Security sandbox violation / Send Failed

For Flex working with ColdFusion to fix an error like one of the following:

“Error #2048: Security sandbox violation”

OR

faultCode:Client.Error.MessageSend

faultString:’Send Failed’

faultDetail:’Channel.Security.Error error Error #2048: Security sandbox violation:

file:// …….. .swf cannot load data from http://localhost/flex2gateway

OR

Fault faultString=”Send failed”

faultCode=”Client.Error.MessageSend”

faultDetail=”Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500: url: ‘http://…’”

Check your crossdomain.xml file.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Flex / Flash Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: …

When attempting to access a URL via the URLLoader, eg:

var loader:URLLoader = new URLLoader(“some url or uri”);
You get an error:
Flex / Flash Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: …
I modified the code referenced from:
To create an URLErrorHandler that will attach to a URLLoader.  So, to easily attach default error handlers to the above code simply:
new URLErrorHandler(loader);
The code for the URLErrorHandler class is:
package modules
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.HTTPStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoader;

public class URLErrorHandler
{
private var errorCallback:Function = null;

/*
Specify a callback function on an error if desired.  The callback function prototype is
public function onError(event:Event):void
*/
public function URLErrorHandler(loader:URLLoader, onError:Function = null)
{
if (loader == null)
return;
loader.addEventListener ( IOErrorEvent.IO_ERROR, handleIOError );
loader.addEventListener ( HTTPStatusEvent.HTTP_STATUS, handleHttpStatus );
loader.addEventListener ( SecurityErrorEvent.SECURITY_ERROR, handleSecurityError );
//loader.addEventListener ( Event.COMPLETE, handleComplete );

errorCallback = onError;
}
function handleIOError ( event:IOErrorEvent ):void
{
trace ( “Load failed: IO error: ” + event.text );
if (errorCallback != null) errorCallback(event);
}
function handleHttpStatus ( event:HTTPStatusEvent ):void
{
trace ( “Load failed: HTTP Status = ” + event.status );
//if (errorCallback != null) errorCallback(event);
}
function handleSecurityError ( event:SecurityErrorEvent ):void
{
trace ( “Load failed: Security Error: ” + event.text );
//if (errorCallback != null) errorCallback(event);
}
}
}

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Apache Mod_rewrite for a secure site and Flex gateway

Rewrite all non-secure URLs aside from flex gateways for ColdFusion to a secure https server.  Here’s a sample Apache configuration:

<VirtualHost *:80>
RewriteEngine On
#  Don’t inherit the mod_rewrite options - don’t mess up flex data.

#  Allow all for the document root, but then will redirect all
#  non-flex based data (flex2gateway, crossdomain.xml, etc) to
#  https server which will do the allow/deny based on logic.
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”
<Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”>
Order deny,allow
Allow from all
</Directory>

Alias /favicon.ico /icons/favicon.ico
Alias /icons /icons

# Redirect all non-flex2gateway related http traffic to https.
RewriteCond %{REQUEST_URI} !(/crossdomain.xml)
RewriteCond %{REQUEST_URI} !(^/flex2gateway|^/flashservices|^/CFIDE)($|/)
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Meredith says Da-Da!

Meredith says Da-Da!

I’ve been practicing with her for awhile.  She could mimic hello and then I got her to mimic Da-Da.  She’s been practicing and I believe can associate the word with me!

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Samsung Epic versus HTC Evo - Sprint 4G

4G Smartphone  Features

HTC EVO 4G

Samsung Epic 4G

2G Network

CDMA 800 / 1900 CDMA 800 / 1900

3G Network

CDMA2000 1xEV-DO CDMA2000 1xEV-DO

Announced

2010, March 2010, June

Status

Available. Released 2010, June Coming soon. Exp. release 2010, August

Dimensions

4.8 x 2.6 x 0.5 inches 122 x 66 x 13 mm 4.9 x 2.54 x 0.56 inches 124 x 65 x 14 mm

Weight

177 g 155 g

RAM

1GB 1GB

ROM

512MB 512MB

CPU

1GHz Qualcomm QSD 8650 Snapdragon 1GHz ARM Cortex A8 Hummingbird

OS

Android 2.1 Android 2.1

Display

4.3-inch WVGA capacitive LCD 4 Inch WVGA capacitive Super AMOLED

Resoluiton

65K colors; 480 x 800 pixels 16M colors; 480 x 800 pixels

UI

HTC Sense with Friend Stream TouchWiz UI 3.0
Multi-touch input method Multi-touch input method
Proximity sensor for auto turn-off Proximity sensor for auto turn-off
Accelerometer sensor for UI auto-rotate Accelerometer sensor for UI auto-rotate
- Touch-sensitive controls
- Swype text input

Physical Keyboard

No Yes

microSD

Up to 32GB, 8GB included Up to 32GB, 16GB included

3G

Rev. A, up to 3.1 Mbps Rev. A, up to 3.1 Mbps

WLAN / 4G

Wi-Fi 802.11 b/g, WiMAX 802.16 e (Wi-Fi router) Wi-Fi 802.11 b/g/n; WiMAX (Wi-Fi router)

Wi-Fi Router

Yes Yes

Bluetooth

Yes v2.1 with A2DP Yes, v2.1 with A2DP

USB

Yes, microUSB v2.0 Yes, v2.0 microUSB

Camera

8 MP, 3264×2448 pixels, autofocus, 2x digital zoom, dual-LED flash 5 MP, 2592 x 1944 pixels, autofocus, 3x digital zoom, LED flash

Video

720p HD 720p HD @30fps

Camera Features

Geo-tagging Geo-tagging, touch focus, face and smile detection

