wrapper

在我们睡觉的时候,程序能不能自动查 bug?

匆匆过客 提交于 2019-12-06 07:39:15
作者介绍:我和我的 SQL 队(成员:杜沁园、韩玉博、黄宝灵、满俊朋),他们的项目「基于路径统计的 sql bug root cause 分析」获得了 TiDB Hackathon 2019 的三等奖。 曾在 Hacker News 上看到过一个 Oracle 工程师处理 bug 的 日常 : 先花两周左右时间来理解 20 个参数如何通过神奇的组合引发 bug。 改了几行代码,尝试对 bug 进行修复,提交测试集群开始跑近百万个测试 case,通常要 20~30 小时。 运气好的话会有 100 多个 case 没过,有时候上千个也有可能,只好挑选几个来看,发现还有 10 个参数之前没有注意到。 又过了两周,终于找到了引起 bug 的真正参数组合,并跑通了所有测试。并增加 100 多个测试 case 确保覆盖他的修改。 经过一个多月的代码 review,他的修改终于合并了,开始处理下一个 bug…… 后来这个工程师感慨说:“I don't work for Oracle anymore. Will never work for Oracle again!” Oracle 12.2 有将近 2500 万行 C 代码,复杂系统的测试是一件艰难、艰苦和艰巨的事情。而测试一个分布式数据库的情况就更复杂了,我们永远不知道用户可能写出什么样的 SQL,表结构和索引有多少种组合

在我们睡觉的时候,程序能不能自动查 bug?

孤街浪徒 提交于 2019-12-06 07:34:50
作者介绍:我和我的 SQL 队(成员:杜沁园、韩玉博、黄宝灵、满俊朋),他们的项目「基于路径统计的 sql bug root cause 分析」获得了 TiDB Hackathon 2019 的三等奖。 曾在 Hacker News 上看到过一个 Oracle 工程师处理 bug 的 日常 : 先花两周左右时间来理解 20 个参数如何通过神奇的组合引发 bug。 改了几行代码,尝试对 bug 进行修复,提交测试集群开始跑近百万个测试 case,通常要 20~30 小时。 运气好的话会有 100 多个 case 没过,有时候上千个也有可能,只好挑选几个来看,发现还有 10 个参数之前没有注意到。 又过了两周,终于找到了引起 bug 的真正参数组合,并跑通了所有测试。并增加 100 多个测试 case 确保覆盖他的修改。 经过一个多月的代码 review,他的修改终于合并了,开始处理下一个 bug…… 后来这个工程师感慨说:“I don't work for Oracle anymore. Will never work for Oracle again!” Oracle 12.2 有将近 2500 万行 C 代码,复杂系统的测试是一件艰难、艰苦和艰巨的事情。而测试一个分布式数据库的情况就更复杂了,我们永远不知道用户可能写出什么样的 SQL,表结构和索引有多少种组合

Wrapper routine for write() with unistd.h included results in error

孤人 提交于 2019-12-06 07:10:50
问题 I am writing a wrapper routine for write() to override the original system function and within it i need to execute another program through execve() ; for which I include the header file unistd.h . I get the error conflicting types for 'write' /usr/include/unistd.h:363:16: note: previous declaration of 'write'was here . I would be very gratefull if someone could help me out as I need to call another program from inside the wrapper and also send arguments to it from inside the wrapper routine.

Is having a wrapper for your IoC a good idea?

≡放荡痞女 提交于 2019-12-06 05:19:05
I have been using StructureMap for more than a year now. And all this time I used to have a wrapper class called IoC which looked like this class IoC { public static T GetInstance<T>() { return (T)GetInstance(typeof(T)); } public static IEnumerable<T> GetAllInstances<T>() { return ObjectFactory.GetAllInstances<T>(); } public static IEnumerable GetAllInstances(Type type) { return ObjectFactory.GetAllInstances(type); } public static object GetInstance(Type type) { return ObjectFactory.GetInstance(type); } public static void Inject<T>(T obj) { ObjectFactory.Inject(obj); } } I added the wrapper

c++ multithreaded windows GUI (accessing the forms)

淺唱寂寞╮ 提交于 2019-12-06 04:59:22
I've written a simple console application using windows sockets to work as a proxy between a server and a client. I decided to make a graphical interface for watching all the in/outgoing packets real time (like a very simple wireshark). The connection between the server and the client runs on a different thread than the message loop. When the server/client sends a packet, I would like that to be displayed (for example added to a simple text control) immediately. But since I can not access the forms from other thread than the thread where the message loop is I dont know how to handle this. I've

