Thursday, December 20, 2012

Using indexOf method on array in server side JavaScript

Sometime back I was trying to use indexOf method on an Array object in server-side JavaScript (SSJS) code. But it was giving me error that indexOf method is not defined. I also couldn't find this method in help documentation. It was then it struck me that the implementation indexOf method in client side JavaScript itself is a bit fuzzy with Internet Explorer not supporting it. It can be defined using prototype property.

I found a simple solution here which implements the method. Just add the below code snippet to your SSJS code and then you would be able to use indexOf method.


Remember that this would be required for SSJS. For client side JavaScript I would recommend using dojo.indexOf.

Wednesday, December 19, 2012

Charging pattern on HTC One X

My HTC One X has a pattern in which it charges itself.


In the above screenshot of my battery usage you can see that from 10% battery level to 60% battery level my phone charges at a constant rate. But from 60% up till around 75% this rate dramatically drops and it takes much longer to charge. Then picks up again until around 90% and afterwards it charges very quickly. I don't know why does this happen and what is its significance. I contacted HTC support but there response was not satisfactory either.

So if you notice the same pattern while charging or a different one do post it in the comments.

Sunday, December 9, 2012

New features in HTC One X after Jelly Bean update

Some time back I updated my HTC One X to Jelly Bean (JB) using OTA update. The update takes your Android version to 4.1.1 and Sense to 4+.


Its been almost a 2 weeks with this update and the most noticeable improvement I can see is of battery usage. My phone lasts 1-2 hours more than it used to before. Well done HTC! There also some additions (and deletions) which I am going to describe here. Now I not an Android expert so I don't know all the new features in JB itself, so you may find a feature new in JB listed here. Also you won't find Google Now and Google Play Music here as I know they are new to JB and not HTC One X.

Sunday, December 2, 2012

Making internet pass-through work after updating HTC One X to Jelly Bean

Update 22 Jan 2013: "HTC Sync" seems to have been discontinued so the download links given below will not work. "HTC Sync" is different from "HTC Sync Manager". For exact difference read on.

I recently upgraded my HTC One X to Jelly Bean via OTA update. After updating I was unable to use internet pass-through which used to work flawlessly before and I already had HTC Sync installed on my PC. I uninstalled, installed, uninstalled again and installed again to make it work. But it simply refused. It gave me error of "Either you do not have the latest version of HTC Sync installed on your PC, or another phone is already using Internet pass-through on your PC." on my phone.


From this discussion on XDA Developers forum I found that there is something called as HTC Sync Manager. This is different from HTC Sync which I had installed on my machine. I don't know why HTC did this but its really confusing. Here's how these two software look.