Date arithmatic in Flex/Actionscripts

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Today I spent some time working on the date arithmetic. I don’t believe there is built-in Date arithmetic in Flex. Therefore, there probably only two solutions.

One is using DateUtils open source library: http://flexdateutils.riaforge.org/

The other one is converting date into milliseconds and then do deductions or additions.

public static const millisecondsPerMinute:int = 1000 * 60;
public static const millisecondsPerHour:int = 1000 * 60 * 60;
public static const millisecondsPerDay:int = 1000 * 60 * 60 * 24;
public static const millisecondsPerWeek:int = 1000 * 60 * 60 * 24*7;

var startDate:Date;
startDate = new Date(dateNow.getTime() – (millisecondsPerHour));
Note here, if we set millisecondsPerWeek to 1000 * 60 * 60 * 24*30, if will exceed the maximum value of a int number!(2^31)-1, which is 2,147,483,647 !

Read More

Willow Garage PR2 robot plays pool

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

PR2 Plays Pool

by Willow Garage, a robotics research lab and technology incubator devoted to developing hardware and open source software for personal robotics applications.It was started in late 2006 by Scott Hassan, an early Google employee who helped develop Google’s technology Steve Cousins is the president and CEO. Willow Garage is located in Menlo Park, California.

Read More

unionpay card

Chinese bank cards(UnionPay银联卡) accepted at Selfridges

Selfridges today became the first department store in Britain to accept China’s only debit and credit card brand.

由于目前来自中国客户的购买力逐渐加强,继法国老佛爷之后,英国Selfridges购物商场也引进了中国银联卡系统来直接进行刷卡消费,不过据非官方称需要是美金银联卡。

Until now, China Union Pay – the only Chinese bank card to operate as Visa and Mastercard do in Europe – had been accepted by only a few small businesses, making Britain the only major European nation not to welcome it.

Stores on the continent that have adopted CUP, including Galeries Lafayette in Paris, found they doubled sales to Chinese customers within the first year of trading with the system.

Selfridges claims to have seen double-digit growth in sales to Chinese customers each year since 2008. A spokesman for the retailer said: “We are very excited by the CUP system. We have one-year department store exclusivity in the UK.”

Can’t wait to try my UnionPay debit card out this weekend!

Reference:

http://www.thisislondon.co.uk/standard/article-23839978-chinese-credit-card-accepted-at-selfridges.do

Read More