Home

Nervous to connect the 2 parts together!!!

  • Jul. 19th, 2008 at 11:27 PM
After polishing a bit of the parsing xml file on Wednesday, I started off with my user interface of the application on Thursday, and now it's time to finish off the connection code of the GUI part with the backend logic part!!! Here you go, Eva Wong!!!

The clock on my laptop is wrong...

  • Jul. 16th, 2008 at 5:35 PM
I was testing my time filtering functions and it always returns me data up to June although I have not specified the end time, and now I discovered why!

Normally when the user do:

var now:Date = new Date();

Flex sets the variable now to the time according to the time zone that is set on that particular machine that user is using. So then I checked the time in the timer icon and it is right. I even checked the TIME variable at command line and it is right. I even reset the clock in dos a couple of times, and the current time showing in the Alert message box in my application launching in firefox is 2008-06-03, this pisses me off so much and I hope this won't be some hardware problems.

Erm...2 more days to go for parsing XML!!!

  • Jul. 14th, 2008 at 10:58 AM
Last week, the project finally looks closer and closer to what I have designed for my final project. It is organized into packages and actionscript classes according to functionalities while avoiding my code to get spaghetti. I am implementing and debugging the backend logic part for the classes that handle the parsing of the xml. After Wednesday, I should be moving onto user interface part to catch up with another demo next Wednesday!

Flex debugger back to life

  • Jul. 11th, 2008 at 8:08 AM
So Firefox 3 was screwing my Flex debugger as well as my yesterday, this is a bug already reported by users to Flex and Mozilla. Argh, I upgraded to Firefox 3 and DOWNGRADED back to Firefox 2 within 2 days! Finally I can debug normally again..

Flex debugger died..

  • Jul. 10th, 2008 at 6:43 PM
A whole nice day is gone for fixing just a little error when the debugger is dead. That is NOT FUNNY AT ALL.

Possible approaches and structure

  • Jun. 28th, 2008 at 9:46 AM
Build, UnitTest, Commit, CodeIssue, Coupling, Coverage, DevEvent and FileMetric.. These are the different sensordata types that the HackyStat sensors collect. After examining the sensordatatypespecification and dailyprojectdataspecification in detail, I came up with 2 main approaches(drafts), i.e., to visualize the data by users or by project, both providing 2 different layouts, in terms of time(daily) or in terms of sensordata types(only avaliable ones). While I was planning out my project, the more I think of it, the more I find it challenging to structure the whole project from scratch. After next week, I shall have a detailed layout of the structure of my coding.
Actionscript does give Flex user more control in the design of the application. I am having fun this week. While I was enjoying coding in actionscript generating HTTP requests dynamically within a control, some issues came up when I press for the display of data too often, or when there are too much data. This is because the thread of displaying the GUI is faster than that of populating the dataProvider. The problem is fixed by having an actionscript class that extends IResponder, which arranges the order of the way the application responds to signals. Moreover, I have been studying the data fetched by the sensors and the way that may provide me more information about the software development progress.
Can this be solved without having the crossdomain.xml under the domain of the server? My application <pretty.swf> is recognizing the data <data.xml> to be remote. Although they are from the same domain, <pretty2.swf> does not work without loading the policy file.

From the security updates stated in Flash version 7 <source>, it states that:
...we added a new permission mechanism which allows broader cross-domain cooperation. You can perform data loading (loadVariables, XML, XMLSocket, runtime shared libraries, Flash Remoting) from outside a movie's own domain as long as the server providing the data provides a policy file—a small XML file that grants cross-domain loading permissions...

Since Flash 8 just has security modification for local sandbox(since my application telling me that the type of the sandbox of my application is remote), I was mainly looking at the newly released(Apr 2008, Flash 9) security updates, and found my problem does not quite suit in one of these catergories.

   
"Since my application and data are from the same domain, why pretty2.swf does not work without the crossdomain.xml?

It is making progress and turn out that my intuition about crossdomain.xml(a remote sandbox that allows flash files to communicate) is correct. Here is my understanding of the problem. Sandbox is a terminology of a secure environment in flash player(version 8 or above). There are 4 types of sandbox, Local-trusted(by default, this is where the debug version of swf are stored when one clicks the run button in flex builder), Local-with-filesystem, Local-with-networking, and Remote. For more information how to modify the settings of these different types of sandbox, read this. The one which is related to my project is the remote sandbox, by convention is the CROSS-DOMAIN-POLICY file which has the name crossdomain.xml, which is basically equivalent to the flash application telling the service, "Trust me, get me the data". One important note is that the CROSS-DOMAIN-POLICY file can be modified such that it works for all subdomains under the same domain, one example can be found in here.

