May 29 2012

Formatting an Integer to String in Java

There are times when you need to format a integer or double value into a String, with the comma for values larger than a thousand. If you need to format a numeric value correctly based on the local formatting rules for numbers use the NumberFormat class. Different locales have different formatting rules, for example in France they use the comma as a decimal point where in the United States the comma is used for delimiting large numbers.

double val = 123456.78;
System.out.println(val); // 123456.78

// Use default locale to format string
String localFormat = NumberFormat.getNumberInstance().format(val);
System.out.println(localFormat); // 123,456.78
		
String frenchFormat = NumberFormat.getNumberInstance(Locale.FRANCE).format(val);
System.out.println(frenchFormat); // 123 456,78

May 28 2012

The 80 Percent

I always give 110% to any task I set out to complete. If you ever give anything less than 100% then you get the following logic…

It’s okay if we do 80%, but the 80% needs to be done 100%… We can’t deliver 80% of the 80% we actually attempt of the 100% we are committed too.


May 21 2012

What To Do When iPad Home Button Stops Working

I’m still using my first generation iPad. I’ve had no issues with my iPad except that a little over a month ago the home button would occasionally stop working. The home button would work intermittently and I would have to push it multiple times for it to register. After a while, the home button would work one time five or ten. The home button on the iPad or iPhone is important because it is what you use to exit out of an app. No matter how I pressed the home button on my iPad or how long I held it down it would not exit out of the app I would be using. I grew frustrated and even considered trading in my otherwise functioning iPad.

The way I worked around the home button not working is to use Multitasking Gestures. As soon as you detect any issue with your home button on you iPad go and open the Settings app. In the Settings app, click on General and then enable the Multitasking Gestures. Once you have the Multitasking Gestures enabled, you don’t need the home button to exit an app but can instead exit an app by pinching your five fingers together. Place the tips of your five fingers in the screen and bring your fingers together to the center of the screen in a pinch gesture and it will close the currently opened app.

If you find that the home button on you iPad stops functioning correctly then turn on the Multitasking Gestures from the Settings app. The five finger pinch will act as if you pressed the home button. You can also do a five finger swipe to move from different apps or you can swipe up with five fingers to reveal the multitasking bar and navigate between apps this way.

iPad Multitask Gesture

iPad Multitask Gestures setting


May 16 2012

Retweet April 2012

From time to time I just blast tweets about software development, project planning, team dynamics, or whatever else comes to mind. Here is a synopsis of recent tweets and rants. If you want to follow the conversation follow me at techknow and/or juixe.

Software Development

  • Too often I’ve seen code that made me lose my lunch.
  • Sometimes source code is like the sausage factory where you don’t want to look what goes into an application.
  • One developer’s corner case is another user’s daily workflow.
  • Application logs are like money, you can always use more… Unfortunately they are like pennies, the more you have the more difficult it is.
  • Fix the problem, not the symptom. Some developers prefer to fix the symptom because they don’t know how to find the root cause itself.

Team Leadership

  • It is important to lead the way and then immediately get out of the way.
  • If it doesn’t make sense to me it is because you are not explaining it correctly.
  • Everyone has a right to their opinions but not everyone’s opinion is right.
  • Great ideas don’t belong to any one person. Great ideas are not unique to anyone. Great ideas stand on their own.
  • If you are safe in your comfort zone you’ll never be in the zone.
  • Even when I think outside the box, I am still in the zone.
  • There are no easy answers without hard choices.
  • It’s one thing to make sense and a completely different thing to be clear.
  • There are some things in life that are not meant for you to understand but to accept.

Product Placement

  • Things Apple should buy: Evernote, app TLD, Square, and my blog.
  • The Notes app on the iPhone badly needs an to support the undo and redo feature.
  • The new Google+ is the new New Coke.
  • If Google would have invented Polaroid, the film would be free but full of ads and a copy would be uploaded to the cloud.
  • Some of Google’s UI often looks and feels like the uncanny valley of design, it has a plastic aspect to it.
  • My other Tumblr is a Moleskine.
  • So much of the content I see in Pinterest seems to come from Tumblr…
  • Instagram has no ads, only available on mobile, Android support just added, not profitable, no web presence… Obviously worth $1 billion.
  • Instead of paying a billion in cash and stock why didn’t Facebook just pay a billion in Facebook Credits and likes.
  • Silicon Valley back of the envelop valuation math: Tumblr + Camera+ > Instagram therefore Tumblr + Camera+ = $10,000,000,000++.
  • I don’t understand @McDonalds economics… A whole McChicken sandwich costs $1 but ask for an extra BBQ sauce and you get charged $0.50.

Silicon Angels

  • Is it possible for the whole of Silicon Valley to jump the shark? If and when it does there will be a large splash.
  • Silicon Valley valuations are relative to previous largest valuation.
  • The Internet is paved with high valuations.
  • Frothyness is the new truthyness.
  • Frothy does a body good.

Randumb

  • I want to see the world in HD.
  • What do we want? Our way. When do we want it. All the time.
  • If someone says something that is factually untrue, it doesn’t mean they lied… It means you lied to yourself by believing it. #truth
  • One persons guest house is a other persons mansion.
  • Some people build walls, others bridges, I build BS radar detection systems.
  • Retweet, reblog, repin, remix, rinse, and repeat!
  • I think in numbers.
  • All language is a metaphor.
  • Trolls shall inherit the earth.

May 10 2012

Software as a Pegboard Set

Software is not like traditional engineering disciplines. Unlike a bridge whose requirements are essentially set in stone, software requirements consistently change and evolve with the needs of the business. The requirements, of say civil engineering, are more firm and concrete than that of software engineering because the artifacts that are being constructed are usually large physical objects like a road or bridge. In the other hand, software is malleable and it often refactored easier than business constraints, that is why product managers often prefer to wedge a round peg (software) into a square hole (requirements) as business constraints evolve. But unlike a kid’s shape sorter or pegboard set, the peg and the hole are consistently changing and not always into the same shape.

Shape Sorter Toy

Shape Sorter Toy


Apr 16 2012

Local Family Tech Support

It is hard to explain to family members that even though I “work with computers” as a software engineer I can’t always fix their computer problems. I tried to explain it to my grandma that I am more like a “race car driver than a mechanic when it comes to computers. I know how to use a computer but not how to fix the weird noise your computer makes.”. To which she responded, “oh that is fantastic, I can’t get this printer to work… It complains that I need a driver.”