Empty the inbox faster in Outlook

by Peter Tyrrell Wednesday, April 30, 2008 9:59 AM

Some great tips for getting things done faster in Outlook, from Lifehacker: http://lifehacker.com/381966/tweak-microsoft-outlook-to-empty-your-inbox-faster.

image

I implemented (and love) the Alt+2 keyboard shortcut to file inbox messages to other folders. I'm recouping valuable seconds per day here!

Tags:

Webpublisher search within search

by Peter Tyrrell Tuesday, April 22, 2008 9:46 AM

I made a working search-within-search for Inmagic Webpublisher a few months back, with the help of the wonderful mootools javascript framework, which makes object-oriented javascript easy. And fun!

Overview

The results page has a 'search within results' textbox. Search text entered there is combined with the initial search to create a brand new query.

The initial search form is serialized to a cookie, or, if the user came to the results via a GET request (canned query), the query string is parsed.

The script in action

The method which serializes a search form looks like this. Four lines: nice and neat.

   1: function SaveQuery(formObject)
   2: {
   3:     var oForm = formObject;
   4:     if (!oForm)
   5:     {
   6:         oForm = document.forms[0];
   7:     }
   8:     var formQuery = decodeURIComponent($(oForm).toQueryString());
   9:     var oQuery = new WebPublisherQuery(formQuery);
  10:     oQuery.saveToCookie(oQuery.cookieName(), {path: "/"});
  11: }

The method that handles the 'search within results' on the results page goes like this. It's a little longer to handle cookie/no-cookie, but still pretty easy to follow.

   1: function Subsearch(searchText, textbase)
   2: {
   3:     var oQuery = new WebPublisherQuery();
   4:     var isCookie = oQuery.loadFromCookie(textbase + "QueryTracker");
   5:     if (isCookie == false)
   6:     {
   7:         if (window.location.search == "")
   8:         {
   9:             return false;    
  10:         }
  11:         var windowQuery = decodeURIComponent(window.location.search.substr(1));
  12:         oQuery.loadFromQuery(windowQuery);
  13:     }
  14:     var subquery = new WebPublisherQueryGroup(searchText, {fields: oQuery.getFields()});
  15:     oQuery.addSubquery(subquery);
  16:     oQuery.saveToCookie(oQuery.cookieName(), {path: "/"});
  17:     
  18:     var query = oQuery.toQueryString();
  19:     var rawUrl = window.location.href.indexOf("?") == -1 ? window.location.href : window.location.href.substring(0, window.location.href.indexOf("?")); 
  20:     window.location.href = rawUrl + query;
  21: }

Of course the real power is in the WebpublisherQuery object, which is a javascript class that does all the heavy lifting.

As with all our Webpublisher scripts, this one is released under an open source MIT license. No documentation. The mootools framework is included in the file.

Download the beta: AndornotUtilities_Subquery_0_2.js

I appreciate any feedback, bug reports, etc. We can also assist with implementation if required; contact us at: info@andornot.com.

 

Andornot releases selected Inmagic WebPublisher PRO enhancement scripts under open source license

by Peter Tyrrell Monday, April 21, 2008 3:15 PM

Andornot is pleased to announce that many of our scripts for use with Inmagic WebPublisher PRO are now available under an MIT open source license. Anyone is now free to use reuse, redistribute, modify etc. these scripts as long as the following license text is retained.

Copyright (c) 2003-2008, Peter Tyrrell and Andornot Consulting Inc.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

Neither the name "Peter Tyrrell" nor "Andornot Consulting Inc."
may be used to endorse or promote products derived from this software
without specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Check out our demo site at http://ask.andornot.com and view source to get the path to these scripts for enhancing search and display pages. Calls to these scripts will need to be made from forms using either the Inmagic DB/Text or CS/Text Form Designer.

If you need assistance implementing these scripts, this can be arranged through a consulting contract with Andornot. Contact us for more information and pricing. Alternatively, many of our add-on products such as our Starter Kits include sample query screens and forms with the scripts already incorporated.

Never be clever

by Peter Tyrrell Monday, February 25, 2008 3:51 PM

When programming, if you don't fully understand some technique, do not use it. And don't mistake intellisense for intelligence.

Case in point.

I wanted to know whether a particular barcode was contained in a list of barcodes. If not in that list, add to another list:

string barcode = "12345";
int index = barcodeList.BinarySearch(barcode);
if (index < 0)
{
    otherList.Add(barcode);
}

Ooh, binary search. Visual Studio intellisense reports:

List<T>.BinarySearch(T item): Searches the entire sorted List<T> for an element using the default comparer and returns the zero-based index of the comparer.

Sounds good to me. Sign me up!

One teary-eyed debugging session later, as barcodes are being reported NOT found that SHOULD be found, I learn the full truth from MSDN:

BinarySearch() return value is the zero-based index of item in the sorted List, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of Count.

Oh... shazbot.

Why didn't I just use List.Contains?

string barcode = "12345";
if (!barcodeList.Contains(barcode))
{
    otherList.Add(barcode);
}

Because. I am an idiot.

 

Tags:

Webpublisher FORCE_CRASH

by Peter Tyrrell Friday, February 22, 2008 4:51 PM

While perusing the Inmagic Webpublisher 10.00 input schema today (yes, that *is* how I like to spend my leisure time), I saw an undocumented action enumeration I've never seen before. Most actions are self-explanatory, like "query" and "insert".

So when I saw this:

AC=FORCE_CRASH

how long do you think I sat there, resisting temptation?

Yeah. A fearful age when measured in nanoseconds.

So I hit Webpublisher with FORCE_CRASH a few times to no discernable effect. I was kind of disappointed. Expected sparks to fly out of my hard drive or *something*.

Tags:

Month List