标签: external

将file:// scheme转换为content:// scheme

我正在使用Droid X的Files应用程序和Astro文件管理器来选择图像文件.这两个应用程序使用方案"file://"返回所选图像,而Gallery返回带有方案"content://"的图像.如何将第一个模式转换为第二个模式.或者如何使用第二种格式解码图像?

android uri external file-uri

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

在Javascript中,是否可以将变量传递给<script>"src"参数?

Javascript中是否可以通过src参数传递变量?即.

<script type="text/javascript" src="http://domain.com/twitter.js?handle=aplusk" />`
Run Code Online (Sandbox Code Playgroud)

我想twitter.js查看是否在执行我需要它之前传递了"句柄"并将其响应返回到原始页面调用twitter.js.

我最初创建了一个函数twitter.js,执行以下操作:

function getHandle() {
  var vars = [], hash, username;
  var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

  for(var i = 0; i < hashes.length; i++) {
    hash = hashes[i].split('=');
    if (hash[0] == 'handle') 
     username = hash[1];
  }

  return username;
}
Run Code Online (Sandbox Code Playgroud)

问题,这是有道理的,window.location.href不会对我正在调用的文件起作用 <script src="" />

谢谢!

javascript external

5
推荐指数
2
解决办法
5760
查看次数

如何以独立于平台的方式在 netbeans 中的 Java 框架内运行外部程序?

我目前正在为一所大学开展一个研究项目,其中我正在与数据库进行 GUI 交互,并根据数据启动外部程序。我正在使用运行时命令(一旦检测到操作系统)来启动具有所选数据的外部程序。

我的问题是如何将外部程序的 GUI 嵌入到 Java 框架中(如果这是远程可能的话)?

java external

5
推荐指数
1
解决办法
7047
查看次数

无法通过system()执行外部程序?

我试图在php脚本中编译我的latex文件,但它无法调用xelatex.

在PHP脚本中:

system("/usr/bin/whoami");
system("/usr/bin/xelatex foo.tex 2>&1");
Run Code Online (Sandbox Code Playgroud)

输出:

myuser
sh: 1: /usr/bin/xelatex: not found
Run Code Online (Sandbox Code Playgroud)

但在我的终端:

$ /usr/bin/whoami
=> myuser
$ /usr/bin/xelatex foo.tex
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)
...(successful output)...
Run Code Online (Sandbox Code Playgroud)

我运行php as myuser,并传递system()绝对路径.然后我就关掉safe_mode了.为什么我还不能执行外部程序?

php system external

5
推荐指数
1
解决办法
338
查看次数

C++从子目录加载DLL?

我是C++的"隐藏/黑暗的地方"的新手,我想知道如何从我正在运行当前可执行文件的目录中的不同目录或子目录中加载.dll文件

例如:

./MyAppDirectory
  /MyApp.exe
  /SomeDLL.dll
  /AnotherDLL.dll
  /SubDirectory
    /SomeDLL2.dll
    /AnotherDLL2.dll
    /YetAnotherDLL.dll
    /...
Run Code Online (Sandbox Code Playgroud)

因此,"MyApp.exe"会自动从其根文件夹"MyAppDirectory"加载"SomeDLL.dll"和"AnotherDLL.dll",但我还希望能够加载"SomeDLL2.dll","AnotherDLL2.dll","YetAnotherDLL".从"MyAppDirectory"文件夹中的"SubDirectory"文件夹中输入"等".

我一直在做一些搜索,从我发现的唯一解决方案是:

  • 1)修改可执行文件的工作目录.
  • 2)将DLL文件放在Windows根目录中.
  • 3)修改PATH环境变量.

但是他们都有一些不好的方面(这里不值得一提)而且这不是我真正需要的.另一个解决方案是通过"特定于应用程序的路径!" 涉及使用Windows注册表,似乎比之前提到的略好.

但是,我需要能够使用C++在"MyApp.exe"中执行此操作,而无需使用外部方法.

我使用的是MinGW 4.7.2,我的IDE是Code :: Blocks 12.11,我的操作系统是Windows XP SP3 Pro x86.

任何参考,教程,文档,示例等都被接受,谢谢你的时间:D

c++ directory dll load external

5
推荐指数
1
解决办法
3936
查看次数

无论如何在Eclipse中使用带有EGit的外部差异编辑器?

无论如何,在进行差异/合并时,是否要将Eclipse/EGit配置为使用外部差异编辑器和合并工具?我一直在寻找一种方法来使用像BeyondCompare或DiffMerge或Kaleidoscope这样的东西,但到目前为止还没有找到配置它的方法.

我意识到BC有自己的插件,但它在Egit上下文中不起作用(即:查看历史记录并与工作树进行比较等).

我正在运行Eclipse 3.7SR2(Indigo)和eGit 2.1.0.我已经尝试将东西放在我的.gitconfig中以使用外部差异工具,但Eclipse仍然在自己的比较窗口中打开文件.

eclipse git compare external egit

5
推荐指数
1
解决办法
3034
查看次数

如何将Ajax调用包含为外部文件?

我有一个简单的Ajax调用,当我在HTML文件中的结束体标记之前将其包装在脚本中的文档就绪函数中时,它可以正常工作.但是,当我尝试将调用移动到外部.js文件(不包括脚本标记和文档就绪函数)时,调用不起作用.我尝试在HTML文件的头部和正文中添加外部文件,但没有成功:

<script src="includes_js/login3.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)

我在这里没有包含太多代码,因为我不确定什么可能有用.

html javascript ajax jquery external

5
推荐指数
1
解决办法
8950
查看次数

如何从Qt中获取外部文件?

我想打开一个pdf文件,只需双击QListWidget的一个元素即可.我创建了一个批处理文件来打开Acrobat Reader(reader.bat),但我想要一个特定的pdf文件:

void MainWindow::on_FileListWidget_itemDoubleClicked(QListWidgetItem *item)
{
        QFile SelectedModel(Current_Path  + "/Template/" + item->text());
        QString FileName;
        FileName = (Current_Path  + "/Template/" + item->text());
        ::system("e:\\reader.bat");
}
Run Code Online (Sandbox Code Playgroud)

1)我不知道从QFile或QString可以更好的是从QListWidget中识别和选择文件; 2)我不知道如何将文件添加到命令中打开Acorbat Reader(在显示的行中我可以打开程序但不能打开我的文件).任何的想法?

c++ qt file external

5
推荐指数
1
解决办法
4996
查看次数

如何将jar文件保留在外部但仍然在我的Android项目中使用它的类?

我需要一个位于Android项目的main/assets目录中的jar文件.jar文件位于那里很重要.

我的主要Android项目是否有一种方法可以在我的代码中引用这个jar文件并使用它的类?

为了清楚起见,我不想在编译后将jar添加到主项目中.

编辑:我已经尝试了下面的链接,它似乎加载我说过的类文件.但我正在努力为动态加载的Class定义构造函数参数.

Android的自定义类装载样本

EDIT2

就快到了.我已经确认该类是从我的classes.jar加载的.我虽然坚持实例化.

在licenseValidatorClazz.getConstructor行上,我收到以下错误.我猜我在接口文件中遗漏了什么?

java.lang.NoSuchMethodException:[interface com.google.android.vending.licensing.Policy,interface com.google.android.vending.licensing.DeviceLimiter,interface com.google.android.vending.licensing.LicenseCheckerCallback,int,class java .lang.String,类java.lang.String]

    public Class licenseValidatorClazz = null;
    public LicenseValidator validator;

    ...

    // Initialize the class loader with the secondary dex file.
    DexClassLoader cl = new DexClassLoader(dexInternalStoragePath.getAbsolutePath(),
    optimizedDexOutputPath.getAbsolutePath(),
    null,
    mContext.getClassLoader());

        try {
            // Load the library class from the class loader.
            licenseValidatorClazz = cl.loadClass("com.google.android.vending.licensing.LicenseValidator");

            validator = (LicenseValidator) licenseValidatorClazz.getConstructor(Policy.class,DeviceLimiter.class,LicenseCheckerCallback.class,int.class,String.class,String.class).newInstance(ddd, new NullDeviceLimiter(),
                    callback, generateNonce(), mPackageName, mVersionCode);

        } catch (Exception exception) {
            // Handle exception gracefully here.
            exception.printStackTrace();
        }
Run Code Online (Sandbox Code Playgroud)

我有一个接口,其中包含传递给已加载类的函数.

public …
Run Code Online (Sandbox Code Playgroud)

java import android jar external

5
推荐指数
1
解决办法
830
查看次数

如何在Perl脚本中调用函数(在shell脚本中定义)

我有两个脚本,即shell_script.shperl_script.pl.

shell_script.sh :它具有函数定义,当从Perl脚本调用时,它将以批处理模式在Linux上执行某些命令.

perl_script.pl :它具有要实现的代码和逻辑,用于调用等.

的内容shell_script.sh文件是为下:

bash-4.2$ cat shell_script.sh

的内容perl_script.pl文件是为下:

#!/bin/bash

# Function Definitions
func_1 ()
{
  echo "function definition"
}

func_2 ()
{
  echo "function definition"
}
Run Code Online (Sandbox Code Playgroud)

我如何调用perl脚本中的函数func_1()(在其中定义shell_script.sh)perl_script.pl

unix linux shell perl external

5
推荐指数
2
解决办法
594
查看次数

标签 统计

external ×10

android ×2

c++ ×2

java ×2

javascript ×2

ajax ×1

compare ×1

directory ×1

dll ×1

eclipse ×1

egit ×1

file ×1

file-uri ×1

git ×1

html ×1

import ×1

jar ×1

jquery ×1

linux ×1

load ×1

perl ×1

php ×1

qt ×1

shell ×1

system ×1

unix ×1

uri ×1