New DOM/CSS Inspector in Safari

Dave Hyatt Tim Hatcher announced last night that the latest nightly builds of Safari now include a new tool for web developers to view DOM and CSS elements/attributes on a web page. I tried it last night, and it’s excellent – even better than the one built into Firefox. You just right-click anywhere on a page, and a contextual menu item will let you “Inspect Element”. This is perhaps more intuitive than Firefox’s “enter a new mode, then click somewhere on the inspected page” method of visually selecting an element to inspect.

Here’s a screenshot of the fancy new inspector, being used to debug a CSS problem I was having with the text in the header of my blog:
Safari Nightly CSS Inspector, over my blog header

Update: I spaced on the author of the post. I guess I still think of the WebKit blog as Dave’s old Surfin’ Safari blog. It ain’t, and there are multiple authors on the new WebKit blog. Oops.

Dave Hyatt Tim Hatcher announced last night that the latest nightly builds of Safari now include a new tool for web developers to view DOM and CSS elements/attributes on a web page. I tried it last night, and it’s excellent – even better than the one built into Firefox. You just right-click anywhere on a page, and a contextual menu item will let you “Inspect Element”. This is perhaps more intuitive than Firefox’s “enter a new mode, then click somewhere on the inspected page” method of visually selecting an element to inspect.

Here’s a screenshot of the fancy new inspector, being used to debug a CSS problem I was having with the text in the header of my blog:
Safari Nightly CSS Inspector, over my blog header

Update: I spaced on the author of the post. I guess I still think of the WebKit blog as Dave’s old Surfin’ Safari blog. It ain’t, and there are multiple authors on the new WebKit blog. Oops.

Locomotive Ruby on Rails Distro for MacOSX

I just grabbed the Locomotive distro of Ruby on Rails for MacOSX – what a nice package! Includes the latest build of Rails, a fresh copy of Ruby, all of the database connectors, RMagick and ImageMagick, some AJAX libraries, and a bunch of other stuff to play with. Best part is – it’s all self-contained in the Locomotive application, so it won’t affect any of the other bits installed on my system.

Looks like the best Rails development system so far – no idea if it translates to a server very easily though.

I’m going to try to force myself to play with Rails for at least a couple of hours every week to see what I can get it to do. This is a good headstart for that…

I just grabbed the Locomotive distro of Ruby on Rails for MacOSX – what a nice package! Includes the latest build of Rails, a fresh copy of Ruby, all of the database connectors, RMagick and ImageMagick, some AJAX libraries, and a bunch of other stuff to play with. Best part is – it’s all self-contained in the Locomotive application, so it won’t affect any of the other bits installed on my system.

Looks like the best Rails development system so far – no idea if it translates to a server very easily though.

I’m going to try to force myself to play with Rails for at least a couple of hours every week to see what I can get it to do. This is a good headstart for that…

Automator for Deploying WebObjects Application

For the Pachyderm project, we wanted a way to automatically update, build and deploy a WebObjects application and its supporting framework. The initial reaction was to just use a shell script, with xcodebuild running on the server to build the appropriate projects.

That didn’t work for us, because our server is still running 10.3 (with the appropriate older XCode dev. kit), while we’ve moved on to 10.4 and XCode 2.1 for development- so our server can’t understand the .xcodeproj files and barfs appropriately. Doh.

So, King and I whipped up an Automator-based workflow that runs on one of our dev. boxes. It first runs a shell script to update the source code from subversion, then builds the framework and application. It then runs a shell script to record the subversion revision number in a file in the compiled application (so we can display the revision number for bug reports etc… and not pollute our source code with revision numbers). Then, it connects to the server over afp, moves the old build products out of the way, and copies the new ones into place. About an hour later, WOMonitor comes through and cycles the app.

Basically, there is one “master” workflow that runs several nested workflows. This “master” is saved as an application, and I’ve set iCal to launch it every morning at 1:00am.

