Sunday, May 24, 2026
Google Fi Referral Code
Here's a referral code to get a $60 credit when you join Google Fi Wireless!
Code: R31JC2
Redeem it at https://g.co/fi/r/R31JC2
Thursday, March 17, 2016
Saturday, September 12, 2015
Macbook Pro Samsung Galaxy S4 Mobile Hotspot Issue
On Samsung S4 below are the instructions to turn on mobile hotspot
If it works for you great.....
Invalid Password
I was getting a invalid password when I tried connecting so I tried changing password
To change password
Connection Timeout
Now I was getting a new error "Connection timeout". Using the same "configure" option above I removed the password and specified "open" however was still getting the same error. I then went to "Allowed Devices" and specified my Macbook pro, Mac address and that solved the issue. Follow the below directions
- Go to Settings -> Connections
- Click on "Tethering and Mobile Hotspot"
- Toggle the "Mobile Hotspot" slider to "On"
If it works for you great.....
Invalid Password
I was getting a invalid password when I tried connecting so I tried changing password
To change password
- Go to Mobile Hotspot page as instructed above
- In options choose "configure"
- Under "security" change the passsword
Connection Timeout
Now I was getting a new error "Connection timeout". Using the same "configure" option above I removed the password and specified "open" however was still getting the same error. I then went to "Allowed Devices" and specified my Macbook pro, Mac address and that solved the issue. Follow the below directions
- Go to Mobile Hotspot page as instructed above
- In options choose "Allowed Devices"
- Follow these instructions to get your Macbook Pro MAC address. Choose "Wi-Fi" in connections
- Specify the "mac address" in "Allowed Devices"
- Turn off and turn on Mobile hotspot toggle.
Thursday, February 13, 2014
Native vs HTML5 vs Hybrid Apps
Native app development
Pro
- Apps where user experience is paramount,
- Apps where speed is vital,
- Apps that need tight integration with device features (camera, location data, motion sensors, contact lists, etc.)
- Apps that need to deliver an immersive experience—like certain games,
- Apps that involve virtual or augmented reality.
- Apps that require high security might do best as native too—iOS sandboxes each app and some Android devices provide the ability to create different profiles for official and personal use
Cons
- If you need to support multiple OSs, you could wind up building separate apps from the ground up for each OS.
- Each OS uses its own language and SDK.
- One way to control cost is to limit development to the two leading platforms—iOS and Android.
- Another answer to the problem of coding multiple times and getting dedicated developers would be using cross-platform tools like Xamarin Studio or Appcelerator Titanium—which are essentially software frameworks that let web developers create native apps for multiple platforms without having to know and learn separate coding languages. For example, a developer with knowledge of HTML and CSS can create an iOS app by using Xamarin Studio.
HTML5 Mobile Apps
Pros
- Where multiple OSs, devices and form factors must be supported while containing cost. Getting to market quickly on multiple platforms is a good use case.
- HTML5 developers are often easier to find than native developers, making HTML5 apps more convenient and cheaper to develop
- Can also be less costly to maintain, since there’s only one code base for all devices
- Apps can be upgraded without requiring users to download and install new code
- Google Docs and Scribd are good examples of successful web mobile apps built in HTML5
Cons
- Not right for every app. Limited when it comes to user experience. And if your app needs access to native device functionality, you might want to look into native or hybrid
- Not every device supports the full capabilities of HTML5, so work arounds might need to be devised for some devices
- HTML5 apps may be less secure than native apps because they’re not leveraging the all the security features of each OS
Hybrid Mobile Apps
What is it?
It is a web mobile app wrapped inside a native container. It can help to combine a rich user interface developed in HTML5 with the device-specific capabilities accessed through the native code. The visual element in a hybrid app is mostly delivered by the HTML part, while the native code interacts with the device—and readymade libraries such as PhoneGap help to connect the two.
Pros
- You can chose to mix and match the HTML and native components to meet the specific requirements of your app. It also provides a nice compromise between the advantages of native and web apps—easy and convenient development, fast deployment, and access to device-specific features.
- Netflix and Yelp are good examples of hybrid mobile apps
Best approach
The reasonable solution would be hybrid apps—that combine the cross platform capabilities of HTML5 with offline and device specific capabilities of native apps. Gartner even puts a hard number to this prediction—about 50% of the total mobile apps developed and deployed by 2016 would be hybrid apps. [http://www.gartner.com/newroom/id/2429815]Factors to consider when making a choice
- What do you need the app for? Does it bring a significant revenue model for your business or is it merely for a mobile presence an extension of your business website?
- What kind of experience does the app need to deliver to the user?
- What features it will need to have?
- Will the app need to access device-specific features—like geolocation abilities and the contacts list?
- Will it need the pinch and zoom functions?
- What about online and offline capabilities?
- What security features do we need?
- What is the total time that you can afford to spend on developing a new app, or how quickly do you need to deploy your mobile app solution?
- How do you intend to make your app available to users?
- Development cost? Don’t just think about development cost—consider the expected returns and benefits from deploying the solution too. An app that costs more to develop may be worth it in the long run.
References
Whitepaper from DMI Inc
Presentation on JQuery Mobile vs Appcelerator Titanium vs Sencha Touch by Steve Drucker
Question about Xamarin 2.0 vs Appcelerator Titanium vs PhoneGap on Stackoverflow
Thursday, October 17, 2013
Exclude files from War packaging by Maven profile
To achieve this I have used the "packagingExcludes" property of Maven war plugin. For more info and examples of using this property see this page. To exclude files by Maven profile you need to first parameterize the value of "packagingExcludes" in war plugin declaration in pom file
In Maven profile you can define the value of this property by profile
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<packagingExcludes>${pkg.exclude}</packagingExcludes>
</configuration>
</plugin>
In Maven profile you can define the value of this property by profile
<profile>
<id>prod</id>
<properties>
<pkg.exclude>WEB-INF/classes/com/internal/*.class,internal/*</pkg.exclude>
</properties>
<activation>
<property>
<name>environment</name>
<value>prod</value>
</property>
</activation>
</profile>
Tuesday, July 30, 2013
Mobile Browsers and Cookies
My attempt at succinctly describing first party and third party cookie support in various mobile browsers. For a good read on Cookies in general see this Wikipedia article
| Browser | Default Cookie Behaviour | Default | Reference |
|---|---|---|---|
| Safari Mobile | Supports three cookie settings. "Never", "From Visited", "Always" | From Visited | http://support.apple.com/kb/HT1677 |
| Chrome Mobile | Accept cookies: checked/unchecked. No way to enable frist part only. | Checked | Checked on my phone |
| Opera Mobile | Accept cookies: On /Off | On | Checked on my phone |
| Opera Mini on a Blackberry | Accept cookies: on/off. | On | http://www.usa.gov/optout-instructions.shtml |
| Android Browser | Accept cookies: Checked / Unchecked. No way to enable first part only. | Checked | http://www.usa.gov/optout-instructions.shtml |
| Firefox Android | Cookies: Options "Enabled", "Enabled, excluding 3rd party", "Disabled" | Enabled | Installed on my phone and checked |
| Internet Explorer Mobile | Allow cookies on my phone: Checked / Unchecked | Checked | http://www.windowsphone.com/en-us/how-to/wp7/web/changing-privacy-and-other-browser-settings |
| Blackberry Browser | Accept cookies: Checked / Unchecked | Checked | http://docs.blackberry.com/en/smartphone_users/deliverables/32004/Turn_off_cookies_in_the_browser_60_1072866_11.jsp |
Monday, June 03, 2013
Elastic Beanstalk Tomcat Container Timezone
When deploying a Tomcat container webapp using AWS Elastic Beanstalk with default AMI, it defaults the EC2 instances to UTC/GMT timezone. To set a different timezone the hard way is to create your own custom AMI with the required timezone. If you are only running the Tomcat container on EC2 instance then an easier way to change timezone is to specify is as a JVM command line option. To change the configuration
1. Login to your AWS console
2. Go to "Elastic Beanstalk" service
3. Under your environment click on "Edit Configurations"
4. That should popup a screen and the last tab in the screen will say "Container"
5. Set the required timezone as shown in below screenshot. Java supports these timezones
1. Login to your AWS console
2. Go to "Elastic Beanstalk" service
3. Under your environment click on "Edit Configurations"
4. That should popup a screen and the last tab in the screen will say "Container"
5. Set the required timezone as shown in below screenshot. Java supports these timezones
Wednesday, May 15, 2013
DOJO Combobox On Enter Key Event
Below code can be used to setup a event to fire when a enter key is pressed inside combobox.
1: require([
2: "dojo/ready", "dojo/store/JsonRest", "dijit/form/ComboBox", "dojox/storage", "dojo/request", "dojo/json"
3: ], function(ready, JsonRest, ComboBox, storage, request, json)
4:
5: {
6: var comboBox = new ComboBox(
7: {
8: id: "IdCombo",
9: name: "NameCombo",
10: placeholder: "Enter text",
11: }, "placesomewhereid");
12:
13: comboBox.startup();
14:
15: require(["dojo/on", "dijit/focus", "dojo/keys", "dojo/domReady!"], function(on, focusUtil, keys)
16: {
17: on(document, "keyup", function(event)
18: {
19: if(event.keyCode == keys.ENTER && focusUtil.curNode.id == "IdCombo")
20: {
21: //Write code here that needs to run when enter key is pressed
22: }
23: });
24: });
25: });
Monday, May 13, 2013
Creating autocomplete text box in DOJO
Using DOJO combobox, you can create a autocomplete functionality. Below code creates a programmatic combobox and assigns a json store to combobox. A declarative input form element is used a placeholder on page.
The AJAX service should return items in below json format
1: <script type="text/javascript">
2: require([
3: "dojo/ready", "dojo/store/JsonRest", "dijit/form/ComboBox"], function(ready, JsonRest, ComboBox)
4: {
5: var jsonStore = new JsonRest
6: ({
7: target: "URL for Ajax service"
8: });
9: var comboBox = new ComboBox(
10: {
11: id: "SomeUniqueID",
12: name: "SomeUniqueName",
13: value: "",
14: store: jsonStore,
15: pageSize: 3,
16: searchAttr: "key",
17: queryExpr: "${0}"
18: }, "StoreItemSelect");
19: comboBox.startup();
20: });
21: </script>
22: <body>
23: <input id="StoreItemSelect"/>
24: <body>
The AJAX service should return items in below json format
[{key: "Autocomplete value 1"},{key: "Autocomplete value 2"},{key: "Autocomplete value 3"}]
Friday, May 10, 2013
Dojo TabContainer Tab select ContentPane reload
The usual way to implement a TabContainer is to define a ContentPane as tab childs. When a tab is selected and if you want the ContentPane to reload everytime the tab is selected then you need to specify the refreshOnShow property of ContentPane to true.
In this case when "Second Tab" is selected, it refreshes every time. Refresh basically calls the dojo ready function on the page same as when loading the page using F5. "First tab" on the other hand will only load the first time its selected and will not refresh in later selects
var tc = new TabContainer(
{
style: "height: 100%; width: 100%;"
}, "tc1-prog");
var cp2 = new ContentPane(
{
title: "First Tab",
href: "page1.html",
});
tc.addChild(cp2);
var cp2 = new ContentPane({
title: "Second Tab",
href: "page2.html",
refreshOnShow: true
});
tc.addChild(cp2);
In this case when "Second Tab" is selected, it refreshes every time. Refresh basically calls the dojo ready function on the page same as when loading the page using F5. "First tab" on the other hand will only load the first time its selected and will not refresh in later selects
Wednesday, April 17, 2013
Using dojo.place to add row to TableContainer
-- Assume you have a table container defined declaratively
To add a new row to this table container pro grammatically using dojo.place
dojo.place('
',"tb","first");
To add a new row to this table container pro grammatically using dojo.place
dojo.place('
Tuesday, November 20, 2012
Why E-Commerce Applications Should Embrace Cloud?
Today is day before Thanksgiving and Express (a clothing brand) just sent an email to all its members about its exciting sale offer (50% of entire items). This is their once chance of the year to bring in shoppers to make good revenue. If only they could keep the site up..... If I was part of their engineering lead, I would bring all engineers to the drawing table and rethink scalability and availability from ground up.
Saturday, July 21, 2012
Android: Set up automated backups
I am great fan of rsync backup Android app and use it a lot to sync files from/to Android with my home server. Combined with the Tasker app its a great way to automate the sync on a daily/weekly basis. This blog post lists the step by step instructions on how to setup rsync backup and Tasker to create automated backups.
Sunday, June 03, 2012
A smarter way to calculate distinct counts
I was recently writing a pig script to calculate distinct count over three fields on a big set of data and was getting an out of memory error on the reducer. The data types of these three fields are strings and The issue was the single reducer usage to calculate the distinct count. I couldn't figure out a way around the single reducer and instead used the below approach
Approach throwing the OOM error
Modified approach using a constant
Approach throwing the OOM error
A = LOAD '$inp' using PigStorage('\t');
H = FOREACH A GENERATE $1,$3,$23;
uq_pid = DISTINCT H parallel 20;
guq_pid = GROUP uq_pid ALL;
itr_uq_pid = foreach guq_pid {
generate COUNT_STAR(uq_pid);
}
store itr_uq_pid into '$otp/uq_metric';
Modified approach using a constant
A = LOAD '$inp' using PigStorage('\t');
pid = FOREACH A GENERATE $1,$3,$23,1;
uq_pid = DISTINCT pid parallel 20;
constant_uq_pid = FOREACH uq_pid GENERATE $3;
guq_pid = GROUP constant_uq_pid BY $0;
itr_uq_pid = foreach guq_pid {
generate COUNT_STAR(constant_uq_pid);
}
store itr_uq_pid into '$otp/uq_metric';
Thursday, May 17, 2012
Get latest successful build number from Bamboo
This little script gets the latest successful build number.
SAVEIFS=$IFS
IFS=$'\n'
for ln in `wget -O- --quiet --http-user="{user name}" --http-password="{user password}" 'http://{bamboo site url}/rest/api/latest/build/{plan key}?os_authType=basic' | tr '<' '\n'`
do
build_number=`echo $ln | perl -n -e 'm/number="([\s\S]+?)" lifeCycleState="Finished" state="Successful"/ && {print "$1\n"}'`
if [ $build_number ]
then
break
fi
done
IFS=$SAVEIFS
echo "Latest successful build number $build_number"
Once you have the build number, you can use that to get latest code coverage, artifacts etc. Get the url for the intended resource and substitute with the $build_number variable above
Saturday, April 28, 2012
Ubuntu 11.10 amixer issue
I have previously used the amixer libraries in Ubuntu to programmatically control volume. I basically built a web UI for my media which has options to control volume. With the recent 11.10 (Oneiric) upgrade, the setup stopped working. There are known error cases where unmute does not work and the system does not support a global volume up and down functionality. Instead now you have to control both the Master and PCM to get the desired outcome. Below are the commands that I have ended up with. I have set hot keys that run each of these. The below is a generalized command that can be used with various options
ll={value};amixer set Master unmute;amixer set PCM unmute;amixer set PCM
$ll;amixer set Master 100;
value can be
mute - to mute the volume
numeric value - you can specify a number like 20 to set the volume to 20. On my box the max is set to 60
Tuesday, October 18, 2011
JSPC Maven Plugin Package Name
Specifying package name when using the JSPC Maven plugin to pre-compile jsps
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<configuration>
<packageName>com.company.package.name</packageName>
</configuration>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
Tuesday, October 04, 2011
Amazon AWS Service Status
AWS currently does not provide an API to query service status. They only provide a health dashboard webpage. Although the page has RSS feed capability, I couldn't detect any specific pattern to watch for. This simple solution below works for now. We have created nagios monitoring out of these one liners
status0 = OK
status2 = Performance Issues
status3 = ERROR
The service and region name below is literally as is from the web page.
wget -qO- "http://status.aws.amazon.com/" | grep -B 1 "Amazon Elastic Compute Cloud (N. California)" | head -n 1 |
perl -n -e 'm/images\/([\s\S]+?)\.gif/ && {print "$1\n"}'
status0
wget -qO- "http://status.aws.amazon.com/" | grep -B 1 "Amazon Elastic Compute Cloud (N. Virginia)" | head -n 1 |
perl -n -e 'm/images\/([\s\S]+?)\.gif/ && {print "$1\n"}'
status0
Saturday, August 13, 2011
Rooted my Motorola Atrix
System version: 4.5.91
Android Version: 2.3.4
Instructions found below:
http://www.digitaltweaker.com/android/phones/2011/07/root-motorola-atrix-4-5-91-on-gingerbread-2-3-4/
If you get the "device not found" error when running "adb shell" then make sure you have sync drivers installed. When you connect Atrix to your computer the first time it installs a bunch of drivers and also gives an option to install "synch drivers". Make sure to install the "sync drivers".
Android Version: 2.3.4
Instructions found below:
http://www.digitaltweaker.com/android/phones/2011/07/root-motorola-atrix-4-5-91-on-gingerbread-2-3-4/
If you get the "device not found" error when running "adb shell" then make sure you have sync drivers installed. When you connect Atrix to your computer the first time it installs a bunch of drivers and also gives an option to install "synch drivers". Make sure to install the "sync drivers".
Thursday, July 07, 2011
Repository for JBoss RestEasy Releases
We have been using JBoss RestEasy for developing restful services. The framework is new and we have had to change the repo many times with various version releases and often times the repos fail with permission denied error or dependencies resolution error. A more stable repo for RestEasy is being maintained by the Atlassian folks. We use the below repo and its been working consistently and updates with new releases fairly quickly
https://maven.atlassian.com/content/repositories/jboss-releases
https://maven.atlassian.com/content/repositories/jboss-releases
Subscribe to:
Posts (Atom)


