Mashape Text Sentiment Analysis API

The Text Sentiment Analysis API on Mashape is intelligently enough to detect the sentiment of a given text or paragraphs. It is useful in social media data mining. To automatically know what your customers talking about, how they feel for the products. By consume this API you need a Mashape API client to proceed. You can use this API in your web application or native mobile application.

Visit here for more information.

Related Posts:

Mashape Weather API
Mashape Air Quality Index

Linode Account Balance Enquiry API

Linode is a cloud hosting platform provides varieties of Linux based OS (ubuntu, cent-os, and more). It does provide an API to dynamically provision Linode cloud, like add new node, upgrade/downgrade plan, and account API. It does provide Prepaid service by credit card. In case you purchase $20 plan, you can pay in advance the amount stored in your account, it will be deducted every first week of month.

I owns a Linode. Normally I paid one or two months fee in advance. I have to create my own reminder or randomly remember, Oh, just need to pay Linode again. I had to log in to Linode Member Dashboard to check my account balance every time.

After 9 months of Linode experience, I began finding its API and found this API very useful, its Account Balance Enquiry API.

This simple API allows me to query my current account balance, and then compare with the threshold I define, if it is lower than the threshold, then I can receive iPhone Push Notification.

I set a Cron Job to execute the following PHP script which then send the notification. The details of setting up Push Notification for iPhone is not in this topic.

< ?php

$threshold = 20;

$api_key = '<your api key here>';
$result = json_decode(file_get_contents('https://api.linode.com/?api_key='.$api_key.'&api_action=account.info'), TRUE);


if($result['ACTION'] == 'account.info') {
	$balance = floatval($result['DATA']['BALANCE']);
	$balance = abs($balance);
	$message = 'Linode Account Balance is '.$balance;
	if($balance < $threshold) { 		$message .= ', lower than threshold '. $threshold; 	} 	sendAPN($message); } echo '1'; ?>

Improve your selfie: Researcher can predict a photo’s popularity

Improve your selfie: Researcher can predict a photo’s popularity

(Phys.org) —Want to rack up more views for your selfie? We can’t all take our photos with the president, but a new tool developed by an MIT PhD can help us predict how popular our photos will be.

Link: http://phys.org/news317633273.html

Experiment Application Access FTP from Internet Browser

Experimenting an application, which allows access FTP from Internet Browser (http://browserftp.herokuapp.com) on an user friendly web page.

User can connect to their FTP host which publicly accessible, and then browse through the folders and files, can view/edit single file, support upload multiple files.

This application is Ajax-based and is able to refreshing, loading the part of the UI (User Interface), like directory tree, without reload whole web page. The UI is designed using Bootstrap Template and heavily using jQuery to manipulate the web page. It used FormData to implement HTML5 file upload feature. It used Server Side Event during file upload whenever to report the file upload progress.

The server side is implemented using Node.JS + ExpressJS. ExpressJS is greatly helpful when creating RESTful and clean interface, and when integrating with the UI. Node.JS FTP Library is used to implement the FTP connection from Node.JS server to user’s FTP server. String-stream is used to convert the uploaded file stream into FTP upload stream. Crypto library is used to perform encryption on the process.

FTP Browser Login Page
FTP Browser Login Page

Titanium Mobile Performance in add-removal views

In Titanium Mobile development, there is a performance penalty when trying detach or attach View object to a Windows object in the circumstances the View object containing many child objects.

Trying to implement master detail view I have a function called showItemPage() which will create a View object, and a bunch of button and label plus event listener, and attach to this View, where this view will attach into a master Window object. If there is previous other View added into Windows object, the previous view must be detached and removed before the new View can add into Windows object. The performance penalty arisen when I create the view object, and add a lot of objects inside, and then at the last attach the View into Windows object. The solution of this problem is tricky, just move “attach View into Windows object” code into the front just after you create the View, before you adding any children object into the View.

I wonder when adding the View object into a Window object, it become very slow when View object contains many child objects, but it is very fast when initially no any child objects added inside.

Side Note: to implement this I will create an object to hold the current active item view in outer context, then check every times, if the current active item view is exist, then remove that view from the Windows object, before adding the new view created to the Window object, and then set this view to current active item view.

Sample code:

if(activeItemView != null) {
	masterWin.remove(activeItemView);
	activeItemView = null;
}
activeItemView = itemView;
masterWin.add(activeItemView);