Yes. Source code management and enterprise application deployment with Automator and iCal 🙂

It seems to work well, but we initially had some permissions problems. It will also make it trivial for use to update the app at will.

For the Pachyderm project, we wanted a way to automatically update, build and deploy a WebObjects application and its supporting framework. The initial reaction was to just use a shell script, with xcodebuild running on the server to build the appropriate projects.

That didn’t work for us, because our server is still running 10.3 (with the appropriate older XCode dev. kit), while we’ve moved on to 10.4 and XCode 2.1 for development- so our server can’t understand the .xcodeproj files and barfs appropriately. Doh.

So, King and I whipped up an Automator-based workflow that runs on one of our dev. boxes. It first runs a shell script to update the source code from subversion, then builds the framework and application. It then runs a shell script to record the subversion revision number in a file in the compiled application (so we can display the revision number for bug reports etc… and not pollute our source code with revision numbers). Then, it connects to the server over afp, moves the old build products out of the way, and copies the new ones into place. About an hour later, WOMonitor comes through and cycles the app.

Basically, there is one “master” workflow that runs several nested workflows. This “master” is saved as an application, and I’ve set iCal to launch it every morning at 1:00am.

Yes. Source code management and enterprise application deployment with Automator and iCal 🙂

It seems to work well, but we initially had some permissions problems. It will also make it trivial for use to update the app at will.

BBEdit + Automator = Happiness

For the Mavericks project, I get to manually “fix” several large xml documents that are spit out of a couple of piped legacy databases and content management systems. Each time a file is exported, it is slightly different, and after the file is handed off to me I get to go in and manually massage the distressed bits so I can use it in a meaningful way.

Until now, that meant going in and doing the tweaks by hand – fixing stupid MS Word quotes and dashes and stuff, and replacing some crazy legacy-induced formatting tags etc… I’d occasionally miss something, or do what comes naturally to a mundane repetitive manual process – screw it up.

But, BBEdit 8.2 now has a boatload of handy Automator actions, and it looks like I can now trivially automate this tedious task. Here’s what the workflow looks like:

BBEdit + Automator

For the Mavericks project, I get to manually “fix” several large xml documents that are spit out of a couple of piped legacy databases and content management systems. Each time a file is exported, it is slightly different, and after the file is handed off to me I get to go in and manually massage the distressed bits so I can use it in a meaningful way.

Until now, that meant going in and doing the tweaks by hand – fixing stupid MS Word quotes and dashes and stuff, and replacing some crazy legacy-induced formatting tags etc… I’d occasionally miss something, or do what comes naturally to a mundane repetitive manual process – screw it up.

But, BBEdit 8.2 now has a boatload of handy Automator actions, and it looks like I can now trivially automate this tedious task. Here’s what the workflow looks like:

BBEdit + Automator

My SubEthaEdit Wishlist

I’ve been using SubEthaEdit as my primary text editor for a while now, and have come up with a list of things that would be nice to have in SEE.

  • multi-file searching. I just had to revert back to BBEdit to do this so I could modify a whole bunch of XML files. It would be cool if I could perform searches across entire directories (with the option of running recursively…)
  • Highlight the current line a bit better. JEdit does this quite nicely, and it makes it very easy to track what I’m doing if I have say 4 open documents. Just have a subtle border, or slightly different background colour on the line containing the text insertion cursor.
  • Reformat text. This would indent XML, stylize java, etc… Bonus points for having per-language options like inserting stub javadoc comments into java code, and fixing/flagging invalid XML/HTML

That’s really about it. I had some minor difficulties doing a funky regex-based search, but that speaks more to my (lack of) experience with regex, rather than SEE’s ability to handle proper regex…

UPDATE: As was pointed out in the comments for another SEE-related post, there is a service called “Tidy Service that provides HTML/XHTML reformatting for any Cocoa app. It works perfectly! (especially when you add the optional config file to tweak the layout of reformatted pages – documented here)

