Mitch's World http://mitchellhashimoto.com Wed, 02 Apr 2008 18:51:24 +0000 http://wordpress.org/?v=2.2.1 en Goodbye Apple, Hello… Oranges? CitrusByte! http://mitchellhashimoto.com/goodbye-apple-hello-citrusbyte/ http://mitchellhashimoto.com/goodbye-apple-hello-citrusbyte/#comments Mon, 31 Mar 2008 17:25:30 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/goodbye-apple-hello-citrusbyte/ Today is the last day I work for Apple. I put in my notice to quit! But let me make it clear that this is not for negative reasons; Apple was and is a very good company to work for. The benefits were good, the hours were flexible, and the people were very cool. But I was working in retail, where I obviously don’t want to be!

A few weeks ago CitrusByte contacted me, offering me a position as a web developer. I flew down to Los Angeles to talk with some of their team, thought they were cool people, and they must have thought I was an okay guy myself because I am now working for them. :)

Funny thing is I seem to be following fruit companies… Apple… Citrus… what next?

]]>
http://mitchellhashimoto.com/goodbye-apple-hello-citrusbyte/feed/
Priorities… Priorities… http://mitchellhashimoto.com/priorities-priorities/ http://mitchellhashimoto.com/priorities-priorities/#comments Thu, 27 Mar 2008 20:05:47 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/priorities-priorities/ I have received a few emails here and there asking whether I was hit by a truck or possibly assassinated by a squad of ninjas. As exciting as the latter sounds, both are false. I am here; I am well. The past 4 weeks have been intensely packed with school, work, and personal projects. And last week was finals week, which is always insane. I’m a few days into spring break now and I can safely say that all is calm. I have some work to get done here and there but I am very exciting to get right back into everything. But the problem is… how do I prioritize this?

Its a rhetorical question and I don’t expect answers. And I won’t just say all the things I want to do, since over half won’t get done.

This post is more of a plea to any scientist who may be able to clone me or introduce me to time travel so I can get double the work done. Thank you. :D (And if such a scientist could send me the API for interfacing with said time machine, I will program you wonderful things)

On a more serious note: Meaningful blog post soon.

]]>
http://mitchellhashimoto.com/priorities-priorities/feed/
Cocoa Distributed Objects are Too Easy! http://mitchellhashimoto.com/cocoa-distributed-objects-are-too-easy/ http://mitchellhashimoto.com/cocoa-distributed-objects-are-too-easy/#comments Thu, 14 Feb 2008 23:22:40 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/cocoa-distributed-objects-are-too-easy/ A little background information: The post below I talked about creating iFishes, the Mac memory editor application. The big hurdle during the process of writing this application has been that in order to search another application’s memory, it must be run as root. And I’m not crazy enough to request a user for permission to run the entire iFishes application as root (too many security risks)!! So I cleverly (if I do say so myself) split the program into two, with one utility which runs as a background process which handles all the memory searching (and runs as root). The problem which this introduces is one which, coming from a windows world, is non-trivial: Interprocess Communication.

I immediately turned to Apple’s amazing developer portal for guidance. I was given a nicely formatted list of available options for process communication such as BSD sockets, shared memory, etc. It noted that if you’re using Cocoa, Distributed Objects is the way to go! So, trusting Apple, I said “Okay!”

Now let me say: Distributed objects are the coolest things ever. I said it. I usually try to stay away from absolute statements such as that, but it’s true. (Well to be honest, I would say they are on the same level as Core Animation)

Basically, distributed objects allow one process to “vend” one of it’s objects. Then another process can receive this vended object and use it as if it were in the same memory space! Example:

Process A has an object:

@interface MyObject : NSObject {}
- (void)someMethod;
@end

Let’s assume Process A “vends” this object. And that Process B receives this object. Now somewhere in process B it can just do this:

- (void)someRandomMethod {
    // Assuming distantObject is an instance variable created earlier from the vended
    // object from Process A
    [distantObject someMethod];
}

