我有以下脚本.我不知道如何在sql server 2005中创建新数据库.我运行以下脚本,它在模型下创建表而不是单独的数据库.它看起来很大.
我该如何创建单独的数据库.我在这里复制一些脚本,以供你的行动和行动.
-----------------------------------------------------------
-- SQL Server 2000 Bible
-- Hungry Minds
-- Paul Nielsen
-- OBX Kites sample database - CREATE Database, Tables, and Procs
-- this script will drop an existing OBXKites database
-- and create a fresh new installation
-- related scripts:
-- OBXKites_Populate
-- T-SQL KEYWORDS go
-- DatabaseNames
-----------------------------------------------------------
-----------------------------------------------------------
-- Drop and Create Database
USE master
GO
IF EXISTS (SELECT * FROM SysDatabases WHERE NAME='OBXKites')
DROP DATABASE OBXKites
go
-- This creates 1 …Run Code Online (Sandbox Code Playgroud) 所以,我有这个基于java的数据转换/屏蔽工具,我想在Oracle 10g上进行测试.Oracle 10g的优点在于,您可以获得大量包含50万条记录的示例模式.模式是:SH,OE,HR,IX等.所以,我安装了10g,发现安装脚本在ORACLE_HOME/demo/scripts下.
我稍微定制了这些脚本以便在批处理模式下运行.这解决了我的一半要求 - 为我的数据转换软件测试创建源数据.要求的后半部分是我在不使用任何数据的情况下以不同的名称(TR_HR,TR_OE等等)创建相同的模式.这些模式将代表我的目标模式.因此,简而言之,我的软件将从模式中的表中获取数据,并将其加载到不同模式中的同一个表中.
现在,我在创建目标模式并清空它时遇到两个问题.
有没有这么简单的方法,没有这么大惊小怪?我需要一个复杂的数据集用于我的测试(复杂的,如带有触发器的表,多个层次结构......例如,一个子表最多有5个级别,一个父表引用一个IOT表和一个IOT表指的是非IOT表等.).从数据集的角度来看,示例模式几乎是完美的.我看到的唯一挑战是自动化加载源模式的整个过程,然后创建目标模式并清空它们.感谢您的帮助和建议.
UPDATE
您需要运行以手动安装oracle示例模式的主脚本是mkplug.sql.以下是从dmp文件加载模式的行:
host imp "'sys/&&password_sys AS SYSDBA'" transport_tablespace=y file=&imp_file log=&imp_logfile datafiles='&datafile' tablespaces=EXAMPLE tts_owners=hr,oe,pm,ix,sh
Run Code Online (Sandbox Code Playgroud)
好吧,我尝试修改此行(在修复mkplug.sql和所有其他sql文件上的路径相关问题之后)到此:
host imp "'sys/&&password_sys AS SYSDBA'" rows=n transport_tablespace=y file=&imp_file log=&imp_logfile datafiles='&datafile' tablespaces=EXAMPLE tts_owners=hr,oe,pm,ix,sh
Run Code Online (Sandbox Code Playgroud)
而且......它没有不帮忙.尽管rows = n属性:(使用行数据创建了架构:(
我正在尝试运行opencv中包含的一个示例:find_obj.py.OpenCV版本:2.4 OS:ArchLinx
该功能出错:
flann = cv2.flann_Index(desc2, flann_params)
Run Code Online (Sandbox Code Playgroud)
错误是:
File "find_obj2.py", line 27, in match_flann
flann = cv2.flann_Index(desc2, flann_params)
TypeError: <unknown> is not a numpy array
Run Code Online (Sandbox Code Playgroud)
请有人知道如何解决这个问题?
是否可以设置Android蓝牙聊天示例应用程序,以便一次连接多个人,并拥有一个迷你聊天室?那会带来什么?
我知道我可以使用样本方法从数组中选择一个随机元素,但这样就可以不止一次地拾取元素.我可以先将数组洗牌,然后按顺序从第一个元素到最后一个元素,但我知道这是内存密集型的,如果可能的话,我正在寻找一种不太密集的方法!
我刚开始从代号为:: blocks的superbible(第6版)学习openGL.但是当我尝试运行第一个示例代码时,我从sb6.h文件中获得了一个未定义的平台错误.
示例代码:
#include "sb6.h"
// Derive my_application from sb6::application
class my_application : public sb6::application
{
public:
// Our rendering function
void render(double currentTime)
{
// Simply clear the window with red
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这一问题?
如何加快R中的概率加权采样?
# Let's assume we are considering following example:
w <- sample(1:4000,size=2e6, replace=T)
# "w" will be integer, so we are going to convert it to numeric.
w <- as.numeric(w)
# Actually the sampling process have to be repeated many times.
M <- matrix(NA, 10, 2000)
system.time(
for (r in 1:10){
ix <- sample(1:2e6,size=2000,prob=w/sum(w))
M[r,] <- ix
})
# It's worth it to mention that without "prob=w/sum(w)" sampling is considerably faster.
# The main goal is to speed …Run Code Online (Sandbox Code Playgroud) 我正在尝试从Julia中的数组中抽取n个(例如,为简单起见,为10个)。使用下面的功能wsample,ndraws我可以得到想要的
using Distributions
population = [ 1, 10 ]
weights = [ .4, .6 ]
population_idx = wsample( population, weights, 10 ) # i.e. population indices
ndraws = population[ population_idx ]
Run Code Online (Sandbox Code Playgroud)
我正在使用Julia 0.2。没有索引,有没有办法做同样的事情?在R比如,我们有
ndraws <- sample( population, size = 10, replace = TRUE, prob = weights )
Run Code Online (Sandbox Code Playgroud)
这里的文档建议有这样做
ndraws = wsample( population, weights, 10 )
Run Code Online (Sandbox Code Playgroud)
应该给我,嗯,正是我想要的?还要注意,在docs中,平局次数的参数名称是,n但在的源代码中查找时sample.jl,它是指k。
我有包含唯一标识符,类别和说明的数据.以下是玩具数据集.
prjnumber <- c(1,2,3,4,5,6,7,8,9,10)
category <- c("based","trill","lit","cold",NA,"epic", NA,NA,NA,NA)
description <- c("skip class",
"dunk on brayden",
"record deal",
"fame and fortune",
NA,
"female attention",
NA,NA,NA,NA)
toy.df <- data.frame(prjnumber, category, description)
> toy.df
prjnumber category description
1 1 based skip class
2 2 trill dunk on brayden
3 3 lit record deal
4 4 cold fame and fortune
5 5 <NA> <NA>
6 6 epic female attention
7 7 <NA> <NA>
8 8 <NA> <NA>
9 9 <NA> <NA>
10 10 <NA> …Run Code Online (Sandbox Code Playgroud) 我在R中发现了这个怪癖,并且无法找到它出现的原因.我试图重新创建一个样本作为检查,并发现该sample函数在某些情况下表现不同.看这个例子:
# Look at the first ten rows of a randomly ordered vector of the first 10 million integers
set.seed(4)
head(sample(1:10000000), 10)
[1] 5858004 89458 2937396 2773749 8135739 2604277 7244055 9060916 9490395 731445
# Select a specified sample of size 10 from this same list
set.seed(4)
sample(1:10000000), size = 10)
[1] 5858004 89458 2937396 2773749 8135739 2604277 7244055 9060916 9490395 731445
# Try the same for sample size 10,000,001
set.seed(4)
head(sample(1:10000001), 10)
[1] 5858004 89458 2937396 2773750 8135740 …Run Code Online (Sandbox Code Playgroud)