Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Sunday, February 14, 2010

The Anti-Netbook

For Christmas this year, I bought my kids (ages 4 and 5) their first computer: an Acer Revo. I call this the anti-netbook, but it actually shares a lot of things with a netbook. First is its processor, an Intel Atom clock in at 1.6 GHz. This helps to make for an incredibly small form factor, especially for a desktop computer. It has a 160 GB hard drive, but no optical drive.

When I bought the computer, I had exactly one reason for it. I wanted my kids to play educational games on it. That was all. The Revo came with Windows XP installed on it, and this was perfect. I needed Windows on there to get the largest number of potential games for it. Windows 7 seems to be much less of a resource hog than Vista, but I am still wagering that XP comes with less overhead.

I had another somewhat unusual plan for the Revo. It is completely isolated. No network access, not even local intranet. This is why I call it the anti-netbook. I want no Internet on it, I only want software that I personally installed to ever run on it. It is like a miniature Battlestar Galactica. Now I know there are a lot of websites with great games for kids, but I don't need them. I can find plenty of shrink-wrapped software to buy at incredibly cheap prices. However, this did lead me to some problems with the computer.

The first problem was how to install all of this software, since I had no optical drive. I was prepared for this. I simply copied the software to a flash drive and plugged that into one of the four USB ports on the Revo. This is where I encountered my first problem. Many of these titles require the original CD to be inserted into an optical drive in order to run the game. I suppose this is an anti-piracy tactic, but it really caused me problems. For a couple of the games, I could leave the flash drive plugged in and they were happy. This did not work for most of the games.

So I bought an external optical drive that could be connected via USB. This worked perfectly well, but it does mean that to change the games, one has to generally change discs in the external drive. This is not something that I trust my kids to do yet... I had one more nasty surprise in store for me. Many, actually most games published these days require the game to connect to the Internet, either to install or to play or both. There was a PBS Kids game we bought that was like this, and it was complete fail when we tried to install on the anti-netbook. So I had to make sure to only buy games that did not explicitly list an Internet connection as a hardware requirement, which generally meant buying a lot of older games. Still I found plenty of such games to choose from.

At some point I will want my kids to be able to do more with a computer. They will need a word processor. Of course I would like to teach them both to program. I would like to get them something like Mathematic/MatLab. And of course by then, they will need a computer that is connected to the Internet. When that day arrives, I will get them a Mac -- but probably not an iPad. I will teach them the old school ways!

Tuesday, February 03, 2009

Function Templates in Objective-C

If you're lucky enough to experience my TwitStream lately, then you might have noticed that I've been doing some iPhone development. That means I'm working in Objective-C. It's reflection capabilities are interesting, to say the least. Low overhead reflection does allow for some code templates. Take a look at this.

double MeanTime(SEL selector){
NSArray *dataList = GetDataList();
if ([dataList count] == 0){
return 0.0;
}
double cnt = (double) [dataList count];
double sum = 0.0;
for (StatData *data in dataList){
if ([data respondsToSelector:selector]){
sum += [[data performSelector: selector] doubleValue];
}
}
return sum/cnt;
}
double MeanDownloadTime(void){
return MeanTime(@selector(downloadTime));
}
double MeanProcessingTime(void){
return MeanTime(@selector(processingTime));
}
double MeanTotalTime(void){
return MeanTime(@selector(totalTime));
}

Yeah, I know, what's up with the C-style functions? This was inherited code where I was only changing the implementation of those functions, and I didn't feel like wrapping them in a nice pretty class just for the blog. The StatData class has several synthesized properties, including downloadTime, processingTime, and totalTime. I needed three functions that iterated over a list of StatData and computed the average of these properties. Objective-C's selectors provided a nice way to do this. I have to admit that I tried to over-think this at first, and tried using @selector(getDownloadTime:) at first, instead of @selector(downloadTime). I thought that this would be the method name that the compiler would synthesize from the property. This didn't even work, but the more obvious, straightforward usage did.

Thursday, August 21, 2008

Automounting a Drive in OSX

One of my colleagues had an interesting question for me. We needed to auto-mount a Windows drive from a Mac. The Mac was being used to automatically create screenshots of web pages on various Mac browsers. It needed to then upload the screenshots to a shared drive. Thus mounting the drive and just doing a copy seemed like the easiest way to go.

Mounting a Windows drive is very easy with a Mac. Just go to Finder -> Go -> Connect to Server -> and then enter smb://some-windows-machine. Automator seemed like the way to go here. I had actually never used it, but it proved quite easy. Here is what it looked like for me:
As you can see from the screenshot, I used the Actions -> Files & Folders. I first selected the Get Specified Servers action and added the same URL that I normally used to manually mount the drive. I then added a Connect to Servers action. You will want to test it once, so that you can submit your credentials while making sure to add the credentials to your Keychain. Next, you'll want to do Saves As and change the format to Application. Now to get to execute the Application automatically at startup, go to System Preferences -> Accounts -> Login Items and then browse to wherever you saved the application. Re-boot and that's it!

Wednesday, December 05, 2007

Tuesday, October 16, 2007

Leopard

Am I going to buy Leopard? Take a look at this desktop...



Yep, I think I need stacks.

Monday, March 12, 2007

Ecto-Mac

