The
Ultimate
Business Machine

Technology, business
and innovation.

And, not least, about
the Mac.

Weblog Archive Cutedge

by: Bernard Teo








Creative Commons License

Copyright © 2003-2012
Bernard Teo
Some Rights Reserved.

Sat 16 Dec 2006

A Denial of Service Attack?

Category : Technology/DoS.txt

I think I'm getting what looks like a Denial of Service attack, since 12 hours ago, and it looks like it's getting worse.

The way it works is that my web server is getting lots of hits from all over and since the server can't distinguish between "real" and "simulated" hits, it wastes resources responding to the evil ones and so deny service to the legitimate users. This can bring the site down.

It's probably some Windows guy who doesn't like what I wrote in these pages.

For some time it has been suggested that I write Firewall software, like Brickwall (now known as Flying Buttress), to round up my collection. But I never could find the time.

Looks like I've been forced to go down this road, to understand what is going on. I'll be a computer security expert, at the end of all this, if I can figure out how to put a stop to this.

Help would be most appreciated.

So, if you're wondering why this site is slow, this is the reason :-(

Posted at 4:08AM UTC | permalink

Wed 06 Dec 2006

Frameworks

Category : Technology/Maven0dot3dot1.txt

This is embarrassing. I just realised when, I was loading up my gleaming new white MacBook, that Maven wouldn't run on any Mac other the one I had developed it on.

I screwed up the path settings for the database connectivity frameworks that I embed into Maven, so the application couldn't find them when it's loaded on another Mac. That's why Maven wouldn't run. But I've fixed it now in version 0.3.1 beta.

In this version, I've fixed some more bugs, and you can enter, modify, add or delete database records on any of the three currently supported databases - SQLite3, PostgreSQL 8.1 and MySQL5. I've made sure to test all three databases by now.

I'm now working on the ability to alter any of the table structures on any of these databases, e.g., to add or delete fields, indices, and constraints. To make all three databases work like they're the same to a Mac user, even though they're all quite different from each other in myriad ways - that's going to be the challenge.

A word about frameworks. They're like DLLs on the PC. They add functionality to an application and they can be shared by applications, e.g., Luca and Maven share the use of the same database connectivity frameworks, in which case they're normally stored in a common location, like/Library/Frameworks. But what if you want to delete Luca and Maven from your system and don't know enough to go find the associated frameworks in /Library and delete them, too? Then they live on as junk in our systems - our very own form of DLL Hell.

There's an alternate approach - embed the frameworks inside the application so they come in as one package and they die together when you later drag the application to the trash.

The picture below shows where I've embedded the connectivity frameworks - you can see them when you Control-click on Maven or Luca and do a "Show Package Contents" :

I love the thoughtfulness of this particular design - it hides the complexities from the end user so everything comes in and out as one convenient whole.

But the thoughtfulness didn't just end there, otherwise the PC geeks would have just another example of how Mac users are such wimps. The problem for a developer is, it's a pain to move each of these frameworks into the each of the applications that use them, each and every time you need to make a change to any of the pieces, just so you can test them together.

So, while developing applications, you would prefer a shared model whereby once you've made a bug fix to a framework, all the applications that use it will automatically be able to access its latest state without your having to manually move it into each application. And that's what Xcode allows the developer to do. We get the best of both world - a convenient shared library approach while in development, and it smoothly dovetails to build an integrated package out of all these little pieces that a Mac user can then conveniently use.

Maybe it's a little hard to explain this, but when I discovered how to do this, I thought, this is so neat, because I don't have to keep so many things in my head. I don't have time for the Microsoft measure of intelligence, like how many manholes are there in New York or how to move Mount Fuji, because I find, first of all, that that intelligence is without context. But I love these ideas, like frameworks on the Mac, because these are ideas that have been put together by people who understood the context in which the tools had been used and who then went on and really made them work better. That's why we can fall in love with these things.

Posted at 6:44PM UTC | permalink

Thu 30 Nov 2006

Maven beta 0.3

Category : Technology/Maven0dot3beta.txt

I've released Maven beta 0.3. It's now able to modify, delete and add data rows in the Contents table view. You can save these changes back safely to the database, or revert to the last saved status or revert selected rows. And I've enabled printing, plus you can drag & drop the data rows into Excel.

