>>> sort myfile.txt | uniq
'Apple Tree'에 해당되는 글 57건
- 2009.06.16 research tools
- 2009.06.11 sort and Remove duplicate lines
- 2009.04.09 pickle in binary file
- 2009.04.02 use BibTex with latex
- 2009.04.01 "Short-circuit" conditional calls in Python
- 2009.03.30 Beamer Themes
- 2009.03.24 Getting start with latex
- 2009.03.24 Contents Tables and Indices
- 2009.02.28 NLP Conference 2009
- 2009.01.30 multiply by logical values
research tools
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.
>>> sort myfile.txt | uniq
Pickler Protocols and cPickle
In recent Python releases, the pickler introduced the notion of protocolsstorage formats for pickled data. Specify the desired protocol by passing an extra parameter to the pickling calls (but not to unpickling calls: the protocol is automatically determined from the pickled data):
pickle.dump(object, file, protocol)
Pickled data may be created in either text or binary protocols. By default, the storage protocol is text (also known as protocol 0). In text mode, the files used to store pickled objects may be opened in text mode as in the earlier examples, and the pickled data is printable ASCII text, which can be read (it's essentially instructions for a stack machine).
The alternative protocols (protocols 1 and 2) store the pickled data in binary format and require that files be opened in binary mode (e.g., rb, wb). Protocol 1 is the original binary format; protocol 2, added in Python 2.3, has improved support for pickling of new-style classes. Binary format is slightly more efficient, but it cannot be inspected. An older option to pickling calls, the bin argument, has been subsumed by using a pickling protocol higher than 0. The pickle module also provides a HIGHEST_PROTOCOL variable that can be passed in to automatically select the maximum value.
One note: if you use the default text protocol, make sure you open pickle files in text mode later. On some platforms, opening text data in binary mode may cause unpickling errors due to line-end formats on Windows:
>>> f = open('temp', 'w') # text mode file on Windows
>>> pickle.dump(('ex', 'parrot'), f) # use default text protocol
>>> f.close( )
>>>
>>> pickle.load(open('temp', 'r')) # OK in text mode
('ex', 'parrot')
>>> pickle.load(open('temp', 'rb')) # fails in binary
Traceback (most recent call last):
File "<pyshell#337>", line 1, in -toplevel-
pickle.load(open('temp', 'rb'))
...lines deleted...
ValueError: insecure string pickle
One way to sidestep this potential issue is to always use binary mode for your files, even for the text pickle protocol. Since you must open files in binary mode for the binary pickler protocols anyhow (higher than the default 0), this isn't a bad habit to get into:
>>> f = open('temp', 'wb') # create in binary mode
>>> pickle.dump(('ex', 'parrot'), f) # use text protocol
>>> f.close( )
>>>
>>> pickle.load(open('temp', 'rb'))
('ex', 'parrot')
>>> pickle.load(open('temp', 'r'))
('ex', 'parrot')
- Download a bibliography style file such as h-physrev3.bst, into the directory where your document is. (There are many options about - just look around the web.)
- Create your bibliography database file by downloading (into the directory where your document is) and editing the example file tau.bib.
- Remove any \begin{thebibliography} ... \end{thebibliography} commands from your document.
- Just before the \end{document} command, add
\bibliographystyle{h-physrev3.bst} \bibliography{tau}
(Alternatively, just download and edit this example file.)
- When processing the file, you need to do: latex filename, bibtex filename, latex filename, latex filename.
# Normal statement-based flow control
if <cond1>: func1()
elif <cond2>: func2()
else: func3()
# Equivalent "short circuit" expression
(<cond1> and func1()) or (<cond2> and func2()) or (func3())
# Example "short circuit" expression
>>> x = 3
>>> def pr(s): return s
>>> (x==1 and pr('one')) or (x==2 and pr('two')) or (pr('other'))
'other'
>>> x = 2
>>> (x==1 and pr('one')) or (x==2 and pr('two')) or (pr('other'))
'two'
from :http://gnosis.cx/publish/programming/charming_python_13.html
Antibes
Bergen
Berkeley
Berlin
Boadilla
CombridgeUS
Cop-enhagen
Darmstadt
default
Dresden
Frankfurt
Goettingen
Hannover
Ilmenau
JuanLesPins
Luebeck
Madrid
Malmoe
Marburg
Montepellier
PaloAlto
Pittsburgh
Rochester
Singapore
Szeged
Warsaw
By David R. Wilkins
2nd Edition
Copyright David R. Wilkins 1995
In addition to the HTML pages listed below, the primer Getting Started with LaTeX is also available in the form of a LaTeX2e input file, and as a DVI file or PDF file.
For further information regarding TeX and LaTeX (including information on how to obtain TeX software), visit the TeX Users Group (TUG) home page.
- Introduction to LaTeX
- Producing Simple Documents using LaTeX
- Producing Mathematical Formulae using LaTeX
- Mathematics Mode
- Characters in Mathematics Mode
- Superscripts and Subscripts
- Greek Letters
- Mathematical Symbols
- Changing Fonts in Mathematics Mode
- Standard Functions (sin, cos etc.)
- Text Embedded in Displayed Equations
- Fractions and Roots
- Ellipsis (i.e., `three dots')
- Accents in Mathematics Mode
- Brackets and Norms
- Multiline Formulae in LaTeX
- Matrices and other arrays in LaTeX
- Derivatives, Limits, Sums and Integrals
- Further Features of LaTeX
All you need to do is add the following command at the point in the document where the TOC is expected to appear (somewhere inbetween the title and the content):
\tableofcontents
TOC Counter Depth
As happy as you may be with the results (especially given the relatively little effort) there are often things that one may wish to tweak, and the counter depth is perhaps the most common. By default LaTeX TOCs will display to the third level (which is subsection for the book class, or subsubsection in the article class), so we see 1.1.1 in the sample book.
To alter this, use the \setcounter command: \setcounter{tocdepth}{depth}
\setcounter{tocdepth}{1}Other built-in tables/lists
It's often the case in academic manuscripts, such as theses and text books a List of Tables and List of Figures accompany the Table of Contents. LaTeX also provides convience commands to issue the production of such lists.
\listoffigures \listoftablesAre all you need to type in order to have these lists automatically generated. It should be obvious, however, that these commands are looking for instances of the figure and table environments.
--CONLL
http://www.cnts.ua.ac.be/conll2009/
CoNLL-2009 will be colocated with NAACL HLT 2009 in Boulder, CO, USA at June 4-5, 2009.
* Paper submission deadline: March 4
* Notification of acceptance: April 3
* Camera-ready copy deadline: April 15
* Conference: June 4-5
--RANLP 2009
http://www.lml.bas.bg/ranlp2009/
Recent Advances in Natural Language Processing/ September 14-16, 2009, Borovets, Bulgaria
* Conference paper submission notification: 6 April 2009
* Conference paper submission deadline: 13 April 2009
* Conference paper acceptance notification: 1 June 2009
* Final versions of conference papers submission: 13 July 2009
-- MT summit XII
http://summitxii.amtaweb.org/
March 6, 2009 | Final day for Tutorial and Workshop proposals |
April 28, 2009 | Deadline for Research paper submissions |
May 28, 2009 | Deadline for Commercial User, Government User, and Translator Training and Tools presentation proposals |
-- IWPT 2009
international conference on parsing technologies
| ||||||||||
| ||||||||||
link: http://alpage.inria.fr/iwpt09 |
- CIKM 2009 (ACM 18th Conference on Information and Knowledge Management )
Beijing, China. October 27-31, 2009
Research and Industry Track |
Abstracts due: May 27, 2009 |
Papers due: June 3, 2009 | |
Notification of Acceptance: July 15, 2009 | |
Camera ready August 15, 2009 |
http://wikicfp.com/cfp/call?conference=NLP
http://www.cs.rochester.edu/~tetreaul/conferences.html
20
>>> 20 * False
0