Using an HFS+ USB disk with a Popcorn Hour (PCH) 0

A couple of days ago i finally switched to a Mac (again), unfortunately  OSX didn’t recognize my Lacie 1TB external disk, possibly due to some weird partition map, doesn’t really matter anyway :) .

Since i had to reinitialize the disk i figured HFS+ would be the best option, since all windows based PC’s have left the building. According to the PCH forums HFS+ is supported, but accessing the disk from the PCH only works if it is formatted with the following settings :

  • Volume scheme = 1 single partition
  • Format = Mac OS Extended (Journaled)
  • osx partition map scheme = “Apple Partition Map”
Original post on PCH forums by cyberheater

Run IE6 and IE7 on linux, within minutes 0

For a project I’m working on i had to check the layout in IE6 , since i run ubuntu on my laptop i thought i had to twiggle around with wine and stuff. Big surprise, there’s no twiggling involved. just follow the guide on this page : http://www.tatanka.com.br/ies4linux/page/Installation

Why i love postgres 0

An old colleague pointed me at http://openlife.cc/node/200 , writing a LOLCODE handler for PostgreSQL is about the coolest abuse of this feature i have ever seen, what a genius >:)

Oh no, even more weird colleagues 0

While enjoying a tasteful cup of coffee at the office i noticed a weird colleague, not the weird colleague, drove to the office with a swing on top.. weird .. why would a normal person drive to the office with a swing attached to his car ? :)

Car with swing


up 926 days, 6:09, 1 user, load averages: 0.18, 0.10, 0.14 0

