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
str = "no ruby, no life!" | |
h = {} | |
str.scan(/\w+/).each do |word| h[word] = h[word].to_i + 1 end | |
h |
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 x10.glb.ArrayListTaskBag; | |
import x10.glb.TaskQueue; | |
import x10.glb.TaskBag; | |
import x10.glb.GLBParameters; | |
import x10.glb.GLB; | |
import x10.util.Team; | |
import x10.glb.Context; | |
import x10.glb.ContextI; // ContextI : Interface for Context | |
import x10.glb.GLBResult; |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>iTERM2</appname> | |
<equal>com.googlecode.iterm2</equal> | |
</appdef> | |
<appdef> | |
<appname>MACVIM</appname> | |
<equal>org.vim.MacVim</equal> | |
</appdef> |
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 x10.util.ArrayList; | |
import x10.glb.ArrayListTaskBag; | |
import x10.glb.TaskQueue; | |
import x10.glb.TaskBag; | |
import x10.glb.GLBParameters; | |
import x10.glb.GLB; | |
import x10.util.Team; | |
import x10.glb.Context; | |
import x10.glb.ContextI; | |
import x10.glb.GLBResult; |
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 x10.util.ArrayList; | |
import x10.glb.ArrayListTaskBag; | |
import x10.glb.TaskQueue; | |
import x10.glb.TaskBag; | |
import x10.glb.GLBParameters; | |
import x10.glb.GLB; | |
import x10.util.Team; | |
import x10.glb.Context; | |
import x10.glb.ContextI; | |
import x10.glb.GLBResult; |
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 x10.util.ArrayList; | |
import x10.glb.ArrayListTaskBag; | |
import x10.glb.TaskQueue; | |
import x10.glb.TaskBag; | |
import x10.glb.GLBParameters; | |
import x10.glb.GLB; | |
import x10.util.Team; | |
import x10.glb.Context; | |
import x10.glb.ContextI; | |
import x10.glb.GLBResult; |
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
class Point01 { | |
static def p( o: Any ) { | |
Console.OUT.println( o ); | |
} | |
public static def main( args: Rail[String] ) { | |
Console.OUT.println("hello"); | |
// construct a 1-d point from Long |
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 x10.regionarray.Region; | |
class Region01 { | |
private static def p( o: Any ) { | |
Console.OUT.println( o ); | |
} | |
public static def main( args: Rail[String] ) { | |
val r1 = Region.make( 1..10 ); |
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 networkx | |
import sys | |
G = networkx.Graph() | |
argvs = sys.argv | |
if( len(argvs) != 4 ): | |
print 'Usage: python %s <d> <n> <seed>' % argvs[0] | |
quit() | |
d = int( argvs[1] ) | |
n = int( argvs[2] ) |
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
// --------------------------------------- | |
template <class T> | |
void Swap( std::vector<T>::iterator it1, std::vector<T>::iterator it2) { | |
T temp = *it1; | |
*it1 = *it2; | |
*it2 = temp; | |
} | |
// ----------------------------------------- | |
template <class T> |
OlderNewer