Friday, June 12, 2009

MySql Text Field - Truncating Data?

Every now and then you run an application that really tests the constraints of data types. I just encountered this....

I just found out that in MySql "BLOB TEXT A BLOB or TEXT column have a maximum length of 65535 (2^16 - 1) characters". I was encountering some data errors with large text chunks - and finally found that they were being truncated silently... When I counted the characters - yes... that was the issue.

Arggg!

But there is a simple solution... LONGTEXT or LONGBLOB fields can handle the larger bits of data - if this is expected. This gives you approx 4 Gig of space to work with. Good to know.

Tuesday, June 9, 2009

Standard Web Page Width

I have been building web pages for over 6 years... and have been using a standard web page width of 778px for 800px monitors, unless the client requests otherwise. The concept is to avoid (left/right) scrolling and make a good user experience.

Most of the justification came from the analysis/tips in Jakob Nielson's book on "Homepage Usability" - dated in 2002. Most other articles I've read suggest this... but the trend is changing, as these monitors become fewer.

Floating widths are cool - and useful. But they take longer to develop and I only do those on request, at an extra fee. However, since my statistics show that less than 2% use 800 px monitors, I am about to change my policy...

But what width to use? Of course I will build for the 1024px monitors... the next size up. This is the largest percentage for screen resolutions now - about 34%. But I am considering only using 960px width for the regular content. That will allow for those who don't open their browser all the way. And it will allow the background colors/gradients to properly frame the page.

More info:
http://webdesign.about.com/od/webdesign/a/aa080904.htm

http://funbytebitstop.wordpress.com/2007/03/01/775-px-make-it-your-default-webpage-width/

http://www.jimdegerstrom.com/blog/2008/07/standard-web-design-page-width.html

Any thoughts?

Wednesday, May 6, 2009

Google Maps - just the basics please

My Spiderweb Logic CMS has had Google Maps integrated into it for a couple years, so I havent had to focus on this for a bit. However, someone just asked me how to integrate Google Maps into their website. This is never a 2 sentence explanation. Here are the basics:

First figure out what you want.

I want GOOGLE MAPS imbedded IN my website:

You will need to use the API to build your map. Reviewing the official documentation will help with "how do I" questions specific to your website.

REF: http://code.google.com/apis/maps/documentation/

1) COPY/Paste code for your website

This is the best method:
http://code.google.com/apis/maps/documentation/#AJAX_Loader
They give you a bunch of javascript. Put it between the head tags.

Don't forget to create a "div" tag in the body with the id of "map" to contain your map.

2) Get a Google API Key for your website (even if it is localhost)

3) Replace the ABCDEFG in the above template with your google key.

4) Find the longitude/latitude of the location you want to center on.
Get longitude and latitude. If you are doing things dynamically both Yahoo and Google provide geocoding apis. But for one-time use, that link is the best.

5) Replace longitude and latitude numbers in the sample code with the actual longitude and latitude for your location.
ref: map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);

It should now work.
You can alter the zoom in/out features by changing the 13 to a different number. You can alter the width and height by altering the width/height of the div tag.

You might also find the tutorial helpful here:
tutorial: http://code.google.com/support/bin/answer.py?answer=74725&topic=11364
list of events: http://econym.googlepages.com/gevent.htm

I want to link to a GOOGLE MAP defined with my specific location(s):

This means that your map stays at Google. You just link to it from your website. However, you can configure a map specific to your needs - with your location preferences.

STEPS:
1) Log into your Google account. (Get one if you dont already.)

2) Get to the Google "maps" product

3) Create a new map and set your preferences. Put in a name and description. Dont forget to save.

4) Go back in edit mode and drag markers/balloons to your locations. Save.
NOTE: When you are editing your map you can zoom in to help put in your markers.

5) Get a link to your map. (Click on the "collaborate" link on left to get the URL. Copy/paste the full URL noted to the "href" of a link.) example map

Tuesday, April 21, 2009

Business Testimonial Sites

One of my clients was interested in using some testimonial sites, and wanted to know what was out there.

Honestly, there are several sites that let you post a business profile and manage testimonials / business ratings. The trick is to hit the main ones (in case someone searches for you) and to use them to build your reputation/goodwill etc - and perhaps your search ranking.

