My Other Blog Is A WordPress
Entering the PHP world from the house of Java
After provoking a small debate with my WordPress, PHP, Anti-Intuitive Reality, ... post yesterday, I feel obligated to at least try out WordPress.
And as a result, I have two blogs now. My canonical blog is still the Pebble powered (and dully named) Weiqi Gao's Weblog. My new blog, named 不惑, is available at http://www.weiqigao.com/blog2/.
The initial mission of the new blog is to get me familiarized with WordPress and PHP so that I can say something more intelligent on this subject. Once that is done, I'll use it to explore some other topics.
My first impression so far:
- The initial setup of WordPress is comparable to that of Pebble.
- The WordPress blog feels snappier than Pebble, although both are more than adquate.
- WordPress takes noticably longer to save blog entries than Pebble does.
- Both seems to support the same set of basic features.
- WordPress's blog editor text area is more developed (more Quicktags) than Pebble's.
- WordPress relies on PHP, which is available in the default installation of Fedora Core 3. Pebble relies on Java and Tomcat, which are not available by default.
The bottom line, as I see it, is this: If I want to setup a blog and I'm not a PHP programmer, I can still setup WordPress. If I want to setup a blog and I'm not a Java programmer, there is not way that I can setup Pebble.
I agree with David Herron on his accessment of the reason for the lack of Java hosting services.
Eric Burke's argument that Java hosting requires more memory can explain why Java hosting is more expensive. If the same amount of memory can host either 100 PHP accounts or 33 Java accounts, then it make sense to price the Java accounts at 3 times the price of PHP accounts. But it cannot explain why there is less Java hosting than PHP hosting services.
The complexities of Java web applications doesn't seem to matter in this argument. As a user, I just don't see them.
Update: My experiment ended in 199 days. The blog is off line now. The following are comments posted to the blog entry in the WordPress system:
Eric Burke Says:
August 28th, 2005 at 9:08 pm
Wordpress posting may take longer if you include hyperlinks in your posts and pingback is enabled. Wordpress might be trying to ping each of those outbound hyperlinks to let them know you are blogging about them.
Pebble and Wordpress use different data storage techniques. Pebble stores pages in flat files, Wordpress uses MySql. This could impact performance when rendering pages.
Anders Says:
August 29th, 2005 at 2:10 am
The long save times are probably because the xml pings it sends while saving.
Ed Finkler Says:
August 29th, 2005 at 9:25 am
Just FYI, most of the apparent delay in saving posts in Wordpress comes from the automatic pinging via XML-RPC of external sites to notify them of updates. The post is actually saved and available on your site immediately. You can disable the pinging by clearing out Options > Writing > Update Services.
Harry Fuecks Says:
August 29th, 2005 at 4:10 pm
It’s ironic that the PHP applications that are most popular (Wordpress and phpBB in particular) are also those that raise the eyebrows of those that know PHP well, usually for secuirty reasons. You may want to read these for example;
http://blog.php-security.org/archives/4-WordPress-a-hackers-paradise.html
http://blog.php-security.org/archives/7-WordPress-update.html
http://blog.php-security.org/archives/8-WordPress-irresponsible-silent-tarball-update.html
Stephan Esser, the author, is a developer for the Hardened PHP project http://www.hardened-php.net/
One alternative is s9y: http://www.s9y.org/ - used by many how also do stuff with PHP internals. s9y hasn’t quite got character sets nailed down yet but if you hack your “local config” you can force it to use UTF-8 without breaking anything (if you’re using the English localization).
Another I’ve heard good things about but never tried is http://www.dotclear.net/ - the language barrier is probably hampering dotclear’s popularity
A third way might be Drupal but that’s not specifically a blog.
Forum-wise, while I’m on this rant, this is what everyone should be using: http://fudforum.org/forum/. Sadly doesn’t quite look as slick as phpBB, which is probably the #1 criterion for many. And perhaps the single file installer throws people (clever trick embedding a binary tarball inside a PHP script) but the code is sane - things like profiling will have happened, for example, and the secuirty track record is good. Here’s one of the authors pointing a sly finger at phpBB http://ilia.ws/archives/55-Webhosts-have-had-enough!.html
不惑? Says:
August 29th, 2005 at 5:26 pm
Interesting title! It means “Forty years old”, courtesy of Google Translate:)
Zhicheng
不惑 » Blog Archive » What The Five Munites Setup Doesn’t Do Says:
September 3rd, 2005 at 8:45 am
[…] 不惑 The Other Side Of Me (I’m Weiqi Gao) « My Other Blog Is A WordPress […]
Google As A Dictionary
What's next? Google as a thesaurus?
Miguel de Icaza: Not being a native speaker means that sometimes my spelling is not great. I depend on Emacs ispell and Evolutions speller for many things, but recently I have started using Google's "define:word" to look up word definitions. Its just two keystrokes away: C-j define:word ENTER.
Ditto on the part about non-native English speakers' need for an on line dictionary.
Thanks for the part about Google's dictionary searches. I've been using the Dictionary GNOME applet on Linux. Now I can do the same on any box.
One thing that is missing from the Google "define:" searches—Google won't suggest alternatives. I would much rather Google say "Do you mean define:receive?" when I type in "define:recieve" than "No definitions were found for recieve."
WordPress, PHP, Anti-Intuitive Reality, ...
When was the last time we thinked?
Had an interesting conversation at the stuff meeting this past last Wednesday, i.e., 3 days ago:
Me: Hi, I started to read your blog.
Nathan: I've noticed. I did spend some time tweaking it. It was fun.
Me: It's quite polished.
Brad: Who's hosting it?
Nathan: I'm hosting it myself.
Brad: What software do you use?
Nathan: WordPress.
Me: Isn't that written in PHP?
Nathan: Yes. And it's quite an easy language.
Me: Didn't they put PHP code right there in the HTML pages?
Nathan: They do.
Me: Didn't we say that's bad?
Nathan: Apparently they are doing alright. Lots of people are using WordPress.
Me: And look at us. We tried so hard to separate our stuff into layers and all that and still can't manage the complexity. We have so many frameworks yet not anything as popular as WordPress.
Nathan: Not everyone needs the scalability. How many hits can I get?
Brad: You are hosting your blog in Java, right.
Me: Yes. I use Pebble with Tomcat. I like it a lot. A well designed tag library is a joy to use.
But why is this? Why do people (at least some people) flock to something like PHP, which we Java people know is "bad" (or at least were told is bad)?
Could it be because that Java, although good, is too hard?
Could it be because Java is not available out of the box? (If you want to do ASP.NET, you get a Windows server. If you want to do PHP, you get a Linux server. If you want to do Java, you get a what?)
Could it be because the Java implementations on different platforms are incompatible? (What's the latest version of Java on Mac OS X? on Solaris 7? 8? 9? 10? on Free BSD? On AIX? HP-UX? Tru64)
Could it be because the Java stuff is too hard to set up right for end-users? True that I can setup Pebble in five minutes, but that's assuming I have a working Tomcat environment. And that is in itself a non-trivial task.
Could it be because what we have been told this past ten years were wrong. That PHP is really superior to Java?
Could it be because contrary to what we believed and what we've been told by our bosses, we aren't that bright, and couldn't see something that is so plain to the PHP product vendors and users. Doesn't that Joel on Software guy have a product that's ASP on Windows and PHP on UNIX? I wonder why he did not use Java?
Fooled us, those @#$%s!
Searching For "Search Engines"
Is Google The Most Popular Search Engine?
If you search for the phrase "Search Engines" on Google, Google comes up as the fifth hit. I thought Google is the most popular search engine in the world. Apparently not, even according to Google!
Upgraded To Pebble 1.9
It's The Ultimate Of Painless Upgrade
I just upgraded my blog software from Pebble 1.7.1 to Pebble 1.9, as I promised 12 days ago.
This is the least painful upgrades I have experienced of upgrading my blogging software—I just dropped the war file in /var/lib/tomcat5/webapps and adjusted my pebble.properties file to point to the right place.
The new Wiki and tags features are things I want to experiment with.
Stay tuned.
I've Seen The JSF Future, And We'Are Not In It
Like many other people, I have been confused by all the JavaServer Faces hype. I went so far as to write this 64 days ago:
Whoever is in charge of JSF evangelization, quit talking architectures and show us something real. A 30 minutes video showing someone using JSF building a website would do. Just show us, like Curt did today, would you?
Well, I got my wish last night at the St. Louis JUG. IBM came over and demoed the JSF features in their RAD product.
After about fifteen minutes of high level talk, the content of which I have seen or heard elsewhere numerous times, the demo began. The rest fifty minutes of the talk was spent inside the IDE.
My take away from the beginning of the talk is this: "JSF is designed to be tooled."
And my take away from the demo part is this: "?!? @#$% (click-click-drag-drop-click-click-I've-seen-this-before-and- this-is-called-Visual-Basic-3.-JSF?-What-JSF?-You-don't- need-to-know-about-JSF-to-pointy-clicky-click.-Look-Ma-no- code-Buy-the-tool."
To be fair. The Eclipse based IDE looks cool, although a bit sluggist at times. One audience member asked how much RAM is in the laptop. The answer is 2GB, but the demo is in a Windows VM with 1.5GB allocated.
Other tidbits from the meeting:
- There are a lot Spring + Hibernate work being started now
- A few IDEA users have upgraded to the latest 5.0 version (me included)
When Is Next Tuesday?
Kevin: If today is a Monday, when is next Tuesday?
Me: That would be tomorrow.
Jonathan: Tuesday next week.
Who's right? (Here at the office "Tuesday next week" wins 4-to-3.)
Berkeley DB XML: Native XML Database With XQuery Support
Berkeley DB XML has been on my radar screen for a long time now. It was mentioned recently in one of the meetings I attended. So I think I would take a deeper look. Here's my first impression report:
Wow! Cool! Yeay! Way to go! Well done!
The Name Game
The official name of the software is Berkeley DB XML, sometimes shortened to BDB XML. The file I downloaded from the website is called dbxml-2.1.8.tar.gz (23M in size), which extracts to a directory dbxml-2.1.8 (190M). However, if you search the web with dbxml, something other than Berkeley DB XML will show up. It is a bit of confusing situation.
Sleepycat Software, License
Sleepycat Software is the maker of Berkeley DB XML. They are better known as the maker of Berkeley DB, the widely deployed open source embedded database engine.
Berkeley DB XML is released under an open source license that permits its use in open source applications. Proprietary software vendors may purchase a proprietary license.
What's In The Bundle
The dbxml-2.1.8 directory contains the following:
[weiqi@gao dbxml-2.1.8] $ du -sh * 20K buildall.sh 48M db-4.3.28 49M dbxml 16M pathan 8.0K README 74M xerces-c-src_2_6_0 4.8M xquery-1.1.0
Berkeley DB XML uses Berkeley DB for data management, Xerces-C for XML processing, and Pathan for XPath parsing and evaluation. It also includes an XQuery processing engine that is written just for Berkeley DB XML.
Building It
Berkeley DB XML can be built using the configure; make; make install method for each of the piece parts of the system. There is also a buildall.sh script that will do the whole thing for you.
I used this command line to build Berkeley DB XML:
./buildall.sh --prefix=/opt/dbxml-2.1.8 --enable-java --enable-perl
It took 26 minutes to build on my Athlon XP 2700+ with 1GB RAM. The result is 154MB of stuff in /opt/dbxml-2.1.8, including goodies such as these:
[weiqi@gao dbxml-2.1.8] $ ls bin db_archive db_dump db_recover db_verify dbxml_load db_checkpoint db_load db_stat dbxml dbxml_load_container db_deadlock db_printlog db_upgrade dbxml_dump query_runner [weiqi@gao dbxml-2.1.8] $ ls lib db.jar libdb_java-4.3.so libpathan.a dbxml.jar libdb_java-4.so libpathan.la libdb-4.3.a libdb_java.so libpathan.so libdb-4.3.la libdb.so libpathan.so.3 libdb-4.3.so libdbxml-2.1.a libpathan.so.3.0.1 libdb-4.so libdbxml-2.1.la libxerces-c.so libdb.a libdbxml-2.1.so libxerces-c.so.26 libdb_cxx-4.3.a libdbxml-2.so libxerces-c.so.26.0 libdb_cxx-4.3.la libdbxml.a libxquery-1.1.a libdb_cxx-4.3.so libdbxml_java-2.1.a libxquery-1.1.la libdb_cxx-4.so libdbxml_java-2.1_g.so libxquery-1.1.so libdb_cxx.a libdbxml_java-2.1.la libxquery-1.so libdb_cxx.so libdbxml_java-2.1.so libxquery.a libdb_java-4.3.a libdbxml_java-2.so libxquery.so libdb_java-4.3_g.so libdbxml_java.so libdb_java-4.3.la libdbxml.so
The Interactive Command Line Tool
After adding the appropriate directories/jar files into the PATH, LD_LIBRARY_PATH, CLASSPATH and ld.so cache, I can run the interactive command line tool called dbxml:
[weiqi@gao] $ dbxml dbxml> createContainer foo.dbxml Creating document storage container dbxml> putDocument foo1 '<foo>bar</foo>' s Document added, name = foo1 dbxml> query ' collection("foo.dbxml")/foo' 1 objects returned for eager expression ' collection("foo.dbxml")/foo' dbxml> print <foo>bar</foo>
I have just created a file called foo.dbxml, inserted an XML document into it, run a XQuery query against the database, and printed the results.
The download bundle include very professional looking documentation, from introduction to programmer's guide to API references. The documentations are also available on the web.
The Guided Tour is especially illuminating.
The C++ And Java APIs
The interactive tool is only meant to be the programmer's helper. The typical Berkeley DB XML application's users won't ever see it. The application can use the C/C++/Java APIs to manipulate XML documents in one or more .dbxml database files in a transactional and multi-threaded fashion.
The following snippet of C++ code does roughly the same thing as the interactive session above:
[weiqi@gao] $ cat foo.cc #include#include "dbxml/DbXml.hpp" int main(int argc, char *argv[]) { try { DbXml::XmlManager mgr; DbXml::XmlContainer cont = mgr.createContainer("foo.dbxml"); DbXml::XmlUpdateContext uc = mgr.createUpdateContext(); cont.putDocument("foo1", "<foo>bar</foo>", uc); DbXml::XmlQueryContext qc = mgr.createQueryContext(); DbXml::XmlResults res = mgr.query("collection('foo.dbxml')/foo", qc); DbXml::XmlValue value; while (res.next(value)) std::cout << "Value: " << value.asString() << std::endl; } catch (DbXml::XmlException& e) { std::cout << "Exception: " << e.what() << std::endl; } return 0; } [weiqi@gao] $ g++ -I /opt/dbxml-2.1.8/include -L /opt/dbxml-2.1.8/lib -o foo foo .cc -lpathan -lxquery -lxerces-c -ldbxml-2.1 -ldb_cxx-4.3 -lpthread [weiqi@gao] $ ./foo Value: <foo>bar</foo>
Of course the second time this program is run, it complaints that foo.dbxml already exists.
XQuery Support
By far the most exciting feature of Berkeley DB XML, for me at least, is its support of the full XQuery 1.0 and XPath 2.0 languages. Although the W3C standardization process for XQuery has been very slow (I wrote about it 585 days ago), the power of the XQuery language has been recognized by the big three relational database vendors and a whole lot of native XML database vendors.
In addition, Berkeley DB XML also supports several XML storage strategies, indexing, metadata, W3C XML Schema validation, and an update syntax extension for the query language.
Got XML?
If you have a lot of XML documents laying around in the file system, why not pour them into a Berkeley DB XML container, add a few indices and some metadata, and query away?
Contributions Start To Flow Into Project Harmony
Geir Magnusson Jr. wrote: > > On Aug 6, 2005, at 12:38 PM, Ian Darwin wrote: > > > Well, this is tiny and trivial but I guess its a start. > > A river starts with a single raindrop
Harmony is the Apache project for an open source Java implementation announced 93 days ago.
I Want One
Simon Brown: I'm cramming in a few minor enhancements before the Pebble 1.9 release, one of which relates to using the RadeoxDecorator. To recap, you can wrap wiki-style content within
<wiki>...</wiki>and have the decorator render that content as if you were writing a wiki page. This is all courtesy of the marvelous Radeox library. Anyway, the feature that's been missing is the ability to link together content using wiki links, but this has now been added.
Funny I was just looking at the RadeoxDecorator feature in Pebble last week. I was planning on using some of the wiki syntax just to simplify my blog entry task. I'm still in the process of finding out all I can about how to do simple things in Radeox wiki. The addition of the wiki links feature will probably propel me towards using both the wiki feature and the static page feature more often.
Thanks Simon.


