runtime

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module

时光毁灭记忆、已成空白 提交于 2019-12-18 03:34:12
问题 I am developing a c# application and I get the following error at debug runtime: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Additional information: Could not load file or assembly 'Autodesk.Navisworks.Timeliner.dll' or one of its dependencies. The specified module could not be found. Autodesk.Navisworks.Timeliner.dll is in the debug folder of the application. I have repaired the .net framework (version 4) but it did not resolve it. Any ideas

Is there a “vim runtime log”?

与世无争的帅哥 提交于 2019-12-17 22:29:05
问题 Sometimes I try a customization/command in my vimrc. Everything seens to be correct, but it just doesn't work. It's difficult to know what's happening when vim starts, and know which command failed or not, so it's really difficult to debug what can be causing a problem in my vimrc. It's a trial-error approach, which is time consuming and really a PITA. For example, I'm having problems with snipmate plugin in some files and just don't have a clue on how to discover the problem. Is there a

Can you add to an enum type in run-time

こ雲淡風輕ζ 提交于 2019-12-17 22:22:51
问题 If I have an enum type: public enum Sport { Tennis = 0; Football = 1; Squash = 2; Volleyball = 3; } Can I somehow add during run-time: PingPong = 4 回答1: The enum has a backing store, defaulting to int if you don't specify it. It is possible to directly assign values outside of the defined values: Sport pingPong = (Sport)4; Then you can check for it: if (value == (Sport)4) {} That is why you have the static function Enum.IsDefined() for checking if the actual value falls inside the expected

change db name in connection string at runtime in Entity Framework

北战南征 提交于 2019-12-17 21:55:38
问题 In my project I want to run some unit tests on the DAL layer that is using EntityFramework. I'm creating from scrips a new database before each run of the tests (in order to have always the same initial data when doing the tests). At the end of the tests, this database is dropped, (all is made automatically with the help of [ClassInitialize()] and [ClassCleanup()] attributes. The generated database always has a different name, something like TestDB-2009-01-31--12-00-00, in order not to

How do I get at the goodies in my Grails Config.groovy at runtime?

风格不统一 提交于 2019-12-17 21:52:29
问题 in Config.groovy I see this: // set per-environment serverURL stem for creating absolute links environments { production { grails.serverURL = "http://www.changeme.com" } } what is the correct way to access that at runtime? 回答1: danb is on the right track. However, life gets a bit easier on your fingers if you do a nicer import: import org.codehaus.groovy.grails.commons.ConfigurationHolder as CH println CH.config.grails.serverURL 回答2: In more recent versions of grails ConfigurationHolder has

Getting template metaprogramming compile-time constants at runtime

白昼怎懂夜的黑 提交于 2019-12-17 21:44:47
问题 Background Consider the following: template <unsigned N> struct Fibonacci { enum { value = Fibonacci<N-1>::value + Fibonacci<N-2>::value }; }; template <> struct Fibonacci<1> { enum { value = 1 }; }; template <> struct Fibonacci<0> { enum { value = 0 }; }; This is a common example and we can get the value of a Fibonacci number as a compile-time constant: int main(void) { std::cout << "Fibonacci(15) = "; std::cout << Fibonacci<15>::value; std::cout << std::endl; } But you obviously cannot get

Adding a user control to a page programatically while preserving controls already present

*爱你&永不变心* 提交于 2019-12-17 20:42:18
问题 I am trying to add a user control into a div at runtime. I can add the control no probelem but it overwrites the previous control added. Basically, I am trying to add passengers to a travel system - the passenger details are in the user control and I don't know in advance how many there will be. I have an add new passenger button which should append the new user control into the div without overwriting the previous passenger. The code is c#/.net 4. I have tried to save the control data into

arrow operator in objective-c

左心房为你撑大大i 提交于 2019-12-17 20:04:20
问题 I have a question, here's the code: @interface MyFoo : NSObject { NSString *nameStr; } @end @implementation MyFoo - (id)init { self = [super init]; if (self) { self->nameStr = [@"some value of the string that is set right into the private ivar" copy]; } return self; } @end The question is: ignoring all the C++ rules, ignoring memory dump vulnerability, why exactly I shouldn't use such arrow operator syntax? Is there somewhere in Apple documentation a rule which says that it's incorrect

Set array's rank at runtime

眉间皱痕 提交于 2019-12-17 19:57:26
问题 I have written a program which reads a file containing multidimensional data (most commonly 3D, but 2D could occur as well). To heighten simplicity I would like to store the data in an array of the same rank (or something pretending to be one), i.e. using a three-dimensional array for 3D data, etc.; the trouble is that the program only learns about the dimensionality on reading the data file. Currently I store all data in an array of rank one and calculate each element's index in that array

C++ runtime knowledge of classes

淺唱寂寞╮ 提交于 2019-12-17 19:55:03
问题 I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded. Is there a way to determine what classes have been compiled, at run-time preferably, so that I can remove the linking and instead provide dynamically loadable libraries instead. 回答1: Are you looking for C++ runtime