在我的config/environments/development.rb中,我有以下行:
config.action_controller.consider_all_requests_local = true
Run Code Online (Sandbox Code Playgroud)
这意味着我应该在开发环境中获得所有丑陋的错误.但由于某种原因,我的应用程序突然开始给我一个你应该在制作上看到的漂亮的错误页面.
是否有可能被过度使用的地方?其他人也正在研究这个项目,所以也许其中一个人做了一些事情.
正如你可以在我的问题的历史看,我正在开发一个电子图书管理员,这将是开源的,我会释放它在10天左右,但我有一个TRadioGroup,你可以看到:
TRadioGroup用在我的格式为:http: //img85.imageshack.us/img85/1830/radiogroup.png
而且我想将一些东西存储在一个变量(需要是一个Integer)中,并与之"链接" TRadioGroup.
我需要做这样的if功能:
TRadioButton的标题 - >需要存储在变量中的数字
适合2x宽度 - 默认 - > 0
适合2xHeight - > 1
适合宽度 - > 2
适合高度 - > 3
但我只是用一个TRadioGroup和TRadioButton一个时间,比我以前用过的20倍以上C#不同.然后我想知道我需要把什么放在if函数上,因为它会做什么我已经知道怎么做了:
var
num: Integer;
begin
if(TRadioButton1 checked?)
begin
num := 0;
end;
end.
Run Code Online (Sandbox Code Playgroud)
我需要把它放在if函数的括号内?
PS:我将把这些学分放在帮助我完成这个小项目的人的计划中.
有没有办法确定特定机器上次运行进程的时间?
我可以使用以下内容来确定某个进程是否正在运行,但如果该进程已停止,则该应用程序无法获取该进程.
Process[] process = Process.GetProcessesByName(processName, serverName);
Run Code Online (Sandbox Code Playgroud) 什么是组织控制器的最佳方式.假设我有一个用户控制器和一个注册操作,我是否应该在我验证和处理数据的过程中执行process_registration操作,或者只是在注册操作本身内执行所有处理.我是否应对每个需要它的操作进行验证/处理操作(注册,进程注册等等)
我还注意到很多人都有模块和控制器,仅用于验证和处理信息,(我想将所有验证逻辑和规则保存在一个位置?)
我想我的问题是,事情需要分开多远?这个问题也适用于模型和视图.
有谁知道如何在j2me程序的源代码中隐藏密码内容?即所以人们不能将"DBT"看作是读取源代码的密码.
public void validateUser(String user, String Password) {
if (user.equals("N0203251") && Password.equals("DBT")) {
switchDisplayable(null, getContinue());
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个问题,我刚刚使用time_ago_in_words遇到(出于某种原因).发表帖子后,我得到了
translation data {"one"=>"1 minute", "other"=>"{{count}} minutes"} can not be used with :count => 9
Run Code Online (Sandbox Code Playgroud)
我也没有做任何有趣的事情,只是调用一个小帮助函数
def friendly_publish_date(post)
return '' if post.publish_date.nil?
if post.publish_date >= 1.day.ago
"#{time_ago_in_words post.publish_date} ago"
else
post.publish_date
end
end
Run Code Online (Sandbox Code Playgroud)
现在,这已经很好地工作了很长时间,然后我尝试今天早上发布一个帖子,它开始抛出先前的异常.有任何想法吗?
编辑:再次发生,所以这里是一个完整的堆栈跟踪请求.
Processing PostsController#index (for 74.213.163.234 at 2010-01-05 11:43:26) [GET]
Parameters: {"action"=>"index", "controller"=>"posts"}
Rendering template within layouts/application
Rendering posts/index
ActionView::TemplateError (translation data {"one"=>"less than a minute", "other"=>"less than {{count}} minutes"} can not be used with :count => 1) on line #5 of app/views/posts/_post.html.erb:
2: <header>
3: <div …Run Code Online (Sandbox Code Playgroud) 在Excel中我可以转到数据 - >导入外部数据 - >导入数据...然后选择要使用的数据源,然后在我提供登录信息后,它会给我一个表列表.我想知道如何使用C#以编程方式获取该列表.
System.Runtime.Serialization.SerializationException:
Type 'System.Threading.Thread' in Assembly 'mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
Run Code Online (Sandbox Code Playgroud)
有办法吗?我已经将Serializable属性添加到我的所有类中,但是我无法为这样的事物添加属性,可以吗?如果可以的话,有没有办法彻底解决这个问题?因为我不想总是要将[Serializable]添加到所有内容中.
PS,在我的项目中,我动态编译C#代码并将其包含在我的应用程序中.
编辑一:由于我的应用程序的性质,所有事件,所有事件等都由我的单独线程管理..我无法摆脱这一事实,因为我需要同时做很多任务.有办法解决这个问题吗?
只是在一些项目的欧拉问题上尝试一些C.
我的问题是为什么我在运行时遇到以下代码的浮点异常?
#include <stdio.h>
main()
{
int sum;
int counter;
sum = 0;
counter = 0;
for (counter = 0; counter <= 1000; counter++)
{
if (1000 % counter == 0)
{
sum = sum + counter;
}
}
printf("Hello World");
printf("The answer should be %d", sum);
}
Run Code Online (Sandbox Code Playgroud)
谢谢,
麦克风
Visual Studio 2008是否会得到新的.NET 4的支持?
我对System.Collections.Concurrent命名空间和并行任务库特别感兴趣,我会立即使用它.
它出现时是否值得升级到Visual Studio 2010?
c# ×3
attributes ×1
c ×1
c#-4.0 ×1
concurrency ×1
delphi ×1
exception ×1
integer ×1
java ×1
java-me ×1
lazarus ×1
odbc ×1
passwords ×1
php ×1
process ×1
radio-button ×1
radio-group ×1
system ×1