1
2
3
%
%   A simple test program to calculate pi, using an easy, slow converging formula
...

C On Fastest way to get value of pi

by Chris Jester-Young, August 31, 2008 22:34

@evilteach: Thanks for that...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
#!/usr/bin/perl -w
package Bdecode;
...

Perl Bencode decoder

by Chris Jester-Young, August 22, 2008 01:19, No refactoring, tagged with bencode, bdecode, torrent

The BitTorrent .torrent fil...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
#include <math.h>
#include <stdio.h>
...

C Fastest way to get value of pi

by Chris Jester-Young, July 30, 2008 03:50, 3 refactorings, tagged with pi, speed, language agnostic

Solutions welcome in any la...

729442eea8d8548842a6e0947e333c7b Talk

C# On I hate to do this, but...

by Chris Jester-Young, July 18, 2008 01:45

@Wolfbyte: Haha, nice. Very...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
my %fbmap = (3 => 'Fizz', 5 => 'Buzz');
my $fizzbuzz = sub {
...

C# On I hate to do this, but...

by Chris Jester-Young, July 16, 2008 10:20 Star_full

Implementation in Perl. :-P...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
4
<?php
function addSecondsToTimestamp ($_timestamp, $_amount) {
    list($year, $month, $day, $hours, $minutes, $seconds) = preg_split('/[- :]/', $_timestamp);
...

PHP On Adding seconds to a MySQL t...

by Chris Jester-Young, July 14, 2008 21:50 Star_fullStar_fullStar_fullStar_full

My fixes below are really t...

729442eea8d8548842a6e0947e333c7b Talk

C# On Balance HTML Tags

by Chris Jester-Young, July 14, 2008 11:52

@Konrad: on your suggestion...

729442eea8d8548842a6e0947e333c7b Talk

C# On Balance HTML Tags

by Chris Jester-Young, July 14, 2008 10:45

Hats off to Corbin for an e...

729442eea8d8548842a6e0947e333c7b Talk
1
2
#!/bin/bash
printf '%s\t%s\n' "$(date)" "$*" >> ~/progress/progress.txt

Bash On store string from terminal ...

by Chris Jester-Young, July 08, 2008 11:36 Star_fullStar_fullStar_fullStar_fullStar_full

Here's a one-liner (excludi...

729442eea8d8548842a6e0947e333c7b Talk

Ruby On Tracking error in numbers

by Chris Jester-Young, June 30, 2008 00:08

I don't know whether your s...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
4
function _TDisplay() {
    var self = this;
    this.tick = function () {
...

JavaScript On countdown timer (minutes &a...

by Chris Jester-Young, June 29, 2008 22:23

@Ryan: Yes, it seems backwa...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
(define (group-by x n)
  (unfold
...

Lisp On Group-by

by Chris Jester-Young, June 29, 2008 09:33

The function can be made ev...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
(define (split-at-or-earlier! x i)
  (let 
...

Lisp On Group-by

by Chris Jester-Young, June 25, 2008 17:36

Here is a demonstration of ...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 25, 2008 01:22

@Mike: That sounds like a g...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 25, 2008 00:50

@Rob, @mmp1: (Re use of a D...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 25, 2008 00:41

@Stefan: The result of clea...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
;; To activate SRFI 1:
;; MzScheme 372: (require (lib "1.ss" "srfi"))
...

Lisp On Group-by

by Chris Jester-Young, June 23, 2008 10:59

Here's a very cheap answer ...

729442eea8d8548842a6e0947e333c7b Talk

Java On Simple interpreter

by Chris Jester-Young, June 23, 2008 09:18

I don't have a code refacto...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 22, 2008 23:30

@Jonathan: New elements com...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 22, 2008 23:14

@Nick: The way Jeff has it ...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
(define (decrypt key rounds)
  (let
...

Lisp On CipherSaber

by Chris Jester-Young, June 22, 2008 11:16

Looking at the code, I just...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 22, 2008 09:39

The result of cleaning "<p>...

729442eea8d8548842a6e0947e333c7b Talk

C# On Sanitize HTML

by Chris Jester-Young, June 22, 2008 07:53

@Stefan:

Yes, that does wo...

729442eea8d8548842a6e0947e333c7b Talk
1
2
3
#!/usr/bin/guile \
-e main -s
...

Lisp CipherSaber

by Chris Jester-Young, June 22, 2008 05:39, 1 refactoring, tagged with scheme, ciphersaber, encryption

Apparently the last Scheme ...

729442eea8d8548842a6e0947e333c7b Talk
1
var tags = Regex.Matches(html, "<[^>]*?(>|$)", RegexOptions.Singleline);

C# On Sanitize HTML

by Chris Jester-Young, June 21, 2008 05:14 Star_fullStar_fullStar_fullStar_fullStar_full

My initial suggestion would...

729442eea8d8548842a6e0947e333c7b Talk