You Are Here Home > Annoying Stuff

Annoying Stuff

jQuery UI Dialog And The Enter – Return Key Problem

This is another post for my ‘Annoying Stuff’ collection and this one is very, so very annoying…

The problem is that jQuery UI, supports forms in dialogs but the problem is that a user can’t hit ‘Enter’ to submit the form, it will break everything, a user has to actually hit the ‘Submit’ (or whatever) button manually. This make the whole thing completely useless unless you make some changes that are basically tweaking the internals of jQuery UI, which is ugly and can break if they change things around but sadly this is the only solution for now.

Assuming that you use the same syntax jQuery UI suggests to create your form, the fix is something like this:

$('.dialog').find('input').keypress(function(e) {
	if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
		$(this).parent().parent().parent().parent().find('.ui-dialog-buttonpane').find('button:first').click(); /* Assuming the first one is the action button */
		return false;
	}
});

You might have to modify it a tiny bit, if that’s the case, you most likely have to change the part $(‘.dialog’) so that it selects the right container that wraps the form…

jQuery UI Dialog And The Enter – Return Key Problem
Comments (0)   Filed under: Annoying Stuff, JavaScript, Programming, Web Design, Web Development, jQuery   Posted by: Codehead on February 18, 2010

Paypal Sandbox Error: Account Created Successfully but failed to add Bank and Credit Card

If you get this error, then login to the Sandbox Account you just created and on the right side click on Add Bank Account, then it will auto populate all the fields for you.

Follow the instructions and you should be all set…

To add a credit card, go to:

Profile > Add Credit Card > Choose a card type (Visa/Master etc.) everything else is auto generated for you > Add a Card > Add a Card again on the next page

Apparently this is going on for a few weeks now.

Paypal Sandbox Error: Account Created Successfully but failed to add Bank and Credit Card
Comments (0)   Filed under: Annoying Stuff, General, Web Development   Posted by: Codehead on January 19, 2010

Microsoft Link Worked Only In FireFox?!!!

So I had to open a support ticket on Windows Live Hotmail because of some problems and the link to the form didn’t work in IE, it said “Error on the page” in the status bar and nothing happened so I had to use FireFox! The Irony!

When I see these things and issues in IE and Windows itself, I wonder, what are they doing there? Clearly someone is not doing their job properly. It’s sad because once I really liked MS products and they do somethings very well but I find myself thinking of switching to Mac more and more these days.

My brother bought a Mac Book Air and he says that he will NEVER buy a PC again…

Microsoft Link Worked Only In FireFox?!!!
Comments (0)   Filed under: Annoying Stuff, General, Operating Systems   Posted by: Codehead on January 15, 2010

The annoying PHP ZipArchive class

This is very rare, PHP’s extensions are usually well done but this one, ZipArchive class is very annoying and I’m very surprised that it’s now in PHP’s distribution…

In my case, it doesn’t create the archive for some reason and it doesn’t throw any errors either.

http://us3.php.net/manual/en/class.ziparchive.php

I’m very disappointed and I wasted a lot of time and yes, all the permissions etc. are right.

So ended up using system calls; first create a temporary folder and then something like:

system("zip -r THE_ZIP_FILE.zip PATH_TO_THE_TMP_FOLDER");

And now the problem with this is that it’s not portable, it’s fine in my case though.

The annoying PHP ZipArchive class
Comments (6)   Filed under: Annoying Stuff, PHP, Web Development   Posted by: Codehead on July 14, 2009

Slowing down Yahoo! Slurp (Yahoo! Search Bot)

A few weeks ago one of our servers started to crash every few days.

After investigating this issue for a while we found 100s of IP addresses from Yahoo! and Inktomi Corporation which is the company who developed Yahoo! Slurp.

So basically Yahoo! was launching DOS attacks against our server although unintentional but very annoying. It also shows that their technology is not as advanced as Google or other search engines or it’s buggy, Whatever you think, crashing people’s servers with your search bot is not cool at all and shows that you have to work on it a little more…

If you have the same problem here is a simple solution Yahoo! suggest; open your robots.txt (create it if you don’t have it and place it in your root folder) and add these lines to it:

User-agent: Slurp
Crawl-delay: 1

Only Yahoo! will understand the line Crawl-delay: X and Yahoo! suggests that you use a small number between 0.5 and 1.

Slowing down Yahoo! Slurp (Yahoo! Search Bot)
Comments (0)   Filed under: Annoying Stuff, Search Engines, Server   Posted by: Codehead on February 22, 2009

Problems with Google AdSense

I use AdSense on 1 of my websites and a while back I discovered some things about this service from Google.

One thing that I think is awful and shows how big corporates ONLY care about money was that I knew a website that was banned (black listed) by Google because they were “violating Google’s terms of services” by helping people buy and sell text link ads ;) and now when I search for the name of the site, it doesn’t show up in normal search results. The messed up part is that this particular website bought AdWords ads and their name shows up in sponsored links section right on the top of the search results.

