Monday, March 24, 2014

Blogs I advocate



Google Testing is a must-read for any serious software developer who cares about code maintainability, and what is considered best practice in the industry. I found the blog via their post on testing doubles, and highly recommend following going through "Testing on the Toilet".

Cal Newport is a Dartmouth and MIT graduate who lately became an assistant professor in Computer Science at Georgetown University. I've found his Straight-A post series to be an inspiring condensation of educational common sense, and his driving philosophy that "mastery leads to passion" a gem to keep life in perspective.

Joel on Software is much lauded and you will often find him referenced elsewhere on the Internet. His post on 12 Steps to Better Code is a must-read. The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) is something you will eventually read, no matter what you think now.

Martin Fowler writes excellent posts on software design, Agile development, code refactoring, and NoSQL.

42Go Engineering always writes crazy interesting posts for Scala developers.

JOOQ offers neat perspectives on SQL practices.


Monday, March 17, 2014

QR codes



Visit my LinkedIn profile by scanning this QR code!

What are QR codes?
The "QR" in QR codes stands for "Quick Response." QR codes are a type of barcode invented in 1994 by the Japan-based Denso Corporation in an effort to store more information than the usual vertically striped UPC barcodes:


A QR code involves a square grid of black and white bits, and can either range from a 1x1 square, to a 40x40 grid. The larger the grid, the more information can be encoded. A QR code is essentially a method of information compression. Although it was initially used to store information on manufactured components by Denso, after its release to the public, QR codes are now often used to store URLs to websites or URLs that allow access to applications. 

There are four levels of error correction possible for QR codes: Low (7% codeword restoration rate), Medium (15% codeword restoration rate), Quartile (25% codeword restoration rate), and High (30% codeword restoration rate). For example, with a Quartile QR code, as long as more than three-fourths of the QR code is not damaged, the QR code will still work. The general way to think of it is: "as long as the damaged fraction of the QR code doesn't exceed the codeword restoration rate, the QR code will still work."

How do you use a QR code?

  1. Find a QR code scanner for your phone, be it a Blackberry, an Android, or an iPhone.
  2. Scan the barcode.
  3. See where the barcode takes you!


Tuesday, March 11, 2014

Why it's important to encrypt your data

People generally only care about securing their data and ensuring their own privacy as far as it is convenient to do so. According to A Large-Scale Study of Web Password Habits published by Microsoft Research in 2007, "Users choose passwords with an average bitstrength of 40.54 bits. The overwhelming majority of users choose passwords that contain lower case letters only (i.e. no uppercase, digits, or special characters)."

The "nothing-to-hide" argument is invalid. Just because one has nothing to hide does not necessarily mean that one has nothing to show. "Having nothing to hide" is equivalent to saying "having nothing one would not be willing to show," which means one is totally comfortable with the potentiality of identity theft that comes with a lack of security. Identity theft notwithstanding, one also needs space in order to think and develop one's identity.

Security is a tradeoff between convenience and privacy.




http://research.microsoft.com/pubs/74164/www2007.pdf
http://www.techhive.com/article/226785/encrypt_your_hard_drives.html
http://www.wired.com/gadgetlab/2012/11/ff-mat-honan-password-hacker/all/

Kravats, D. (2013, April 23). Here's a Good Reason to Encrypt Your Data | Threat Level | Wired.com. Retrieved from http://www.wired.com/threatlevel/2013/04/encrypt-your-data/

Monday, March 10, 2014

A Comparison of Open Source Java Web App Frameworks: Spring vs Play!




In the old days, Java web programming was done with Java Web Servlets, and HTML was embedded inside of Java "servlet" code that was placed in "web containers" that interacted with actual servers. This is what servlet code looks like:



Click the sample code above to see a more full-blown example of the process.

Every single time servlet code changes, one needs to stop and start the server running the servlet. This doesn't sound like a big deal; after all, most coding workflows require recompilation and re-execution for every change we make.

As this StackOverflow answer says, Spring is a framework that primarily serves to "wire" components together.

Inspired by Ruby web application frameworks such as Rails and Sinatra, Play Framework differs from Spring in that it supports Scala development and it detects changes to files and automatically recompiles and restarts the server on those changes.

Packaging for distribution in both Play and Spring are both rather straightforward. Either run "play dist" for Play or "./gradlew build" for Spring.

Both Play and Spring support asynchronous programming with Comet WebSocket.



What does the Spring framework do? Should I use it? Why or why not? [closed]. (n.d.). java. Retrieved March 17, 2014, from http://programmers.stackexchange.com/a/92672/79516 Spring. (n.d.). Spring. Retrieved March 17, 2014, from http://spring.io/

Monday, March 3, 2014

About Me

This is a practice post in preparation for the Summary snippet on LinkedIn.





I'm interested in mastering functional programming techniques, becoming more efficient in web development, and visualizing data.

I worked with basic NodeJS in my Spring 2013 coursework, and picked up JQuery two weeks before the summer started. At my first internship during the past year, I've built an internal web app that essentially acts as a Google Docs & Google Forms replacement with pagination using Scala Play, PostgreSQL, and ExtJS.

In addition to learning new frameworks and Scala, I've learned a lot on how to code and about myself.
  • Automated testing can literally save months by shortening how long it takes to get feedback on code and preventing regressions.
  • Git is essential for being the time machine for code that it is.
  • Always understand "best practices" before writing any code.
  • To deal with the current reality, no matter what my previous time expectations were.
  • The more I don't know, the simpler problems seem, and the more likely optimistic underestimates will happen.
  • Rest is necessary for productivity. "Enjoyment predicts efficiency." - Eric S. Raymond.
I am currently dabbling in Javascript visualization library D3js and the Neo4j graph database in my spare time, along with Java Play and Haskell for some school projects. Any opportunities involving contact with experienced developers in Haskell, Java, Scala, Play Framework, Neo4j, or D3js are especially welcome.



On Management and the Maginot Line. (n.d.). On Management and the Maginot Line. Retrieved March 16, 2014, from http://www.catb.org/esr/writings/homesteading/cathedral-bazaar/ar01s12.html