Monday, December 22, 2008

A response to "Wage Labour and Capital: Introduction"

This evening I read Fredrick Engels' introduction to "Wage Labor and Capital" by Karl Marx, and I cannot wait to poke holes in Engels' theories contained within.

In the introduction, Engels gives an example of how we can can judge the cost of labour. He states
Let us assume that the money price of these means of subsistence [the cost to keep the labourer able and willing to work] averages 3 shillings a day. Our laborer gets, therefore, a daily wage of 3 shillings from his employer. For this, the capitalist lets [makes] him work, say, 12 hours a day. Our capitalist, moreover, calculates somewhat in the following fashion: Let us assume that our laborer (a machinist) has to make a part of a machine which he finishes in one day. The raw material (iron and brass in the necessary prepared form) costs 20 shillings. The consumption of coal by the steam-engine, the wear-and-tear of this engine itself, of the turning-lathe, and of the other tools with which our laborer works, represent, for one day and one laborer, a value of 1 shilling. The wages for one day are, according to our assumption, 3 shillings. This makes a total of 24 shillings for our piece of a machine.

But, the capitalist calculates that, on an average, he will receive for it a price of 27 shillings from his customers, or 3 shillings over and above his outlay.

Whence do they 3 shillings pocketed by the capitalist come? According to the assertion of classical political economy, commodities are in the long run sold at their values, that is, they are sold at prices which correspond to the necessary quantities of labor contained in them. The average price of our part of a machine – 27 shillings – would therefore equal its value, i.e., equal the amount of labor embodied in it. But, of these 27 shillings, 21 shillings were values were values already existing before the machinist began to work; 20 shillings were contained in the raw material, 1 shilling in the fuel consumed during the work and in the machines and tools used in the process and reduced in their efficiency to the value of this amount. There remains 6 shillings, which have been added to the value of the raw material. But, according to the supposition of our economists, themselves, these 6 shillings can arise only from the labor added to the raw material by the laborer. His 12 hours’ labor has created, according to this, a new value of 6 shillings. Therefore, the value of his 12 hours’ labor would be equivalent to 6 shillings. So we have at last discovered what the “value of labor” is.

“Hold on there!” cries our machinist. “Six shillings? But I have received only 3 shillings! My capitalist swears high and day that the value of my 12 hours’ labor is no more than 3 shillings, and if I were to demand 6, he’d laugh at me. What kind of a story is that?"

If before this we got with our value of labor into a vicious circle, we now surely have driven straight into an insoluble contradiction. We searched for the value of labor, and we found more than we can use. For the laborer, the value of the 12 hours’ labor is 3 shillings; for the capitalist, it is 6 shillings, of which he pays the workingman 3 shillings as wages, and pockets the remaining 3 shilling himself. According to this, labor has not one but two values, and, moreover, two very different values!

As soon as we reduce the values, now expressed in money, to labor-time, the contradiction becomes even more absurd. By the 12 hours’ labor, a new value of 6 shillings is created. Therefore, in 6 hours, the new value created equals 3 shilling – the amount which the laborer receives for 12 hours’ labor. For 12 hours’ labor, the workingman receives, as an equivalent, the product of 6 hours’ labor. We are, thus, forced to one of two conclusions: either labor has two values, one of which is twice as large as the other, or 12 equals 6!
This binary conclusion that Engels presents is the basic flaw of Marx and Engel's theories; when a customer is buying a part from the Capitalist, the customer is not simply buying the part, but she is also purchasing the service of simplifying the acquisition of said part. The Capitalist adds value to the "experience" of purchasing the part for the customer. Without the intervention of the Capitalist, the Customer would need to perform many tasks to obtain the needed part. The Customer would need to obtain access to the machinery, vet and chose potential labourers, calculate the cost of subsistence for the labourers, and transport the finished part to where it is needed. By handling these tasks, the Capitalist can justify adding his 3 shillings to the cost of the part.

Engels does not seem to understand that when a customer buys a thing, she not only buys the thing, but also buys the service involved in getting the thing to her. Thus we can now understand that there is not one single labour cost but two costs of labour added to the raw materials and deprecation value of tools. There is a "production labour" and a "service labour."

Simply put there are not two values of labour... there are two labours, each with value. Engels is wrong when he states "the working class alone produces all values." While it is true that the working class alone produces all _production_ values, the working class produces nearly none of the service values.

Even if the bourgeois Capitalist were to employ someone to manage the service labour involved in selling the part (we will call these labourers "managers"), there is still a labour associated to maintaining the management or a risk involved in neglecting them; for if the Capitalist owner does not oversee management, their business is at greater risk of failure.

Wednesday, September 24, 2008

Back on my feet

After a terrible few weeks. Im started to get back on my feet and feeling happy. My work morale has gone up quite a lot, and superiors have started to give me a heavier work load as they see me getting better.

Thursday, August 28, 2008

Sadness

My Step father died today. April 10 1949 - August 28 2008. Miss you Greg.

Mom called me this morning @ 7 and told me to come to the hospital, but I didn't make it on time.

Friday, July 11, 2008

Utopia Attack Calculator Screenies



Windows and Mac respectively

If you want to try out the pre-beta go here

Pre-Beta Testers for Utopia Attack Calculator

Utopia Attack Calculator has seen some work put in on it... im nearly ready for some pre-beta testers.

I am looking for people who run Mac/Windows & do not have QT installed.
I am not looking for Linux users at this time.

If you are interested, please sent me an email, or comment on my blog

Please Include
Name:
Operating System:
Email Address:

You DO NOT NEED TO PLAY UTOPIA TO HELP ME! Pre-beta is just to see if there are any problems running the executables

Monday, June 23, 2008

I have the best job in the world

I have the best job in the world. Last week I got moved up from a team working on "in market" devices to the team working on brand new devices. It feels like I've been called up to the NHL after a short stint in the AHL.

True I spend long hours at work, but I love every second of it!

Anywho... Im also being flown to England this coming Saturday after my Graduation... It's going to be a very busy week for me.

Saturday, June 14, 2008

Seeker the Dark is Rising

I would rather be raped by an elephant than have to watch that movie again.
I felt like burning my testicles to escape from the pain my eyes were suffering.

This movies only redeeming quality is that Bulimics will appreciate the after-meal regurgitation assistance provided by the cast.

-5 stars.

Saturday, May 31, 2008

Qt: Utopia Attack Calculator

So why have I been learning Qt... I've been learning Qt because I play an online war game called "Utopia". Utopia used to be really big with 80,000 people playing on it. On Windows a program called Utopia Angel helps players format and calculate their play.

Utopia Angel is created in a language called Delphi (which I know very little about), is completely closed source and does not run on Linux or Mac unless you use VMware or Wine. Brother Green, the main programmer for Angel has said publically that he will not be making a linux/mac port.

Anywho... Utopia is no longer as successful as when I was in highschool. About 20,000 players play the game now, and formatters aren't really as useful as the game shows you some calculations already. However its still been a goal of mine to create an Angel competitor.

Soo... without further adue here is my version 1 of the Open Source Utopia Attack Calculator (OSUAC).



