Skip to content

Instantly share code, notes, and snippets.

View jiankaiwang's full-sized avatar
🎯
Focusing

Jian-Kai Wang jiankaiwang

🎯
Focusing
View GitHub Profile
@jiankaiwang
jiankaiwang / use_gzip.py
Created September 10, 2018 03:20
Compress and decompress a gzip file in python.
# coding=utf-8
import gzip
import cStringIO
import codecs
import json
def compressFileToString(inputFile):
"""
read the given open file, compress the data and return it as string.
and now is string type, does not matter the length of string
@jiankaiwang
jiankaiwang / genPwd.py
Created September 10, 2018 03:10
generate several passwords in python
# coding: utf8
# desc: generate several passwords in python
import random
sets = (int)(input("How many passwords you need ? "))
pwdLen = (int)(input("The length of each password ? "))
pwdComposition = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789^&*()_"
pwdMaterial = []
@jiankaiwang
jiankaiwang / Check_Binary_Mirror_Tree.java
Created July 30, 2018 15:09
check whether the binary tree is the mirror tree
import java.util.Stack;
class NODE {
public String ch;
public NODE leftNode;
public NODE rightNode;
public NODE() {
ch = "_";
leftNode = null;
rightNode = null;
@jiankaiwang
jiankaiwang / WordCount.java
Created June 20, 2018 08:12
MapReduce example in Hadoop
/*
**************************************************************
Platform
**************************************************************
jdk: 1.8.x
hadoop: 3.1.0
**************************************************************
Quick Guide
**************************************************************
@jiankaiwang
jiankaiwang / Basic_CLI_Parameters.py
Created April 22, 2018 08:14
basic operations of parameters in CLI over Python
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 22 16:04:40 2018
@description: Basic Operation in CLI
@author: JianKai Wang
"""
# coding: utf-8
import sys
@jiankaiwang
jiankaiwang / recaptcha-example-js.html
Last active March 25, 2024 09:39
the example to use recaptcha in javascript
<!--
Description: The following is the example code to use recaptcha.
Notice: The function backend_API_challenge is the concept and you should implement it on the backend.
Especially, you must keep your secret key in private all the time.
Flow:
1. Click the submit button.
2. On the console, execute backend_API_challenge function.
-->
<html>
<head>
@jiankaiwang
jiankaiwang / AutoCamera.cs
Created January 20, 2018 14:22
The C# script makes the camera move on the path desired in Unity3D.
/*
* author : jiankaiwang
* description : The C# script makes the camera move on the path desired in Unity3D.
* platform : Unity
* date : 2018/01
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@jiankaiwang
jiankaiwang / Line_Notify_API.py
Created December 29, 2017 02:13
Send information to the specific line group.
# -*- coding: utf-8 -*-
"""
author : JianKai Wang
description : send info to the specific line group
date : Dec 2017
Line Notify : https://notify-bot.line.me
document :
* line sticker : https://devdocs.line.me/files/sticker_list.pdf
Notice :
* Add the official account (LINE Notify) into the group
@jiankaiwang
jiankaiwang / MouseCamLook.cs
Created December 18, 2017 06:52
The script provides you with basic operations of first personal camera look on mouse moving.
/*
* author : jiankaiwang
* description : The script provides you with basic operations
* of first personal camera look on mouse moving.
* platform : Unity
* date : 2017/12
*/
using System.Collections;
using System.Collections.Generic;
@jiankaiwang
jiankaiwang / CharacterController.cs
Created December 18, 2017 06:52
The script provides you with basic operations of first personal control on Unity.
/*
* author : jiankaiwang
* description : The script provides you with basic operations of first personal control.
* platform : Unity
* date : 2017/12
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;