由买买提看人间百态

topics

全部话题 - 话题: fname
1 2 下页 末页 (共2页)
g*****d
发帖数: 526
1
data _null_;
fname="tempfile";
rc=filename(fname,"filename");
if rc = 0 and fexist(fname) then
rc=fdelete(fname);
rc=filename(fname);
run;
j*****7
发帖数: 4348
2
来自主题: Statistics版 - SAS大牛给咨询一下
我的这段小code(把目录下所有的log文件集中起来), 在 Windows下运行没问题, 在
UNIX下就不行了。
filename getdir pipe "dir/b &dirname.*.log";
* Determine total number of LOG files to be processed;
data dirlist;
infile getdir length=len;
length fname $200;
input @;
input @1 fname $varying200. len;
fname=upcase(fname);
if substr(upcase(fname),1,1) in (&fprefix);
run;
是不是这个dir/b 在UNIX下不好使啊?
谢谢了。

is value= correct? the webpage dose not display the string stored
in $fname. Thanks!
s*****r
发帖数: 59
3
来自主题: BuildingWeb版 - passing paremetor in html code
can some PHP guru take a look at following code:

size="30" maxlength="50" id="fname2">
g*******t
发帖数: 124
4
来自主题: Statistics版 - 再问一个sas base里的问题。
Which INPUT statement reads the values for Lname, Fname, Department and
Salary (in that order)?
1---+----10---+----20---
ABRAMS THOMAS
SALES $25,209.03
BARCLAY ROBERT
MARKETING $29,180.36
COURTNEY MARK
PUBLICATIONS $24,006.16
a. input #1 Lname $ Fname $ /
Department $12. Salary comma10.;
b. input #1 Lname $ Fname $ /
Department : $12. Salary : comma.;
c. input #1 Lname $ Fname $
#2 Department : $12. Salary : comma.;
d. both b and c
答案是d,
说明:
j******g
发帖数: 197
5
来自主题: Statistics版 - 请教两个 excel 问题
not 码农。just have too much free time on my hand...
第一个问题:
附注:
1. 在DEF文件里,打开sheet1, B1 是 要选择的文件名; C1 是 所选文件的路径
2. ABC 和 DEF 文件不需要在同一个文件夹里
3. DEF文件,因为要加入VBA,所以要另存为xlsm
4. 数据源的文件ABC等,不能先打开
打开DEF文件, Hit "Alt+F11", 建个module,Paste the following code:
Sub Mitbbs_Move_Data_Q1()
Workbooks.Open Filename:=Cells(1, 3).Value
Sheets(1).Select
Range(Cells(2, 2), Cells(200, 2)).Select
Selection.Copy
Workbooks("DEF.xlsm").Activate
Sheets(1).Select
Range("B2").Select
ActiveSheet.Paste
End Sub
只打开 DEF.xslm, run thi... 阅读全帖
o*******p
发帖数: 722
6
in C++:
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef vector> wcs;
bool myfakeless(pair a, pair b)
{
return (a.second>b.second);
}
wcs findkfwords(const char* fname, int k)
{
wcs results;
ifstream fs(fname);
if (k<1)
{
cerr << "bad k" < return resu... 阅读全帖
s*****n
发帖数: 839
7
来自主题: CS版 - Python: index out of rang error
我的程序目的是把一个文件夹里面所有的csv file(4 columns each with same
variables)合并成一个文件。 总是得到IndexError: list index out of range
下面是我的程序:
import csv
import os
##this path is the location where raw data are stored
path = "C:/Users/Project/Python code/practice1/csv"
dirList=os.listdir(path)
##this fname is the output file name
fname = "C:/Users/Project/Python code/practice1/Combined file/combined.csv"
nfile = open(fname,'wb')
writer = csv.writer(nfile)
start = 0
for fn in dirList:
##this fullfn is the path for ... 阅读全帖
s*****n
发帖数: 839
8
来自主题: CS版 - Python: index out of rang error
我改好了,现在正常了。 贴出来分享:
import csv
import os
##this path is the location where raw data are stored
path = "C:/Users/Documents/Project/Python code/practice1/csv"
dirList=os.listdir(path)
##this fname is the output file name
fname = "C:/Users/Documents/Project/Python code/practice1/Combined file/
combined.csv"
nfile = open(fname,'w', newline='')
writer = csv.writer(nfile)
start = 0
for fn in dirList:
##this fullfn is the path for raw data plus file name
fullfn = "C:/Users/Documents/Project/Pyth... 阅读全帖
d**a
发帖数: 75
9
in the definition of table e1, fname is of type
character(10).
so if i ran the following sql, what i got:
SQL> select '++'||fname||'++' from e1;
'++'||FNAME||'
K*****n
发帖数: 23
10
character (len=100) :: fname, fmtstr= '(A,I??,A)'
integer :: ndig
do i = 1, 1460
ndig = int(log(dble(i)))+1
write(fmtstr(5:6),'(I2)') ndig
!
write(fname, fmtstr) 'xx',i, 'xxx'
!
open(10, file=fname,action='read')
....
close(10)
enddo
在 moontrees (moonovertrees) 的大作中提到: 】
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
来自主题: Computation版 - 关于文件输出,请教大家?
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
来自主题: Statistics版 - [合集] 问一个sas的问题2
☆─────────────────────────────────────☆
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
来自主题: Statistics版 - SAS base 70 题第29 和 31题
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
来自主题: Statistics版 - sas base123 question 20 一问
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... 阅读全帖
B******e
发帖数: 16928
16
来自主题: Military版 - 能老师说高考太容易了
https://www.umsalary.info/index.php?FName=Uday&LName=Rajan&Year=0
University of Michigan, Full Professor in Finance,一年过300K
https://www.umsalary.info/index.php?FName=Toni&LName=Whited&Year=0
University of Michigan, Full Professor in Finance,一年过400K
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
来自主题: JobHunting版 - 那位大牛做过这道题
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
来自主题: JobHunting版 - Linkedin 电面 面经x2
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... 阅读全帖
G*******n
发帖数: 6889
q****x
发帖数: 7404
22
来自主题: Apple版 - Obj C multi-parameter method
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
来自主题: BuildingWeb版 - help about sql connection with ASP
我想用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
来自主题: Database版 - Question on relational calculus
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
来自主题: Database版 - help: question on oracle sys_context()
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 ......
j**f
发帖数: 28
28
来自主题: Programming版 - 求助: Cygwin GCC g77编译.f文件出错
The two functions are not implemented in g77/gfortran
the detail of the function can be found here
http://docs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/p_man/cat3/f90/JIAND.z
http://docs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/p_man/cat3/f90/JISHIFT.z
Most likely you can just use IAND and ISHIFT to substitute them.
The two were implemented in ifort, so you can try to see if the substitution
change results. I don't kno
d********g
发帖数: 10550
29
来自主题: Programming版 - 看C码工写Python真是捉急
下面这个捉急的片段,看有多少是用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
来自主题: Programming版 - Cassandra returns null row keys?
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)
l******t
发帖数: 108
h****9
发帖数: 26
33
C IS right.
the last 'by fname' should be'by descending fname'
A*******s
发帖数: 3942
34
来自主题: Statistics版 - [Help] Dividing a SAS data set
用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
来自主题: Statistics版 - SAS MACRO question (包子求教重金酬谢)
%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
R*****s
发帖数: 41236
38
Geoff Roes, 2010年WS100冠军, 这张图就是那年的冠亚季军, 从左到右。
http://ultrasignup.com/results_participant.aspx?fname=Geoff&lna
我上次跑JJ100, 那个冠军Hal Koerner也是两次2007/2009 WS100冠军。
http://ultrasignup.com/results_participant.aspx?fname=Hal&lname
l*y
发帖数: 21010
39
来自主题: _girlgroup版 - wangdachui
~/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
来自主题: _girlgroup版 - wangdachui
~/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";
}
}
B******e
发帖数: 16928
41
来自主题: Military版 - 能老师说高考太容易了
我对理工专业的收入不清楚,不过我贴得已经很清楚,business school faculty full
professor research active的300K以上是正常,这基本属于常识。你说说我的link有
什么问题
再来一个:
https://www.umsalary.info/index.php?FName=Joel+&LName=Slemrod&Year=0
这个是Econ系的full professor,一年400K+
i**y
发帖数: 2557
42
来自主题: ebiz版 - 这个网站挺有意思
收藏了,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
m******c
发帖数: 830
t*******e
发帖数: 207
v*******a
发帖数: 759
45
来自主题: GiftCard版 - PTF+ with $25 walmart
https://secure.trade-interactive.com/cgi-bin/passport_to_fun/index.mp?s=
160798&r=aaa&m=4tsdgpsnv7c&c=90225&p=1&config=2147&email=weiweifancn%
40hotmail%2ecom&email=weiweifancn%40hotmail%2ecom&fname=&lname=&address=&
address2=&city=&state=&zip=&country=&gender=&phone=&dob=&
again, not a referral
v*******a
发帖数: 759
46
来自主题: GiftCard版 - AHR+ with $25 sears
https://secure.trade-interactive.com/cgi-bin/at_home_rewards/index.mp?s=
160799&r=aaa&m=4tsdgtenv94&c=90226&p=1&config=2147&email=weiweifancn%
40hotmail%2ecom&email=weiweifancn%40hotmail%2ecom&fname=&lname=&address=&
address2=&city=&state=&zip=&country=&gender=&phone=&dob=&
w****o
发帖数: 367
47
来自主题: Investment版 - 大家看看这个是不是骗子? (转载)
【 以下文字转载自 Money 讨论区 】
发信人: wookao (六味地黄丸), 信区: Money
标 题: 大家看看这个是不是骗子?
发信站: BBS 未名空间站 (Mon May 18 15:49:06 2009)
在ebay看到一个链接:
https://www.microplace.com/
就是收集小额贷款,发给第三世界贫穷国家,小额贷款对working poor来说可以扩大再
生产,帮助他们脱贫。
我就注册了一个账户,然后通过paypal投资了50块,回报是1~6不等,根据你的投资长
短,和地区不同。
今天受到他们的一个电话说,要我的Photo ID,说是我们本周的法律,为了防止ID
Theft,要SSN,Date of Birth and Photo ID.
我在FINRA上查到他们的公司的信息如下:
http://brokercheck.finra.org/Search/SearchResults.aspx?SearchGroup=Firm&SearchType=FreeForm&SearchText=microplace&FName=&MName=&LName
w********r
发帖数: 8704
48
来自主题: Living版 - 老外多少喜欢叫initials的?
看你不相信的样子,好吧,不好透露真实的姓,偶就找了找类似的名字,but you got
the idea。
http://www.linkedin.com/search/fpsearch?fname=Jb&lname=Smith&ke
g*******g
发帖数: 447
49
来自主题: Returnee版 - 还是说说收入吧
刚刚去purdue大学,随机找了个副教授Hong Tan,我声明我以前没有听说过
这个人,2008-09年9个月工资大概10.5万,加3个月暑假您算算吧,每年
加3%-5%,现在人家工资是多少?而且purdue的副教授大部分是没有tenure的。
http://php.jconline.com/salaries/purdue/?searching=y&fname=hong
c******g
发帖数: 19294
1 2 下页 末页 (共2页)