我有个问题.Quartz不断将其日志记录在我的所有日志文件中.我可以将Quart的日志重定向到单独的文件吗?这是我的logback.xml:
<configuration debug="false">
<appender name="hcmut.cse.virtuallab.request" class="ch.qos.logback.core.FileAppender">
<file>log/hcmut.cse.virtuallab.request.log</file>
<encoder>
<pattern>%date %level [%thread] %logger [%file:%line] %msg%n</pattern>
</encoder>
</appender>
<appender name="hcmut.cse.virtuallab.timer" class="ch.qos.logback.core.FileAppender">
<file>log/hcmut.cse.virtuallab.timer.log</file>
<encoder>
<pattern>%date %level [%thread] %logger [%file:%line] %msg%n</pattern>
</encoder>
</appender>
<logger name="root" level="debug">
<appender-ref ref="hcmut.cse.virtuallab.timer" />
<appender-ref ref="hcmut.cse.virtuallab.request" />
</logger>
</configuration>
Run Code Online (Sandbox Code Playgroud) 我有一个十进制值为 18,8 的列。我被要求将其扩展到 18,18 以在,.
ALTER TABLE [dbo].[TransakcjeGotowkowe]
ALTER COLUMN TransakcjeGotowkoweKwota decimal (18,18) NULL
Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
Run Code Online (Sandbox Code Playgroud)
我也尝试通过 GUI 来完成。没有其他变化只是想在 , 之后保存更多数据。
有没有其他方法可以做到这一点?
我想做的是:用户在地图上选择开始和目的地,然后从他们的坐标我想显示地图上的位置列表中最近的点位置.我有一个简单的Sqlite数据库,包含可能位置的经度,纬度和名称.
我做了一些研究,这是我发现的:
http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL
但这是为了将它与mySql和某种空间搜索扩展一起使用.有没有可能我可以使用android api或外部库做类似的事情?
public Point dialogFindClosestLocationToPoint(geometry.Point aStartPoint){
List<PointWithDistance> helperList=new ArrayList<PointWithDistance>();
try {
openDataBase();
Cursor c=getCursorQueryWithAllTheData();
if(c.moveToFirst())
do{
PointWithDistance helper=new PointWithDistance(c.getDouble(1),c.getDouble(2),c.getString(3));
int distance=returnDistanceBetween2Points(aStartPoint, helper);
if(distance<MAX_SEARCH_DISTANCE){
helper.setDistance(distance);
Log.i("values", helper.name);
helperList.add(helper);
}
}while (c.moveToNext());
Collections.sort(helperList,new PointComparator());
if(helperList!=null)
return helperList.get(0);
else return null;
}catch(SQLException sqle){
throw sqle;
}
finally{
close();
}
Run Code Online (Sandbox Code Playgroud)
这是PointComparator()类中的代码:
public int compare(PointWithDistance o1, PointWithDistance o2) {
return (o1.getDistance()<o2.getDistance() ? -1 : (o1.getDistance()==o2.getDistance() ? 0 : 1));
}
Run Code Online (Sandbox Code Playgroud)
where PointWithDistance是一个包含:lat,long,distance,name的对象
但是这个解决方案没有提供正确的返回信息......我意识到它根本不可扩展且非常慢.我需要一个能够快速执行最多1000行数据库的解决方案.
编辑:我在排序中的这段代码中出现了错误,现在我已将其更改(应该是<而不是>)
我有一个String列表
ArrayList<String> list = new ArrayList<String>();
Run Code Online (Sandbox Code Playgroud)
每个项目:
list.add(week+" "+year);
Run Code Online (Sandbox Code Playgroud)
在哪里week和year是整数.
如何将此列表按升序排序?
我正在使用MVVM灯并设置绑定如下:
class TestModule:NinjectModule
{
public override void Load()
{
Bind<ICollection<Element>>().To<Collection<Element>>();
Bind<Element>().ToSelf();
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试获取ICollection时,我得到一个包含ONE元素的集合.我期待一个很好的收藏.
var _kernel = new StandardKernel(new TestModule());
var col = _kernel.Get<ICollection<Element>>();
Console.WriteLine("Count={0}", col.Count); //Write "Count=1", Expect "Count=0"
Run Code Online (Sandbox Code Playgroud) 我在mac上设计我的网站.我使用基本格式,然后当我想要我的电脑时,包装宽度太宽.我的问题是我能做什么才能使我的网站在所有浏览器/操作系统上看起来都一样?
我正在寻找类似于缩进但是(bash)脚本的东西.仅限控制台,无着色等
你知道吗?
我正在从PHP文件中提供JS响应.设置Content-Type标题时我应该使用哪个值,application/javascript还是text/javascript?
这两者有什么区别?
我认为您已经听说过消息/事件总线,它是系统中所有事件流动的单一位置.在计算机的主板和LAN网络中可以找到类似的架构.这对于主板和网络来说是一个很好的方法,因为它减少了电线的数量,但它对软件开发有好处吗?我们没有像电子产品那样的限制.
消息总线/事件总线的最简单实现可以是:
class EventBus {
void addListener(EventBusListener l}{...}
void fireEvent(Event e) {...}
}
Run Code Online (Sandbox Code Playgroud)
发布事件是通过bus.fireEvent(事件)完成的,接收消息由bus.addListener(侦听器)启用.这种体系结构有时用于软件开发,例如MVP4G为GWT实现类似的消息总线.
活跃项目:
休眠/死亡项目:
它只是流行的Observer(Listener)模式"全局" - 系统中的每个对象都可以监听每条消息,我认为这很糟糕,它打破了封装原则(每个对象都知道所有内容)和单一责任原则(例如,某些对象需要一种新类型的消息,事件总线通常需要更改,例如在Listener类中添加一个新的Listener类或一个新方法.
由于这些原因,我认为,对于大多数软件来说,Observer模式比事件总线更好.您如何看待事件总线,它对典型应用程序有什么好处?
编辑:我不是在谈论像ESB这样的"大型"企业解决方案 - 它们可能很有用(ESB提供的内容远远超过事件总线).我在询问有关在"常规"Java代码中使用消息总线进行对象到对象连接的有用性 - 有些人这样做,请查看上面的链接.事件总线可能是电话到电话通信或计算机到计算机通信的最佳解决方案,因为网络中的每个电话(或计算机)通常可以相互通信,并且总线减少了电线的数量.但是对象很少相互交谈 - 一个对象可以拥有多少合作者 - 3,5?