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
// merge calls itself recursively | |
def merge(l1: List[Int], l2: List[Int]): List[Int] = { | |
// termination cases | |
(l1, l2) match { | |
case (Nil, Nil) => Nil | |
case (x, Nil) => x | |
case (Nil, y) => y | |
case (_, _) => l1.head.compare(l2.head) match { | |
case -1 => l1.head :: merge(l1.tail, l2) | |
case _ => l2.head :: merge(l2.tail, l1) |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import csv | |
import datetime | |
import re | |
def qtr(word): | |
word = re.sub('^|$','"', word) | |
return word |
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
ls 808\ \(* | while read file; do mv "$file" `echo $file | sed 's/[()]//g' | sed 's/ /_/'` ; done |
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
#!/usr/bin/env ruby | |
@rg = [0,0,0,0] | |
@i = 0 | |
def adder () | |
while @i < 2 ** @rg.length | |
puts "#{@rg}" | |
def add(position) |
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
int[] colors = new int[3]; | |
// int numColors = int(pow(2, colors.length)); | |
void setup() { | |
size(1000, 240); | |
background(255); | |
} | |
void draw() { | |
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
#!/usr/bin/perl -w | |
use strict; | |
my @urlies; | |
my $URLs = "URLS.txt"; | |
open(my $ufh, "<", $URLs) or die "canne open $URLs!\n"; | |
my $IDs = "artIdz"; | |
open(my $ifh, "<", $IDs) or die "DIED!\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
#!/usr/bin/perl -w | |
use strict; | |
my $URL = "http://prodapi.openaura.com/info/artists/__ARTID__?id_type=oa%3Aartist_id&api_key=special-key"; | |
my $IDs = "artIdzz"; | |
open(my $ifh, "<", $IDs) or die "DIED!\n"; | |
my $NEWURLS = "URLS_4_BENCH.txt"; | |
open(my $ofh, ">", $NEWURLS) or die "DIED!"; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct freaky { | |
int num_freaks; | |
int *freaks; | |
} freaky; | |
freaky* new_freqs_from_string(char* string) |
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.example.testSingleton; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class ActivityA extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
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 bignumz[16]; | |
int conv_bitz(int num) | |
{ | |
for ( int i = 0 ; i < 16; i++) { | |
//printf("Comparing %d with %d\n", num, ( 1 << i)); | |
//printf("AND is %d\n", num & ( 1 << i)); | |
if ( (num & ( 1 << i )) == num ) { |