git clone url -> svn checkout url
git pull -> svn update
git diff -> svn diff | less
git status -> svn status
git add -> svn add
git rm -> svn rm
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
// Vectors | |
val nums = Vector(1, 2, 3, -88) | |
x +: xs // Create a new vector with leading element x, followed by all elements of xs. | |
xs :+ x // Create a new vector with trailing element x, preceded by all elements of xs. | |
// Ranges | |
val r: Range = 1 until 5 |
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
<?php | |
// find record by ID | |
$article = Doctrine_Core::getTable('Article')->find(123); | |
// set multi attributes in one go | |
$article->fromArray(array( | |
'Title' => 'My first article', | |
'Content' => 'This is my very first article.\n Hope you enjoy it!', | |
)); |
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"?> | |
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> | |
<!-- Put site-specific property overrides in this file. --> | |
<configuration> | |
<property> | |
<name>mapred.job.tracker</name> | |
<value>localhost:9001</value> | |
<description>The host and port that the MapReduce job tracker runs | |
at.</description> | |
</property> |
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 /usr/bin/ruby | |
STDIN.each_line do |line| | |
m = line.match /Score="(\d+)"/ | |
if m | |
puts "LongValueSum:#{m[1]}\t1" | |
end | |
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
#!/usr/bin/env ruby | |
posts_count = 0 | |
last_key = nil | |
STDIN.each_line do |line| | |
key, value = line.split("\t") | |
if last_key && last_key != key | |
puts "#{last_key}\t#{posts_count}" | |
last_key, posts_count = key, value.to_i |
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 ruby | |
STDIN.each_line do |line| | |
m = line.match /Score="(\d+)"/ | |
if m | |
puts "#{m[1]}\t1" | |
end | |
end |
NewerOlder