我正在尝试编辑一些flash以进行外部javascript函数调用,但没有成功.这是我的actionscript 2.0代码:
//testing external .js calls
import flash.external.ExternalInterface;
//attempting to make external js call
ExternalInterface.call("createPlaylist","It's my Life!");
Run Code Online (Sandbox Code Playgroud)
这是我的javascript;
function createPlaylist(mess){
alert("called createPlaylist: " + mess);
}
Run Code Online (Sandbox Code Playgroud)
我见过很多例子,我对使用它感到困惑 ExternalInterface.addCallback.我不需要javascript将任何内容返回给flash,这是必要的吗?
无论出于何种原因,我从未看到警报.有没有人在我的代码中看到任何问题?有ExternalInterface没有我没有的图书馆?另外,最好的使用方法是什么ExternalInterface(即错误检查等),在此先感谢...
我在Windows上安装了boot2docker.我试图在以下链接(https://github.com/boot2docker/boot2docker-cli/issues/230)的帮助下配置代理,但它不起作用.
当我执行时boot2docker download,我有以下错误:
boot2docker download
Latest release for github.com/boot2docker/boot2docker is v1.6.0
Downloading boot2docker ISO image...
error in run: Failed to download ISO image: Get https://s3.amazonaws.com/github-cloud/releases/14930729/0573f322-e442-11e4-8500-b1bbe904b032.iso?response-content-disposition=attachment%3B%20filename%3Dboot2docker.iso&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1430303112&Signature=oTercMri%2FkqD9cbA315JhNHzehk%3D:
Proxy Authentication Required
Run Code Online (Sandbox Code Playgroud) 我遇到了一些在 spring 框架中使用的 java 类。首先,applicationContext.xml 中有 bean
<bean id="someBean" parent="txProxyTemplate">
<property name="target">
<bean class="path.to.bean.impl.SomeBeanImpl">
...
</bean>
...
</bean>
Run Code Online (Sandbox Code Playgroud)
我有接口ISomeBean和它的实现SomeBeanImpl
然后,我有另一个使用 ISomeBean 的类。
public class SomeOtherClass {
...
public function doStuff() {
...
ApplicationContext ctx;
SomeBean theBean = (SomeBean) ctx.getBean;
}
}
Run Code Online (Sandbox Code Playgroud)
我想知道为什么我们要转换到接口而不是转换到类。
我写了这段代码.它运行正常,但是当我在Valgrind下检查它时它会遇到2个问题.既然我无法解释valgrind的消息,我会很感激,如果有人解释我更多,并告诉我问题在哪里!
这是代码:
#include <iostream>
#define width 70000
#define height 10000
using namespace std;
int main(void)
{
int** pint;
pint = new int*[height];
for(int i = 0; i < height; i++)
pint[i] = new int[width];
for(int i = 0; i < height; i++){
delete[] pint[i];
pint[i] = NULL;
}
delete[] pint;
pint = NULL;
return 1;
}
Run Code Online (Sandbox Code Playgroud)
我用extjs库编写了一个程序,该程序在所有浏览器中工作正常,除了Internet Explorer 8,问题是,当我从localhost加载它时,它工作,但是当从服务器访问时,它不加载页面,我有一个空白页面,
我删除了一个逗号,程序从服务器访问时开始工作.有人有解释吗?
这是标题:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Description" content="Default Style" />
<meta name="Version" content="2.1.1" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>project name</title>
<link rel="stylesheet" type="text/css" href="./style/default/main.css" media="all" />
<style type="text/css" media="all">@import "./style/default/main.css";</style>
<link rel="shortcut icon" href="./style/default/images/favicon.ico" type="image/ico" />
<script type="text/javascript" src="http://10.215.63.218/Apsys/js/base.js"></script>
<script type="text/javascript" src="http://10.215.63.218/app/js/collapse.js"></script>
<script type="text/javascript" src="http://10.215.63.218/app/lib/overlib/overlib.js"></script>
</head>
Run Code Online (Sandbox Code Playgroud) 我有一个javascript全局变量的问题,让我假设我有以下内容
var globalVar;
Run Code Online (Sandbox Code Playgroud)
我有一个文本字段
<input type="text" id="myInput" onkeydown="checkKey(this)" onkeypress="checkKey(this)"/>
Run Code Online (Sandbox Code Playgroud)
在函数checkkey中,我为它分配了一些值:
globalVar=document.forms[0].elements("myInput").value;
Run Code Online (Sandbox Code Playgroud)
我检查了全局变量值是否已更改并发出警报.当我尝试globalVar在另一个函数中使用时,我发现它的值未定义.另一个功能有:
param += globalVar;
Run Code Online (Sandbox Code Playgroud) 我想将我的Java源代码提供给另一个Java开发人员,这样他就可以在他们应该无法编译它们的同时学习它们.我正在寻找一种简单但有效的单向算法,使我的源无法编译.我希望我能清楚地解释目标.
我的第一个想法是解析我的所有源代码并使我的所有方法名称随机混合大小写:
private double getAvailableCash() - > private double gEtaVailabLEcASh()
它很简单,重做也不容易,但并非不可能.你能告诉我一些其他的,希望更好的方法吗?
更新:
很多人评论/询问有人想要这样做的原因.假设以下情况:您必须在其他开发人员向您支付费用之前证明您已准备好提供高质量的解决方案,但您有充分理由不相信他.显示一个有效的编译演示是不够的,因为他想看看你的工作方式.如果您向他提供了可编辑的来源,您可能会在没有提供来源的情况下尽快收到付款.
无论如何,这对我来说似乎是一个非常有趣,有趣的问题,即使你们很多人也能看到许多评论和答案.. :-)
我正在尝试将一些预先存在的html/JavaScript文件转换为Flex.我尝试进行一些研究,看看是否有任何编译器编译从javascript到actionscript的代码.据我所知,有很多方法可以将动作脚本转换为javascript,但我找不到任何相反的方法.有谁知道是否有办法做到这一点,或者我应该只编写自己的工具?
我正在尝试遍历一个数组,每次都向另一个数组添加一个新级别.让我举例说明 - 变量$ arr的值每次都不同
$arr = array("1","5","6");
Run Code Online (Sandbox Code Playgroud)
循环
$index[$arr[0]];
Run Code Online (Sandbox Code Playgroud)
循环
$index["1"][$arr[1]] // "1" since this key was filled in by the previous loop, continuing with a new key
Run Code Online (Sandbox Code Playgroud)
循环
$index["1"]["5"][$arr[2]] // same as previous loop
Run Code Online (Sandbox Code Playgroud)
- 完成所有$ arr的项目,结果是$ index ["1"] ["5"] ["6"] -
问题是我不知道$arr数组包含多少值.然后,我不知道如何继续,例如,$index["1"]当第一个值$arr已经循环到下一个数组级别时(换句话说:添加另一个键).
任何人?
我在C代码中有以下定义:
#define set_str(r,s) sprintf(r, "%-.*s", (int)sizeof(r)-1,s)
Run Code Online (Sandbox Code Playgroud)
我尝试在我的代码中调用函数set_str来理解符号的含义,但它没有给出任何特殊的格式或任何东西,变量只是按原样复制.谁能告诉我这是什么意思?
我是SQL的新手,我正在尝试定义一个2个表Hospital,Hospital_Address但是当我尝试在其中添加外键时Hospital_Address会抛出一个错误:"1215: Cannot add foreign key"
create table Hospital (
HId Int not null,
HName varchar(40) not null,
HDept int, Hbed Int,
HAreaCd int not null,
Primary Key (HId)
);
create table Hospital_Address (
HAreaCd Int not null,
HArea varchar(40) not null,
HCity varchar(40),
HAdd1 varchar(40),
HAdd2 varchar(40),
Primary Key (HArea),
foreign key (HAreaCd) references Hospital (HAreaCd));
Run Code Online (Sandbox Code Playgroud)
请帮助我这方面.提前致谢.
我有一个名称如下所示的容器列表:
容器 1:myApp_ ihm .dfgdfgdfgdfvdfdfbvdfvdfv
容器 2:myApp_back.uirthjhiliszfhjuioomlui ...
容器 3: myApp_database.piyrjfhjyukyujfkgft
我必须在名称包含ihm的容器上执行一些字符串(我的示例中的第一个)
为了执行我的命令,我习惯于这样做:
docker exec -it ihm bash
Run Code Online (Sandbox Code Playgroud)
所以ihm应该用一些测试代替以获得第一个名称:
myApp_ihm.dfgdfgdfgdfvdfdfbvdfvdfv
建议?
javascript ×3
arrays ×2
docker ×2
java ×2
2d ×1
actionscript ×1
bash ×1
boot2docker ×1
c ×1
c++ ×1
dynamic ×1
extjs ×1
flash ×1
flex4 ×1
loops ×1
mysql ×1
nested ×1
obfuscation ×1
php ×1
powershell ×1
shell ×1
spring ×1
sql ×1
valgrind ×1