Search Results

Search found 5586 results on 224 pages for 'global illumination'.

Page 145/224 | < Previous Page | 141 142 143 144 145 146 147 148 149 150 151 152  | Next Page >

  • Is it possible to programmatically control c# health monitoring without using the web.config file?

    - by Adam
    I have developed my own custom provider for the health monitoring; however, I use parameters in the constructor and this is not allowed when using the health monitoring from the web.config file. Does anyone know if I can turn on/off the monitoring and have it watch properly through code (possibly in my global.asax file on application startup). Or, is it possible for me to create my own watcher that will do the same thing as the health monitor. Or, finally - can I just pass variables from the web.config setup (i'm not familiar with the public token part of the provider type declaration). Thanks in advance

    Read the article

  • removing dashboard menu options for the user role editor

    - by styler
    I want to remove some of the dashboard menu tabs on my wordpress site using this code: //Remove some menu options function remove_menus () { global $menu; $restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Contact'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins')); end ($menu); while (prev($menu)){ $value = explode(' ',$menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);} } } add_action('admin_menu', 'remove_menus'); At the moment this removes the menus from all user roles, how could I update this to just apply to editors? Ive also got this snippet of code but dont know how to combine it with what I have: $editor = get_role(‘editor’); $editor->remove_cap(‘publish_pages’);

    Read the article

  • Asp.Net error reporting with stacktrace

    - by Helo
    I have an Asp.Net web site set up to log errors using Log4Net (in global.asax) and redirect users to a custom error page (set up in web.config with: ). On this error page the users have the opportunity to write about what they did when the error occurred and post the description back to us to help fix the problem. My question is this: How do i connect the error stacktrace to the users error report? It appears that .Net has handled the error when it was written to the log file and the custom error page has no information about the stacktrace. If only I could see the stacktrace from the custom error page code-behind my problem would be solved.

    Read the article

  • How to see variable in calling function in visual studio?

    - by carter-boater
    Hi all, Does anyone know how to watch a variable in calling function. For example: C#: void fn a() { int myVar=9; b(); } b() { Throw new Exception(); } How can I watch myVar when I get the exception in function b?? I have a really big recursive function with in a loop and get an exception in one iteration. I don't know which iteration it belongs to$%^&*(. The thing I did was to promote my intersted variable to global so I can watch them anywhere. However, I don't think that's a good idea only for debug. Thanks everyone!

    Read the article

  • How can I use javascript to convert relative href attributes into absolute paths?

    - by jhensley2
    I have a template that gets screenscraped from an outside vendor and need to include absolute paths in the navigation so the externally hosted content will properly link back to our site. Right now the page/template is driven by a global menu app written by our back end development staff... so anyone who updates our site goes in and changes the menus and their paths... Right now all of the links are linking to relative paths back to the root. For example <a href="/">Home</a> <a href="/news/">News</a> <a href="/media/">Media</a> <a href="/other/">Other</a> I need a simple way (preferably with jquery) to prepend "http://www.domain.com" to each of those links.

    Read the article

  • Reusing a vector in C++

    - by Bobby
    I have a vector declared as a global variable that I need to be able to reuse. For example, I am reading multiple files of data, parsing the data to create objects that are then stored in a vector. vector<Object> objVector(100); void main() { while(THERE_ARE_MORE_FILES_TO_READ) { // Pseudocode ReadFile(); ParseFileIntoVector(); ProcessObjectsInVector(); /* Here I want to 'reset' the vector to 100 empty objects again */ } } Can I reset the vector to be "vector objVector(100)" since it was initially allocated on the stack? If I do "objVector.clear()", it removes all 100 objects and I would have a vector with a size of 0. I need it to be a size of 100 at the start of every loop.

    Read the article

  • Using variable for tag in getElementsByTagName() for PHP and XML?

    - by Jared
    See my PHP: $file = "routingConfig.xml"; global $doc; $doc = new DOMDocument(); $doc->load( $file ); $ElTag = "Route"; $tag = $doc->getElementsByTagName($ElTag); XML is: <Routes> <Route></Route> <Route></Route> <Routes> Error returned is: Fatal error: Call to a member function getElementsByTagName() on a non-object I'm not sure how to do this?

    Read the article

  • my window's handle is unused and cannot be evaluated

    - by numerical25
    I am trying to encapsulate my Win32 application into a class. My problem occurs when trying to initiate my primary window for the application below is my declaration and implementation... I notice the issue within my class method InitInstance(); declaration #pragma once #include "stdafx.h" #include "resource.h" #define MAX_LOADSTRING 100 class RenderEngine { protected: int m_width; int m_height; ATOM RegisterEngineClass(); public: static HINSTANCE m_hInst; HWND m_hWnd; int m_nCmdShow; TCHAR m_szTitle[MAX_LOADSTRING]; // The title bar text TCHAR m_szWindowClass[MAX_LOADSTRING]; // the main window class name bool InitWindow(); bool InitDirectX(); bool InitInstance(); //static functions static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); int Run(); }; implementation #include "stdafx.h" #include "RenderEngine.h" HINSTANCE RenderEngine::m_hInst = NULL; bool RenderEngine::InitWindow() { RenderEngine::m_hInst = NULL; // Initialize global strings LoadString(m_hInst, IDS_APP_TITLE, m_szTitle, MAX_LOADSTRING); LoadString(m_hInst, IDC_RENDERENGINE, m_szWindowClass, MAX_LOADSTRING); if(!RegisterEngineClass()) { return false; } if(!InitInstance()) { return false; } return true; } ATOM RenderEngine::RegisterEngineClass() { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = RenderEngine::WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = m_hInst; wcex.hIcon = LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_RENDERENGINE)); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = MAKEINTRESOURCE(IDC_RENDERENGINE); wcex.lpszClassName = m_szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); return RegisterClassEx(&wcex); } LRESULT CALLBACK RenderEngine::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(m_hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } bool RenderEngine::InitInstance() { m_hWnd = NULL;// When I step into my code it says on this line 0x000000 unused = ??? expression cannot be evaluated m_hWnd = CreateWindow(m_szWindowClass, m_szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, m_hInst, NULL); if (!m_hWnd)// At this point, memory has been allocated unused = ??. It steps over this { return FALSE; } if(!ShowWindow(m_hWnd, m_nCmdShow))// m_nCmdShow = 1 and m_hWnd is still unused and expression {//Still cannot be evaluated. This statement is true. and shuts down. return false; } UpdateWindow(m_hWnd); return true; } // Message handler for about box. INT_PTR CALLBACK RenderEngine::About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (message) { case WM_INITDIALOG: return (INT_PTR)TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; } break; } return (INT_PTR)FALSE; } int RenderEngine::Run() { MSG msg; HACCEL hAccelTable; hAccelTable = LoadAccelerators(m_hInst, MAKEINTRESOURCE(IDC_RENDERENGINE)); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam; } and my winMain function that calls the class // RenderEngine.cpp : Defines the entry point for the application. #include "stdafx.h" #include "RenderEngine.h" // Global Variables: RenderEngine go; int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); // TODO: Place code here. RenderEngine::m_hInst = hInstance; go.m_nCmdShow = nCmdShow; if(!go.InitWindow()) { return 0; } go.Run(); return 0; }

    Read the article

  • Different ways to use browser and system media resources

    - by utype
    Examples: <img src="system://media/icons/logo.png" alt="OS"> <style> img.browserIcon {background-image: url(browser://media/icons/logo.png); width: 16px; height: 16px;} </style> On Firefox you can access to some resources like this: <style> .button {background: transparent url(chrome://global/skin/button/startcap.png) no-repeat scroll left top} </style> Is it possible to access to rasterized font data or system sounds? Where can I get transparent 1px gif?

    Read the article

  • Referencing control on one form from another form VB.NET

    - by Tom
    My gosh man, why is this so complicated in VB.NET? As you can guess, I'm kind of new to .NET and just want to reference a control on one form from another. Usually I would just do Form.Control.Property but that doesn't work and every example I've found through Google doesn't work for me. It just seems overly complicated with public classes, etc. Is there a more simpler way to do this? I'm ready to throw in the towel and just use a global variable at this point. I have the form containing the control I want to reference, frmGenerate which has a textbox called txtCustomerNo. From this form through a button's click event I want to show another form, frmCustomers, and have that form reference the value in txtCustomerNo. frmCustomers.ShowDialog() It has to be something simple that I'm just not grasping. Thanks.

    Read the article

  • C++: Define simple string?

    - by Jason
    This thing is really wracking my mind. I'm learning C++ and I wanted to define a constant that I can use in another function, A short answer on how to do this will be fine.. Lets say at the beginning of my code I want to define this constant: //After #includes bool OS = 1; //1 = linux if (OS) { const ??? = "clear"; } else { const ??? = "cls"; } I don't know what type to use to define the "clear" string... I'm so confused. Later on I want to use it within a function: int foo() { system(::cls); //:: for global return 0; } How would I define the string up top, and use the string down below? I heard char only had one character and things... I'm not sure how to use , since it says it's converting string into const char or something.

    Read the article

  • Killing a script launched in a Process via os.system()

    - by L.J.
    I have a python script which launches several processes. Each process basically just calls a shell script: from multiprocessing import Process import os import logging def thread_method(n = 4): global logger command = "~/Scripts/run.sh " + str(n) + " >> /var/log/mylog.log" if (debug): logger.debug(command) os.system(command) I launch several of these threads, which are meant to run in the background. I want to have a timeout on these threads, such that if it exceeds the timeout, they are killed: t = [] for x in range(10): try: t.append(Process(target=thread_method, args=(x,) ) ) t[-1].start() except Exception as e: logger.error("Error: unable to start thread") logger.error("Error message: " + str(e)) logger.info("Waiting up to 60 seconds to allow threads to finish") t[0].join(60) for n in range(len(t)): if t[n].is_alive(): logger.info(str(n) + " is still alive after 60 seconds, forcibly terminating") t[n].terminate() The problem is that calling terminate() on the process threads isn't killing the launched run.sh script - it continues running in the background until I either force kill it from the command line, or it finishes internally. Is there a way to have terminate also kill the subshell created by os.system()?

    Read the article

  • How can I have a Windsor IoC container that can be shared amongst my classes but not shared across m

    - by Si Keep
    I am building a set of class libraries that produce office open xml based reports and I am using a static Windsor IoC container. My problem is that one possible entry point to the reporting system is via a web front end which means that the reporting systems static IoC Container is being shared amongst multiple web requests which causes exceptions as for each new request the reporting system is trying re-register components in Windsor that were already registered by an earlier request. I dont want to move the registration into the web app global.asax as my reporting system will no longer be stand-alone. How can I have a Windsor IoC container that can be shared amongst my reporting classes but not shared across multiple web requests?

    Read the article

  • is there a way to add a variable/property to a DOM element (eg, an element returned by a jQuery sele

    - by bt
    Hi there, I am looking for an alternative to using an object/variable in global scope -- I would like to associate key/value pairs with specific DOM elements (eg, a DIV), so that I can use them as input for logic that processes other elements (eg, child elements of said DIV). I tried something naive like: $('[foo=bar]').key='value' , and $('[foo=bar]')[key]='value', but it puked. Doing something like: var foobar = $('[foo=bar]'); foobar.key = 'value' -- works, but the new property/value only affects the new object (ie, foobar, not $('[foo=bar]')) Most likely there's something terribly basic I am overlooking. Any help is appreciated, thanks!

    Read the article

  • What am i doing wrong with this in asp.net-mvc?

    - by Pandiya Chendur
    I gave this in my site.master <li><%= Html.ActionLink("Material", "Index", "Material")%></li> But my link doesnt seem to get my material controller Index method... I have this in my global asax file, public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Material", action = "Index", id = "" } ); } My controller: public class MaterialController : Controller { // // GET: /Material/ Material material = new Material(); public ActionResult Index() { var materials = material.FindAllMaterials(); return View(); } } What am i doing wrong.... When i click the link i get The resource cannot be found. error.. Any suggestion...

    Read the article

  • Why are my \n not working in PHP?

    - by Doug
    I'm playing with SAX and noticed it's not line breaking properly. I have no iea why. function flush_data() { global $level, $char_data; $char_data = trim($char_data); if( strlen( $char_data ) > 0 ) { print "\n"; $data = split("\n", wordwrap($char_data, 76 - ($level*2))); foreach($data as $line) { print str_repeat(' ', ($level +1)) . "[".$line."]"."\n"; } } $char_data = ''; }

    Read the article

  • iPhone Wait For Animation Ending

    - by paul simmons
    Hi, In an iPhone application, I try to catch animation endings using setAnimationDidStopSelector. I try to suspend code execution until animation ends. I have tried this; set a global BOOL variable, set it to TRUE before commiting animation and after commiting animations waited using a while loop. In the setAnimationDidStopSelector, set the BOOL variable to FALSE and hope while loop to break. But unluckily this did not work, the code did not even fall into setAnimationDidStopSelector (I check that with some trace outputs). What do you suggest?

    Read the article

  • Codeigniter pre_system hook for DB driven dynamic controller selection - best approach?

    - by Andy
    Although I can tentatively see a solution to this, I was wondering if there may be a glaringly obvious simpler approach. My aim is to use the first segment of a given URI to query the DB as to which controller should be run. I assume I would have to reform the URI with the resultant controller name in segment 1, then allow the system to continue processing as normal (hence a pre_system hook). Although not essential I would also like to hold a couple of other variables from the same DB request to be used later in the call stack, and assume this would have to be done using global variables? Any better suggestions would be gladly received. Thanks.

    Read the article

  • How do I bind a key to "the function represented by the following key sequence"?

    - by katrielalex
    I'm just starting to learn emacs (woohoo!) and I've been mucking around in my .emacs quite happily. Unfortunately, I don't know Lisp yet, so I'm having issues with the basics. I've already remapped a few keys until I fix my muscle memory: (global-set-key (kbd "<f9>") 'recompile) That's fine. But how can I tell a key to 'simulate pressing several keys'? For instance, I don't know, make <f1> do the same as C-u 2 C-x } (widen buffer by two chars). One way is to look up that C-x } calls shrink-window-horizontally, and do some sort of lambda thing. This is of course the neat and elegant way (how do you do this?). But surely there's a way to define <f1> to send the keystrokes C-u 2 C-x }?

    Read the article

  • namespacing large javascript like jquery

    - by frenchie
    I have a very large javascript file: it's over 9,000 lines. The code looks like this: var GlobalVar1 = ""; var GlobalVar2 = null; function A() {...} function B(SomeParameter) {...} I'm using the google compiler and the global variables and functions get renamed a,b,c... and there's a good change that there might be some collision later with some outside code. What I want to do is have my code organized like the jquery library where everything is accessible with $. Is there a way to namespace my code so that everything is behind a # character for example. I'd like to have this to call my code: #.GlobalVar #.functionA(SomeParameter) How can I do this? Thanks.

    Read the article

  • Seperate Configuration files for each user in codeigniter

    - by Dileep Dil
    is it possible to make Config files for each and every users? Currently i have a Config file named Siteconfig.php for global configuration. Now a user registered,so that i need a configuration file for that user. I have a BANNER ,user uploads images to the server and select some images for that banner. I want to store the names of the images in the configuration file,i know that database is another way. is there any wrong with this ? or is it possible to do this ? Thank you.

    Read the article

  • Pass an array from one file to another using include

    - by mrakodol
    How to pass an array from one file to another using include using PHP language? I have one file with some language array(language/langen.php): global $lang; $lang['Here'] = 'Here'; $lang['Date'] = "Date"; In other file I have: include base_url().'language/lang'.$_COOKIE['lang'].'.php'; var_dump($lang); *(My mistake by coping code - true is var_dump($lang))* But it shows me an error: A PHP Error was encountered Severity: Notice Message: Undefined variable: lang How to solve this problem and what did I do wrong?

    Read the article

  • Is `eval`ing in a CPAN module without localizing $@ a bug?

    - by rassie
    I think I've encountered a bug in Params::Validate, but I'm not sure whether I identified the problematic code piece correctly. The code in question failed to pass exceptions up the chain (using Try::Tiny), so I started debugging and found out that a class used inside the try block has a destructor. This destructor calls object methods which use Params::Validate and looking into Validate.pm source I see an eval without $@ localization, i.e. the global $@ gets overwritten. Now I see two options: Params::Validate should always localize $@ and thus it's a bug that should be reported. The bug is in the class in question, because it shouldn't use Params::Validate in a destructor. Params::Validate can stay as it is now. Which one is it? How I should I handle this situation? PS: I think that CPAN modules should be rock-solid and neither break themselves nor their environment, hence the question title.

    Read the article

  • how to pass session variable to model in RoR?

    - by siulamvictor
    I used a global variable in my app for passing information before. But I got a problem and thanks everyone here suggested me to store those data in session with database. I tried, but I found that I can't access the session variable in Model. I googled and knew this is the Model normal behavior, RoR won't pass the session variable to Model. So how to pass the value of the session variable into Models? or is there any other method for my use case? I need a variable storing a value, which is required in all MVCs, and should be independent between different concurrent users. Thanks everyone. :)

    Read the article

  • HTAccess mod rewrite issue using QSA

    - by Matt
    Hey, I want to add a parameter to a URL but currently it isnt showing in the $_GET global. A snippet from my htaccess file is as below: RewriteRule ^account/blogs/([0-9]+)/([^\s?]+)/?$ /account/blog.php?blogId=$1 [L,QSA] Then in my php code i want to add a link such as: /account/blogs/1/ThisIsWhereTheTitleGoes?delete=1 The wildcard (any char but space) option is for the blog title as i never know what it would be. I know want to add a query string param on the end such as ?delete=1. I however dont want this as part of the rewrite. Does anybody know how to so this? Thanks

    Read the article

< Previous Page | 141 142 143 144 145 146 147 148 149 150 151 152  | Next Page >