How to create a Wrapper

江枫思渺然 提交于 2019-12-06 04:57:46
问题 As I Googled particular things, I've numerously run into the concept of "create a wrapper and extend that." In my case, I want to extend DOM. I know how advised against that is, but what I'm trying to do is slightly different and to do it I need to at-least explore these methodologies. So my question to you, after not getting a straight answer nomatter what blog/wiki/tut I looked at, is: What is a wrapper object/function and how do you make and use one? Sorry if it turns out I made no sense;

Is there a reason to always use Objects instead of primitives?

走远了吗. 提交于 2019-12-06 04:19:41
问题 So I just started my second programming class in Java, and this is the example given to us by the professor to demonstrate loops and arrays. public class ArraysLoopsModulus { public static void main(String [ ] commandlineArguments){ //Declare & Instatiate an Array of 10 integers Integer[ ] arrayOf10Integers = new Integer[10]; //initialize the array to the powers of 2 Integer powersOf2 = new Integer(1); for(int i=0;i<arrayOf10Integers.length;i++){ arrayOf10Integers[i] = powersOf2; //multiply

How to use a C++ project from within a .NET application?

不想你离开。 提交于 2019-12-06 03:55:31
问题 I'm a regular .NET developer aiming to integrate a C++ library into a .NET project. I have a few ideas, but since I'm new to C++ in general I don't know the limits of the technology I'm trying to work with. The C++ project is essentially a fast sound renderer that can playback multi-track audio files with a bunch of different postprocessing tricks. All of this is cool, but considering I have a simple .NET WinForms app I want to integrate with, things start to look messy. Firstly, the C++

微课程 | 第四课《目录结构演示》

*爱你&永不变心* 提交于 2019-12-06 02:46:04
https://v.youku.com/v_show/id_XNDQ1MjQ3NjE2OA==.html 上一期我们介绍了 DBLE 的普通安装方式,这一期我们来了解一下安装好的目录结构。 https://v.youku.com/v_show/id_XNDQ1MjQ5MzQyOA==.html DBLE 安装目录介绍 首先是一个算法的目录,存放自定义算法。然后是 bin 目录,存放启动脚本和初始化集群状态的脚本,然后还有小工具命令。conf 目录是最重要的,存放配置文件,我们后面详细说它。pid 是守护进程文件,如果进程不在了,pid 就消失了。所以如果监控的话,可以通过这种方式来去看 dble 状态是否正常。然后 lib 目录是我们的 jar 格式的包存放目录,包括一些依赖包以及最重要的 dble 的 jar 文件。然后是日志目录,日志目录里面可以看到已经有写了些日志,包括一些归档的按照日期分类的日志,当前的 dble 日志,还有一个 GC 日志,GC 日志只有发生 GC 才会去写。如果我们有 GC 方面的问题,可以以此诊断,还有一个分布式事务的日志。还有一个 version.txt 文件,这里面有一个彩蛋!这个彩蛋可以在 Linux 环境下展示一个二维码。这个二维码是我们的社区微信公众号的二维码,还显示了当前 dble 的版本信息。最后是 viewConf 文件,在使用

CSS实现footer“吸底”效果

谁说我不能喝 提交于 2019-12-06 02:37:09
我们经常会遇到这样的问题:如何用css来实现底部元素可“粘住底部”的效果,对于“粘住底部”,本文有两种理解: 一是无论内容的多少,我们都希望使按钮,固定于可视窗口的底部,且内容区是可滚动的。 二是当内容区的内容较少时,页脚区不是随着内容区排布,而是始终显示在屏幕的最下方;当内容区的内容较多时,页脚能随着内容区的增高而撑开,始终显示在页面的最底部。 谈到“吸底”效果的实现,大家可能较多了解到的是sticky-footer布局,但这个方式大多是用来解决第二种情况的实现。本文将采用以下的三种方案来分别来实现以上这两种效果,并简单实现的原理以及其的适用情况。 容器(wrapper)包含两部分,分别是内容(content)和底部需固定的区域(footer)。 html设置 <!-- wrapper是包裹content和footer的父容器 --></div> <div class= "wrapper" > <div class= "content" > <ul> <!-- 页面主体内容区域 --></div> <li>1.这是内容,这是内容……</li> <li>2.这是内容,这是内容……</li> <li>3.这是内容,这是内容……</li> <li>4.这是内容,这是内容……</li> <li>5.这是内容,这是内容……</li> <li>6.这是内容,这是内容……</li> <li>7