I need to write some Regular Expressions to scrape the Utopia pages to do formatting... but the OSUAC already monitors the system clipboard (hack needed to be done on Linux because X doesn't share the clipboard like Windows or Aqua).

My Goals are these... To call the program a success
Users: 1000+
Community: 3+ developers, 10+ testers
Programmers must have fun developing the application

So anyway... soon I think I should go to sourceforge and figure out how to share the OSUAC... soon meaning whenever I have some spare time from work (53h last week :) )

Sunday, May 25, 2008

Kscope

Programmers of the world... you must try Kscope... it has most of the functionality of source insight, but isn't quite as slick.

Kscope definately gets my thumbs up (I wish it was multiplatform!!!)

Friday, May 23, 2008

More adventures in QT


following an online tutorial I made the above last night using QTDesigner... it was really simple.... thats a screeny of the compiled code running.

Monday, May 19, 2008

My awesome car

My awesome car gets 42mpg on the highway!

Don't be Evil

**NOTE** Links here (except the slashdot link) are either really fucking disgusting or have got people killed... I DONT WANT YOU TO VISIT THEM

So I woke up today to read this on The Slashdot (the leader of the free world prefaces sites on the internets with the word "the"... I should do the same)

In short... The Google complied to Indian authorities demanding to know the IP address of someone who posted images depicting a Hindu God in a "profane" way. Of course, slashdot didn't link me to the images, so I dont know if they ARE profane or not... but that doesn't matter -- I live in a country that protects a persons inalienable right to free speech, whether that be pictures like this, pictures like this, or even pictures like this.

So the Indian authorities went to the ISP owning the IP address, arrested the man whom had the IP address. They beat this man, and made him eat shit *literally* THEY GOT THE WRONG MAN!!!

So let me sum up... The Google helped the Indian authorities arrest beat and torture a man completely innocent... even if the man wasn't innocent of what they said, the "crime" is something that is an inalienable right in The Google's Headquarters (Google is home in Mountainview California... The US is big on free speech).

Now we come to the part about ME.

I use the Google... I love(d) the Google. The Google provides the best email services/search services/and hosts this blog. I use Google services because they are premier, and better than all the rest. So what am I to do?

I've linked to images that are really really controversial (pictures of Mohammed might get me killed! Christians might shun me for linking to an image of the Virgin Mary covered in shit... Gay Pron is not well received by the masses)... is Google going to give up my IP so that I can be punished for expressing myself?

Should I boycott the Google for Doing Evil? I just dont know what I would use if not for Google.

Sunday, May 18, 2008

My Hometown

Pictures of my hometown... then pictures of what has become of my public school



Saturday, May 17, 2008

Highway 7













Drove to my parents house and took the very scenic highway 7... some pics

Ford just doesn't get it do they

So on my way to work on Thursday I saw someone driving a "Ford Escape Limited" from Kanata Ford....

Think about that for a second.... a _LIMITED_ Escape from somewhere you Cannat-afford?

I want a full escape for free damnit! There are Model-Ts rolling in a junk heap somewhere.

Wednesday, May 14, 2008

Man Im tired

left the door at 8am, got back home at 8pm.... long days are good though, cause it makes me feel needed @ work. I feel special that I was given something urgent to look at in my first 2 weeks.

Friday, May 9, 2008

My first Blackberry Pictures

So now I really have a reason to blog... I'll have images:) here are the first ones

View from my living-room window

More view from living room

Creek as seen from living room

The batmobile, my awesome car (I get 35mpg!)

Where I work

Off to the distance from where I work

Batmobile in batcave

Front of my home


Pictures of my Living room


the Blackberry, the Pictures, and the Macintosh: A Bluetooth Western

Howdy pardners

t'Day we gone learn 'bout taken dem der pichers on bakberr 8330, and uploo'in dem teh yer Maa'Intash.

Took me a while to figure out, but now I'm going to give you a guided tour of taking pictures on your Curve, and uploading them to your Macbook via bluetooth.

Step 1: Pair the devices
a) On 8330: Scroll to the Radio Antenna *click* -> Setup bluetooth *click* -> Allow another device to find me *click* -> OK *click -> "Waiting for a connection"

b) On Mac: Bluetooth Icon -> Setup a Bluetooth Device *click* -> Continue *click* -> Mobile Phone *click* -> continue *click* -> BlackBerry 8330 Continue *click* -> Continue *click* -> Remember NUMBERS







c) On 8330: Enter Numbers on Phone -> When "Accept connection request from " shows up make sure to click "Don't ask this again" and then YES
d) On Mac: clickthrough to finish

Step 2: Security Options on the Macbook
In System Prefs -> Sharing -> Enable Bluetooth Sharing.



Step 3: Sending the Media
On Device: Go to the media you want to send -> Send Using Bluetooth *click*
On Mac: Accept in Documents look for your media.

Thursday, May 8, 2008

My adventures in QT

QT seems really nifty. Cross platform GUI API+tools for C++.

Here is where my adventure starts

Bug 1: In windows, after installation you must set full permissions of the install dir for anyone wishing to invoke qmake.

Bug 2: Rather than invoking qmake as explained in most tutorials, Mac users must invoke qmake -spec macx-g++ No one told me this... but Im telling you.

Bug 3: QtWebKit requires you to manually edit the Makefile generated by the bug2 command.... perhaps you need to do more with -spec

figuring out these issues took me 2 nights work (interrupted by a couple hours of TV of course), I hope I saved you that time.

Monday, May 5, 2008

First Day at Work

I had a good first day at work... of course, I do not yet have access to the source code that I will be working on (red tape), but I got lots of other admin type stuff done today.

I had a good meeting with my new manager (my old manager moved to a different team) and I feel very positive about the work I will be doing.

Of course, dont look here for any tidbits about whats going on where I work... I really cannot speak about anything related to what I do.

Wednesday, April 30, 2008

Ubuntu pt 3 : The VNC bug

There seems to be a VNC bug. My keyboard was garbled. eg when I type asdf I get abfs.

There is a hack to fix it located @ https://bugs.launchpad.net/ubuntu/feisty/+source/vino/+bug/112955

Look for what the poster wjs writes.

Ubuntu part 2

Ok in this session Im going to configure essential services that I need. This includes
  1. Firestarter - a firewall
  2. ssh/scp - remote sessions and remote file transfer
  3. svn for remote computers
  4. basic http server
1) Firestarter. I already installed it, I want 1114 and 1115 for Azureus. I want 80 for webserver, 22 for SSH. 443 because I intend on putting https sometime soon. All done with an easy GUI.

2) ssh/scp. Ready from startup

3) K, I have to install svn server first. Use synaptic for subversion and subversion-tools... check, copy in a tgz I created from my old repo and do a checkout on the code... check. I have to fool around with svnserve.
Ok I created an unpriveledged user called svn and a group called svn. added my normal uname to the group and changed permissions on the repositories to 'chmod g+rx -R *' I can checkout fine, and cannot commit which my normal user... which is what I wanted

Now I want to figure out how I can submit as the svn user..... --username doesn't work like I thought. Ok... the commit plan is to co as svn 'svn svn+ssh://svn@192.168.0.1/repo change' then svn diff > patch.txt the changed work, then patch -p0 < patch.txt... after that I can commit from the change repo :)

