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
@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
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
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
// 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
# 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 |
NewerOlder