由买买提看人间百态

topics

全部话题 - 话题: filenames
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
h******b
发帖数: 6055
1
来自主题: Programming版 - 十个包子求助:NodeJS多线程?
var directory = require('fs');
function processFile(filename) {
// dependencies
var fs = require('fs');
var zlib = require('zlib');
var csv = require('csv');
// filenames
var sourceFileName = filename;
mainFileName = 'main_' + filename;
// streams
var reader = fs.createReadStream(__dirname + '/original/' + sourceFileName),
writer = fs.createWriteStream(__dirname + '/transformed/' + mainFileName),
gunzip = zlib.createGunzip(),
gzip = zlib.createGzip();
//Main File
csv()
.from.stream(reader.pipe(g... 阅读全帖
j*****o
发帖数: 320
2
which filename
whereis filename
locate filename
find / -name filename -print
m*****e
发帖数: 4193
3

"dirname $filename" returns the pathname
"basename $pathname" returns the last pathname
input: FILENAME
PATHNAME=`dirname $FILENAME`
BASEDIR=`basename $PATHNAME`
echo "${FILENAME}_${BASEDIR}"
m**c
发帖数: 90
4
来自主题: Unix版 - Help: convert // to /* */ in C code?

Try to see if "sed" can help:
sed -i'.bak' -e 's/^\([^\/]*\)\/\{2,\}\(.*\)$/\1\/*\2*\//g'filename.c
Above command will repalce "//..." to "/*...*/" in filename.c (and make a
backup of "filename.c" named "filename.c.bak").
To replace all files, use "find" and "sed" together:
find -iname '*.c' -print0 | xargs -0 sed -i'.bak' -e
's/^\([^\/]*\)\/\{2,\}\(.*\)$/\1\/*\2*\//g'
t**c
发帖数: 97
5
来自主题: Unix版 - my script Re: how would you do this?
If the directory list need to be printed, I think it's better to use a hash
table %counter to count the number of times the filename appears:
####################################################################
my (%counter,%detail,@dirlist,$filename,$curdir);
# put all files in the hashes according to their filenames
push @dirlist,$dirname;
while(defined($curdir=pop(@dirlist))){
opendir(DIR, $curdir) or die "cannot open $curdir $!\n";
while (defined ($filename = readdir(DIR)))
{
if
s**********t
发帖数: 680
6
申绿卡急用Paper求助!双黄包答谢!
各位兄弟姐妹如有CNKI或万方的权限请帮我下载!
我的Email是 [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
谢谢!
1.
影响阻塞性黄疸预后的多因素分析
来 源: 肝胆胰外科杂志 1997年03期
CNKI链接:http://lib.cnki.net/c... 阅读全帖
c*u
发帖数: 22
7
来自主题: JobHunting版 - 问一道题
这样可以么? list 保存每一轮数值并用变量记下该轮最大值:
从上往下
string filename = "data.txt";
if (File.Exists(filename))
{
string line;
List list = new List();
StreamReader sr = File.OpenText(filename);
int max = 0;
while ((line = sr.ReadLine()) != null)
{
int[] array = line.Trim().Split(' ').Select(n => int.Parse(n)).ToArray<
int>();
int size = array.Count();
if (size ==1)
{
list.Add( array[0]);
max = list[0];
}
else if (size>1)
{
int next=0, val = 0;
... 阅读全帖
c*u
发帖数: 22
8
来自主题: JobHunting版 - 问一道题
string filename = "data.txt";
if (File.Exists(filename))
{
int depth = 100;
int[,] arr = new int[depth,depth];
StreamReader sr = File.OpenText(filename);
int loop = 0;
while ((line = sr.ReadLine()) != null)
{
int[] array = line.Trim().Split(' ').Select(n => int.Parse(n)).
ToArray();
for(int i=0;i arr[loop, i] = array[i];

Console.WriteLine(line);
loop++;
}
sr.Close();
//从最底下两层开始
for ... 阅读全帖
m**********r
发帖数: 2099
9
来自主题: SanFrancisco版 - 【有包子】问个DOS文件的问题 (转载)
你好!
All versions:
find /c "ERROR" [filename].BAT | [output filename]
>winME:
findstr "ERROR" [filename].BAT
l***a
发帖数: 12410
c*****s
发帖数: 180
11
来自主题: WaterWorld版 - PURE WATER DO NOT NETER PLEASE
1.
Which of the following statements associates the fileref OnSale with the
raw data files London.dat, Paris.dat, and Zurich.dat? The files are stored
in the C:\Routes\New directory in the Windows operating environment.
a.
filename onsale (c:\routes\new\london.dat,
c:\routes\new\paris.dat,
c:\routes\new\zurich.dat);
b.
filename onsale 'c:\routes\new\london.dat'
'c:\routes\new\paris.dat'
'c:\routes\new\zurich.dat';
c.
filename onsale ('c:\routes\new\london.dat'
'c:
d****e
发帖数: 251
12
来自主题: Apple版 - rar.001, rar.002, ...怎么解压?
如果原来的文件是用split个分割的,直接terminal下用cat就可以了:
cat filename.rar.* > filename.rar
然后用unrar e filename.rar
不知道这个split&cat是不是就是个加了个图形界面而已。
a***y
发帖数: 19743
13
☆─────────────────────────────────────☆
rodney (||) 于 (Sat Aug 21 20:43:37 2010, 美东) 提到:
问问。。。
☆─────────────────────────────────────☆
jaff1973 (jaff) 于 (Sat Aug 21 20:45:13 2010, 美东) 提到:
把.001, .002去掉。。。

☆─────────────────────────────────────☆
rodney (||) 于 (Sat Aug 21 20:58:14 2010, 美东) 提到:
那剩下的部分重名了。
在windows下用winrar打开rar.001,提示错误是unexpected end of archive。
在mac下用betterzip打开rar.001,看不到内容。
☆─────────────────────────────────────☆
Adriano (Leite Ribeiro @ Flamengo) 于 (Sat Aug... 阅读全帖
a****1
发帖数: 61
14
no problem when you use:
char * fileName="abcdefg";
int L = strlen(fileName);
LinearSuffixSort(fileName,L);
At least I have just tested it on vc++2005.net
g****e
发帖数: 141
15
当然可以,但是我不记得具体细节
基本原理就是,先运行一个命令生成文件列表 filelist = `ls /Path_in`
然后对每一个文件循环执行 test.pl
for [filename in filelist]
perl test.pl filename filename+'out'
我的语法肯定不对,n久没用过了,你得自己查shell编程手册
w****y
发帖数: 1
16
来自主题: Database版 - about installation of oracle9i
Hope this works for you:
Directions to extract the files
1. Run "gunzip " on all the files. Eg. lnx_920_disk1.cpio.gz
2. Extract the cpio archives with the command "cpio -idmv < "
Eg. cpio -idmv
Important Note: Some browsers will uncompress the files but leave the
extension the same (gz) when downloading. If the above steps do not work for
you, try skipping step 1 and go directly to step 2 without changing the
filename. Eg. "cpio -idmv
k**g
发帖数: 1558
17
我每天要bulk upload一个csv的文件,这个csv的 文件名有每天的日期,我用了下面的
语句,但是 出错,大家帮我一下吧?谢谢!
DECLARE @FileName VARCHAR(100)
SET @FileName='c:\DAILY_'+( CONVERT(VARCHAR(8),GETDATE(),112)+'.csv')
BULK INSERT DAILY
FROM @FileDate
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ';',
ROWTERMINATOR = '\n'
)
Go
错误信息是:
Incorrect syntax near '@FileName'.
Msg 319, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'with'. If this statement is a common
table expression or an xmlnamespaces clause, the previous statement must be
te... 阅读全帖
i*****1
发帖数: 7
18
Da xia,
My applications has different packages, and I want a different property file
in each package. How can I read/write some files located at the same directory
of the class file?
I can use:
InputStream in = this.getResource("filename").openStream();
To get the file content sucessfully.
But how can I change the file content? I tried
FileOutputStream out = new FileOutputStream(this.getResource("filename").
toString());
this.getResource("filename").toString() return a String like file:C://...
z****n
发帖数: 28
19
来自主题: Java版 - how to open pipe files in java
Sorry for this question, but I do appreciate your answer if you can tell me on
this board or to my mailbox.
Under unix
cat filename | ./run
Inside run script, there is the Java file that takes filename as the input. So
how does Java read the filename in the java code?
y****i
发帖数: 12114
20
来自主题: Java版 - 编程新人求助—死循环了
步骤:
1、用户输入文件名和路径;
2、程序检查是否已有该文件存在,
2 .1、如果存在,要求用户输入新文件名和路径,回到2;
2.2 、如果新文件名不存在,则生成该文件,运行下一段程序。
我的代码如下。我知道按照我的代码,只要输入新文件名,那个新文件立刻就存在了,
然后就又得输入新文件名,然后文件又存在了,进入死循环了。
该怎么写才能实现上述步骤?
谢谢指点。
Scanner keyboard=new Scanner(System.in);

//get file name
System.out.println("Please enter file name:");
String fileName=keyboard.nextLine();
//get file path
System.out.println("Please enter path:");
String filePath=keyboard.nextLine();
//creat... 阅读全帖
b***i
发帖数: 3043
21
来自主题: Java版 - java web start的奇异问题
我用java webstart作客户端的RIA。假定我这个程序叫good.jar。我用动态网站
servlet http ://dynamics.com/serve?filename=good.jar&folder=root&user =guest
问题是,我用jnlp这个文件放codebase,放jar, java webstart有的时候会把?
version-id=1.0放进链接,就出了问题,变成两个问号
http ://dynamics.com/serve?filename=good.jar?version=1.0&folder=root& user=
guest
有的时候又把pack.gz(压缩)放进去。放的时候,会把pack.gz放第一个问号前面
http ://dynamics.com/serve.pack.gz?filename=good.jar?version-id=1.0&folder =
root&user=guest
我现在可以用servlet直接读取servletPath,用
http: //dynamics.com/serve/good.jar.pack.g... 阅读全帖
J*******3
发帖数: 1651
22
Do you mean using ^C to stop monitoring is good?
But when I run several programs like them and use
grep 'Total='h2o.*.out< filename.out
I could not find filename.out , not mention to open it up.
It is supposed that all data stored in filename.out.
y****i
发帖数: 156
23
【 以下文字转载自 JobHunting 讨论区,原文如下 】
发信人: yunhai (飞纵千里山), 信区: JobHunting
标 题: Re: [转载] 这样读多个文件对吗?
发信站: Unknown Space - 未名空间 (Tue Apr 12 19:52:30 2005) WWW-POST
// Your first question
ifstream in;
char filename[2][] = {"a.txt", "b.txt"};
in.open(filename[0], ios::in);
while(in) {
// read
}
in.close();
in.open(filename[1], ios::in);
while(in) {
// read
}
in.close();
// second
ifstream in;
in.open ("a.txt", ios::in);
int size = 0;
char line[80];
while (in) {
// read one line
in >> line;
b*********n
发帖数: 1258
24
来自主题: Programming版 - 问一个C++函数Parameter的问题
这几句是我刚才写的,修改了一下
char* fileName="abcdefg";
int len=strlen(fileName);
LinearSuffixSort(fileName,len);
还是不行,VC 6下,compile通过(no error),build的时候
=======================
error LNK2001: unresolved external symbol "int * __cdecl LinearSuffixSort(ch
ar * &,int &)" (?LinearSuffixSort@@YAPAHAAPADAAH@Z)
fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
=======================
谢谢

the
r*******e
发帖数: 114
25
我在分析一个网页时要找出某个字段,但是有的是结尾的,有的是以结尾
的,我写了下面的语句,两个re.search各自都能找,
但是nested if就只能找第一个了。请问各位python高手,是我的nested if用错了,还是
re.search用错了?
data = open("d:\cgi2.html").read()
pattern=re.search(r'(.*?)<.*?/a>',data)
if pattern:
filename=pattern.group(1)
else:
filename='999'
W*W
发帖数: 293
26
我现在用 Analyze 带的AVW library编一些图像处理的程序,里面基本是C写的程序,
有不同的功能可以调用,刚刚上手遇到很多问题。 比如不知道如何用里面一个函数打
开一个图像文件:
#include
#include "AVW.h" 这是函数库的head file
#include "AVW_ImageFile.h"
int main()
{
AVW_ImageFile *filename;
AVW_Image *image;
filename = AVW_OpenImageFile("C:/program files/avw/test.jpg", "r");
image = AVW_ReadImageFile(filename,NULL);
AVW_ShowImage(image);
system("pause");
return 0;
}
我用的是 VC++ 2008 express, 在project里面添加了AVW的library和link文件, 编
译和链接都没有问题, 但运行的时候就是读不出图,提示的war
G********7
发帖数: 234
27
来自主题: Programming版 - python一问
filelist = [filename for filename in files if ".txt" in filename]
刚学python,对以上这个句法不是太明白,谁能帮着解释一下。明白 for...: 或者 if.
..: else: 没见过这for...in...if...在一起的。多谢!
f*******n
发帖数: 12623
28
来自主题: Programming版 - python一问
这是一个list comprehension。 你现在初步可以理解它和这样写差不多:
filelist = []
for filename in files:
if ".txt" in filename:
filelist.append(filename)
e*********6
发帖数: 3453
29
来自主题: Programming版 - 这个python code能否优化去掉file write
class C:
def __init__(self, x):
self.x = x
def write_to_file(object, filename):
f = open(filename, 'a')
f.write(str(object.x) + 'n')
def large_loop(object):
print(object.x)
if (object.x == 1000):
print ('finish')
else:
n = object.x + 1
new_object = C(n)
if (object.x % 100 == 0):
# we need record some information
write_to_file(object, "temp.log")
return large_loop(new_object)
def working_on_intermidiat... 阅读全帖
a*****e
发帖数: 1700
30
你那行 perl 显然做的不是同一件事情。如果做和 perl 同样的事情,以下是 Haskell
程序:
main = parse >>= mapM_ (putStrLn . show)
parse = readFile "records" >>= return . concat . map (takeOut . words) .
lines
where
takeOut x = let v = (x!!1,x!!2,x!!29,x!!27,x!!32,x!!33,x!!49)
in [(x!!1,v), (x!!2,v)]
以下是 Perl 程序:
my $filename = "records";
open (my $fh, $filename)
or die ("could not open file '$filename'");
while (my $row = <$fh>) {
my @x = (split(/ /, $row))[1,2,29,27,32,33,49];
print "($x[1], @x)\n";
... 阅读全帖
u********s
发帖数: 1047
31
来自主题: Programming版 - python pickle 目的是什么
import pickle
a = {'hello': 'world'}
// serialize object a and save a string to filename.pickle
with open('filename.pickle', 'wb') as handle:
pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)
// open file, deserialize a string and convert to map
with open('filename.pickle', 'rb') as handle:
b = pickle.load(handle)
print a == b
j***y
发帖数: 87
32
gunzip -c filename.tar.gz | tar xvf -
tar -xvfz filename.tar gz (linux)
gzip -dc filename.tar.gz| tar xvf -
m******n
发帖数: 497
33
来自主题: Unix版 - Shell Question
#!/bin/ksh
fullpath=/home/username/config.cfg
filename=${fullpath##*/}
echo $filename
withoutext=${filename%.cfg}
echo $withoutext
v**t
发帖数: 25
34
我用$>time cat filename > test.dat时
test.dat的内容是 cat filename 的结果。
但time的结果还是显示在终端上,而没有输入到filename中。
另外我用$>time command 〉tmp 时,tmp内容为空,time
的结果显示在终端上
r**a
发帖数: 630
35
在sh/bash中可以用:
(time cat filename) > time.out 2>&1
刚才俺才意识到问什么我以前在bash中用time cat filename > time.out 2>&1 (就是俺说
的把stderr重定向到stdout后再重定向到文件)行不通,原来是time认为它的参数是
cat filename > time.out 2&1,故而其输出根本就没有被重定向,而是cat的输出被重定
向了,FT!!!!! 现在强行规定了命令执行顺序就好了。
BTW I/O redirection in csh is not consistent with other shells, and csh itself
is not suitable to be used to write scripts, so I almost never use it.
l****a
发帖数: 50
36
use matlab
help imread
IMREAD Read image from graphics file.
A = IMREAD(FILENAME,FMT) reads the image in FILENAME into
A. If the file contains a grayscale intensity image, A is
a two-dimensional array. If the file contains a truecolor
(RGB) image, A is a three-dimensional (M-by-N-by-3) array.
FILENAME is a string that specifies the name of the
graphics file, and FMT is a string that specifies the
format of the file. The file must be in the current
directory or i
c*******n
发帖数: 1648
37
来自主题: Computation版 - 关于文件输出,请教大家?
FILENAME = 'char01'
DO I = 1, 10
J = 10+II
WRITE(FILENAME(5:6),I2.2) I
OPEN(UNIT=J,FILE=FILENAME)
ENDDO
result:
char01
char02
....
g******s
发帖数: 733
38
来自主题: Computation版 - fortran90的超级怪问题
程序如下
PROGRAM MAIN
IMPLICIT NONE
real aa
aa=1023.0/2.0*1.0e-4
print*,aa
END PROGRAM
用f90 filename.f90 -o filename之后,filename出来的结果是0.051149997
用f77,把1023.0改成1021.0或1025.0,或者把*1.0e-4改成/1.0e4都对。
什么原因?先谢了!
g******s
发帖数: 733
39
来自主题: Computation版 - fortran90的超级怪问题
thanks a lot! But I don't know how to separate the compiling and link commands
. I use "f90 filename.f90 -o filename" which has put the compiling and link
together; or "f77 -c [-O4] filename.f" which doesn't recognize the switch "-r8
" or "-r16". What kind of compile and link commands shall I use if I want to
add the switch -r8 or -r16?

most
it
l*******G
发帖数: 1191
40
来自主题: Computation版 - strange matlab slowing-down problem
I finally found the reason. When the directory under which I run the
code has too many (>5000) files, matlab gets very very very slow. Because in
each of the for loop iteration ($loopind), I create about 1500 temp files
to save data onto disk, and then I will load these files one by one. Before
loading them, I use calls to exist(filename,'file') to make sure the file
exists. It turns
out that exist(filename,'file') gets very very slow when there are many
files in the folder even though an e... 阅读全帖
l*******G
发帖数: 1191
41
来自主题: Computation版 - strange matlab slowing-down problem
I finally found the reason. When the directory under which I run the
code has too many (>5000) files, matlab gets very very very slow. Because in
each of the for loop iteration ($loopind), I create about 1500 temp files
to save data onto disk, and then I will load these files one by one. Before
loading them, I use calls to exist(filename,'file') to make sure the file
exists. It turns
out that exist(filename,'file') gets very very slow when there are many
files in the folder even though ... 阅读全帖
W*W
发帖数: 293
42
【 以下文字转载自 Programming 讨论区 】
发信人: WtW (wtw), 信区: Programming
标 题: 求助: 有人用Analyze的程序包做图像处理的吗?
发信站: BBS 未名空间站 (Thu Jun 4 19:44:12 2009, 美东)
我现在用 Analyze 带的AVW library编一些图像处理的程序,里面基本是C写的程序,
有不同的功能可以调用,刚刚上手遇到很多问题。 比如不知道如何用里面一个函数打
开一个图像文件:
#include
#include "AVW.h" 这是函数库的head file
#include "AVW_ImageFile.h"
int main()
{
AVW_ImageFile *filename;
AVW_Image *image;
filename = AVW_OpenImageFile("C:/program files/avw/test.jpg", "r");
image = AVW_ReadImageFile(filename,NULL);
AVW_S
r****y
发帖数: 1437
43
来自主题: Mathematics版 - matlab在循环中读写大文件的问题
The filename of your hdf5write to is one fixed filename for all loops,
or the name is different for different j?
I suspect it is the former. If so, just make filename distinctive for each
loop, e.g. fname = [' ', int2str(j), '.hdf']
Another possibility is that file is not closed correctly after you write it.
If it is a temp file, why use hdf5write, just write as mat format?
g*****d
发帖数: 526
44
data _null_;
fname="tempfile";
rc=filename(fname,"filename");
if rc = 0 and fexist(fname) then
rc=fdelete(fname);
rc=filename(fname);
run;
e****t
发帖数: 766
45
来自主题: Statistics版 - help... sas autocall doesnt always work ?
i tried to call some sas macros in different directories. but some time it
works some time not?
any thing i need pay attention to ?
any limitation for the path or can i embeded macros between each other ?
any order to call ?
for example :
filename boot "Z:\AAAAAAAA\XXX\Projects\XXXXXX\IBBBBBBBB\Programs\AdHoc\
Develop\XXXX\EEEEEEEEEE\macros\statistical" ;
filename boot1 "Z:\AAAAAAAA\XXX\Projects\XXXXXX\IBBBBBBBB\Programs\AdHoc\
Develop\XXXX\EEEEEEEEEE\macros\utility" ;
filename setup "Z:\AA... 阅读全帖
x*******u
发帖数: 500
46
来自主题: Statistics版 - help! 读CSV文件读得要崩溃了
谢谢大家的帮助, 最后是SAS Technical Support 解决了问题。
It looks like you may have a Unicode file that has a hex '00' between each
character. Are you using PROC IMPORT to read the file? Use a FILENAME
statement to create a fileref for the file you want to read. On the
FILENAME statement add the ENCODING=UNICODE option. Then in the PROC IMPORT
, use DATAFILE=.
For example,
filename temp 'c:\temp\qualityinfo.csv' encoding="unicode" lrecl=32767;
proc import datafile=temp out=quality dbms=csv ... 阅读全帖
A****t
发帖数: 141
47
来自主题: Statistics版 - sas question!!!
用macro会方便一点
data _null_;
length filename $ 10;
input filename $;
call symput('y'||left(_n_), filename);
datalines;
a_20120101
a_20120102
a_20120105
a_20120106
b_20120107
;
run;
%put &y1 &y2 &y3 &y4 &y5;
j******g
发帖数: 197
48
来自主题: 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... 阅读全帖
j***g
发帖数: 19
49
来自主题: sysop版 - D source
1 int
2 delete_range(filename,id1,id2)
3 char *filename ;
4 int id1,id2 ;
5 {
6 struct fileheader fhdr;
7 char tmpfile[ STRLEN ], deleted[ STRLEN ];
8 int fdr, fdw, fd;
9 int count;
10
11 tmpfilename( filename, tmpfile, deleted );
12 if((fd = open(".dellock",O_RDWR|O_CREAT|O_APPEND, 0644)) == -1)
13 return -1;
14 flock(fd,LOCK_EX);
15
16 if((fdr
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)