Tuesday, September 15, 2009
Augmented Reality - Wanna see more than what’s real !
Well, Augmented Reality(AR) is nothing new and has been around for sometime but the level at which it is being applied today might well be the next GPS-like revolution. From the word itself, Augmented which means increased, the meaning converts to increased level of reality. This level of reality is achieved by mixing the real-world data with statistics and information generated by the computer system. Hence, the result is a mixed reality which is better than the real object in view. This augmentation is possible with advanced sensors, actuators and navigation systems which today is even available in mobile handsets. AR sits between reality and vituality.
As a matter of fact Google have utilized an AR API in their Android phone to develop AR applications.
Here are some examples I wanted to share:
A google device which scans for a fruit and provides information on the nutritional values:
The same device translates language realtime:
A G1 phone which has a camera, compass & GPS receiver which knows where you are and where to guide you to for a restaurant or ATM:
Contact Lens powered with AR ready to see more than the reality in front:
Vehicle cameras which can provide more information than just the road ahead:
Looks like AR is here to stay and will replace lot of keyboards and punches in GPSs and computer systems. With the voice recognition and voice enabled devices getting the final touches after years of improvements, it's not far when we can do and find things without typing at all.
Using Dynamic DB configuration based on the current value of Environment Variable in XML
Image via Wikipedia
It has been a constant endeavor to segregate code dependency and provide loose coupling to ensure the same. That’s where XML comes into the picture helping us dynamically configure attributes required during runtime.
Here I have shown how to dynamically pull values from an environment variable and then use it in an xml file, thereby further promoting it for code usage. This is a common situation in environmental infrastructures, and code would depend on the current environment to build on the outgoing URLs/databases/queues/etc etc
Let’s take the picture of an app deployment which would connect to environment-wise database servers. We will assume that we will have a ENV_VAR user/system variable already defined on the box.
I have utilized spring’s PropertyPlaceholderConfigurer to feed a properties file which will contain the various db configs environment-wise:
<spring:beans>
<spring:bean class="org.springframework.beans. factory.config.PropertyPlaceholderConfigurer">
<spring:property name="location" value="classpath:dbconfig.properties"/>
</spring:bean>
</spring:beans>
Content of properties file(dbconfig.properties) with sample values:
devurl=jdbc:db2://someIP:30000/DB
devuser=username
devpass=password
produrl=jdbc:db2://someIP2:30000/DB
produser=user1
prodpass=pass1
Then in the xml config where we define the database configuration I picked up these dynamic values using:
<spring:property name="url" value="${${ENV_VAR}url}" />
<spring:property name="username" value="${${ENV_VAR}user}" />
<spring:property name="password" value="${${ENV_VAR}pass}" />
ENV_VAR should be an environment variable in each box i.e. ENV_VAR =dev for DEV box, ENV_VAR=prod for PROD blades etc
While server startup the values are picked up dynamically from the properties file depending on the value of the ENV_VAR environment variable on the application server box.
Thanks,
Yassar
Ø Email Blog
Thursday, February 12, 2009
Been Long Since....
Its been quite long since I pen-ned something! I have been quite busy but that's one excuse anyone can make - isn't it? So I have a made a resolve to regularly write on my activities. Lately I have been to places around US - perhaps that could be a good topic to start off with!
Will start soon...
Take care.