I have been working on a project and ran into some issues with Drupal and it’s db_query() function.  The problem arises when using MySQL LIKE queries.  db_query() automatically replaces certain strings using the % character.  For example, %s will be replaced by one of the parameters in db_query().  So a query like this

SELECT * FROM table WHERE column LIKE ‘%someword%’

will have the %s replaced.  db_query() uses the following parameters.

db_query(sql string, replacement, replacement, replacement….)

I kept reading articles telling me to leave out the replacement parameters and no replacements will take place.  So I did this and sent the file to the server.  After testing and believing everything was working perfectly, several days later, CRASH!  A search string caused no results to appear when there should have been results.  I printed the query and ran it directly in the server.  It pulled the results. *scratch my head*  The query contained a word that created one of the replacement patterns like %s.  For example, look at the query above.  The search string some word creates %s.  Apparently, Drupal will try to replace these combinations, even though there is nothing to replace them with. WAAAA???  That doesn’t make sense.  After further research, I found that you must escape a % with a % in a Drupal query.  So the above query would need to be:

SELECT * FROM table WHERE column LIKE ‘%%somecolumn%%’

Hopefully, this entry will save others time and confusion.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Linux permissions

I don’t use Linux commands very much.  Filezilla does pretty much everything I would need to do.  But every once in a while there are some commands I need to use.  This is just a list for my reference.  For some reason, I have trouble finding examples of the uses of these commands.  I can always find definitions and vague explanations of the usage.  But not many good examples for my situations.

Change Entire Directory Permissions

chmod -R 0775 /directory/

-R is the recursion option.  0775 is the permissions values.  And /directory/ is, of course, the directory path.

List out files with details

ls -l

-l is the details option for viewing permissions and such.

Switch User

su – user

-user is the user to switch to.  Leave blank to switch to the root user.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Photoshop Stuck On Hand

I’m posting this for my future reference but maybe someone else will find it useful.  On several occasions, I’ve been working on a Photoshop CS3 project and the pointer acts up.  It turns into the hand tool.  Then, it does not allow switching between other tools.  I restarted Photoshop… still the same issue.  Then, I went to Window->Workspace->Default Workspace.  Presto!  The tool icon fixed itself.  It must be some sort of memory issue.  An odd and rare occurrence, but after the third time, I guess it was time to write down the solution to the problem… :)

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Broke The Karaoke Cherry

There was not much in the plan today.  The plan was to climb to the top of the volcano but crappy weather told us NOOOOOO!  We went driving around and stopped by the mall.  We walked around and played some Pachinko.  Pachinko is their form of a highly advanced arcade.  There are the little coin games where coins drop off the ledge to card games.  The card games allow you to bring a deck of cards in and virtually play the card game.  You can virtually emulate card games like Magic the Gathering.  Pretty cool stuff.

I had Pepper Lunch for lunch.  It was a hot plate that cooked in front of you.  Rice, corn, parsley or something and steak.  MMMMM gooodness.  Ordering the food was a different experience.  You use a vending machine to choose your dish and pay.  Then, you give the clerk your ticket and they produce the order.  I was starting to get pretty good with chop sticks.  I am starting to prefer chop sticks to the standard silverware we use.

There are toys and Disney memorabilia everywhere in the mall.  The Japanese really like their animation.  I am still amazed at the trust.  I could walk by any store and easily swipe inventory.  There is virtually no crime in Japan.  I still had not seen a cop driving around Misawa yet.  Quite a difference from the States where there is a cop on every corner of a city.

Later, we went to the language center.  I made some new friends and helped some people practice English.  One girl brought some sort of rice ball cake doohickey.  It was pretty good if you could get past the chewey, stretchy, rice exterior.  The exterior was like eating a rubber band.  The interior was absolutely delicious.

