2007-12-05

Piratebay down?

At this point it's nothing more than a rumour, but word on the streets is that The Piratebay has been raided by police again. I can ping their IP and their tracker seems to be working fine, but such rumours are inevitable whenever the site goes down. Who knows?

I'm passing it on anyway because I'm irresponsible that way.

1st update: Given that my blog views have more than doubled since I posted the above (not a difficult feat, mind you), and everyone visiting is searching on some variation of the words piratebay down, I'd say the problem is a widespread one.



Dammit! Just let me finish this Battlestar Galactica torrent!

Seriously, though, I'm still pinging through successfully.

--- thepiratebay.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 176.535/202.730/270.733/34.598 ms

--- tpb.tracker.thepiratebay.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 21131ms
rtt min/avg/max/mdev = 160.589/221.843/339.991/75.557 ms

If the servers had been seized or shut down, they wouldn't ping back. I'm sure the site'll be back up soon. Don't panic.

2nd update: I popped into the IRC channel.

[04:08:21] * Topic for #thepiratebay.org is: thepiratebay.org is down atm. http://bayimg.com back online
[04:08:21] * Topic for #thepiratebay.org set by [NoFate]!Nofate@bnc.gamehotel.dk at Wed Dec 5 03:19:27 2007

Labels: , ,

2007-11-03

A horking pile of bugs

Jaq asked me why I was laughing, so I showed her this, from Ubuntu's Hardy Heron roadmap:


She just smiled and nodded.

2007-09-15

Deluge BitTorrent Client

I loved BitComet as a bittorrent client, but that was on Windows. When I switched to Linux I missed it something fierce. Kirby suggested running μTorrent under Wine, and that did well enough as far as transferring files went, but the interface wasn't emulated properly so it was ugly to look at. Yeah, I figured that was important enough to keep looking. I'm shallow.

Everyone likes Azureus, but at the time I only had a low-end computer, which would choke on it. I eventually settled on KTorrent, using it for the past year or so. But it always stuck in my craw that I was forced to use a KDE app in Gnome just to get the features I wanted.

When I accidentally blew away my Ubuntu install last week, it was as good a time as any to search out new options. That's when I wandered back to the Ubuntu forums after a long absence and spotted a 3rd party forum for Deluge, a GTK based bittorrent client written by a couple of Ubuntu geeks. It's got all the features I like in KTorrent, and none of the features I don't (an aqua-wannabe interface, mostly, but I already said I was shallow). It runs on Linux, of course, and it's been ported to OS X. Someone's working on a Windows port, too, which is good because the only way to affordably run software in Windows is to steal it, so they need bittorrent clients.

If you're running Edgy or better, it's in the repos. A more recent .deb is available at deluge-torrent.org. It works, I'm happy, and that's all that matters.

Labels: ,

2007-06-05

Scraping

I lifted this code from Google Hacks about six months ago. It hasn't failed yet. Until today. As was pounded into my head over and over, scraping web pages is unreliable.

$ cat /home/galoot/bin/calc 
#!/usr/bin/php5
preg_match_all('{<b>.+= (.+?)</b>}',
file_get_contents('http://www.google.com/search?q=' .
urlencode(join(' ', array_splice($argv, 1)))), $matches);
print str_replace('<font size=-2> </font>', ',',
"\n{$matches[1][0]}\n\n");
;
?>
Okay.

$ calc 2000/364

5.49450549
So far so good.

$ calc 2000/366

5.46448087
That's right.

$ calc 2000/365

{Carlo <b>...
Heh. That's from the 8th hit for those search terms.



Back to the drawing board.

2007-04-11

Running IE under Ubuntu

I've been wanting to install Ubuntu on the laptop ever since I got it. The Edgy live disc detected all the hardware flawlessly (for Googlers, it's an Acer Travelmate 5610), with the only "tweak" being trying to remember the wireless network's password. (edit: Almost all the hardware. The TI 5-in-1 card reader remains invisible.) I was getting real close to dual-booting into XP (I need Internet Explorer), and the only thing holding me back was the impending release of Feisty on April 19th. (Check out the upcoming features.)

Then I ran into IEs4Linux. It runs your choice of IE 5, 5.5 or 6 (or all of the above) under wine, and it installed easily and flawlessly for me. I didn't expect that at all! My luck running apps under wine, especially MS ones, has been spotty at best. But this gave me no problems whatsoever. Either wine is becoming less irritating or this is an awesome install script. Or both.

I haven't tested it with whackloads of sites, but I don't really intend to. The idea is to test my own pages, not to actually (hahahaha) "surf with IE."

IEs4Linux installs Flash along with IE, if you develop in that. Support for IE 7 is in beta.

Now, the impending release of Feisty is the only thing holding me back from completely wiping Windows from the laptop.



(This post comes with six seven free parenthetical remarks. (No, seven!))

Labels: , ,

2007-03-09

Daylight Saving Time begins at 2 a.m. Sunday

Apparently this is a problem for Windows users. Ubuntu (Edgy) is fine. I don't know about Dapper or earlier versions, though. If you're nervous type zdump -v /etc/localtime | grep 2007 in the terminal.

