March 2007


Programming and Technology29 Mar 2007 11:38 am

I was recently coding a PHP application that connected to and interacted with a mySQL server. One of my sql scripts was producing a mySQL Error 1421 that I had not seen before. Here is the sql that I was running, the error, the resolution, and the reason.

The SQL:

INSERT INTO my_table(
 field1, field2, field3, field4, field5
)
SELECT (
 fieldA, fieldB, 1234, NOW(), fieldC
)
FROM my_table_two
WHERE my_table_two.PK =1

The error:

MySQL said: Error#1241 – Operand should contain 1 column(s)

The resolution: Remove the Parentheses () around the second embedded SELECT statement so the statement is as follows.

INSERT INTO my_table(
 field1, field2, field3, field4, field5
)
SELECT
 fieldA, fieldB, 1234, NOW(), fieldC
FROM my_table_two
WHERE my_table_two.PK =1

The reason the error occurs: When you ad parentheses () around the SELECT columns you create an ordered list of values or a tuple. The SELECT statement expects a list of individual values. Or in simpler terms you are giving it the array[1][2] when it expects the values 1 and 2. You can recreate this error by running this sql statement SELECT 1,2 which will return 1 2 amazingly. Then run SELECT (1,2) which will return ERROR #1241 – Operand should contain 1 column(s). For me it occurred because I copied and pasted code from an insert statement to not have to retype all the fields and grabbed a little too much in my copy.

The Cliff Notes Version If you get a mySQL ERROR 1241 then look for some unnecessary parentheses surrounding your SELECT statement and remove them!

Technorati Tags: , ,

del.icio.us:mySQL Error #1421 digg:mySQL Error #1421 spurl:mySQL Error #1421 wists:mySQL Error #1421 simpy:mySQL Error #1421 newsvine:mySQL Error #1421 blinklist:mySQL Error #1421 furl:mySQL Error #1421 reddit:mySQL Error #1421 fark:mySQL Error #1421 blogmarks:mySQL Error #1421 Y!:mySQL Error #1421 smarking:mySQL Error #1421 magnolia:mySQL Error #1421 segnalo:mySQL Error #1421
Software and Technology28 Mar 2007 03:44 pm

Order Photos with Automator Screenshot
Problem: I had a directory of 115 photos which I wanted to upload to my picture gallery in the order they were taken but they were taken with three different cameras so the filenames meant nothing. With the Firefox/Apple finder you are unable to order by Date Created very easily in the dialog that pops up when you click to upload a photo to the web.

Solution: I created an Automator Action to first take Selected Finder Items then copy them just in case, then order the items by Date Taken, then rename the files in that order to 1-115.jpg. I also added a string so I could use this script for multiple directories I needed to order like this. You can download the action: Order Photos Automator Action.

To use this Automator Action, first select your photos in the finder, the double click on the Automator Script (after unpacking it from the ZIP). You will need to edit the location to save the copied items to to fit your needs and edit the filename settings if you don’t want _nc in your name.

This script is nothing special or perfect but hopefully it gets you thinking about harnessing Automator to quickly perform menial tasks on your Apple.

Technorati Tags: , ,

del.icio.us:Automator Action to Order Photos digg:Automator Action to Order Photos spurl:Automator Action to Order Photos wists:Automator Action to Order Photos simpy:Automator Action to Order Photos newsvine:Automator Action to Order Photos blinklist:Automator Action to Order Photos furl:Automator Action to Order Photos reddit:Automator Action to Order Photos fark:Automator Action to Order Photos blogmarks:Automator Action to Order Photos Y!:Automator Action to Order Photos smarking:Automator Action to Order Photos magnolia:Automator Action to Order Photos segnalo:Automator Action to Order Photos
Sipe Family News25 Mar 2007 10:57 am

It has been great seeing all of our family again and I am excited they all have gotten to meet Kayla and Steph since they are such a big part of my life. Our trip back to Portland started out well but turned ridiculous. You can view the picture gallery of our trip back to Portland HERE.

Step 1: Return to Charlotte
We again decided to leave early to fit into Kayla’s sleep schedule. The drive home was great. Kayla again did spectacular. We only hit one hiccup when we stumbled upon an accident and what looked like a drug raid on a white SUV with 6 police cars present. Not sure if there was a chase or what but it was quite the site. We stopped in Hickory to eat lunch and met Great Grandpa and Grandma Sipe and Great Great Aunt Virgie at a Cracker Barrel.

We had a great lunch and Great Grandpa had fun feeding Kayla some apple sauce and it was good to get to see them again before we headed home. Kayla also enjoyed rocking in a Cracker Barrel rocking chair outside. Our trip back to Charlotte was uneventful and we got some good sleep at the hotel.

