Archive for April, 2008

Scenic Photos

Sunday, April 13th, 2008

It is a scenic drive from Cougar, WA to Amboy, WA. Tons of people on motorcycles were driving this route and I can see why. It’s scenic, windy, and pretty fun to drive.

A view of Mt. St. Helens from the windy road…
Mt. St. Helens from road

Pretty view of Mt. St. Helens from the road

It was a pretty countryside drive…

Pretty barn in the country

Before arriving at the BBQ in Hillsboro, OR, I noticed this tulip farm:

Field of tulips

Grove of tulips

Tulip farm

Fallen tulip

Search and Replace Wildcard Characters in Dreamweaver

Wednesday, April 9th, 2008

Search and Replace Wildcard Characters in Dreamweaver

Dreamweaver has a powerful search/replace ability which includes ‘regular expressions’. This allows you to scan and replace particular html without affecting data.

Here’s an example of how useful this is:

Let’s say you are harvesting content from Wikipedia and putting it on your own website. Though I don’t endorse that activity, it is allowed according to the GDFL and a lot of people do it. So, here’s a way to make it easy.

Let’s say you find a huge table full of data that you wish to use on your own website. Since Wikipedia has tons of links and junk in the code, you want to strip it all out. One way is to copy and paste into Excel, then save as a .csv or .txt file, thus stripping out the extra invisible formatting html code that was previously a part of it. Then, close and re-open the .csv or .txt into Excel, then copy and paste into Dreamweaver (or your HTML editor). While this works, Excel still seems to copy over some html formatting, such as <td height="17" … on every field of the table, which is annoying.

You can do a find/replace in Dreamweaver for height=”17” and leave the replace field blank. That would solve that problem, however, Wikipedia often uses footnotes which add [1] [2] [3] etc in superscript, such as the example below. The question is how do we delete these brackets from our copied table, but preserve the data. Good news- we can do that with Dreamweaver, using regular expressions.

Change from this:
<td height="17">Batman Begins[1][2]</td>
<td height="17">Superman</td>
<td height="17">Army of Darkness[3]</td>

Into this:
<td>Batman Begins</td>
<td>Superman</td>
<td>Army of Darkness</td>

If you had a huge table full of this with 100+ rows with 50 or more footnotes, it would take a long time to manually remove all of the brackets by hand. Here’s a way to automate it in Dreamweaver:

(Make sure you are searching the ‘source code‘ and that the ‘Use regular expression’ box is checked)

