日時: | 2024-02-01 |
---|---|
作: | 時雨堂 |
資料 バージョン: | 2024.1 |
GitHub URL: | https://github.com/shiguredo/momo |
製品 URL: | https://momo.shiguredo.jp/ |
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
How to write python database driver | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
- https://pycon.jp/2016/ja/schedule/presentation/13/ | |
- https://www.youtube.com/watch?v=ax2WmQ_MSXs | |
- https://togetter.com/li/1028521 | |
======================================== | |
Preface |
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
#!/usr/bin/env python | |
""" | |
Zeroconf Discovery for Rigol DS1000Z-series scopes | |
-------------------------------------------------- | |
Documentation worth looking at: | |
* http://lxistandard.org/Documents/Specifications/LXI%20Device%20Specification%202011%20rev%201.4.pdf | |
* http://lxistandard.org/GuidesForUsingLXI/Introducing%20LXI%20To%20Your%20Network%20Administrator%20May%2024_2013.pdf | |
* http://lxistandard.org/GuidesForUsingLXI/LXI_Getting_Started_Guide_May_1_2013.pdf |
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
$.ajax( { | |
type: "GET", | |
url: "/command.cgi?op=190&CTRL=0x1f&DATA=" + value, | |
cache: true, | |
dataType: "json", | |
timeout: 3000, | |
beforeSend: function( jqXHR, settings ) { | |
jqXHR.setRequestHeader( "If-Modified-Since", "Thu, 01 Jan 1970 00:00:00 GMT" ); | |
} | |
} ).done( function( data, textStatus, jqXHR ) { |
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 'ftdi' | |
ctx = Ftdi::Context.new | |
begin | |
ctx.usb_open(0x0403, 0x6001) | |
begin | |
ctx.set_bitmode(0xff, :bitbang) | |
100.times do | |
ctx.write_data [0xff] | |
sleep 0.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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
#!/usr/bin/env ruby | |
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
# Supports post types: regular, quote, link, photo, video and audio | |
# Saves local copies of images | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' |