Friday, January 28, 2011

developer.apple.com = Chrome Fail

Over the last month or so I've been dabbling in build an iPhone application.  After taking my testing as far as I could on the simulator, I wanted to install it on my phone and give it a whirl.... let the frustrations begin.

So, I get a developer account with Apple and go through all the steps to get a certificate, except the stupid website would not accept the Certificate Signing Request that was generated thanks to their instructions.  I tried it over and over, and generated and re-generated the CSR all to no avail. 

I submitted a help ticket to their support website and they didn't get back to me for a week.  When they did finally get back to me they recommended that I clear the browser cache and try again!  Are you serious Apple?  This is DEVELOPER support, you can't give me better help than that?

Ater clearing the cache and going through the whole process again, and once again failing, I wondered if it would work on a different browser (I was using Chrome).  I brought up Safari, submitted the same CSR file, and it worked like a dream.  So I guess they don't support Chrome, but neglect to say so.

Thanks a bunch Apple.

Tuesday, October 5, 2010

Terminal Prompt Coloring and Line-Wrap Issues

The other day I was look scrolling back through my terminal window and needed to be able to pick out the prompts so I could differentiate output from different commands.  So I edited my ~/.profile file and added this to the bottom:

export PS1="[\e[36m\u\e[33m@\e[32m\W\e[0m]\e[32m > \e[0m"

To give me a prompt that looks like:



However, whenever I would use a command that was longer than the line, and it needed to wrap, the formatting would get all funky and the terminal wouldn't correctly represent either the command that I had entered or the position of the cursor.

I asked a colleague of mine about it and he suggested that it was because of the coloring of the prompt and that the non-printable characters (the ones that are for coloring) caused the line editor to display incorrectly. So I researched it further to realize that my PS1 string was missing the non-printable character string delimiters: \[ ... \]

So I edited my PS1 variable, wrapping all non-printing characters with \[ and \]

export PS1="[\[\e[36m\]\u\[\e[33m\]@\[\e[32m\]\W\[\e[0m\]]\[\e[32m\] > \[\e[0m\]"


and PRESTO line wrapping issues are gone!

So, remember: if you ever see weirdness in the terminal formatting check out your prompt definition first!

For a decent guide to creating a nice prompt check out Prompt Magic.

Thursday, September 9, 2010

Environment/Resource problems with Tomcat 7 in Eclipse

When developing JEE applications it is common practice (and very good practice in my humble opinion) to read in environment specific configurations from the container via JNDI.  Up until today I used Tomcat 6 with Eclipse and WST to develop on my local box.  I would edit the server.xml file to add my environment variables and my container managed database connections. The result looks somelthing like this:

...
<resource auth="Container" 
   driverclassname="com.mysql.jdbc.Driver"
   maxactive="100" maxidle="30"
   maxwait="10000" name="jdbc/mydb"
   password="root" type="javax.sql.DataSource"
   url="jdbc:mysql://localhost/mydb?autoReconnect=true"
   username="" validationquery="SELECT 1;" />
<environment name="var1" 
   type="java.lang.String" value="foo"/>
<environment name="var2" 
   type="java.lang.String" value="bar"/>
...

Today, I tried to move to using Tomcat 7--not for any particular reason except that I like to stay up on using the latest and greatest and since 7 > 6 it must be the latest; it remains to be seen whether or not it is the greatest.

When I tried to start using Tomcat 7 for local development I started by using the same setup I used for Tomcat 6 above. Everything looked good except that when I would try to start the server from the Servers tab, I would get weird NullPointerExceptions that had no apparent reason.






I tried taking the Resource and Environment stuff out of server.xml and the server would start up like a charm (except all the errors that it would throw because of my missing environment variables).

The fix is to double-click the Tomcat 7 server in the Servers tab and check the box next to Publish module contexts to separate XML files in the Server Options section.










Apparently, the startup order has changed between Tomcat 6 and Tomcat 7 causing some unhappiness.  I found the solution at the Eclipse Community Forum.

Friday, November 14, 2008

To Shame the Wise

Lately, I have been trudging through a lot of difficulties in the way that I think and act. These habits, even though having been helpful in the past, are now decidedly poisonous. They are completely incompatible with having any kind of deep relationship--and it is because of a relationship that all of these septic, cantankerous approaches to life have come to my attention. It had previously occurred to me that I was not the smartest person on earth, but I didn't believe it...that was my mistake.

Whatever I think or feel is true, right?
Whatever my mind and senses can interpret as reality--is reality, right?

Well, that strategy has worked well getting me through school, getting a job and being decently competant in that regard but what about the people that I want to get close with...? It doesn't work at all. I can't deduce; I can't strategize; I can't investigate and come to logical conclusion; I can't... This realization has left me at a loss...but that is when Jesus steps in.

When there is less of me there is more of Him. I am all about having Him replace the parts of me that are causing the pain, frustration, and doubt of these last couple months. I am learning that I have to take His word, and believe it, and act on it. It doesn't make sense to me but the things that have made sense don't work...so now I am left with believing in the things that are nonsense. He uses the foolish things to shame the wise...

Friday, July 25, 2008

Food Coma

As many, many before me have done, I suffer from the constant torment of Post-prandial somnolence -- Commonly called "Food Coma." If you haven't experienced this disastrous condition consider yourself lucky. To what shall I compare the effects of food coma?

