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 'sparql/client' | |
sparql = SPARQL::Client.new("http://dbpedia.org/sparql") | |
sparql.query("SELECT ?album WHERE { ?album dbp:type 'album'@en ; dbo:artist dbr:The_Beatles . }") | |
# SELECT * WHERE { ?s ?p ?o } OFFSET 100 LIMIT 10 | |
# query = sparql.select.where([:s, :p, :o]).offset(100).limit(10) | |
# query.each_solution { |solution| puts solution.inspect } | |
2.2.4 :055 > query = sparql.select(:album).where([:album, 'dbp:type "album"@en ;', 'dbo:artist dbr:The_Beatles']) | |
=> #<SPARQL::Client::Query:0x3ff07ce42bd4(SELECT ?album WHERE { ?album dbp:type "album"@en ; "dbo:artist dbr:The_Beatles" . })> |
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
# a port of | |
# archive.org/stream/Gortek_and_the_Microchips_1984_Commodore#page/n35/mode/1up | |
# along with help from | |
# patshaughnessy.net/2012/2/29/the-joke-is-on-us-how-ruby-1-9-supports-the-goto-statement | |
__label__(:wrong) | |
puts "WHAT IS THIS WORD -- SIBAC" | |
input = gets.chomp | |
__goto__(:right) if input == "BASIC" | |
__goto__(:wrong) | |
__label__(:right) |
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 'colorize' | |
periodic_table = %w[H He Li Be B C N O F Ne Na Mg Al Si P | |
S Cl Ar K Ca Sc Ti V Cr Mn Fe Co Ni Cu | |
Zn Ga Ge As Se Br Kr Rb Sr Y Zr Nb Mo | |
Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe Cs | |
Ba Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb | |
Bi Po At Rn Fr Ra Lr Rf Db Sg Bh Hs Mt | |
Ds Rg Cn Uut Fl Uup Lv Uus Uuo La Ce Pr | |
Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Ac Th |
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
if has("statusline") | |
set statusline=%<%f\ %y\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P | |
endif | |
set fileencodings=ucs-bom,utf-8,sjis,euc-jp,default,latin1 |