由买买提看人间百态

topics

全部话题 - 话题: newline
首页 上页 1 2 (共2页)
M****g
发帖数: 162
1
来自主题: JobHunting版 - 急求rocket fuel 3小时的online test!!!
Question 1 / 2 (LaserMaze)
You are standing in a rectangular room and are about to fire a laser toward
the east wall. Inside the room a certain number of prisms have been placed.
They will alter the direction of the laser beam if it hits them. There
are north-facing, east-facing, west-facing, and south-facing prisms. If the
laser beam strikes an east-facing prism, its course will be altered to be
East, regardless of what direction it had been going in before. If it hits
a south-facing prism... 阅读全帖
d******e
发帖数: 2265
2
来自主题: Stock版 - 抄底指南
YDKN , Finance , Major Banks ==> 2014-11-20 00:00:00:JONES STEVEN W as
Officer, Purchase 2000 shares at $18.70, total value is 37,400
X , Basic Industries , Steel/Iron Ore ==> 2014-11-10 00:00:00:BURRITT DAVID
B as Officer, Purchase 26489 shares at $37.36 - $37.75, total value is 995,
000
X , Basic Industries , Steel/Iron Ore ==> 2014-11-11 00:00:00:FILHO MARIO
LONGHI as Officer, Purchase 28362 shares at $35.21 - $35.25, total value is
999,000
YUM , Consumer Services , Restaurants ==> 2014-12-16... 阅读全帖
w**k
发帖数: 6722
3
感觉大盘很不稳
可是今天还是手贱的买了点。擦
为什么你的回文总是把newline给吃掉了?
f*******n
发帖数: 5241
4
来自主题: Weightlifting版 - 增肌健美和寿命的关系
你说的老奶奶是不是这个?我以前在健身版贴过她照片。
Morjorie Newlin,72岁为了能扛动猫粮开始练举重。两年前去世了。
http://www.citypaper.net/articles/2006-08-03/naked.shtml

Resting
g**u
发帖数: 13
5
来自主题: WmGame版 - 哪有LINUX下的Mud client ?
谢谢,我有了,不过我在安装mud (fy3 ) 在freeBSD 2.2.7上的时候
碰钉子了,谁能帮帮我?
下面是报错信息和config.fy3的前部分内容
% ./driver config.fy3 &
[1] 17313
% using config file: config.fy3
Initializing internal tables....
----------------------------------------------------------------------------
风云三(本地) (MudOS v21.7) starting up on FreeBSD - Sun Mar 21 16:58:10 1999
Connected to address server on localhost port 9990
adm/simul_efun/file.c line 20: Undefined function seteuid
adm/simul_efun/object.c line 57: Undefined function getuid
ad... 阅读全帖
b*s
发帖数: 82482
6
来自主题: LeisureTime版 - 想哭 (转载)
让我用newline去置换空格试试看……


到美

男友
当我
还想
起相
b*s
发帖数: 82482
7
来自主题: LeisureTime版 - 想哭 (转载)
用newline置换空格以后还行,不算太长。
概括起来:
girl met boy
girl loved the boy
boy got cold feet and bailed out
girl went berserk
the end
w*****u
发帖数: 299
8
国人对《魔戒》认识的几大误区
作者:凡夜 发表日期:20040315 22:10:39
首先声明,不喜欢《指环王》这个译名,因此按照中文版图书和港台译法《魔戒》
纯粹是 因为最近看到一些国内所谓的著名电影人或记者什么的对《魔戒》的评论,碰巧
偶心情很好,过来给那些小白老白扫扫盲(其实偶知道那种人根本看不进的啦)……郁闷
之作~了解魔戒的人就不用看了,不过也欢迎一起来郁闷啦~
******************************
误区一:这是是最典型的美国本土大片
这是是最典型的小白!说魔戒是美国本土大片恐怕所有的魔戒迷都会笑掉大牙!影片的导
演,制片,编剧等一干主创人员都是新西兰本土人氏,而各位主要演员则来自世界各地。
影片中那些令人敬佩的特技、替身和群众演员全部都是新西兰的普通民众。魔戒的全片在
新西兰,其中后期制作有些部分在伦敦完成。当年PJ导演带着初步完成的魔戒企划去找米
拉麦克斯公司投资时遭到回绝,对方对PJ将这个故事拍两部的计划不抱以信心,只愿意拍
一部;而当PJ找到当时还是小公司的Newline新线时,新线当即拍板要拍就拍3部。尽管这
样,当初魔戒的预算也只有1亿8
l******a
发帖数: 3803
9

