Pages

Thursday, January 31, 2013

Online slate board using HTML5 websocket and glassfish

My last post was about #AdoptAJSR initiative in which JUG Hyderabad is actively involved. Meanwhile I was trying to explore the Websocket API for Java (JSR 356) using glassfish 4 's latest build as reference implementation.

The idea was to use HTML5 websocket API in the front end to communicate with websocket endpoint created in the glassfish server.  To get started with I referred a  similar sample application blogged by Arun Gupta.

In this process I managed to log following bugs against the reference implementation

  1. Session object coming as the parameter in @WebSocketClose annotated method is null

  2. Session#isOpen method returns NoSuchMethodException

    To avoid this situation I have put the code "peer.getRemote().sendString("Ping");" in try block so that if it fails , it can gracefully remove that peer instead of ending up in exception.


My app lets you draw freehand lines in the browser and the same gets drawn in real time at every other user's browser who is accessing this app. If you refresh the page or a new user joins in then the existing state of the drawing is shown the browser.

To create such project one has to go maven way as of now. Following are the major steps you need to care about while creating this project

  1. Choose a Maven project in Netbeans


Maven1

Maven2

Maven3

2. The Websocket Java APIs could not be imported in the Java class unless the websocket library is searched in the repository and added to the project

maven4

maven5

The source code that I created can be accessed from Github. Feel free to download and give feedback or try to create your own version.

You can download the slate demo video and play in any flash enabled browser.

Play this in full screen to see the code.
Unable to display content. Adobe Flash is required.

Further features and future challenges

  1. Draw the existing lines slowly (Playback) when a new user joins in so that he gets the context. For this, one needs to block other users ( javaScript thread ) from drawing till the playback is over. or some way to buffer the new drawings till the JavaScript thread is free from playback.

  2. Different color and strokes

  3. Simultaneous drawing using webworkers.

Wednesday, January 30, 2013

Quickly turn your browser into a notepad in one line

So many times while jotting down some text quickly (especially over a during call) we search for windows notepad. We forget that we have a full fledged browser always running which is a great software to do anything. In fact I have composed Gmail drafts and sometimes typed in Google to temporarily note down phone numbers and addresses. I found a trick to turn the browser quickly into a text editor/notepad

  1. Open a new browser tab

  2. Type the following in the address bar and hit Enter

    data:text/html, <html contenteditable>



  3. You should be able to type in the web page now.. You can also paste text here from your clipboard
    bookmark
    data:text/html,<html contenteditable>


  4. To make it easily accessible bookmark it on the bookmark toolbar

  5. Optionally you can save text like a web page from the browser with Ctrl + S key.


bm2 bm3

Adopt-A-JSR at JUG Hyderabad

Lately there has been a lot of activity in JUG Hyderabad after introduction to #AdoptAJSR initiative. JUG Hyderabad has taken up JSR 338 (Java Persistence 2.1), JSR-107 (JCACHE - Java Temporary Caching API), JSR-256 (Java API for websocket ) and there has been significant progress. I am a kind of programmer who jumps into code directly before going through pages of theory. So here are some links for quick reference

Meanwhile The Java user group in Hyderabad has gone social and following are the links

JUG Hyderabad is looking for passionate people who are passionate about JAVA and want to drive the community forward. Do let us know.

Learn French by Using Your Smartphone

Last week I posted about the English-2020 project for improving spoken English world wide and I was also playing around my mobile phone. With the mobile version of English-2020 coming in next few months I came across this interesting site for learning french. Below is a partner post about this site and their apps. I always wanted to learn, hope you find it useful.

The French language is one of the most widely spoken languages in the world. There are currently more than 129 million people that speak French and 70 million of that are native speakers according to a study made by the European Union. This number is expected to increase up to 500 million in 2025 according to Agence universitaire de la Francophonie (AUF) and Laval University. Some study French because it is required in school and some learn this language to impress someone. Hearing someone talk in French, especially the likes of Olivier Martinez and Audrey Tatou, is a major turn on for most men and women. There is something sexy about this language that attracts people. Years ago, the only way to learn French is by going to a language school. With today’s technology, you can now learn this language by using your smartphone. Here are some Android applications that can come in handy when learning French:

PartyPoker France
Who says that learning French can be boring? You can actually have fun playing poker and at the same time learn this language. You can either visit the Partypoker.fr website or download its application in your Android phone. If you know the poker terms, then it will be easier for you to translate what’s on the website. If you are not familiar with them, then you can always click the Google translation on top of your browser. Since poker is mostly about numbers, then you only need to learn a few important terms including Full aux As (Aces Full), Miser le Pot (Bet the Pot), and Cart Ouverte (Open card). Once you have mastered those terms, then you can compete with the other French opponents at PartyPoker. There are different kinds of tournaments available in this poker site, which makes it more fun and exciting. You can also join in anytime you want because the games here run 24/7. Joining this game is a win-win situation because you won’t only have fun playing poker and learn basic French, but also get a chance to win huge cash.

