Tuesday, June 9, 2009

Man this was good

That's not one of my favorite FFVII songs, but the 'power' of that performance just made it sound awesome.

Saturday, May 2, 2009

I finally passed Discrete Mathematics!

On the final exam that I needed at least a 42 on, I got a 56.
After taking the class 4 times, I'm finally done with it and can forget everything I learned xD

The best part is I can finally take my advanced programming classes (which I couldn't take before because Discrete Math was a prerequisite).

The bad news is, the programming class I wanted to take for next semester was already full when I went to register, so I'll have to wait another semester to take it...

Technically I 'Passed' Discrete Math the second time I took it with a D+, but my university has some policy that I need to get a C or better for it to count...
Anyways, I finally got a C+, so I'm good to go..
(Its also funny how this class totally fucked up my high GPA to an 'average' GPA, and made me lose all my scholarships)

Friday, May 1, 2009

Greatest Man that Ever Lived

Leonardo Da Vinci was a brilliant man.
Probably the greatest man that ever lived.

Wikipedia describes him as "an Italian polymath, being a scientist, mathematician, engineer, inventor, anatomist, painter, sculptor, architect, botanist, musician and writer."

Considering he excelled in all those fields, that's extremely impressive.
He's "god-like" if you will.

I have to say I'm envious.

Friday, April 24, 2009


The grade I needed to get on my final exam to pass my Discrete Math class, just so happened to be the answer to the universe... 42.

If I got 42 or higher, then I can pass the class with a 70% C.
(I need a C or higher for it to count as passing)

I've been sick with the flu all week, so I didn't have a chance to study. I really fucking hope I got 42% or higher, I'll probably drop out of my University if I didn't... (I can't stand taking this class a 5th time!)

If I do drop out of Uni, I'll probably join one of those video-game colleges, and get a degree in "game and simulation programming."
The degree doesn't look as good as a "Computer Science" degree, but its better than nothing. And its probably a lot funner to achieve.
Also, my grades would be a lot higher if most my classes were about programing games (I think I've mentioned in a previous post, that I'm only good at stuff I enjoy).

Friday, April 10, 2009

Awesome Megaman Rap Video

One of my favorite video game series is the Megaman series.
A friend at work recommended me to watch this cool video on youtube:

I'm not too into rap music, but this song was pretty good.
Its got some awesome lines:
Heatman: "I got a face for radio and a box for a suit"
Megaman "Capcom really didn't spend much time on you..."

Windman and Airman's raps are my favorites, but they're all cool.
Any megaman fan should watch the video xD

Wednesday, April 8, 2009

Sleep is a double-edged sword.

Sleep is pretty awesome, it helps rest your mind and helps improve memory and all that good stuff.

But sadly sleep has its negatives, the main one being it takes away a lot of free time.
Or it can make you not want to wake-up, and you'll be late for work or school (happens to me every day xD)
Another problem is if you want to do something, but can't because you're too tired and need to sleep. Or if you just can't think straight because of lack of sleep.

So I've often pondered if life would be better without sleep.
The main problem that arises with this is that, if people didn't sleep, then work and school would most-likely be a lot longer. And that doesn't sound like a good thing xD

A compromise would be if the world rotated slower, and a day would be something like 27 hours instead of 24 hours.
This would allow for 3 more hours of sleep a day, and most people with busy lives would probably benefit from this.

Of course that also has negatives as well. For instance, if you're waiting for a certain day to happen, you'll have to wait longer. In fancy math terms the extra time you'd have to wait is (3 * n) hours longer where n is the number of days.

Furthermore, if you're having a bad day, and want the day to end, you'll have to endure that bad day for another 3 hours =D.

So really, I'm not sure what could be done to solve the problems of sleep. All options seem to have their ups and downs.... but that seems to be the case with most things in 'life'.

Saturday, March 28, 2009

Earth Day?


Heh this is pretty funny, they want us to turn off our lights for an hour? What for?

I'm all for cleaner sources of energy and a cleaner planet earth, however we need new technology that's more efficient, we shouldn't have to use technology less just because its inefficient.

Probably ~40% of the energy in the things we use daily is wasted due to inefficient technology (just my guess).

PSU's iirc are at-most like 80% efficient, and standard lightbulbs waste like 50% of their energy as heat (i've totally forgotten the exact statistics of these things, so they might be off).

But the point is, we don't need to use technology less to conserve energy, we need to make technology better!

Wednesday, March 25, 2009

Discrete Mathematics Sucks

I've taken Discrete Mathematics 3 times, and I'm on my 4th try ><
I feel pretty retarded taking the same class 4 times, and it especially hurts when I see people that are dumber than me passing the class :/

I'm one of those people that are only good at stuff they enjoy. If I don't enjoy doing something, or if I see no real-benefit from it, I won't apply myself and just half-ass it (or in the case of discrete math, just procrastinate and not study till the-day-of the test :o)

The class is basically a bunch of different advanced math courses/theories combined into 1 class. It needed for all Computer Science majors at my school, so it *should* have something to do with computers, but it really doesn't :/

Seriously, I spend most my days programming shit, and I really don't see much practical use for discrete mathematics. There may be some cases where you can use graph theory to help with stuff like shortest path algorithms, but there's a big difference between programming 'graph theory', and math graph theory.

Basically 'graph theory' or any other aspect of discrete mathematics to a mathematician is all about proving or showing something is true for all possible cases, regardless of the practicallity of actually implementing the algorithm. To a programmer its just "does this work good enough for what I need, and is it fast?"... See the difference? :p

Now, what good is an algorithm if its not practical to actually use? Or if you'll never use it? I love programming because I can create and view my creation. With mathematics you theorize and.... wait I guess that's it!? oO

Its funny, because back in high school I took Honors and Advanced Placement math courses, and got very good grades. I used to think math was pretty fun and easy... but then when I got to college I realized that the math in high school was "bullshit fake math."

College math was a punch in the face, I actually had to study!? wtf! The bullshit fake high school math courses only 'taught' me that I didn't have to study for math courses because they were easy... I got pretty pissed when I learned what 'real math' was after taking some university math classes :/

Anyways, the point of this blog-post is:
1) Discrete Mathematics is pretty useless, and shouldn't be mandatory for Computer Science Majors.
2) High School mathematics 'prepares' you badly for college-level math, by giving you false expectations that it will be easy.

Monday, March 23, 2009


I realized that the default option for comments is that you need an account to leave them. So I just changed it so that anyone can leave a comment, and I also disabled the word verification since those things are so annoying!

The worst part about word verification is that the text they make you type in is usually sooo warped that it takes a couple tries to type in the correct word ><

Programming != Math

There's a big misconception a lot of people have where they think in order to be a programmer, you have to be excellent at math or be a mathematician. This is absolutely false for most types of programming, or at least very misleading.

Rather than saying you have to be good at math, its more correct to say you have to be good at thinking logically or procedurally. When you program you have to think about the goal you want to accomplish within the program you're writing, and then think of the step-by-step way to achieve that goal using the 'instructions' made accessible to you by the programming language.

But notice that 'thinking logically' and 'mathematics' aren't the same thing. Of course being good at math is definitely a benefit to programming; if you know certain mathematical rules you might be able to simplify or optimize parts of your program, but its not a necessity for most types of programming.

Now there are some fields of programming where math is more crucially used, a 3d game programmer for instance is going to use more math than a programmer developing a word processor. But if you take all the types of programmers in the world, most programmers rarely have need for any advanced-math in their applications.

Personally I believe programming is more practical than mathematics anyways. Programmers create things that are useful to people, whereas mathematicians come up with theories that 95% of the time don't have any practical value.

I always wonder why people want to be mathematicians, what the hell are they going to do with that mathematical knowledge? I guess that's why most of them just go on to be professors or teachers, since they can't find a real job that practically applies that knowledge :p

So bottom line is:
1) You don't have to be a mathematician to be a programmer.
2) Knowledge is useless if its not put to a practical use.

Saturday, March 21, 2009

What is microVU?

Well earlier today on the pcsx2 forums someone asked this question, and I guess I could go further into detail here as well as give a nice overview on PCSX2 and the Sony Playstation 2 (it should be an interesting way to kick-start this blog).

Well as I mentioned in my first post, the main project I work on is a PS2 emulator called "PCSX2".
For those of you unfamiliar with emulation, it's basically the idea to mimic or 'emulate' one system on another system.
In the case of PCSX2, we are emulating the Playstation 2 system on a PC. So basically it lets you play ps2 games on your PC! :)

