Author: barce

  • A Quicksort in Erlang

    qsort([]) -> [];
    qsort([Pivot|T]) ->
       qsort([X || X <- T, X < Pivot])    ++ [Pivot] ++    qsort([X || X <- T, X >= Pivot]).

    %% Let L be a list of unsorted numbers.
    %% 2> L=[234,322,233,5,1000].
    %% [234,322,233,5,1000]
    %%
    %% 3> lib_misc:qsort(L).
    %%
    %% qsort will return:
    %% [5,233,234,322,1000]

  • My Favorite Coder Interview Question

    What is your favorite algorithm?

    My favorite algorithm right now is the merge sort.

    v1: Nuno Nogueira (Nmnogueira), v2: edited by Daniel Miller (cobaltBlue)
    v1: Nuno Nogueira (Nmnogueira), v2: edited by Daniel Miller (cobaltBlue)

    I like it so much that I’ve implemented it in PHP and Ruby.

    The problem is that as a web developer I’ve never had to use a merge sort. Back in the old days when pagination was tricky, I’ve had to use a linked list, but you really don’t have to use the merge sort anymore.

    So at this point it’s really just academic.

    What interview question should really count now?

    More on that in my next post. As a clue, I’d like to say it has to do with Leibniz’s statement, “The present is big with the future.” A techie who believes that and the principle of sufficient reason is the kind of techie you want.

  • Google Adwords: A Great Trend Spotter

    I initially put up Google Adwords to bring more traffic to this blog.

    What’s interesting with using Google Adwords is that you get to bid on certain key words. 3 months later I’m noticing that a few word phrases have gone up in price:
    Google Adwords, a great trending spotter

    It’s a great sign that the phrase, “newlisp webserver,” has gone up 400%. It’s definitely a sign that more people are taking a commercial interest in newlisp as a serious web server. I’ve wrote about how newlisp is the fastest way to get onto the Internet before, and it still continues to be the fastest.

    What’s also interesting is seeing that ec2 and lamp are still pretty stale.

    The big take away is that you can use Google Adwords as a trending tool.

  • Doing Sysadmin on the iPhone

    For checking up on sites in the enterprise, I use Alertsite. It was suggested to me by a VP I work with at McCann, Ed Recinto. It’s been a great tool.

    For personal websites that I manage, I’ve been using something I rolled in newLISP, sitebeagle. Why? Because beagles are great watchdogs.

    Very often, most problems can be solved with tweaking code, changing permissions, or upgrading and apache or mysql.

    Very often, it’s the weekend, I’m sitting in a cafe, and get an alert from Nagios or Alertsite. With iSSH, on the iPhone, I can ssh into a LAMP server and do the work I need.

    I can see things getting a bit more complex. What tools do you use to sysadmin from an iPhone?

  • Oddments: A Great Blog For Keeping Up With Drizzle and Gearman

    Alan Kasindorf just introduced me to a great blog by Eric Day, Oddments.

    If you are into learning about alternatives to MySQL like Drizzle, or how to scale writes to a database using Gearman, then I wholeheartedly recommend his blog.

    I really like the samples of code he puts up that acts as a very useful, and direct tutorial to new technologies.

  • The Easiest Way to Deliver Your Web Project on Time

    This week a web project that I’m working on started to fall behind. On the key things that made this happen was adding a set of feature requests last minute.

    I understand it’s important to deliver value, but when new sets of features are added to a project, it causes the project to slip.

    What should you do?

    Learn to say, “No.”

    It’s hard to do, but take the design of the iPhone for example. Instead of saying yes to more features, Steve Jobs took the approach of saying “No,” in order to create something light-weight, elegant and a work of genius.

    Less is more.

  • Overcoming File Encoding Issues

    Ever see characters any of these characters:

    1) ^M

    2) <feff>

    3) A black diamond with a white question mark in it.

    4) What<92>s going on?

    ???

    Does your version control system tell everything has changed when it doesn’t?

    Does your web app break because one of the above characters?

    If you answered yes to any of these questions, you are not alone!

    If you’ve dealt with this and figured out it please definitely shared your findings in the comments below.

    I believe it is *the* number one issue in working in a hybrid environment, e.g. with Windows, Linux, and OS X.

    In the next blog posts, I’ll talk about how I’ve struggled with these issues with other developers.

  • The Corporate Game: Coders Use A Deck Lots

    Being on the bleeding edge of technology just isn’t as profitable as making money. A good example right now is the beer industry. BUD is making tons off of our down economic times. But I bet you if you look at BUD, you might find a non-networked FoxPro application, or something from 10 years ago. You might find that there are copying processes that you would’ve replaced with rsync ages ago, or user rights managements issues still solved with point and click.

    I can’t say for sure, because I’m not there. If the clothing that most people wear in Fortune 500 companies is any indication, their tech is 10 years behind the times.

    How do you communicate to them?

    Kathy Sierra style and use a deck. Create a power slide presentation for free at Google Docs.

    If you’re at a big company, a coder that turns his passion and goals into something others share uses a deck. By my count, you should spend an hour of your day making a deck to get a point across.

  • This Post posted by ScribeFire

    ScribeFire is a Firefox plug-in that allows you to post to your blog. In fact, I didn’t have to go through the WordPress interface to publish this, and used ScribeFire’s interface instead. It’s a must have plug-in if you’re a blogger.

    Technorati Tags: , ,

  • 3 Clients for Storing Data into Amazon S3

    It’s not that difficult to store data into your Amazon S3 account and share that data with 50,000 or so people on the cheap.

    Armed with just your Access Key ID and Secret Access Key, you can use these two cool storage clients.

    S3 Webmaster

    For Windows, you can download the S3 Webmaster for free, and you just simply drag and drop your files and S3 will automatically set the permissions for public download.

    S3Hub

    For Macs, there is S3Hub, which works whether or not you have an S3 account. If you don’t have an S3 account you can view other public S3 buckets. If you do have an account you can easily upload and share the assets you stored.

    Transmit

    If your data storage needs run the gamut from sftp, webdav, iDisk, automated upload workflows, and S3, you’ll want to plunk down some cash like I did and get Transmit. At $17.95 it’s a bargain. I use it’s webdav and S3 features almost daily.