 |
Diary of a late, late adopter
|
 |
 |
Tuesday, April 27, 2004 |
While every article about application development impresses upon us the importance of separating the data, logic and presentation layers, MS Excel gleefully mixes the three. While this gets sneers from most developers, it is precisely the reason that so many people use it and love it and get themselves into all kinds of trouble with it... and then ask me to help. So I was very excited to get my copy of Excel Hacks today. Among other things, it has a lot of tips for separating the data from the formulas and the data from the presentation, making a complex Excel spreadsheet more maintainable. Other things I was glad to see:
- Chapter devoted to the SpreadsheetML, or the xml/xslt format used to describe spreadsheets. This facilitates generating spreadsheets using PHP and Java and other technologies that have nothing to do with Excel
- Lots of hints for overcoming limits imposed by Excel: For example, override the number of undos allowed and override the limit to criteria for conditional formatting of cells.
- Lots of easy to understand VBA code
- Ways to recover data from corrupt workbooks
- Long chapter on charts with some neato ideas for custom charts. I get asked a lot of questions about Excel charts and I never really learned more than basic charting skills.
- And a question I have tried to solve several times, never getting a graceful solution: How to fill in empty cells with values
- Solutions to pivot tables
I am working my way through each of the 100 hacks and in almost every one, I am saying to myself, "Gee, I didn't know excel could do that" In summary, the O'Reilly hacks series has produced some excellent books and this one is one of the best. It is clear, concise, error free, and doesn't assume you have the most recent version of Excel. It is full of nuggets such as the fact that Excel purposely doesn't recognize that the year 1900 was a leap year (link blames it all on Lotus!). Who knows, you might encounter that some day.
10:56:46 AM
|
|
 |
Friday, March 26, 2004 |
You can put a link tag on your web page that tells the visiting browser to start downloading another page while it is idle so that your browsing seems faster:
< link rel="prefetch" href="/images/big.jpeg" >
from 0xDECAFBAD
4:12:08 PM
|
|
 |
Monday, March 15, 2004 |
JavaScript Disable Links Here is the javascript function I used to disable the link that people often click more than once:
function disable_links(){
// this function disables all the links on the page
for(var i=0; i < document.links.length;i++)
{
document.links[i].onclick=function () { return false; }
document.links[i].title = "The exam has been submitted. Please wait for results page";
}
return true;
}
12:52:50 PM
|
|
For two weeks I had this really frustrating problem:
When users submitted the online fisheries exam, sometimes they would get an error page while the results would be emailed with no problems. I kept testing it and never got the error. I wondered if the database was crapping out because of too many open connections, I wondered about browsers caching error pages.
Then I watched someone submit the exam. They were like, "it sometimes takes several clicks before it submits"..... click click click. It is second nature to me not to submit a form more than once, no matter how long it takes the server to process the form.
So, when testing, click all the buttons more than once, because it's a sure bet your users will.
In any case, there should be some code that handles this problem, but I didn't write the thing, I just inherited it.
9:39:39 AM
|
|
 |
Saturday, January 31, 2004 |
I like the PHP function mysql_insert_id( ) . I just found out about it. It is good for when you just inserted on one table and you want to insert the autogenerated primary key into another table. Almost serves as the equivalent of an Oracle sequence object, but not quite.
Works as follows
[ME]: Damn. I wonder how to find the user ID for the brand new user without doing another query?
[Narrator from Dukes of Hazzard]: "Well, son just try $user_id = mysql_insert_id(); "
9:01:06 PM
|
|
 |
Saturday, November 29, 2003 |
Help a guy who has been helping PHP programmers for free for a long while. Notepad hangs out at www.codewalkers.com answering people's questions for free. He wants to go on the PHPCruise and I daresay he deserves it. Codewalkers has set up a donation page for him and they have already raised half of his trip cost. Support the PHP community and thank an active participant!
10:54:42 AM
|
|
 |