Farewell dear dedicated :’(

After four years of nearly nonstop honorable service it’s over. The last customer is migrated and the last mail is processed, the last HTTP request is complete, the last Postgres query has been executed, the last SSH session is closed..

For some reason i don’t want to perform the shutdown statement, ill just wait for the provider to shut it down and take it away to the cold dark mean office somewhere far far away…

Although it has been a busy period completing the migration im glad it’s done, i can now focus on the development work which is more fun in the end.

Apr 10 21:06:31 dedicated postgres[26741]: [6-1] LOG:  received smart shutdown request
Apr 10 21:06:31 dedicated postgres[26746]: [3-1] LOG:  shutting down
Apr 10 21:06:31 dedicated postgres[26746]: [4-1] LOG:  database system is shut down

Houston, we got a masterpiece 0

Today the weird colleague crafted a true masterpiece, due to some bad lighting some of the pictures where useless :( , but still..

The weird colleague  started out pretty standard, using cheese and salami:

08042008114.jpg 08042008115.jpg

But within a view exciting minutes  he added a meatball,  egg, apple, banana, salad and some peanut butter, pretty amazing!

08042008122.jpg 08042008123.jpg

Unfortunately  the structural integrity of the masterpiece didn’t stand :( , some minor reconstruction was necessary:

08042008124.jpg

Although most ingredients made it to the masterpiece it is our sad duty to report the first casualty of lunch :’(

08042008126.jpg

Rest in piece, dear apple…

Getting started with Adobe Flex and Axis2 ( part 6 : Upgrade the Flex app ) 0

In the previous parts we build and deployed a small Flex app, in this part of the tutorial we will upgrade the Flex application. The following new features will be implemented:

  • Add product
  • Remove product
  • Update prodcuct

Since the WebService already implements these operations we only need to change the Flex mxml code. Add the following code somewhere in the mx:webservice tag:

<mx:operation name=”removeProduct”>
<mx:request xmlns=”http://service.test.com”>
<id>{productGrid.selectedItem.id}</id>
</mx:request>
</mx:operation>

This XML defines the removeProduct method, using the selected product id as parameter, the {productGrid.selectedItem.id} glues the DataGrid to the SOAP operation. Add the following XML as wel, this attaches the description and price fields ( which we will define later ) to the updateProduct SOAP call.

<mx:operation name=”updateProduct”>
<mx:request xmlns=”http://service.test.com”>
<id>{productGrid.selectedItem.id}</id>
<description>{s_description.text}</description>
<price>{s_price.text}</price>
</mx:request>
</mx:operation>

The last operation defines the addProduct method

<mx:operation name=”addProduct”>
<mx:request xmlns=”http://service.test.com”>
<description>
{p_description.text}
</description>
<price>
{p_price.text}
</price>
</mx:request>
</mx:operation>

At this point we defined the SOAP operations, in the next step we will create the necessary text boxes.

First of all we will create the update/remove text boxes,

<mx:Label x=”418″ y=”12″ text=”Id”/>
<mx:TextInput x=”511″ y=”10″ id=”s_id” editable=”false” htmlText=”{productGrid.selectedItem.id}”/>
<mx:Label x=”418″ y=”70″ text=”Description”/>
<mx:TextInput x=”511″ y=”68″ id=”s_description” htmlText=”{productGrid.selectedItem.description}”/>
<mx:Label x=”418″ y=”42″ text=”Price” />
<mx:TextInput x=”511″ y=”40″ id=”s_price” htmlText=”{productGrid.selectedItem.price}”/>

These text boxes automatically  get the values from the DataGrids selected item.
Beneath the text boxes there are two buttons :

<mx:Button id=”removeButton” x=”511″ y=”98″ label=”Remove” click=”WS.removeProduct.send();WS.getProducts.send()”/>
<mx:Button id=”updateButton” x=”604″ y=”98″ label=”Update” click=”WS.updateProduct.send();WS.getProducts.send()”/>

The most interesting part of these buttons is the onClick code; after clicking one of the buttons the following actions are performed :

  • The WS.removeProduct.send() method is invoked
    • The send() method of the removeProduct operation gathers the message data as we defined before.
    • A Soap call is performed,the server removes the product from the array
  • The WS.getProducts.send() method is invoked
    • A soap call is performed, the server return the current products ( not including the one we just removed ).

The last element on the page is the Add functionality, just like the update/remove XML it contains a button and some text fields.

<mx:Button x=”682″ y=”190″ label=”Add” click=”WS.addProduct.send();WS.getProducts.send()”/>
<mx:TextInput x=”514″ y=”162″ id=”p_price”/>
<mx:TextInput x=”514″ y=”190″ id=”p_description”/>
<mx:Label x=”421″ y=”192″ text=”Description”/>
<mx:Label x=”421″ y=”164″ text=”Price”/>
<mx:HRule x=”421″ y=”137″ width=”250″ height=”4″/>
<mx:HRule x=”418″ y=”218″ width=”250″ height=”4″/>

After inserting this XML you should be able to perform all operations on the product database.

Rename a database, how hard can it be… 0

.. in MySQL?

Just found out renaming database in mysql isn’t as straightforward as it could be, amazing ..

Mysql 5.0.51a ( the version running on the server ) doesn’t allow you to rename a database, after some googling i found the answer. MySQL implemented this feature in 5.1.17. The next paragraph in the MySQL docs made me smile :)

This statement was added in MySQL 5.1.7 but was found to be dangerous and was removed in MySQL 5.1.23. It was intended to enable upgrading pre-5.1 databases to use the encoding implemented in 5.1 for mapping database names to database directory names (see Section 8.2.3, “Mapping of Identifiers to Filenames”). However, use of this statement could result in loss of database contents, which is why it was removed. Do not use RENAME DATABASE in earlier versions in which it is present.

Weird colleague 0

Although most people at work are pretty normal, there is one guy ( ;) ) who really enjoys his lunch. For example, this is what his lunch looked like a couple of days ago;

  • Cheese
  • 1 Egg
  • 1 Croquet

04032008100.jpg

And to finish it he added some salad on top of the rest ..

04032008101.jpg

Tasty huh :)

Check out the weird food archive for other recipes

Getting started with Adobe Flex and Axis2 ( part 5 : Getting started with Flex ) 0

In the previous steps we created a simple axis2 based web service, allowing us to remotely alter an array of products. We will now focus on building the Flex client application.

Create the project

First of all we will need to create the Flex project. Launch Flex and create a new project, give it any name you like. The server technology field should be None, we will use SOAP instead of Flex remoting.

After creating the project you should have a new project with a empty <ProjectName>.mxml file, open this file.

Create the Flex client

The default mxml file has a mx:application XML tag, within this tag we will define the components used by this application. Add the following attribute to the mx:application tag :

creationComplete=”WS.getProducts.send()”

This will trigger the getProducts operation (defined later in this part ) of the WebService component on load.

The next step is to create the webservice client xml, add the following XML to the mxml file.

<mx:WebService
id=”WS”
wsdl=”http://localhost:8080/axis2/services/FlexService?wsdl”
showBusyCursor=”true”
service=”FlexService”
concurrency=”single”
> </mx:WebService>

Let’s take close look at this XML,

  • The id attribute defines the unique id of this component on the stage, all other components need to use this id if they want to use this component.
  • The wsdl attribute defined the location of the WSDL file, this is the webservice we deployed in the previous steps.
  • The showBusyCursor attribute tells Flex to display a small icon when a webservice call is active, this is usefull since we can easily see if a button is actually performing a SOAP call.
  • The servicetag attribute tells the SOAP client which service to use, this matches the value found in the wsdl:service tag in the WSDL file.
  • The concurrency attribute tells flex not to open multiple connections at the same time. Since 0ur webservice is far from thread safe this attribute makes sure Flex doesn’t perform simultaneous calls.

All future mx:request tags should be placed within this tag, you should create only one mx:WebService tag in this application!

The first method we will add to the mx:WebService tag is the getProducts method

<mx:operation name=”getProducts”>
<mx:request xmlns=”http://service.test.com”>
</mx:request>
</mx:operation>

Since the getProducts method doesn’t have any parameters the request body is empty. We just build a fully functional SOAP client, the next part will describe a datagrid used to display the results.

<mx:DataGrid x=”10″ y=”10″ width=”400″ height=”492″ id=”productGrid” dataProvider=”{WS.getProducts.lastResult}”>
<mx:columns>
<mx:DataGridColumn headerText=”Id” dataField=”id”/>
<mx:DataGridColumn headerText=”Description” dataField=”description”/>
<mx:DataGridColumn headerText=”Price” dataField=”price”/>
</mx:columns>
</mx:DataGrid>

Let’s take a closer look at this XML:

  • The mx:DataGrid defines the datagrid, this is a default Flex component,
    • The id attribute defines the unique id of this component, just like the WebService component.
    • The dataProvider attribute tells the dataGrids to use the data supplied by the webservice component. All binding and event handling is taken care of. WS.getProducts.lastResult means get the lastResult from the operation getProducts in the webservice WS.
  • For each field in the product ( the id, description and price ) there is a matching tag in the mx:columns tag. Each mx:DataGridColumn represents a property of the product. The dataField attributes matches the column to a SOAP response field.

At this point you should be able to run the Flex application, and you should see a datagrid containing the products we defined in the FlexService Java class.

Open / Close

Blogroll

Your List

  • Your list items
  • Your list items
  • Your list items
  • Your list items
  • Your list items