Writ Large http://tom.wilcoxen.org Tom Wilcoxen's web development notes. Thu, 11 Sep 2008 17:20:25 +0000 http://wordpress.org/?v=2.2.2 en Flex Builder 3, .swc Libraries and Linked Source http://tom.wilcoxen.org/2008/09/11/flex-builder-3-swc-libraries-and-linked-source/ http://tom.wilcoxen.org/2008/09/11/flex-builder-3-swc-libraries-and-linked-source/#comments Thu, 11 Sep 2008 17:16:07 +0000 Tom flexNote to selfria http://tom.wilcoxen.org/2008/09/11/flex-builder-3-swc-libraries-and-linked-source/ I’ve been using Mate for some time and liking it very much. I wanted to be able to use Flex Builder’s ability to navigate to and view the source of included types. With only having the downloaded .swc file in my /libs directory that wasn’t possible. It took me some time to sort it out, so here’s my recipe in case it helps anyone (and so I can remember next time).

This should also work for any project that you can download the source for, that just happened to be Mate for me. I’m using Flex Builder 3 — not sure what would be different if anything with FB2.

1. Download the source using the directions here

2. Create a Flex Library Project in Flex Builder, let’s call it ‘MateLib’

3. Import the source into the project, leaving out all the .svn directories, such that your folder structure looks like:

MateLib
   /bin
   /com
      /asfusion
         /mate
            /etc....
   manifest.xml

4. Right click the project in the FB Navigator view and select: Properties -> Flex Library Compiler. Set the Namespace URL: to “http://mate.asfusion.com/” and Mainifest file: to manifest.xml

5. Save and build the project.

6. In your project that uses the library, select Properties -> Flex Build Path and click Add SWC and navigate to the MateLib project -> /bin folder and select the MateLib.swc file there.

Now you can use the standard way to include Mate components in your mxml, with:

xmlns:mate="http://mate.asfusion.com/"

And you’ll be able to view the source code by command-clicking (control-click on Windows I think) a Mate component. You can also select the text, e.g. Dispatcher, and use the F3 key. And… the classes will also come up and be navigable with the Open Type, command-T, navigator.

, , ]]>
http://tom.wilcoxen.org/2008/09/11/flex-builder-3-swc-libraries-and-linked-source/feed/
Merb with Phusion Passenger http://tom.wilcoxen.org/2008/07/21/merb-with-phusion-passenger/ http://tom.wilcoxen.org/2008/07/21/merb-with-phusion-passenger/#comments Tue, 22 Jul 2008 04:57:25 +0000 Tom macmerbruby http://tom.wilcoxen.org/2008/07/21/merb-with-phusion-passenger/ I just got Merb running under Phusion Passenger on my OS X Leopard MacBook and it all went well but with a couple gotchas. I looked at Manfred’s and TopFunky’s notes, but I couldn’t get Merb to kick in.

It turns out I was missing a config.ru as they were running straight Rails apps and Merb has to (gets to?) run as a Rack app. This page on Merbivore has all the info. I was being a bit dense about actually taking that first bit of code (# config.ru, etc) and putting it into a file at the root of my Merb app named config.ru. Once done Merb fired right up and it’s working swimmingly.

, , ]]>
http://tom.wilcoxen.org/2008/07/21/merb-with-phusion-passenger/feed/
Twice as fast. Half the price. Or not. http://tom.wilcoxen.org/2008/07/11/twice-as-fast-half-the-price-or-not/ http://tom.wilcoxen.org/2008/07/11/twice-as-fast-half-the-price-or-not/#comments Fri, 11 Jul 2008 23:43:42 +0000 Tom businessiPhonemac http://tom.wilcoxen.org/2008/07/11/twice-as-fast-half-the-price-or-not/ In April I changed jobs, moving from a position with a company-supplied phone to one without. I decided to go with AT&T as I wanted to make the plunge and get an iPhone. However, being a loooong time Apple customer (first Mac: 1984) I was aware that the new version was right around the corner, so I got a cheap LG flip phone and figured I’d upgrade when the new iPhone came out.

You’re probably already shaking your head at my naiveté. I’ve never been a heavy cell phone user — my plan before my company provided phone was a pay-as-you-go with Virgin, which suited my pretty well actually. I’m not a big talker, but I am a big emailer/web browser, etc., hence the iPhone lust.

So here’s some numbers I’m running through my head — the cost of my LG phone (a refurb, fwiw) was about $10 — they seem to be going for $80 used — I’d imagine AT&T would have gotten them for that at most. So say they funded $70 of my phone.

I have the cheapest phone plan at $40/month with a $10 media plan. So far:

AT&T -> Tom $70
Tom -> AT&T $50/mo * 3 = $150

Now, due to that $70 AT&T won’t provide me the upgrade price, but will generously allow me to upgrade for the open price of $399/$499 — although in order to do so I would still be required to extend my plan. Why? I don’t know.