Next step is to allow anonymous access.... inside each repo is a conf/svnserve.conf file... add the line anon-access = read.

4) Basic Http server is ready from install :)

Ubuntu 8.04

My friend Cesar just asked me to continue blogging... right now Im just setting up my PCs, but in order to accommodate him, I may as well blog about what I am doing. Seeing as its Open Source stuff, I even get to make my way onto the SeneBlog (Chris Tyler's Seneca Planet).

Before I get started, let me make a plea to someone like Andrew Smith, or Cesar, or perhaps even myself to set up a Planet for the Seneca Alumni. I would like to read my friends blogs even if they are no longer specifically writing about Open Source stuff. Another plea to Andrew specifically is to keep cranking out the blog postings... I really love it when you have a new article. Grumble Grumble is my fave.

Anyway, onto installing Ubuntu 8.04. Dont be alarmed by the lack of grammar in the next few paragraphs, I write in my patented "stream of thought" method which needs no grammar.
===
I pop in the disk and get on my way... Lets check the CD to make sure there aren't any errors... OOPS 22 files are in error... lets try again -> still 22. Ok lets download a new iso (FYI: i got the first one via bittorrent... second one via http) and check that... 0 errors. Great. Lets begin the install

I speak English, I live in Ottawa... Oh Noes Ottawa isn't a city recognized by the Ubuntu installer... grumble:( Ok I guess I'll say I live in Montreal, its only 2h away.

Guided-use entire disk for my partition... erase that nasty Windows XP install. Set up my account details, and let the installer do its magic. Im actually surprised I didn't get to say which packages I wanted, but whatever.

20 minutes later... (while playing NINs new free online single Discipline)

Alright, first boot, lets see how this goes. Uname,Pword.... Hmmm something funny, the screen is at the wrong resolution. A "glxinfo | grep render" shows that direct rendering is not enabled (I have a 7600GS Nvidia card on this machine). A few seconds later a pop-up shows on my screen saying something about restricted drivers... click the button enter the password for sudo and chose to enable the nvidia card in an easy to use GUI. Machine is dling the driver, installing, and requires a reboot. After the boot the resolution is nice and glxinfo shows direct rendering, glxgears @ initial window size shows ~3000fps woohooo!

Alright, now for installing the software I want. Open up Synaptic, lets install
  • Sun Java JDK6
  • Azureus for sailing the seven seas (yarr!)
  • flashplugin-nonfree (the real adobe)
  • doxygen
  • apache2
  • php5
  • mysql-client & mysql-server
  • openssh-server
  • firestarter
  • g++
In total, there is 306MB of data to download... this may take a while. While its downloading, lets surf the Google Images for a nice background. Lookiee here, FF3.05b. Ok that was quicker than I expected. Lets go for some Gnome themes from http://art.gnome.org GlossyP is my fave, so lets install that. For login Managers I picked the Brasillinux Eye, the Gnome Zen, Devils Candy and Falling Angel (my all time fave), put them on rotate so I have a nice variety whenever I use this machine. Still 5min left for my application installs.

And there you have it... a nicely set up Ubuntu Machine in < 1.5h. Stay tuned to part2 where I configure different things:)

Thursday, April 24, 2008

The Move

So we loaded up the truck and moved to Beverley... Ottawa that is. Piles of Snow, Political Stars.

I've been packing and packing, and finally I've moved in to my new Condo... its f'ing sweet. A large living room, huge bedroom with walk-in closet, 2 bathrooms (one is only toilet & sink... other has bath/shower), a solarium (maybe I grow things soon?), and an office... yes I have a freaking office dude!

Hardwood floors all around, which means I have to put little felt things on all my furnature. Speaking of furniture...

I have a new couch, loveseat, and a big fluffy chair, and a 50" TV (1080i... not P) all total $2800. It was a good price for having only 2 hours to shop (had to shop for furnature on the weekend didn't have much time). I have a big Queensized bed too.

My other furniture such as the desk, the sectional, my dresser etc should be coming really really soon, once its here I will be able to complete my move:)

Good Times in the O-town.... Ohh yeah Bell Express View too -- GO HABS GO.

Thursday, April 17, 2008

Last Exam

Its all over but the crying. Time to move!

Friday, April 11, 2008

Schools out forever

A forgiveness ... this post isn't specifically about Open Source (although mandrake and gentoo are two major actors in my tale)... i just know that my Open Source label will provide me with an audience.

Today was my last day of class -- ever. I'm remarkably sad. I may yet return to school someday, but the kindergarten -> Job lifecycle is complete for me.

This tale is about my experience with Seneca College.

I've learned a great deal with Seneca. C++, OOP, .NET, UML, DirectX, Open Source, how to integrate yourself into a business, what business wants, etc. While I'm not sure how much was curriculum, and how much was personal interest, I am definitely a programmer able to enter the work world and be productive because of the guidence Seneca has given me. Even if Seneca's curriculum did not directly educate me on all matters (eg. Seneca is in no way responsible for me knowing how to install various Linux distros on machines... perhaps the curriculum should look into this... perhaps the various install-fests are all that is needed) it certainly provided me with a good environment in which to foster my self interest.

I'm going to answer questions in this post which I should have spoken up @ a meeting I had with my schools chair & a government deputy minister.

Why did I come to Seneca all those years ago? How come I pursued a degree at a community college rather than somewhere like the UofT?

1) After working at a deposit broker for 2 years doing SQL-like procedural code, I realized how really little I understood about computers -- although I claimed to know a lot. I had just been experimenting with Mandrake Linux and Gentoo and found it so nifty... I could run a webserver on my own machine awesome!!! I could compile my own hardware kernEL AWESOME!!!

2) I needed out of my hometown. I lived with my parents in a big old country house, and life was pretty sweet. My girlfriend had a car and would come pick me up, then give me armloads of candy and we had a lot of fun. but I still needed out. I needed my own life and my own things and I was not willing to settle.

3) I knew that a University would creditialize me better, but I wanted to learn real practical things. I was not really interested in my employability, rather than what cool computer things I could do for myself. eg I want to make video games, just not necessarily for a living (although it would certainly be cool). I knew Seneca to be the best college in 'learning cool things.' The UofT degree certainly turns more heads than Seneca... but I wanted the Seneca curriculum (sans business classes)

4) One Profs website claimed he hated haircuts... I hate haircuts too, obviously I am meant for this school.

Now, there was a little bit of vanity in wanting a Degree rather than a Diploma (BSD is rather similar to the diploma offerings from Seneca... you can think of the BSD as 25% harder/longer than the CPA specialization), but I also knew that I would be more employable with the BSD.

To be honest, Im not sure if I should have. Certainly the extra difficulty brought out something more in me, and I therefore learned with more intensity... but some of the subjects of the BSD are just plain uninteresting to me. For example, I really dont care about my business classes, other than the base fundamentals, I dont particularly want a job where those skills are needed. The business classes are a major factor in BSD differentiating itself from CPA though. Perhaps I would have been happier to drop these business classes and have a more enjoyable club life. I had far too much homework for the linux club which is just hanging out with other nerds who also like linux... the social aspect would have been nice, but I've only seen my highschool buddies a double handful of times over the past 4 years I was in Toronto :( .

