context

Thread context on Delphi

I am creating a server that starts a thread (listening thread). This thread listens for connections and does it's thing. Eventually it may receive some data, that I want to pass to the creator of the server: My program --> Creates my server --> Creates the listener --> Creates a thread for every client Now the question is: if I assign ...

JavaScript context

var User = { Name: "Some Name", Age: 26, Show: function() { alert("Age= "+this.Age)}; }; function Test(fn) { fn(); } Test(User.Show); =============== Alert shown by code is "Age= Undefined". I understand as User.Show function is called from inside of Test(), refers 'this' of 'Test()' function rather than 'User'...

Is there a Perl shortcut to count the number of matches in a string?

Suppose I have: my $string = "one.two.three.four"; How should I play with context to get the number of times the pattern found a match (3)? Can this be done using a one-liner? I tried this: my ($number) = scalar($string=~/\./gi); I thought that by putting parentheses around $number, I'd force array context, and by the use of scal...

How do I check in PHP that I'm in a static context (or not)?

Hello, Is there any way I can check if a method is being called statically or on an instantiated object? Jamie ...

Does iPhone provide any API for inserting menu selections into e-mail, SMS and Addressbook context menus?

The Blackberry APIs allow one to insert custom menu items (and corresponding event handlers) into their standard email, SMS and Address book context menus. Is there any supported way to do this with iPhone APIs? Thanks. ...

Setting values from a class to Spring context file

We usually define some beans with their properties in the Spring context file and write some setter methods in the class. Let's say I wanna do the opposite. I have a bean in the context file and want to declare some properties from the class..or initialize values of declared properties in the context from the class. How do I do that? ...

How to get django context automatically in Jinja2 filters?

For example, I have an paginator object with a lot of attributes, and don't want do write something like {{ paginate(paginator) }} in templates. How can a get context automatically in the filter function, like a django register.inclusion_tag(…, takes_context=True)? Yes, of course, I can do something like paginate(paginator), but it loo...

Windows Explorer Context Menu Application with Multiple Arguments

Hi, i have read heaps of articles about how to add custom right click context menu's to windows explorer but all of them only work if you have only 1 single file highlighted. The app i am writing is a utility app and i would ideally like it to work on %n number of files. Can this be done? ...

Entity Framework - Deleted association still appears in the second call

Hi, We have a long entity framework context running (don't ask why...), with a query which retrieves a user entity with its associations: var user = entities.UserSet.Include("UserAddresses") .Where(u => u.Id == 1).FirstOrDefault(); If a row of a user address is deleted from the database (by another process), and we ...

Django: which context belongs to which template

Hi all, I'm on the verge of testing attributes in response.context with django's own test client (in django.test.client). I get back 5 response.context's. As it seems one for each template part, because when I remove a nested template part (e.g: {% include "sometemplate.html" %}) from the base template the amount of returned context's ...

Django: Setting context by url's GET

How can you make a specific action based on the url by base.html? I have two if -clauses as context statements in base.html. If there is algebra in the GET, then the given context should be shown. My url.conf from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^algebra/$', 'algebra'), (r'^mathematics/$', 'ma...

Tomcat and Context paths

I created a web application in Netbeans, and it packages the application in a file called "aa-bb.war". When I run the project in netbeans, I can access it at "localhost:8080/aa/bb". This is all good. Moving the .war file into a standard tomcat installation though, gives me problems. When I drop the .war into the "webapp" directory, it g...

Contextual/RunWhen validation in ASP.NET MVC 2?

Does the latest ASP.NET MVC 2 validation allow contextual validation? I'm looking for something similar to Castle Validator's "RunWhen" property. It allows you to declare that a validator should only be executed in a particular context. The most obvious use is for Identity fields. The following would specify that the int ID field is ...

Drupal panel / view not showing in print view

I have a Drupal 5 site that is using the Printer, e-mail and PDF versions module that appears to be creating a print version of a URL like so: screen: country/uk print: print/country/uk Each page is set up using panels and has the country image and a view of most recent country news below. On the print/country/xxx the view isn't pr...

Pythonize Me: how to manage caller context variables in Python? (Python/Django)

I'm trying to refactor a fairly hefty view function in Django. There are too many variables floating around and it's a huge function. Ideally, I want to modularize the view into logical functions. However, I have to pass the function context around to get easy access to the variables. For example, def complex_view(request, slug): ...

Context Path in Jboss

Hi. There is a war deployed in JBOSS currently. If I want to figure out the context path for the WAR in Jboss, where should I be looking at? Server.xml? Thanks. ...

Implementing a bread crumb in Django

I'm writing an application in Django and I want every page to contain a bread crumb. The bread crumb needs to look like "Group A > Group A.1 > Group A.1.1". On each page the bread crumb will be different. Group is a model. The thing confusing me is getting the group object into the context. I am considering writing a context processo...

C# receiving argumens from Windows Context menu

Hi, I have done this before but for the life of me cant remember how to do this... In my explorer context menu i added a new entry (go to regedit...go to HKEY_CLASSES_ROOT...bla bla bla)... Nou when i click on my option i want to pass in the file path, file name, those kind of things to my application...and then use it there? Anybody??...

rhino embedding

Anyone understands the rhino javascript Contexts? I cannot find any useful documentation about it. My main problem is the Context.exit() (really should be cx.exit()) which from what I understand exits the context associated with the current thread? Does that mean I need to keep track of what which thread does? main thread: Context...

Changing Tomcat web application context

I have web application, which was designed and always worked under root context ("/"). So all css, js and links started with "/" (for example "/css/style.css"). Now I need to move this web application to some different context (let's say /app1). It is easy to change server.xml configuration file and bring up web application in new contex...