Monday, September 19, 2011

TIP: How to save images from Facebook gallery

In Facebook, while browsing shared photos of your friends, if you like some photos and want to save them to your computer you would normally  e.g. in Firefox (FF), right click on the image and use Save As option. But this does not work as expected. You do not see an option to save the image only. This happens because the image is "hidden" behind script which loads it. To overcome this, do the following steps:

1) Right click on the image
2) Use inspect element(opens a little window area at the bottom with the html source)
3) Look for tag <img src="xxx"/> xxx is the url of the image.
4) Copy and paste xxx in the address bar of FF and load page.
5) Now right click and save image on your disk.

Note: this tip might work for other sites too which use similar gallery features to display images.

Thursday, September 15, 2011

Finally, DLNA at Home !

DLNA stands for Digital Living Network Alliance. In a nutshell, it is like running a small network and sharing data (video, audio, pictures etc) between different devices (TV, Computer, Game console, video player etc) at your home through this network. Minimum you need a TV (display unit) and a media server (e.g. a computer running some DLNA software). No problem if the TV is not DLNA compatible. You can add a DLNA compatibe player like DVD/Blueray player connect same to the TV.

DLNA is almost 7-8 years old but the technology has become popular (and affordable) now. At my home, I've been adding up components for a DLNA home for over a year now. I have following things now:

1) Linksys E3000 wifi router (N+ with MIMO)
2) 42" LG Infinia LED HD TV (non DLNA)
3) Sony PS3 game console and Sony BDP S-370 Blueray player (both are DLNA players)
4) Acer laptop running Windows 7 Home premum (DLNA server)
5) 320 GB Buffalo USB 2.0 for storage (upgrading soon to 1TB Western Digital USB3.0)

Setup and execution


1) Start Linksys router (ensure UPnP is enabled)
2) Start computer and enable media streaming
3) Switch on TV
4) Switch on PS3 (or player) and configure to use DLNA
5) Choose DLNA Media Server option in PS3 XMB
6) The name of the computer (DLNA server) is shown select it and use further online options to view media. See the picture below.

That's all for a basic DLNA at home. I was able to play some MP3 and view pictures (average size 3MB) without much problem. However, video display was breaking frames. Probably because PS3 uses only b/g and was not able to exploit higher WiFi capacity of N+ network. Also, the concrete walls and other radio in my house is probably interfering with WiFi waves.


Windows 7 Media Server in PS3 XMB.



Friday, September 02, 2011

Programming verbiage

Which is a better style?

 Style 1:

boolean checkNum(int x) {
   if (x > 10) {
       return true;
   }
   else {    // actually else {} is unnecessary
       return false;
    }
}


Style 2:


boolean checkNum(int x) {

       return (x > 10);
}


Though I find style 1 more often, specially in the code written by rookies, I prefer style 2. It is short and crisp.