I'll work on the Structure table view, next, so we can alter the table structure, and add or delete fields, indices, and constraints. This is really going to be the crux of why I'm doing Maven (and not just as a CocoaMySQL alternative). I want to be able to get the data in and out of databases with surgical precision and use the database connectivity frameworks that I'm building to hide the differences in data types between SQLite, MySQL and PostgreSQL.

I really ought to be working on Luca, e.g., to add the ability to compute and record different tax rates on each line item so our Canadian friends can use it, as well as to add the invoicing and inventory modules. But I believe that the time I'm spending now on Maven, to improve the database connectivity frameworks, will pay back in terms of increased productivity and a greater ability to leverage the power of databases, when I get back to doing Luca and its add-ons.

And, to whet your appetite as to what we can expect, increasingly, to see the Mac do, here's a link that Kevin Mickey sent me about what someone had done to enable barcode scanning using the Mac's built-in isight camera - http://www.bruji.com/cocoa/barcode.html. The picture below shows Bruji's BarcodeScanner application scanning a barcode into the Mac using my Intel iMac's built-in camera :

And, to complete the cycle, I went and found another site that demonstrates how to get those barcodes printed in the first place, from a Cocoa application, without needing special barcode fonts - http://www.lamarchefamily.net/nakedsoft/ :

And so, you see, the Mac can do some amazing things. There's iCal integration with Address Book, Open Directory, and email-iCal-To Do integration. There are lots of things we can do. (My particular dream is to put these things together so they work seamlessly.)

If you're a soccer fan, you know the saying, that the great strikers like Ruud van Nistelrooy, they don't go where the ball is - they move to where they think the ball is likeliest to fall next. It's the same here. You see all these stuff happening on the Mac and you know you're heading towards the most productive time to be a Mac developer. And it's gonna be the most rewarding time, ever, to be a Mac user.

Posted at 8:26AM UTC | permalink

Wed 15 Nov 2006

Maven beta 0.2

Category : Technology/Maven0dot2Beta.txt

I've changed Maven's layout to implement split views. This is how I've been wanting to work with the data when I'm studying a database and its structure :

I've also implemented drag-and-drop of table names and columns to build, for the moment, single-table queries. Will work, next, on adding the ability to update the database, alter the database, and then move on to add support for multi-table drag and drop to build up a query.

Posted at 2:50PM UTC | permalink

Sun 12 Nov 2006

Workaround Bonjour No More on Intel Macs?

Category : Technology/WorkaroundBonjourIntelMac.txt

This is interesting. I just realised that I don't get the Workaround Bonjour stall on my Intel iMac anymore.

I wonder when that started to happen. I remember checking if it's still there when I updated my machines to 10.4.8, and was disappointed that it still was.

Perhaps, I've only tested it on my G4 iBook? So, to be sure, I went back to the G4 iBook and, sure enough, it's still there. It still stalls everytime a call is made to launchd load.

So, maybe I hadn't tested it on my Intel iMac. Anyway, it's gone, on that machine. I've only got that one Intel Mac. I would love to hear it if anyone else can confirm it.

Posted at 1:26PM UTC | permalink

Fri 10 Nov 2006

Maven

Category : Technology/Maven.txt

I'm working on something I'm calling Maven. This is how it fits.

But before that, let me back up a bit and explain how my world view had been shaped. I believe I'm lucky to be living in Singapore at just this point in time - just one generation earlier, and I would have been engulfged in the deprivation brought on by the Japanese invasion of World War II - no Internet and definitely no Mac, and no career as a software developer.

But when I see some parts of Bangkok that looked a bit like how Singapore used to be, I'm old enough to remember how we had made that progression.

It started with infrastructure - the building of the roads, the airport, the harbour, and then the neat, clean factories and pioneer industries.

Actually, it started with the rule of law, which we were fortunate to have inherited from the British. Read William Bernstein's fascinating and illuminating "The Birth of Plenty" about how democracy follows economic and material progress and not the other way round. But, then, I digress.

So, that's what I have been working on - building the infrastructure. The mail server, web server, and database server - these are the roads, rail and harbour when you're setting up a business.

I was at a Red Hat Linux talk yesterday and much of what was said was so much IT talk - IT guys talking to each other - of backports, and escalation, and service level agreements - all hot air over the heads of end users.

I see a different movement - of people who're coalescing around much smaller scale enterprises. Just because they can. And they've got no room for IT departments. They use consumer-level tools. And they want (and need) software that works like their consumer-level tools. Works first time, with a slip of paper for the manual, or no more than five pages. Because who has got the time to read the manual?

