May 11 2012

Graham’s Scan

Luthi

Last Friday I attempted my implementation of Graham’s Scan. My C++ is a bit rusty since I haven’t used it since the fall. Last term was all C, but we were doing with it was different enough to make me a bit rusty. The project isn’t due until this Monday so the plan was to get the following coded:

1. Write the point class for holding the coords and the doing the math needed – mostly cross product and distance.

2. Input the points coords from the given files – we were given 6 different sets. To make it easier on the grader, I made a switch statement so all they have to do is type the # of the file and it passes the file name to the input function. I’m nice like that.

3. Write and test the function that finds Point 0 – the point with the smallest Y coord. And if there is a tie, to choose the one with the smallest X.

4. Write and test a merge sort that sorts the remaining points by polar axis to P0 by calculating the cross product (the vector of P0Pi x the vector of P0Pj). If positive Pi goes first and if negative Pj goes first.

Midnight. This is where I hit a brick wall. Or more specifically this part of my notes: if two points have the same polar angle, throw out the one with the shortest distance to P0. Fuck. I was using an array of point objects. Doing it in the merge sort might have worked by just ignoring it and not copying, but not if it was the last element and then you have issues with the size. I might have gotten it to work correctly, but it seemed more trouble than it was worth.

So which container to use instead? A vector would be the easiest to implement, but will it work? A linked list would be a lot more complicated, but would work better. I opened a new project and started over using a linked list.

1am: eff this. I need to sleep on it. I have an assignment due this week that I haven’t even looked at yet. Not to mention personal obligations. There really are only so many times a person can not show up to social events before people stop asking.

8am: I should just try a vector. Just to see what happens. By 1pm I had a fully working version including the merge sort! Which left enough time to go to the market, stuff some strawberries and go to the cinco de mayo party.

Would a link list be better? Yeah. But I think it would have been overkill for the assignment. There are only 18 set of points in the largest file, so the copying of merge sort isn’t a big deal. It also doesn’t matter if I rearrange the points since the only thing I’m doing with them is this. Using a vector is the most efficient way to go in this case.

All I have left to do this weekend is the graham’s scan function. Should be fine.


May 5 2012

Applied Algorithms

Luthi

This class is turning out to be a mix of not as terrible as I thought it would be, yet really effing difficult.

A long time ago I was really good a math. Then they stopped making me take it after geometry in middle school. That was 20 years ago. Art school? That was so basic and I tested out of it. Last year I took a data structures class that touched on algorithms that had me exponentially lost in figuring out run-times. The book was even worse. It was as if they were all speaking a completely different language.

This class? Now I finally understand what they were talking about before. Well… I think so. My algebra is still rusty, but I’m following the math part just fine. Mostly fine.

After spending the better part of 2 years thinking in C++, now I have get to force myself to push all of that aside. The point of the class is to think of the big ideas, not syntax and code details. Write an algorithm that does something specific and prove the run-time without thinking about syntax. Without thinking in code. Write it in English pseudocode.

I follow everything pretty well in class, even the math which is really rusty. But my head keeps getting stuck at “you left out so much of the implementation!” “But you have to link the nodes to….” Damnit.

The first homework assignment question? I paced my apartment for the better part of 4 hours. Then I had 8 more left.

Midterm:
I’m a really horrible test taker. Or at least now I am. Which is kind of odd given that I have a scary good memory. What happens is this: my hands start shaking, a migraine sets in from teeth grinding and my mind goes blank. It’s partly due to going back to school, changing careers, and not being completely sure I’m capable of using the other side of my brain after so many years focusing on art. Which should have gone away now due to how well I’ve been doing.

It has gotten better though. What really helps is a mini meditation right before. I’m a Buddhist (Zen) and one of the teachings is a short breathing exercise to calm down, focus, and bring yourself into the moment.

Luckily the midterm wasn’t so bad. For the most part was following algorithms we went over in class at each step given the input. Merge sort, binary search, coin change, longest common sub-sequence, etc. The issue happened at the end when I came to:

Design an algorithm that given an array where you don’t know the length…. Hold on. If I don’t know where the end is, how can I do anything without it possibly blowing up for accessing memory outside of the bounds of the array? And that is where my brain stayed. Based on the asked for running time, I knew which search algorithm I needed to modify. But I kept getting stuck on the implementation of it. I eventually got it, but it was still frustrating.

Programming Assignment:

All of the work so far has been the higher level thought. This is the one project that we will actually be implementing something. Yay! C++ how I missed you!

The project is to implement the graham’s scan algorithm: computing the convex hull of a set of points with a time complexity O(nlgn). Let’s see how far I can get.


May 4 2012

C2E2

Luthi

A couple of weeks ago was C2E2 (Chicago Comic Con and Entertainment Expo). I was going to go for just an afternoon since I’m not all that big into comics anymore… who has the time for that? The last series I read was Y: The Last Man.

