workaround

Ways to circumvent the same-origin policy

The same origin policy I wanted to make a community wiki regarding HTML/JS same-origin policies to hopefully help anyone searching for this topic. This is one of the most searched-for topics on SO and there is no consolidated wiki for it so here I go :) The same origin policy prevents a document or script loaded from one origin ...

Entity Framework 4 - How work around to use cast with interfaces

How can I use cast in Linq to Entities? I need something like this: if (typeof(myObject) is IMyInterface) { return MyObjectSet.Where(x => ((IMyInterface)x).MyProperty == 1); } If I try above code, I get an exception. It's an expected behavior of EF or it's a bug? ...

How to investigate client side WSAECONNABORTED happening very often only on machines with NVDIA Quadro?

We have a C++ client/server application in which the client retrieves and renders 3D content from a server. Our client disconnects from the server very often (more than 50% of runs after less than 1 minute) with recv failing and WSAGetLastError returning WSAECONNABORTED. But the strange thing is that this happens only when: the client...

Looking for a better workaround to Chrome select on focus bug

I have the same problem as the user in this question, which is due to this bug in Webkit. However, the workaround provided will not work for my app. Let me re-state the problem so that you don't have to go read another question: I am trying to select all the text in a textarea when it gets focus. The following jQuery code works in IE/FF...

FireFox overflow bug#550882: (overflow:hidden) to (overflow:visible) with script = no scrollbars!

I ran into a problem recently and found out that this is a bona-fide bug in FireFox 3.6.x. What happens is this: If you set up your page's initial CSS overflow property on the body tag to be: hidden, THEN you change the style value via a script (like javascript) to:visible.... FireFox does NOT render the scrollbars on screen. You can st...

Weird idea: C# - declare a method insinde another method.

Okay, in python one can do this: def foo(monkeys): def bar(monkey): #process and return new monkey processed_monkeys = list() for monkey in monkeys: processed_monkeys += bar(monkey) return processed_monkeys (This is just a stupid example) I sometimes miss this functionality of declaring a method inside ...

Using MYSQL DB, unit testing with HSQLDB = Problems

I recently modified a MYSQL query using the keyword RLIKE however when I ran the unit test which uses HSQLDB in order to mock a database it throws an unknown SQL token exception. In order to resolve this currently I have commented out these tests, but would like to find a work around so I can actually test my code. My google-fu faile...

Multiple columns, column-span workaround

hey there... i'm working with safari and i need to have a multiple columns text (in a single <p> through webkit-column-count), but also i need to make an image span upon two or more columns (i know it's not supported yet, but i'm asking for some workaround if possible) meaning: i want this layout --------------------------- image ---...

Which file downloads are blocked by Internet Explorer's Security Bar?

Standard scenario: ajax-heavy web application with reports that can be downloaded as files. Problem: Internet explorer blocks file downloads with its yellow "security bar". When you click on the bar and allow to download, the whole page gets refreshed and data entered is lost. Question: what counts as a blockable download? Does it look...

Working around Python bug in different versions.

I've come across a bug in Python (at least in 2.6.1) for the bytearray.fromhex function. This is what happens if you try the example from the docstring: >>> bytearray.fromhex('B9 01EF') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: fromhex() argument 1 must be unicode, not str This example works f...

SWF loaded twice in Firefox, workaround needed

I have the same problem as the following stackoverflow question: http://stackoverflow.com/questions/499949/flash-loads-twice-workaround but the provided solution is not working for me (my script runs after the DOM ready and a delay), is there any workaround to fix the Firefox bug which is fixed in the bugzilla but still exists? upda...

ASP.NET MVC Validationsummary with excludePropertyErrors = true renders empty if the model is invalid

Say you have a standard ValidationSummary: <%: Html.ValidationSummary(excludePropertyErrors: true) %> If the ModelState contains model errors for properties but not for the model itself the ValidationSummary renders the following HTML: <div class="validation-summary-errors"><ul><li style="display:none"></li></ul></div> Which is dis...

jquery ajax 1.4.2's ifModified workaround ?

Hi, I have a script that looks like this : <script type='text/javascript'> $(document).ready(function(){ setInterval(function() { $.ajax({ url: "../Ps/th.php", ifModified:true, success: function(data, textStatus){ if(textStatus!="notmodified") { $("#display").append(data); alert...

C++ template work-around

On my C++ project, I recently stumbled upon a little problem: Templates. I declared a class, Data in my header file (which is shared by each .cpp), and gave it a template function. I implemented it in data.cpp. I soon remembered how templates are compiled on the spot, when they are referred to, and this breaks the declaration/implementa...

What is a workaround for placing a background image in Gmail ?

I understand gmail does not support background-images or background: url('.. in Gmail. I was wondering if anyone had a sizeable workaround to this? This is for emails I send via a server to a user's email accounts if they are using gmail. ...