标签: external

OCaml外部声明中的%含义是什么?

externalOCaml标准库中的许多声明在函数名称的开头都有%,例如int_of_float:

external int_of_float : float -> int = "%intoffloat"
Run Code Online (Sandbox Code Playgroud)

'%'是什么意思?

ocaml external ffi

13
推荐指数
2
解决办法
720
查看次数

android无法从外部jar中找到类

我正在尝试创建一个简单的测试应用程序,它基本上通过从外部JAR调用一些简单的功能来扩展Android Hello World教程应用程序.但是,当我运行应用程序时,它无法从JAR中找到该类.我究竟做错了什么?

以下是JAR的完整来源:

package com.mytests.pow;

public class power2 {

private double d;   

public power2()
{
    d = 0.0;
}   

public String stp2(double dd) 
{
    d = dd*dd;
    return String.format("%e", d);
}

}
Run Code Online (Sandbox Code Playgroud)

这是"Hello World ++"来源:

package com.myLuceneTests.namespace;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.mytests.pow.*;

public class AndroidSimpleSIH_EclipseActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

    power2 pp = new power2();
    String iout = pp.stp2(12.0);

    super.onCreate(savedInstanceState);
    TextView tv = …
Run Code Online (Sandbox Code Playgroud)

android jar external

13
推荐指数
1
解决办法
1万
查看次数

从外部配置文件读取连接字符串

我创建了一个控制台应用程序和一个app.config文件以及Connections.config文件.app.config文件有一个指向Connections.config的connectionstring属性源

当我尝试读取应用程序中的连接字符串时,我得到了一个 ConfigurationErrorException

这是我的主要方法.

