我用表单打开一些选项卡,当我按下命令按钮时(会话过期一段时间后),我收到一条 java 脚本警报:
serverError: class javax.faces.application.ViewExpiredException viewId:/register.xhtml - 无法恢复 View /register.xhtml。
在 Firefox 上(本地 glassfish 4)
我已经添加了 :
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/index.xhtml?faces-redirect=true</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)
在我的web.xml但我没有重定向到我的索引。这是为什么 ?
编辑:示例按钮
<h:commandButton value="Register" action="#{userController.register}">
<f:ajax execute="@form" render="@form" />
</h:commandButton>
Run Code Online (Sandbox Code Playgroud)
UserController 是 ViewScoped
这就是我在日志中看到的内容:
[jbossas-DOMAIN.rhcloud.com SHA]\> tail_all
2014/05/26 09:08:35,527 INFO [org.jboss.as.messaging] (MSC service thread 1-4)
JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
2014/05/26 09:08:35,599 INFO [org.jboss.as.deployment.connector] (MSC service t
hread 1-2) JBAS010406: Registered connection factory java:/JmsXA
2014/05/26 09:08:35,620 INFO [org.hornetq.ra.HornetQResourceAdapter] (MSC servi
ce thread 1-2) HornetQ resource adaptor started
2014/05/26 09:08:35,621 INFO [org.jboss.as.connector.services.ResourceAdapterAc
tivatorService$ResourceAdapterActivator] (MSC service thread 1-2) IJ020002: Depl
oyed: file://RaActivatorhornetq-ra
2014/05/26 09:08:35,623 INFO [org.jboss.as.deployment.connector] (MSC service t
hread 1-4) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
2014/05/26 09:08:35,785 INFO [org.jboss.as.server.deployment] (MSC service …Run Code Online (Sandbox Code Playgroud) XML:

Java的:

这是一个错误还是一个功能?
不用说,选择XML文件时,快捷方式(Ctrl+ Shift+ Alt+ W)可以正常工作.
使用的软件版本:
面向Web开发人员的Eclipse Java EE IDE.
版本:Luna M7版本(4.4.0M7)版本号:20140508-1440
我正在将一个巨大的 py 模块重构为包 - 为了不破坏现有代码,我将其内容移动到package/__init__.py模块(将代码添加到 __init__.py)并继续从那里拆分它。我注意到在某个时刻,在我的回溯中我得到:
Traceback (most recent call last):
File "<string>", line 656, in DoItemMenu
File "bash\balt.py", line 2109, in PopupMenu
link.AppendToMenu(menu,parent,*args)
File "bash\balt.py", line 2225, in AppendToMenu
for link in self.links: link.AppendToMenu(subMenu,window,data)
...
Run Code Online (Sandbox Code Playgroud)
其中的行File "<string>"对应于特定package/__init__.py模块。此外,PyCharm 的调试器显示“帧不可用”行,并且不会单步执行__init__.py. 为什么?与进口模式有关吗?
该代码由启动器类导入:
class UnicodeImporter(object):
def find_module(self,fullname,path=None):
if isinstance(fullname,unicode):
fullname = fullname.replace(u'.',u'\\')
exts = (u'.pyc',u'.pyo',u'.py')
else:
fullname = fullname.replace('.','\\')
exts = ('.pyc','.pyo','.py')
if os.path.exists(fullname) and os.path.isdir(fullname):
return self
for ext in …Run Code Online (Sandbox Code Playgroud) 假设我有一个线程和程序的主要部分.因为GIL,一个线程应该在正确的时间(而不是同时)工作?但是,如果其中一个线程是无限循环(或两者都是这样)呢?
这两个过程会并行运行吗?
def test():
while True:
print "hello"
def test2():
while True:
print "hi"
def start_thread():
try:
thread.start_new_thread( test2,() )
except:
print "Error: Unable to start thread"
start_thread()
test()
Run Code Online (Sandbox Code Playgroud) 我正在为 tensorflow RNN 准备输入张量。
目前我正在做以下事情
rnn_format = list()
for each in range(batch_size):
rnn_format.append(tf.slice(input2Dpadded,[each,0],[max_steps,10]))
lstm_input = tf.stack(rnn_format)
Run Code Online (Sandbox Code Playgroud)
是否可以使用一些 tensorflow 函数在没有循环的情况下立即执行此操作?
如果我有一(key, value)对配对,我可以快速初始化这样的字典:
>>> data = [ ('a', 1), ('b', 2) ]
>>> dict(data)
{'a': 1, 'b': 2}
Run Code Online (Sandbox Code Playgroud)
我想用Counter字典做同样的事; 但怎么样?构造函数和update()方法都将有序对视为键,而不是键值对:
>>> from collections import Counter
>>> Counter(data)
Counter({('a', 1): 1, ('b', 2): 1})
Run Code Online (Sandbox Code Playgroud)
我能管理的最好的就是使用一个临时字典,这个字典很丑陋而且不必要地迂回:
>>> Counter(dict(data))
Counter({'b': 2, 'a': 1})
Run Code Online (Sandbox Code Playgroud)
有没有一种正确的方法Counter从一(key, count)对配对中直接初始化?我的用例涉及从文件中读取大量已保存的计数(使用唯一键).
我将我的整个数据集作为元组列表存储在内存中,其中每个元组对应一批固定大小的"N".即
(X [I],标记[I],长度[I])
主要问题:批次间的差异很大.
我正在查看以下数据集API的示例和文档,但无法理解如何为我的案例创建DataSet对象.像Dataset.from_tensor_slices和Dataset.from_tensor这样的API似乎不起作用(抛出广播错误),因为它们要求张量具有相同的形状i,而且批次之间的W是相同的.有没有办法我可以做而不必填充我的批次(使用DataSet.padded_batch)?
我使用tensorflow对象检测API中的代码生成了pascal voc 2007 tfrecords文件。我使用tf.contrib.data.DatasetAPI从tfrecords中读取数据。我在没有tf.contrib.data.DatasetAPI的情况下尝试了mehtod ,并且代码可以正常运行,但是更改为tf.contrib.data.DatasetAPI后无法正常工作。
没有tf.contrib.data.Dataset以下代码:
import tensorflow as tf
if __name__ == '__main__':
slim_example_decoder = tf.contrib.slim.tfexample_decoder
features = {"image/height": tf.FixedLenFeature((), tf.int64, default_value=1),
"image/width": tf.FixedLenFeature((), tf.int64, default_value=1),
"image/filename": tf.FixedLenFeature((), tf.string, default_value=""),
"image/source_id": tf.FixedLenFeature((), tf.string, default_value=""),
"image/key/sha256": tf.FixedLenFeature((), tf.string, default_value=""),
"image/encoded": tf.FixedLenFeature((), tf.string, default_value=""),
"image/format": tf.FixedLenFeature((), tf.string, default_value="jpeg"),
"image/object/bbox/xmin": tf.VarLenFeature(tf.float32),
"image/object/bbox/xmax": tf.VarLenFeature(tf.float32),
"image/object/bbox/ymin": tf.VarLenFeature(tf.float32),
"image/object/bbox/ymax": tf.VarLenFeature(tf.float32),
"image/object/class/text": tf.VarLenFeature(tf.string),
"image/object/class/label": tf.VarLenFeature(tf.int64),
"image/object/difficult": tf.VarLenFeature(tf.int64),
"image/object/truncated": tf.VarLenFeature(tf.int64),
"image/object/view": tf.VarLenFeature(tf.int64)}
items_to_handlers = {
'image': slim_example_decoder.Image(
image_key='image/encoded', …Run Code Online (Sandbox Code Playgroud) 我有一个数据框,其中的排序值由ID标记,我想将ID的第一个元素的值与所有先前ID的最后一个元素的值之差。下面的代码做了我想要的:
import pandas as pd
a = 'a'; b = 'b'; c = 'c'
df = pd.DataFrame(data=[*zip([a, a, a, b, b, c, a], [1, 2, 3, 5, 6, 7, 8])],
columns=['id', 'value'])
print(df)
# # take the last value for a particular id
# last_value_for_id = df.loc[df.id.shift(-1) != df.id, :]
# print(last_value_for_id)
current_id = ''; prev_values = {};diffs = {}
for t in df.itertuples(index=False):
prev_values[t.id] = t.value
if current_id != t.id:
current_id = t.id
else: continue
for k, v in …Run Code Online (Sandbox Code Playgroud) python ×5
tensorflow ×3
eclipse ×2
python-2.7 ×2
counter ×1
eclipse-luna ×1
gil ×1
glassfish-4 ×1
jboss ×1
jsf ×1
jsf-2.2 ×1
openshift ×1
pandas ×1
python-3.x ×1
traceback ×1