However I am surely making more money in the future... which is important to me NOW at the end of the journey than it was at the beginning ... because of BSD.

Thats why I came to Seneca. It seems to have been a good choice.

Anywho, I want to give a thank you to my Profs, McIntyre, Letterio, Leung, Samuel, Boychuk, Czegels, Lennon, Cullen, Adames, Norman, Onzekizologlu, Anastasiade, Roy.

I specifically want to single out three Profs

Szalwinski: For having a truely heroic work ethic, and providing a role-model image for how to get work done.

Weaver: For giving me a really, really cool job, and introducing me to mind-blowing C concepts. Allowing me to flourish as a programmer. For hating haircuts.

Humphrey: For showing me the open source way. For letting me choose between safety and dreams... twice.

Tuesday, April 1, 2008

Mac Keyboard Layout: Just a rambling.

Went to school today without my laptop, and I used the schools desktops in Windows.

Dang I wish there was some way of converting a windows machine keyboard layout into mac keyboard layout.

If you dont know Apple uses the "cmd key" (labeled with the apple logo... similar to the key labeled with the windows logo on a normal keyboard) for pretty much everything, and for everything that doesn't use the cmd key, you can use a program like QuickSilver or Butler to do a user defined mapping.

I use these commands regularly
Cmd+Q - Quit the Appliciation
Cmd+W - Quit the current user interface/tab (doesn't close the application, but closes the GUI your currently looking at)
Cmd+R - QUICKSILVER - Start Terminal.app
Cmd+F - Find (in most apps)
Cmd+T - new tab
Cmd+Alt+Right/Left - move tabs in Firefox
Cmd+Shift+[/] - move tabs in Terminal.app (Dang this should be exact same as FF... I should Quicksilver this ... oh well Im too lazy to switch and I've memorized the motion already)
Cmd+N - New thing (like new document in Pages, or New Window in FF)
Cmd+E - QUICKSILVER - New Finder
and so on...

Most importantly, Cmd+c/Cmd+x/Cmd+v/Cmd+s for copy/cut/paste/save!

Anyway... I like the mac keyboard layout, its superior to the windows one I think... but its hard to switch back to Windows. I just wanted to complain!

Saturday, March 29, 2008

The Toronto Earth Hour Failure: C3P0 says "We're Doomed"


Yesterday, March 29, 2008 between 8-9PM was earth hour. It was a total failure.

To start, two of Canada's biggest hockey teams were playing at that time, I suspect many eyes were glued to un-switched-off-sets to watch the hometown Leafs defeat their arch rival Canadiens.

I turned off my lights and went grocery shopping during the hour... because I live in a basement which has absolutely no source of light other than electricity I would have been bumping into things constantly if I didn't. What I saw when I walked through my neighbourhood is about 50% houses with lights on... all the stores at Dufferin and Steeles had their lights on and all the streetlights were lit while I walked past.

While I disagreed with the stated goal of Earth Hour (raising awareness my butt), the reason I participated was because I believe that earth hour was a test to see if humanity could collectively get its ass together and switch off for just 1 hour a year. I viewed the occurance as a sort of Prisoners Dilemma where if we would all switch off together our human race would be saved, if people don't come together and switch off... well then we're doomed.

If you did switch off you are in the worst position, not only are you doomed, but you didn't get to see the majority of the Leafs vs Habs.

Friday, March 28, 2008

Mass Moment of Inertia

the mass moment of inertia -> how hard it is to change the spin of an object.

Its not the shape that matters when spinning, its the mass that matters. If the mass is closer to the center of gravity it will spin easier because the mass isn't moving very much.

mass moment of inertia is a 2nd rank tensor. vector is rank 1 and a scalar is rank 0. We express as a 3x3 matrix.

Bunch of formula for normal objects.

moment of inertia = matrix * angular access

Thursday, March 27, 2008

Safari 100% on Acid3

My latest Safari trunk is at 100 on the acid3 tests (+8)
Firefox is still at 71 (0).

Wednesday, March 26, 2008

Use the Force

Impulse Force : a non-continuous force. Happens in an instantaneous amount of time... infinitely small.
Body Force: is a force which occurs on an object over a non-instantaneous amount of time

Thursday, March 20, 2008

DPS912 Semaphores; Shared Memory: Message Ques

Semaphores

Have to do with synchronizing processes (threads have their own method of synch)
Sometimes you have to serialize the access to shared resources
Unix semaphores are known as system V Semaphores (as opposed to BSD Semaphores which are used in threads)

"protect a critical section" - any section of code which could have a race condition.

See "Critical section example from Les' notes

P - V: P = wait for resource ... V = signal when finished with resource

Shared Memory

normally different processes have completely different memory areas... but doing IPC is expensive and hard.... thus shared memory.

shared memory is much like semaphores... shared memory should use semaphores to serialize and synchronize.

Message Queues

Efficient and easy method of sending messages to unrelated processes

Message Queues, Shared Memory, and Semaphores all work similarly.

Wednesday, March 19, 2008

DPS906 Lecture March 19

displacement = velocity * time (if there is no acceleration over time)
displacement = velocity * time + 1/2accel*time*time

what we are missing is a justification for the velocity. We do not have a reason for velocity right now.

Causes of Motion
Kinetics

Mass - amount of matter OR amount of resistance to change in motion.
- stationary things are in motion, with a velocity of 0.
Mass is a scalar... no direction
Additive... if a thing is made out of different parts, you can simply add them together to get the mass of the whole thing.

Centroid is the geometric center of a 3d object. The centroid is the center of mass for objects with uniform density.

For objects that do not have uniform density the center of mass must be calculated.

To find the center of mass for a non-uniform dense object...
- pick some point as a reference (it doesn't matter where),
- From that reference point, create vectors to each of the centers of mass of the components.
- center of mass of whole = (m1*v1 + m2v2) / m1+m2

Newtons Laws
1) Every object in a state of uniform motion tends to remain in that state of motion unless an external force is applied to it.
2) The relationship between an object's mass m, its acceleration a, and the applied force F is F = ma. Acceleration and force are vectors (as indicated by their symbols being displayed in slant bold font); in this law the direction of the force vector is the same as the direction of the acceleration vector.
3) For every action there is an equal and opposite reaction.

force = mass * acceleration something

Tuesday, March 18, 2008

New Acid3 Tests


GOOD NEWS EVERYONE!


I just reran the Acid3 tests on my own personal builds of webkit and firefox. Improvements in both Webkit and Mozilla:)


Safari-Trunk: 92 (+2)
Firefox-Trunk: 71 (+2)

Keep up the good work guys:)

UPDATE: Safari has just released v3.1 which has 75 tests passed (+36 from previous version!)

Saturday, March 15, 2008

Raising Awareness

I just read an article from theStar. about Earth Hour. On march 29th, 2008.

You know... Im not sure how I feel about this. The goal of Earth Hour is to "Raise Awareness of Global Warming"

I like the idea of the entire city going black for an hour... even if its just the spookyness factor, but Seriously, is there anyone unaware of global warming?

Why do we have so many events to raise awareness for things like cancer, global warming, heart failure... blah blah blah. Do we really need to 'raise awareness?' could we not do something better with our time?