Think of your brain as a highly precise instrument (even if yours is not); like a surgeon's scalpel. Now, take that scalpel with it's infinitely sharp edge and point and walk out to the side walk, and grind down it's refined edge until it resembles a butter knife fallen into the garbage disposal.
Next, take the scalpel and run it over with a dump truck, so that the handle is bent and jagged.
To top it off, go swirl the toilet water of your favorite public restroom with the--now unrecognizable-- scalpel.
Give it back to the surgeon and ask them to perform any type of surgery. You will see that not only will they not be able to perform but they will also irrevocably contaminate anything that has been touched by the scalpel.

I kid you not, whenever it decides to kick in, my brain no longer functions. It is as if someone opened up my scalp and poured gravy all over it. My vision gets blurry, I can't think straight and I feel as though I would murder someone for a cot and pillow. Just think Kevin James' impression of himself after eating a Big-Mac.

If you would like to experience my pain simply follow these rules:
  1. Get less than adequate sleep
  2. Eat a moderate to large lunch with lots of carbohydrates.
  3. Sit back and wait for your productivity and IQ to plummet.
I sincerely hope that you are not one of the throng of people who suffer under the affliction but if you are just think..."At least Jonathan gets it worse!"


Now time for Q&A

Q: Since you seem to be an expert on "Food Coma" how can we recognize the signs of
Post-prandial somnolence in others?
A: Two things should give away: 1) A blank or spacey look on their face combined with slow verbal and physical response to stimulae 2) Excesses of drool--beyond any normal drooling the subject might be prone to.

Q: Ok, now I'm scared of becoming a brainless zombie! What can I do to prevent this from happening to me?
A: Now, don't freak out...Usually the condition only lasts for about an hour or two. So, even if you do fall pray, you may still survive to live a long and productive life...maybe. To completely avoid the situation I would suggest not eating. Yes, thats right. Don't eat.

Q: Wait a second, how can you--the lover of all things edible--recommend that as a course of action?
A: Well, I didn't say that I actually follow my own advice. You will find that people all across the globe know of this solution but choose not to take it.

Q: But Why?
A: The bottom line is, people are weak. They love food, and they have very bad memories. When I see a nice juicy hamburger in front on me I am not thinking about how I will not be able to function afterward--no, I am thinking about how good it is going to taste; about how crunchy the pickles, how sweet the tomatoes...

Q: Where are you going?
A: Check your watch! It's lunch time...

Thursday, July 17, 2008

The Journey Home

So, I currently reside just past Scotts Valley off Hwy17. My living situation is most agreeable... It is still close to Santa Cruz, but it is also close to San Jose, where I have to drive (or ride) to work.

I live with a family of people that I love, whom I laugh, enjoy, and have fun with. In my relaxing time I can lay by--or in-- the pool that is about 50 meters from my bed. From the tip of the driveway I am able to see all the way to big sir (about 30 miles) and the ocean. "The Ranch" is a place that lots of people from our church come to spend a day of fun, and I get to live there!

Jesus loves me.

Here's the rub...
They decided to re-pave the whole driveway. Since the driveway is the only access to the house, this is a very big deal. No one can drive into the part of the ranch that we live in.

Now, of course I knew that this was going to be happening...but did not plan well for it. When I was told all this I decided that I would just park my motorbike for the week and just use my car. After all, a car is much more handybthan the bike and it wouldn't hurt to have it. Come Monday morning ( the day they started ripping up the asphalt) I was awoken by a giant machine tearing up the road, and I hadn't gotten the car out yet....there is no way for a car to get out. Luckily I had my motorcycle and I could just barely scoot by the monster.

Now we have no direct access to the house...

Instead we drive another two miles down the road to where there is another entrance to the actual "ranch" part. From there drive up a pretty beaten up (partly dirt) road to where I can park. This part of the adventure gets really interesting because I drive a motorcycle and my bike is really not meant for any kind of bumps or dirt. Just picture how funny I must look driving up that road losing traction and swerving everywhere.

After I park I then have to transfer myself into a glorified gold cart and ride another mile or so up dirt trails to the house. This acutally ends up being really fun but it makes getting home really difficult.

So, if you are having a lousy day just remember that at least you have a driveway.

Posted with LifeCast

Tuesday, July 15, 2008

iPhone Day

Last Friday, July 11, will now forever be known as iPhone day. The much anticipated (at least by myself and a few, nose tap, others) release of Apple's newest gadget was met by my brother (Jesse), a friend of mine (Bilbo Passerino) and myself driving to the Los Gatos Apple store to wait for our new prize. Not having any idea of what the line would look like we decided to show up a little before the store opened at 8am.

Upon arrival, we saw that there were a measly 200 people in front of us. Doing the math, we decided that they would probably have about 20 salespeople helping customers purchase their iPhones. We thought that going through the process to buy a phone shouldn't take longer than 10 minutes, so if they stayed on that schedule, they would average about 30 seconds per customer. That would put our line waiting time at about 1 1/2 hours. No problem.....

"Measly, ha!" It turns out that slightly under trained staff combined with an abundance of technical issues (iTunes crashing) turned our ignorant average processing guess from 30 seconds to 2 minutes.

Yes, thats right...we waited 6 hours.

And now the Q&A

Was it worth the wait?
--Yes
You know, you could have gone the next day and not waited in any line.
--Ya, I know.
So, why didn't you just wait and not bother with the line?
--I got my phone before you did.
Why does that matter? You are going to have that phone for a while probably...whats one day?
--Who had their phone first? Me.
What do you think of the iPhone so far?
--It absolutely destroys any mobile device that I have ever used. On a scale of 1-10 I would give the iPhone a 10 and the closest other device at a 5. I cannot say enough how great this compute...I mean phone is.