Arxiu: 2016/12

Java cheasheet

1System.out.printf("%3d ", n); // print number with spaces. 1Arrays.copyOfRange([1,2,3], 1, [1,2,3].length); // subarray from 1 to length array Initialize 2 dim array 1int[][] arr = new int[2][2];

Python cheasheet

Get content of URL 12import urllib2print urllib2.urlopen('').read() Remove chars and split by , from a string convert to list 1'jshfjshfjsh[]'.translate(None, '[] "\n').split(',') Dif

SQL cheasheet

In same query you can refer to same table twice 12345select firstname, lastname from names as a, names as b WHERE a.firstname = b.firstname AND a.lastname != b.lastname