Find:
<td height="17">([^<]*)\[[^"]*</td>

Replace:
<td>$1</td>

Result:
Dreamweaver will instantly strip out all the junk from your code and replace it with the core code while preserving your data. In this case, the wildcard variable will preserve anything between <td height="17"> and </td>.

Explanation:
The find is the prefix of the tags, then the wildcard variable that’s stored: ([^<]*) then, I wanted to remove the brackets, so I put one in, but since we’re using expressions, it has to be ‘escaped’ to tell it we literally mean the bracket, so I put this \ before the [ then I added a non-stored wildcard variable (the other junk I want removed), so I added: [^"]* then the close tag </td>. Then the replace is the simple $1 variable between the tags which recalls the stored variable. Very cool!

Another challenge:
Let’s say you want to copy a huge list of links from Wikipedia and change them to our own links on our own website. Here’s an example:

Change from this:
href="/wiki/Army-of-Darkness">
href="/wiki/Raiders-of-the-Lost-Ark">
href="/wiki/Pulp-Fiction">

Into this:
href="http://www.domain.com/Army-of-Darkness.php">
href="http://www.domain.com//Raiders-of-the-Lost-Ark.php">
href="http://www.domain.com/Pulp-Fiction.php">

In Dreamweaver, select Find/Replace…

1. Check ‘use regular expression’
2. Do Find for:
href="/wiki/([^<]*)">
4. Replace:
href="http://www.domain.com/$1.php">
5. It preserves the variable inside

Without the regular expression, you could have done Find/Replace for the first part, but when you wanted to add the .php to the end, you’d be stuck. How else would you do it?

Pretty incredible, huh? You can automate the changing of links or anything on an entire website with thousands of links and pages in just seconds. All using the stored wildcard variable.

([^<]*) is stored (use $1 to retreive in replace)
[^"]* is unstored

You can also do Find/Replace to recall multiple variables at once, like this:

If multiple wildcards:
([^<]*) ([^<]*) ([^<]*)
Use:
$1 $2 $3

A tool like this can give you the power to harvest public domain or free content, manipulate data and repurpose it for your own site.

WordPress: The Ultimate Google Ranking Machine

Sunday, April 6th, 2008

WordPress ranks high in Google

Google loves WordPress. WordPress content is a nice, tasty meal for those hungry Google spiders.

In some cases within 45 minutes of posting, content on my blog was ranked #1 for certain keyword combinations. That’s impressive how quickly Google will scan and update it’s SERPs with freshly blogged content. Recent postings on this very blog demonstrate that.

On March 29, 2008, I witnessed a scene of a crash along I-5 in Kelso, Washington- an event that affected thousands of travellers. When I got home, I went ahead and made a blog posting about it. Within 45 minutes, it was picked up by Google and ranking as the top page for all of those people Googling to find more information about it. No official news story was even published until the next day, so all of the search traffic went to this blog. The local newspaper, TDN, made their posting, but they didn’t use WordPress- they use their own system that is not optimized for search engines and probably lacks the auto-pinging functionality WordPress has. So, even though they have a better story, theirs didn’t come up in search rankings as high as my little blog posting did.

These screenshots were captured only today, but these keywords,
car crash longview, were ranked #1 like this within 45 minutes of posting:

Fatal Car Crash near Longview, Washington

Google works fast.

Here is another example, with the keywords: car crash i-5

Car crash on I-5

When you think about it, I-5 is a LONG freeway, extending 1,381 miles from Canada all the way to Mexico. It spans major metro areas, including Seattle, Portland, Sacramento, Los Angeles, and San Diego. There are multiple wrecks every day on I-5 just in Portland alone. But think of all the wrecks that occur daily on the entire freeway and of the many thousands of people affected! Some of these people will be impacted and will search Google to find more information. So, for this blog to be ranked #2 in Google for car crash i-5 out of 235,000 results is crazy to me. WordPress is an ideal platform for fast, high rankings.

As another example, yesterday, I made a blog posting on the Best Places to Dance in Portland.

Today I checked the results, and it is ranked either #1 or the top 10 for many keyword combos:

Google Rank for Dancing in Portland

High Google Ranking for Dances in Portland

In less than 24 hours, the keyword: Oregon Best Dancing ranked #3:

Best Dancing in Oregon

And finally here’s another keyword combo: Portland Best Dances that ranks 10th.

Best Dancing in Oregon

Even 10th is not bad for less then 24 hours and not being an authority site on dancing. This is the only dance-related post. In fact, this blog is really new and doesn’t even have very much content yet. Compare this to the many other dance websites that have been running for years with much content. Isn’t it strange that a single random WordPress posting can outrank many of these established dance websites? It shows the true importance of SEO and specifically WordPress as a web marketing tool.

WordPress also outperforms my custom-made Internet Marketing Articles area. Even though this section also has a similar structure, has good SEO, and has RSS feeds, it does not seem to get as high of rankings as WordPress does. WordPress has the advantage of the auto-pinging feature, along with my unproven hunch that Google favors blogs, especially the spider-friendly WordPress structure.

This WordPress blog is not overly pimped out, but uses a simple open source theme that is SEO friendly and I added a Twitter plug-in. That’s about it.

That should be adequate enough of a posting for you to look into this Google-influencing blog platform. The next time I do a Google search, I’ll be looking for your WordPress blog on the front page.

Best Places to Dance in Portland, Oregon

Saturday, April 5th, 2008

View more Portland, Oregon stock photos like this at www.turbophoto.com
Portland, Oregon

Looking for a great place to dance? With 10 years experience in social / partner dancing around Portland (including ballroom, salsa, swing), the following is the list of the best places to dance, ranked within each category and with URL links. People should find this useful, as sometimes online dance information can be somewhat scattered.

Best Places to Salsa Dance in Portland:

1. Mambo Lounge
It’s the biggest dance floor of any regular salsa dance venue and great live music every Saturday night. $10 admission. Mambo lounge doesn’t really have a website, so everyone seems to link to DJ Roger Rumba’s own website (nice for him).

2. Aztec Willies
It’s not a large area, but can be quite lively sometimes on the weekends. Since Mambo Lounge opened, it has taken a sizable chunk of their market share, but it can still be hopping on some days. Live music sometimes. Admission from $6 (no band) to $10 or more on evenings with live music. Unfortunate for them, it looks like they accidentally lost their previous website domain name and that some spammer has it now. But the link above appears to be the only website they have.

3. Andrea’s Cha Cha Room (Grand Cafe)
Not far behind Aztec Willie’s is this small dimly-lit ‘basement’ feeling of a club below the Grand Cafe. The dance floor is a little odd, with a couple pipes and a beam anyone 6′ or taller might hit his/her head on, but other than a few hazards, it can be a nice place to dance. Thursdays seem to be the most popular evening for this venue. Fridays can be ok sometimes too. It can be pretty dead any other times. It is the cheapest place to salsa dance with only $4 or so admission when there’s no band.

4. Satin & Latin
A good dance studio to learn salsa and Casino Rueda (salsa dancing in a circle) and is only $5 for Friday nights. It appeals to a younger crowd, due to it’s non-nightclub atmosphere. They have open dancing after the hour and a half lesson and a great, spacious floor to dance on, but no one stays around. It’s actually strange how people bolt so quickly.

There are a few other studios, smaller clubs and the occasional large event at random places for salsa dancing, but this list is the best you’ll find in Portland on a consistent basis.

Best Places to Swing Dance in Portland:

1. Scottish Rite
Sunday nights is best consistent weekly dance for swing dancing in the Portland area. It includes west coast swing and blues dancing upstairs as part of the admission. $8.

2. Crystal Ballroom
This is an inconsistent swing dance venue because it is a low priority activity for booking. (they make more money off the booze people drink for concerts and other events). So, they often get weird days booked for dancing, such as a Monday night or occasionally a Friday night. But when it is available, it is the best floor you can dance on! It’s really springy and easy on the feet for lively swing dancing. $8. The host of the dance usually switches off between Stumptown dance and Swingtime.

3. PPAA
Swing here on Thursdays is usually pretty good. From my observations, it tends to bring some more experienced dancers. $6.

4. Ambassador Ballroom - Tigard
Located in Tigard, it is the nicest ballroom to dance at in all of Portland metro area, being large, new, and clean. They claim it’s the largest dancefloor area west of the Mississippi or something. There’s a main floor and then two other smaller ballrooms. When they had their opening in 2007 (I think), it was absolutely packed. They also had no air conditioning at the time, so I think it turned away a few folks. But since then, things have settled down, and it just isn’t very busy. Their swing dance on Saturday evenings has been only lightly attended most of the time. It just seems dead sometimes. They have offered tons of dance classes during the week, but was not very well attended. Their biggest open dance of the week is Sunday evenings, and even that is not very busy. It’s an ideal place to dance, but too bad not more people show up. $8

Best Place to Ballroom Dance in Portland:
Ambassador Ballroom - Tigard
Sunday evenings. $5 and includes a quick lesson. More info is listed above.

Best Place to West Coast Swing Dance in Portland:
Bushwhackers - Tualatin
This is a nice dancefloor in a country redneck environment. But the best part is this place is absolutely free. They offer free lessons every week year around, and they are good. You can learn to be an excellent dancer without paying a dime and many of your moves can translate into other dance styles. One of the west coast swing instructors there was the best dance instructor I’ve ever had. It appeals to an older crowd, so I think that’s the reason not more people take advantage of it. $0 for classes and sometimes a small cover for weekend evenings.

Finally, for those into the wild, nightclub-type environment, Portland’s largest dance club is Barracuda.

These are the best places to dance in Portland for social and partner dancing. A website that is very useful for finding what’s going on is http://portlanddancing.com but double check all the events posted by going to the source, as times/venues change and this list doesn’t always get updated.

Have fun on the dance floor!

How to Win at Internet Checkers

Saturday, April 5th, 2008

Internet Checkers

Internet Checkers is a fun game which comes with any standard Windows XP installation. It’s neat how Microsoft configured it to link with anyone in the world looking for a player for the same game. The template message options at the bottom allow people to reach across any language barriers and just play a simple game of checkers.

I have wasted a lot of time playing this game- usually I end up playing it at home on the computer while I’m waiting for something- on hold on the phone, waiting for a file to copy, video to load, or whatever. Over time, it adds up and I’ve become a competent internet checkers player. I play on expert mode and win about 75% of the time, every time. (I have that line from the movie Anchorman in my mind).

Here’s the tips that have helped me:

1. Keep your checkers in the middle.

2. Don’t move your bottom row of checkers. Not until you run out of options, and when you do, move them out in this order: bottom far left first, then, the 2nd to the right. Try not to move your last two pieces from the bottom, unless of course, you can capture a piece from the opponent. With the two bottom pieces, if you have to move them, then move the 2nd from the bottom left. The bottom far right is the last one you should move. There are reasons for this order, but it would take too long to explain- through experience, you’ll see why it’s usually advantageous.

3. Trade pieces at the first of the game to ‘open up’ your opponent’s middle area. Try to get his pieces to the outside of the board and have your pieces in the middle.

4. Chip away your opponents’ back row. If you can trade pieces and get the opponent to lose his back row pieces, then always do it. It will make it easier to get in and get crowned later.

5. Always look for double-jump opportunities. Also be aware of your opponent’s double-jump opportunities. Try to avoid positioning your piece where you’re vulnerable to such a jump.

6. Capture pieces from your opponent, even if you have to compromise your position. It is always worth it. For example, the screenshot below, I could have moved my double piece down to try to jump over on of the opponent pieces, but it risked getting jumped back. A sure move to capture one piece is to compromise my positioning by sacrificing my bottom piece for two of the opponents’. Often games end up being a tie or one person with an extra piece. The player with the extra piece is guaranteed to win (when played correctly). So, always take a piece when you can.

Internet Checkers

I hope these tips help your game.