So anyway yeah, I am really really tempted to go to this event and walk up to people and say "OMG are you SERIOUS... I've never heard of this global warming! WE have to get scientists to look into this!" "WHAT OJ KILLED HIS WIFE.... NO WAY! Im stunned, he was such a great running back."

SVN Timelapse FTW

Its 3am and I cannot sleep. I've been working for a few hours on my DPS912 code... the writing of a shell, and I think I am pretty much done. My post tonight isn't going to be about my code assignment though, this post is about SVN and SVN time-lapse.

I've been using svn to keep track of all my coding assignments this semester because I didn't want to go through the anguish of making code mistakes and not be able to revert myself to a previous working copy... something which happens to me a lot if I dont use a code repository. I've gotten pretty good at using svn on the command line now, but I've found a really nice little tool to use with SVN

The tool is called SVN Time Lapse, and is GPL v2, so it can be used by anyone. What SVN Time Lapse allows you to do is look through your code seeing the changes that have been made from revision to revision. Its akin to the amazing p4 diff that comes with perforce.

Here are some screenies


NOTE: the code browsed is from my assignment... please do not steal this code as it is not Open Source and I can get severely penalized if people take my code and use it for themselves.

Wednesday, March 12, 2008

FUCK OFF ITUNES!

I am now getting an error message 2ce a week when I start up iTunes. Its fixed by deleting a few files from my iTunes directory and re-importing all my stuff... BUT ITS BLOODY ANNOYING

FUCK OFF APPLE.... quit shipping me buggy versions of itunes.

<- NO IT WASN'T!

DPS906: Angular Motion

Spinning motion

Angular Displacement
- change in orientation, rather than a change in position.
- is a change in the rotation matrix
- DELTA-R = FINAL-R - INIT-R (^r=r-r0)

Angular Velocity
- Euler says you can describe angular motion as the rotation around a vector. This vector is a separate axis to X,Y,Z.
- The magnitude of the vector describes the speed of the spin

Tuesday, March 11, 2008

BTS830 Lecture

Previous methods of analysis have been based on timevalue of money. (very objective)

Cost benefit does some of the objective work, but also examines the subjective values.

Goes beyond ROI and helps decision makers consider the value-added benefits. Involves the estimateion and evalutiona of the net benefits associated with alternative courses of action

Sunday, March 9, 2008

Reply to the Moz Cause

Mark Paruzel talks about the recent acid3 tests in his latest blog entry. His entry prompted me to try out my various browsers on the acid3.

I looked at firefox 2.0.0.12 (latest release)
a trunk firefox build I do myself
Safari 3.0.4 (latest release)
a trunk Webkit build I do myself.

Firefox Release = 52 tests passed (same as AA report)
Safari Release = 39 tests passed (same as AA report) -- this explains Mark's bad experiences with Safari
Firefox Trunk =69 tests passed (same as AA report)
Safari Trunk = 90 test passed (same as AA report)

I cannot claim to how verifiable these tests are, I do not run Safari (either build) very much, so I haven't seen very many problems. The "Web Standards Project group" have been around for 10 years now though.

Both Firefox and Safari have meta bugs for Acid3 showing that these two development teams find it worth while to check against acid3.

Friday, March 7, 2008

DPS906 Note

Velocity = distance / time;
distance = velocity * time;
accel = velocity / time;

Thursday, March 6, 2008

Ghosts and the Creative Commons

Nine Inch Nails (NIN) has just released a new 4 disc album titled "Ghosts." All the tracks are copyright using the Creative Commons licence. Share and Share alike.

If you are unaware, NIN was one of the biggest (one man) bands of the 90s, releasing songs such as Closer, and Head like a Hole. NIN was damn popular back then. Trent Reznor, the main ingredient of NIN has continued to work on new projects this decade with varying success. NINs new albums all sell well and are loved by fans, but his songs are rarely played on the radio and dont usually make it into "top 20s" lists.

Though NIN rarely makes the charts... its music is definitely pop and is by no stretch of the imagination "underground."

NIN/Trent Reznor has recently left his record label, and Ghosts is the first released album post-interscope. Released under the Creative Commons license (go ahead... give your buddy all the tracks) Ghosts is a collection of NINstrumentals. Combining various mechanical sounding noises together with more traditional instruments such as pianos or plucked violins, NINstrumentals are some of Trents more haunting and touching tracks.

None of the tracks have lyrics, perfect for studying to.

Ghosts is good, dont get me wrong. But I feel as though I have already heard this album. The songs are all original, but it sounds to me like Trent & crew are recycling the mechanical sounds created for previous albums, reshaping them. My favourite tracks are 14,16, and 32.

Does anyone else think this of the new album?

