'Apple Tree'에 해당되는 글 57

  1. 2009.06.16 research tools
  2. 2009.06.11 sort and Remove duplicate lines
  3. 2009.04.09 pickle in binary file
  4. 2009.04.02 use BibTex with latex
  5. 2009.04.01 "Short-circuit" conditional calls in Python
  6. 2009.03.30 Beamer Themes
  7. 2009.03.24 Getting start with latex
  8. 2009.03.24 Contents Tables and Indices
  9. 2009.02.28 NLP Conference 2009
  10. 2009.01.30 multiply by logical values
2009. 6. 16. 12:19

research tools

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

Linux & Ubuntu/Linux tips | Posted by 알 수 없는 사용자 2009. 6. 11. 09:31

sort and Remove duplicate lines


>>> sort myfile.txt | uniq
Programming/Python | Posted by 알 수 없는 사용자 2009. 4. 9. 22:35

pickle in binary file

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')
Linux & Ubuntu/LaTex | Posted by 알 수 없는 사용자 2009. 4. 2. 12:04

use BibTex with latex

 

  1. 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.)
  2. Create your bibliography database file by downloading (into the directory where your document is) and editing the example file tau.bib.
  3. Remove any  \begin{thebibliography}  ...  \end{thebibliography}  commands from your document.
  4. Just before the  \end{document}  command, add

    \bibliographystyle{h-physrev3.bst}
    \bibliography{tau}
    

    (Alternatively, just download and edit this example  file.)

  5. When processing the file, you need to do: latex filename, bibtex filename, latex filename, latex filename.
Programming/Python | Posted by 알 수 없는 사용자 2009. 4. 1. 04:54

"Short-circuit" conditional calls in Python

# 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

Linux & Ubuntu/LaTex | Posted by 알 수 없는 사용자 2009. 3. 30. 15:05

Beamer Themes

AnnArbor

example of a slide

example of a slide

example of a slide

example of a slide

Antibes

example of a slide

example of a slide

example of a slide

example of a slide


Bergen

example of a slide

example of a slide

example of a slide

example of a slide

Berkeley

example of a slide

example of a slide

example of a slide

example of a slide

Berlin

example of a slide

example of a slide

example of a slide

example of a slide

Boadilla

example of a slide

example of a slide

example of a slide

example of a slide

CombridgeUS

example of a slide

example of a slide

example of a slide

example of a slide

Cop-enhagen

example of a slide

example of a slide

example of a slide

example of a slide

Darmstadt

example of a slide

example of a slide

example of a slide

example of a slide

default

example of a slide

example of a slide

example of a slide

example of a slide

Dresden

example of a slide

example of a slide

example of a slide

example of a slide

Frankfurt

example of a slide

example of a slide

example of a slide

example of a slide

Goettingen

example of a slide

example of a slide

example of a slide

example of a slide

Hannover

example of a slide

example of a slide

example of a slide

example of a slide

Ilmenau

example of a slide

example of a slide

example of a slide

example of a slide

JuanLesPins

example of a slide

example of a slide

example of a slide

example of a slide

Luebeck

example of a slide

example of a slide

example of a slide

example of a slide

Madrid

example of a slide

example of a slide

example of a slide

example of a slide

Malmoe

example of a slide

example of a slide

example of a slide

example of a slide

Marburg

example of a slide

example of a slide

example of a slide

example of a slide

Montepellier

example of a slide

example of a slide

example of a slide

example of a slide

PaloAlto

example of a slide

example of a slide

example of a slide

example of a slide

Pittsburgh

example of a slide

example of a slide

example of a slide

example of a slide


Rochester

example of a slide

example of a slide

example of a slide

example of a slide


Singapore

example of a slide

example of a slide

example of a slide

example of a slide

Szeged

example of a slide

example of a slide

example of a slide

example of a slide

Warsaw

example of a slide

example of a slide

example of a slide

example of a slide


Linux & Ubuntu/LaTex | Posted by 알 수 없는 사용자 2009. 3. 24. 12:03

Getting start with latex

카테고리 없음 | Posted by 알 수 없는 사용자 2009. 3. 24. 10:35

Contents Tables and Indices

All LaTeX needs to do is harvest all the headings from your document as it processes it. Basically, all you need to do is to tell LaTeX that you actually want the TOC to appear (a bit like how you need to tell it to show the document title information with \maketitle.

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
\listoftables
Are 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.

Natural language processing | Posted by 알 수 없는 사용자 2009. 2. 28. 02:18

NLP Conference 2009

--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

 

When: Oct 7, 2009 - Oct 9, 2009
Where: Paris, France
Submission Deadline: May 25, 2009
Notification Due: Jul 1, 2009
Final Version Due: Aug 15, 2009
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
Programming/Python | Posted by 알 수 없는 사용자 2009. 1. 30. 17:28

multiply by logical values

>>> 20 * True
20
>>> 20 * False
0