Jan
09
2013
0

JQueryUI Buttonset not always working when clicked

I ran into a interesting problem tonight.

I was using the jqueryui buttonset on some forms because I love the way it looks:
http://jqueryui.com/button/#radio

But the problem was that when clicking a large number of radios in a row, sometimes the click didn’t seem to take. Further investigating appeared to show that when the mouse was moving – even slightly, it didn’t fire the click event. Apparently, this is a known bug and it is being worked on. In the meantime, however, I needed a fix.

Here’s what I came up with, and it looks like it works 100%!

I just bound the “mousedown” event to the label and fired the click event. Mousedown captures the click even if it’s moving and I bound it to the label because the input radio is actually hidden so it doesn’t receive any events.

Here’s the code:

http://jsfiddle.net/8uM5u/

$(document).ready(function() {
$('.buttons').buttonset();
$('.buttons label').bind('mousedown',function() {
$(this).trigger('click');
});
});

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized |
Mar
17
2012
0

Enable WP-Touch through the URL

wptouch-wordpress-on-iphoneIt looks like this functionality is not part of the plugin unfortunately. See this forum post.

Support Forum Post

A few edits to the code will allow it however.

Here’s the updated version.

wptouch.1.9.39.edited

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized |
Feb
15
2012
0

Injecting page specific header code (WordPress)

I found two steps to this:

1. Add a function into general-functions.php

function get_page_id($page_name){
global $wpdb;
$page_name = $wpdb->get_var(“SELECT ID FROM $wpdb->posts WHERE post_name = ‘”.$page_name.”‘”);
return $page_name;
}

2. Add this code to your header.php

echo get_post_meta(get_page_id($pagename),’header-tag’,1);

3. On the page you want to add custom header tags to, add a custom field called header-tag with your code to inject.

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized | Tags:
Dec
03
2011
0

Kindle Fire vs Nook vs iPad

While not a full review of the Kindle Fire versus the Nook and iPad, I did do quite a bit of research into all three before deciding on the Kindle Fire this Holiday Season. It arrived the other day and we are really happy with it.

The reviews I saw comparing the Nook and the Kindle Fire pointed out the differences in hardware and interface. The Nook won in both of those respects, but where it lost was in the media content. The Kindle has access to the entire Amazon media library including all the hit movies, tv shows and music. There is no option on the Nook for downloading movies or music other than through Pandora and Netflix, which are both limited.

Another review of the Kindle Fire vs the Nook said that their web browsing experience on the Kindle was slightly choppy, but workable compared to the Nook. I haven’t experienced any choppiness on the Kindle Fire yet. Everything is extremely smooth and fast.

I was pleasantly surprised to find all of the music and movies I’ve ever purchased through Amazon readily available on the Kindle with a tap of the button. Without any configuring or loading, I was able to play my purchased music (and download it for off-line play) immediately.

The Kindle has 6gb of storage space available on it. The Nook has 16gb of available storage plus it has an SD expansion slot. The KindleFire doesn’t have an expansion slot. That being said, the Kindle Fire is designed to work off of the cloud mostly, and it does a great job at that.

The only other downside to the Kindle Fire is that it doesn’t have Bluetooth support. The Nook doesn’t either. The iPad does (of course).


We purchased a bluetooth adapter for the Kindle Fire that allows us to use our Bluetooth headsets to listen to it without waking the babes.

As far as features and screen size go, the iPad beat both the Kindle Fire and the Nook hands down. However, for some (including us) the smaller screen was actually a plus. Of course the price on the iPad is also much higher.

Happy Shopping!!

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized |
Sep
04
2011
0

PHP Left

There is no function in PHP equivalent to VB or ASP’s left. There is a more robust function called substr. Here’s a function from the forums that replicates the functionality.

function left($string, $count){
return substr($string, 0, $count);
}

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized | Tags: , ,
Sep
04
2011
0

Best time to buy anything

Handy reference. Who would have thought April was the best time to buy laptops.

http://lifehacker.com/5736625/the-best-times-to-buy-anything-in-2011

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized |
Aug
28
2011
0

MSSQL: Cross Apply with XML

Handy function to remember:

SELECT *
FROM orders AS o
CROSS APPLY (
SELECT linenotes + ‘,’
FROM orderLines AS ol
WHERE ol.orderID = o.orderID
FOR XML PATH(”) )
temp ( listOfLineNotes )

http://www.stillnetstudios.com/concatenating-child-rows/

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized | Tags: ,
Aug
24
2011
0

Getting PHP and Microsoft SQL Server (MSSQL) to play nice

I have a Windows Server 2008 with IIS7 installed. I’ve been pounding my head against a Microsoft constructed brick wall for the past day trying to get PHP to interact with SQL Server 2008.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20098

A brief Google search pulls up a download page from Microsoft with the newest SQL Server drivers for PHP:

In the package you download, there are about 9 different files. You only need to install 1 or 2 and there are no instructions as to which one is the one to install.

In my case, even installing ALL of them didn’t work. My PHPInfo() said there was sql server support, but it wouldn’t connect to the sql server.

FINALLY, I found a single post that explained it. Turned out my PHP version which was installed by IIS7 was too old! For SqlServer to work – you have to have PHP 5.2.4 or newer.
The help instructions that come with it aren’t specific enough.

http://social.msdn.microsoft.com/Forums/en/ssdsgetstarted/thread/5fa1215f-5104-40f3-ac5c-872c4812f416

Lastly, here’s a great link that goes over how to actually use the sqlserver connection. Good god!

http://social.technet.microsoft.com/wiki/contents/articles/whitepaper-accessing-sql-server-databases-from-php.aspx

One other thing to note if you’re used to working with .NET or Classic ASP. In PHP the field names are case sensitive.

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: PHP,SQL Server | Tags: ,
Aug
21
2011
0

WordPress on IIS7 can’t install themes or plugins automatically

WordPress has an awesome feature where it can automatically upgrade itself, install themes and plugins, etc. It works fantastically on all apache and lamp installations I’ve played with, but never on Windows with IIS.

I recently upgraded to IIS7 and it was still giving me errors when trying to upgrade, install plugins, etc.

I realized that it just didn’t have write access to the file system so it couldn’t download the new files. To fix this, I added the user IIS_WPG to my wp-content directory with write permissions and immediately it worked. The full step by step went:

1. In file explorer, right click on the wp-content directory. Select Properties.

2. Select the Security Tab.

3. Click Edit.

4. Click Add

5. Type IIS_WPG, click Check Names. It should format it.

6. Uncheck Execute, check, Write and Read.

7. Click Apply.

You’re done!

It should work now.

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Blogging,Installing Wordpress | Tags: ,
Nov
21
2010
0

OpenVBX Applet for Adding Timeout and CallerID to Dial Applet

A friend of mine turned me on to Twilio and I have to say it’s pretty kick ass. They did an amazing thing by creating an open source call routing system as well. Not only can you straight out code the routing, etc., but you can use their existing system straight out of the box with little modification.

One thing was lacking for me on the OpenVBX without plugins. The Dial applet that came with it didn’t allow for adding a timeout. Luckily someone did write out the code for modifiying the applet to include timeout and callerid, but it was confusing and I had to spend some time to edit it myself.

I finally got it working, so I’m posting it here.

Here’s the original link:
https://github.com/twilio/OpenVBX/issues/#issue/27

Here’s the link to the modified dial applet that includes caller id and timeout.
Time Out Dial Applet

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: Uncategorized |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes