有人可以帮我配置log 4j.我正在使用eclipse,该应用程序是一个gwt应用程序.无论何时,我正在启动网络应用程序,它正在显示
log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext).
log4j:WARN Please initialize the log4j system properly.
Run Code Online (Sandbox Code Playgroud)
我已将log4j.propeties文件放在gwt应用程序的src中.log4j.propeties文件包含:
# Set root logger level to DEBUG and its only appender to Appender1.
log4j.rootLogger=INFO, Appender1,Appender2
# Appender1 is set to be a ConsoleAppender.
log4j.appender.Appender1=org.apache.log4j.ConsoleAppender
log4j.appender.Appender2=org.apache.log4j.RollingFileAppender
log4j.appender.Appender2.File=sample.log
# Appender2 uses PatternLayout.
log4j.appender.Appender1.layout=org.apache.log4j.PatternLayout
log4j.appender.Appender1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.Appender2.layout=org.apache.log4j.PatternLayout
log4j.appender.Appender2.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?
还有什么可以为后端框架做什么,以便为基于backbone.js或其他完整的MVC前端框架的前端应用程序提供一个宁静的服务?
我能想到
还有什么?
我正在为一个学校项目开发一个C++的小型虚拟机,它应该像dc命令一样工作,由一个输出输出元素,一个芯片组,一个Cpu和Ram组成.我目前正在研究芯片组,我已经实现了一个小的解析类,以便能够从标准输入或文件中获取一些Asm指令,然后将此指令推送到Cpu.
问题是:我的指令在std :: list中排序,我希望能够通过foreach指令逐个推送它们.为此,我需要能够将我的成员函数"push_instruction"称为for_each的函数指针F; 我无法找到这样做的伎俩......
有任何想法吗?这是我的代码:
/*
** Function which will supervise
** the lexing and parsing of the input (whether it's std_input or a file descriptor)
** the memory pushing of operands and operators
** and will command the execution of instructions to the Cpu
*/
void Chipset::startExecution()
{
/*
** My parsing
** Instructions
**
*/
for_each(this->_instructList.begin(), this->_instructList.end(), this->pushInstruction);
}
void Chipset::pushInstruction(instructionList* instruction)
{
if (instruction->opCode == PUSH)
this->_processor->pushOperand(instruction->value, Memory::OPERAND, Memory::BACK);
else if (instruction->opCode == ASSERT)
this->_processor->pushOperand(instruction->value, Memory::ASSERT, …Run Code Online (Sandbox Code Playgroud) 我已经描述了一个自定义的按钮栏这里.
现在,我想在第一个和第二个之间以及第二个和第三个按钮之间添加一个分隔符.我的按钮栏定义如下:
<LinearLayout
android:id="@+id/buttonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/buttonbarstyle"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
>
<ImageButton
android:id="@+id/buttonBarImageButton1"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/copy"
android:padding="2dip"
android:background="@drawable/buttonbar_background_selector"
android:layout_gravity="center_vertical"
/>
<ImageButton
android:id="@+id/buttonBarImageButton2"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/options"
android:padding="2dip"
android:background="@drawable/buttonbar_background_selector"
android:layout_gravity="center_vertical"
/>
<ImageButton
android:id="@+id/buttonBarImageButton3"
android:scaleType="centerInside"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:src="@drawable/media_play"
android:padding="2dip"
android:background="@drawable/buttonbar_background_selector"
android:layout_gravity="center_vertical"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
任务似乎很简单,但我找不到一个好方法.它应该在每个按钮之间有一个灰色的分隔符,所以它看起来有点像这样.
我相信这很简单,请指出我正确的方向.
为什么C#List<>的ToString方法没有提供合理的字符串表示来打印其内容?object.ToString当我尝试打印一个List<>对象时,我得到了类名(我假设它是默认实现).为什么会这样?
我正在编写一个程序来列出Windows上目录中的所有文件.我只是使用提供的文件管理功能,但我对结果感到好奇:
Target file is *.*
The first file found is .
The next file found is ..
The next file found is file0
The next file found is file1
...
...
The next file found is fileN
Run Code Online (Sandbox Code Playgroud)
从技术上讲,这些"是什么".和".."?我记得我在cmd中使用"cd .."退出到上一级目录.对于"cd.",我不知道它是什么.
好的,所以我跟着文档一直到最小的细节,当我尝试调试并运行时,它一直给我以下错误(F5):
检测到PInvokeStackImbalance消息:调用PInvoke函数'VistaControls!VistaControls.Dwm.NativeMethods :: DwmExtendFrameIntoClientArea'使堆栈失衡.这很可能是因为托管PInvoke签名与非托管目标签名不匹配.检查PInvoke签名的调用约定和参数是否与目标非托管签名匹配.
我不知道这意味着什么,或者如何解决它!有人可以帮忙吗?有什么建议?
我以前用过这个,但这次没用.我正在使用VS2010 Express C#WinForms,.NET 4(就像我以前在很久以前第一次使用它时那样.)
谢谢
链接:http://windowsformsaero.codeplex.com/wikipage? title = Glass% 20on%20WinForms & referringTitle=Documentation
是的,我注意到一个人在那个页面底部做出的修正,我修正了,但它仍然不起作用!
代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VistaControls.Dwm;
namespace One_Stop_Management
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.FillRectangles(Brushes.Black, new Rectangle[] {
new Rectangle(0, 0, this.ClientSize.Width, 30),
new Rectangle(this.ClientSize.Width - 30, 0, 30, this.ClientSize.Height),
new Rectangle(0, …Run Code Online (Sandbox Code Playgroud) 我有一行Ruby代码看起来像这样:
words = params[:words].gsub("\n","").gsub("\s","")
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法来执行此操作,因为代码占用所有空格和换行符并摆脱它们?只是好奇,如果有更好或更短的方式,在我的代码中过于重复的情况下.上面的代码对我有用,但我是编程的新手,并希望在可能的情况下做得更好/更美观.
我正在使用org.hibernate.cfg.ImprovedNamingStrategy,但对于一个表我已经明确指定了表名
@Table(name="EventLog",schema = "eventlogs")
Run Code Online (Sandbox Code Playgroud)
但是hibernate似乎在寻找event_log.不应该显式命名覆盖ImprovedNamingStrategy提供的命名
我有一个模型,其中包括一个字段:
TAX_CHOICES = (
(10.5, '10.5%'),
(17.5, '17.5%'),
(30, '30%'),
(33, '33%'),
)
taxBracket = models.DecimalField(max_digits=4, decimal_places=2, choices=TAX_CHOICES, default=10.5)
Run Code Online (Sandbox Code Playgroud)
我现有的Django表单在我的应用程序中工作,允许用户成功输入他们的纳税括号.但是,我需要通过Django Admin界面手动添加一些用户信息,但是当我选择10.5或17.5值时会出现如下错误:
Value Decimal('10.5') is not a valid choice
Run Code Online (Sandbox Code Playgroud)
我从阅读Django文档中了解到,Admin表单将DecimalField类型视为"文本"输入,但我不确定是否应该查看模型定义或管理表单的自定义.我目前没有在此项目中定义admin.py以进行管理站点自定义.