<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.5.1" -->
<rss version="0.92">
<channel>
	<title>recurser</title>
	<link>http://recurser.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jun 2008 01:27:29 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Setup 64bit CentOS (PHP5, MySQL, memcached, ketama)</title>
		<description>I recently had to set up a few CentOS servers with "PHP":http://php.net/ , "MySQL":http://www.mysql.com/ , "memcached":http://www.danga.com/memcached/ and "ketama":http://www.audioscrobbler.net/development/ketama/, and ended up writing this script to do it. You can "grab the whole thing from subversion":http://svn.recurser.com/misc/build/ (you'll need the php folder as well) or "download everything in a zip file":http://recurser.com/wp-content/uploads/2008/06/build.zip .


if ...</description>
		<link>http://recurser.com/articles/2008/06/23/setup-64bit-centos-php5-mysql-memcached-ketama/</link>
			</item>
	<item>
		<title>Force MySQL Encoding to UTF8</title>
		<description>Often MySQL will need to be forced to return results in UTF8 encoding. There are two ways to do this:
# Run a query "SET NAMES 'utf8'" at the start of each connection - this will force MySQL to use UTF8 for the lifetime of that connection. This is a good ...</description>
		<link>http://recurser.com/articles/2008/06/23/force-mysql-encoding-to-utf8/</link>
			</item>
	<item>
		<title>Browser detection with PHP</title>
		<description>You can use PHP's "get_browser()":http://jp2.php.net/get_browser function to find out information about user's browsers, but it takes a little setting up.

# Download a _browscap_ file from "garykeith.com":http://browsers.garykeith.com/downloads.asp . I found "lite_php_browscap.ini":http://browsers.garykeith.com/stream.asp?Lite_PHP_BrowsCapINI good enough for my needs, but depending on what you want you might want a different version.
# Save it somewhere ...</description>
		<link>http://recurser.com/articles/2008/06/23/browser-detection-with-php/</link>
			</item>
	<item>
		<title>PHP5 on OS X Leopard</title>
		<description>PHP5 is already installed on Leopard by default - all you have to do is turn it on.

First, turn on web sharing - go to System Preferences->Sharing and make sure the 'Web Sharing' option is turned on.



Next, open the apache config file in a text editor using sudo.

$ sudo vi ...</description>
		<link>http://recurser.com/articles/2008/06/23/78/</link>
			</item>
	<item>
		<title>Subversion Server on CentOS</title>
		<description>1. Install a couple of packages via yum:

$ sudo yum install httpd subversion mod_dav_svn


2. Create a directory to store the svn repositories in :

$ sudo mkdir -p /var/lib/subversion/repositories
$ sudo chown -R apache:apache /var/lib/subversion


3. Because I make and delete repositories quite a lot, i made a script to build them. Save ...</description>
		<link>http://recurser.com/articles/2008/03/27/subversion-server-on-centos/</link>
			</item>
	<item>
		<title>Format JSON with PHP</title>
		<description>
/**
 * Indents a flat JSON string to make it more human-readable
 *
 * @param string $json The original JSON string to process
 * @return string Indented version of the original JSON string
 */
public static function indent($json) {

    $result    = '';
    ...</description>
		<link>http://recurser.com/articles/2008/03/11/format-json-with-php/</link>
			</item>
	<item>
		<title>jQuery i18n Translation Plugin</title>
		<description>I've recently had to do some translation on the client-side using JavaScript, and wrote this plugin to do it (based heavily on "javascript i18n that almost doesn't suck":http://markos.gaivo.net/blog/?p=100 by Marcus).

Download  "jquery.i18n.js":http://svn.recurser.com/misc/jquery/i18n/jquery.i18n.js.

To try it out, "download the sample files":http://svn.recurser.com/misc/jquery/i18n/ , or check them out using subversion :

svn co http://svn.recurser.com/misc/jquery/i18n/


The index.html ...</description>
		<link>http://recurser.com/articles/2008/02/21/jquery-i18n-translation-plugin/</link>
			</item>
	<item>
		<title>jQuery SimpleColor Color-Picker</title>
		<description>As the name suggests, a very simple color-picker plugin that displays a square grid of colors to select from. I found a lot of the other color-picker plugins quite heavy, and so I ended up writing this. The list of colors it uses can be customized, and the layout size ...</description>
		<link>http://recurser.com/articles/2007/12/18/jquery-simplecolor-color-picker/</link>
			</item>
	<item>
		<title>Find Prime Factors with Python</title>
		<description>I've been slowly working through the "Project Euler":http://projecteuler.net/ problems, and came across a prime sieve algorithm for "Python":http://www.python.org/ , which I've modified slightly to return the prime factors of a number. It doesn't actually work to solve the "Project Euler problem in question":http://projecteuler.net/index.php?section=problems&id=3 because it runs out of memory on ...</description>
		<link>http://recurser.com/articles/2007/12/17/find-prime-factors-with-python/</link>
			</item>
	<item>
		<title>Default Values With Hibernate Annotations</title>
		<description>To set the default value of a field with Hibernate, you can use the _columnDefinition_ argument :

/**
 * Returns the file size of this Photo
 */
@Column(name="file_size",nullable=false,columnDefinition="bigint(20) default 0")
public Long getFileSize() {
    return fileSize;
}
    
/**
 * Sets the file size of this Photo
 *
 * ...</description>
		<link>http://recurser.com/articles/2007/12/05/default-values-with-hibernate-annotations/</link>
			</item>
	<item>
		<title>Adding Appfuse Dependencies</title>
		<description>I recently had trouble importing the com.sun.media.jai imaging library into appfuse :

The import com.sun.media.jai cannot be resolved


To add a dependency in your pom.xml, first add the new repository (may not be strictly necessary if the library is already in the default appfuse repositories) :


    ......
   ...</description>
		<link>http://recurser.com/articles/2007/12/05/adding-appfuse-dependencies/</link>
			</item>
	<item>
		<title>Complex Constants in Java</title>
		<description>If you want to assign a complex class (such as a HashMap / ArrayList etc) as a constant in Java, use the _static initializer block_ construct :


import java.util.ArrayList;
import java.util.HashMap;

public class MyConstants {

       public final static HashMap myHashMap = new HashMap();
     ...</description>
		<link>http://recurser.com/articles/2007/12/05/complex-constants-in-java/</link>
			</item>
	<item>
		<title>MySQL Delete On Joined Tables</title>
		<description>If you want to (for example) delete all users with the  _guest_ role from your database :

DELETE FROM user WHERE EXISTS (
    SELECT * FROM role
    WHERE role.id = user.role_id
    AND role.name = 'guest'
);
 </description>
		<link>http://recurser.com/articles/2007/12/02/mysql-delete-on-joined-tables/</link>
			</item>
	<item>
		<title>Get complete AppFuse sources</title>
		<description>To get the complete, exploded source of an AppFuse application, run

#> mvn appfuse:full-source
 </description>
		<link>http://recurser.com/articles/2007/11/28/get-complete-appfuse-sources/</link>
			</item>
	<item>
		<title>Skip AppFuse Tests</title>
		<description>To skip tests when compiling/running "AppFuse":http://www.appfuse.org/ applications, add the _-Dmaven.test.skip=true_ argument to your "Maven":http://maven.apache.org/ call:

#> mvn jetty:run-war -Dmaven.test.skip=true
 </description>
		<link>http://recurser.com/articles/2007/11/27/skip-appfuse-tests/</link>
			</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.344 seconds -->
<!-- Cached page served by WP-Cache -->
