runtime

C, runtime test if executable exists in PATH

*爱你&永不变心* 提交于 2019-12-12 17:15:16
问题 I am currently writing an application in C, targetting BSD and Linux systems with a hope to being generall portable. This program a runtime dependency, in this case mplayer. As it stands I am using execlp() to start mplayer. I am checking the error code of the execlp call and I am testing for EACCESS , so I know when I attempt to run mplayer if it exists or not. Because of the way my program works, mplayer is a required dependency but may not be used for some time after my program starts. As

Pygame Distribution - Runtime Error

岁酱吖の 提交于 2019-12-12 15:11:38
问题 I am working on a problem with my 2D arcade game programed with Python using the module pygame for 2 days now and I can't find a solution. The problem is: I want to create a Windows Executable File that is running my program correctly. I already managed to create a .exe file, but I get an error as soon as I start the exe: Runtime Error! Path\MyGame.exe This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more

PHP Yii: Database connect in runtime

强颜欢笑 提交于 2019-12-12 14:15:52
问题 I would like to connect to a second database with Yii at runtime. The database name would come from a database table after the user to login. I saw in a tutorial I should do this: $db2 = Yii::createComponent(array( 'class' => 'EMongoClient', 'server' => 'mongodb://127.0.0.1:27017', 'db' => $emp['database'] )); Yii::app()->setComponent('db2',$db2); But in my controler when I access Yii::app()->db2 get the error: Property "CWebApplication.db2" is not defined What am I doing wrong? 回答1: The

How to create pyqtSignals dynamically

核能气质少年 提交于 2019-12-12 12:33:15
问题 Is there any possibility to create signals at runtime when needed? I'm doing something like this in a function: class WSBaseConnector(QObject) def __init__(self) -> None: super(QObject, self).__init__() self._orderBookListeners: Dict[str, pyqtSignal[OrderBookData]] = {} def registerOrderBookListener(self, market: str, listener: Callable[[OrderBookData], None], loop: AbstractEventLoop) -> None: try: signal = self._orderBookListeners[market] except KeyError: signal = pyqtSignal(OrderBookData)

Create table programmatically

泄露秘密 提交于 2019-12-12 12:26:02
问题 I am working on devexreport and I want to create a table programmatically I use these codes but have a little problem. DevExpress.XtraReports.UI.XRTable tbl = new XRTable(); DevExpress.XtraReports.UI.XRBarCode xrBarCode = new XRBarCode(); Detail1.Controls.Add(tbl); tbl.Location = new System.Drawing.Point(358, 17); tbl.Size = new System.Drawing.Size(358, 50); tbl.Borders = (DevExpress.XtraPrinting.BorderSide) (((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)

convincing C# compiler that execution will stop after a member returns

旧街凉风 提交于 2019-12-12 12:25:09
问题 I don't think this is currently possible or if it's even a good idea, but it's something I was thinking about just now. I use MSTest for unit testing my C# project. In one of my tests, I do the following: MyClass instance; try { instance = getValue(); } catch (MyException ex) { Assert.Fail("Caught MyException"); } instance.doStuff(); // Use of unassigned local variable 'instance' To make this code compile, I have to assign a value to instance either at its declaration or in the catch block. I

How to capture standard out and print to both the console and a file during process runtime (C++/Boost.Process)

我只是一个虾纸丫 提交于 2019-12-12 12:22:48
问题 I am working on an application that starts child processes using Boost's C++ Process library (http://www.highscore.de/boost/process0.5) and redirects the standard out of that process to a file using the below code: boost::process::initializers::bind_stdout(boost::iostreams::file_descriptor_sink goes here ) The above solution and code worked well. However, now, I need to be able to print the child process's standard out to both a file and the console. I have found the code below which seems

C++ Stack around a variable is corrupted

旧城冷巷雨未停 提交于 2019-12-12 12:06:50
问题 I'm getting the following error from the code I've written - Run-Time Check Failure #2 - Stack around the variable 'pChar' was corrupted From research it is suggestive that the problem has to do with pHexValueBuffer = new char[256] and the memset and how I'm using the veritable - to store values to return a Hex number instead of Decimal. My research suggests that somehow I'm going out of bounds with the memory I've set, just not understanding the how. Any suggestions on how to fix the issue?

新建jsp文件,The superclass \"javax.servlet.http.HttpServlet\" was not found on the Java Build Path错误解决方法

左心房为你撑大大i 提交于 2019-12-12 11:10:07
新建一个jsp文件后,有一个错误,The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法: 1. 右键项目->build path->configure build path... 2. 选择 Java build path 3. Add Library->Server Runtime->Click Next 4. 选择 Server runtime->选择Tomcat->Fin 来源: https://www.cnblogs.com/fangjb/p/12027878.html

How to create new type at runtime in F#? [closed]

孤人 提交于 2019-12-12 10:28:02
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Please give an example of how to create new type (say, two types Cartesian product) in F# at runtime with reflection? UPDATE I am looking for a language with first class types. I was told F# can this. I tried