sklar.com

...composed of an indefinite, perhaps infinite number of hexagonal galleries...

© 1994-2017. David Sklar. All rights reserved.

Essential PHP Tools

My second book, Essential PHP Tools, is nearing completion. It covers various add-on modules and extensions for PHP that make it easier to:

  • Access a database (PEAR DB, ADODB)
  • Generate robust web forms (HTML_QuickForm)
  • Use page templates (Smarty)
  • Create or parse XML documents (XML_Parser, SimpleXML)
  • Request or serve XML-RPC or SOAP methods (PEAR XML_RPC, PEAR SOAP)
  • Send HTML or multipart e-mail messages (PEAR Mail and Mail_mime)
  • Authenticate users (PEAR Auth and Auth_HTTP)
  • Inspect your scripts with a debugger (Xdebug)
  • Boost server performance without rewriting any code (APC, PHPA, and MMCache)





You can pre-order it or read more about it. It should be in stores in March.

Porta-Fax/Scanner

I am a very low volume faxer/scanner. Here’s my ideal fax machine/scanner: a cylinder (or prism) about 9 inches long, 1/2 inch high, and 1/2 inch deep. There’s an 8 1/2 inch slot through the middle of it.



When I need to scan, I pull out the retractable USB cable, plug it into my computer, and feed a piece of paper through the slot. (Plugging in the cable or pushing a piece of paper into the slot should wake the device up.)



When I need to fax, I do the same thing, but instead of the USB cable, I pull out the retractable RJ-11 phone cord and plug it into an outlet and punch the phone number in on a tiny keypad on the top of it. The buttons could even be laid out in a row, instead of in a grid.



I’d like this to be powered from the USB cable and the phone line, but if that’s not enough power, I suppose I could deal with rechargeable batteries.



I’d even settle for a scan-only mode, since then I could use some eFax or tpc.int-style service to send my faxes.

RSS == NNTP

Rod Chavez details his ApacheCon 2003 experience, including a talk by Chris Pirillo about how RSS over HTTP should replace SMTP for e-mail marketing and message distribution.



And not just for one-way distribution, either. RSS feeds with track/trace/ping/whatever-backs allow for discussion and user comment.



How is this significantly different than Usenet 15 years ago? RSS feed = newsgroup. Moderated newsgroups allow restricted posting. NNTP allows for an efficient way to distribute the same content to lots of people.



Granted, newsgroup creation requires some oversight, while anybody can create a blog, so maybe blogs are like a relaxed version of alt.*.



Still, I am confused why there is so much effort being expended to invent and reinvent new versions of RSS and RSS readers with all sorts of whizzy features instead of reusing the tons of news serving, exchanging, and reading code that’s out there.

PHP community site project

Chris is spearheading an effort to launch a new PHP community site. An excellent project.

Virtual Machine War

Last week at php-con was subtle, preliminary skirmish in the upcoming Virtual Machine War. The contenders are Parrot, whose language-in-chief is Perl 6, and the CLR, whose patron language is C#.



If this were just a language battle of Perl 6 vs. C#, it wouldn’t merit any more notice than any other matchup in the perpetual linguistic conflict that is constant among programmers. What sets this face-off apart is that each of these VMs can host other languages as well. Running on top of Parrot, Python code can use Perl libraries and vice versa. Running on top of the CLR, C#, J#, Visual Basic.NET code can perform similar feats of reuse.



Rarely are functions in the standard C library reimplemented in systems programming. This kind of wheel-reinvention happens all the time in web apps, however. The multi-language capabilities of Parrot and the CLR provide the opportunity for each system to have a “libc for the web” that handles standard functionality: handling form and URL data, serving and consuming web services, processing XML, and all of the other tasks that make up the plumbing of web applications. No matter what language you write your application in, you can use the same core library functions. If knowing a language’s library APIs is as crucial as knowing a language’s syntax, a common core library makes you productive in new languages much more quickly.



Microsoft’s ASP.NET libraries, also implemented for Mono are a shot at the prize. There is plenty of code in CPAN that, converted to Perl 6, could also be a contender.



So why was php-con a skirmish? The talk by Sterling Hughes and Thies Arntzen about their plans to build a PHP-to-Parrot compiler tug the future of PHP towards Parrot. But there’s also an existing project to build PHP#, a version of PHP that runs on the CLR. (Memo to Microsoft: hire Alan Knowles and/or anyone else you can get your hands on to make PHP# a reality if you want to win this battle.) Brian Goldfarb, a Product Manager from Microsoft, came to PHP-Con to learn from folks there.



Microsoft was blindsided by Linux and now is attempting to avoid their mistakes in the world of scripting languages and PHP. With little to no commercial backing, PHP has become an incredibly popular on-ramp to small-time web developers. That’s supposed to be Visual Basic’s niche. So maybe by understanding PHP, Microsoft can compete better in that world.



