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
# Now get our other source ids (text ids). Assume these text id's are in order. | |
tids.uniq.each do |tid| | |
sent = exec "SELECT wordid,nextwordid FROM chains WHERE textid=$1", tid[1] | |
sent.flatten!.uniq!.map! { |c| c = c.to_i } | |
sent.delete sent[-1] | |
frags << sent | |
end | |
Retrieve sour |
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
// ajax get the upvote click | |
jQuery( document.getElementsByClassName( "up_count" ) ).bind( 'click', function( event ){ | |
jQuery( '#vmp_message' ).empty(); | |
jQuery.ajax( { | |
url:ajax_object.ajax_url, | |
method:'get', | |
dataType:'json', | |
data:{ | |
action:'count_vote_090813', |
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
CREATE OR REPLACE FUNCTION somefuncname() RETURNS int LANGUAGE plpgsql AS $$ | |
DECLARE | |
tmp int; | |
BEGIN | |
CREATE TEMP TABLE res AS SELECT id, SUM(count) OVER (ORDER BY id DESC) AS cum_sum FROM chains WHERE wid=## GROUP BY id ORDER BY cum_sum DESC; | |
tmp := FLOOR(random()*( SELECT max(cum_sum) FROM res LIMIT 1 )); | |
RETURN (SELECT cum_sum FROM res WHERE cum_sum > tmp ORDER BY cum_sum ASC LIMIT 1 ); | |
END |
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 'awesome_print' | |
matchstr = /[[:punct:]]|[[:space:]]|[^[:ascii:]]/ | |
class String | |
def palindrome? | |
self == self.reverse | |
end | |
end | |
class Array |
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
@echo off | |
REM Billy Rhoades | |
REM 8/3/15 | |
REM Backup script meant for rotations. Please change the variable gamename and run this with the windows scheduling program. | |
REM This file manually looks for the SavedGames folder in its current directory--- this will fail for anything except lego harry potter. | |
REM Enables md (mkdir -p equivalent) | |
setlocal enableextensions |
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 <iostream> | |
#include <string.h> | |
#include <stdio.h> | |
#include <cstdlib> | |
#define NUMBER_OF_OPTIONS 3 | |
#define NUMBER_OF_ARGS NUMBER_OF_OPTIONS*2 | |
using namespace std; |
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
class MyHash | |
def initialize | |
@keys = [] | |
@values = [] | |
end | |
def [] index | |
@keys.each_with_index do |v, i| | |
if index =~ v | |
return @values[i] |
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
rm -rf repacked unpacked | |
mkdir repacked &> /dev/null | |
mkdir -p unpacked &> /dev/null | |
for f in $(ls *.gz) | |
do | |
newfn=$(echo $f | perl -ne "print /(.+).tar.gz/") | |
#newdir=$(pwd)/unpacked/$newfn | |
#mkdir -p $newdir &> /dev/null | |
tar xvf $f -C unpacked |
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
✘ br046823@M1600801 ~/.nonwork/grader upstream/fb-inspect-hotfix ± cat assignments/hw1/gradesheet/Dockerfile | |
FROM ubuntu | |
MAINTAINER Kimbro Staken | |
RUN apt-get install -y software-properties-common python | |
RUN add-apt-repository ppa:chris-lea/node.js | |
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y nodejs | |
#RUN apt-get install -y nodejs=0.6.12~dfsg1-1ubuntu1 |
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 | |
# Builds example submissions / assignment.yml for use with: | |
# grader import --kind multiple | |
if [ -z "$1" ]; then | |
echo "./build-test-assignments.sh [number of assignments]" | |
echo " Builds mock assignments for local testing." | |
exit 0 | |
fi |
OlderNewer