In the general case, there is no way to list all the keys that a memcached instance is storing. You can, however, list something like the first 1Meg of keys, which is usually enough during development. Here’s how:
More and more, my web apps need to run things in the background: Sending email, re-calculating values, fetching website thumbnails, etc. In short, I need a message queue in my toolbox.
I setup my Mercurial repository in the same way we used to do CVS, then SVN: A directory owned by a group, with the GUID bit, and all users who need to commit are in that group.
The steps are, create the group and add relevant users to it:
:noclick
sudo groupadd topsecretgroup
sudo usermod -a -G topsecretgroup graham
I will be speaking at Open Web Vancouver on Thursday, June 11, 2009 and Friday, June 12, 2009.
That’s in Vancouver, B.C., Canada. There’s a very interesting speaker lineup, and the whole conference is reasonably priced, so come along, learn, interact, and enjoy Vancouver in the summertime.
My talk will be entitled How and Why to Extend Firefox in Javascript (and Thunderbird, Komodo, and Songbird). I will post the slides here in June.
When I was 16, I wrote a computer game, called Micro Zooides. It was called that partly because on Windows .EXE files all start with the two characters MZ, and partly because it was about small creatures. Micro-Zooides was going to be about humanity’s progress, it was going to be Civilization, which didn’t exist yet.
The game had a splash screen of a Far Side comic, then a short video of me tromping through the woods like a Neanderthal, which my Dad filmed and which I digitized with a very early video capture card.
In Borland’s Turbo C++ 3.0 I wrote a basic graphics engine to display the tiles of the world, and an event loop so I could move the main character around the world. I drew sprites for a proto-human (the micro zooid), dirt, rocks and sticks. He could walk around the world, and pick up and put down rocks or sticks.
Then I took a break to plan. I have a proto-human, rocks, and sticks. How do I get to civilization?
After a desktop and server upgrade, my subversion client stopped working. I am using Digest authentication, and it kept asking me for the username and password. Wireshark showed me that the SVN client wasn’t sending the Authentication header. To find out more, I turned on Subversion’s debug output. Here’s how you do it:
Edit /etc/subversion/servers
Add this line at the end: neon-debug-mask = 511
That showed me this error: auth: '/' is inside auth domain: 0.
This means that the path I was requesting (the root of the repo) was not considered inside the AuthDigestDomain I had set in Apache.
It turns out that at some point in the upgrade of Apache, Subversion, or a library, the AuthDigestDomain requires a scheme. I had AuthDigestDomain svn.myserver.com
whereas it should of been AuthDigestDomain http://svn.gkgk.org.
Foxden is a Firefox extension that allows you to tile all the web applications you use on one page. Imagine being able to see your email, your calendar, your bug tracker, feeds, twitter, whatever you use, on one page. Take a look at my setup:
As you can see, I have (counter clockwise from top left) my email, calendar, feed reader, todo list and a local text file for taking notes.
It’s free, should work wherever Firefox 3 works, and it could be yours right now.
Most ActionScript / Flash applications have a main event loop, triggered by Event.ENTER_FRAME. This is where the animation moves along to the next frame, or the sprites of the game are re-drawn in their new places.
In the Flex framework, you are expected to call invalidateDisplayList on the framework to say you need an update, and actually do the update when the framework calls your updateDisplayList method. This is the invalidation / validation pattern.
I went searching in the Flex code to understand how this invalidation / validation step ties in with Flash’s event model. I ignored properties and sizing, and edited the code down to the bare essentials.
Here is what happens when you change the label of a button:
UPDATE March 19th: Added First Steps in Flex, and Learning Flex 3.
You’re an experienced server-side programmer, with a background in C/C++/Java/C# or Python, but no Flash experience. You want to learn Flex. Which book should you buy to learn Flex 3?
I have speed-read the following, so that you don’t have to:
Los Angeles is under attack, by trigonometric functions! OMG! Trigo-what? If I wanted to do maths, I’d go to San Francisco!! You, like, totally gotta save L.A man. Enter your name, then move your tank.
Use the left and right arrow keys to rotate, the forward and back arrow keys to move. The barrel of the tank is the little black line. That’s the front.
No, your tank can’t fire. Avoid the mathematical blobs. YEAH!
The longer you live, the more points you get. A score above 100 is, like, totally AWESOME! Good luck Bro.
Let me know in the comments how much you score.
When writing object-oriented Javascript, there are two occasions when you need to be careful that this is set correctly: In inner functions and in callbacks.
this in inner functions
If you are not in an object, this refers to the global window object.
If you are in an object’s method, this refers to that object,
except in an inner function, when this refers to the global window object again.
Number 3 is what you need to watch for. It is considered a bug in Javascript. Here is an illustration of the three cases:
Javascript is not an opinionated language. At it’s heart it is a hash map. You can layer pretty much any idiom you want on top of it. I’d like to make it look like Python, and it’s pretty easy to do. They both are dynamically typed, have functions as first class objects, and can treat most types as hash maps.
Let’s assume code for a whimsical Moose Observation Project, and translate it from Python to Javascript.
I have just launched Plebis.net. It’s a wall on the Internet you can write on, for all to see.
You can write anything you want. There’s no censor and nothing is recorded, so feel free to scream shout and wail. Tell the world how you feel. Get it off your chest. Go on, it’s good for you. Head over to Plebis.net, and say something!
At work we setup a Twiki, and Internet Explorer refused to send the NTLM authentication, instead it showed a login popup. The problem was that our Windows domain, say mycompany.com was different from the Twiki URL, which was othercompany.com.
The solution is to tell IE that othercompany.com is a trusted site. ‘Tools’ -> ‘Internet Options’ -> ‘Security’ -> ‘Local Intranet’ -> ‘Sites’ -> ‘Advanced’ and add it in there, this must start with http:// or https://
Note that this will be a problem not just with that Perl module, but with any cross-domain NTLM authentication. IE correctly refuses to give out your username as it doesn’t know it can trust the site.
Keithnote is a presentation generator. You provide information such as the title of your presentation, and it downloads relevant images from Flickr. These are stored locally so you can run your presentation whilst offline.
Keithnote is hosted at Google Code, here: Keithnote
For many months now I have been making and receiving telephone calls from my computer. There are two advantages:
It is very cheap. Calls within the United States are about $1/hour!
It makes your phone number virtual, and configurable, which means for example that my phone number will forward to my cell phone if my computer is offline. It also means you don’t have to be in the same country as your phone number.
I am running Ubuntu Linux on a Thinkpad, but most of this should apply to Ekiga on all platforms, and the principles apply to all Softphones.