This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(dt) { | |
return [dt.getHours(), dt.getMinutes(), dt.getSeconds()].map(function(n) { | |
return n < 10 ? '0' + n : n | |
}).join(':'); | |
})(new Date()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import factorial as fact | |
def comb(seq, r): | |
n = len(seq) | |
total = fact(n) / (fact(r) * fact(n-r)) | |
pos = range(r) | |
c= [] | |
i = 0 | |
while i < total: | |
c.append(map(lambda x: seq[x], pos)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import factorial as fact | |
def comb(seq, r): | |
n = len(seq) | |
total = fact(n) / (fact(r) * fact(n-r)) | |
pos = range(r) | |
#c= [] | |
i = 0 | |
while i < total: | |
#c.append(map(lambda x: seq[x], pos)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
public class Combinations<T> implements Iterable<ArrayList<T>> { | |
private int totalCombinations; | |
private int n, r; | |
private int factorial(int n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 | |
7747 7747 | |
10247 10247 | |
12747 12747 | |
15247 15247 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocalClassSample { | |
public static void main(String[] args) { | |
class Utils { | |
public void printHello(String name) { | |
System.out.println("Hello " + name); | |
} | |
} | |
Utils util = new Utils(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following files were submitted: | |
---------------------------------- | |
total 24K | |
-rw-r--r-- 1 5.5K Mar 19 20:03 Brute.java | |
-rw-r--r-- 1 5.7K Mar 19 20:03 Fast.java | |
-rw-r--r-- 1 2.7K Mar 19 20:03 Point.java | |
-rw-r--r-- 1 4.0K Mar 19 20:03 studentSubmission.zip | |
****************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RawSmtp Information: 0 : ---Session Started @ 11:59:52 AM | |
RawSmtp Information: 0 : << 220 BLREQX343539D Service ready | |
RawSmtp Information: 0 : >> EHLO BLREQX343539D | |
RawSmtp Information: 0 : << 500 Syntax error, command unrecognized | |
RawSmtp Information: 0 : >> HELO BLREQX343539D | |
RawSmtp Information: 0 : << 250 127.0.0.1 | |
RawSmtp Information: 0 : >> MAIL FROM:<arun_jayapal@infosys.com> | |
RawSmtp Information: 0 : << 250 OK | |
RawSmtp Information: 0 : >> RCPT TO:<deostroll@hotmail.com> | |
RawSmtp Information: 0 : << 250 OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool listen = true; | |
TcpListener listener = GetListener(); | |
listener.Start(); | |
while(listen) | |
{ | |
if(!listener.Pending()) | |
{ | |
Thread.Sleep(500); //why?! and why only 500 | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Comparator; | |
public class KdTree { | |
private final static boolean HORIZONTAL = true; | |
private final static boolean VERTICAL = false; | |
private Node root; | |
private int size; |
OlderNewer