This file contains hidden or 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
int[][] G = { | |
{1, 4, 7, 11, 15}, | |
{2, 5, 8, 12, 19}, | |
{3, 6, 9, 16, 22}, | |
{10, 13, 14, 17, 24}, | |
{18, 21, 23, 26, 30} | |
}; | |
System.out.println(Arrays2D.contains(G, -1)); |
This file contains hidden or 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 com.trolltech.qt.core.QPoint; | |
import com.trolltech.qt.gui.QApplication; | |
import com.trolltech.qt.gui.QBrush; | |
import com.trolltech.qt.gui.QColor; | |
import com.trolltech.qt.gui.QFont; | |
import com.trolltech.qt.gui.QPaintEvent; | |
import com.trolltech.qt.gui.QPainter; | |
import com.trolltech.qt.gui.QWidget; | |
/** |
This file contains hidden or 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
class TreeBuilder{ | |
public Node buildTree(String[] preOrder, String[] inOrder){ | |
assert(preOrder.length == inOrder.length); | |
if(preOrder.length == 0){ | |
return null; | |
} | |
String rootData = preOrder[0]; | |
Node root = new Node(); | |
root.data = rootData; | |
int rootIndex = Array.<String>search(inOrder, rootData); |
This file contains hidden or 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.lang.Math; | |
public class Complex { | |
protected double re; | |
protected double im; | |
public Complex(double real, double imag) { | |
re = real; | |
im = imag; |
This file contains hidden or 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 edu.emory.mathcs.jtransforms.fft.DoubleFFT_1D; | |
/** | |
* Wrapper class over JTransforms library for fourier transforms. | |
* @author apurv | |
* | |
*/ | |
public class FFT { | |
public static Complex[] fft1D(Complex[] signal){ |
This file contains hidden or 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
➜ ~ vim ~/.netrc |
This file contains hidden or 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
➜ ~ git clone https://code.google.com/p/my-git-dummy-project/ | |
➜ ~ cd my-git-dummy-project | |
➜ ~ echo "README" > README | |
➜ ~ git add . | |
➜ ~ git commit -m "first commit" | |
➜ ~ git push -u origin master |
This file contains hidden or 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
enum Algorithm{ | |
A("a"){ | |
private transient String msg = "I am A returned"; | |
public String f(){ | |
System.out.println("This is algo A"); | |
return msg; | |
} | |
}, | |
B("b"){ |
This file contains hidden or 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
package com.deepu.digitalimage; | |
import java.awt.Color; | |
import java.awt.GraphicsConfiguration; | |
import java.awt.GraphicsDevice; | |
import java.awt.GraphicsEnvironment; | |
import java.awt.Transparency; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; |
This file contains hidden or 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
package wordcount; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Job; | |
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; | |
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; | |
import org.apache.hadoop.util.GenericOptionsParser; |
NewerOlder