Front Camera

1.3 MP VGA

Battery

Standard battery, Li-Ion 1500 mAh Standard battery, Li-Ion 1500 mAh

Sensors

Proximity and Motion sensors Six-axis motion sensor, proximity sensor, light sensor

Video Out

HDMI port DLNA (Wireless)

Infrared Port

No No

Media Formats

MP3/WAV/AAC+/WMA9 player MP3/WAV/eAAC+/AC3/ FLAC player
MP4/H.263/H.264/WMV9 player MP4/H.264/H.263/DivX/ WMV player

Alert types

Vibration, MP3, WAV ringtones Vibration, MP3, WAV ringtones

Speakerphone

Yes Yes

Audio Jack

3.5 mm audio jack 3.5 mm audio jack

Phonebook

Practically unlimited entries and fields, Photocall Practically unlimited entries and fields, Photocall

Call records

Practically unlimited Practically unlimited

GPRS

No No

EDGE

No No

Messaging

SMS(threaded view), MMS, Email, Push Email, IM SMS(threaded view), MMS, Email, Push Mail, IM, RSS

Browser

HTML HTML

Radio

Stereo FM radio with RDS Stereo FM radio with RDS

Games

Yes Yes

Colors

Black Black

GPS

Yes, with A-GPS support Yes, with A-GPS support

Java

Via third party application Via third party application
Social networking itegration Social networking integration
Digital compass Digital compass
Voice memo Voice memo/dial/commands
Google Search, Maps, Gmail Google Search, Maps, Gmail
YouTube, Google Talk, Picasa integration YouTube, Google Talk, Picasa integration
Image/video editor
Document editor (Word, Excel, PowerPoint, PDF)
Calendar & Organizer
Dedicated Search Key Flash Lite v3.1

Sprint HTC EVO 4G :

Sprint Samsung Epic 4G:

Samsung Epic

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

How to make multiple lines of text in Flex components

Since \n doesn’t work, you have to specify the newline code in an escaped manner.

<mx:TextArea text=”Saving. Please wait.” textAlign=”center” />

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

PHP Class for MySQL and Prepared Statements Reference

For prepared statements in PHP / mySQL check out:

http://mattbango.com/notebook/web-development/prepared-statements-in-php-and-mysqli/

Combine that with:

<?php
class MySqlDriver {
private
$_Link;

public function __construct( <…> ) {
$this->_Link = mysql_connect( <…> );
}

// this will be called automatically at the end of scope
public function __destruct() {
mysql_close( $this->_Link );
}
}

$_gLink = new MySqlDriver( <…> );
// and you don’t need to close the link manually
?>

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

SVN Vendor Branch Management

Here’s the best reference I could find on vendor branching.

http://svnbook.red-bean.com/en/1.1/ch07s05.html

The main idea is if you are updating or modifying another group’s source project and you want your updates to be applied to updates from the group’s next release.  This is called vendor branching.  Basically, create a vendor repository and import the vendor’s code to that repository.  For each release from the vendor, tag the code in that repository.  Then import the diffs from one tag to another applied to your main trunk which contains the features you added.

Also, check out snv_load_dirs.pl for loading directories as it will better capture files that are moved as part of an upgrade.  Eg. you might modify file A1 from a vendor, then the vendor moves it to a new directory.  You will still want your modifications applied to the same upgraded file in the new location.  Simply importing a tree into an svn vendor branch without this function might not pick up that file A1 was moved.

$ svn copy http://svn.example.com/repos/vendor/libcomplex/current \ http://svn.example.com/repos/vendor/libcomplex/1.0 \ -m ‘tagging libcomplex-1.0′

$ svn copy http://svn.example.com/repos/vendor/libcomplex/1.0 \ http://svn.example.com/repos/calc/libcomplex \ -m ‘bringing libcomplex-1.0 into the main branch’ …

Add your features, fixes, etc.  Then vendor releases a new release…

$ cd working-copies/calc $ svn merge http://svn.example.com/repos/vendor/libcomplex/1.0 \ http://svn.example.com/repos/vendor/libcomplex/current \ libcomplex

… # resolve all the conflicts between their changes and our changes

$ svn commit -m ‘merging libcomplex-1.1 into the main branch’

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Subclipse, eclipse, svn, “Error while reading log messages from file”

I got this error when in Flex Builder / Eclipse and using SVN.

I had done a commit, then SVN thought it needed to commit the base directory which had no revisions.  I committed it, then came back and added log comment later on.  When I went to view the revision tree, SVN gave the message “Error while reading log messages from file.”  I tried everything from restarting eclipse, checking out a new copy of the project, to committing a new revision.  But, it turns out you just need to refresh the SVN tree.

First, make sure you have the SVN Repository view open.  Window->Other Views->SVN->SVN Repositories

Then click on the SVN Repositories tab, right click your repository having the problem and clear the revision graph cache.  Right click then choose “Clear revision graph cache”

Next Right click and choose “Build/Update revision graph cache”

Then select your project tree, eg myProject/trunk, right click and choose “Show Revision Graph” and it’ll work.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Delete a Subversion (SVN) Revision

If you just had a commit error on the repository or just committed something by accident, an easy way to remove the revision from the repository is to reload the repository up until the previous revision.  Say the latest commit 603 just had an error or mistake.

First backup the repository up until the previous revision:

svnadmin dump -r1:602 repositoryName > repositoryName.dump

Next, you’ll need to import the dump into a new repository.  You can either delete the old and create one of the same name or create a new name.

svnadmin create repositoryName

svnadmin load repositoryName < repositoryName.dump

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz