我正在将Google App Engine与Google Web Toolkit结合使用来编写错误跟踪器(以了解这些技术的功能).
以谷歌代码的问题跟踪器为模型,我决定一个问题可以有0个或更多标签,可以预先定义(让我们说在设置中).
标签类(CustomLabel):
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class CustomLabel implements Serializable {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
private String encodedKey;
@Persistent
@Extension(vendorName="datanucleus", key="gae.pk-id", value="true")
private Long keyId;
/**
* label caption.
*/
@Persistent
private String caption;
// Unimportant getters / setters
}
Run Code Online (Sandbox Code Playgroud)
现在是父类(问题):
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Issue implements Serializable {
private static final long serialVersionUID = 1L;
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
// Replacing the Long key by this key …Run Code Online (Sandbox Code Playgroud) 我创建了以下LINQ查询来演示此问题:
string[] dateStrings = new string[] { "2009-07-20 13:00:00", "2009-07-20 16:00:00", "2009-07-20 09:00:00" };
DateTime dateValue = DateTime.MinValue;
var results =
from dateString in dateStrings
where DateTime.TryParse(dateString, out dateValue)
orderby dateValue descending
select dateValue;
Run Code Online (Sandbox Code Playgroud)
您希望结果是相反顺序的DateTimes列表:
20-7-2009 16:00:00
20-7-2009 13:00:00
20-7-2009 9:00:00
但我得到的只有:
20-7-2009 9:00:00
20-7-2009 9:00:00
20-7-2009 9:00:00
我究竟做错了什么?如果删除orderby语句,您会注意到DateTime的正常列表.
我已经看到了四种不同的方法来告诉jQuery在文档准备好时执行一个函数.这些都是等价的吗?
$(document).ready(function () {
alert('$(document).ready()');
});
$().ready(function () {
alert('$().ready()');
});
$(function () {
alert('$()');
});
jQuery(function ($) {
alert('jQuery()');
});
Run Code Online (Sandbox Code Playgroud) 出于某种原因,Xcode告诉我,只要我使用像kCAFillModeForwards这样的东西就找不到符号.必须有一个图书馆或班级,我必须包括......但是哪一个?正常的核心动画的东西工作得很好[myView beginAnimations ...].让更复杂的动画制作工作的诀窍是什么?
我已经包含在.h文件中:
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface TestClass : UIView {
}
// ...
Run Code Online (Sandbox Code Playgroud)
我运行这段代码:
- (void)testAnimation {
CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
[fadeInAnimation setToValue:[NSNumber numberWithFloat:1.0]];
fadeInAnimation.fillMode = kCAFillModeForwards;
fadeInAnimation.removedOnCompletion = NO;
// other stuff deleted to limit error possibilities...should at least compile
}
Run Code Online (Sandbox Code Playgroud)
这种情况发生在我构建时(确实清理了很多次),2个错误:
cd "/Users/thanks/Desktop/Thanks/iPhone Development/TestApp"
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk "-L/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/Debug-iphonesimulator" "-F/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/Debug-iphonesimulator" -filelist "/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/TestApp.build/Debug-iphonesimulator/TestApp.build/Objects-normal/i386/TestApp.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o "/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/Debug-iphonesimulator/TestApp.app/TestApp"
Undefined symbols: …Run Code Online (Sandbox Code Playgroud) 我需要显示一个选择框,它将一次显示所有类别和子类别.
我想显示所有类别最左边和粗体,而所有子类别将属于相应的类别,但将缩进和Italized.
我们如何在PHP中创建这样的选择列表?
我在Magento电子商务(www.magentocommerce.com)管理面板中有类似的内容.
从DB中检索类别,有时可以达到6级深度,例如:
` 猫1
猫1A
猫1B
猫2
猫2A
Cat 2AA
猫2AB
Cat 2AC
Cat 2ACA
猫3`
所有具有子类别的类别应为粗体,所有子类别应为斜体.
我希望现在能更清楚地了解我想要实现的目标.
在我看来,课堂培训似乎为我们提供了技术构建块,但很少涵盖实际构建任何大型或复杂的东西,甚至当课堂培训涵盖"大型项目"时,您仍然只是获得正确的最终结果.
人们应该去哪里学习软件设计的更大方面?具体来说,在开始从事中型到大型项目/系统的工作时,人们可以去哪里学习实际的"最佳实践"?(理论更少,应用更多)
(我的重点是.NET和C#,但问题对任何技术都有效)
我在家里使用MacBook,运行Leopard,安装了最新的Apple JDK 1.6.在IDE中,我想浏览com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel的源代码,但IDE无法找到它.我想浏览的另一个例子是com.sun.java.swing.plaf.nimbus.ButtonPainter.
为了浏览com.sun,我需要将哪些JAR或ZIP添加到我的IDEA项目中..雨云.IDE中的类我只对Leopard感兴趣,因为在Windows上使用Sun的JDk可以正常工作.
我知道Nimbus课程是可用的,因为我的应用程序运行Nimbus外观和感觉.
我正在用PHP构建一个Twitter小东西,我正在尝试解析URL,@ replies和#hashtags并将它们变成可点击的链接.
我找到了一个用于解析URL的类,我想知道这是否也可用于解析@replies和#hashtags:
// http://josephscott.org/archives/2008/11/makeitlink-detecting-urls-in-text-and-making-them-links/
class MakeItLink {
protected function _link_www( $matches ) {
$url = $matches[2];
$url = MakeItLink::cleanURL( $url );
if( empty( $url ) ) {
return $matches[0];
}
return "{$matches[1]}<a href='{$url}'>{$url}</a>";
}
public function cleanURL( $url ) {
if( $url == '' ) {
return $url;
}
$url = preg_replace( "|[^a-z0-9-~+_.?#=!&;,/:%@$*'()x80-xff]|i", '', $url );
$url = str_replace( array( "%0d", "%0a" ), '', $url );
$url = str_replace( ";//", "://", $url );
/* If …Run Code Online (Sandbox Code Playgroud) 由于Delphi让你一直到方法的var部分来声明一个局部变量,你是否发现自己比在大学时更频繁地打破"Curly's Law"(重新使用变量)?(当然,除非你在大学编程Pascal).
如果是这样,你怎么做才能打破这种习惯,特别是在需要获取和/或设置大量属性的函数中.是否有一个门槛的地方是可以接受的申报TempInt : Integer和TempStr : String.(你有时使用'e' 而不是其他时间吗?)Temp
在远程计算机上安装用C#编写的Windows服务(以标准方式)的最佳方法是什么,我需要提供应该运行的用户名和密码?
我将从MSBuild运行它作为集成测试的一部分.
编辑:我没有msi,我不想创建一个.