This is a simple script to run a Java program from Linux shell in the background - so that the process does not terminates when you log out of the shell.
Usage is simple:
- Start the process
$ ./java-app-run.sh start
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
v8 "rogchap.com/v8go" | |
) | |
func main() { |
package main | |
import ( | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"time" | |
stdruntime "runtime" |
This is a simple script to run a Java program from Linux shell in the background - so that the process does not terminates when you log out of the shell.
Usage is simple:
$ ./java-app-run.sh start
public class StringJoinBenchmark { | |
public static void main(String[] args) { | |
final int MAX_ITER = 1000 * 1000; | |
final int RUNS = 1; | |
long delta = 0; | |
long delta2 = 0; | |
for(int run = 0; run < RUNS; run++) { |
#!/usr/bin/env python | |
import http.server | |
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_my_headers() | |
http.server.SimpleHTTPRequestHandler.end_headers(self) | |
def send_my_headers(self): | |
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate") |
The way Internet works is that we first type a domain name in browser: say google.com. The browser then hits the DNS servers for resolution of IP address, so that the browser know which machine to send the request to. The DNS servers return an IP (v4 or v6) against google.com and that IP is then used for all requests going forth. There is a TTL (time to live) associated with every DNS resolution after which the browser is required to re-ask the DNS servers for the new IP again (in case it has changed - this is meant to make sure that in case the machines fail or IPs change - the website can again be reached after the TTL is expired.
Now there are multiple types of DNS records:
Called as Address mapping records - these are used to map a domain/subdomain to a given IP - say,
package com.sangupta.jerry.ds.bitarray; | |
import java.io.IOException; | |
import com.sangupta.jerry.util.BitUtils; | |
import com.sangupta.jerry.util.ByteArrayUtils; | |
import net.jcip.annotations.NotThreadSafe; | |
@NotThreadSafe |
var webpage = require('webpage'); | |
var page = webpage.create(); | |
page.viewportSize = { width: 1600, height: 900 }; | |
page.open('http://sangupta.com/poetry/best-of-luck.html', function() { | |
// execute the selector | |
var ev = page.evaluate(function(sel) { | |
var ele = document.querySelector(sel); | |
if(ele) { | |
ele.style.border = "2px solid red"; |
/** | |
Problem: Given a set of data ranges (i.e. 2-7, 5-9, 10-20), write a function to determine if there is any overlap within the set. | |
Write test cases. Which data structure would be best to represent the intervals. | |
Solution: I would prefer to use an array of size 2N and then iterate over it. Another | |
way is to work up using interval tree's but I think that may be an overkill considering | |
it used to check overlaps in multiple ranges and points. | |
*/ |
/** | |
Add the following lines to the original class: | |
org.eclipse.egit.github.core.RepositoryCommit.java | |
*/ | |
private Stats stats; | |
private List<CommitFile> files; | |
public Stats getStats() { |