Tag: Mac OS X

One of the first posts I wrote for this blog, back in 2007, was about how to write and compile C programs using Mac OS X. That post was a result of me doing C programming in my first year of university, and since then plenty of things have changed. Not only have I finished university, but the basic procedure for installing Xcode has changed as well.

I thought I’d write a new tutorial updated for the more recent versions of OS X.

  1. Install Xcode from the Mac App Store
  2. Install the extra Command Line Tools from within Xcode by navigating to Xcode > Preferences > Downloads
  3. Create a new Xcode project by navigation to File > New > Project
  4. From the template list, under OS X, select Command Line Tool and choose Next
  5. Fill out the required forms, and under Type choose C
  6. Save the project to your computer
  7. Open main.c and write!

It’s possible that by default the toolbar won’t be shown to click Compile + Run, so you can press Cmd+R to do that directly.

The method in the original post continue to work, as long as Xcode installed as described above. Comments on that post provide additional information, like this one from mvdhoef:

instead of resorting to the default a.out you can use gcc the way it was meant to be used!!!
…………………….
gcc -o -Wall name file.c
…………………….
where name is the name of the program gcc will create,
file.c is the file and perhaps extension of the code you have created.

-o is to open new/rewrite in this case name (*if name already existed, it would overwrite without a second thought)
-Wall is another option which tells gcc to show all errors it encounters during compiling. (*this is optional)

Don’t forget to slack off while your code is compiling.

Tagged with: , ,

aboutSLIt’s now been close to three weeks since Snow Leopard arrived in stores, and the Internet has now had a chance to go through the entire system and find the good, the bad and the barely changed. I’ve been using it since that time too, and like some of the subtle changes. Since Engadget, Gizmodo and even David Pogue have all weighed in with lengthy reviews, I’m going to avoid that here. Instead, I’m going to go through some of the changes I’ve seen and whether I think it’s worth the $35CAN upgrade fee.

This is the first of 3 operating system comparisons. Windows 7 and Ubuntu 9.04 will be up shortly.

The Improvements

I was pleasantly surprised at how easy it was to upgrade my MacBook from 10.5 to 10.6. I inserted the DVD while logged in, the menubar and Dock faded away and I returned 50 minutes later to my original desktop. There were options for installing additional languages, printers or Rosetta, but the default installation seems to provide all the required data, with the notable exception of Rosetta. If you still run PPC based applications, be sure to click that checkbox.

animatedwifiAfter it was installed, I took a look around and found very few changes to the interface. Sure, Stacks can now scroll when using the tile arrangement, and some menubars have more function, but by and large, the upgrade is behind the scenes. The Airport menu is slightly animated when not connected to a network, as shown on the left. Doing an option+click on the menu items now brings up a condensed system preference panel with the most important functions front and centre. The Sound menu item brings what is probably the most convenient small update, with the ability to choose the audio input and output on the computer with entering System Preferences.

Snow Leopard also seems to change the behaviour of computers exiting from sleep as well. On my MacBook, sleeping the computer for an extended period of time (about 2 hours or so) sometimes causes it to go into deep-sleep mode. That means when it wakes again, you must load the contents of RAM from the hard drive, which can take an extra 30 seconds or so. I’ve yet to determine if this is a change to the OS itself, or simply a flaw with my computer.

Ideal customer

Apple has taken a new strategy here with Snow Leopard. By keeping the interface familiar and improving the underlying technology, they allow users to gain familiarity with the software. As a $35 CAN upgrade, it is easy to recommend, but for regular users of Leopard who use their computer more for email and web than pushing the boundary of computing, it’s probably not all that necessary.

Interestingly, I think Snow Leopard works better as an upgrade for those users still running pre-Leopard installations. As a move from Tiger, or even Panther, SL offers many new features that make computing much, much easier. I’m excited about the new applications that will be released shortly that take advantage of this new technology — it just looks like I’ll have to get a new computer to fully use all the new tools.

