Sunday, March 1, 2009

Computers...

I really want to be able to just play with things.

I guess I need to get deeper into virtualization?

I came here with every intention of saying "I need to design some kind of thing to allow me to swap hard drives on and off of things and I need like 5" or some bullcrap like that - what I really need is a decent tower with space for 4-5 disks, a DVD+/-RW, a floppy drive, and decent video, sound, and networking cards, then to RAID it up, throw a really stable linux with good driver support on it, and then virtualize stuff.

I _could_ buy 2-3 really cheap low-end boxes to mess around with and put really basic versions of linux on and hack the kernel and break things like apache and MySQL and C - but it's probably more useful and even easier for me to just get a really damn good tower and build a PC for about a thousand bucks.

.. there must be some easier solution to this.

Sunday, December 28, 2008

Since the last post...

I've written a fair bit about how the taxonomy should work - the basic two groupings, "Practicals" and "Esoterics" seem to be set, and from there I'm looking at classifying things within.

The way I initially thought I'd go about this was in a general sense, "How could I classify the things to be learned?" - and after a couple of minutes of just slamming my head into that wall I crumbled, and decided to just write about 30 things I'm interested in learning and then find the most general way to classify them. Seems to have worked.

Then I got sidetracked by some guitar I heard on the radio into playing with mine, and from there I got angry about not knowing simple musical theory like what the subdominant chord in the key of E would be - or even what the notes in the tonic chord would be. So I made a bunch of little pieces of paper I could slide around with the notes listed chromatically on them, and a counter and that was neat. Really clunky though. Then I streamlined it by cutting some well-spaced holes in a piece of paper and putting one of the thin pieces of paper I'd written scales on to slide into it. If I put an E in the top hole, it shows a G# and a B on the other two holes. It's quick and easy, and I could go on to make a slide for minor chords, for all the different chords in a particular key, for interesting intervals - but that's when I got smart.

I brushed up on my more-than-adequately rusty Turing skills and wrote myself a little program that tells me what information I would like to know. I made it very expandable, but off the bat I programmed in (for any given note) the major and minor tonic, subdominant, and dominant chords, as well as the perfect 4th and 5th interval to be shown. It isn't much, and in the long run it's something I should simply know - but doing it helped me learn a fair bit of theory and it was a lot of fun. I also learned a good deal about wrapping things into a range with a mod statement. That is now what this post is about.


I spent about 25 minutes kind of staring at the screen before making any real good work - I'd written the shell of a function and gotten it into my head I needed some kind of loop because I'd be repeatedly subtracting from a number. The situation was:

  • 12 elements, 0-11 of an array, values 'A','Bb','B'...'G#'
  • A function should take in a 'current' position in the array, and
  • a 'modifier', the number of chromatic steps up or down to take, and
  • should return an index to the desired note
An example would be func(10,3) - meaning G + 3 chromatic steps, or Bb, index 1. Alternatively, you could get func(2,-20) meaning B - 20 chromatic steps, or, really, -8 chromatic steps since the first 12 just wrap around, and you end up at Eb.

Anyway I sucked at this. I spent a long time doing nothing, then spent a much longer time watching Lawrence of Arabia for the first time (that movie is amazing) then I went back to not succeeding. After a long, long period of time, I'd worked to this point:



if (modifier < MINNOTES) and ((current + modifier) < MINNOTES) then
current := (modifier + current) mod (MAXNOTES)
elsif (modifier < MINNOTES) and ((current + modifier) >= MINNOTES) then
current += modifier
elsif (modifier > MINNOTES) and ((current + modifier) > MAXNOTES) then
current := ((modifier + current) mod (MAXNOTES))
elsif (modifier > MINNOTES) and ((current + modifier) <= MAXNOTES) then
current += modifier
end if



After trying to write this small snippet of code in Blogger and spinning my wheels for a very long time, I've grown frustrated but learned a good deal. There are some issues that occur when moving between 'Compose' and 'HTML' mode that make newlines disappear and cause evaluation of symbols. For example, &-lt appears as <, but when you move to composition mode, the HTML is rendered and thus the symbol-text is replaced. Moving back to HTML leaves you with just an angle-bracket, and then moving into Compose will kill a large section of your post.

It's ugly.

