Thursday, April 23, 2009

virtualbox how to adjust the screen size

I had an issue where Virtualbox would start my OS (Win XP in this case) at 800x600 screen resolution. I wanted to increase the size to fill my 22 inch monitor so under the Machine drop down I select "Fullscreen mode", but to my surprise it just centered the 800x600 with a black background to fill the rest of the area for the full screen view. Meh, this is not what I wanted! After much searching I found nothing that anyone had posted to fix the problem. Well stop searching!!!

How to fix:

Login to your VirtBox machine and change the XP display settings, Yep it's just that simple =P

Detailed how to:
1- Start VirtBox
2- Login to XP
3- Right click the desktop
4- Select Properties
5- Select the Settings tab
6- Slide the Screen resolution slider towards the More side
7- Click Apply
8- Click Yes to confirm your settings
9- Click Ok

That's it, enjoy!!!

jQuery CSV validation for user input

I'm using jQuery 1.3.2 with the jQuery Validation plugin 1.5.2 and noticed there was no validation for CSV formatted user input. After looking for a while I did find that I could extend the validation plugin with the additional-methods.js file. It's has some great added validations but still nothing for CSV. So this is to all looking for something for CSV (Comma Separated Values).

Validates for a-z A-Z 0-9

jQuery.validator.addMethod("validcsv", function(value, element) {
return this.optional(element) || /^([a-zA-Z0-9])+(,[a-zA-Z0-9]+)*$/.test(value);
}, "Must be comma separated if entering multiple values: Value1,Value2");


Validates for a-z A-Z

jQuery.validator.addMethod("validcsv", function(value, element) {
return this.optional(element) || /^([a-zA-Z])+(,[a-zA-Z]+)*$/.test(value);
}, "Must be comma separated if entering multiple values: Value1,Value2");


Validates for 0-9

jQuery.validator.addMethod("validcsv", function(value, element) {
return this.optional(element) || /^([0-9])+(,[0-9]+)*$/.test(value);
}, "Must be comma separated if entering multiple values: Value1,Value2");


Alt validation for 0-9

jQuery.validator.addMethod("validcsv", function(value, element) {
return this.optional(element) || /^([\d])+(,[\d]+)*$/.test(value);
}, "Must be comma separated if entering multiple values: Value1,Value2");


Validates for a-z A-Z 0-9 _


jQuery.validator.addMethod("validcsv", function(value, element) {
return this.optional(element) || /^([\w])+(,[\w]+)*$/.test(value);
}, "Must be comma separated if entering multiple values: Value1,Value2");


Now this will validate values for a-z upper and lower case and 0-9 numeric values that are separated by a comma. If you need to modify the Regular Expression to fit your needs please post back with your findings.

Thursday, April 16, 2009

jQuery (1.3.2) w/ Thickbox (3.1) and Java .action hack

Here goes:

While trying to incorporate jQuery Thickbox into my JSP page I encountered a problem. The problem being is that I did not want to use the iFrame call but the Ajax call but I was getting a 404 Error. After looking at the URL Ajax was calling I noticed the Ampersand symbol (&) was being passed in the URL but the .action method needs a ? to pass parms in the URL.

Looking at thickbox.js line (303 I think)

