Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts

24 March 2016

iCloud for iBooks

With the release of OS X 10.11.4 and iOS 9.3 a couple of days ago, iBooks now syncs your own PDF and ePub books (ones not from the iBooks Store) via iCloud. This is fantastic! I’ve been wishing for this capability for a long time.

The first time you open iBooks on your updated device, you’re asked if you want to use “iCloud for iBooks”. After that is turned on, any books added to iBooks are automatically uploaded to iCloud, making them available for download on your other devices.

To test it out I added a couple of PDF documents to iBooks on my Mac, and shortly after I had them available on my iPhone with the familiar iCloud icon overlay. With a couple of taps on the iCloud icons, I had the PDF documents on my phone. Love it.

Books was the last media type to still need old fashioned iTunes syncing, so with this update, I don’t need to use iTunes for syncing at all! The only reason I plug my phone into my Mac now is to create a local backup. I backup my phone to iCloud too, but having a local copy is a fail-safe.

Syncing books over iTunes never worked right either. It would often refuse to sync some books, and it was slow. In contrast, my experience with the new iCloud for iBooks has been flawless, so far.

Thanks Apple!

30 November 2014

SystemC on OS X

Aren't you tired of logging into a Linux server, or resorting to a virtual machine to use SystemC? Wouldn't you rather be using your shiny Mac and the awesome Clang C++ compiler? This is how you can do it.

Install Apple's "Command Line Tools". You have two options: install Xcode (a big download), or just the command line tools (a much smaller download). If your goal is simply building SystemC applications at the command line, then I recommend the latter.

Install Apple's "Command Line Tools" by launching Terminal, entering

$ xcode-select --install

then clicking Install. After that, you'll have make, clang and more available at the command line.

Build and install Accellera's SystemC implementation. Download the latest release from the Accellera Downloads page (annoyingly, you'll have to provide a few personal details) and extract the contents of the .zip file.

I like to keep a copy of the SystemC source code available, because it can be useful for debugging or understanding how something works. Therefore, I move the extracted folder (systemc-2.3.1) into ~/Work/Other. That's where I keep source code for third party libraries. However, you can put it wherever you like.

Open Terminal, change into the extracted folder (systemc-2.3.1), and execute:

$ mkdir build  
$ cd build  
$ export CXX=clang++  
$ ../configure --with-arch-suffix=  
$ make install

The --with-arch-suffix= option prevents a -macosx64 suffix being add to the lib folder name, allowing your build scripts to be simpler.

After that process, the salient include and lib folders should be available within the systemc-2.3.1 folder.

Configure your build environment. There are many ways you can do this; I have a simple approach that I believe is close to what the SystemC maintainers envisioned. I define two environment variables in my .bash_profile (executed for every new Terminal session on OS X):

export CXX="clang++ -fcolor-diagnostics"  
export SYSTEMC_HOME=~/Work/Other/systemc-2.3.1

Build a SystemC application. You could use Make, the quintessential build tool, which you get with Apple's "Command Line Tools", or any one of the plethora of other options. I use SCons with SConstruct files that look something like this:

import os  
env = Environment(CXX=os.environ["CXX"],  
                  SYSTEMC_HOME=os.environ["SYSTEMC_HOME"],  
                  CPPPATH="$SYSTEMC_HOME/include",  
                  LIBPATH="$SYSTEMC_HOME/lib")  
env.Program("main.cpp", LIBS="systemc")

View trace (VCD) files. Scansion is a nice tool for this. GTKWave is another option, but it's a bit clunky.

Now you're rocking!

28 September 2014

No sleep for you Mac mini

Our Mac mini (a late 2012 model running the latest OS X 10.9.5) has just decided that it doesn’t want to wake from sleep anymore. It would normally wake when accessed from my MacBook for Screen Sharing, or from our Apple TV for streaming with iTunes Home Sharing, which we use all the time (Peppa Pig!). My feelings: frustration with a tinge of déjà vu.

This was all working fine before Apple’s recent round of software updates: iOS 8, OS X 10.9.5 and Apple TV 7.0.0. I don’t know which of those updates is the culprit, if any.

I spent the morning looking for a solution. I tried playing with network settings, resetting all the devices, and even resetting the Parameter Memory (PRAM) in the Mac, all to no avail. And I definitely have the salient “Wake for network access” preference set in Energy Saver Preferences. I’ve submitted a bug report to Apple, but who knows what will come of that.