After the language group, a bunch of us went to some traditional Japanese restaurant.  You had take off your shoes and sit on the floor.  This does not work for me.  I am made of bones and do not bend like Stretch Armstrong.  It was kind of painful to sit there.  I had some sort of noodle dish that was pretty delectable.  One of the girls mentioned there were already rumors going around about me.  Great!  One week there and already people are talking… The only thing I found out was that everyone thought “Adam’s younger brother came to visit him in Japan.”  HAHAHA!  He’s 23 and I’m 25.  HAHAHA!

Next was Karaoke.  It was an interesting experience.  The room started off with just a few of us.  We passed the mic back and forth and sang some good old tunes.  Then, a bunch of other friends should up and the room was packed.  The Japanese really love their karaoke.  If you want to know what it is like then watch Lost In Translation.  The experience is pretty much the same.  Small room, alcohol, tv, singing…

This was the last night in Misawa.  I made a lot of great friends and experiences.  I will miss them.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Today we went to the Aquarium in Aomori.  It was your standard aquarium with fish… lots of fish.  But they had some huge sea turtles, deep sea specimens, a giant squid, dolphins, otters and seals.  There was a dolphin show.  I didn’t understand a thing about the show but it was kind of cool.  There was a giant cartoon fish that I had to take a photo with.  Everything is cartoon over here.  We left the aquarium to head back to the house.

Across the street we noticed a shrine gate and decided to go up.  It looked like the steps went over the mountain and possibly overlooked the bay.  It did.  One thing about visiting shrines in Japan… you will lose weight.  And I have no weight to lose on the hundreds of steps we have climbed.  There were several tori gates and shrines along the path.  On the other side, you could see most of the bay.  There was an island in the middle which had a random tori gate on it.  It would probably be cool to take a boat over and see what was up there.  The beach was not made of sand.  It was built up with fist sized stones, all eroded into smooth shapes.  We did the normal climbing around rocks and such.  Then headed back to Misawa.

In Misawa, we grabbed food at Burg Burg.  Some sort of Japanese burger joint.  I had sake.  The best I’ve ever tasted.  Yummy in my bellaaa!  Main course was ginger pork.  I am not a big fan of ginger and do not really eat pork, but it was quite delectable.  They provided forks, spoons etc.  It appeared many Americans from the base ate there.  I still used chop sticks.  For some odd reason, I prefer chop sticks to regular utensils now.  At the house we played video games and drank the $4.00 Suntory whiskey we bought out of curiosity.  It was Japanese whiskey.  Anybody would’ve done the same thing.  Should’ve known better.  Cheap alcohol is never good alcohol.  Everybody almost spit their shots into the sink.  Good times.

I also learned some Japanese.  Just writing for my own practice.

doko – where

itsu – when

nan / nani – what

dou – how

dou shite – why

ego ga hanasemas ka? – Do you speak english

anatano namae des ka? – What is your name?

genki des ka? – how are you

ohayo gozaimas – good morning

konnichiwa -good day

kombanwa – good evening

Nihongo ga sukoshi hanasemas. – I speak little japanese

sumimasen – excuse me

daijobu – ok

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Big Buddha

Today started out with a few movies.  We watched The Losers, Alice in Wonderland and a few others.  Very good flicks.  Then we headed out to Aomori to see the Buddha temple.  You can see part of the Buddha’s head from the road.  It sits off in the mountains and is mostly hidden by the forest.  There are several traditional style japanese buildings.  The really cool architecture.  The temple was not ancient.  It was built sometime in the 1980’s.  The Buddha was ginormous!  There were probably a hundred different statues around the temple.  You could also walk inside the Buddha.  There was some sort of setup based on the zodiac inside.  Did not figure out what.  We were the only ones there due to the rain, so we could not ask anyone.  When you walk into the Buddha, the energy instantly raises.  Something I would expect from a site like this.  We walked around the grounds and looked at the different buildings.  Then, headed home.

Today I ate at Suikara or something.  It’s japanese fast food.  A Yakitori Bowl which contains rice, chicken, sauce and seaweed.  Seaweed should stay in the sea where it belongs.  Everything else was pretty good.

