Skip to content

Instantly share code, notes, and snippets.

@jakalada
jakalada / gss_cartesian_coords.csv
Created March 20, 2017 14:35
gss_generator.pyの出力例
1.22464679915e-16 0.0 -1.0
-0.0185511469485 0.0795141687573 -0.996661101836
-0.11510877307 0.00780833227827 -0.993322203673
-0.0794333510688 -0.11671931096 -0.989983305509
0.0488700851286 -0.155385096561 -0.986644407346
0.163177583038 -0.0805192648137 -0.983305509182
0.191430375208 0.0549531867769 -0.979966611018
0.12268505648 0.176484241225 -0.976627712855
-0.00750226789622 0.229461541818 -0.973288814691
-0.144663150994 0.195626511937 -0.969949916528
@jakalada
jakalada / gss_generator.py
Last active July 28, 2020 21:59
GSS(一般化螺旋集合) Generator
#!/usr/bin/env python
# coding: utf-8
'''参考文献に記載されているDelphiのコードの移植版
Notes
-----
参考文献: 多数の点を球面上に一様分布させるソフトウェアGSS Generator
https://www.jstage.jst.go.jp/article/geoinformatics/12/1/12_1_3/_article/-char/ja/
@jakalada
jakalada / file0.cpp
Last active November 23, 2016 15:07
ArduinoでOLEDディスプレイを試す ref: http://qiita.com/jakalada/items/8f83d07291d984a31633
#define SSD1306_I2C_ADDRESS 0x3D // 011110+SA0+RW - 0x3C or 0x3D
@jakalada
jakalada / file0.txt
Created May 7, 2016 09:40
ElectronでCanvasの描画内容を画像ファイルとして保存する ref: http://qiita.com/jakalada/items/6f62b2089a67a04514b7
function saveCanvas () {
const canvasDataUrl = myCanvas.toDataURL()
const decoded = dataUriToBuffer(canvasDataUrl)
fs.writeFile(imageFilePath, decoded, (err) => {
if (err) {
window.alert('ファイルの保存に失敗しました')
console.log(err)
} else {
window.alert('ファイルを保存しました')
}
@jakalada
jakalada / file0.txt
Created March 29, 2016 16:44
Raspberry Pi 3とGenuino (Arduino) 101でBLE通信する ref: http://qiita.com/jakalada/items/7ad4144efa2f5e109b89
peripheral discovered (xxxxxxxxxxxx with address <xx:xx:xx:xx:xx:xx, public>, connectable true, RSSI -68:
hello my local name is:
ButtonLE
can I interest you in any of the following advertised services:
["19b10010e8f2537e4f6cd104768a1214"]
require 'serialport'
port = "/dev/ttyAMA0"
bps = 115200
class ESP8266
def initialize(port, bps)
@serial_port = SerialPort.new(port, bps)
end
class Storage
constructor: ->
@init()
init: ->
@table = {}
@keys = []
@length = 0
clear: ->
@jakalada
jakalada / appengine_entity.py
Created March 15, 2010 17:47
quote from GAE document - Entity
# ref: http://code.google.com/intl/ja/appengine/docs/python/datastore/entitiesandmodels.html#Properties_and_Types
# reserved attribute names by the Model class
#
# all, app, copy, delete, entity, entity_type
# fields, from_entity, get, gql, instance_properties
# is_saved, key, key_name, kind, parent, parent_key
# properties, put, setdefault, to_xml, update
# --------------
@jakalada
jakalada / appengine_model.py
Created March 15, 2010 16:57
quote from GAE document - Model
# ref: http://code.google.com/intl/ja/appengine/docs/python/datastore/entitiesandmodels.html
# -----
# Model
# ref: http://code.google.com/intl/ja/appengine/docs/python/datastore/modelclass.html
# -----
from google.appengine.ext import db
class Pet(db.Model):
#!/usr/bin/ruby19
# coding: utf-8
require 'mechanize'
hiragana_characters = %w(
あ い う え お
か き く け こ
さ し す せ そ
た ち つ て と