Seeking Help on the Internet

29 06 2007

I know, I know. I always start these posts with some sort of long explanatory section before I get to the gist of what the post is about. I have this thing where I feel the need to tell the background whether or not others want to know about it. You’ve been warned.

Two weeks ago I was messing around with putting checkboxes in a web form. I had written my own routine for this in 1999, but because I use dreamweaver widgets for almost everything now, I decided to try a checkbox tool and it proved problematic.

What happens with the form is that the users select any number of checkboxes. The value of each checkbox is a number, but the user sees text (In this case the names of our Intranet web apps). All I do when the user submits the form is save the user id and the number values. Later, when I need to show the user what they have selected, I take the number of the check box and match it to another database table that has the same number plus the URL and name of the web app. So, in total I’m working with three database tables:
STAFF

staffid username position department .
75 johnr webmaster development
62 joshl Net Engineer network

WEBAPPS

appid title URL
1 Training Management System train.php
2 Staff Calendar cal.php
3 Human Resources hr.php

APPS_LOOKUP

appid userid
1 75
2 62
2 75
3 75
3 62

APPS_LOOKUP is what’s called a lookup table and this lookup table holds the results of the checkboxes that each user clicked. Without a lookup table I would probably store all of the web apps links for each user in the STAFF table, and with many web apps on our intranet this table would soon become ungainly and slow to search. Our current Intranet page contains over 30 links haphazardly listed on the home page. The idea for the new intranet was for staff members to choose only the links they usually use, and see those when they log in.

So, that’s easy enough to do, but the checkbox widget I used stored the data as comma separated values:

APPS_LOOKUP
appid userid
1,2,3 75
2,3 62

I had never worked or seen data stored like this before within a SQL field, and in fact, it went against what I had learned about storing data in lookup tables. I needed to know if there was some sort of SQL statement I could put together to accomplish pulling each value out of the appid field so I could relate it to the data stored in the WEBAPPS table. Interestingly enough, there was no Dreamweaver widget to store checkbox data into a traditional lookup table format, and the documentation for the widget I was using expected you to output the data like this:

johnr| Training Management System, Staff Calendar, Human Resources

I needed to output each webapp separately, so I was going to need help. Instead of doing a Google search I decided to try the comp.databases.mysql newsgroup. For my problem it was best that I explain exactly what I wanted to do. The responses to my query?

The first response basically told me that it was wrong to store data as comma separated in a field, rather that the data should be separate. I was then hit with some sort of quote about SQL empirical data. My reply was that the data was entered this way in the table, and again asked if there was a SQL routine I could use to separate it.

This first response really ticked me off. One of the things I see many times in forums is someone asking for specific help using IIS and Windows Server. One can almost guarantee that one of the responses will be “you should be using Apache and Linux.” Please, just answer the question or don’t say anything. In my case I was quite aware that my data was not stored “empirically”, but that wasn’t my question.

The second response was a link where a coder did a fairly complicated routine using MySQL 5 with stored procedures.. Not a help since my app is for MySQL 3, and stored procedures are not a part of that version, besides not knowing a thing about stored procedures.

The third response basically reiterated what the first reply said, plus chastising me for “top posting” in reply. I’m going to write a short post (I promise)about top posting next week, and ask Alvin for a TSPY ruling.

My next step was a Google search, and I found several topics with people seeking the same answer as I was. One particular thread had a response from a coder where he made a very convincing argument for how comma separated values in a field could save lots of searching time. Outside of the stored procedure solution, I found no SQL solution to my problem. I ended up doing what I should have done in the first place, and solved my problem in about an hour using a PHP array, but I was sure there had to be some sort of easy SQL solution out there somewhere. I know there are other people out there with this problem, so I’ll try to post my code in a comment to this post.



Send to Twitter

Create Better HTML Tables with CSS – Part Two

28 06 2007

At the end of the first tutorial on creating better tables with CSS, we ended up with a nice looking table, but it can still use a ilttle improvment. If you have a lot of data in your table that stretches across the entire width of the page, or that results in a long list, it can be difficult for users to know if the data they are viewing is on the correct line. For example, in a long contacts list a user may think they are viewing the phone number for Doug Quaid, but they are actually viewing the number for Melissa Quaker on the line below. One way to make this easier for users is to give every other line in your table an alternate color, and we’re going to do that with a little bit of Javascript, and only a slight change to our original CSS definition. But first, we have a little house cleaning to do from the previous tutorial.
Read the rest of this entry »



Send to Twitter

I made the switch

27 06 2007

I realized this evening that after years of using Internet Explorer, I’m now almost exclusively using the Flock browser. This wasn’t anything I had planned, but I like the photostream featue, the built-in blogging editor, feeds display, the snippets feature, and the overall interface. IE7 has too many annoyances that I’m too lazy to configure to get it to work the way I want. I wish Microsoft had left the interface alone, and just added tabs. That would have been enough for me. There was no reason to move stuff around, so that buttons and menus aren’t where they were in the previous six versions.

