Jim's Blog Ramblings about novels, comics, programming, and other geek topics

14Mar/123

How to convert a street address to longitude and latitude (geocoding) via web services (Google)

Google AdSense

Several years ago, I wrote a blog entry detailing how to use geocoder.us (and Yahoo!) web services to geocode an address. Since then both web services have changed a little and I found myself needing to update my code to support non-US locations. Below is sample code showing how to use Google’s Geocoding web service to get longitude and latitude values for addresses.

21Sep/1158

How to remove passwords from protected Microsoft Word documents

Google AdSense

There's always been a need to remove passwords from protected Microsoft Word documents when you need to make a change. My most common occurrence is with Human Resource (HR) forms. HR staff will create the MS Word document, password protect it, and then upload it to our company intranet. However, when I need to fill the form out, the only way to do so is to print the form, sign my name, scan the signed & printed form, and them email it back to them. What I would like to do, is to just paste a scan of my signature onto the form, save as a PDF, and them email them the PDF saving printing and scanning time and paper (which would then need to be shredded).

Here’s a trick that I learned a long time ago.

12Jul/110

Securing ASP.NET Web Sites: Form Caching

What is "Form Caching Vulnerability"?

The Form Caching Vulnerability allows sensitive form fields to be cached and retrieved by another user on the same client.

CWE-525: Information Exposure Through Browser Caching

12Jul/110

Securing ASP.NET Web Sites: Cookie Vulnerabilities

This is the first of my series on securing ASP.NET web sites. As I work through various vulnerabilities, I’ll document instructions for fellow web developers in hopes that we can help build more secure web applications. The Cookie Vulnerability falls under the common vulnerability name of "Broken Authentication and Session Management."

What is "Broken Authentication and Session Management"?

This cookie vulnerability is OWASP 2010 A3. You can read more at Top 10 2010-A3-Broken Authentication and Session Management. This threat applies to application functions related to authentication and session management not implemented correctly, allowing attackers to compromise passwords, keys, session tokens, or exploit other implementation flaws to assume other users’ identities.

29Jun/110

Comicster Plug-In: Debugster

Debugster is a suite of debugging and development tools for Comicster. I’ll go over each of the various tools below.

  • Property Window
  • Output Console
  • Dynamic Execution
21Jun/110

Comicster Skin: The Hero Initiative

For my first Comicster Skin, I decided to build a customized user interface highlighting the Hero Initiative. I’ve been a bronze member for the last couple of years (ever since I discovered the charity) and I felt that the idea of making a skin to highlight the Hero Initiative would be a great idea. At the least, I figure that it will bring a some exposure for the charity and maybe some of Comicster's users will read about the charity and become members.

A little bit about the Hero Initiative:

In late 2000, a consortium of comic publishers came up with the idea to create a financial safety net for comic creators, much in the same fashion that exists in almost any other trade from plumbing to pottery. By March of 2001, the federal government approved The Hero Initiative as a publicly supported not-for-profit corporation under section 501 (c) (3).

Since its inception, The Hero Initiative (Formerly known as A.C.T.O.R., A Commitment To Our Roots) has had the good fortune to grant over $400,000 to the comic book veterans who have paved the way for those in the industry today.

The Hero Initiative is the first-ever federally chartered not-for-profit corporation dedicated strictly to helping comic book creators in need. Hero creates a financial safety net for yesterdays' creators who may need emergency medical aid, financial support for essentials of life, and an avenue back into paying work. It's a chance for all of us to give back something to the people who have given us so much enjoyment.

The Hero Initiative, www.heroinitiative.org

20Jun/110

Comicster Plug-In: Auto Save

My third Comcister Plug-In is to create an “auto save” feature that will automatically save my comic book collection without requiring me to click the “save” button. This auto-save feature will check every 60 seconds to see if the comic book collection has been modified and if so, then save the collection.

I’m re-using some of the code from my previous plug-in (Create Backup of Collection) and adding in a timer with an interval of 60 seconds. This plug-in also implements the newly created IToogleTool interface to allow changing the state from on/enabled to off/disabled. When enabled, a checkmark will appear next to the menu choice. If the extension is in the off/disabled mode, then the timer will not execute and auto-saves will not occur.

8Jun/110

Comicster Plug-In: Create Backup of Collection

The second Comicster Plug-In I created was for the purpose of making backup copies of my collection. Although my collection isn’t huge, I feel that entering all of the data and having to go through all of my comics to get an accurate list was enough effort to merit making regular backups. With this plug-in, it only takes 1 click to safely create a back up and store it.

The easy way to accomplish this would be to use:

File.Copy(collection.FileName, backupFileName);

But that wouldn’t be any fun, so I did it a bit more complicated so that I could learn a bit more about how Comicster works. I used the below code to write out the collection in the CMXX format.

7Jun/110

Comicster Plug-In: Reload Images

The first Comicster Plug-In I created was to assist importing of my previous Comicster v1 collection. After the import, the issue cover images needed to be refreshed/redownloaded.

The below code illustrates how the plug-in works. The code below is shown looping through each issue within the “Owned” folder within the source collection. This process is repeated for “Wanted Issued”, “Owned Trades”, and “Wanted Trades.”

foreach (Issue item in source.Owned.Issues)
{
   ThumbnailImage.Reload(item.Id, item.ImageSource);
}
6Apr/112

How to append options to CascadingDropDown after initially populated via AJAX Web Service

The setup: Microsoft ASP.NET and AJAX Control Toolkit components

I needed to add additional dropdown options to a DropDownList web control in use by the Ajax Control Toolkit CascadingDropDown ASP.NET AJAX extender. The CascadingDropDown provided a means to get an automatic population of a set of options called by the web service. This AJAX call also passes in the parent item, so that the list items cascade (show items related to the parent control).

An example could be 2 drop down lists: Automobile Make and Automobile Model. If the user selects “Ford” from the Automobile Make drop down list, then only Ford models are listed in the Automobile Model drop down list. If the user changes the Automobile Make to “Honda”, then the items in the Automobile Model changes to show only Honda models.

I needed a way to append an “All” option to the drop down list, but I didn’t want to automatically include “All” as valid option in my Web Service. I wanted to append it on a specific form rather than as part of the data feed.

To start, you need to have a working set of CascadingDropDown web controls. I’m not to explain that set up, because you need to figure out that before you can add additional elements.