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.

Thursday, November 6, 2008

Steps 0-3

Preamble:

I'm a verbose guy. I like to use a lot of words and to speak in stories that go on and on and on. I know the value of being concise, and I love being concise, but when I write for writing's sake, I often simply let it flow. I hope to present two versions of whatever this is: my version, which will be lengthy and meaty and get things across really well but take forever to read and write; and your version, which will be shorter, better organized, and may somehow miss some sort of crucial step.

Regardless, I'm going to do my way first then cut things down. You're less important than I am in my world, that's just the way the blocks fall.

Given my plan and goal, I'm thinking about my first steps. I'll plot a little path of what I've done so far, and what I plan on doing now and next - this is in the spirit of documenting everything.


The Meta Steps

Step Zero: Prioritize.

Many times in my life, I've sat down (or lay down, or stood somewhere, or swam or something, take your pick) and thought for quite a while on what I want to do in life, how I want to do it, why I want to do it, and all that sort of stupid crap.

My answers almost always change - spy, physicist, video game designer, physicist, video game designer, author, physicist, computer scientist, spy, author - but these are really just surface thoughts. I've been looking for a long time for a concise set of rules (a la Asimov on robots) that sum up my priorities in life. Recently, for the first time, I settled on some. I don't know how it took so long for them to materialize (especially given their simplicity), but they finally have and I'm glad for it. I'll likely write a better explanation of them someday, but for the moment I'm just going to record them:

First, I shall search for my legacy, provided it does not hinder my search for Freedom, which takes precedence.
Second, I shall search for Freedom, provided it does not hinder my search for love, which again takes precedence.
Third, I shall allow love to find me. When it does, it shall override all else, aside from concrete and unbreakable commitments.

The specific notion of Freedom here is intended to mean: Freedom to associate with whomever I like, and to think, act, feel, come and go, and ultimately do as I like. Freedom in this sense (particularly the last two qualifiers) require that I have a certain degree of Power; that being Power over others, through money or some other means. I will go into it in depth at some later point, but suffice to say, I've settled for the moment on what may be naive or foolish, but are satisfyingly concise and complete priorities.

I would advise anyone who wants to be productive, happy, and fulfilled to do the same. From the moment I settled on these things, I have felt a wondrous sense of purpose. It is allowing me to live better, by placebo or some other effect, and I am grateful.

Along with this prioritization, I realized I do indeed enjoy writing and desire greatly to be a writer. That's something I feel you can do about other things and while you do them, which is a large part of why I am documenting this process. Allows me to output my verbal diarrhea into (haha) digestible form.

Anyway, time for Step Zero Point Five.

Step Zero Point Five: Decide to actually do stuff, and, Actually do stuff

Priorities are great, but until you start _acting_, they don't really mean squat. There are always excuses and reasons to put off working on your dreams, but you need to find excuses and reasons to go get started _right now_.

My excuse is that I had toe surgery this afternoon. It's left me bedridden for Thursday and Friday, which means I have from now (Thursday at 3 AM) until Sunday night to get started making my foundation. Once that foundation is there, once the process of storing and working on ideas exists, I'll be able to go back to my hectic day to day and incrementally tick away at my dreams until I again have more time to invest.

So find your excuse - if it's just a weekend or a sick day or a snowstorm or if you really don't have things you need to do, just prioritize and start acting.

A lot of people feel like acting means taking big noticeable steps - and I fear that might lead you away from planning.

Planning may not be for everyone, but I really feel that a good plan is the only sure way to see a task to its end. If you have a bit of a roadmap from point A to point B, you will have a much easier time getting there than if you simply declare your intended destination and begin walking. Your map doesn't even have to be correct; the map just has to exist. This is a lot like grocery shopping. If you make a list and then show up, buy the contents of the list and leave, you can shop in a timely manner and not waste money. You can always come back if you realize you missed something. On the other hand if you just go into the grocery store because you know you need food, you could spend 2-3 hours and come out with things you don't need or even really want, but purchased on impulse. Worse yet, you may forget a large number of necessities and have to return anyway.

So the message is: (god I take a long time to say simple things) No matter how busy you are, find time to start doing things.

Even if you only make a plan, that is at least something to follow later. The important part is beginning, because that's the first step toward finishing.


Actual Steps:

