Skip to content

Instantly share code, notes, and snippets.

squarednob /
Last active Aug 29, 2015
Blender script to add UVspheres along with curve's location and length.
def addUVsphereOnCurves(number,scale=0.1):
import bpy
import mathutils
from mathutils import Vector
objectList = []
curveList = []
lengthList = []
locationList = []
squarednob / D3_CPI_JP_core-corecore.html
Last active Oct 1, 2015
D3 plot for Japanese CPI of core and corecore.
View D3_CPI_JP_core-corecore.html
<!DOCTYPE html>
<meta charset="utf-8">
.axis text {
font: 15px sans-serif;

Based on which uses D3 to draw elements into a google maps overlay layer, but doesn't use d3.geo machinery to draw map geometry. This gist illustrates how to align a D3 mercator projection with google maps so we can do standard d3 mapping stuff on top of the google API.

View R elementary
//making bubble chart. circle= data of size.
symbols(teamvelocity$TotalPoints, teamvelocity$TotalDevs, circles=teamvelocity$Team, inches=0.35, fg="#00FFFF", ylab="Team Members", xlab="velocity", bg="#CCCCCC")
//show stacked two charts at the same time. layout() is the frame.
layout(matrix(1:2, nrow = 2))
par(mar = par("mar") * c(0.8,1,1,1))
boxplot(m$mortality, ylim=xr, horizontal = TRUE, xlab="mortality")
hist(m$mortality, ylit=xr)
View R ggplot2
//simplest making pointplot
ggplot(m,ase(x=ocean,y=mortality)) + geom_point()
//divide into color on barchart = geom_histogram(aes(fill=...))
g + geom_histogram(alpha=0.5, aes(fill=ocean))
View Github tutorial
// chack if I am on master branch, and hold commited things ahead of pushing.
git status
//clone URL
git add <file>
View python webscraping
#1scrapy基本 でアイテムフィールドを設定する。今回はタイトルとリンク。
from scrapy.item import Item, Field
class CraigslistSampleItem(Item):
# define the fields for your item here like:
# name = Field()
title = Field()
link = Field()
squarednob / python unicode-csv
Created Dec 3, 2013
View python unicode-csv
#1 日本語のcsvファイルを読み込むには、unicodecsvを使う。
import unicodecsv
f = open("utf30.csv","rb")
r = unicodecsv.reader(f, encoding='utf-8')
squarednob / Geocode
Last active Dec 30, 2015
View Geocode
#1Get coorinate using pygeocoder and googlemap API throuth place data in Japaneese.
# -*- coding: utf-8 -*-
from pygeocoder import Geocoder
import unicodecsv
def pick(query):
print "start"
squarednob / Japan_geojson_index.html
Last active Dec 30, 2015 — forked from minikomi/index.html
Japan's geojson and D3 code.
View Japan_geojson_index.html
<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
var width = 960,
height = 700;
var svg ="body").append("svg")