context

Get context-param in asynchronous method seam

Hi guys, I want to get a context-param configure in my web.xml. In a method call normally (with seam 2.2.0), I do this: readDirectory = (String) FacesContext.getCurrentInstance() .getExternalContext().getInitParameter( "ReadDirectory"); It's work fine, but in asynchronous method (@Asynchronous)...

Scope within an object literal

Hi Folks, I'll start with an example snippet: self.addwidget({ box: ns.box({ text: 'Foobar', fromTop: ~~(Math.random()*window.innerHeight), fromLeft: ~~(Math.random()*window.innerWidth), toTop: 240, toLeft: ...

How do I get Eclipse navigator to refocus, based on a new level of filter in mylyn?

Hi everyone, I am currently using eclipse and Mylyn. My problem is that when I change the level of interest required for an item to show up in mylyn context, I cannot get eclipse navigator to accept the new settings. In fact, if I close the task and open it again, the degree of interest meter-thingy has reset itself. The only solution ...

Trying to understand python with statement and context managers

Hi , I am new to this and am just trying to understand the with statement.I get to understand that it is supposed to replace the try except block.Now suppose I do something like this:- try: name='rubicon'/2 #to raise an exception except Exception,e: print "no not possible" finally: print"Ok I caught you" Now how do I replace ...

android show context menu from code behind

Hi all, This might be a simple question, but i've been looking around and can't find the answer, well, as my title said, is there any code to show the context menu on the android from a code, instead press the menu button? eg. when i touch the screen then it'll call the context menu? Regards, AnD ...

Problems with context when trying to display Toast

I try to display a Toast inside a AsyncTask. This first piece of code is placed in an activity that we may call MyActivity, and works fine: Toast.makeText(this, "Toast!", Toast.LENGTH_SHORT).show(); Then I create a new instance of MyObject and calls method(). This code is also placed in MyActivity. MyObject obj = new MyObject(this);...

Android : how to set context to a view in layout xml ?

I am using WebView in an ActivityGroup and it will throw an exception if WebView show Dialog and complain the activity is not valid. But it's okay if I set the context of the WebView to the TOP activity. So I wish to know how to set the context in the layout xml ? ...

NHibernate's ICurrentSessionContext is being cleaned up

I have a Windows.Forms application and we need to use one session and keep it opened, because our application is a legacy product that we're moving to NH. Here is the code that gets a session: public static ISession GetCurrentSession() { ISession session; if ( CurrentSessionContext.HasBind( SessionFactory ) ) { ses...

JSF application giving 404 for a sub-context

My JSF application works in my local tomcat for URL like http://localhost:8080/MyApp/admin, but not on the hosting server, the URL there is http://www.myapp.com/admin Do I need to do something with 'context.xml'/ put BocBase & AppBase. I got these things googling, but could not understand what exactly I have to do. Can anyone help me wit...

Can the context url be obtained from a WebMethod (Java)?

Inside a webservice defined like @WebMethod public ResponseType myMethod() { ... } How can I get the calling url? In a http servlet I can use the ServletRequest object to get the url with something like request.getRequestURL(). Thanks, Adam ...

Context menu shows up completely black

I followed the instructions and examples on Android website to create a context menu but mine shows up completely black and i cannot change any options in it ; anyone out there had the same experience and can help me solve this issue. FWIW, here are my class .java and the menu .xml files <?xml version="1.0" encoding="utf-8"?> <menu xml...

Mimic Context.getExternalFilesDir() prior to Android API Level 8?

Android API level 8 introduced the Context.getExternalFilesDir() method, providing a File object reference to an SD card path specific to your app. I am wondering how to mimic this as low as API level 5. I see there is a Context.getDir() method, but I can't tell from reading about it how this differs. ...

How to specify sub-context in JSF web application?

In my JSF application, I have a sub-context 'admin' and I have some pages under 'web/admin' folder. I am able to access all the pages under 'web' with the URL www.abc.com but I am getting 'requested resource not found' for the request www.abc.com/admin. I could make out that this is the issue with the 'context' specification in 'context...

tomcat 6: accessing web app without war name in the URL and without overwriting ROOT?

in my war's META-INF/context.xml I have: <?xml version="1.0" encoding="UTF-8"?> <Context path="/foobar" docBase="my-long-war-name"/> I deploy my war to the webapps/ directory and I confirm that my contex.xml is in %CATALINA_HOME%\conf\Catalina\localhost with the name my-long-war-name.xml Now, instead of accessing my REST service thr...

Extending Application

I'd like to extend Application in my Android app. I've done this such that I've created an extended Application object called MyApplication and added it to the manifest. I'd now like to add some getters and setters to hold some information. It looks like I'll need to pass the application Context to any classes which do not contain a C...

CD - Writing Custom Contexts & Scopes

Hi all, I would like to have my own contexts for some CDI-based projects. I need (want) custom scopes so that I can isolate the how long a component lives and where. To implement your own context, you need to implement the Context interface which is pretty self-explanatory, but how or where to you really define when it is created? Th...

Access Android activity stack from asynchronous thread?

There are a ton of activity stack related questions on StackOverflow, but I didn't really see any that answered the question I have. I'm working on an online game that (for now) has 3 different activities: Login/Register Menu (seen when logged in, includes "new game", "my stats", and a few other things...I'm just worried about the "ne...

Rails 3 routing based on context

Greetings, I am trying to implement a "context" system similar to the one used by GitHub. For example, a Post may be created belonging either to the User or one of the Companies the User belongs to depending on whether to User is in the "User" context or a context that refers to one of the Companies. As a part of this, I'd like to be a...

Measure ContextSwitch Time C (Windows)

Hello, I need to implement a method that can measure Time and CPU cycles of context switch between threads in Windows. Here is my code #include <stdio.h> #include <windows.h> #include <time.h> LARGE_INTEGER initialTimeStamp, finalTimeStamp, freq; DWORD ThreadProc(LPVOID lpdwThreadParam) { SwitchToThread(); return 0; } int main() ...

Drawing a circle on the canvas using mouse events

I am trying to draw a circle using mouse on the canvas using mouse events, but it does not draw anything: tools.circle = function () { var tool = this; this.started = false; this.mousedown = function (ev) { tool.started = true; tool.x0 = ev._x; tool.y0 = ev._y; ctx.moveTo(tool.x0,tool.y0); }; this.mousemove = function (ev) { var center...