Step One: Make a folder (or organizational unit familiar to one's self)

When I want to do something, or think of an idea, or make a plan, I often jump into my bare bones text editor and just start typing. This is a good habit, and I highly recommend you do the same. Some of the nice things about this are the quickness and lack of distraction (ie. no ability to mess with fonts, not much going on with margins, spacing, anything crazy like that. Just you and your text), and the ability to start throwing #'s or /**/'s in, name your file .sh or .c or something, and have it be compilable.

Some of the downsides are the lack of organization this leads to - I am a man with a folder called "Text" - and it is several gigabytes of unorganised small text files I've accrued over time. This is a problem. Perhaps I should write a program to fix it? Now would be when I post in my idea blog, once it's created - I digress. (Added later: I put that in the idea blog)

The best way I presently know to organize something is to put it into a folder structure and use a sort of naming convention.

So that's what I'm doing here. I named the inital plan "One", because it's my starting point, and I saved it in a new nearly top level folder in My Documents (yes, Windows at the moment. Eck) named "Awesome", because this idea/its execution will hopefully be so. This text will be saved as Two and so on, until I can think of a better convention or am done. I will be placing these texts into subversion soon as well, so that I may have a history of revisions of this project.

The over-riding message of this step is to maintain a level of organization. It is a tight-rope walk between being a cumbersome hindrance, and not even being worth your time, but try to find a scheme that works for you. Such a scheme should allow you to come back and ask "what the hell was I thinking?", then to respond, "Oh, right." It's a nice feeling, when that happens.

Step Two: Document Incessantly!

I began writing before doing anything other than coming up with the idea to do this. This should be a reproducible experience, and I want to be able to have information about every step of the process. This means writing a lot, writing often, and saving everything. I could have just written down 2-3 things to do and gone to do them, but I would likely have gotten lost somewhere along the way, forgotten my purpose, and gone to sleep. Now I have a project started, and I cannot wait to continue. Writing allows ideas to take form, and the expression of those ideas allows you to improve upon and better understand them before you actually need to start dealing with them.

It's a good idea even if you suck at writing. It will make you a better writer. A good process is to write approximately a page, then go back and do a quick edit over your work. One of the best editing methods I am aware of is reading somewhat aloud. Your writing should be easy to say with a normal meter as if in a conversation. If you get tripped up a lot or can't figure out the right pacing on how to say a sentence, then it is likely too complicated or has an error in it.

Step Three: This is where the work begins. Blogfinding!

I want to open up a blog or two. I was inspired by this guy: http://benjamin-meyer.blogspot.com/ who, on that personal blog, has a link to a different blog he runs, http://ideasfrommydreams.blogspot.com/. First off, that's a cool blog as it is. I regularly get kickass ideas in my dreams and that's an awesome way to collect them. Second, having very purposeful blogs is a good idea in its own right. It sort of matches up with the Unix philosophy of many small, specialized components optimized and designed to work together, and be very good at one thing each. A person could have a dozen places to keep very specific things, and that is where I'm going with this. I plan to put up a blog called "Awesome" or something to that effect, where I'll post these notes and my progress in this project, then also a blog called "Todo" where I can post todo lists and modify them when things pop up, and finally a blog called "Ideas", that's not just going to be ideas from dreams but any time I have a decent idea I'll pop the blog open and toss it in there. These will not be primarily kept on my home server because my home
server is dubiously stable at best - and these are resources whose existence I want to rely on.

None of them are necessarily that original, but originality isn't what I'm aiming for. I'm aiming for function.

So now I've got to go set up these blogs. My plan is to find out what technologies are offered for free blogs, what people think of them, and then to rapidly (ie low setup time) open each of them.

Step Three A: The Search.

I'll compile a list of blogging technologies first. Using Firefox I'll go to google, and type in "blog providers".

Some results were:

http://www.domainmonster.com/editorials/blog_providers/
http://petrona.typepad.com/petrona/2007/01/an_overlong_pos.html
http://www.rssblogsubmit.com/blogging-free-providers-hosting.php

Step Three B: Results

The gist is:

Blogger, WordPress, TypePad, LiveJournal, or a Yahoo/AOL/MSN sponsored variant. The general opinion seemed to be that Blogger and WordPress are the best. Reasons for each seemed variable. Blogger is owned by Google, which can be a Good Thing or a Bad Thing, but I'm not really taking a stance there. I'm pretty sure I already have a Blogger account, so I may just head back there to minimize signup/setup time.

Step Three C: Rapid Deployment (haha)

Almost 20 hours have passed. I spent most of that time asleep and working on things for SOCIS. However, I have set up 4 blogs under Blogger, and I am about to post this collection of text as a new post. Good progress. Maybe not so rapid. Also, it turned out I didn't want to use my old Blogger account, so I made a new one. It's very easy - if you have a gmail account then you essentially just log in and choose a layout, and you're there.

Looks like I'm almost ready for Step 4: Decide what to do.


Just a quick recap with maybe a slight look forward:

0. Prioritize.
0.5 Actually do things
1. Organize First
2. Document During
3. Set up infrastructure, invest time and thought
4. Sketch some goals out, choose one, draft plan to get there
5. Execute on plan (while documenting)
6. Reflect on success/failure.
7. Goto 4. Repeat until satisfied with life.
8. ????
9. Profit!

Yeah, that sounds good. Onto Step 4, baby!

Situation, Goal, Plan: A Good Start

Situation:

I am a second year Computer Science student with a bit of time on my hands and a desire to be productive.

Knowledge*:

Use/installation of Linux OS and Windows XP
Use of C/C++(sans STL) and Java programming languages
Use of SVN

Okay, that's a start.

Goal:

Develop something cool. Learn a lot. Create the tools and develop the processes necessary to continue developing cool things.

Plan:

Create a blog called Todo. Create a blog called Ideas. Write out 5-6 detailed schemes of things I would really like to do, then analyse them to figure out what would teach me the most/be doable first. Choose it, do it. Document everything along the way.

Cool!

*knowledge: These are not the only things I know, but they are the sole things I know reasonably well that I can use to be productive.

An early explanation

I recently decided that I would like to do things.

In the spirit of my decision, I am doing something. Here.

It may be worthwhile, it may be longstanding. It may be flighty and pointless and equivalent to a tribute to whimsy. Only time will tell. Fortunately, time is something that (at the moment) I have got, and I am choosing to invest it here. May it pay off well! Please come along for the ride if you wish, but I make no promises.