context

Using Perl, how do I show the context around a search term in the search results?

I am writing a Perl script that is searching for a term in large portions of text. What I would like to display back to the user is a small subset of the text around the search term, so the user can have context of where this search term is used. Google search results are a good example of what I am trying to accomplish, where the cont...

How can I change my context root in WebWork?

I am currently working on a huge web application consisting of JSPs. Also i use WebWork framework. Until now the context root of my application was "/". Now I want to change that to "nstat". How should I handle the relative and absolute calls from my JSPs? ...

jQuery: Adding context to a selector is much faster than refining your selector?

I just noticed that adding context to the selector is much faster than refining your selector. $('li',$('#bar')).append('bla'); Is twice as faster than: $('#bar li').append('bla'); Is this generally true? ...

Create new threads or get more work for threads

I've got a program I'm creating(in C#) and I see two approaches.. 1) A job manager that waits for any number of X threads to finish, when finished it gets the next chunk of work and creates a new thread and gives it that chunk or 2) We create X threads to start, give them each a chunk of work, and when a thread finishes a chunk its as...

Seeking One-Size-Fits-All Context Based Storage

First off, I wish context based storage was consistent across the framework! With that said, I'm looking for an elegant solution to make these properties safe across ASP.NET, WCF and any other multithreaded .NET code. The properties are located in some low-level tracing helpers (these are exposed via methods if you're wondering why they...

Visual Studio Context

In Eclipse we are using Mylyn to have an overview of our Trac Tickets. A nice feature is the Context attached to a Ticket. For example it remembers the classes you worked on when that ticket was active. If you open that ticket a month later, then Mylyn opens all the classes. Is there something similar in Visual Studio? ...

How do I create an object that returns different values in different scalar contexts?

I want to return a different value in string context and numeric context like $! does. I know I can find out whether I am in list or scalar context with wantarray, but is there any way in pure Perl to determine which scalar context I am in? I assume there is an answer in XS as well and I am willing to take that answer if there is no wa...

Instantiating a context in LINQ to Entities

I've seen two different manners that programmers approach when creating an entity context in their code. The first is like such, and you can find it all over the MSDN code examples: public void DoSomething() { using TaxableEducationEntities context = new TaxableEducationEntities()) { // business logic and whatever else ...

Dynamic LINQ context

I'm trying to figure out how to create a dynamic context, and what I mean by that is I have two databases: one for testing, and one for production. Depending on where my website is hosted, I want my context to be pointing at one of the two. So, in my web.config I have: <add name="Testing_ChannelsEntities" connectionString="removed for b...

C# - Context Menu Strip has scroll behaviour when user hits arrow keys

I have a context menu strip with 8 items and two separators. When the user brings up the context menu strip, then hits the arrow key to scroll through the items, hitting the eighth item causes the menu to 'scroll' up, leaving blank space at the bottom. Is there any way to prevent that behaviour? ...

How do OpenGL contexts and device contexts work?

I'm new to U/I programming, and I'm trying to get started with OpenGL. When I run an example program which creates a new OpenGL window with GLUT, it works fine. Good. However, in the context of another program, where I have to respond to Draw events (on Windows), with a device context passed to me - and where I might not have GLUT ava...

Is it possible to use OpenGL in a window that is already using GDI+ ?

Basically I am being called to render to an offscreen DC which is set up (I'm not sure how) to use GDI+. When I try to associate an OpenGL context with the DC, it just fails (i.e. returns zero but no error). SetPixelFormat also fails (probably because it is already set up?), again by returning zero, not an error. Anyone know whether i...

VSTO and Outlook 2003 Context menus

Hi Guys, I want to have outlook 2003/2007 integration with my application using VSTO. with outlook 2007 it's OK - i have all the hooks i need but with outlook 2003 i can't find how to add conext menu item to the mail items in the inbox. I didn't find any event handler for populating the context menu like the one in the 2007 version. D...

Is it possible to add an item to the right-click context menu of a Mac OS programmatically?

I have a program that works with a variety of files on both the Windows and Mac OS. I would like to give the user the option of adding a new option to their right click/control click context menu to the effect of "Compress with [Name of App]". I know this is quite possible in Windows with modifications to the registry, but is there a w...

What is the equivalent to ASP.NET's HttpContext.Current.Items in Classic ASP?

The title says it all really, but to clarify what HttpContext.Current.Items is, it's a store that has a life span of the HTTP request. I'd like to know the Classic ASP equivalent of this. ...

asp.net WebForms emulation of the state in the stateless env

I'm looking for an elegant way to have AppContext configured right and here is it: public class AppContext : IAppContext { public AppContext() { Application = new AppStorage(); // app scoped hashtable Local = new LocalStorage(); // current thread scoped hashtable Session = new SessionStorage(); ...

Get context for search string in text in C#

Given a string text which contains newline there is a search keyword which matches an item within the text. How do I implement the following in C#: searchIdx = search index (starting with 0, then 1, etc. for each successive call to GetSearchContext. Initially start with 0. contextsTxt = string data to search in searchTxt = keyword t...

Is there a WCF equivalent to RPC context handles?

I'm updating an old c++ service to use WCF instead of RPC and there is an issue as to what type to use when sending and receiving a handle (HANDLE, void*..etc). In the updated service I currently have it using IntPtr, but this does not work when going from a 64 bit version of the service to a 32 bit version. The IntPtr can not deserializ...

Mobile Contexts for Information Retrieval

Hello, I work with contexts for a Mobile Wiki Software. Contexts are used to serve the right information for a specific situation out of large pool of information units. For example: When you are at the customer, the system checks your location and presents you location based information. Another example: You are at the customer and t...

(Ruby,Rails) Context of SELF in modules and libraries...?

Hi All, Quick question regarding the use of "SELF" inside a module or library. Basically what is the scope/context of "SELF" as it pertains to a module or library and how is it to be properly used? For an example of what I'm talking about, check out the "AuthenticatedSystem" module installed with "restful_authentication". Best NOTE:...