Wednesday, December 23, 2009

Hard to settle

So far I've played with Python, learned some piano, written a program to help me learn large-number multiplication, played hours of Ogre Battle 64, and watched the first season and a half of Weeds. Also seen friends, walked many kilometers, and slept gratuitously.

I think a haircut is in order. Maybe not today, maybe the 27th or so. Also, laundry.

I'm going to move forward with watching the SICL videos, and then dive into the Graphics/Language stuff. Math can happen in my spare time, as can piano. I've also got a phone-interview for an internship today. I'm not certain quite what to expect - algorithms and code-related questions, a history of myself, or just good discussion. I hope it goes well.

It's been wonderful to have time not committed - when I decide I want to do something, I can generally just go do it. I've learned a lot and I feel much happier than I have in weeks.

I also fixed up my home-server's webpage, have read a bunch of my various books (Contact, The God Particle, the latest Wheel of Time book), listened to a TON of the music I've accrued over the past semester, and played with some VMs. Installing Slackware is an interesting experience to say the least.

I'll post back in a few days (likely just post-christmas) about my progress on SICL, Python, Graphics, and my C-spitting-extensions to C.

Wednesday, December 16, 2009

A flurry of activity

Well, that's another semester past.

I have from right now until January 10th to myself, effectively. It's time to decide how to use it.

So from what I can tell, my options are:

Graphics
Languages
Base Skills
Something Complex

Graphics would be making computers do graphical things for me and also making graphics myself. Playing with Blender, with the GIMP or Photoshop, with Paint and maybe Flash, reading about colour-theory and how to paint a perdy picture. I'd also be drawing a lot, and reading about basic art stuff. And of course, playing with C/OpenGL to make the computer do cool things, and learning related math (Matrix Algebra, anyone?)

Languages would be reading about and learning Lisp and Python through the development of simple (and slightly more complicated) projects with them. I would watch the SICL videos from MIT's Open Courseware, generally get a better feel for Lisp, and I'd just do stuff with Python. I would like to implement my scope/stack/reference/object stuff for C.

Basic Skills would be math and physics and chemistry and maybe biology, just learning voraciously over the break -- very largely just improving my mathematical skill and comfort level. I would also be spending a lot of time working on music and some basic technology things, like awk/sed and being a better vimmer, using the full extent of regexp's and scripting.

Something Complex would be choosing a project - I'd spend a few days choosing, then go through a design phase and build myself something good. Something that I could sell, or at least use in my day to day life. Maybe this could include working on an Open Source project, or attacking Sam Altman's company Loopt, which just does not seem to be doing a good job with my idea.

Anyway, one of those four things. I'll have to ask myself "Where do I want to be on January 10th", and my answer could be "I want to walk up to a Piano and lay down the driving rhythm line from 'Don't Stop Me Now'.", or "I want to be able to take 4 files of similar data in disparate formats and spit them sorted into a single new file, every 10 seconds or when the file exceeds 100 lines, and I want to be able to write the thing to do it in about two minutes.", or maybe "I want to be able to spend a weekend and make a simple game, with my own pixel graphics, my own physics, my own everything, and run it on Linux or Windows.", or maybe "I want to be able to do what I want to be able to do. In Lisp. (really poor recursion joke)". Ooh, or, "I want to be able to read a Wikipedia article on a mathematical topic and not have it go over my head before I'm halfway down the page."

So, which of those sounds best? Or at least, sounds like the one I'd like first? I'm going to spend an hour or two thinking about it.

Monday, November 9, 2009

The next few weeks, schoolwise

Networking,
Modelling,
3750,
and a tiny bit of databases

Networking I've got a good mental start on. I'm agreeing so far with Martin on using a linked list - I considered just making a big buffer and filling it in using some neat math, but that...

