Search Results

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

Page 137/224 | < Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >

  • Best way to implement a 404 in ASP.NET

    - by Ben Mills
    I'm trying to determine the best way to implement a 404 page in a standard ASP.NET web application. I currently catch 404 errors in the Application_Error event in the Global.asax file and redirect to a friendly 404.aspx page. The problem is that the request sees a 302 redirect followed by a 404 page missing. Is there a way to bypass the redirect and respond with an immediate 404 containing the friendly error message? Does a web crawler such as Googlebot care if the request for a non existing page returns a 302 followed by a 404?

    Read the article

  • How to refresh an activity? Map View refresh fails

    - by poeschlorn
    Hi Guys, after implementing some Android Apps, including several Map activities, I try to refresh the activity when the GPS listener's onLocationChanged() mehtod is called. I have no idea how to tell the map activity to refresh on its own and display the new coords... the coords to store will have to be in global values, so that the location listener will have access to it. In my sample GPS-class (see code below) I just changed the text of a text view....but how to do that in map view? private class MyLocationListener implements LocationListener { @Override public void onLocationChanged(Location loc) { final TextView tv = (TextView) findViewById(R.id.myTextView); if (loc != null) { tv.setText("Location changed : Lat: " + loc.getLatitude() + " Lng: " + loc.getLongitude()); } } I think the solution of this Problem won't be very difficult, but I just need the beginning ;-) This whole app shall work like a really simple navigation system. It would be great if someone could help me a little bit further :) nice greetings, Poeschlorn

    Read the article

  • About Network Address Translation (NAT)?

    - by Rudi
    Just curious about a particular scenario of NAT. Let's suppose we have 4 computers sharing a global IP address under the NAT. I understand that the NAT box keeps an internal record to know which computer to forward requests to. But let's say on computer #2 I'm trying to download a file. And let's say on computer #1, #3, and #4, I'm just browsing the web normally. When the browser initiates a TCP connection to get that file, how does it know which computer to give it to? I mean like, each of the four computers is using port 80 to browse the web right? How does the NAT's record distinguish which "port 80" belongs to which computer?

    Read the article

  • Managing EntityConnection lifetime

    - by kervin
    There have been many question on managing EntityContext lifetime, e.g. http://stackoverflow.com/questions/813457/instantiating-a-context-in-linq-to-entities I've come to the conclusion that the entity context should be considered a unit-of-work and therefore not reused. Great. But while doing some research for speeding up my database access, I ran into this blog post... Improving Entity Framework Performance The post argues that EFs poor performance compared to other frameworks is often due to the EntityConnection object being created each time a new EntityContext object is needed. To test this I manually created a static EntityConnection in Global.asax.cs Application_Start(). I then converted all my context using statements to using( MyObjContext currContext = new MyObjeContext(globalStaticEFConnection) { .... } This seems to have sped things up a bit without any errors so far as far as I can tell. But is this safe? Does using a applicationwide static EntityConnection introduce race conditions? Best regards, Kervin

    Read the article

  • Can I resolve ASP.NET "~" app paths to the website root without a Control being present?

    - by jdk
    I want to Resolve "~/whatever" from inside non-Page contexts such as Global.asax (HttpApplication), HttpModule, HttpHandler, etc. but can only find the Resolution methods specific to Controls (and Page). I think the app should have enough knowledge to be able to map this outside the Page context. No? Or at least it makes sense to me it should be resolvable in other circumstances, wherever the app root is known. Update: The reason being I'm sticking ~ paths in the web.configuration files. Update 2: I'm trying to resolve them to the website root such as Control.Resolve(..) URL does, not to a file system path.

    Read the article

  • Issue in exec method

    - by mukul sharma
    Hi all, I am a having two python files file1.py and file2.py. I am using exec() to get the method/Variables defined in the file2.py. file1.py have a class as given below class one: def init(self): self.HOOK = None exec(file2.py) self.HOOK = Generate ### call the hook method #### self.HOOK() file2.py looks like as (There is no class define in file2.py) def Generate() do 1 do 2 Hello() def hello() print "hello" Now the problem is as When i run script it is giving a error global name Hello not found. If i remove Hello() from Generate method in file2.py then its work fine. I cant use import file2.py in file1.py,because in file2.py the only one method name (Generate) is fix (its taken as requirement). So apart from Genarate method user can define any method and can call this in generate method, because this approach is not working so i have to write whole code into generate method only and code is also repetitive. Any help is really appreciable...

    Read the article

  • Exposing headers on iPhone static library

    - by leolobato
    Hello guys, I've followed this tutorial for setting up a static library with common classes from 3 projects we are working on. It's pretty simple, create a new static library project on xcode, add the code there, a change some headers role from project to public. The tutorial says I should add my library folder to the header search paths recursively. Is this the right way to go? I mean, on my library project, I have files separated in folders like Global/, InfoScreen/, Additions/. I was trying to setup one LOKit.h file on the root folder, and inside that file #import everything I need to expose. So on my host project I don't need to add the folder recursively to the header search path, and would just #import "LOKit.h". But I couldn't get this to work, the host project won't build complaining about all the classes I didn't add to LOKit.h, even though the library project builds. So, my question is, what is the right way of exposing header files when I setup a Cocoa Touch Static Library project on xCode?

    Read the article

  • How to deploy ASP.NET MVC application in a shared hosting without losing the beautiful uri?

    - by ZX12R
    i am trying to upload an asp.net mvc application in a shared server. I don't have access to IIS. What i have done after reading from various sources is change the route method in the global.asax file as follows routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", "{controller}.aspx/{action}/{id}", new { action = "Index", id = "" } ); routes.MapRoute( "Root", "", new { controller = "Home", action = "Index", id = "" } ); it is working fine. but the problem is i have lost the beautiful uri here. is there a way to remove the ".aspx" behind the controller..? thanks in advance.:)

    Read the article

  • Why ping another innet machine from MacBook get netgate's ip address?

    - by Xinwang
    I have three machine in my home network connected by a wireless router. One is server installed linux at 192.168.1.1, another is Thinkpad with MS Windows XP at 192.168.1.2, last one is MacBook Pro with Mac OS X 10.6.3 at 192.168.1.3. When I ping the Linux Server from Thinkpad (MS Windows XP) I can get the correct ip address, but when I ping it from Mac I get the global address of my router, like 61.135.181.175. Could you tell me why this happen? And how do I get same ping result on Mac and Windows. Thanks

    Read the article

  • facebook iframe application gives null GET/POST

    - by misterjinx
    hey everybody, I came up to something really strange with a facebook iframe application. I don't know why but my global supervariables $_GET and $_POST are empty (nulls actually)! As far as i know, when using iframe for doing applications all the specific facebook variables are kept inside the $_GET variable. But for some reason now I don't have anything. I don't know what might be the problem. And as this wouldn't be enough, when i submit a form using POST as method, my $_POST variable is also null! What you guys think might be the problem? I've spent half a day trying to figure this out, but i didn't get any result.

    Read the article

  • How to import a macro file (previously exported as .bas file) to Microsoft Word using command line?

    - by Nam Gi VU
    I'm writing a command-line program that has a step in which I need to replace text in a Word file. The replacing task is accomplished using Word macro. What I need to do now is to call this macro from command-line. At the moment we can do this by using the -mMacroName parameter of 'winword.exe', i.e. \winword.exe -mMacroName. But this need the macro to be already available as a global macro. Since I need to run the program on another computer, I need to import the above replacing macro programatically... and I don't know how to do this. Please help.

    Read the article

  • Strange exception while using linq2sql

    - by zerkms
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: mapping Source Error: Line 45: #endregion Line 46: Line 47: public db() : Line 48: base(global::data.Properties.Settings.Default.nanocrmConnectionString, mappingSource) Line 49: { this is what i get if i implement such class: partial class db { static db _db = new db(); public static db GetInstance() { return _db; } } db is a linq2sql datacontext why this hapenned and how to solve this?

    Read the article

  • Simplest way to update a client-side javascript array variable during a ASP.NET AJAX postback in an

    - by Noel
    If I want to inject a globally scoped array variable into a page's client-side javascript during a full page postback, I can use: this.Page.ClientScript.RegisterArrayDeclaration("WorkCalendar", "\"" + date.ToShortDateString() + "\""); to declare and populate a client-side javascript array on the page. Nice and simple. But I want to do the same from a async postback from an UpdatePanel. The closest I can figure so far is to create a .js file that just contains the var declaration, update the file during the async postback, and then use a ScriptManagerProxy.Scripts.Add to add the .js file to the page's global scope. Is there anything simpler? r iz doin it wrong?

    Read the article

  • Using Application Settings and reading defaults from app.config

    - by Peter Goras
    Hi, I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5) And I need to provide a configuration file for this app that any user can modify. For this reason, I am using Application Settings instead of standard appSetttings in app.config so I can separate the the user config from app config. see http://msdn.microsoft.com/en-us/library/ms228995(VS.80).aspx Creating a Settings.settings file using VS generated a class with hard-coded default values like this: [global::System.Configuration.DefaultSettingValueAttribute("blahblah")] public string MyProperty ... WTF? I want to read the default values from the app.config! So I created my own class deriving from ApplicationSettingsBase but I cannot get this to read values from the app.config. Any ideas?

    Read the article

  • Can a CWinApp be placed in a DLL?

    - by jmucchiello
    I'm updating some legacy apps to Visual Studio 10 and am in linker hell. All of these DLLs derive classes from CWinApp and use AfxGetApp() to get access to the object. When I link the DLLs I get unresolved externals that look like global static objects that would get pulled in by a normal app's main(): Shell.lib(SHELL.obj) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CException::classCException" (?classCException@CException@@2UCRuntimeClass@@B) Shell.lib(SHELL.obj) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CFrameWnd::classCFrameWnd" (?classCFrameWnd@CFrameWnd@@2UCRuntimeClass@@B) Shell.lib(SHELL.obj) : error LNK2001: unresolved external symbol "public: static class CRect const CFrameWnd::rectDefault" (?rectDefault@CFrameWnd@@2VCRect@@B) My current combination of ignore default libraries and additional libraries (the method you can easily google to find the answer to linker hell) is: msvcprtd.lib,mfc100d.lib,mfcs100d.lib,libcmtd.lib When I add nafxcwd.lib (the mfc library), these three external symbols resolve but I end up with a bunch of other duplicate symbols (requiring the use of /FORCE:MULTIPLE) and in end __argc and __argv become unresolved. So the basic question is: Can you link a DLL containing a CWinApp in VS10? How do you setup the linker to do it?

    Read the article

  • C#: How to Make it Harder for Hacker/Cracker to Get Around or Bypass the Licensing Check?

    - by Peter Lee
    Hi all, Suppose that the user has saved the License file under the Application.StartupPath, where all users can read. And then, every time when the app starts, it will check if it can find and verify the license file. If the app can find and verify, we let the user to continue with full functinalities. If not, we prompt a MessageBox showing "Unlicencsed, continue to use with trial version, functionalities limited." My question is, if I'm a hacker/cracker, I would try to get around or bypass the licensing check instead of cracking the license file, because, if we use RSA signature, it's very difficult to crack a license file. So where should we put the license check? thanks. Merry Christmas and Happy New Year! Peter P.S.: and also, is it safe if I put a global variable IsLicensed (true / false) to limit the functionalities? Is it easy for a hacker to change IsLicensed = true?

    Read the article

  • Best practices for querying an entire row in a database table? (MySQL / CodeIgniter)

    - by Walker
    Sorry for the novice question! I have a table called cities in which I have fields called id, name, xpos, ypos. I'm trying to use the data from each row to set a div's position and name. What I'm wondering is what's the best practice for dynamically querying an unknown amount of rows (I don't know how many cities there might be, I want to pull the information from all of them) and then passing the variables from the model into the view and then setting attributes with it? Right now I've 'hacked' a solution where I run a different function each time which pulls a value using a query ('SELECT id FROM cities;'), then I store that in a global array variable and pass it into view. I do this for each var so I have arrays called: city_idVar, city_nameVar, city_xposVar, city_yposVar then I know that the city_nameVar[0] matches up with city_xposVar[0] etc. Is there a better way?

    Read the article

  • How to deploy RESTful Web Service onto IIS

    - by Chris Lee
    Hi all, I'm new to .Net and IIS. I've created a simple RESTful Web Service in VS2008 and .net 3.5 framework using WCF. I've tested it well with F5 debugging in VS(seems it is auto deployed on Windows Service). Now I want to deploy it on my IIS server so that I can use it remotely. But I cannot find any guide for this. I manually deployed my service folder just as an ASP.net site. But seems it does not work(keep showing 401 error). Can anyone tell me how to deploy it to IIS? It contains a simple GET method and I hope it can be accessed by anomynous clients (because the host IP is 192.168..). I have a web.config file, a .dll and .pdb under /bin folder, a Global.asax and .svc file for my service. The IIS server is on the same machine. Thanks a million.

    Read the article

  • Python and Plone help

    - by Grenko
    Im using the plone cms and am having trouble with a python script. I get a name error "the global name 'open' is not defined". When i put the code in a seperate python script it works fine and the information is being passed to the python script becuase i can print the query. Code is below: #Import a standard function, and get the HTML request and response objects. from Products.PythonScripts.standard import html_quote request = container.REQUEST RESPONSE = request.RESPONSE # Insert data that was passed from the form query=request.query #print query f = open("blast_query.txt","w") for i in query: f.write(i) return printed I also have a second question, can i tell python to open a file in in a certain directory for example, If the script is in a certain loaction i.e. home folder, but i want the script to open a file at home/some_directory/some_directory can it be done?

    Read the article

  • KRL and Yahoo Local Search

    - by Randall Bohn
    I'm trying to use Yahoo Local Search in a Kynetx Application. ruleset avogadro { meta { name "yahoo-local-ruleset" description "use results from Yahoo local search" author "randall bohn" key yahoo_local "get-your-own-key" } dispatch { domain "example.com"} global { datasource local:XML <- "http://local.yahooapis.com/LocalSearchService/V3/localsearch"; } rule add_list { select when pageview ".*" setting () pre { ds = datasource:local("?appid=#{keys:yahoo_local()}&query=pizza&zip=#{zip}&results=5"); rs = ds.pick("$..Result"); } append("body","<ul id='my_list'></ul>"); always { set ent:pizza rs; } } rule add_results { select when pageview ".*" setting () foreach ent:pizza setting pizza pre { title = pizza.pick("$..Title"); } append("#my_list", "<li>#{title}</li>"); } } The list I wind up with is . [object Object] and 'title' has {'$t' => 'Pizza Shop 1'} I can't figure out how to get just the title.

    Read the article

  • Which IOC runs in medium trust

    - by Rippo
    Hi I am trying to get a website running with Mosso that has Castle Windsor as my IOC, however I am getting the following error. [SecurityException: That assembly does not allow partially trusted callers.] GoldMine.WindsorControllerFactory..ctor() in WindsorControllerFactory.cs:33 GoldMine.MvcApplication.Application_Start() in Global.asax.cs:70 My questions are Does Castle Windsor run under medium trust? Can I download the DLL's without having to recompile with nant? (as I don't have this set up and don't know nant at all) Or is there another IOC that I can use that I can download and works in Medium Trust? Thanks

    Read the article

  • Error using CreateFileMapping - C

    - by Jamie Keeling
    Hello, I am using the tutorial on this MSDN link to implement a way of transferring data from one process to another. Although I was advised in an earlier question to use the Pipe methods, due to certain constraints I have no choice but to use the CreateFileMapping method. Now, i've succesfully managed to make two seperate window form projects within the same solution and by editing some properties both of the forms load at the same time. Furthermore I have managed to implement the code given in the MSDN sample into the first (Producer) and second (Consumer) program without any compilation errors. The problem I am having now is when I run the first program and try to create the handle to the mapped file, I am given an error saying it was unsuccesful and I do not understand why this is happening. I have added both the Producer and Consumer code files to demonstrate what I am trying to do. Producer: #include <windows.h> #include <stdio.h> #include <conio.h> //File header definitions #define IDM_FILE_ROLLDICE 1 #define IDM_FILE_QUIT 2 #define BUF_SIZE 256 TCHAR szName[]=TEXT("Global\\MyFileMappingObject"); TCHAR szMsg[]=TEXT("Message from first process!"); void AddMenus(HWND); LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM); ////Standard windows stuff - omitted to save space. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { WCHAR buffer[256]; LPCTSTR pBuf; struct DiceData storage; HANDLE hMapFile; switch(message) { case WM_CREATE: { // Create Menus AddMenus(hMainWindow); } break; case WM_COMMAND: // Intercept menu choices switch(LOWORD(wParam)) { case IDM_FILE_ROLLDICE: { //Roll dice and store results in variable //storage = RollDice(); ////Copy results to buffer //swprintf(buffer,255,L"Dice 1: %d, Dice 2: %d",storage.dice1,storage.dice2); ////Show via message box //MessageBox(hMainWindow,buffer,L"Dice Result",MB_OK); hMapFile = CreateFileMapping( (HANDLE)0xFFFFFFFF, // use paging file NULL, // default security PAGE_READWRITE, // read/write access 0, // maximum object size (high-order DWORD) BUF_SIZE, // maximum object size (low-order DWORD) szName); // name of mapping object if (hMapFile == NULL) { MessageBox(hMainWindow,L"Could not create file mapping object",L"Error",NULL); return 1; } pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object FILE_MAP_ALL_ACCESS, // read/write permission 0, 0, BUF_SIZE); if (pBuf == NULL) { MessageBox(hMainWindow,L"Could not map view of file",L"Error",NULL); CloseHandle(hMapFile); return 1; } CopyMemory((PVOID)pBuf, szMsg, (_tcslen(szMsg) * sizeof(TCHAR))); _getch(); UnmapViewOfFile(pBuf); CloseHandle(hMapFile); } break; case IDM_FILE_QUIT: SendMessage(hMainWindow, WM_CLOSE, 0, 0); break; } break; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hMainWindow, message, wParam, lParam); } // //Setup menus // Consumer: #include <windows.h> #include <stdio.h> #include <conio.h> //File header definitions #define IDM_FILE_QUIT 1 #define IDM_FILE_POLL 2 #define BUF_SIZE 256 TCHAR szName[]=TEXT("Global\\MyFileMappingObject"); //Prototypes void AddMenus(HWND); LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM); //More standard windows creation, again omitted. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { HANDLE hMapFile; LPCTSTR pBuf; switch(message) { case WM_CREATE: { // Create Menus AddMenus(hMainWindow); break; } case WM_COMMAND: { // Intercept menu choices switch(LOWORD(wParam)) { case IDM_FILE_POLL: { hMapFile = OpenFileMapping( FILE_MAP_ALL_ACCESS, // read/write access FALSE, // do not inherit the name szName); // name of mapping object if (hMapFile == NULL) { MessageBox(hMainWindow,L"Could not open file mapping object",L"Error",NULL); return 1; } pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object FILE_MAP_ALL_ACCESS, // read/write permission 0, 0, BUF_SIZE); if (pBuf == NULL) { MessageBox(hMainWindow,L"Could not map view of file",L"Error",NULL); CloseHandle(hMapFile); return 1; } MessageBox(NULL, pBuf, TEXT("Process2"), MB_OK); UnmapViewOfFile(pBuf); CloseHandle(hMapFile); break; } case IDM_FILE_QUIT: SendMessage(hMainWindow, WM_CLOSE, 0, 0); break; } break; } case WM_DESTROY: { PostQuitMessage(0); break; } } return DefWindowProc(hMainWindow, message, wParam, lParam); } // //Setup menus // It's by no means tidy and final but it's just a start, thanks for any help.

    Read the article

  • How can I translate my programmatic WCF configuration into app.config

    - by ofer
    Hi, I have an self hosted WCF server with hard coded configurations. the server worked fine until I tried to implement some new functionality. the new setting did not work (urrr.... ) and I find it hard to locate where are the problems in my code. instead of digging inside the code, I thought about different approach: Is there any way to dump those hard coded WCF configuration (the entire ) into app.config like text file after all configurations are loaded? this will enable me to have a easy global view of the entire settings .. mmm .. .by the way, does anyone know a way that will do the translation to the opposite direction? config to code. Any advice will be welcomed! ofer

    Read the article

  • Making ofHideReadOnly work with UseLatestCommonDialogs

    - by Jan Goyvaerts
    In Delphi 2007 and later, the global variable UseLatestCommonDialogs causes TOpenDialog to use the new Vista-style dialog on Windows Vista and 7. That's cool. Unfortunately, the Vista-style dialog does not seem to support the ofHideReadOnly option of TOpenDialog. The read-only checkbox never appears regardless whether this option is set to True or False. How can I make TOpenDialog show a read-only checkbox on the Vista-style dialog? TOpenTextFileDialog adds a combo box to the dialog regardless of whether it's Vista-style or not. It should be possible to add a read-only checkbox in the same way, but I can't figure out how to do it, even when looking at the source for TOpenTextFileDialog.

    Read the article

  • Fluent NHibernate SchemaExport to SQLite not pluralizing Table Names

    - by weenet
    I am using SQLite as my db during development, and I want to postpone actually creating a final database until my domains are fully mapped. So I have this in my Global.asax.cs file: private void InitializeNHibernateSession() { Configuration cfg = NHibernateSession.Init( webSessionStorage, new [] { Server.MapPath("~/bin/MyNamespace.Data.dll") }, new AutoPersistenceModelGenerator().Generate(), Server.MapPath("~/NHibernate.config")); if (ConfigurationManager.AppSettings["DbGen"] == "true") { var export = new SchemaExport(cfg); export.Execute(true, true, false, NHibernateSession.Current.Connection, File.CreateText(@"DDL.sql")); } } The AutoPersistenceModelGenerator hooks up the various conventions, including a TableNameConvention like so: public void Apply(FluentNHibernate.Conventions.Instances.IClassInstance instance) { instance.Table(Inflector.Net.Inflector.Pluralize(instance.EntityType.Name)); } This is working nicely execpt that the sqlite db generated does not have pluralized table names. Any idea what I'm missing? Thanks.

    Read the article

< Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >