Homebrew vs. MacPorts

If you do development on a Mac and you have a Unix background, you immediately start noticing missing tools and utilities. macOS doesn’t have an apt-get for package management (or even one of the lousy RPM variants). There are options though. Two of them have been around for quite a while, MacPorts and Fink.

MacPorts is strongly influenced by the BSD ‘ports’ system. Ports are essentially recipes for taking source code and build scripts and making them compile and install on the target operating system. BSD ports organize the recipes and source code into a tree that make adding software easy.

Fink takes a different approach. It’s based around Debian’s packaging tools and apt-get. Fink mainly manages pre-compiled/pre-built applications. So the applications you install using Fink don’t need to be compiled and built on your system.

Between the two of them, MacPorts tends to be the easier solution. Software is more up to date, there are more options, it’s somewhat less intrusive into your system and you get new versions faster when Apple updates macOS. Ironic when you consider that MacPorts code is compiled on your system while Fink is just downloading binaries.

But MacPorts is still no walk in the park. Even though it’s less intrusive then Fink, it still isn’t a great citizen on macOS. MacPorts eschews many of the system libraries and software already available in macOS for other variants. Installing a seemingly simple utility might somehow require a new version of Perl, Python or other set of large software.

Homebrew is a reaction to the complexity of MacPorts. It’s extremely simple. Homebrew appears to be targeted more at individual packages. If you want to pull in the entire world of open source software and want every package, then you’re better off with MacPorts or Fink. But if you’re looking for the occasional tool or utility, Homebrew is for you.

Read More

Oracle sues Google over Java patents in Android

I didn’t see this one coming. Oracle just sued Google over patents in Java. Oracle contends that Google’s clean room implementation of Java - Dalvik - violates several patents.

Here are the patents referenced in the suit:

  • 6125447 - Protection Domains to Provide Security in a Computer System
  • 6192476 - Controlling Access to a Resource
  • 5966702 - Method and Apparatus for Preprocessing and Packaging Class Files
  • 7426720 - System and Method for Dynamic Preloading of Classes through Memory Space
  • RE38104 - Method and Apparatus for Resolving Data References in Generate Code
  • 6910205 - Interpreting Functions Utilizing a Hybrid of Virtual and Native Machine Instructions
  • 6061520 - Method and System for Performing Static Initialization

These are all pretty low-level features. They boil down to how Java handles security, just-in-time compiling, how class files are structured and how the system sets up code.

This is a pretty nasty attack by Oracle. One can only assume that they tried to shake down Google before filing the actual suit. Assuming that the patents stand I don’t see how some of them can be worked around by Google without changing Java.

According to the lawsuit, what does Oracle want? Treble damages and all copies of Android destroyed. That clearly won’t happen so the question is whether Google will cave and license Java from Oracle or fight the suit.

Since the suit was filed at all, I’m assuming that the licensing conversations went poorly. But Google has never been a company to drag through the courts while Oracle most definitely is. So my guess is that unless the patents are quickly invalidated that Google will end up licensing the patents from Oracle.

macOS Java MicroTip: Decompile Java class from the Finder

Here’s another micro-tip. I needed to decompile a Java class to step through for debugging. But I wanted to pick and choose classes from the Finder. No problem, this is macOS and Automator is your friend.

If you don’t already have it, download JAD (Java Decompiler) from http://www.varaneckas.com/jad.

Then open up Automator and create a new Service. Tell Automator that the service will receive only selected files or folders. You can use any application or just Finder, your call. If you like, filter out only the class files. Then comes the real work. Specify the zsh shell and give it this command line:

jad -lnc -o -d `dirname $1` $1

You’ll have to specify the full path to the jad executable if it’s not in your path. The -lnc tells JAD to add original line numbers as comments - very helpful when debugging. The -o tells JAD to overwrite output files without asking. And the -d tells JAD where to put the decompiled files. In our case we’re only allowing a single file at a time and we’re putting the decompiled file into the same directory as the original class file.

When you’re done, it should look something like this:


Save the workflow service and name it whatever you like, in my case I named it ‘Decompile Java Class’. Close any open Finder windows and re-open them. Now when you right click on a file you’ll see ‘Decompile Java Class’ as an option in the Services menu. Select it and JAD will decompile your selected class file into a .jad file.

Coda Notes

“Panic”, an Apple software developer, has released one of the nicest browser extensions I’ve ever seen. Coda Notes makes it very easy to markup a web page with your own comments and highlights. The annotated page can then be emailed to whomever you like. To use Coda Notes you’ll need the very latest version of Safari - 5.0.1.

Once you install it, Coda Notes adds a little leaf button 3 to the Safari button bar. When you click it, a toolbar slides down and the current web page goes into edit mode. You can draw on the page using a pencil tool (in green, red or blue), you can draw using a highlighter (in yellow, purple or blue), you can change the text on the page or you can put sticky notes with text on top of the page.

When you’re done, click the Send button and the whole page rotates to reveal a postcard on the back. You can email the annotated page with comments to whomever you wish.

Here’s a quick view of an annotated page after it was received in email:


Coda Notes is already very slick and very useful, but a few flaws keep it from replacing Skitch for me. The first is that it doesn’t have a tool to draw boxes and arrows yet. The second is that you can only annotate and send the visible portion of the web page. It would be much more useful if you could scroll up and down the entire web page.

One more thing to keep in mind if you make use of the Coda Notes extension, all emails are routed through the Panic servers. Panic has a good reputation and state up front that they don’t keep images, but if you’re at all concerned about security, don’t email your images.

macOS Microtip: Making forced Exchange server signatures output correctly

I just started a new job and they forcefully apply an email signature to all outgoing Exchange email. The signature block is dynamic and picks up the senders name, phone number, email address, etc. from Active Directory and puts it in the signature. I sent myself a test email and saw that some of the information was wrong, so I contacted the email admin. He fixed it and asked me to test it again.

When I sent myself another test email it came through as plain text without any formatting. The company signature block is supposed to have formatting and a company logo. I was positive the email admin had messed things up. I was wrong.

Turns out the automated Exchange signature block is output in rich text (HTML) when the incoming message is rich text and is output in plain text when the incoming message is in plain text.

Mail.app has a setting that says whether messages will be composed as Rich Text or Plain Text. I had always assumed that applied to all new messages. Unfortunately it’s now apparent that the setting only means that a message can be sent as Rich Text. If you don’t include any formatting in your message then the message goes out as Plain Text, regardless of the composition setting.

The fix? Create a simple signature block with formatting. My first choice was a simple single-pixel line but Mail.app won’t accept a formatted line without any associated text. So now I just have the word ‘Thanks’ in bold.

Cloud security is the big stumbling block


Google’s first big government switch to Google Apps has hit a roadblock that will be common to all cloud implementations - security.

The LAPD put the brakes on the City of Los Angles conversion due to security requirements. That includes the big concern all cloud users have, data segregation. In addition, the LAPD requires background checks on all personnel who have access to their data.

Google will work through this process of course and the end result will become standard practices for all cloud providers. Namely the establishment of strict data controls both from the technical perspective and from the personnel perspective.