w****w 发帖数: 521 | 1 加个logger handler, module和lineno对应__file__和__line__:
formatter = logging.Formatter('%(asctime)st%(levelname)st%(module)st%(lineno
)st%(message)s')
handler.setFormatter(formatter) |
|
g****a 发帖数: 1304 | 2 如何实现一个myprint(x)能显示出filename,lineno,then x,类似于__file__ and __
line__。用了个currentframe(), 显示的是myprint()所在文件和所在行。。。 |
|
e*******e 发帖数: 248 | 3 我用lineno package的时候,加了[pagewise]这个开关。但是在我自己的电脑上出来的
行号,还是不分页。奇怪的是Elsevier Editorial System给我生成的行号又是完全正
确的(每页重新从1开始)。不知道我的miktex什么地方没有设置好。 |
|
l*****g 发帖数: 685 | 4 Good question!
I was wrong. It's not really a BST, but rather a BT.
The nodes don't have explicit keys, and line numbers are implied by the in-
order traveral of the tree. Each node holds prevCount, number of all lines
before it, and nextCount, number of all lines after it.
Here is a rough implementation of this idea.
class Line
{
public:
//char * text;
Line * prev;
Line * next;
int prevCount;
int nextCount;
Line(char * text)
{
// clone text data
prev ... 阅读全帖 |
|
|
x***i 发帖数: 12 | 6 You are the man! :)
I used script as follows:
lineno=1
while read line
do
lineno=`expr $lineno + 1 `
rest=`expr $lineno % 20`
if [ $rest = 0 ]
then
echo $line
fi
done
echo $lineno
But it executed so slow and it can not work under linux!
By the way, can you use 'sed' command to do it? I am not familiar with
awk.... |
|
s******c 发帖数: 1920 | 7 编译一个程序。如果configure 的时候 enable-static 那么segfault的时候用gdb就有
具体的debug信息(比如call stack 对应到lineno in file);
如果 enable-shared, gdb的时候就只有main有lineno,其他的就没有
请问如果编译成动态库是不是还要有些什么选项要打开?
现在用的是-g -ggdb 操作系统是MacOS10.7 (Lion) |
|
m*****n 发帖数: 204 | 8 A couple issues that come to mind:
1. With your def of wordLineMap you can only handle one file correctly.
2. you should presort occurrences of each word by filename:lineno, then
query could be done similar to merge-sort.
3. for each occurrence of a word, record file name, line number, and offset
of the line-start in file. Use file seek to retrieve line, do not read line
by line.
4. Your code records duplicate occurrences if a word appears on a line more
than once. Think 'a' and 'the' etc.
5. Si... 阅读全帖 |
|
l********u 发帖数: 195 | 9 OrderNo lineNo Status LineType Date1 Date2
1 0001 99 T 07092002(date1)
1 0002 99 S 07012002(date2)
1 0003 50 S
2 0001 99 S 07012002(date2)
2 0002 99 S 07012002(date2)
3 0001 50 T 07092002(date1)
3 0002 99 S 0 |
|
|
e*******e 发帖数: 248 | 11 Nobody know about this package? A lots journal require line numbers ba. |
|
|
e*******e 发帖数: 248 | 13 应该不是这个原因吧。我编译了n次都没有用,还是不变。再说了,Elsevier
Editorial System怎么知道要编译两次呢? |
|
l********r 发帖数: 175 | 14 I finished a paper draft and needed to add line numbering to the text. Using
the package lineno and command \linenumbers, it could work for all the
parts of the text except the abstract part. How to fix the bad latex
template problem? Thanks a lot. |
|
l**x 发帖数: 202 | 15 package lineno
\linenumbers |
|
a**n 发帖数: 3801 | 16 \usepackage{lineno}
\linenumbers |
|
c*******y 发帖数: 1630 | 17 贴到stackoverflow去问问,很多是写library的在上面晃
%prun -l 5 count, bins, ignored = plt.hist(s, 50, normed=True)
45928256 function calls (45910189 primitive calls) in 52.608
seconds
Ordered by: internal time
List reduced from 243 to 5 due to restriction <5>
ncalls tottime percall cumtime percall filename:lineno(function)
366366 14.342 0.000 14.342 0.000 weakref.py:267(__init__)
50050 6.618 0.000 15.825 0.000 artist.py:883(get_aliases)
50050 3.088 0.0... 阅读全帖 |
|