Skip to content

Instantly share code, notes, and snippets.

View Xerosigma's full-sized avatar
💻
Making Things Happen

Nestor E. Ledon Xerosigma

💻
Making Things Happen
View GitHub Profile
@codebutler
codebutler / JsonHelper.java
Created April 8, 2012 20:20
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@aeurielesn
aeurielesn / build.xml
Created August 4, 2011 05:24
ant script to get local revision number from the subversion's .svn/entries file
<?xml version="1.0" encoding="UTF-8"?>
<project name="svn" default="revision-number" basedir=".">
<target name="check-svn-entries">
<available file=".svn/entries" property="svn.entries.present"/>
</target>
<target name="revision-number" depends="check-svn-entries" if="svn.entries.present">
<loadfile srcfile=".svn/entries" property="revision">
<filterchain>
@gennad
gennad / BFSDFS.java
Created January 23, 2011 09:14
Breadth-first search and depth-first search Java implementation
Class Main {
public void bfs()
{
// BFS uses Queue data structure
Queue queue = new LinkedList();
queue.add(this.rootNode);
printNode(this.rootNode);
rootNode.visited = true;
while(!queue.isEmpty()) {
Node node = (Node)queue.remove();