Getting Quake II GWT Working on the Mac–Updated

November 9, 2011

Last year I posted about a port of Quake II to HTML5, to run in the browser. I’ve been keeping up with the minor enhancements to the project since then, so I figured I’d update my instructions for how to get it running on your Mac. It turns out that it no longer runs in Safari, even in the WebKit Nightly–but it does run in public release Firefox and Chrome.

  1. Install MacPorts and then run
    sudo port install vorbis-tools
    sudo port install lame
    
  2. Install Mercurial version control client
  3. Install the Apache Antbuild tool
  4. Check out the code
    hg clone https://code.google.com/p/quake2-gwt-port/ quake2-gwt-port
    
  5. Build and run the server. It will take a while to build the first time, but will start up quickly from there on out.
    cd quake2-gwt-port
    ant run
    
  6. Start Firefox or Chrome and navigate to http://localhost:8080/GwtQuake.html. You should see a console.

If you have any problems, I can’t help you, so check the comments on these pages:


Dangerous Duty of Delight Study Guide

October 23, 2011

This post has been moved to my new theology blog.


Essential iPad Apps–October 2011

October 11, 2011

Another friend of mine just got an iPad, so I figured it was time to update my list of essential iPad apps. If you have an others to recommend, leave a comment and I might try it out and add it to the list!

  • AppShopper [FREE]–lets you put apps on a wish list and alerts you when they go on sale. Great way to save money. It’s also the easiest way to e-mail or tweet links to apps.
  • Flipboard [FREE]–presents your Facebook, Twitter, and Google Reader content like a magazine, making it very fun to browse and read.
  • iBooks [FREE]–the best-looking and most fun to use ebook reader out there.
  • YouVersion [FREE]–has more free downloadable Bible translations than any other app, with every reading plan imaginable. Allows you to share notes publicly and follow others.
  • DropBox [FREE]–the easiest free way to sync documents between multiple computers and mobile devices. Syncs a designated folder automatically, so it’s literally zero steps to transfer files.
  • The Weather Channel for iPad [FREE]–the most extensive weather app.
  • Wikipanion [FREE]–iPad app for browsing Wikipedia and other MediaWiki wikis. If you use a Wikia wiki for video games or TV shows, it’s a must-have.
  • Facebook [FREE]–just released yesterday as of this writing. Smoother and more reliable than third-party Facebook clients.
  • Twitter [FREE]–again, more reliable than third-party Twitter clients, and has a nice column view.
  • Pandora [FREE]–listen to free personalized streaming music
  • Flixster [FREE]–my favorite app for movie showtimes and tickets
  • Helsing’s Fire Lite [FREE]–my favorite puzzle game on the iPad, with a very innovative light dynamic. The lite version only has iPhone graphics, but there is an HD paid version.
  • GoodReader [$4.99]–if you only buy one iPad app, buy this one. Full file system, viewing of PDF, image, and Office documents, access to FTP and DropBox servers. Essential for file management.
  • TypeLink [FREE or $5/yr]–obligatory plug for my app. Take notes and organize them using hyperlinks. Access your data on any device or on the web. Free for a basic account, $5/yr for an unlimited account.

Adding an Attribute to a Core Data Entity in Xcode 4

July 31, 2011

I wanted to add an attribute to one of the objects I manage using Core Data in my iPhone app. Because it’s a simple change, I wanted to use what Apple calls Lightweight Migration–automatically migrating the data when you make a simple change like adding a field.

