An error has occurred, ‘The string is not closed.’.

•May 17, 2007 • Leave a Comment

I started getting an error emailed to be from a system that’s been humming along nicely for a while now. The Flex front end and the CF data dumps were fine, but the CF Report Builder report was blowing up for one month for one report with the error

An error has occurred, ‘The string is not closed.’.

Turns out someone put a “#” into one of the fields. I don’t know why this didn’t come up while testing.  I changed the “#” to “number” for a quick fix.

People are lazy.

Review: Spider-man 3 (PS2)

•May 16, 2007 • Leave a Comment

Booooooooooommmmmmmmmmb

I can easily say I didn’t give this enough time to really appreciate it. I played for under and hour before I got mad at it and quit.  Bruce Campbell doing the voice over is the best part by far.

Controls are loose, there’s loading time scattered all over the place, and interacting with objects requires a silly amount of precision.  Such as one of the first missions, you have to destroy 7 bombs on a building.  You’re crawling around the outside of the building and hit triangle when you get to the square shaped bomb.  But for some reason you can only destroy the bomb from one of the four sides.  Web swinging didn’t have the feeling of speed that Spider-man 2 did for Gamecube. There’s upgrades for all that I’m sure. But I have to remain interested in the game long enough to get to those upgrades.

One amusing thing is how buggy the NPCs are.  You finish a mission for a little white lady and return her purse or whatever. She’ll tell you about the next mission in her husky black man voice. That’s hot.

2 out of 5 [Slimy Murloc Scales]

Review: The Godfather: Mob Wars (PSP)

•May 16, 2007 • Leave a Comment

If you loved The Godfather for PS2, then you can easily pass on the PSP adaptation. Rather than running/driving around the city and taking over businesses, they’ve put in a turn based strategy mode (Mob Wars) to accomplish this. You do a few missions and are introduced to that. I beat the Mob Wars section of the game in about 3 hours of only half paying attention. This powered by character up enough that story mode was a joke.

There’s a single difficulty level, you can’t skip cut scenes, there’s nothing to do when you beat the game other than replay. All driving was removed and you can’t customize your character. I did have an edge though, from playing this game on PS2. All buildings have the same layout and I knew the control set up.

I’m just glad I rented this instead of buying it. Any game that you can beat the snot out of in 5 hours, then has no replay value, isn’t worth more than $5.

3 out of 5 [Murloc Eyes] if you haven’t played any of the new Godfather games on another system, otherwise 2 out of 5. And only because the strategy game starts to get really interesting right before you win and can’t play it anymore.

Passing object to a CFC, Flex or CF bug?

•May 15, 2007 • 1 Comment

I’m not sure who is to blame, but this really smells like a bug to me. I’m getting into the habit of creating an object in Flex if I’m sending a lot of fields to a CFC. It shortens up the RemoteObject call and makes debugging easier because then all the data to be passed is in a single structure.

So I have this harmless looking bit of code. Make an object, figure out the value of some Boolean, and call a method in my RemoteObject.

var deptInfo:Object = new Object();
var newDept:Boolean = chNewDept.selected ? true : false;
deptInfo = {
  DepartmentID : cbEditDept.selectedItem.DepartmentID,
  Department : tiEditDeptName.text,
  Division : cbEditDivision.selectedItem.Division,
  newDept : newDept};
ro.saveDepartment(deptInfo);

Simple enough. The function it’s calling is simple too. Take the data and mangle it with queries and whatever.

<cffunction name="saveDepartment">
  <cfargument name="deptInfo" type="struct" required="true">
  ...
</cffunction>

Cool, let’s run it…

coldfusion.runtime.MissingArgumentException: The parameter DEPTINFO to function saveDepartment is required but was not passed in.

AHH! What? Everything I tried in Flex, that object wasn’t ending up in the arguments scope of the ColdFusion function. I set the access to remote and called the function through the URL, it works fine. I tried a cfinvoke from ColdFusion…

<cfset deptInfo = StructNew()>
<cfset deptInfo["DepartmentID"] = 1>
<cfset deptInfo["Department"] = "testdept">
<cfset deptInfo["Division"] = "testdiv">
<cfset deptInfo["newDept"] = true>
<cfinvoke component="kiosc.cfc.disc" method="saveDepartment" deptInfo="#deptInfo#"/>

And it works fine. So what’s wrong with this running from Flex? I checked with ServiceCapture, that shows the object’s data being passed properly over the wire. I got the bright idea to pass another, dummy, variable along with my structure.

ro.saveDepartment(deptInfo,1);

And that works. So tell me, what the hell. Searching Google came up with nothing, implying no one else is having this problem. I have another application that does this same thing, making an object and passing it to the CFC, and that worked fine. But that one is sending the object and 2 arrays. This one that didn’t work is only passing the object. Is there some bug with only passing a single object to a CFC?

RemoteObject vs WebService gotcha

•May 14, 2007 • Leave a Comment

I discovered something annoying a while ago.  RemoteObject calls will return your variables with the same case as was in your CFC.  WebService however will return all uppercase.  Furthermore a CFC that returns a query will give you an ArrayCollection of Objects with RemoteObject and an Array of ObjectProxy type objects with WebService.  Good reason to not switch between the two in your code.