This isn’t the first time we have had this type of issue. If I remember correctly, the first version of OS X Mountain Lion (10.8) broke “wake from sleep” for us, and it wasn’t fixed until 10.8.2. I vaguely remember other issues when running Lion too. There is a smell of unreliability around this “wake from sleep” stuff.

After a wasted morning, I started wondering: why do I even care about this? I can just prevent the Mac mini ever going to sleep and be done with it. Sure, it’ll cost a bit more in electricity usage, but compared to all my other expenses, not a big deal.

I think part of the reason that I persist with this folly is that I just feel like it should work; it’s the correct solution! Apple has a cool technology with its Bonjour Sleep Proxy service, which has been around for a while, and should “just work”. And I’m using all modern Apple hardware, with the latest software, so there should be minimal compatibility issues; why doesn’t it work! And it feels wrong to waste electricity, when I don’t have to.

But that’s all wishy-washy thinking; I should be looking at the facts:

  • I measured the Mac mini’s power usage: 1 Watt when sleeping, 8 Watts when fully awake. It would be even less when the hard drives aren’t spinning (but, I didn’t measure that). At $0.35 per kWh (my highest tariff), it costs about $25 to run the Mac mini at full power for an entire year. That’s not much.
  • The time to wait for the Mac mini to wake from sleep can range from a few seconds (fine), to tens of seconds (not so fine). However, when the Mac is fully awake, access is instantaneous; bonus!
  • Sometimes we see flaky behavior with Home Sharing, and I usually fix it by restarting the Apple TV, or by restarting iTunes on the Mac mini. I don’t know if “wake from sleep” comes in to play here, but it might.
  • I can schedule the Mac to completely shutdown overnight for at least six hours, which will save energy (and $6 a year, pffft). Resetting iTunes every night probably doesn’t hurt either.

Considering the above facts, the course of action is clear: no sleep for you Mac mini!

15 June 2013

SimpleNote is like a comfy pair of shoes

I’m a fan of plain text notes. I have more than 1200 of them. They are part of the process I use to organise my life and guide my thinking, both at work and home.

Up until October last year, I was using a combination of nvALT (a Notational Velocity fork) on Mac, SimpleNote on iOS and ResophNotes on Windows. This was a pretty good setup, until SimpleNote started to become flaky. The SimpleNote server seemed to be down every other day, and notes were sometimes corrupted, very rarely, but rarely is too often.

So I stopped using SimpleNote, and switched to using DropBox for syncing. DropBox promised much: speed, reliability, and I could keep my notes in plain text and have them available on all my devices. I continued to use nvALT on my Mac, and switched to using Sublime Text (a text editor) on Windows, because ResophNotes only works with SimpleNote. But I also needed to find a good iOS text editor that supported DropBox sync, to replace the SimpleNote iOS app.

In the search for the perfect iOS text editor I undertook weeks of research and experimentation, using Brett Terpstra’s iOS Text Editor roundup as a guiding resource. I read many reviews and articles before narrowing the field down to Elements, Notesy, Nebulous Notes, PlainText and nvNotes. I purchased all those apps. But to cut a long story short, none of the apps were really up to the task of handling 1200 notes, in particular, and invariably, searching across all my notes was a dreadfully slow and infuriating main-thread-blocking experience. Not to mention the high frequency of crashes.

I masochistically persisted with this sub-optimal setup for months, vainly hoping things would get better. I filed bug reports and received sympathetic replies from developers, but not much hope.

During this time, I also had a spell of replacing nvALT with JustNotes, and that didn’t work out too well either. I might talk about that another time.

Finally, in April this year, I gave up and switched back to SimpleNote. It was like a breath of fresh air! SimpleNote has switched to a new and improved API, and it is remarkable how brilliantly fast and reliable it is now.

Aaahh, it is very comfortable being back with my friends SimpleNote and nvALT. I don’t think I’ll be leaving them again any time soon.

22 July 2012

OS X Apps

This is a list of the OS X apps I currently use on my MacBook Air (2012 model), which runs OS X Lion. This is a useful reference; when someone asks me “what apps do you use?”, I can point them here. Maybe it’ll be useful for some other Mac users out there too. If nothing else, I’ll have it recorded for posterity. The list is in alphabetical order.