that sounds complicated. Easy to write out, hard to set up. I'd much rather save each datagram into a list and then sort the list, and iterate through it to write it out/test whether or not stuff was received. So I'm going to set up my listeners, send out the request, read everything in, sort and check my data (likelier I'll sort as I read), rerequest what I haven't got, repeat until I've got everything, then write the data out. Cool.

Haven't looked at modelling or databases yet. Will do so soon.

Have a meeting for 3750 tomorrow, we'll have discussion and such, and get back on track.

Alright, school is looking manageable. Modelling and Networking are both due circa Nov 26th, DB will be sooner, and 3750 is ongoing and constant. This iteration (final) is due next Thursday.

Then Finals!

Tuesday, November 3, 2009

TA ta ta

Just dropping a note whilst TAing:

registered for my courses for next semester: phil: critical thinking and phil: intro to metaphysics, also cis: digital systems, cis: computer graphics, and cis: compilers -- compilers isn't actually signed up yet, I have to get waived in like everyone else.

finally got "The Great Hunt", book 2 of the Wheel of Time back. I'd left it on the plane on the return-trip from Tucson. Also bought "The Light Fantastic", because I freaking love discworld.

Started reading manga. Got through a volume of Legend of the Strongest Man: Kurosawa last night, and I've started on Trigun. Downloaded Gambling Emperor Zero v1 and 2 as well. I'm gonna check what sort of things I find at the end of the internet for marvel comics now. I knew I liked this format - just never got into it.

It's a time of great opportunity: Networking and Modelling aren't due until late November, and there's no more midterms. I have only to push forward on 3750 and get a decent (>75%) mark, same with databases, and I can safely devote some time to side projects. I'm looking at you, Awesome.

Which reminds me: What the hell, blogroll? I've posted since "Still Working". I posted last night. I posted a week or two ago. Yet you insist on showing that I haven't worked on my project in 3 months. I've remade the blogroll, deleted caches, tried alternate URLs, it always pulls up some ancient thing out of the XML. confusion++;

I'll try to figure that out

Monday, November 2, 2009

Breaking the rules

It's 2:03, and I promised myself about a week (maybe a bit more?) ago that I would absolutely fundamentally definitely start going to bed by 1 as a soft deadline, with 2 as an absolute final hard deadline. By 2 AM, I would be lying down in my bed, trying to sleep.

Well, here we are. 2:04.

I'll be done this in a few minutes, it's okay. I feel like this quarter hour of blogging is more important to me in the long run than this quarter hour of sleep. I'd rather look back and remember this, than vaguely remember a dream I may have had at some point in the future. So let's move on! (this was the title's namesake by the way, I broke my new rule. This isn't the first, the last, or even a notable time I've done so). So let's move on to a few random tidbits worth mentioning.

Justice is awesome. I've known this for a while (I started listening in earnest back in the summer), but some things, like their unreleased fabriclive mix, are just staggeringly good.

I became vegetarian after being vegan. My original reasoning for switching to being vegan was that we have no right to hold any dominion over any creature, aside from the thought of "might is right", which isn't at all universalisable, or even really that reasonable at all. A friend of mine (Andrew Stoneburgh) suggested the argument that we are actually being farmed right now. What if we're in the matrix, and being farmed, would I be cool with that or freak out about it? And after some deep consideration, I'm really okay with it. I am fine with that thought. Continuing that, if I'm okay with being farmed without my consent, it is unreasonable for me to have a problem with farming animals. I do still have problems with the way they are treated, absolutely. I just don't feel like the very notion of farming is evil or wrong, which brings use of animal products back into reasonability. Still not okay with killing them for their meat though.

Well, that's about it for now. I'm hoping that November will be a good, productive month. I don't have too much to think about scheduling wise, just TAing and assignments at the end, and 3750. Signing up for courses as soon as possible, and OSAP for next semester. Hoping to take Compilers with McCaughan, Graphics with Calvert, and some other stuff or something.

Okay, it's 2:33. Half an hour is enough. Goodnight, world.

Thursday, October 8, 2009

Robyn can't figure out the difference between dependency and composition

That's what you get for a title when I'm writing a brief post at 4:00 AM. You get a snippet of something a confused housemate says regarding UML diagrams.

-- A breakthrough! He has realized that what he is observing is aggregation. Now he has expressed a desire to know what aggregation really means. I can dig it.

I am prepared to believe that there is more good music than I can hear out there, and it's a fascinating thought. Every stone turned brings about a revelation of a musician who leaps not off the page, but out of the speakers? That was a good try at being clever, I guess.

The past week has been pretty full!

I travelled to Arizona on Tuesday, September 29th, to attend the Grace Hopper Celebration of Women in Computing, with my friends Melanie Veltman and Ali Tremblay. Ali and I flew out through Toronto and Dallas Fort Worth to Tucson, where the amazing weather embraced us (so warm! at night even!) and the intriguing desert flora crowded in to be awesome and bizarre. 20 foot cacti and strange green trees, spiny little bushes, and prickly fuzzy bulbus things were scattered about!

That was just the environment. The conference itself took place at a right-fancy hotel nestled between some tall (cactus covered!) hills on the outskirts of Tucson. Google, Microsoft, the NSA, Facebook, IBM, Intel, Amazon, Intuit, Sun, many more businesses, many universities, and thousands of attendees from all over the world at various levels of academia and industry attended the conference, to celebrate the role of women in the field of computing.

I had the educational and intriguing experience of witnessing an inverted female:male gender computer science ratio while in attendance. I was not on the receiving end of hostility or under attack, but it was at times lonely, isolating, or embarrassing. Being the only male in a room while a gender issue is discussed is bizarre - you can feel all eyes glancing at you. I may have abstractly understood what it is like to be a woman in a male dominated field before, and while I cannot claim to have a full understanding of the experience now, I am definitely more learned.

Please don't misconstrue this as me saying I in any way had a bad time! Everyone I met was intriguing and friendly. I made some new friends and we explored the conference and some of the foothill paths around the hotel. The Grace Hopper Conference is an unbelievably friendly and supportive place - everyone seemed interested to learn about one another. I feel lucky to have attended and to have met some of the most interesting people in the world - I'll definitely try to attend again.

And oh, the weather! This reminds me though, I have to post photos I took.

The time since our return has been one of the least sensible in terms of sleep schedules that I've ever held during regular class time. I have not fallen asleep before 7AM on any of Saturday (after flying in), Sunday, Monday, or Tuesday night. It's Wednesday and here I am, 5:08 AM, wrapping up my evening. I'm preparing for a whopper of a sleep at a projected 4 hours. There's quizzes tomorrow, assignments and deliverables due, friends to visit, movies to see, then friday. Which is TAing, more assignments, and then probably heading to London for Thanksgiving. Which means I won't be around home for a weekend until the 17th. I can't wait to see my family!

Final notes: I'm trying to be vegan. Have been for a week or two, it's going okay. Causes a lot of moral self-reflection. I still think meat and animal products are delicious and I wish I could eat them, but I must not due to the moral imperative.

Hopefully I start a new trend of regular blogging.

Tuesday, August 25, 2009

I'm just gonna leave this here

theme="Whatever magic does not already exist in nature, we have the power and perhaps, the duty, to create."


for later, when I need it

Saturday, August 8, 2009

Typing can be enjoyable for the sake of it

Every once in a while, when you get into a certain state of mind, you can easily think of what you want your hands to say and just let them fly acrsoss the keyboard for an extended period of time, as I"m doing now. It's cathartic, really, kind of a close bond between you and the machine. You just think, type, and try to take the buffer out between. Don't even look at it - at the keys, at the sctreen, just close your eyes and let the text spread out beneath you like a warm safe cloud.

I find I run upon that certain style of thought very early in the morning, when I still exist in a day the rest of the world has moved successfully on from. Living in the past, you might say, puts me into a place where my disjoint mind can do naught but want to spout out a never ending stream of ASCII love.

There are those who would take the humorous phrase, "diarrhea of the mouth", and appropriate it for the keyboard: "diarrhea of the hands" or "fingers", which manages to at once make the whole thing less and more disgusting. I am not one of those - but I am aware of them.

I saw 500 Days of Summer last night, and Terminator: Salvation (on to very different factors of form) and enjoyed them both (Terminator less). Perhaps the Esquire Article is onto something with a supposition that Sam Worthington is a very great actor (he fared well in McG's slaughterhouse, as did Anton Yelchin. But Yelchin always fares well.), and I was positively enthralled by the work of Marc Webb, Zooey Deschanel, and Joseph Gordon-Levitt. Funny and watchable, well composed and endearing. I've also finally called Joseph Gordon-Levitt by his actual name, instead of (I confess!), "that kid from 3rd rock" or "angels in the outfield". I'll strive to keep it up.

So I'm done now, my hands are no longer playing that mad piano game with my mind and are starting to make typos at merely par. Good morning to you, good night to me, and let's all have a chat sometime later this weekend yes?

Indeed.

gosh italics are fun

Thursday, August 6, 2009

Whose laughing now, Twitter?

Looks like I found an alternate means of getting my stupid messages out to the world just in time, before the great Twitter Outage of ot-nine.

Working hard, will write some fiction tonight. Summer party tomorrow, went to a tech talk earlier about Testing. Got a rad book, "How We Test Software At Microsoft". The book was written by the three guys who did the presentation, Alan Page, Ken Johnston, and Bj Rollison, who all do neat Test related stuff here at Microsoft. They're pretty cool guys, and illuminated the topic magnificently.

For those who don't know, Microsoft splits production up into "feature crews" which have a Developer (Software Development Engineer), a Tester (Software Development Engineer in Test), and a Spec-Writer / Designer (Program Manager), who all work together to create a feature. This sounds like perhaps a trivial detail from the outside, but it is a vital piece of our culture. Think about how important testing software is, and how undervalued it tends to be. Now think about your perception of "oh god microsoft makes bad products lawl". Now think about the fact that they employ about 11,000 SDEs (devs) in total, and about 9,000 SDETs (tests) - there is nearly a tester for every dev in the company. Testing is taken very seriously here, and regardless of any person's opinions on Microsoft or its products, this is a powerful defense against bugs and defects. Complex software will have issues - and our testers (in conjunction with devs, and pms) do a damn fine job of sorting those out and producing high quality software.

Anyway, that's enough of my hivemindspeak for now. Tried ModPlug recently; where has it been all my life?!

Tuesday, August 4, 2009

That Ambiguous Comma Operator

The ternary 'conditional operator' can be tricky sometimes. If you've ever looked at The 12 Bugs of Christmas and been frightened off by them, congratulations on your humanity.

After seeing a particularly confusing piece of code today, of the form:

func(a, b ? c : d, e);

I began to ponder whether func takes 2 parameters or 3, and what the heck I should assume is going on here. It also (for the first time) made the question of "does d,e evaluate to d, or to e" relevant to me. So I wrote a test program!

First, let's see what happens when we use commas in the ternary operator during assignment:

num = v0 ? v1 : v2, v3; /* each of these is a variable vn where n is the value */

This evaluates to 2. Simple enough-- let's move on.

What happens within 'func(0 ? 1 : 2, 3);'?

This case ends up being straight forward. The comma is taken as part of the parameter list and not as part of the conditional operator, regardless of the prototype of the function. I'd started out thinking that whatever works might be done (if func took 2 ints, this would treat the comma as a parameter separator, and if func took 1 int, it would be a comma operator inside the condition) - but it does not. The comma is strictly for parameters in this case. Neat - but I'm still curious what would happen to it used as a comma operator here. Should be the same as before, right? Let's force it to be used in the conditional and find out.

func((0 ? 1 : 2, 3), -1);

This is the function I tested. The second parameter (-1) isn't necessary for anything other than illustration, and so that I didn't have to rewrite the function. 'func' Now becomes meaningful to specify: it takes two ints and prints them out in the left-right order in which they were received. This is the output:

one, two: 3, -1

Wait a minute. This time, the comma operator's right hand value was treated as the expression's value! That's not the same as before! What the heck? Let's check the spec*:

3.3.17 Comma operator

Syntax

expression:
assignment-expression
expression , assignment-expression

Semantics

The left operand of a comma operator is evaluated as a void
expression; there is a sequence point after its evaluation. Then the
right operand is evaluated; the result has its type and value./43/

Example

As indicated by the syntax, in contexts where a comma is a
punctuator (in lists of arguments to functions and lists of
initializers) the comma operator as described in this section cannot
appear. On the other hand, it can be used within a parenthesized
expression or within the second expression of a conditional operator
in such contexts. In the function call

f(a, (t=3, t+2), c)

the function has three arguments, the second of which has the value 5.

Forward references: initialization ($3.5.7).
My own emphasis is added in the 'Semantics' paragraph. Clearly the right-hand operand is the one which should normally provide the value. What happened in the assignment then, which caused this to be reversed?

To the best of my knowledge, the answer is actually inside of the 'Example' paragraph. I quote,
in contexts where a comma is a
punctuator (in lists of arguments to functions and lists of
initializers) the comma operator as described in this section cannot
appear.
So the issue is that this comma is (again) not treated as part of the ternary conditional operator, but treated as an illegal comma operator floating around on the far right of an initialization. My guess is that this
If a ``shall'' or ``shall not'' requirement that appears outside of
a constraint is violated, the behavior is undefined.

(from the definition of 'undefined behaviour')
is what is allowing the situation to occur. A comma can not be placed within an initialization list and be treated as a comma operator. So if you force that to happen... whatever the heck the comma and the people who wrote the compiler have agreed on could occur.

In this particular case, it looks like what they've done (this is in gcc) is just ignore the comma and everything after it until the semicolon. Thus in the line

num = v0 ? v1 : v2, v3;

num evaluates to 2, and the ", v3" just doesn't enter the picture. Giving us our unexpected result.

Crazy cool.



* You may have noticed that this is not coming from an official ANSI or ISO standards site, and if you're particularly astute, you may have also noticed that this is merely a draft of the C90 spec. That's because I found it first and feel like C90 is good enough. But I checked the C99 spec as well (again just a draft), and the only modification is an explicit statement that a comma operator does not yield an lvalue. I only looked at drafts because ISO and ANSI are mean and don't like people to see specifications without paying money. I'm cheap, so our learning is lessened. :P

** What? a double star? That's right folks, you get a bonus note! During the writing of this post, I realized that my test program was being rather silly. I made several variables 'v0', 'v1', etc to hold simple int values. It was only while writing that I recognized I could have simply used '0', '1', etc, and that this would be less confusing to read about. I originally wrote

num = 0 ? 1 : 2, 3;

As the first expression, which now uses the variables. I didn't think this could possibly cause any difference - and was wrong! When writing a second program later to do some different tests, I used my newfound sensibility and bypassed the creation of variables. I was given the following unfriendly error code:

newterntest.c:5: error: syntax error before numeric constant

It took just a moment to recognize that this was because of the comma! The comma is (as we've discussed) unexpected and not allowed here, but it looks like this case is obviously wrong enough to the compiler writers that they generate a syntax error before the integer '3'. So whileThis on its own isn't too crazy - the crazy part is that

num = v0 ? v1 : v2, v3;

doesn't even throw a warning under -Wall -pedantic (with or without -ansi as well), while the literal integer actually causes a syntax error. Every other parenthesized use of comma operators in this situation gives at least a "warning: left-hand operand of comma expression has no effect", but our code draws a blank!

General weirdness.

edit: removed the pre/pre tags from the blockquotes. They were there by default, made the quoted text appear in a plaintext-ish font and I felt they added to the post. But in the published version, they rendered underneath the righthand column. So they're gone.

Sunday, August 2, 2009

I'm back.

I didn't forget about this (these) blog(s). I didn't stop posting for a lack of things to post. I didn't lose motivation or stop for any of the reasons I have before. This time I had something else to do that was more important - and I wasn't going to let myself spend time here when I knew I should be there. I procrastinated on it for a long time regardless, and I've finally moved past.

So let's get these cogs a cranking.

In the time I've been gone, I've flown on my first airplane, stayed in a hotel alone for the first time, climbed my first mountain, played my first game of whirlyball, had a highway cleared so my friends and I could ride along it, bought a second laptop, started an internship at Microsoft, and spent my first whole month (well, more than) in a different country. It's been quite a journey - and it's not nearly over yet.

I can't wait to be back in Canada, but I've got the rest of my work left to do, my first time skydiving to have, PAX to attend, and who knows what else? I miss my friends and family, but I'm having a good time here and I've made some new connections too. I can't say much about my work other than that I'm working on Office, and I'm coding a small feature that'll be present in a few of the major apps in Office 2010.

I've been learning lisp, listening to a lot of music, learning some foundational graphic design, and working a bit on Awesome. I'll update again soon; I have things I can show - pictures and personal work and such.

Catch you on the flipside.