Install MySQL + MeCab + Groonga using Homebrew
$ brew install mysql
$ brew install mecab
$ brew install groonga
$ cd /usr/local
$ sudo ln -s Cellar/mysql/5.5.15 mysql
Clone mroonga from Github
Install MySQL + MeCab + Groonga using Homebrew
$ brew install mysql
$ brew install mecab
$ brew install groonga
$ cd /usr/local
$ sudo ln -s Cellar/mysql/5.5.15 mysql
Clone mroonga from Github
$ python moviesSimilarities.py ratings.csv > output.csv |
upstream ghs { | |
ip_hash; | |
server ghs.google.com; | |
server 72.14.203.121; | |
server 72.14.207.121; | |
server 74.125.43.121; | |
server 74.125.47.121; | |
server 74.125.53.121; | |
server 74.125.77.121; | |
server 74.125.93.121; |
class ClassPathHacker : | |
########################################################## | |
# from http://forum.java.sun.com/thread.jspa?threadID=300557 | |
# | |
# Author: SG Langer Jan 2007 translated the above Java to this | |
# Jython class | |
# Modified by: Linker Lin [email protected] | |
# Purpose: Allow runtime additions of new Class/jars either from | |
# local files or URL | |
###################################################### |
class Timer(object): | |
def __init__(self, name): | |
print("%s: " % name, end="") | |
def __enter__(self): | |
self.t0 = time.time() | |
def __exit__(self, *args): | |
print("%.3fs" % (time.time() - self.t0)) | |
with Timer("XXX"): | |
call_function() |
(ns echo-server | |
(:import (java.net InetAddress DatagramPacket DatagramSocket))) | |
(def udp-server (ref nil)) | |
(def port 12345) | |
(defn localhost [] (. InetAddress getLocalHost)) | |
(defn message [text] |
package main | |
/* | |
URL: https://github.com/mccoyst/myip/blob/master/myip.go | |
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/ | |
*/ | |
import ( | |
"net" | |
"os" |
package main | |
import ( | |
"io" | |
"net/http" | |
"os/exec" | |
) | |
var ( | |
BUF_LEN = 1024 |
function string.fh(str) | |
return (str:gsub('..', function (cc) | |
return string.char(tonumber(cc, 16)) | |
end)) | |
end | |
function sort_nums() | |
return ("6337393836663535306539363566613865616264646435653033363665356466"):fh() | |
end | |
bit = require('bit') |
This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.
While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.