Skip to content

Instantly share code, notes, and snippets.

View cylim's full-sized avatar
👻
Enjoying life ~

CY Lim cylim

👻
Enjoying life ~
View GitHub Profile
@cylim
cylim / introrx.md
Created February 2, 2018 14:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
#!/bin/bash
LOADING=false
DEBUG=/dev/null
usage()
{
cat << EOF
usage: $0 [options] <DBNAME>
OPTIONS:

Keybase proof

I hereby claim:

  • I am cylim on github.
  • I am cylim (https://keybase.io/cylim) on keybase.
  • I have a public key ASBGCqhnoENPgqlElauWm8C65SU8Fn77SH0tJ4tYzpsWago

To claim this, I am signing this object:

@cylim
cylim / CSCI361-Asgn1-Part2-Question1b.py
Last active May 3, 2016 21:58
CSCI361 Assignment 1 Part 2 Question 1b
import sys
def main():
dict = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D']
cipher = []
for a in range(14):
for num in range(14):
cipher.append((a * num + 1) % 14)
if len(cipher) == len(set(cipher)):
@cylim
cylim / CSCI361-Asgn1-Part2-Question1ab
Created March 27, 2016 10:13
CSCI361 Assignment 1 Part 2 Question 1 a and b
import sys
def main(argv):
dict = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D']
a, b = int(argv[0]), int(argv[1])
print("Function: Yi = {}Xi + {}".format(a, b))
for num in range(14):
cipher = (a * num + b) % 14
@cylim
cylim / CSCI361-Asgn1-Part2-Question2
Last active March 26, 2016 11:50
CSCI361 Assignment 1 Part 2 Question 2
dict = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E']
def main():
for i in range(14):
cipher = (pow(i, 2) + i) % 15
print(dict[i], ":", dict[cipher])
if __name__ == "__main__":
main()
@cylim
cylim / CSCI361-Asgn1-Part2-Question1c
Last active March 26, 2016 11:45
For the answer of CSCI361 Assignment 1 Part 2 Question 1c
import sys
def main(argv):
dict = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D']
for char in argv[0]:
num = int(char)
cipher = (11 * num + 3) % 14
print(dict[num], ": ", dict[cipher])
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query
@cylim
cylim / index.js
Created August 28, 2014 04:32 — forked from edokeh/index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \