Sep
30
2011
I’ve always found that when defining a database table it is always best to create a integer primary key, even if a unique key such as social security number, ISBN, or some other business value. Recently I had to go through the unpleasant process of updating a database table and associated scripts, resources, and code that had used a business attribute as the primary key but because of business requirements it was no longer unique and had grown to have different meanings. Because your business requirements will change, don’t use business attributes as primary keys for you database design. In addition, don’t overload attributes to more than one meaning. For example, the database that I was working with had a database column called Sequence that functioned as the primary key, the line number, and a workflow execution order to process the data. It is a source of confusion and bugs to overload one attribute to so many different meanings.
1 comment | tags: business, database, ddl, define, design, requirements, schema | posted in Programming, SQL, TechKnow
Sep
12
2011
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
- More code, more problems.
- Code. Money. Respect.
- Code war is the new cold war.
- The programer-designer is the philosopher-king or our time.
- Give a man a fish and he’ll eat for a day. Teach a man to gold farm and he’ll eat for a lifetime.
Team Leadership
- When the world is flat and information freely available there is a premium on creativity.
- There is no such thing as free lunch, especially if it’s lobster.
- Give a silicon valley startup founder a lemon and he’ll make a social networking site for people that like lemonade.
Product Placement
- I hope Twitter doesn’t become the next MySpace.
- There is no i in Apple.
- Google is buying Motorola for $12.5 Billion. Google is also developing a autonomous car, so in a few years it might buy Ford.
- It’s not Thanksgiving, so why did Google pay so much for a moto turkey?
- AT&T charges for services you use and most importantly for services you don’t, and they sell you out to the feds on top of that.
- I know that many G+ users are still in the early adopter stages of denial, but honestly, Google does not know how to do social right.
Quote
- Money is a terrible master but an excellent servant. – P.T. Barnum
- Wall Street is now a huge mathematical game of chess where individual companies are just pawns. – Mark Cuban
- Search is dead. What people want is an answer. … You don’t need Trip Advisor, you don’t need Yelp. – @Jason, #TWiST 171
Questions
- Got Woot?
- You think Papa Murphy’s is related to Papa John’s?
- Has Flash lost it’s fizzle?
- If G+ was spun out of Google as an independent company it would be valued at $50 billion.
- What company will be around in 25 years, Apple, Zynga, Facebook, Google, eBay, Microsoft, …???
- Now they are making movies in 4D… What is next, 7D?
- If this is your third startup, are you really still a starting up?
- I just want to know, why are those birds so angry?
Randumb
- When life gives you bullshit, make lemonade.
- Untangling headphones in the dark.
- Current Status: somewhere between FML and IDGAFF.
- Zoned out from being on the zone for so long.
- The future is retro.
- Don’t trust your shit to chance.
- MTV has as much expertise to produce MTV’s Music Awards as the History Channel’s has to produce Ancient Aliens.
- It’s ironic how many people misuse the word irony.
- Even though I haven’t gone back to school for a while now, I can’t resist a good Back To School sale!
- I tired of Shark Week. When will they have Turtle Week or Salamander Week?
- If Teenage Mutant Ninja Turtles were to be created now they would have been known as Angry Turtles.
- Total Retargeting
- Shift+Happens
no comments | tags: apple, google, media, motorola, mtv, plus, social, twitter | posted in Programming, Rant
Sep
9
2011
I’ve had situations where I’ve needed a list of foreign keys (fks) that I get from a result set and from that list make additional queries. Sometimes for whatever reason there are null values in the list and I have to remove them. You might had a similar problem where you needed to remove multiple occurring value from a lists in java. There are a few ways you can approach this problem. You you can remove each occurrence of a list element one at a time. The example below removes any null element in the list one at a time.
while(ids.contains(null)) {
ids.remove(null);
}
There is another approach you can use to remove all instances of a given value from a list in one go. Instead of the remove method you can use the removeAll as in the following code sample.
ids.removeAll(Collections.singleton(null));
Of course, instead of null values you can remove all instances of any given value from a list based on your business needs.
1 comment | tags: arraylist, collections, Java, list, null, removeall | posted in Java, Programming
Sep
8
2011
For the longest time I’ve used the BrowserLauncher library to open the default web browser to a specified web page from Java. BrowserLauncher is simple to use, just import edu.stanford.ejalbert.BrowserLauncher and call openURL method with the desired website URL.
Since Java 1.6, the JDK has introduced the java.awt.Desktop class to do the same so you don’t need an additional third party jar. The Desktop class has the ability to launch the desktop’s default email client and default web browser given a URI. Here is how you can launch the desktop’s default web browser in Java.
// Launch your default email client with ...
URI email = new URI("mailto:myemail@mydomain.com");
Desktop.getDesktop().mail(email);
// Launch your default web browser with ...
URI url = new URI("http://www.mydomain.com");
Desktop.getDesktop().browse(url);
1 comment | tags: browser, desktop, ejalbert, firefox, Java, launcher | posted in Java, Programming
Aug
5
2011
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
- I can’t take an IDE seriously if it looks like iTunes.
- Beta at your own risk.
- Refactor and remix yourself.
Team Leadership
- Moving on to plan b, section iii, revision 10, update 8, …
- Everything happens for a reason but not every reason is meant to be understood.
- The key to being cost effective is first being effective.
- To change your life, try to change your trajectory.
- Who is in your development dream team?
- Originality is dead. I know this because I copied it from someone else.
Product Placement
- Install Lion, Xcode 4.0 not supported, need to upgrade to Xcode 4.1, a 3GB install.
- Apple already working on next OS X release, tentatively known as Sea Lion.
- Google Plus going after Facebook is like an 800 pound gorilla going after a 800 pound rhinoceros.
- Google’s motto: Do no evil without cresting a algorithm to automate evil.
- G+: don’t be a square join a circle.
- The next release of Windows should come with one key feature: a 100GB DropBox like cloud spaces for free integrated into the OS, Office, etc
- I wish I could use Google to search my memories to find where I last placed my keys.
Question
- What is the speed of time?
- Isn’t Captain America wearing the big Scarlet Letter on his forehead?
- Which is worse: different day, same shit or same day, different shit?
- Is it just me or is it hot in herre?
- Fruit by the Foot or Sugar by the Pound?
- Why does it feel like Friday when it should feel more like Wednesday?
- What is the weather report on cloud computing?
- Is Jack Dorsey the web 2.0 version of Steve Jobs?
- If you had 8 more hours a day what would you do with them?
Randumb
- There is no God particle. Sub atomic particles are atheists.
- A live police chase is the human equivalent of a lolcat watching a light beam.
- When time flies it does so in first class.
- Frankie Says Chillax
- Bay Area Forecast: Fog-Drizzle My Nizzle Fo Shizzle.
- I’ma power up with a power nap.
- It is what it is and it do what it do.
- La Gaga has jumped the outer space shark.
In Da Future
- In the future, a picture will be 90% filters and photoshop and 10% reality.
- If the future could travel faster than the speed of time then it would travel back in time.
- In the future, the revolution will be fought with tweets.
- In the future, every other word in a sentence will be a registered trademark.
- In the future, the exercise of free speech will be deemed suspicious.
- In the future, a large portion of the president’s state of the union speech will be redacted.
- In the future, action figures will be illegal and replaced by diversity and cooperation figures.
Summertime
- Happy 4th of July. Let keep America free!
- Long live freedom, death to red coats.
- It’s going to be one hot fourth of July.
- Beerbeque.
- There is no freedom without choice.
- I’m so cool that the heat don’t get to me.
- Beans and cornbread.
- This heat is like kryptonite.
no comments | tags: chillax, fourth, google, ide, iphone xcode, kryptonite, osx, plus | posted in Programming, Rant
Jul
1
2011
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
- Know thy framework.
- I recently received two books, one on Scala and one Clojure. From reading the few chapters on each, I have to say I like Clojure best.
- How do you pronounce C++0x? Is the ++ silent?
- Coworker: Functional programming is the future. Me: Functional programming has been the future since the 80’s.
- Developers love to reinvent the wheel. Which means, writing their own editor, IDE, bug tracking, version control, wiki, web framework, blog
Team Leadership
- Live each day to it’s potential.
- Today is a new and improved day. It only gets better.
- Every day has the potential to be your best day of your life, because today is the only day that matters.
- Love what you do is a key to success.
- If you are about to fail, do it with flair.
- People need to learn how to disrupt an entrenched business, product, or industry. There should be a class on disruption.
- Always walk into a meeting with pen and notepad.
- If you want to survive, you need to adapt.
- If plan A doesn’t work move on to plan B, and it that doesn’t work, move to plan… That is why we have 26 letters in the alphabet.
- The most critical aspect of making a mistake is usually not the mistake but how you respond to it.
- Ideas aspire to be more than just ideas.
- Practice what you preach and live what you teach.
- One easy way to think outside the box is to add an extra dimension.
- The fact that unicorns aren’t real doesn’t mean that people won’t buy unicorn bacon.
Product Placement
- You’ll know if Google+ is successful when a congressman’s penises are accidentally posted and shared on it.
- What is up with these Google+ invites? The seem to be worth their weight in BitCoins.
- By the way he writes, I think David @Pogue is Apple’s VP of Marketing.
- I like the Migration Assistant in OS X. You can migrate data and apps to a new Mac from another Mac, mac backup, or external drive.
- Did @airbnb use the same black hat techniques that picture collectors and questionable dating sites use on @craigslist?
- The Swiss should make a Swiss Army iPod case.
- Companies are using positive tweets about their products as endorsements in commercials. I wonder if those Twitter users got compensation.
- How many screws does it take to take out a hard drive from a Mac Book Pro? I lost count at 21 screws and two different screw drivers.
- I don’t even know what language I speak when I order at Starbucks. Iced chai grande Americano hella latte extra cafe con leche fo shizzle.
Quote
- Checking in is so 2009. – Dave Matthews #TWiST
- If it’s printed, it’s no longer news. – @jbminn
- You can make a buck with cat pictures – Steve Yegge
- The impossible might take a while. – Scott Heiferman, #TWIST
Question
- Would you pay an extra $100 to buy an iPad made in the US?
- Do super models have role models?
- What is your innovation strategy?
- How smart is you network, team, or organization?
- How much is the whole of the USA worth?
- Since when is it a feature to have your product available in white?
- Is Instagram the new Polaroid?
- Will any software application last 100 years?
- Do you give a tip on pick up or only on delivery?
Randumb
- And then Jobs said, “Let there be an app market.” – The Book of Jobs
- I don’t respond well to BS.
- Love is a by product of accepting yourself and others as they are.
- It’s always a good morning when you can sleep in.
- To sleep or not to sleep, that is the dream.
- Be you. Do you. Get yours.
- Love love and live for life.
- Love is transdimensional.
- Love don’t cost a thing if you file for chapter 11.
- Lifetime movies is like porn for women.
- Any place that claims to be the happiest place on earth is really covering something deep.
- I wish my closet functioned like the TARDIS from Doctor Who, so my fashion could always current and I could have extra space.
- I’m a register member of the Ninja party but I have some Pirate party leanings.
- The most read book is Facebook.
- If only we could solve all of the world’s problems with a dance battle.
- Heading out to a beerbeque.
- Empathy is my religion.
- Everyday should be like Friday.
- Hollywood can follow up a successful movie with a sequel, a prequel or an alternative timeline-quel.
- Twitter is where quotes go to get misquoted and then retweeted.
no comments | tags: airbnb, beerbeque, clojure, craigslist, google, plus, pogue, scala, starbucks, yegge | posted in Programming, Rant, TechKnow