Tuesday, October 26, 2010

My Dogs Hgb Blood Test Is High

Compare the differences between two documents in PDF

Note: here suggest that the program GUI DiffPDF that allows a better comparison between two PDF documents. A simple method to compare two documents in PDF format is to exploit the combination (To convert PDF to text pure) + diff (to see the differences). I was tired of performing all the usual commands then I wrote this script fresh fresh:

# / bin / bash
  convert function () {   txt = $ (   eval "expr \\ $" $ 
1
")
pdf = $ ( eval" expr \\ $ "$ 2 " )
choice = "" while [ -f "$ txt" ] do
read -p "$ txt file already exists, overwrite? [Y / n]:"
choice case "$ choice " in
s then exit
1 fi eval
"$ 1 = $ txt"
}

if
[$ #-ne 2]; then echo

"Usage: $ 0 PDF1 PDF2 "
exit 1 fi
pdf1 = $ 1 pdf2
= $ 2
txt1 = $ (dirname
" $ pdf1 ") / $ (

basename "$ pdf1"
. pdf). txt2 txt = $ (dirname
"$ pdf1" ) / $ (
basename "$ pdf2" . Pdf). txt convert convert txt1 pdf1 & & txt2 pdf2
if [$? -Eq 0];
then diff-u "$ txt1"
"$ txt2" an abbreviation of the current user's home folder), possibly creating it if it does not exist. Give the command in the terminal .
~ /. profile (for the curious used to load the file ~ /. profile which adds the folder $ HOME / bin the environment variable $ PATH ), then this should be sufficient to give the terminal command
pdf-diff / path / to / first / your / path / to / second / file (or the name you gave to the script). will not be perfect, it has all the limitations that exist in the transition from a PDF to a plain text file (for example if an image change does not notice and the success of the comparison depends on how well pdftotext unable to read the documents) but is quite fast and I found this system often very useful. I also wrote the script corresponding
Nautilus (using zenity
):
# / bin / bash

title = "Comparing PDF" function

convert () {
txt = $ ( eval "expr \\ $" $ 1 ")
  pdf = $ (eval  
"expr \\ $" $ 2 ") while [
-f" $ txt "
] 
do


if ! zenity - question - title = "$ title"
-
text = "$ txt file already exists, overwrite?" ; then
 txt = $ (  zenity - entry - title =  "$ title"  -  text = 'Specify a different output file: ")  
else

break 2 fi

done
pdftotext "$ pdf" "$ txt" homes $? in 0)
;; 1) zenity - error - title = "$ title" - text = "There was an error opening $ pdf." exit 1 ;;
2) zenity - error - title = "$ title" - text = "There was an error opening $ txt."
exit 1 ;; 3) zenity - error - title = "$ Title" - text = "There was an error related permits $ pdf."
exit 1 ;; *) zenity - error - title = "$ title" - text = "There was an error!"

exit 1 esac

eval "$ 1 = $ txt"}
if [$ #-ne 2];
then zenity - error - title = "$ title" -
text = "You must select two files at a time"


exit 1 fi
pdf1 = $ 1


pdf2 = $ 2
txt1 = $ (dirname


"$ pdf1" ) / $ (basename " $ pdf1 "
. pdf). txt2
txt = $ (dirname

" $ pdf1 ") / $ (basename
" $ pdf2 ". pdf). txt convert txt1 pdf1 & & ; convert txt2 pdf2
if [$? -Eq 0];
then diff-u "$ txt1"
"$ txt2"

- filename = / dev / stdin rm-f "$ txt1" "$ txt2"
else #
should not ever come here, to put safety
zenity - error - title = "$ title" -
text = "There was an error!" exit 1 fi
exit 0
To use this second script open a blank file with a text editor, copy the script editor and save it in the folder ~ / .gnome2/nautilus- calling scripts, for example, " Compare PDF . Make it executable and then script. So you can select and compare two PDF files by clicking the right button, choose Script → Compare PDF (or the name you gave to the script).
From a technical standpoint, the script of which looks a bit 'particular: the function converter (which is used to convert PDF to text and make the appropriate checks) has a sort of passing variable by reference and not by value. The trick is to convert the function not the value of the variable but its name (those familiar with other programming languages \u200b\u200bmay find it natural). Details can be seen here: # http://www.pluto.it/files/ildp/guide/abs/functions.html DEREFERENCECL .

Saturday, October 23, 2010

Monica Roccaforte -film

Import Gmail sent mail to another account

Questa volta parlerò di un problema non legato al sistema operativo GNU/Linux, però è un problema che mi ha tenuto impegnato per un po' e voglio spiegare il barbatrucco con cui l'ho risolto: importare in Gmail la posta inviata di un altro account.

In Gmail è possibile importare le email ricevute da un qualsiasi altro account di posta elettronico nel proprio account su Gmail. Se si vuole è possibile anche continuare a scaricare automaticamente la posta da altri account (al massimo 5) con la funzione chiamata Mail Fetcher . Purtroppo né l'importazione manuale della posta né Mail Fetcher importano anche le email inviate dagli altri account, as explained in section
Troubleshooting Guide. It is true that you can not do this automatically, but with a few laps I managed in my purpose. To do this I had to take a look at the organization of the mail on Gmail. The barbatrucco work fully if the account from which you want to import your e-mail senders will be added to custom . The mail (which are normally collected for
conversations, if you do not like this view you can disable it by Settings tab and select
General Conversation View off ) are not divided into folders, but have " labels" that are attributed to them. The use is basically the same, the difference is that a mail can be attributed to multiple labels, it is as if they were in multiple folders. All mail can be found in space called All messages (the link is in the bar on the left, if not see press
Other
), they are not displayed deleted emails (which have the label Trash) and those marked as spam (which the label Spam ). (Almost) All the "groups" that we see on the left do nothing but collect e-mail according to the labels that have been allocated. Così, le email posizionate in
Posta in arrivo
sono semplicemente delle mail che hanno l'etichetta Posta in arrivo (per quanto possa sembrare strano, una email inviata può trovarsi in
Posta in arrivo : basta che abbia la corrispondente etichetta), le eventuali email presenti in Personale
, Lavoro , ecc. hanno le rispettive etichette e, come detto, una mail può anche avere più etichette contemporaneamente (e quindi comparirà in tutti i rispettivi "gruppi"). Invece le mail presenti in Posta inviata hanno come caratteristica di avere come mittente l'account in uso o uno dei mittenti personalizzati. Vi wondering: what does all this talk with the import of emails sent? Calm down, we come now to solve the problem by doing a quick summary of what we learned. We know that Gmail can import from other accounts on the mail arrived, but not sent, then we might think of moving into the old account emails in the Inbox folder (usually this is an operation can, of course I can not explain the details so vary from provider to provider), but this creates the problem that importing the mail in your Gmail email sent will have the label Inbox and then will be in that group (except during import has not been selected Archive incoming messages (Skip the Inbox)
). But we know also that to remove a message from the Inbox
just remove the corresponding label, nothing is easier! I have already indicated that the barbatrucco work if we are importing the address from which mail is one of the senders own, then the email will already automatically Sent , otherwise it will not appear in this "Folder" but only in All To avoid having to manually remove the labels to each message sent to the board to split the import operation at two points: 1) import all mail in your Gmail account normally come to the old account; 2) after completing this operation , move (in the old account) emails sent in the download folder and run again in Gmail (quiet, emails already imported will not be downloaded again) by selecting
Archive incoming messages (Skip the Inbox)
. In this way, as already explained quite well by the name of the option, the new email that will be discharged (in the hope that there are only emails sent and not appears some new mail:-D) will be stored , that will not be added to the label Inbox . In the old account from which you imported the email you can now do whatever you want: bring back the email sent in the Sent Items folder, delete, etc.. Of course you can select Archive incoming messages (Skip the Inbox) already importing all the mail received, in this case it is not even needed a double import, you can import them all email received and sent (of course after you move them into the folder of incoming mail). If you are using Mail Fetcher, after the import of messages you may want to remove the option
Archive incoming messages
: remember to do it, otherwise the new mail received on your old account will not go to your Inbox! This is the barbatrucco I devised myself, I do not exclude that there is some easier method, in which case I'd be happy to know! :-)

