我正在尝试使用maven2托管依赖设置一个webapp.这是我的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mtx-production</groupId>
<artifactId>mtx-production</artifactId>
<version>0.0.1</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.0.2.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.2.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.12</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.5.1-Final</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.1-Final</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jboss-releases</id>
<url>http://repository.jboss.org/maven2</url>
</repository>
</repositories>
</project>
Run Code Online (Sandbox Code Playgroud)
如果我出错了,请纠正我,但这应该有用吗?!我只是进入了我的日食这个例外
13.06.2010 16:48:15 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'dataSource' is not eligible …Run Code Online (Sandbox Code Playgroud) 我正在寻找Linux嵌入式Web浏览器,或者最好只是一个渲染对象(它不会用于实际浏览,只是用于显示基于web的gui).要求是:
到目前为止我只找到了嵌入式Konqueror.欢迎任何建议,商业解决方案都可以,但开源更可取.
找到另一个选项QT WebKit,它被选中并满足我的所有要求.
另一个更新:在我的主板上使用WebKit成功安装并测试了嵌入式QT分发.帧缓冲区的配置是无缝的,触摸屏校准需要一些时间,但在底线上一切都按预期工作.
我正在进入java脚本的精彩世界:)我处理更好的内核驱动程序.
另一个更新:我发现了另一个我将来可能考虑的商业解决方案.从进入公司的嵌入式浏览器在这里.我没有和他们一起工作,但是为了公共记录我也建议我把它放在这里.
获取内容时遇到问题.我不知道post变量的名称所以我不能这样做
$variable = $_POST['name'];
Run Code Online (Sandbox Code Playgroud)
因为我不知道"名字".我想捕获POST方法发送的所有变量.如何获取$_POST[]数组的键和相应的值?
每次我试图从servlet(从其他项目)访问一个普通的java类它给我classNotFound异常,任何想法如何解决这个问题,提前谢谢
我有一个无序的列表,如:
<ul id="cities">
<li><a href="/london/">London<a></li>
<li><a href="/new-york/">New York<a></li>
<li><a href="/paris/">Paris<a></li>
<ul>
Run Code Online (Sandbox Code Playgroud)
使用jquery如何获得"纽约"的href值?通过客户端只知道锚文本值,所以我想找到匹配的锚文本并提取href.
谢谢
我正在尝试编写一个超简单的解决方案来异步加载一堆JS文件.到目前为止,我有以下脚本.但是,当脚本未实际加载时,有时会调用回调,这会导致找不到变量错误.如果我刷新页面有时它只是工作,因为我猜文件是直接来自缓存,因此比调用回调更快,这是非常奇怪的?
var Loader = function () {
}
Loader.prototype = {
require: function (scripts, callback) {
this.loadCount = 0;
this.totalRequired = scripts.length;
this.callback = callback;
for (var i = 0; i < scripts.length; i++) {
this.writeScript(scripts[i]);
}
},
loaded: function (evt) {
this.loadCount++;
if (this.loadCount == this.totalRequired && typeof this.callback == 'function') this.callback.call();
},
writeScript: function (src) {
var self = this;
var s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = src;
s.addEventListener('load', function (e) { self.loaded(e); …Run Code Online (Sandbox Code Playgroud) 所以,我正在尝试创建一个随机向量(想想几何,而不是一个可扩展的数组),每当我调用我的随机向量函数时,我得到相同的x值,尽管y和z是不同的.
int main () {
srand ( (unsigned)time(NULL));
Vector<double> a;
a.randvec();
cout << a << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
使用该功能
//random Vector
template <class T>
void Vector<T>::randvec()
{
const int min=-10, max=10;
int randx, randy, randz;
const int bucket_size = RAND_MAX/(max-min);
do randx = (rand()/bucket_size)+min;
while (randx <= min && randx >= max);
x = randx;
do randy = (rand()/bucket_size)+min;
while (randy <= min && randy >= max);
y = randy;
do randz = (rand()/bucket_size)+min;
while (randz <= min && …Run Code Online (Sandbox Code Playgroud) 我用Java编写的速度测试得到了这个结果:
Java
real 0m20.626s
user 0m20.257s
sys 0m0.244s
GCJ
real 3m10.567s
user 3m5.168s
sys 0m0.676s
Run Code Online (Sandbox Code Playgroud)
那么,GCJ的目的是什么呢?有了这个结果,我确定我不打算用GCJ编译它!
我在Linux上测试过这个,Windows中的结果可能比那更好吗?
这是应用程序的代码:
public static void main(String[] args) {
String str = "";
System.out.println("Start!!!");
for (long i = 0; i < 5000000L; i++) {
Math.sqrt((double) i);
Math.pow((double) i, 2.56);
long j = i * 745L;
String string = new String(String.valueOf(i));
string = string.concat(" kaka pipi"); // "Kaka pipi" is a kind of childly call in Dutch.
string = new String(string.toUpperCase());
if (i % 300 == …Run Code Online (Sandbox Code Playgroud) 首先:这不是Delphi和SAPI的重复.我对"Delphi中的SAPI"主题有一个具体问题.
我在Delphi 2009中使用了优秀的Import Type-Library指南来获取组件面板中的TSpVoice组件.这非常有效.同
var
SpVoice: TSpVoice;
Run Code Online (Sandbox Code Playgroud)
我可以写
SpVoice.Speak('This is an example.', 1);
Run Code Online (Sandbox Code Playgroud)
获得异步音频输出.
第一个问题
根据文档,我可以写
SpVoice.Speak('This is an example.', 0);
Run Code Online (Sandbox Code Playgroud)
获得同步音频输出,但我获得了EZeroDivide异常.为什么?
第二个问题
但更重要的是,我希望能够动态创建SpVoice对象(我认为这被称为"后期绑定"SpVoice对象),部分原因是我的应用程序的所有会话中只有一小部分会使用它,部分是因为我不想假设最终用户系统上存在SAPI服务器.
为此,我试过了
procedure TForm1.FormClick(Sender: TObject);
var
SpVoice: Variant;
begin
SpVoice := CreateOleObject('SAPI.SpVoice');
SpVoice.Speak('this is a test', 0);
end;
Run Code Online (Sandbox Code Playgroud)
显然什么也没做!(将0替换为0可以获得EZeroDivide异常.)
放弃
我是COM/OLE自动化的新手.对于我在这篇文章中所表现出的任何无知或愚蠢,我感到很抱歉......
为了让每个人遇到与我一样的问题,François的视频解释说SAPI/Windows中存在一个错误(某些地方不兼容),这使得以下代码引发了EZeroDivide异常:
procedure TForm1.FormClick(Sender: TObject);
var
SpVoice: variant;
begin
SpVoice := CreateOleObject('SAPI.SpVoice');
SpVoice.Speak('This is a text.');
end;
Run Code Online (Sandbox Code Playgroud)
视频中提供的解决方案是更改FPU控制字:
procedure TForm1.FormClick(Sender: TObject);
var
SpVoice: variant;
SavedCW: Word;
begin
SpVoice := CreateOleObject('SAPI.SpVoice'); …Run Code Online (Sandbox Code Playgroud) 对不起,如果这是一个副本,我的搜索没有任何结果.
我使用以下方法生成枚举类型的下拉列表(从这里解除:http://addinit.com/?q = node/54):
public static string DropDownList(this HtmlHelper helper, string name, Type type, object selected)
{
if (!type.IsEnum)
throw new ArgumentException("Type is not an enum.");
if(selected != null && selected.GetType() != type)
throw new ArgumentException("Selected object is not " + type.ToString());
var enums = new List<SelectListItem>();
foreach (int value in Enum.GetValues(type))
{
var item = new SelectListItem();
item.Value = value.ToString();
item.Text = Enum.GetName(type, value);
if(selected != null)
item.Selected = (int)selected == value;
enums.Add(item);
}
return …Run Code Online (Sandbox Code Playgroud)