Anyway the important thing of this whole ordeal is that it seems like Trent has made a fortune because of his new method of music distribution. The album ghosts is released in several 'value added' packages. Ranging from $300 where you get vinyl records, Blu-Ray disc for sampling, and a book, to .... well free of charge without any added bonuses (NIN website offers the first nine tracks of the album, but I'm sure you know someone on the interwebs who has bought the album and is willing to give it to you for free). Reports all over the internet say that the limited edition $300 package has completely sold out in 2 days (2500 total copies = $750,000).

Its good to see that the idea of moving away from record companies which have gouged the public for years with $20 CDs seems to work for Popular bands like NIN and Radiohead... Its even better to know that an album released under the Creative Commons has made so much money.

Friday, February 29, 2008

Building Webkit

Today there was a slashdot article about one of Vlad's blogs... the topic made me revisit my Safari browser after a long time with Firefox... I decided to grab the source code and try building.

Along the way, I noticed that Windows users had to download non-open source code to get webkit to build properly. I went on their IRC and talked to a few guys there.... one guy bfulgham is working on porting the webkit back to cairo
"bfulgham
:
mmullin: The port already exists, in that GTK+ is Cairo-based. I have heard rumblings that wxWindows may switch to Cairo due to problems they have had with the GDI code.
[12:34p] bfulgham:
So it's mostly a matter of plugging into the existing Cairo framework. It's a great thing, because almost all necessary functions are in place, and as soon as the GTK guys add new functionality, the Windows port pretty much gets it for free.
[12:35p] bfulgham:
Also, WebKit was originally Cairo-based on Windows, so there is useful historical information in the SVN archive."
Im currently following their guide to build on Mac right now... but will try this cairo-windows soon.

Thursday, February 14, 2008

Wednesday, February 13, 2008

DPS906 Lecture 9

Linear Motion

How do we give realistic motion to our game models?

Linear Motion is motion in a straight line.

Fundamentals Units
  • time - measured in seconds unless otherwise stated
  • length - in meters unless otherwise stated
Particle Motion
  • The mass of this object is so small as to have no effect on motion
Frame of Reference
  • If you draw a picture of the moon moving around the earth, the picture is different than if you draw a picture of the moon moving around the earth while moving around the sun.
Scalar vs Vectors
  • measurement unit with no direction involved
  • vectors are scalars + direction
displacement = endposition - start position (change in position, directional)
(average) velocity : change in position over a unit of time (the bigger the time, the more inaccurate the calc... the CPU controls the time, we have no control).

velocity = total displacement / total time;

Saturday, February 9, 2008

DPS906 Code Nearly Compete

I am nearly complete my game tree assignment. I have
  1. A Move Generator
  2. Transposition Tables
  3. AlphaBeta Pruning
its a little funny to get TT and AB working together, spent 8 hours on this last night (oy what a good feeling when it worked!). I got it to work in the end, but I am VERY confused as to why

You see, there is a line of code in my program which double checks the retreived from TT score vs the current alpha/beta values. This double check exists because, the first time you run into a board layout the alpha and beta values might be very different from the second time you run into a board layout. This took me a long time to fathom... but finally I did, and I started tweaking my code.

I started coding statements like "if the value of the TT check score is greater than alpha and below beta, the board does not need rescoring" (if current.beta > tt.score > current.alpha )"

However this doesn't work. What does work is this
if( sc.score_ <= nn->d._atLeast || sc.score_ >= nn->d._atMost )

SC being the TT check score and nn->d being a structure that holds the current alpha (atLeast) and beta (atMost).

Im very perplexed... oh well it works (and is the same as the literature I've read), Im just rather confused to why. I'll send Cathy an Email.

Friday, February 8, 2008

DPS906 Lecture 8

E=T-O -- error calculation

Wj = Wj + lr * Ij * E -- new weight calculation

Genetic Algorithm (GA)
- things evolve from other things... including solutions.

Solutions can evolve from other solutions.
- solutions need to be some sort of parameter list (called a string)
- create a gene (one possible solution)
- each gene needs to be evaluated for its fitness

start with initial population of randomly generated solutions(genes)
for the better solutions give them a % chance to be successful
This % chance is called "Relative Fitness"
eg
5 genes
g1 fitness = 5 (relative fitness is 5/15) [0.333]
g2 fitness = 3 (relative fitness is 3/15) [0.533]
g3 fitness = 4 (relative fitness is 4/15) [0.799]
g4 fitness = 1 (relative fitness is 1/15) [0.866]
g5 fitness = 2 (relative fitness is 2/15) [1]

now survival of the fittest pick 5 genes at random by rolling a dice which has values between 0 and 1

next operation is called cross over to form new genes. Then to restart the process.

mutation process... you randomly pick one spot on a gene and change it. You dont want to do mutations very often.

BTR820 Lecture 7

Citing vs Quoting

Quoting - using other words verbatim. (3 or more unusual words)

Citing - When you take someone elses idea. Or facts/info/methods. (facts that are not common knowledge to the audience you are writing to). You must cite if you summarize or paraphrase.

Difference between citing and footnotes/endnotes. Don't use for citation, use for parenthetical information.

... - when cutting out info from a quote .... when cutting out the end of the sentence. If ... is actually in the quote then use [...].

4 lines or more you use block quotes. (10 space indent)

Works Cited is only the works you cite... Bibliography is all the work you read.

Thursday, February 7, 2008

DPS912 Lecture 6

Lots of Review on Network Sockets. stdout is buffered, if you need to make sure that printf actually prints uses fflush.

Went over the Assignment

Signals

Signals are sometimes called interrupts. They interrupt the normal flow of the program. CTRL+Z or CTRL+C. You have no idea when they will occur.

Processes can send other processes signals if they have permission. Most singnals have a default behaviour, and processes can be programmed to change the default behavior (eg ignore the signal)

you can set a signal handler using the following functions

signal() - easier but deprecated

sigaction() - harder but modern. It can do more stuff

Wednesday, February 6, 2008

DPS906 Lecture 8

Machine Learning

Teach a program to learn to do something.
Something==Pattern Recognition (usually)

Training Data (computer creates rules from this data)
Testing Data (test the computers rules with this data)

The way that it comes out with an answer is often not something that can be explained with a rule.

Neural Networks

In AI neural nets are made of nodes. Nodes have a bunch of input... the could come from anywhere depending on the situation. The inputs have a weight when they input data to the node. When the node outputs it does calculation based on the inputs... during the "training phase" the weights of the input are adjusted. See written notes for more info

Nodes typically have the same activation function.
3 common functions
  1. Threshold function: (if IjWj > threshold return 1 else return 0) (have to adjust threshold)
  2. Sign function: similar to threshold add in an extra weight and input to the threshold function (W0I0) W0 is threshold (allows you to adjust the threshold as a weight rather than the threshold) I0 = -1
  3. Signoid function: a function that doesn't return 1 or 0 only... returns values inbetween (eg 0.234 or 0.453) Has a funky Sigma curve.
Perceptron

Feed forward, single layer, neural net.
  • feed forward == input/output goes one way, never backward (see drawings). inputs for a node always come from a node in previous layers never from later layers. Nodes in same layer do not connect.
  • Single layer means only one layer. Single layer + feed forward means the nodes never talk to each other.
Good things
Given time/data a perceptron will learn to separate anything that is linearly separable. (AND OR are both linear separate, XOR is not linear separate)

Actual learning of a perceptron
DEFINITION EPOCH: Each time you update the weights in the perceptron is called an epoch.
Perception begins its "life" as a bunch of nodes. Create your layer of nodes with inputs and outputs. Randomly assign weights to all inputs and go through the 1st "training" stage. You may get an error.
Input(I)
Error(E) = Training Answer(T) - Neural Net Output(O).
if( e > 0 ) t must be > o
if( e <> t

if (Ij) is -ve increasing weight will decrease output
if Ij is +ve increasing weight will increase output
weight = weight + learning rate(this is a constant) * Ij * E.

Tuesday, February 5, 2008

Another Response to a Grumble Grumble article

Andrew Smith is a brilliant mind concerned with open source. He is also a former classmate of mine so I am quite interested in all of his rants. His latest rant is titled "Whether to make money with software"

Andrew States:
"so by open sourcing your software you, as a business, don’t have anything to gain"

I disagree, take this fictitious example....

I am releasing a client/server game called World of Wormcraft. I will not make money from selling the actual software, in-fact I will give away the client AND the server for free. Completely open source.

I will make money from the millions of people who have a monthly subscription which allows them to connect to my OFFICIAL high broadband server.

Why would I want to release the server as open source? Cant anyone just set up their own personal server? Yes they can.... however their personal servers are not official (and not of the same service quality). Their servers add to my World of Wormcraft publicity, add interest to my game (you can try it out for free), and eventually is a GoodThing (TM) because the game will live on after I stop running the Official Server.

There is a risk that another business will take my server code and start their own high-bandwidth near-official servers. Their competitive advantage over me is that they did not have to spend any money in development. However MY competitive advantage includes being "the brand," having a full working knowledge of the code AND being maintainer of the code (thus v2 is released by me... if my competition releases v2 they have to fork and lose branding). My competition and I will compete based on price and service quality. My service quality will be superior to theirs because of my intimate knowledge of the code and the ability to v2 w/o forking, so if I can match their price I win.

I admit there are a lot of holes in my argument. I am postulating this idea not to be bullet proof, but just to give Andrew the idea that it "can be done and I do have something to gain."

BTR820 Lecture 6

How do we Evaluate an Article?
  • how famous is the author
  • how often are is the author cited by others
  • where do they work
  • where was it published
- use scholar.google.com
- 25 citations is very very good
- 10 is acceptable
- 0 is shady

Sometimes really really bad papers get cited a lot (as examples of what not to do)
younger papers get cited less

It is a common occurrence for a scholar to get excited about something outside their field and write a paper about it.

wikipedia is biased
sometimes journals are biased too. Alan Sokal published a "joke" paper and it got published (he put in enough physics jargon and wrote to the political views of the journal)

Thursday, January 31, 2008

DPS912 Lecture 5

Review Unix Sockets

High level calls (putchar getc etc) need a FILE*, read/write are low level and need a file descriptor
File pointers are different from a file descriptor.

Internet Sockets

Sockets which can communicate over networks. Does not use file names instead...
instead use : IPaddress Port Number

Interesting way in which an ipaddress is made eg 1.2.3.4 =
1 * 256^3 + 2 * 256^2 + 3 *256 + 4
Use AF_INET

Network Byte Order
- a standard order in which bytes are put onto the network. May or maynot be the same as your machine order (big-endian, little-endian). There are conversion functions to convert from host byte order to network byte order
- htonl : host to network long
- htons
- ntohl
- ntohs

Network Addressing
convert ascii ipaddress to IP address in network byte order
- inet_pton("127.0.0.1") (also inet_addr or inet_aton)

real usage
inet_pton( AF_INET, "127.0.0.1", &address.sin_addr);


Using hostnames
x = gethostbyname("zenit.senecac.on.ca");
getaddrinfo("zenit.senecac.on.ca", NULL, NULL, &addrinfo_var);

use setsockopt to set the SO_REUSEADDR option so that you can reuse a socket right away after closing.

IO Multiplexing

use select to wait for activity on multiple file descriptors
select simply checks to see if a read(or whatever) will be non-blocking
Manipulate File Descriptor sets via
FD_ZERO - initialize a set (an fd_set structure)
FD_SET - put a file descriptor into the set
FD_CLR - remove an fd from the set
FD_ISSET - check to see if a filedescriptor is now unblocking

Wednesday, January 30, 2008

DPS906 Lecture 7

The problem with A* Search is that the search space grows exponentially. Even the A* has too many branches for normal sized worlds.

Another method called Iterative Deepening A* Search
- set a threshold for search = to a minimal estimate (cannot over estimate)

eg
Arad to Bucharest - 366 (crow flies distance) is minimal estimate THRESHOLD
A->Z = 75 + straight line from Z->B (374) == 449
A->S = 140 + S->B (253) == 393
A->T = 118 + 329 == 447

all checks are bigger than threshold... so set new threshold (smallest of previous checks)
A-S = 393 THRESHOLD
A->S->O = 140 (A-O) + 151(S->O) + 380(O->B) == 671
A->S->F = 140 (A-O) + 99(S-F) + 178(F->B) == 417
A->S->R = 140 (A-O) + 80(S-R) + 193(R->B) == 413 THRESHOLD

etc

The idea is that you keep making your threshold bigger until you can prove that your trip is the threshold.

Tuesday, January 29, 2008

BTS830 Lecture 5

Financial methodologies are rooted in traditional “captital budgetting decisions”
long term & depreciable
- machinery facilities, IT and management expertise

Breakeven analysis
- comparison of quanitiable costs and non quantifiable benefits

Steps
1.calulate value of costs
2.calculate value of quantifiable benefits
3.calculate Net Present Value of costs/benefits
4.determine non-quantifiable benefits and subjectively consider them in the analysis


Payback Period Methodology
- every payback period has a cutoff period (it ends in X years)

Accounting Rate of Return (book rate of return) : book value=cost-depreciation
- memorize the ARR calc

Friday, January 25, 2008

DPS906 Lecture 6

Heuristic functions for searches must
- work fast
- cannot overestimate

The tree the heuristic analyzes is a binary heap

Reviewed Binary Heaps (see btp500 notes)

As an array
root=array[0]
leftchild for node i = 2i +1
righchild for node i = 2i + 2
parent for i = (i-1) / 2

LSO230 Lecture 3

Karl Marx
- single most important person of the past 200 years
- 100 million dead from marxism ideas
- born 1818
- at 25 became radical and journalist
- was supported by Engels
- a bit of a deadbeat

Ideas
Before, things were OK, but not good
  • Lived in the country
  • most people are bakers, farmers etc
  • people specialize a little at what they do
  • they trade as equals
  • landowners are the wealthy. the rest are not rich. Everyone is equally poor
Marx things that things are ok because
- good work. work contributes to who they are
- good communities

Things changed because capital came along. (not just money)
During the industrial revolution, captial changed to be owned by factory workers rather than tradespeople.

Capital divides into haves and have nots (bourgeoisie vs proletarians).

Two classes
Proles: sell their labour, work for a living, earn small wages in exchange for work
Bourge: do not sell labour, own capital, receive profits from others work

Peasants lose good work -> work in factories -> factories are more successful -> more peasants lose work -> more peasants work in factories -> drives down wages -> factories are more successful

Bourg invest money to get better technology which makes labour have poorer jobs with worse pay. More profits for the Bourgies.

Middleclass gets squeezed.
Proles work gets easier and easier, worse and worse. In 1818 half of the cotten mill workers were children under the age of 10.

Inevitably the proles get poorer and of greater number
the Bourgies get fewer and richer

Response - There has not been one big crisis. Why?
Destruction of productive forces
Conquest of new markets.

BTR820 Lecture 5

White Papers (2 types)
-promotional (majority)
-professional

Promotional papers are meant to capture an audience who have a problem and want discussion on solutions from suppliers

Structure SBFO
header info (to:from:re:etc)
Summary - so you dont have to read the whole thing
Background - history - Past
Facts - current situation - Present
Outcomes - actions to take - Future

White Papers should use a modified SBFO format.

Parts of a WhitePaper
  • Intro
  • Market Drivers
  • Problems
  • Historical Approach
  • Solution
    • Define
    • Benefits
  • Specific Advantages
Exercise: Whitepaper structure on the current state of spam
Definition: cutting edge info (image spam)
Market Drivers: case studies (humber servers crashed and cost them $1M to fix)
History: Trends, Spam Evolution
Solution: Present Trade Marked names of filters
- present technologies that filters rely on (whitelist, bayesian, reporting)
- CBA
Outcome : Pimp a specific technology and filter

Thursday, January 24, 2008

Libpcap

I spent the evening fooling with libpcap. Ive found something strange on my leopard machine that is interesting because it is different from the documentation I am reading.

What is interesting is the pcap_open_live function. When I use a value of 0 for the timeout value parameter, it takes a very long time to capture packets, and I capture them all in a big burst.

eg. when running a descr = pcap_open_live(dev,1,0,0,errbuf); followed by pcap_dispatch(descr,-1,my_callback,NULL);
my program seems hung

When I change to
pcap_open_live(dev,1,0,1000,errbuf);
I capture all the packets that occur in 1 second.

It seems like the timeout value of the pcap_open_live is some sort of polling to some sort of system-level network packet buffer.

I can live with this purpose for my little experiments. However it is noted that top shows higher level of CPU usage when the "polling" value is lower.

DPS912 Lecture 4

Review over the first 2 weeks lectures & labs

Client Server Review

A simple server works on one request at a time and cannot accept new requests until the previous one is done
bad if multiple clients must do stuff... use fork to solve this problem

Sockets
Unix Sockets - local sockets... similar to named pipes must be on the same local machine
Sockets are bidirectional
can use most file descriptor functions like write/close/read/write (NOT open)

Socket descriptors
- use integers like file descriptors
- when using sockets use 2+ descriptors
- - 1 descriptor is just to establish connections
- - 2 descriptor is for actual data transfer
- - more descriptors for more simultaneous clients

Basic functions
  • socket - used to create the socket
  • bind - used to name a socket SERVER FUNCTION
  • listen - used to create a listen queue SERVER FUNCTION
  • accept - used to accept a connection from a client socket SERVER FUNCTION
  • connect - used to connect to a server CLIENT FUNCTION
  • read - or recv
  • write - or send
  • close
Error Handling
Important to check for errors in C
the return value of a function says "error occured" but that is all
use errno to get the exact error description
error codes are stored in errno.h
can use strerror(errno) to get the english representation of an error number

Wednesday, January 23, 2008

DPS906 Lecture 5

Path Searching

Efficient searching
How do you eliminate parts of the search 'universe?'

Uniform Cost Search
- always finds the optimal solution if a solution is found
- sacrifice to these benefits is the cost of getting to a state is minimized
- - G is used a cost function
- - in our example it is total cost of travel from beginning to current position
- expand the search based on smallest total cost
- to stop: a)no more nodes to consider b)goal reached & cost of others is > goal cost

Greedy Search
- Use a heuristic to guide search
- not guarenteed to be optimal
- estimate remaining cost (call the function which does this h)
- guide search by minimizing h
- can get stuck

A*
Best first search : one can find the optimal solution to a search with A*, rather than greedy
searches which cannot be proven to find the most optimal solution to search needs
can be used for path finding, and also other searches
Basically build a tree and apply the A*
- best of greedy + uniform cost

A* uses the same algorithm as the other two
- uses cost & heuristic
- heuristic must be valid estimate of cost
- - cannot overestimate straight line distance is good

To represent a graph
- sparce matrix - quicker, lots of RAM
- adjecency list - less ram, slower

http://en.wikipedia.org/wiki/A*_search_algorithm

Tuesday, January 22, 2008

BTS830 Lecture 4

Chapter III: Decision Making Methodology

Economics of Infomation

Theories involving scarcity of resources, and unlimited desires in relationship with design devel manufacture and delivery.

Transaction cost theory (difference between cost of IT transaction vs size of firm).
eg transactions are very expensive for small firms; transactions are cheap for large firms

Agency theory: as the firm grows the number of people that act as agents for the firm increases. as the business grows the cost:hire ratio becomes 1:1.

Why measure IT performance?
Allow you to assess the business value.

Measures of IT Business Value
financial performance - count dollars
business performance - efficiency
strategic performance - comp advantage

Business Value
1: identify the objectives of IT investments
2: select measures to assess each objective (more than 1 is better)

Slides have measures for financial/business/strategic

BTR820 Lecture 4

Grammar: Ideally you can read only the headings and get the gist of the whitepaper. I does hate on grammer!

More review

Passive Voice
Sounds pompous, hides the subject.

In English, we put our most important words at the front of the sentance, passive voice mixes up normal english "I need to go to the bathroom" vs "The bathroom needs to be gone to by me."

Passive Voice Rules
passive voice is very formal (used by scientific papers)
use we or our which is semi-formal and good for most purposes
sometimes use I which is informal and is sometimes suitable

Wretched
  • Got
  • Affect
  • Utilize
  • Accept
  • Then / Than
  • Supposed to
  • Used to
"The effect, an affect."

Jargon
define jargon once per chapter
Do so the first time you use the acronym
"Voice Over internet Protocol(VoIP) is a radical ..."
"Digital Rights Management (DRM) is ..."
avoid defining well known acroynms (IBM)

avoid computerese
nouns used as verbs (trash the files, boot the computer, firewalling would help)
uncommon words
telephony, connectivity
anything like lol, :), ROFL, u, i, etc.

