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
This is my first gist. |
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
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
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
#----------------------------------------------------------------------------------------------- | |
# Check for number of arguments, Initialize them. | |
#----------------------------------------------------------------------------------------------- | |
[[ -n $1 && -n $2 && -n $3 && -n $4 && -n $5 && -n $6 ]] || { echo "Invalid input.Check the usage.." >&2; usage; exit 1; } | |
# debecho (debug-echo), by Stefano Falsetto ### | |
# Will echo passed parameters only if DEBUG is set to a value. ### | |
debecho () { | |
if [ ! -z "$DEBUG" ]; then |
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
# To get the current directory. | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
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 readFile() throws IOException { | |
FileInputStream stream = new FileInputStream(new File("String.txt")); | |
try { | |
FileChannel fc = stream.getChannel(); | |
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); | |
/* Instead of using default, pass in a decoder. */ | |
return Charset.defaultCharset().decode(bb).toString(); | |
} | |
finally { | |
stream.close(); |
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 String getThreadStatus() | |
{ | |
StringBuffer buf = new StringBuffer(); | |
Thread[] daemonThreads = getAllDaemonThreads(); | |
for (Thread thread : daemonThreads) { | |
if (thread.getName().contains("Solrj")) { | |
buf.append(thread.getName() + "--" + thread + "\n"); | |
} | |
} | |
return buf.toString(); |
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 String formatIntoHHMMSS(long secondsInput) | |
{ | |
int hours = (int) (secondsInput / 3600), remainder = (int) (secondsInput % 3600), minutes = remainder / 60, seconds = | |
remainder % 60; | |
return ((hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" | |
+ (seconds < 10 ? "0" : "") + seconds); | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
CmdUtils.executeCommand("SMILExtract -C /media/MEDIA02/msthesis/emobase2010.conf -I example_audio1.wav -O targetFile.arff -label1 ); | |
public static String executeCommand(String command) { | |
StringBuffer output = new StringBuffer(); | |
Process p; | |
try { | |
p = Runtime.getRuntime().exec(command); | |
p.waitFor(); |
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
#include <stdio.h> | |
int main() | |
{ | |
int i, x, y, sizeX, sizeY, width, height, count, c; | |
/* All five shape types */ | |
const int features = 5; | |
const int feature[][2] = {{2,1}, {1,2}, {3,1}, {1,3}, {2,2}}; | |
const int frameSize = 24; |
OlderNewer