Monday, December 29, 2008

GWT : How to clear HTML Table completely?

This is the way many programmers cleans HTML Table (FlexTable and Grid are subclass of HTML Table). 

private FlexTable table = new FlexTable();

int i = 0;
for (List row : result) {
   int j = 0;
   for (String element : row) {
      table.setHTML(i, j, element);
      j++;
   }
   i++;
}

Programmer could also add widgets to the Flex table.

table.setWidget(i, j, new Label("Name"));

And to clear the table, programmer call clear() method of HTML table.

table.clear() 

Description of the clear() method says "it removes all widgets from this table, but does not remove other HTML or text contents of cells". So it will remove the label added to the Table but not HTML added in the for loop. Many times it leads you to wrong result.

For example: Lets assume table (4 x 4) contains 'A' in each cell 

AAAA
AAAA
AAAA
AAAA

Now programmer called table.clear() and write (3x3) elements with data 'B'. If he tries to print the complete table, he will see following result which is not expected.

BBBA
BBBA
BBBA
AAAA

How can we eliminate this problem? Solution : remove all the row one by one before adding new data to table.

for (; table.getRowCount() > 0; ) {
   table.removeRow(0);
}

Feel free to comment on this blog.

Friday, December 12, 2008

Running Python Script on the Mac Apache Web Server

The Mac OS X operating system has build in Apache Web Server and libraries to run python script. So user does not need to install any extra software to run python script on apache web server.

Open System Preference -> Sharing window and enable 'Web Sharing' option. It starts Apache web server on your machine. Wow so easy !!!


The default location to place CGI programs for the OS X apache installation is in the following directory:

/Library/WebServer/CGI-Executables

Files placed in this directory can be accessed via the following URL:

http://localhost/cgi-bin/script-name

Lets create a simple python script named hello.py under /Library/WebServer/CGI-Executables directory.

#!/usr/bin/python
print "Content-type: text/html\n\n"
print "<html>"
print "<head>"
print "<title>hello</title>"
print "</head>"
print "<body>Test Page</body>"
print "</html>"

Set the executable permission to the python script (chmod 755 hello.py). Now access this script via http://localhost/cgi-bin/hello.py

If webserver throws some error, please look at the log for detailed information. Logs are stored in /var/log/apache2/error_log file. NOTE: location may differ based on the version of OS and version of apache server.


Thursday, December 11, 2008

Python os.spawnl returns error code 127

In this blog I am giving solution to the most common problem when programmers try to execute os.spawnl command. Most of the programmers get 127 error code at the time of executing command os.spawnl. For example

>>> import os
>>> os.spawnl(os.P_WAIT, 'ls', 'ls', '-l')
127

The error code "127" means that the system can't find the exectuable.

Solution: Use absolute pate of the executable.

>>> import os
>>> os.spawnl(os.P_WAIT, '/bin/ls', 'ls', '-l')
-r-xr-x--- 1 abc unknown 2994 Nov 5 21:25 create_
-rw------- 1 xyz unknown 7938048 Oct 8 19:09 nohup.out
0

Hope, this trick helps you.

Friday, December 5, 2008

Google Friend Connect : adding social features to your site

Google Friend Connect means more people engaging more deeply with your website -- and with each other. By adding Google Friend Connect to your site, you can give social network's effect to your website. Your users can easily invite friends from social networks and contact lists to visit and join your site. Just copy and paste a few snippets of code into your site, and Friend Connect does the rest.




Members Gadget : The Members gadget allows visitors to join your site, sign in and out, see other members, see pictures of their friends, explore other members' profiles, invite other people to join your site and use other social features. 

Wall Gadget : Allows viewers to post comments, or links to videos on your site.

Review & Rate Gadget : Allows viewers to rate a page, or a section of a page.



These are few gadgets which give social network effect to your website with minimal effort. So go and enjoy these cool gadgets.

Wednesday, October 15, 2008

Safety Filter on Orkut : Get rid of mature content

