Thursday, May 19, 2011

Some summer goals

I have to limit my expectations for the summer. Getting married is taking up all of my free time. I am hoping that between late August and December I'll make lots of progress but until then I'm stuck only being able to squeeze in maybe 30 minutes a week actually coding.

A reasonable goal that will unlock some new projects is to get a handle on dynamic and shared libraries. I've used shared libraries that I like to during compiling, but only because I'm following instructions - not because I know what it's doing.

I think I should make a simple function that just adds two numbers together and try to put that into a .dll and then write another program that dynamically links to that .dll and can use the function. The examples I've seen so far use really unfamiliar data types and macros but it might be Windows-specific stuff that I wouldn't need. I dunno - it looks scary.

click

I think I wrote about this a few months ago, but I had more thoughts on it. I wrote a program at work to play a click whenever certain things happened in the data acquisition system. These things happened fast - potentially every 800 microseconds although realistically it's not that fast. Maybe 4-5 milliseconds at the fastest? I should look. The point is that the Windows function I was using to play the sound was slow and calling it faster than it could respond created unpredictable results - that is to say I'd try to play two sounds before the first one was done playing. It SHOULD have supported this (it had a flag you could pass to allow overlapping) and to some extent it worked but the behavior was inconsistent. I wrote the same program in Matlab with Matlab's function for playing sound and it behaved rather well.

This kind of irritates me because I had expected the C program to perform better. The bottleneck is the generic PlaySound() function I was using (part of the Windows SDK). I want to rewrite the program with SDL's sound playing libraries.

There MIGHT be a chance I'm just doing something stupid that's making it slow. Oh, the other crappy thing is that I can't just play a click - I had to make a .wav file of a 0 to 1 edge to be my click. I spent forever trying to figure out why it wasn't working and it turns out my .wav file was too short. I had to play "guess and check" to see how short I could make it before it stopped working. The minimum sample size wasn't documented anywhere I could see. I forget what the end result was.

Monday, May 16, 2011

ah, tech

I was pondering updating my Ubuntu install that I run through VirtualBox to 11.04 and debating the consequences. Then I remembered that it's a virtual install... I can either take a snapshot and then roll it back to that snapshot or just install another Ubuntu OS on the side. It's a freaking playground with zero consequences (well.... disk space).

Kind of makes me wish I had a spare XP license sitting around. Wait how does that work with virtual installs?

200

200 posts, cool!

I did some more of the GTK book. In the spirit of full disclosure I skipped a minor part about packing buttons in a vertical pane one way instead of the other. It seemed somewhat redundant. I have a feeling the self test part of this chapter will require that knowledge (if the prior chapter was any indication of how those tend to go). Anyhow, section 3-3 was taking a gtkcontainer and packing in "panes" separated by a vertical line that you can grab to resize the two spaces. Cool stuff (not screenshot-worthy, however).

The next section is about tables and I think this will really get me going. Finally it's getting into laying things out and making something that looks like a UI.

EDIT: Ok, screenshot: http://i.imgur.com/6QvgV.png

Friday, May 13, 2011

Old problems

I had a funky dream last night about taking a test in a math class and realizing I didn't remember anything. That basically sums up my college experience in mathematics but it shook me up a bit and got me thinking. I have an old calculus book sitting here and I wonder if it would be worth my while to flip through it a bit. I've toyed with the idea of tackling other topics I've struggled with in my learnin' years. My programming has slowed down because I'm doing enough Matlab at work to keep me from not wanting to mess with code at home.

If I remember I'll take the book home (it's sitting up here at the office for some reason) and see about it.

Wednesday, May 11, 2011

29

I should change the above description of the journal because I'm not 28 anymore. Also, the terms of the project, to be C literate, isn't very good. I consider myself C literate now in the sense that there aren't a lot of functions/syntax/words/operators that are unfamiliar to me. The knowledge I lack is comprised of advanced data structures, the mathematical rigor of optimizing code (Euler project showed me that), and the finer points of WHEN to use advanced concepts. It's like I know all the words in the English language but can't write above a third grade level. I can get the job done but it's not going to be elegant or optimized.

Not that I'm complaining. I've gotten pretty far in the past year.

burp

I've been doodling a bit in SDL but nothing post-worthy. It's mostly just little modifications to the example program so that I can figure out what controls what. I'll back it up and start slow because I don't want any of the functions for initializing the system to be a mystery.

I really need to get through more of the GTK book so that I can write a few test programs at work.