In my last two articles My first Java Application (apache commons cli) #1 and Server / Thread (threading & connection handling) #2, I’ve started to write a Policy-Daemon for Postfix. In this article I’m stumbling through postfix documentation and the RFC to create a flowchart and a state diagram for my before-queue-filter. Hence I call that „pre“-work.
Continuing my first article this time I’m going to implement threading into my small application. For that I’ll use a Server and a Thread class and the Executor stuff.
Recently I’ve started to write my first Java-Application. I’m developing a before-queue-policy filter for Postfix (aka smtpd-proxy) which allows to filter whole mails before they’re stored in postfix‘ queue. I’ll document my process of learning Java and writing that policy daemon here 🙂 Alright, I have to admit that I already have some experience with Java and due to my programming background the syntax isn’t very difficult to me. Also some friends are helping sometimes (thanks to Till, Stefan and Sven).
Today my license key for Intellij Idea arrived; first time I bought something commercial (except for games) in the past years. I did start webdevelopment with some WYSIWYG editors in windows, back when I was 11 up to 14. Due to all the problems that caused (not w3c conform, having to add hacks for several browsers, precise work was impossible, those editors created table based layouts, etc) and me learning PHP I started to use simple editors with syntax highlighting. When I switched completly to Linux (14 years now linux only) I was using bluefish and vim to do webdevelopment. I think one or two years ago, Till was showing me eclipse, my first IDE – I’ve been pretty impressed because he was hacking down a simple CRUD application within less than 5 minutes and eclipse was doing a lot of stuff automatically, so I switched to eclipse. But…
Somehow I thought the singleton pattern would be pretty useful for my Request and Response classes, because they’re unique things and there should be only one object of them. They shouldn’t get initialized over and over again. PHP is request based, which means, once you got the output of your php script, the request is finished. Reloading the page will just cause a new request. That means if you write a Request or a Response class it doesn’t make much sense to initialize them more than once. At least, that’s my opinion.
In my last blog-entry you’ve seen that I compared regexp vs nonregexp-techniques and the result was, that there are „bad“ and „good“ regexp; while the good regexp are as fast as non-regexp-techniques. Let’s take a closer look at what „good“ regexp are. Please notice that I’m not a regexp-magician so if you know about a regexp which would do better than the regexp I’ll show, please let me know.
Yesterday I was talking with Sven about my Imap-Class and I told him that I switched regexp to non-regexp to gain performance. He was asking me whether the use of str* is really faster than the use of regexp in PHP and thus he said „you could write an entry about that in your blog, I’d be interested“ – Hey Sven, here you go.
some time ago I wrote a small document about MySQL’s COALESCE usage. Today I was asked to help with such a construct for a similar usage-scenario. Here’s the result:
Currently I’m working on some sort of shipping-system for a customer. It turned out that i was spending 3 days looking for a problem with my query while there was no problem. Well, apart from phpmyadmin 🙂 But, lemme tell you later about it.