As mentioned in my last article, I started doing some challenges from the Programming Praxis website. And here comes my PHP solution to the second challenge.
Continue reading
Sieve of Eratosthenes in PHP
RPN Calculator in PHP
I’ve found this nice little blog a couple of days ago called Programming Praxis (it’s in my blogroll as well) which poses a series of programming challenges.
The challenges found there are much more interesting than the other usual ones you can find online. This being the first reason why I’ve decided (as my time permits it) to fool around and have some fun solving them.
And that is why in the lines to follow I will share my PHP solution to the RPC calculator challenge.
Continue reading
Port forwarding with PuTTY
A couple of days ago, while being at home, I had to access a couple of services for testing, that are under normal circumstances only accessible from the companies intranet.
While there is a VPN which I can access, my current internet provider lacks the desired bandwidth for normal work to be done via the VPN. For commodity reasons, or for others unknown to me, the company has a backdoor server, which grants me easy access on companies intranet.
Never having done before port forwarding, I looked it up a bit, and found the PuTTY articles of doing it rather confusion, from one point of view: not being verbose enough for the ones who never had to deal with port forwarding before.
Continue reading
Filed under Insight
Firing HTML events
In all this time doing client side Javascript, I never had the need to fire HTML events, right until this day.
It all started with this simple task: intercept a form submission, process it to a custom URL which provides additional data to fill in the form, and afterward submit it to the action provided in the form (without intercepting it the second time). I had gone with the straight forward approach.
Continue reading
Filed under Code
Design Patterns: Elements of Reusable Object-Oriented Software
Design Patterns: Elements of Reusable Object-Oriented Software is one of the books that you highly anticipate to read, given all the positive feedback in all the book reviews it’s listed. But I beg to differ.
I can not complain about how the book is structured and the case study it starts with. But from that point onward it’s going straight downhill. As I and other colleagues have come to realize after reading it, no sense of gratification is fulfilled, like other good technical books we’ve read. Basically I have finished the book with the same knowledge I’ve dived into it.
The book is too technically verbose, and lacks a simple way to describe the problems that the patterns solve.
If I weren’t familiar with most of the patterns provided in the book, I don’t think I would have managed to make sense of most of them while at the first read, and that is the excuse the book has to offer. The more you read it, the clearer it gets. Unfortunately that is not an excuse, especially for a book… and that is why I clearly wouldn’t make this book a recommendation for any fellow developer. It may have been da funk when it was first published, but it’s content does not shine that much in current days when we all are already used with design patterns, and do not see them as things that mystically solve problems.
Baseline: the easiest way to learn design patterns, is by facing the problems they solve on a daily basis; through programming.
Filed under Books
Tools of trade in web development
Like any other developer in the years I’ve done web development (not many, but enough to experiment with a variety of application) I, as well, have come to form an ecosystem
for my web development work. So if you are looking alternatives for the tools you currently use or you are in the mood of experimenting with others, than maybe my suggestion would be to interest to you.
Continue reading
Filed under Discussion
Why I like Prototype?
Lately I have read articles which were comparing, bashing and dissecting multiple Javascript libraries (or framework, but I wouldn’t go that far with their definition). And as each of those articles took a side for their favorite and disregarding the others. I as well would like to show my appreciation to my favorite Javascript library Prototype, and this without bashing the other ones.
So what do I like about Prototype?
Continue reading
Filed under Code, Discussion
sed & awk
sed & awk (2nd Edition) by Dale Dougherty and Arnorld Robbins is one of those books that deserves it’s special place on the bookshelf of any developer, system administrator or Unix enthusiast.
Initially I have bought the book to enrich my knowledge on text/stream/input parsing and reporting, a field where before I have used Perl or other scripting languages to accomplish the task. The main reason I decided to make the switch is because in most cases I have to accomplish a specific parsing/reporting task just one time, where using Perl would have been an overhead.
Aside from the main topics of the books, I did find very useful the special chapter dedicated to regular expressions. Prior to reading the book I used only PCRE and always had a bad time when grep was not compiled with support for them. But not anymore, because as I said the book has an entire chapter on them describing the POSIX regular expression and the extended regular expression set.
As the rest of the book goes, it is easy to read and follow diminishing the time I needed to assimilate the content of it to two days.
Of course in those two days I have neglected the last chapter where the full potential of awk is unleashed, because to be frank I don’t think I’ll be in the situation to do such applications in these languages.
Altogether a great book, well written, with succinct examples that will kick-start your way of parsing text from the point you read it onward.
Filed under Books
A thing or two about Postfix log analysis
In the last couple of days I had to work on a parser for our email server which uses Postfix; and while it was my first time when I had anything to do with Postfix logs there are a couple of things I’d like to share to the ones that are starting just now with them.
As with often encountered log parsing necessities, the requirements for my task where so distinctive that I couldn’t use any of the Postfix logfile analysis tools it has to offer.
If you are reading this article because you need to parse Postfix log files (and most certainly that is the case), than I would highly recommend to analyze the provided list of tools before moving forward. While parsing logs is not a hard task, it does take some time before getting it right.
Continue reading
Filed under Code