Orkut, Google's social networking site, comes up with new and unique feature called "Safety Filter". Safety filter tries to hide mature contents from users. Users can turn on or turn off this filter from settings page.



Lets see how it works by example.

Currently safety filter of my profile is turn off and I tried to search for 'sex' keyword. I will get result page shown as following image. Obviously profiles/communities with bad contents will come in the search result.



Now lets turn on the safety filter from settings page and try to search for 'sex' key word again.



You can see change in the search results. Obviously it will give profiles/communities which contain 'sex' keyword. But if you look at the first profile which comes first in the search result, that profile contains no mature content. That is the work of Safety Filter.



We can conclude that safety filter works pretty decently but not for all the cases. There are some cases in which we find mature profiles/communities in search result. Help center page of orkut also mentioned that "it is not possible to filter out all the mature content". I would like to say that Safety filter works very well and hope it will become more and more robust as time pass.

As a good orkut users it is our responsibility to make orkut clean as well. If we find any bad/mature content while safety filter is on, we should flag that profile/community to report such cases. In this manner we can help to keep orkut beautiful.

Happy Orkutting :)

Sunday, October 5, 2008

Picasa 3 From Google

Google released 3rd version of Picasa with many new features. New features (retouch your images, create and edit movies, etc) are really amazing. Please look at the video describing new features of Picasa 3.




Major features of this version
  • Retouch your images : Use the Retouch tool to remove unsightly blemishes and improve photo quality.
  • Create and edit movies : Combine your photos, videos, and music into a movie or use the editing room to trim your existing movies.
  • Add text or watermarks to your photos : Easily personalize your photos using the Watermark and Text tools.
  • Get more information about photos : New icons and tools to the Library view to quickly communicate useful information about your photos.
  • And many more...
To know more about all new features and updates, visit http://picasa.google.com

Saturday, October 4, 2008

Mac Update Engine from Google

Update Engine is a OS X framework that can help users keep their products up-to-date. It can update nearly any type of software, including Cocoa apps, screen savers, and preference panes. It can even update kernel extensions, regular files, and root-owned applications. Update Engine can even update multiple products just as easily as it can update one.

The following are some unique features of Update Engine:

  • Can update virtually any type of product (e.g., Cocoa app, pref pane, kernel extension)
  • Can update non-bundle-based products (e.g., command-line tool, plain file)
  • Can update many products at once
  • Solid framework on which to build







For more information please visit official Google Site : Update Engine

Thursday, July 17, 2008

Google Docs Templates

Google docs is an online answer to MS Office. Google docs is becoming more and more popular because of benefit of accessing anywhere where you have Internet access. Google docs also allow you to upload existing documents, spreadsheets, PDFs and many more.

Google docs now launched very useful feature call "templates". Google launch templates for docuemnts, spreadsheets and presentation.


A template gives you a quick start towards creating a document, spreadsheet, or presentation. Each template has boilerplate content and preset design styles that are meant to be reused. To get started, click "Use this template" button, which will create a new document that is a copy of the template. You can then edit the document, replacing boilerplate text and images with your own.

There are many templates which touch over daily life also. For example "Wedding Album", "Photo Album", "Dinner Party Invitation", "Project", "Credit Card Payoff Calculator", "Sales Invoice", "Research Paper", etc. These are only few example of templates. Not it would be very easy for all the users to write effective documents/presentations.

For example, I want to create a new presentation of My baby's photos and sweet memory. I can directly use "Baby soft Album" template for that and every thing is ready for me. I just need to add my baby's photo.


You can rate any templates and also find other users rating for each templates. To find highest rating templates by a click on left side bar.

So Start Creating professional documents, spreadsheets, and presentations in Google Docs.

Enjoy this wonderful feature.. Hurray!!!

Thursday, July 10, 2008

GMail : Great security feature "Remote sign out"

Gmail, the best anti spam mail provided by Google, tighten security of customer's account. Users can protect their account by remote sign out mechanism. Gmail also provides information about where are you logged-in currently. 