That’s it!!! Cocoa handles all the underlying messaging between the processes. Amazing. AMAZING.

]]>
http://mitchellhashimoto.com/cocoa-distributed-objects-are-too-easy/feed/
“Busyness” to Infinite http://mitchellhashimoto.com/busyness-to-infinite/ http://mitchellhashimoto.com/busyness-to-infinite/#comments Tue, 12 Feb 2008 19:04:38 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/busyness-to-infinite/ Life has gotten super busy the past few weeks. Here is a brief overview of what’s been keeping me busy:

  • New Zend Screencasts - There is not much more I can say right now other than that…
  • AutoUW release imminent. - If my roommates have notified me correctly, registration is in a few weeks. Therefore, further polishing and preparing for release of AutoUW must be done.
  • A new project: iFishes - I have been working on a new project, that being a Mac OS memory editor similar to Windows’ ArtMoney. More information will come on this soon, as this program is also nearing testing quality.

In addition to these personal projects, I continue to work at the Apple Store and also am a full time student. Where do I find the time?!

]]>
http://mitchellhashimoto.com/busyness-to-infinite/feed/
My Thoughts On FileMaker’s Bento http://mitchellhashimoto.com/my-thoughts-on-filemakers-bento/ http://mitchellhashimoto.com/my-thoughts-on-filemakers-bento/#comments Sat, 09 Feb 2008 04:36:22 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/my-thoughts-on-filemakers-bento/ One of the hot new products out for Mac (or at least heavily advertised products) is Bento by FileMaker. I’ve been receiving emails about, I’m getting slammed with information about it at work, and I just keep hearing “What is Bento?” So I finally downloaded myself a trial copy and began playing around with it. This is not a review, these are just some quick thoughts and answer the biggest question: What is it? If you’re looking for a review, a quick google search will reveal many.

What is it?

FileMaker says its a personal database. Too bad that for a user-friendly application, this doesn’t say much. But Bento actually is that powerful… it can store almost ANYTHING in an organized way (a database!). How would I use it? Well, I would use it for programming projects. For each programming project there is some information I’d like to store: A goal, a start time, some references to documents for research, etc. Also, I’d like to store notes on progress of the project as I work on it, so I know what was last done and what still needs to be done. Also, I would like another database to store information about my classes, including teachers, office hours, course URL, homework assignments, etc. There is no other program out there I know of which has the flexibility to create such a database so easily. If you want a custom database, Bento is for you.

What needs improvement?

Here is the reason I don’t use Bento: I can’t take it with me. It’s the same reason I didn’t use iCal before I had an iPhone! I thought iCal was great, I could store my appointments, classes, work schedule, homework, etc. Awesome! But all this information became useless as soon as I left my computer. What if I needed to modify it? view it? add to it? I couldn’t without my computer. Useless, for myself.

This is the same with Bento. I LOVE the organizational techniques of Bento, and I would love to use it to further enhance my homework planning, project management, etc. but a lot of times I need to access this information away from my computer. So I will say this now: As soon as Bento has a companion application for the iPhone (hopefully when the SDK comes out this month), I will use Bento, and I will love it.

Until then, Bento fills a very specific niche.

]]>
http://mitchellhashimoto.com/my-thoughts-on-filemakers-bento/feed/
Gotta Look Good http://mitchellhashimoto.com/gotta-look-good/ http://mitchellhashimoto.com/gotta-look-good/#comments Tue, 29 Jan 2008 00:12:31 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/gotta-look-good/ My entire website has had a face lift! There are still some links and such which aren’t going to be working for a little while but for the most part the website is working! A few changes:

  • Easy blog category navigation on the left
  • You can now browse by month and year (archives)
  • Search capabilities! In the upper left box just enter your search query and press enter.
  • Pretty comments. (Hey, it was important to me)
  • Easier to navigate main navigation up top.
  • Easier to read blog entries.

