Thursday, December 5, 2013

Reflections

So I've finally got some free time and I really don't feel like studying for calculus so here I am writing what will likely be one of the last posts on this blog. I'd like to take this post to reflect on the subject this blog was suppose to focus on CSC148.

I started the course with practically no knowledge of Python and having spent about a year programming in Java. This made the first month or so rather crazy for me considering this was my first semester in University and all that jazz. That being said I'm glad I took 148 over 108 because this course has thought me more than it ever would have had I come in with previous knowledge of Python. For one 148 and the entire semester as a general has thought me the fine points of time management. I have never before had so much to do and so little time to do it in. I have a part-time job and commute to Toronto which meant that the entirety of my time was either taken up by class homework or work. That put me under a lot of stress and the demands made on me by that stress have made me grow as a person I think. So ya, wouldn't trade it even if I get bad marks.

Now onto the actual programming stuff. There are a couple of things I think this class did phenomenally and a couple of things that in hindsight don't make that much sense to me. First and foremost, recursion. I was introduced to recursion in high-school, my teacher mentioned it had us do a couple of exercises and then we never saw it again. This meant I had a vague understanding of the concept but wasn't particularly good at using it. When I realized how recursion heavy 148 was going to be I wasn't too happy at first but I've definitely warmed up to it now. You could say that 148 thought me how to recurse. I am now intimately familiar with recursive algorithms and their pros and cons, and sure there's always something new to learn but this has given me a much more solid base on which to sand with this particular problem solving strategy than anything else has.

On the other hand on thing that didn't make much sense to me is how little time we spent on OOP in 148. I mean sure we were introduced to it and we did some stuff with OOP but at the same time I feel like we could have put a little more emphasis on it. Then again maybe I'm biased but I feel like OOP is an incredibly useful tool to have in your programming belt (for reasons mentioned in an earlier post about the topic) and we could have spent a little more time developing it. Maybe 108 touched on OOP and that's why it wasn't as emphasized as recursion but at the same time I felt like when Danny introduced it he was doing so with the mind that we weren't meant to have this tool yet meaning 108 hadn't covered. Anyway I love me some OOP so maybe I'm just sour that it didn't get the attention I feel it deserves.

The other thing we spent an extensive amount of time on was Binary Trees. On this I feel like the course did a very good job at teaching us how to work with these trees, how they function their pros and cons and all that good stuff but one thing I think it missed were practical applications. And I understand that the pattern crops up everywhere in nature but it would have been nice to see examples of where binary trees could be used in actual programs. We had the example of regex's but I'm not sure that was particularly effective in conveying the utility of tree structures and where they're useful to have.

Which brings me to my last comment on the course and my learning. This one is intimately related to Python as a language. I found that in the course of learning how to work with Python and the various rules and conventions around it I also learned a lot about Java. There were concepts in Java like private vs public methods and classes and static vs non-static methods that even after a year of battling errors related to them I could not grasp, weather it was because of instruction or myself I'm not sure but they just didn't click. After having these constraints removed by Python I think I finally understand why the creators of Java added them to their language and the creators of Python didn't.

Python is meant to be this open ended language where you can kind of do what ever you want to do and you rely on your own skill to make stuff work. Java on the other hand is this lumbering giant of a language, they don't want to rely on a programs skill to make sure stuff doesn't break down for someone who's good at what they do. They want programmers to be able to protect their software from learners who're still fumbling in the dark and likely to knock over the expensive vase if you don't put it in glass casing so they give them things like public and private and static so they can protect their work and force young programmers to follow the rules not break them. 148 made me see this and made me understand how I might be able to make use of these public and private and static key words in Java which before I had mostly put in because otherwise the IDE would yell at me for it. So, thanks for that, can't wait to see if I can finally make some of my Java stuff work with this new knowledge.

That being said I've had lots of fun this semester and I'm glad I have this experience under my belt. Thank again for your time.

PS: I had a plan on doing a post on AI, I'll see what I can do about that, I might put something up tomorrow if not well Bye~

Friday, November 29, 2013

Sorting Time Stuff