In day to day life, normally user open his Gmail account not from just one computer. User can access Gmail account from cyber cafe, home, friend's home or from college/school. Sometime user forgot to sign out from Gmail account. Now because cookie is still alive next person who sits on the same machine can access that account which is not bearable.

Security feature added by Gmail team now allow you to track that other than your computer, where else your Gmail account is open. You can find following information by clicking on details link.
  • Last activity and recent activities on Gmail account.
  • Remote location where your Gmail account is still open.



Gmail gives you more information about current session information which includes your Access Type (Browser, Mobile, etc...) and IP address. 

Gmail provides facility to remotely sign out from all the active session other than your current computer by clicking on "Sign out all other session".


In the era where privacy is main concern, this is right step taken by Gmail team. Enjoy this functionality and keep your account secure.

Tuesday, July 8, 2008

Protocol Buffer : flexible, efficient, automated mechanism for serializing structured data

Protocol buffers are Google's data interchange format. Protocol buffers are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications p frotocols, data storage, and more. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the "old" format.

Protocol Buffers allow you to define simple data structures in a special definition language (C++, Java and Python), then compile them to produce classes to represent those structures in the language of your choice. These classes come complete with heavily-optimized code to parse and serialize your message in an extremely compact format. Best of all, the classes are easy to use: each field has simple "get" and "set" methods, and once you're ready, serializing the whole thing to – or parsing it from – a byte array or an I/O stream just takes a single method call.
Protocol buffers were designed to solve many of these problems:
  • New fields could be easily introduced, and intermediate servers that didn't need to inspect the data could simply parse it and pass through the data without needing to know about all the fields.
  • Formats were more self-describing, and could be dealt with from a variety of languages (C++, Java, etc.)

As the system evolved, it acquired a number of other features and uses:

  • Automatically-generated serialization and deserialization code avoided the need for hand parsing.
  • In addition to being used for short-lived RPC (Remote Procedure Call) requests, people started to use protocol buffers as a handy self-describing format for storing data persistently (for example, in Bigtable).
  • Server RPC interfaces started to be declared as part of protocol files, with the protocol compiler generating stub classes that users could override with actual implementations of the server's interface.
Protocol buffers are now Google's lingua franca for data – at time of writing, there are 48,162 different message types defined in the Google code tree across 12,183 .proto files. They're used both in RPC systems and for persistent storage of data in a variety of storage systems.

Find more information about protocol buffers here:
  • http://google-opensource.blogspot.com/2008/07/protocol-buffers-googles-data.html
  • http://code.google.com/apis/protocolbuffers/docs/overview.html

Saturday, June 28, 2008

Transitions of Bill Gates


Transition One: Coder to Negotiator

Back in 1980, when Gates was barely old enough to rent a car, he walked into a room filled with IBM execs and sold them a product he didn't even have. IBM wanted to get into the computer business, and Bill Gates wanted to get into the software business. He didn't have any negotiating skills, but he landed a deal under which IBM licensed MS-DOS from Microsoft. It was a ridiculously advantageous arrangement since it gave Microsoft the freedom to license the operating system to any other computer maker -- which is what eventually fueled Microsoft's fantastic growth.

Transition Two: Founder to Fortune 500 CEO

Many entrepreneurs are fully brilliant leaders of startups, but they crash and burn when those companies grew beyond the startup stage. There's little overlap between the skill sets involved in running a small startup and those required to steer a major corporation. Bill Gates lead his company to Fortune 500.

Gates matured simultaneously with the company. He learned to tuck his shirt in, comb his hair, and make polite cocktail conversation.

Transition Three: Monopolist to Savvy Defendant

His visions didn't help when the feds came knocking in the late 1990s for one of the longest, most drawn-out antitrust cases in U.S. history. In what has been famously characterized as the 1998 "Rainman" deposition, Gates rocked back and forth in his chair, at times snapping at prosecuting attorney David Boies and generally behaving like a temperamental child. The thing is, it worked. Gates didn't give an inch. And roughly 10 years later, even Boies concedes that Gates' performance was spot on, both in the deposition and on the stand in court.

Transition Four: Captain of Industry to 'Venture Philanthropist'

