poorna — August 13, 2008, 11:17 pm

Using MySQL from NetBeans 6.1 IDE on Mac OS X

Detailed article on using MySQL from inside NetBeans 6.1: http://www.netbeans.org/kb/60/ide/mysql.html

Here is a brief write-up with just the instructions:
1. On you NetBeans, open up the Services tab using Command+5 OR Window->Services.
2. Right-click the MySQL (Connector/J driver) and choose Connect Using
3. Replace <HOST>:<PORT>/<DB> with ‘/’ so that the URL reads “jdbc:mysql:///”. For User Name type “root” and hit OK.
If you have already created a database <database>, you can also connect
to the database by replacing <HOST>:<PORT>/<DB> with “localhost:3306/<database>“.
4. Click OK to accept the default schema.
You are now connected to the mysql database server using Netbeans

Detailed article on installing MySQL on Mac OS X: http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html

Quick instructions to install MySQL:
NOTE: Check to see if you already have mysql:
$ mysql –version

1. Download MySQL 5.0 from:
http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg
2. Double-click on the MySQL 5.0.67-community package for Mac OS X installer and go through the installation accepting the license and default choices.
3. Double-click on the MySQL Startup Item Installer for Mac OS X and go through the installation accepting the license and default choices.
4. Add “/usr/local/mysql/bin” to your path by editing /etc/paths using:
$ sudo vi /etc/paths
5. Exit your current terminal and login again for the path reset to take effect.
6. Test mysql installation using:
$ mysql –version
7. Start MySQL using:
$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
8. Create a test database using:
$ mysql –user=root
> create database testdb;

poorna — , 10:10 am

Netbeans 6.1 Icons, Badges, Symbols (updated)

Since I wrote a post on this topic I found this wiki page information on the icons and badges in the Visual Mobile Designer Palette:

http://wiki.netbeans.org/VisualMobileDesignerPalatteReference


poorna — July 30, 2008, 6:52 pm

Thinking out of the box, Fishing without a rod

Caught a recent episode of Anthony Bourdain’s No Reservation episode about Shanghai on the Travel Channel. I was quite amused by the traditional Chinese fishing method of using long-necked fish-eating Cormorants to catch fish. Apparently Erhai lake in Dali province has an economy built around cormorant fishing!

The fisherman (can we still call him that?) ties a thread around the cormorants’ neck so that it cannot swallow big fish although it can eat up smaller fish. While the birds work hard for his dinner he chills out on the boat. May be it is not fair for the cormorant but, the idea itself - brilliant!

Found this Youtube video on cormorant fishing

poorna — July 23, 2008, 10:06 pm

Memory and Cognition Exercises

If you have to take a break at work try CognitiveLabs. I checked out a couple of their tests and am impressed enough to go back for more :).

These folks convert research notes in the field of cognitive speed into interesting games, brain exercises and tests. Their claim is that attention and focus are the key to success at every task and these games and brain exercises improve memory and cognitive abilities. Furthermore, certain tests are designed to provide early indications on potential memory loss candidates and dementia in elderly. Take this test to see if you are demented: http://cognitivelabs.com/cognitive_freetest3.htm :P

poorna — July 20, 2008, 2:08 am

Bear Market Tip 2: Sell and Buy Out of the Money Calls.

It is common investment wisdom that every rally in a bear market should be sold. But, sometimes you do not want to sell tickers that are working. If, you can identify a range in which your favorite stock trades, here is a way to make some money in a sideways market. When the stock is up, sell calls that are just out of the money (the premium is higher) and buy them back just if and when the stock goes low (the premium is lower) on a down day.

I will briefly demonstrate this strategy on one of the tickers I own - Interactive Brokers (IBKR). In the past 3 months, the stock has traded roughly between $27-34.72. My cost basis is around $30. I usually write calls for the next options expiration date (not the current one but, the one after the current expiration date) for a strike price that is just out of the money (say $35). If I time the sale correctly (say when the stock is around $34), I earn a premium of about $2.50-3.00 ($250-300 since each contract represents 100 shares).

There are three possibilities with this strategy: If the stock rises above the strike price plus the premium of the call I sold i.e. >37.5 (35+2.50), I may be assigned the call which means I will lose the shares. But, that is okay since, I will score a good strike price ($5 above my cost basis) plus I get to keep the premium ($2.5). That is a wholesome 25%. I can even get back on the stock and not lose much momentum. If the stock falls lower than when I sold the call option, I usually buy back the call option so that I am ready to repeat the process. It is to be noted that the premium affords me the luxury of holding on the stock even if it falls below my original cost basis upto $27.5 ($30-2.5). If the stock trades sideways in the same range, then eventually the call expires. I get to keep the premium and write another call!

