Saturday, May 16, 2009

Twimr02: Five Useful stuff in last 10 days

This is the second edition of my Twimr series. I have started twimr series on my blog to collect various useful stuff via twitter. by tagging my twitter update with a HashTag #twimr.
Today i jus reviewed my twimr basket and I found 5  useful stuff in my basket. Lets know about it.
  1. SlideShare Transcript Viewer: I keep admiring Christian Heilmann for his simple and useful innovations, This is another quick hack from him. If you frequent slide share user, then this might be useful for you.
  2. Gesture recognition in GWT and IT Mill Toolkit: There is lots of innovation happening around the world using Wii Remote Controller, This might, inspire you to create next killer app using this.
  3. Third item in my basket is a real funny thought (was set as status of gTalk by one of my friend) That is “Never hold your farts in. They travel up your spine, into your brain, and that is where shitty ideas come from.”
  4. Mashup Generator: This is a cool web based fully drag and drop supported mash-up creator written by a Korean guy. Nice stuff!
  5. 8 Cool Tips & Tricks to Make Most Of Google Chrome: Dont you think, title itself explaining everything, :) I don't have much to say!!

Thursday, May 7, 2009

Fix JSON based Ajax in Chrome

I love JSON, because its very easy to work with JSON than working with XML. If you don't know what JSON is please read in detail here http://www.json.org/.
Here i am discussing the use of JSON and the JSON retrieval method for AJAX. This method does not work in Chrome, because chrome maintains a JavaScript cache. I will discuss the fix of this problem as well.
Lets take an example code, which will grab data from twitter search and it will display on your page.
<html>
<head>
<script>


   1:  
   2:     function getsearch()
   3:     {
   4:       var search_url='http://search.twitter.com/search.json?callback=mycallback&q=';
   5:       /*search_url will fetch you JSON with callback name as mycallback*/
   6:       var query='';
   7:       query=document.getElementById('query').value;
   8:       search_url=search_url+query;
   9:       var scrpt_div = document.getElementById('script_div');
  10:       scrpt_div.innerHTML = '';
  11:       var scrpt_ele = document.createElement('script');
  12:       scrpt_ele.src = search_url;
  13:       scrpt_div.appendChild(scrpt_ele);
  14:       var result_div = document.getElementById('result_div');
  15:       result_div.innerHTML = 'loading....';
  16:     }
  17:     function mycallback(data)
  18:     {
  19:       /*write code here to do the JOB*/
  20:       var html='';
  21:       for(var i=0;i<data.results.length;i++) 
  22:       { 
  23:         var tweet=data.results[i].text/*aah.. luxury of jus using the data, no parsing*/
  24:         html=html+tweet+'<br/>';
  25:         
  26:       }
  27:       var result_div = document.getElementById('result_div');
  28:       result_div.innerHTML = html;
  29:     }
  30:   
</script></head><body><div><form action="javascript:void(0)"> <input id="query" type="text"></input> <input type="submit" onclick="getsearch();" value="search"></input> </form> </div><div id="result_div"><!--Here your Result will appear --></div><div id="script_div"><!--Here your JSON script will come <script src="http://search.twitter.com/search.json?callback=mycallback&q=hello"> </script> --></div></body></html>

 Get this code in plain here .

