Statusbar example with Swift in XCode 6.2

• February 17, 2015 • Leave a Comment

I’ve created a simple Statusbar application that dynamically creates a menu of Applications in the Utilities folder and opens the Application when the corresponding menu item is clicked. I use simple NSThread for the collection and use image assets for the icon. Not a lot of error handling and could be tweaked for speed, and maybe the thread was over kill, but it should be enough to get most people started. Hope some one finds it useful.

Here’s a link to the full project.


Minecraft Utilities

• February 8, 2015 • Leave a Comment

My son has been playing a lot of Minecraft and runs a server so I made him a series of utilities to make life easier. The first few I wrote were in Python and Tk, quick and dirty, but I wanted to learn the Swift programming language so I rewrote one utility in XCode 6 with Swift. What it does is moves worlds from the Minecraft saves folder to the server and updates the file. It’s just a simple little tool, but it saves him time as he switches between new worlds a lot. If this is something that interests you, you’re welcome to download it and use it. I consider this a public domain application so do with it as you wish. It’s tested on Yosemite.

Download MCServerUtil (MCWorld2Server)

Streamweaver and postscript, oh my…

• February 6, 2015 • Leave a Comment

I was tasked to write some Pitney Bowes Streamweaver code for Adobe ES produced postscript. It has been an interesting adventure as I am new to postscript and Streamweaver. I must side step the politics and get to the meat of it. So, I need to take 30k – give or take – letters with form attachments, etc. and save money. To do this the first step is too duplex. Sure, easy enough. The other savings is to group letters by address by envelope, an envelope holds seven pages. Sounds easy.

Well, the problem I have with proprietary products are the lack of examples, vague documentation, and nothing to reference on the internet. This is great for training and consulting dollars for them, but it is a waste of fucking time and money for everyone else, as you likely already know. This led me to write this in C# out of frustration in order to figure out how their product worked and to understand postscript structure.

So, I got Streamweaver working with very little code, but I also have all this C# code that adds blank pages to odd page counts for duplex reflections, sorts and merges the correspondence by address to fit into a standard envelope, and code that interrogates if the postscript is even correct in the first place! I was getting a lot of bad postscript that wasn’t very visible in Streamweaver.

