dictionary

Optimizing HTTP header manipulation, part 2

Tagged:  •    •  

In the previous post I told you how a couple of primitives (which means, modifications to the base classes) helped speeding up HTTP processing in Swazoo by a factor of 6.

Today I'll remove another part of it by modifying Swazoo itself. To remove Seaside, I used the simple "hello world" site that Swazoo serves if you start it with

gst-load --start=swazoodemo Swazoo

Extracting and manipulation numbers from a text string

Tagged:  •    •    •    •  

Some years ago I came across a interesting text manipulation puzzle, on a c++ site
I think. I was learning Ruby at the time so had fun with implimenting in Ruby,
I decided to redo it in gst -- just for fun.

The problem: you have a string of mixed Alpha and Numeric characters, jumbled up,

'098m03r9f80239802389f0m9KDKL3KLJDKLJm0983m890DMOm003  dlkfj33hljf4h3klhl00000002998'.

We need to extract all the numerics, sort them into numeric order, but print them with leading zeros retained. Its not as obvious as it seems BTW. :-)

Syndicate content

User login