c**h 发帖数: 4 | 11 The XML data schema looks like this:
XYZ
MNO
...
I try to use DSO to read one record at one time and display
the data in an HTML table. But since and
are grandchild items, I can't find a way to use to
only get one record. If I add #xmldso in the , I
will get all the data not just one.
Could you let me know how to display these grandchild or
even grand-grand c |
h***o 发帖数: 539 | 12 character*3 fname, lab
fname = 'out'
do 10 i = 1, 100
write(lab,'(i3.3)') i
open(unit=7, file=fname//lab, .....)
.....
....
write(7, *) ....
10 continue
output files are out001, out002, ...., out099, out100 |
|
o******6 发帖数: 538 | 13 ☆─────────────────────────────────────☆
gutenacht (嗯) 于 (Wed Mar 11 19:35:21 2009) 提到:
The following SAS program is submitted:
proc sort data=work.employee;
by descending fname;
proc sort data=work.salary;
by descending fname;
data work.empdata;
merge work.employee
work.salary;
by fname;
run;
Which one of the following statements explains why the program failed execut
ion?
A. The SORT procedures contain invalid syntax.
B. The merged data sets are not permanent SAS data sets.
C. The data set |
|
x***1 发帖数: 22 | 14 31:
Item 31 of 70 Mark item for review
Given the following raw data records in DATAFILE.TXT:
----|----10---|----20---|----30
Kim,Basketball,Golf,Tennis
Bill,Football
Tracy,Soccer,Track
The following program is submitted:
data WORK.SPORTS_INFO;
length Fname Sport1-Sport3 $ 10;
infile 'DATAFILE.TXT' dlm=',';
input Fname $ Sport1 $ Sport2 $ Sport3 $;
run;
proc print data=WORK.SPORTS_INFO;
run;
答案: C.
Obs Fname Sport1 Sport2 Sport3
1 Kim B... 阅读全帖 |
|
y**x 发帖数: 117 | 15 QUESTION 20
The following SAS program is submitted:
proc sort data=work.employee;
by descending fname;
proc sort sort data=work.salary;
by descending fname;
data work.empdata;
merge work.employee
work.salary;
by fname;
run;
Which one of the following statements explains why the program failed
execution?
A. The SORT procedures contain invalid syntax.
B. The merged data sets are not permanent SAS data sets.
C. The data sets were not merged in the order by which they were sorted.
D. The RUN stateme... 阅读全帖 |
|
|
S********t 发帖数: 4402 | 17 你又不给他账号。
下面是我们公司的sample.你可以拿过去用:
To Whom It May Concern,
This is to confirm with FedEx that D**** LLC, the shipper, waive our
rights to pursue the claim of a package (tracking number: 9222881100*****)
shipped by FedEx. In addition, we authorize FedEx to resolve the claim with
fName lName as the claimant. fName lName’s address is ******.
If you have any further questions, please don’t hesitate to contact us at
603-***-****.
Thanks a lot for your assistance!
Sincerely, |
|
f**********t 发帖数: 1001 | 18 class CompanyDB:
def __init__(self, fname):
self.industries = defaultdict(set)
self.companies = defaultdict(set)
fp = open(fname);
for line in fp.readlines:
items = line.split('|')
if len(items) < 3:
continue
if items[0] == "industry":
self.industries[items[2].strip()].add(items[1].strip())
elif items[0] == "company":
self.companies[items[2].strip()].add(items[1].st... 阅读全帖 |
|
f**********t 发帖数: 1001 | 19 class FileIter {
ifstream _fin;
static const size_t kBufLen = 1024;
char _buf[kBufLen];
public:
FileIter(const char *fname) {
_fin.open(fname);
}
bool hasNext() {
return !_fin.eof();
}
string next() {
_fin.getline(_buf, kBufLen);
return string(_buf, _buf + _fin.gcount());
}
};
void FileIterTest() {
FileIter fi("iter.cpp");
while (fi.hasNext()) {
cout << fi.next() << endl;
}
} |
|
b*******y 发帖数: 35 | 20 我多年不用Java了,不太灵光了。对熟悉的牛们,应该不难。
Suppose that your boss walks in one day and drops the following code on your
desk. Your
asked to spend an hour or two and improve the quality of the code. What
would you suggest
to improve this? Each suggested improvement, comment, or observation can get
you extra
credit. If you have any questions, please make note of them as part of your
feedback!
Creativity is a plus.
Don't write any code! Just put your commentary inline, kind of a stream-of-
concisousness
approac... 阅读全帖 |
|
|
q****x 发帖数: 7404 | 22 C++:
void foo(const char* fname, const char* mname, const char* lname);
Obj C
- (void)first:(NSString *)fname second:(NSString *)mname third:(NSString )
lname;
So the function name and the 1st parameter name are identical? This really
looks weird. What's the rationale behind this design? It's count-intuitive
that changing the 1st parameter name means changing the function name. |
|
p******e 发帖数: 31 | 23 我想用ASP添加数据库record时,总是报错。
请问是怎么回事? 谢谢!
我的数据库并没有设为只读啊。
程序如下:
<%
dim db
dim strCon
db="access"
strCon="DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=c:/Inetpub/wwwroot/name/name.mdb"
set db=Server.CreateObject("ADODB.Connection")
db.open strCon
%>
set res=Server.CreateObject("ADODB.Recordset")
res.Open "select * from
user",strCon,adOpenKeyset,adLockOptimistic
res.AddNew
res("pass")=pass
res("fname")=fname
res("lname")=lname
if city<>"" then
res("city")=city
....... |
|
h*****l 发帖数: 184 | 24 我用ASP处理ACCESS数据库。
但运行INSERT时,出来错:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use
an updateable query.
百思不得其解, 请帮我看看, 错误出在SQLInsert那句上:
Set corConn = Server.CreateObject("ADODB.Connection")
dbpath = Server.mappath("fpdb\mbaalumni.mdb")
corConn.open "driver={Microsoft Access Driver (*.mdb)}; dbq=
"&dbpath&""
RS = Server.CreateObject("ADODB.Recordset")
SQLSel = "Select * from mbaalumni Where fname = '"&
Request.Form("fname") |
|
p*****e 发帖数: 58 | 25 if you want to get all employees who work on ANY project
that john smith works on then the SQL is:
select e.ess, e.fname, e.lname, wk.projectno, wk.hours
from employee e
inner join works wk on e.ess = wk.essn
inner join
(select distinct w.projectno
from works w inner join employee ref on ref.ess=w.essn
where ref.lname='Smith' and ref.fname='John')
p
on p.projectno = wk.projectno |
|
d**a 发帖数: 75 | 26 I had a table and I want to retrieve those rows whose fname
is the same as the user name of the login user. the
following is what i ran in sql+
SQL> select * from e1;
UNAME FNAME LNAME ADDR |
|
a********d 发帖数: 491 | 27 if you want run your 10 programs in Unix, then write a simple shell scripts:
batch.ksh
#!/usr/bin/ksh
for fname in `ls *.c`
do
gcc $fname.c
done
then you can just run batch.ksh in background:
nohup ./batch.ksh &
baozi please ...... |
|
|
d********g 发帖数: 10550 | 29 下面这个捉急的片段,看有多少是用C风格/思路来写Python的,另外还有无法忍受的错
误/不推荐做法:
def strip_non_ascii(self, string):
''' Returns the string without non ASCII characters'''
s = ""
nonascii = 0
for c in string:
if ord(c) < 128:
s += c
else:
nonascii = 1
return (s, nonascii)
for fname in files:
(file, nonascii) = self.strip_non_ascii(fname)
if file == 'something':
continue
if nonascii == 1:
filepath = path + '/' + file + '*'
else:
... 阅读全帖 |
|
h**j 发帖数: 2033 | 30 cqlsh:testks> show version
[cqlsh 4.1.1 | Cassandra 2.0.6 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
用了helenus和astyanax都一样,row key都是null,都指定了target version 1.2 和
CQL3.
[ ,
]
key作为一个column返回,by design? |
|
S*A 发帖数: 7142 | 31 哈,我就是好奇,C 可以多快。
这里用一个 python script 生成用来测试的数据
a.txt 4000行。
b.txt 100000行。
每行都是 30 byte 的随即大写 A-Z。
import difflib
import random
import string
def gen_table(fname, size):
f = open(fname, 'w')
for j in range(size):
print >>f, ''.join(random.choice(string.ascii_uppercase) for i in
range(30))
gen_table('a.txt', 4000)
gen_table('b.txt', 100000) |
|
|
h****9 发帖数: 26 | 33 C IS right.
the last 'by fname' should be'by descending fname' |
|
A*******s 发帖数: 3942 | 34 用macro吧,要不也可以用file statement with filevar option,更麻烦点.
%macro abc;
%let fname=result;
%do i=1 %to 1000;
data &fname&i;
set result(firstobs=%eval((&i-1)*1599+1) obs=%eval(&i*1599));
run;
%end;
%mend;
%abc |
|
c**d 发帖数: 104 | 35 Suppose you have a lot of excel files under H:\Temp
/* get excel names */
filename myxls 'dir "H:\Temp" /b' LRECL=5000;
data myfile;
infile myxls length = len;
input fname $200. len;
run;
/* save each into a macro variable */
proc sql;
select fname into :a1 - :a9999
/* do loop to input excel */ |
|
h********o 发帖数: 103 | 36 DATA TEST;
INFILE CARDS DLM = ",";
INPUT FNAME $ LNAME $ BIRTH $ 23-30 PHONE $ 31-40;
CARDS;
SMITH ,BOB 01/03/668845333883
JACKSON ,ANDREW 03/09/779917736612
ALICE ,KIM 02/24/542243226673
;
PROC PRINT DATA = TEST NOOBS;
RUN;
===========================================================
FNAME LNAME BIRTH PHONE
SMITH BOB 01/03/66 8845333883
JACKSON ANDREW 03/09/77 9917736612
... 阅读全帖 |
|
s******y 发帖数: 352 | 37 %let dirpath=d:;
filename csvfile pipe "dir /b &dirpath.\*.csv";
data allcsv;
infile csvfile lrecl=1000;
input;
fname=catx('',"&dirpath.",_infile_);
infile dummy filevar=fname filename=myfile end=done firstobs=4
dsd truncover;
do while(not done);
input date :date9. Tier :$50. Ccy :$50.
Doc :$50. Sd1y :percent. Sd2y :percent.;
output;
end;
put 'Done with ' myfile=;
run;
external |
|
|
l*y 发帖数: 21010 | 39 ~/perl$ cat convertArticleToJson.pl
#!/usr/bin/perl
my $fname = shift;
open (my $fh, '<', $fname) or die $!;
while(my $line = <$fh>) {
chomp $line;
if ($line =~ /\S/) {
print "'$line',\n";
}
} |
|
l*y 发帖数: 21010 | 40 ~/perl$ cat convertArticleToJson.pl
#!/usr/bin/perl
my $fname = shift;
open (my $fh, '<', $fname) or die $!;
while(my $line = <$fh>) {
chomp $line;
if ($line =~ /\S/) {
print "'$line',\n";
}
} |
|
|
i**y 发帖数: 2557 | 42 收藏了,hehe
TYPE=people&DB=WP&FNAME=Nicholas&LNAME=Smith&CITY=&STATE=AZ&KEY=1295150625
430371198.71.198.206.65&COUNT=9&PRCOUNT=9999&REC=6 |
|
|
|
|
|
|
|
|
|