[CODE]url += "&random=" + (new Date().getTime()), function() {[/CODE]

I just replaced the & with ? and bingo.

[CODE]url += "?random=" + (new Date().getTime()), function() {[/CODE]

Just a FYI for all with headaches ;-)

Wednesday, April 15, 2009

Firefox 3.0.7 update breaks Aptana + how to fix

Okay so after much digging around I found that Aptana needs libgtkembedmoz.so to run (Aptana team please fix this, just include the file in the next build please!!!).

Work around:

Well xulrunner (the new version) doesn't include libgtkembedmoz.so file. So after much Googling I found that Thunderbird does. So I YUM install thunderbird and went to check if the file libgtkembedmoz.so was there. (BTW: thunderbird version 2.0.0.18 on CentOS 5). Yeah it's there.

So I have a script that looks for the libgtkembedmoz.so file

[SCRIPT]
#!/bin/bash

# Set path for the Mozilla SWT binding
MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME%*/}
if false && [ -n "$MOZILLA_FIVE_HOME" -a -e $MOZILLA_FIVE_HOME/libgtkembedmoz.so ]; then
:
elif [ -e /usr/lib/mozilla/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/mozilla
elif [ -e /usr/lib/firefox/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/firefox
elif [ -e /usr/lib/xulrunner/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
elif [ -e /usr/lib/esc-1.0.0/xulrunner/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/esc-1.0.0/xulrunner
elif [ -e /usr/lib/mozilla-firefox/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox
elif [ -e /usr/lib/mozilla/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/mozilla
elif [ -e /usr/lib/thunderbird-2.0.0.18/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/thunderbird-2.0.0.18
else
$DIALOGW \
--title="Integrated browser support not working" \
--text="This Eclipse build doesn't have support for the integrated browser."
[ $? -eq 0 ] || exit 1
fi

# libraries from the mozilla choosen take precedence
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

# Do the actual launch of Aptana Studio
exec ./AptanaStudio
[/SCRIPT]

make it executable (chmod 755 scriptname) and run.

Note:

Just cjeck to make sure you have the right version of the program and/or that the path works.

[user@machine]# ls /usr/lib/thunderbird-2.0.0.18/libgtkembedmoz.so
/usr/lib/thunderbird-2.0.0.18/libgtkembedmoz.so

So if you have thunerbird 2.0.0.14 please make the change in the script as well.

Hope this help ;-)

Tuesday, February 03, 2009

Configure Aptana for CentOS 5

While moving from a Windows environment to Linux I wanted to use Aptana's free IDE for development, but was having a ton of issues getting Aptana to run correctly on Linux CentOS 5.
So here are my finding:

After I installed Aptana (install directory: /usr/share/aptana )

I keep getting errors like this:

SWT-ERROR

looking in the logs I see this:

!MESSAGE No more handles (java.lang.UnsatisfiedLinkError: /root/.Aptana/Aptana Studio/configuration/org.eclipse.osgi/bundles/72/1/.cp/libswt-mozilla-gtk-3236.so: libxpcom.so: cannot open shared object file: No such file or directory)

!STACK 0

org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError: /root/.Aptana/Aptana Studio/configuration/org.eclipse.osgi/bundles/72/1/.cp/libswt-mozilla-gtk-3236.so: libxpcom.so: cannot open shared object file: No such file or directory)


Well after search the forums and other sites for about an hour, people suggested I install these packages.
  • yum install gtk2-devel
  • yum install xulrunner
  • yum install libstdc*
  • yum install gtk2*
  • yum install libswt3-gtk2*
  • yum install compat-libstdc++-33
I had some already installed and I don't know if they are really required but there they are for you.

After all that it still didn't work until I came across this post. in the post it has a file you need to download called aptana.sh.

Here is the code if the file is not available:

/*************** START OF FILE **************/

#!/bin/bash

# Set path for the Mozilla SWT binding

MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME%*/}
if false && [ -n "$MOZILLA_FIVE_HOME" -a -e $MOZILLA_FIVE_HOME/libgtkembedmoz.so ]; then
:
elif [ -e /usr/lib/mozilla/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/mozilla
elif [ -e /usr/lib/firefox/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/firefox
elif [ -e /usr/lib/xulrunner/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
elif [ -e /usr/lib/mozilla-firefox/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox
elif [ -e /usr/lib/mozilla/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/mozilla
else
$DIALOGW \
--title="Integrated browser support not working" \
--text="This Eclipse build doesn't have support for the integrated browser."
[ $? -eq 0 ] || exit 1
fi
# libraries from the mozilla choosen take precedence
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

# Do the actual launch of Aptana Studio
exec ./AptanaStudio


/*************** END OF FILE **************/

Still didn't work so I decided to see if the file it was trying to call existed. the command for the file name in:

locate libgtkembedmoz.so

it found it so I added the condition to the script and now it works great, YEAH!!

elif [ -e /usr/lib/esc-1.0.0/xulrunner/libgtkembedmoz.so ]; then
export MOZILLA_FIVE_HOME=/usr/lib/esc-1.0.0/xulrunner

Let me know of any other findings that might help out.

Thanks,
--Phill

Wednesday, July 30, 2008

Using the PSI GTalk hack to get all your IM freinds on iPhone

The thought occurred to me the other day that I wish I could chat with all my friends over the iPhone. I know there is meebo but it's not the same on the iPhone. Then I remembered this PSI GTalk hack on how to get all your IM friends in GTalk from BigBlueBall. I have done this hack before for Yahoo and GTalk and added all my Yahoo IM buddies but found that all my friends switched to GTalk so I didn't really need/use it anymore.

Now that Google has release a iPhone GTalk app I think its time to fire it back up.

Tuesday, July 15, 2008

Apple customer for life - An iPhone 3G story

If you are considering getting the new iPhone and wonder what kind of service your will receive from Apple & AT&T read this.

Our Story:

2 week prior to launch I spoke with AT&T over the phone to confirm my wife and I were eligible to purchase the iPhone.
As another step I also went to the Apple store and also confirmed we are eligible to purchase the iPhone.

Both parties (AT&T & Apple) said yes we can, yeah!!

The Big Day:

4:30 AM the alarm goes off to wake me up so I can go to the local mall and stand in line at the Apple store.
I get to the mall around 5:00 AM and to my surprise I am the first person there. YEAH!
I setup a chair for me to sit in and start to read a book I brought.
More people start to line up around 5:20ish and then more keep coming.
7:00 AM they open the mall door's to let us in to stand in a new line in front of Apple.
7:20 some Apple employees come out to answer any question we might have. Being the first person in line they wanted to streamline any question I might have. She asks about the plan I am getting and a couple of other questions to see if I have everything I need. I come to find out after the Q&A I need to have the person who the account is under do the iPhone registration, aka my wife.
I call my wife to have them all (+ the kids as well) come down to the mall and meet me there.
They get there at 7:45 AM with 15 minutes to spare before they open the Apple store.
As the first ones in and with all parties available to do the purchase we begin the process.
The sales person says we must buy each iPhone in a separate transaction, Fine by me.
We start the process and come to find out we have some sort of error that won't let us purchase the iPhone from the Apple store. We are taken to the trouble shooting station to find out why.
Apple calls AT&T to find out why we can't purchase the iPhone. AT&T says our account looks fine and we should be able to purchase it.
We try again to purchase the iPhone but got the same error.
Now Apple is saying we need to go to the AT&T store up stairs in the mall (Luck one was so close by) to purchase an iPhone because their system will not let them for some reason.
8:30 We head upstairs to the AT&T store only to find a long line :-(
, I see the Apple manager from down stairs and ask her if she could ask the AT&T store manager to help us cut in line to purchase the iPhone ( I know but we couldn't wait in line again).
She came back with the answer of, "Sorry he cannot let us cut and they are running low on iPhones at this AT&T location.
We see the AT&T manager and ask him if he could take a look at our account to see why we cannot purchase from the Apple store. He agrees to look at our account.
All looks fine he states, you should be able to purchase the iPhone from the Apple store.
8:45 So we head back downstairs to the Apple store and speak to the manager again. He agrees to let us try to purchase the iPhone again. So this time we try my number first.
Still no luck, we get the same error message again.
At this point the manager says there is nothing they can do at the Apple store, try the AT&T store.

My wife and I are not happy; we had taken the steps to ensure that we could purchase the iPhone.
AT&T said we are eligible, Apple said we are eligible, so what's the problem?


Now I see the AT&T manager in the Apple store talking to the manager, something is happening and we want to know what it is.
After they talk for a minute they come over and explain that we can only purchase the iPhone at the AT&T store due to my corporate discount that I had just found out about and applied for not less than a week ago.

Here is why:

Through my work I receive a corporate discount which I had just signed up for a week ago for all of our numbers on the family plan. By doing this I unknowingly excluded eligibility to purchase the new iPhone at Apple and must purchase it at AT&T.


wait, WHAT!!!


There was no mention of the corporate discount and where to purchase the phone in any documentation I read or that any customer rep from AT&T or Apple had told us about.

At this point my wife had to leave and I was to deal with us getting the iPhones. I spoke to the manager again and wanted to know if there was any way to cancel the corporate discount so I may purchase the iPhones. He stated that the manager from AT&T said they could, but it would take a day for my account status to be cleared for me to purchase the iPhones.

Now it seems like we would not be able to purchase the iPhones today, bummer. I had complained some to the manager and felt that since Apple didn't tell us about this glitch what was Apple going to do for us? I had taken all the steps in order to qualify and purchase the iPhone and felt like crap that I had wasted all this time and effort in doing so.
At this point the manager had said he would comp us some accessories for the iPhone for our trouble.
So I went and picked out a couple for my wife and myself and waited for my wife to return (which was about 10:15 when she got back).

When she got back to the Apple store I explained to her what was going on.

My wife didn't want accessories; she wanted the iPhone and was not happy that after all our efforts we would not be getting an iPhone today.
So we spoke to the manager again asking if there was some way we could purchase the iPhone today and activate it tomorrow. He said no that Apple or AT&T had to activate the phone in order for us to purchase the phones.


After explaining our situation and trying to argue our point the manager offered us 2 iPod touches for free for all the trouble we have gone through. (Wow I didn't expect this at all)


My wife still wasn't happy, she said I don't want the iPod touch I want the iPhone.

I had to take a step back when she said no to the 2 free 8GB iPod touches, I was thinking WHAT!! They are offering us free iPod touches and you're saying NO!

After speaking with my wife and listening to her side of things I backed her up in this decision.

From her point we had taken all the necessary steps in order to purchase the iPhones, waited in line and was shuffled from Apple to AT&T a couple of time with both parties saying we should be able to purchase the iPhone just not from me (AT&T or Apple). She said I am never going to use the iTouch so she doesn't want it, she wanted the iPhone.


after some more time explaining our situation to the manager, he still said there is nothing he could do.
I asked my wife if she wanted the iPod's or the accessories at which that point the manager said he would just give it all to us. The iPod's and the accessories, WHAT!! HUH!! HOW!!! OKAY!!

I looked at my wife and she looked at me is complete amazement and shock. I looked at the manager and said thank you as he walked away to ring up the merchandise for us.

I have never had a manager do something like this for us; I and my wife are still in shock.

In my past experience with Apple they have always had great customer service and care, but this was beyond that.

So Apple comped /gave us


2 8 GB iPod touch's $299 each
2 Blue tooth headsets $129 each
2 iPhone 3G docks $39 each
2 carrier cases for the iPhone $39 each
1 protective film for the iPhone $19

for a total of:

$953.00 plus tax of Apple merchandise for FREE

After this we went back upstairs to the AT&T store to see if they could do anything else for us.
We spoke with the manager and he took our names down as a special group for tomorrow's shipment.
9:00 AM Saturday July 12th 2008 EDT we are allowed to purchase the iPhones from the AT&T store.

Later that day (without my knowledge):

My wife had called AT&T to see if there was anything else we could do so we could purchase the iPhones from Apple today.

The AT&T rep said they could remove my corporate discount and it should take it off the account immediately. WHAT, why didn't the AT&T rep at the store do this? The AT&T rep on the phone didn't know why, but she had removed the corporate discount and that is what my wife wanted to do.

Now my wife heads back up to the mall to see if she can purchase the iPhone from Apple today. She enters the store and asks for the manager. They speak and he gets her an Apple employee to see if she can purchase the iPhones now.

Even later in the day:

As I am at work and need to make a call on my cell phone I notice that I have no service available. I think weird why can't I get service. I pick up the land line to dial my wife and she has just IM'ed me about the great news. She was able to purchase the iPhones at the Apple store. She explained that my phone would have no service on my current cell phone until we used iTunes to activate the iPhones at which point I should be home by then to enjoy my new iPhone.

I am writing this note to boast about all the free stuff we received from Apple, but to give props to them for being such a great company. They went above and beyond what other companies would do for their customers or even potential customers. I just wanted to say thanks for making what seemed to be a bad experience into one that I will never forget. Apple customer for life!!!

Monday, April 14, 2008

Digg iPhone Request

Thanks all at Digg for making the iPhone Digg site, but I have one complaint. I love the upcoming stories, could you add this in the views I can use?

So under Topics could you add upcoming?

Thanks,