Step 2: Fly to PDX
We woke up bright and early at 5:30 am and had breakfast at the hotel before catching the 7:00 AM shuttle to the airport. We had to wait in a large but not too long of a line before waiting in a really really long security check-in line to get to our terminal. When we arrived at our gate we were not gleeful to see our plane had been delayed for an hour. This was no good because we only had an hour layover in Minneapolis. So …. with the help of a very very nice NW Airlines clerk we were rerouted to a US Airways plane leaving in an hour.

The new flight was not a perfect situation because we were now going to be going through Phoenix which added about two hours to our flight time and would cause us to get into PDX at 4:50PM instead of our original 1:40PM. BUT, we were still going to get home which was the important thing. Stay tuned.

The flight to Phoenix was long but went well. We were all assigned seats in different rows and all in middle seats. This was not ideal with Kayla and we were all stuck in the very very back of the plane. Luckily, a very nice man offered to give up his isle seat to me in-order to help keep our family sitting together. He was 6′4″ and not excited about the middle seat but even more amazingly the guy in the isle in that row offered to switch with him. It all was pretty great to see strangers be so friendly on a plane and it made our flight much more pleasant.

Our layover in Phoenix was pretty long but it gave us a chance to get something to eat. Turns out that Spring Break time is not a great time to fly through Arizona. The crowds were pretty intense. Then things got weird. It started to rain and then hail in Phoenix … yes the middle of the Arizona desert. We thought this was neat and took some pictures but it was deadly to our time-line.

We all boarded the plane and the plane taxied onto the runway. The pilot announced that because of the storm we were 24 in line to take off :( but we would leave shortly… He lied. We proceeded to sit on the runway for the next 3 and 1/2 hours!! With Kayla! This was not fun. Luckily she slept for a bit and we survived until we finally took off. The flight was a bit bumpy but we survived and landed at around 9:00pm … that is 12AM EST which we were on instead of the 1:45pm we were supposed to get in.

It was a really really long day but we survived. Steph went to work the next day and a couple of days later we were finally able to catch up on sleep.

Thanks again to all our family for the fabulous time and we hope to see you all again soon.

del.icio.us:Back Home, an Epic Journey digg:Back Home, an Epic Journey spurl:Back Home, an Epic Journey wists:Back Home, an Epic Journey simpy:Back Home, an Epic Journey newsvine:Back Home, an Epic Journey blinklist:Back Home, an Epic Journey furl:Back Home, an Epic Journey reddit:Back Home, an Epic Journey fark:Back Home, an Epic Journey blogmarks:Back Home, an Epic Journey Y!:Back Home, an Epic Journey smarking:Back Home, an Epic Journey magnolia:Back Home, an Epic Journey segnalo:Back Home, an Epic Journey
Sipe Family News22 Mar 2007 04:38 pm

On Tuesday morning at 5am we left for Lawrenceburg, Indiana where my Mom’s family lives. We left super early so we could keep Kayla on her schedule and sleeping in the car. We made great time and stopped for Breakfast at a Cracker Barrel in Tennessee I think. Kayla enjoyed the break and as always made friends with everybody at the restaurant. We then drove for another couple of hours and stopped at a Truck Stop when Kayla needed to eat again. After that it was straight to Indiana. We made such good time that Steph got the reputation of a speed machine, even though she only drove for 3 hours ;)

After we arrived in Indiana, we checked into our hotel and went over to visit with Uncle Art and Aunt Sue and then with Aunt Wilma at her apartment. We ate dinner at Wiskey’s Family Restaurant and it was really good.

Wednesday was our big day. We went over to Aunt Cheryl’s in the morning and had lunch with her and Angela. We then visited Grandma Folke at her place. That night we had a large family get together at Aunt Sue’s. It was awesome to see all the family again. Pretty much everybody was able to make it and it was great to have everybody meet Kayla and see family I had not seen in 15 years. We are going to try and make it not such a long time before we see them again.

You can now view the picture gallery of our Indiana trip HERE.

del.icio.us:Family Fun in Indiana digg:Family Fun in Indiana spurl:Family Fun in Indiana wists:Family Fun in Indiana simpy:Family Fun in Indiana newsvine:Family Fun in Indiana blinklist:Family Fun in Indiana furl:Family Fun in Indiana reddit:Family Fun in Indiana fark:Family Fun in Indiana blogmarks:Family Fun in Indiana Y!:Family Fun in Indiana smarking:Family Fun in Indiana magnolia:Family Fun in Indiana segnalo:Family Fun in Indiana
Sipe Family News19 Mar 2007 01:54 pm

We had an amazing time at my Grandfather’s 80th birthday party. It was held at the Mt. Zion Lutheran church in Conover, NC and about 200 people attended. Grandpa, who is my namesake Richard Sipe Sr., is well loved by the entire community and state of North Carolina. He helped to build the church and fellowship hall, a couple of fire stations, many houses around North Carolina when he was a stone mason and is really involved in the community and the church. He received an award from the governor of NC this weekend and it was very special.

