Dynamic Flash

Confessions of a serial code abuser
  • rss
  • Home
  • MTASC
  • Archives
  • About me
  • Goodies
    • Base64 encoder/decoder class
  • My Bookshelf
  • My Talks

PHP, preg_split() and utf-8

Sunday, 20 November 2005

This is just a quickie for anyone who’s battling with the UTF-8 support (or lack thereof) in PHP4.

According to the online docs the PCRE family of functions can be made UTF-8 aware by adding a u modifier to the pattern you’re using. Since the standard explode function doesn’t support UTF-8, you might think of using the preg_split function like this to split a UTF-8 string into an array of characters:

[php] $characters = preg_split(’//u’, $source); [/php]

Unfortunately it seems that preg_split is the only PCRE function that doesn’t support the u modifier. Instead, you’ll have to use preg_match_all like this to get the same effect:

[php] preg_match_all(’/./u’, $source, $matches); $characters = $matches[0]; [/php]

Comments
4 Comments »
Categories
PHP
Comments rss Comments rss
Trackback Trackback

IFBIN: Good, bad or ugly?

Thursday, 10 November 2005

Recently there has been some criticism of the IFBIN service for ’spamming’ the MXNA Feed Aggregator with what is essentially advertisements for their commercial service. I have to say that I agree on this point. The spamming is just about bearable while it’s just one company – simply avoid clicking on any IFBIN links if it’s not for their ‘Friday Freebie’ example unless you already subscribe. However, if more companies take this approach to marketting their services then our precious feed aggregators could become as spam-infested as usenet, a situation that benefits nobody.

That issue aside, I can’t help but wonder if IFBIN is actually good for the Flash/Flex community. One the one hand, we have a ready supply of high quality examples from some of the leading lights in our industry. The website says that all the examples go through a quality controll process, adhere to common coding standards and come complete with comments and documentation. This is much higher quality stuff than was around when I first started learning Flash and would have made the process somewhat less painfull.

On the other hand, the $500 per year subscription for the complete service is something that I wouldn’t have been able to afford back then. Maybe a developer struggling to learn Flash or Flex isn’t the target for this service, but I can tell you that I learned a lot from real-world examples that developers posted onto sites like FlashKit and were-here.com. It’s inevitable that some of the example code the authors would have posted on their blogs for all the world to learn from are instead going to be available only to IFBIN subscribers, and that makes our community a little less welcoming to new members. Having said that, there are now more Flash and Flex blogs than ever, so maybe others will step in to fill the void.

Of course, developers posting examples on IFBIN isn’t all that different from developers deciding to commit their hard-earned knowledge to a book instead of posting it all on their blog. Looking at it that way, maybe the site is more like a constantly updated book that the developers get paid to contribute to. However, you can go out and buy one high-quality book per month for the cost of this service – by the same authors, even – and you’d probably learn just as much.

At the end of the day it’s all about choice and your personal learning habits. Not good, bad or ugly. Just different.

Comments
11 Comments »
Categories
Flash
Comments rss Comments rss
Trackback Trackback

MTASC and ActionScript 3.0

Nicolas Cannasse has announced that he has no intention of adding ActionScript 3.0 / AVM2 support to MTASC. Instead he had announced that he’s working on a new language, codenamed Flexible, with the aim of being able to use the same language for coding Flash, JavaScript and his own NekoVM server-side platform.

Looking at the current specification I can see that Nicolas is planning to build several useful features into the language. Class templates and enumerated types both are things I miss from my C++ days, and the rich type system is something that looks interesting. Aside from that, however, it looks remarkably like Java or ActionScript 3.0, and I don’t know if the features listed are desirable enough to make learning yet another language worthwhile.

What I do know is that it takes a long time for any new language to reach a critical mass of developers. No matter how good a language might be, many companies (mine included) will be reluctant to consider it whilst it languishes in obscurity. There are exceptions to this rule, but they are few and far between. Almost all of the languages we use today enjoyed a slow steady climb towards critical mass, but for every one that made it there are far more that fell by the wayside.

Which fate awaits this new language? Only time will tell.

Comments
4 Comments »
Categories
Flash, Open Source
Comments rss Comments rss
Trackback Trackback

Mr Balmer, are these your marbles?

Tuesday, 08 November 2005

You have to wonder what goes on inside of Microsoft’s board meetings these days. I think that everyone must stick their ideas in a tombola and the first ones out automatically get implemented. I can’t find any other way to explain the recent rumours of 7 different editions of Windows Vista.

The jewel in the crown seems to be the ‘Starter Edition’ which is targeted at ‘emerging markets’ (aka poor folk). This edition will be cheap (or maybe even free) but will only be able to run 3 applications consecutively. For me, that’s like selling corn to the poor and starving in Africa that’s been genetically modified not to seed.

Comments
2 Comments »
Categories
General
Comments rss Comments rss
Trackback Trackback

About Dynamic Flash

Steve Webster is a Senior Web Developer for Yahoo! in London, UK.

He is more than a little concerned that he defines himself in terms of his career, and that he talks about himself in the third person.

Find out more

del.icio.us-ed

  • samuel's squawk at master - GitHub
  • Pixelwave - A native 2D iPhone framework, based on the Flash API
  • Pixelwave - A native 2D iPhone framework, based on the Flash API
  • mnot’s Weblog: Are Resource Packages a Good Idea?
  • Download details: IE App Compat VHD
  • ZSync
  • jQuery source viewer
  • Penetration testing tools - Stack Overflow
  • Logrep
  • DOM Window (jquery.DOMWindow.js)

Recent Posts

  • Moving on
  • iPhone / iPod Touch Development Resources
  • Upgrading your app to AIR 1.5
  • Motivate yourself by doing it in public
  • The trouble with Flash and REST
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox