Archive for the ‘tools.perceptus.ca’ Category

New MySQL Escape Tool on tools.perceptus.ca

Sunday, February 19th, 2012

I had the need to escape a fairly large string for running a one-off SQL query against a database today. There were plenty of quotation marks and other dangerous characters in the text… so, I needed to escape the string properly.

Thus, the newest tool on Perceptus’ Web Tools, our new Web Based MySQL Escape Tool.

We hope that someone besides us finds a use for it.

Oh, and for our American friends, Happy President’s Day!

 

New Web Based URL Encode and URL Decode Tools

Saturday, April 23rd, 2011

The other day we were  programming a new website feature for a client that required the use of URL encode and URL decode functions.

We realized that our uber-cool web tools site didn’t have any web based URL encode or decode functions, which would have been handy during our testing.  So, we’ve added them to our web based tools site for the next time we need them.

Here are the links to the new tools:

Web Based URL Encode

Web Based URL Decode

PHP PEAR HTML_Template_IT Eats Dollar Signs

Wednesday, December 29th, 2010

Sigh.  We discovered a bug in our recently reworked tools.perceptus.ca (“PWT”) site.

We have a simple, custom, partial MVC system that runs a few of our smaller websites.  That system uses the PEAR HTML_Template_IT package to do the final template rendering. We ported PWT to our MVC to make future site changes much easier.

A week after going live with the changes, we found a baffling bug.  The tools were eating the dollar sign and dollar amounts (but not the decimals) from the input text. E.g. “$103.00” would get returned as “.00”.  Not good.

Apparently, HTML_Template_IT defaults to processing all text with regex.  Not cool.

There might be a historical reason for this, but for new users, this has got to be confusing. Plus, this is NOT mentioned in the intro documentation: http://pear.php.net/manual/en/package.html.html-template-it.intro.php

We’re not the only ones caught by this: http://pear.php.net/bugs/bug.php?id=50.

The fix is to initialize and set the use_preg option, like this:

$tpl = new HTML_Template_IT(‘./’,array(‘use_preg’=>true));

I have glanced at the package pages, and while this behavior is  documented it is buried quite deeply in the documentation.

This also explains a typo we had years ago on a static page that had the text like $5 in it.  That time, we just changed the copy to read 5 dollars and got on with life.

 

A Web Based Adding Machine

Monday, December 13th, 2010

We have Perceptus’ Web Tools at the top of mind lately.  We’ve created another new tool, our minimal web based adding machine.

Have you ever had a half-hazardly formatted list of numbers to add up (maybe from an email?) and you didn’t want to do this:

  • open up Excel (or other spreadsheet program)
  • create a new file
  • paste the values
  • tidy them up so that they are  recognized  as numbers
  • create the SUM() function

Well, we have, and now we have created a tool to save us, and hopefully you, some time.

Visit our new web based adding machine tool and try pasting in a set of numbers like this:

10
-7.8
8 000
(92)
30.1

And be impressed when you get results like this:

Add Running Total
+0 0
+10 10
-7.8 2.2
+8000 8002.2
-92 7910.2
+30.1 7940.3

Impressed?  Did you notice that it handles negative numbers in (brackets) magically?  Or how about that awkward space in “8 000”?  We’re pretty proud of ourselves – even if you’re not impressed.

Comments and feedback is always appreciated!

 

Clean Up a Column of Mixed Date Formats Tool

Sunday, December 12th, 2010

A few times a year, a client of our will need our help in cleaning up a manually populated Excel file that has a couple of date columns. Invariably, there is a hodge-podge of date entries, such as 2010-10-05;  june 10, 2010; or 8/4/2008.  We’ve finally made a tool to fix up the bulk of this so that Excel will detect it properly as a date value.

Perceptus introduces the  Clean and convert a column of dates in Excel Numbers Wizard, on the Perceptus Web Tools mini-site.

We hope this tool saves some people besides ourselves some time.