technology from back to front

Archive for July, 2012

Serving JSON at Altitude

Colin Putney recently released a preview version of a new Smalltalk web framework, Altitude.

Altitude seeks to be a RESTful Seaside: an HTTP framework that uses RESTful URLs, ubiquitous use of Xtreams, and learning the lessons of years of Seaside development.

Let’s take it for a spin!

Read more…

by
Frank Shearar
on
31/07/12

Making (Kindle) books from blogs

Admittedly, more and more of them are doing this already, but this is a slightly more DIY option…

So, you’d like some more reading material for your Kindle. Maybe you’re going away for the holidays, or just want to survive the elongated journey times of the Olympic period. There’s a few blogs I’d like to read more of, but I’d never gotten around to because of the sheer volume of back-reading I’d need to do first. What if we could dump those blogs (and blog-like things) onto the Kindle? Glad you asked, as that’s exactly what I’ve put together.
Read more…

by
Tom Parker
on
30/07/12

You should consider using SSH-based Configuration Management

[Forget Puppet or Chef]: http://blog.gomiso.com/2011/08/26/forget-chef-or-puppet-automate-with-sprinkle/
[Puppet]: http://puppetlabs.com/puppet/what-is-puppet/ “What is Puppet? PuppetLabs page”
[Chef]: http://www.opscode.com/chef/ “Chef home page”
[Chef Solo]: http://wiki.opscode.com/display/chef/Chef+Solo
[CfEngine 3]: http://cfengine.com/ “CfEngine home page”
[Ansible]: http://ansible.github.com/ “Ansible home page (GitHub)”
[Origins of Triumvariate]: http://verticalsysadmin.com/blog/uncategorized/relative-origins-of-cfengine-chef-and-puppet “Origins of Cfengine, Chef and Puppet”
[Puppet is not CfEngine]: http://www.watzmann.net/blog/2006/12/puppet-is-not-cfengine-rewritten-in-ruby.html
[Blueprint]: http://devstructure.com/blueprint/
[Sous Chef]: https://github.com/michaelklishin/sous-chef
[LittleChef]: https://github.com/tobami/littlechef/
[Foodcritic]: http://acrmp.github.com/foodcritic/
[Capistrano]: https://github.com/capistrano/capistrano/wiki/
[Spatula]: https://github.com/trotter/spatula/
[Soloist]: https://github.com/mkocher/soloist
[Facter]: http://www.puppetlabs.com/puppet/related-projects/facter/
[capistrano-conditional]: https://github.com/deviantech/capistrano-conditional
[Fabric]: http://docs.fabfile.org/en/1.4.3/index.html
[Sprinkle]: https://github.com/crafterm/sprinkle/
[Cobbler]: http://cobbler.github.com/
[Sprinkle SlideDeck]: http://fushunpoon.github.com/sprinkle-revealjs-slidedeck/

At the first mention of configuration management (CM), everybody and their dog
(and links on their respective blog posts!) will direct you to one of what I
take the liberty of calling ‘The CM Triumvariate’: [Puppet][], [Chef][] and
[CfEngine 3][]. But I reckon the interwebs is presenting a skewed view and hides
from you some real, useful alternatives.

> “Pfft.”

You say.

> “Alternatives?! With a gazillion resource types, cloud
> integration, and promise theory readily available, what else could you you possibly
> want to manage your thousand server infrastructure with?”

If I may reply with a question, can a developer use any of them, say, to provision a bunch of remote hosts
directly from his developer machine without installing any additional software?

> “…”

you say.

Read more…

by
hok
on

Least fixed points, and the grouping of behaviours

Sometimes one has a set of interrelated (monotonic) recursive equations one needs to solve. An naïve implementation will recurse infinitely. Handily there’s a solution: the least fixed point. I had need of one the other day, implementing parsing with derivatives. So why bother with least fixed points? Let’s find out…

Read more…

by
Frank Shearar
on
27/07/12

Double word squares

You start off meaning to contribute a tiny tweak and then forget about it, and you end up spending hours writing reams of multithreaded C code.

A friend posted to Twitter asking for help optimizing his code to find double word squares. I spotted a small optimization: instead of copying his working state for his recursive search, he could just undo his changes, and pass around a reference to a single shared data structure. A 10% boost!

However, not long after that it started to look like we’d nearly exhausted the room for optimization in Python, and were nowhere near being able to solve the more difficult cases. The inner loop seemed simple enough, and conveniently doesn’t directly do any string manipulation, instead handling references. So it seemed easy enough to convert to C. It still seemed like I might stop there. But no; then came the multithreading (very hacky at first, then cleaned up) and the replacement of the implausibly huge hash table with direct calculation at the point I needed it for a big saving in memory usage, to the extent we could hope to fit in L3 cache.

Finally, it was optimized enough that, given less than a day to work, it could handle any wordlength. I can report that with our dictionary, there are no double word squares for words of 9 letters or more, and for 8 letters all 42 double word squares are word squares (ie symmetrical around the leading diagonal). Rather sad!

Source code, under an MIT licence. Enjoy!

by
Paul Crowley
on
18/07/12

Search

Categories

You are currently browsing the LShift Ltd. blog archives for July, 2012.

Feeds

Archives

2000-14 LShift Ltd, 1st Floor, Hoxton Point, 6 Rufus Street, London, N1 6PE, UK+44 (0)20 7729 7060   Contact us