小编Nic*_*las的帖子

今天最先进的HFT交易系统有多快?

你一直听说高频交易(HFT)以及算法的速度有多快.但我想知道 - 这几天有多快?

更新

我不是在考虑交换机和运行交易应用程序的服务器之间的物理距离造成的延迟,而是由程序本身引入的延迟.

更具体一点:从应用程序到达应用程序的事件到该应用程序的时间是什么时候在线路上输出订单/价格?即交易时间.

我们在谈论毫秒级吗?还是亚微秒?

人们如何实现这些延迟?在汇编中编码?FPGA的?好旧的C++代码?

更新

最近发表了一篇关于ACM的有趣文章,为今天的HFT技术提供了很多细节,这是一个很好的阅读:

网关的野蛮人 - 高频交易和交易技术

algorithmic-trading low-latency

47
推荐指数
4
解决办法
2万
查看次数

android前后摄像头拍摄的图片方向问题,以错误的方式旋转

我有一个纵向模式的相机应用程序,它从前端和后端相机拍摄照片.问题就像捕获的图像以错误的方式旋转...

对于预览,我使用了以下代码....

    Camera.Parameters parameters = camera.getParameters();
        android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();
        android.hardware.Camera.getCameraInfo(defaultCameraId, info);
        int rotation = this.getWindowManager().getDefaultDisplay()
                .getRotation();
        if (Integer.parseInt(Build.VERSION.SDK) >= 8) {

            int degrees = 0;
            switch (rotation) {
            case Surface.ROTATION_0:
                degrees = 0;
                break;
            case Surface.ROTATION_90:
                degrees = 90;
                break;
            case Surface.ROTATION_180:
                degrees = 180;
                break;
            case Surface.ROTATION_270:
                degrees = 270;
                break;
            }
            int result;
            if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
                result = (info.orientation + degrees) % 360;
                result = (360 - result) % 360; // compensate the mirror …
Run Code Online (Sandbox Code Playgroud)

camera android orientation nexus-s

17
推荐指数
1
解决办法
7183
查看次数

如何在图像上创建响应式文本?

我真的不确定如何以任何其他方式提出这个问题,但我正在尝试在图像上加载文本 - 这本身似乎是一个棘手的任务,但我已经开始使用教程了.遗憾的是,该教程稍微过时了,我无法找到一种方法来动态更改移动设备的字体大小和跨度大小,并仍然将文本保持在图像顶部的正确位置.

调整窗口大小时,文本和框不会正确调整大小(它会溢出图像外).

我已经尝试了百分比大小以及其他技术,运气不佳.我用来在背景图像上显示文本的CSS可以在下面看到.

在图像上叠加文本的最佳做法是什么?如何使其响应?这就是我现在正在尝试用于桌面浏览器的内容:

.herotext span {
  position:     absolute;
  top:          80%;
  font-family:  'museo_slab500';
  font-size:    150%;
  color:        #fff;
  padding-left: 20px;
  width:        40%;
  line-height:  35px;
  background:   rgb(0, 0, 0);
  background:   rgba(0, 0, 0, 0.7);
}
Run Code Online (Sandbox Code Playgroud)

这些天有没有人对如何妥善处理这个问题有什么建议?我上面提到的文章是从2009年开始的,我怀疑它不是覆盖文本的最佳方式.

html css html5

12
推荐指数
1
解决办法
4万
查看次数

跨TimeZone的Java Quartz-Scheduler

我的服务器在欧洲/罗马时区运行 - 这个是服务器上的默认tz,我需要根据用户的时区安排工作,因此,如果居住在太平洋/檀香山时区的用户安排一个CronTrigger,每个人都会触发我发现这个解决方案的一天是晚上22点为他的地球区域:

CronTrigger trigger = newTrigger()
  .withIdentity("name", "group")
  .withSchedule(
    cronSchedule("0 0 22 ? * *").inTimeZone(TimeZone.getTimeZone("Pacific/Honolulu"))
  )
  .startNow()
  .build();
Run Code Online (Sandbox Code Playgroud)

在我的服务器上,这个工作从第二天"我的"上午09:00开始.

除了保持更新时区(即时区更新工具)之外,还有一些特殊问题需要考虑吗?

如果我想为前一个作业定义.startAt()和.endAt(),这种日期是否正常?使用此程序可以安全地节省夏令时吗?

Calendar calTZStarts = new GregorianCalendar(TimeZone.getTimeZone("Pacific/Honolulu"));
calTZStarts.set(2013, Calendar.JANUARY, 10);

Calendar calTZEnds = new GregorianCalendar(TimeZone.getTimeZone("Pacific/Honolulu"));
calTZEnds.set(2013, Calendar.JANUARY, 30);

Calendar calStarts = Calendar.getInstance();
calStarts.set(Calendar.YEAR, calTZStarts.get(Calendar.YEAR));
calStarts.set(Calendar.MONTH, calTZStarts.get(Calendar.MONTH));
calStarts.set(Calendar.DAY_OF_MONTH, calTZStarts.get(Calendar.DAY_OF_MONTH));
calStarts.set(Calendar.HOUR_OF_DAY, calTZStarts.get(Calendar.HOUR_OF_DAY));
calStarts.set(Calendar.MINUTE, calTZStarts.get(Calendar.MINUTE));
calStarts.set(Calendar.SECOND, calTZStarts.get(Calendar.SECOND));
calStarts.set(Calendar.MILLISECOND, calTZStarts.get(Calendar.MILLISECOND));

Calendar calEnds = Calendar.getInstance();
calEnds.set(Calendar.YEAR, calTZEnds.get(Calendar.YEAR));
calEnds.set(Calendar.MONTH, calTZEnds.get(Calendar.MONTH));
calEnds.set(Calendar.DAY_OF_MONTH, calTZEnds.get(Calendar.DAY_OF_MONTH));
calEnds.set(Calendar.HOUR_OF_DAY, calTZEnds.get(Calendar.HOUR_OF_DAY));
calEnds.set(Calendar.MINUTE, calTZEnds.get(Calendar.MINUTE));
calEnds.set(Calendar.SECOND, calTZEnds.get(Calendar.SECOND));
calEnds.set(Calendar.MILLISECOND, calTZEnds.get(Calendar.MILLISECOND));

CronTrigger …
Run Code Online (Sandbox Code Playgroud)

java timezone scheduled-tasks quartz-scheduler

9
推荐指数
1
解决办法
2万
查看次数

每次应用程序启动时请求Google Cloud Messaging(GCM)注册ID

我读过有关GCM的文章可能会刷新注册ID而没有常规周期.我正在尝试使用推送通知构建应用程序但不太确定如何处理这样刷新的注册ID.

我的第一个策略是每次应用启动时请求注册ID并将其发送到应用服务器.它看起来有效,但听起来有点不对劲......

可以这样做吗?

android push-notification google-cloud-messaging

7
推荐指数
1
解决办法
5865
查看次数

类路径包含多个与 Gradle 的 SLF4J 绑定

构建 Gradle 项目时出现以下错误:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/qliu/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.0.6/ba738848da3e6fffa0107771c75546eb6d407f3c/logback-classic-1.0.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/qliu/.gradle/caches/modules-2/files-2.1/uk.org.lidalia/slf4j-test/1.1.0/f4f523049e041dea673bd421d7b0d61fb5e49548/slf4j-test-1.1.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.selector.DefaultContextSelector]
Run Code Online (Sandbox Code Playgroud)