still, to my best impression, the Hobbit tastes more like a leftover
of the LOTR feast. OK, some say even the meat left between teeth makes
a dish:)
The Hobbit is the only movie that I watched struggling to fend sleep.
The overture, hmm, intro has been too long and it mixed with too much
piecemeal actions so that after that long hour, we can hardly remember
any solid main characters. Sorry to character-building.
The rockergon: fight!
Yeah, this just proves the techniques created during the LOTR... 阅读全帖
s***k
发帖数: 23
10
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: stock (Microsoft is dead), 信区: Programming
标 题: Perl for programmers(6): characters in string
发信站: The unknown SPACE (Tue May 23 11:14:19 2000) WWW-POST
double-quoted "...", single quoted '...' and if there is no
other interpretation, a word can be treated as quoted string
called barewords
special character in double quoted string
Code Meaning
\n newline
\r carriage return
\t Horizontal tab
\f Formfeed
\b backspace
\a alert(bell)
\e ES
c***k
发帖数: 1589
11
来自主题: BuildingWeb版 - Question about html code

is not white space. It's a newline character, if you put several
that'll generate several empty lines.
g*****g
发帖数: 34805
12
No, xml is just data, itselt doesn't specify how it should
be displayed.
l*********r
发帖数: 674
13
谢谢回复!我有个文件想用ie看,里面有一部分是memo,现在所有text全部在一段,看
起来非常不清楚,有什么办法能够让它display的时候也有类似于
的换行效果么?
g*****g
发帖数: 34805
14
Any decent text editor can specify where a line should
be wrapped. Open it there.
l*********r
发帖数: 674
15
thx, it worked in winEdit
l********g
发帖数: 134
16
r u talking about xlst?
z*****n
发帖数: 7639
17
you can make a simple CSS to display
XML data in good format.
s*****n
发帖数: 839
18
来自主题: 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... 阅读全帖
s***m
发帖数: 28
19
来自主题: Database版 - Mysql limits

I try to use longtext for the field. However, if the string
that i create contains
new line, the server fails to accept it. For examples, if i
create a simple GUI
for mail composer, if i want to allow user to type in their
message into textarea and then
use a servlet to fetch the content in textarea as a string,
i am not able to insert
them into mysql because of the Indent and newline. How can i
do that?
F***Q
发帖数: 6599
20
来自主题: Hardware版 - 用git来备份重要文件怎样
I have been using git to manage my core files (almost everything, except
pictures, downloads, and big data files) since 2010. really happy that I
made that choice.
My repository (bare) has grown from from 3GB to 8GB (you will be surprised
how slow your real creations grow once you start organizing your files).
Once you checkout a copy, the total git folder is about 2x of the bare repo
size - to me, is about 16 GB plus un-tracked files (mostly those do not
worth version control).
There are a few ... 阅读全帖
b******y
发帖数: 9224
21
use java to write a simple program to do that ;-)
BufferedReader to read in file line by line,
BufferedWriter to spool/write file out line by line to a new file.
Problem solved...
c*****t
发帖数: 1879
22
echo `grep ">start" textfile.txt`
l***i
发帖数: 289
23
来自主题: Java版 - about builder pattern
和这个'pattern'贴些边的是fluent interface http://martinfowler.com/bliki/FluentInterface.html,属于internal domain-specific language。
builder的本质上是把对象一点点'捏'出来
例如:
htmlBuilder.beginParagraph();
htmlBuilder.text("Hey you, refactor to patterns only!");
htmlBuilder.endParagraph();
htmlBuilder.newLine();
Html testimony = htmlBuilder.getHtml();

a
a*****i
发帖数: 4391
24
来自主题: Linux版 - emacs: indent after a newline

press
Check this out:
http://www.emacswiki.org/emacs/AutoIndentation
b*d
发帖数: 75
25
来自主题: Linux版 - emacs: indent after a newline
use ctrl+j instead of return

