Apache Mahout A Machine Learning Library

Apache Mahout which is a Java based machine learning library released under Apache License.

Currently Mahout supports mainly four use cases: Recommendation mining takes users’ behavior and from that tries to find items users might like. Clustering takes e.g. text documents and groups them into groups of topically related documents. Classification learns from exisiting categorized documents what documents of a specific category look like and is able to assign unlabelled documents to the (hopefully) correct category. Frequent itemset mining takes a set of item groups (terms in a query session, shopping cart content) and identifies, which individual items usually appear together.

Learn more at https://cwiki.apache.org/confluence/display/MAHOUT/Mahout+Wiki

Have a QuickStart at https://cwiki.apache.org/confluence/display/MAHOUT/Quickstart

Overview for Functional Programming

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state.

In practice, the difference between mathematical functions and notion of a “function” used in imperative programming is that the imperative function can have side effect, it changes the program state. Means the same language expression can have different results over time, but functional programming is not, the data is immutable, unchangeable, the same language expression always lead to same result.

Functional programming promotes higher order function, that it is able to pass function as a parameter to other function.

In JavaScript,


var len = function(list) {
return list.length;
}
var sum = function(list) {
var total = 0;
for(var i = 0; i < list.length; i++) {
total += list[i];
}
return total;
};
var avg = function(list) {
var total = c(list, sum);
return total / c(list, len);
};
var c = function(list, m) {
return m(list);
};
var a = [1,2,3,4,5];
c(a, sum); // 15
c(a, avg); // 3

Many languages support Closures, the popular one is JavaScript, F#, Erlang, Scala (JVM Language). Java 7 is adding support declaration of Lambda function. Excitingly, PHP 5.3.0 started to support anonymous function now.

Before Java 7 is introduced, we also can declare anonymous classes (a class without assigning reference). From inside the method of anonymous classes to access the variable outside the scope of the anonymous class, the variable should declared as final. Means, the variable must be immutable, unchangeable, otherwise it caused side effect.


final int a = 0;
new SomeClass() {
void someMethod() {
System.out.println("a: " + a);
}
}

But sometimes we want to achieve some simple computation, we may just define an anonymous function passed as an argument to other function.

More Information

PHP 5.3.x
http://jburrows.wordpress.com/2011/06/24/the-state-of-functional-programming-in-php-5-3-x/

 

Wolfram alpha recommended

I found an apps that intelligent enough to query various type of information and computational knowledge.

My sister introduced to me and we purchased and installed to our iOS device. It helps us to perform many complex math problem.

Wolfram alpha: http://www.wolframalpha.com/

Near Field Communication

Near Field Communication (NFC) technology makes life easier and more convenient for consumers around the world by making it simpler to make transactions, exchange digital content, and connect electronic devices with a touch.

A standards-based connectivity technology, NFC harmonizes today’s diverse contactless technologies, enabling current and future solutions in areas such as:

  • Access control
  • Consumer electronics
  • Healthcare
  • Information collection and exchange
  • Loyalty and coupons
  • Payments
  • Transport

Near field communication (NFC) is a set of standards for smartphones and similar devices to establish radio communication with each other by touching them together or bringing them into close proximity, usually no more than a few centimetres. Present and anticipated applications include contactless transactions, data exchange, and simplified setup of more complex communications such as Wi-Fi. Communication is also possible between an NFC device and an unpowered NFC chip, called a “tag”.

Comparison between NFC and Bluetooth

NFC Bluetooth
Network Standard ISO 13157 etc. IEEE 802.15.1
Network Type Point to Point WPAN
Range < 0.2m < 10m
Frequency 13.56 MHz 2.4–2.5 GHz
Set-up time < 0.1 s < 6 s

There is a rumor saying that iPhone 5 is one of the several devices that will shipped with NFC-enabled smartphones and probably released in year 2012.

Android 4.0 the just released version includes new features called Android Beam that equips Android device with NFC communication.

Google Wallets is a mobile payment solution released by Google that uses NFC to complete the tedious mobile payment process just a single touch.

Services in cities and countries that employed NFC technology

Singapore Mobile payments:MasterCard, DBS Bank, StarHub, EZ-Link, Gemalto
Malaysia Maxis FastTap

 

More about NFC (http://www.nfc-forum.org/aboutnfc/)

Titanium Studio 1.0.8 Update greatly improve module packager process

With latest Titanium Studio 1.0.8 update and its latest SDK 1.8.1, it is now easier to create Titanium iOS module and packaged into Titanium mobile apps. I am able to code the iphone torch controller (flash light) in Objective-C and compiled into module and invoked from Titanium JavaScript API.

Just to remember to change the Apps Project release to use armv7 (standard).

Last three weeks I tried to do the same thing in older version of Titanium Studio but I failed to make it even I followed the completed steps for manually creating module skeleton templates using command utility tool.

The latest Titanium Studio 1.0.8 Update really improve module packager process.