Archive for category Tech
FaceBooker xd_receiver path
A team back here is buiding an application with FBConnect using Facebooker plugin. After successfully authentication from FB, this plugin expects xd_receiver.html (for taking care of cross domain issues) in the same path where the current url is.
We have this file under / as www.domain.com/xd_receiver.html and hence login url for FBConnect from the homepage would work fine. The app also has a FBConnect button from /xyz page and this would fail as Facebooker was looking for xd_receiver.html at www.domain.com/xyz/.
We tried in vain to make this an absolute URL by modifying the init_string in the file fb_connect.rb. As a workaround, we have currently we have copied the same file in two places and the app is up and running with FBConnect.
Has anyone faced this before? Is there a better solution?
Amazing Amazon EC2.
Amazing Amazon EC2..
We badly needed a new server for a demo and our existing server had some issues. Could get a Win2003 server in flat 10 minutes at 4 AM IST. Just cannot imagine such a QoS with traditional data centers.
“Jai Ho” to the power of cloud computing and to Amazon for making it so easy.
Apache Tomcat OutOfMemory Exceptions - HeapSpace, PermGen Space
Came across an interesting problem and noticed that we usually treat all “tomcat OutOfMemory” issues by just adding the java xms & xmx options. This may not be right solution as this just increases the JVM heap space and hence would take care of the exception which is related heap space i.e. Exception in thread “main” java.lang.OutOfMemoryError: Java heap space.
For the exception related to permGen i.e. java.lang.OutOfMemoryError: PermGen space, need to add one more option in JAVA_OPTS called MaxPermSize.
After adding all these options, here is what the entry for JAVA_OPTS looks like in the catalina.sh file.
export JAVA_OPTS=”-server -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m $JAVA_OPTS”.
Each of these otions are explained below.
• Server - Run the tomcat in server mode. (the default is developer mode)
• Xms - Minimum java heap space
• Xmx - Maximum java heap space. While running on dedicated servers for production instances, keep both these options the same to ensure better utilization of available memory.
• PermSize - The initial permSize. (default is 64MB)
• Max PermSize - The maxPermSize. (even here, it may be a good idea to keep the intial and the max value the same).
More information relate to OutOfMemory exceptions can can be found in the following articles.
• http://www.freshblurbs.com/explaining-java-lang-outofmemoryerror-permgen-space
• http://raibledesigns.com/rd/entry/how_do_you_determine_a
Some interesting discussions and articles relates to tomcat performance can be found at
• http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html#Production%20Configuration
• http://wiki.apache.org/tomcat/FAQ/Performance_and_Monitoring
• http://kinetic.more.net/web/javaserver/resources/wpapers/performance.shtml
What’s in the name?
This may be true when naming humans and many other things but when developing software names used inside the code are very important. While developing software, what names you give to entities (classes, methods, variables, files, etc) inside your code have a big impact on how easy it is to deal with the program during development and later during maintenance, by yourself and other team members.
We mostly use a person’s name to associate a label to a face. A person’s name may have a meaning but it does not tell anything about the person. As opposed to this, names used inside software program are expected to be meaningful and serve as an indicator of what the entities represent or are expected to do.
e.g.
- An object of instance Customer should be better named as a customer rather than object
- A method which is computing a total may be better named computeTotal or getTotal rather than some thing as strange as doTheStuff.
- An customerId argument passed to a method should be better named as customerId rather than just id so that when someone looks at the method signature the argument meaning is clear
Looking at some one else’s code, or even looking at one’s own code after a long time, is a pain. In addition to that if the proper names are not used it becomes irritating and difficult to work with.
Names used in a program should almost always fall into 2 categories
- Noun: These are used to represent some concept that is modeled in the system.
e.g Customer, Order, Bank Account, etc - Verb: These are used generally to name functions, methods, procedures, actions.
e.g register(), calculateTotal(), copy(), delete()There are some exceptions like Collection.size(), StringUtils.defaultString(), etc but its still better to stick to the convention of using verbs to describe methods, functions, procedures.
Names should be explanatory but at the same time overly long names should be avoided
e.g. registerUserSendMailAndSubscribeToNewsletter()
Correct names should be used from the start and not left as a TODO exercise. Correcting names in a program later on is a difficult task as there may be dependencies involved and this also needs further testing to be done. Also once a software is running fine no one is interested in doing this unless its a paid effort or is mandated by someone.
Last but not least, names must not have spelling mistakes.
So next time you are coding think before naming anything and not use the first name that comes to your mind.
Cloud Computing at Neev
There has been an upsurge in the work engagements that we are doing at Neev that are based on various Cloud computing platforms that are now available in the market.
Saurabh and Me had previously worked at Pi now decho where we were one of the select initial Beta testers for the Amazon S3 platform so have been hooked on to the cloud/utility computing bandwagon ever since.
In one of our projects we shifted Ninemotion to a Amazon EC2+S3 infrastructure since we had anticipated and got large loads and usage.
We are currently working with a startup which is looking at building software that will help optimise and manage Cloud infrastucture for heavy users of the same. This project has given us great knowledge and perspective on how to leverage the cloud infrastucture optimally for a variety of installations. e.g. while writing the test harness of the same we have tested(and stressed) various J2EE applications on range of Application Servers(various versions) such as WebLogic, WebSphere, Glassfish, Tomcat etc
Some other Cloud/Utility computing platforms other than Amazon EC2 , S3 that we have worked with are
During CeBIT 09 in Germany where we participated as an exhibitor we had a lot of enquiries specifically for the services that we offer in this space.
We are sure that the value proposition that cloud/utility computing offers will surely lead to more and more corporates and clients switching to this as a preferred mode of deployment.
Memory Plus and iPhone based development at Neev
“Memory Plus” Neev’s first iPhone app - is now at #4 in the Education Section and #22 in the Puzzles Section on the Apple App Store.The application has had 9k+ downloads all over the world.
This is Neev’s first application that is available for download through the App Store and is the culmination of a lot of hard work put in by our in house iPhone Development team over the past year. We now plan to put up an App every 3-4 weeks into the App Store.
Some of the other interesting work that we have done for our clients as project engagements are
Auction Client - This was done for an auction portal in Germany. A User can view all the articles that are belonging to various categories in the client’s home page display and bookmark them , add them to his watchlist or even login and Bid and Buy them. The project involved integration with web services on the back end and uses all the iPhone / iPod touch usability features to the maximum to provide a great user experience.
Expense Management Tool - this was done for a start up in California , USA. Here a Sales person could jot down the expenses incurred on a sales visit / meeting with location based data being provided by a Google Map integration done by us. The expense data was then sent to the back end and collated and calculated appropriately.