Now I have a xml file(which contains HackyStat data that I fetched by GET method of HTTP request) uploaded here, and my flash file here, and a crossdomain.xml here. Notice all of them are under the same domain. The swf file basically get data from the data.xml(which this part is hard coded for now to test whether crossdomain.xml works), it checks for the security policy specify by the crossdomain.xml file(which is the wildcard character for now, which basically trusted applications on every servers and is not a good idea, but anyway, it's for testing).

All the above concludes that I need a crossdomain.xml file in the domain of Hackystat server for my application to work remotely in the future.

However, the fact that I conclude that the problem is semi-solved is that when I type <http://dasha.ics.hawaii.edu:9876/>, the broswer does not recognize the URL and give me error. We figured this out when I tried to put the crossdomain.xml file under the domain on Matthew's server, we successfully put the file on port 8080(the UI component only) but not 9876. So that I will then have to talk to the HackyStat developers more to figure out a way to put the crossdomain file under <http://dasha.ics.hawaii.edu:9876/crossdomain.xml> or load the crossdomain.xml when the user types in the link above.

Security error accessing url

  • Jun. 9th, 2008 at 2:29 PM
When I was trying to post my demo(which was working fine within Flex builder but not even locally) today, the application loaded with this error message sandbox saying the following:

        faultCode:Channel.Security.Error
        faultString:'Security error accessing url'
        faultDetail:'Destination: DefaultHTTP'

More than that, I discovered that when the Flash Player accesses data from another domain on behalf of a Flash app, it first looks for a crossdomain.xml file in the root directory of the domain that is being accessed. In order to do so, I will then have to include a file naming "crossdomain.xml" (with the following content)so that my application can access at http://<host>/crossdomain.xml (for details, see here).
	<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="<yourdomain>" />
</cross-domain-policy>

Fetching HackyStat data!

  • Jun. 8th, 2008 at 12:01 AM
I have successfully made a Flex application that sends HTTP request to fetch the sensorbase data and display it in a datagrid with the styling done by CSS. Here is the link to the application: (to be updated by Monday). You will need to use this login information to continue: (user: iwa.wong@gmail.com, pin:RuvkmNeGub6S).

There was some point in this week that I started to wonder, whether I should continue to fetch HackyStat data using ActionScript in Flex or use the class recommended by Philip. And finally, I have chosen Flex over Java, and I cannot deny that ActionScript in Flex has cleaner coding style. If I specialize Flex to be my flash code only, I will then have to go over the trouble of integrating files of different languages together. For this, I have learnt that never try to think too much or else I will get sway away from my goal and ideas, think simple, and there will be some way. Moreover, after I am done with this little exercise, I find myself more familiar with the usage of style sheets in flex, which is used to customize the style of the controls in the application.

Since this little application can only allow one to fetch data of his/her own, I will explore the possible ways to get information of a group of users. Moreover, I will start to come up with more interesting design for viewing data than just a datagird. These are my goal for next week.

First Demo!

  • Jun. 1st, 2008 at 12:19 AM
For the past week, I have been catching up with the ActionScript 3 then Flex, which is a more appropriate way to learn them. As I read along, this question come to my mind, shall I code more in ActionScript or MXML? The answer is both for now, but the more the former the later. For the time being, since I am just coding little pieces to test my understanding of the language and the procedures of fetching data from HackyStat derby database, it will be wiser for me to use the existing component and bind them with the data that I want. However, in the long term, ActionScript is the one that will be dominating since Flare is a feature plugin for Flex builder which gives more control.

For testing for my understanding of the material, a demo will be a nice and fast way to show, hence, make me feel more comfortable in coding in ActionScript 3.

Since I was not very experienced with both things,  so the demo was intended not to be ideal. It updates the list of users' id on those events from a listener embedded in a button. For then I was about to find out the format of the raw data from HackyStat server and as well as how shall I get them, which will be my goal next week. For now, my demo just have a method that generate random user_id and updates the data grid using bindable arraycollection data structure on events from mouse down listener.

Integration of XML and Actionscript - Flex

  • May. 25th, 2008 at 8:31 AM
For the last week, I have been reading tutorials and API for Flex, and starting to build code snippet out of it.

Flex basically integrates XML with Actionscript in traditional Flash and becomes another approach to building SWF applications that run with Flash Player in a browser. It shifts the focus from animation to creating user interfaces and interactions by visualizing UI components. The UI components are used for displaying data from databases, XML and text documents, the file system, and data streams from web services and RSS feeds.

For the little application that I tried coding, the most challenging yet greatest one is called photo_browser.mxml. Once the user hit return on his/her keyboard or clicks the button next to the text field, It sends request to the RSS feed pointed by the URL specified in the application, then it retrieves and displays the relating data in the panel. After building this application, I am on the right track of binding data from outside and interacts with the user on the other end, which is a very basic yet important idea of my HackyStat project.

More and more to be prepared!

  • May. 16th, 2008 at 2:05 PM
The first week is now gone.

I like my seat in the lab, which has 1 of the 5 of LCD monitors with a wide window on the left (with the view of trees which I believe is good for eyes).

After a series and configuration and installation of sensors and services for the first 3 days, Matthew(my partner) and I set up a local server of HackyStat for getting information among some of the peers. I like this part which is so cool.

Then I installed the Adobe SDk (plug-in) for eclipse for using Flare which will expire in 92 days. When I think that this is equivalent to finishing off everything along with the testing within 3 months, I spent the rest of the week cramming concepts in MXML during the day, learning how to use Flex Builder, and re-studying CSC209 server stuffs in the evening. SOAP-based web services, AMF protocol, ActionScripts, RPC component calls ... Since the new terms are still sinking into my memory, I wonder what how fast my trasfer rate will be at the pub in 45 minutes from now, 56Kbs? Yes, I look like I am day-dreaming after cramming.

Anyways, long weekend is coming!
(with presentation on Tuesday)
errrrr.....

P.S. Why can't we have a crocodile instead of a hippo for the mascot this year? Because I am so bad at drawing :p