workaround

Simulating "focus" and "blur" in jQuery .live() method...

Update: As of jQuery 1.4, $.live() now supports focusin and focusout events. jQuery currently1 doesn't support "blur" or "focus" as arguments for the $.live() method. What type of work-around could I implement to achieve the following: $("textarea") .live("focus", function() { foo = "bar"; }) .live("blur", function() { foo = "fi...

What would happen if I set null in prepared statement with varchar always?

I have this method to insert data using jdbc that will insert the value according to the java type. Something like this: Object o = map.get( key ); if( o == null ) { // setNull( index ); } else if( o instanceof String ) { // setString( index, (String) o ); } else if( o instanceof Timestamp ) { // setTimestampt( index, ( Ti...

Is this ASP.NET Inherited Shared Function practice acceptable?

I have a bunch of different forms that I would like to create a base MustInherit class for. One function I would like them all to contain is a shared function called GetForms(). I know that you can't declare a shared function MustOverride so I did the following in my abstract class: Public Shared Function GetForms() As List(Of OrderForm...

Firefox hide embeded object bug workaround?

Hi there is a well documented bug in firefox(since version 0.9!) where hidding a flash, java applet, quicktime... really anything you can put in a "embed" or "object" tag makes the embeded content be restarted/reloaded when shown back again. It seems to occur when modifying any display related attribute on css. Normally this wouldn't be...

IB complains that a new window has contents that go off screen

Interface Builder gives me a warning about the set up of my .xib file. It says, in a dialog called "MainMenu.xib Info", Object: Window ID: 21 Type: Illegal Configuration Issue: This window's content rectangle does not lie entirely on the screen with the menu bar and may not be completely visible for all screen resolutions and configur...

Alternative to poseAsClass in Mac OS X 10.5 and higher?

Apple has deprecated NSObject's poseAsClass: method for OS X v10.5 and above. Is there another way to make class posing work? ...

What should I do or don't do to avoid Delphi "push dword" bug.

I found that Delphi 5 generates invalid assembly code in specific cases. I can't understand in what cases in general. The example below produces access violation since a very strange optimization occurs. For a byte in a record or array Delphi generates push dword [...], pop ebx, mov .., bl that works correctly if there are data after thi...

JMenuItem.getRootPane() workaround ?

It seems to be well-known there is a bug when using JMenuItem.getRootPane(). I read the bug description but i cannot figure out a workaround. Do you know work-around code for this in an Action.actionPerformed() method ? Thank you. Update: I get this now but that don't work with sub-menus :-( public void actionPerformed(ActionEvent e)...

Handling Y2.036K & Y2.038K bugs.

Hi All, I am currently working on a project with a requirement that our software must operate until at least 2050. Recently we have run into problems dealing with the Y2.036K "bug" in the NTP protocol and also the Y2.038K bug. Basically, our software must continue to run past these dates with all data recorded using correct time stamps....

XCode xcconfig: Configuring a dependency based on the target

In the quest to resolve the Objective-C namespace issue I'd like to experiment with prefixing a dependency's Objective-C classes based on the target being built. As an example, suppose I have in my shared library (ObjCStaticLib) a class (CWindow). I have two plugins (A and B) that will use this CWindow. To avoid A's CWindow from collidi...

How to make jQuery load() not freeze the page?

When using jquery's load function, the page freezes until it has loaded. How can I get around that? I have a script that makes all links load through ajax, into a div in the page. I also made it so that it would make another div reload (the navigator). Whilst this is going on, another script refreshes every now and then, reloading ano...

jquery load freezing the page

$(document).ready(function(){ $("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank"); $("a[target!='_blank'][target!='_top']").click(function(){ $("#actualcontent").load($(this).attr("href")); $("#nav").load('nav.php'); window.location.hash=$(this).attr("href"); return false; }); }); This c...

How to get around UDF restriction on side-effecting operators?

Microsoft Books Online (BOL) on Using Change Data explains a misleading error messages for cdc.fn_cdc_get_all_changes_* & cdc.fn_cdc_get_net_changes_* when an invalid, out-of-range LSN (Log Sequence Number) has been passed to them. Msg 313, Level 16, State 3, Line 1 An insufficient number of arguments were supplied for the procedure ...

mssql_bind empty string converting to NULL

I am currently using SQL Server 2000 Stored Procedures with PHP. Following the PHP doc, I use mssql_bind to assign value of parameters and then execute the Stored Procedure. The problem is that I got this bug which prevents me to bind empty strings to parameters (they are converted to NULL when the Stored Proc gets called) I dont't wan...

Very frustrating ORA-12154 excpetion finally resolved!

This is a little something I thought I need to share. We had some issues establishing connection to Oracle. We kept getting the ORA-12154 (TNS:could not resolve the connect identifier specified) without any apparent reason. The weirdest thing was that in some application the connection was successfully established, while it kept throwin...

[JavaFX] changing the content of HBox in Tile

When changing the content of an HBox in a Tile, the Tile elements gets sorted as if it has only two columns. For example, running the following script and clicking the button would display the objects tiled in 2 columns, instead of four: var grid = AnimGrid { columns: 4 content: for (i in [1..10]) HBox{content:[Text {content...

How to use .NET 3.x features in .NET 2.0 (Visual Studio 2008)

You're stuck with targeting .NET 2.0 in Visual Studio 2008, but you'd like to use all the latest goodness from .NET 3.x features, like: LINQ Extension Methods Lambdas What can one do to enable this awesomeness? EDIT: I had not originally found the post: http://stackoverflow.com/questions/173080/c-net-3-0-3-5-features-in-2-0-using-v...

Easy way to access private fields/methods/properties using f# interactive

F# interactive is a powerful development tool as it allows to run either WinForm or Wpf window and invoke arbitrary code in there. This gives a way for a 'try-before-you code' approach. Very often I wish to 'break the boundaries' explicitly and invoke private/protected methods access/change private fields and properties Is there a...

Select uniques, and one of the doubles

I have a table with columns A, B and C. Column A might have duplicates. I need a query that will get me a resultset with unique values in column A, and I don't care which possible duplicate it takes. I don't know anything beforehand about the rest of the data. An example might be: A B C 1 8 8 1 7 7 2 10 10 In...

Add 2 extra columns to an excel file

LS, Since the Microsoft ODBC Excel Driver doesn't support ALTER TABLE/DELETE FROM(/UPDATE?) statements, I'm using alternative ways of getting the right data in the right place. I still have one problem with getting 2 columns added to an excel sheet. Someone told me to use: SELECT *, newcol1, newcol1 INTO newExternalSheet FROM thisShe...