As organisations, they may be small in size - but as a market, in aggregate, they're huge - they're going to be huger than the old-line enterprises, if they not already are.

So what all these enablers (like MailServe, WebMon, and DNS Enabler) do is help these bands of people or individuals snap on and set up their computing/communications infrastructure, in a fashion that tries at least to match the joy of using a Mac.

But what people also need are databases - to store, organise, record and analyse their business data. A good database mirrors the health of the business. We have great database solutions on the Mac - SQLite3, MySQL5 and PostgreSQL - and they're all free and very powerful. But they remain hidden, unless there's a way to help people tap their potential.

That's what I'm trying to do with Maven - to realise the potential of all these database solutions so we get them to play with the rest of the things we're starting to exploit.

Ironically, it is Microsoft that is showing us the way - look at this demo of Microsoft's Office Accounting Express. The power comes from having an integrated workflow - with all the parts coming together to make the whole greater than the sum of its parts. This is what I'm trying to express, to tie all these things I'm doing together. We can do it on the Mac. I, of course, believe we can do it better. That's why I built Luca, the accounting system. Otherwise, why bother?

Posted at 6:15PM UTC | permalink

Thu 26 Oct 2006

Luca 2.4

Category : Technology/Luca2dot4.txt

I've received an updated French localisation from Joselyne Rochaud and Corentin Cras-Méneur for Luca.

I've decided to name this as Luca 2.4 to denote that it's a major change with the addition of the PostgreSQL option. Should have just done it earlier.

Posted at 5:56AM UTC | permalink

Wed 25 Oct 2006

Luca 2.3.2 with PostgreSQL Support Released

Category : Technology/Luca2dot3dot2.txt

I've released Luca 2.3.2 with PostgreSQL support. There are also some minor bug fixes. I've promised some people that I'll do the Postgres version. So that's a promise kept.

A good way to try out PostgreSQL on OS X is via Marc Liyanage's very excellent installer.

The PostgreSQL documentation page provides a nice gentle introduction to SQL. I'm finding that, between the three - SQLite, MySQL and PostgreSQL - I'm using PostgreSQL more like the reference platform for standard SQL. I'm looking for a way to write code that is perfectly portable across the major SQL platforms. I'm encouraged, from this successful port to PostgreSQL (it took only five days), that this is in fact possible. This may point to a commoditising of the database layer, since these products become largely substitutable for one another. Let's see if this proves to be true.

Posted at 1:47PM UTC | permalink

Thu 19 Oct 2006

Luca & PostgreSQL - Client/Server - It Just Works

Category : Technology/LucaPostgreSQLClientServer.txt

I've got Luca on PostgreSQL largely done. Maybe a bit more testing is needed, just to be sure. But every Luca feature works on PostgreSQL.

A few things PostgreSQL does differently from MySQL and SQLite : (1) PostgreSQL "folds" all table and column names to lower-case. I've mentioned that before. (2) It doesn't support DROP TABLE IF EXISTS - so I had to find a way to check that a table exists before dropping (deleting) it in a script. And (3) It's very picky about dates - it won't accept invalid date values. But sometimes we don't yet know an exact date, like a date-of-birth field. Both MySQL and SQLite are much more accomodating and therefore more practical. Quite like the way Java is so dogmatic when compared to the wonderful pragmatism exhibited Objective-C. But other than that, all the SQL code behaved properly when ported over to PostgreSQL. This is better than I had ever dared hope it will be.

I copied this build of Luca over to a machine, my iBook, which doesn't yet have PostgreSQL installed on it. I started up Luca on the iBook, and pointed it towards the machine that does have PostgreSQL and is hosting the accounting database, i.e. my Intel iMac.

And ... it just works. Luca accesses the database over the network. All the magic is packed into the little connectivity framework bundled into Luca. You don't need anything else on the client machine. And the clients can be any Mac, anywhere on the Internet.

Note : MySQL uses port 3306, Oracle uses 1521, and PostgreSQL uses 5432. These are the ports I had to open in my firewall. The only other thing I had to do is to edit the PostgreSQL config file to give my particular Postgres user account the rights to access the database from any IP address. And that's about it.

And I'm thinking just how stupid Oracle is. You have to go to every Oracle client to install SQL*Net - a 20 to 30 minute installation on a PC - even if you just want to access Oracle via a GUI application.

