context

Why use Tomcat's context.xml files to declare DBCP resources?

Im having trouble understanding why I would use a context.xml file to declare a resource, in my case a database connection pool. Hopefully I've got my facts straight in the following arguments against using context.xml As far as I can tell, resources declared in /META-INF/context.xml are only available within the context, so there's no...

Javascript literal loses its variables when called with setTimeout

Hi, I have this piece of code, and it doesn't work as I expect (it's demo code, distilled from a larger program): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Test</title> <script language="javascr...

Turning a complex jquery css selector into a context for caching

After feedback, complete rewrite of the question. I have the following mark up : <body> <h1>Title</h1> <p>bla</p> <div> ... <!-- a thousand tags --> </div> <div id="do-not-modify-me"> <!-- a hundred tags --> </div> </body> I can access to : <h1>Title</h1> <p>bla</p> <div> ... <!-- a thousand tags --> ...

Can you explain the Context design pattern a bit?

I've started to read about the Context design pattern. Here's what I understood from the text : you have a map containing all your variables you pass it around to whoever needs it, so that you won't have to send all the variables as method parameters Did I "get" it? ...

Windows: avoid pushing full x86 context on stack

I have implemented a language under MS Windows that uses cactus stacks to implement parallel programs. The stack chunks are allocated on a per-function basis and are just the right size to handle local variables, expression temp pushes/pops, and calls to libraries (including stack space for the library routines to work in). Such stack ...

How to put variables on the stack/context in Python

In essence, I want to put a variable on the stack, that will be reachable by all calls below that part on the stack until the block exits. In Java I would solve this using a static thread local with support methods, that then could be accessed from methods. Typical example: you get a request, and open a database connection. Until the re...

Context parameters in VSTS Web Tests

Hi, Can anyone help me with the following question? How can a context parameter be used in a parameterized request? I have created an extraction rule that populates a context parameter (say Param1). I also have parameterized a subsequesnt request and want to use this context parameter in that request. Eg. "{DetailArray:strUserID:xyz,int...

Log4net: context only for exception

Hi I'm looking for a way to collect a set of data, that will only be used for debugging, the data should only be logged if I log an exception. AFAIK it can happend when ILog.Error, Fatal or Debug with an exception argument when logging other data with an exception, the data shouldn't be logged. I plan to use the GlobalContext or Thread...

How can I keep the context of 'this' in jquery

I have something like this: var Something = function(){ this.render = function(){}; $(window).resize(function(){ this.render(); }); } The trouble is that inside the anonymous function 'this' refers to the window object. I know I could do something like: var Something = function(){ this.render = function(){}; var tempThi...

How can I configure Spring to save as much memory as possible?

We're deploying an application on a semi-embedded device that has memory constraints. Looking to save whatever we can we are analysing heap dumps of the app and attacking the biggest consumers. We use Spring 2.5 together with Spring DM 1.1 and we notice that some of our bundles with more complex Spring contexts are using up quite a bit...

Ruby a clever way to execute a function on a condition

Hey, As a bit of a fun project I'm implementing a Beatnik interpreter in Ruby. If you've never heard of Beatnik it's an esoteric programming language in which operations are specified by the "scrabble score" of the words in the source code. Anyway, the implementation requires a different operation to happen for different scrabble score...

Popup blocked, jquery window.open in success: AJAX? outside ok.

Hi there, can anyone help, I have some jquery and chrome is blocking the popup i am creating, after some investigation it appears to be an issue with window.open in sucess event of an ajax call.. Is there a way round this? My jquery ajax call needs to return the URL i need to open :-) ... so i am bit stuck... If i place the open.windo...

Sharing Spring Security Configuration Between Applications

I'm brand spanking new at Spring and have gotten a majority of the knowledge I do have from the Spring Recipes book from Apress. I've got LDAP authentication working with Spring Security within one webapp. I would like to rip out my application context beans and properties files from this one webapp, however, and somehow externalize the...

Distinguishing source context in log4net output

I'm fairly new to log4net, and I can't seem to find any clear examples of how to handle this situation. I have a communication stack that consists of three layers: hardware, transport, and protocol. The three layers are contained inside of a manager class. As far as the user of the code is concerned they create the manager with a hard...

Mozilla Rhino: Default JavaScript Compliance Level

Hi there, to execute JavaScript in Rhino one has to create an execution context for the script. The constructor of the Context class uses the JavaScript compliance level VERSION_DEFAULT. protected Context(ContextFactory factory) { if(factory == null) { throw new IllegalArgumentException("factory == null"); } this.fa...

SSI Jboss not including html (context issues)

Hi I hope that someone out there could give a clue on where to here. Here's the problem. I have enabled SSI in some jboss under Solaris, I have the application web.xml configured as follows: <filter> <filter-name>ssi</filter-name> <filter-class> org.apache.catalina.ssi.SSIFilter </filter-class> <init-param> <param-name>conte...

Why does map return an empty array?

I have a problem in Perl I don't understand. I stripped it down to this very short code. Why does Perl's map function return an empty array? Shouldn't it return an array with 9 undefs? sub mySub{ return; } my @arr = (1 .. 9); my @arr2 = map( mySub($_), @arr ); print @arr . ' ' . @arr2, "\n"; It prints "9 0". It is probably som...

jQuery selectors performance

Hi I know I'm just being OCD about a few milliseconds worth of performance time, but I was just wondering why the following is true for me. It seems goes against my logic. I currently have a div that has fades out the image inside on hover: $('div.someclass').hover(function() { $(this).children('img').fadeOut(function(){ /...

WCF AuthorizationContext not cleared between calls from different clients. (was: When does a WCF service session actually end?)

I was doing some unit testing, and ran into an interesting problem in WCF. I have a service using the wsHttpBinding, configured as such: <bindings> <wsHttpBinding> <binding name="wsHttpUnsecured"> <security mode="None"> <transport clientCredentialType="None" /> <message clientCredentialType="None" /> <...

Using Jeremy Mcanally's context for testing in Rails 2.3.x

I'd like to try out Jeremy Mcanally's context gem for testing: http://github.com/jeremymcanally/context/tree/master It does not work out of the box with Rails 2.3.x, anyone got it working? EDIT hi mike, tx for ur help. i installed the gem like u said, and have added "require 'context'" to test_helper.rb however, it stil doesn't seem t...