我的网站是非常标准的ecom网站,它不是JS支持的独立应用程序或任何东西,它只是一个使用JS标准内容的网站,以及一些jquery插件来做一些事情.
我正在尝试在我的网站上进行一些JS内存评估.我通过查看Chrome任务管理器和堆快照完成了此操作.
首先,我的第一次加载站点在任务管理器上位于35MB(即35,000K)和40MB之间.如果我同时打开其他网站的多个标签,则这是所有标签中最大的标签.如果我刷新页面它会跳到55-60,另一次刷新看到它跳到65-70MB.
在工作流程中的普通页面上,它在45-65之间波动(有时75,取决于您正在做什么).单击并在页面之间执行工作流程会看到内存跳转到85-100,并在您继续浏览站点时增加.
我试过做一些事情,比如检查:
我需要更深入地寻找循环引用或闭合问题.
堆快照没有透露太多,大多数顶级列表是(数组),(字符串),(系统).快照介于4.8MB,5.1MB,5.8MB,6.8MB之间并增加.
结果我有几个问题:
How do I understand the different metrics between snapshot memory and task manager memoryAre there any good tutorials (apart from the ones on the Google Developers site)?How much memory is considered acceptable? Given in the task manager my site is always the highest?Do I have a memory leak? Apart from the steps I've described above (which I haven't found anything concrete from) is there any other …javascript performance profiling memory-leaks google-chrome-devtools
我的目标是在找不到对象时在404上返回带有描述性消息的错误bean,并返回所请求的相同MIME类型.
我有一个查找资源,它将基于URI返回XML或JSON中的指定对象(我已经设置了com.sun.jersey.config.property.resourceConfigClass servlet参数,所以我不需要Accept标头.我的JAXBContextResolver有ErrorBean.class在其类型列表中,并为此类返回正确的JAXBContext,因为我可以在日志中看到).
例如:http://foobar.com/rest/locations/1.json
@GET
@Path("{id}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Location getCustomer(@PathParam("id") int cId) {
//look up location from datastore
....
if (location == null) {
throw new NotFoundException("Location" + cId + " is not found");
}
}
Run Code Online (Sandbox Code Playgroud)
我的NotFoundException看起来像这样:
public class NotFoundException extends WebApplicationException {
public NotFoundException(String message) {
super(Response.status(Response.Status.NOT_FOUND).
entity(new
ErrorBean(
message,
Response.Status.NOT_FOUND.getStatusCode()
)
.build());
}
}
Run Code Online (Sandbox Code Playgroud)
ErrorBean如下:
@XmlRootElement(name = "error")
public class ErrorBean {
private String errorMsg;
private int errorCode;
//no-arg constructor, property constructor, getter and …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种匹配已知数据集的方法,比方说一个MP3或wav文件列表,每个文件都是有人说话的样本.此时我知道文件ABC是人X讲的.
然后,我想采取另一个样本,并进行一些语音匹配,以显示这个语音最有可能的人,然后给出已知的数据集.
此外,我不一定关心这个人说了什么,只要我能找到一个匹配,即我不需要任何抄录或其他.
我知道CMU Sphinx不进行语音识别,它主要用于语音到文本,但我见过其他系统,例如:LIUM Speaker Diarization(http://cmusphinx.sourceforge.net/wiki/ speakerdiarization)或VoiceID项目(https://code.google.com/p/voiceid/),它使用CMU作为此类工作的基础.
如果我要使用CMU,我该如何进行语音匹配?
另外,如果CMU Sphinx不是最好的框架,那么还有一个替代的开源吗?
audio speech-recognition pattern-matching voice-recognition cmusphinx
替代文字http://i45.tinypic.com/j6tmdl.png
我正在使用dompdf生成一些PDF,其中包含表格中的一些文本和图像.但是如果文本中有一个大的URL,则URL会一直包装到行尾.所有文本和URL都包含在具有固定宽度和高度的div中,但URL仍然溢出.
在浏览器中呈现的相同HTML似乎没问题.
有什么想法吗?
<VirtualHost *:80>
ServerAdmin webmaster@dev.dom.com
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName dev.dom.com
ServerAlias dev.dom.com
ErrorLog "logs/dev.dom.com-error.log"
CustomLog "logs/dev.dom.com-access.log" common
PassEnv CLUSTER
Header always set X-Cluster "%{CLUSTER}e"
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
这是我的配置.我有一个环境变量,它告诉我我在哪个集群,它在'X-Cluster'中作为标题传递.这在200或404响应上返回正常,但304 Not Modified响应永远不会返回标头,即使它返回其他适当的Apache标头.
如何在304响应期间设置标头?
如果我有一个基于REST的服务,用Symfony [symfony-project.org]框架(即PHP)编写,那么是否有任何不错的工具/框架可以解析我的代码并生成API文档?
基于Java的框架包含类似于我需要的文档功能,您可以在此处查看此示例:http://enunciate.codehaus.org/wannabecool/step1/index.html.
我理解基于REST的服务的前提应该是不言而喻的,但是我想要为我生成这个文档的东西,而不需要手动写出我的所有端点,支持的格式,样本输出等.
谢谢
rest ×2
apache ×1
audio ×1
cmusphinx ×1
dompdf ×1
enunciate ×1
exception ×1
html ×1
http-headers ×1
javascript ×1
jersey ×1
json ×1
memory-leaks ×1
pdf ×1
performance ×1
php ×1
profiling ×1
symfony1 ×1
word-wrap ×1