Skip to content

Instantly share code, notes, and snippets.

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

sol 5pecia1

πŸ˜€
Rustaceans
View GitHub Profile
@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");
}
}
@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 / 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 / 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 / 8x8_binary_ascii.txt
Last active May 26, 2017 02:19
convert hexadecimal ascii to binary ascii (8 x 8)
Space - Ascii 32
[
00000000,
00000000,
00000000,
00000000,
00000000,
00000000,
00000000,
00000000
@5pecia1
5pecia1 / .gitconfig
Last active May 26, 2017 14:15
add git pretty log alias
git config --global alias.lg "log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@5pecia1
5pecia1 / deleteCards.js
Last active December 9, 2017 15:58
delete multiple cards in list in trello
/**
* CAUTION!
* Copy board before run.
* Lists start at 0.
*/
function deleteCardsInList(listNumber) {
var list = document.getElementsByClassName("list-cards")[listNumber];
var a = list.getElementsByTagName('a');
var aLength = a.length;
0x05E7bE3755f987Caed5387487B4Cc5CD23102108
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.placeholder(tf.float32, shape=[None, 784])
y_ = tf.placeholder(tf.float32, shape=[None, 10])
W = tf.Variable(tf.zeros([784,10]))
b = tf.Variable(tf.zeros([10]))
sess.run(tf.global_variables_initializer())
@5pecia1
5pecia1 / dodo_fighter_agent.py
Created August 18, 2018 12:22 — forked from segfault87/dodo_fighter_agent.py
도도 νŒŒμ΄ν„°(https://pycon-2018-dodo-fighter.spoqa.com) μ—μ΄μ „νŠΈ 예제 μ½”λ“œ
import json
import sys
# 도도 νŒŒμ΄ν„°μ— μ°Έκ°€ν•˜κΈ° μœ„ν•΄μ„œλŠ” μ—μ΄μ „νŠΈλ₯Ό λ§Œλ“€μ–΄μ„œ μ œμΆœν•΄ μ£Όμ…”μ•Ό ν•©λ‹ˆλ‹€.
# μ—μ΄μ „νŠΈλŠ” μ‚¬μš©μžκ°€ μž‘μ„±ν•˜λŠ” 인곡지λŠ₯ μ½”λ“œλ‘œμ„œ, μ£Όμ–΄μ§€λŠ” ν˜„μž¬ κ²Œμž„ μƒνƒœλ₯Ό λ°”νƒ•μœΌλ‘œ
# μ–΄λ–€ μ•‘μ…˜μ„ μ·¨ν• μ§€λ₯Ό κ²°μ •ν•˜λŠ” 역할을 ν•©λ‹ˆλ‹€.
#
# μ•‘μ…˜ μ„€λͺ…
# - idle - 아무것도 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
# - forward - μ•žμœΌλ‘œ μ›€μ§μž…λ‹ˆλ‹€. μƒλŒ€κ°€ λ°”λ‘œ μ•žμ— μžˆμ„ 경우 더 움직이지 μ•ŠμŠ΅λ‹ˆλ‹€.