My Cheat sheets

sqljoins



vim_cheat_sheet_for_programmers_screen

OpenStreetMap – Wikipedia for maps

OpenStreetMap is a website for collaborative mapping. I just signed up and spent about an hour editing the map nearby my apartment and workplaces. It was so much fun. Added a bunch of bus stops, library, grocery supermarkets and banks. Its good that we have an alternative to Google map and it belongs to no one and everyone.

http://www.openstreetmap.org

List of online courses sites

CanopyLAB is an interactive learning LAB for youth from across the world
CourseBuffet: http://www.coursebuffet.com
Data Camp datacamp.com
http://www.mooc-list.com/
CourseSites MOOC Catalog
Curcle http://curcle.co
Mytestbuddy: http://mytestbuddy.com
Berkeley Webcasts: http://webcast.berkeley.edu/
Carnegie Mellon: http://oli.cmu.edu/
[Read more…]

How to get the real time bus location for sf muni:)

Download the ‘MUNI Live’ android app

Get it on Google Play

https://play.google.com/store/apps/details?id=com.hellothupten.sf_muni

[Read more…]

If statement is not always followed by a condition in java

This code will compile and run. Notice the assignment operator(=) in the condition.

boolean a;
boolean b = true;
if(a=b){
   //do anything;
   //this compiles
}

But this won’t compile

int a;
int b = 5;
if(a=b){   
   //notice its still = not ==
   //do anything;
   //this does not compile
}

The reason is because the previous code’s a is of

boolean
type and the latter’s is of
int
type.

if
statement is not necessarily followed by a condition.
a=b
is not a condition. Its an assignment. But it works if the left variable (i.e. a) is of a boolean type.

So its better if we think

if(boolean)
instead of
if(condition)
. Anyway, a condition like a==b or a>b etc will result a boolean result.