As promised, I'm giving Ecto a try on the Mac. It sure looks a lot different. The Windows look-and-feel was very Office-ish. The Mac version looks like ... Mac-like, but not really like any other Mac app. Setup was also challenging again. On the Windows version, I needed the unique GData URL to my blog (unique because it includes Blogger's internal ID for the my blog.) For the Mac version, I just needed the generic URL used to retrieve blog metadata for an authenticated user. It still required double authentication, just as the Windows version did. The insert iPhoto pic didn't work any better than the insert Flickr photo did on Windows. I'm clearly missing something. I'll use it a few times and see if it grows on me. The tagging is probably critical...

Update: The labels worked a little better. I got the little Technorati tags bit, just as Flock likes to put them. No Blogger labels, though, so this will probably not be a product I purchase.

Technorati Tags:

Monday, March 05, 2007

Safari Slowdown

It's a few days old, but I noticed this article on /. about the Safari browser causing other Mac apps to run slower. I had just noticed the same thing yesterday. I was editing a slideshow in iMovie, tweaking around with durations and effects on slides along with the accompanying music. At the same time, I was also writing some code in XCode. I opened up Safari to check some C++ documentation, and it was like iMovie had been crippled. I didn't think it was Safari to blame in particular. I had opened a third application on a machine with two CPU cores, and both of my first two tended to be CPU intensive (encoding is never cheap, nor is compiling code.) Sounds like maybe I should have checked the documentation in Firefox instead. The reason I used Safari was because it is much faster at rendering most pages. I don't use it for everything mostly because it doesn't work as well with several Google apps I use a lot.

Sunday, March 04, 2007

MacBook Pro Battery Life

I've been using a MacBook Pro (15", Core Duo 2GHz, Radeon X1600 about 6 months old) for the last week or so. I used to have an iBook that I bought in 2001. It had really great battery life, especially for a laptop of that era. I have a Dell that is very similar to the MacBook Pro (also 15", Core Duo 1.8 GHz, integrated graphics.) It gets excellent battery life. I'm almost always using it with the wireless card turned on and it gets around 3 hours of battery life. If I turn the wireless off, like I've done on an airplane for example, it will easily get 4+ hours of battery life. I expected something similar from the MacBook Pro. Maybe a little less battery life since it has a slightly faster processor and a better graphics card.

Nope. The battery life is awful. I get around an hour of battery life with the wireless card on. I manually turn the brightness way down on the display. I have the power setting for "Better Battery Life". I keep Bluetooth turned off at all times. Still maybe an hour of battery life. What's worse, is that it tells me I have more battery time left than I actually have. I don't get any kind of warning. I'll just be typing away at something and the thing goes to sleep unexpectedly. Really annoying.

I love the MacBook otherwise. It will be nice when Office is compiled as a universal binary so it will perform a little better, but everything else I use on here runs really fast. My only other complaing is that it gets extremely hot. I think that's a combination of it being so thin, having a metallic skin, and relying on passive cooling to keep it quiet. No big deal. Bad battery life and buggy management of it? Very big deal.


technorati tags:, , ,

Saturday, February 24, 2007

XCode

I've been doing some development on the Mac lately. The tool that I've been most interested in is Dashcode, but I've also been using the seminal Mac development app, XCode. I thought it would be interesting to compare it to a couple of other multi-purpose IDEs: Visual Studio and Eclipse.

In some ways it's kind of ironic, but probably the thing that jumps out the most in such a comparison is that VS and Eclipse both have a lot more eye candy. They are more visually appealing programs, at least in my opinion. XCode is a little more stripped down, and not just in the eye candy department.

A popular feature in IDEs is code completion, popularized by VS's IntelliSense. I don't know if VS was the first IDE to have this, I just know it made it popular. I actually think Eclipse does this better than VS these days. XCode has this feature, too, but it is turned off by default. There is something appealing about that to me. Code completion can make developers lazy, and some would argue that it decreases your programming skill. It's hard to argue that it doesn't make you more productive, though. XCode should make better use of it and turn it on by default.

XCode is very good for running and debugging. I was impressed that it gave me an error code in a program that didn't clean itself up properly. Of course that error message was very cryptic, and was just a warning. Only after I fixed the problem did I realize that the weird warning was because I had left some garbage on the heap in the program.

All of this made me think, I wonder if there is an Eclipse plugin that's designed to enable Mac development? The answer is no, and for a good reason. Eclipse is a little clunky on the Mac because SWT is implemented in Carbon, not Cocoa. Most of those super-slick Mac apps out there use Cocoa. SWT binds the native UI elements on whatever system it is running on, so it could use Cocoa or Carbon on the Mac. The SWT developers chose Carbon. They had some very good reasons for doing so, but the end result is Eclipse is a little clunky. It's hard to convince somebody who wants to build a slick looking Cocoa app to use Eclipse.

Anyways, XCode holds up pretty good, though it definitely seems like a notch below VS and Eclipse. Let's face it, appealing to developers has never been Apple's strong suit. Dashcode is kind of promising, though widget development is definitely a niche at this point.

Thursday, February 22, 2007

Safari

I found myself using Safari for the first time in ... a long time. I have to say that it has some definite speed advantages over Firefox on OSX. Firefox on OSX compares pretty well I think to Firefox on Windows and Linux. Blogger gives me a dumbed down interface on Safari though. I guess some of its rich editor features don't work on Safari. I'm guessing that's probably a common problem I'll encounter with Safari. Like Opera, it really embraces standards.