jquery textarea autoresize

I was looking for the cool factor that you get when you use facebook to respond to wall posts

The closest I came to was this chap .James Padolsey who wrote a nice plugin for textarea resizing

The only thing I added was the ability to paste content into the textarea, I’ve written to him so hopefully he’ll update his plugin.
If not heres where you update the plugin.
Look for the textarea .bind list and change it to :>

user control is ambiguous in the namespace ‘ASP’

This one was a particular pain.

Long story short try this in your web config

Set batch=”false” under compilation

This will allow you to drill further into the problem, its not a particularly desirable attribute to set in production.

Visual Studio VS 2010 not stopping at breakpoints

Ever wondered why suddenly you cannot debug because the compiler isnt breaking on your breakpoints.

There are several reasons for this.

make sure that.
1. Your project is compiling when you begin debugging (check this in build > configuration manager)
2. Ensure your projects are compiling in debug mode not release (check this in build >configuration manager)
3. In the Webconfig ensure you are in debug mode

4. The (project properties > startup options > debuggers has the ASP.NET checkbox checked)
5. Delete all pdb files in your bin folder
6. Ensure every project referenced is set to build under (build > configuration manager)
7. Do a full clean and rebuild. (build > clean solution) (build > rebuild solution)

Finally and this is the one that caught me out
8. Check you are not setting a cookie cache timeout of positive time, I was expiring my page after 1 day. The best way to check this is to load a page in debug, knowing your break point will not be stopped at. Once the page is fully loaded hit ctrl F5 to force full reload of the page. If your breakpoint is stopped at then you know its a cache problem.

jcarousel No width / height set for items

If you use jquery, then the chances are you are using the jcarousel library.

Well im new to jquery but have come along at an accelerated rate, perhaps because of my OO background.

Ok so you hit this page likely because you got this error

jCarousel: No width/height set for items. This will cause an infinite loop. Aborting…

When i tried to nail down what the cause was i stumbled across a post that told me to add css styles for width and height. This was all well and good until i wanted to apply styling to more than one carousel on the page. Anyway what took me a few hours to figure out I support open and collaborative minds by sharing it here.

The error occurs regardless of widthand height attribute of you jarousel item. You need to set the width and height of the first parent of the carousel. If you follow this design pattern below, you cant go wrong

Firstly im assuming you have already included a reference to your already downloaded jcarousel library. There is really only one of them so you cant go wrong in finding it. here

1. Markup for your page containing the jcarousel element (note wrapped in a containing div)

Your initialising jscript to bring your carousel to life (note applied to the ordered list)

Your CSS (note applied to the wrapping div)

The reason why we do this is because the jcarousel class ammends the html markup so that styles will no longer apply because the objects will no longer exist, or have the same name at the jcarousel object level.

Hope this helped those who were stuck as I was.

JavaScript window.SetTimeout to javascript class method passing object/parameter

I notice people have been struggling with calling a class method and passing a parameter through to it when using the window.setTimeout javascript timer

In my current search engine proejct I am both calling the settimeout method from within my class, assigning the id to a class parameter, incase i want to cancel it before it hapopens, and passing the current call object through to the target class method, setting my delay from a class global delay variable.

The trick is to place an inline function into the expression of the setTimeout call like so :-

Inside my input handler (this is fired from keyup, keydown, paste and various other change events on the page)

Hope this helps those that might have been struggling with this.

ASP.NET Master Page Nested inheritance

I seem to be asked this a lot so i thought i would mention this online so hopefully people will no longer ask me, they’ll find the answer when they ask google

You are trying to inherit from a masterpage and you recieve the following error

the page has one or more < asp:content> that do not correspond with < asp:ContentPlaceHolder> controls in masterpage

Script tags are the culprit around 80% of the time. For some reason the visual studio designer doesnt like not fully closing your script tags at design time.

Change all of you script tags from this

< script type="text/javascript" src="js/myjs.js" /> 

correcting it to this:

< script type="text/javascript" src="js/myjs.js" ><  /script>

Any you should be good to go.

Error 1310 Config.msi verify access

If you recieve the following error when trying to install or uninstall windows applications

Error 1310. Error writing to file: C:\Config.Msi\*******.rbf. System error 5. Verify that you have access to that directory.

You can try and resolve this by re registering windows installer

Open a command prompt Start > run > “cmd”

msiexec /unreg
msiexec /regserver

If this doesnt solve your problem try running your installer from the root of the C drive as an administrator in various compatibility modes.

SQL Handling Null Values

Having Null Values in your database is a good thing despite those that might tell you otherwsie. Not only does it save space but it is a definitive “im empty” signature. There are of course proper and improper ways to handle SQL Nulls. Just remember never ever try to compare to a null using “=”.

1. A NULL value represents an UNKNOWN value

2. Under ANSI_NULLS ON, two NULL values will never be equal to each other because the two separate values are unknown. With ANSI_NULLS OFF, two separate NULL values will evaluate to equal values.

Any time a NULL value is present in a column that an aggregation is performed on, such as a COUNT, AVG, or SUM function, those values will be ignored and therefore not included in the functions result.

The COALESCE function returns the first non-NULL value in the field list that it accepts. The COALESCE function is very useful in a join operation or in queries where you are comparing a single value from a list of possible fields to a single value.

How To Restore All Your HTC Widgets

Recently my htc widgets have not been available for my home screen (friend stream, mail music, twitter etc) Im not sure what caused it but none the less its happened.

To get them back is pretty simple.

Note: this will completely reset your home screen layouts and wipe any saved layouts
1. Make sure you have over 15mb free space2. Open Settings
3. Select Applications
4. Select Manage Applications5. Scroll to HTC Sense and select it
6. Hit Clear data
7. Press the home button and wait
8. You will now see your widgets available when trying to add via one of the home screens

Information Technology, Life, Interesting Stumbles, Servers, Configuration, Topology, Security, Best Practices, Developing, Fire Fighting, Problem solving, Visual Studio 2005 – 2015 .NET 1.1 – 4.5, jQuery, JSON & much much more