Skip to content

Instantly share code, notes, and snippets.

@Swind
Swind / gist:1266995
Created October 6, 2011 09:49
[Scala][DB] Db4o Example
package tw.teremolo.example
import com.db4o.Db4oEmbedded
import scala.collection.JavaConverters._
/**
* Date: 2011/10/6
* Time: 下午 5:21
*/
object Hello_db4o {
@Swind
Swind / FindPrimse.scala
Created February 14, 2012 08:30
[Scala][Algorithm] 用Scala找質數的範例
object FindPrimse {
def main(args: Array[String]) {
val result = fillPrimeList(10000)
result foreach println
}
def fillPrimeList(max: Int, list: List[Int] = List(3, 2)): List[Int] = {
if (list.head < max)
fillPrimeList(max, findNextPrime(list, list.head + 2) :: list)
@Swind
Swind / FileUtils.scala
Created May 5, 2012 14:57
[Scala][IO] I/O Opertaions
package tw.epubcoverter.util
import java.io.File
import java.io.InputStream
import java.io.OutputStream
object FileUtils {
/**
* ***********************************************
@Swind
Swind / Example.scala
Created May 5, 2012 23:00
[Scala][OAuth][JSON] Scala Example
import org.json.{JSONObject, JSONArray}
import java.util.Date
/**Result**
{ "action_list" : [ { "action_id" : 1,
"action_type" : "get-all",
"get_deleted" : true
} ],
"client_version" : 0,
"latest_sync_point" : 1303995807749
@Swind
Swind / gist:3383896
Created August 18, 2012 01:55 — forked from chinghanho/gist:3346205
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@Swind
Swind / CreateRepositoryCommand.scala
Created October 2, 2012 15:20
[Scala][Script] Create Add jar to Maven Repository Command
import java.io.File
object CreateRepositoryCommand {
val PATH = """PATH"""
val command = "mvn install:install-file " +
"-Dfile=%s " +
"-DgroupId=%s " +
"-DartifactId=%s " +
"-Dversion=%s " +
#include <inttypes.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <scsi/sg.h> /* take care: fetches glibc's /usr/include/scsi/sg.h */
/* This is a simple program executing a SCSI INQUIRY command using the
@Swind
Swind / hello.py
Created August 25, 2013 09:13
Simple Python Plugin
from random import randint
import ucltip
def hello_world_cmd(name):
"""Execute remote performance test.
-n=<str> --name=<str> Hello Name
"""
print "hello world cmd %s" % name
print "Test import random %d" % randint(0, 51)
[global]
time_based
thread
fadvise_hint=0
@Swind
Swind / text.md
Last active February 15, 2016 01:00
ネイテイブスピーカーとノウネイテイブスピーカー

ネットショッピング

自己紹介

オウヤン マーク キャロライン ポール クラウディア