Shame and anticompetitive hijinks

24 05 2012

This week, Apple pulled one of Rogue Amoeba’s iOS apps, from the App Store. Reportedly, little explanation was given. I think I might know what’s going on here.

Apple has a history of taking ideas from existing iOS apps, building them into newer versions of iOS, and then making the app essentially useless. It is kind of a dick move when you think about it for half a second. I know people like to associate that “good artists copy, great artists steal,” phrase with Steve Jobs in particular and Apple in general. Unfortunately, when hardworking independent developers get screwed over, everyone loses, even Apple.

Of course, the developer is going to take the brunt of the blow in the form of lost sales. Users who are not aware of the app from whence some iOS feature came will not know that there may be some better alternative, still on the App Store. This might keep the user experience from being as good as it might. In the end, Apple is hurting itself a little by potentially alienating developers. I know, personally, that if I worked my ass off on an app that I was proud of and Apple came along and ripped me off, I would reconsider developing for Apple’s platforms in the future.

Maybe I am completely wrong about all of this and I am just overreacting. I really hope I am. Hopefully, Rogue Amoeba’s app goes back up on the store and they go back to making money from it. Thanks for indulging this rant.


Intro to structs

25 09 2011

Structs have been a part of the C programming language from nearly the beginning. They seem to be somewhat inspired by objects or, given C’s age, it could be the other way around. I am not really sure.

A struct is like an object, but simplified. A struct cannot have any methods. Without methods, you are left with a structured group of variables. When you create a C struct, you must first define a struct type. This is a lot like writing a class. You define how many variables the struct can hold and what their types are. Here is an example of a struct definition. Read the rest of this entry »

Old-school programming not so relevant

28 06 2011

I have been watching session videos from WWDC 2011. For me, they bring up the subject of teaching old programming languages and techniques in an academic environment when the outside world rarely uses them. The stuff that Apple was showing off and people were discussing there was bleeding-edge stuff. However, it will not be bleeding-edge for much longer because developers are going to start adopting all the new developer technologies that they saw there.

I fully realize that it is important to learn the fundamentals of programming before moving on to the more shiny, advanced stuff like what Apple was showing. However, we never moved on. The instructors will probably not move on for some time, still.

An example might be compilers. If you are in the Computer Science program at Purdue, you may end up taking a class where you learn about compilers and actually have to make your own. Last year, Apple announced that they are moving on from the traditional GCC to the brand-new LLVM (Low-Level Virtual Machine). In fact, Xcode 4.2 does not support GCC anymore. It’s gone. History. However, GCC will likely linger for some time in academia because the instructors will not teach anything else. LLVM may be where things are headed, but it is new and unfamiliar. While most new software engineers will not have to understand how LLVM works, it is still a modern programming technology likely to become more and more popular as time marches on.

Maybe we should spend time during the 100- and 200-level computer science courses teaching students the basics of how software works. Things like C, Java, and basic compiler architecture could be covered then. The 300- and 400-level courses could focus more on modern programming techniques and technologies. Many universities have iPhone development courses. This is a step in the right direction. However, there are many other web frameworks out there, like Android, Sproutcore, and Rails that could do with more attention in academia as well. I could be all wrong about this, but this is where I stand on the subject.

Getting started with .bash_profile

22 04 2011

If you are new to the UNIX-like command line interface (CLI) and you think you are going to spend more and more time there, creating a .bash_profile file is something to consider. You may have already used the Terminal for quite some time and never used your .bash_profile.

The .bash_profile is a hidden plain text file that resides inside your home directory (~/). Keep in mind that your home directory (~/) and your root directory (/) are not the same thing. Stay inside your home directory and its subdirectories while we work on the .bash_profile. This file is like a settings file. It keeps instructions that are used when setting up your environment whenever a new shell (Terminal window or tab) is opened. These instructions can specify settings and aliases. I get the most use out of aliases.

I am a web developer, so I spend a great deal of my time in the command line. I actually came to prefer it over the GUI for work-related stuff. By creating aliases, or shortcuts, for my Terminal, I save myself a bit of time and effort when I try to accomplish common tasks.

A good example is getting to where my work projects are stored. I build WordPress sites, primarily and I run MAMP on my MacBook at work so I can build the site on my laptop before I push the code up to our development server. (MAMP = Mac Apache MySQL PHP.) Here’s the file address to a given project’s location:


Obviously, this can be a bit inconvenient, so I created an alias in my .bash_profile to take me to the htdocs folder and list its contents.

alias mamp="cd /Applications/MAMP/htdocs/; ls -l;"

After running “source ~/.bash_profile” or opening a new shell, I can just type “mamp” and I am taken to the htdocs folder and its contents are listed for me. Once you get the hang of this, it can really help you more out of the Terminal.