Tomorrow we will be driving the 500 miles to Lawrenceburg, Indiana to visit my mom’s family. I had not been back to Conover, NC in about 12 years and it has been more like 17 since I have been to Indiana to visit my mom’s family. This will be the first time they will be meeting Steph and Kayla so we are really excited to see everybody. Maybe not so excited to drive the distance with an infant but ti will be worth it.

You can view the pictures of the 80th birthday party and the rest of our trip at our picture gallery. It was such a great trip and we took so many photos that I had to spread them out over galleries so make sure you check multiple pages.

del.icio.us:Happy Birthday Grandpa. Now off to Indiana digg:Happy Birthday Grandpa. Now off to Indiana spurl:Happy Birthday Grandpa. Now off to Indiana wists:Happy Birthday Grandpa. Now off to Indiana simpy:Happy Birthday Grandpa. Now off to Indiana newsvine:Happy Birthday Grandpa. Now off to Indiana blinklist:Happy Birthday Grandpa. Now off to Indiana furl:Happy Birthday Grandpa. Now off to Indiana reddit:Happy Birthday Grandpa. Now off to Indiana fark:Happy Birthday Grandpa. Now off to Indiana blogmarks:Happy Birthday Grandpa. Now off to Indiana Y!:Happy Birthday Grandpa. Now off to Indiana smarking:Happy Birthday Grandpa. Now off to Indiana magnolia:Happy Birthday Grandpa. Now off to Indiana segnalo:Happy Birthday Grandpa. Now off to Indiana
Technology19 Mar 2007 09:40 am

twittervision.com
The same people who brought us twittermap now have a beta (just to be hip I suppose) called twittervision which again is a Google Maps mashup but this time as a real time twitter tracking of sorts. It displays the last 20 twitters on a map with their location and message. The delay gives you just enough time to read before popping onto the next one. It zooms the map into the location so you find your self virtually flying around the map following the flow of twitters.

Its fun in mostly a fun voyeur kind of exercise but it is, as twiter is, very entrancing. I especially like when it pops over to Denmark and you understand nothing or when you get an @ message and have no idea what the rest of the conversation was.

If you haven’t given twitter a shot yet sign up at twitter.com and add me @ richsipe to get on your way.

Technorati Tags: , ,

del.icio.us:Twittervision: Stalking made easy and fun! digg:Twittervision: Stalking made easy and fun! spurl:Twittervision: Stalking made easy and fun! wists:Twittervision: Stalking made easy and fun! simpy:Twittervision: Stalking made easy and fun! newsvine:Twittervision: Stalking made easy and fun! blinklist:Twittervision: Stalking made easy and fun! furl:Twittervision: Stalking made easy and fun! reddit:Twittervision: Stalking made easy and fun! fark:Twittervision: Stalking made easy and fun! blogmarks:Twittervision: Stalking made easy and fun! Y!:Twittervision: Stalking made easy and fun! smarking:Twittervision: Stalking made easy and fun! magnolia:Twittervision: Stalking made easy and fun! segnalo:Twittervision: Stalking made easy and fun!
Sipe Family News16 Mar 2007 12:07 pm

We are currently at a my Grandfather Richard Sipe’s 80th birthday celebration. The party is on Saturday and we are looking forward to a fun time. Kayla was just awesome on the long plane ride from Portland, OR and the short drive from Charlotte to Conover, NC. We have people coming in from many states for this and I will be seeing the family for the first time in 12 years! The extended family will be meeting Kayla for the first time and we are excited they get to love her too.

After the celebration in North Carolina, we will be driving 400 miles north to Lawrenceburg, Indiana to visit my mom’s family. We will have a bit of a reunion and dinner there on Tuesday then drive back 400 miles to Charlotte on Wednesday and fly back home on Thursday.

We will post tons of pictures and maybe some video once we return home. If you were at either of these shin-digs and have pictures we would love to have copies of them. Just email me and we will get you our address.

del.icio.us:Sipe Family Reuinon in North Carolina digg:Sipe Family Reuinon in North Carolina spurl:Sipe Family Reuinon in North Carolina wists:Sipe Family Reuinon in North Carolina simpy:Sipe Family Reuinon in North Carolina newsvine:Sipe Family Reuinon in North Carolina blinklist:Sipe Family Reuinon in North Carolina furl:Sipe Family Reuinon in North Carolina reddit:Sipe Family Reuinon in North Carolina fark:Sipe Family Reuinon in North Carolina blogmarks:Sipe Family Reuinon in North Carolina Y!:Sipe Family Reuinon in North Carolina smarking:Sipe Family Reuinon in North Carolina magnolia:Sipe Family Reuinon in North Carolina segnalo:Sipe Family Reuinon in North Carolina
Technology14 Mar 2007 09:30 am

