www.nickhodge.com

microsoft, munging and on being a mercurial iconoclastic professional geek.

Archive for the ‘php’ Category

Who woulda thunk?

with one comment

geek shoes

My first chunk of heavy code on MSDN (yes, that MSDN!!) is a whole lotta PHP to SQLServer. Microsoft, and the world, is a funny old place.

Written by Nick Hodge

September 23rd, 2008 at 12:19 am

Posted in microsoft,php

De-commissioning old Content Management System

with 3 comments

Notes from De-commissioning old Con­tent Man­age­ment Sys­tem: The Mun­gen­etEn­gine. The engine has rendered 10 mil­lion image views and 2.5 mil­lion page views from hand­coded MySQL and PHP.

  1. cod­ing” in PHP feels wrong, wrong, wrong. A little dirty. After 6 months, I feel I should be writ­ing in C#, Iron­Py­thon; at least some­thing decent. Not PHP. It’s too lose. Like Visual Basic. Sadly, this will prob­ably the last time I use PHP for a sig­ni­fic­ant amount of time as I move to CLR/DLR style lan­guages and platforms.
  2. The code to com­plete the trans­ition was a mere 138 lines of PHP; ref­er­en­cing some open­source XML-RPC lib­rar­ies (to insert blog entries over the wire), and 2110 lines in the base lib­rary that acts as the old engine.
  3. Turn­ing off http://twitter.com/nickhodge for a few days helped pro­ductiv­ity. Also work­ing at home dur­ing the shenanigans of APEC 2007 helped pro­ductiv­ity, too.  I also stopped being as respons­ive on email, voice­mail etc to get some good “focus” time to get this happening.
  4. The code I am put­ting out to pas­ture was largely writ­ten in 2001–2. Small pieces were tweaked through 2002–7. It has sur­vived PHP 4.0.x to 5.2.x pretty unscathed. http://nickhodge.com/mn8/section/23/ details the his­tory and philo­sophy of the self-written and main­tained CMS.
  5. Word­Press is not the final step. It is just a good time to move a plat­form I trans­ition to other places in the future, some­where in the cloud.
  6. As Joel Pobar says, “hav­ing no policy on cache is a memory leak”. In my instance, the smart­ness of a cache for pro­duc­tion use to reduce hits on MySQL res­ul­ted in a bug that took 45 minutes to track down. Not as a memory leak, just unex­pec­ted behavior.
  7. Strategy: get images from the data­base into a fixed file sys­tem under http://media.nickhodge.com/. As per the wise guid­ance of UncleMike, this future­proofs my data. A part of the strategy is to move the rss feeds to a local feed sys­tem as I am not trust­ing feed­burner and feed­jum­bler for stats right now.
  8. Rendered pages: best thing to do is “wrap” what is con­tent with mark­ers, render the page via CURL, and per­sist what is wrapped into the Word­Press CMS. The how came to me in an after­noon nana nap. Con­scious brain was on hold, and the real smarts came to the fore. 
  9. Reg­u­lar Expres­sions. Why-oh-why where they inven­ted to make my brain explode? Thank­fully, the intar­webs helps.
  10. A shim of the Mun­gen­etEn­gine will remain in place to “301″ old URLs to new URLs. Full page ren­der­ing and image/binary ren­der­ing will be turned off. There­fore, the import mode will not be Word­Press RSS style import. Using http://www.dentedreality.com.au/bloggerapi/ to post via XML-RPC
  11. Mangling dates, and doing hand-crafted fixes to my Word­Press XML-RPC (note: this is patched for 2.3, evid­ently) took some hours.
  12. There are 761 blog entries prior to trans­ition.  From an earlier blog trans­ition on August 8th 2006, the count was 371. There have been 390 entries since. Post trans­ition, there are now 940 posts.
  13. Raw trans­fer com­plete at 6:50pm 5th Septem­ber 2007.
  14. To com­plete: neater clas­si­fic­a­tion of the new entries.

Written by Nick Hodge

September 5th, 2007 at 7:04 pm

XSL-FO

without comments

Hav­ing lots of fun with XSL-FO. I don’t know why I didn’t go and learn this stuff sooner. In my exper­i­ments, I am using styles and flows as defined by Adobe Frame­Maker over­rid­ing the XSL-FO com­mands. Next stop: XSLT.

All this is in aid of some Adobe Doc­u­ment Server demon­stra­tions I am doing over the next couple of weeks. Also learn­ing how to use JScript as an ASP lan­guage. I would have pre­ferred to be cod­ing in PHP; but the COM to PHP stuff is a little bey­ond my ken at the moment. Keep things as simple as pos­sible. Oh yes, the music of the 1980s assists greatly.

