Has moved. Please go to the “new location”:http://www.magpiebrain.com/colophon.html.
Has moved. Please go to the “new location”:http://www.magpiebrain.com/about.html.
The last week of work is a strange affair. Time assigned for finishing off work, writing that “What’s wrong with the company and Here’s How To Fix It” document inevitably vanishes amidst joking with friends, telling people how you REALLY feel about other people (behind their backs of course), performing the inevitable countdown performed by all men previously thought condemned but who’ve now been reprieved (“This is the last Monday at 1:56pm I’ll ever have to worry about”). And that’s cool and all, but I’m already bored by it! I want out! All the actual and metaphorical debriefing that could be done has been done, and all I’m left with is an increasingly small amount of time left in which to get something done – or should I say something I actually want to do. Its only Monday afternoon and already my apathy has soared to new heights. Next thing you know I’ll be turning up to work in my dressing gown. Roll on next week…
Continuing in my brief series of posts on the wonder of @sed@, this time we will be looking at using @sed@’s addressing features to generate code.
Continue reading…
For years now I have extolled the virtues of the SuSE Linux distribution on the basis of it coming with every application under the Sun (yes, including a JDK!) and the fact that YaST is an excellent install and administration program, far better than any other distributions (this was certainly the case a couple of years ago, I’m not sure about now). Therefore the news that Novell are to “open source YaST(Novell management tool going open source)”:http://news.com.com/2100-7344_3-5175682.html?tag=nefd_top does leave me with mixed feelings – on the one hand you’ll now have no problems downloading SuSE with “YaST”:http://www.suse.de/en/private/products/suse_linux/i386/yast.html for free, on the other hand other distros are now free to include it therefore potentially reducing the target audience for what is an excellent distribution. Either way an open source YaST can do nothing but promote Linux as a whole.
Following up my “previous post(A brief history of ed, sed and Regular Expressions)”:http://www.magpiebrain.com/archives/000199.html on @sed@, I thought I’d post a little tutorial on using @sed@ and @grep@ for the purposes of cleaning up logfiles. To follow the examples you’ll need @sed@ or @grep@ for your platform.
Continue reading…
As “promised(A brief history of ed, sed and Regular Expressions)”:http://www.magpiebrain.com/archives/000199.html, I’ve found a nice script which will allow you to edit the original files using @sed@, making running @sed@ on multiple files much more useful. The script come from O’Reilly’s excellent “UNIX Power Tools”:http://www.oreilly.com/catalog/upt3/ (which is probably the most useful book on actually using Unix/Linux/cygwin that I’ve ever read), and can be viewed on the “UNIX Power Tools Examples(http://examples.oreilly.com/upt3/#runsed, 3rd Edition – runsed)”:http://examples.oreilly.com/upt3/#runsed site.
The shell script @runsed@ was developed to make changes to a file permanently. It applies your @sedscr@ to an input file, creates a temporary file, then copies that file over the original. @runsed@ has several safety checks:
- It won’t edit the @sed@ script file (if you accidentally include @sedscr@ on the command line).
- It complains if you try to edit an empty file or something that isn’t a file (like a directory).
- If the @sed@ script doesn’t produce any output, @runsed@ aborts instead of emptying your original file.
@runsed@ only modifies a file if your @sedscr@ made edits. So, the file’s timestamp (Section 8.2) won’t change if the file’s contents weren’t changed.
Also of possible interest is “checksed(http://examples.oreilly.com/upt3/#runsed, 3rd Edition – checksed)”:http://examples.oreilly.com/upt3/#checksed, which unlike @runsed@ simply provides a @diff@ allowing you to check the changes your @sed@ commands will make. Very handy before you start thinking about running @sed@ on several thousand files!
I was about to post some helpful tips on using @sed@ to generate code, but thought a brief introduction of @sed@ was in order.
Continue reading…
After hearing the “good news(ongoing – Sunny Boy)”:http://www.tbray.org/ongoing/When/200x/2004/03/15/SunnyBoy that Tim Bray has joined Sun, I spent a little time reading over some of his old posts and came across a small piece on the “80/20 point(ongoinig TPSM-12:80/20 Point)”:http://www.tbray.org/ongoing/When/200x/2004/01/14/TPSM-8020. Briefly put, the 80/20 rule defines a point in a soft are development where you’ve achieved 80% of your requirements with 20% of the effort. Tim then looked at certain pieces of software which seem to solve most of what needs to be solved without going overboard (who have reached this 80/20 point and stopped) and compared it to software who went for every last piece of functionality. Here, the argument is that those pieces of software that solve most problems as simply as possible work, whilst those that attempt to be all things to all people invariably fail.
You may quibble over the exact percentages, or some of the comparisons made by Tim, but any of you that have developed sizable applications will of seen this yourself. Now I could proceed to rant about how TDD (actually any development process with short iterations) can help you quickly identify this point and make a judgement call as to whether or not to continue, but I won’t (apart from this sentence or course). I can however draw a simple analogy between software and books. Short books are by their definition shorter than long books (I get the feeling I may be dumbing down here, but anyhoo). They have less time to get you interested and get their point across before they finish. By the same token, software which has decided against this other 20% effort will have less to explain – it is quicker to learn because there is less of it to learn. You also don;t have to worry about the fact that it has to cater for the extra 20%. Likewise you don;t have to turn as many pages in a short book as in a long book. I kind of loose my point right around here, but I’m sure I had lots more to say when I was thinking about this during my sushi. A simile too far perhaps…
The issue of course is whether or not this extra 20% functionality results in a more complex piece of software for the other 80% of the functionality. If the answer is yes, you could make a strong argument in favour of not doing it, or even look at refactoring the application. You can, I think, always argue in favour of sushi.
Well, to show you how far behind the times I actually am, I finally got my “orkut”:http://www.orkut.com/ invite. I’ve never been that interested in this whole ‘social networking’ thing, but after a few minutes of playing around with it I realised that all Orkut is doing is providing a framework for communities that already exist. Many of us are members of mailing lists, forums, have people we know socially or just via the web. Theoretically a system like Orkut (and its by no means the only social networking system out there) can replace many of these.
I did have a few other thoughts about Orkut (and the other social networks out there):
* The market research information gathered is fantastically valuable. The value of market research information increases with its verbosity – the more specific the information gathered, the more people want it. Orkut encourages you to to answer as many questions as possible as it helps you describe your persona via the system – whether or not to show you more accurately to people you already know, or in order to meet new people. If Orkut remains a free service, don’t expect it to be too long before you start seeing highly targeted adverts.
* Something like this could form the basis for an anti-spam solution. My filter could quite easily say “I don’t accept mail from someone I don’t know via Orkut”.
* In line with the above, stick a decent web services API on it and integrate it with your PIM software – suddenly your friends become your email contacts, community events get loaded onto your calendar…
* In line with social bookmark managers like “del.ici.ous”:http://del.icio.us/ or social RSS aggregators like “Bloglines”:http://www.bloglines.com/, I could store my feeds and bookmarks in Orkut – these then become resources for my friends.
* Use it to agregate my existing blog, thereby displaying what I’m currently up to on my Orkut page.