crap. software patents now almost legal in EU (fwd)

This post by Justin Mason is a fwd of a mail announcing the startling news that software patents are now legal in the EU. *bam* There goes Free Software in Europe! (maybe..)
UPDATE! Justin posted a follow up stating that there’s another stage to go through before it’s law in the EU. Colm replied saying it was at the “committee” stage still, and asking people to get in touch with their MEPs to reject the upcoming law!

Relaunching a website..

John points at a story about relaunching websites. I dunno, It doesn’t make sense to completely revamp your site, but it still happens. We’re in the middle of a relaunch, and while the site design is going to change, the basic contents and structure isn’t. Does that count as a redesign? Incremental changes happen all the time of course, without them the site would stagnate and glaring bugs wouldn’t be fixed!

model view controller pattern

I’m still working away at a registration process using the MVC pattern. It’s coming along very nicely in fact! Here’s an article describing it in some depth.
I’ve hijacked the idea somewhat for my project. I have one controller, and multiple views/models. There’s one model and view for each page. The view is split between PHP code and Smarty templates. The PHP code doesn’t do much beyond assigning variables for the Smarty templates but I wouldn’t put those assign calls into the model, as then the model would have to know about Smarty. This makes it easy to figure out where something is going wrong, and where I need to _put_ code.
How many of you have “super” classes with thousands of lines of code? That sucks for maintainability.
While some of the Java examples I’ve seen redirect the browser to the new view, I simply unset the old model and view and create the new model and view. The single solitary display() call at the end of the controller takes care of displaying whatever view is active!
Must post some example PHP code later.

Regular Expressions: Finding Email Addresses

Recently I fixed the Sendmail configuration on one of our boxes, and I’m now inundated daily with over 1700 return mails from old and expired email addresses. This is the second day so I decided to combat it:

  1. Create a procmail script to redirect all the bounced mails into a file.
  2. Grab all the email addresses from that file and create SQL statements to disable sending mail to those users of our site.

With Google’s help, I came up with the following procmail recipe, and stuffed it into my .procmailrc:

:0
* ^From: .*MAILER-DAEMON.*
* ^Subject:.*(Undeliverable|failure notice|Returned mail:|Delivery (Status )?Notification|Mail System Error|Delivery fail|Nondeliverable mail|Message status – undeliverable|Mail Delivery Problem|Notification d’état de la distribution).*
RETURNS

That should catch almost all the returns sent to my inbox.
I used the following code to extract the emails from the RETURNS file. It can probably be done better, but this works well enough.

awk -F “< " '// {print $2}’ ” ‘{print $1}’| sort|uniq

I then grep out bogus lines such as the ones smtp servers add, opened the file in vi and added SQL statements around each email address. I expect a lot less email in my inbox tomorrow..

Here’s a handy online regex tester if you want to test a regular expression easily.

Sendmail – Masquerading And Relaying

Ah! The joys of Sendmail cf configuration. How arcane can the following get?

R$+ $@ $>93 $1

That line tells Sendmail to masquerade the headers of an email as another domain. Luckily I just generated another sendmail.cf with my install-sendmail script and did a vimdiff of both files. Comments are helpful too, and takes some of the bite out of the .cf file.

Jeremy Zawodny's blog: The Facts… Sort of.

I guess Jeremy never said it explicitly but I (and probably lots of others) assumed Yahoo Finance used MySQL in the delivery of data, but it’s only used in the back-office which is a lot different!
Where I work, Tradesignals.com, uses MySQL to store our market data and it’s obviously used to deliver data. Then again, the Futures stock market is a lot smaller than the range of data Yahoo offers. While I can’t reveal how much data we go through, American futures trading generate a lot of information!