This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Superposition: | |
https://www.youtube.com/watch?v=7-DmVBLaydE | |
R-2R Ladder: | |
https://www.youtube.com/watch?v=VKfx7e88uYI | |
R/L/C Impedance: | |
https://www.youtube.com/watch?v=hjxJIB5kUA4 | |
R/C Circuit & Filter: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Strategy Pattern | |
Define a family of algorithms, encapsulate each one and make them interchangeable | |
Lets algorithms vary independently for clients of that class | |
class List { | |
- Sorting sortType = new DefaultSort(); | |
============================== | |
+ setSortType(Sorting newSort) { sortType = newSort; } | |
+ sort() { sortType.sort(this); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> Execute something on UI Thread from Non-UI Thread <<< | |
runOnUIThread(new Runnable() ...); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recall a bash history entry without invoking | |
###:p /* then press <UP> key */ | |
# GCC - expand pre-processing only | |
gcc -E -o foo.i foo.c | |
# test if file or directory exists | |
[ -f filename ] && ... /* substitute "||" for does NOT exist */ | |
[ -d filename ] && ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=g++ | |
CFLAGS=-c -Wall -I/usr/local/opt/openssl/include | |
LDFLAGS=-L/usr/local/opt/openssl/lib | |
LIBS=-lcrypto | |
EXECUTABLE1=dh_test | |
EXECUTABLE2=udp-send-dh | |
SOURCES1=dh_test.cpp dh.cpp | |
SOURCES2=udp-send-dh.cpp dh.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialize new local repo | |
git init | |
# add all files in *current* directory (and below) to staging area | |
git add . | |
# commit staged changes | |
git commit -m "<commit_msg>" | |
# checkout last commit on branch 'master' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gopro; | |
import android.os.Handler; | |
import android.util.Log; | |
import junit.framework.Assert; | |
interface Events { | |
void onTimeout(); | |
void onX(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> Convert InputStream to String <<< | |
String text = new Scanner(inputStream).useDelimiter("\\A").next(); | |
OR | |
try (java.util.Scanner s = new java.util.Scanner(inputStream)) { | |
return s.useDelimiter("\\A").hasNext() ? s.next() : ""; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. STUDIO_JDK=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ | |
2. <CMD> + L.Click | |
Navigate to Declaration/Definition | |
3. <OPT> + <CMD> + Left/Right | |
Navigate Back/Forward | |
4. Click on Marker in Marker Bar | |
Navigate to code line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.System: | |
.out.format(String format, Object... args) | |
.arraycopy(Object src, int srcPos, Object dest, int destPos, int length) | |
.currentTimeMillis() | |
java.lang.String: | |
.charAt(int index) | |
.toCharArray() | |
.toUpperCase() | |
.toLowerCase() |
NewerOlder