Flex on Rails not a dream any more!!!

Filed under: Flash, Flex, Ruby on Rails — Wrote by Campbell on Friday, March 2nd, 2007 @ 6:06 pm

Have you played with Ruby on Rails? if not well theres no helping you….. (just jokes). But there are alot of nice features. Today lets take a look at ActiveRecord. What it does is on startup of the website it maps database tables to the Class objects (Models in MVC) in its code. From there on in you have methods like Cat.find(:all) which will go find all the cat rows in the Cats table database and return them. Thats it no more code!!  How about matching to sql conditions?  Well, Cat.find(:first, :collar_color => 'blue'). nice!!

So how cool would it be if flex could do this to a database. Well Mark from WebOrb showed me it can. With that little code!!! Mark has basically mapped alot of the cool functionality of ActiveRecord from ROR into their Flex Data Services package. Very cool! Ok so where is it? Well its still in the works but very close and you will be able to add code like:

<mx:DataGrid dataProvider="{ActiveRecords.Order.findAll()}"
   <mx:columns>
     <mx:DataGridColumn dataField="OrderID"  />  
     <mx:DataGridColumn dataField="CustomerName" />
     <mx:DataGridColumn dataField="BillDate" /> 
     <mx:DataGridColumn dataField="ShipDate" />
   </mx:columns>
</mx:DataGrid>