Tagged with: , , , , ,

The time has come for a new Macintosh operating system. Mac OS X 10.6, or Snow Leopard as the cool kids call it, will arrive in stores this coming Friday and bring a host of new features with it. The name of the OS differs very little from 10.5, which was just Leopard, and that is exactly what Apple wants to convey.

OS X 10.0 was by most accounts, a good start, but far from perfect. Through 5 other iterations, the software has grown from novelty to mainstream, with advanced features added with each new release. Snow Leopard takes a slightly different approach in that it forgoes the usual list of blockbuster features and instead improves the existing codebase significantly. This new version will be faster, lighter (on hardware) and will offer new ways for developers to take advantage of the latest hardware.

The big new features of Snow Leopard involve the graphics card and CPU. With the advances in technology of these two components, programmers can take advantage of the new power by using Grand Central Dispatch and OpenCL. Grand Central Dispatch is a suite of tools available to developers to use every core in the multi core systems Apple sells today. OpenCL does something similar with the graphics cards. When these tools are included in new software, they will be much more powerful than today’s applications.

Buying opinions

The most important new feature of Snow Leopard is the cost. At just $29USD, it is priced like an upgrade, and even in Canadian funds it works out to much less than other software ($35). Based on this price point, and the new features that will be available, I will be purchasing a copy soon after it is released on Friday. I may even spring for the family pack, which comes with 5 licenses for only $59 CAN.

For the benefits to users, and the price point of $30, this will be a very popular upgrade, and is highly recommended for users of Leopard, and especially those with older machines. If you’ve been holding out for a solid version of OS X that you can build on and use for many years to come, this may be it.

Look for more information about Snow Leopard here next week.

Tagged with: , , , , ,

I think something might be wrong. Let’s hope actually finding something on the computer takes less time.

For the record, 124,392 hours is the equivalent to 14 years, 2 months, 12 days and 10 hours.

Tagged with: , ,

Maybe you’ve bought a new computer and can’t use Migration Assistant, or maybe you need to restore your data after it has been corrupted. Whatever the reason, you’ll be happy to know that replacing the data in Address Book, iCal and Keychain is as easy as replacing a file. Since OS X stores data inside standard text files, all data associated with a specific application will be found inside the user library.

Here’s where to find them.

Address Book

Navigate to userfolder / Library / Application Support / AddressBook. Inside that folder is a number of strange and mysterious file names. The one you’re looking for is AddressBook.data. If you try opening that file in a text editor, you’ll see gibberish because it is a binary data file.

Transfer that file to another Address Book instance (in the same folder), restart the application, and you’ll have all your contacts again.

Keychain

Restoring the Keychain, while basically the same process, requires slightly more work to complete. Navigate to userfolder / Library / Keychains and look for login.keychain. This file stores all the passwords and website form details that are collected whenever you save them. “Login” is the master keychain that the system always looks for. If you’re replacing this keychain with another backup, you’ll have to unlock it before you can use it properly again. To do that, open Keychain Access (inside /Applications/Utilities) and select Unlock Keychain “login” from the File menu. Enter your administration password, and you’re good to go.

iCal data

Backing up iCal calendar data is much easier if you export the calendar from inside iCal. To do that, select the calendar from the list on the left side of the window, and choose Export from the File menu. That will produce a file with a .ics extension that can be imported into iCal by double clicking the document.

If you’re looking for the iCal data specifically, the calendar files are located at userfolder / Library / Calendars. The problem with this method is that the calendars are stored inside a cryptically-named folder that can only be distinguished by opening the info.plist file inside the folder. Using the folder itself is probably only necessary when you need to rescue data and iCal cannot be opened.

Thanks to the file organization of Mac OS X, you can be sure that important personal data can be recovered or backed up if there is a problem.

[tags]Mac OS X, iCal, Keychain, Address Book, backup, troubleshooting[/tags]

Tagged with: , , ,