For the most part this was a huge usability update. I loved my old design, but I needed something that was easier to expand, easier to navigate, and more integrated.

Enjoy the new look!

And I understand many pages are broken or missing. This is being looked into and I am fixing the pages one by one. Sorry for the inconvenience! Especially zend screencasts!

Thanks to Thuiven Design for the wonderful look.

]]>
http://mitchellhashimoto.com/gotta-look-good/feed/
AutoUW: A Preview of What’s To Come. http://mitchellhashimoto.com/autouw-preview-post/ http://mitchellhashimoto.com/autouw-preview-post/#comments Fri, 18 Jan 2008 22:00:00 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/autouw-preview-post/ I mentioned back on new years that I had an automated registration tool for the university of washington coming. This is not a lie. I am here today to show you a bunch of preview screenshots of AutoUW and exactly how it works. AutoUW is easy to use and is very reliable. I used this tool this quarter to grab a couple of my classes and it worked wonders. AutoUW will not drop courses for you. This is for your own security. AutoUW will only add courses. :) When will it be available? Before next quarter. :) That is all.

To see all the screenshots and AutoUW in all its glory, then click read more at the end of this post!

(more…)

]]>
http://mitchellhashimoto.com/autouw-preview-post/feed/
My UW Notifier Blocked! Temporarily ;] http://mitchellhashimoto.com/my-uw-notifier-blocked-temporarily/ http://mitchellhashimoto.com/my-uw-notifier-blocked-temporarily/#comments Wed, 09 Jan 2008 22:31:15 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/my-uw-notifier-blocked-temporarily/ So my program has an automatic internal test suite built into it which runs once a day, just to make sure that it is working correctly, which it has been for the past couple months. I was surprised today to receive a text message from my application which said it was “broken!” Further research and it seems that MyUW now forces you to log in to view SLN information. This renders my UW notifier broken, for the time being.

Lucky for you guys, and unlucky for UW, I already have the code written to automate logging in. So, sorry if you’re waiting for a text message for a class opening now, because you won’t get it.

But I promise this program will be completely up and running before next quarter. :) They can’t stop us that easily.

]]>
http://mitchellhashimoto.com/my-uw-notifier-blocked-temporarily/feed/
Unit Testing WebView Objects in Cocoa http://mitchellhashimoto.com/unit-testing-webview-objects-in-cocoa/ http://mitchellhashimoto.com/unit-testing-webview-objects-in-cocoa/#comments Wed, 09 Jan 2008 20:03:38 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/unit-testing-webview-objects-in-cocoa/ Another subject which revealed no results in Google for me was how I was supposed to possibly test my models which interfaced with the web. My models use a WebView object to talk with various servers (for my UW auto registration program). Like I said in a previous post, I have implemented quite a bit of unit testing to make sure that my code continues to run smoothly. However recently when I was writing some more testing code, I realized the most important thing of all was not being unit tested: the MyUW interfacing.

Let me give a bit of a run through of what the process for using a WebView is, at least with my objects. I set my model to be a WebView’s delegate, make a request, and wait for the WebView to kick back a webView:didFinishLoadingForFrame: method. What this means is that all my web requests are asynchronous, and do not freeze up the main thread or GUI thread, which is why my program is able to run so smoothly. But this blessing is also a curse. Because the requests to my model return immediately (and a delegate call is made later to report the completion of a request), my tests also complete immediately.

For those not familiar with unit testing, let me show you a method from one of my unit tests which checks the MyUW authenticator:

- (void) testLoginDoesWorkWhenShouldWork
{	
	expectedResult = YES;
	[auth authenticateWithId:GOODUSER usingPassword:GOODPASS];
 
	// OH NO! How do I test the result?!
}

As you can see, the test ends… without being able to assert the result I needed to get. My first thought was to use a separate thread to run the authenticator class… which I tried. And this didn’t work. I was stumped! A bit more debugging revealed that the WebView was not even loading the URL!!! WHY?!! (These capitalizations do not even begin to correctly represent the frustration I was experiencing at this point.)

