Skip to content

Instantly share code, notes, and snippets.

View chenhong805's full-sized avatar
๐Ÿ˜ƒ

Xx chenhong805

๐Ÿ˜ƒ
View GitHub Profile
PyAutoGUI
boto3
# from poker_ai
blessed
click
dill
enlighten
ipdb
matplotlib
pytest
//Automatic Water Level control system by Easy HomeMade Projects.
//Arduino code written by Engr. Usman Ahmad.
//Use arduino UNO or Arduino NANO.
//
#include <LiquidCrystal.h>
int level1 = A1;
int level2 = A2;
int level3 = A3;
int level4 = A4;
int level5 = A5;
@chenhong805
chenhong805 / DataStructures.java
Created October 17, 2019 15:28
basic data structures usage examples in java
import java.util.*;
public class HelloWorld{
public static void main(String []args){
// Arrays 0
System.out.println("==============");
int[] a0 = new int[100];
for(int i = 100; i > 0; i--) {
a0[100 - i] = 101 * (i << 1);
import java.util.*;
class Main {
public static void main(String[] args) {
case0();
case1();
}
public static void case1() {
int k = 2;
// https://www.1point3acres.com/bbs/forum.php?mod=viewthread&tid=506633
import java.util.*;
public class HelloWorld{
public static void main(String []args){
// k = 1
System.out.println(HelloWorld.solve("10", 1)); // true
@chenhong805
chenhong805 / lmu.m
Created March 20, 2018 22:11 — forked from phillbaker/lmu.m
Macbook ambient light sensor data
// Compile with $ gcc -o lmutracker lmu.m -framework IOKit -framework CoreFoundation -framework Foundation
// Usage: ./lmu [now]
// Prints out the value from the ambient light sensor and the back light LED every 1/10 of a second. Optionally print just one value.
// Inspired by the code found at
// http://google-mac-qtz-patches.googlecode.com/svn-history/r5/trunk/AmbientLightSensor
// and http://osxbook.com/book/bonus/chapter10/light/
// and http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/Archives/Computing/2010_February_10#Mac_OS_X_keyboard_backlight_drivers
// http://forums.macrumors.com/showthread.php?t=1133446
#include <stdio.h>
@chenhong805
chenhong805 / SwitchyOmega.pac
Created March 11, 2018 06:54
my docker dev stack: standalone spark cluster + zookeeper + kafka + kafka manager + cassandra + jenkins + sshd proxy + switchyOmega to access docker network
var FindProxyForURL = function(init, profiles) {
return function(url, host) {
"use strict";
var result = init, scheme = url.substr(0, url.indexOf(":"));
do {
result = profiles[result];
if (typeof result === "function") result = result(url, host, scheme);
} while (typeof result !== "string" || result.charCodeAt(0) === 43);
return result;
};
@chenhong805
chenhong805 / clean-idea.sh
Created February 15, 2018 23:20
clean java/scala intellij work place
#!/bin/bash
rm -rf .idea
find . -type f -name "*.iml" | xargs -I {} rm {}
find . -type d -name "*target*" | grep -v 'src' | xargs -I {} rm -rf {}
template<class T>
class Node {
protected:
T val;
virtual T getVal() { return this.val; }
virtual void setVal(T val) { this.val = val; }
template <typename R, typename V>
virtual Node<R> operator+(Node<V> rhs);
}