I decided these might be useful command line tools. I’ll be getting these written, packaged up, and released soon. They will be free, open, and likely under the Apache 2 license. I will write them for Linux (C++ or Perl), Mac (Swift or Objective-C), and Windows (Mono C#). These will work on Adobe standard postscript.

Moon Diary – The witches journal

• June 16, 2014 • Leave a Comment

I created a simple journal application geared towards Wiccan, it can double as a mood journal, and it’s free to use, forever – just made it for the hell of it in Xojo Basic since I got a cheap copy. If you want a secure and simple journal give it a try. All database entries are encrypted.

You can export all posts, create PDF or RTF of entries. It displays the current moon phase, weather, and astrological sign. It will notify you of Sabbats and Esbats as well. It’s only a Mac application though, sorry. Maybe if people like it I’ll make it better, add more features, and make it for Windows and Linux as well. Comment!

Update 2015-02-06, bugs: First launch shows black screen on entry listing. Not sure if this is just isolated to Yosemite or not, but restarting the app fixes this issue. I may rewrite this in Swift when I get time, which should be a bit more stable.

Download for Mac 10.7+ MoonDiary

Quick and dirty way to get Location data on Mac in Xojo

• May 24, 2014 • Leave a Comment

You could make a Xojo plugin in XCode to access the location data, buy a plugin, or maybe use AppleScript but I think this is simple and will work right in the console using Curl as well as within any language that can issue shell commands. Since it’s Curl it should work for Linux as well.

Create a button and add an Event Handler “Action” and paste in the following code. That’s it

  Dim s As New Shell
  Dim cmd As String
  Dim ip As Variant
  Dim city As Variant
  Dim state As Variant
  Dim country As Variant
  Dim zip As Variant
  Dim coordsArray(1) As String
  Dim coords As Variant
  Dim latitude As String
  Dim longitude As String
  cmd = "curl -s"
  If s.ErrorCode=0 Then
    Dim loc as new JSONItem(s.Result)
    ip = loc.Lookup("ip", "none")
    city = loc.Lookup("city", "none")
    state = loc.Lookup("region", "none")
    country = loc.Lookup("country", "none")
    zip = loc.Lookup("postal", "none")
    coords = loc.Lookup("loc", "")
    If len(coords) > 0 Then
      latitude = coordsArray(0)
      longitude = coordsArray(1)
    End If
    MsgBox("Error " + Str(s.ErrorCode))
  End If

Create a Button with hover effect in Xojo

• May 8, 2014 • Leave a Comment

Drag a Canvas object onto your form from the Library. Click the Canvas object and select the Inspector, top right, and turn off UseFocusRing and for Backdrop select your default image. You can select the hover image as a Backdrop as well as it will add the image to your project and save you time, otherwise drag and drop the hover image into the Project Contents. Rename your Canvas object as btnHover int the Name field in the Inspector – hit the enter key to set the name or it will revert back to the default name, at least on Mac.

Right click the btnHover object and add the following four Event Handlers:


Click the MouseEnter and add the following code. The image name should appear in your contents, don’t worry about the path or extension.


Do the same for MouseExit, only set as your default image.

Click MouseUp and add the following code:



I’ll be posting more of these as I am developing a project in Xojo (RealBasic) since I got it for $20 through MacHeist. Pretty easy to work in and the language is Basic so it’s pretty easy too.

Thanks Apple!

• September 13, 2013 • Leave a Comment

Thanks Apple for effectively turning just about every program into a virtual store and/or billboard. At the same time you somehow indirectly managed to reduce the quality of most Mac software. Just about every application that I have tried reminds me of those cheap Chinese toys you get at the dollar store. The AppStore doesn’t need App approvers to protect me from evil, it needs an exterminator to protect me from buggy indie software.

Easiest way to convert a PDF to EPUB for free on a Macintosh?

• August 22, 2013 • Leave a Comment

1. Open the PDF in, Edit>Select All, right click selection and Copy.
2. Open, Edit>Paste.
3. Do any minor edits.
4. Export as EPUB (You will have other output options as well).
5. For further tweaks get Sigil.

Don’t spend weeks writing code to do this only to find that a complicated PDF is such a pain in the ass to work with that you need to buy a book to help you figure it all out while knowing deep down it will never be perfect anyway! Certainly don’t spend any money to do this shit when simple tools can do it for you.

If you just want a great reader, get Skim

Also see-


Python PDFMiner



• January 18, 2013 • Leave a Comment

Are you looking for a simple and quick way to enter notes into the Apple’s application from the statusbar? Don’t want the extra features of big note tools or really just like Apple’s built in Notes app? Me too! So I wrote a little utility to allow quick note entry to the! Simply select your account, local or otherwise, and you’re all set.

DOWNLOAD MacNote SHA1: 574b36d5ff37cc971159c8445769e4df79804290
Requirements Mac OS X 10.8, might work on 10.7 (Lion)


MacNote in action

The Internet should be a library not a mall.

• September 13, 2012 • Leave a Comment

All media is equal, or should be considering it’s becoming computer files like everything else. The Internet is basically a library and needs to be treated as such in my opinion. It’s one of the best places to share what we create.

Hey, why not tax the American people a little and pay the copyright holders, the actual creators, a fair wage from that tax, and cut out the stinking middle man that drives up costs and forces us to live in an archaic world of greed?! We should be able to download any movie, song, or book from this digital library. I’ve held this opinion since the damned nineties and I’m pretty amazed at how greed is suffering good work and limiting what the people can access.

“you expect me to pay more taxes? Boo fucking hoo, I want to pay a CEO millions to figure out how to charge me more, like with my health care!”

Come on, you’d rather not pay a little more tax for the benefit of affordable entertainment? I consume a lot of it and it’s rather pricey, but if you’re dumb like that I suppose you’ll stop reading by now and call me a socialist liberal pig. Enjoy your $.99 Family Guy rerun…

“who’s paying the librarians and computer people to run it?”

We already do or I wouldn’t be discussing the library. But, if you use the library you may have noticed how limited the people’s digital library is compared to the corporate version. At the rate we are going, Amazon and iTunes will be the library, and this is bad for the future.

“but the authors won’t make enough money!”

Bullshit! They will get about as much as publishers pay them now, if not more. There is more money to be made selling swag, toys, commercial use of works, physical copies for those idiots who think they need this shit on a bookshelf collecting dust as well. The copyright holders could supplement their tax royalty income with these things, and this keeps the junk industry driven by media alive. China jumps for joy! I’d imagine there would still be investors looking for a little return from these sales if it’s no longer worth the investment in creating the actual media so I doubt big movies will lose the investment capital needed to cover production.

“but what about those damned foreigners taking our stuff without paying ’cause we can’t tax them?”

So. Charge non-American companies and citizens a monthly fee for access. If the British libraries want access to American content charge them accordingly and let them use whatever they want. We pay for the BBC’s crap.

“but people will just steal shit!”

Let’s redefine steal, because it’s impossible to steal a file since the owner likely retains the original, but for argument sake. People already ‘steal’ in the current system and it is costing you. If the files are free, already paid for with tax revenue, would this not curb the need to steal? Even with the few taking content for free do you really believe it will cost everyone as much as the attorneys, law enforcement agencies and middle man corporations are costing now? Do you really believe going against the people by making crazy laws and stupid expensive technologies like DRM keeps people from stealing or reduces your cost? This crap drives up costs, keeps media from the poorer people, and puts money in the hands of companies that provide no real value in an Internet society.

“what about copyright?”

It will still exist. If an author dies his family collects the royalty for whatever period the law states. If there is no one to collect or the work is beyond the copyright period, the work becomes public domain. Sorry capitalistic cock sucker, *cough* Disney *cough*, no more free money for you. Come up with your own ideas and concepts…

“what if I wrote a song and anyone can play it? I’d lose money!”

Really? Ever heard of tribute bands? The fact is, having the ability to read the notes does not transfer the copyright, nor does it imply permission to perform the song to an audience. That mess wouldn’t likely change. The reality is that a concert tour generates tons of cash and the band would already be guaranteed their tax royalty on top of it.

Reality check: Did you know that if you play your purchased music CD at a block party with a certain amount of people that you could possibly be sued? Are you aware that if you project a football game on a large screen for your friends that you may very well be breaking the law? Anyway…

“what about the amount of stuff? Led Zeppelin has a lot of music and some others not so much. How does that work?”

That is a tough one. I suppose a system where popularity and productivity up the payment percentage would work. The more you give the more you get, and popularity helps tee-shirt sales as well. Do we really want to pay artists that suck and only produce one song that is temporarily popular? This will keep artists productive and it’s better than the corporate alternative of “you’d better make something or I’m taking your ass to court for breach of contract”.

Some side benefit perhaps.

You know all that crap out there, like the garbage lil’ Wayne makes money from for example? It’s really not very innovative, creative or valuable, plus he can’t even sing or play an instrument. Those content creators that simply suck will simply fade away along with the huge profit machine and their brain washing commercialism, because people will only download shit that’s good! With more choice you are able to make better decisions. In academia this is called ‘peer review’. It works. Maybe not as well as commercial brainwashing though…

If this does not happen say good bye to public domain, the library, and freedom. You must realize companies like Amazon will take their place and force everything to the cloud where it can be controlled. Your children will eventually have to buy everything you bought, and there children, etc. – if they can afford the fees to borrow it from the publisher and pusher.