poorna — July 6, 2008, 1:53 am

Myth of Multi-tasking and your Choice.

I do not want to regurgitate Christine Rosen’s article on The New  Atlantis about “The Myth of Multi-tasking“. But, this post has some notes for myself. One of the reasons why people have to multi-task is that great publications like this one are quite long. All those names, affiliations, times and quotes distract the reader’s line of thought. How about just cutting out the quotes and providing the names, affiliations and times in a reference section like they do in technical publications? If I really want to pursue a particular reference I can as easily look it up! ?

Check out the important choice decision at the bottom after reading the interesting bits from the article below:

“Workers distracted by e-mail and phone calls suffer a fall in IQ more than twice that found in marijuana smokers.”

“workers took an average of twenty-five minutes to recover from interruptions such as phone calls or answering e-mail and return to their original task”

“estimated that extreme multitasking—information overload—costs the U.S. economy $650 billion a year in lost productivity”

“functional magnetic resonance imaging (fMRI) scans to determine that when people engage in task-switching — that is, multitasking behavior—the flow of blood increases to a region of the frontal cortex called Brodmann area 10. (The flow of blood to particular regions of the brain is taken as a proxy indication of activity in those regions.) This is presumably the last part of the brain to evolve, the most mysterious and exciting part,”

“evidence of a response selection bottleneck that occurs when the brain is forced to respond to several stimuli at once. As a result, task-switching leads to time lost as the brain determines which task to perform.”

“rather than a bottleneck in the brain, a process of adaptive executive control takes place, which schedules task processes appropriately to obey instructions about their relative priorities and serial order,”

“with training, the brain can learn to task-switch more effectively, and there is some evidence that certain simple tasks are amenable to such practice.”

“multitasking contributes to the release of stress hormones and adrenaline, which can cause long-term health problems if not controlled, and contributes to the loss of short-term memory.”

“Even if you learn while multitasking, that learning is less flexible and more specialized, so you cannot retrieve the information as easily.”

“people use different areas of the brain for learning and storing new information when they are distracted: brain scans of people who are distracted or multitasking show activity in the striatum, a region of the brain involved in learning new skills; brain scans of people who are not distracted show activity in the hippocampus, a region involved in storing and recalling information.”

Techno-social Darwinism: “it is likely that brains that are more adept at media multitasking will be passed along and these changes will be naturally selected” VS. Attention-Deficit Recession: “media multitasking kids might become adults who engage in very quick but very shallow thinking.”

“The faculty of voluntarily bringing back a wandering attention, over and over again, is the very root of judgment, character, and will.”

“Further research could help create clever technology, like sensors or smart software that workers could instruct with their preferences and priorities to serve as a high tech ‘time nanny’ to ease the modern multitasker’s plight.”

Now, is the time to decide:

“Would you like to assume that humans are not capable of multi-tasking and hence just try to develop the faculty of bringing back your wandering attention to focus on single-tasking?”

OR

“Would you like to make a concious effort to start developing the part of your brain for selective multi-tasking so that you can pass on to the next-generation a better set of genes that can eventually evolve into a well-developed multi-tasking system?”

poorna — June 30, 2008, 2:32 pm

SVLG Data Center Energy Summit (June 26, 2008)

Sun hosted the Silicon Valley Leadership Group’s Data Center Energy Summit on June 26, 2008. Talks and panel discussions touched every facet of building energy efficient data centers.

Interesting tidbits from the summit:

- Synopsys forecasts that we will see machines with 350000 cores by 2013. (Source: Sriram Sitaraman’s presentation from Roundtable 1 on Resource Optimization)

- Dean Nelson (Sr. Director of Global Datacenter Design Services, Sun) drew a very enthusiastic round of applause from the audience when he challenged Rackable, Modular Rack Systems to test and compare their modular data center designs with those of Sun’s.

- SynapSense presented the results of instrumenting one of the Yahoo data centers with their wireless sensors. They were able to reduce the Power Utilization Efficiency (PUE) from 1.56 to 1.44 by visualizing the data center environment, suggesting better airflow management and providing adaptive cooling control. Port for hooking up other senorsSynapsense wireless sensor