galoot@cowbell:~$ zdump -v /etc/localtime | grep 2007

/etc/localtime Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
/etc/localtime Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800
March 11. Yup. We're good.

Labels: ,

Cheat Sheets

I Googled for "Regular Expressions Cheat Sheet" and found a treasure trove. Cheat sheets for Ruby on Rails, ASP/VBScript, Javascript, MySQL, CSS and more. Suitable for printing. Great fun at parties.

Labels:

2007-03-01

Ubuntu

Mrs. G's computer finally died, taking Win98 (I know) with it. When the dust finally settled, she had a better computer running Linux. She likes it.

Yeah! [fist-pump]

A day later, my Microsoft-loving geek friend, who is too old to be going through a mid-life crisis, called me up to ask "what version of Ubuntu should I install, 6.04 or 6.10?" Once I stopped sputtering, I recommended Dapper.

Yeah! [fist-pump]

Labels:

PHP Arrays

Some day I'm going to come back to these posts and laugh at myself for being such a newb. Those of you who already know all this stuff have the pleasure of laughing at me right now.

I finished the HTML/CSS course, and it was about as easy as I expected. Aside from being pissed off for a few hours during the final assignment before discovering the difference between quirks mode and strict mode (which wasn't addressed in the course), it wasn't difficult at all.

It would be less confusing to the student if they gave more robust example code, though. I had a bit of a time trying to get their code for vertical CSS buttons working right until I tried it in IE. Suddenly it worked. When I found the tiny bug and pointed it out, my instructor's response was, "too bad all browsers don't render the same." Yeah. Thanks. I know you require your students to use IE, but how hard would it be to support other browsers? When your target audience is people who want to learn open source languages, you can assume that a larger than normal percentage of them will be using an open source browser. It's not as though what you're teaching is complex enough to require special CSS hacks, it's all pretty basic stuff.

The only HTML I've used in the last couple of years has been in my blog templates, and while I came away from this course with a handful of new tricks, the main thing I got out of it was a chance to hone some rusty skills.

Still, I was happy with it. It's a well-written course.

Introduction to PHP, on the other hand, is not. It was very obviously written by a (messy) coder, not a teacher. The first five lessons consisted of a collection of little tricks buried in an ever-growing spaghetti bowl of ugly code. Each new concept was shoehorned into the same snowballing mess, regardless of whether it made sense to do so.

Teaching a neophyte this stuff is hard enough without tossing ugly and irrelevant code in front of him. The person who wrote the example code is probably proud of some of the little hacks in it, but when those hacks are extraneous to the lesson they're just distracting. It's a bit like trying to teach a kid about baseball and suddenly interrupting yourself to talk about valence levels. Yes, from the right perspective, it's related. But just offer up the most relevant material before going there.

I managed to simplify the examples enough so they made sense, then figure out the small hacks later, but it took a lot of needless slogging.

They finally dropped the tangled ugly mess of snowballing code and started fresh in lesson six, and it suddenly got easier. Which is good, because lesson six was arrays. Clean examples helped tremendously. I can't imagine if they'd tried to shoehorn arrays into that other crap.

I didn't like this section. I "get" arrays just fine, but one of the assignments involved traversing through a nested array, which is a lot easier if you're not using PHP 4 (the version they teach with), which lacks the array_walk_recursive() function. Of course it's doable, and I have to admit that I learned more figuring out how to work around the lack, but it ticked me off having to write twice the code I would have had to if I'd been using the version of PHP I have installed on my own fucking computer.

I'm not old-school enough. I can just hear the old dogs saying, "Son, in my day iterating through an array meant keeping track of the keys' addresses in memory. So you had to use a few ifs. Get over it."

To that, I say "shut the fuck up, old-timer." If I've got access to a post-hole auger I'm not going to be happy about having to spend three hours sweating with a clam-shell digger. Yes, yes, I know. I learned more by hacking around a missing feature than I would have if it had been handed to me. I appreciate that. I just didn't enjoy it.

And that, I see upon re-reading, is a big fat lie. I hated it when I was doing it, but having done it feels pretty good. You old dogs already knew I'd say that, didn't you? I can hear you chuckling to yourselves.

I'm not quite halfway through this course and I already enough to know that, at the end of it, I won't know anything. It'll be like spending two years in art school having learned nothing more than how to hold a pencil. Hopefully I'll know enough to confidently dig myself out of my own holes. (I didn't plan that last sentence when I wrote the bit up there about clam-shell diggers, but it worked out well, didn't it?)

I'd be extremely interested in hearing stories of what it was like for you to learn programming. What language did you start with? Would you have started with something else? What concepts baffled you, and what "aha" moments got you over the humps? What approach did you take? How long did it take for you to feel proficient? What would you have done differently? What did you do exactly right? What was your frustration:fun ratio back then, and what is it now?

Go ahead, get nostalgic.

Labels: , ,

2007-02-23

Tiddlywiki

I'd forgotten about my short affair with Tiddlywiki until recently. But, having switched away from Opera [twitch], I needed something to replace my much-loved Notes Panel. Tiddlywiki does so much more, I consider it a net win.

Thumbs up.