More often than not sorting algorithms seem to be viewed as the first major step to understanding programming after basic arithmetic. They seem to be to some extent the embodiment of what we as programmers do and while this is an extremely limited example of what a computer can and does do it’s in a way iconic. It teaches young and aspiring minds a few very key things to programming. First, speed is important. Second, efficiency is import. And most over looked I think, there is more than one way to solve a problem.

I think a lot of people thing that since computers are math based they must work like math too, and to a certain extent they do. There usually is only one right answer, and it takes a lot funky logic to get to it sometimes. Yet unlike in math, there is more than one way to apply logic to a problem. Sorting algorithms are an awesome example of this. First of all there about 10 standard ones granted some of them aren’t that great but still that’s a lot of different solutions to one problem. Here are three examples:
 Selection sort starts at the top picks the smallest item and puts it at the front then takes moves on to the next position, rinse and repeat. It’s kind of slow, O(n^2), but also pretty simple.

Quick sort does live up to its name with O(nlogn) (just don’t give it a list in reverse order or it’ll be as bad as selection sort). It picks a pivot, arranges the values in the list so that those smaller than it go on the left and those bigger go on the right then does the same to the sublist and it’s sublist and it’s sublist and its sub – you get the point – until everything’s nice and orderly.

Merge sort also uses sublist but in a different way. It divides the original into to as many sublist as it has to until there’s only one element left in each sublist. It then proceeds to merge the sublist all the while comparing and making sure each sublist is in sorted order. It actually works at about the same average speed as quick sort, again O(nlogn) but lacks an obvious kryptonite.

So ya, lots of ways to fix one problem each with varying uses and speed. Also big O() notation: useful thing. It’s kind of annoying when you have to prove it but very good at giving people solid ways to compare algorithms after all it’s kind of hard to argue with graphs and number.


Anyway, that’s about all I’ve got to say about this one, other than comp sci is way better than calc XP

not edited

Vocaloid