press
s******e
发帖数: 163
26
来自主题: Linux版 - Openoffice公式怎么换行?
newline
a*****i
发帖数: 4391
27
来自主题: Linux版 - nxserver 不能安装
Make sure the key is correct.
Like having a newline character at the end of key would be wrong.
E*V
发帖数: 17544
28
来自主题: Linux版 - Go 语言。。。有闲人真多
define name ( parameters ) { newline
auto_list statement_list }
I never use it anyway
h***r
发帖数: 726
29
自问自答吧
echo "--- abc ---" >> file-to-be-appended
echo "
" >> a for newline
echo -e "\n" may or may not work.
V*E
发帖数: 1642
30
来自主题: Linux版 - emacs RET vs C-j 问题
I think your terminal messed up with ctrl_M and ctrl-J. since I just
recalled ctrl_j is newline. ctrl_m is carriage return.
S***d
发帖数: 1802
31
来自主题: Linux版 - linux下有啥dvd->iso的软件么?
try this:
Two Perl implementations courtesy of MIT Student Information Processing
Board members Keith Winstein and Marc Horowitz. The shorter one, qrpff, is
472 bytes (discounting newlines). The faster one, 531 bytes long, caches the
permutation corresponding to CSStab1, and is actually fast enough to use to
watch a movie. The program takes a five-byte title key on the command line
(five decimal numbers in least to most-significant order, separated by
colons) and an MPEG2 Program Stream VOB file... 阅读全帖
m**k
发帖数: 290
32
来自主题: Linux版 - ssh 动态添加 tunnel 的快捷键
ssh escape character is "~"
$ ~?
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)
$ ... 阅读全帖
d****n
发帖数: 1637
33
来自主题: Linux版 - 码工码农,帮忙了! (转载)
1. first use getc() or getline (),
when reach a newline char '\n', use ftell() function save the current
position into a list/array sequentially
save this entire array into a text/binary format file as index.
2. when you try to pull out server lines from the huge file,
organize the line numbers in ascending order,
for each line number in your query
binary search your previous saved index
lseek the position in the index.
getc() or getline() until to the first '\n' by that offset
3.... 阅读全帖
j*****h
发帖数: 62
34
来自主题: Programming版 - [转载] A shell script question. :)
I guess you can do it in the following steps, using shell pipes to connect them.
1. use "sed" to convert the text into a stream of words separated by newline
2. use "sort" to sort the words
3. use "uniq" to count the number of unique words.
t****t
发帖数: 6806
35
来自主题: Programming版 - C++ string to int Problem
你逗号后面还有别的东西(e.g. extra newline, extra space)被读了进来,但是并非数
字, 这时候:
atoi返回0
extractor (>>)失败,上次的结果不变, 所以是3
PS 来来回回看了几遍才总算看懂了你的问题, 下次能不能说中文

