Skip to content

Instantly share code, notes, and snippets.

State of the Values
April 2014: Infant Edition
John Rose, Brian Goetz, and Guy Steele
“Codes like a class, works like an int!”
This is a sketch of proposed enhancements to the Java Virtual Machine instruction set, and secondarily to the Java Language, to support small immutable, identityless value types. (They may also be considered as identityless aggregates, user-defined primitives, immutable records, or restricted classes.) This is an early draft, intended to describe the overall approach. Readers are expected to be familiar with the JVM bytecode instruction set.
Background
The Java VM type system offers two ways to create aggregate data types: heterogeneous aggregates with identity (classes), and homogeneous aggregates with identity (arrays). The only types that do not have identity are the eight hardwired primitive types: byte, short, int, long, float, double, char, and boolean. Object identity has footprint and performance costs, which is a major reason Java, unlike other many object oriented languag
@nighthawk24
nighthawk24 / Getting Started with Android Design & Development
Last active August 29, 2015 14:01
Getting Started with Android Design & Development
Notice the inclusion of both Design & Development as Android App creation includes heavy focus on User Interface design
with all possible kinds of objects like buttons, imageviews, layouts, etc; unless the Android project is focused on
designing a service based component only, like web proxy, background sound calibration, background data collection and
uploading (having no User Interface).
Prerequisites:
- Basic Java knowledge: http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter01/features.html
- Basic XML, drag and drop UI Building
- Comfort of using IDEs: Eclipse(Google ADT for Android) or IntelliJ IDEA(Android Studio for Android)
- Basic SQL Database knowledge: Vogella is a great resource http://www.vogella.com/tutorials/AndroidSQLite/article.html
@nighthawk24
nighthawk24 / ACH Codes
Created May 14, 2014 17:19
Provided by ZenPayroll
ACH Return Codes
R00 Manually Cancelled
R01 Insufficient Funds
R02 Account Closed
R03 No Account/Unable to Locate Account
R04 Invalid Account Number Structure
R05 Unauthorized Debit to Consumer Account Using Corporate SEC Code
R06 Return per ODFI's Request
R07 Authorization Revoked by Customer
R08 Payment Stopped
Tar, (short for tape archiver), is a versital tool that can be used for archiving files to disk or any other device as easily as tape. In fact, if you don't work in a data center, you will probably never use tar with a tape drive.
Often, Unix/BSD/Linux files and source code are distributed in a zipped tar file, sometimes called a tarball. Extensions for tarballs are usually .tgz or .tar.gz (gz because it was compressed using gzip, the free GNU zip program). Rarely, you may run across a tar file that is not compressed and has an extension of simply .tar.
Here are some common uses for tar. If you pass a directory or a wildcard to tar, it will include all subdirectories in the tar file by default.
Create a gzipped tar archive
tar czvf backup.tgz files-to-backup
Create a gzipped tar archive, preserving file permissions
tar czvpf backup.tgz files-to-backup
LG G3 @ 1x: 360×640
Nexus 5 @ 1x: 360×640
Galaxy S5 @ 1x: 360×640
Galaxy S4 @ 1x: 360×640
Galaxy S3 @ 1x: 360×640
Galaxy Note 3 @ 1x: 360×640
Galaxy Note @ 1x: 400×640
HTC One M7 @ 1x: 360×640
HTC One M8 @ 1x: 360×640
Nexus 4 @ 1x: 384×640

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google

Keybase proof

I hereby claim:

  • I am stevegraham on github.
  • I am sg (https://keybase.io/sg) on keybase.
  • I have a public key whose fingerprint is DB6D 0AB8 BEA8 3D90 E1FC B5A8 9E83 7DE0 28E3 4D82

To claim this, I am signing this object:

Verifying myself: My Bitcoin username is +adi. https://onename.io/adi
At over 23k, the current email regexp is getting pretty big. That doesn't include the nested comment
stripping, which adds just over 1k, or the domain literal (IPv4 & IPv6) rules, which add another 1k.
It's a testament to PCRE that it even runs.
(((?:(?:(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*
))?(?:\x28(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+
)*))?(?:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|[\x21-\x27\x2A-\x5b\x5d-\x7e])|(?:\x5c(?:\x0a*\x0d*[\x00
-\x09\x0b\x0c\x0e-\x7f]\x0a*\x0d*)|(?:\x5c[\x00-\x7f]))))*(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x0

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
L2 cache reference ........................... 7 ns                     14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns                     20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory