2007-12-11

Irssi screening guide.

It's best to do this right first time, although, I'm sure, most people won't read this until their machine is about to go down and they're going to lose all their work. :)

  1. Add all your networks to irssi, pick any random name. For instance:
    /network add freenode
    /network add efnet
    
  2. Add servers for the networks.
    /server add -network freenode irc.eu.freenode.net
    /server add -network efnet irc.efnet.org
    /server add -network efnet efnet.port80.se
    
  3. Add channels to the networks.
    /channel add -auto #irssi freenode
    /channel add -auto #defocus freenode
    /channel add -auto #lulz efnet
    
    "-auto" here means to auto-join the channel when connecting to the specified network. Modified from http://irssi.org/documentation/tips, this alias will add all your current channels, and auto-join them: /alias addallchannels script exec foreach my \$channel (Irssi::channels()) { Irssi::command("channel add -auto \$channel->{name} \$channel->{server}->{tag} \$channel->{key}")\;}
  4. /layout save This makes all the tabs re-appear in the same place when you next load irssi.
  5. /save Commit all the work done above to disk. If you messed up, just /reload.
  6. When you next load irssi...
    /connect freenode
    /connect efnet
    All of the above mentioned commands have loads of extra options, go read the /help. :)

2007-09-16

PHP's docs.

At the time of writing, a google search for:

Warning: file_get_contents() expects parameter 2 to be boolean, resource given

..doesn't get any hits.

I encountered this problem following the docs.

Does this imply nobody reads the docs? Do they just steal^Wborrow code from other people? Is everyone using a framework that wraps this for them (haha)?

Hint: It's a docs problem, the correct prototype is:

string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])

Thanks to the lovely people in ##php on freenode. :)


2007-07-31

Programming.

I recently opened my Mini-Programming Competition #2 (not a plug, open to UWCS peoples only).

The challenge was made up about an hour before I announced it, and, as such, I didn't even try coding it before announcing it, I just "guestimated" the size of the problem, I think I did reasonably well, and I think this makes me a good programmer.

A few I have spoken to (especially among the non-hobby-programming crowd) have not been able to come up with a(ny) algorithm within a quarter of an hour or so, I didn't measure, but I guess I had a codeable solution within a minute of imagining the problem. I'd hope this makes me a good programmer.

As for solutions, I spent a reasonably amount of time coming up with a single (good) algorithm and have tried to "optimise" it, and port it to other languages, etc. Others have come up with many algorithms and trialed them. I have to admit that my solution was pretty poor, regardless of optimisations. The really interesting question here is, does this make me a better or worse programmer than the many-algorithm people?

Aside: Golf as a programming benchmark.

Golf, the art of writing short (by character) programs (as apposed to fast programs), is often sneered upon by programmers (especially the employed ones).

As I mentioned above, it's far more about algorithmics (an important skill, regardless of language or formatting) than the simple ability to delete whitespace and use short variable names (although being able to follow code in this form is a (useful?) skill). Alongside this, it's a great way to use language features you don't see very often (for instance, I now actually have experience programming with raw pointers :p).

My rules for the MPC are carefully chosen such that it doesn't matter if a language is "better" than another for writing short code in, although, obviously, points are awarded for the combined best choice of language and solution.


2007-07-29

Amazon Accounts

I have, for a while, suspected that I have more than one Amazon account associated with my main e-mail address. I've dismissed it as silliness, as, in no sane system, would this be possible, regardless of the fact that recommendations always seem to be incredibly similar.

After having all kinds of crazy things happen to my shopping basket today, I decided to have a poke around.

It appears that I do have two amazon accounts (or possibly more!) associated with my e-mail address, with different passwords. I can easily see this happening, as I have a set of ten or so passwords that I use for random websites, and just guess if I can't remember which it is for the current site.

Showing how "brilliant" their database design is, even though they allow two accounts with the same e-mail address, they check that there are no e-mail-address/password collisions:

"The e-mail address and password that you selected may not be used at this time. Please select a different e-mail/password combination below."

Which basically means "You've just sucessfully guessed someone else's password. Please log-into their account and buy stuff.".

Continuing, even worse, creating a new account with the same e-mail address as an existing account (with a different password, obviously) (note that this doesn't require access to the e-mail account in question) allows you to skim some details from the existing (or one of the existing) accounts. For instance, the "Change your name, e-mail address or password" seemingly always gives me the wrong name.

Dyoooooooooh.

Update:

You can use the "forgot password" form to see if you have more than one account ("We can't seem to identify you using your email address alone."), and the Wishlist Search to guess how many accounts you have.


2007-06-24

This error message sucks:

The file is corrupt. Please try another.

2007-04-13

C# + DWM -> pretty!

I was reading a nice, if slightly dated, set of articles about the new features in Windows Vista, including ars technica's rundown. This article mentions that not much of the functionality avaliable in the Desktop Window Manager (Aero to everyone else) is going to be exposed to third parties, which I think it a great shame.

However, quick investigation reveals that, at least, the thumbnaling stuff has an API.

B#'s blog shows how to get at the DWM previews in .NET, and the MSDN magazine shows how to create pure glass windows.

A quick combination (and about an hour trying to work out a decent layout algorithm) gives:

I've actually put a FDWMlist.net binary (sig) up, for once, even though it's generally worse than the code I normally hide. :)

Any key to refresh. Any use may invalidate your Reliability Index. You have been warned.


« Prev - Next »