Now, let me tell you a strange fact about myself: When I have a problem, I have a very convenient way of solving it in my sleep. So when I woke up this morning, I was more or less not surprised that the solution was so clear in my head: Because the WebView is event-driven, I need to initialized a Run Loop, or else the events won’t be processed! And because this code is running within a unit test thread, and not within an NSApplication, I didn’t have the luxury of a run loop being made for me (NSApplication creates a run loop for you).

So here is the final code (more or less, I removed some method calls and copied them into this code to make it easier to read) which successfully tests the code:

- (void) testLoginDoesWorkWhenShouldWork
{	
	// 1.) Run the authentication with the expected result being a success
	expectedResult = YES;
	[auth authenticateWithId:GOODUSER usingPassword:GOODPASS];
 
	// 2.) Initialize and loop an NSRunLoop UNTIL WE GET THE RESULT
	// The gotResult flag is modified in the delegate method below...
	gotResult = NO;
	BOOL isRunning;
	do {
		NSDate* next = [NSDate dateWithTimeIntervalSinceNow:1.0];
		isRunning = [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
											 beforeDate:next];
	} while (isRunning && !gotResult);
}
 
// This method is called by the MyUW authenticator object automatically
// when the authentication is complete. Result is a boolean which is... obviously...
// the result.
- (void) didFinishAuthenticating:(BOOL)result
{
	STAssertEquals(expectedResult, result, @"Authentication did not get the expected result.");
	gotResult = YES;
}

I hope this helps relieve some headache for people in the future.

]]>
http://mitchellhashimoto.com/unit-testing-webview-objects-in-cocoa/feed/
Using OCMock with Xcode 3 in Leopard http://mitchellhashimoto.com/using-ocmock-with-xcode-3-in-leopard/ http://mitchellhashimoto.com/using-ocmock-with-xcode-3-in-leopard/#comments Tue, 08 Jan 2008 02:52:39 +0000 Mitchell Hashimoto http://mitchellhashimoto.com/using-ocmock-with-xcode-3-in-leopard/ I recently ran into another “programmer’s block” similar to when I was trying to get SVN working with mediatemple. So I am posting this to share my solution.

I am a big fan of unit testing, always have been, but I am not a test driven developer. I merely like including as many unit tests to test my code as possible. It makes me feel better about what I write. So, recently, with my ever-growing cocoa apps (see post below), I decided to begin including unit tests so that I feel better about the growth. Along with unit tests I needed mock objects to simulate a WebView for my models. Although the SenTeskingKit is included with XCode, OCMock, the mock object framework, is not.

Although I got unit testing working very easily following this guide here, I was having a lot of trouble getting the OCMock framework working. I first tried copying the framework into my project folder and linking it within the unit tests target, but that didn’t work. It would cause my app to hang. After checking the logs, I saw this:

/Developer/Tools/RunUnitTests:209: note: Running tests for architecture 'i386'
2008-01-07 18:50:59.461 AutoUW[2405:10b] Error loading /Users/mitchellh/Desktop/AutoUW/build/Debug/UnitTests.octest/Contents/MacOS/UnitTests:  dlopen(/Users/mitchellh/Desktop/AutoUW/build/Debug/UnitTests.octest/Contents/MacOS/UnitTests, 262): Library not loaded: /Library/Frameworks/OCMock.framework/Versions/A/OCMock
  Referenced from: /Users/mitchellh/Desktop/AutoUW/build/Debug/UnitTests.octest/Contents/MacOS/UnitTests
  Reason: image not found

Even though I was adding the project directory the fallback framework path, it wasn’t searching it. I’m still not sure why. But anyways, if you follow the error and just add the OCMock.framework file to the /Library/Frameworks directory and compile, it works fine.

I hope this helped anyone else that may be having this issue.

]]>
http://mitchellhashimoto.com/using-ocmock-with-xcode-3-in-leopard/feed/