Macintosh Factory

No Comments

This is the coolest thing I’ve ever seen in my entire fucking life! I wanna own a factory like this one some day :)   

[Quickies]Shaking a NSWindow

No Comments

On the Mac OS X login window, when you don’t type the right password, the window shakes. It’s a very cool and classic way to tell people the password is wrong. Even WordPress copied it. You can reproduce the same behavior on an ordinary NSWindow with just 7 lines of code! Here’s how it works:

//Gets the window rect
NSRect rect = [window frame];
//Shake offset amount
int amount = -10;
//Shake the window 5 times
for(int i = 0; i < 5; i++){
//Changes the frame origin
[window setFrameOrigin:NSMakePoint((rect.origin.x + amount), rect.origin.y)];
//Pause the thread for 0.04 seconds
usleep((useconds_t)40000);
//Inverts the offset amount
amount *= -1;
}
//Restore the window’s original position
[window setFrame:rect display:NO];

Download the sample app here.

Using CGSPrivate

No Comments

CGSPrivate is a super cool header which allows Mac developers to use nice animations on their apps. There are many animations, but the most popular one is the cube. On the Mac OS X, when you switch the user usingthe fast user switching, the desktop rotates and the other user’s desktop appears. You can use that and many other animations on an ordinary NSWindow with a few lines of code.

CGSPrivate uses private APIs, which means it can stop working anytime as Apple may update Mac OS X and remove the support for the animations with no prior notice. Mostly likely it’s not going to happen any time soon, as CGSPrivate has been here for a couple years(the first version of CGSPrivate was wrote back in 2003, I believe). It also can’t be used on apps you pretend to sell on the Mac App Store. Apple doesn’t like apps that use private APIs.

More

iPhone 4

2 Comments

Yesterday I bought an iPhone 4. I was going to write this post yesterday, but I forgot. After looking for it in the entire city, I finally found one at a mall. It’s very hard to find them for sale, as they are sold very fast. The store I bought it received 100 iPhones a day before I buy my one, and I bought the last one!

This phone is just MAGICAL. Sometime ago when I first saw the iPhone 4, the Retina Display didn’t seem so magical. That’s what usually happens when you try stuff on a store. The display is just COOL. Things look more real on it. I really wish my MacBook had a Retine Display.

The camera is wonderful. 5MP is great and HDR makes it much more magical. I can take and record stuff with a great quality. And it works from both: frontal and back camera. The Facetime is very cool. It’s much better than a video chat on iChat.

The phone is very fast. Most apps take a fraction of second to open. Compass is also something cool to play with, but it doesn’t seem very useful. I haven’t tried the GPS yet.

But there are also some problems. I create ringtones from my music library without syncing it with iTunes in order to transfer them back to the phone. I’d really like to change the ringtone anywhere and anytime. Another problem is that Facetime is not available on 3G network. Another problem is that some(not all) apps that are non-Retina Display ready look a little pixelated. The first 2 problems can be solved with Jailbreak and the last one can’t.

In fact, this is the world’s best cellphone. I don’t even know what to expect from the next version. Maybe TV, but I don’t really use to watch it. If it could tune TV stations from other countries, that would be really cool as my favorite TV shows are from NBC.