Tuesday, November 04, 2003 |
Software Requirements Part I The DNR Project Requirements Group meets for the first time today. The assigment for the first meeting was to read part one of "Software Requirements" by Karl Weigers, a requirements guru. Published by Microsoft Press.
- The metrics should give pause to any developer. The costs of not doing requirements well are staggering. On average, rework consumes 30 - 50 percent of total costs and requirement errors account for 70 to 85 percent of reasons for rework
- The first chapter gives the top reasons for requirements errors. The one that jumped out at me was "CREEP"
- The author suggests using testing to constantly verify requirements. This can be verbal. You have a meeting with the customer and walk through what the software will do. It can also involve a rigorous verification process where a team of people look at your requirements documents and try to find errors.
- After reading this, I know I want to create a project glossary so we can have a reference for all the crazy terms fisheries biologists throw around.
- Establish a baseline document that the customer agrees to. This document serves to connect cost estimates, time estimates, requirements, basis for acceptance of completed project and a jumping off point for change management. The first thing to strive towards is a baseline for each of the following documents:
- Vision and Scope statement "why are we building this?"
- Use Case Document "Customers can make reservations"
- Software Requirements Specification "The system shall send the customer an email verification of the reservation"
- The book suggests creating user interface and technical prototypes, even a preliminary implementation. This seems to fly in the face of all the cautions in the book, "dont start coding until requirements are done" I question this.
- Version control on the requirements documents. Book suggests using a requirements management tool. Our analyst has a home grown one that he has developed over his career and it seems effective.
- hold facilitated elicitation workshops. **Shudder** We have tried several of these. Without the other stuff in place, they didn't bring us to where we needed to be. We didn't create usable requirements documents out of them and to do it again now may bring accusations that we are going over the same ground again.
- Don't use sign off as a weapon. Sign off means the customer has agreed to your estimates and requirements. I guess this means don't wave the requirements in your customer's face and scream, "You already bought it, sucker!!!" Use it instead as a basis for change management
- This section of the book leaves me wondering how estimates of time and money are connected to requirements. It says "Developers are in the best position to estimate costs" and then the next sentence says "many developers are not skilled estimators" so, how do we do it?
- The book has a nice "bill of rights for software customers" followed by a "bill of responsibilities for software customers" "Make timely decisions" is one of these...
- Finally, it has a list of good requirements characteristics. "Avoid lumping requirements into long narrative paragraphs. " bullets, bullets bullets.
8:31:43 AM
|
|
 |
Sunday, September 28, 2003 |
A warning to ye... I can't impress upon ye enough: set error_handling to E_ALL (verbose) when developing PHP. You will cut your errors in half. You can do this in three ways:
- uncomment the following line in your php.ini file: error_reporting = E_ALL . This will affect all PHP scripts
- add the line
error_reporting = 2047 in an .htaccess file. This will affect only php files in or below the directory of the .htaccess file.
- add a line of code at the start of every php page:
error_reporting (E_ALL); This will affect only the files that you alter.
After you do this you may get a whole page of warnings about undeclared variables. This is a good thing, since it forces you to declare all variables and lets you know when you introduce new ones into the mix by mistake. You will at some point mis-type variable names. Without error reporting turned verbose, PHP accepts these mistakes as real variables:
$species_code = "WAE";
if($speces_code == "WAE"){ //do stuff}
The above code exhibits a bad feature of PHP; that you don't need to declare variables before using them. I introduced a variable called speces_code to the PHP script and since it is blank it is not equal to "WAE". It just skipped over this comparison without a blink!
Also, set error reporting to zero when in production so that visitors cannot peer into the inner workings of your code and directory structure when they encounter an error.
11:47:51 AM
|
|
I reviewed the Google Hacks book here on the tcphp web site: At first glance, it didn't seem that substantial because it starts out with a bunch of obvious things, but the more I look at it, the more interesting it gets. And the more curious I become about Google. The book is packed with Perl code that does interesting things with the Google API. I am slowly translating all that into PHP in the "sections" section of the TCPHP site.
7:40:13 PM
|
|
 |
Thursday, September 11, 2003 |
I posted the meeting notes to the September PHP Meeting. Before doing so, I installed Post Nuke, a PHP CMS system on the site. It took about 20 minutes. Most of the time is spent pearing back the features you don't want.
11:59:15 PM
|
|
 |
Sunday, June 08, 2003 |
Notes from PHP mapscript session:
- Presentation run on PHP slideshow software
- PHP slideshow software only runs well on Mozilla
- XML based
- PHP slideshow allows you to run PHP code within the slideshow for demonstration purposes
- No one is yet talking about putting PHPMapscript into PEAR
- slideshow online soon.
- Paul Spencer of DMSolutions gave an excellent presentation
- Other mapscript implementations (perl java Tcl, etc) use SWIG. PHP can't. Why not?
- PHP must be run as CGI because the open source tools that mapserver depends on are not all threadsafe. DMSolutions intends to get a threadsafe version of all of these tools available so that PHP can be run as Apache module.
- What does mapscript allow you to do that regular mapserver doesn't?
- build queries based on user input beyond zoom and pan.
- mapscript really lets you build applications while mapserver allows you to build dynamic maps.
- Output in various formats like PDF and flash.
4:57:21 PM
|
|
 |
Thursday, May 01, 2003 |
Jeremy Zawodny has a good mysql related web log. I saw him speak at PHPCON last week and he was excellent. Anyway, he has a neat little post about how to tell mysqldump to not use a buffer and not take up so much damn memory. (the -q option)
4:40:07 PM
|
|
© 2004 mcgyver5
Last Update: 4/27/2004; 10:56:58 AM

|
|
|
|
 |
| April 2004 |
| Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
| |
|
|
|
1 |
2 |
3 |
| 4 |
5 |
6 |
7 |
8 |
9 |
10 |
| 11 |
12 |
13 |
14 |
15 |
16 |
17 |
| 18 |
19 |
20 |
21 |
22 |
23 |
24 |
| 25 |
26 |
27 |
28 |
29 |
30 |
|
| Mar May |
|
|
|
|
|
|