If it can be said in smaller shorter words, do it. Brevity is the soul of wit.

Academic dishonesty
Very, very bad.

Kinds
copying answers
lying about the work you did
plagerising
Representing someone else's words/ideas as your own
  • writing
  • words
  • ideas
  • research
you do not need to cite common knowledge

types of plagiarism
- word for word
- summary
- citation

Saturday, January 19, 2008

DPS906 Code

We got our assignment for DPS906 yesterday, and found out that Cathy will not be releasing the source of the screen rendering code; though she is releasing the source of the basic game. Cathy instead gave us borland compiled .obj files instead of 2 source files. This is unfortunate.

Cathy isn't releasing the sources because they are the 'answer key' to several difficult 3rd semester courses, and teachers of the 3rd semester would not be happy if she released them.

Luckally, I have code which has an api nearly similar to cathy's code (my answer to the 3rd semester questions in fact... they differ slightly from the answer key in that my code has more functionality and I use references and keep the dynamically allocated data under control by my library rather than letting the programmer do it).

I spent all night and a few minutes today (slaving for 8h pulling my hair out on a small data setting matter, 5minutes today with a eureka moment) to get cathy's game engine running with my ncurses/conio library. Now I have all the source I need to compile with gcc/cl etc.

Perhaps I should release this source code to the rest of the class (technically they should already have it).