What I would like to do:
AT&T -> Tom $200 (iPhone subsidy)
Tom -> AT&T $70/mo + $5/mo for text

I would even be happy to pay off that $70 debt I have for the LG subsidy. AT&T would be $25/month ahead, meaning they’d pay back the LG subsidy within a few months and have $300/year more of my cash indefinitely.

It’s just hard to not feel penalized as an existing customer and boy, do I regret not doing a pay-as-you-go plan for a while. At this point looking into alternatives like a cracked phone and switching providers would look good, if it was feasible. It just makes me want to leave AT&T. Here they have a chance to increase their revenue from me, but they manage to turn that around and make me an unhappy customer.

Sheesh.

, , ]]>
http://tom.wilcoxen.org/2008/07/11/twice-as-fast-half-the-price-or-not/feed/
FlexBuilder 3 Security Sandbox Explained http://tom.wilcoxen.org/2008/07/01/flexbuilder-3-security-sandbox-explained/ http://tom.wilcoxen.org/2008/07/01/flexbuilder-3-security-sandbox-explained/#comments Tue, 01 Jul 2008 16:54:58 +0000 Tom actionscriptflexNote to selfria http://tom.wilcoxen.org/2008/07/01/flexbuilder-3-security-sandbox-explained/ I’ve been trying to load a local file with some dummy data and hitting a security warning. I was running out of FlexBuilder 3 and trying to read a local file, so wasn’t sure why I was getting a security error.

I’d come across many references to adding a cross domain policy to a web server, but this is the first full explanation of the security sandbox that made sense to me. Following this, I added:

-use-network=false

To the custom compiler line in the project preferences and all is well. Here’s the link with a great explanation:

http://blogs.adobe.com/flexdoc/2008/06/the_security_sandbox_in_flex_b.html

, , , ]]>
http://tom.wilcoxen.org/2008/07/01/flexbuilder-3-security-sandbox-explained/feed/
Flex Time http://tom.wilcoxen.org/2008/06/24/flex-time/ http://tom.wilcoxen.org/2008/06/24/flex-time/#comments Tue, 24 Jun 2008 21:07:48 +0000 Tom designdesign patternsflexNote to selfriaUncategorized http://tom.wilcoxen.org/2008/06/24/flex-time/ It looks like I’ll be doing Flex RIA development, which I’m really looking forward to. Right now I need to tuck away a few links for further study…

Cairngen - for generating the basics for a Cairngorm Flex app:
http://code.google.com/p/cairngen/wiki/GettingStarted

Paul Williams - a series of blog posts on presentation tier design patterns with an eye to Flex:
http://weblogs.macromedia.com/paulw/

dpUint - Flex unit testing framework with async testing support baked-in:
http://code.google.com/p/dpuint/wiki/Introduction

Prana - an IoC for Flex… useful with Cairngorm:
http://www.herrodius.com/blog/64

Steven Weber very good introduction to Cairngorm:
http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html

Bruce Eckel articles on Artima:
http://www.artima.com/weblogs/viewpost.jsp?thread=212818
http://www.artima.com/weblogs/viewpost.jsp?thread=230610

And Getting Started with Flex at Adobe:
http://learn.adobe.com/wiki/display/Flex/Getting+Started

, , , , , ]]>
http://tom.wilcoxen.org/2008/06/24/flex-time/feed/
Migrating user accounts w/o Firewire Target Disk http://tom.wilcoxen.org/2007/06/26/migrating-user-accounts-wo-firewire-target-disk/ http://tom.wilcoxen.org/2007/06/26/migrating-user-accounts-wo-firewire-target-disk/#comments Tue, 26 Jun 2007 22:27:44 +0000 Tom macos x http://tom.wilcoxen.org/2007/06/26/migrating-user-accounts-wo-firewire-target-disk/ Perhaps this is an edge case, but recently I wanted to migrate my wife’s account from a G4 Yikes (1st generation G4 desktop machine) to a MacBook. It turns out that the G4 Yikes (aka, non-AGP graphics G4) is the only G4 (or, I believe G3) with built-in Firewire that won’t go into target disk mode.

You can, however, use the Migration Assistant with a mounted volume — if you happen to be able to yank the drive from the old machine and pop it in the new one, you’re good to go. I couldn’t, but had an external Firewire/USB drive. I used SuperDuper! to make a backup of the G4 HD, copied that to the external drive and then migrated from that onto the MacBook.

It worked great, but beware: you have to register SuperDuper! to get the full copy capability. I had registered, but was using a demo copy on the G4 and kept getting only the Users folder copied (which isn’t enough to Migrate from). With the registered version it will actually make a bootable volume.

Technorati Tags: ,

