Programatically Selecting Text Background Colour
Monday, October 22nd, 2007 Posted in Code Design | No Comments »Yesterday I was reminded of a little problem I had thought about before but never really solved: how to write a function to select the optimal background colour for any colour of foreground text so that the text can be read easily. An obvious ...
MS Word characters
Friday, October 19th, 2007 Posted in PHP | No Comments »MS Word sucks. Unfortunatly we gets all our clients thinking it's perfectly okay to copy-paste their text from Word into our carefully crafted admin areas that are supposed to let them add new content. Yeah well, Word uses a bunch of ...
LazyList not lazy enough
Tuesday, October 16th, 2007 Posted in JSP, Java, Struts | No Comments »Today I was writing a jsp for Struts in which I needed to define a text field for an indexed property of the form bean. The property was a string list which could be any length, depending on what was ...
State Machine Inputs
Friday, October 12th, 2007 Posted in Code Design, Java | 1 Comment »The other day I was thinking about state machines. More specifically, the best way to write a class such that when some "input" method of the object is called, the object acts differently depending on which state it is in. The ...
PHP and Perl sharing files
Tuesday, October 9th, 2007 Posted in PHP, Perl | No Comments »I came across an interesting tid-bit today. Although not immediately obvious - Perl and PHP have so much in common syntax wise that you can write basic variable definitions in a single file and they'll be parsed by both. # PHP ...
Welcome to Two’s-Complement
Tuesday, October 9th, 2007 Posted in Blog Stuff | No Comments »I'm Fiona, he's Mark. We live together and write code for a living. After coming back home at the end of the day we'd constantly tell each other of a new tip or "gotcha" that we'd found out during the day, we ...