Friday, January 18, 2008

Communist Manifesto Chpt 1 & 2

My thoughts

Sometimes I wonder if Marx & Engels are arguing for or against the bourgeois, "The bourgeoisie, wherever it has got the upper hand, has put an end to all feudal, patriarchal, idyllic relations," isnt an end to patriarchal feudalism bad, and were they really idyllic?

I have a post-industrial mindset towards this text, and I am constantly thinking about "who are the bourgeois of our society; who are the Proletariat?" Am I the bourgeois, & am I soon to become a member of the meritocracy elite?

I find it incredibly interesting that I can relate to this document still. The words "The history of all hitherto existing society is the history of class struggles" are true.

Telekinetic Dreams

"Telekinesis
To dream that you are telekinetic, represents a higher level of awareness and consciousness. You are not utilizing your full potential and need to start putting your stored energy levels and mental abilities to use. In other words, your dream may imply that you need to put your thoughts into action. For some, dreams of telekinetic powers may indicate your latent paranormal abilities."

Interesting since almost every dream I have involves me having telekinetic powers. It reaffirms my belief that I have supernatural powers, Heroes is about me baby!

DPS906 Lecture 4

We went over the Assignment Specs

Alpha-Beta Pruning
Root Node: Initially our minimum value is neg-infinity. Our max value is infinity
keep going down each node having -+infin until we hit leafs

When we hit our first leaf (assume parent is maxinode) the value of Alpha is set, and we set for each leaf. ... our alpha and beta will be exactly the same for the first pass [6,6]

When you walk up from this, (now at a mininode) alpha beta of this node is [neginfi,6] we walk down (maxinode to leaf) to the very first leaf and see that the value is 8, this means that at a minimum our maxinode will be 8... it might be more, but it doesn't matter at this point.

describing w/o pictures is very difficult.