RSS ? Recent Blog Posts

Blogs ยป Archive for March, 2004

The Joy of Turck MMCache

by Harry Fuecks

It’s been said before but Turck MMCache is a great piece of software. As it says on the cover;

Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. Also it uses some optimizations to speed up execution of PHP scripts. Turck MMCache typically reduces server load and increases the speed of your PHP code by 1-10 times.

Last time I looked at it was back in the beginning of 2003, when I needed an accelerator for a Windows server running PHP. Since then it’s come on along way and now offers what it calls a “dynamic content cache” which is what got me interested again.

Installation is a breeze on Linux and even easier on Windows - the author bothers to take the time to compile Windows dlls for just about every PHP version back to 4.1.0, making this about the only Open Source PHP accelerator you can run easily on under Windows, without needing to drag out VC++.

The dynamic content cache provides an API for storing data in …

 

New to Open Source?

by Blane Warrene

One of the biggest stepping stones to discovering the wonders of open source solutions is misinformation. Not intentional mind you, but a lack of easily accessible quality data on how and why to use open source for your needs.

There are some great places to start. For instance, you can run Linux from CD on your current Windows workstation. This is a great way to see what Linux and open source applications are all about.

Try this as a starting point:

Knoppix - http://knoppix.net/

For a central site to review Linux and open source news as well as vast amounts of user commentary, downloads and how-tos, see the Open Source Development Network at http://www.osdn.com

 

Code Reuse in CF - Part One

by davidjmedlock

…posted by davidjmedlock:

Well, in about 7 hours I’m going to be on a plane to Salt Lake City, Utah for my first snowboarding trip. I’ve never been snowboarding or skiiing, so this should be interesting. I just hope I don’t break any important members. (I can live with a broken leg. A broken arm might impede my ability to code, though, and I don’t think worker’s comp will cover it.)

Anyway, before I leave Nashville for the weekend, I wanted to post a brief blog on code reuse. I asked a while back what you all wanted to see in my blogs and articles and one reply was that you’d like to see something about creating custom tags. So, here you go. This will be a pretty brief description of how to create a simple tag, but I think you’ll get the point, and I’ll write more on it when I get back.

First of all, any CFM file can be a custom tag. Try the following exercise. Create a file called “customtag.cfm”. Inside that custom tag, do this:

#Attributes.Hello#

Save it to …

 

A taste of projects to come with PHP5

by Harry Fuecks

Just drawing attention to some interesting projects written specifically for PHP5.

First up is cowiki which, despite being only on release 0.3.x, has already proved a hit and powers the phpCommunity site. The code is very well organised, packed with patterns and it’s clear the author knows Java. There doesn’t seem to any reliance on other PHP libraries so wheels are getting re-invented but, as such, it makes an interesting study for anyone looking for tips on how to put PHP5’s new features into use. It’s a little too Java inspired for my taste for example there’s a base class “Object” - for thoughts on those lines read PHP Application Design Concerns. Each to their own of course and perhaps having some additional abstractions built in helps while PHP5 itself is still a moving target.

Another two interesting projects can be found over at http://www.phpdb.org.

First is Creole, a database abstraction library written specifically for PHP5 and modelled after Java’s JDBC. This will definately pull a Java crowd and the code is, again, very well organised. Here’s a sample of connecting performing a query;

$dsn = “mysql://dbuser:dbpass@localhost/testdb”;

$conn = Creole::getConnection($dsn);

$rs = $conn->executeQuery(”SELECT id, name FROM users”);

while($rs->next()) {
echo $rs->getString(”name”) …

 

Check your Spelling With Google

by miseldine

I’m inheritently lazy…Inheritently, is that the correct spelling? Instead of opening Word, or shock horror, actually leafing through a real dictionary, I now just plug the word into Google and look at the “Did you mean:” entry at the top of the page. And sure enough inheritently is in fact “inheritantly”. Thank you Google.

So, to demonstrate how easy Google’s Web Service APIs are to use within your .NET applications, here is a small application to grab and display a spelling correction in Google:

1. You need to obtain a license key to use the Google service. This is automated and free to all, however you are restricted to 1,000 queries (or spelling checks!) a day.

2. Add a Web Reference to your project from the http://api.google.com/GoogleSearch.wsdl entry point.

3. Drop 3 controls onto your form: A Label, a TextBox and a Button.

4. On the button click event, create a Google search object and use the doSpellingSuggestion method to return the correct spelling of the word you entered into the Label control on the form:

Google.GoogleSearchService search = new Google.GoogleSearchService();
Label1.Text = search.doSpellingSuggestion(”xxxxxxxxx”,TextBox1.Text);

And that is that. Spelling, thanks to Google :)

Pointless? Perhaps. Cool? Yes.

 

Replacing CreateTimeSpan()