It was a peculiar situation, though, when, in his early 40s, Gates found himself one of the richest men in the world and had to start thinking about giving away his money, while he was still hungry to earn more. His initial attempts at philanthropy did not go over well.

The Gates Library Foundation, founded in 1997, was widely criticized for being too modest (he initially funded it with $200 million) and for being self-serving. And indeed it was -- the mission of the foundation was to provide libraries in low-income communities with internet access and computers. While a worthy cause, Microsoft was also a beneficiary of the foundation's work.

Thursday, June 26, 2008

Symbian OS v9.5



Symbian OS v9.5 brings high performance features designed for richer consumer and enterprise experiences as well as significant savings to phone build costs and time-to-market, delivering a truly scalable mobile operating system for the global market.

Higher performance for lower hardware cost

Symbian OS v9.5 delivers performance improvements with reductions in requirements on memory, processor and battery, enabling smartphones based on Symbian OS v9.5 to run on feature phone hardware. Key memory optimization features including demand paging and automatic RAM de-fragmentation can reduce average RAM usage in excess of 25 per cent, allowing for more concurrent applications for an even better user experience or enabling licensees to include less memory and reduce phone build cost.

These features and more deliver substantial benefits in the areas of performance and power usage: faster device start-up time, faster start-up time of popular applications such as browser, email and navigation by up to 75%, and improvements on the already highly competitive battery life of Symbian smartphones.

Faster time-to-market

Symbian is continuing to improve time-to-market for handset vendors, system integrators and developers. Symbian OS v9.5 introduces standardized support for digital TV and location-based services (LBS) making it cheaper and easier to bring these popular services to the mass market.

The introduction of a SQL database offers developers a well known interface for storing and retrieving high-cardinality application data. This, together with integrated P.I.P.S. – P.I.P.S. Is POSIX on Symbian OS - helps developers port existing applications from the desktop or server environment to Symbian OS with minimal effort and in less time.

Designed for richer user experiences :

Multimedia

Symbian smartphones based on Symbian OS v9.5 will support rich multimedia experiences with advanced camera features similar to standalone digital cameras. The 35 new camera features include support for tilt sensors, preset image enhancements, panorama stitching, and red-eye reduction.

With improved seamless connectivity to home computers, enabling the easy transfer of music, videos and images using MTP, one smartphone can replace several devices. In addition, with support for multi-standard digital TV (DVB-H, ISDB-T) and standardized LBS, the Symbian smartphone will bring true convergence to consumers worldwide.

Enterprise

New Symbian smartphones will enable users to be more productive and cost effective with Wi-Fi to 3G connection roaming. Professionals will benefit from push-email and VoIP run over Wi-Fi when in the office and automatically switch to 3G when on the move. In addition, real-time networking ensures that VoIP services are not interrupted when other IP-based services, such as web browsing or push email, make a connection.

Symbian OS v9.5 offers contacts hosted in SQL, providing better support for large database search performances, ideal for customer-facing professionals that store thousands of contacts in their phones. Support for the new GEO property will encourage innovative use of meeting location with positioning/LBS. The interoperability of calendars with Microsoft Exchange and Lotus Notes has been upgraded and support for Exchange ActiveSync Protocol (OTA) continues to deliver remote email, contacts and calendar synchronization.

Symbian OS v9 already offers the best-in-class security model of any open mobile operating system, designed to meet the most stringent security requirements from network operators, handset manufacturers and enterprises.

Smartphone lifestyle

The introduction of Brahmic script support in Symbian OS v9.5 extends Symbian OS support of languages to cover 99% of the world’s countries and the support for global standards including HSPDA, HSUPA and DVB-H as well as ISDB-T, makes Symbian OS the only true global mobile operating system powering both mass market and high-end mobile phones.

For more information look at http://www.symbian.com

Monday, June 23, 2008

Google Analytics



Google Analytics Explained

Google Analytics is a free website analysis tool which provides sophisticated reports about traffic on your website. Actual Metrics is an Authorized Google Analytics Consultant -- we offer a complete suite of consulting, training, support, analysis, integration, and customization services for Google Analytics. No matter which type of site you have -- e-commerce, lead generation, branding, or informational -- Google Analytics will show you how visitors reach your site and how they interact with your site's content. Our expertise will help you improve the ROI of your marketing initiatives and your overall online presence.

Born From Urchin.

Google acquired Urchin Software Corporation in April 2005, and released Google Analytics in November 2005. Behind the scenes, Google Analytics is based on Urchin v6 Software.

Reallocate Your Analytics Budget.

The hosted version of Google Analytics is 100% free, without any hidden costs or extra hardware requirements. This means you can invest in optimizing your site layout, rolling out an internal site search solution, or search engine marketing.

Installation Is A Snap.

Add a snippet of tracking code to each page of your site, and you'll start seeing data in your Google Analytics Account a few hours later. Once the tracking code is in place, Actual Metrics can help you configure your profile properly and utilize some of the more advanced features.

Integration Options

Data collected by Google Analytics can be integrated with a variety of tools and software packages, including (but not limited to) the Google Website Optimizer, the Google Search Appliance and Mini, CRM solutions, dashboard reporting systems, and more.

Advanced Reporting.

GeoTargeting, site overlay, executive dashboards, conversion funnels, e-commerce reports, and on-the-fly visitor segmentation allow you to drill down and learn how visitors reach your site, what activities they perform while on your site, where they exit, what they buy, and much more.

Linked To AdWords.

If you're an AdWords advertiser, Google Analytics can be configured to automatically import your keyword list and cost data. You can then generate ROI metrics for individual keywords as well as your entire AdWords campaign.

Saturday, June 21, 2008

Clearsilver - HTML template system


What is Clearsilver?

Clearsilver is a fast, powerful, and language-neutral HTML template system. In both static content sites and dynamic HTML applications, it provides a separation between presentation code and application logic which makes working with your project easier.

Why use Clearsilver?

High Performance and Language Neutral. Because Clearsilver is written as a C-library, and exported to scripting languages like Python, Perl, Java and Ruby via modules, it is extremely fast. This also means you can work with the same template system independent of the language your project is in.

Pluggable Look and Feel. Clearsilver makes it easy to face lift a site by providing a new set of templates. It is possible to easily run more than one look and feel at once, and share components with a base look and feel to reduce maintenance.

Internationalization Support. Clearsilver makes it trivial to support internationlization. You write your templates in your native language and included tools automatically extract and catalog language strings for translation.

Advanced features. Built in support for advanced features such as gzip compression, smart whitespace stripping, parametric macros, online debugging mode, url and javascript string escaping, and more.

Websites which user Clearsilver

Here are some examples of websites and applications built today using ClearSilver. The host programming language is also listed.:

Sites

  • wunderground.com - The Weather Underground serves comprehensive world-wide weather information to millions of users per day. (C)
  • Mollyguard - a Premium Service Enabler built on top of PayPal. (Python)
  • Xoom - The smarter way to send money. (Python)
  • BroadOn - Clearsilver is used for templating of the web-UI for an embedded device. (C)
  • Bloglines - Used by the server based RSS aggregator. (C)
  • Plaxo - Used by the website portion of this shared address book. (C)
  • Techdirt Wireless - Just one of many enterprise blog sites run by Techdirt Corporate Intelligence. (C)
  • Discogs - Discogs is a user-built database containing information on artists, labels, and their recordings. (Python)
  • Google Groups - The new version of Google Groups uses ClearSilver. (C++/Python)
  • Orkut - Google's social networking site uses ClearSilver. (Java)

Applications

  • trac - an issue tracker with wiki-features and a bridge to subversion
  • Manhattan Virtual Classroom - a GPL'd course management system (C)
  • netcon - an operational machine and network monitoring and notification tool written in Python
  • Hassan Image Server - a server for sharing web-browsable photo repositories. (Python)
  • Gaku.net - Personal Portal written in ClearSilver, complete with a web-wikki (Ukki). (Perl)
  • Zild Application Server - Used as the template language (and ClearSilver ServerPages) of this C based Application Server. (C)
  • ezmlm-web - Web interface to ezmlm mailing list manager. (Perl)