Flock is way down the list of popular browsers, but as I mentioned before, you should give it a try, especially if you are a blogger. It really makes taking text blocks and graphics from other sites very easy, and you can just drag and drop into the blogging editor.

technorati tags:, , ,



Send to Twitter

Useful WordPress Plugins

27 06 2007

For you technical WordPressers out there, here are some plugins that I’ve found to be useful on this site:

Google Analyticator – Once you get a Google Analytics account, you can use this plugin to automate placing your Analyics Javascript code into your WordPress Site pages.

Preserve Code Formatting – Very useful if you want to show programming code on your site. Every time I tried to use the Code tag in the WP editor it would not show my code until I installed this plugin.

Viper’s Video Quicktags – The author’s description for this useful plugin:

Tired of copying and pasting the embed HTML from sites like YouTube into posts on your site? Well then this plugin is for you.

Just simply click one of the new buttons
that this plugin adds to the write screen (rich editor included) and
then paste the URL that the video is located at into the prompt box –
easy as that. You can fully configure how the videos are displayed
(width, height, alignment on the page) and much more. Best of all, it
won’t break your page’s (X)HTML validation.

Currently supports these video sites:

As well as these file types:

  • QuickTime (MOV, etc.)
  • Generic video files (AVI, MPEG, WMV, etc.)
  • Flash Video Files (FLV)

Wp-Print – (scroll down the page to find it) Adds a printer-friendly link to your posts. Not that I think the world is rushing out to print my stuff, but I thought it would be useful for any tutorials I post on the site. I think it looks really good. Here’s an example from my HTML Tables Tutorial

I hope you find some of these plugins useful for your WordPress site.

technorati tags:, , ,



Send to Twitter

Create Better HTML Tables With CSS

25 06 2007

For displaying lists of data, the HTML table still rules. While you can create table-like structures purely in CSS (Cascading Style Sheets), browser compatibility still limits what you can do. Adobe Dreamweaver, for all of its many CSS capabilities, still favors tables when displaying lists from a database. However, using CSS you can really streamline the creation of tables, making them look better and saving lots of HTML coding time.

This tutorial may look daunting, but it’s just that I’ll be explaining the “why” as we do things. The actual processs is very easy and quick.

As I’ve indicated before in this blog, most school districts still display table data as if there had been no development in HTML since 1996. Here’s a typical example:

A Basic HTML Table

Link to the HTML table Web Page:

HTML Table

Let’s check a couple of lines of the table code:
<table border="1">
<tr>
<th>Staff Member</th>
</tr></table>

There are a few factors contributing to the ugliness of this table. The first problem is the use of the “border” attribute. In 1995, when giant shadows under every graphic and 3d was the rage, this type of table was OK, and for awhile this was all you could do with a table, but times have changed in 13 years and a cleaner, less fussy look is desired. Even if you don’t use the CSS in this post, please get rid of the border attribute.

Another problem is that the longest text in the data cells (“the “td” element) fills the cell, leaving no white space for things to “breathe”, e.g. “Software Development Coordinator”. We need to add padding to the cells to make them look less cluttered.

The final problem is the ugly “times” font. Don’t use it. It looks great on the printed page, but it’s ugly on a web page displayed on a monitor. We’re going to need a sans-serif font to add to our cleaner look for the table.

I also want to mention the “th” or “table header” element. Using this for the first row of a table will automatically center the text and make it bold. Most of the time you will want the rest of your table data left-aligned, which is standard.

Read the rest of this entry »



Send to Twitter

More History with flickr

21 06 2007

I’m working on some coding examples with the new Dreamweaver CS3, but I’m doing those in my spare time, so it will probably be next week before I post some code and my initial thoughts on the software.

Last week, “shuttersparks” (that’s the flickr username) posted a photo in the wvmemory group of the marker for the Monongah Mine Disaster. If you click the link to the group you can also view some more pictures of a recent monument that has been erected, as well as additional pictures of the town.

Monongah Disaster

At the time of the explosion two work shifts had just entered the mine, and the explosion blew the entrance of one mine across the river where it landed at the entrance of the second mine. Shuttersparks sent me an email stating that the explosion was “equivalent of a 5 kiloton nuke set off underground”. I read where it knocked streetcars off the tracks in Fairmont, four miles away.

Here in West Virginia, when a mine disaster occurs we usually blame the mining company first. From what I’ve read, the Monongah mine was a modern and safe operation, but there was no real knolwedge of the effects of “black damp” (methane), so no safety rules were in place.

Most of the workers were European immigrants, and most of them were from Italy. Many young boys died in the disaster as they were allowed to work in the mines.There was no room in the town for all of the bodies, so caskets were placed in the street. For burial, mass trenches were dug in the cemetery.

A few months ago I did some reading from contemporary news articles, and the mine foreman plainly states that both shifts had just gone into the mine, numbering about 1,000 workers. The offical death toll is 361, and I’ve seen a couple of estimates in the 500 range, but only one that comes close to 1,000. I wonder if the 361 is just for the bodies that were recovered.

The Monongah disaster remains the worst mining disaster in America. This December will mark the 100th anniversary.

