CFSCRIPT loop over a query and a big mistake

I have to look this one up every time. You can use cfscript to loop over a query by doing the following:

view plain print about
1for (var i=1; i <= qry.recordcount;i++) {
2                
3}
4
5OR
6
7for (var i=1; i <= qry.recordcount;i = i+1) {
8
9}

You notice a slight difference between the part that increments. The top one has an 'i++' the bottom has 'i+1'. I am pretty sure these do the same thing but later version sof coldfusion allowed you to use the double plus sign ++ to increment by 1.

I got stuck half way between and had i=i++. That put my loop into eternal running mode and I had to keep stopping the application to make the thing quit running. I am embarrassed how long this stumped me. So don't do that.

More about varchar(max)

I am trying to understand the varchar(max) data type. I cam across a really old article but it had the exact answers I was looking for. Specifically when do I go from using varchar with some number i.e. varchar(700) to varchar(max)

From This blog post:

  • The size range for VARCHAR is now 1 to 8,000 or MAX. Note there is nothing between 8,000 and MAX.
  • VARCHAR(MAX) is more than a replacement from TEXT. It works just as well with short strings as well as long ones. Therefore, if there is any possibility that you'll exceed 8,000 bytes then use VARCHAR(MAX).
  • The maximum size for a VARCHAR(MAX) is 2^31 - 1 bytes / characters.

    I hope, even though this article was from 2006 that this stuff is all still relevant.

  • Note templates in infusionsoft

    This isn't something new to me but I am ashamed I don't use it more. Infusionsoft has what they call "Note Templates". That's kind of a funny name and doesn't really do justice to what you can do with note templates. It's actually like a macro, or just a way to kick of a whole bunch of repetitive tasks. There are lots of different uses for such great functionality but the other day I just wanted to do one thing.

    I was monitoring our support forums because we had made a change in the delivery of our product which required our customers to login to retreive their newsletter. We had many requests for their account information. I set up a note template that emailed them their account information and added a note to their account. This isn't very difficult, but it does take several minutes to select the email template and create a note.

    So I created a note template that did both of those things. Now I just click on the note template box and start typing the first few letters in the note template name, which shortly pops up. Tabbing out of the field selects the top one and another tab puts focus on the add note button. Press enter and poof email sent and note created. However long it took before it only takes seconds now.

    You can attach any number of actions to a note template. I shouldn't procrastinate creating note templates and I should review the work flow of my staff and save them oodles of time by creating key note templates for them. Not only saves them time but reduces entry errors.

    Microsoft SQL Server to remove text datatype in future release

    I was browsing google searching for information on data types as I was creating a new table in my db. Just wanted to make sure I was doing things right and I came across this snippet notifying of the following:


    Important

    ntext, text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.

    Fixed and variable-length data types for storing large non-Unicode and Unicode string and binary data. Unicode data uses the UNICODE UCS-2 character set.


    So in this particular table I did use varchar(MAX) instead of text. Didn't even know there was varchar(max) or I forgot.

    cfmail using Gmail SMTP

    I am trying to switch over to a fax service through vocalocity from our own fax server. Either way I send an email to the fax server to actually send a fax. But with this new one I only have on box and so emails have to come from the assigned email account. Since I have some faxes that are sent out automatically (as part of our newsletter subscription) I need to be able to let the server handle the whole process including logging in to the email account to send the faxes.

    Enter cfmail. I knew I could do it but hadn't played with it for a while. First google search I found exactly what I needed from Jamie Crug: cfmail using Gmail SMTP.

    I couldn't get TLS to work but I only tried once and since SSL worked I stuck with that.

    ABBYY FineReader vs Acrobat Pro

    I have a project I am working on. For this project I need searchable pdf documents. Since not all of the pdf's that I gather are searchable, many are image only, I was looking for an OCR solution. I use evernote frequently and it's ability to OCR image only pdf documents is awesome. I just upload them and then I search and all the text inside those docs is searchable and I feel like it does a great job. I whish I could upload these image only pdf's to evernote and then download a searchable pdf. But I can't. I do have an option when I right click to "Download searchable pdf" but it is only the text, doesn't have the image in front.

    After some research I think I found that evernote uses ABBYY technology for their ocr engine. So I went to their site at http://www.abbyy.com/ and downloaded their trial copy and eventually bought their pro version. I also have acrobat pro 9.4 and it has ocr built in. ABBYY was $169. I honestly can't tell you how much acrobat pro is cause I have been upgrading since version 5 or 6. Wow, just went to look and it is $449. I have been getting the upgrades for ~$200. Researching this I just noticed that acrobat.com has a free pdf converter and some monthly plans to do simple stuff like convert docs to pdf.

    Anyway, I ran some tests between ABBYY and Acrobat. Both have good OCR and can optimize the pdf's which saves a lot of space when your done. However, ABBYY did recognize some words that acrobat didn't. I just tested on one document but easily found 2 words that ABBY caught and Acrobat missed. Acrobat default optimizing was smaller than ABBYY but the quality was much less. I adjusted Acrobat Optimizing one click of the slider (didn't seem to want to let me slide it wherever, only stopped at certain intervals) and the resulting file was bigger, 116k but the quality was only a hair better than the default ABBYY (78k). ABBYY optimizes automatically. Acrobat you run the OCR then have to run the optimizing seperate (but it is easy). Not sure if there are settings you can customize for that or not.

    If you are looking for a good OCR tool and don't need Acrobat for much else (it is very powerful and does alot of stuff) then ABBYY is the better OCR and cheaper choice.

    Sending Invoices before actual due date in Infusionsoft - Part 2

    Final Solution:

    I used a combination of the 2 solutions I was working on in this post: http://www.davemineer.com/index.cfm/2011/12/16/Sending-Invoices-before-actual-due-date-in-Infusionsoft.

    I create my own tables with the information that I want, but I also create an infusionsoft invoice and record that infusionsoft invoice number in my tables. Then when I send a copy of the invoice via my own mail server the invoice number matches that from infusionsoft. And since an invoice in infusionsoft is created we can easily accept payments against that invoice or our customers can use customerhub to pay those invoices by themselves.

    One small note is that the invoice looks a little different, especially the line items but the totals match up and there is a line item for each item on each invoice, just the description in the infusionsoft invoice is truncated and therefore slightly different.

    I think I explained this in the previous post, but when I create the infusionsoft invoice I bump forward the next bill date for the corresponding subscription. The new invoice helps us keep track of who owes and we will see the past due invoice, but the subscription will be active until the bill date which was advanced. So, of course care must be taken to deactivate the subscription if payment is not made on the related invoice which is now just a one time invoice.

    CC and BCC Keyboard Shortcuts for gmail

    I was wondering how I could add a cc address when I compose an email without having to click on "cc" to do it. Found an article in the forums that explained it:

  • c = compose new mail with only main address
  • d = compose new mail with CC box open
  • b = compose new mail with CC and BCC boxes open.
  • You can also tab to it but it is way down in the tab order so:

  • TAB x 6 + enter for CC
  • TAB x 7 + enter for BCC
  • Founds these tips at http://www.google.com/support/forum/p/gmail/thread?tid=0d687fc92e5e61c0&hl=en

    join.me now includes voip

    Just heard that join.me has voip now. This rocks! About 8 months ago we cancelled our gotowebinar account for financial reasons. It was costing us about $500 per month. The alternative join.me was free and was even easier to use. We miss gotowebinar only slightly and there have been a few times where we would have liked to have some of the features. Still, 95% of the time join.me is more than sufficient for us. We use skype in conjuction with join.me for meetings of all sorts. Our sales people fire it up whenever they need it also, no more sharing gotowebinar accounts.

    Join.me just added voip functionality. For now, you have to go to beta.join.me to use it. This was a piece that we missed, although skype did a pretty good job as an alternative. We will see how it works. Way to go join.me.

    Why is the next bill date in infusionsoft red

    Working on the project that I talk about here: Sending Invoices before actual due date in Infusionsoft. Now playing with setting the nextbill date out so when a customer pays from the one time invoice it adjusts their subscription accordingly. Noticed when I tested one that it turned that date red inside infusionsoft on the subscription page. Tech Support told me that the red is an indicator of the date being further out than the length of the subscription. So if you change that date to 2 months from now, but the subscription is a 1 month subscription, it will be red.

    More Entries