Skip to content

Instantly share code, notes, and snippets.

;; ~/elisp をライブラリパスに追加
(setq load-path
(append
(list
(expand-file-name "~/elisp/")
)
load-path))
;; indent setting
(setq-default tab-width 4 indent-tabs-mode nil)
@domitry
domitry / gpa.rb
Created March 4, 2015 15:50
じーぴーえー (阪大koanフォーマット)
# -*- encoding: utf-8 -*-
require "csv"
path = ARGV[0]
csv = CSV.read(path, headers: true, encoding: "Shift_JIS:UTF-8")
column = csv["評語"]
column.delete("欠席")
sum = column.reduce(0) do |memo, alphabet|
[39] pry(main)> module Hoge
[39] pry(main)* module ClassMethods
[39] pry(main)* def hoge
[39] pry(main)* @@hoge = 1
[39] pry(main)* end
[39] pry(main)* end
[39] pry(main)* def self.included(cls)
[39] pry(main)* cls.extend ClassMethods
[39] pry(main)* end
[39] pry(main)* end
<html lang="en">
<head>
<title>Plot Sample - Line</title>
<link rel='stylesheet' href="https://rawgit.com/domitry/elegans/master/examples/common.css">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/domitry/elegans/master/release/elegans.min.js"></script>
<script type="text/javascript">
window.onload = function(){
var STEP_NUM = 10000;
<html lang="en">
<head>
<title>Plot Sample - Line</title>
<link rel='stylesheet' href="https://rawgit.com/domitry/elegans/master/examples/common.css">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/domitry/elegans/master/release/elegans.min.js"></script>
<script type="text/javascript">
window.onload = function(){
var STEP_NUM = 10000;
<html lang="en">
<head>
<title>Plot Sample - Line</title>
<link rel='stylesheet' href="https://rawgit.com/domitry/elegans/master/examples/common.css">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.4/d3.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/domitry/elegans/master/release/elegans.min.js"></script>
<script type="text/javascript">
window.onload = function(){
var STEP_NUM = 10000;
D3.selectAll("rect")
.data([{x: 1, y: 2}, {x: 3, y: 10}])
.attr("x", lambda {|d| d[:x]})
.attr("y", lambda {|d| d[:y]})
.run
#-> <# D3::Selection>
#[
# {target: "a123-23a4-b345", name: "data", args: [{x: 1, y: 2}, {x: 3, y: 10}]},
# {target: "a123-23a4-b345", name: "attr", args: [{type: "Proc", uuid: "123-456-789"}
@domitry
domitry / interact.rb
Last active August 29, 2015 14:13
Draft version of Nyaplot v2.0
require 'nyaplot'
include Nyaplot
df = DataFrame.from_csv("hoge.csv")
df1 = df.clone
p1 = Plot.add(df1, :bar, :x, :y)
p2 = Plot.add(:scatter, x, y)
.add(:filter_x)
{|min, max|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.