by davidjmedlock

…posted by davidjmedlock:

I was reading up on some ColdFusion optimization techniques recently for work and I came across something that said you could increase the efficiency of caching your queries by eliminating the CreateTimeSpan() function used in the CachedWithin attribute of your cfquery tags.

Now, here’s my disclaimer: This is not really my idea. I saw it last week and for the life of me I can’t find it anywhere and I can’t remember where it was. (Seems like it was House of Fusion, but I didn’t see it in there unless I just missed it.) To the author who came up with it, if you read this let me know so I can give due credit. It’s pretty cool and I thought I’d share with our audience here.

CreateTimeSpan simply takes the days, hours, minutes, and seconds and converts them to a decimal number. This is based on days. So one day is 1, 1 day and 1 hour is 1.0416666666667 and so on. So, you can eliminate the function call to CreateTimeSpan() by doing a little junior high math on your own:

1 day: 1

 

Widget Overload

by sgrosvenor

Whilst i was traversing the web in the search for new and exciting things the other day, i bumped into a rather interesting site called Beam Jive Consulting.

They have a whole bunch of components to create interface applications and controlling applications, however the one that grabbed my eye was the BJC Control Component Set 1. This component set, whilst not free (retails at 70 Euros) offers some excellent widgets for controlling information within your interfaces, and saves hours of development time for rapid application development.

The BJC Control Component Set 1 contains the following components

BJC CCS1 Demo, BJC Analog Meter, BJC Digital Meter, BJC Poll Meter, BJC Button, BJC Switch, BJC Led, BJC Joystick, BJC Slider, BJC Wheel

Heres a Return On Investment (ROI) Calculator that i created in about an hour (with all the math) using the BJC Analog Meter component.

Definitely an interesting component suite and one that’s an instant time saver if you frequently use widgets in your applications for controlling feedback.

Click Below for and Example ROI Calculator using the BJC Analog Meter

http://www.phireworx.com/content/blog/sitepoint/roi_001.html

Details of the BJC Control Component Set 1 can be found below

https://store.beamjive.com/products_ccs1.php

 

More on PHP Security

by Harry Fuecks

The WACT Wiki now has a page about Php Application Security which (I assume, judging from the style) Jeff added. Right now it’s a pretty much a checklist for things to watch out for, plus links to many a bedtime read (or not if you like to sleep well).

Although the WIKI was originally intended for documenting WACT, it seems to have taken on a life of it’s own, with pages like that about the Template View having become almost infamous. Good to see it’s become a shared resource, useful to PHP developers in general.

Feel free to add your input to Php Application Security and the pages leading off from it.

 

Nothing Like Free Controls!

by miseldine

Need a menu? A forum for your site? A rich text box for a contact page?

Here’s a quick list of free controls and source code packs for ASP.NET that I just couldn’t live without:

UI: TimothyHumphrey.WebControls

Simple to code, simple to deploy, Timothy Humphrey has produced a collection of controls offering cross-browser menus (which can even be built from CSS), frames, and an anti-spam mail link. Code output is concise and tidy, which is quite a rarity for menu controls!

Forum Software: ASP.NET Forums

Written by Microsoft, and used on the official ASP.NET web site, this forum software is quick to install, feature-rich and can sit up there with any of those PHP boards.

Input: FreeTextBox

This is my favourite control of all. Slick, immensely powerful, and now works in Mozilla and Firefox, FreeTextBox is a WYSIWYG editor for your users. You can even print from the control, save to RTF, open an RTF, heck it’s an editor inside your web page for just 1 line of code on your part.

Blogging: DasBlog

DasBlog is a free blogging solution by newtelligence. With all the features you’d expect, such as Trackbacks, pingbacks, Blogger API implementations, and a zippy cache engine, this is the tool to …

 

Promote and Sell Your CF Tags - A Primer

by davidjmedlock

…posted by davidjmedlock:

Have you thought about developing a revolutionary custom tag, CFC, or CFX tag? Maybe it’s a super flexible and easy to install content management system or a CFX tag that allows someone to create zip files on the fly. Whatever it is that you’ve developed, or plan on developing, you should research the various ways of promotion in order to maximize your visibility and sales.

First, you may want to start out by reading Sell Software on a Shoestring right here on SitePoint by Yau Wei Liang. It’s a couple of years old, but the information is still very valid today.

Once you’ve gotten your script developed, here are a few suggestions for promoting it:

First, you need to create your sales page(s) for your script. If you run a web site where you sell (or will sell) other products, you’ll want to create a sales page that features the product you’re selling exclusively. On the sales page you’ll want to have all the information that a visitor could possibly want about your script. If they can’t get all the information they need quickly and easily, they will move on …

 

Sponsored Links

SitePoint Marketplace

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