我的PC(Windows XP)中有JRE 6但是当我在命令提示符下编译程序时它会显示javac is not recognised as internal or external command.编译Java程序需要哪个软件?
我想根据要显示的文本长度动态地为标签指定宽度.标签是在uiview上自行添加的.我正在使用以下代码,但我仍然得到更短宽度的标签.
- (id)initWithFrame:(CGRect)frame OrangeText:(NSString*)orange WhiteText:(NSString*)white {
if ((self = [super initWithFrame:frame])) {
CGSize textSize = [orange sizeWithFont:[UIFont systemFontOfSize:14]];
OrangeLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 0, textSize.width, textSize.height+2)];
OrangeLabel.text = orange;
OrangeLabel.backgroundColor = [UIColor clearColor];
OrangeLabel.textColor = [UIColor orangeColor];
[self addSubview:OrangeLabel];
WhiteLabel = [[UILabel alloc] init];
CGSize whiteTextSize = [white sizeWithFont:[UIFont systemFontOfSize:14]];
WhiteLabel.frame = CGRectMake(OrangeLabel.frame.size.width+35, 5, whiteTextSize.width, whiteTextSize.height);
WhiteLabel.text = white;
WhiteLabel.backgroundColor = [UIColor clearColor];
WhiteLabel.textColor = [UIColor whiteColor];
[self addSubview:WhiteLabel]; // Initialization code
}
return self;
Run Code Online (Sandbox Code Playgroud)
}
我最近加入了一家使用类型化数据集作为'Dto'的公司.我认为它们真的很垃圾,并希望将它改成更现代和用户友好的东西.所以,我正在尝试更新代码,以便数据层更通用,即使用接口等,另一个人不知道Dto是什么,我们对如何完成它有轻微的分歧.
如果不试图让人们思考我的思维方式,我想向你们提供关于Dto可以存在的层次的公正答案.DAL,BL和Presentation或仅在这些图层中设置一个小子集.
此外,是否应该或不应该在DAL中存在IList对象.
谢谢.
我有一个在xaml中创建的用户控件,让我们将其命名为"View".在View.xaml.cs中,我将类View的访问修饰符更改为internal:
internal partial class View : ViewBase { ... }
Run Code Online (Sandbox Code Playgroud)
更改访问修饰符后,编译器会声明错误:
"ABView"的部分声明具有冲突的可访问性修饰符
我的第一个猜测是视图必须通过xaml代码在内部进行.所以我添加了两行xaml:
x:Name="View"
x:FieldModifier="internal"
Run Code Online (Sandbox Code Playgroud)
但这并没有解决错误.我在哪里更改访问修饰符以使内部视图?
我想知道我们是否可以超时sql查询.
从某种意义上说,假设我有一个SQL查询,其输出仅在10分钟内输出时才有用,之后即使输出结果也没用.
我想要做的是,如果查询需要超过10分钟来完成处理,那么它应该只是自杀.
有可能这样做吗?
一个例子非常有用.
如果我的想法不可理解,请告诉我.
请看这段代码:
function addCounter(&$userInfoArray) {
$userInfoArray['counter']++;
return $userInfoArray['counter'];
}
$userInfoArray = array('id' => 'foo', 'name' => 'fooName', 'counter' => 10);
$nowCounter = addCounter($userInfoArray);
echo($userInfoArray['counter']);
Run Code Online (Sandbox Code Playgroud)
这将显示11.
但!如果在函数参数中删除"&"运算符,则结果为10.
这是怎么回事?
假设我在我的Web服务中声明了以下方法:
@WebMethod()
public Long addNewApplication(String applicationName) throws ServiceManagerException {
// implementation
}
@WebMethod()
public Long addNewApplication(String applicationName, ApplicationState status) throws ServiceManagerException {
// implementation
}
Run Code Online (Sandbox Code Playgroud)
问题是上面不起作用,我得到以下异常:
org.springframework.remoting.jaxws.JaxWsSoapFaultException: Cannot find dispatch method for Request=[SOAPAction="",Payload={http://example.org/applicationManager}addNewApplication]; nested exception is javax.xml.ws.soap.SOAPFaultException: Cannot find dispatch method for Request=[SOAPAction="",Payload={http://example.org/applicationManager}addNewApplication]
at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.doInvoke(JaxWsPortClientInterceptor.java:503)
at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.invoke(JaxWsPortClientInterceptor.java:487)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy123.addNewApplication(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
如果我重命名方法以便它们具有不同的名称,那么一切都有效.是否可以在Web Service中使用重载方法?如果是,那怎么样?
我想知道为什么你仍然会使用ASP而不是Silverlight,因为有了silverlight,你可以做很多事情.你不必使用css,jquery,js,html等.
同样使用silverlight,您可以通过ria服务调用数据库.
我只能想到一个原因,即不是每个人都安装了这个插件.但那仅仅是时间问题.
只是好奇你们怎么想这个主题.
我即将参加一些模式识别课程.由于我对C或C++没有任何先验知识,我的教授告诉我在课程开始之前要学习其中一个,并在学习课程时学到更多知识.
我应该选哪一个?
编程的先验知识主要限于C#,但也有一些PHP,SQL和Prolog.
在以下示例中,引用reason存储在父级和子级中.我想避免这种情况并仅将引用存储在父级中(通常使用Java异常).
import java.lang.{Exception, Throwable}
class FileError(message: String, reason:Throwable) extends Exception(message, reason) {
...
}
Run Code Online (Sandbox Code Playgroud)
如何在不在子类对象中存储值的情况下初始化父类字段?
c# ×2
java ×2
ado.net ×1
architecture ×1
asp.net ×1
c ×1
c++ ×1
class-design ×1
iphone ×1
javac ×1
jax-ws ×1
mysql ×1
php ×1
scala ×1
silverlight ×1
spring ×1
sql ×1
web-services ×1
wpf ×1
xaml ×1