Later, we headed to the language exchange center.  People meet there to practice English and Japanese.  It was fun.  I met some interesting people.  Everyone was very friendly.  We headed back.  Maki came over to grade papers and hang out.  We watched a movie and played video games.  Nothing too special today.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Top Ramen… No Biscuit For You!

Today we headed out to Lake Towada and Oirase Gorge.  Oirase Gorge has hundreds of waterfalls.  Seeing how it just rained we were excited to see the powerful falls.  We arrived and walked the trail.  The first thing we saw was a stone hut.   A large boulder sat on top of others creating a small, hut like structure.  Apparently, a woman lived there at one point.  She would attack travelers and steal their belongings.  One mean lady.  The falls were beautiful.  They were everywhere.  Creating nice serene meditative scenes.  I can’t really describe it and the photos do not do any justice.  The best way to put it is this:  it was more beautiful than the stupid Niagra Falls that everyone is so interested in.  Why?  These may be smaller but are in nature, not the loud, obnoxious city.  It is a much more serene, natural scene.

After the falls, we headed to Lake Towada.  Lake Towada feeds Oirase Gorge.  It is a caldera lake over 1000 feet deep.  The water was beautiful.  It was crystal clear in the shallows and deep blue as the water became deeper.  There were shrines everywhere.  Different types: stones, papers, boards… We walked the trails up the mountain to some of the shrines.  The steps up the mountain varied in build.  Some were stone, some wood and others were metal ladders.  There were several ladders that had to be climbed for 50 feet or more.  They were pretty rickety.  Some had loose screws and they just looked old in general.  Makes one nervous.  But it was worth seeing the shrines and views of the lake.  We stopped at a little shop in Towada and bought some Japanese snacks.  I picked up a tea.  It is definitely an acquired taste.  I think the tea was steeped in rice water, which just isn’t my thing.

For lunch we stopped at a Japanese ramen shop.  It was bar style and you could watch the cooks.  I ordered ramen in miso soup with spring onions and spice.  It was awesome.  Chop sticks make the whole experience interesting.  If you like Top Ramen, you need to try traditional ramen.  Then, you will want to bang your head against a wall whenever you see a top ramen or similar product.  NO BISCUIT FOR YOU FAKE RAMEN!

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Falling Off A Mountain

A recap of yesterday’s events.  We woke up early and packed the hiking gear.  Unfortunately, it was starting to rain but what the hey.  We left anyways.  We headed to a mountain somewhere near Aomori.  I was hoping to hike to the peak and walk inside the volcano crater.  It was a few hours before we arrived at the mountain.  When we got there, the lift to the trail was closed due to weather conditions.  We looked at how high the lift went.  Oh well, we hiked up the mountain without a trail.  There was something resembling an animal trail which we ended up following.  It was probably frequented by cougars or the giant bunnies.  I fear the giant bunnies more than the cougars.  Japanese bunnies are larger than dogs and will eat your face off!  There were several bunny beds along the trail.  It was littered with bunny scat.  Big, mean bunny scat!  Even Master Chief had to point out the scat and be like OMG!

OMG! GIANT BUNNY POO!

We continued the Indiana Jones adventure.  The trail followed the lift wires and pipes up the steep mountain.  At one point, we had to shimmy across poles above a creek.  The jungle was beautiful. Hiking up the mountain, you are hiking through some of the densest vegetation.  I could have used a nice sized machete to help clear a path.  Not the type of trails you hike back in Ohio.  The view, what I could see, was pretty awesome.  It was raining and foggy so much of the view was hindered.  It probably would have been best at the mountain top, but the weather conditions were becoming quite brutal.

The trail was long and hard but soon we saw the lift building.  Maybe a 1/2 mile away, probably less.  Then, we hit snow.  To climb the snow I had to use my fingers as spikes.  I dug into the snow for traction, crawled and pulled my way up the embankments hoping not to fall.  After a certain point, we called it quits.  The mountain side was just to steep and we didn’t have the equipment to continue through the snow.  If you see the photos, they do not do the steepness of the mountain justice.  We were literally crawling on hands and knees.  You could not stand.  If you did, you would fall and become cougar food.  To get down the snow embankments, we butt surfed.  For a time we slid down the mountain on our bums… our bums.  Then, we were able to stand and continue down.  Somehow I rolled my ankle on the trip down.  Oh well.  We returned to the creek to Indiana Jones across it.  I stopped and drank some of the mountain water.  The creek is fed by a melting glacier.  Talk about the best tasting water ever.  Straight from the gods and goddesses themselves.  Mmmmmmm, glazier water.  Dasani and Aquafina have no game.

