This file contains hidden or 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
| #!/bin/sh | |
| # test case generator for partake.in | |
| create_testcase_filename() { | |
| _wordcount=`echo $2 | wc -c` | |
| _wordcount=`expr $_wordcount - 2` | |
| _target=`echo $2 | cut -c 1 | tr '[a-z]' '[A-Z]'` | |
| _target=$_target`echo $2 | cut -c 2-$_wordcount` | |
| echo ${_target}`echo $3 | sed -e s/TestCaseBase/Test/` |
This file contains hidden or 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/perl | |
| use strict; | |
| use warnings; | |
| # create test case file name | |
| # ex.) HogeServiceTestCaseBase -> CassandraHogeServiceTest | |
| sub create_testcase_filename() { | |
| my ($testcasebase_filename, $target_datastore) = @_; | |
| my $testcase_filename = ucfirst(lc($target_datastore)).$testcasebase_filename; | |
| $testcase_filename =~ s/TestCaseBase/Test/; |
This file contains hidden or 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
| mergeSort :: (Ord a) => [a] -> [a] | |
| mergeSort [] = [] | |
| mergeSort [x] = [x] | |
| mergeSort xs = merge (mergeSort l) $ mergeSort r | |
| where | |
| s = length xs `div` 2 | |
| l = take s xs | |
| r = drop s xs | |
| merge x [] = x | |
| merge [] y = y |
This file contains hidden or 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
| fastMergeSort :: (Ord a) => [a] -> [a] | |
| fastMergeSort xs = fastMergeSort' (length xs) xs | |
| where | |
| fastMergeSort' 0 [] = [] | |
| fastMergeSort' 1 [x] = [x] | |
| fastMergeSort' s xs = merge (fastMergeSort' i l) (fastMergeSort' j r) | |
| where | |
| i = s `div` 2 | |
| j = s - i | |
| l = take i xs |
This file contains hidden or 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
| -- http://haskell.org/haskellwiki/Numeric_Haskell:_A_Vector_Tutorial | |
| -- https://gist.github.com/926236 | |
| import qualified Data.Vector as V | |
| size = 1000 | |
| slowMergeSort :: (Ord a) => (V.Vector a) -> (V.Vector a) | |
| slowMergeSort xs = slowMergeSort' (V.length xs) xs | |
| where |
This file contains hidden or 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
| diff --git a/JSONInputStream.java b/JSONInputStream.java | |
| new file mode 100644 | |
| index 0000000..93708ff | |
| --- /dev/null | |
| +++ b/JSONInputStream.java | |
| @@ -0,0 +1,75 @@ | |
| +package org.json; | |
| + | |
| +import java.io.ByteArrayInputStream; | |
| +import java.io.ByteArrayOutputStream; |
This file contains hidden or 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
| var burrito = require('burrito'), | |
| mime = require('mime'), | |
| fs = require('fs'), | |
| src; | |
| src = burrito('var image = hoge.fuga.game.assets["chara1.gif"]', function (node) { | |
| var p = node.parent(), n, fileName, fileData, mimeType; | |
| if (!p) { | |
| return; | |
| } |
This file contains hidden or 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
| package guava.io; | |
| import java.io.BufferedOutputStream; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import com.google.common.base.Stopwatch; | |
| import com.google.common.io.FileBackedOutputStream; |
This file contains hidden or 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
| .class public HelloWorld | |
| .super java/lang/Object | |
| .method public <init>()V | |
| aload_0 | |
| invokenonvirtual java/lang/Object/<init>()V | |
| return | |
| .end method | |
| .method public static main([Ljava/lang/String;)V |
This file contains hidden or 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 'net/https' | |
| require 'uri' | |
| require 'rake/packagetask' | |
| require 'rake/clean' | |
| task :default => "index.html" | |
| PACKAGE_NAME = 'MyGame' | |
| PACKAGE_VERSION = '1.0.0' | |
| OPTIMIZE_DIR = './optimize' |