Letsgetdugg

Random tech jargon

Browsing the topic programming

I am working on a little twitter project that uses twitter4r as the client API. As of recently twitter pulled some strings on their API and broke compatibility. syris:~ victori$ ruby somebot.rb /opt/local/lib/ruby/gems/1.8/gems/mbbx6spp-twitter4r-0.4.0/lib/twitter/client/base.rb:43:in `raise_rest_error’: Not Found (Twitter::RESTError) from /opt/local/lib/ruby/gems/1.8/gems/mbbx6spp-twitter4r-0.4.0/lib/twitter/client/base.rb:48:in `handle_rest_response’ from /opt/local/lib/ruby/gems/1.8/gems/mbbx6spp-twitter4r-0.4.0/lib/twitter/client/base.rb:20:in `http_connect’ from /opt/local/lib/ruby/1.8/net/http.rb:543:in `start’ from /opt/local/lib/ruby/gems/1.8/gems/mbbx6spp-twitter4r-0.4.0/lib/twitter/client/base.rb:16:in `http_connect’ from /opt/local/lib/ruby/gems/1.8/gems/mbbx6spp-twitter4r-0.4.0/lib/twitter/client/user.rb:37:in `user’ from somebot.rb:5 Curse […]

Tagged with

I finally got around to open sourcing our scala memcached implementation that we use at fabulously40 for session storage. Since wicket sessions can vary greatly in size, using the standard memcached server implementation became impractical due to the slab allocator. The current code on github lacks the ehcache store and an Actor IoHandler adapter. The […]

Tagged with , , ,

I would be sitting on a gold mine. SLOC Directory SLOC-by-Language (Sorted) 37890 src java=37890 5026 contrib-utilities java=5026 4457 contrib-crud java=4457 2259 contrib-mootools java=2259 1235 contrib-generaldao java=1235 1185 contrib-emailmanager java=1185 986 jetty-memcache java=986 961 contrib-cache java=961 787 jmemcached java=786,sh=1 640 contrib-thumbnail java=640 503 contrib-blueprint java=503 181 contrib-snapshot java=181 32 contrib-nicedit java=32 Totals grouped by language […]

Tagged with

One of the first few things I have tackled while creating fabulously40 was stateless pagination. I wanted to keep all the public facing pages stateless to avoid session overhead. Wicket makes pagination brain dead simple at the cost of session use. I wanted to keep the simple programming model yet be completely stateless. Here is […]

Tagged with ,

I am about to run out the house for the Labor Day weekend, quickie post on my new coding url strategy. MixedParamHybridUrlCodingStrategy lets you keep stateful multi-pagemap URLs clean while using mixed parameters. Example… mount(new MixedParamHybridUrlCodingStrategy(“/questions”,QuestionsPage.class,false,new String[]{“cat”})); This will mount “/questions/stupid-category” and convert it to… new PageParameters(“cat”,”stupid-category”); package com.base.target.coding; import java.util.HashSet; import java.util.Iterator; import java.util.Map; […]

Tagged with ,

This is a late night post, so I am just going to make it short. This patch lets you use QueuedThreadPool with the Grizzly Connector. This is a monkey patch, getMaxThreads() should be moved up into the Thread Interface. — GrizzlyConnection-old.java Sat May 2 01:08:02 2009 +++ GrizzlyConnector.java Sat May 2 00:56:37 2009 @@ -51,6 […]

Tagged with , ,

You might find this plugin nifty if you have multiple application servers processing requests. The Perlbal BackendHeaders plugin appends X-Backend headers with which backend served the request. Update 06/26/09 Now on github perlbal-plugin-backendheaders syris:~ victori$ curl -I http://fabulously40.com/questions HTTP/1.1 200 OK Server: nginx/0.7.52 Content-Type: text/html; charset=utf-8 Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Language: en […]

Tagged with ,

Try this fun perl benchmark, to test your dual core, SMP or hyperthreaded system. Before running, make sure you have perl 5.8 with threading support compiled in. Perl has native ithreads as of perl 5.8. #!/usr/bin/perl -w use threads; use strict; my $y1=Bench->new(); print “Bencmarking multi-threadedn”; $y1->benchmark(); print “Benchmarking single-threadedn”; $y1->ncpu(1); $y1->benchmark(); package Bench; sub […]

Tagged with , ,

Dynamic type languages such as Perl, Ruby, PHP, and Python free you as the developer from managing memory in your application. However, it isn’t a fool proof solution that you won’t have memory leaks in your application. You as the developer should be aware of how the underlying garbage collector of your preferred language works […]

Tagged with ,

I *really* needed session affinity for our wicket application. HAproxy does session affinity but can’t be reconfigured at runtime without a restart. Perlbal is much more configurable, it lets you add and remove nodes in a pool at runtime. This makes deploying a new version of our web application a lot easier. I have the […]

Tagged with , ,