, ]]>
http://tom.wilcoxen.org/2007/06/26/migrating-user-accounts-wo-firewire-target-disk/feed/
Preventing XSS from entering your database http://tom.wilcoxen.org/2007/06/08/preventing-xss-from-entering-your-database/ http://tom.wilcoxen.org/2007/06/08/preventing-xss-from-entering-your-database/#comments Fri, 08 Jun 2007 21:54:38 +0000 Tom railsrails xss securityUncategorized http://tom.wilcoxen.org/2007/06/08/preventing-xss-from-entering-your-database/ I had all of our data being html-escaped as it was rendered to the page, but the problem is that other systems interact with ours — we send data to web analytics systems and to SalesForce.com. In that case you can’t count on escaping entities on display — you need to catch it on the way into your database.

I found a few sites with some fixes, though most were still focused on cleaning the data on display. I ended up taking Rick’s plugin and applying it at save time in the model object. I’m not sure it’s the cleanest — I’d almost certainly say there is a more elegant way to do this — but this was quick and works great.

It’s still basically designed to be used at output time:

<%= white_list @article.body %>

But instead I include the helper directly to a model and overwrite the attribute setters:


class Contact < ActiveRecord::Base

include WhiteListHelper

def name=(text) write_attribute(:name, white_list(text)) end

end

I tried setting up a before_filter and stepping through the param[] object, but my data was fairly simple and the above was dead easy.

, , ]]>
http://tom.wilcoxen.org/2007/06/08/preventing-xss-from-entering-your-database/feed/
ecto and WordPress on Dreamhost http://tom.wilcoxen.org/2007/05/11/ecto-and-wordpress-on-dreamhost/ http://tom.wilcoxen.org/2007/05/11/ecto-and-wordpress-on-dreamhost/#comments Fri, 11 May 2007 19:30:32 +0000 Tom dreamhostectowordpressxml rpc http://tom.wilcoxen.org/2007/05/11/ecto-and-wordpress-on-dreamhost/ Ok, this took me far too long to track down. I got my blog set up nice and quick like using Dreamhost one-click installs - so far so good.

But then I went to try ecto to post and kept getting a cryptic error:

XML-RPC server accepts POST requests only.

I went through checking username/password, checking .htaccess, etc. and was having no luck. I finally thought to check the Dreamhost wiki and found the answer: add this line to the top of your xmlrpc.php file at the base of your WordPress install:

$HTTP_RAW_POST_DATA = file_get_contents(”php://input”);

All better. It’s apparently got to do with PHP 5.2.2.

Technorati Tags: ,

, , , ]]>
http://tom.wilcoxen.org/2007/05/11/ecto-and-wordpress-on-dreamhost/feed/
Windows CRLF IE whitespace bug http://tom.wilcoxen.org/2006/09/21/windows-crlf-ie-whitespace-bug/ http://tom.wilcoxen.org/2006/09/21/windows-crlf-ie-whitespace-bug/#comments Thu, 21 Sep 2006 07:39:00 +0000 Tom http://tom.wilcoxen.org/2006/09/21/windows-crlf-ie-whitespace-bug/ Lately I’ve been doing a lot more html/css than I’ve done for several years. It’s good to be back in it, and it’s somewhat of a relief to be targeting IE6 and better. By better of course I mean Firefox.

Besides the amazing 3 pixel gap bug I had to hunt down, I’ve spent a load of time ironing out IE6 issues.

Yesterday’s fun was a small amount of space above the headlines in some pages.
It only showed up in IE – Firefox was fine. After reducing the included files to no more than a word of plain text – and both included files were going into the same template – I took a look at the files themselves.

It turns out that all the misbehaving files were saved with Windows line endings (CRLF). I had to actually create new files and copy in the content to fix the issue – doing a Save As didn’t do it.

I’m not sure how these files came to be as all the development’s been done on a Mac using TextMate. But something to look for if you see inexplicable addition of whitespace in your pages in IE.

]]>
http://tom.wilcoxen.org/2006/09/21/windows-crlf-ie-whitespace-bug/feed/
Capistrano subversion permissions issue http://tom.wilcoxen.org/2006/08/27/capistrano-subversion-permissions-issue/ http://tom.wilcoxen.org/2006/08/27/capistrano-subversion-permissions-issue/#comments Sun, 27 Aug 2006 06:48:00 +0000 Tom http://tom.wilcoxen.org/2006/08/27/capistrano-subversion-permissions-issue/ I finally got Capistrano running. The last hurdle was a funky one having to do with subversion. Our deployment environment is 2 web/application servers and one db server. We have another machine that hosts our subversion repository.

The issue was that each machine has to check out from the subversion server. When they went to do that, there was a message to accept the server or not. This would hang Capistrano.

To solve it, ssh into each of your web/app/db machines. From each, check out from the subversion server interactively and choose to permanently accept the svn server.

]]>
http://tom.wilcoxen.org/2006/08/27/capistrano-subversion-permissions-issue/feed/