Skip to main content

Posts

Double Checked Locking And Java Singletons

I read this article by Bill Pugh on why the double checked locking idiom does not guarantee thread safety in Java Singletons. That article taught me a lot of new things, and to be honest, I had to re-read that article at least a couple of times to partially understand it :-) I recently created a presentation to make at DevCamp on this topic. What follows are my slides and an explanation of each slide. I hope you enjoy this presentation and find it useful. Double checkedlockingjavasingletons View more presentations from parag . slide 1: In this presentation I will discuss the double checked locking idiom, and explain why it does not work to provide thread safety to Java Singletons. I will also talk about how using volatile fields will fix the problem in JDK 1.5 onwards. slide 2 (Singleton): Many of you might already have used the Singleton design pattern . In case you have not, here is a brief description of what Singletons are. The Singleton pattern is used when we want to ensure...

DIY Masters in Computer Science

Since my formal education, a lot of advances have taken place in software development. I have been able to keep up with a few with regular reading and practice. But a lot of this learning has been a bit random, and as a result a bit dissipated as well. I feel like I want to engage in continuous learning, in a more organized manner. Over the years there are several core concepts which I have forgotten because I have not been able to use them in my regular work. I feel like relearning those concepts. I think the volume and content of both these can constitute a masters course in Computer Science. But I do not want to go back to school. Not because there is anything wrong with school - I had a great time in grad school. But here's why... I don't want to go back to school because I want to define the courses I want to learn, and not pick up from what's offered. I don't want to go back to school because I want to be able to learn at my own pace, which at times may be slower ...

Android apps can run in parrallel (video)

This is the seventh in a series of videos published by Google on Android programming. In this video the speaker starts an app to track photos his buddy publishes on Flickr. He can keep this application running in the background, so while he is browsing or checking his email, this application will constantly track the photos and notify him if a new photo has been uploaded.

Adndroid apps don't have any borders (video)

This is the sixth in a series of videos provided by Google on Android programming. Index: 00:00 Introduction 00:32 Zebra crossing application 01:35 Library app 02:14 A GeoSocial app which combines user GPS, user created photos, and Compass My Takeaway: Android applications do not have any borders. They can use data from other applicatiosns, they can use hardware available on the device such as camera, compass, GPS, accelerometer, etc, and they can also use content from the web API's. The first application called Zebra Crossing is an application which can pull information from bar codes and QR codes. So if you photograph a product's bar code and give it to the application, it will pull up information about the book from the web. If on the other hand you give it a QR code from the back of a business card, it can extract contact information about that person which you can use to call or send email. The Zebra Crossing app also publishes intents, to allow other applications to commu...

How to embed the web in Android apps (video)

This is the fifth in a series of videos provided by Google on Android programming. This video shows how we can use the WebView to create applications that render HTML pages. Along with being able to embed HTML and Javascript web pages in apps, the most exciting thing I found in this view was the fact that the Javascript in a webpage can communicate with Java code and Java code can communicate with javascript. This is really cool.

Android programming - All applications are created equal (video)

This is the fourth video in the series of videos provided by Google on Android programming. Index: 00:25 Dianes ringtone app 01:08 App to create a shortcut to anything on the system 01:36 Replacing the home screen (End at 02:17) My Takeaway: This video shows that all applications created on the Android platform are equal. Even though I have not done any iPhone development, I believe applications written for iPhone do not have access to everything the way Android applications do. So this is a positive for Android development. In this video we see how to a custom application can change the ringtone on an Android phone, how another application can create shortcuts to anything on the phone, and how we can also change the 'Home' application.

Android Programming - API's (Video)

This is the third video in the series of videos provided by Google on Android programming. Index: 00:00 Introduction 00:16 Android API's 00:24 Location Manager 01:25 XMPP 02:42 Notification Manager 04:08 View System 06:00 Conclusion (Ends at 07:05) My Takeaway: In this video the speaker talks about API's provided on the Android platform to developers. The LocationManager API allows an application to get the location of the device it is running on. This information can be used to register intents, which will inform the user if they are close to an interesting location such as a Ice Cream shop. I can also think of another use. If traffic information is available, then we can also use the location manager to inform us if we are getting close to a high traffic area. Interestingly this API uses whatever information it has to determine the location. If GPS information is available then it will use that, otherwise it will use cell tower information. XMPP Service is used to send mess...