Now… what can reformat java source…

I’ve been using SubEthaEdit as my primary text editor for a while now, and have come up with a list of things that would be nice to have in SEE.

  • multi-file searching. I just had to revert back to BBEdit to do this so I could modify a whole bunch of XML files. It would be cool if I could perform searches across entire directories (with the option of running recursively…)
  • Highlight the current line a bit better. JEdit does this quite nicely, and it makes it very easy to track what I’m doing if I have say 4 open documents. Just have a subtle border, or slightly different background colour on the line containing the text insertion cursor.
  • Reformat text. This would indent XML, stylize java, etc… Bonus points for having per-language options like inserting stub javadoc comments into java code, and fixing/flagging invalid XML/HTML

That’s really about it. I had some minor difficulties doing a funky regex-based search, but that speaks more to my (lack of) experience with regex, rather than SEE’s ability to handle proper regex…

UPDATE: As was pointed out in the comments for another SEE-related post, there is a service called “Tidy Service that provides HTML/XHTML reformatting for any Cocoa app. It works perfectly! (especially when you add the optional config file to tweak the layout of reformatted pages – documented here)

Now… what can reformat java source…

Subversion hosting on SourceForge?

It looks like SourceForge is is planning to roll out subversion hosting as part of its service. They don’t give a timeline, but I hope it’s Real Soon Now.

That would be nice, because I’ve got to put a whole bunch of code there in the near future, and it’s all under SVN control now. Being able to do an svn export would help quite a bit, since I don’t want to lose all commit messages…

Update: As of 2006/02/21, Subversion is available for all projects on Sourceforge.

It looks like SourceForge is is planning to roll out subversion hosting as part of its service. They don’t give a timeline, but I hope it’s Real Soon Now.

That would be nice, because I’ve got to put a whole bunch of code there in the near future, and it’s all under SVN control now. Being able to do an svn export would help quite a bit, since I don’t want to lose all commit messages…

Update: As of 2006/02/21, Subversion is available for all projects on Sourceforge.

Ruby on Rails

I’ve been watching Ruby on Rails for a while now. It seems to be gaining some momentum.

Ruby seems like a nice language, and the Rails framework appears to add some WebObjects-like functionality. It looks like it’s got some stuff that approaches Direct-to-web. It still doesn’t look quite as elegant as WebObjects, but it is definitely interesting, and tries to be pretty cleanly MVC, which is nice. It’s also just sitting there at /usr/bin/ruby begging to be dusted off and called into action…

Basecamp was the first “real” app that used Ruby on Rails (and it’s a beauty app, to be sure). I’m sure there will be some others going live Real Soon Now.

I’d be interested in developing an app using it, except I’d have to throw away all of the java libraries I’m using (including APOLLO and PXFoundation). When/if I get a chance, I’ll work up a simple app to act as an alternate front end to the Asset Management Database, to see how well it works.

I’ve also been rolling around the idea of building more stuff in PHP, but haven’t found a decent framework to use, and I really dread having to roll everything from scratch. To be fair, I haven’t really looked very hard, either…

Update: MacOSX 10.3 ships with Ruby v. 1.6.8. The latest version is 1.8.1 (downloadable here).

Update: ImageMagick is available in Ruby via RMagick – there’s one dependency I don’t have to worry about…

Update: A Slashdot article comparing Ruby on Rails to Java Spring/Hybernate – sounds promising for RoR

I’ve been watching Ruby on Rails for a while now. It seems to be gaining some momentum.

Ruby seems like a nice language, and the Rails framework appears to add some WebObjects-like functionality. It looks like it’s got some stuff that approaches Direct-to-web. It still doesn’t look quite as elegant as WebObjects, but it is definitely interesting, and tries to be pretty cleanly MVC, which is nice. It’s also just sitting there at /usr/bin/ruby begging to be dusted off and called into action…