TIP 1: create accounts in about 3-4 sites. You dont need to create and manage accounts in lots of these unless you have LOTS of time. But only let your customers know about 1 or two at a time. That way you can have several testimonials with one site. (Its a good idea to put links to these in your emails and in your website.) As you grow, share the other sites to build them up also. If someone asks for referrals, you can pass them a link with more than one testimonial.

TIP 2: If you sign up for an account with these places, take the time to do it right. Upload relevant pictures, including your logo. Remember - this is part of your BRANDING/MARKETING. Put in contact info AND your website url in the proper places. Put in a good description of your company. Put in a coupon - if they allow such things.

1) http://www.yelp.com
2) http://local.yahoo.com
3) http://www.insiderpages.com
4) http://centralcoast.citysearch.com
5) http://www.trustlink.org (affiliated with BBB)
6) http://www.merchantcircle.com

If you are in the food or travel business there are specific referral sites related to these activities. That way if someone is interested in traveling, he/she can do a search on what there is to do/eat and plan an iternerary - based on the reputation of the business.

Friday, March 27, 2009

Securing XML Web Services - SOAP

I was doing research on securing XML Web Services and came across the following:

http://www.keithelder.net/blog/archive/2007/01/06/Securing-Web-Services-With-Username-and-Password.aspx

I want to see if I put a XML Web service in a folder - secured with folder permissions - and use username/password to get the web service... that would be the most scalable solution for me... Since I would like to use this secure some user-specific data.
-------------------

Ok - for speed and simplicity I just did the following:
1) Made username and password properties passed into the web service
2) Used SSL to connect to protect the web service.

It was simple and easy to use... pulled data specific to a user... from ASP.Net app into vba app.

Want the code??

Monday, March 16, 2009

ASP.Net AJAX - Update Panels

Update Panels are COOL!

They have some quirks - but if used properly, they can really speed up a web app. (Had trouble using them with file uploads... but all else was fine.) I have been working on building some advanced lead-generation/management tools into my CMS - mostly using AJAX modals, tabs etc.

I have found that those forms with several grids and more than 3 tabs tend to take a few seconds to redraw - using a regular postback. However, if I use an Ajax update panel - only the data in that update panel is redrawn... saving LOTS of time for the update.

I still use regular postbacks - especially if if the update impacts several tabs, or if using file uploads. However, in most cases this is not needed...

FILE upload in Update Panel?
I normally don't bother... But if needed, refer to this:
http://geekswithblogs.net/ranganh/archive/2008/04/01/file-upload-in-updatepanel-asp.net-ajax.aspx

----------------------

One critical thing to consider with update panels - whether to set
UpdateMode="conditional" or "always".

Set to "conditional" if:
This update panel is not being affected by other update panels.

Set to "always" if:
This update panel data is being affected by updates in other update panels. This slows down the display/postback of all update panels with this... but can be very handy. Only do if necessary.

Monday, December 29, 2008

Importing Contacts from Hotmail, Gmail, Yahoo using C#

Many of the social bookmark services offer a means to import/invite people from your online email accounts... This is a great feature.... Honestly, I was a bit afraid of it at first. However, I do see the usefulness of it.

I have found some help (C#) to do this... I do have some websites that this would help with... particularly those with marketing, contact lists, and newsletter features. It can be rather useful..

http://forums.asp.net/p/1083530/2279066.aspx#2279066
http://forums.asp.net/p/1083530/1982614.aspx

Yahoo class:
http://gnillydev.blogspot.com/2007/10/yahoo-contact-import-class-in-c.html

Google documentation:
http://code.google.com/apis/contacts/
http://code.google.com/apis/contacts/docs/2.0/developers_guide_protocol.html

Live/Hotmail documentation:
http://gnillydev.blogspot.com/2007/10/live-msn-hotmail-contacts-importing-in.html

I will update this with any insights as I find it... and try it out.

Where to use it:

Lets say you have a "newsletter" or "prospect management" or "social" web-software. You can use such tools to import new contacts or friends and jump-start your system with your current business/family contacts.