4 GB OF RAM FOR MAC LAPTOP IS ONLY $61....
OK, so I haven’t bought new RAM in years, but still, $61 for 4GB of ram? Unreal.
ASK A QUESTION BOOKMARKLET
I snuck a feature into Answerbag… the ask a question bookmarklet. Anytime you’re on a page, and you want to ask a question about it, using the bookmarklet will automatically fill in the URL for you. How does it work, you ask? Simple. Drag the link below into your bookmark toolbar. Click on it, ask away! Ask a question
ERLANG - WORKING WITH ETS:SELECT_COUNT
In my last post, I covered using guards with Erlang’s ETS select/2 functionality. However, what if you’re looking to select a count of the number of matches for a given pattern? Lets use select_count for that. You can use the same pattern matching I covered in my previous post. There’s some weird behavior though, with the last parameter of the Result part of the record. It seems that using ‘$$’ returns 0.
'ERLANG: ETS MATCHING WITH GUARDS (SELECT/2)'
Not every time we want to pull data out of an erlang ETS table is it as straightfoward as the previous example. Sometimes we want to get all values that are greater than zero, rather than just constants. We’ll need to use the ets:select function, which has support for guards. Here’s a basic setup. Tmp = ets:new(tmp, []). ets:insert(Tmp, {bob, 0}). ets:insert(Tmp, {jim, 1}). ets:insert(Tmp, {jon, 2}). % Returns all results ets:select(Tmp,[{{'$1','$2'},[],['$$']}]).
'ERLANG: SUPER BASIC ETS MATCHING TUTORIAL'
I hate having to look stuff up to get examples, especially when I have to click on more than the first google link to figure things out. As a result, here’s a very, very basic intro do doing matching with ETS and erlang. It’s similar to a SELECT in SQL. Here’s some simple matching. 44> Tmp = ets:new(bacon, []). 26 45> ets:insert(Tmp, {joe, {fish, 1}}). true 46> ets:match(Tmp, {’$1’, {fish, ‘$2’}}).
GOODBYE QUICKSILVER, HELLO LAUNCHBAR
It’s unfortunate that I’ve reached this point, since I thought quicksilver was a really awesome piece of software. Unfortunately, it’s just gotten to be completely unstable. Beach balls became all too common. So common, that I was willing to cough up $20 for LaunchBar after only trying it out for 10 minutes. I never was a power user of quicksilver - I did like a lot of things in theory, but I never took the time to memorize the keyboard shortcuts.
TURNING TO THE DARK SIDE FOR A BIT....
For better or worse, I’ll be doing c# development for a while. I’ve never been particularly fond of Windows, so we’ll see how things go. I can say that I did manage to blue screen my box on day #2. If anyone has any good c# tutorials or books they’d recommend, I’d appreciate it.
MYSQL: ERROR 1267 (HY000): ILLEGAL MIX OF COLLATIONS (UTF8_UNICODE_CI,IMPLICIT)
I have never, ever seen this before. I don’t even know how the table was created with a different collation. However, I had all my other tables created with the character set utf8, no collation specified. I had to convert the second table to match the character set. This probably wouldn’t have been a problem if I wasn’t joining on a character field. alter table exclusion CONVERT TO CHARACTER SET utf8;
EXECUTING MYSQL QUERIES WITHIN VIM
I haven’t been using vim for very long, but I’ve gotten over the initial learning curve of getting used to the different editing modes. With some help from the guys in #vim on irc.freenode.net, I managed to get this gem: ` map :call SwitchDB() :function SwitchDB() : let g:current_db = input(“Database > “) :endfunction map :call Doquery() :function Doquery() : if !exists(“g:current_db”) : call SwitchDB() : endif : let query_string = input(g:current_db .
COMPILING LIBJPEG ON 64 BIT CENTOS
I ran into an issue just now compiling libjpeg on 64 bit CentOS. I found this very helpful post that gives a workaround using a config.guess file from libtool. For some reason, I didn’t have the folder he suggested, but I did have the alternative (automake). cp /usr/share/automake-1.9/config.guess . cp /usr/share/automake-1.9/config.sub . I copied the above files into my jpeg-6b directory, and ./configure –enable-shared –enable-static worked correctly.