Basecamp was the first “real” app that used Ruby on Rails (and it’s a beauty app, to be sure). I’m sure there will be some others going live Real Soon Now.

I’d be interested in developing an app using it, except I’d have to throw away all of the java libraries I’m using (including APOLLO and PXFoundation). When/if I get a chance, I’ll work up a simple app to act as an alternate front end to the Asset Management Database, to see how well it works.

I’ve also been rolling around the idea of building more stuff in PHP, but haven’t found a decent framework to use, and I really dread having to roll everything from scratch. To be fair, I haven’t really looked very hard, either…

Update: MacOSX 10.3 ships with Ruby v. 1.6.8. The latest version is 1.8.1 (downloadable here).

Update: ImageMagick is available in Ruby via RMagick – there’s one dependency I don’t have to worry about…

Update: A Slashdot article comparing Ruby on Rails to Java Spring/Hybernate – sounds promising for RoR

SubEthaEdit vs BBEdit

I’ve been a hard core BBEdit user since BBEdit 6 (way back before MacOSX). It’s a great text editor, and has many awesome features. I’ve actually stuck at BBEdit 7, since the Big New Features in BBEdit 8 weren’t that big to me, and I couldn’t justify allocating budget for the upgrade license.

I’ve also dabbled with SubEthaEdit, but only seriously as a collaboration tool, never for serious text editing on my own.

However, I was just using it to edit some files, and it’s really nice as a standalone editor! It’s got just about everything I like about BBEdit, has a great UI, the collaboration stuff, and it’s free for non-commercial uses.

SubEthaEdit

The command line tool works nicely (without spewing up extra untitled documents if the app isn’t running when a document is opened via the command line tool), and integrates as a standard EDITOR, so I can use it for subversion commit messages. It’s got syntax colouring for any language I care about, which is nice.

The only thing I’m left wanting for with SubEthaEdit is code reformating. BBEdit has a great tool for reformatting HTML (and XML), and that’s invaluable when writing that. It’s also handy to be able to clean up the formatting on a chunk of java code, so the curly brackets all line up nicely so I can follow flow more easily. I suppose a separate reformatting tool would work fine, especially if it’s callable from within SubEthaEdit.

I’m going to try switching to SubEthaEdit as my primary editor for a while to see if it works as well as BBEdit in practice. I may even set XCode to open files for editing in SubEthaEdit (although XCode has a nice – but not perfect – code reformatter built in).

Now, if only I could find an efficient, well designed editor like SubEthaEdit, with the powerful code cleaning/formatting of JEdit

Update: Holy. Crap. Check out the demo movie of “block editing” – this could come in extremely handy!

Update: Well… One day with SEE, and I’m still pretty happy with it. I keep catching my reflexive command+option+shift+f to reformat html, but that’s not fatal… Besides, I’m supposed to be off for the week, so I should be spending less time reformatting HTML anyway 🙂

I’ve been a hard core BBEdit user since BBEdit 6 (way back before MacOSX). It’s a great text editor, and has many awesome features. I’ve actually stuck at BBEdit 7, since the Big New Features in BBEdit 8 weren’t that big to me, and I couldn’t justify allocating budget for the upgrade license.

I’ve also dabbled with SubEthaEdit, but only seriously as a collaboration tool, never for serious text editing on my own.

However, I was just using it to edit some files, and it’s really nice as a standalone editor! It’s got just about everything I like about BBEdit, has a great UI, the collaboration stuff, and it’s free for non-commercial uses.

SubEthaEdit

The command line tool works nicely (without spewing up extra untitled documents if the app isn’t running when a document is opened via the command line tool), and integrates as a standard EDITOR, so I can use it for subversion commit messages. It’s got syntax colouring for any language I care about, which is nice.