A day to wander around the show room and just geek out for a bit should be enough, right? That’s what I thought until I looked at the panel line up. A few video game panels including one with Coach Tony’s son, Taylor. Did I forget to mention that my Kung Fu coach is Kung Lao (Mortal Kombat 2 and 3) and his son is Kung Lao in the 2011 version? They are both awesome. And oddly it means the gym is filled with nerds. EKF!!!

My plan was to go by myself. Whenever I go to cons with other people, I don’t meet anyone new and I spend far too much of my time coordinating schedules and finding people. This time around I was going to do whatever I wanted and not care about what other people thought of it. Best decision ever. I met so many different people. Had all sorts of different conversations. Comics/art/games/kung fu/school/Buddhism/coding/tech/tattoos/etc. It was bloody brilliant.

Friday:

I spent a good portion of my day just wandering around the show room. What I really mean by that is artist alley. Everything else was just kind of… meh. Like I said, I don’t really read comics anymore. I sometimes flirt with getting back into it, but I don’t know where I’d find the time. I’m already stretched pretty thin. Plus I always read trades and I didn’t see many of them for sale, in my really brief walk through. The tees were over priced and only 1 thing jumped out at me… something about gamer girls not being suitable for normal guys. However it was only available in girl sizes where even the large cut off circulation in the arms for someone who’s done martial arts for 27 years.

What I think is hilarious is that I never once ran into the guys from EKF. How did I miss 5 guys walking around with wushu weapons?

I had a blast in artist’s alley. Where else can you have an in depth conversation about xkcd with artists? I was constantly getting stopped about my tattoos, my xkcd tee (I’m not slacking off, my code is compiling), and the more shocking to me the Buddhist beads I wear. The thing about wandering about alone, you are far more approachable. I think in a few short hours, I filled my talking to people quota. Plus I got to look at awesome art.

The Geek Girl and the Artist: Women’s Perspectives on Geek Culture, Gender Identity and Art/Media:
The only panel I went to on Friday. I’m really going to try and not get all angry feminist on this blog, so bear with me. There are real issues with girls and sexism in geekdom and it was nice to see this panel available. Plus the amount of turnout of the male gender. A lot of points got brought up, but I think it might have been glossed over a bit. Meaning the panelists were a bit too far on the positive side.

For instance, one said that being a geek helped her fit in with her co-workers in her techy job. But I don’t remember anything mentioned that as women we have to prove that we aren’t a fake geek, especially more now thanks to hipsters. They do exist, I’ve met several, and all have been hipsters. Being someone who gets confused as a hipster (black rim glasses, tattoos, piercings, nerdy tees, cycling, and crazy hair), I do actually end up spending quite a bit of time justifying my reasons for being a nerd (seriously?) and ya know.. proving my history of it. For the record, I don’t like apple products, I’m not opinionated about music, I don’t go out much and every hipster I’ve met I’ve found pretty douchy.

I think they also barely touched on the overly sexualized nature of geekdom and the sexual harassment we do have to endure. Especially in video games. You know because we are all fat, ugly or slutty.

On a logical standpoint, I completely understand why they tried to keep it positive. 1. It scares off women who are trying out geekdom to see if they like it. Keeping it positive, mitigates that hesitation. 2. Whenever a woman starts talking about these kinds of issues, we get labeled overreacting and feminist. Proof? Read the comments on this ars post. Constantly undermining our viewpoint based on being an over-sensitive female, sadly makes us second guess ourselves. Or at least hesitate when talking about it.

I tried. I really did.

The free shuttle stopped at 8pm but my panel didn’t get out until 8:30. Boo! So I split a cab to the loop with a bunch of strangers, who turned out to be very interesting and we went out for burritos and beer. Oh that was so needed.

Saturday:

Bringing Video Games to Life: The Men Behind the Motion
Really huge turn out for this. It was really weird watching guys I’ve seen fall on their face in class demo on stage in front of a crowd. Wushu: if don’t fall or hit yourself with your weapon, you aren’t trying hard enough. Just watch the vids I took.

After that I ran around with the ekf people until my next panel…

Behind the Graphics: a Video Game Industry Round Table
The majority of the talk was interesting. They had a programmer, technical artist, art director, animator and a programmer/everything else really indie guy. For the most part it was pretty basic things of who they are, where they work, and how they got into the industry.

The thing that really struck a chord with me was when 2 of them stressed pretty heavily how you have to be the best of the best in order to get a job. I understand how you’d be able to tell the difference with say artists, but how exactly do you gauge that with programming? How about technical artist? The more I learn about the role of a technical artist, the more I see it as a fit. However there is a time and a place for these kinds of discussions. It really didn’t fit into the lighthearted feeling of the rest of it and it never really got expanded.

I’m not a fan of our current culture of praising mediocrity, because it does seriously reduce effort put in. Or that everyone can do anything they want as long as they try, because people are different and excel at different things. I can’t draw myself out of a box and that’s OK. I have a really good eye for photography, but my execution is…decent. I was a really good editor, but I didn’t have the personality for it. I’m too much of an introvert to be constantly networking with people I have little in common with. The majority of the work is contract based and the constant looking for a job was really frustrating. Then I fucked up my wrist. No more motion graphics = death of an editor.

