2013-11-09

Guido Says: Python 3 Things Still Unsolved: Multi-Line Lambda

lol. In Guido's python 3 retrospect, his last item is: “Things still unsolved: Multi-line lambda”.

Python 2 vs. Python 3: A retrospective By Guido Van Rossum. @ www.dropbox.com…

See also:

Example of JavaScript Sort Method Using Custom Sort Function

Example of JavaScript Sort Method Using Custom Predicate

// array sort example
var aa = ["a1", "a70", "a8", "A2"];

// default sort. element compared as string
aa.sort();
console.log(aa);                // [ 'A2', 'a1', 'a70', 'a8' ]

// sort by comparing as numbers after first char
aa.sort(ff);
console.log(aa);                // [ 'a1', 'A2', 'a8', 'a70' ]

function ff (x,y) {

    var nx = parseInt(x.slice(1)); // remove first char. consider rest as number
    var ny = parseInt(y.slice(1));

    if ( nx < ny ) { return -1; }
    if ( nx > ny ) { return 1; }
    if ( nx == ny ) { return 0; }
}

see more at JavaScript Array Methods

2013-11-07

How to Connect BlackBerry PlayBook to Linux

Perm URL with updates: http://xahlee.info/comp/blackberry_playbook_unable_to_delete_file.html

  1. • plug in the USB between PlayBook and Linux machine.
  2. • on PlayBook, go to 〖About〗, find the USB IP address of the PlayBook. In the About screen, the Network menu. Note, it's the USB'S IP address, not the wifi ip address.
  3. • on PlayBook, go to 〖storage & sharing〗, set the menu “USB Connections” to “Connect to Window”. In the “File Sharing” section, turn it on.
  4. on Linux, just open a folder, and in the address type smb://169.254.134.77/, where the IP is your IP.

BlackBerry PlayBook is the worst tablet.