A PostgreSQL or MySQL database installation is done in just minutes. By way of contrast, an Oracle database installation can take you at least half a day. And, believe me, at the end of it all, it doesn't work any better. In fact, you can get a lot more work done, a lot faster on PostgreSQL or MySQL. There are some config file editing for PostgreSQL and MySQL, e.g., for setting up user account access rights. But if I build a Postfix Enabler/DNS Enabler-type interface for this, it can be done in seconds.

All this speed adds up to a tremendous business advantage. You can pack up, go somewhere else, set up shop, and be operational in minutes. This is the holy grail of disaster recovery planning (provided you have off-site backup for your data). Use a Mac. It doesn't just look good. It's got muscles in all the right places.

Posted at 6:19PM UTC | permalink

Tue 17 Oct 2006

Luca & PostgreSQL - It Works

Category : Technology/LucaPostgreSQLWorks.txt

And I'm stunned :-) This is Luca pulling data from a PostgreSQL 8.1.4 (on i686-apple-darwin8.7.1) database :

Of course, I've still got a lot of testing to do. But so far, all the reports - like Chart of Accounts, Trial Balance, etc - work. And I can update, modify and delete data.

Even the blob data type, which I used to store CurrencyFormatter objects, works (though it's called a bytea field in Postgres). In the larger scheme of things, this is significant. Blob fields can be used to store any media types - pictures, sound files, documents, etc. So I now have the means to move these data types across any of the three SQL databases - SQLite, PostgreSQL, and MySQL - that are free and popularly used.

PostgreSQL is a "buzzword-compliant" database system - ACID, views, triggers, stored procedures, transaction locking, concurrency control, etc.

I'm like a kid in a toy store. Or a more apt metaphor, like a Samurai who's just found the Master's sword. If you've ever worked on Oracle in a corporate environment, where you have to beg a database administrator to condescend to give you access your own data, you'll know how liberating it is to have this kind of tool, this kind of power, available on tap, and so easily wielded.

Forgive me while I go into hyperbole. This is the Mac in all its protean majesty. Some people use it to listen to music, organise photos, make movies. Others will wield it like the Universal Turing Machine to simulate all other machines imaginable - cash registers, accounts ledgers, etc. The database, in making it possible to make intentional and retrievable associations between pieces of data - is the bridge that carries us from data to information to knowledge and, hopefully, to wisdom.

Suddenly, the two thousand odd dollars we paid to lug this little white beauty of a machine around? Isn't it such a bargain?

Posted at 12:07PM UTC | permalink

Mon 16 Oct 2006

PostgreSQL and Luca

Category : Technology/Luca_PostgreSQL.txt

I've built a database connector framework, over the last few days, to allow Luca to store its data into a PostgreSQL database.

Luca already works with SQLite and MySQL. And we did build also a database framework for OpenBase, and went as far as being able to show the Chart of Accounts and Trial Balance on OpenBase, but I realised (it seems) that OpenBase doesn't support the SQL command, Union, which we used quite a bit - particularly in being able to generate a Statement of Accounts or an Ageing Report reasonably quickly. So I've left that aside for the moment to work on PostgreSQL which does support Unions.

I've been able to populate a Postgres database with data needed by Luca, and that was rather satisfying - that our framework's structure works across four database types now.

But I've hit a curious snag.

I've named my database columns using mixed case because "currencyCode" is much easier to read than "currencycode". But PostgreSQL "folds" all column and table names to lower case, by default. So my column is named "currencycode" in Postgres.

When the data is read back into Luca, they're packed into dictionaries so that it's easier to access each field value using Objective-Cs "valueForKey" construct.

But C, on which Objective-C is based, is of course case-sensitive and so 'valueForKey:@"currencyCode"' which I use all over the code does not work now that the key, that is returned from Postgres, is called "currencycode".

There are various ways of solving this, with a variety of trade-offs. So I'm mulling it over.

But, if you're management, how do you assess this situation? Should you allocate resources to explore the options and produce a solution? First question, "why bother?".

Well, PostgreSQL is free, and there are no contraints on its use, whether for commercial or open source development. It's easy to install, or at least the Mac OS X installation went like a breeze (use Marc Liyanage's installer). And PostgreSQL has been known to break new grounds that later became standard features on other databases. So this is a great tool to have in your toolset.