I met up with the ekf guys again for a bit until I had to run off to another panel. This post is already a wall of text so, I’m going to leave it at that.

Sunday:

Chicago Exists! The Games Industry in Chicago
This was an extremely positive experience. While there isn’t all that much of a big industry in Chicago, supposedly the community is really good less about competition. More open and helpful.

They talked quite a bit about IDGA Chicago and that it is open to students. Another was brought up called indie city games. I was going to ask when students should be getting involved, but from everything else they said it seemed like the answer was right away. But… I can’t make even make something other than text come up on the screen. Complex algorithms? Sure. Data structures of c++? Yep. I wrote a ray tracing renderer in the fall, but not how to use it. Yeah. That makes no sense to me either. Basically we did the math/computational geometry/etc for it to show up on screen but not the show up on screen part.

I guess it’s time to put the excuses away and just start showing up to meetings and talking to people.

final thoughts:
I bought a lot of geek art and that was worth it alone. I also have a bit more of a direction to focus on other than just the classes and assignments. Now I really can’t wait for PAX Prime in the fall.


Apr 22 2012

tech news weirdness

Luthi

Here we go.. another night of procrastinating homework. It’s Saturday night.. which isn’t so lame since it’s technically my Sunday because I work tomorrow. Anyways.. I spent most of the day cleaning and at kung fu, so applied algorithms isn’t really something I want to do at the moment. Now I have 1 screen of catching up on The Guild and Zero Punctuation and the blog on the other. I’m such a good multitasking faffer. It’ll get done, done correctly and on time.

A long time ago when my focus was art/film/animation/whatever I had stopped reading tech news. I recently got back into it and all I can say is what the hell is going on?

The patent wars? Seriously? Patents have no place in the tech field. Copyright? Yes. Patents? No. The problem with patents as a non-lawyer sees it, is that they are far too broad which stifles innovation. 1 person makes something cool, patents it, and no one else can take the idea and improve on it. That’s how the tech industry has worked since the beginning. You can’t really call foul this late in the game, especially when your company has done the exact same thing. *cough* apple *cough*.

ebook price fixing? Apple: hey publishers, if you want to sell ebooks for our shiny new ipad (please don’t laugh at the name) that everyone is going to want cause we are apple and we are the hippest shit out there, you have to agree to our terms. Set whatever price you want unlike that evil empire Amazon. We are going to take 30% of every single sale for no reason other than we can, so add that to your price. Oh and you can’t sell them cheaper anywhere else.

See that last part there? That’s against the law. Oops. Enter in the DoJ, European Commission, 16 states and a few class action law suits from Canada. What I don’t understand is where Apple is getting the balls to actually fight this. The line they are trying to stand on is that they were trying to break the monopoly held by amazon and it’s better for the consumer.

I’m a kindle consumer. I don’t want to read a book on a backlit screen, sorry apple. I <3 my kindle. Hard. It is hands down my favourite gadget. I can carry around programming and personal books without killing my back and decide which I want to read during my daily hour long train commute. If I finish a book while on the train? No big deal, hop onto my amazon wish list. I could buy them at 50% off. In comes apple and now books are almost the same price. Fuck you, apple. How is that good for me? I give up being able to lend out books to friends, sell them back, use during open book tests, read during parts of flights, and flip through for reference; and yet I now get to pay roughly the same price? All because you want to take 30% of the sales for your customers.

What they should have done is just opened their ebook store and let their customers overpay. They are used to it anyways. And like everything else, they would have happily bent over and asked for more.


Mar 10 2012

chicken parmigiana in pseudo-code format

Luthi

During my first class (C++ 1), I made a recipe book for a coder who is a disaster in the kitchen. It was his birthday and I wanted to do something cheeky. I thought it was quite nice and clever at the time.

I got the idea when the professor was explaining things based on recipes. Ingredients go first (variables and function prototypes) and then the instructions. That comment stuck with me.

I could have written it more accurate in the code part, but it was more of a cheeky and silly project. As in the instructions could have been the actual functions instead of the prototype + comments, but I wanted to keep it simple and under a page long.

//Chicken Parmigiana
 
int main()
{
	int eggs (2);
	int chicken (1), shredded_mozzarella (1), marinara (1), 
        grated_parmesan (1); //packages
	int dry_bread_crumbs;
	int crisco;
 
	void prep(int crisco);
	//preheat oven to 350 degrees
	//lightly grease baking sheet
 
	void chicken_prep(int& chicken, int eggs, 
        int dry_bread_crumbs);
	//cut chicken into smaller strips
	//place eggs into a bowl
	//put bread crumbs into another bowl
	//dip chicken into egg, then crumbs, and put on baking sheet
	//bake 40 mins.
 
	void combine(int& chicken, int sauce, int shredded_mozzarella,
        int grated_parmesan);
	//pour 1/2 the sauce into a baking dish
	//place chicken over sauce
	//cover with sauce
	//sprinkle with cheese
 
	void cook(int& chicken);
	//start pasta now
	//cook chicken for another 20mins
 
	return 0;
}