Displaying a video lightbox in IE7

16 03 2011

Recently on a project at work, I had to implement an FLV player inside a lightbox that would be activated by clicking on an image. It worked perfectly in every browser, except for Internet Explorer 7 and 8. After three workdays and several hours from my coworkers, I finally made it work.

For this project, I used the Colorbox lightbox JQuery plugin. It is fairly mature and easy to implement. I also used SWFObject to replace the contents of a div with a particular idea with the SWF video player loaded with the appropriate content. All of this was built on top of WordPress in a custom-built theme.

In all other browsers, the video showed up and played perfectly. In IE, it simply showed a small gray box in the upper left corner of the lightbox. My implementation of Colorbox works by taking the inner HTML of a hidden div and moving it into Colorbox’s own dynamically generated div and displayed in a lightbox.

Originally, SWFObject would run on page load and then that would be moved into the Colorbox when the proper element was clicked. It turns out IE does not like this. The trick was to have SWFObject run only after the Colorbox was loaded and displayed. The SWFObject code should be included inside an inline function that will be called by Colorbox once the lightbox is displayed. Below is a simplified version of the code I used.

$('#video-lb').colorbox({width:"942px", height:"402px", inline:true, href:"#video-lb", onComplete:function(){
   function setVideo(vidpath) {
      var flashvars = {
         flv: vidpath,
         showvolume: 1,
         showtime: 1,
         showfullscreen: 1,
         showiconplay: 1,
         autoplay: 0,
         bgcolor: "000000"
      var params = { allowFullScreen: true };
      var attributes = {};
      swfobject.embedSWF("player.swf", "playerContainerDiv", "618", "350", "9.0.0","expressInstall.swf", flashvars, params, attributes);

Video lightboxes seem to be becoming more and more popular. IE support is still typically required for most development shops. Hopefully this will help someone who is trying to do something similar.

Mac App Store will have the same failings as iOS App Store

22 10 2010

Yesterday, Apple announced that it plans to launch a version of its App Store for the Mac, bringing a hallmark feature of its iOS platform to its desktop environment. The App Store on the Mac will fill essentially the same role as its counterpart on the iOS. It will be used as a virtual retail space where developers can submit apps to be sold.

App Store on MacBook Air

Where this will go will be interesting to see. Apple has been fighting a PR battle over the App Store since it launched in July 2008. Apple vets all iOS apps that are submitted for the App Store. This same process will be applied to all Mac apps submitted for the Mac App Store. With this comes the same failings because it is the same system with the same people.

On the other hand, it could bring lesser-known apps to the attention of more people, thus encouraging small-time indie Mac developers. I recently started using a Tweetie-inspired Gmail client, called Sparrow, on my MacBook. It is still in beta, but it an impressive application with a great deal of potential. I would love to see more people discover this app, among others.

An advantage that this version of the App Store will have over the iOS version is that it is not the exclusive way to get new software on your Mac. Users will still be able to purchase Mac software online and on physical media, without Apple’s ecosystem or infrastructure. Ars Technica performed some informal interviews with indie Mac developers to see what they think about this.

Until we see the Mac App store launch about 90 days from now, it should be safe to assume that it will have most of the same problems and strengths that the current App Store does. It will not be exactly the same but it should be interesting to watch.

Quick overview of UIAutomation

25 06 2010

UIAutomation is a new plugin, previewed at WWDC, that will be in the version of Instruments shipping with the iOS 4 SDK. Essentially it allows scriptable testing of the UI. This is one of the few (if any) instances of Apple supporting Behavior Driven Development (BDD) in their developer programs and it is very exciting.

If you have spent any amount of time with BDD in Ruby on Rails, this should be familiar to you. If not, here are the basics. As the developer builds out new features or modifies existing ones, he or she can create simple test scripts that will be read and parsed to create a virtual interface for the application that will only be seen by the testing software. Here, it is Instruments. In Ruby on Rails, it is Cucumber.

UIAutomation makes use of JavaScript-based scripts to describe what the test should do and what it should be testing for. Unlike Cucumber, which runs in an invisible, virtual browser, UIAutomation will actually run on a development device and operate the application on the screen, for the developer to see. The team at Apple that created this plugin has come up with a way to describe UI elements and features on the screen in JavaScript.

The script will run through the tests that are specified and, as it runs, it will deliver a running report of what has happened so far. When it is done, the developer can save the results of the test session.

As someone who spent most of his summer in 2009 writing Cucumber scripts and wading neck-deep in BDD, it is a little exciting to see this kind of testing coming to the iPhone. Hopefully, it will be available for Mac development, as well. When I have the new development tools in my hands, I will give you a more detailed tutorial.