The ps2 is a powerful beast, and I don't think much people understand how difficult properly emulating the system is. Its not uncommon for people to belittle the project or to flame it with hateful remarks (but I guess I can talk about that in another post :p)

Basically to make an emulator, you need to have a solid understanding of how the system you're emulating works at a low level. In the case of the ps2, it has multiple different processors and units that need to be emulated correctly, and it also has to be programed in a way so that the components can sync and 'talk' to each other nicely.

The PS2's main component is the Emotion Engine (EE), this is the 'heart' of the system which also includes 2 co-processors: COP1 (FPU), and COP2 (VU0 in macro-mode).
In terms of PCSX2, we currently use dynamic recompilers to emulate the EE.
A 'dynamic recompiler' is an emulation approach in contrast to an 'interpreter' (which is generally alot slower and easier to code).

The idea of a recompiler is to take the ps2's native language or 'instructions' and to translate it into something your PC understands. After it translates alot of instructions, it saves them in memory in 'blocks'. A block is basically a bunch of instructions that have been translated.
Later on when a game wants to 'read' an instruction, the recompiler would look-up a compatible block, and start 'executing' that block of code.

This approach is alot faster than an interpreter because it only has to translate the code once, and then can read the saved translated code as much times as needed.
An interpreter however doesn't 'save' any translated code, but instead just calls a function whenever an opcode needs to be executed (the overhead for the function calling, as well as the lack of optimizations that can be made, are some of the reasons interpreters are so slow).

Well to get back to what I was saying, PCSX2 currently uses recompilers for its EE emulation (it also has interpreters for the EE, but they're really slow). Our current implementation of the EE recompiler is really a mess quite-frankly. Most of the pcsx2 team agrees we need a complete rewrite of the recompilers eventually, and hopefully next-time around it'll be cleaner and faster :)

To get back to describing the PS2, in addition to the EE, it also has 2 Vertex Unit Processors (VU0 and VU1), a Graphic Synthesizer (GS), various DMA units (vif, sif, gif, ...), 2 Sound Processing Units (SPUs), an Input/Output unit (IOP), a MPEG-decoding unit (IPU), and various other components I didn't mention.
Emulating all these units is alot of work, and syncing them so they work 'together' is ridiculously complex (many of pcsx2's problems is incorrectly syncing these units).

Well now I guess I can finally get to the original question: "What is microVU?"
microVU is what I named the new VU recompilers I'm working on.
Currently PCSX2 uses the VU recompilers named "Super VU" a.k.a. "zerorecs", but they're incorrect when it comes to properly following the VU's pipeline rules, also they're coded in a way that makes them un-threadable.
The goal for microVU is to properly emulate the VU's pipeline and possibly be even faster than Super VU. Additionally, microVU is coded with threading in mind, and eventually it should be threadable which would enable big speed-gains for quad-core CPU users, and possibly nice speed-gains for dual-core users as well.

Since this post is already a Wall of Text, I guess I'll stop here for now, and possibly go over some more stuff in future posts :p

Starting this blog.

Well this is my new blog.

Here I'll post random things dealing with the projects I work on, as well as any other stuff I feel like talking about =D

I guess I should post a bit of background info about myself for those that don't know me.

Well I go by the nick 'cottonvibes', I'm a 20 year old university student living somewhere in the USA (exact location is hidden to prevent my privacy ;p)

Mostly I spend my time coding for a well-known project called PCSX2 (the world's most advanced ps2 emulator! :p). I've been working on PCSX2 for about a year, but 'officially' I've only been coding for the project about a few months.

Before that I was one of the founders of PCSX2 Playground, which was a PCSX2 branch project that quickly gained popularity, and eventually got merged into the official PCSX2 project (and thats how the rest of the playground team and I got on the official PCSX2 team).

Aside from PCSX2, I've worked on various other random private coding projects, mostly just for fun by myself.

I'm halfway done with my own NES emulator called "cottonNES", but due to PCSX2 taking up most my time, I've had to put that project on hold.

...well this probably is enough writing for my first blog post, so I guess I'll just stop here and write some more random gibberish later :D