1Password. I use this to store all my account details (both online and offline accounts). It allows me to use very strong randomly generated passwords, and has great integration with Safari. I also use this on my iPhone and iPad. It seems expensive ($51.99), but absolutely worth it.

Caffeine. Prevent your Mac going to sleep with one click in the menu bar. Great in a variety of scenarios, but particularly useful when giving a presentation. Free.

CheatSheet. Hold down the command key to get a list of shortcuts for the active app. Free.

Day One. A journal app. I only got this a couple of weeks ago, prior to that I used Notational Velocity for journalling. It is nice to use, and syncs with the iOS version, but it does seem to crash a bit. I’m not yet sure if I will stick with it, or go back to the simpler Notational Velocity solution. $5.49.

Dropbox. Reliable and simple to use file storage and synchronisation service. It just works. I sync files between computers and my iPhone and iPad. Free (for up to 2 GB of storage).

iCal. Builtin calendar app. Works very well. I don’t see the need to use anything else.

iNodeMon. Monitors Internode ADSL usage. It runs in the menu bar. Free, unobtrusive and does the job well.

iPhoto. Builtin photo management app. It is easy to use, and works very well. I don’t see the need to use anything else.

iTunes. Everyone knows about iTunes. I don’t see the need to use anything else for music or video.

Keynote '09. Use it to create presentations. It’s like PowerPoint, but better. $20.99.

Marked. Simple previewer (not editor) for Markdown and other text formats. Works brilliantly. I used it to write this article. $4.49.

Money. I use this to keep track of my financial accounts and spending. It has some rough edges and a limited feature set. It does the basic job quite well, and does some things really well, like its simple modeless operation.

Moom. Advanced control of windows layout. Very handy! Doesn’t conform to Apple’s new sandboxing requirements, so probably don’t buy it from the App Store as it won’t be getting any updates there. $10.

Notational Velocity. It’s a note taking app, but for me, it is much more: it’s my personal knowledge management solution. I really love this app, simple and fast without frivolous features. I sync it with simplenote so that I can access my notes on my iPhone and iPad. Free.

Office 2011. You still need to interact with the rest of the world, most of which uses Windows and Office. Excel is a great tool; it’s better than Numbers. KeyNote and Pages are better than PowerPoint and Word.

OmniDiskSweeper. Shows files and directories in descending order by size, letting you quickly remove the worst offenders. Free.

OmniGraffle. Fantastic diagram editing tool. Simple and easy to use, yet powerful. $109.99.

Pages ’09. Simple and easy to use word processor. It’s better than Word. $20.99.

Parallels Desktop. Virtual machine manager. I use this to host a Windows 7 guest which I use whenever I need to run some Windows software (like e-tax), or for Windows development. I find Parallels easier to use and more reliable than VirtualBox (which is free).

QuickCursor. Makes it easy to edit text fields from any OS X app, using your favourite text editor, Sublime Text in my case.

Reeder. Brilliant app for reading RSS feeds. It syncs with Google Reader. I also use this on my iPhone and iPad. $5.49.

Remote Desktop Connection for Mac. Good for remote access to a computer running Windows.

Safari. Builtin web browser. I don’t see the need to use anything else.

Sublime Text. A super fast, powerful, extensible and cross platform text editor. I used to use TextMate (which is great too), but Sublime Text is cross platform, and suits me a little better. $59.

Terminal. Builtin terminal emulator. It works very well, I don’t see the need to install an alternative one.

TextExpander. Custom keyboard shortcuts expand into text. I only recently purchased this; it is very nifty, but I am yet to see how useful it really is, for me. Like Moom, it doesn’t conform to Apple’s sandboxing requirements, so buy it directly. $34.95 US.

Things. A brilliant and simple task management app that syncs with iPad and iPhone apps. For anyone who feels like they have a million things to do, but never enough time, this app may help. For me, it is almost perfect; it just needs cloud sync, which is coming soon. $51.99.

Transmit. FTP, SFTP, WebDAV and Amazon S3 file transfer client. I use it mainly for mounting remote file systems over SSH. $35.99.

Twitter. The official Twitter app. Simple and easy to use; I am not a Twitter power user. Free.

VLC. Free and open source multimedia player; plays almost anything!

Viscosity. Simple and reliable OpenVPN client. $9 well spent.

Xcode. For OS X and iOS app development.