This means 2 things: 1 – Google doesn’t care much about what you do when you pay, 2 – You can BUY the first spot on Google SERPs!!!

What they could do is to check the URLs against their banned list but…

The other thing about AdSense is this: Have you ever clicked on an AdSense link with confidence? have you ever seen anything valuable in those links?
Many of them are links that take you to irrelevant pages and many of the people who buy these keywords have so much money that they want the traffic in anyway they can, by bidding on keywords that have nothing to do with their pages.

This could be very bad, you are sending your visitors away with AdSense in the first place, but sadly you are sending them to pages that are not good.

It’s unfortunate but it’s what it is for now.

Problems with Google AdSense
Comments (0)   Filed under: Annoying Stuff, General, Search Engines   Posted by: Codehead on November 27, 2008

How to fix transparent PNGs in Internet Explorer

You might know already that there are some issues with transparent GIFs but PNGs don’t have those issues.
The problem with transparent PNGs is that Internet Explorer doesn’t like them so much and gives them a funny background.

So here is the solution that works great:
http://homepage.ntlworld.com/bobosola/index.htm

How to fix transparent PNGs in Internet Explorer
Comments (0)   Filed under: Annoying Stuff, JavaScript, Web Browsers, Web Design, Web Development   Posted by: Codehead on November 12, 2008

My problem with Microsoft and their products

A while back, I wrote two posts about Microsoft and I wrote them when I was upset so it might have offended people.

To be honest with you, I was a fan of Microsoft and their products up until Internet Explorer 7 came along.
I installed it on two computers and I had to disable all the addons other than the essentials in order to make them run smoothly and without so much issues.

Right now, my Internet Explorer process grows until it’s 1GB in size!!! and it then gets so slow or crashes and I loose all my open tabs and what ever I was doing.
It also crashed every once in a while for some reason and it’s still not standard compliant.

About Windows Vista; we also bought four computers with Vista and every single one, without an exception had issues right out of the box, big issues that I think Microsoft should have known about but shipped the product anyway.

Honestly, this is disappointing for me, because I liked Windows and it’s openness and the ability for everyone to write great applications for it and it’s huge documentation on Microsoft website.

I also think that Microsoft contributed a lot to the industry and I hope that this is not the end of it.

I’m a software developer and I don’t consider myself to be the best one but I know one thing, we don’t EVER ship until we fix all the obvious bugs, if we did, we wouldn’t have any clients right now.

Good Luck :)

My problem with Microsoft and their products
Comments (0)   Filed under: Annoying Stuff, General, Programming, Web Browsers   Posted by: Codehead on

Python as CGI and Error 500, Internal Server Error

If you have this problem on *nix systems, these are the things to look for:

1 – Make sure your line breaks are \n not \r\n you can set this in almost all editors, you will have to either select *nix like line breaks or \n somewhere in your editor preferences.

2 – After the first step you will have to make sure that your FTP client uploads the files in ASCII format and this will insure that \n will stay \n.

3 – If it still doesn’t work, make sure your Python script’s permissions are 755. You can try:
chmod 755 your_python_script.py

Or use your FTP client to fix this. (Refer to it’s documentation but usually you can right click on the file, on your server and click properties)

4 – If you still have the problem, you will have to have the right shebang line in the beginning of your script, the most common one is:
#!/usr/bin/env python
If this doesn’t work try:
#!/usr/bin/python
Or:
#!/usr/local/bin/python
Note that, this must be the first line

5 – If none of these worked and you have root access to your server, try:
tail -f /usr/local/apache/logs/error_log (Note that, the path to Apache error log might be different on your server)
And look for the error message associated with your request.

6 – If you still can’t figure it out, write to your hosting company and ask them.

I hope this helps :)

Python as CGI and Error 500, Internal Server Error
Comments (2)   Filed under: Annoying Stuff, Python   Posted by: Codehead on November 10, 2008

Fixing libxml, php bug and issues with HTML entities; libexpat

There is another way to fix this issue and I didn’t write about it because I couldn’t make it work at first.
Apparently I was missing one line :)

First you will need to find out where libexpat is located on your server, it’s probably here:
/usr/lib

To find out for sure, open this folder (/usr/lib) and look for the file:
libexpat.so

If you can’t find it, log in as root via SSH and enter:
whereis libexpat.so

This should list the folder in which libexpat is located.

After all this you will need to compile PHP to use libexpat instead of libxml, so go to:
/var/cpanel/easy/apache/rawopts/

And create a file and name it “all_php5″ (no quotes), if there is a file with this name edit it and add these lines to the end of it:
–with-expat=builtin
–with-libexpat-dir=/usr/lib

(lines start with two dashes “-” that are not showing up here for some reason)
Remember that depending on where libexpat is located on your server you might need to edit the second line.

Now compile Apache and everything should work fine!

Fixing libxml, php bug and issues with HTML entities; libexpat
Comments (0)   Filed under: Annoying Stuff, Programming, Server, Web Development   Posted by: Codehead on October 19, 2008
Older Posts »