and jQuery.trim()

When performing a .trim() function on a string pulled via the .text() tag in jQuery,   will convert into a special space that will not be removed.

Example:

<div id="div1">  This is text  </div>

<script type="text/javascript">
jQuery(document).ready(function() {
trimString = jQuery.trim($('#div1').text());
</script>

I was able to catch the Unicode character, which ended up being 160, by using:

alert(trimString.charCodeAt(0));

After performing a regex replace on the string, I was able to achieve a truly trimmed string.

<script type="text/javascript">
$(document).ready(function() {
trimString = $('#div1').text();
var re = new RegExp(String.fromCharCode(160), "g");
trimString = jQuery.trim(trimString.replace(re, " "));
});
</script>

Commit Monitor for SVN

I use SVN on a regular basis to commit and update code either myself or my team is currently working on. However one issue I've had, that I've never really looked into, was notification of commits so that each programmer can be notified automatically of changes.

I've heard of some scripts that can be created to email the proper programmers, but today I found a nice tool that makes this painless. By default this program, that hides away in your system tray for Windows, checks for a new commit every 90 minutes. When a new commit is found, it displays a small window showing an update, similiar to goodsystray for Google Wave.

This small program can monitor multiple projects and there a few options you can customize such as running a script after a new commit is found or changing how often it checks for commits.

The program is called CommitMonitor and can be found at http://tools.tortoisesvn.net/CommitMonitor.

SQL Management Studio 2008 Error: Saving changes is not permitted

Recently I came accross a blockade after upgrading my SQL Management Studio from 2005 to 2008. All of a sudden if I added a "no-null" option column in a table or inserted a column in the middle of the existing schema I could not save. At first I thought there was some hidden permission I was missing, but after futher research I find out it's a setting in the Studio itself.

The full error is: Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.

To get rid of this annoying "feature", take these steps.

  • Go to Tools > Options > Designers > Table and Database Designers via the menu
  • Uncheck the option 'Prevent saving changes that require table re-creation

Note: This is a safety feature and turning this off opens you up to possible loss of data, so make sure you know what you're modifying or at least make a backup.

Alternate System Recovery

On HP Laptops, sometimes F11 will get you into the recovery partition. However if this fails and you can still get into a runnable Windows you have an option.

Run compmgmt.msc (Computer Management) in Windows and select Disk Management. Then mark the recovery partition (usually D) active by right clicking on the drive's icon. Then restart.

Don't press any keys and if the partition is still good it should boot up the recovery partition so you can get your computer back to factory condition.

This was verified on a HP Pavilion dv6000 series laptop.

Duplicate Errors Using jquery.validate on Dynamic Forms

I have a form that clones a div upon clicking an add button. For validation I use the jquery.validate plugin. When the add button is clicked, I exectute the following to clear the errors.


validator.resetForm();

However, if inline errors are displayed before this being called, and then they are displayed again after the form is reset, the inline errors are displayed one time on the first div, two times on the second div, and so-forth.

The alleviate this issue I'm now destroying the error element.


validator.resetForm();
$('label.error').remove();

Flash and iPhone Apps

I would just like to give props to Adobe for integrating a method to create iPhone apps with Flash. Unfortunately, this doesn't mean flash will appear in the browser, but it will allow Flash designers to create iPhone Apps using Flash Pro. The way this is done is Flash compiles the ActionScript into native ARM code. ARM is the processor used in the iPhone. I'm guessing this will work for iPad too, but not sure.

Interesting video at Adobe TV.

FireFox Only Prints First Page Of Multiple

I spent a couple of hours today trying to figure out why my website was only printing the first page when there where clearly multiple pages worth of content to be printed. IE would print just fine, but FireFox would not.

I finally found the culprit. I had a container DIV that was assigned a CSS attribute of "overflow:hidden". This is old code I took on, so no idea why it was there. But after removing it, I got all my content to print.

There's a bug documented by Mozilla here.

Adobe Photoshop Content-Aware Fill Sneak Peek

Check out the Adobe Photoshop Content-Aware Fill Sneak Peek on FaceBook.

I'm not a PhotoShop expert, so sometimes I give up on things that just take me way too long. One of those "things" is patching or manipulating areas of a photo that need to be touched.

This video shows you an upcoming feature that makes this 100% easier.

Adobe ColdFusion Builder Trail Gotcha

Today Adobe released ColdFusion Builder and Flash Builder 4. Apparently you get a Flash Builder 4 Standard license "free" with the purchase of CF Builder at $299.

I've been using the beta and pre-release versions of CF Builder for awhile now. Today, I went ahead and uninstalled those and deleted my workspace to get a fresh, non-beta installation. The pre-release has the license control built into it and I had 43 days left. When I installed the version 1 60-day trail, ta-da - I still have 43 more days left to try it, not 60.

Just a heads up to those expecting to give it a try for awhile before shelling out the cash.

jQuery UI datepicker and Dynamic Forms

When implementing jQuery UI's datepicker in a dynamic form, you may notice that it will break as you bind it to new elements. The datepicker method adds a "hasDatepicker" class which must be removed first.

This example finds all the elements with a "datePicker" class and removes the "hasDatepicker" class from the element. It then calls the datepicker method and binds the .datePicker class again.


$('body').find(".datePicker").removeClass('hasDatepicker').datepicker();

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner