问题标签 [replicate]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
547 浏览

r - 如何在不替换的情况下随机抽取样本后引导函数

我有一些代码允许我从数据集中随机抽取两个样本,应用一个函数并重复该过程一定次数(请参阅下面来自相关问题的代码:How to bootstrap a function with replacement and return the output)。

示例数据:

代码:

我不想抽取两个大小为 15 的随机抽取样本,而是抽取一个大小为 15 的随机抽取样本,然后在第一次随机抽取后提取数据集中剩余的 15 行(即subA等于第一个随机抽取的样本15 个 obs,subB将等于在 subA 被占用后剩余的 15 个 obs)。我真的不知道该怎么做。任何帮助将非常感激。谢谢!

0 投票
1 回答
1469 浏览

php - Laravel 4:复制到表

如何将表行从一个表克隆到另一个我找到了克隆但不知道如何将其插入其他表的方法

我有数据类和产品类,我只想从数据克隆到产品一行

0 投票
2 回答
3013 浏览

sql - 如何在 SQL Server 的列中查找重复的数字。例如 11111、33333333、5555555555、7777777 等

我需要在列中识别重复的数字(例如:1111、33333333、5555555555、777777777 等)。

我怎样才能在 sql server 中做到这一点,而不必对每个场景都进行硬编码。最大长度为 10 列。任何帮助表示赞赏。

0 投票
1 回答
375 浏览

amazon-web-services - 从本地服务器到 EC2 实例的 Couchdb 复制

我正在尝试将我的数据库从本地服务器复制到 EC2 实例,但我不知道如何处理身份验证。这是我正在尝试的:

但我越来越

有任何想法吗?

0 投票
0 回答
57 浏览

sql - Copying Data From A Remote Database With Limited Access

I am an "accidental DBA" managing data for an engineering company. Each of our sites has a local store of the latest 3 months (rolling) of site data in a SQL Server 2000 database.

These databases (circa 150 of) are managed by the plant manufacturer and we only have read only SELECT access to the data. It is not possible to gain administrative access or make any changes to the tables, schema, configuration options, etc to these remote databases.

In addition to this, we keep an exact copy (same tables, schema, etc) of all data on a SQL Server 2012 (Standard edition) database in our office. This stores all historical data from each site, not just the 3 months stored remotely. At present, the remote data is retrieved and the office database updated using a custom third-party tool. However, this is provided as an exe and it is not possible to view the source code.

As configuration options on the third-party transfer tool are limited, I have been asked to find a way of replacing it. Obviously, I could write my own custom application, but I first wanted to explore whether I could leverage any existing SQL Server tools.

So far, I have tried to explore (note: I'm not an expert in SQL Server, so please forgive any inaccuracies):

  1. SQL Server replication: if I understand correctly, this must be configured on both the source and target databases, which is unfortunately not an option (I also believe SQL Server 2000 does not support replication).

  2. Microsoft Sync Framework: from what I've read this involves creating tables / columns in the source database to monitor changes. This is not possible in my case.

  3. Linked servers (I don't think this is a replication technology in itself, I just tried it out): I tried to create a linked server but as the remote database is running SQL Server 2000 this is not possible.

  4. Service Broker: like 1. and 2., this involves creating queues in the remote database.

So, my questions are:

  1. Are there any tools in SQL Server to replicate data between instances when you only have SELECT permissions on the remote databases?

  2. If the answer to 1. is no, are there any good examples of stored procedures which carry out the above?

  3. Monitoring for changes is relatively easily in my case as each row contains a signal timestamp. So it's possible to monitor this for new data. However, some columns contain counter information which depending on when the data was retrieved may have changed (same timestamp, but another column may have been updated). What is the best way of handling these cases?

PS - I'll be out of the office until Tuesday 29th July, so I will try any suggestions then. Thanks for your help!

0 投票
1 回答
180 浏览

pouchdb - pouchDB 到 iriscouch 同步问题与删除

我已按照教程http://pouchdb.com/getting-started.html进行操作,添加新的 todos 效果很好,编辑 todos 也是如此,但删除(删除)不起作用。

即在 browser1 中我添加了一个待办事项并在 browser2 中显示它。然后在浏览器1中我删除了待办事项,它消失了,但只在浏览器1中,在浏览器2中它仍然存在,如果我登录到我的iriscouch,它也仍然存在。

有人遇到同样的问题并找到解决方案吗?

0 投票
1 回答
916 浏览

r - 在 R 中绘制排列在单列中的重复

我在 40 个人中测量了许多变量的两次重复。我的数据集按列排列,每列代表一个变量。这意味着在每一列中,我有 40 个个体的两个重复,即 80 个值。一个额外的列是个人的身份,另一个额外的列是复制品(1 或 2)。

我想尽可能地保留这个结构,因为我需要它来做进一步的分析。

我试图做的没有成功(因此寻求您的帮助)是制作一组散点图(每个变量一个),x轴上的个人的第一个重复,y轴上的第二个 -轴。然后,我想用个人的 ID 标记这些点,以检测异常等......

到目前为止,我只能(部分)通过将数据集一分为二(每个复制一个),然后在两个数据集中选择相同的变量并在循环内绘制它来做到这一点。但这并不优雅。这是我到目前为止所做的代码:

但我会很感激按照上面的解释这样做,而不是分裂。lattice 或 ggplot 都可以。另外,我更喜欢以某种方式保存这些图,然后将它们全部排列在同一个面板中,然后再将它们保存到文件中(这是我对代码所做的)。

在此先感谢您的时间。

编辑:一些可重现的数据(不确定直接从控制台粘贴是否可以......)。Fish 是 ID 列,test 是复制,另外两列是两个变量。

0 投票
3 回答
144 浏览

r - R如何在列表中复制空值

结果是:

假设我想对大于 2 的数字执行此操作,有没有办法通过复制获得相同的列表结构?

0 投票
1 回答
447 浏览

php - 使用外键复制 - Laravel

我正在尝试在我的数据库中复制某些数据,并按照以下链接中的步骤进行操作。Laravel 4:复制到表 但是,我需要仅使用外键复制一些其他数据。我尝试使用 find() 方法获取我的数据但没有返回任何内容。where 子句返回我的数据但以数组的形式复制方法不接受它。

Anhy 知道我做错了什么以及如何复制我的其他数据?!

代码:

0 投票
1 回答
279 浏览

r - 在 R 中保存来自复制模拟的数据

我创建了一个生成数据表的小函数。然后,我希望R多次复制这个函数,所以我将我的函数包含在一个“replicate()”函数中。这似乎工作得很好。

现在,我想将每个模拟的结果保存在一个表中。我尝试过 rbind、data.table 等...但显然我做错了。