Sunday, 30 March 2008

If Apple Made Pocket Knives ...


Thanks to John Spencer

"Time cools, time clarifies; no mood can be maintained quite unaltered through the course of hours." - Mark Twain

Friday, 28 March 2008

Number Generator Uploaded

Here’s a little program I wrote for fun a few years ago. It runs under Windows and randomly selects six lottery numbers. 10% of all lottery wins payable to me

"Every time you don't follow your inner guidance, you feel a loss of energy, loss of power, a sense of spiritual deadness." - Shakti Gawain

ViewCSVTAB Uploaded

I have just uploaded ViewCSVTAB to my website. It can be downloaded here. ViewCSVTAB is a very simple utility that will open a Comma Separated (CSV) or Tab Delimited (TXT) file and allow you to quickly view it to the screen, and search all columns for specific data. Included in the Zip Archive are versions to run natively on Mac OSX, Windows and Linux.

"No great improvements in the lot of mankind are possible until a great change takes place in the fundamental constitution of their modes of thought." - John Stuart Mill

Wednesday, 26 March 2008

Unix 'Man Pages' Widget

It’s not always easy to remember the parameters and format of each Unix command, especially when you don’t often need to use them. Each Unix system is documented by ‘Man Pages’, each page representing the complete details for a single Unix command. I’ve found a freely available Dashboard Widget that installs on your Mac and gives you the necessary information within seconds:
Try it, its great

"Change is the process by which the future invades our lives." - Alvin Toffler

Monday, 24 March 2008

New Mac Pro :-)

It was time to invest in some new hardware. Dual core is all well and good but I was becoming increasing frustrated by a lack of Memory and CPU when attempting to run multiple VM’s, especially whilst querying large databases and running everyday applications at the same time. I decided to upgrade my main Workstation to something powerful enough to fulfill my needs for the next three years and that could be upgraded easily. I settled on one of the new Mac Pro’s with the following spec:

Two Quad Core Intel Xeon ‘Harpertown’ 2.8Ghz Processors
6 Gb RAM
500Gb 7200 SATA Primary Drive
1 Tb 7200 SATA Secondary Drive
30’‘ Apple Cinema LCD Monitor
16 x Dual Layer DVD Writer
Airport Extreme WiFi Card
ATI Radeon HD 2600 XT 256Mb Graphics Card
Applecare Protection Plan

The immediate benefit of this specification is that I can run several Windows Virtual Machines at the same time without any performance or memory issues, this saves time and frustration as it allows me to do more simultaneously. Have a look at the screenshot, it shows a Windows XP VM (itself running an IP Camera Application) and a Windows 2003 Server VM with Oracle running at the same time as several native Mac applications including a Digital TV Application, iTunes, Mail, Firefox Etc. As you can see from the Activity Monitor and the Menu Meters at the top of the screen it manages all this without breaking a sweat.

I can see this configuration providing a significant productivity boost

"Hope begins in the dark, the stubborn hope that if you just show up and try to do the right thing, the dawn will come. You wait and watch and work: You don't give up." - Anne Lamott

Saturday, 8 March 2008

OSX / Realbasic and Oracle

Despite the Intel Macs having been around for a couple of years of so, it seems Oracle have not yet got around to creating a native Oracle DB client for OSX on Intel. Apparently it is due ‘soon’ according to Oracle. There are a couple of work-arounds fortunately and the one that seems to be working well for me so far, is creating a Universal Binary Macintosh application running against Universal Binary ODBC Drivers from Actual.

The Oracle ODBC Drivers are $29, seem to work well and are easy to install. An advantage of using these is that your other Mac applications such as Word, Excel and Filemaker can also access Oracle through these drivers.

I’ve yet to use them for any ‘heavy duty’ work however so time will tell just how suitable they are for me.

Actual also make ODBC drivers for the other popular SQL Databases.

"Don't let the bastards grind you down." - General Joseph W Stillwell

Friday, 7 March 2008

iPhone Roadmap

On March 6th Steve Jobs, CEO of Apple unveiled the iPhone Roadmap at Apple Town Hall, Cupertino, California. You can view a movie of the event here.

