Skip to content

Instantly share code, notes, and snippets.

View chunmeng's full-sized avatar
♨️
My fingers are on fire!

chunmeng

♨️
My fingers are on fire!
View GitHub Profile
@chunmeng
chunmeng / in_range.py
Created February 10, 2019 07:50
Count how many numbers are within in the given ranges
import numpy as np
def in_range_opt(numbers, ranges):
cnt = 0
r_index = 0
range_exhausted = False
# This loop requires numbers to be sorted
numbers_sorted = sorted(numbers)
for n in numbers_sorted:
@chunmeng
chunmeng / design_pattern_cpp.txt
Created June 21, 2017 08:27
design pattern - builder, factories note
a fluent builder
HtmlElement& addChild(name, text)
{
return *this;
}
operator HtmlElement() { return root; }
@chunmeng
chunmeng / git_notes.txt
Last active June 1, 2017 09:29
notes from git tips and trick training
git hist
directed acyclic graph
HEAD
a <- b <- c master
^
d <- e feature
git lg feature..master
@chunmeng
chunmeng / sync_fork.txt
Last active June 1, 2017 05:43
Sync forked repo
git clone https://github.com/chunmeng/alexa-avs-raspberry-pi.git
git remote add upstream https://github.com/alexa/alexa-avs-sample-app
git remote -v
origin https://github.com/chunmeng/alexa-avs-raspberry-pi.git (fetch)
origin https://github.com/chunmeng/alexa-avs-raspberry-pi.git (push)
upstream https://github.com/alexa/alexa-avs-sample-app (fetch)
upstream https://github.com/alexa/alexa-avs-sample-app (push)
@chunmeng
chunmeng / using_gitk.txt
Created May 31, 2017 07:53
gitk cheatsheet
# alias
k = !gitk --all &
# git k to invoke
# show only commits on path
gitk -- opensource/path
///////////////////////////////////////////////////////////////////////////
class TheAdaptor {
public:
TheAdaptor(const TheFactory& factory);
virtual ~TheAdaptor();
virtual void createNode(const std::string& uuid, const std::string& uri);
TheNode& findNode(const std::string& uuid);
Source:
http://stackoverflow.com/questions/31495147/android-studio-libpng-warning-iccp-not-recognizing-known-srgb-profile-that-h
https://groups.google.com/forum/#!msg/adt-dev/rjTQ_STR3OE/-UcNQRISTKsJ
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
find . -path '*src/main/res/*' -name '*.png' -exec exiftool -overwrite_original -all= {} \;
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpEntity
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.params.HttpParams
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.protocol.HttpContext
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpHost
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpRequest
Warning:library class android.net.http.AndroidHttpClient depends on program class org.apache.http.HttpResponse
Warning:library clas
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.5 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency commons-logging:commons-logging:1.1.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.5 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.2.5 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency commons-logging:commons-logg
03-11 17:36:32.729 22233-22233/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x430f3140)
03-11 17:36:32.729 22233-22233/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tempura.storagewidget, PID: 22233
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tempura.storagewidget/com.tempura.storagewidget.HelpTopicActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.ads.AdView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2318)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at and