Sunday, December 29, 2013


The technology that still works even if cell signals are blocked ( i.e.  cell phone jamming ) is Beacon or  iBeacon (apple) :

"They are poised to transform how retailers, event organizers, transit systems, enterprises, and educational institutions communicate with people indoors. Consumers might even want to deploy them as part of home automation systems ."

With iBeacons :

"companies will be able to provide deals to people that are walking past their stores. But for now, iBeacon will simply help people that are already inside an Apple retail location." [more]

Payments - Proxima Wallet :

"On the user’s side, there is no physical credit card to take from your wallet; you do everything in the app. On the vendor’s side, there is no card reader that needs to be plugged into your phone; the iPhone itself, as you bought it, is the cash register. No swiping required"

'you’re able to get an approximate range in terms of distance to the beacon,” Nolan says. “So you join the queue to buy something from the vendor and when you get to the top of the queue the vendor can take your order, which is all seamlessly handled by the software the vendor uses. You approve the purchase and the entire communication is handled securely over the multipeer APIs Apple shipped in iOS 7, and proxied through the vendor’s device if your device does not have a currently responsive Internet connection'

Thursday, December 26, 2013

Javascript has landed in iOS : "implement a roughly Node.JS-compatible interface using JavaScriptCore.framework on iOS 7 and OS X Mavericks" : "Node.JS interpreter as an iOS app," : "JavaScriptCore gives developers deep access to the full JavaScript runtime from Objective-C. You can syntax-check and execute scripts, access variables, receive callbacks, and share Objective-C objects, making possible a wide range of interactions." : "Apple’s iOS7 is the first iOS operating system to officially support JavaScript as a mobile development language in Apples XCode tool chain. Apple’s iOS7 support of JavaScript inline with your Objective-C code validates JavaScript as the leading (and only) non proprietary language that is supported within the iOS development environment by the device manufacturer."

Thursday, December 19, 2013

Ev Williams on what u can do online

The Javascript vs Native facts

"But the real elephant in the room here is that in all these articles on this subject, rarely does anyone actually quantify how slow JS is or provide any sort of actually useful standard of comparison. (You know… slow relative to what?) To correct this, I will develop, in this article, not just one useful equivalency for JavaScript performance–but three of them. So I’m not only going to argue the “traditional hymns” of “wa wa JS is slow for arbitrary case”, but I’m going to quantify exactly how slow it is, and compare it to a wide variety"...

Sunday, December 1, 2013

Node.js school
>npm set http-proxy --global
>npm install -g learnyounode
>learnyounode select hello world

Write a program that prints the text "HELLO WORLD" to the console (stdout).

HINTS: To make Node.js program, create a new file with a `.js` extension and start writing JavaScript! Execute your program by running it with the `node` command. e.g.:
Created file1.js:
var http = require('http');
http.createServer(function (req, res) {
       res.writeHead(200, {'Content-Type': 'text/plain'});
       res.end('I Have arrived!\n');
}) .listen(1337, '');
console.log('Node Server running at');
>node file1.js
Node Server running at
I Have arrived!

>learnyounode select my first i/o!

Write a program that uses a single synchronous filesystem operation to read a file and print the number of newlines it contains to the console (stdout), similar to running `cat file | wc -l`.
The full path to the file to read will be provided as the first command-line argument.

To perform a filesystem operation you are going to need the `fs` module from the Node core library. To load this kind of module, or any other "global" module, use the following incantation:
   var fs = require('fs')

Now you have the full `fs` module available in a variable named `fs`.
All synchronous (or blocking) filesystem methods in the `fs` module end with 'Sync'. To read a file, you'll need to use `fs.readFileSync('/path/to/file')`. This method will return a `Buffer` object containing the complete contents of the file.

Documentation on the `fs` module can be found by pointing your browser here:
C:\nodehome\AppData\Roaming\npm\node_modules\learnyounode\node_apidoc\fs. html

`Buffer` objects are Node's way of efficiently representing arbitrary arrays of data, whether it be ascii, binary or some other format. `Buffer` objects can be converted to strings by simply calling the `toString()` method on them. e.g. `var str = buf.toString()`.

Documentation on `Buffer`s can be found by pointing your browser here: C:\nodehome\AppData\Roaming\npm\node_modules\learnyounode\node_apidoc\buf fer.html

If you're looking for an easy way to count the number of newlines in a string, recall that a JavaScript `String` can be `.split()` into an array of substrings and that '\n'. Using this method you'll end up with an array that has one more element than the number of newlines.
var fs = require('fs');
var buf = fs.readFileSync('C:/logs/test.log');
var str = buf.toString();
var newstring = str.split('\n');
console.log('split ' + newstring);
var n = newstring.length -1;
console.log('count in file ' + n);

>learnyounode run file2.js Running "my first i/o!"...

 >learnyounode list