There is a lot going on that makes the outcome of this titan clash still unclear. ActiveState is working on Perl for .NET. The .NET development model is tightly integrated with Visual Studio, which is designed with languages like Visual Basic and C# in mind, so day-to-day comfort of application development doesn’t yet quite sync with the technical possibility of running other languages on the CLR. The CLR and Mono are available now, while Perl 6 is not. PHP 5 is on the way (“before Perl 6” I think is the target release date) and plenty of people will stick with PHP 4, let alone move from PHP 5 to a future Parrot/CLR based version of PHP in a few years. IIS and Windows are tuned to provide the best operating environment for .NET – what kind of tight integration will be developed between Apache, Linux, and Mono or Parrot?



Oh yeah, Java is still around, right? Visual J# seems focused on migrating developers away from Java and I don’t expect a version of Java for Parrot (but open-source developers have built all sorts of crazy projects). Both Parrot and the CLR have learned from the Java VM’s host-only-one-language mistake. Given the $zillions invested Java deployments to date, I suppose Java’s not disappearing any time soon, but Sun needs to work on how to stay relevant in the multi-language VM world of the near future.

Data Entry Gone Wild

This San Francisco Chronicle article describes how an overseas medical dictation transcriber threatened to disclose confidential patient data in a back-pay dispute with the UCSF Medical Center.



If a US-based employee tried something like this, they’d be in big trouble, whether or not they had a valid pay gripe. But the long arm of US law doesn’t extend so easily to Pakistan, where this incident happened, or plenty of other overseas destinations for medical transcription outsourcing.



As a chain is only as strong as its weakest link, a privacy or confidentiality regime protecting data is only as strong as the flimsiest, most disclosure-prone access to the data. In this case, an underpaid and mistreated (or wily and greedy, depending on who you believe) person not accountable to US law provides an extremely weak link in the medical privacy chain.



I’ve idly wondered if working as a custodian at a software company can get you a lucrative sideline as a pirate software distributor – bring a FireWire DVD burner to work with you and take home some goodies. There are a lot of people in the “chain of data” that are sometimes just looked at as furniture by the “professionals” who are “really” working with the data. In the UCSF case, doctors record gobs of dictation and then, a little while later, it shows up all typed out. Do they care if it took a trip around the world in the process?1 Software developers go to work every day and find the floor vacuumed.2 Are they concerned about who cleaned up and restocked the kitchen with Jolt? Who changes the lightbulbs in Experian’s data center? Lots of juicy data there.



Once we realize all of the people that really do have access to very sensitive data, we can treat them appropriately (and scrutinize them properly before such access is granted).




1 Many doctors may in fact care, I don't mean to categorically malign them. Multiply subcontracting administrators seem to have been the problem in the UCSF case.
2 I realize it is likely that some developers are familiar with the custodial folks since the developers are cranking away when the custodians show up at midnight.

PHP on Mainframes

I spent Monday with the Metropolitan VM Users Association, a user group for folks involved with VM, IBM’s venerable virtualization OS. Since VM now supports Linux as a guest OS, VM folks can use all sorts of popular software, like PHP, that they couldn’t back in their pre-Linux days. That’s why they asked me to give a talk about PHP.



I learned a lot about VM – the kinds of tasks that folks are using it and the hulking machines it runs on to do. A large database of customer records, travel plans, medical information, or other data typically has a few interfaces to it: TN3270-style text entry screens, IVR phone access, and a web interface. A Linux guest under VM using PHP to provide the web interface to the data can be a great choice for VM users.



In another kind of implementation, Marist College provides virtual Linux servers for undergraduates taking CS and IT classes. They also have some virtual Linux machines under VM for web mail access with IMP and other tasks. They’ve got about 500 virtual servers running now, with more coming online each semester (and some going away each semester as students graduate.)



Separately, I was talking to someone a few weeks ago who was attempting to run PHP on his AS/400 using PASE, an OS/400 package that lets you run AIX binaries.



There’s a lot of opportunity out there for PHP in these legacy/enterprise environments.

Computer, read this for me

This article is about some text analysis tools that can make some sense out of large collections of text. It is appealing to me that the most productive uses detailed involve humans employing these tools as assistants to help find useful connections in a large mass of data, connections which the humans then use to draw meaningful conclusions, instead of humans relying on these tools as oracles which divine conclusions that are accepted blindly.

Putting leap second to good use

An extra day in the week or hour in the day is obviously too much to ask for, so I’ll have to settle for a leap second to catch up on all of the things I wish I had time to read, learn, etc.



These and others keep cycling through my head. Perhaps if I start to note them here then I can actually go through the list one day (ha!) and explore.

Learn Pointer Arithmetic with a Deck of Cards

Play Segmentation Fault!



You can also use a deck of cards for a cryptosystem.



I suppose you’d need an arbitrarily large deck of cards for a general purpose playing card Turing machine, though.