The iPhone has it’s fair share of critics, (most of them haven’t yet used one ...) here are some interesting statistics especially considering the iPhone has only been available for around eight months.

In the US the iPhone now has a 28% share of the Smartphone market, beaten only by RIM (41%) with their Blackberry devices. In addition 71% of the mobile Internet Browser market is taken by the iPhone.

One of the main features of the iPhone Roadmap is concerned with iPhone in the Enterprise. Apple sees massive opportunity here, and rightly so. These are the most desired enterprise features requested by corporates, and they will all be available in the next release of the iPhone software:

Push Email
Push Calendar
Push Contacts
Global Address Lists
Two Factor Authentication
WPA2, 802.1x
Enforced Security Policies
Global Configuration
Remote Wipe

Full Microsoft Exchange support will be built into all iPhones. Direct connection between the Exchange Server and the iPhone is possible utilising ActiveSync wirelessly, avoiding the traditional and convoluted method of Smartphone > Network Operating Centre > Message Server > Exchange Server.

Software Development Kit
Another big announcement concerns the long awaited SDK. This news was well worth waiting for. The iPhone O/S is a modified version of OSX with a full set of API’s for 3D Graphics and Sound, both hardware accelerated, a 3 axis Accelerometer and built in SQLite database. A full suite of tools based on Xcode and Interface Builder are available as is an iPhone Simulator.

For an example of what can be accomplished with this new SDK with just a couple of weeks development time, view the video from 40:50. Fantastic software from Apple, Sega, Salesforce.Com and Electronic Arts, amongst others is demonstrated. If you are a developer and this doesn’t excite you then it’s time to look for a career change

Distribution of iPhone applications will be through either iTunes or the new App Store, directly from the iPhone. Developers get to state their price and take 70% of the revenue, Apple keeping 30% towards the running of the distribution facilities. Free applications can be developed and made available with no cost to either the developer or the customer.

The SDK will be available in June, All the features discussed and demonstrated will also be available on the iPod Touch.

The iFund
A surprise at the end of the event was John Doerr from the worlds largest venture capital company Kleiner Perkins Caufield and Byers, they announced that they have a pot of $100,000,000 with which to fund iPhone related startups.

One word to describe the announcements made at the event ? WOW.

"Better shun the bait, than struggle in the snare." - John Dryden

Wednesday, 5 March 2008

Oracle Top 'N' Queries

If we wanted to query all our Customers from an Oracle database, show the Account Code, Name and Balance and order by the Balance in descending order we would use something like this:

select accm1_cus_sup as Code, accmname as Name, accmledg_balance as Balance
from accm_data
where accm1_co_site = '01'
and accm1_rec_type = 1
order by accmledg_balance desc

What if we wanted to retrieve only the Top 10 Customers who owe us the most money ? The best way of doing that is as follow:

select * from
select accm1_cus_sup as Code, accmname as Name, accmledg_balance as Balance
from accm_data
where accm1_co_site = '01'
and accm1_rec_type = 1
order by accmledg_balance desc
where rownum <= 10

What we have done here is made our initial query into a subquery and used the ROWNUM pseudocolumn to limit the rows returned by the query. This method uses a table scan initially and the rows outside of the rownum count are discarded, giving you your Top 10 Customers by account balance.
Following on but using a slightly different example, what if we wished to display all our Customers in Account Code order, retrieving only ten at a time, maybe within a thin client or web page scenario ? This is how that can be accomplished:

select *
from ( select X.*, ROWNUM rownumber
select accm1_cus_sup as Code, accmname as Name
from accm_data
where accm1_co_site = '01'
and accm1_rec_type = 1
order by accm1_cus_sup
where ROWNUM <= 10)
where rownumber >= 0

Obviously when the user indicates they require the next 10 records you would alter the parameters within the final two WHERE statements accordingly. An important point here is that if the column you are using to order the data is not unique, you must append a unique identifier to the ORDER BY statement. This is usually done by adding TABLENAME.ROWID to the end of the ORDER BY statement.

"When you make a mistake, there are only three things you should ever do about it: admit it, learn from it, and don't repeat it." - Paul ‘Bear’ Bryant