second
r*********w
发帖数: 119
36
来自主题: Programming版 - 问计算机词汇的翻译 -- flush
C++里面的
例句 That statement prints "a" followed by endl, which prints a newline and
flushes the buffer associated with cout.
谢谢!
c**********e
发帖数: 2007
37
来自主题: Programming版 - C++ Q13: Input
#include
#include
#include
#include
using namespace std;
int main()
{
std::string line1(3, '*'), line2(5, '*');
std::cin >> line1;
std::getline(std::cin, line2);
std::cout << "Line 1:" << line1 << std::endl;
std::cout << "Line 2:" << line2 << std::endl;
std::cout << "EOF\n";
return 1;
}
Given the program above, what happens if, when the program is run, the user
enters "Hello world!" followed by a newline?
a) It will print out:
Line 1: Hello
Line 2: world!
EOF
r****t
发帖数: 10904
38
来自主题: Programming版 - C++ Q13: Input
(2nd function version:)
istream& getline ( istream& is, string& str );
Get line from stream
...
The delimiter character is delim for the first function version, and '\n' (
newline character) for the second. The extraction also stops if the end of
file is reached in is or if some other error occurs during the input
operation.
所以 getline 就从 hello 后面那个空格开始读到 \n 了。
c**********e
发帖数: 2007
39
来自主题: Programming版 - C++ Q20: construction and inheritance
#include
using namespace std;
struct A {
virtual void invoke() { cout << "Goodbye!\n"; }
};
struct Invoker {
Invoker(A* a) { a->invoke(); }
};
class B : A, Invoker {
public:
B(): A(), Invoker(this) {}
void invoke() { cout << "Hello world!\n"; }
};
Referring to the code above, what happens when an instance of class B is
constructed?
a) "Hello world!" will be printed out on the console--followed by a newline.
b) "Goodbye!" will be printed out on the console--followed by a n
a****m
发帖数: 693
40
#include
#include
#include
using namespace std;
// this function removes trailing spaces from x
void trim (char *str, int size )
{
int i;

/* remove the null terminator */
for ( i = size; i >0; i=i-1 )
{
if ( str[i] == '\n' || str[i]=='\t' || str[i]==' ' )
{
str[i-1] = '\0';
/* we're done, so just exit the function by returning */
return;
}
}
/* if we get all the way to her... 阅读全帖
t****t
发帖数: 6806
41
来自主题: Programming版 - 请教一个C++的问题
checked standard. if EOF happens in the middle of a line, you see eofbit
alone. if EOF happens immediately after a newline, a sentry object is
constructed at that time and traits::eof() is returned. and sentry object
set eofbit|failbit.
i think usually badbit alone should be the exception condition. failbit can
happen quite easily.
l********a
发帖数: 1154
42
来自主题: Programming版 - C的fscanf的问题
你能保证|前面的长度吗?如果都是4,下面的可以
int main()
{
FILE *fid = fopen("data.txt","r");
float num = 0.0;
char name[10] = {0};
fscanf(fid,"%4c|%f",&name,&num);
fclose(fid);
printf("Name: %s\nNumber: %f\n",name,num);
return 0;
}
如果分隔符不是|而是空格,用
fscanf(fid,"%s %f",&name,&num)好使
%s String of characters. This will read subsequent characters until a
whitespace is found (whitespace characters are considered to be blank,
newline and tab).
v******n
发帖数: 421
43
来自主题: Programming版 - Ruby 为什么输给了py
FPUTS(3) FreeBSD Library Functions Manual FPUTS(
3)
NAME
fputs, puts -- output a line to a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include
int
fputs(const char *str, FILE *stream);
int
puts(const char *str);
DESCRIPTION
The function fputs() writes the string pointed to by str to the stream
pointed to by stream.
The function puts() writes the string str, and a terminating newline
character... 阅读全帖
v******n
发帖数: 421
44
来自主题: Programming版 - Ruby 为什么输给了py
FPUTS(3) FreeBSD Library Functions Manual FPUTS(
3)
NAME
fputs, puts -- output a line to a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include
int
fputs(const char *str, FILE *stream);
int
puts(const char *str);
DESCRIPTION
The function fputs() writes the string pointed to by str to the stream
pointed to by stream.
The function puts() writes the string str, and a terminating newline
character... 阅读全帖
b***i
发帖数: 3043
45
来自主题: Programming版 - ASIO异步一问
我的项目的具体设计是一个嵌入式的服务器用Linux, C++11, ASIO, JSON等
客户端向服务器请求connect
连接后,服务器向客户端发送一个问题,
客户端回答
服务器回答对了
客户端开始发送JSON
服务器解析后进行动作,然后发送返回的信息
问题在最后一行:如果这个动作需要时间,我这些动作要在handle_read里面进行,还
是另起一个线程?我在进行这些动作的时候是否可以锁定信号灯?或者是比较简单的
lock?比如我要写一个变量,但是多个server可能同时访问这个变量,所以要lock再写。
目前采用boost的一个例子:
void start_read() {
// Set a deadline for the read operation.
input_deadline_.expires_from_now(readTimeout_);
// Start an asynchronous operation to read a newline-delimited message.
asio::async_read_until(socke... 阅读全帖
y***a
发帖数: 840
46
来自主题: Programming版 - python 小问题
>>> import re
>>> re.sub(r'\$xxx', 'yyy', '$xxxxx')
'yyyxx'
为啥会MATCH&REPLACE?
我的理解是 r'\$xxx' 就是‘\$xxx', 所以'$xxxxx'不会MATCH,不应该有REPLACE发生
。 ANY COMMENT? THX
When an "r" or "R" prefix is present, a character following a backslash is
included in the string without change, and all backslashes are left in the
string. For example, the string literal r"\n" consists of two characters: a
backslash and a lowercase "n". String quotes can be escaped with a backslash
, but the backslash remains in the string... 阅读全帖
e*******o
发帖数: 4654
z*****n
发帖数: 7639
48
\newline
or use tabularx package.
i*i
发帖数: 918
49
来自主题: TeX版 - footnote doublespacing
Nontrivial, you can always add \newline at appropriate places though.
首页 上页 1 2 (共2页)