Friday, October 22, 2010

Optical Migraines/herpes

Useful options for composing LaTeX documents in GNU Emacs + AUCTeX

GNU Emacs, as I have said, is a powerful text editor that allows you to do everything and more. There are many functions that allow you to help you write code in many programming languages, including, of course LaTeX (although in this case as "programming language" is not entirely appropriate). One of the many reasons why Emacs is popular is its customization and expansion: there are hundreds of extensions that increase the potential of this text editor over the functions provided natively. There is (obviously) an extension for LaTeX: AUCTeX (but is also useful for ConTeXt, docTeX, Texinfo, and plain TeX: Many of the settings that we will see will be valid for all these languages, although I usually refer only to LaTeX). is not my intention here to explain how to install Emacs nor AUCTeX (also because these packages are provided by the Most GNU / Linux, the installation is very simple if you know the operation of its own package manager), but rather explain what are the options for AUCTeX (Emacs and some of his own) that I find personally useful. I'll assume that you have at least familiar with Emacs, with the notation of the shortcuts and commands and also with AUCTeX (but sometimes remember how to perform certain operations.) Before you begin remember that you can consult the manual (in English) at AUCTeX http://www.gnu.org/software/auctex/manual/auctex.html or directly inside Emacs with Ch idm AUCTeX RET . For editing of much of the following AUCTeX will already be loaded. I'm not an expert in Emacs, I might sometimes say silly things, I hope you forgive me and tips are welcome (in any way I can assure you that by following this guide you do not break out the pc:-D). In AUCTeX, you can perform various tasks such as compiling, running bibtex, makeindex execution, deletion of temporary files, etc. ... using Cc Cc (followed by the command you want to use). The deletion of temporary files is performed using the list of file extensions stored in the variable LaTeX-clean-intermediate-suffixes . Change this variable (as all variables in Emacs, of course substituting the name where appropriate) you can use the command (remember that the commands can be entered with Mx, where M is called the Meta key and can be obtained by 'ALT, or, if there is such a key, with ESC (release after pressing ESC)): customize-variable RET
LaTeX-clean-intermediate-suffixes RET
To add new extensions INS select and insert side Regexp: 's regular expression (for more information on regular expressions in Emacs, consult the manual or see Elisp in Emacs here) corresponding to the extension that you want to add. For example, I added the extensions .
tex ~ (backup files created by Emacs) and
. Run.xml
(file used to create the bibliography with the package
biblatex ) with the following regular expressions: \\. tex ~ \\. run \\. xml To finalize the changes for future sessions, select Save

(you'll need to do the same every time you use customize-variable ). Emacs is also concerned

indent the code correctly, including the various environments. You can set the editor in particular so that when pressed the Enter key (or, in the notation of Emacs, with the command: customize-variable RET TeX-newline-function RET Select Value Menu and select

newline-and-indent . You can also change the behavior of Emacs indentation in certain environments changing the variable LaTeX-indent-environment-list , always with the command:
customize-variable RET LaTeX-indent-environment-list RET
I, for example, I added the environment lstlisting to do so did not add that Emacs automatically indents the text in this environment. To do this I selected INS, written lstlisting beside Environment: and after putting the check in Function: I wrote in its space
current-indentation (just as is the default for '
 
verbatim environment).
Emacs also allows the ' syntax highlighting of LaTeX, but in some (rare) cases may go into distress. For example, I had problems with the aforementioned environment lstlisting as not AUCTeX 11.86 conosce bene il suo funzionamento (per esempio l'inserimento del simbolo del dollaro $ rovina tutta l'evidenziazione del documento). Per fortuna è possibile spiegargli che lo deve trattare allo stesso modo dell'ambiente verbatim (in pratica tutto ciò che si trova all'interno di questo ambiente non viene interpretato da Emacs per quanto riguarda l'evidenziazione della sintassi) modificando la variabile LaTeX-verbatim-environments : customize-variable RET LaTeX-verbatim-environments RET
aggiungete
 lstlisting 
(penso che ormai avrete capito come funziona questo tipo di interfaccia di modifica delle variabili) e il gioco è fatto.
In maniera default Emacs compile documents in DVI . If you want to set as a default PDF format must change the value of the variable TeX-PDF-mode

: customize-variable RET TeX-PDF-mode RET Select Toggle until you get to
on (non-nil)
. 
If you installed a distribution of latex in a location that is immediately recognized by Emacs and AUCTeX will need to change some variables. For example, I have installed TeX Live 2010 by following this guide of Henry Gregory and all the LaTeX files are in subfolders / usr/local/texlive/2010 / (where Emacs e AUCTeX normalmente non cercano). Fra le variabili che potrebbero dover essere cambiate ci sono TeX-macro-global (contiene, ricorsivamente, le cartelle in cui AUCTeX cercherà i file di stile) e
exec-path
  (contiene i percorsi in cui Emacs cerca i programmi da eseguire). La modifica di queste variabili è simile a quanto visto finora. Per la prima variabile ho aggiunto il percorso  
/usr/local/texlive/2010/texmf-dist/tex/
, mentre per exec-path ho aggiunto /usr/local/texlive/2010/bin/i386-linux/ (su architetture diverse dal 32 bit questo percorso sarà sicuramente diverso. Controllate per bene la posizione in cui avete installato la distribuzione). To change the program that opens the output document (be it in DVI, PDF, HTML, etc.) via Cc Cc RET View must change the variable TeX-view-program-selection . As usual you can customize the variable use customize-variable RET TeX-view-program-selection RET settings've seen so far are saved automatically
Emacs initialization file ~ /.
emacs (I recall that the tilde ~ is an abbreviation of the location of your home directory, but files that have names beginning with a dot are hidden ). All these settings can also be stored manually editing the file . emacs (so you can do this yourself but you must know the language Emacs Lisp). Now let's see some other useful options you set by editing the file . emacs (this however can always be set using the interface
 customize-variable). The 
of AUCTeX manual suggests adding a
.
emacs the following lines: (setq TeX-auto-save t) (setq TeX-parse-self t) so that getting support for LaTeX packages that are used in your documents (option TeX-parse-self
performed Emacs parsing
 
of the document and the information will be collected in a subfolder of the directory of the revised document called
Car . If you do not want to crowd into their own folders, you may not want to activate these two options). If you use frequently divide their LaTeX documents into multiple parts to be included in the main file with the commands \\ input or

\\ include may be useful to add the file . option emacs (setq-default TeX-master nil) In this way, the opening of LaTeX documents Emacs will ask what is the associated main file (which should, for example, run compilation commands). You can make sure that you open a document LaTeX Emacs spell check on the fly by adding a . option emacs (add-hook 'TeX-mode-hook' flyspell-mode)
Also, if you often use LaTeX to compose mathematical documents might be useful to add the option
(add-hook 'TeX-mode-hook' LaTeX-math-mode) that allows the rapid integration of several mathematical symbols (see
manual). Finally, make sure to wrap the cursor after the insertion of a fixed number of characters per line (ovviamene Emacs is smart, does not break a word into two, wrap in so that the line appears along
 
than the fixed number of characters) you can add the
(add-hook 'TeX-mode-hook' turn-on-auto-fill) The number of characters line after which Emacs will start a new line is stored in the variable fill-column . Left as an exercise to find out how you change that variable (ok, I leave a clue: you can always use the usual command:-D).

Saturday, October 9, 2010

Lord Of The Flies Is Ralph Gay

Ipe: An error During the run pdflatex occurred. There was an error reading the pdflatex output [solved]

If you have installed TeX Live 2010 distribution, and use the graphics program to create drawings Ipe, going to build an image you may receive the following error dialog: An error occurred During the run pdflatex There was an error reading the Pdflatex output


 Trovate la soluzione a questo problema qui:  
http://http.typke.com/cgi-bin/bugzilla3/show_bug.cgi?id=350
e consiste nell'aggiungere al preambolo dell'immagine il comando
\pdfobjcompresslevel0 . Ricordo che il preambolo di un'immagine Ipe può essere modificato da Edit → Document properties (oppure con la scorciatoia da tastiera CTRL
+
Shift + P ), scrivendo nel campo Latex preamble .
  


Shimano Sahara/ Fish Eagle 11

Git4LaTeX: an introductory guide to Git for LaTeX projects

Chi scrive documenti con LaTeX potrebbe a un certo punto avere il bisogno di controllare lo sviluppo dei vari documenti, in modo da controllare i cambiamenti effettuati tra un salvataggio e l'altro per poter, eventualmente, anche individuare quando sono stati introdotti degli errori e poter in pochi passi ripristinare una versione precedente. In vostro soccorso arriva allora Git, programma di controllo versione. L'uso tipico di Git è quello di tenere traccia dello sviluppo di un software, ma svolge ugualmente bene il suo lavoro con i documenti LaTeX.

Proprio per spiegare come utilizzare insieme Git e LaTeX, sul forum del Guit l'utente dianoia ha
 annunciato 
la realizzazione di una guida (con licenza
CC-BY-NC-SA 2.5 Italy
) Using Git to manage the development of a document written in LaTeX. The guide does not set great goals, not become an expert of Git reading it, but it is certainly helpful to be able to use with these helpful tools.
 
find the source code of its guide on dianoia Gitorious
http://www.gitorious.org/git4latex address and you can download the PDF document (which may not be updated) at http:// hotfile.com/dl/74484041/9c21bb8/git4latex.pdf.html . If you have Git on your system you can clone the repository with the command git clone git
: / / gitorious.org/git4latex/git4latex.git 
Finally, the source code can also be downloaded in a compressed archive at http://www.gitorious.org/git4latex/git4latex/archive-tarball/master Since the user has wisely decided to use a free license for this helpful guide I made a fork that you can always find the address on Gitorious
http://www.gitorious.org/ ~ elrondgit/git4latex/elrondgits- git4latex/commits/elrond
, PDF (also not up to date) can be downloaded from http://elubuntu.altervista.org/LaTeX/git4latex.pdf
. Also if you have Git installed on your system you can clone the repository with the command

git clone git: / / gitorious.org / ~ elrondgit/git4latex/elrondgits-git4latex.git elrondgits git4latex
-cd-elrondgits git4latex # to enter a folder
git checkout # elrond to open the branch (the last two commands as explained in the comments, they serve to show my branch). Finally even this long list of addresses to point out that my branch can be downloaded in a compressed archive at
http://www.gitorious.org/git4latex/elrondgits-git4latex/archive-tarball/elrond
. Any criticism (constructive), reporting of inaccurate or request for clarification is very welcome! Texing Happy:)