runtime

Build with runtime packages on Delphi XE2

眉间皱痕 提交于 2019-12-02 07:07:09
问题 I found a similar question but did not find the answer. The question is how easily to add all installed runtime packages to the list in "project options/package/runtime packages" in a Delphi XE2 project? In XE and earlier versions you can do it by simply checking/unchecking "build with runtime packages" and those packages immediately appear in the edit below. 回答1: Create a new project and copy list from its options. 回答2: Check Link with runtime packages . Check Inherit for ´Runtime packages`.

Java - Execute a .SH file

会有一股神秘感。 提交于 2019-12-02 06:58:58
How would I go about executing a .SH file (this is localhost, no remote connection or anything)? I've seen lots of Runtime.exec and other things when I searched but those didn't seem to work. This is Java 6. Also if it matters, all the SH is doing is moving two folders around. Thanks! Martin You could use ProcessBuilder ProcessBuilder pb = new ProcessBuilder("myshell.sh", "myArg1", "myArg2"); Process p = pb.start(); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = null; while ((line = reader.readLine()) != null) { System.out.println(line); }

Which method to detect run mode of php script is more reliable?

你离开我真会死。 提交于 2019-12-02 06:48:54
I now to ways to detect weather php script runs in cli or web server mode: if (defined('STDIN')) or: if (isset($argc)) Do they equally reliable or one of them is more ? Neither. Check the value returned from php_sapi_name() . $_SERVER['REQUEST_METHOD'] won't be set, due to the lack of a HTTP request. I think defined( 'STDIN' ) or isset( $argc ) are reliable too, though. If it was up to me, I'd probably go with the defined( 'STDIN' ), as I can imagine someone accidentally setting a value to $argc. The php_sapi_name function above seems to be another (the most reliable?) way of determining this,

“Object variable or With block variable not set” runtime error in VB6

人盡茶涼 提交于 2019-12-02 06:17:59
问题 I've got a problem with VB6. I have a form with several ComboBox objects on it. I wish to populate the ComboBoxes via a function that takes a SQL query as a parameter. So the code looks like this Private Function FillComboBoxFromMDB(ByVal sDBName As String, _ ByVal sSQL As String) As ComboBox '/* ' * Execute SQL in MDB and fill the ComboBox with the results ' * Returns filled ComboBox ' */ Dim DB As Database Dim DBRecordset As Recordset On Error GoTo FillComboBoxFromMDB_ErrHandler Set DB =

.NET 3.5 runtime and .NET 4 runtime compatibility

故事扮演 提交于 2019-12-02 05:49:54
问题 Is it possible to run an application built on .NET 3.5 with a plug-in built with .NET 4? 回答1: You will need to rebuild (not exactly true, check update) the .NET 3.5 application to target .NET 4.0 because by default it will start in the .NET 2.0 runtime which will then not support the plugin. If the machine only has .NET 4.0 framework installed the application will not run unless rebuilt to target it specifically . Update: Well, you don't need to rebuilt after all. Chris comment got me

java runtime 入门

ぐ巨炮叔叔 提交于 2019-12-02 05:36:38
前言: Java的类库日益庞大,所包含的类和接口也不计其数。但其中有一些非常重要的类和接口,是Java类库中的核心部分。常见的有String、Object、Class、Collection、ClassLoader、Runtime、Process...,熟悉这些类是学好Java的基础。而这些类一般不容易理解,需要做深入的研究和实践才能掌握。下面是我对这些类理解和使用的一些总结。欢迎你在阅读后将你宝贵的意见和读后感留下! 一、概述 Runtime类封装了运行时的环境。每个 Java 应用程序都有一个 Runtime 类实例,使应用程序能够与其运行的环境相连接。 一般不能实例化一个Runtime对象,应用程序也不能创建自己的 Runtime 类实例,但可以通过 getRuntime 方法获取当前Runtime运行时对象的引用。 一旦得到了一个当前的Runtime对象的引用,就可以调用Runtime对象的方法去控制Java虚拟机的状态和行为。 当Applet和其他不被信任的代码调用任何Runtime方法时,常常会引起SecurityException异常。 二、API预览 addShutdownHook(Thread hook) 注册新的虚拟机来关闭挂钩。 availableProcessors() 向 Java 虚拟机返回可用处理器的数目。 exec(String command)

How to force a XmlSerializer to serialize elements as attributes of a compiled type?

梦想的初衷 提交于 2019-12-02 05:36:27
问题 I've given some predefined XML similar to this: <?xml version="1.0" encoding="utf-8"?> <Root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Points> <Point X="1.345" Y="7.45" /> <Point X="1.123" Y="5.564" /> <Point X="3.34" Y="2.5345" /> </Points> <!-- and a bunch of other attributes and structures which are perfectly serialized and deserialized by the XmlSerializer --> </Root> And my goal is to deserialize it into a List<System.Windows

Standalone VS 2010 C++ Program

不羁的心 提交于 2019-12-02 05:03:34
it's been a long while since I've used VS 2010 and C++, and as I'm getting back to using it, I'm running into the same problems that plagued me last year: the exe's that I compile do not run well on older machines that do not have the correct C++ runtimes. I do not even know what link to give them, and I told them to install this after they had an error that said "The program can't start because MSVCR100.dll is missing from your computer. Try Reinstalling the program to fix this problem. Click OK to close the application."). So I went in and set the code generation to /MT and disabled quite a

Castle Windsor: How to specify a runtime value as a parameter (E.g. value returned from static function call)

亡梦爱人 提交于 2019-12-02 04:28:49
问题 I want to perform this CODE equivlant in the castle xml config file. // Foo(string name) IFoo f = new Foo(StaticBarClass.Name); XML Now for the XML, I know everything (e.g. the blah) except for the stuff inside the parameter part. What would the parameter part look like? <component id="blah" service="blah" type="blah"> <parameters> <name>StaticBarClas.Name_THAT_I_NEED_HELP_WITH</name> </parameters> 回答1: One approach you could use is to replace the configuration parameters inspector with your

“Object variable or With block variable not set” runtime error in VB6

ぐ巨炮叔叔 提交于 2019-12-02 03:19:11
I've got a problem with VB6. I have a form with several ComboBox objects on it. I wish to populate the ComboBoxes via a function that takes a SQL query as a parameter. So the code looks like this Private Function FillComboBoxFromMDB(ByVal sDBName As String, _ ByVal sSQL As String) As ComboBox '/* ' * Execute SQL in MDB and fill the ComboBox with the results ' * Returns filled ComboBox ' */ Dim DB As Database Dim DBRecordset As Recordset On Error GoTo FillComboBoxFromMDB_ErrHandler Set DB = OpenDatabase(sDBName, False, False) If Not DB Is Nothing Then Set DBRecordset = DB.OpenRecordset(sSQL) If