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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<style type="text/css"> | |
body{background-color:#ccc} | |
#box{ | |
width:100px; |
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
package com.linkingenius.parser | |
import java.io.File | |
import java.io.FileWriter | |
// Handler to perform write operations in a file | |
case class FileHandler(file: File) { | |
def add(text: String): Unit = { | |
val fw = new FileWriter(file, true) |
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
private static String translateToProteins(String dna) { | |
String result = ""; | |
int idx = dna.indexOf(START_CODON, 0); | |
while (idx < dna.length() && idx != -1) { | |
String dnaChunk = dna.substring(idx, idx + 3); | |
if (dnaChunk.equals(END_CODON_1) || dnaChunk.equals(END_CODON_2) | |
|| dnaChunk.equals(END_CODON_3)) { | |
idx = dna.indexOf(START_CODON, idx); |
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 SpiralMatrix { | |
enum Direction { | |
LEFT_RIGHT, TOP_DOWN, RIGHT_LEFT, BOTTOM_UP | |
}; | |
public static void traverseMatrixInSpiral(char[][] matrix, int initialRow, | |
int finalRow, int initialColumn, int finalColumn, int totalElems, | |
int visited, Direction direction) { | |
System.out.println("Num Elems: " + totalElems + " visited: " + visited); |
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 static boolean containsLoop(LinkedListNode list) { | |
LinkedListNode slowIterator = list, fastIterator = list; | |
// If a loop exists in the list, both iterators will be going round | |
// and round in the loop, and at some point, they will be equal | |
while (slowIterator != null && fastIterator != null) { | |
slowIterator = slowIterator.getNext(); | |
try { | |
fastIterator = fastIterator.getNext().getNext(); | |
} catch (NullPointerException npe) { | |
fastIterator = null; |
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.io.UnsupportedEncodingException; | |
import java.math.BigInteger; | |
import java.nio.charset.Charset; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
public class MainDigester { | |
public enum Digester { | |
SHA512("SHA-512"), |
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
sort -nr -t$'\t' -k<column> <file> | column -ts $'\t' |
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
#!/bin/sh | |
git filter-branch --commit-filter ' | |
if [ "$GIT_COMMITTER_NAME" = "Francisco Perez-Sorrosal" ]; | |
then | |
GIT_COMMITTER_NAME="Francisco Perez-Sorrosal"; | |
GIT_AUTHOR_NAME="Francisco Perez-Sorrosal"; | |
GIT_COMMITTER_EMAIL="fperezsorrosal@gmail.com"; | |
GIT_AUTHOR_EMAIL="fperezsorrosal@gmail.com"; | |
git commit-tree "$@"; |
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
# Generate dep graph in maven | |
mvn org.fusesource.mvnplugins:maven-graph-plugin:reactor -Dhide-external=true |
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
# Local-Remote synchronization of directories/files | |
# NOTE: Deletions are NOT considered yet. | |
# Usage | |
# ----- | |
# Local-remote sync: | |
# make -f Makefile.rsync lrsync SERVER=my_host PROJECT=project_name LOCAL_BASEDIR=/Users/my_name/dev REMOTE_BASEDIR=/home/my_name/dev | |
# | |
# Remote-local sync: | |
# make -f Makefile.rsync rlsync SERVER=my_host PROJECT=project_name LOCAL_BASEDIR=/Users/my_name/dev REMOTE_BASEDIR=/home/my_name/dev |
OlderNewer