Sunday, May 3, 2009

Honda Civic Sales Chart

I'm currently looking to buy a Honda Civic Sedan LX. I was trying to predict whether Honda will extend certain incentives they have in place, so I made this chart of Honda Total Car Sales and Civic sales over time. Maybe someone'll find this useful...

All data is from here:
http://hondanews.com/categories/1090/releases/3888

Thursday, March 26, 2009

Hackintosh setup Part 1 - Introduction

edit: apologies for the constantly updating pages. I keep thinking of how to format this so it's easiest to follow.

Hackintosh Install Guide Contents

Part 1 - Introduction
Part 2 - What You'll Need
Part 3 - Installing OSX
Part 4 - Additional Notes

I've recently been messing around with trying to install OSX on my PC. There's a ton of information on the internet, however, the problem I ran into is that this information isn't easy to sort through. There's a huge number of forum posts dealing with the various hardware combinations that people have, and it can be pretty overwhelming. An additional problem is that many of the people at the forefront of hackintosh developement are based in Asia or Europe and english is definitely not their first language.

I am not an expert on setting up a hackintosh, but I figure if I put up the setup procedure that I used for my system, someone out there might find it useful. Something that drove me crazy is that there are a bunch of tiny details that need to be paid attention to, but is hardly ever mentioned in other hackintosh guides. I'll try to highlight the ones that gave me trouble.

Hackintoshes are notoriously picky about what hardware and what drivers are used. This contributes to the fragmented nature of install guides on the web. What may work for one person's hardware may not for another. The process I used here should be applicable to a wide range of hardware, but will be the most help to those that have my same motherboard. I will be posting the kexts and boot files I used.

My hardware:
Gigabyte GA-G31M-S2 motherboard
2x2GB DDR2-800
ATI Radeon HD4850
Sound Blaster Audigy 2 Value
PS/2 Microsoft Internet Keyboard
USB Microsoft Intellimouse
Maxtor 80GB IDE HD
Pioneer IDE DVDRW

To start, here are the resources I used:
insanelymac.com - A lot of info here, but the forums are a pain because it isn't easy to find. The best you can do is use the forum search and read the stickied posts in the relevant sections. The wiki there is not really up to date or written well, so don't expect much from that.

menoob Hackintosh tutorial - This is the process that I basically followed.

bassheadtech tutorial - Another similar tutorial which was also helpful.

google.com - Yeah, I know should be obvious, but unfortunately people are lazy and need reminding. Don't underestimate how useful google can be to help you solve your install problems. If you're getting an error, chances are high someone else has experienced that same error already. The two guides posted above were found with google, and the solutions a number of driver problems I had were also found via google.

Tuesday, February 24, 2009

fucktards

I work with this guy who is a total slacker. Now, although I generally find lazy people contemptible, that in and of itself is not enough to seriously annoy me. What frustrates me is that I actually have to work with this douche. To this dumbass, I just want to say: I understand what we're doing is not the most glorious project ever, and I'm sorry your career isn't going as swimmingly as you would like, but tough shit man. It's not like you're the only person with a lame job. You don't have to be a dick about it and talk over me every time I say something. And even when I'm not even fucking talking to you, you try to talk over me. Fuck you man.

Thursday, January 8, 2009

Buffered java.io.RandomAccessFile

Now for some total randomness. I'm posting this because I know someday, someone, somewhere out there, will come across this exact same problem and will google for it. The solutions I found via google were meh, and I know I would've liked to have this. So I post this for the children of the future (unless Sun gets its act together).

/**
*  A subclass of RandomAccessFile to enable basic buffering to a byte array
*  Copyright (C) 2009 minddumped.blogspot.com

*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.

*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.

*  You should have received a copy of the GNU General Public License
*  along with this program.  If not, see .
*/

package ed.javatools;

import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.IOException;

/**
*
* @author minddumped.blogspot.com
*/
public class BufferedRaf extends RandomAccessFile {

