Java, Open Source, Regex, and Conformance
641397
The other day Tim Bray wrote up an interesting piece on java.util.regex.  I sent him off a quick email detailing my past experiences  and he just blogged his feedback .  "Well... yeah, but here's a story. I was kind of surprised at the results on my OS X box, so I took the code and data over to a nearby Windows XP box and got similar results, so I took 'em to a Debian-stable box I had handy and once again, about the same story. "  "Only, not quite the same. Because it was Perl 5.8.1 on one box and 5.8.3 on another and 5.6.1 on the third, and the i18n/regex code was slightly different in each version, and no two of them gave quite the same results. "  "Now, I'll grant that Unicode/i18n is one ...
662731
Following up on the start of his port of the Hamcrest (a library of "matchers") functionality over to PHP, Sebastian Bergmann has posted the getting started guide to show you how to use it with the popular PHPUnit unit testing software.   There are a number of situations where matchers are invaluble, such as UI validation, or data filtering, but it is in the area of writing flexible tests that matchers are most commonly used.   His example that checks to see if one object is equal to another object. The Hamcrest matcher allows for a "assertThat" method making it easier to create and use pre-existing unit testing assertions.   He also includes a list of some of the most common matchers broken up into groups of core, logical, object, number and text.
255902
Now for some real Apache code Column As I write this, I'm on the Eurostar train, just returning from O'Reilly's OSCon (Open Source Conference) in Brussels. Some fascinating insights there; and even my own talk generated some interesting discussion. Some of the delegates, including O'Reilly himself, are promoting opensource ideas going beyond software and into society more generally. I've touched on that in this very column before now, but a related argument that's new to me is that the open/closed debate in software could become largely sidelined, as the industry focuses on software as a service (such as Google's offerings) more than as a product.â¦
206812
Asymptote (http://asymptote.sourceforge.net) is a powerful descriptive vector graphics language for technical drawing, inspired by MetaPost but with an improved C++-like syntax. Asymptote provides for figures the same high-quality level of typesetting that LaTeX does for scientific text.    A new picture size routine, which maps specified user coordinates to a given final size, provides a convenient way of forcing the plotted  subregion of a graph to have a fixed size. The correct surface normal is chosen when calculating lighting. The comment character can now be escaped when reading strings from data files (but is disabled when reading raw characters with getc). The new word file mode is useful for reading  white space-delimited strings. PostScript output files are now explicitly designated as EPSF in the header line. The minimum width and height of flowchart blocks may now be controlled separately. Interpolation and knot theory modules were added. The usage of path vs. guide in the base files was  standardized.   https://sourceforge.net/projects/asymptote
448776
Sara Golemon describes the path she took in a search for an OpenID library to work with in PHP. The trip took her through both PEAR and PECL with no promising results. Heading off to a Yahoo! search she comes up with one good result - Auth_OpenID.   Now, granted, this is the first OpenID system I've looked at, and I haven't really dug into it in depth, but I've got to say, this is some clean, well written code and the author clearly understands the maths involved (or at least fakes it shockingly good).   Knowing this, she asks "why isn't this in PEAR" if it's so well-structured and useful? It works with any version of PHP from 4 up and is smart enough to adapt itself to whatever the structure of your application might be.   There's also some great comments on the post where it's explained why the library isn't in PEAR, another OpenID package for PHP and suggestions for alternate distribution methods (PEAR channel).
300638
SableVM is a robust, extremely portable, efficient, and specifications-compliant Java Virtual Machine that aims to be easy to maintain and to extend. It features a state-of-the-art and efficient interpreter engine. Its source code is very accessible and easy to understand. It also has many robustness features that have been the object of careful design.     SableVM is a clean-room implementation of the publicly available specifications.    In this version, we added an experimental generational garbage collector, we imported a new GNU Classpath snapshot, we added handling of Jar/Zip files on boot classpath, we added user-friendly failure messages for bootstrap problems, we added added a profiling switch, we made sablevm-classpath install its files in standard locations, we made jikes and gcc be less verbose by default, and we made several important bugfixes and improvements.  You can download the SableVM from: http://sourceforge.net/project/showfiles.php?group_id=5523&release_id=281502
275619
Travis Swicegood is teasing us with some output from a script in his latest blog post:   So my free time of late (what there is of it) has been spent on a project that's getting really close to v0.1 release. In other words, its first functional release. If you've ever run a test using the PEAR installer or know what a .phpt file looks like, you might be able to guess what I've been up.   Keep an eye on his blog for more information on his "secret project".
235938
Ivo Jansch discovered something interesting by way of an applicant's resume - a hidden "trick" that PHP pulls on the user when they try to use a Java-like syntax with System.    So yesterday I was reviewing a code sample that a job applicant had written during a test and I encountered the following line of code:  It's not hard to guess what his background was :), but I was initially stunned that this actually works in php.    After a little investigating (and ruling out the Java Bridge), Ivo found that the line was being interpreted literally and was just being handled as a string instead of a constant. He gives two other examples to help with clarification.
579637
Because anyone can edit Wikipedia, the Web encyclopedia's reliability varies wildly. Now a computer science professor hopes to give users a better baloney detector: software that flags questionable lines in Wikipedia entries.
741963
DevShed is wrapping up their look at the Strategy pattern with the last part of their series posted today - a look at validating a user's input via the pattern.   In the next few lines I'm going to demonstrate how to use the strategy pattern in a useful case, that is validating user-supplied input. Sound like an interesting experience, right?   They start by show how to build a "validation strategy selector" that uses a switch to hand off the request to the correct validation function. Naturally, this is followed by the creation of those validation classes and an example of their use. They wrap it all up with the complete code listing to make cut and paste coding easy.
401233
From the RefreshinglyBlue blog, there's a new post that makes a comparison between two of the most popular web scripting languages - PHP and Ruby - on a practical, basic level.   There are rather significant syntactical differences between PHP and Ruby. For example PHP requires semicolons at the end of lines and generally requires curly brackets to enclose blocks of code. Ruby, on the other hand, uses newline characters to denote the end of a line of code...   The post goes through other differences like: value return methods, function/method naming, similarities between them, frameworks, namespaces, documentation and hosting options.
582158
Michael Kimsal points out the posting of the latest part of his "Grails for PHP developers" series to his blog site - Part Five of the series.   I've put up the latest installment in my "Grails for PHP developers".  Rather than delve too much more in to Grails head on, I'm taking this installment (and at least the next one) to delve more in to the Groovy language itself.  Groovy offers similarities to PHP, but also many differences which can trip you up if you're not careful.  I'll try to lay those out as best I can in the next couple of installments.   This new part of the series goes back and puts the spotlight on GRoovy, the base of the Groovy/Grails combo. He talks about working with variables and arrays as containers for multiple pieces of data and some possible gotchas that could come up along the way.
490972
In this installment, a solid programming style has been imposed, a JavaScript class model developed for Preezo which supports single inheritance and simple, tightly bound class definition code. This is important when working with large applications. By Guyon Roche. 1129
563051
SANTA CLARA, CALIF. -- Simplifying Java programming is on the minds of Java development executives at Sun, but making the language available via an open source format remains off the table, according to executives at a Sun âChalk Talkâ session here on Wednesday.
328952
cpdetector is a configureable java framework for code page detection of textual documents. It may be used to allow applications like browsers, file-sharing software or search engines to correctly handle data received over network. The new version 1.02 is a result of beginning with quality assurance and covers 2 severe bugs, additional features (XML dtd's, test/build automation and a new ASCII fallback detection implementation.    Changelog:   http://sourceforge.net/project/shownotes.php?release_id=254536  Download:   http://sourceforge.net/project/showfiles.php?group_id=114421   Homepage:   http://cpdetector.sourceforge.net
632254
Harry Fuecks has gotten busy and posted the third part of his "Joy of Regular Expressions" series over on the SitePoint PHP Blog today.   Following on from the last part, this one is more of an intermission-a round up of regex syntax seen so far and a couple of links following feedback.   He looks at two different topics:  A "must reads" section of resources for getting the most out of regular expressions A comprehensive "cheat sheet" with tips on expression delimiters, literals, pattern modifiers, character classes, quantifiers, assertions, sub-patterns, and working with the blackslash.
323255
Patrick Chanezon sayz :  "I got some pretty good feedback after my post Java Syndication Babel: let's paint the picture together!, mainly from the Rojo/Feedparser team."  ...  "Then the Rojo/Feedparser team, Brad Neuberg and Kevin Burton posted some good comments. I agree with Kevin that we don't necessarily need a JSR and should start collaborating now. From Kevin and Brad it seems like what we should work on first is defining a common set of Unit Tests, and a way to get a DOM-Rome-like API on top of their SAX-like API."  So check out the list  and the wiki .  Hopefully we'll be able to collaborate and make some forward progress.  I'm sure everyone will benefit.  The more I think about a ne ...