由买买提看人间百态

topics

全部话题 - 话题: stderr
首页 上页 1 2 3 下页 末页 (共3页)
D*****r
发帖数: 6791
1
来自主题: Joke版 - Evolution of a programmer
http://www.ariel.com.au/jokes/The_Evolution_of_a_Programmer.html
High School/Jr.High
10 PRINT "HELLO WORLD"
20 END
First year in College
program Hello(input, output)
begin
writeln('Hello World')
end.
Senior year in College
(defun hello
(print
(cons 'Hello (list 'World))))
New professional
#include
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
... 阅读全帖

发帖数: 1
2
来自主题: Joke版 - 求助术版 - 加,减,乘,除
http://rosettacode.org/wiki/24_game/Solve#C
改一下就行了。这是输入4个的,可以改成输入3个的。
6 17 3 7: No solution
……
#include
#include
#include
#define n_cards 4
#define solve_goal 29
#define max_digit 9
typedef struct { int num, denom; } frac_t, *frac;
typedef enum { C_NUM = 0, C_ADD, C_SUB, C_MUL, C_DIV } op_type;
typedef struct expr_t *expr;
typedef struct expr_t {
op_type op;
expr left, right;
int value;
} expr_t;
void show_expr(expr e, op_type prec, int is_r... 阅读全帖
A*********u
发帖数: 8976
3
来自主题: PKU版 - here u go
board mean stderr
pennysaver 599.3152174 17.17152256
pku 488.6129032 23.76118143
seattle 332.4166667 12.10666833
lovenlust 330.8202247 21.2327113
sex 319.2258065 21.26226582
worldnews 61.16483516 33.07317622
go 24.65934066 3.491458959
A*********u
发帖数: 8976
4
来自主题: PKU版 - ft,没注意无间道
我说worldnews误差那大呢
重新来过
sorry
board mean stderr
pennysaver 599.3152174 17.17152256
pku 488.6129032 23.76118143
seattle 339.6923077 12.3256752
lovenlust 332.3068182 21.42267789
sex 319.2258065 21.26226582
worldnews 28.51111111 5.309314935
go 22.71111111 2.929732402
c*********t
发帖数: 30088
5
来自主题: PKU版 - [合集] here u go
☆─────────────────────────────────────☆
AdvancedEdu (飞跃重洋) 于 (Mon Jul 12 21:14:36 2010, 美东) 提到:
board mean stderr
pennysaver 599.3152174 17.17152256
pku 488.6129032 23.76118143
seattle 332.4166667 12.10666833
lovenlust 330.8202247 21.2327113
sex 319.2258065 21.26226582
worldnews 61.16483516 33.07317622
go 24.65934066 3.491458959
☆─────────────────────────────────────☆
handsomex (潇潇细雨) 于 (Mon Jul 12 21:18:27 2010, 美东) 提到:
c*********t
发帖数: 30088
6
来自主题: PKU版 - [合集] ft,没注意无间道
☆─────────────────────────────────────☆
AdvancedEdu (飞跃重洋) 于 (Mon Jul 12 23:24:52 2010, 美东) 提到:
我说worldnews误差那大呢
重新来过
sorry
board mean stderr
pennysaver 599.3152174 17.17152256
pku 488.6129032 23.76118143
seattle 339.6923077 12.3256752
lovenlust 332.3068182 21.42267789
sex 319.2258065 21.26226582
worldnews 28.51111111 5.309314935
go 22.71111111 2.929732402
☆─────────────────────────────────────☆
prettyday (胖墩爱吃包子) 于
c**t
发帖数: 2744
7
来自主题: DotNet版 - 这怎么实现
You need redirect stderr and stdout to different streams; and handle them se
parately; While you do that, you need avoid deadlock, I had it in my recent
post.
z*********e
发帖数: 10149
8
谢谢lz分享
有个问题,我上传图片提交后出错,说500 internal error,查了lighttpd log发现是
2013-04-04 01:36:36: (mod_fastcgi.c.2701) FastCGI-stderr: PHP Fatal error:
Call to undefined function imagecreatetruecolor() in /var/www/photoserver/
upload_local.php on line 173
这是怎么回事, ty
B**z
发帖数: 153
9
sometimes you have to go through(just do a read) all stdout and stderr
to make it work.
H***a
发帖数: 189
10
Process process = Runtime.getRumtime().exec("Your C program command line");
process.waitFor();
//you need to read the stdout and stderr from the process to avoid stuck
//process.getInputStream() and process.getErrorStream()
return process.exitValue();
z***h
发帖数: 405
11
BTW, actually you should always read(and print out) the stdout and stderr
from Java Runtime Process, because once the buffer is full, it could stuck.
l*****b
发帖数: 82
12
The whole error log is:
INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] SQLErrorCodes
loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
ERROR [STDERR] com.active.dao.DAOException: An exception occurred during
database access: PreparedStatementCallback; uncategorized SQLException for
SQL [SELECT * FROM transactions WHERE transaction_id = (SELECT refenence_
tran_id FROM transactions WHERE transaction_id = ?) or transaction_id = (
SELECT original_transaction_id F
c******n
发帖数: 4965
13
is there an easy module to do the above?
for example, I want to read from the stdout and stderr of the same
Runtime.exec()
u****s
发帖数: 2186
14
open a DOS prompt, run the .exe file from there, you may get something from
stdout/stderr
u****s
发帖数: 2186
15
来自主题: Java版 - Runtime.exec()是blocking的吗?
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.
From my past experience,
Make sure you read stdout and stderr if there is output, otherwise the
buffer could be full.
w******r
发帖数: 201
16
我用一个script A 调用 script B
Script A:
#do nothing but call B
ssh another-machine "/user/tom/b.sh"
Script B:
# do some fancy things, takes about 1 hour to finish
...
我用命令:
nohup a.sh &>/tmp/log &
A was "stopped" after 5 minutes but B was running and B finished correctly.
这是什么原因?我记得stopped是因为stdin/stderr? 这里好像没有问题啊?
而且我也没有ctrl-z。
l*l
发帖数: 26
17
来自主题: Linux版 - stdout/stderr redirect
In bash, I use "some_command > out.txt 2>&1".
But I still saw some output in the console.
How is this possible???
t*****g
发帖数: 1275
18
来自主题: Linux版 - stdout/stderr redirect
what about
some_command 2>&1 > out.txt
l*l
发帖数: 26
19
来自主题: Linux版 - stdout/stderr redirect
nothing changed.
t*****g
发帖数: 1275
20
来自主题: Linux版 - stdout/stderr redirect
It's probably the output of your current shell.
f*****g
发帖数: 3086
21
怎么查看一个后台进程的stdout和stderr啊?linux x86_64
我搜了一下:linux attach to process 64-bit没什么收获,求高人指点一二,感激不
尽!
h***r
发帖数: 726
22
来自主题: Linux版 - 请问bash下 > 和 >&有啥区别
没有 >& 这么个玩意。
&是和后面的东西结合的
eg: redirect stderr to stdout
a.out 2>&1
l*****n
发帖数: 633
23
来自主题: Linux版 - 请问bash下 > 和 >&有啥区别
这两个都是有的。>是重定向stdout(1),>&是重定向stdout以及stderr(2),和&>一样
。所以:
cmd &> file
等于:
cmd >& file
等价于:
cmd > file 2>&1
x**m
发帖数: 941
24
来自主题: Linux版 - 请问Ctrl+Z把任务suspended之后
用&没用,需要把stdout/stderr重定向。
v*****r
发帖数: 1119
25
来自主题: Linux版 - &! 什么意思?
&! has no meaning.
>&! 应该是 csh 的语法 to redirect stderr to stdin. 你这段 shell 肯定是 csh
script
mkdir $run >&! /dev/null
这一句换成 Bash 或 Ksh 的语法就是:
mkdir $run > /dev/null 2>&1
S*A
发帖数: 7142
26
stderr redirect to stdout
h****a
发帖数: 70
27
来自主题: Linux版 - 再问个fork的题
Given the following code:
#include
int main(void)
{
int tmp;
tmp = fork();
if(tmp == 0)
{
printf("Hello ")
sleep(1)
}
else if(tmp > 0)
{
printf("World, ")
sleep(1)
}
print "Bye bye"
}
Assuming the call to fork doesn't fail, which of the following is true (zero
or more answers may be correct):
a The execution of this is deterministic.
b The output will be: 'Hello World, Bye bye'
c This ca... 阅读全帖
x**m
发帖数: 941
28
来自主题: Linux版 - /etc/passwd 里面没有user ids?
你确认getent passwd里面有xyz? 想来这个输出应该是到stdout而不是stderr,如果
grep没有,那就有点奇怪了。
s**********g
发帖数: 139
29
Screen is good. or you have to redirect stdout, stderr, stdin:
nohup ./sas a.sas > a.sas.out 2> a.sas.err < /dev/null &
f*****3
发帖数: 19
30
你的c 语言输出是到STDOUT吗?
试试这个看输出是到STDOUT,或STDERR:
perl code.pl 1> out.txt 2> err. txt
q***z
发帖数: 934
31
来自主题: Programming版 - One network C question
Hello I am a newbie on network programming.
I am trying to receive a packet
if((numbytes = recvfrom(udp_fd1, buf, MAXLEN-1, 0,(struct
sockaddr*)®ister_addr, &addr_len))==-1){
fprintf(stderr, "error in recvfrom.\n");
exit(1);
}
The packet I am receiving has the following possible structure.
typedef struct struct_CN
{
unsigned char magicA;
unsigned char magicB;
unsigned short msgLen;
} CN;
typedef struct struct_Cc
{
CN msgHeader;
uns
s********h
发帖数: 286
32
来自主题: Programming版 - 又一个GDB的问题:关于显示数据
我在程序停止的时候用
print dz[j]
打印我的数据,dz是一个数组,j是index。打印出来的数据和实际不一样!
实际上,在我的程序中,也就是停止程序的前一个语句,已经让程序打印出来这个值:
fprintf(stderr, "dz[%d]=%g,",j,dz[j]);
显示的是
dz[5]=0.603372,
可是用GDB打印的结果却是
(gdb) print dz[j]
$3 = 36.7898712
我也试了打印其它格式,都不对,实在找不到问题在哪里了。
请问大家知道这是怎么回事吗?多谢先!!!
t****t
发帖数: 6806
33
来自主题: Programming版 - 关于STDERR定向到文件问题
yeah, local alias should work for this case.
c**t
发帖数: 2744
34
来自主题: Programming版 - 关于STDERR定向到文件问题
yeah, you are right...
h***z
发帖数: 233
35
Just redirect stderr to a file. Google for how to do this in your shell.
p***o
发帖数: 1252
36
来自主题: Programming版 - 问一个vc++ 2008的问题
从WinMain进去,有参数就起一个console,把stdout/stderr挂上去,
没参数该干嘛干嘛。
w******r
发帖数: 201
37
【 以下文字转载自 Linux 讨论区 】
发信人: warrener (淮水东边旧时月), 信区: Linux
标 题: 高人帮我看看一个简单的script,为什么nohup有问题?
发信站: BBS 未名空间站 (Tue May 26 21:17:10 2009)
我用一个script A 调用 script B
Script A:
#do nothing but call B
ssh another-machine "/user/tom/b.sh"
Script B:
# do some fancy things, takes about 1 hour to finish
...
我用命令:
nohup a.sh &>/tmp/log &
A was "stopped" after 5 minutes but B was running and B finished correctly.
这是什么原因?我记得stopped是因为stdin/stderr? 这里好像没有问题啊?
而且我也没有ctrl-z。
c**t
发帖数: 2744
38
来自主题: Programming版 - how can I get external program's result in C
you can catch stdout and stderr
h****a
发帖数: 70
39
来自主题: Programming版 - 再问个fork的题 (转载)
【 以下文字转载自 Linux 讨论区 】
发信人: himdca (how are you doing?), 信区: Linux
标 题: 再问个fork的题
发信站: BBS 未名空间站 (Thu Jun 9 03:31:30 2011, 美东)
Given the following code:
#include
int main(void)
{
int tmp;
tmp = fork();
if(tmp == 0)
{
printf("Hello ")
sleep(1)
}
else if(tmp > 0)
{
printf("World, ")
sleep(1)
}
print "Bye bye"
}
Assuming the call to fork doesn't fail, which of the following is true (zero
o... 阅读全帖
s**********o
发帖数: 197
40
来自主题: Programming版 - 再问个fork的题 (转载)
感觉就是shell里redirect stderr到一个文件,打开文件失败对你程序有没有影响,答
案是没影响,所以C不对
t*********o
发帖数: 143
41
来自主题: Programming版 - python比java慢这么多呀
谢谢大家讨论。楼上贴的benchmark results非常有用,跟我的数据很吻合,很好 :)
我的python核心代码如下。很简单,一行一行的读,把某一列的数据重新label一下,
然后写到一个新的文件。
我已经决定就用java了。从benchmark比较结果来看,java速度已经位列最快的一波了
,居然比c#还快。
pos = 10; // 11th column of the data
valueMap = {}
cnt = 0
for ln in sys.stdin:
vals = ln.split('\t')
val = vals[pos]
if val == null or len(val) == 0: continue
else:
if (not valueMap.has_key(val)):
... 阅读全帖
t*********o
发帖数: 143
42
来自主题: Programming版 - python比java慢这么多呀
谢谢大家讨论。楼上贴的benchmark results非常有用,跟我的数据很吻合,很好 :)
我的python核心代码如下。很简单,一行一行的读,把某一列的数据重新label一下,
然后写到一个新的文件。
我已经决定就用java了。从benchmark比较结果来看,java速度已经位列最快的一波了
,居然比c#还快。
pos = 10; // 11th column of the data
valueMap = {}
cnt = 0
for ln in sys.stdin:
vals = ln.split('\t')
val = vals[pos]
if val == null or len(val) == 0: continue
else:
if (not valueMap.has_key(val)):
... 阅读全帖
F********g
发帖数: 475
43
请高人解释一下为啥这个输出总是"HELLO-ERR"
#include
#include
int main()
{
while(1)
{
fprintf(stdout,"hello-out");
fprintf(stderr,"hello-err");
sleep(1);
}
return 0;
}
F********g
发帖数: 475
44
Thanks, 思考猪, now it's working
#include
#include
int main()
{
while(1)
{
fprintf(stdout,"hello-out");
fflush(stdout);
fprintf(stderr,"hello-err");
sleep(1);
}
return 0;
}
d****n
发帖数: 1637
45
if you dont mind change the output to adding '\n'
then it will work.
'\n' can flush, no need to call fflush()
#include
#include
int main()
{
while(1)
{
fprintf(stdout,"hello-out\n");
fprintf(stderr,"hello-err\n");
sleep(1);
}
return 0;
}
w******p
发帖数: 166
46
来自主题: Programming版 - 一个 perl 的 print 的初级问题
in first line $amt is interpreted as the file handle, which is neither
stdout or stderr, but if you add this after after $amt=2 you'll see the
print out:
open $amt, "|cat"; # anonymous pipe
首页 上页 1 2 3 下页 末页 (共3页)