 public BufferedRaf(File file, String mode) throws FileNotFoundException {
  super(file, mode);
  bufferlength = 65536;
  bytebuffer = new byte[bufferlength];
  maxread = 0;
  buffpos = 0;
  sb = new StringBuilder("0");
 }

 private byte[] bytebuffer;
 private int bufferlength;
 private int maxread;
 private int buffpos;
 private StringBuilder sb;

 public int getbuffpos() {
  return buffpos;
 }

 @Override
 public int read() throws IOException {
  if (buffpos >= maxread) {
   maxread = readchunk();
   if (maxread == -1) {
    return -1;
   }
  }
  buffpos++;
  return bytebuffer[buffpos - 1] & 0xFF;
 }

 public String readLine2() throws IOException {
  sb.delete(0, sb.length());
  int c = -1;
  boolean eol = false;
  while (!eol) {
   switch (c = read()) {
   case -1:
   case '\n':
    eol = true;
    break;
   case '\r':
    eol = true;
    long cur = getFilePointer();
    if ((read()) != '\n') {
     seek(cur);
    }
    break;
   default:
    sb.append((char) c);
    break;
   }
  }

  if ((c == -1) && (sb.length() == 0)) {
   return null;
  }
  return sb.toString();
 }

 @Override
 public long getFilePointer() throws IOException {
  return super.getFilePointer() + buffpos;
 }

 @Override
 public void seek(long pos) throws IOException {
  if (maxread != -1 && pos < (super.getFilePointer() + maxread) && pos > super.getFilePointer()) {
   Long diff = (pos - super.getFilePointer());
   if (diff < Integer.MAX_VALUE) {
    buffpos = diff.intValue();
   } else {
    throw new IOException("something wrong w/ seek");
   }
  } else {
   buffpos = 0;
   super.seek(pos);
   maxread = readchunk();
  }
 }

 private int readchunk() throws IOException {
  long pos = super.getFilePointer() + buffpos;
  super.seek(pos);
  int read = super.read(bytebuffer);
  super.seek(pos);
  buffpos = 0;
  return read;
 }
}

Some notes:
1) This is only for buffered reading.

2) Most read type methods in RAF end up calling read(), so read() is the only method that really needs to be overridden. The exceptions are the read(byte b[]), read(byte b[], int off, int len), readFully(byte b[]) and readFully(byte b[], int off, int len) methods. They end up calling a private readBytes method. It's probably not a big deal, since in those methods you're asking for a byte array anyway, but it will throw off the buffpos file pointer!

3) If you're calling lots of readLine(), the readLine() in the original RAF sucks. It constantly creates a new StringBuffer object which is unnecessary and can really slow things down. In my class, I reuse a StringBuilder and just delete the contents. Unfortunately, for some dumbass reason, readLine() is final, so my method is readLine2(). From a simple test of reading through a file using readline, I find the performance is nearly the same as using BufferedReader.

4) people on the Sun Forums are total fucking douchebags. Don't ever go there looking for help.

Thursday, December 25, 2008

still here

I feel like I should post something, since it's been over a month since the last post. Although there's still way more in the Democracy is Overrated series, I think I'll put that on hold for a bit.

Sunday, November 2, 2008

Democracy is Overrated part 2

The vote of each person in this video counts as much as your vote.

Thursday, October 30, 2008

Democracy is Overrated part 1

It's that time again to exercise our civic rights and vote for whatever nonsense is on the ballots this year. Whenever I look at my voter pamphlet, I'm always bugged by this question: "Does anyone actually read this crap?" I'm not talking about the half page proponent/opponent summaries, I'm talking about the multipage, small-print legalese stuff in the back. I'd put money down that nearly no one does. It bothers me that people, who aren't fully informed, are allowed to vote on these matters. Doesn't that seem ridiculous to anyone?

I argue that, at a minimum, someone who is contributing to a decision that affects tens of millions of people in a state should at least read the god damn legislation. That's at a minimum. I think in order to make a fully informed decision, one would have to be somewhat informed in relevant current details of the state.

