由买买提看人间百态

topics

全部话题 - 话题: test2
首页 上页 1 2 3 4 5 下页 末页 (共5页)
L******r
发帖数: 199
1
来自主题: Programming版 - Perl/MySQL下fetchrow出错
怎么回事?
Can't call method "fetchrow_array" without a package or object reference at
test2.pl line 12.
#!/usr/bin/perl
use strict;
use DBI;
use FileHandle;
use Mysql;
my $dbh= DBI->connect("DBI:mysql:jXXX","XXX","XXX") || die "Got error";
my $tablename="GoogleDVD_Bi_2";
my @results;
#my $rows = $dbh->do(qq{select * from $tablename where (N1 is NULL)||(word_
0 is NULL)||(word_1 is NULL)});
my $rows = $dbh->do(qq{select * from $tablename where id=55});
while (@results = $rows->fetchrow_array()) {
j***3
发帖数: 142
2
来自主题: Programming版 - 初级awk问题 (转载)
【 以下文字转载自 Unix 讨论区 】
发信人: j1123 (2134), 信区: Unix
标 题: 初级awk问题
发信站: BBS 未名空间站 (Sat Jul 19 17:46:07 2008)
想把文件里 $1 的 "C" 换成 "8"
awk '$1 sub("C","8")' test.txt>test2.txt
不work,只把一行里的第一个 ‘C“ 换了,而且没有限在 $1 里面。
请问要如何做呢,谢谢了
j***3
发帖数: 142
3
来自主题: Programming版 - 初级awk问题 (转载)
隔壁的建议用
awk 'gsub("C","8",$1)' test.txt > test2.txt
只把$1里有"C"的几行 输出,
没有输出其他行。
g****g
发帖数: 310
4
不加任何优化的代码
if( j!=0 ) i++;
0041DD87 837D B0 00 CMP DWORD PTR SS:[EBP-50],0
0041DD8B 74 09 JE SHORT test2.0041DD96
0041DD8D 8B45 A4 MOV EAX,DWORD PTR SS:[EBP-5C]
0041DD90 83C0 01 ADD EAX,1
0041DD93 8945 A4 MOV DWORD PTR SS:[EBP-5C],EAX
i+= !(!(j));
0041DD0D 33C0 XOR EAX,EAX
0041DD0F 837D B0 00 CMP DWORD PTR SS:[EBP-50],0
0041DD13 0F95C0 SETNE AL
0041DD16 0345 A4 ADD EAX,DWORD PTR SS:[EBP-5C]
0041DD19
b*******e
发帖数: 34
5
来自主题: Programming版 - 请教个Bloomberg 的 C++ 题目
How many constructor (including copy constructor) and destructors will be
called for test1 and test2?
Test1:3 constructors and destructors
Step-1 Default constructor will be called at Base a;
Step-2 Copy constructor will be called when passing a as formal parameter i.
e func(a).
Step-3 Copy constructor will be called for return object.
Step-4 Destructor will be called for actual parameter of func.
Step-5 Now this return obj will act as nameless obj in test1() and will get
destroy after line func
g*******y
发帖数: 1930
6
来自主题: Programming版 - 请教个Bloomberg 的 C++ 题目
test2可能会有NRVO。应该是compiler-dependent。
http://msdn.microsoft.com/en-us/library/ms364057%28VS.80%29.aspx

i.
get
H*M
发帖数: 1268
7
来自主题: Programming版 - 看下这个小程序
为什么最后一个输出为400?
好奇怪,我还以为应该是垃圾.
谁给解释下,谢了
这个b在程序里起什么作用?
//test2
//////////////////////////////////////
#include
int main()
{
int a[5]={10, 20, 30, 40, 50};
int b[5]={100, 200, 300, 400, 500};
int *ptr = (int *)(&a+1);
int *t = (int *)(&a -1);
printf("%d %d %d \n", *(a+1), *(ptr-1), *(t+1));
}
c*******t
发帖数: 13
8
undefined behavior
不过主流开发环境中优化之后,test1中的字符串放在只读数据段中,函数返回后数据
依然有效,而test2中的字符串在栈上。
d*******o
发帖数: 5897
9
楼主确定test1会返回正确的结果?怎么我觉得test1和test2都不可靠?
r****t
发帖数: 10904
10
今天编译某个别人的程序,发现现在 test1 这种写法编译应该已经有 warning 了:
warning: deprecated conversion from string constant to 'char*'
test2 是怎么回事俺还没明白。。。
s*****w
发帖数: 1527
11
来自主题: Programming版 - c# decorator pattern question
this is the compiled code, in the end i got "get 0", instead of "get
30".
why ?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test2
{
class MainApp
{
static void Main()
{
ConcreteComponent c = new ConcreteComponent(5);
ConcreteDecoratorA d1 = new ConcreteDecoratorA();
ConcreteDecoratorB d2 = new ConcreteDecoratorB();
d1.SetComponent(c);
c**t
发帖数: 2744
12
来自主题: Programming版 - c# decorator pattern question
ConcreateDecoratorB has its own localComponent with initial val: 0.
That's why you got 0.

this is the compiled code, in the end i got "get 0", instead of "get
30".
why ?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test2
{
class MainApp
{
static void Main()
{
ConcreteComponent c = new ConcreteComponent(5);
ConcreteDecoratorA d1 = new ConcreteDecoratorA();
s*****w
发帖数: 1527
13
来自主题: Programming版 - Nested batch file doesn't run in windows
i have root.bat, in it i have 2 lines,
test1.bat
test2.bat
when i run root, it only runs the 1st one.
so what's the correct way pls ?
l*********s
发帖数: 5409
14
来自主题: Programming版 - Nested batch file doesn't run in windows
call test1.bat
call test2.bat
O*******d
发帖数: 20343
15
来自主题: Programming版 - 我写的CUDA屏保软件 (转载)
运行开始后,有一个叫test2.txt的文件被产生或更新。 其内容如下
15.518912 18.481120
15.595360 18.413234
18.680639 24.259508
15.684287 19.304968
15.714080 21.223647
15.708960 19.361958
timer 22, TimerScaleFactor 2.666667
前六排的第一个数字是计算一幅图像GPU运行时间,单位是毫秒。 第二个数字是一幅图
像的总时间,包括图像的后处理和显示。 timer 22的意思是刷屏一次要用22毫秒。用
的是上边6次的平均值区间化。
p*****2
发帖数: 21240
16
test1 和 test2 可以用两个db吧 如果本来就可以并行的话
c******o
发帖数: 1277
17
来自主题: Programming版 - Scala的map和flatmap什么区别?
从下面的code 看出。
map能对一个数据(一个List, 一个Option, 一个Future) 进行操作。
applicative (ap) 能对多个数据进行操作。
monad能对对多个数据进行操作的同时,根据数据的内容动态改变操作流程。
基本上functor (map),applicative functor (ap), monad (flatMap)的区别就是这
些。
object test {
def oneVarFunc: Int => Int = {
_ + 1
}
def twoVarFunc: (Int, Int) => Int = {
_ + _
}
def optionap[A,B](a: Option[A])(f: Option[A => B]): Option[B] =
f.flatMap(t1 => a.flatMap(t2 => Some(t1(t2))))
val x1 = Some(1)
val x2 = Some(2)
val x3 = None
//functor
def test... 阅读全帖
g*********e
发帖数: 14401
18
i have an array, each of them is a string of a testname.
then a need to do a sql query "select ... where TESTNAME=testname ... " for
each tests, then collect each query result back and form the eventual
response.
[{test1: test1_query_result},
{test2: test2_query_result},
...
]
that's what i want. can anyone share usable code? Thx.
e******i
发帖数: 341
19
来自主题: Security版 - what does he want to do?
TNND, a fucking guy is trying to hack my webpage
93.248.197.213 - - [29/Oct/2003:12:59:42 -0500] "GET /sophia/photo/test2.php
HTTP/1.1" 200 5
193.248.197.213 - - [29/Oct/2003:13:05:03 -0500] "POST /sophia/upload.php
HTTP/1.1" 200 39
193.248.197.213 - - [29/Oct/2003:13:06:26 -0500] "GET /sophia/photo/ HTTP/1.1"
200 3506
193.248.197.213 - - [29/Oct/2003:13:06:27 -0500] "GET /icons/folder.gif
HTTP/1.1" 304 -
193.248.197.213 - - [29/Oct/2003:13:06:28 -0500] "GET /icons/blank.gif
HTTP/1.1" 304 -
193.
r*********s
发帖数: 2157
20
来自主题: TeX版 - 请教图片排版问题
I use the following one, you may have a try:
\usepackage{graphicx}
\usepackage{subfigure}
\begin{figure}[htb]
\centering \mbox{ \subfigure[sub title-1]{\includegraphics[scale=.5]{test1.eps
}}\quad
\subfigure[sub title-2]{\includegraphics[scale=.5]{test2.eps}} }
\caption{caption} \label{Fig:CellDropRates}
\end{figure}
just like
xxxxx yyyy
(a)---(b)
Fig2: title
j***3
发帖数: 142
21
来自主题: Unix版 - 初级awk问题
想把文件里 $1 的 "C" 换成 "8"
awk '$1 sub("C","8")' test.txt>test2.txt
不work,只把一行里的第一个 ‘C“ 换了,而且没有限在 $1 里面。
请问要如何做呢,谢谢了
h*******r
发帖数: 6
22
计算全过程如附图:
http://sites.google.com/site/hoverstar/ca/test2.JPG?attredirects=0
最后公式(9)得到的 l 结果在 x=0 处的值的确应该是 -3 ,就是不知道表达式 l 的
第一项中头两个减号是什么。
c******k
发帖数: 252
23
来自主题: MedicalCareer版 - step 3 pass 216 March 2013
三月底考的,今天才拿到的成绩.很高兴过了(汗一个), 俺的追求是通过就好. 分数没有
达到平均值(221),呵呵. 我在考前看了这里很多的考经,所以现在也把经历分享在这里,
希望能够对以后要考试的人有所帮助.
前人的step3考经写得都很好,其中EMMA和watermelonxu的考经尤其有参考价值, 强烈推
荐. ccs online的interactive cases象EMMA说的要练3-4遍为好. 有喜欢研究细节的和
做过内科OB的study partner一起过一遍UW的case很有帮助.UW有大概41个readout
case, cover了一些interactive cases里面没有的内容.
我的timeline:
1月初买了三个月的ccs和uw bank,之前有看88 cases offline, 其实什么都没有看进去
, 还是买了online的题库以后有些动力. 因为只买了三个月的,得争取在题库过期前考
完.
大概一个月做完了一遍,正确率只有58%. 之后重做错题.
2月底做的CD,正确率73%.
3月初做的NBME test2 online, 430.
3月中旬做... 阅读全帖
z***q
发帖数: 175
24
来自主题: MedicalCareer版 - Done with CK: 260+
CK考试终于尘埃落定。一颗悬了3个星期的心终于可以放下了。写些感受希望能帮助后
来人。
正式复习时间6个月。复习经历:
1.kaplan ck comprehensive video:全看了,推荐ob/gyn和IM
2.usmle consult qbank 71%正确率 (题太偏)
3.kaplan qbank 68%正确率 (题太偏,可以作为后期提高阅读速度)
3.uw qbank 第一遍75%,第二遍90%
4.kaplan notes:看了ob/gyn,ped,surgery,psychology
5.MTB2一遍,MTB3两遍
6.FA只看了ob/gyn
7.uwsim:260 (感觉是最接近真题的模拟)
8.usmle consult sim test:257(有真题的感觉)
9.kaplan sim test1:75% test2:82%(差,不推荐)
10.nbme forms:all online,form 6:260, form 4:257, form 3: 253, form 2
:260
11.cd:92.5%
考试前一天晚上,吸取step1考前彻夜未眠的教训,... 阅读全帖
t*****r
发帖数: 1765
25
我知道hunter college的算法
算GPA
A +/A 4.0
A- 3.7
B+ 3.3
B 3
B- 2.7
C+ 2.3
C 2.0
D 1
单独每门课乘以3,加起来再除以这个学期的总学分
比如如果这个学期4门课 分别是 ABBC 一共是12个学分的话
GPA= (4×3+3×3+3×3+2×3)/12=
你中国的成绩折成ABCD
97.5-100 A+/A
92.5-97.4 A
90-92.4 A-
87.5-89.9 B+
82.5-87.4 B
80-82.4 B-
77.5-79.9 C+
60-69 D
0-59.9 F
hunter 有Nursing Entrance Test,申请nursing program看GPA和Nursing Entrance
Test2个的排名从高到低录取。要CPR和医疗保险加malpractice 保险。
GPA他们会四舍五入 比如如果是2.9几的 就算你3了 就是B了
h***o
发帖数: 539
26
BBS水木清华站∶精华区
发信人: FangQ (骆驼·飞鸟·驴), 信区: MathTools
标 题: Mathematica函数及使用方法——流程控制
发信站: BBS 水木清华站 (Sat Dec 12 11:42:31 1998)
Mathematica函数及使用方法——流程控制
—————————————————————————————————————
十五、流程控制
分支
If[condition, t, f] 如果condition为True,执行t段,否则f段
If[condition, t, f, u] 同上,即非True又非False,则执行u段
Which[test1,block1,test2,block2..] 执行第一为True的testi对应的blocki
Switch[expr,form1,block1,form2,block2..]
执行第一个expr所匹配的
s******r
发帖数: 1524
27
来自主题: Statistics版 - SQL
proc sql;create table test2 as
select * from test
where index(names,", N")>1 or index(names,",N")>1;run;quit;
b********g
发帖数: 1
28
来自主题: Statistics版 - SAS base 87% pass today
At least 50% in base 50 and 123. Many thanks to this board.
Something new or unsure:
1
x='372';
y='234 ';
z='657';
how to get 372-234-657
a. cat('-',x,y,z)
b. catx('-',x,y,z)
c. x!!'-'!!y!!'-'!!z
d.x!!'-'!!left(y)!!'-'!!z
2 _'char'% function
data test;
input name $;
datalines;
Liu
Ellisa
Risa
Loui
;
run;
data test2;
set test;
name2=(_'i'%);
run;
what is the value(s) of name2?
3 where is format saved if not saved permanently?
4. FOUND function;
5 function (trch? not remembered) to cha
l*****k
发帖数: 587
29
来自主题: Statistics版 - sas proc transpose
An issue that must have an elegant and simply solution.
I am trying to use transpose on a dataset, however how do
I specify all the variables?
if the are named col1, col1, etc, it is ok to use: var col1-col99
however what if they have random names, I have been trying to export
the data to excel, copy the header(variable name), then paste it back
to sas like
proc transpose data=original out=out;
var test1 result2 test2 result2........;
run;
is there a way to do this without specifying all
A*******s
发帖数: 3942
30
涉及变量名的改变的基本上是两种思路,一种是用transpose将变量名变成变量然后改
变,一种是用proc sql's dictionary.table读入变量名到macro variables,然后再用
proc sql或者data step改名。lz的这个问题我觉得用proc transpose更简单些。
data test;
a=1;
b=3;
c=6;
d=3;
e=8;
f=9;
run;
proc transpose data=test out=test1;
run;
data test1;
set test1;
_Name_=cats('col_',put(_N_,$10.));
run;
proc transpose data=test1 out=test2(drop=_Name_);
run;
d*******1
发帖数: 854
31
proc sort data=test1; by _name_; run;
data test1;
set test1;
by _name_;
if first._name_ then i++;
_Name_=cats('col_',put(i,$10.));
run;
proc transpose data=test1 out=test2(drop=_Name_);
var col1;
id=_name_;
run;
另外一个问提是所有的numerical都变成char了, 如果原始的变量是 numerical和char
的混合的话, hehe
p*****o
发帖数: 543
32
我是先给ARRAY TEST1赋值的
ARRAY TEST1{*} VAR1--VAR100;
然后我想定义两个新的ARRAY,并且他们的DIMENSION跟TEST1一样,请问该怎么定义?(
当然假设我并不知道TEST1的维数是100)。
我想是类似这样的,ARRARY TEST2{DIM(TEST1)}
请问有办法么?
j*****7
发帖数: 4348
33
DIM function.
n2 = dim(test1);
array test2{n2} .......
s******r
发帖数: 1524
34
data test;
set test;
idx=_n_;run;
proc sql;
create table test2 as
select a.* from test a inner join
(select var1, min(idx) as min_idx, max(idx) as max_idx
from test where var2 >''
group by var1) b
on a.var1=b.var1 and a.idx between min_idx and max_idx;quit;run;
s******r
发帖数: 1524
35
not sure what you want to do; check for each variable or check all variables
at the same time. I seldom use array, if you want to use array, you got to
use data step.
%macro Test;
data test;
set test;
idx=_n_;run;
proc sql;
create table test2 as
select a.* from test a inner join
(select var1, min(idx) as min_idx, max(idx) as max_idx
from test where
var2 >''
%do i = 2 %to 200;
and/or var&i >''
%end;
group by var1) b
on a.var1=b.var1 and a.idx between min_idx and max_idx;quit;run;
%do i = 1 %to
g*********n
发帖数: 441
36
可能是格式的问题或者数据的POSITION 的问题,你查一下TEST2 里包含哪些变量,然
后再调整吧。
R*********i
发帖数: 7643
37
来自主题: Statistics版 - 菜鸟问题 (R & SAS)
A not-so-straightforward but working solution in SAS:
data test;
mystr='abcdef ghijklnopaijeiajig aeioajgeojgajipa aweg rrr eagaggeagg
awgae gawegwgaaag aewh aawgah';
newstr=compress(mystr);
l=length(newstr);
output;
run;
proc sql;
select left(put(ceil(l/10),4.)) into :len from test;
quit;
data test2;
length newvar1 - newvar&len $10;
set test;
array newvar [*] $ newvar1 - newvar&len;
do i=1 to dim(newvar);
newvar[i]=substr(newstr,1+10*(i-1),10);
end;
drop i newstr;
run... 阅读全帖
a*****3
发帖数: 601
38
data test2 ;
input @1 q1 date9. ;
format q1 yymmdd10. ;
datalines;
12NOV1993
;
run;
还有个问题,没看完你就删了?
A*******s
发帖数: 3942
39
my idea is:
go through the data set one row by one row{
1) output current row if it is not matched
2) if the current row (and the previous rows) seem to match (part of) the
pattern, then stop outputting.
3) if the current row doesn't match but the previous do, go back to output
the previous and the current rows.
}
Codes:
data test;
obs=_N_;
input char $3.;
cards;
2
3
4
1
2
5
8
_
1
2
3
3
5
3
+
4
3
1
2
1
f
g
2
_
1
2
3
1
f
g
e
d
u
_
1
2
3
h
;
%let pattern=_123;
data test2;
retain n_... 阅读全帖
d*******r
发帖数: 71
40
来自主题: Statistics版 - sas proc report的问题。
Just make another variable eq to id, please look
data test1;
input id x y;
datalines;
1 1 5
1 1 2
1 1 3
1 2 8
1 2 7
1 2 10
1 2 4
;
run;
data test1;
set test1;
xc=x;
run;
data proc sort data=test1;
by id x xc;
run;
proc report data=test1 out=test2;
column x id xc y;
define x/order noprint;
define id/ order;
define xc/order;
define y/ display;
run;
首页 上页 1 2 3 4 5 下页 末页 (共5页)