Author Archives: Robert Beverly

Laggy file navigation at startup with xfce Thunar: fix

This applies to the last two or three distributions of Linux that use Thunar as file manager, notably Xubuntu or others using Xfce for the desktop. The problem is that the first time you open the file manager, you have to wait a very long time to see anything. This can persist for several minutes [...]

Posted in Uncategorized | Leave a comment

VirtualBox 4.1.8

VirtualBox is my new best friend. Soooo many 64-bittish problems, not to mention OS X problems (if developing anything other than Cocoa) can be solved simply by installing 32-bit linux in VirtualBox. Now to see if my Py2App distributions actually run on the mac :)

Posted in Uncategorized | Leave a comment

Forcing 32 bit Python in OS X 10.6 +

Lots of python libraries fail to install or fail to work under 64 bit python. Here’s a cheesy non-programmatic hack to make 32-bit python the default. 1. Find the path to the python installation you want to default to 32-bit mode in your .bash_profile nano .bash_profile Mine is at /Library/Frameworks/Python.framework/Versions/2.7/bin 2. Go to the python [...]

Posted in Uncategorized | Leave a comment

ndexr – index a directory and output a json file of its contents

New python project at https://sourceforge.net/projects/ndexr/ Currently it indexes a directory specified in interactive mode or by a config file, and writes a json file cataloging the directory’s contents. You can also specify the output file and the files types to index. It is made to be easy to extend with your own scripts… ie: if [...]

Posted in Uncategorized | Leave a comment

Stretching a 1-pixel image to make a resizeable border or shadow

This comes up a lot, so I’m positing an image to illustrate the idea. Here’s my related stack overflow answer, which uses the technique to make a shadow around a UITableView section of arbitrary size and shape.

Posted in Uncategorized | 2 Comments

Batch plist to JSON conversion

Posted this to sourceforge last night: plist2json: Batch convert plist files to JSON Feature list: Convert any number of plist’s to json Command line – type a directory to convert or drag and drop folder to Terminal Works with OS X, should work fine in most Linux distros Compact, easy to modify for your own [...]

Posted in Uncategorized | 1 Comment

Convert plist to JSON

EDIT: see my plist2json post for a better version Here’s a python program to convert a plist to JSON. You’ll need to type in the input and output filenames in the GUI (ie: /Users/bob/myDirectory/file.plist). It will overwrite the output file if it already exists. If anyone wants a version for batch processing, feel free to [...]

Posted in Uncategorized | 2 Comments

Python 2.7 and XCode 4

Here’s a relevant link for setting up a project (I’m using it for cross-platform development, not PyObj-C): Python + XCode @ SO For debugging you’ll probably have to go outside XCode, or figure out how to set Python debugging up properly. Supposedly LLDB has support, but in XCode you’ll get SIGTRAP when you run your [...]

Posted in Uncategorized | 1 Comment

Fast Enumeration of NSDictionary: “for in” loop returns NSCFString

People ask, and I see questions, and… Ok I admit it, this has gotten me too. If you use the for … in syntax in Objective-C to iterate through an NSDictionary, the result is different than if you were iterating through and NSArray. (Yes I know, they totally warn you of this in the documentation). [...]

Posted in Uncategorized | Leave a comment

Moodle: Set a quiz to email teacher when a student completes it

When you want to know each time a student attempts a quiz in moodle: http://docs.moodle.org/20/en/Quiz_submission_email_notification

Posted in Uncategorized | Leave a comment