French Translator/Dictionary
This application from GreenLife Apps is perfect for those who want to learn short French sentences. You can type an English sentence and it automatically translates it to French. Or you can type a French sentence so you will know what that means in English. Aside from translating English to French and vice-versa, you will also get a new word each day which you can add to your French vocabulary. The French Translator/Dictionary also gives sentences on how to use that word.

BabelFish Voice: French
French words are quite difficult to pronounce because how it is written is sometimes different from how you say it. Thanks to BabelFish Voice: French, you can now learn how to correctly say the words written in French. This application gives voice translation so all you have to do is speak into the microphone and get a spoken French translation. This will spare you from speaking funny French.



The above site has about 38,000 daily visitors according to wolframalpha.

Tuesday, January 29, 2013

Winows 8 and iOS custom rom on Android Phone

screenshot-1359316639379 screenshot-1359378012305Lately even after rooting my phone I got bored with my Android phone's (Samsung Galaxy ACE) UI. Same old Android 2.3 (Gingerbread)

Yesterday I came across one article on the internet which was talking about custom ROM which can give the windows 8 look and feel to my hardware. Luckily it worked. However for most of the windows tile (eg. Appstore, music, internet etc ) , asked me to assign an android app installed in the phone while being used for the 1st time. The UI response did not slow down much. Most of the feature which were there in my Android OS was there in this ROM also. The music player was not very impressive but the system settings and widgets looked better to me. I noticed that the Bluetooth could be left discoverable forever in this ROM.

If you search in the YouTube, you can fine a lot of videos sharing the procedure how to install this ROM.

I also found an iOS themed ROM and installed it right away in my phone. However when the ROM started it started all in Chinese :) . One of the most challenging task was to find the language settings in the phone and change to English.

I also did install the Samsung Galaxy S II ROM but it was kind of out dated. Finally I settled with the Android 4.1.1 Jelly Bean official CM10 ROM. Unfortunately Google Play and other Google apps were not present in the ROM, so I had to install them from a separate zip file. Since Jelly Bean was designed for phone with higher resolution , the settings menu's font looked very small in my phone but not very hard to figure out.

There were also intermediate versions of the ROM available in the Internet e.g. Ice cream Sandwich

All above ROM needed ClockworkMod Recovery (CWM) installed in the phone. This can be also used for restoring backed up data before attempting to play with new ROMs.

Update (28 Jan)

I finally settled for ICS (Android 4.0.4) as Jelly Bean was making my phone slow and eating up a lot of phone storage. I also got rid of small texts in setting menu as Android 4.1 was designed for phone with larger screen. Icecreame sandwich seems to be the perfect match and the optimum release for Galaxy ACE hardware.

Friday, January 25, 2013

HTML5 talk at Avanti Institue

Last Saturday I was invited to Avanti Institute Of Technology in Hyderabad for a lecture on HTML5. I presented the same slides what I presented in Google DevFest last year. They have a very active IEEE student branch and volunteers. The audience were from second year to fourth year and relatively more knowledgeable than other colleges. However as usual they were shy enough to ask questions in the class but later I was approached individually regarding some questions.

DSCN1877

Thursday, January 24, 2013

End of Golden Era

Well, not quite. Just that I stepped down as GOLD Chair of Hyderabad section of IEEE this month. I was appointed for 2012 and Prashant KV will lead the GOLD (Graduate of Last Decade) group in 2013. This year is very important in the GOLD perspective because Hyderabad won the bid for R10 GOLD/WIE/Student congress. I hope this year Hyderabad GOLD gets more visibility around the world comes out of the miscellaneous category getting as much importance as any other society gets. Summery of activities can be found the slides presented in the Annual General Body Meeting (AGM).



I will continue to volunteer in the IEEE Hyderabad section as webmaster and technical resource person and of course as past chair of GOLD.DSC07424

Let me know if you are willing to volunteer in this year. We are looking for really passionate people who want to help advancing technology for humanity with world's largest professional association.

VSSUT Alumni meet in Hyderabad region

On 20th of this month my under grad school UCE Burla (now VSSUT) alumni staying in Hyderabad had an get together. Thanks to Sanjay Jena and his friends who let the initiative. It was fun meeting old buddies from college and hostel. Also met a lot of new faces who had joined in later years. Interestingly there were some alumni from the batches of 80s who shared their experience with us what was it like to be in an engineering college in 1980s. These senior people are now in top positions in companies like State Electricity Board and Satyam Computers. No doubt in those era UCE Burla was a top college in India which produced the brightest engineering students.