Dynamic RemoteObject CFC source

•May 14, 2007 • Leave a Comment

I have an app that is in one folder structure in dev an another in test and prod. So I needed to assign the location of the CFC(s) as a variable somehow. This could have been solved by going into my flex folder within the ColdFusion installation and adding the CFC as a destination, but this generally isn’t an option, especially in shared hosting environments. So in my main application MXML file, I slapped in

public var cfcLocation:String = "pathInDev.cfc.disc";
//public var cfcLocation:String = "pathInProd.morePath.cfc.disc";

And my RemoteObject calls become

<mx:RemoteObject
  id="ro"
  destination="ColdFusion"
  source="{mx.core.Application.application.cfcLocation}">
  ...
</mx:RemoteObject>

Then to make a build for test, I swap which variable assignment is commented out.

WoW 2.1.0 … tomorrow?

•May 14, 2007 • Leave a Comment

2.1.0 Patch Notes

I was reading through the patch notes again, I can’t wait!! I hope this drops tomorrow. All those new quests! New flying mounts! Mend pet as an instant cast HoT!  Kill Command not using the global cooldown! I’ve been working on dragonscale leatherworking and have that up to about 352, but everything I can make that’s orange requires at least 6 primals.  So it’s getting extremely expensive / time consuming. At 365 I think everything will need primal nethers. The new quests will help regenerate my gold levels (down to 250g across all characters!) and maybe I’ll finally get some boots to replace my level 60 Cryptstalker booties.  I sold off some green boots from a high 60s quest in Netherstorm that were actually better.  But they were ugly.  And all the armor that replaces the sweet epix I had before better be a massive upgrade AND look awesome.

Why I’ve been working on Dragonscale LW…

http://spreadsheets.google.com/ccc?key=p8C44qiSmbMEo208w1_C0Zg

I got an addon that looks at your total stats and talents and computes weighting for each item on armor.  According to these numbers, I can craft stuff that’s better than T5.  I don’t really believe the computed numbers because the addon said that mana/5 is worth almost 4 times more than agility.  Before a few months ago, I couldn’t have cared less about mana regen, I’m just now appreciating how useful it is for long fights.  But since my new guild isn’t taking Karazhan yet, any upgrades are a good thing for me.

Castlereagh on the Armory

I heard from a friend this weekend that Blizzard is making the “color” of each item no longer represent the actual quality of the item, but how difficult it is to get.  This means they should make level 60 running mounts blue and fast fliers purple and the new netherwing mounts orange.  But Blizz also wants to destroy the old big raiding guilds, hence no 40 man stuff in the expansion.  But in order to get T4 or T5, you need a 10 or 25 man run.  Well I’m in a social guild now that runs 5 man stuff if we have enough people on. Where’s the tier gear that can be gotten with 5 people?  They’re still forcing 10+ people to be around, which keeps casual gamers from getting really high end stuff.

Note to self: Plan in advance

•May 14, 2007 • Leave a Comment

I built up the admin page of this little Flex app at work, starting with just one item on it, editing employee info.  But there was space, so I added editing departments.  Still space left, so I added edited team leads.  I hooked up everything so it interacts with the database, handles errors, validates info, whatever.  Then I realized my MXML file was close to 500 lines, with three distinct functions and thought “hey, I should split this into 3 components!” and started down that road.

What a pain in the ass.

My lesson learned today: plan your screens out in advance.  Adding stuff to the file until it reaches some critical mass and then splitting it is a bad idea.  I’m now stuck figuring out where all these function to control the three parts should go.  I’m not sure on the best practice, but from now on, before hooking up second set of functionality in the same MXML file, I’ll be sure it really belongs.

Printing in Flex

•May 11, 2007 • Leave a Comment

I had to print something from Flex, but the LiveDocs weren’t that helpful. I found this function and modified it to make it more generic…

<mx:Script>
  <![CDATA[
    import mx.core.IUIComponent;
    import mx.printing.FlexPrintJob;
    private function doPrint(printMe:IUIComponent):void{
      var pj:FlexPrintJob = new FlexPrintJob();
      if( pj.start() != true ){
        return;
      }
      pj.addObject(printMe);
      pj.send();
    }
  ]]>
</mx:Script>

Then define some display object you’ll want to print. I loaded another component into this canvas.

<mx:Canvas
id="formContent" backgroundColor="#ffffff"/>

And a button to print, passing it the component above. It’s that simple!

<mx:Button label="Print" click="doPrint(formContent)"/>

No DateAdd()…?

•May 11, 2007 • Leave a Comment

Either I’ve missed something, or there is no DateAdd() function built into the basic Flex installation. Well that simply won’t do, I need to be able to add dates! There’s no DateDiff(), either. I must be missing something.

private function DateAdd(origDate:Date, addVal:int, addUnit:String):Date{
  var newDate:Date;
  switch(addUnit){
    case 'y':
      newDate = new Date(origDate.fullYear+addVal, origDate.month, origDate.date);
      break;
    case 'm':
      newDate = new Date(origDate.fullYear, origDate.month+addVal, origDate.date);
      break;
    case 'd':
      newDate = new Date(origDate.fullYear, origDate.month, origDate.date+addVal);
      break;
  }
  return newDate;
}