Using SharePoint’s Imaging Web Service to access Publishing Images
I spent a fair amount of time yesterday trying to access the images in the Images list (also known as Publishing Images) of a SharePoint site using the SOAP-based Imagining web service. Every time it failed, usually with an uninformative error message.
Finally, I used cURL to send the SOAP requests so that I could see every last detail of the transaction. The SOAP response was pretty clear at that point:
The list PublishingImages is not found
or
The list Images is not found
I tried other Picture Libraries on the site, and that worked fine. That’s when it dawned on me: the SharePoint Images (or PublishingImages) list is a Document Library, not a Picture Library. That makes absolutely no sense whatsoever, but fine, it wouldn’t be the first time I’ve run into something nonsensical in SharePoint.
I was hoping to use the download method of the Imaging web service. I don’t have an alternative solution at this time, but I hope to find one soon using one of the other SharePoint web services.
Opening links in a new window without the target attribute
Web developers often use the attribute target="_blank" to force a link to open in a new window. However, if you use an HTML validation service to check your web pages, you know that the target attribute is not valid in strict versions of HTML and XHTML.
There is a simple way to have a link open in a new window using Javascript. You may have seen code like this:
<a href="#" onclick="window.open('http://osric.net')">osric.net web hosting</a>
That method has some serious drawbacks, though:
- The user now sees # in the browser’s status bar instead of the actual destination URL
- The link fails if the Javascript fails (or if the browser has Javascript disabled
- Search engines may not follow the link
I’ve written a summary of the issue and the methods I’ve found so far that best address it. I moved it to a page outside this blog because of the Javascript examples, which were easier to include on a separate page:

How to best use Javascript to open links in a new window
More People Alive Today Than Have Ever Died
A few years ago, I ran across this quote:
“There are more people alive today than have ever died.”
As we contemplate overpopulation, a quote like that is quite thought-provoking and shocking. Could it be that the living today outnumber all of our ancestors? It’s astounding. However, I didn’t believe it. I still don’t believe it, and for good reason.
› Continue reading
JSONP and Sencha Touch
I was recently trying to get a Sencha Touch demo up-and-running, but my callback functions after requests for JSON data never ran, and Firefox would throw errors along the lines of “invalid label.” I didn’t understand why–until I read more about JSONP.
JSONP prefixes your JSON response with a function name, which runs when the response is retrieved. It’s a way of handling the data without a listener.
This means that your JSONP provider needs to detect a JSONP parameter, and then wrap or “pad” the response within the specified parameter value.
For Sencha Touch, the JSON returned should be wrapped in Ext.util.JSONP.callback();. If your JSON looks like this:
{"results":[{"name":"Chris"},{"name","Harry"}]}
then your JSONP should look like this:
Ext.util.JSONP.callback({"results":[{"name":"Chris"},{"name","Harry"}]});
Not that you should hard-code that function name anywhere in your JSON output–web-based APIs and services should pick up the function from your request and wrap the JSON for you. For example, the twitter search API accepts a callback querystring parameter.
http://search.twitter.com/search.json?q=fakecriterions&callback=myCallbackFunction
would wrap the JSON response inside
myCallbackFunction();
I ignored the extra letter in the acronym at my own peril–I figured it was just a trivial variation on JSON (which it is) that wouldn’t make any difference in how it was handled (but it does).
Parsing a URL Querystring with Javascript
Can you access a URL querystring with Javascript?
Yes. Just refer to location.search.
Why would you want to reference the URL querystring with Javascript?
A couple reasons come to mind. › Continue reading
Why I’m Not Friends with My Bank on Facebook
I received a request today from my financial institution asking me to follow them on Facebook, Twitter, Flickr, and YouTube.
Aside from the fact that I doubt that their updates on these various services will enrich my life, there is another very good reason not to follow them:
Security.
It’s easy to trace your connections online. Most of this information, for most users, is public. If you follow Bank A, it stands to reason that you have an account at Bank A–something a malicious person would not have known before. Even if your online persona isn’t directly connected to your name, you might be surprised at how easy it is to connect the two with a Google search.
- Want to know 9000 people with Citibank accounts? Check http://www.facebook.com/citibank
- Want to know 6000 people with Wells Fargo accounts? Check http://twitter.com/#!/Ask_WellsFargo/followers
- Want to know 5 people with Bank of American accounts? Check http://www.youtube.com/user/bankofamerica/
(That last item says a lot, I think.)
Any bank that suggests you follow them on social media must be pretty confident of their security! Or, more likely, their marketing teams and their security teams don’t talk to each other.
You wouldn’t stand on a street-corner handing out cards that say, “My name is Bob Billiards and I have an account at Bank A” would you? Then don’t follow your bank on a social media site.
Generating puzzles for a Four-by-Four Word Game
A few years ago, I made a crossword-like game wherein users fill out a 4×4 grid of letters to spell 8 words (4 across and 4 down): http://osric.com/chris/wordgame/
However, over the course of several days, I was able to develop only 20 puzzles by hand. Trying all the various combinations is clearly a task better suited to computers than humans. Such a grid has 16 slots, each of which can contain one of 26 letters–so there are 2616 total permutations to check. That’s about 43,000,000,000,000,000,000,000–which could take a very long time, even for a computer. One key to speeding things up is to ignore permutations that don’t contain words.
› Continue reading
Creating a Javascript Game (LetterLock)
I recently created a simple word game using Javascript, which presented certain challenges. The game displays 3 random letters to the player, who must then attempt to create a dictionary word in as few moves as possible by shifting the letters up or down in the alphabet.
There were several programming decisions or challenges that came up during the game’s creation, for which I was able to apply some of the things I learned in my recent computer science classes.
Testing for multiple versions of Internet Explorer
Only one version of Internet Explorer (IE) can exist on a single windows installation by default. I had previously used Multiple IE as a way of testing web pages on older versions of IE. This allows you to have IE3, IE4, IE5, IE5.5, and IE6 installed alongside your existing IE7 or IE8 install. You can even run them concurrently.

I don’t test pages on anything earlier than IE6 anymore, but IE6 still accounts for more than 5% of my site traffic. Multiple IE basically helps me test both IE6 and IE8 from the same machine. However, there is still the IE7 gap, plus Multiple IE, which is no longer being updated or maintained, can produce some glitchy behavior.
It turns out, though, Microsoft offers some tools to help test their legacy browsers.
› Continue reading
Hunt the Wumpus
I am taking a course in discrete mathematics this semester, and the professor suggested we take a look at a game called Hunt the Wumpus.
Hunt the Wumpus was originally created in the 1970s, and unfortunately, most of the versions you can find on the web today are easier and less interesting that the original. The original eschewed a square grid for the game board and instead used a “squashed” dodecahedron, where each game space was one of the vertices.
It is also noteworthy for introducing the superbat, a feature of other games (including Zork) that followed Hunt the Wumpus, and for the humorous feedback (e.g. “ZAP–Superbat Snatch! Elsewhereville for you!”) that many of my favorite games adopted.
At any rate, I decided to recreate a version of the easier and less interesting grid-based game in Javascript:
Hunt the Wumpus
Pages
Archives
- April 2012
- March 2012
- January 2012
- December 2011
- November 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- March 2011
- February 2011
- January 2011
- November 2010
- May 2010
- March 2010
- January 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008