What this basically is, is a data grid that will ask ActiveRecord to go and find all the Orders in the database, and populate the datagrid with them. Hang on i hear you say….what about Async callbacks, when the data has loaded. Well seeing databinding is available in flex that method can return an empty Array collection and when the data is recieved the datagrid will update. No more addEventListener(……… But dont worry you still have them there for use if you want to update the UI. But its AMF packets here so the packets are binary data and pretty quick.

Ok cool so what about all those Order objects we have in the datagrid, what can they do now? Well through the majick of data binding and ActiveRecord you can just have another datagrid below that updates automatically as items are selected in the first:

<mx:DataGrid dataProvider="{otherDataGrid.selectedItem.addresses}">
  <mx:columns>
    <mx:DataGridColumn dataField="OrderID" />
    <mx:DataGridColumn dataField="OrderDate" />
    <mx:DataGridColumn dataField="RequiredDate" />
    <mx:DataGridColumn dataField="ShippedDate" />
    </mx:columns>
</mx:DataGrid>

And that would populate the second datagrid with all the addresses for an order for each click on the first datagrid. And thats all info in the database.

So how does it work?  Well you set up your database model as you would any other application, hit the WebOrb Control panel and allow it to inspect the database tables. It will then generate a code base for you to place in your Flex application. Dont worry there are empty stubs for extending with your own functionality which never get over-written when you update the generated code.

Much much much more cool things are in the pipline but this blog post is getting a tad long. So heres what you need to start to find out more information

WebOrbs blog

Also if your lucky enough to be going (or even have tickets too) Flex 360:

"Also, if you are attending the 360Flex conference, I will be demonstrating WDMF during my session next Monday between 4:00 and 5:20 in the Integration track." – Mark Piller

Stay tuned I will be updating with more soon. 

Using .NET dlls in your Ruby on Rails project!!

Filed under: MS .NET, Ruby on Rails — Wrote by Campbell on Friday, January 19th, 2007 @ 1:43 am

Last night I got side tracked and figured out how to call methods and recieve results on a .NET dll from inside my Ruby on Rails website.

What the F*$k you say. .NET and ROR, what an unlikely couple. Well yeah. ROR rocks at making sites quick and clean. .NET is the most rocking serverside lanuage with system intergration. It should be its writen by the same company that makes the OS. So I was after a way to get the best of both worlds.

I really wont bore you with the details here, but if you want any info just leave a comment with your email and I will explain it to you. I would like to write a generic wrapper/plugin for ROR to make this really easy but I have to sort out translation of dataTypes so complex Objects can be passed between the two.

I wrote a little site that called a .NET dll to get system information like CPU % etc to display on a page. To basically show load on the server. 

Ultra g33k stuff I know but still a very cool little tid bit to know can be done. 

Ajax and Prototype at it’s finest

Filed under: General, Ruby on Rails — Wrote by Campbell on Monday, December 11th, 2006 @ 10:25 pm

http://www.pikipimp.com/

Check it out !!!

VidemoEvent – Flex showing PXT,TXT,Mobile video at live events

Filed under: Flash, Flex, New Zealand, Ruby on Rails — Wrote by Campbell on Tuesday, October 17th, 2006 @ 1:33 am

Videmo the website has a new child. Its fat and "web aware". Lol I finished the videmo.co.nz event display yesterday and it has withstood 24 hours of testing. Basically the concept is that plasma screens, big screens etc can display the video, images, and text messages that people send in. It can be moderated remotely via a flex web interface too (just incase any of you have dodgy photos ;o). I have packed this product with so many technologies and three letter acronyms it isnt funny.

We had planned to launch the first display for Vodafone NZ at the surf champs this weekend (at the beach) but a local service provider HyperFactory threw thier toys out of the cot so well have to re-schedule.  :o ( gutted cause I have spent alot of nights on this thing. We had been hooked up with a GPRS modem for the display and everything.

If your unsure as to where videmo came from there is a project link on the side bar to your right (i will update it soon with this information). Basically I took that website 1 step further. Messages are convertered server side and added to a database. A Prudy Flex web interface allows people to moderate the messages remotely, via AMF and once given the ok they beam thier way off to a remote location at a live event. At the event the are displayed in all thier mobile goodness on a large Flex screen. (but no-one ever knows that unless Adobe sponsors me for the Video SDK wink wink nudge nudge)

 

I have to now save to buy the On2 Server side sdk. The photo above shows the display running on my tv at home (has been for 24 hours remember) and youll notice the video is a little small. Basically pumping it up much more with FFMpeg kills the quality, so I really have to get the video On2 SDK to take it to the next level. Considering that the SDK is about $7000 NZ I might be saving for a while, OUCH!

So if anyone out there thinks that live video and images along with text would suit their event, feel free to let me know, and we can work something out. Im cheap as I need to eat and have to start raising funds for that SDk and paying bills again.

Its a version 1 with many possible features, but well just see how it sits with users for now and see what people actually want this thing to do.

Rock on Flex though!!!! It was the easiest to implement and mate up with the other technologies. It (really the flash player) is so suited to GUI over many other platforms it really was the only choice. Next up I will be plumbing the ROR site back into the new schema so photos and video will be availble for viewing afterwards with lightbox like video popups.

Finally, I would really appreciate it if anyone out there, no matter what country your from would send me a pxt or mobile video. I need to start getting a feel for other formats of service providers. Ill even post the funniest in a few days.

Send the message to testevent@videmo.co.nz, and it will display on my tv at home in all its glory. 

Venture Capital funding done right for the Web 2.0 era.

Filed under: Flash, Flex, General, New Zealand, Ruby on Rails — Wrote by Campbell on Saturday, October 7th, 2006 @ 10:27 pm

You know I see on techcrunch and mashable all these stories about "xbeloit", "peebOs", Smegoooo's" or some wierd named web 2.0 site getting another 10 million funding. ANOTHER 10 MILLION? friggen Aye? how does someone get 10 mill for building yet another basecamp with a freeky name. And then what are you expected to give back for that 10 mill. Your soul, first born and the left nut of your uncles brother?

Then I came across a link which instilled in me a sense of, "now that just makes sense". It was about getting the idea out. Getting that version 1 live.

How many of you out there have had a cool idea and developed it so far but all the 3am nights later you start to loose interest because it just doesnt seem to be happening. Well if your in the US time to check out http://www.ycombinator.com.

[ VIA: Orielly.com ]

Check this from thier site:

Do we need to write a business plan?

Not for us. We make funding decisions based on our application form and personal interviews. We love demos, but we never read business plans.

How much do you usually invest?

Rarely more than $20,000. The goal is usually to give you enough money to build an impressive prototype or version 1, which you can then use to get further funding.

What does Y Combinator get out of this?

Stock, usually about 5-7% of it.

Heck, give me 6k to hold me over for the time, and ill give you 20% and the nut of my uncles brother.

Man how I wish someone in New Zealand had a clue and started something like this. Really to get that version 1 out…to get it to a really basic product…full time…. should take 3mnths. How many peolpe in that three months is just a measure of how hard it is.

When I dream that my idea could make a really usefull and cool site/idea, and I dream that I could make a really sweet product out of it, I am not looking for 10 mill of funding. heck Im looking to not go hungry and still have a home at the end of developing it.

Where are the VC's that give you 10g to push out a web 2.0 site in Ruby on rails in 2mnths that functions and can handel some users on your so so hosting plan. Thats the point that I want to reach. Where it can be evaluated as a self standing product. 

Wise up guys (all you VC's out there) and youll find you get alot more for your money. 

© Flex developer, Campbell Anderson, from New Zealand – xsive blog -