Supermind Search Consulting Blog 
Solr - Elasticsearch - Big Data

Posts about programming

URLizer in c++

Posted by Kelvin on 30 Sep 2004 | Tagged as: programming

I recently converted my URLizer WordPress plugin to C++.

Initially, I used the Boost.regex package available at http://www.boost.org/libs/regex/doc/index.html. I required the latest release because it had support for text replacement. Then, I found it didn't support lookbehind, only lookahead. Argh. Ugly and inefficient as it was, I worked around it with a 3-pass approach:

  1. Replace the lookbehind pattern with some arbitary string like '@@@'.
  2. Match/replace what you need to match.
  3. Restore the replaced lookbehind pattern.

Yes, I know it sucks. But it is relatively simple to write. Anyway, there is another way which requires much more work but less replacements, but this margin is too thin to contain it. 🙂

I am checking out http://www.pcre.org as an alternative. Supports lookbehind, but not replacing. *sigh* There's another package called PCRS which is an add-on for substitutions, but I can't get it compiling on my VS6 environment yet. The biggest plus of PCRE is that it isn't written in fancy C++ in all its glory (templates, traits, etc), which means PCRE probably ports pretty well.

Ideal Development Management System

Posted by Kelvin on 12 Jun 2004 | Tagged as: programming

  1. CVS accessed via SSH. Using passwd file in CVSROOT, administered with cvspadm or cvsadmin (link down – 22092004).
    Rationale: Why CVS not subversion? Well, I've used CVS… SSH for greater security over pserver's numerous security vulnerabilities. I also don't want the restriction of one system user for one CVS user.
  2. CVS commit notification using activitymail or log_accum, sending emails to a Mailman list.
    Rationale: I've used log_accum.pl and happy with it. We want to raise visibility of commits. Mailman allows developers to subscribe to commit emails, or view archives.
  3. Web-based access via CVSWeb or ViewCVS
    Rationale: Well, we want to be able to access the files via a browser too, don't we?
  4. Maven-based build system
    Rationale: Hell, Maven is so much cooler and more extensible than Ant.
  5. Daily build with AntHill OS
    Rationale: Raises project visibility, runs unit tests, open-source. AntHill provides easy way to change build schedule (no messing with crontabs) and also provides web access to build logs and version incrementing (with cvs tagging). You'll have to use an Ant wrapper for Maven to get AntHill to run Maven build scripts.

That's it for now. A pretty modest list, and nothing too difficult to implement.

Open-source Code

Posted by Kelvin on 04 Jun 2004 | Tagged as: work, programming

A compilation of code I've written.

Code in Apache repositories is licensed under the Apache License. Everything else is licensed under the BSD License unless otherwise stated. I understand the BSD license to be less restrictive than the Apache License in that it doesn't require the attribution notice "This product includes software developed by…".

Jakarta Commons Configuration

  • XMLConfiguration (view|download)
    Summary: Access an XML configuration file in the same way as Java properties.

Jakarta Lucene

  • ChainedFilter (view|download)
    Summary: Allows multiple Filters to be chained.
  • Javascript Query Validator (view|download)
    Summary: Javascript validation for Lucene queries
  • Javascript Query Constructor (view|download) documentation
    Summary: Syntactic sugar for query construction in Javascript.

Amazon Wishlist liberation
Uses Jakarta Velocity to transform Amazon wishlist into any format you wish.

XML Résumé Library

  • DVSL templates for rendering of an XML Resume in HTML, txt and PDF. (download)
    Instructions:

    1. Download/cvs checkout DVSL
    2. In one of the folders (I used the examples folder as a reference), extract resume-xml.zip.
    3. Customize xdocs/resume.xml. The zip file contains mine as a reference.
    4. Run 'ant' with one of the available targets: doall, pdf, html, txt

WinCVS Python Macros
Instructions: download the .py macros into your CVS_HOME/macros folder and restart WinCVS

* Open the file in a texteditor and search for "CHANGE ME" and edit accordingly

WordPress plug-ins

« Previous Page