如何在Oracle中授予用户DBA权限?我猜是这样的:
CREATE USER NewDBA
IDENTIFIED BY passwd;
GRANT DBA TO NewDBA WITH ADMIN OPTION;
Run Code Online (Sandbox Code Playgroud)
这是正确的方式,还是......
我有这个程序:
CREATE OR REPLACE PROCEDURE PROC1(invoicenr IN NUMBER, amnt OUT NUMBER)
AS BEGIN
SELECT AMOUNT INTO amnt FROM INVOICE WHERE INVOICE_NR = invoicenr;
END;
Run Code Online (Sandbox Code Playgroud)
所以,当我像这样运行时,它绝对没有返回:
DECLARE
amount NUMBER;
BEGIN
PROC1(1000001, amount);
dbms_output.put_line(amount);
END;
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我使用DreamCoder for Oracle.程序本身或我称之为程序有问题吗?INVOICE表中有一个条目,INVOICE_NR等于1000001.
我运行Eclipse 4.3了Java 7 JRE.当我升级到a时Java 8 JRE,Eclipse会突然消耗更多内存.如果我JRE 7直接将Eclipse启动到我的工作区,它会根据任务管理器分配600 MB的RAM.当我使用时JRE 8,此值为750 MB.
更糟糕的是,如果我运行一个大型Java程序,通常会分配大约10 GB的RAM JRE 7,切换到JRE 8它会分配12 GB的RAM.
有人知道是什么原因导致额外的RAM分配吗?我已经测试了调整不同的选项,但没有成功:
-XX:ReservedCodeCacheSize=
-XX:MaxMetaspaceSize=
-XX:MetaspaceSize=
...
Run Code Online (Sandbox Code Playgroud) 我正在使用Transformer通过添加更多节点来编辑Java中的XML文件.旧的XML代码没有改变,但是新的XML节点具有<而>不是<>并且在同一行上.而不是如何获得<> <和>以及如何获得新的节点后换行.我已经阅读了几个类似的线程,但无法获得正确的格式.以下是代码的相关部分:
// Read the XML file
DocumentBuilderFactory dbf= DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc=db.parse(xmlFile.getAbsoluteFile());
Element root = doc.getDocumentElement();
// create a new node
Element newNode = doc.createElement("Item");
// add it to the root node
root.appendChild(newNode);
// create a new attribute
Attr attribute = doc.createAttribute("Name");
// assign the attribute a value
attribute.setValue("Test...");
// add the attribute to the new node
newNode.setAttributeNode(attribute);
// transform the XML
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.METHOD, …Run Code Online (Sandbox Code Playgroud) 我有一个XML文件,具有以下结构:
<root>
<level1>
<level2>
<value>A</value>
<value>B</value>
<value>C</value>
<value>D</value>
<value>E</value>
<value>F</value>
</level2>
</level1>
</root>
Run Code Online (Sandbox Code Playgroud)
我想我只想在XSL中连接前三个值以获得ABC.我该怎么做?
我正在Ubuntu 12.04 x86_64上编译几个库.首先,我使用GCC 4.7.2编译了这些库并且一切顺利.然后我尝试使用Inte Composer 2013 u2重新编译它们.我做的目的是:
export CC=/opt/intel/composer_xe_2013.2.146/bin/intel64/icc
export CPP=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
Run Code Online (Sandbox Code Playgroud)
然后我运行./configure并得到以下错误:
checking how to run the C preprocessor... /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
configure: error: in `/var/www/workspace/freetype/freetype-2.4.11/builds/unix':
configure: error: C preprocessor "/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc" fails sanity check
See `config.log' for more details
make: *** [setup] Error 1
Run Code Online (Sandbox Code Playgroud)
配置日志文件包含此错误:
configure:3345: checking how to run the C preprocessor
configure:3415: result: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
configure:3435: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc conftest.c
conftest.c(14): error: identifier "Syntax" is undefined
Syntax error
^
conftest.c(14): error: expected a ";"
compilation aborted for conftest.c (code 2)
configure:3435: …Run Code Online (Sandbox Code Playgroud) 我在不属于类的头文件中有以下代码:
template<typename Foo> static const Compl<Foo,bar> *foobar (const FBTYPE &x);
template<> static const Compl<typea,bar> *foobar<typea>(const FBTYPE &x) {
return x.funcA();
}
template<> static const Compl<typeb,bar> *foobar<typeb>(const FBTYPE &x) {
return x.funcB();
}
Run Code Online (Sandbox Code Playgroud)
代码使用较旧的GCC版本编译得很好,但在较新的版本中,我收到此错误消息:
rsvt.h(672): error #3503: a storage class is not allowed in an explicit specialization
template<> static const Compl<typea,bar> *foobar<typea>(const FBTYPE &x) {
^
Run Code Online (Sandbox Code Playgroud)
知道为什么它适用于较旧版本的GCC但不适用于较新版本的GCC吗?另外,如何让它与GCC 5一起使用?
我有一个巨大的XML文件(114 KB/1719行;请参阅下面的错误消息,为什么我说巨大)我尝试阅读它,因为我之前已经完成了两个类似的文件.
其他两个文件正常加载并且大小相当,唯一的区别是所讨论的文件包含阿拉伯文本.所以这是PHP代码:
$doc3 = new DOMDocument('1.0', 'utf-8');
$doc3->load($masternumber.'.xml');
Run Code Online (Sandbox Code Playgroud)
错误是:
警告:DOMDocument :: load()[domdocument.load]:文档中的深度过高:256在文件中使用XML_PARSE_HUGE选项:...
然后$doc3不加载文件.所以我修改了代码:
$doc3->load($masternumber.'.xml', "LIBXML_PARSEHUGE");
Run Code Online (Sandbox Code Playgroud)
我最后还有另一个警告:
警告:DOMDocument :: load()期望参数2为long,字符串在...中给出
$doc3 又空了.
这有什么问题?其他文件包含其他语言的相同文本并正确加载但不是这个?我使用的是PHP 5.3.9.
我正在尝试编译我从Internet下载的大型项目,并且我有一个运行configure,make和make install的自定义脚本.问题是我想传递一些兼容性标志,但项目使用的libtool无法识别LDFLAGS,我必须找到另一种传递兼容性标志的方法.所以在运行configure后我的脚本中我有如下代码:
COMPATFLAG="-gcc-name=/usr/local/gcc-4.2.1/bin/gcc"
sed -i "s/CC -shared/CC -shared ${COMPATFLAG}/g" libtool
Run Code Online (Sandbox Code Playgroud)
${COMPATFLAG}可能会得到不同的值取决于正在编译的平台,所以我不能在sed语句中以明文形式.问题是它不起作用 - 我得到一个空的空间而不是值${COMPATFLAG}.如果我改为写sed -i "s/CC -shared/CC -shared TEST/g" libtool,则将字符串"TEST"添加到文件中.如果我使用单引号,我得到${COMPATFLAG}字符串而不是变量的值.如果我尝试导出${COMPATFLAG}它仍然无法正常工作.我不知道为什么会出错.任何的想法?
我刚刚在Mac OS X 10.7上安装了我的证书,并编写了codesign一个在编译项目后运行在许多文件上的脚本.我创建了一个新的钥匙串,并在一段时间后禁用了锁定它的选项.它看起来像登录钥匙串.但是每次我的脚本运行codesign命令时都会发生以下错误:<filename>: User interaction is not allowed.如果我启动一个shell,解锁密钥链,security unlock-keychain <path>然后手动运行脚本,它就可以了.问题是如何保持钥匙串始终解锁,以便我的自动构建可以签署文件?
我的应用程序应该将一些数据存储在文本文件中.每次启动应用程序时,都会读取数据,每次关闭应用程序时,都会从文本文件中删除数据,并保存有关上次会话的新数据.
现在我在读取数据时没有问题:
InputStream is = getResources().openRawResource(R.raw.myFile);
BufferedReader br = new BufferedReader(new InputStreamReader(is));
Run Code Online (Sandbox Code Playgroud)
问题是当我写入文件时.显然它必须以某种方式通过资源访问,但R.raw.myFile结果只在InputStream中,我必须将一个字符串传递给openFileOutput.这是有问题的代码:
FileOutputStream fos = openFileOutput(getResources().openRawResource(R.raw.myFile), MODE_PRIVATE);
Run Code Online (Sandbox Code Playgroud)
所以这似乎不起作用.有没有其他方法写入原始文件夹中的文件?
想法是开始聊天.所以我在班上有这个属性:
private MulticastSocket so;
private EditText messageBoard;
private InetAddress serverAddress;
private int port;
Run Code Online (Sandbox Code Playgroud)
然后我在onCreate()方法中有这个代码:
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
// connect to server
connect();
// Associate a variable with the Button on the interface
final Button sendButton = (Button) findViewById(R.id.button2);
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// when the button is clicked the next screen is loaded
sendMessage();
}
});
} // end of onCreate
Run Code Online (Sandbox Code Playgroud)
这是我的connect()方法: …