Skip to content

Instantly share code, notes, and snippets.

View qunwang6's full-sized avatar
🏠
Working from home

qunwang6

🏠
Working from home
View GitHub Profile

How to make the Webster's 1913 your default Kindle dictionary

  1. Download a Kindle-compatible version of the dictionary here. Unzip the .rar archive.

  2. Get the "Send to Kindle" program on your computer. Here's the link for the Mac.

  3. Right-click your recently downloaded (unzipped) dictionary file, and click the "Send to Kindle" menu item. It will arrive on your Kindle shortly.

  4. Once the dictionary has arrived, go to your settings -- on my newish paperwhite, it's at Home > Settings > Device Options > Language and Dictionaries > Dictionaries > English. Choose the Webster's 1913.

Latency Comparison Numbers
--------------------------
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
#!/opt/local/bin/ruby1.9
# encoding: utf-8
# 「Judy先生の英語科学論文の書き方」[1]付属のCD-ROMのデータを
# Dictionary.app用のXMLデータに変換するスクリプト。
# Usage :: ruby1.9 judy-to-dictionary.rb > MyDictionary.xml && make && make install
#
# Author :: Masayuki Higashino
#
# References ::
@qunwang6
qunwang6 / dict.sh
Last active August 29, 2015 14:07 — forked from mh61503891/dict.sh
#!/bin/sh
# Description :: バックグラウンドで辞書.appで単語検索して、バックグラウンド
# でGoogle Chromeで英辞郎 on the Webで検索して、しまいには
# sayコマンドでしゃべってもらうスクリプト。
# EmacsとかSublime Text 2とかから叩くと便利です。
# Usage :: sh dict.sh "hello"
# Requiments :: Mac OS X, Gogle Chrome
# Note :: "Google Chrome"を"Safari"にしてexecute javascriptを
# do javascriptにすればSafariでも動くかもしれません。
# -*- coding: utf-8; -*-
#
# Author :: Masayuki Higashino
#
# This plugin looks up a word beside a caret or a selected text in
# Dictionary.app without changing activeness of Sublime Text 2.app's window.
#
# In order to use this plugin, Add a keymap such as a follow into user's key bindings.
# { "keys": ["super+d"], "command": "look_up_in_dictionary" }
#!/bin/sh
# == References
#
# * OSXでMP4動画からAAC音声抽出
# http://d.hatena.ne.jp/ikki_j/20080304/1204629353
# > H.264+AACなMP4動画から再コンパイルなしでAAC音声のみを抽出する方法。
#
# * EvalVid - A Video Quality Evaluation Tool-set Pre-compiled binaries (static)
# http://www2.tkn.tu-berlin.de/research/evalvid/fw.html#bin
@qunwang6
qunwang6 / dict.c
Last active August 29, 2015 14:07
/*
* Command-line dictionary lookup.
*
* Build with:
* clang -framework CoreServices
*/
#import <CoreFoundation/CoreFoundation.h>
#import <CoreServices/CoreServices.h>
int main(int argc, char *argv[]) {

General Usage

Most of the following commands can be used both on files directly and in pipes, e.g. the command sed G can be used in both of the following ways:

... | sed G
sed G [/path/to/]file
javascript:(function(){script=document.createElement('script');script.src='http://dict.bing.com.cn/cloudwidget/Scripts/Generated/BingTranslate_Hover_Phrase_Selection_ShowIcon.js';script.onload=INIT;document.body.appendChild(script);})();function INIT(){BingCW.Init({MachineTranslation:true,WebDefinition:true});}