我发现以下问题是Java"pass-by-reference"还是"pass-by-value"?.
我几乎阅读了所有内容,但是如果我想要这个foo(-)方法,我还不知道该怎么做才能改变我String的价值?(也许或不参考,对我来说无关紧要).
void foo(String errorText){
errorText="bla bla";
}
int main(){
String error="initial";
foo(error);
System.out.println(error);
}
Run Code Online (Sandbox Code Playgroud)
我想bla bla在控制台上看到.可能吗?
我有一个页面包含一个嵌套在对话框中的表单和其他表单.当在主窗体中单击按钮时,我需要将参数传递给对话框
<h:form>
<p:dataTable var="form" value="#{myBean.formList}">
<p:commandButton id="selectProduct"
update="selectProductForm" oncomplete="selectProductDlg.show()"
image="ui-icon-" >
<f:param name="formId" value="#{form.id}" />
</p:commandButton>
</p:dataTable>
</h:form>
<p:dialog>
...<h:form>
<p:commandButton action="#{myBean.setSelected}"
update="main_form"
oncomplete="if(#{myBean.errorText == 'SUCCESS'}){ selectProductDlg.hide();}"
value="Sec">
</p:commandButton>
Run Code Online (Sandbox Code Playgroud)
我无法在myBean中看到带有代码的formId:
if (form == null) {
HttpServletRequest req = (HttpServletRequest) FacesContext
.getCurrentInstance().getExternalContext().getRequest();
if(req.getParameter("formId") != null) {
formId = Long.valueOf(req.getParameter("formId"));
}
if (formId != null && !"".equals(formId)) {
form = formService.findById(formId);
}
}
Run Code Online (Sandbox Code Playgroud)
哪里我错了谢谢
我需要<img src=""/>在所有浏览器中使用JavaScript 设置HTML 对象的不透明度.
在Firefox中,我使用line:
imageobject.style.MozOpacity=opacity/100;
Run Code Online (Sandbox Code Playgroud)
在不同浏览器中设置元素不透明度的正确javascript代码是什么?
简单地说,我试图通过FireBug在生成的HTML中查看组件的名称,之后我在JSF项目中手动定义的css中更改它,但无法覆盖PrimeFaces的CSS定义.提前感谢任何想法.
我正在使用Eclipse Indigo和Subversive SVN Team提供程序.
当我使用SVN存储库生成项目时,我提供了用户名和密码.
现在一周后我想更新一些文件,右键单击一个文件,Team-> Update,得到以下错误:
Some resources were not updated.
svn: connection refused by the server
svn: PROPFIND request failed on 'bla bla'
Run Code Online (Sandbox Code Playgroud)
我想我必须登录但是从哪里可以提供路径?或者问题是什么?谢谢
对于下面的代码,我收到行标题中的错误
while((*(It2 + code)).exists){
Run Code Online (Sandbox Code Playgroud)
void locatetohashtable(std::list<Element> elist,
int *m,std::list<Element>& table,
std::list<std::string>& keylist )
{
std::list<Element>::iterator It2=table.begin();
int i=0;
int k=0;
std::list<Element>::iterator It;
for(It = elist.begin(); It != elist.end(); ++It)
{
int code=hash_func(stringIntValue((*It).name),*m,i);
while((*(It2 + code)).exists){
i++;
}
table.insert(*(It2+i), (*It));
keylist.insert(keylist.begin(),(*It).name);
k++;
}
}
Run Code Online (Sandbox Code Playgroud)
我没有得到同样的错误 ++It
有什么问题?
我写了一个这样的svg文件:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1280pt" height="650pt" viewBox="0 0 1280 650" id="svg1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><script xlink:href="pathToPolyline.js"/><script><![CDATA[
alert(document);//returns [object SVG document]
//and tried
var path=document.getElementById('path1');//the problem line
alert(path);
]]></script>
<path id="path1" fill="#000000" d=" M 0.00 0.00 L 1280.00 0.00 L 1280.00 449.99 C 1276.46 444.19 1270.19 441.08 1265.59 436.31 C 1264.17 429.73 1265.36 422.91 1266.42 416.36 C 1267.19 413.43 1264.94 410.65 1262.45 409.42 C 1255.44 405.63 1247.99 402.68 12 .....
Run Code Online (Sandbox Code Playgroud)
如注释行中的alert(document);警报 …
我有这些QML行:
Item {
id:container
Rectangle {
id:rec1
width:20; height:20; x:20; y:20
color:"blue"
MouseArea {
onClicked:rec1.forceActiveFocus();
}
//bla bla
}
Rectangle {
id:rec2
width:20; height:20; x:200; y:200
color:"red"
MouseArea {
onClicked:rec2.forceActiveFocus();
}
//bla bla
}
}
Run Code Online (Sandbox Code Playgroud)
当我点击其中一个矩形时,它会获得焦点而其他焦点会失去焦点.这就是我想要的,好吧,但我想要一个矩形失去焦点当我点击白色空间,矩形和项目,项目ID:容器?
我该怎么办?
我在理解gdb时遇到了一些问题.
我有一个主要功能,我在自己写了这个主要功能.
在这个主要的一些行,调用库中的一些函数,我认为库名称并不重要,但它是tesseract-ocr.
我在main中调用一个函数的行,一个构造函数在这里:
choiceItr = new tesseract::ChoiceIterator(itr);
Run Code Online (Sandbox Code Playgroud)
我在上面一行的gdb处设置了一个断点,然后运行,当它在该行停止时,我使用step命令进入该功能.
这是名为的库函数:
ChoiceIterator::ChoiceIterator(const ResultIterator& result_it) {
ASSERT_HOST(result_it.it_->word() != NULL);
tesseract_ = result_it.tesseract_;
PAGE_RES_IT res_it(*result_it.it_);
WERD_CHOICE* best_choice = res_it.word()->best_choice;
BLOB_CHOICE_LIST_CLIST* choices = best_choice->blob_choices();
if (choices != NULL) {
BLOB_CHOICE_LIST_C_IT blob_choices_it(choices);
for (int blob = 0; blob < result_it.blob_index_; ++blob)
blob_choices_it.forward();
choice_it_ = new BLOB_CHOICE_IT(blob_choices_it.data());
choice_it_->mark_cycle_pt();
} else {
choice_it_ = NULL;
}
}
Run Code Online (Sandbox Code Playgroud)
然后我使用gdb的"next"命令来执行功能.
这是我的gdb控制台:
Breakpoint 1, pixsOfOneWord (langString=0x8049e7c "klm",
imageString=0x8049e71 "paket2.tif", outputData=0x8049c7b,
datapathString=0x8049e6f ".") at deneme234.cpp:161
161 choiceItr = new tesseract::ChoiceIterator(itr);
(gdb) …Run Code Online (Sandbox Code Playgroud) 我尝试同时构建一个既是JQuery treeTable又是JQuery数据表的表.请注意,我的问题不是关于如何使用它,我可以查看没有问题,如果我填写"表".
但是当我向我的treetable建筑代码发送一个空数组时,我收到错误.
这是问题行:
$('#table tbody tr').each(function(){
console.log(this);
if(mytable.fnGetData(mytable.fnGetPosition(this))[4]){
console.log('in set child before');
$(this).addClass('child-of-'+mytable.fnGetData(mytable.fnGetPosition(this))[4]);
console.log('in set child after');
}
$(this).attr('id', mytable.fnGetData(mytable.fnGetPosition(this))[0]);
});
Run Code Online (Sandbox Code Playgroud)
当我没有填充表格,尽管我的愿望,过程进入上述循环,并且
console.log(this) 打印出来:
<tr class="odd"><td valign="top" colspan="4" class="dataTables_empty">No data available in table</td></tr>
Run Code Online (Sandbox Code Playgroud)
因此它会生成错误,因为行数据不是预期的.
我想问一下,如果它是一个填充的"数据"或一个空的警告行,最优雅的控制方法是什么?检查"dataTables_empty"的"类"是否合适?
或者,如果表为空,还有其他方法可以不通过上面的循环.
c++ ×2
javascript ×2
jsf ×2
primefaces ×2
css ×1
datatable ×1
eclipse ×1
gdb ×1
immutability ×1
iterator ×1
java ×1
jquery ×1
list ×1
opacity ×1
parameters ×1
qml ×1
stl ×1
string ×1
svg ×1
svn ×1