We made it down the mountain soaked.  It was as if we had been swimming.  Then headed home.  Not much else happened.  Watched a few movies, passed out…

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Swept out to sea!

After the journey back from Akita, I tried to get some sleep.  A good ol’ hours worth.  Then, we left to get McDonalds.  Most know I am absolutely no fan of fast food.  I despise it with every ounce of my being.  But when you are hungry, have little time, and are in a foreign country you take what you can get.  Fast food tastes better here anyway.  It does not taste all greasy.  They also give you smaller portions.  Actually, everything is in smaller portions.  Even the soda cans.  I believe they are 8oz soda cans rather than 12oz.  After McDonalds, we head to Sega World, a pachinko parlor, to pick up Maki.  Maki is one of Duke’s friends from the language center.  She was very cool.  We went down to some beach where there were massive cliff formations.  It was absolutely beautiful.  Freezing cold but beautiful.

At the first stop we grabbed photos.  Hogan had bought a kite so he flew that.  It flew well.  After a few crash landings we switched to soccer and walking.  I talked to Maki about Japan.  She had been to New Zealand at one time.  Another country on my list of to dos.  Then we headed to the next beach.  The next beach was cooler.  You could easily get to the rock formations and climb them out into the sea.  First, I should mention the weather conditions.  It is very windy so the waves are crashing.  The tide is starting to come in.  Rain is also on it’s way.  Not the best of weather conditions.  We climb the rocks.  I mention it would be cool to get out on the last rock and get photos.  Duke holds the camera while I climb out towards the sea.  I had to time my jumps between rocks just right.  Otherwise, the waves would have hit shore and most likely drug me out.  All good fun.  Spider man, spider man, does whatever a spider can!

Afterwards, we went to a giant thrift shop.  Not much to say there.  Then, dropped Maki off at her car and headed home.  We decided to hit the malls.  It still surprises me how trustworthy this culture is.  Everything is out in the open.  A thief paradise.  When talking to Prince, he had mentioned they have very low crime rates because of the peaceful mentality.  Malls are not really anything special.  Same as back home.  People just walking around and hanging out.  This culture has definitely surpassed America with censorship.  They understand that the human body is just that.  That any concept which is negative is only negative because you think it is.  In America, the stores in the Japanese malls would have been sued for every dime by some podunk mom who wants the government to do their parenting for them.  Japanese stores sell items with nudity, sex, grotesque violence and random wierd stuff.  These are stores open to everyone in the malls.  Most would say “That’s disgusting.”  My response is this.  Japan is one of the most peaceful, patient, friendly cultures in the world.  They have one of the lowest crime rates.  So, why are other cultures not following by Japan’s example.  An example which actually works toward achieving peace, freedom, non-violence…  I could go on but that’s not for this entry.

After the malls, we came back and watched Youth In Revolt with Michael Cera.  It is pretty good and features other good actors such as Fred Willard, Zach Galifianakis, Justin Long, Ray Liotta, Steve Buscemi…. Then, The Book of Eli with Denzel Washington.  It was pretty good.  Not what I expected.

Tomorrow, we are going to try and hike the mountains if the stupid weather doesn’t give us problems.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter

Land of the Beautiful

Saturday we headed to Akita.  It is a city on the west side of Japan.  The drive was long, but the scenic view was beautiful.  We past through the mountain ranges.  They are the first young mountains I have ever seen.  You could count the Appalachians but they are more like hills than mountains.

