我们h:inputText在一个绑定到Integer属性的JSF页面中使用a (因此可以接受null).当没有写入的值时h:inputText,表单提交的是0代替null.我们正在使用Trinidad 1.2.2和Tomcat 6.0.20(我们也尝试过Tomcat 6.0.14,因为我们读到这可能发生在某些Tomcat版本上).
这是怎么造成的,我该如何解决?
我正在构建一个内容管理网站,其中还包括其他功能.当管理员通过管理面板删除项目时,我希望将此项目移动到"回收站"30天(然后自动删除).
实现此功能的最佳方法是什么?
我的一个想法是在我的表中有一个'Deleted'位列,然后只显示记录WHERE Hide=0.然而,这意味着必须记住每次我从桌子上放置这个条件SELECT.
我的另一个想法是有一个第二个表,记录将在删除时移动到.但是我在我的网站中使用了很多表,因此这意味着表的数量加倍,并且具有重复的表结构(这可能会导致将来出现一致性问题).
理想情况下,我希望有一个"RecycleBin"表,将所有记录移动到该表,但这可能包含100个列,以便能够存储来自所有不同表的数据.
如果有人有任何其他想法,将非常感激.
谢谢.
我习惯为自定义控件创建依赖项属性.但我真的厌倦了定义静态字段,在构造函数中填充它们,编写标准属性以及稍后的事件,以及转换和验证对象,尽管有复制和粘贴以及代码片段的帮助.
所以,问题是......是否有任何努力,主动性,众筹,框架,工具,项目或想法使依赖属性的创建更容易?
也许C#5.0预编译"Compiler as Service"和"Meta-Programming"来定义这样复杂的WPF/Silverlight功能.那将是非常有帮助的!
class Register < User
end
class Admin < User
end
class Project < ActiveRecord::Base
has_many :admin, :class => 'User', :conditions => "type = 'admin'"
has_many :registers, :class => 'User', :conditions => "type = 'registers'"
end
Run Code Online (Sandbox Code Playgroud)
这里的问题是,当我使用项目来has_many创建一个寄存器或管理员时,它不会将填充对象类自动化为类型字段.
像这样:project.admins.new.
如何解决这个问题?
package {
import flash.display.Sprite;
import flash.utils.*;
public class SetTimeoutExample extends Sprite {
private var delay:Number = 1000; // delay before calling myDelayedFunction
public function SetTimeoutExample() {
var intervalId:uint = setTimeout(myDelayedFunction, delay,stopTime);
}
public function myDelayedFunction():void {
if(arguments[0] ==fk.playheadTime)
{fk.pause();}
}
}
}//this is my document class named SetTimeoutExample.as
Run Code Online (Sandbox Code Playgroud)
import flash.net.URLLoader;
import fl.video.*;
import flash.utils.getTimer;
import flash.events.Event;
fk.autoPlay = false;
var myLoaderInfo=new Object();
myLoaderInfo.myParamsLoaded = false;
myLoaderInfo.loaderComplete = loaderComplete;
this.loaderInfo.addEventListener(Event.COMPLETE, myLoaderInfo.loaderComplete);
myLoaderInfo.useParams = useParams;
var myParams:Object = new Object();
var myParamsLoaded:Object …Run Code Online (Sandbox Code Playgroud) 我只是想知道在PHP中提取动态字符串的某个部分最简单,最有效的方法是什么?
例如,在此字符串中:
http://www.dailymotion.com/video/xclep1_school-gyrls-something-like-a-party_music#hp-v-v13
我只想提取(并在变量中插入):"xclep1_school-gyrls-something-like-a-party_music".
主要目标是使用此部分,将其插入此URL:http://www.dailymotion.com/thumbnail/160x120/video/xclep1_school-gyrls-something-like-a-party_music,以便我可以从外部捕获缩略图.
对不起,如果这是一个"新手"的问题,非常感谢你的时间.任何提示/代码/ PHP参考表示赞赏.
\mainpage在两种情况下,我无法确定doxygen对该部分的行为:
\mainpage部分,它是否会使用任何其他页面,如果是,那么如何选择?\mainpage部分怎么办?我有一个项目,我现在开始作为Maven项目,但由于某种原因它不起作用.这是我的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>ProgramName</groupId>
<artifactId>ProgramName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.core</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<!-- all other dependecies here -->
</dependencies>
<build>
<finalName>ProgramName</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<webResources>
<resource>
<targetPath>WEB-INF</targetPath>
<directory>src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<includes>
<include>*.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud) 我在另一个线程中进行了讨论,发现类方法优先于具有相同名称和参数的扩展方法.这很好,因为扩展方法不会劫持方法,但假设您已向第三方库添加了一些扩展方法:
public class ThirdParty
{
}
public static class ThirdPartyExtensions
{
public static void MyMethod(this ThirdParty test)
{
Console.WriteLine("My extension method");
}
}
Run Code Online (Sandbox Code Playgroud)
按预期工作:ThirdParty.MyMethod - >"我的扩展方法"
但是然后ThirdParty更新它的库并添加一个与扩展方法完全相同的方法:
public class ThirdParty
{
public void MyMethod()
{
Console.WriteLine("Third party method");
}
}
public static class ThirdPartyExtensions
{
public static void MyMethod(this ThirdParty test)
{
Console.WriteLine("My extension method");
}
}
Run Code Online (Sandbox Code Playgroud)
ThirdPart.MyMethod - >"第三方方法"
现在突然代码在运行时会表现不同,因为第三方方法"劫持"了你的扩展方法!编译器不会发出任何警告.
有没有办法启用此类警告或以其他方式避免这种情况?
在我的SQL表中:
Period| Brand A small Bags| Brand A big bags| Brand D Shoes| ...| Brand X Shoes
2010 | 10 | 20 | 30 | ...| 200
Run Code Online (Sandbox Code Playgroud)
如何对列名称中包含某些单词(例如鞋子)的列进行求和?
预期成绩:
Period | Sum of Bags | Sum of Shoes | ..
2010 | 30 | 230 | ..
Run Code Online (Sandbox Code Playgroud)