我有一个用Struts/Tiles/JSP编写的应用程序,我正在添加一个GWT应用程序.我的应用程序的非GWT部分通过实际写出带有从我的svn存储库附加的版本号的css文件来处理css缓存,就像这个"styles.css?svnbuild = 12345".这样我就可以告诉浏览器永远缓存这些css文件,当我部署新版本时,所有用户都会立即下载它.
现在我正在转向GWT应用程序,我喜欢它如何使用"longmd5sum.cache.css"作为文件名,所以我仍然可以告诉浏览器永远缓存它.问题是与我的主题相关的css文件,如"gwt-standard.css",没有强名称,并且没有附加我的svnbuild参数.每当我部署新版本的应用程序时,用户仍然会看到旧版本的css,这会让它看起来不对劲.
有没有人想出一个处理gwt主题css文件缓存的最佳实践?有什么方法可以在将css附加到文档时附加svnbuild参数或类似内容?
我通过jquery.append将HTML附加到DOM中 - 我的脚本如下(请原谅蹩脚的代码)
myDiv = $("<div class='bottomright' title="+msgID+">"+msgTitle+msgContent+
"</div>").appendTo(document.body).fadeOut(0).slideDown('fast');
shown.push(msgID);
Run Code Online (Sandbox Code Playgroud)
是否有一种不同的方式来解决悬停或追加(因为看着萤火虫,似乎div在那里好了,它们完美地出现)以便我可以使用悬停功能?
当我说我无法使用它时,我的意思是它实际上什么也没做,我写了以下内容并且没有任何反应:
$(".bottomright").hover(function(){
alert("text")
})
Run Code Online (Sandbox Code Playgroud) 如果你想在java for windows,mac和linux中编写桌面应用程序代码,那么所有代码的代码是否相同?
你只需更改GUI,以便Windows应用程序更像Windows,等等?
如何在不深入细节的情况下运作?
我正在构建一个ASP.NET MVC应用程序,它使用DDD(域驱动设计)方法,由NHibernate处理数据库访问.我有域模型类(管理员),我想通过一个IOC容器,如Castle Windsor注入依赖,如下所示:
public class Administrator
{
public virtual int Id { get; set; }
//.. snip ..//
public virtual string HashedPassword { get; protected set; }
public void SetPassword(string plainTextPassword)
{
IHashingService hasher = IocContainer.Resolve<IHashingService>();
this.HashedPassword = hasher.Hash(plainTextPassword);
}
}
Run Code Online (Sandbox Code Playgroud)
我基本上想要为SetPassword方法注入IHashingService而不直接调用IOC容器(因为这被认为是IOC反模式).但我不知道如何去做.我的Administrator对象要么通过实例化,new Administrator();要么通过NHibernate加载,那么我如何将IHashingService注入Administrator类?
再想一想,我是否正确地走这条路?我希望避免让我的代码库乱丢......
currentAdmin.Password = HashUtils.Hash(password, Algorithm.Sha512);
Run Code Online (Sandbox Code Playgroud)
...而是让域模型本身处理哈希并巧妙地将其封装起来.我可以设想另一个开发人员意外地选择了错误的算法,并且有一些密码为Sha512,有些是MD5,有些有一个盐,有些有不同的盐等等.相反,如果开发人员正在写...
currentAdmin.SetPassword(password);
Run Code Online (Sandbox Code Playgroud)
...然后那会隐藏这些细节并处理上面列出的那些问题不是吗?
nhibernate asp.net-mvc castle-windsor ioc-container inversion-of-control
Blend支持显示样式资源的图形表示,并允许您选择要查看或修改的活动属性/事件触发器.但是,由DataTriggers控制视觉元素是很常见的.是否有可能告诉设计师它应该将DataTrigger视为"活动",以便可以在设计器中查看其视觉变化?
例:
<Style x:Key="MyBorder" TargetType="Border">
<Setter Property="CornerRadius" Value="5" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsRandomPropertyActive}" Value="True">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#FFFF8935" Offset="0" />
<GradientStop Color="#FFFF610C" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
Run Code Online (Sandbox Code Playgroud)
在设计器中,这只显示一个空框,因为默认样式不定义特定的视觉方面.反正有没有告诉设计师我希望它假设IsRandomPropertyActive是真的,并显示适当的样式?
我想移植一个使用机械化的iPhone应用程序.此应用需要登录网页并使用网站cookie转到该网站上的其他网页以获取一些数据.
使用我的python应用程序,我使用mechanize进行自动cookie管理.对于可移植到iPhone的Objective C有类似的东西吗?
谢谢你的帮助.
我可以使用SQL查询来查找两个字段相同的记录吗?也就是说,我可以使用下表并通过比较名称列(并忽略手机)返回1,3(ids)吗?
ID | Name | Phone
1 | Bob | 5555555555
2 | John | 1234567890
3 | Bob | 1515151515
4 | Tim | 5555555555 i'm using the tessnet2 wrapper to the Tesseract 2.04 Source on windows XP, configured it to work with x86.
TessarctTest project main function contains:
Bitmap bmp = new Bitmap(@"C:\temp\New Folder\dotnet\eurotext.tif");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
// ocr.SetVariable("tessedit_char_whitelist", "0123456789");
ocr.Init(@"C:\temp\tessdata", "eng", false);
// List<tessnet2.Word> r1 = ocr.DoOCR(bmp, new Rectangle(792, 247, 130, 54));
List<tessnet2.Word> r1 = ocr.DoOCR(bmp, Rectangle.Empty);
int lc = tessnet2.Tesseract.LineCount(r1);
Run Code Online (Sandbox Code Playgroud)
when i try to run the program it crashes on the following line inside the ocr.Init
int result = m_myTessBaseAPIInstance->InitWithLanguage((char …Run Code Online (Sandbox Code Playgroud) I have installed Oracle 10G XE. I want to connect to it using JDBC . Which driver should i use for it and from where can i download it ?
Thank You.
Since the Image control doesn't have a Click event, I simulate it using MouseDown event and it works exactly like a Click.
Here's my style:
<Window.Resources>
<Style x:Key="imageStyle" TargetType="{x:Type Image}">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform />
</Setter.Value>
</Setter>
<Setter Property="RenderTransformOrigin" Value="0.5, 0.5" />
<Style.Triggers>
<EventTrigger RoutedEvent="Image.MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:0.5" From="1" To="1.2" AutoReverse="True"
Storyboard.TargetProperty="RenderTransform.ScaleX"/>
<DoubleAnimation Duration="0:0:0.2" From="1" To="1.2" AutoReverse="True"
Storyboard.TargetProperty="RenderTransform.ScaleY"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
Run Code Online (Sandbox Code Playgroud)
Where/how can I create a click event so I don't have to do this to …