在运行时性能方面,在Java中将int转换为short是多么昂贵?可能有成千上万的这样的铸造,因此我想知道它是否会影响性能.谢谢.
我有一个从主GUI线程调用的对象,并显示一个单独的JFrame几秒钟,然后消失(使用一个计时器).现在我想让主GUI线程等到弹出的JFrame窗口消失.例如,在主GUI代码上:
// initiate the object and show the pop-up JFrame
DisappearingJFrame djf = new DisappearingJFrame ();
djf.show ();
// now the main GUI thread should wait
// and after the pop-up JFrame disappears, the rest of the code is then executed
...
...
Run Code Online (Sandbox Code Playgroud)
任何建议都会受到欢迎.谢谢.
我正在使用Supervisord来管理服务器上的uwsgi进程,我遇到了这两个选项:environment以及directory使用Supervisord运行程序.
我看看文档,但仍然不确定他们到底做了什么.为了澄清,这里的上下文是我正在使用uwsgi运行web2py应用程序.在uwsgi的配置中,我已经设置了PYTHONPATH和它应该运行的virtualenv.
有人可以解释这两个选项的用途,如何在必要时设置它们?
我想在Bootstrap表格单元格中垂直居中一个复选框,这就是我现在所拥有的:
<div>
<table id="mytb" class="table table-hover table-condensed">
<thead>
<tr>
<th style="width: 25%;">A</th>
<th style="width: 40%">B</th>
<th style="width: 35%">C</th>
</tr>
</thead>
<tbody>
<tr>
<td>Blah</td>
<td>Blah More</td>
<td class="vcenter"><input type="checkbox" id="blahA" value="1"/></td>
</tr>
<tr>
<td>Blah</td>
<td>Blah More</td>
<td class="vcenter"><input type="checkbox" id="blahA" value="1"/></td>
</tr>
<tr>
<td>Blah</td>
<td>Blah More</td>
<td class="vcenter"><input type="checkbox" id="blahA" value="1"/></td>
</tr>
</tbody>
</table>
</div>
/* CSS */
td.vcenter {
vertical-align: middle;
}
Run Code Online (Sandbox Code Playgroud)
示例:http://jsfiddle.net/dRgt2/2/.很明显,复选框位于单元格的下半部分.
请注意,在上面的小提琴中,我已经尝试过这个问题的解决方案:使用Twitter Bootstrap在表格单元格中垂直居中按钮,但它似乎在我的情况下不起作用.
我正在使用最新的Bootstrap 2.3.2,如果这有所不同.