A tip that relates to below. I find that developers often forget that you can access strings as arrays. This comes in handy for finding a specific character in a specific point in a string. For example, when looping over a list of files using:
if($filename{0} != '.'){
.... not a hidden file
}
<br /> Will keep you from getting a bunch of hidden files or the '.' && '..' directories. Make sure to note that you have to use curly brackets and not square brackets.
Forta.com - Blog: " is used to enumerate the variables used in your code, ensuring that they exist, optionally setting default values if they do not, and possibly also validating data types. Placing a series of tags at the start of a page makes it easier to ensure that required variables exist, and that they are of the right type. But what if you need to check for types not supported by ? What if you wanted to check for specific values or value ranges or value patterns? In Blackstone we plan to enhance in several important ways: 1) Additional data types (including e-mail, url, ssn, usdate and eurodate). 2) Value ranges using specified minimum and maximum values. 3) Regular expression pattern matching for ultimate control. Yet another example of one of the many infrequently discussed goodies in the works. "
More goodness from the CF world. I mentioned the greatness of CFPARAM
<a href="http://www.userscape.com/blog/2004/10/16/development-tips/">previously</a> and my PHP work around for it. <p>
(Via <a href=""></a>.)
</p>
<a href="http://us2.php.net/manual/en/function.scandir.php">this new addition</a> to PHP 5. Finally a nice simple way to get a listing of the directories and files within a directory. Of course it wasn't that hard before but it's one less little function that needs to be added to your code. Of course since it's only PHP 5 it's not going to be much use to me in my current project which needs to be 4/5 :-(
ongoing · On Search: Sorting Result Lists: "Here’s the trick: nobody will ever look at more than the first hundred or so results. So you don’t have to sort at all, you just have to find the highest relevance values."
Dave from Geek News Central points out a report on how
<a href="http://www.geeknewscentral.com/archives/003340.html">Linux Server sales</a> have grown, to over $1 billion last quarter. I'm not suprised by this, he talks about IT professionals but I also think other folks are moving towards Linux for servers as well. I'm no server admin but I've successfully run my own 2 way Dell box on Red Hat for the last 3 years with little trouble. I also know several other small business owners who do the same. My bet is that there are alot of us out there helping to drive up those numbers.
should the IT guys run your website?: "My concern isn't that they're losing some ticket sales, it's that they don't appear to know or care. That no one is benchmarking and simplifying and reality checking a site that accounts for a huge chunk of their revenue."
I thought I'd publish this code out to the world in hopes someone else may find it useful. I'm sure there are optimizations that could be made and I'd love to hear them.
This is a piece of code I came up with for our upcoming product HelpSpot which is a PHP driven Help Desk program. One of the key features is the ability to tag requests with what we call "reporting tags". Each request can have tags associated with it. Later these tags can be used to build very flexible reports on where your requests are coming from, what the major issues are, etc.
Since people would probably be adding lots of tags I wanted to come up with a good way of getting the input without either a request back to the server each time they added one or making them use a textbox and giving lots of instructions about how there should only be one per line, etc.
So this is what I came up with. You can find an example here. It creates a nice simple list on the fly. Each list item gets a hidden form field that in PHP will be passed back as an array of list items. Then I can insert them into the database and so on. This should work on IE6 and all Mozilla's cross platform. It's still being tested and worked on. If we make any major revisions I'll post them here.