Each sensor node is 802.15.4 capable and comes with a temperature and humidity sensor. There is a custom port that can be used to hook up other sensors. Their proprietary software SynapSoft 4.0 can be used to provide live imaging maps for thermal, pressure and relative humidity. Alarms, alerts, graphing and the whole kit and caboodle is provisioned. I am impressed with the SynapSense product portfolio since they are sitting smack on a very relevant cross-disciplinary area of data center monitoring and wireless sensor networks.

poorna — June 26, 2008, 12:10 am

Java ME development on Mac OS X

As of this date (June 25, 2008) the only practical solution for Java ME development on Mac OS X seems to be installing Netbeans 6.1 on an alternate operating system (Windows * or Linux) running over VMware Fusion.

Sure, there are a couple of blogs that describe workarounds to getting a Java ME development environment on Mac OS X. JustDev and FaqMobilityMpowerMacOs describe one approach using the MPowerPlayer SDK. Javablog has an article using the MicroEMU WTK.

I tried the former approach with MPowerPlayer and was quite disappointed. The MPowerPlayer emulator crashes quite often even for the simple sample demos that come with NetBeans IDE. Other sample demos that require optional packages such as the Bluetooth demo will not compile. Even open source projects such phoneME that provide these optional packages only cater to Windows (x86) and Linux (x86, ARM).

The latter approach with MicroEMU seemed quite twisted.

Until, Apple updates to JDK 5 Update 14 (version 1.5.0_14) on OS X, I would rather spend $80 on a VMware Fusion license rather than get distracted with little hacks.

poorna — June 23, 2008, 5:52 pm

Netbeans 6.1 Icons, Badges, Symbols

Yeah, I searched for all those terms on the web and on the netbeans.org site. But, could not find the descriptions. But, eventually managed to get help using the following on my Mac:

Netbeans->Help->Help Contents->Search: Look for “icon”

Sometimes, hovering the cursor on the actual icons or badges does not provide a description.

poorna — June 22, 2008, 6:10 pm

Sun’s Data Center Design Services - Green, Energy-efficient, Open

Recently, I got the opportunity to tour Sun’s Santa Clara, CA data center. I must say, I was pretty stoked!

A significant design difference that I noticed as soon as I entered the facility was the absence of raised flooring. The data center was constructed on a concrete slab floor. Such a design gives you additional overhead space and takes away some of the raised floor wizardry costs. Outside each of the modular data center pods is a signpost indicating the actual efficiencies achieved. The best experience at the data center was holding my hand up against the fan of an older server and another against that of a T2000. The older server was blowing hot air while the T2000 was really cool. No wonder even PG&E is offering rebates on buying these CoolThreads servers.

The data center design services group and their achievements are hidden behind the oft-abused terms such as “eco-responsibility”, “green”, “energy-efficient”, “open”. Every company with or without the qualification uses these terms so often that my mind just ignores them by default.

The Sun Global Datacenter Design Services folks are not without qualification though. Local utility company Silicon Valley Power recognized their innovative design of the Santa Clara data center with rebates and awards of more than $1 million. Most notably $250,000 of that was an “Innovation Award” for cooling technologies. The first award of that kind to be awarded to any company ever! (Sources: AOL, CTO Forum). These folks have achieved phenomenal success by reducing Sun’s data center related real-estate by 80% and reducing power consumption by 60%. (Source: Sun.com)

How did the group managed to do it? Look at the equation for efficiency:

Efficiency = IT Load / Total Facility Power

The actual IT Load only consumes about 1/3rd of the total facility power. Cooling provisions take up another third. Power conversion losses at the Uninterrupted Power Supplies (UPS) and Power Distribution Units (PDU) make up for the rest of the total facility power.  To increase efficiency they first replaced all the older servers with the latest Sun servers which improve the compute power at lower consumption while occupying less space. Secondly, they reduced the power consumed for cooling by using innovative modular pod designs. Thirdly, they worked with partners and developed unique overhead cooling solutions that are markedly different from the typical in-row set up.

Sun is open about innovation is and the Global Datacenter Design Services group has created and publicized a blueprint on designing efficient data centers.

Sun has achieved a PUE (Power Usage Efficiency) of 1.28 which is 36% better than the Uptime Institute target and 50% better than the standard! (Source: Dean Nelson’s blog). Next time any other solutions provider offers an eco-friendly, energy-efficient datacenter solution ask them what their PUE is. Request for a customer tour of the Sun Santa Clara data center. Till then a video tour of the SCA data center should do it.