I had to assemble the steps from a few different places to get it to work, partially because blog posts I found were for Xcode 3, and not even all the Apple docs have been updated for Xcode 4. Here’s the full set of steps that worked for me. For example purposes, I’m assuming your app is called YourApp, and the Core Data model is called YourData.

  1. Don’t make changes to the data model yet!
  2. Run your app in the simulator to make sure it has data set up under the current version of the entity.
  3. Select the YourData.xcdatamodel file and choose Editor > Add Model Version… The default numbering scheme (“YourData 2″) is probably fine.
  4. Select the new YourData 2.xcdatamodel file, select the entity, and add the new attribute. Make sure the right pane is visible (third button above “View” on the toolbar) and the third option within that pane is selected. Either set the attribute to be optional, or set it to have a default value–you have to choose one or the other for Lightweight Migration to work.
  5. Regenerate your model classes by selecting the entity, choosing File > New > New File…, then NSManagedObject subclass. Note: I first created my classes under Xcode 3, and at that time it put the .h and .m files inside of the actual YourData.xcdatamodel file (which is really a directory on the filesystem). Xcode 4 didn’t seem to give me this option, but that’s fine–to me, it makes more sense to store them with the other classes anyway. If you do put your new .h and .m files in a new location, be sure to delete the old ones.
  6. Select the YourData.xcdatamodeld file, go to the right panel, first option, and look for Versioned Data Model > Current Version. Set this to the newer version.
  7. In YourAppAppDelegate.m, find the persistentStoreCoordinator method, or wherever you call addPersistentStoreWithType:… You will probably be passing it nil for options:. Instead, pass this:


    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
    [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
    [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];

  8. Update your app to use the new attribute/property in your entity. You might want to make only small changes at first, in case something goes wrong with your auto migration.
  9. Run your app and test it.

I wrote these steps out after I finished, so please leave a comment to let me know if I missed something and you run into other trouble.


Setting Up a CentOS VM in VirtualBox

July 28, 2011

I’ve been trying to set up a CentOS VM in VirtualBox, and had a lot more trouble than I’ve had with other Linux distros. The prebuilt image I tried from virtualboxes.org had issues with the networking adapter and keyboard layout. Trying the minimal or network installer had the same problems.

I was eventually able to solve it by installing from the Live CD disk image.


How Does Adam Make Us Sinners?

June 19, 2011

I ran across Romans 5:19 today, and I think it may be one of the clearest verses for understanding the doctrine of original sin.

Romans 5:19—”For as by the one man’s disobedience the many were made sinners, so by the one man’s obedience the many will be made righteous.”

The context is that Paul is contrasting Adam’s disobedience, along with the condemnation and death that resulted, with Christ’s obedience, along with the justification and life that resulted. But this verse says something even more specific. The word translated “so” in the ESV is two words in the Greek: οὕτως καὶ. The latter simply means “and,” and the former means “in the same way.” So a more literal rendering could be:

“For as by the one man’s disobedience the many were made sinners, IN THE SAME WAY by the one man’s obedience the many will be made righteous.”

The point is that the means by which we are made sinners by Adam is the same as the means by which we are made righteous by Christ.

So does this teach original sin? One could propose that the way Adam makes us sinners is by his bad example that we follow. If that was the case, then Romans 5:19 would say that Christ makes us righteous in the same way: by giving us a good example to follow. And this is more or less what Pelagians have taught. But Romans is absolutely clear that the means by which Christ makes us righteous is not his good example, in many places, but particularly in 4:3-5:

Romans 4:3-5—”what does the Scripture say? Abraham believed God, and it was credited to him as righteousness. 4 Now to the one who works, his wage is not credited as a favor, but as what is due. 5 But to the one who does not work, but believes in Him who justifies the ungodly, his faith is credited as righteousness”

Righteousness is not first produced in believers. First, it is credited/accounted/imputed to them. They don’t have it inherently to themselves, but it is credited to their account.

So if Romans 4:3-5 teaches that Christ makes believers righteous by crediting them righteousness, and Romans 5:19 teaches that Christ makes righteous the same way Adam makes sinner, then Adam must also credit people sin. The means by which Adam makes people sinners is by crediting them the sin that they don’t yet have, but that he has.

What if someone objects that they don’t accept that Romans 4:3-5 teaches imputation, and that they still insist on taking the verse to mean that Adam makes sinners only by example? If that was the case, then by Romans 5:19 Christ would make people righteous only insofar as being a good example for them. But is that enough? God is a holy God, and he cannot accept sinners. Even if we reject Adam’s imputation of sin to us, we have all sinned ourselves, and stand guilty before God for it. And even if a person was to turn from their sin and live sinlessly for the rest of their life, they would still be guilty of the sins in their past. The only hope for sinners is that Christ would be able to impute his righteousness to us: but the person who rejects imputation in order to avoid original sin can’t then have Christ’s imputation of righteousness.

So, for sinners to have any hope, we need the doctrine of imputation, by which we’re rescued from both our original sin and our own sinful acts by the imputation of Christ’s righteousness.


Script to Clear Dropbox Cache

June 16, 2011

I store an encrypted sparseimage file on my Dropbox for security. As of a few weeks ago, I started getting a problem where my hard drive space was filling up quickly. It turns out that Dropbox was storing multiple copies of it in a folder called “.dropbox.cache”. According to the forums, this is a bug that was fixed years ago, but it seems to have come back.

I’ve reached out to Dropbox for a fix, but, until then, here’s an AppleScript you can run to clear the cache. It quits Dropbox first for safety, clears the cache, then reopens Dropbox. I saved it as an application and put it in my dock so I can run it in one click any time I’m running low on hard drive space.

WARNING: I don’t provide any warranty for this code. It deletes files off of your hard drive without warning. It shouldn’t cause any problem, but if it does, I can’t take any responsibility for it. Understand the code and use it with caution.


tell application "Dropbox"
quit
end tell
do shell script "rm -fr ~/Dropbox/.dropbox.cache/*"
tell application "Finder"
open application file "Dropbox.app" of folder "Applications" of startup disk
end tell


Follow

Get every new post delivered to your Inbox.

Join 523 other followers