Friday, October 29, 2010

FSOSS!!

So today was FSOSS (amazing so you know, you should have been there!). I went to Evan Weaver's, Dawn Mercer with speakers: Ken Ono and Mike Hoye, David Humphrey, Cathy Leung, Scott Downe, andd... the guy from Mozilla... Matt Thompson, I think (Disclaimer, I'm dumb and thus cannot be held accountable for my spelling or logical errors).

During Evan's we heard about the academic background of open source and how it got started at the school, Dawn explained how financial breakdowns for funding for these companies, and how to obtain grants (numbers hurt my head...), David talked about audio components, Cathy talked about the game jam results from Wednesday (which I'd signed up for and not shown up for because, once again, I'm a moron and thought I had signed up for her Friday class and was extremely upset when I realized I'd missed the class... just about cried in class, felt bad too, Cathy looked a bit mad at me :( ...), Scott talked about boring stuff (kidding, he talked about the stuff he's been working at during his work term at CDOT, which included a puzzle he made by setting a video into a grid, breaking the grid and scrambling it, it was pretty stellar), and Matt talked about Mozilla and it's fight for world domination... or at least world web domination. It was pretty neat, how the web is a community, and we're all citizens there mucking about in a public park, where the park is free but we're responsible for it.... made me wonder whether we should have enforcement in our park, or whether letting everyone run wild is a bad choice? Would it be better to over control or under control any environment? tyranny or anarchy? I don't know, not an answer I have... just wondering about parental controls, etc for children, since they're a huge market on the net.

Dave's presentation, the whole thing about audio components and the attempt to make it visual using images and speech, by use of sound breakdown (both tonality, frequency, etc) and transcribed subtitles, it got me to thinking, if a linguistic were able to dissect sounds into the English language (or any language really) then the videos wouldn't need to be transcribed but could just be run, or run once and then save them over the original video (saved into phonetics, and phonetics saved into exact spelling which is displayed as subtitles, subtitles then translated (I've seen a couple sites on this, not sure about their accuracy)). Sounds could also be saved into colour palettes that could be overlayed over the words in order to describe the tonality of the person (sarcasm, anger, etc) based primarily on tonality and volume (Disclaimer - I'm not sure that this is an accurate breakdown of sound, but it seems like something I could find out, this is just my best guess).

On a different note, my brother has started doing game design at RCC (traitor, I know!). His school stresses learning programming though (woot woot!), and this has been great. Not only do I have something to discuss with my hermit brother, but I've been able to teach him about it (loops, if else, switches, etc), and it has reminding me of the basics, and I'm really kind of enjoying it. I also had someone in the open lab ask me a question on C, and the things students can come up with as mistakes, its phenomenal! You really have to know your stuff to see someone else's mistakes because it's something you'd never even consider doing, so you think, well maybe... but no. Just no. They're sneaky those new programmers, sneeeakky.

There was something else I wanted to discuss... I forget now though, its been a long day. Started with a cup of tea made with coffee instead of hot water, and ended with killing Bambi... :( It was a dark road, and it ran at our bus (not kidding).

Oh I know what it was! DecimalFormat! Oh I love DecimalFormat!
In java if you write...
//http://www.java-forums.org/advanced-java/4130-rounding-double-two-decimal-places.htm original source of this...
DecimalFormat twodec = new DecimalFormat("#.##");
return Double.valueOf(twodec.format(temp));
this returns a number with two decimals spots? Why yes it does! Its that easy! BOOYA!
Thank you good sir who posts awesome code like this! You rock apple sauce!

Well, its bedtime for me, long since past! Love you all! Have a great weekend and party hearty!

Saturday, March 20, 2010

Virtual Muddles My Mind

Alright, so small dilemma... I have to declare an instance of another class (BField) in my class (BForm)'s constructor, this would all be well and fine if it weren't for virtual. In BField's constructor (it has no empty constructor mind you), there is something that references (void* data = (void*) 0) to be passed in. This is reference to a virtual member of BField's class (virtual void* data()). So, when I try to add something in to that position from BForm with my BField member, I get error C2259: 'BField' : cannot instantiate abstract class. Or rather, I assume this is what causes it.
So instead of this:
BField* _fld[MAX_NO_FIELDS];

_fld[_curidx] = new BField(row, col, "problem here-Virtual Element", framed);

I have to figure out how to override the virtual element of the BField constructor. I'll come back to this when I figure it out. Go Team!

Wednesday, March 17, 2010

Casting

I bloody hate casting. I have avoided it until this point.

I spent about half an hour knowing what I wanted to "return" from one of my functions, but getting a compilation error C2440, something along the lines of can't change type1 into type2. Took me a while to get why return *this was attempting to return an instance of BForm (the class I had declared and was working in) instead of BField, which was the type I was supposed to return. It was strange also because I had thought I had previously attempted casting for BField, but I suppose I must have forgotten the &. Still.... Damn you casting! I will conquer you and CRUSH you between my toes! Victory!!!

So just to recap:
BField& BForm::operator[](unsigned int index){
return (BField&)*this;
}
does nothing, but still, VICTORY!!! *kicks casting*

Friday, February 26, 2010

Difficulties

So for being such a social creature, I find blogging very difficult, but I shall attempt this again.

This semester in OOP has been... different. We've spent the majority of our time working on learning how to use SVN. Although this has been interesting to see a new program, and I love being able to spy on my team mates progress, I am having difficulties deciding exactly what our "tags" folder should hold. Even when I have my function complete, I'm tempted to wait and see how this will interact with the other group members functions before posting it in tags and committing myself to the exact structure of my function. Ah well, I suppose I need to learn to be more adventurous.

Now to the meat and potatoes: how exciting are macros?! You want to make a quick little program that sums up 2 integers but don't know what they are? BAM! #define sum (a+b) and then just call it in your little main program with like c = sum; and there you are! Just like that... BAM!

Also, I love this whole #ifdef sum #else #endif stuff too. I don't have to deal with other people's main, just #ifdef PERSON == Carolyn (having first defined PERSON to hold a member called Carolyn), and there you go, my space, M-I-N-E! I love it.

Oh yes, and last thing I learned: don't trust friends. Don't trust friends because they'll stab you in the back when you least expect it and spill all those juicy details of your code. Yes! I am talking about friends as a part of your Classes. Don't be so silly, real friends shouldn't stab you in the back, unless they're axe murderers, and then its really your fault for not watching your back.

Alright, so blogs don't seem so bad, and I should do it more often so they're not THIS long. Sorry about this... no I'm not, I'm lying.
Mwahaha! I'm off!
Until Next Time!

Monday, January 11, 2010

Test

This is a test out of a blog. I have nothing really to say today, its too early.