So I just finished E6 and A2 and decided I might as well try and write something for this blog – slog – thing... which brings me to a topic I've been meaning to mention on here for a while now: Vocaloid.
Now, I think some of you already know what this is (I've seen Miku floating around here and there), some of you however are going to be sitting there and going "Huh?". For those of you who are here's a brief summary of the thing called Vocaloid and the general culture surrounding it as I see it (if you have other ideas please comment, I'd love a discussion).

Vocaloid is, in the simplest terms, a singing software. No, it's not auto-tune, though it does sound like it to a certain extent. This is a software what essentially allows you to program a the vocals of a song, lyrics, vibrato, dynamics, and all and have the computer sing it back to you.
The original Vocaloid program -created by Yamaha- allowed a person to record a bunch of very simple sounds and using that the computer would be able to sing any song given to it in the recorded voice. They then sold the program as a license to other companies. These new companies, like Crypton Future Media and Internet Co., took the Vocaloid software and created what most now refer to as Vocaloids. They took various voice actors and singer and recorded them creating a vocal library which was then distributed as it's own product.

At this point I should mention that most Vocaloid have Japanese voice banks, meaning they were created with the intention of singing in Japanese. This isn't all that surprising considering Yamaha is a Japanese company despite its success worldwide. There were a few attempts are creating English speaking Vocaloids but they didn't really take to the market all that well and have mostly been pushed into the closet at the moment. There has also been a recent attempt to create a Korean speaking Vocaloid and we'll see how that goes.

Anyway, all the program-y things aside. There is now this software on the market which any song writer/composer can buy and ask it to sing his/her songs but what happens with these songs you ask? Well they go on the internet of course. The most wide spread portal for Vocaloid music is a Japanese video sharing website called Niconico (kind of like YouTube but not really). And perhaps the most amazing thing is what happens after.

The amount of attention this armature music sung my robots gets is completely unprecedented. You name me a Vocaloid song and there’s a 99% chance someone’s done a cover of it. Not only that but there’s probably a piano version, a rock version, a band versions, a chorus version, a videos and a dance in every combination under the sun for any particular song. The amount of creativity and innovation that goes on around these songs is unbelievable. And guess what, no one makes money off it. This is perhaps one of the best examples of art for art’s sake I’ve seen alive this century. Recently there have been some particularly popular song writers and some rare singers who have released albums of their covers for sale but even then they’re still available for download from Niconico for free. Some people would call Vocaloid music cold and robotic, I think it’s one of the most human thing I’ve ever encountered.

not edited

Some clarification just in case, I call any peice of music whose original singer was a Vocaloid, Vocaloid music. I sort of consider that music as a genre as opposed to a singing group or something like that.

Also some songs to YouTube if you're interested: Just Be Friends, Soraru's WAVE and the chorus version of Senbozakura.

Friday, October 18, 2013

Anne Hoy Why

Quick post here. So, while I was coding this week's exercise I figured out how I could have made my cheese moving program work (at least I think I did). This is somewhat disappointing seeing as I can no longer use this information for that project. Well, I guess I could, but it be worth nothing other than my own satisfaction at having solved the problem, which, with my rather limited time due to life is unfortunately not enough motivation to get me to go back and bang my head against that wall again. Anyway, I've gotta go study for my Calculus midterm tomorrow (I am seriously thinking of finding myself a TARDIS and going back in time to convince Rene Descartes against all that mathy stuff). Bye~

Tuesday, October 15, 2013

OOP and Recursion

So, I haven’t had a lot of time to update this blog lately, mostly due to midterms and various assignments. Anyway, these entries are a little late because of that sorry.

Object-oriented programming is probably one of the most intuitive things ever. It’s literally the representation of a thing (whatever that thing may be) in code.  What defines it are it’s parameters and its methods. The parameters are unique characteristics, like colour, size and shape. Methods are the things the object can do, like bounce, run and change colour. One important bit to not get confused is that the difference between a class and an object. A class is the blueprint for an object, an object is one unique variation of the class. Now, the reason I say OOP is intuitive is that -for the most part- it’s how we as human beings tend to organize the things we interact with. We categorise them by the things they have and the things they can do, hence why OOP tends to be pretty easy to understand.7

Recursion on the other hand is not quite as intuitive, at least to me. When people explained recursion to me it made a general sort of sense I could see. I mean why wouldn’t you break down a large problem into smaller easier parts that you can solve the same way you did the bigger part, right? Unfortunately, I discovered that I don’t quite solve problems that way, or rather I don’t do it consciously. When I go to solve a recursive problem I break it down through trial and error for the most part. Rarely  do I sit down and actually think through the solution enough that I would be able to fully understand it consciously, in all of its nitty-gritty detail, which is kind of essential if you want to write a recursive function. Now I’m not saying it’s not useful, of course it is, there’s tons of problems that can be simplified through recursion and the such. Never the less, I still don’t find it as useful and generally applicable as Object-oriented programming.

As a side note, I found the list-comprehensions we learned recently incredibly frustrating because seemed to make a difficult subject all the more difficult for me. True, their incredibly easy to read, which is not something you can say for a lot of code. However, they are also practically impossible to debug once written. The one line of code you use to write the comprehension leaves pretty much no room for internal debugging with which to see what’s going right and what’s going wrong.


Anyway, that’s just my opinion at the moment and who knows maybe by the end of the semester I’ll figure recursion and list-comprehensions out and love them. Anyway, I gotta go now, bye~

Monday, September 30, 2013

Printing and Chip-and-Pin Machines

So, I’m supposed to talk about my Comp Sci experiences on this blog so here’s y experience for the week.




Now I know what most of you are thinking, we don’t have chip-and-pin machines at U of T, and you’d be right. However, what we do have are printers, and I had a bit of a row with it a couple of days ago in which I told it to print and it said nope, piss off. It was rather embarrassing seeing as, if anyone should know how to make a printer behave it’d be a Comp Sci student, right? Now, I’m also sure that using the printers in the CDF labs is nowhere near as complicated as it looks to me now. There was probably one tiny detail left out of what instructions on printing in the PDF labs I found that threw a proverbial wrench in my printing plans and left me whispering abuse at the machinery involved.

I guess, what I’m trying to say here is that my first couple of weeks in U of T have had this same problem iterated over and over again. I know what an Object is and how they work, but why is else if one word. Or I know limits but why does he keep writing (of form blah) instead of just stating the answer. So, yah, silly details shall be the bane of my existence.

PS: Yes, most of the entries will likely end in “So, yah...” that’s just how I work >.>

PSS: I wrote this a couple of days ago and I kinda want to post it already so please excuse the bad writing (this is Comp Sci not English so I hope that wouldn’t be too big of a deal)