Search Results

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

Page 57/224 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • What happens if two COM classes each without a threading model are implemented in one in-proc COM se

    - by sharptooth
    Consider a situation. I have an in-proc COM server that contains two COM classes. Both classes are marked as "no threading model" in the registry - the "ThreadingModel" value is just absent. Both classes read/write the same set of global variable without any synchronization. As far as I know "no threading model" will enforce COM to disallow concurrent access to the same or different instances of the same class by different threads. Will COM prevent concurrent access to instances of the two abovementioned different classes? Do I need synchronization when accessing the global variables from two different COM classes in this situation?

    Read the article

  • NSIS Check Textbox empty not working

    - by Hernán
    I'm trying to display a page in NSIS to obtain two different values. I want both to be not empty. The page actually displays altough I can't get my page leave function to check properly for empty fields. Function CCInstallOpts ReserveFile "cc_installopt.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "cc_installopt.ini" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "cc_installopt.ini" FunctionEnd My page leave function where I validate fields (4 and 5 ) is : Function CCInstallOptsLeave Push $R0 Push $R1 !insertmacro MUI_INSTALLOPTIONS_READ $R0 "cc_installopt.ini" "Field4" "State" !insertmacro MUI_INSTALLOPTIONS_READ $R1 "cc_installopt.ini" "Field5" "State" StrCmp $R0 "" mustcomplete StrCmp $R1 "" mustcomplete StrCpy $CC_CyberID $R0 StrCpy $CC_VCode $R1 goto exitfunc mustcomplete: MessageBox MB_OK|MB_ICONEXCLAMATION "Empty not allowed" Abort exitfunc: Pop $R1 Pop $R0 FunctionEnd Note that I want to store the entered values into $CC_VCode and $CC_CyberID variables to be later used on different files (I've defined both as:) Var /GLOBAL CC_VCode Var /GLOBAL CC_CyberID Thanks in advance.

    Read the article

  • Entity Framework and the XmlIgnoreAttribute

    - by Mikey Cee
    Say you have a one to one relationship in your entity model. The code generator will decorate it with the following attributes: [global::System.Xml.Serialization.XmlIgnoreAttribute()] [global::System.Xml.Serialization.SoapIgnoreAttribute()] public RelatedObject Relationship { get {...} set {...} } I want to serialize my parent object together with all its properties for which data has been loaded through an XML web service. Obviously, these related properties do not get serialized because of these attributes. So for my purposes I just want to remove these "don't serialize me" attributes. I can do a find and replace in the designer code, but any modifications I make in the designer will put these attributes back in. How do I permanently get rid of these attributes? VS 2008 / EF 3.5.

    Read the article

  • python, accessing a psycopg2 form a def?

    - by i-Malignus
    i'm trying to make a group of defs in one file so then i just can import them whenever i want to make a script in python i have tried this: def get_dblink( dbstring): """ Return a database cnx. """ global psycopg2 try cnx = psycopg2.connect( dbstring) except Exception, e: print "Unable to connect to DB. Error [%s]" % ( e,) exit( ) but i get this error: global name 'psycopg2' is not defined in my main file script.py i have: import psycopg2, psycopg2.extras from misc_defs import * hostname = '192.168.10.36' database = 'test' username = 'test' password = 'test' dbstring = "host='%s' dbname='%s' user='%s' password='%s'" % ( hostname, database, username, password) cnx = get_dblink( dbstring) can anyone give me a hand?

    Read the article

  • Need help with Xpath methods in javascript (selectSingleNode, selectNodes)

    - by Andrija
    I want to optimize my javascript but I ran into a bit of trouble. I'm using XSLT transformation and the basic idea is to get a part of the XML and subquery it so the calls are faster and less expensive. This is a part of the XML: <suite> <table id="spis" runat="client"> <rows> <row id="spis_1"> <dispatch>'2008', '288627'</dispatch> <data col="urGod"> <title>2008</title> <description>Ur. god.</description> </data> <data col="rbr"> <title>288627</title> <description>Rbr.</description> </data> ... </rows> </table> </suite> In the page, this is the javascript that works with this: // this is my global variable for getting the elements so I just get the most // I can in one call elemCollection = iDom3.Table.all["spis"].XML.DOM.selectNodes("/suite/table/rows/row").context; //then I have the method that uses this by getting the subresults from elemCollection //rest of the method isn't interesting, only the selectNodes call _buildResults = function (){ var _RowList = elemCollection.selectNodes("/data[@col = 'urGod']/title"); var tmpResult = ['']; var substringResult=""; for (i=0; i<_RowList.length; i++) { tmpResult.push(_RowList[i].text,iDom3.Global.Delimiter); } ... //this variant works elemCollection = iDom3.Table.all["spis"].XML.DOM _buildResults = function (){ var _RowList = elemCollection.selectNodes("/suite/table/rows/row/data[@col = 'urGod']/title"); var tmpResult = ['']; var substringResult=""; for (i=0; i<_RowList.length; i++) { tmpResult.push(_RowList[i].text,iDom3.Global.Delimiter); } ... The problem is, I can't find a way to use the subresults to get what I need.

    Read the article

  • Suppress/Override application.html.erb

    - by user310628
    Is there any way to suppress the default js and css loaded by application.html.erb on a view by view basis? I'm finding it incredibly difficult to manage a global css and js includes configuration when certain views need different js libraries that for some reason seem to be conflicting with one another. For example, I might want jquery 1.3 for one view and 1.4.2 for another. I don't necessarily want to have to have an include for every view (I do want to have a global site-wide default), but I would also like to be able to override those for any view I want. Thanks!

    Read the article

  • Problems setting up an ASP.NET MVC site on IIS7 w/ Nhibernate

    - by Brandon
    When deploying my published website to the host (Its a shared hosting plan) I get this error: [NullReferenceException: Object reference not set to an instance of an object.] System.Web.PipelineStepManager.ResumeSteps(Exception error) +929 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +91 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +508 I found this question which describes my problem, but I'm not initializing NHibernate in Application_Start, it is already being done in Init. The only other cause of this error I can find is that the Global.asax file is inheriting from a class other than HttpApplication, but I'm not doing that either. This is pretty much the Global.asax file protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); } public override void Init() { base.Init(); if (_wasNHibernateInitialized) return; // Initialize NHibernate // Other setup like the StructureMap initialization } Is there any other reason why an ASP.NET MVC application would give this error when being deployed to IIS7?

    Read the article

  • How can I block based on URL (from address bar) in a safari extension

    - by PerilousApricot
    I'm trying to write an extension that will block access to (configurable) list of URLs if they are accessed more than N times per hour. From what I understand, I need to have a start script pass a "should I load this" message to a global HTML page (who can access the settings object to get the list of URLs), who will give a thumbs up/thumbs down message back to the start script to deny/allow loading. That works out fine for me, but when I use the usual beforeLoad/canLoad handlers, I get messages for all the sub-items that need to be loaded (images/etc..), which screws up the #accesses/hour limit I'm trying to make. Is there a way to synchronously pass messages back and forth between the two sandboxes so I can tell the global HTML page, "this is the URL in the window bar and the timestamp for when this request came in", so I can limit duplicate requests? Thanks!

    Read the article

  • Urlredirect in MVC2

    - by Ken
    In global.asax routes.MapRoute( "Test_Default", // Route name "test/{controller}/{action}", // URL with parameters new { } ); routes.MapRoute( "Default", "{universe}", new { controller = "notfound", action = "error"} ); I have a controller: Home, containing an action: Index Enter the url in browser: h**p://localhost:53235/test/home/index Inside the index.aspx view in <body> tag: I want to link to the second route. <%=Html.RouteLink("Link", new { universe = "MyUniverse" })%> Shouldn't this generate a link to the second route in Global.asax? The generated url from the above is: h**p://localhost:53235/test/home/index?universe=MyUniverse. I can only get it to work, if I specify the name of the route: <%=Html.RouteLink("Link", "default", new { universe = "MyUniverse" })%> Am I missing something?

    Read the article

  • imported function name is not visible in entities context

    - by ali moharrami
    hi I am working on silverlight application which uses EF. I am able to retrieve the data. But I want to execute a stored procedure which returns no value. I tried using Import function. and the function is created in DataModel.Designer.cs : public int ClearWorkflow(Nullable<global::System.Guid> processId) { ObjectParameter processIdParameter; if (processId.HasValue) { processIdParameter = new ObjectParameter("ProcessId", processId); } else { processIdParameter = new ObjectParameter("ProcessId",typeof(global::System.Guid)); } return base.ExecuteFunction("ClearWorkflow", processIdParameter); } But the function name is not visible in entities context while accessing in silverlight.

    Read the article

  • ASP.NET MVC Routes

    - by MVCDummy09
    Can I see one example that would make this piece of code compile? public IEnumerable<RouteBase> Routes { get { return new List<Route>() { new Route(...) } } } What would you do if RouteCollection.MapRoute() didn't exist? I'm trying to put my Controller in charge of mapping routes, not Global.asax.cs. public IEnumerable<RouteBase> Routes is a member of my Controller. If the Controller is responsible for a Route, it's a bad idea to decouple the Route by using routes.MapRoute() in Global.asax.cs.

    Read the article

  • Assembly stack persistency

    - by user246100
    Hello. I would like to know if after calling functions the data I have in the stack is persistent. Like, I would like to know if (assuming cdecl convention) can I do this (independently of function X and independently of optimizations): push 1 push 2 push 3 call X call X call X add 12 esp ? Also, let's say that before the calls I save the address of where the pushed values are in a global variable. Can I, inside X, alter the values it contain by acessing the global variable? Like, for some reason I want that in X I'm able to alter the values in stack so that the second and third call to X receive different values.

    Read the article

  • JavaScript function binding (this keyword) is lost after assignment

    - by Ding
    this is one of most mystery feature in JavaScript, after assigning the object method to other variable, the binding (this keyword) is lost var john = { name: 'John', greet: function(person) { alert("Hi " + person + ", my name is " + this.name); } }; john.greet("Mark"); // Hi Mark, my name is John var fx = john.greet; fx("Mark"); // Hi Mark, my name is my question is: 1) what is happening behind the assignment? var fx = john.greet; is this copy by value or copy by reference? fx and john.greet point to two diferent function, right? 2) since fx is a global method, the scope chain contains only global object. what is the value of this property in Variable object?

    Read the article

  • Process-wide hook using SetWindowsHookEx

    - by mfya
    I need to inject a dll into one or more external processes, from which I also want to intercept keybord events. That's why using SetWindowsHookEx with WH_KEYBOARD looks like an easy way to achieve both things in a single step. Now I really don't want to install a global hook when I'm only interested in a few selected processes, but Windows hooks seem to be either global or thread-only. My question is now how I would properly go about setting up a process-wide hook. I guess one way would be to set up the hook on the target process' main thread from my application, and then doing the same from inside my dll on DLL_PROCESS_ATTACH for all other running threads (plus on DLL_THREAD_ATTACH for threads started later). But is this really a good way? And more important, aren't there any simpler ways to setup process-wide hooks? My idea looks quite cumbersome und ugly, but I wasn't able to find any information about doing this anywhere.

    Read the article

  • How to merge VB.NET WEB Project with C#.NET MVC project

    - by Thushara Perera
    Hi All, I've got an existing asp.net project written in vb.net need to merge into C# ASP.NET MVC 1.0 application. I couldn't find a good article on this. I have successfully created a sample project and merge it. It works successfully. But when merge it into my real project it does not work. I've used C#.csproj project file and deleted VB project file. for the merging i could find a good article this link successful on sample project not with the real project. good one: http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc how it is possible to merge VB Default.aspx, C# Default.aspx and VB Global.asax, C# Global.asax. Can I used VB.vbproj file insted of csproj Thanks Thushara Perera

    Read the article

  • Facebook Social Plugins Like button returns "Website Inaccessible"

    - by buggedcom
    We've just added Facebook like button to http://www.willyoung.co.uk/global/songs-and-lyrics/releases/the_hits?page=1, however the json returned by facebook is for (;;);{"error":0,"errorSummary":"","errorDescription":"","errorIsWarning":false,"silentError":0,"payload":{"requires_login":false,"success":false,"already_connected":false,"is_admin":false,"show_error":true,"error_info":{"brief":"Website inaccessible","full":"The page at http:\/\/www.willyoung.co.uk\/global\/songs-and-lyrics\/releases\/the_hits could not be reached."}}} It basically says that the website is not accessible. We've implemented this on other sites and it's fine. I'm not really sure where this is coming from. Any ideas?

    Read the article

  • CUDA, more threads for same work = Longer run time despite better occupancy, Why?

    - by zenna
    I encountered a strange problem where increasing my occupancy by increasing the number of threads reduced performance. I created the following program to illustrate the problem: #include <stdio.h> #include <stdlib.h> #include <cuda_runtime.h> __global__ void less_threads(float * d_out) { int num_inliers; for (int j=0;j<800;++j) { //Do 12 computations num_inliers += threadIdx.x*1; num_inliers += threadIdx.x*2; num_inliers += threadIdx.x*3; num_inliers += threadIdx.x*4; num_inliers += threadIdx.x*5; num_inliers += threadIdx.x*6; num_inliers += threadIdx.x*7; num_inliers += threadIdx.x*8; num_inliers += threadIdx.x*9; num_inliers += threadIdx.x*10; num_inliers += threadIdx.x*11; num_inliers += threadIdx.x*12; } if (threadIdx.x == -1) d_out[blockIdx.x*blockDim.x+threadIdx.x] = num_inliers; } __global__ void more_threads(float *d_out) { int num_inliers; for (int j=0;j<800;++j) { // Do 4 computations num_inliers += threadIdx.x*1; num_inliers += threadIdx.x*2; num_inliers += threadIdx.x*3; num_inliers += threadIdx.x*4; } if (threadIdx.x == -1) d_out[blockIdx.x*blockDim.x+threadIdx.x] = num_inliers; } int main(int argc, char* argv[]) { float *d_out = NULL; cudaMalloc((void**)&d_out,sizeof(float)*25000); more_threads<<<780,128>>>(d_out); less_threads<<<780,32>>>(d_out); return 0; } Note both kernels should do the same amount of work in total, the (if threadIdx.x == -1 is a trick to stop the compiler optimising everything out and leaving an empty kernel). The work should be the same as more_threads is using 4 times as many threads but with each thread doing 4 times less work. Significant results form the profiler results are as followsL: more_threads: GPU runtime = 1474 us,reg per thread = 6,occupancy=1,branch=83746,divergent_branch = 26,instructions = 584065,gst request=1084552 less_threads: GPU runtime = 921 us,reg per thread = 14,occupancy=0.25,branch=20956,divergent_branch = 26,instructions = 312663,gst request=677381 As I said previously, the run time of the kernel using more threads is longer, this could be due to the increased number of instructions. Why are there more instructions? Why is there any branching, let alone divergent branching, considering there is no conditional code? Why are there any gst requests when there is no global memory access? What is going on here! Thanks

    Read the article

  • Strategies for Error Handling in .NET Web Services

    - by Jarrod
    I have a fairly substantial library of web services built in .NET that I use as a data model for our company web sites. In most .NET applications I use the Global ASAX file for profiling, logging, and creating bug reports for all exceptions thrown by the application. Global ASAX isn't available for web services so I'm curious as to what other strategies people have come up with to work around this limitation. Currently I just do something along these lines: <WebMethod()> _ Public Function MyServiceMethod(ByVal code As Integer) As String Try Return processCode(code) Catch ex As Exception CustomExHandler(ex) 'call a custom function every time to log exceptions Return errorObject End Try End Function Anybody have a better way of doing things besides calling a function inside the Catch?

    Read the article

  • How to use ctrl-i for an emacs shortcut without breaking tabs

    - by mksuth
    I want to redefine the emacs keyboard shortcut control-i to be "MOVE CURSOR UP" To do this, I added the following line to my .emacs file: (global-set-key (kbd "C-i") 'previous-line) What I then discovered is that the tab key, by default, does whatever is bound to control-i, which is obviously not what I want. So, to restore normal tab behavior, I added this to my .emacs file (global-set-key (kbd "<tab>") 'indent-for-tab-command) This mostly works. BUT, tab no longer works for auto-completing commands in the mini buffer. How can I fix that? Or is there a better way of going about this? Thanks.

    Read the article

  • Avoiding NPE in trait initialization without using lazy vals

    - by 0__
    This is probably covered by the blog entry by Jesse Eichar—still I can't figure out how to correct the following without residing to lazy vals so that the NPE is fixed: Given trait FooLike { def foo: String } case class Foo( foo: String ) extends FooLike trait Sys { type D <: FooLike def bar: D } trait Confluent extends Sys { type D = Foo } trait Mixin extends Sys { val global = bar.foo } First attempt: class System1 extends Mixin with Confluent { val bar = Foo( "npe" ) } new System1 // boom!! Second attempt, changing mixin order class System2 extends Confluent with Mixin { val bar = Foo( "npe" ) } new System2 // boom!! Now I use both bar and global very heavily, and therefore I don't want to pay a lazy-val tax just because Scala (2.9.2) doesn't get the initialisation right. What to do?

    Read the article

  • Convert Date to Datetime field.

    - by infant programmer
    The argument my C# function is getting is a string which is merely a Date or a DateTime. I am suppose to convert this String to DateTime, to carry on furthure calculation. Now I need to test whether the incoming data is a Date, if it is date(examle:"12/31/2009"), then I need to add "00:00:00" (24 hours format) to it, so that it will become "12/31/2009 00:00:00". If string manipulation is one possible way, I want to confirm whether there is some other way where we can automate the testing and conversion within DateTime.TryParseExact() method. This is my sample C# code : (which is now only able to convert string of format "MM/dd/yyyy HH:mm:ss" to DateTime.) private static string[] formats = new string[] { "MM/dd/yyyy HH:mm:ss" }; public string date_conv(string date_str) { DateTime date_value; DateTime.TryParseExact(date_str, formats, new global::System.Globalization.CultureInfo("en-US"), global::System.Globalization.DateTimeStyles.None, out date_value); /*Some useful instruction to use date_value*/ return(date_value.ToString("MM/dd/yyyy HH:mm:ss")); }

    Read the article

  • Websphere Scheduler

    - by Dileep81
    Websphere Scheduler is using scheduler datasource XA driver . When task is executed by scheduler it is starting a global transaction, but in our application we are creating a new connection to another database and explicitly commiting the data and closing the connection. This data source configured using non-XA driver datasource. For the application we have also enabled the Accept heuristic hazard (Last participant support extension) . Now while running the scheudler we are getting the exception DSRA9350E: Operation Connection.commit is not allowed during a global transaction . Can any one help me out in this

    Read the article

  • When are you truly forced to use UUID as part of the design?

    - by Pyrolistical
    I don't really see the point of UUID. I know the probability of a collision is effectively nil, but effectively nil is not even close to impossible. Can somebody give an example where you have no choice but to use UUID? From all the uses I've seen, I can see an alternative design without UUID. Sure the design might be slightly more complicated, but at least it doesn't have a non-zero probability of failure. UUID smells like global variables to me. There are many ways global variables make for simpler design, but its just lazy design.

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >