Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sherin_Mathew

@Sherin_Mathew
About
Posts
13
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to pass a value from Java Applet code to HTML page
    S Sherin_Mathew

    The sample HTML file The listing below shows the source code for the sample HTML file we created for this article, including the applet tag shown.We name this file AppletParameterTest.html.

    Java applet example - Passing applet parameters to Java applets

    The ParamTest.java file So far we've seen to create the HTML code that (1) invokes a Java applet using an applet tag, and (2) passes parameters to the applet. Next, let's look at the Java applet code needed to read the parameters being passed to it. The next listing shows the Java code for the ParamTest.java file.

    import java.applet.*;
    import java.awt.*;

    public class AppletParameterTest extends Applet {

    public void paint(Graphics g) {

      String myFont   = getParameter("font");
      String myString = getParameter("string");
      int mySize      = Integer.parseInt(getParameter("size"));
    
      Font f = new Font(myFont, Font.BOLD, mySize);
      g.setFont(f);
      g.setColor(Color.red);
      g.drawString(myString, 20, 20);
    

    }
    }

    Java java javascript html graphics help

  • difference between api and web services
    S Sherin_Mathew

    API API is the acronym for Application Programming Interface. It is a software interface that allows two applications to interact with each other without any user intervention. APIs provides product or service to communicate with other products and services without having to know how they're implemented. Web Service A Web service is a collection of open protocols and standards which are widely used for exchanging data between systems or applications. Software applications are written using various programming languages and running on multiple platforms. It allows you to use web services to exchange data over computer networks.

    .NET (Core and Framework) wcf json

  • difference between api and web services
    S Sherin_Mathew

    API API is the acronym for Application Programming Interface. It is a software interface that allows two applications to interact with each other without any user intervention. APIs provides product or service to communicate with other products and services without having to know how they're implemented. Web Service A Web service is a collection of open protocols and standards which are widely used for exchanging data between systems or applications. Software applications are written using various programming languages and running on multiple platforms. It allows you to use web services to exchange data over computer networks.

    .NET (Core and Framework) wcf json

  • difference between api and web services
    S Sherin_Mathew

    API API is the acronym for Application Programming Interface. It is a software interface that allows two applications to interact with each other without any user intervention. APIs provides product or service to communicate with other products and services without having to know how they're implemented. Web Service A Web service is a collection of open protocols and standards which are widely used for exchanging data between systems or applications. Software applications are written using various programming languages and running on multiple platforms. It allows you to use web services to exchange data over computer networks.

    .NET (Core and Framework) wcf json

  • difference between api and web services
    S Sherin_Mathew

    API API is the acronym for Application Programming Interface. It is a software interface that allows two applications to interact with each other without any user intervention. APIs provides product or service to communicate with other products and services without having to know how they're implemented. Web Service A Web service is a collection of open protocols and standards which are widely used for exchanging data between systems or applications. Software applications are written using various programming languages and running on multiple platforms. It allows you to use web services to exchange data over computer networks.

    .NET (Core and Framework) wcf json

  • what is tuple in mvc
    S Sherin_Mathew

    So Tuple is a good thing. It is very useful in scenarios where you need to return multiple values from a method but do not intend to create a dedicated DTO for that sole purpose. It is not of structure type either which means it is passed by reference. I created 2 methods in my controller for testing Tuple - one for Get and other for Post.

    [HttpGet]
    public ActionResult TestTuple()
    {
    Tuple t = new Tuple("test", 123);
    return View(t);
    }

        \[HttpPost\]
        public ActionResult TestTuple(Tuple tuple)
        {
            return new EmptyResult();
        }
    

    The view part is straightforward:

    @model Tuple
    @{
    ViewBag.Title = "TestTuple";
    }

    @Html.BeginForm("TestTuple", "Home", FormMethod.Post){

    @Html.EditorFor(m => m);  
    
    input type="submit" value="Test Tuple"/
    

    }

    .NET (Core and Framework) question asp-net architecture

  • How do you pause an animation?
    S Sherin_Mathew

    Try This Code:

    div {
    width: 100px;
    height: 100px;
    background: blue;
    position: relative;
    animation: mymove 3s infinite;
    animation-play-state: paused;
    }

    @keyframes mymove {
    from {left: 0px;}
    to {left: 400px;}
    }

    Click the buttons to Play/Pause the animation:

    Play
    Pause

    function myPlayFunction() {
    document.getElementById("myDIV").style.animationPlayState = "running";
    }

    function myPauseFunction() {
    document.getElementById("myDIV").style.animationPlayState = "paused";
    }

    JavaScript help question

  • How to use setters and getters.
    S Sherin_Mathew

    In Java, getter and setter are two conventional methods that are used for retrieving and updating value of a variable. The following code is an example of simple class with a private variable and a couple of getter/setter methods:

    public class SimpleGetterAndSetter {
    private int number;

    public int getNumber() {
        return this.number;
    }
    
    public void setNumber(int num) {
        this.number = num;
    }
    

    }

    The class declares a private variable, number. Since number is private, code from outside this class cannot access the variable directly, like this:

    SimpleGetterAndSetter obj = new SimpleGetterAndSetter();
    obj.number = 10; // compile error, since number is private
    int num = obj.number; // same as above

    Instead, the outside code have to invoke the getter, getNumber() and the setter, setNumber() in order to read or update the variable, for example:

    SimpleGetterAndSetter obj = new SimpleGetterAndSetter();
    obj.setNumber(10);
    int num = obj.getNumber();

    So, a setter is a method that updates value of a variable. And a getter is a method that reads value of a variable.

    Java sales tutorial help question learning

  • How do I choose DIV based contents in a page with a dropdown list
    S Sherin_Mathew

    jQuery Show Hide Elements Using Select Box
    .box{
    color: #fff;
    padding: 20px;
    display: none;
    margin-top: 20px;
    }
    .red{ background: #ff0000; }
    .green{ background: #228B22; }
    .blue{ background: #0000ff; }
    $(document).ready(function(){
    $("select").change(function(){
    $(this).find("option:selected").each(function(){
    var optionValue = $(this).attr("value");
    if(optionValue){
    $(".box").not("." + optionValue).hide();
    $("." + optionValue).show();
    } else{
    $(".box").hide();
    }
    });
    }).change();
    });

        Choose Color
            Red
            Green
            Blue
    

    You have selected red option so i am here

    You have selected green option so i am here

    You have selected blue option so i am here

    JavaScript database question

  • What is difference between web api post and put
    S Sherin_Mathew

    PUT

    • RFC-2616 clearly mention that PUT method requests for the enclosed entity be stored under the
      supplied Request-URI. If the Request-URI refers to an already existing resource – an update operation
      will happen, otherwise create operation should happen if Request-URI is a valid resource URI.
      PUT /questions/{question-id}
    • PUT method is idempotent. So if you send retry a request multiple times, that should be equivalent to
      single request modification.
    • Use PUT when you want to modify a singular resource which is already a part of resources collection.
      PUT replaces the resource in its entirety. Use PATCH if request updates part of the resource.
    • Generally, in practice, always use PUT for UPDATE operations.

    POST

    • The POST method is used to request that the origin server accept the entity enclosed in the request
      as a new subordinate of the resource identified by the Request-URI in the Request-Line. It
      essentially means that POST request-URI should be of a collection URI. POST /questions
    • POST is NOT idempotent. So if you retry the request N times, you will end up having N resources with
      N different URIs created on server.
    • Use POST when you want to add a child resource under resources collection.
    • Always use POST for CREATE operations.
    ASP.NET json tutorial question

  • What's the difference between "prototype" and "__proto__"?
    S Sherin_Mathew

    __proto__ - __proto__ is the actual object that is used in the lookup chain to resolve methods. - It is a property that all objects have. This is the property which is used by the JavaScript engine for inheritance. - According to ECMA specifications it is supposed to be an internal property, however most vendors allow it to be accessed and modified. Syntax

    var Circle = function () {};
    var shape = {};
    var circle = new Circle();

    // Set the object prototype.
    // DEPRECATED.This is for example purposes only. DO NOT DO THIS in real code.
    shape.__proto__ = circle;

    // Get the object prototype
    console.log(shape.__proto__ === circle); // true

    prototype - prototype is a property belonging only to functions. - It is used to build __proto__ when the function happens to be used as a constructor with the new keyword. - In prototype-based object oriented languages like Self and Javascript, every object in the system has a field that says "if I don't have a property or method that is requested of me, go to the object that this field references my prototype and look for it". - Since that object will also have this "prototype" field as well, this becomes a recursive process. - It is what is meant by a prototype chain. - Note that this means that in a prototype language, there is no abstract concept of a "class" Syntax

    var shape = function () {};
    var p = {
    a: function () {
    console.log('aaa');
    }
    };
    shape.prototype.__proto__ = p;

    var circle = new shape();
    circle.a(); // aaa
    console.log(shape.prototype === circle.__proto__); // true

    // or
    var shape = function () {};
    var p = {
    a: function () {
    console.log('a');
    }
    };

    var circle = new shape();
    circle.__proto__ = p;
    circle.a(); // a
    console.log(shape.prototype === circle.__proto__); // false

    // or
    function test() {};
    test.prototype.myname = function () {
    console.log('myname');
    };

    var a = new test();
    console.log(a.__proto__ === test.prototype); // true
    a.myname(); // myname

    // or
    var fn = function () {};
    fn.prototype.myname = function () {
    console.log('myname');
    };

    var obj = {
    __proto__: fn.prototype
    };

    obj.myname(); // myname

    JavaScript javascript question

  • How to establish connection between JAVA & MS SQL Server ?
    S Sherin_Mathew

    Step 1: Connect Use the connection class to connect to SQL Database.

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;

    public class SQLDatabaseConnection {
    // Connect to your database.
    // Replace server name, username, and password with your credentials
    public static void main(String[] args) {
    String connectionUrl =
    "jdbc:sqlserver://yourserver.database.windows.net:1433;"
    + "database=AdventureWorks;"
    + "user=yourusername@yourserver;"
    + "password=yourpassword;"
    + "encrypt=true;"
    + "trustServerCertificate=false;"
    + "loginTimeout=30;";

        try (Connection connection = DriverManager.getConnection(connectionUrl);) {
            // Code here.
        }
        // Handle any errors that may have occurred.
        catch (SQLException e) {
            e.printStackTrace();
        }
    }
    

    }

    Step 2: Execute a query

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;

    public class SQLDatabaseConnection {

    // Connect to your database.
    // Replace server name, username, and password with your credentials
    public static void main(String\[\] args) {
        String connectionUrl =
                "jdbc:sqlserver://yourserver.database.windows.net:1433;"
                + "database=AdventureWorks;"
                + "user=yourusername@yourserver;"
                + "password=yourpassword;"
                + "encrypt=true;"
                + "trustServerCertificate=false;"
                + "loginTimeout=30;";
    
        ResultSet resultSet = null;
    
        try (Connection connection = DriverManager.getConnection(connectionUrl);
                Statement statement = connection.createStatement();) {
    
            // Create and execute a SELECT SQL statement.
            String selectSql = "SELECT TOP 10 Title, FirstName, LastName from SalesLT.Customer";
            resultSet = statement.executeQuery(selectSql);
    
            // Print results from select statement
            while (resultSet.next()) {
                System.out.println(resultSet.getString(2) + " " + resultSet.getString(3));
            }
        }
        catch (SQLException e) {
            e.printStackTrace();
        }
    
    Java database java sql-server com sysadmin

  • difference between interface and abstract class in c#
    S Sherin_Mathew

    1)ABSTRACT CLASS -It contains both declaration and definition part. -Multiple inheritance is not achieved by abstract class. -It contain constructor. -It can contain static members. -A class can only use one abstract class. -It can be fully, partially or not implemented. -An abstract class can have non-abstract methods. 2)INTERFACE -It contains only a declaration part. -Multiple inheritance is achieved by interface. -It does not contain constructor. -It does not contain static members. -A class can use multiple interface. -It should be fully implemented. -Interface has only abstract methods.

    .NET (Core and Framework) csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups