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/ruby | |
require 'digest' | |
require 'fileutils' | |
require 'tempfile' | |
require 'yaml' | |
require 'uri' | |
class DFS | |
INDEXNAME = 'index' |
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
--- taglib-1.5/taglib/toolkit/tstring.cpp.orig 2008-02-05 00:14:45.000000000 +0900 | |
+++ taglib-1.5/taglib/toolkit/tstring.cpp 2008-08-23 19:52:16.000000000 +0900 | |
@@ -208,12 +208,22 @@ | |
s.resize(d->data.size()); | |
if(!unicode) { | |
- std::string::iterator targetIt = s.begin(); | |
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) { | |
- *targetIt = char(*it); | |
- ++targetIt; |
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 | |
import DiscID, CDDB, sys, os | |
from eyeD3.tag import * | |
def disc_id(track): | |
frame2array = lambda(f): (f/(60*75), (f/75)%60, f%75) | |
last = len(track) - 1 | |
track_frames = [] | |
checksum = 0 | |
for i in range(1, last + 1): |
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/ruby1.9 -rnkf | |
module NKF | |
puts ARGF.file.map{|l|[guess(l),nkf('-w', l)]}.select{|i|i[0]!=ASCII}.join(' ') | |
end |
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
//import java.io.ByteArrayInputStream | |
import java.io.{BufferedReader,InputStreamReader} | |
object A { | |
def main(a: Array[String]) { | |
for (i <- 0 until 10) { | |
println("hello " + i) | |
} | |
val ls = Runtime.getRuntime.exec("ls -l") | |
var in = ls.getInputStream |
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
import java.net._ | |
import java.io._ | |
import scala.actors.Actor | |
import scala.actors.Actor._ | |
object HTTPD { | |
def server = { | |
loop { | |
react { | |
case s :Socket => |
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/ruby | |
require 'base64' | |
require 'digest/md5' | |
b1 = '' | |
b2 = '' | |
s1 = '' | |
s2 = '' | |
open('b.txt') do |fd| | |
loop do | |
x = fd.readline |
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
hgbook/ja$ ls html/* | |
html/onepage: | |
99book.bib hgbook.tmp revlog.png | |
99defs.aux hgbook.xref snapshot.png | |
feature-branches.png hgbook0x.png tour-basic.aux | |
filelog.png hgbook10x.png tour-history.png | |
hgbook.4ct hgbook13x.png tour-merge-conflict.png | |
hgbook.4tc hgbook14x.png tour-merge-merge.png | |
hgbook.aux hgbook15x.png tour-merge-pull.png | |
hgbook.bbl hgbook17x.png tour-merge-sep-repos.png |
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
jsonic-1.1/src/net/arnx/jsonic$ LANG= svn diff | |
Index: JSON.java | |
=================================================================== | |
--- JSON.java (revision 787) | |
+++ JSON.java (working copy) | |
@@ -2074,10 +2074,18 @@ | |
return sb.toString(); | |
} | |
+ private boolean isScala(Class<?> c) { |
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
object a { | |
def sub(in: Long): Int = { | |
val masked: Long = in & 0x0101010101010101L | |
(0 until 7).foldLeft(masked) {(v, i) => (v & 0xff) | (v >> 7)}.toInt | |
} | |
def sub2(inp: Long): Int = { | |
val m1 = inp & 0x0101010101010101L | |
val m2 = (m1 & 0x0001000100010001L) | (m1 >> 7) |
OlderNewer