via Don’t Eat My Brain.
Finished evil xmas shopping. Bought junk that’s the wrong size & color for everyone so waiting in line to exchange is guaranteed.
Please send me the battery that you said you would. I’m not really liking when I see this:
That’s not much fun at all.
This video is totally worth it too. Follow the link to see this one.
At Christmas time we should always spare a thought for those less fortunate than us. After 20 years of bleeding the world, the global financial community has fallen on hard times. These people desperately need our thoughts, prayers and lots of our money. If you have any investments or savings left, or any money left over at the end of the month please, please give generously. Merry Christmas.
From Bleed The World
Thanks to the Macalope, I came across this video on youtube:
Fainting Goats: From YouTube - Fainting Goats
A Note on Automounting MacFUSE File Systems
Mac OS X, like many other Unix-like operating systems, includes the “autofs” file system layer that make automatic on-demand mounting of remote resources possible. See the man page for automount(8) for more details.
From Mac OS X Internals: The Blog » Blog Archive » A Note on Automounting MacFUSE File Systems
Awesome. This might replace the need for ExpanDrive. And be even more automatic.
I’ve just spent about five hours working out some kinks with data migration between an SQLite database, and a PostgreSQL database. I’m using SQLAlchemy as the transfer tool, since the newer PGSQL database is created and only ever used through this interface.
The big issue I’ve hit is with some Numeric types. One table has Numeric values, which are NULLABLE, but for some reason when I try to load objects from this table, decimal.Decimal throws an exception.
But here is the weird bit. If I rerun the query, and try to load the same object a second time, it succeeds.
Since I needed to access all of the rows from this table, I had to keep trying to load them until I’m no longer throwing exceptions, and then finish. I had a nice code sample from SubEthaEdit, but that seems to have a bit of a bug with the Copy As XHTML feature in the newest build (submitting a bug report now).
I’ve played quite a lot with the Cocoa methods for doing WebServices: lots of people whinge about how little support is given to SOAP from Cocoa, but I actually think it’s not too bad.
To create a SOAP request is quite complicated, but it’s easy to abstract most of this out.
The first step is to create the WSMethodInvocationRef, using WSMethodInvocationCreate. This takes three arguments, one of which is the endpoint URL, which for most cases will be the same across all of your application’s requests. The second is the method name, and the third is the protocol you are using.
You then just need to set the parameters, namespace, headers and so on. This takes care of generating all of the SOAP Envelope stuff, and you can then just use this object to pass to WSMethodInvocationInvoke. This returns a CFDictionaryRef, which is toll-free bridged with an NSDictionary, and gives you status information, as well as results. Notably, this dictionary contains one with the key “/Result”, which contains another dictionary with all of the result data - and this is the cool part - it has already been converted back from XML into whatever structure it represents!
I’ve wrapped this up a little further into some classes - they are still a little under construction, but I’ll release them on bitbucket or something when I’ve cleaned them up a little. I may even make it into a Framework. Which I have been meaning to learn how to do.
I discovered, quite by accident the other day, that it is possible to use an NSSegmentedControl to control which Tab of an NSTabView is displayed. Here is how to do it.
First of all, it is much easier to change the selected tab if you leave the tabs on to begin with. So, I would suggest building all of the NSTabView’s tabs first. I’ve done five, each with a different control.
Now, you can alter the NSTabView so it doesn’t show the Tabs:
You can now add the NSSegmentedControl, and style it as you wish. I really like the Small Square styling.
Now to hook up the connection. There is an outlet on NSTabView called takeSelectedTabViewFromSender:, which can be hooked up to an NSSegmentedControl.
You will need to ensure that your initially selected cell and view are the same index, which prohibits having it save the value between runs (or you might be able to, if you know more than me).