This file contains hidden or 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
| curl -H "Accept: application/sparql-results+xml" "http://localhost:8000/sparql/" --data-urlencode "query=SELECT ?s ?p ?o { ?s ?p ?o . }" |
This file contains hidden or 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> | |
| <body> | |
| <form action="prime_birthday.php" method="post"> | |
| Day: <input type="text" name="day" /> | |
| Month: <input type="text" name="mon" /> | |
| Year: <input type="text" name="year" /> | |
| <input type="submit" /> | |
| </form> |
This file contains hidden or 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
| ## An attempt to query the data here: http://en.wikipedia.org/wiki/Comparison_of_Internet_Relay_Chat_clients | |
| ## via http://dbpedia.org/spraql to determine which IRC clients for Windows are GPL licensed | |
| prefix dbo: <http://dbpedia.org/ontology/> | |
| prefix dbpprop: <http://dbpedia.org/property/> | |
| prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| prefix yago: <http://dbpedia.org/class/yago/> | |
| select distinct ?client ?label ?license ?os |
This file contains hidden or 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 argc, char **argv) { | |
| FILE *fp; | |
| char mc ; | |
| fp = fopen(argv[1],"r") ; | |
| printf("Reading contents of file\n"); | |
| while((mc = (char) fgetc (fp)) != EOF) { |
This file contains hidden or 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/zsh | |
| # Global virtualenvwrapper postactivate, lives in $WORKON_HOME/postactivate | |
| # Remove virtual env from start of PS1 as it's in RPROMPT instead | |
| PS1="$_OLD_VIRTUAL_PS1" | |
| PROJECT_DIR="$HOME/projects/$(basename $VIRTUAL_ENV)" | |
| if [ -d $PROJECT_DIR ]; then | |
| # If we aren't already within the project dir, cd into it |
This file contains hidden or 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 MnemonicsCoder(words: List[String]) { | |
| private val mnemonics = Map('2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", | |
| '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") | |
| /** Invert the mnemonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */ | |
| private val charCode: Map[Char, Char] = | |
| for ((digit, str) <- mnemonics; letter <- str) yield (letter -> digit) | |
| /** Maps a word to the digit string it can represent */ |
This file contains hidden or 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 'rubygems' | |
| require 'nokogiri' | |
| m = {} | |
| f = {} | |
| open("dist.male.first").readlines.each { |l| | |
| d = l.split(/ +/) | |
| m[d[0].downcase] = d[1].to_f | |
| } | |
| open("dist.female.first").readlines.each { |l| |
This file contains hidden or 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 | |
| # <UDF name="ssh_key" Label="Paste in your public SSH key" default="" example="" optional="false" /> | |
| # root ssh keys | |
| mkdir /root/.ssh | |
| echo $SSH_KEY >> /root/.ssh/authorized_keys | |
| chmod 0700 /root/.ssh | |
| # update to latest |
This file contains hidden or 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
| # How to select *everything* in a triplestore containing several different named graphs | |
| SELECT * { { ?s ?p ?o . } UNION { GRAPH ?g { ?s ?p ?o } } } |
This file contains hidden or 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
| /* | |
| #myrandomnumber Tutorial | |
| [email protected] | |
| April, 2010 | |
| */ | |
| //This is the Google spreadsheet manager and the id of the spreadsheet that we want to populate, along with our Google username & password | |
| SimpleSpreadsheetManager sm; |