Skip to content

Instantly share code, notes, and snippets.

View vishnu-saini's full-sized avatar

Vishnu Saini vishnu-saini

View GitHub Profile
  1. The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. Function.prototype.bind()
    var module = {
      x: 42,
      getX: function() {
        return this.x;
      }
    }
    

To Fill up the timesheet

$("select option[value='357815']").attr("selected", "selected");
$( "#content-ts tr td select" ).trigger( "change" );
$("select option[value='159087']").attr("selected", "selected");
$("#content-ts tr td:nth-child(12) input").attr("value","09");

Note : Here 357815 is project id which is 'struts upgrade' and 159087 is task id which is 'developement'

@vishnu-saini
vishnu-saini / Sorting Algorithms.md
Last active July 31, 2018 10:01
Data Structures and Algorithms

Java Sorting Algorithms

A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms such as search and merge algorithms, which require input data to be in sorted lists; it is also often useful for canonicalizing data and for producing human-readable output.

Java Sorting Algorithms Examples

  1. bubble sort in java
  2. selection sort in java
  3. insertion sort in java
  4. quick sort in java

Java 8 provides features

  1. Lambda expressions,
  2. Method references,
  3. Functional interfaces,
  4. Stream API,
  5. Default methods,
  6. Base64 Encode Decode,
  7. Static methods in interface,
  8. Optional class,
  1. To check the avilable memory

    df -h 
    

    -h is human readable

  2. current directory

    pwd
    

CSS Important Properties

CSS Colors

  • Color Names
  • RGB
  • HEX
  • HSL
  • RGBA
  • HSLA values

1. Color Names

HTML5

What is New in HTML5

The DOCTYPE declaration for HTML5 is very simple:

<!DOCTYPE html> 

The character encoding (charset) declaration is also very simple:

<meta charset="UTF-8">

Threads

Have you ever watched a movie with a group of friends, laughing, shouting, and sharing popcorn, nachos, or fries—all at the same time? If yes, you’ve already practiced multithreading and concurrency.

“Every problem has a solution, and every solution has a problem”—this statement holds true for threads. Threads were created so that they could make the best use of a processor’s time. An application can create multiple threads. When threads share objects among themselves, it can result in interleaving operations (thread interference)

When port is not free (8080 or other)

  You can use "netstat" to check whether a port is available or not.
  ```
  netstat -ano | findstr 8080
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       6696
  TCP    [::]:8080              [::]:0                 LISTENING       6696
  ```
  then kill the process with