NEWS:

flex & actionscript & ria 01 Jul 2008 09:54 am

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

ria & Note to self & design 24 Jun 2008 02:07 pm

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

os x & mac 26 Jun 2007 03:27 pm

Migrating user accounts w/o 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: ,

rails 08 Jun 2007 02:54 pm

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.

DreamHost 11 May 2007 12:30 pm

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: ,

Uncategorized 21 Sep 2006 07:39 am

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.

Note to self 27 Aug 2006 06:48 am

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.

Uncategorized 17 Apr 2006 07:38 am

time.onrails.org Launches

time.onrails.org is a free time tracking application written by Daniel Wanja of Nouvelles Solutions. I’ve used it some in development and it’s a very handy tool. If you bill by the hour head over and check it out.

Launch Announcement

Uncategorized 21 Mar 2006 12:56 pm

rtex PDF mojo on Windows

Bruce Williams has release a nice plugin to access pdftex using Rails Views to generate PDFs:

http://codefluency.com/pages/rtex

pdftex is probably already installed if you are on a *nix system, but if on Windows you’ll need to install it. I’m in that category (for the moment) and found it pretty easy to get going.

There are many LaTeX distributions and most of them now include pdftex. I used one called proTeXt that promised to be comprehensive and easy to install. It seems to be both so far:

http://www.tug.org/protext/

It’s a substantial download of about 415 MB. I don’t know if there are others that are lighter – probably so. This one includes 2 different editors along with a number of other extras. I was interested in LaTeX itself as I’ve heard about it over the years and just never had a good reason to dive in and check it out. So I grabbed proTeXt as it seems it will allow me to dig in a bit. I used to work in the graphic design world and had a particular liking for working with text, so I want the full tour.

After you download, extract the archive to a temp directory. Then open up the directory structure to protext/install and open the PDF for your language. The rest of proTeXt is actually installed by use of this PDF. It’s a pretty nice system really – you get a couple paragraphs on why you are about to do what you are about to do, then a link is presented that starts the next install. It’s very clear about what can be skipped (like those two editors) and what is essential. Pretty cool, really.

Install the plugin to a Rails app and fire it up. Bruce has a sample controller method – just be sure to add ‘renderwithoutlayout’:

  def mypdf    @time = Time.now    renderwithoutlayout  end

The ‘rtex’ view (mypdf.rtex) is:

  documentclass[11pt]{article}  begin{document}

    The time is <%= @time %>.

  end{document}

This is kind of a throwback to me. In the early 90s I worked to convert a publishing system at a newspaper from using a linotype typesetting machine to using Macs and QuarkXPress (version 3 was just about to come out – woo!). This looks kind of like the markup that our typesetter understood. It should work well for generating documents, but I’m not sure I’m ready to start inserting LaTeX into my writing. But for generating documents it looks to work well, and it seems you have about as much typographic control as those old typesetters did, which was really a pleasure to see, if not to mark-up.

Next step is to try creating a table. I’ll post a sample when I have one.

Uncategorized 19 Jan 2006 09:56 pm

Migrate Away your Cruft

Last summer I developed my first Rails application under a very tight deadline. I cut a few(!) corners and one was not creating a link from my Person table to my Team table for the team coach.

So I’m trying to clean up after myself a bit. It turns out that I can get about 90% of the way there for just a few quick lines of code:

class AddFieldsToTeam < ActiveRecord::Migration
  def self.up
    add_column :teams, :coach_id, :integer
    add_column :teams, :asst_coach_id, :integer

    Team.reset_column_information

    @teams = Team.find(:all)
    @teams.each do |t|
      c = Person.find_by_full_name t.coach
      ac = Person.find_by_full_name t.asst_coach
      if !c.nil? || ac.nil?
        t.coach_id = c.id unless c.nil?
        t.asst_coach_id = ac.id unless ac.nil?
        t.save
      end
    end
  end

  def self.down
    remove_column :teams, :coach_id
    remove_column :teams, :asst_coach_id
  end
end

Here’s the findby_fullname:

  def self.find_by_full_name(fn)
    name = fn.split
    find(:first, :conditions => ["void = 0 and first_name = ? and last_name = ?", name.first, name.last])
  end

That’s just too easy.

Next Page »