Skip to content

Instantly share code, notes, and snippets.

View 5pecia1's full-sized avatar
๐Ÿ˜€
Rustaceans

sol 5pecia1

๐Ÿ˜€
Rustaceans
View GitHub Profile
@5pecia1
5pecia1 / sum.c
Last active March 16, 2017 14:43
#include <stdio.h>
#include <stdlib.h>
int sum (int n) {
if (n <= 0)
return 0;
else
return n + sum(n - 1);
}
@5pecia1
5pecia1 / hanoi.java
Last active March 16, 2017 12:23
hanoi test
import java.math.BigInteger;
public class Hanoi {
private static final BigInteger ONE = new BigInteger("1");
private static BigInteger DISK_MOVE_COUNTER = new BigInteger("0");
private static int STACK_COUNT = 0;
private static int CURRENT_BIGGEST_DISK = 0;
public static void main(String[] args) {
@5pecia1
5pecia1 / config
Last active November 22, 2016 11:50
git alias for hakyll
[alias]
make-master = !git checkout master && cp -a _site/. .
commit-develop-and-master = !git commit $1 \"$2\" && git make-master && git add . && git commit $1 \"$2\"
push-origin-all-checkout-develop = !git push origin --all && git checkout develop
@5pecia1
5pecia1 / logAllValuesInCursor.java
Last active December 29, 2016 13:44
log all values(records) in Cursor on Android
private void logAllValuesInCursor(Cursor cursor) {
if (cursor.moveToFirst()) {
do {
logAllValuesInCurrentCursor(cursor);
} while (cursor.moveToNext());
} else {
Log.e("test_file", "cursor is empty");
}
}