还有我的 Gradle 构建文件:

dependencies {
        // for output logger messages
        compile group: 'log4j', name: 'log4j', version: '1.2.17'

        // for testing outputed logger messages
        compile group: 'uk.org.lidalia', name: 'slf4j-test', version: '1.1.0'
}
Run Code Online (Sandbox Code Playgroud)

我如何删除警告?

unit-testing slf4j gradle

2
推荐指数
1
解决办法
6108
查看次数

如何使Logstash使用自己的日志

基本上,我想LogStash消耗自己的日志和填充字段,如@timestamp,level等在Kibana使用.

我当前的配置如下所示:

input {
  file {
    path => "/path/to/logstash/logs/*.log"
    type => "logstash"
  }
}
Run Code Online (Sandbox Code Playgroud)

这似乎很难做到 - 没有回复写Grok过滤器.LogStash是否真的无法使用自己的日志?(很难谷歌,我找不到任何东西.)

或者这首先是错误的做法?

LogStash的日志输出示例:

{
  :timestamp=>"2014-09-02T10:38:08.798000+0200", 
  :message=>"Using milestone 2 input plugin 'file'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones",
  :level=>:warn
}
Run Code Online (Sandbox Code Playgroud)

logstash logstash-grok

2
推荐指数
1
解决办法
1296
查看次数

Android:空指针异常运行时错误

在我尝试包含菜单,对话框和弹出框后,我开始在启动时收到NullPointerException.我试图注释掉部分代码,只有当我在onCreate方法下面注释类变量和所有内容时,progam才有效.我很感激帮助找到造成异常的原因.

package com.emailandcontactmanager;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.PopupWindow;

public class MainActivity extends Activity{

EditText title = (EditText) findViewById(R.id.txtTitle);
EditText body = (EditText) findViewById(R.id.txtBody);
View layout = (View) findViewById(R.layout.main);


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button btnSendMenu = (Button) findViewById(R.id.btnSendMenu);
    btnSendMenu.setOnClickListener(new View.OnClickListener() { …
Run Code Online (Sandbox Code Playgroud)

android nullpointerexception

0
推荐指数
1
解决办法
1161
查看次数