technology: September 2004 archives
Power to Animals
[ rakaur on Thu Sep 30 at 06:11 PM // category: eawr, life, programming, relationships, school, technology ]
First off: I’m definitely owning in IRPG:
- rakaur, the level 51 destroyer of worlds. Next level in 0 days, 15:06:11.
- sycobuny, the level 50 CockGrabber. Next level in 0 days, 07:46:59.
- rintaun, the level 50 ultimate lego warrior. Next level in 0 days, 13:27:15.
- madragoran, the level 49 gaidin. Next level in 0 days, 03:53:00.
In other news: at about 7:45 AM yesterday I bent over to pick up my backpack and when I came back up the power was out. This wasn’t too surprising, but the fact that it didn’t come back on immediately was pretty surprising. So, I go outside and my neighbors are all out there “we don’t have power.” Okay, so I didn’t forget to pay the bills at least. My ride shows up, we go to school. All the way down Edwardsville Road the lights are out in all buildings. The traffic lights are also out on Edwardsville Road and Wood River Ave. We get to school, and the main and south buildings are without power. However, right across the street, the east building has power. What the hell? Is that road a power grid seperator or something? We all just stood around for twenty minutes before they told us to go home.
I wasn’t too thrilled either way, as I didn’t have power at home. I spent the first thirty minutes looking for a corded phone (every phone in my house is cordless, and my cell was at my dad’s). When I finally found one and plugged it in the power came back on. Apparently some animal had chewed through a wire at a power distribution station, taking out several grids.
On a side note, I’m making progress with my Python project. I just built a few classes based on the asyncore module. It’s very interesting. I’m kind of confused though. It insists that the asyncore.poll method uses select.select, that asyncore.poll2 uses poll.poll, and that asyncore.poll3 uses select.poll. Those are all correct, according to the code; however, the process status is always listed as poll when using any of these (including asyncore.loop(use_poll=False)). I guess maybe the Python interpreter uses poll if the system supports it, even when you’re calling the select.select method. I’ll have to look that up I guess; it’s irking me.
No still haven’t talked to girl probably never will talk to girl no one cares if girl talks to me or I talk to girl except other guy that wants girl who will “get” her according to everyone I talk to which puts a real damper on my self-esteem as if I had any to begin with.
If you read that “sentence” and still want to ask me if I’ve talked to her you need to go cut your tongue out.
-- rakaur // 2004.09.30 @ 06:11 PM
Football, Python, and Ruby
[ rakaur on Sat Sep 25 at 04:15 PM // category: life, programming, relationships, technology ]
I went to a football game last night.
Let me just give you a moment to digest the fact that I went to a football game.
Okay, so anyway. It was supposed to be a really good game, and it was. Of course, I didn’t really care either way, but it was still nice to be able to be around a bunch of people and have them set everything aside and just get along for once. We won 21-20 after being down 20-0 at halftime. I couldn’t really see much of the game (I was mostly watching the girl I want anyway), but it was still fun. Standing for like three hours screwed up my back nicely though.
I can safely say that I know Python now. I’ve read a ton of books until it got to the point where they were just repeating everything I knew. I’ll keep making plans on how to implement my first project though. The only thing I really wish it had is switch. There’s a PEP for it, but Guido (the Python author) doesn’t seem too keen on it. It’d be nice to have though.
On a related topic, I still haven’t found any decent “Learning Ruby” books. I guess I just won’t, since I don’t seem to care for it anyway. I thought perhaps it was the book I was reading, but I just don’t like it in any case.
-- rakaur // 2004.09.25 @ 04:15 PM
Every One is Addressed to me
[ rakaur on Wed Sep 22 at 05:54 PM // category: life, programming, relationships, technology ]
Yeah, so I gave up on Ruby. At least, on that particular book.
For now, I’m concentrating on Python, as it is awesome. Take the socket module for example. It’s pretty much a higher-abstraction interface to the C API, which is awesome. You can manipulate the sockets on the system API level if you choose to, or let Python handle all the dirty stuff if you choose not to. It’s very cool.
I’m going to another volleyball game tomorrow. Yeah, I know, I’m pathetic, etc.
Sorry for not updating this very often, but my life isn’t very interesting.
-- rakaur // 2004.09.22 @ 05:54 PM
Ruby Red
[ rakaur on Sat Sep 18 at 10:09 PM // category: programming, technology ]
Okay, so, I kind of added on to my last post and made it into a rant this morning. It still needs some work.
I finished the Python book I was reading. It’s a great (if a bit difficult) book to read if you already have programming experience.
So, I’ve moved on to the Ruby book. I’m still only a few pages/chapters/whatever into it, and it’s pretty weird. I mean, aside from the wacky syntax and Perlishless, it’s just pretty weird. Take the way it implements iterators for example. It associates code blocks with a method. That is, no code block is run within being tied into some sort of method (I think) and you can use the yield keyword (not the same yield as generators in Python) to “talk” to the code block it was called from. For example:
def someMethod
yield
yield
yield
end
someMethod { puts "hello world" }
Will result in:
hello world
hello world
hello world
I’m not sure I completely understand this concept yet, but I realize it’s very powerful. I may not like Ruby very much yet, but I definitely respect it. I can realize already that I’m going to have extreme difficulty grasping the Japanese logic (Ruby is mostly Japanese, having originated and mostly displaced Python there) that comes along with it. It’s like using a TI calculator all your life then being forced to use a Casio. That’s the best example I can think of. I’m a retard.
Anyway.
-- rakaur // 2004.09.18 @ 10:09 PM
The Battle of the Scripts
[ rakaur on Fri Sep 17 at 11:00 PM // category: programming, technology ]
Oh right, I have a Webpage.
I’ve been pretty “busy” the last few days between school and infatuation and reading up on some scripting languages. This is going to be a pretty long post… and may turn into a rant if it keeps going the way it is.
Here’s a note before I get started: I use the term “scripting” in reference to any language which is either interpreted or compiled into bytecode and interpreted. I use the term “coding” or “programming” to refer to any language which is compiled into native code and executed directly. Please spare me the “but you can compile Python scripts into executables by linking them with the Python libraries!” because that’s clearly not what I mean. Pedantry city is thataway.
I program as a hobby. It’s interesting, but I don’t think I could stand to do it for a living. One reason being that I randomly stop “feeling like it” and just don’t code for a really long time. That’s usually not so good for the monies.
The first “language” I ever had experience with was mIRCScript. mIRC is an IRC client, as you might have guessed. Its language is pretty defunct and mentally retarded to the point that you’d sometimes rather gouge your eyes out with straws than attempt to accomplish anything in. But, I must admit, it was a useful introduction to programming.
After that, I moved on to PHP. I believe that PHP was in the PHP3 days when I was first introduced to it. As with mIRCScript, I pretty much taught myself and learned as I went. PHP is pretty damned intuitive and you can usually just “figure it out.” Some time later, I actually bought a few PHP4 books and learned it the “correct” way. PHP serves its purpose as a Web development language very aptly. PHP elitists: I am very much aware that PHP can be used to do many things that have nothing to do with Web development. In fact, I saw a project a few months ago where someone had written not only a PHP HTTP server, but a TCP/IP stack to be used with the server. This is pretty astounding. But, for the sake of my sanity and this discussion, I’m going to go ahead and limit PHP’s usefulness to Web development. That’s what it was written for; that’s what it excels in. I don’t want to hear all of your PHP success stories on how you wrote an operating system using only the PHP interpreter. You can all rest assured that:
- I’ve heard it before, and;
- I didn’t care the first time.
After that, I moved on to C. I’ve done all of my “serious” programs in C. So, my history is pretty much one useless scripting language, one mostly-useless scripting language, and one old school programming language.
Now, jump from that to diving into Python and Ruby. Naturally, I was astounded at how simple in made things. Think of going from a few thousand lines of code to write a socket library in C, to three lines of importing modules in Python or Ruby. Yeah.
Perl
I’m going to mention this one first just to get it out of the way. I know about Perl, and I’ve tried very hard to forget about Perl. My friends, along with most of the Unix community, know and love Perl. I just don’t get it. I’ve tried to read books on it; I’ve tried to read references; I’ve tried to read tutorials; I’ve tried to read giant Websites that explain why Perl is so awesome and why it takes a steaming shit on every other scripting language ever, but; I just don’t get it. If you put aside that the language is absolutely deplorable in terms of aesthetics, well, I guess you have a useful language then, wouldn’t you?
I absolutely cannot stand neither Perl’s syntax nor the never ending philisophy of “there’s more than one way to do it, and every single one of them reminds you vaguely of that time you stepped in dog shit outside and then dog piss and then sixty billion cockroaches and wiped it off on your head.” Perl and Perl hackers are pretty much summed up by “you can do it sixty different ways… that is, so long as you never want to look back and your code and be able to know what the hell you just did. Isn’t that grand?!”
Spare me on the “Perl can be elgant if you want it to be,” because, in my opinion, it cannot. That’s it; case closed.
PHP
I’m going to go ahead and get this out of the way too. I find PHP infinitely useful for Web development. That’s what it was made for, and that’s what I use it for. PHP is simply not a plausible language to use for everyday things, in my opinion.
Notice how I keep stressing that? Everything that anyone ever says is quite obviously their opinion. Let’s make life easier and assume that from now on.
Ruby
I’m going to admit this straight off: I’ve read about two chapters worth of information on Ruby. I’m in the middle of reading another book at the moment, and I fully intend to pick up on Ruby after I’m finished with this one.
Over the past year or so I keep hearing about this infinitely wonderful new scripting language called Ruby. From what I can tell, it looks like Perl and Python had a catfight, and Ruby is the result. I’m not entirely sure if I like this language or not yet. It seems to lean more on the Perl side of things (variable prefixes, regular expression integration (id est =~ and /regex/), weird globals (eg: $_, et al), along with other things) than anything else. Since I can’t stand Perl, I’m not sure how well I’ll receive a language that so far acts a lot like it.
All in all, it looks to be an interesting read if nothing else.
Python
I’ll also come out and say that I haven’t finished reading up on this language completely. Most people don’t like Python for one of three reasons:
- They think it has strictly pedantic indentation rules;
- They think it’s inferrior to the god we know as Perl;
- They think the syntax is too weird.
I’m going to address those right here.
One: Python doesn’t have any indentation rules, per se. Python uses indentation to decide where code blocks start and end. Some languages (like C) use {braces} to determine this. Some languages (like Ruby) use keywords such as begin and end to determine this. Python uses indentation. The indentation can be one space or sixty spaces or one tab or sixty tabs; it doesn’t matter, so long as you’re consistant throughout the code block. Even this tiny rule may seem like it forces style upon you, which, in a way it does. It definitely leads to more readable code, id est, by everyone that reads it. Coming from a C programmer, you’ll not only get used to, but appreciate this. Trust me.
Two: It seems that Python is indeed slower with simple tasks, in terms of processing speed. However, Python tends to match if not excel Perl’s performance with larger, more complex operations. Also, Python doesn’t use nearly as much memory as Perl. I have no idea how the Perl interpreter works, but I do know that Python manages memory through both a reference-count garbage collector, and a mark-and-sweep garbage collector. Of course, this is simply memory management, not memory overhead. If you’re interested, Ruby outperforms Perl in speed in most cases. I’m not too sure about memory usage though.
Three: This is actually pretty valid. I’ll be the first to admit that Python’s syntax seems a little backwards. For example:
print [(k, v) for k, v in dict.items() if k == 'key']
This doesn’t really make much sense until you learn the Python syntax. I said earlier that it looks backwards, well, it is, a lot of times. This particular line of code would print a list of tuples of (key, value) for every entry in the dictionary “dict” if and only if the key is the string “key.” Yeah, that is pretty confusing. After you get used to the syntax you’ll find it’s pretty easy to slip into and start using.
So far, I’ve found Python to be very nice. If I have any serious scripting projects in the future, I’ll be using Python (unless of course I finish the Python book and read the Ruby book to find that I like it better ;).
On another note, I’m extremely tired. I started this post some time ago and I’m going to go ahead and post it like this until I have the stamina to write up a rant/article. Check back soon!
No one hears you.
-- rakaur // 2004.09.17 @ 11:00 PM
Idle RPG Update
[ rakaur on Sun Sep 12 at 11:59 AM // category: games, technology ]
I’m finally winning again! I have to post this because in like twelve seconds I’ll be last:
- rakaur, the level 46 destroyer of worlds. Next level in 3 days, 15:14:44.
- rintaun, the level 46 ultimate lego warrior. Next level in 3 days, 18:19:37.
- madragoran, the level 45 gaidin. Next level in 0 days, 01:39:51.
- sycobuny, the level 45 CockGrabber. Next level in 1 day, 11:44:17.
- naki, the level 41 isux. Next level in 2 days, 12:33:39.
- Rob_X, the level 36 Man. Next level in 0 days, 16:36:35.
- Guyver, the level 36 shadow blade. Next level in 1 day, 08:24:07.
-- rakaur // 2004.09.12 @ 11:59 AM
PHP5 and Accessors
[ rakaur on Sat Sep 11 at 11:12 AM // category: programming, technology ]
Okay, this is an addition to my previous post, but I figure it’s so immediately retarded that it deserves its own post.
PHP5 “solves” the problems of accessors with __get() and __set(). Say you have this code in PHP:
class Person
{
private $name;
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
}
Okay, so, putting aside that this is the most retarded thing on the planet, it’s pretty kludgy. What happens when you have a dozen properties? You have two dozen accessors. Well, that sucks more than the purpose of accessors themselves! I mean. if you’re feeding the stupid thing the value in the first place what the fuck is even the point of making the property private?!
But, PHP5 goes forth and makes this even more retarded:
class Person
{
private $data;
public function __set($property, $value)
{
$this->data[$property] = $value;
}
public function __get($property)
{
if (isset($this->data[$property]))
return $this->data[$property];
else
return FALSE;
}
}
So, this code sort of provides virtual accessors. That is, you feed it some undefined property (in this case, a nonexistant member of data) that you want to retrieve and/or modify, and it creates the property and does it for you.
But wait! You want to use inheritance?! Sorry, but, the only thing your child class is going to get is an empty data array! And __set() and __get() only work on nonexistant properties! Sorry, you’re screwed!
Gee, I know, I’ll just write my own accessors. I’ve only done that a thousand times.
But in either case, can anyone tell me the fucking point of this? How is this any different than making the varaible public to start with? How is any accessor any different than making the variable public? Why is this so fucking stupid? Am I missing some gaping logic and reason here or something?
-- rakaur // 2004.09.11 @ 11:12 AM
Volleyball for the Win (Volume II)
[ rakaur on Sat Sep 11 at 10:30 AM // category: life, programming, relationships, technology ]
Another awesome game last night.. we won again. It was a big tournament, with a bunch of schools. We only played one last night, and it was another “tied right to the end” game, which was awesome. The tourney continued this morning at 9:30, but I guess I’m going to have to sit that one out. Oh well. There’s a game Monday night against my home town, Bunker Hill, which should be awesome.
Oh, and there’s the other kid there that wants the girl I want. We both go just to watch her, it seems. That’s a bit of a conundrum.
I’ve been reading up on all the changes for PHP5. Some are pretty neat, some are pretty Java-retarded. I’m really beginning to hate OOP. I mean, I like the idea, but all of the implementations (excluding perhaps D’s) suck. I hate Java’s retarded interfaces and lack of anything else useful (which has been carried over into PHP5) and I hate C++’s multiple inheritance and kludgy templates. But the thing I hate most of all are accessors. Accessors are methods with the sole purpose of modifying and/or retrieving the value of a private property. I hate that. Isn’t it easier and less crappy to just make the variable public? But wait! That violates the OOP blah blah encapsulation blah blah. Okay, so why not just come up with a type modifier akin to public, private, and protected that allows for public read-only yet privately writable properties? Would that be really so hard? Oh wait, that would make fucking sense or something.
I don’t think I can stand to use OOP until D is finalized/standardized and put to real-world use. D is the Christ of the programming universe, IMO.
Oh right, 9/11 never forget etc. Tomorrow is my birthday; buy me shit.
-- rakaur // 2004.09.11 @ 10:30 AM
The Information Superhighway
[ rakaur on Tue Sep 07 at 06:24 PM // category: technology, web ]
Yeah, so apparently some registrar is giving away 25 .info domains per person for no good reason. I mean, I guess they hope to attract people there, and they’ve done a damn good job of that. I’m betting it gets Slashdotted soon.
I got ericw.info, ericwill.info, rakaur.info, and a few others that don’t relate to this site: sycobuny.info, stephenbelcher.info for a friend, s-url.info, a-url.info, tinyaddr.info for the Malkier URL catcher; malkier.info, dereferenced.info for other versions of domains I already own. Fun!
I still want that girl from school, but pizza will have to suffice for now I guess.
-- rakaur // 2004.09.07 @ 06:24 PM
Idle RPG Update
[ rakaur on Sat Sep 04 at 10:19 AM // category: games, technology ]
I’d just like to make a note that I’m still owning in IRPG:
- rakaur, the level 43 destroyer of worlds. Next level in 1 day, 19:10:11.
- rintaun, the level 43 ultimate lego warrior. Next level in 2 days, 05:04:17.
- madragoran, the level 42 gaidin. Next level in 0 days, 00:32:10.
- sycobuny, the level 42 CockGrabber. Next level in 0 days, 06:56:41.
- naki, the level 41 isux. Next level in 2 days, 12:33:39.
- Rob_X, the level 33 Man. Next level in 0 days, 06:56:42.
- Guyver, the level 23 shadow blade. Next level in 0 days, 01:25:15.
- dbn, the level 5 UglyMan. Next level in 0 days, 00:20:19.
Because I’ll very likely be losing quite soon… people have higher item sums than I do now.
-- rakaur // 2004.09.04 @ 10:19 AM
No Backbone Since 1986
[ rakaur on Wed Sep 01 at 05:18 PM // category: eawr, life, relationships, school, technology, web ]
Yeah, didn’t talk to her yet. I will tomorrow. I swear.
We had hella Physics homework today, so I can use that as a conversation starter. I had like the perfect opportunities too. I never do anything, and I regret it all day. I hate me.
Sorry about the page being messed up all day (as if anyone reads this). I kind of forgot about the possibility that there wouldn’t be any posts for a month.
Oh, I didn’t have any pictures to post today, so I went outside and took some. If you haven’t caught on yet: I like to take pictures.
-- rakaur // 2004.09.01 @ 05:18 PM
« technology: August 2004 | Main Index | Archives | technology: October 2004 »
