RSS ? Recent Blog Posts

Blogs ยป Archive for February, 2004

Nice tutorial on GIS (Geographic Information Systems)

by Harry Fuecks

Java and GIS, Part 1: Intro to GIS - gives an overview of how GIS works. Useful leg up to PEAR::Image_GIS and how to generate maps on your site.

 

Flash Plagiarism and the Current Climate

by sgrosvenor

If you’ve slaved away over a hot keyboard creating the latest and greatest Flash application, only see it or derivatives of it surfacing all over the web, then you have been hit by someone using an SWF decompiler who has decompiled you SWF file and repurposed the content for their own needs; be it ActionScript, Sounds, Images or Structure.

To say its annoying is an understatement when it’s a personal SWF file, but what about when the content is for a commercial enterprise? The ramifications here could be far reaching and demand separation of content and business logic from design elements if the SWFs are to be presented to a public audience via the internet. So what can you do against this type of plagiarism to protect your files?

There are several options available as follows (not a definitive list):

- Use Server Side ActionScript (SSAS)

Exactly the same concept as Flash MX / MX 2004 ActionScript apart from the fact the ActionScript resides on the server and is referenced via several different methods; this can become expensive as you will need access to an installation of Flash Communication Server.

- Use SWC files in Flash MX 2004

Create compiled code in the form of …

 

GUI’s and Open Source

by Blane Warrene

There are frequently debates in open source circles about the impact of layering graphical user interfaces across Linux and Open Source applications. The issue revolves around encouraging GUI use to configure daemons (the Linux version of Windows services) and servers when the user may not know how or understand how to configure the underlying application from the system shell or via individual configuration files.

Those new to open source often see this as Unix snobbery. However, the concern is that from time to time, a GUI may become unavailable and require “going under the hood” in the system shell or in a text editor. This could lead to system disasters due to lack of in-depth knowledge of an application, such as Apache or Postfix (mail server).

My own philosophy falls in the middle. I encourage the use of well-designed GUI’s for configuring servers while promoting and encouraging new administrators to take the time to learn the system shell, to learn how to edit text files in Pico or Vi, and to read the man pages for each application they use. Thus, the convenience and speed of GUI configuration prevails, and in an emergency, the administrator is capable …

 

Pick your fonts

by Harry Fuecks

When viewing your source code, can you tell the difference between zero and an upper case O? What about an upper case i and a lower case l?

If not, try ProFont, available on Mac, Linux and Windows and designed for programming, as explained here.

 

Refactoring in Progress

by Harry Fuecks

Currently refactoring WACT’s template parser, the SourceFileParser. Refactoring began with Revision 1.39.

The SourceFileParser the effectively the center of WACT’s template engine, so not screwing up is kinda important. This main issue, as you can see with Revision 1.38, is the parse() method which is a giant loop, handling all XML events (currently we’re using an XMLPull API) and, in that procedural form, has become almost impossible to modify. Hence the need to refactor…

Although I own Refactoring, can’t say I’m any kind of refactoring guru (haven’t read it from cover to cover) so attempting to apply as much “common sense” as possible, making “baby steps” rather than broad changes, and testing thoroughly with each step.

Here’s where it’s going so far;

- Have created a class TreeBuilder into which I’m dumping sections of the procedure from SourceFileParser::parse() into respective static methods.

- The names of the methods need to be as “sane” as possible, so that they “read well” as they appear in the SourceFileParser.

- Right now I don’t want to worry about dealing with an instance of TreeBuilder, and any properties it will use, hence the use of static calls. Using it as an instance from SourceFileParser is coming up in the “Round …

 

Call for suggestions

by Simon Willison

David’s done it and Steve’s done it so I’m going to follow suit: what kind of things would you like to see covered in this blog? I’m not just fishing for suggestions, I also want some kind of indication of the level of material people want to see. I’m completely open to suggestions - in fact I’ve already started looking in to an article on remote scripting as a direct result of feedback from this site.

 

SimpleTest 1.0beta4 Released

by Harry Fuecks

Simple Test hit the final milestone before a stable release today (well last night I think). The release file is up on Sourceforge.

Simple Test is the unit test framework for PHP. Not only is it packing essential features, like mock objects, that you probably won’t find elsewhere but the documentation is excellent, both on Marcus’s site and bundled with the release itself.

With a dynamically typed language like PHP, unit testing is critical. Once you’ve grasped the concept and made it a habit, you’ll wonder how you ever managed before - the quality of your code will improve dramatically plus you’ll be able to take on larger, more complex projects knowing you can trust your code. Bruce Eckel makes the case in Strong Typing vs. Strong Testing…

 

Tracking Your Deployed Files

by davidjmedlock

…posted by davidjmedlock:

If you’re not using some sort of version control, you should be. “Why,” you ask? “Why not,” is my reply.

Most of us do not have access to a dedicated ColdFusion server. If you’re like me, you have a developer’s copy of CFMX on your computer at home (or whereever your development takes place). I also have CVS installed on my machine for keeping track of my code. It doesn’t allow me to easily deploy it to my server, since I have to actually FTP it to my host, but at least I can keep track of it on my machine.

Also, I tend to keep a log of files I’ve deployed and the date that I deployed them to a live server. This way I can, at a glance, look at my log and see where to look if there’s a problem.

For an easy tutorial on how to use CVS for your site, I recommend Harry Fuecks’ CVS tutorial.

For Windows users who don’t want to deal with command line CVS, you can use one of many graphical …

 

Is configuration with arrays a bad smell?

by Harry Fuecks

Something I see fairly often in PHP, where OOP / classes are concerned;

$options = array (
‘name’ => ‘Harry Fuecks’,
‘favoritecolors’ => array (’red’,'green’,'blue’),
‘favoritefoods’ => array (
‘breakfast’ => ‘English Breakfast’,
‘lunch’ => ‘Steak and chips’,
‘dinner’ => ‘Tandori Chicken’,
),
‘etcetc’ => ‘aarrrgh!’
);

$person = new Person($options);

In other words a giant array used to “configure” the runtime behaviour of an object.

For me this is a bad smell. For a start it usually means there’s some giant class method in there somewhere which deals with “parsing” the array and reacting accordingly. More importantly, think it’s a nightmare for the user - arrays are hard to document and easy to get wrong when you’re hand-coding one.

I’d much rather see something like;

$person = new Person();
$person->name(’Harry Fuecks’);
$person->addFavColor(’red’);
$person->addFavColor(’blue’);
$person->addFavColor(’green’);
$person->addFavFood(’breakfast’,'English Breakfast’);
$person->addFavFood(’lunch’,'Steak and Chips’);
$person->addFavFood(’dinner’,'Tandori Chicken’);

The methods are easy to document (with phpDocumentor) and, IMO, it’s alot easier to test / use. The API makes what’s happening explicit.

Otherwise, wise use of parse_ini_file(). PHP can parse an ini file …

 

A pat on the head

by Harry Fuecks

Just thought I’d highlight the great work being done by the guys at PHP Application Tools. Not only have they been helping out PHP developers for ages now with their various pat* projects (probably patTemplate is the most reknowned) but they also maintain no less than 8 PEAR packages (been finding XML_Serializer very useful recently). Many thanks!

Would be great to see more PHP developers getting behind PEAR…

 

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Logo Design, Web page Design and more!

99designs

  • Custom logo designs created ‘just for you’.
  • Pick the design you like best.
  • Only pay if you’re satisfied with the result.

The Web Site Revenue Maximizer
The Ultimate HTML Reference

Book: The Ultimate HTML Reference

The most complete and up-to-date HTML Encyclopedia money can buy.

Free eBook! Firefox Revealed