I really appreciate all of the marker pictures in the WV Memory Group. I’ve learned a lot of fascinating and fun things about my state.

I guess my point to this post is that schools should not block flickr. I think it is so much more than pictures, and can be used in many classroom disciplines.

technorati tags:, , , ,



Send to Twitter

Josh Unleashed

19 06 2007

Toad’s Stool » What’s an iPhone?

Josh Leeth, SCOCA Network Engineer and Gadget Freak, has a good post about all of the recent iPhone media frenzy on his brand new blog. His thesis is valid: it’s a phone. Even the folks at my favorite podcast, TWiT, are beginning to wear me out on this subject (have you noticed that TWiT seems to be going more and more into unrelated tangents lately?).

A few monthe ago it was Apple TV generating all of the buzz, and I simply don’t get it. I’ve got a D-Link media streamer with Wireless g or the option of wired ethernet. It doesn’t have a built-in hard drive, but it can stream music (wav, mp3, wma), video (mpeg, DIVX, XVID), photos (jpg, bmp. gif) from any hard drive on my network. Additionally it will stream live audio from any music or radio station via UPnP on Rhapsody (or Napster, if I subscribed). Plus I can view Video, photos, or listen to audio from RSS feeds. Everyday I check out pictures from a large number of flickr feeds on my TV. The model I have has component video and digital audio outputs, and the next model up includes HDMI. I paid $180 for it and have had it for three years. I believe Josh has a couple of old xBox units that he modified to do essentially the same thing as my D-Link box, and I know he has been doing that for at least two years. I’m not a gamer, but I believe the xBox 360 and PS3 come with media streaming capabilities built-in.

Because the D-Link media receiver uses the UPnP standard, I have the
option of choosing from several UPnP servers to install on my PC.
Currently I’m using TVersity, which will transcode files like .mp4
which are not natively supported on the media receiver. Oh yes, the software is free.

In Apple’s defense I’m sure it is a prettier box, and has a nicer interface than my D-Link unit. However, my media streamer sits in a shelf uner my TV, so all you can see is a really cool blue light when it’s turned on. I’ll admit that I was intrigued when I first heard about Apple TV, but with limited file support, no UPnP, and the requirement of iTunes, it was way too limiting to purchase for $300.

So, does the iPhone interface look cool? You bet, but I wonder how fast the data access shown in the commercial will be in real world use. It’s a phone. Time to move on.


technorati tags:, , , , ,



Send to Twitter

Geocaching

18 06 2007

When I did my Geotagging podcast with Alvin he mentioned that he thought I was going to talk about geocaching. I didn’t know a thing about geocahing at that time, but with my new Garmin nuvi I’ve done it a couple of times in the past month, by putting my nuvi into Off Road/Pedestrian mode.

Geocaching is a fun activity where people have hidden small caches of items (trinkets, logbooks, etc.). You’re given the GPS location of the caches and you go and find them. All caches contain a logbook, which you can sign to prove you found it, and you can take a trinket if one is provided, usually placing your own trinket within the cache before hiding it again. While this may sound easy, it can be hard to find exactly where the cache is buried, and I’ve also found that a good bit of the fun is trying to hide your activity in sometimes public places so that non-geocachers won’t find the cache and remove it.

The main site for this activity is at Geocaching.com, where you can find caches in your area (believe me, these things are all over the place), and log your finds.

Additionally, here’s a news story about geocaching in Utah State Parks.


technorati tags:, , ,



Send to Twitter

Dapper

17 06 2007

Dapper is a very cool online tool that lets you create widgets from your web site. I created the Flash applet below in about two minutes using the URL to the SCOCA Training RSS feed.



What is incredibly neat for schools is that I could have created the same Flash widget just by entering the URL of the SCOCA page that lists training at www.scoca-k12.org/training. Dapper allows you to select portions of the page to include in your widget. This is simple to do, but hard to explain here.

If you are responsible for the web in your school district, you owe it to yourself to spend a few minutes and create your own widget. It’s a great way to add a little pizazz to your site.





 Add to your site powered by DapperÂ

technorati tags:, ,



Send to Twitter

flickr Genealogy Part Two

16 06 2007

Awhile back I posted about uses of flickr for Genealogy. When I opened my inbox this afternoon I had an email from pit-yacker who found 68 Newgate Street in Bishop Auckland, County Derry, UK, and he sent me links to two pictures he recently took where this picture was taken at the end of the 19th century:


Here is the building as it looks today:

It is now a pub, and the date on the building indicates that the original was torn down and replaced in 1912. Here’s a shot of Newgate Street (the pub is in the middle on the right):

I don’t know the population of Bishop Auckland, but here in Huntington the population of our town is around 45,000, and the downtown sidewalks are never this crowded. Huntington did look this thriving in the late ’50s, early ’60s when I would come from Charleston to visit my Grandmother. The town had a population of about 97,000 then.

As I indicated in my earlier post, I love relating these contemporary photos to my past.

Now I need to ask pit-yacker what Tut ‘n Shive means.



technorati tags:, , , ,



Send to Twitter