TwitterMap: Twitter and Google Maps Mashup

A fancy Web 2.0 Mash-Up created using Twitter’s public feed and the Google Maps API that shows twitters on a map along with their most recent update. You can search by Twitter name or map location. Also supports setting your location in your updates: Example: ‘Going to the office. l:3000 6th Ave, New York’ so you can update your location whenever.

This is a pretty sweet way to visualize the Twitter community and also find people in your area to Twitter@. The update your location feature is equally awesome and the refresh is pretty instant because twittermap is pulling from the Twitter RSS feed. The only thing to note is it removes the location text after and including the L: as you can see in the screenshot above.

read more | digg story

Technorati Tags: , ,

del.icio.us:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map digg:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map spurl:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map wists:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map simpy:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map newsvine:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map blinklist:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map furl:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map reddit:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map fark:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map blogmarks:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map Y!:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map smarking:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map magnolia:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map segnalo:Sweet Twitter GoogleMaps Mashup -- See all Twitters on the map
Technology12 Mar 2007 12:05 pm

My website is powered by WordPress and includes a combination of family updates, pictures, and technology blog posts. The issue I have to address is my family who come to the website for pictures and family news don’t want to necessarily read the technology posts and vise versa the tech folks don’t care as much how our recent vacation went ;) My home page I set up to be mostly for family and friends because most of the tech readers come through Google into specific posts or through the RSS feed they have subscribed to.

Along those same lines, I wanted to monetize my technology posts while not subjecting my friends and family to AdSense ads that Google has pulled from our family vacation text! Here is how I did it.

To display AdSense ads in WordPress for posts that are in specific categories:
1 ) Download this Code: WordPress PHP Code to Display AdSense by Category
2 ) Change the AdSense code to yours under where it says Change This.
3 ) Change the Category to your own where it says $cat->cat_name == "Technology"

Note: You could also add multiple categories here using an OR (||) operator. IE: ($cat->cat_name == "Technology" || $cat->cat_name == "Hardware")

4 ) Log Into your WordPress site admin Section
5 ) Click on the Presentation Button and select Theme Editor
6 ) Click on the Single Post file (will be single.php) in your template

Note: You could use this code on any page that includes the WordPress loop where you would like to display AdSense ads.

7 ) Add the code you copied and edited above to where you would like the AdSense ads to appear
8 ) Save this page and view a post to see if it works.

Technorati Tags: ,

del.icio.us:WordPress Display AdSense Ads for Specific Categories digg:WordPress Display AdSense Ads for Specific Categories spurl:WordPress Display AdSense Ads for Specific Categories wists:WordPress Display AdSense Ads for Specific Categories simpy:WordPress Display AdSense Ads for Specific Categories newsvine:WordPress Display AdSense Ads for Specific Categories blinklist:WordPress Display AdSense Ads for Specific Categories furl:WordPress Display AdSense Ads for Specific Categories reddit:WordPress Display AdSense Ads for Specific Categories fark:WordPress Display AdSense Ads for Specific Categories blogmarks:WordPress Display AdSense Ads for Specific Categories Y!:WordPress Display AdSense Ads for Specific Categories smarking:WordPress Display AdSense Ads for Specific Categories magnolia:WordPress Display AdSense Ads for Specific Categories segnalo:WordPress Display AdSense Ads for Specific Categories
Technology12 Mar 2007 11:23 am

follow richsipe at http://twitter.com

Well I am not sure exactly why but I am up and running on Twitter. Twitter has been described as micro blogging and is kind of a running conversation. I think it was developed with the thought that it would be a running discussion on what you were doing and had going on. IE: Got up, Eating Yogurt, Working, Blogging, etc. I think it has and will continue to morph into a broad spectrum chat and a platform to broadcast needs or thoughts. I feel into it from a blog post I read via digg but it looks like Twitter is getting a ton of buzz at the SXSW conference this week in Austin, TX. Anyways look me up on twitter, my userid is richsipe.

del.icio.us:Twitter? Twhy? Twhynot. digg:Twitter? Twhy? Twhynot. spurl:Twitter? Twhy? Twhynot. wists:Twitter? Twhy? Twhynot. simpy:Twitter? Twhy? Twhynot. newsvine:Twitter? Twhy? Twhynot. blinklist:Twitter? Twhy? Twhynot. furl:Twitter? Twhy? Twhynot. reddit:Twitter? Twhy? Twhynot. fark:Twitter? Twhy? Twhynot. blogmarks:Twitter? Twhy? Twhynot. Y!:Twitter? Twhy? Twhynot. smarking:Twitter? Twhy? Twhynot. magnolia:Twitter? Twhy? Twhynot. segnalo:Twitter? Twhy? Twhynot.