Tuesday, January 15, 2013

Suryalanka Trip 2013

Last weekend was spent at one of the beaches in the east coast of India next to Bay of Bengal called Suryalanka. We decided to drive this time. We took the newly constructed Outer Ring Road of Hyderabad and then National Highway 9 to Vijaywada to make sure drive is pleasant.

View Suryalanka Driving Trip in a larger map


There was one more alternate way via Nalgonda which is about 30 KM shorter but we decided to stick to the road which has dividers all the way till Guntur. We had to pay a sum of INR 300 as part of toll in each side of Journey  but I think it was worth it. took us around 9 hours to reach the destination (420KM) including an hour break and a 30 minutes traffic jam at Vijayawada while entering NH5. Otherwise the average speed was very good. While going from Vijayawada to Guntur we took the Tadepalli Trunk road short cut which did not have dividers but we stuck to NH5 while coming back. Also there is something wrong with Google Maps , which shows a longer path near Kodad instead of following the NH. Probably the route map is not updated with latest imagery which have the highway construction completed.

There are couple of more places near to this place which I have got good reviews

  1. Chirala Beach ( There is a private resort )

  2. Bhawani Island (Can be booked through APTDC website , use Internet Explorer )


Saturday, January 12, 2013

Tuesday, January 8, 2013

ISS Trails

Couple of weeks back I spotted the ISS but I was not well equipped to capture a trail against the "Fixed" stars. On 3rd Jan me and  Joy wanted to capture it from roof. It was evening time but ISS was relatively fainter and lower in the horizon. Also the sky was almost covered by  cloud. Following tables ( taken from heavens-above.com) have all the details











Date:03 January 2013
Orbit:400 x 422 km, 51.6° (Epoch: 07 January)


























































EventTimeAltitudeAzimuthDistance (km)BrightnessSun altitude
Rises18:29:52311° (NW)2,2980.9-8.7°
Reaches altitude 10°18:32:0210°302° (WNW)1,4420.0-9.1°
Maximum altitude18:35:0236°234° (SW)652-1.5-9.8°
Drops below altitude 10°18:38:0310°165° (SSE)1,447-0.4-10.5°
Sets18:40:13157° (SSE)2,3080.5-11.0°

Sky Chart (Courtesy heavens-above.com)

[caption id="" align="alignnone" width="618"] ISS Sky Chart[/caption]

I tried to click the trail with 20 and 25 second exposure but sky was too bright to distinguish the trail.
ISS Trail 2

Another one is here. The trail is very faint but next time I will try to spot it in the morning.

Monday, January 7, 2013

Talk on Rich Client Technology at Inauguration of IEEE Student branch.

Last Saturday me and IEEE Hyderabad section's secretary Dr. Amit Kumar traveled to University College of Engineering (Kakatiya University) at Khammam for inauguration of IEEE student branch. I spoke about rich client technologies like JavaFx and HTML5 while Dr. Amit Kumar briefed about IEEE activities and membership benefits to the students . It was long 5 hours of drive from Hyderabad but worth visiting because the college is situated at a very distant area from the IT industry of Hyderabad and even a slightest exposure can inspire the students.

IEEE SB Inauguration This college was not only have same name as my under grad college but also situated at a similar rural location. I like this kind of residential college because you have not much distraction of city life and bound to focus on studies :)

Play audio and receive phone calls from Windows 7 using Bluetooth

I have been lately trying to operate my phone remotely from my PC when I am at home or work because I don't feel I really need to use my mobile phone when I am already in front of a full fledged computer. Also sometime I keep my phone somewhere in house and miss many calls because of not hearing the ring or not able to reach in time before the ringing stops.

I found a way in Windows 7 to play audio and receive phone calls from Windows 7 using Bluetooth. I use rooted Samsung Galaxy ACE running on Android 2.3.

  1. Pair your phone with PC

  2. Go to Control PanelAll Control Panel ItemsDevices and Printers in the PC
    Control Panel

  3. Double click and open the Bluetooth Control

    Bluetooth Control

  4. Click connect button for using the computer speaker to during phone calls and play music from PC using mobile phone's audio player

    Audio Player

  5. You will notice a small media player control at the right bottom of the screen where you can play/pause/change songs which is being played in the phone.


Note that I have not found a way to choose to pick up calls from PC, it automatically picks up after few rings. May be I have to play around the settings more. Anyway this helps improving the phone signal strength of my phone because we don't have to attach the phone to our ear.