Thursday, December 10, 2009

Hackintosh setup...

Ugh. Just realized I never finished the Hackintosh setup guide... I'll hopefully get around to it one day. The information to setup osx on a non-mac is available all around the web, it's just that the information is generally very poorly consolidated. Given the huge variety of system configurations, this is understandable. I was just hoping I could help those folks out that have similar configurations to my own. Anyway, like I said, hopefully I'll get back to it later on.

Wednesday, December 9, 2009

Thunderbird 3 already is beginning to piss me off

Search sucks. I search for "waters" and everything with "water" shows up. I put "waters" in quotes, and STILL everything with "water" in the text shows up. WTF. The default search results page sucks. Who the fuck thought it was a good idea?

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.