Written by Nick Hodge

November 8th, 2002 at 12:00 am

Posted in php,xml

mungenetengine

without comments

At 8.30am today, mun­gen­eten­gine had served 10000 unique page views to 1829 unique viewers.

Earlier today I had an idea of a web ser­vice that I could imple­ment here. To the right is from this web ser­vice on mun­genet — the Ran­dom Neil Finn Lyric Server. This is imple­men­ted as a SOAP ser­vice installed on my host, backended by a MySQL data­base. Includ­ing the inter­face to the data­base and the SOAP ser­vice, it took about 4 hours to complete.

Lynn Grillo on Cre­at­ing HTML emails with GoLive

I’ve just tried to load mun­genet in Nets­cape 4.7 and real­ised its very broken. I’ll have to look into how to fix this on the server side. The good news is that things are still cool with the newly released pre­view of Nets­cape 7. It looks like we’re back into web browser ver­sion num­ber wars.

note to self: WSDL is easy, as long as you name things intel­li­gently and match the code and parameter’s nam­ing conventions

Written by Nick Hodge

May 23rd, 2002 at 12:00 am

InDesign at ACP

without comments

For those inter­ested in InDes­ign. The ‘engin­eer’ men­tioned is, err, me.

How the mun­gen­eten­gine works is a quickie descrip­tion of what is going on behind the scenes.

There’s another rewrite in my head. In my fea­tures data­base, there are 21 to-dos. So many ideas, so little time. The more I think about mun­gen­eten­gine, I real­ise that there is a bet­ter way. At the moment, the render engine is tied up in one object– not the best way to cre­ate a OO application.

When you ‘write’ your own applic­a­tion, and run it live, its easy to see how dif­fi­cult it is to cre­ate large applic­a­tions like Pho­toshop or InDes­ign. Let alone an oper­at­ing system…

Written by Nick Hodge

December 3rd, 2001 at 12:00 am

SVG, PHP, Weather demo

without comments

D�Oh. NZ Weather SVG & PHP Demo demo now works. I over did the secur­ity bit, but that�s all fixed now.

Written by Nick Hodge

November 29th, 2001 at 12:00 am

PHP Week

without comments

Hol­i­day nearly over, still more pro­gram­ming left undone. For those inter­ested in cre­at­ing dynamic web sites, let me give a little plug to PHP After cod­ing most of the week, I�ve found this pro­gram­ming lan­guage extremely pro­duct­ive. About the only thing that I miss is a devel­op­ment envir­on­ment with a debug­ger (but I do know that they are out there for PHP)
The last languages/environments I felt this pos­it­ive about were: Java in WebOb­jects and an obscure lan­guage called VICOM­script which was a part of a ter­minal emulation/front end devel­op­ment pack­age called VICOM Pro
For those who are not inter­ested in pro­gram­ming, I will be return­ing to write some more guides on Pho­toshop, Illus­trator and Acrobat in com­ing weeks.

Written by Nick Hodge

November 18th, 2001 at 12:00 am

XMLRPC, PHP, AppleScript

without comments

Com­pleted some very small example pro­jects using XML-RPC. Cli­ents in Visual Basic, PHP and AppleScript — and a server in PHP

As a part of the next road­show these examples will be shown to all and sun­dry — I will also post the code here for per­usal. MySQL is a part of this pro­ject as well. I have it installed under MacOS X 10.1 and Win­dows 2000.

PHP, whilst an excel­lent script­ing lan­guage for server-side HTML scripts, I can under­stand why it is easy to mix up your present­a­tion (HTML) with code (PHP) and loose track of your pro­ject. Even with objects and external include files, it lacks the MVC (Model-View-Controller) paradigm that is required for good OO and main­tain­ab­il­ity. Maybe its time to brush up on the Java skills?

Written by Nick Hodge

October 18th, 2001 at 12:00 am

PHP, Perl and Java

without comments

A very good art­icle com­par­ing PHP, Perl and Java for Web server-side scripting.

Written by Nick Hodge

April 22nd, 2001 at 12:00 am

Posted in java,perl,php

PHP, SVG

without comments

Next on the agenda: using PHP, SVG (for a nav­ig­a­tion ele­ment) and other stuff I need to update myself on.

Written by Nick Hodge

March 7th, 2001 at 12:00 am

Posted in php,svg