« December 2007 | Main | February 2008 »

January 9, 2008

Truncating labels that use a percentage width

When an mx:Label is created, truncateToFit is true, and a percentage is specified for its width the label will show all of its content even if placed inside a fixed width container. The following example shows this scenario:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:HBox width="100" horizontalScrollPolicy="off">
<mx:Label text="This is a really long label" width="100%" truncateToFit="true"/>
<mx:Button label="X"/>
</mx:HBox>
</mx:Application>

The result is which is not what I had hoped would happen.

The fix is to specify a minWidth for the label. If another HBox is added as shown below the label behaves correctly.

<mx:HBox width="100" horizontalScrollPolicy="off">
<mx:Label text="This is a really long label" width="100%" minWidth="0" truncateToFit="true"/>
<mx:Button label="X"/>
</mx:HBox>

The new result is which is just what I wanted.

Tags: flex label percentage width

January 6, 2008

New FlexUnit Flex Cookbook Entries

I've added some more advanced FlexUnit cookbook recipes that cover testing visual components and automated TestSuite generation. These can be found at Testing Visual Components with FlexUnit and Automated TestSuite Generation respectively.

Tags: antennae flexcookbook flexunit

January 1, 2008

A History of the World in 6 Glasses

"A History of the World in 6 Glasses" by Tom Standage was a fun read. In it the history and influence of beer, wine, spirits, coffee, tea, and Coca-Cola are dissected. The author makes convincing claims that each beverage played a key role in lubricating change in the human condition. While episodes like the Boston Tea Party have obvious ties others like the role of beer in building the pyramids or rum and the mixed in lime juice leading to the rise of the British navy maybe less well known. While the book at times doesn't make it clear what are the author's extrapolations versus researched material the text is well written and easy to read.

Tags: books

2007 Spam Statistics

Another year gone by, another year of spam filtering. The overall spam percentage for 2007 is almost the same as it was in 2006, but the volume has increased.

In 2007 I received 111,095 emails. Of those 87,623 were spam. Between SpamAssassin and procmail 86,206 (98%) of the spam was automatically filtered while I had to manually flag 1,417 emails (about 4 a day). Overall that means 79% of my incoming email in 2007 was spam, which translates to about 240 spam messages a day. Compared to 2006 that is a 16% increase in total incoming email and an 18% increase in spam.

Since I used the same spam filtering techniques for the entire year the graphs look more regular.

I'm at a loss about the dramatic drop off in spam around June.

The trend at the end of the year doesn't look good if it isn't just a seasonal spike.

The peak and valley pattern is due to day of week fluctuations. If I look at the amount of spam I got for the year based on the day of the week each gets about 12,000. The amount of legitimate email varies such that the weekday totals are about 4,000 more than the weekend resulting in the higher percentage of my email being spam.

Tags: spam

About