我正在使用Seam框架和RichFaces AJAX库开发一个网站(这些对于手头的问题并不是那么重要 - 只是一些背景).
我似乎在RichFaces中发现了一个错误,在某些情况下,它会导致基于AJAX的更新在IE8中失败(有关详细信息,请参阅此处:http://community.jboss.org/message/585737).
以下是发生异常的代码:
var anchor = oldnode.parentNode;
if(!window.opera
&& !A4J.AJAX.isWebkitBreakingAmps()
&& oldnode.outerHTML
&& !oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ) {
LOG.debug("Replace content of node by outerHTML()");
if (!Sarissa._SARISSA_IS_IE || oldnode.tagName.toLowerCase()!="table") {
try {
oldnode.innerHTML = "";
} catch(e){
LOG.error("Error to clear node content by innerHTML "+e.message);
Sarissa.clearChildNodes(oldnode);
}
}
oldnode.outerHTML = new XMLSerializer().serializeToString(newnode);
}
Run Code Online (Sandbox Code Playgroud)
最后一行(使用XMLSerializer的那一行)是IE中发生异常的地方.我想知道是否有人知道我可以在那里使用的任何替换方法/库/等(仅在IE上很好).谢谢.
编辑:经过一些进一步的研究后,似乎异常不是由XMLSerializer未定义引起的,而是当我尝试将XMLSerializer的输出分配给oldnode的outerHTML属性时.
这很奇怪,因为它大部分时间都有效,但仅在几个场景中失败(这个框架似乎相当重要).
任何人都可以想到什么时候XMLSerializer的输出(从调试器显示的内容看起来是非常有效的HTML)对于元素的outerHTML属性是不可分配的?
最奇怪的是,如果我要克隆元素(使用cloneNode(true))然后设置outerHTML,它似乎工作.
尝试将一些 XML 加载到文档中:
<Custom AttributeA='' AttributeB='Bob' AttributeC='HUNTERS' COMPANY EMPLOYEES' 403B PLAN' />
Run Code Online (Sandbox Code Playgroud)
然后当我尝试将它添加到文档时:
XmlDocument xmlCustom = new XmlDocument();
xmlCustom.LoadXml(customNode);
Run Code Online (Sandbox Code Playgroud)
我最终收到一条错误消息 System.Xml.XmlException: 'COMPANY' is an unexpected token。预期的标记是“=”。AttributeC 的值应该是:HUNTERS' COMPANY EMPLOYEES' 403B PLAN
我尝试在加载 XML 之前替换 ' ,但它替换了所有撇号,并且 AttributeA='' 同样无效。
编辑:是的,我同意格式不佳,但这是我必须使用的。
几天前我的一位朋友找到了我 - 他的编程经验很少,他有一个项目,他要求帮助.
基本上 - 这是他试图完成的事情:
1.) Create a website that can accept text files as input.
2.) Read said file and pass the parameters contained in the
file to a python script.
3.) Output these results of the script on the same webpage upon completion.
Run Code Online (Sandbox Code Playgroud)
他知道少量Python(足以编写处理脚本),但他不知道从哪里开始.我使用读取文件的ASP页面为他做了一个快速示例,并使用IronPython将参数传递到脚本文件并输出结果,这正如我预期的那样工作.
然而 - 对他来说,我希望能指导他朝着正确的方向发展一个更简单的应用程序来执行此操作,并希望找到一些建议或听取有关不同方法的一些想法.我认为由于他缺乏经验,越简单越好.
多谢你们.
嘿所有,所以基本上我有一个非常简单的布局与标题图像,主要居中的文本区域.以及位于主中心文本区域左侧的侧边栏.这基本上就是我的布局看起来如何:
<center>Header</center>
<div style="float:left;">Sidebar</div>
<center>Main Area</center>
Run Code Online (Sandbox Code Playgroud)
好吧,侧边栏显然会一直对齐到页面的左侧,我希望它做的仍然是在页面的左侧,但我希望它"拥抱"主要居中区域.
这里是什么样子,现在一个基本的图片,我想发生什么箭头: http://img18.imageshack.us/img18/2307/exampleps.jpg
我有一张图片,显示地图上哪条路是北方.如果找到新标题,则此图像由CoreLocation更新.它也放在正确的位置,我使用以下代码:
locateMeView.transform = CGAffineTransformMakeRotation(([CoreLocationController sharedInstance].heading - 45) * M_PI / 180);
CGRect frame = locateMeView.frame;
CGPoint pos = [MapClass vectorForLocation:[CoreLocationController sharedInstance].location mapCenter:curLocation zoom:curZoom];
frame.origin.x = (int)(self.view.bounds.size.width/2 + pos.x - frame.size.width / 2);
frame.origin.y = (int)(self.view.bounds.size.height/2 + pos.y - frame.size.height / 2);
frame.size.width = 24;
frame.size.height = 24;
locateMeView.frame = frame;
Run Code Online (Sandbox Code Playgroud)
CoreLocationController是一个存储正常CoreLocation更新的类.MapClass将lat/lng坐标转换为地图上的x/y坐标.图像的位置是正确的,但旋转会产生奇怪的效果.对于0 en M_PI,图像是正确的,但在这些图像之间,图像被拉伸,好像它也围绕z轴旋转,并且在M_PI/2和3*M_PI/2处,它完全消失.有人可以解释发生了什么,我做错了什么?
我正在寻找一种在某些条件下提前终止应用函数的方法.使用for循环,类似于:
FDP_HCFA = function(FaultMatrix, TestCosts, GenerateNeighbors, RandomSeed) {
set.seed(RandomSeed)
## number of tests, mind the summary column
nT = ncol(FaultMatrix) - 1
StartingSequence = sample(1:nT)
BestAPFD = APFD_C(StartingSequence, FaultMatrix, TestCosts)
BestPrioritization = StartingSequence
MakingProgress = TRUE
NumberOfIterations = 0
while(MakingProgress) {
BestPrioritizationBefore = BestPrioritization
AllCurrentNeighbors = GenerateNeighbors(BestPrioritization)
for(CurrentNeighbor in AllCurrentNeighbors) {
CurrentAPFD = APFD_C(CurrentNeighbor, FaultMatrix, TestCosts)
if(CurrentAPFD > BestAPFD) {
BestAPFD = CurrentAPFD
BestPrioritization = CurrentNeighbor
break
}
}
if(length(union(list(BestPrioritizationBefore),
list(BestPrioritization))) == 1)
MakingProgress = FALSE
NumberOfIterations = NumberOfIterations + …Run Code Online (Sandbox Code Playgroud) 我需要一个库来处理http(c ++,c).它必须发送和接收http请求.它将在服务器中用于回答http请求.我的客户端 - 服务器交互应该使用REST模型.
我有一个方法......
[HttpPost]
public ActionResult Start(SomeViewModel someViewModel) { ... }
Run Code Online (Sandbox Code Playgroud)
是基于一些条件返回之类的东西回报View("Invalid"),View("NotFound"),View("Run", anotherViewModel),等的问题是,无论我提出什么观点,URL不会更改以反映新的控制器/行动.当我的View想要发布到不同的操作时,这会产生问题.我怎样才能解决这个问题?
我使用的是在Ubuntu 10.10 AMD64 git的1.7.1,而我试图提取我的仓库头的散列,我编到我的项目一个自动版本信息来使用它.
在过去,这总是通过使用
git describe --tags
Run Code Online (Sandbox Code Playgroud)
然而,git现在正在投掷
fatal: No names found, cannot describe anything.
Run Code Online (Sandbox Code Playgroud)
对我.有没有人知道这意味着什么?
谷歌显示只有少数点击,没有解决方案.
我是新手来构建数据库,而我正在尝试基于拥有三个数据库表来进行JOIN.
Table A = ID, Name, etc
Table B = ID, Name, etc
Table C = ID, TableAId, TableBId
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚的是使用活动记录如何进行此选择.我试图尽可能少地提出请求,但是如果不进行三次单独的调用就应该写下这些请求.
c# ×2
actionresult ×1
asp.net ×1
asp.net-mvc ×1
c ×1
c++ ×1
codeigniter ×1
css ×1
database ×1
file-upload ×1
git ×1
html ×1
http ×1
iphone ×1
javascript ×1
join ×1
objective-c ×1
php ×1
python ×1
r ×1
transform ×1
web ×1
xml ×1