Wrappers

ClearSilver comes with wrappers for use in Java, Ruby, C#, Python and Perl. There are additional wrappers available: More Information at http://www.clearsilver.net

Thursday, June 19, 2008

Code Autocomplete Functionality in Notepad++

Code auto complete functionality is the basic requirement for all the programmers. Now Notepad also support this functionality. Hurray!!!



As you can see in the screenshot above I was writing a bit of HTML, and as I started to close the “center” tag it offered to auto-complete it for me. Simply pressing the Tab or Enter key would have inserted the current recommendation.

This feature is disabled by default, but a quick trip to the Preferences ill get you using the new auto-complete feature in no time at all. Go to Settings -> Preferences, and switch to the Backup/Auto-competion tab. At the bottom of that screen you’ll see where you can enable auto-completion, and you can optionally turn on the “show function parameters” feature as well. What’s that do? Here’s an example of me using a PHP function, and you’ll notice that it gives me a friendly reminder of the parameters the function takes:


Lets download it and enjoy this feature
Get Notepad++ from here.



Wednesday, June 18, 2008

IBM's Roadrunner - Fastest super computer


IBM's Roadrunner breaks petaflop barrier. It's the first system to reach 1.026 petaflops (1 petaflop is equal to a quadrillion, or one thousand trillion, calculations per second).


The fastest supercomputer in the world is also one of the most energy efficient. That's according to the Top500 supercomputers list, to be released Wednesday at the International Supercomputing Conference in Dresden, Germany.


Twice yearly, the list measures the 500 most powerful computer systems available commercially. This year, the 31st time the list has been put together, the honor of top supercomputer goes to IBM's Roadrunner, which is housed at the U.S. Department of Energy's Los Alamos National Laboratory. 


In total, Roadrunner takes up 278 refrigerator-size server racks, and connects 6,562 dual-core AMD Opteron and 12,240 Cell chips.


IBM, which continues its dominance of supercomputing, makes 210 of the 500 systems, including 5 of the top 10. Hewlett-Packard is close behind, however. HP makes 183 of the fastest computers, including the No. 8 fastest system known as EKA, located in Computational Research Laboratories' data center in Pune, India.


Rounding out the top 10 is Sun Microsystem's Ranger at No. 4, Cray's Jaguar at No. 5, SGI's Encanto at No. 7, and SGI's Altix at No. 10. 


Fun fact: the fastest supercomputer in the world--used to monitor the U.S. nuclear weapons stockpile--is really just a PlayStation 3 on steroids. Roadrunner is based on the IBM QS22 blades, which are built using advanced versions of the Cell processor in Sony's PS3. It also runs using x86 chips from Advanced Micro Devices, making it the world's first hybrid supercomputer.


Tuesday, June 17, 2008

Firefox3 Benifits

SAFER BROWSING
* Security track record, with more frequent, transparent updates, so that you use a safer browser
* Malware protection to be protected against unwanted downloads such as viruses and trojan horses

BETTER BROWSING, WITH THOUSANDS OF IMPROVEMENTS
* Awesome bar, so that you can find places you've been before with a couple of keystrokes
* "
Save on exit" so that when you launch Firefox, you're immediately ready to surf, with last windows and tabs open
* Remember passwords without a dialog box, so that you decide to save the password after you've logged-in
* New
download manager, users can pause a download and resume it later, with a search box to easily retrieve previous downloads
*
Customizable: change the look and feel (themes) and add features (extensions) to Firefox through the built-in add-ons manager. More than 5,000 community-built extensions are available for free!

BETTER PERFORMANCE
* Fastest on complex Web applications, such as GMail so you are more comfortable, even on old machines
* less memory than any other browser, so you'll get more mileage out of your computer
* Moving the Web forward by supporting advanced Web standards so that the Web keeps evolving and benefits users in the long term.


Download FireFox3 here