Anyway, hopefully this works out (I've simply resolved to not switch back to Compose mode - who needs WYSIWYG) and you can read the code I posted in. Note that it's hideous. It took me over 3 hours to come up with that code which does actually work, during which time I went through off-by-one errors and modulo arithmetic problems and all sorts of hairy guff. Fortunately it finally worked, and once I saw that if-statement I saw it could be further reduced:



if isBetween (MINNOTES, current + modifier, MAXNOTES) then
result (current + modifier)
else
result ((modifier + current) mod (MAXNOTES))
end if



is the final rendition of that code - I wrote a small 'isBetween(low,target,high)' function that returns true when target is above-or-equal-to low and below-or-equal-to high, inclusive.

After hours of pounding away at what's really a simple problem, I finally ended up with a simple solution. From there the program wrote itself, and the ability to simply say "5 steps up from whatever the input is" without any error-checking or external wrapper statements made it all worthwhile.

It was a good coding experience.

Anyway, goodnight.

Monday, December 22, 2008

Setbacks.... or not?

So I'm stalled.

Yeah.

In the meantime I've done a lot of other neat stuff, but I'll be back on track soon. The graphs were doing well at the point that I stalled, and I did so due to exams. I'll pull back in by ... there are children on television eating some sort of gigantic ridiculous cake-bread. That was insane. "Bauli". What the crap. Italian tradition? Insanity. Anyway where was I? -- Oh yeah, anyway, I have discovered something of higher momentary importance. A Taxonomy of Goals.

So let's think this through.

I want to classify all goals. So what are my goals for this system by which I can classify goals? Well first off let us stop being so freaking wordy. Kay.

Goals:
-> Upon realization of a goal, low effort and fast categorization.
-> Must function like a "tech tree", with dependencies showing or intuitive.
-> Ease of finding goals.
-> PRETTY COLOURS ZOMG WHAT NO THIS ISN-

Okay, so we've got a Tree shape, easily divisible, sensible divisions.

Sounds like a good prototype. I'll take a Tree with root 'Goal', and then make sensible divisions. This is an n-ary tree. Perhaps I'll store it in my graph program? Neat!

Anyway, I'll work on that. Once I've got some rudimentary system ready I'll throw a nonsensible amount of data into it and then be strangely satisfied, and I can go on with my earlier work. And hey, maybe it'll be useful or something.

But it's 6:00 AM and I'm going to bed. Revenge of the Nerds be damned.

Saturday, November 29, 2008

Python Graphs ---- GO!

Martin, you sly dog.

The idea was thus: build a graphical graph-building application. You can make nodes and make connections between them and drag them around to check planarity and stuff. Maybe even read values in them or something. In Turing.

I challenged him to make it in Python and use the experience to learn Python. I know Python to the extents that I can read it and if you asked me to write something I could bumble around for a while and produce it - ie. I don't know it very well at all.

So now I have accepted my challenge to Martin, and am creating the program. It's one I've wanted to make for a while, but I was thinking I'd dive back into my C graph implementations. Why not just make a new graph library though, eh?

So let's plan this crap out. (Warning: Now entering intensely rambly incomprehensible mode ... project planning)

Situation: I'm learning Python with the intent of developing a user-interactive graphical application that presents and manipulates representations of graphs.

Problems:
  • I don't know Python that well.
  • I don't know how to do graphics in Python.
  • (Same vein) I don't know how to do window-level UI with Python.
  • I don't have a Graph Library for Python.
  • I don't have a List library for python.
  • 99 Bricks (a joke)
Tasks:
  • Learn Python better (I can do this along the way)
  • Learn about pygame (gives me graphics+window-level UI)
  • Build a linked list adt.
  • Build a Graph adt.
Refactored/ordered Tasks:
  1. Build a Linked List ADT using Python.
  2. Follow some tutorials and make some simple pygame apps.
  3. Build a Graph ADT using Python.
  4. Make the UI I want, sans graph stuffs.
  5. Plug the graph stuffs into the UI.
Cool. Next up: Subtasks!

Build a Linked List ADT using Python:
  1. Write out an ADT spec (can be simple and concise, just make one).
  2. Read some stuff on classes/object creation/destruction in Python.
  3. Read some more in-depth stuff about python's Pass-by-X system. (I don't know if it uses pass by value or pass by reference, .. and I don't have an immediate appreciation of what the differences are going to mean to me. If I thought about it, I'd get there, but I'm restricting that thought because I need to research this anyway, and keep on task. And be longwinded.)
  4. Write a simple sample class and then test it out.
  5. Write a LinkedList type according to my spec or simplified.
  6. Debug.
  7. Much Rejoicing

Okay! That's a good enough start for now. I'll come back and post.append() later on once I've done all this. I'll post up my ADT and any relevant stuff.

Thursday, November 20, 2008

Systems of Government

Tuesday, November 11, 2008

Animation

Saturday, November 8, 2008

Step 4: Ideas & Decisions

Unfortunately, now that I actually stand in the intersection of free time, available tools, and preparedness, I'm finding every excuse to stall... But I'll manage to press forward. This is all about momentum. I just have to start in order to continue.

So I think it'd be reasonable for me to outline what size/style of project I'm thinking about here. I would like to start off smaller, so that I have a higher probability of actually finishing, but this shouldn't be so small that it's just "Write a tiny easy program in a language I know". A project can be anything though. Just start writing them and delete them if they look stupid.

- Check out & compile a linux kernel
- Make a barebones app with Qt
- Make a barebones app with GTK+
- Do something cool with Python. Maybe a web browser? Something grapical
- Check out & compile some sort of OSS software - something interesting and big. Read the code and play with it.
- Get my graph/tree/table/list code imported into SVN and in good working order
- Get openGL and play with it - make a tetrahedron that rotates in 3 dimensions on keypresses in fullscreen - then make some 3D terrain - then make a person move around on it. Then make a game!
- Improve graph ADT by adding things like A* search and perfecting my minimum spanning tree stuff, etc
- Do something cool with Ruby. Something graphical, or something databasey?
- Write that database app, in C, or in Java, or anything
- Play with mySQL. Learn Databases, damn it!
- Write a simulation
- Download & play with a physics engine. First assignment of 3750.
- Play with graphics in Java. Produce a smallish 2D game.
- Ruby on Rails. Get it and see what it's like.
- Play with FTP/SFTP/Telnet by hand a bunch and know the commands
- Learn Regular Expressions, maybe alongside some Perl?
- Continue to mark down RFCs of interest, then Read a bunch of RFCs
- Find out some useful newsgroups/mailing lists, join up. Be active. Get involved.
- Write an actual short story, with a beginning, middle, and end. Or at least (because it doesn't necessarily need a beginning/middle/end) make it complete.
- Write some sort of sound producing program.
- Learn awk/grep magic
- DirectX. Play with that, too.
- Get some sniffing/packet software, maybe libpcap and write a sniffer. Do some kickass security stuff.

Okay, that's a pretty good first list. Now I've just got to choose some particular thing to do.


----------------- Commence thinking! (skip past it if you don't like rambling text)


Okay, the ones that stand at the top (for doing today) are:

- Check out & compile some sort of OSS software - something interesting and big. Read the code and play with it.
- Continue to mark down RFCs of interest, then Read a bunch of RFCs
- Find out some useful newsgroups/mailing lists, join up. Be active. Get involved.
- Play with mySQL. Learn Databases, damn it!
- Get my graph/tree/table/list code imported into SVN and in good working order
- Get openGL and play with it - make a tetrahedron that rotates in 3 dimensions on keypresses in fullscreen - then make some 3D terrain - then make a person move around on it. Then make a game!

That's unfortunately like half the list. The best course now would be to expand on each idea and see which ones just start flowing.

- Check out & compile some sort of OSS software - something interesting and big. Read the code and play with it.

What would I get? Chromium, valgrind, gcc, firefox, pidgin, vlc, vim, the linux kernel, gnome

- Continue to mark down RFCs of interest, then Read a bunch of RFCs

I think I should do this in my odd spare time, like at night or when I get tired of coding - better than take this as a project that blocks other things from being done.

- Find out some useful newsgroups/mailing lists, join up. Be active. Get involved.

I think this should largely be integrated into the OSS thing. Step one would be find a mail/news reader/aggregator, step 2 would be finding the lists for certain projects, step 3 would be aiming it and step 4 would be reading, reading reading, then sign out one that I feel like I understand a bit

- Play with mySQL. Learn Databases, damn it!

This could be really quick and easy to do. Key issue is that I don't really have anything I want to do, or know enough that I could craft a reasonable sample-task. Requires some research on DBs

- Get my graph/tree/table/list code imported into SVN and in good working order

A bit daunting, a bit annoying, but also really inspiring. I want to know SVN better (OSS stuff would help me with this too) and I really want to play with my graph/list stuff, but even moreso I want that stuff to be good and done properly. Issue is that I don't know where the most up to date stuff is stored, and I worry that I may not even have it >_< - definitely needs to be done at some point

- Get openGL and play with it - make a tetrahedron that rotates in 3 dimensions on keypresses in fullscreen - then make some 3D terrain - then make a person move around on it. Then make a game!

This is a biggie. But it's really, REALLY exciting and cool. I think I should have a lot of time available for this one even with the infrastructure. .. hm. Definitely a fair bit of research needs to go into this as well.


Okay, so after expanding them out, I've found:

I will do RFCs no matter what. I'll do them at night regardless of whatever else is going on.
Looking up some OSS projects / their newsgroups and installing some newsgroup software takes me several steps in several directions. I think it points at an SVN checkout/compile of an OSS project being the best first move. So, I think that's where I'll go with this.




-------------------- Thinking done! Action time!

Actions:

Find out some good newsreaders/how rogers 'does' Usenet access. Maybe sign up through a professional thing.
Go check out some OSS projects' contact info and see how best to communicate with them, where their lists/groups are, etc.
Hook into the parties' groups, read read read read
Whoever is most understandable/cool/interesting/nice, check out their software.
Play with it! Compile it! ... Patch it?

Awesome. Onto Step 5: Execute.