Friday, August 11, 2006

Apparently I'm not the only one who Can't Code

I've been reading a lot of the links on programming.reddit.com and I've come to the conclusion that few, if any, people actually know how to write a program. The number of variables involved and the pre-existing opinions of people seem to cloud the issue a lot for me.

Thursday, July 06, 2006

Recursion Gone Bad

I recursively get adjacency lists on a graph, going down a level every time, but unfortunately that means I eventually have a huge stack of lists in memory, depending on the size of the graph I'm working on. This seems like at least one of my current problems to work through for memory allocation. I'm thinking if I can solve this problem, issues with running out of memory will be a little better for me. Right now more than 13 or 14 vertices fails when I run out of memory (and yes, some of my earlier attempts turned out to have some other issues, hence the runtime and memory were ok, but they were incorrect).

Monday, June 05, 2006

Progress Report

After discarding C for a Lisp implementation (secretly thnking I'm probably wrong somewhere anyways, so why not throw on some extra learning, at the least), I think things are going well.

I have a Common Lisp program that seems to be a solver, although I've worked on a small number of data sets. My todo is:

1) Find a good graph generator
2) Run generated graphs against solver
3) Make PHP frontend to progam for people to access the program.
4) ???
5) Profit

We'll see how it goes.

Monday, May 15, 2006

Lisp > Pike > LPC > C ? Yes : No

I've been struggling into Lisp, which is interesting. I remember back in college, I had the opportunity to take an 'Artificial Intelligence' class, but it conflicted with some other class, so I skipped it. My roommate at the time, Todd, ended up taking it and he ended up using Lisp in the class for a project. I wasn't sure about it at the time, as all I ever heard was "parentheses", but at the end of the semester, people were showing off their projects. Everyone had to make a game, I don't remember most of them, but one was a chess game. Some dorky college students pumped out a working chess game in a month or two. I remember being impressed, as most of the things coming out of class were pretty useless. A working chess game (the computer was your opponent) was very cool to me at the time. Maybe it wasn't because of Lisp, but I don't remember anyone writing anything that really worked that well in C that quickly (remember we were all undergrads with little to no programming experience).

Anyways, as much as I use C, I still slug along slowly whenever I ahve to write a lot of datastructure code. Probably everyone does, unless you copy somehting from the public domain or GPL land, depending on your need. I started out writing C for my code to go for the speed, but I write C all day ad I wasn't getting down into that last bit of hashing. A bit of thrashing through Lisp and I pretty much solved that issue in Lisp in something like 2 hours, including continuously looking up functions in my Lisp reference.

Ah, high-level languages, how I love thee!

Monday, May 08, 2006

Lisp

I was perusing the posts at reddit and this was one of them: Lisp Tutorial. I'll have to check back and see what else is posted there.

Monday, May 01, 2006

Compiler and No Compiler (Typecasting)

At work today, we had a presentation on c++. I'm fairly familiar with Object-Oriented things in general, so nothing of great news to me. However, as we were sitting there listening, it really did strike me about compilers and strict vs loose types. I'm not the first to say it, and I've heard it before, but I don't know that it would be a weakness for a compile language to have loose typing. The compiler has plenty of time to figure things out. The only really useful thing from typing (other than enforcing coding rules you should problably learn elsewhere) strictly is that you are giving extra hints to a compiler. Languages with VM probably benefict MORE from static typing, as they have a hint about a variable and can skip some of the interrogation of that variable.

If I was writing a compiler, I'd do it for a loosely typed language. One that makes programming pretty fast, but lacks a compiler. Maybe one like this.

And I haven't forgot about my NP problem. I'm implementing some binary tree items in C, I'll see how fast things go after that (and maybe do some actual math work again to find the work done). I could probably whip this all out in Pike in a few hours, but I like the pain.

Monday, April 10, 2006

Tail Recursion...Tail Recursion...Head implode

I took some cold medicine, so I'm sure my mind isn't quite up to the task I've set it. I started reading about Ruby, Lisp, Scheme, Python, and even a book about Unix philosophy. Mostly I just read entries on Wikipedia, although over at Rafe Coleburn's weblog a post on Ruby caught my eye.

So I dug a little into Ruby, and it looks like Perl at first glance. Not my cup of tea in general, but at this point I'm not that much of a language evangelist, so who knows, maybe I'll be using it someday.

However, not today. Today I installed Common Lisp on my windows machine (I can't boot into linux as I don't have support enabled for my wireless card, I'm in a hotel, etc.) Then I installed Cygwin and what have you. My thought process at the moment is that I would like an interactive web browser, and seems like I need some more experience, so why not write my own? I might give up and just use emacs, but I haven't used emacs in years and never was very good at it. Who knows.

The tail recursion thing though, was from reading on wikipedia and following the link to tail recursion. Not something I really gave much thought to before, but now that it's been pointed out to me I'll have to remember it.

Now the real meat of the moment is I need to devise a good way to compare lists of graphs. How does this all fit together? Not sure at the moment, but once the medicine wears off maybe it'll all come together.