There are some questions whether MySQL's licensing will allow its C API to be embedded inside a commercial application, with no restrictions. Sometimes, I read, yes; sometimes I'm not too sure.

But there are no such ambiguities with SQLite and, I think, also with PostgreSQL. And so, with SQLite forming the core of a light-weight embedded database that is shrinkwrapped into Luca, and PostgreSQL for people who need multi-user, concurrent, client-server access with transaction locking, that should cover all the bases.

Posted at 3:43AM UTC | permalink

Sun 15 Oct 2006

Why Bother?

Category : Commentary/whybother.txt

Coming back to a question I posed last week :

Is it possible to understand and thereby manage the software development process (and make decisions on what platforms to standardise on, what directions to take, technologies to adopt, etc.), if you're not yourself a competent programmer?

Sometimes I think the answer is, yes. After all, we drive our cars without knowing how they actually work. And we use our computers without knowing anything about the physics that govern the workings of semi-conductors.

There is a level of abstraction we can take that will allow us to understand things conceptually without knowing the details, and that is enough to allow us to make comparisons and decide on what car to buy, etc, or what computer systems to use.

But then look at this piece from a week ago : "Macs - Why bother?"

I'm highlighting this because the author's argument is so typical of that used to justify PCs and (not inconsequentially) marginalise Macs in organisations :

"I asked all of my students yesterday how many of them owned a Macintosh. The answer of course was zero."

The author is trying is establish that he has truth on his side. "Everybody" thinks one way and therefore that way must be true. But must it?

"... the overwhelming majority were using Windows-based laptops. I did notice one girl hiding in a corner with her iBook, but the cool kids were all sporting Dells, HPs, Lenovos, and the occasional Gateway.".

"... our job in Ed Tech (especially in K-12) is to provide the most relevant educational tools for our students. In many cases, relevance means Windows."

"For many years, Apple dominated the educational market. Now, extremely aggressive pricing among Window-based OEMs and, for some, the emergence of mature Linux distributions, makes Macintosh far less relevant, and far too pricey for this area. I challenge readers to talk back below and make a case for Macintosh in Ed Tech. Why should I bother? And why should I pay more for a machine and OS aimed at digital entertainment far more than productivity and business applications? [italics added] Let me know. Because those new HPs are looking pretty attractive, even if their boardroom isn't."

This argument is so typical. Yet it is also so wrong.

Macs are not more expensive, are actually more relevant to the world the students will find themselves in - a world where the arts meld seamlessly with science - and Macs are not only good for digital entertainment but also trump everything else in productivty applications, and all these can be demonstrated, not just argued.

But the fact is that the PC-biased argument works, and continues to work, is proof enough that it's not so easy to make good decisions on technology in organisations. And we need to ask why.

I think there's a way to understand technology from a conceptual viewpoint, even if it's not possible to know all the details like a programmer. But we've got to care enough to see that things can go wrong with the technological choices in organisations, and be able to see through the motives or agendas that led to those choices. We need to be curious enough to work out what questions one needs to ask in order to be wiser the next time, and be constantly motivated to improve this skill (at questioning) because the stakes are so high, as far as technology management is concerned.

Posted at 1:47PM UTC | permalink

Read more ...

Mac@Work
Put your Mac to Work

Sivasothi.com? Now how would you do something like that?

Weblogs. Download and start a weblog of your own.

A Mac Business Toolbox
A survey of the possibilities

A Business Scenario
How we could use Macs in businesses

VPN Enabler for Mavericks

MailServe for Mavericks

DNS Enabler for Mavericks

DNS Agent for Mavericks

WebMon for Mavericks

Luca for Mavericks

Liya for Mountain Lion & Mavericks

Postfix Enabler for Tiger and Panther

Sendmail Enabler for Jaguar

Services running on this server, a Mac Mini running Mac OS X 10.9.2 Mavericks:

  • Apache 2 Web Server
  • Postfix Mail Server
  • Dovecot IMAP Server
  • Fetchmail
  • SpamBayes Spam Filter
  • Procmail
  • BIND DNS Server
  • DNS Agent
  • WebDAV Server
  • VPN Server
  • PHP-based weblog
  • MySQL database
  • PostgreSQL database

all set up using MailServe, WebMon, DNS Enabler, DNS Agent, VPN Enabler, Liya and our SQL installers, all on Mavericks.