In this code above, we are simply embedding a script element in the DOM whose src attribute will be the URL to retrieve JSON data (e.g http://search.twitter.com/search.json?q=hello’.) The URL will contain the call-back so that retrieving the JavaScript code for this element will result in calling your call back function and hence you will be able to use this JSON data in your call-back function.

The above code is hosted here, so try Demo1

If you try this code in Chrome browser, for a same query it will not work for the second time! Reason is Chrome does smart caching of JavaScript. So if it will find that the new script tag has same src  URL, it will not include that for second time,  and hence it will not work second time in chrome.To fix this problem, I have added in extra parameter in the JSON query URL. which will be a fake counter.
Instead of JSON URL like this
var search_url='http://search.twitter.com/search.json?callback=mycallback&q=';
you can modify by adding extra query parameter which does not mean anything to server. like this :
var search_url='http://search.twitter.com/search.json?callback=mycallback&count='+fake_counter+'&q=';
Increase the fake_counter on every call. So that new URL will be different from the previous one. This will fix the problem in chrome.


Now this fix code in PlainText is here and Demo2 is here

Wednesday, May 6, 2009

Twimr:Lets start this series

Twimr- stands for: ‘Things Which Ignited Me Recently’.

This is a new blog series i am starting today. This is first post of this series.  Goal is to post this series everyday, and mostly collect data via twitter, with a hash tag ‘#twimr’.

Now, here are the few things which ignited me recently.

Thanks watch out for more..

Wednesday, April 29, 2009

How to choose a phone: Role of chipset

When you go out to buy a phone, you look for cool applications, you look for cool user interface and multi touch kind of stuff.One thing you forget to notice! who is running your cool applications?
image
QUALCOMM's chipset based phones.
Very similar to desktop computer, every phone has a processor, which runs your application, but in mobiles, processor is not directly shipped via processor company. (for example in your laptop the processor might be directly coming from  Intel’s fabrication plants or from AMD). In case of mobiles something which is called chipset is manufactured and goes into the mobile handsets. As name suggest a Chipset is not only one thing, but its a set of chips. It includes processor, modem circuitry, power management unit and digital signal processing unit.
Most of the chipset manufacturing companies are using mobile processors as ARM. it means they use ARM architecture for their processing unit. ARM is just an architecture, things can only work when it will be installed on a platform nicely to get the thing work.
Now when it comes to performance, its all about how these things are kept together! There are several companies, which are putting these things together.
I specially want to talk and discuss about Qualcomm’s Chipset. As they evolved from a modem company they have best modem in the market. When it comes to mobile phone, the primary role of the phone is to talk wirelessly. So modem’s efficiency becomes critical. A better modem will also help you to get faster Data rate ,when it comes to data application.
The second most important thing for mobile is the way your voice is processed. How clear and crystal sound you hear from you partner, while you talking on phone. This is done by the digital processing unit in your phone. Qualcomm has best voice processing algorithm in the market.  So when you use any QUALCOMM chipset based phone you will feel the difference.
Now! when you are OK with the primary functionality of phone, you need your phone’s UI to run smoother. Have you ever wondered why high end phones which is based on the chipset of some other companies run so slow? Its because the applications hunger for processing time is not properly fulfilled by underlying chipset.
Most of the latest smart phones like HTC diamond, Samsun Omnia, Sony’s Xperia. All these phones are based on QUALCOMM’s chipset. The series name the chipset which is used by these phone is 72xx. This series chips are having 2 ARM processor in it and separate ‘digital signal  processing’ units. By this way your application and modem runs on 2 different places and hence lighter the load on processor and hence the smoother the UI. Clock rate of this chipset was 400 MHz.
Upcoming QUALCOMM chipset is a  giant platform which is having 1GHz CPU. this the first of its own kind. the name of this upcoming platform is ‘Snapdragon.
So if you are going to buy a phone, go to the market and ask which chipset it has. blindly you can trust on Qualcomm chipsets. they are high performance chipset.
If you are a developer, get yourself ready to develop the applications which is capable enough to Hog this much processing power. 

Tuesday, April 14, 2009

Chill yourself and use tweetactive API

tweetactive.com deals with activeness of people and keyword on twitter. Now tweetactive is exposing few APIs which might help you to build some cool badges which you can be hosted on your blog( or at different random places).

1.ProfileImage

This is simple REST API to get your twitter profile image. (
http://www.tweetactive.com/profileimage?q=yourtwitterid
you can directly display image like
    <img src=”http://www.tweetactive.com/profileimage?q=yourtwitterid”/>

2.getfancybadge
This is to show your tweetactiveindex. tweetactive index is dynamic time decaying value, which shows that how active you are on twitter.
TweetActiveIndex of yours will decay with time if you don't tweet. In one word: more the tweetactive index more you have tweeted in recently. The decay rate also depends on how much you have tweeted.
http://www.tweetactive.com/getfancybadge?id=yourtwitterid
    Note: this uses query string id.

image 3.GetActivity
what ever you see on twitter badge can be retrieved in JSON format using this API.
http://www.tweetactive.com/getactivity?q=markandey&callback=hello

4.twittercompare

 

image TwitterCompare is a REST CHART API, which shows you the real time motion chart to track the activeness of a keyword.
    simplest form is
http://www.tweetactive.com/twittercompare?q=keyword1,keyword2
you can resize the chart like
http://www.tweetactive.com/twittercompare?q=keyword1,keyword2&w=300&h=200
you can change the method for comparing
http://www.tweetactive.com/twittercompare?q=keyword1,keyword2&w=300&h=200&m=getkeywordactivity [default]
http://www.tweetactive.com/twittercompare?q=keyword1,keyword2&w=300&h=200&m=gettwitterlove
    gettwitterlove makes intelligent calculation and gets a value which will be corrected by the way people tweet. like iPhone might me popular keyword but popularity does not lies in using that keyword but when people praise the iPhone and not when they criticize it.
5.rtkey

image
http://www.tweetactive.com/rtkey?q=yourquery
View this page when you are lazy.
This is a real-time tracking portal where you can get real-time updates of any keyword on twitter. You need not to refresh the UI. refreshing is automatically done.
this page also displays the trending list at the top.
UI is deliberately made black to give your eyes some rest, while you lazily tracking some event.

Watch a demo on YouTube video http://www.youtube.com/watch?v=VxAPV9e98x4