static void Main(string[] args)
    {
        var settings = ConfigurationManager.ConnectionStrings;
        if (settings != null)
        {
            foreach (ConnectionStringSettings setting in settings)
            {
                Console.WriteLine(setting.ConnectionString);
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

App.config文件

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings configSource="Connections.config"></connectionStrings>
</configuration>
Run Code Online (Sandbox Code Playgroud)

Connections.config文件

<?xml version="1.0" encoding="utf-8" ?>
<connectionStrings>
  <add name="SQLDBConnecion"
   providerName="System.Data.ProviderName"
   connectionString="" />
</connectionStrings>
Run Code Online (Sandbox Code Playgroud)

我在这里观察了两件事.第一:如果我指定configSource,我无法读取连接字符串(抛出异常.)

第二:如果我在App.config文件中放入相同的连接字符串并尝试读取然后代码正在工作但获取两个连接字符串(应该只返回一个空字符串)第一个连接字符串是sqlexpress连接字符串,如下所示

data source=.\SQLEXPRESS;Integrated Security=SSPI;
     AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
Run Code Online (Sandbox Code Playgroud)

它返回的第二个连接字符串是空字符串(这是预期的).

我想从我的场景中读取外部文件中的连接字符串.怎么做?我在这里错过了什么?

c# connection-string app-config external configuration-files

13
推荐指数
2
解决办法
2万
查看次数

Kotlin中`external`关键字的目的是什么?

externalKotlin中关键字的目的究竟是什么?

我想这对JNI来说就像native在Java中一样,但我似乎无法找到任何实际的参考或文档.

java-native-interface external keyword kotlin

13
推荐指数
1
解决办法
1832
查看次数

打字总是抱怨全球模块

打字稿我很新.无论我尝试安装什么类型,我得到:

打字ERR!message尝试将"angular"编译为外部模块,但它看起来像一个全局模块.

我只是想做

typings install dt~angular
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

更新: 如果你来这里的知识很少(就像我在写这个问题时那样) - 考虑使用npm/@ types.更多信息讨论.

module global external typescript

13
推荐指数
1
解决办法
7601
查看次数

JSF的外部CSS

将外部CSS文件添加到jsf的语法是什么?

试过两种方式.没有帮助.

1.

<head>
<style type="text/css">
    @import url("/styles/decoration.css");
</style>
</head>
Run Code Online (Sandbox Code Playgroud)

2.

<head>
    <link rel="stylesheet" type="text/css" href="/styles/decoration.css" />
</head>
Run Code Online (Sandbox Code Playgroud)

css jsf external

12
推荐指数
3
解决办法
4万
查看次数

什么是TExternalThread?终止基于线程的计时器时"无法终止外部创建的线程"

这种情况发生在关闭我的应用程序的一半时间,在该应用程序中,我在设计时将TLMDHiTimer放置在我的表单上,Enabled设置为true.在我的OnFormClose事件中,我调用MyLMDHiTimer.Enabled:= false.当这个被调用时,我有时(大约一半的时间)得到这个例外.

我调试并进入调用,发现它是LMDTimer.pas中的第246行,它给出了这个错误.

FThread.Terminate;
Run Code Online (Sandbox Code Playgroud)

我使用的是最新版本的LMDTools.我在周末之前完成了LMD工具的重新安装,并且已经将组件移除并重新添加到表单中.

根据我的发现,这与TExternalThread有关,但Embarcadero没有关于它的文档,我没有在LMDTools源代码中找到任何引用它的文档.

使用完全更新的RAD Studio 2010,Delphi 2010.

让我感到不安的是,没有任何文件.谷歌实际上谈到了一个结果,其中有人说错误是由于试图终止TExternalThread造成的.但是看看这个LMDHiTimer的源代码,不是一次它的目的是做任何事情,而是创建一个常规的TThread.我可以找到一个google结果,Thread:无法终止外部创建的线程?在Embarcadero上提到使用GetCurrentThread()和GetCurrentThreadId()来获取挂钩到现有线程所需的数据,但TLMDHiTimer没有这样做.它只是创建自己的TThread后代,它有自己的Create()构造函数(当然是重写,并且在构造函数的开头继承了调用)

那么......这个TExternalThread到底是什么?还有其他人遇到过这种例外吗?也许找出了解决方案或解决方法?我已经向LMDTools自己的支持提出了几乎完全相同的问题,但在多个地方提问并不会有什么问题.

提前感谢您的任何帮助.

delphi multithreading external delphi-2010

12
推荐指数
2
解决办法
6566
查看次数

App Engine和MySQL

我只是想问一下我们是否可以从Google App Engine访问外部MySQL服务器...

mysql architecture google-app-engine external

12
推荐指数
1
解决办法
7141
查看次数

外部禁用Linux程序的信号

在Linux上,是否有可能以某种方式禁用外部程序的信令...即,不修改其源代码?

语境:

我在Linux上的bash脚本中调用了一个C(也是一个Java)程序.我不希望我的bash脚本和脚本启动的其他程序(作为前台进程)中断.

虽然我可以用...

trap '' INT
Run Code Online (Sandbox Code Playgroud)

...在我的bash脚本中禁用Ctrl C信号,这仅在程序控件恰好在bash代码中时才有效.也就是说,如果我在C程序运行时按下Ctrl C,C程序会被中断并退出!这个C程序正在进行一些关键操作,因此我不希望它被中断.我无法访问此C程序的源代码,因此C程序内的信号处理是不可能的.

#!/bin/bash

trap 'echo You pressed Ctrl C' INT 

# A C program to emulate a real-world, long-running program,
# which I don't want to be interrupted, and for which I 
# don't have the source code!
#
# File: y.c
# To build: gcc -o y y.c
#
# #include <stdio.h>
# int main(int argc, char *argv[]) {
#  printf("Performing a critical operation...\n");
#    for(;;); // …
Run Code Online (Sandbox Code Playgroud)

linux bash signals external bash-trap

12
推荐指数
1
解决办法
8216
查看次数

在 main() 中声明的函数是否具有外部链接或无链接?

请参阅以下代码:

/* first file */

int i; /* definition */
int main () {
  void f_in_other_place (void);   /* declaration */
  i = 0
  return 0;
}
/* end of first file */


/* start of second file */

extern int i; /* declaration */
void f_in_other_place (void){   /* definition */
  i++;
}
/* end of second file */
Run Code Online (Sandbox Code Playgroud)

我知道外部对象有external链接,内部对象有none链接(extern暂时忽略)。现在,如果我谈论函数f_in_other_place(),它是在 main 函数中声明的。那么它的标识符会被视为内部对象吗?如果是,则它应该具有none链接,但在程序中可见,此函数指的是它在第二个文件中的定义,该文件显示它的标识符的行为类似于具有external链接的对象。所以我很困惑这里的这个标识符是否有external链接或none链接?

现在谈到extern关键字,我在某处读到了函数声明隐式前缀 …

c external function extern linkage

12
推荐指数
1
解决办法
407
查看次数