Skip to content

Instantly share code, notes, and snippets.

@squarednob
squarednob / 1D3_shapes_snipets1
Last active Dec 30, 2015
1D3_shapes_snipets1 // #1 #2 map_change coordinates into x,y by projection([lon,lat]) ; #3 map_template ; #4 arcテンプレート ; #5 パイテンプレート ; #6 treeテンプレート 2D3_shapes_snipets2 // #1 パックテンプレート ; #2 パックjsonテンプレート; #3 バブルテンプレート ; #4 バブルjsonテンプレート #5 ラインテンプレート; #6 エリアテンプレート ; #7 シンボルテンプレート 3D3_forcelayout_template 4D3_forcelayout_json 5D3_display_utirity /…
View 1D3_shapes_snipets1
#1
#2 map_change coordinates into x,y by projection([lon,lat])
var coordinates = projection([mylon, mylat]);
map.append('svg:circle')
.attr('cx', coordinates[0])
.attr('cy', coordinates[1])
.attr('r', 5);
View Parse csv , json to D3 format
#1 d3.csv to [{x:~},{y:~}]
var makeData = function(d,country){
var list = [];
d.forEach(function(datum){
var obj = {};
obj["x"]= parseInt(datum.id);
obj["y"] = parseInt(datum[country]);
@squarednob
squarednob / Obama_speech2008.txt
Last active Jan 3, 2016
Electrophoresis emulator.
View Obama_speech2008.txt
If there is anyone out there who still doubts that America is a place where all things are possible; who still wonders if the dream of our founders is alive in our time; who still questions the power of our democracy, tonight is your answer.
It’s the answer told by lines that stretched around schools and churches in numbers this nation has never seen; by people who waited three hours and four hours, many for the very first time in their lives, because they believed that this time must be different; that their voice could be that difference.
It’s the answer spoken by young and old, rich and poor, Democrat and Republican, black, white, Latino, Asian, Native American, gay, straight, disabled and not disabled – Americans who sent a message to the world that we have never been a collection of Red States and Blue States: we are, and always will be, the United States of America.
It’s the answer that led those who have been told for so long by so many to be cynical, and fearful, and doubtful of what we can achieve
@squarednob
squarednob / pseudo-integrate.ipynb
Created Feb 24, 2016
Python: Pseudo integrate class
View pseudo-integrate.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View blender_dupl-on-curves1.py
import bpy
def dupliOnCurve(curve_length_effect=None, replace=None):
'''
When you want to duplicate an object on object: Simply do "object > make links > object data".
The function is optimised for an object to duplicate on curves, althoubh it can be used to duplicate on objects.
Usage:
1. Multiple selecte curves, and lastly select an object as an object to be duplicated.
2. Paste the code on text editor which can be found in scripting layout.
View blender_addon_template_toolshelf-input1.py
import bpy
# Meta information.
bl_info = {
"name": "Addon-template1: Add IcoSphere",
"author": "Gappy",
"version": (1, 0),
"blender": (2, 75, 0),
"location": "Object > Ball",
"description": "Add IcoSphere",
View python:state-space model test with numpy
# coding: utf-8
# In[1]:
import numpy as np
import scipy as sp
# matplotlib:
from matplotlib.pylab import plt
@squarednob
squarednob / README.md
Last active Feb 17, 2017
D3-electrophoresis: Simple Example
View README.md
@squarednob
squarednob / README.md
Last active Feb 17, 2017
D3-electrophoresis: Customizing settings with DNA sequence.
View README.md

D3-electrophoresis plugin example: Default text is a kind of DNA sequence. You can change text and words in text box.

Github: D3-electrophoresis

@squarednob
squarednob / README.md
Last active Feb 24, 2017
D3-electrophoresis: Customizing setting with Trump inauguration text
View README.md

D3-electrophoresis plugin example: Default text is Trump's inauguration speech. You can change text and words in text box.

Github: D3-electrophoresis