The only thing I’m left wanting for with SubEthaEdit is code reformating. BBEdit has a great tool for reformatting HTML (and XML), and that’s invaluable when writing that. It’s also handy to be able to clean up the formatting on a chunk of java code, so the curly brackets all line up nicely so I can follow flow more easily. I suppose a separate reformatting tool would work fine, especially if it’s callable from within SubEthaEdit.

I’m going to try switching to SubEthaEdit as my primary editor for a while to see if it works as well as BBEdit in practice. I may even set XCode to open files for editing in SubEthaEdit (although XCode has a nice – but not perfect – code reformatter built in).

Now, if only I could find an efficient, well designed editor like SubEthaEdit, with the powerful code cleaning/formatting of JEdit

Update: Holy. Crap. Check out the demo movie of “block editing” – this could come in extremely handy!

Update: Well… One day with SEE, and I’m still pretty happy with it. I keep catching my reflexive command+option+shift+f to reformat html, but that’s not fatal… Besides, I’m supposed to be off for the week, so I should be spending less time reformatting HTML anyway 🙂

XML Parsing into MySQL

I had to write a utility for the Mavericks project to allow me to import asset descriptions that were exported from ContentDM via a tweaked XML format, into a MySQL database for use in Pachyderm authoring. I was going to write a simple python or php script to do it, but realized just how much simpler it would be in WebObjects. Using JDOM to parse the xml into a DOM Document, and then passing the data into an EOEnterpriseObject to be persisted into the database. Access to both libraries made my code insanely simple.

It’s possible that it would be as simple in another environment, but I doubt I could have done it any faster or simpler in anything else. WebObjects really does rock.

My code is essentially one line to trigger parsing of the XML to the Document, 2 lines to create the EO and insert it into an editing context, a bunch of lines to populate the attributes of the EO with the various values in the XML ( nothing more complicated than record.setTitle(xmlElement.getChildText("Title"));), and a line to save the pending changes in the editing context. Easy peasy.

I had to write a utility for the Mavericks project to allow me to import asset descriptions that were exported from ContentDM via a tweaked XML format, into a MySQL database for use in Pachyderm authoring. I was going to write a simple python or php script to do it, but realized just how much simpler it would be in WebObjects. Using JDOM to parse the xml into a DOM Document, and then passing the data into an EOEnterpriseObject to be persisted into the database. Access to both libraries made my code insanely simple.

It’s possible that it would be as simple in another environment, but I doubt I could have done it any faster or simpler in anything else. WebObjects really does rock.

My code is essentially one line to trigger parsing of the XML to the Document, 2 lines to create the EO and insert it into an editing context, a bunch of lines to populate the attributes of the EO with the various values in the XML ( nothing more complicated than record.setTitle(xmlElement.getChildText("Title"));), and a line to save the pending changes in the editing context. Easy peasy.

Laszlo Platform now open source

The Laszlo Platform, which is kinda like Macromedia Flex, was just released as open source (under the Common Public License).

I’d looked at Laszlo Platform a while back, and it was pretty cool, offering dashboard-like stuff, sorta like Macromedia Central meets Sherlock meets Konfabulator. Kinda cool for dynamically generated flash content and widgets.

Open Source announcement here, and thoughts from the company’s CTO here.

It’s kind of like Flex, but without coughing up $12K per CPU on the server. Might come in handy for a Pachy 2.5 (or 3.0) authoring interface…

Thanks to Matt Raible for the link.

The Laszlo Platform, which is kinda like Macromedia Flex, was just released as open source (under the Common Public License).

I’d looked at Laszlo Platform a while back, and it was pretty cool, offering dashboard-like stuff, sorta like Macromedia Central meets Sherlock meets Konfabulator. Kinda cool for dynamically generated flash content and widgets.

Open Source announcement here, and thoughts from the company’s CTO here.

It’s kind of like Flex, but without coughing up $12K per CPU on the server. Might come in handy for a Pachy 2.5 (or 3.0) authoring interface…

Thanks to Matt Raible for the link.