Skip to content

Instantly share code, notes, and snippets.


xnnyygn xnnyygn

Block or report user

Report or block xnnyygn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foo_instance_error.rb
class Foo
def initialize(arg0)
@arg0 = arg0
# run me in irb, and you will get this error
xnnyygn /
Created Oct 21, 2014
a simple java program to parse query string
public class ParseQueryString {
public static void main(String[] args) {
String queryString = "foo=a&bar=b";
for(String pair : queryString.split("&")) {
int index = pair.indexOf('=');
// -1 means not found
// 0 means at beginnging, e.g '=a'
if(index <=0) {
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class Dijkstra {
class VectorAndDistance {
xnnyygn /
Created Nov 26, 2013
binary search tree in java
import java.util.Iterator;
import java.util.LinkedList;
public class BinarySearchTree<T extends Comparable<T>> implements Iterable<T> {
// tree node
class Node {
T value;
Node leftChild;
Node rightChild;
xnnyygn / validation-form-select-by-class
Created Aug 22, 2012
Test html for validation two form with same class
View validation-form-select-by-class
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<script src=""></script>
<script type="text/javascript" src=""></script>
<style type="text/css">
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
xnnyygn / hobbies.scala
Created Jun 8, 2012
My first code example to post on posterous
View hobbies.scala
object Hobbies {
def main(args[]: String){
println(List("Scala", "Java", "ACG", "Linux", "etc").mkString(", "))
You can’t perform that action at this time.