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 D3 { | |
import scala.scalajs.js | |
import js.annotation._ | |
import org.scalajs.dom._ | |
import js._ | |
trait Selectors extends js.Object { | |
def select(selector: js.String): Selection = ??? | |
def select(element: EventTarget): Selection = ??? |
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
--- src/main/scala/D3/d3.scala 2014-07-03 13:59:52.000000000 -0700 | |
+++ ../scala-js-ts-importer/d3.original.scala 2014-07-03 14:34:04.000000000 -0700 | |
@@ -1,11 +1,10 @@ | |
- | |
-package D3 { | |
- | |
import scala.scalajs.js | |
import js.annotation._ | |
-import org.scalajs.dom._ |
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
import scala.scalajs.js | |
import js.annotation._ | |
package importedjs { | |
package D3 { | |
trait Selectors extends js.Object { | |
def select(selector: js.String): Selection = ??? |
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
main = lift scene state | |
state = foldp step initial (fps 60) | |
initial = State 0 -70 100 8 0 | |
data State = State Float Float Float Float Float | |
scene (State t x y vx vy) = collage 400 400 [box, ball x y] |
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
import Mouse | |
main = lift scene v | |
scene : Float -> Element | |
scene v = collage 600 600 (objs v ++ [ | |
toForm <| plainText (show v)]) | |
objs : Float -> [Form] | |
objs factor = map (render factor) <| filter (pred factor) [30,20,10,5] |
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
var PS = PS || {}; | |
PS.Prelude = (function () { | |
"use strict"; | |
function Show(show) { | |
this.show = show; | |
}; | |
function Num($percent, $times, $plus, $minus, $div, negate) { | |
this["%"] = $percent; | |
this["*"] = $times; | |
this["+"] = $plus; |
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 'net/http' | |
require 'cgi' | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
require "resolv-replace" | |
require 'timeout' | |
BASE_URL = "http://www.google.com/search?" | |
LANG = "ja" |
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 'net/http' | |
require 'cgi' | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
require "resolv-replace" | |
require 'timeout' | |
BASE_URL = "http://www.google.com/search?" | |
LANG = "ja" |
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
#aozoraget.rb | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
for i in 1..13 | |
toc = "http://www.aozora.gr.jp/index_pages/sakuhin_a#{i}.html" | |
puts "Opening: " + toc | |
html = IO.read(toc) |
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 'rubygems' | |
require 'hpricot' | |
require 'iconv' | |
$vector = Hash.new | |
$vector[:utf8] = Array.new(65536).fill(0) | |
$vector[:shiftjis] = Array.new(65536).fill(0) | |
$vector[:iso] = Array.new(65536).fill(0) | |
$vector[:eucjp] = Array.new(65536).fill(0) |