Akita is a beautiful city.  There were flowers in bloom everywhere.  Senshu park has an old castle and gardens galore.  The Flickr photo gallery for day 2 shows these scenes.  Akita is a place off the beaten path.  Foreigners are a rare site.  Unlike Misawa or Tokyo where the people see foreigners daily.  In Japan, people stare at you with inquisitive minds.  Some probably seeing a white person for the first time.  But they are very friendly people.  We walked around most of the day.  Booked rooms at Castle Hotel.  The rooms were small, but at least it was not a pod hotel.  I’ve seen photos of those places.   Talk about claustrophobia.

Ate lunch at the hotel and then passed out.  Afterwards, we walked around the town some more.  Took pictures with some cool statues.  Even an Obama statue.  ROFL!  Randomly, we found a statue of Obama out in the streets.  We had to mess with it.  For dinner, we went to a curry restaurant and had Japanese curry.  Quite tasty.  There were some Japanese girls that the others already knew.  One gave us free beer.  :) Then, we headed down to the club district.

Club AK didn’t open until ten so we continued walking around.  We found an alley with a bar called Kuru Friendly.  What the hell, we walked in.  It was my kind of place.  A high class, clean professional bar.  The bartender was a bartender gold medalist in some competition.  He was freakin’ awesome.  As he was pouring our drinks, he was talking in Japanese.  Of course, we just go “Yea, Yea WOO!”  Apparently, he was asking if we wanted oden, a japanese dish.  The other bartender served us.  I had trouble with the chopsticks.  But kind of figured it out.  Oden is not very good and doesn’t taste like much of anything.  The brown, tubular piece looked like something from a squid or octopus.  It was in fact a fish paste of some sort.  There was a white triangle that looked similar to a pear cut.  It tasted like absolutely nothing.  There was literally no taste, none.  Then the circular thing was just freakin’ nasty.  But at least I can say I tried it.  We talked to the bartenders for a while.  They were both very friendly and interested in why we were in Japan.  We asked another customer to take some photos of us with the bartenders.

Next we headed to the club.  There were few people there.  Started off drinking red bull and vodka.  It was the only thing on the menu that had a good english translation.  The club was uber loud.  Beyond what I like.  But there was a smoking area and outside rooms where we talked most of the time.  The club slowly filled with people.  Not a single unattractive Japanese women was present.  On that note, I have seen very few unattractive woman when we have gone out.  In America, there is quite a mixture of attractiveness.  But Japan and Montreal are very different.  It is partially due to the areas of Japan that I have visited.   I know very few Japanese sentences which caused a great language barrier at the club.  However, I was wearing a t-shirt that said “Watashi ni kisu shite.”  It means kiss me.  :)   It worked from time to time.  The difficulty of the language barrier persisted.  Some of the girls we had already met  and they spoke english.  When they left, it was pretty much game over.  After a few hours, we met Prince, a Japanese fellow interested in practicing his English.  I sat and talked to him for a while.  He had been all over India, Ireland, Germany…  We talked “politics” for a while and he translated for his friend.  Then he helped translate for some of the other girls.  It was good times.  The Japanese guys seem to be very friendly.  Unlike Americans at a club, the Japanese won’t club you for talking to the girls.  They were probably afraid of us more than anything.  There were a couple of reggae artists on stage.  By 5am the club was still rockin’.  They don’t stop.  I left out of shear exhaustion.  Adam was like “Grab a cab.”  But what do I do?  The opposite.  Adventure time.

I knew the approximate direction of the hotel, so I started walking.  An hour or so later I found it.  After passing it several times.  I also had to stop a few Japanese and ask for directions.  They are very shy and sometimes ignore you.  Some are afraid of foreigners.  But one elderly paper man pointed me the right direction.  Then, of course, I passed it because I only understood have of what he said, even though he spoke good English.  Later, an elderly guy was walking his schnauzer.  I stopped and asked him.  He spoke absolutely no English but walked with me a block or two until we both understood each other through hand gestures and simple terms.  Interesting experience.  I went back to the hotel room, passed out and woke up a half hour later.  The others called ready to head back.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • PDF
  • StumbleUpon
  • Technorati
  • Twitter