Say, in your household, you're faced with the decision of whether to buy a new car. Would you do that without looking at your complete financial position?How much is the monthly payment and where is the money coming from?

When it comes to deciding whether to fund measure XYZ, shouldn't people be putting in the same amount of research and thought into that? What's the current financial position of the state? What's the current annual revenue? Where's the money to fund this measure coming from?

The reality is, not many put that much thought into this. People tend to vote whatever their party's position is. They read the measure summary and base their decisions on that.

It just seems to me, allowing decisions affecting millions to be decided by people not equiped to make the most informed choice isn't rational.

Friday, October 17, 2008

Practical experience

I've been taking these martial arts classes for the last year. The gym I'm taking the classes at offers a pretty wide range of arts. I've just been taking the panatukan, or philippino boxing, I'm enjoying because it's like dirty boxing. Anyway, even more recently, for the past few months I've also been taking the weaponry class.

The weaponry class is basically a series of drills. It looks freak'n cool when done right, but I've been wondering recently what the practical value of it is. I mean, seriously, when's the last time you heard of two people fighting with sticks or machetes? And if I'm ever in a knife fight, I'm looking to run at the first opportunity.

Maybe I am better off having this little tid bit of extra knowledge compared to your average joe, but I really have no idea where I stand. Maybe there's a weaponry sparring class I can take, or maybe I should be randomly starting knife fights with people...

Tuesday, September 16, 2008

Is it just me?

Most of the friends I've made in Seattle are people I work with. They're an alright bunch, and I do enjoy hanging out with (most of) them.

I sometimes wonder, though, what the hell is up with their other friends. Occasionally, I'll meet some of them, and I think "these guys are tools." What I don't get, is why my friends, who I like, hanging out with such douchebags? It makes me wonder if maybe I just don't know my friends that well. I still feel like I'm the new guy, so I don't think it's really my place to mention I think these other guys are asshats.

Of course, an alternative that I'm forced to acknowledge, is that maybe I'm the problem! Maybe I'm the jerk, and I just don't get along with other people very well.

Unfortunately, I don't see any solution to this question. I don't have any really close friends here that I can confide in to figure out if I'm just being a hardass. I guess that's part of why I started this blog, so I can ramble into the void of the internet.

Thursday, September 11, 2008

People in Seattle are cheap

I've been in Seattle for over a year and a half now. During my time here I've observed certain behaviors of people here, each of which is insignificant, but taken together have lead me to this conclusion: People in Seattle are cheap. BTW, when I say "cheap," I don't mean thrifty. I mean definition number 7 on answers.com:

Cheap
adj., cheap·er, cheap·est.
7. Stingy; miserly.

What finally coalesced my thoughts on this, was that yesterday, I overhead some coworkers talking about how they should find a time to dumpster dive, discussing what the best places were to dumpster dive and how great dumpster diving is. Dumpster diving. Seriously? WTF?! Ok, usually, overhearing something like this wouldn't really make me draw any conclusions. I'd probably think, "Ok, that's... odd. But whatever floats your boat." The thing is, this isn't the first time I've heard Seattleites talk about the awesomeness of dumpster diving. The last instance, was during a work retreat, where a different person mentioned it. I remember being dumbfounded that I was the only person in the van who seemed to think dumpster diving was odd. Everyone else just accepted it as the most normal thing in the world.

I remember the very first incident that gave me the impression of Seattleites being cheap, was within the first couple of weeks of coming to Seattle. The person in charge of birthdays was collecting some money to get a gift for someone in the workplace. Well, the next day, I overheard (No, I don't intentionally eavesdrop. People just talk really f'n loudly) someone talking to the office manager, complaining about having to contribute $5 to everyone's birthday and that they really didn't want to do this anymore. After that, the policy of getting the birthday person a gift ends. I understand people might not be raking in the greenbacks. But come on, seriously? $5 for everyone in the office is $60 a year.