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.Arrays; | |
public class MergeSort { | |
public static int[] sort(int[] input) { | |
int len = input.length; | |
int mid = (len) / 2; | |
if (len <=1) | |
return input; |
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/bash | |
# Called by Java.sublime-build | |
# Located in /usr/bin | |
# $1 := $file_path | |
# $2 := $file | |
# $3 := $file_base_name | |
# Runs .class files on a XTerm window |
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.Arrays; | |
public class subsetGenerator{ | |
public static void main(String []args){ | |
int[] input = {0, 1, 2, 3, 4}; | |
int[][] subsets = subsetGenerator(input); | |
for (int[] subset : subsets) { | |
System.out.println(Arrays.toString(subset)); | |
} |
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 | |
# My OSX Setup for Yosemite | |
# | |
# Source: https://gist.github.com/emrehan/53d8a9668ae616b03b55 | |
# Ask for the administrator password upfront | |
sudo -v | |
############################################################################### |
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 <string.h> | |
char u[3][3]; | |
char l[3][3]; | |
char f[3][3]; | |
char r[3][3]; | |
char b[3][3]; | |
char d[3][3]; | |
char temp[3]; |
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
# $t0 = the first char address of the string | |
# $t1 = the last char address of the string | |
# $t2 = left iterator | |
# $t3 = right iterator | |
# $t4 = left iterator char | |
# $t5 = right iterator char | |
# $t7 = the character address to be omitted | |
# | |
# Emrehan Tüzü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
durations = ['16:51', '21:00', '20:52', '13:46', '6:09', '12:01', '13:39', '9:04', '8:28', '11:58', '6:27', '6:15', '7:09', '16:11', '14:16', '13:20', '9:42'] | |
mins = 0 | |
secs = 0 | |
for duration in durations: | |
mins += int(duration.rsplit(':', 1)[0]) | |
secs += int(duration.rsplit(':', 1)[1]) | |
mins += secs / 60 | |
secs = secs % 60 |
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
(require '[sparkling.conf :as conf]) | |
(require '[sparkling.core :as sparkling]) | |
(require '[sparkling.destructuring :as destructuring]) | |
(import '[org.apache.spark.mllib.linalg.distributed RowMatrix]) | |
(import '[org.apache.spark.mllib.linalg Vectors]) | |
(import '[org.apache.spark HashPartitioner]) | |
(def spark-config (-> (conf/spark-conf) | |
(conf/master "local") | |
(conf/app-name "item similarities"))) |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "0.0.5", | |
"title": "Spock", | |
"description": "Spock gives sparkling recommendations to Kirk", | |
"contact": { | |
"name": "SuggestGrid Inc." | |
} | |
}, |
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/awk -f | |
BEGIN { printf "{\"items\": [\n" } | |
{ | |
FS=","; | |
if(NR>2) printf ", \n" | |
if(NR>1) printf " { \"id\": \"%s\", \"imdb_id\": \"tt%s\"}", $1, $2 | |
} | |
END { printf "\n]}\n" } |
OlderNewer