חנוך/lipu sitelen pi toki aliחנוךhttp://xn--9dbdkw.se/diary-all/index.tp.htmlחנוךikiwiki2014-10-18T16:38:09Zhow to parse IMAPhttp://xn--9dbdkw.se/diary/how_to_parse_IMAP/index.en.html2014-05-03T02:47:00Z2014-05-03T02:47:00Z
<p>So I'm <a href="https://github.com/legoscia/bic/">writing an IMAP client for Emacs</a>. The main reason is
that I want an email client works as if by osmosis, like the one on my
phone—whenever it has a connection, messages magically enter a local
cache, where they stay available even if the connection is lost.
There are many ways to achieve that with existing Emacs email clients,
possibly augmented with external tools, but I want one that works with
minimal setup, and requires nothing but Emacs itself.</p>
<p>The first problem encountered when writing an IMAP client is parsing
what the server is sending. There are two IMAP parsers in the Emacs
source tree already (<code>imap.el</code> and <code>nnimap.el</code>), both fairly closely
tied to their respective clients, and both synchronous—they block
Emacs while they are waiting for data from the server. I want to
address both of those points: my IMAP client is going to have a
reusable asynchronous parser module.</p>
<p>Obviously, the first step in figuring out how to parse the protocol is
to read <a href="http://tools.ietf.org/html/rfc3501">the IMAP RFC</a>. Naturally, you'd skip ahead to the
section "Formal syntax", which defines in ABNF what various messages
should look like: a sequence number followed by one of a few keywords
followed by a quoted string or an atom, etc etc. That's where I
started, adding a special case for each command response into my
parser code.</p>
<p>But then I thought that this wasn't the right way to do it. The
parser module wouldn't be independent of the module that uses it,
since the calling module might want to use an extension that the
parser module doesn't know about yet. Also, I would constantly need
to come up with sensible data structures to represent the responses
with.</p>
<p>So I decided to create a parser that would be able to parse IMAP
responses with as little knowledge as possible about what those
responses should look like. It turns out that most of IMAP consists
of atoms, strings and lists. I figured that I should be able to parse
everything following these simple rules:</p>
<ul>
<li>If it starts with a double quote, parse it as a quoted string.</li>
<li>If it starts with a <code>(</code> or <code>[</code>, descend, parse recursively and return
it as a list.</li>
<li>Otherwise, treat it as an atom, read until the next space character
or closing <code>)</code> or <code>]</code>, and return it as a string.</li>
</ul>
<p>For example, this <code>LIST</code> response:</p>
<pre><code>* LIST (\HasNoChildren) "." INBOX
</code></pre>
<p>gets parsed to this:</p>
<pre><code>("*" "LIST" ("\\HasNoChildren") "." "INBOX")
</code></pre>
<p>This mostly worked. One exception is that if the second word of a
line is one of <code>OK</code>, <code>NO</code>, <code>BAD</code>, <code>BYE</code> or <code>PREAUTH</code>, then the rest of
the line (described by <code>resp-text</code> in the RFC) is free-form
human-readable text, optionally preceded by a <code>resp-text-code</code>. For
example, this is part of a response to a <code>SELECT</code> command from the
Dovecot server:</p>
<pre><code>* OK [UNSEEN 6] First unseen.
* OK [UIDVALIDITY 1381959933] UIDs valid
* OK [UIDNEXT 10] Predicted next UID
1 OK [READ-WRITE] Select completed (0.003 secs).
</code></pre>
<p>There is no reason why this free-form text couldn't contain unbalanced
parentheses or anything else that might confuse a parser, and besides
it doesn't make sense to split the text into words anyway. So that's
a special case for the parser, and gets parsed to this:</p>
<pre><code>("*" :ok :code "UNSEEN" :data "6" :text "First unseen.")
("*" :ok :code "UIDVALIDITY" :data "1381959933" :text "UIDs valid")
("*" :ok :code "UIDNEXT" :data "10" :text "Predicted next UID")
("1" :ok :code "READ-WRITE" :data nil :text "Select completed (0.003 secs).")
</code></pre>
<p>Then there is <code>BODY</code>, which when given as a fetch or message attribute
is followed immediately by an opening square bracket, e.g. <code>BODY[]</code>.
I decided to treat it as if there were a space between <code>BODY</code> and the
bracket, and return them as two elements, the string <code>"BODY"</code> and the
list of items parsed inside the brackets.</p>
<p>And all of this applies in principle to every single line, except that
a physical line can end with a byte count in curly braces
(e.g. <code>{42}</code>), which means that the following bytes are literal data
to be treated as part of the current logical line. Fortunately, this
is independent from the parsing itself, so I have a function that
splits the data by logical lines and passes everything to the parse
function.</p>
<p>So far, my little client is able to select a mailbox, search for
unread messages and fetch the messages, and my parser is sufficient
for all of that.</p>
<div class="share"></div>
how to enable GnuTLS for Emacs 24 on Windowshttp://xn--9dbdkw.se/diary/how_to_enable_GnuTLS_for_Emacs_24_on_Windows/index.en.html2014-04-26T00:01:11Z2014-04-26T00:01:11Z
<p>Emacs 24 introduced the possibility to open TLS network connections
using the GnuTLS library directly, instead of using a command line
tool as a wrapper. This is especially interesting for those who are
stuck using Emacs on Windows, as the command line tools can be rather
brittle on that platform.</p>
<p>However, there are some steps that need to be performed in order to
get native GnuTLS to work. This page attempts to describe them.</p>
<h1>Get a GnuTLS-enabled Emacs</h1>
<p>The Windows binaries available for download from the GNU site are
compiled against GnuTLS, but if you compile your own Emacs, see the
file <code>nt/INSTALL</code> in the Emacs source distribution for instructions.</p>
<h1>Find the GnuTLS DLLs</h1>
<p>The first google hit for "emacs gnutls windows" is
<a href="http://www.gnu.org/software/emacs/manual/html_mono/emacs-gnutls.html">this page</a>.
It says:</p>
<blockquote>
<p>There's one way to find out if GnuTLS is available, by calling
<code>gnutls-available-p</code>. This is a little bit trickier on the W32
(Windows) platform, but if you have the GnuTLS DLLs (available from
<a href="http://sourceforge.net/projects/ezwinports/files/">http://sourceforge.net/projects/ezwinports/files/</a>
thanks to Eli Zaretskii) in the same directory as Emacs, you should
be OK.</p>
</blockquote>
<p>On that page, I found:</p>
<pre><code>gnutls-3.0.9-w32-bin.zip 2012-01-02 7.2 MB
</code></pre>
<h1>Extract the GnuTLS DLLs</h1>
<p>I first naïvely tried opening the zip file in Explorer and copying the
files from there, but that does nothing—it neither copies the files
nor displays any error message. You need to extract the zip file, and
then copy all DLL files to the <code>bin</code> directory where your Emacs is
installed, probably somewhere like
<code>C:\Program Files (x86)\emacs-24.3\bin</code>.</p>
<h1>Restart Emacs and try it</h1>
<p>At this point, if you restart Emacs and type:</p>
<pre><code>M-: (gnutls-available-p) RET
</code></pre>
<p>you should see <code>t</code> in the echo area, which means that Emacs can find
the GnuTLS libraries.</p>
<h1>Configure trust files</h1>
<p>However, if you try to open a TLS connection, it will fail complaining
that certificate validation failed. This happens because GnuTLS needs
to have a set of CA certificates to verify the certificates of the
servers it connects to. It looks for CA certificates in the locations
specified in the variable <code>gnutls-trustfiles</code>, but none of the default
values work out of the box on Windows.</p>
<p>I'm not aware of any way to make GnuTLS use any certificates that come
with the Windows system, so you need to get a certificate bundle from
elsewhere. The cURL project
<a href="http://curl.haxx.se/docs/caextract.html">provides such a bundle</a> that
you can download. Download the <code>cacert.pem</code> file to a suitable
location, and point <code>gnutls-trustfiles</code> to it with <code>customize-option</code>.
Note that the file name is passed unexpanded to GnuTLS, so you cannot
use <code>~</code> as a shorthand for your home directory; use the full absolute
file name instead.</p>
<h1>See if it works</h1>
<p>Paste the following piece of code into the <code>*scratch*</code> buffer:</p>
<pre><code>(condition-case e
(delete-process
(gnutls-negotiate
:process (open-network-stream "test" nil "www.google.com" 443)
:hostname "www.google.com"
:verify-error t))
(error e))
</code></pre>
<p>Then put point at the end and hit <code>C-j</code>. If <code>nil</code> gets inserted into
the buffer, then the certificate could be verified, and your setup
appears to be working.</p>
<p>Otherwise, you'll see an error like:</p>
<pre><code>(error "Certificate validation failed www.google.com, verification code 66")
</code></pre>
<p>If so, a good place to start debugging is setting the variable
<code>gnutls-log-level</code> to a value greater than 0.</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/how_to_enable_GnuTLS_for_Emacs_24_on_Windows/index.en.html" rev="flattr;language:en_GB;category:text;tags:emacs,gnutls;" title="How to enable GnuTLS for Emacs 24 on Windows">Emacs 24 introduced the possibility to open TLS network connections using the GnuTLS library directly, instead of using a command line tool as a wrapper. This is especially interesting for those who are stuck using Emacs on Windows, as the command line tools can be rather brittle on that platform. However, there are some steps that need to be performed in order to get native GnuTLS to work. This page attempts to describe them.</a></p>
Why doesn't M-x proced work on OSX?http://xn--9dbdkw.se/diary/Why_doesn__39__t_M-x_proced_work_on_OSX__63__/index.en.html2014-05-20T10:00:17Z2013-09-03T12:51:13Z
<p>In Emacs 23 or later, you can use <code>M-x proced</code> to get a list of
running processes. You can sort and filter them in various ways, the
most common end goal being to quickly find and kill certain processes
in my experience.</p>
<p>However, Proced currently doesn't work on OSX. I just spent a few
minutes figuring out why, so I hope writing this could save someone
else some effort.</p>
<p>Proced is <em>not</em> based on command line tools such as <code>ps</code>, but uses
Emacs Lisp functions implemented in C to get the list of processes
(<code>list-system-processes</code>) and to get process attributes
(<code>process-attributes</code>). <code>list-system-processes</code> works on OSX, but
<code>process-attributes</code> does not.
<a href="http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/src/sysdep.c"><code>sysdep.c</code></a>
contains a few different implementations guarded by <code>#ifdef</code>s, and
this is the one chosen for OSX:</p>
<pre><code>Lisp_Object
system_process_attributes (Lisp_Object pid)
{
return Qnil;
}
</code></pre>
<p>In March 2010, this was <a href="https://email.esm.psu.edu/pipermail/macosx-emacs/2010-March/001869.html">discussed on the macosx-emacs mailing
list</a>,
and a patch giving parts of the needed information yielded <a href="https://email.esm.psu.edu/pipermail/macosx-emacs/2010-March/001873.html">a
screenshot</a>,
but it seems that it wasn't finished, nor merged into Emacs.</p>
<p><strong>Update</strong>: I got bored and <a href="http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16579">wrote a patch for it</a>. It
basically works, but there are some things that it currently doesn't
retrieve, notably memory and CPU usage, and command line
arguments.</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/Why_doesn__39__t_M-x_proced_work_on_OSX__63__/index.en.html" rev="flattr;language:en_GB;category:text;tags:emacs;" title="Why doesn't M-x proced work on OSX?">Emacs' process editor (proced) works on many operating systems, but not OSX. Here is why.</a></p>
Erlang prōses cild fr ōld cōdhttp://xn--9dbdkw.se/diary/Erlang_process_killed_for_old_code/index.sp.html2013-08-26T00:32:51Z2013-08-20T11:55:49Z
<p>In Erlang, if a prōses iz runing cōd frm modyul <code>a</code> wen modyul <code>a</code> iz
rēlōdd, it duznt get outomaticli upgrādd tu th nyu vurjhn. Th ōld vurjhn ov
th cōd iz kept az long az eni prōses iz yuzing it, nd th prōses iz sed tu b
runing "ōld cōd".</p>
<p>Hauever, ōnli won ōld vurjhn iz kept, so if th prōses duznt swich tu th nyu
vurjhn bifor th modyul iz rēlōdd fr a secnd tīm, th prōses wil b cild bī th
cōd survr. This can b cnfyuzing, az thr iz oftn no trās ov th prōses dīng,
nd ēvn if thr iz, yu ōnli get tu nō that th prōses woz cild, but not y.</p>
<p>Wīl chāzing daun a problm rilātd tu this, Ī cām up with this pach tu th cōd
survr:</p>
<pre><code>diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index 00ad923..c4d5fd6 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -1414,6 +1414,7 @@ do_purge(Mod0) ->
do_purge([P|Ps], Mod, Purged) ->
case erlang:check_process_code(P, Mod) of
true ->
+ catch info_msg("Killing ~p for old code from ~p", [P, Mod]),
Ref = erlang:monitor(process, P),
exit(P, kill),
receive
</code></pre>
<p>That led mē strāt tu th modyul that woz bēng rēlōdd, nd let mē fix th problm
bī enshoring that th prōses swichd tu nyu cōd.</p>
<p>This pach iz probubli not sūtbl fr inclūjhn in th ofishl Erlang/OTP sorsiz,
but Ī hōp it can b yusfl wen diveluping.</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/Erlang_process_killed_for_old_code/index.sp.html" rev="flattr;language:en_GB;category:text;tags:erlang;" title="Erlang prōses cild fr ōld cōd">Hau can yu nō wen th cōd survr cils yur prōses, nd y?</a></p>
Erlang process killed for old codehttp://xn--9dbdkw.se/diary/Erlang_process_killed_for_old_code/index.en.html2013-08-20T11:55:27Z2013-08-20T11:55:27Z
<p>In Erlang, if a process is running code from module <code>a</code> when module
<code>a</code> is reloaded, it doesn't get automatically upgraded to the new
version. The old version of the code is kept as long as any process
is using it, and the process is said to be running "old code".</p>
<p>However, only one old version is kept, so if the process doesn't
switch to the new version before the module is reloaded for a second
time, the process will be killed by the code server. This can be
confusing, as there is often no trace of the process dying, and even
if there is, you only get to know that the process was killed, but not
why.</p>
<p>While chasing down a problem related to this, I came up with this
patch to the code server:</p>
<pre><code>diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index 00ad923..c4d5fd6 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -1414,6 +1414,7 @@ do_purge(Mod0) ->
do_purge([P|Ps], Mod, Purged) ->
case erlang:check_process_code(P, Mod) of
true ->
+ catch info_msg("Killing ~p for old code from ~p", [P, Mod]),
Ref = erlang:monitor(process, P),
exit(P, kill),
receive
</code></pre>
<p>That led me straight to the module that was being reloaded, and let me
fix the problem by ensuring that the process switched to new code.</p>
<p>This patch is probably not suitable for inclusion in the official
Erlang/OTP sources, but I hope it can be useful when developing.</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/Erlang_process_killed_for_old_code/index.en.html" rev="flattr;language:en_GB;category:text;tags:erlang;" title="Erlang process killed for old code">How can you know when the code server kills your process, and why?</a></p>
DRIVER_IRQL_NOT_LESS_OR_EQUAL in w22nt51.sys BSODhttp://xn--9dbdkw.se/diary/DRIVER__95__IRQL__95__NOT__95__LESS__95__OR__95__EQUAL_in_w22nt51.sys_BSOD/index.en.html2013-07-07T23:22:20Z2013-07-07T23:14:40Z
<p>So I was dusting off an old Windows XP machine, applying security
updates for the last few years, when suddenly I found that the machine
would crash with a BSOD a few minutes after boot. The BSOD said that
a <code>DRIVER_IRQL_NOT_LESS_OR_EQUAL</code> error had occured in w22nt51.sys.
Googling that lead to <a href="http://www.chetos.net/blog.asp?what=dispPost&postUID=25088">this article</a>, which revealed that
this is a problem in the driver for the Intel 2200BG wireless network
card.</p>
<p>Broken network drivers usually lead to chicken-and-egg problems, and
that article suggests a way around that, but fortunately I had an
Ethernet cable at hand and was not entirely dependent on wireless
network. (The cable was in my "give away or throw away" bag, so I'm
grateful for my laziness and will reconsider some of the items in it.)</p>
<p>So I solved this by the following steps:</p>
<ul>
<li>Boot into "Safe mode" (without networking).</li>
<li>Deactivate the wireless network card in the "System" section of the
control panel, to stop the crashes.</li>
<li>Boot into "Safe mode with networking" (though a normal boot would
probably have been sufficient at this point) and connect the
Ethernet cable.</li>
<li>Download the new driver from the <a href="https://downloadcenter.intel.com/">Intel Download Center</a>.</li>
<li>Install the driver.</li>
<li>Reboot, to make sure the old driver is not in use (not sure if
necessary).</li>
<li>Reactive the device in the control panel.</li>
</ul>
<p>And it works!</p>
<p>So why am I subjecting myself to Windows XP again? Simply because the
firmware upgrade tool for my HTC phone requires Windows. Also, now I
have the opportunity to test whether my <a href="http://emacs-jabber.sourceforge.net/">Emacs-based Jabber
client</a> works well with Windows. (One of these days…)</p>
monspuraj programojhttp://xn--9dbdkw.se/diary/monspuraj_programoj/index.eo.html2012-11-25T23:08:22Z2012-11-25T22:48:04Z
<p>Mi komencis scivoli, kial restas tiel multe da monato je la fino de la
mono.</p>
<p>Mi ja havas la konteltirojn de la banko, do mi povus rigardi ilin kaj
mem sumigi kion mi pagis al kiu, sed tiun laboron la komputilo devus
fari por mi, ĉu ne? Pasintjare mi komencis por tio uzi
<a href="http://hledger.org">hledger</a>. Tio kio plej logis min al ĝi estis ke ĝi
konservas transakciojn en teksta dosiero. Tia dosiero estas facile
redaktebla per ajna tekstoredaktilo, kaj se pro iu kialo mi ne plu
povus uzi tiun programon, mi ĉiukaze povus legi miajn datumojn.</p>
<p>Iel mi devas enmeti la datumojn en la programon. Mia banko permesas
elŝuti konteltirojn en "CSV-formato" (datumeroj disigitaj per komoj).
hledger havas funkcion por legi transakciojn el CSV-dosiero, dividi la
transakciojn en kategoriojn (ekz. manĝo, lupago, transporto ktp)
surbaze de la priskriba teksto kaj dosiero kun reguloj, kaj krei
tekstan dosieron laŭ la formato de hledger. La procedo estis la jena:</p>
<ol>
<li>Elŝuti dosierojn de la banka retejo. Estas po unu dosiero por ĉiu
konto (kuranta konto, ŝparkonto, kreditkarto). Por la kuranta konto
kaj la ŝparkonto mi povas elekti ajnan periodon ene de la lastaj tri
monatoj, sed por la kreditkarto mi povas elekti nur laŭ pagperiodo
(t.e. ekde la mezo de unu monato ĝis la mezo de la sekva).</li>
<li>Alinomi la dosierojn. La nomoj de la elŝutitaj dosieroj konsistas
el la elŝutodato (ne la dato(j) de la elektita periodo) kaj la
kontonumero, sed tiutempe hledger postulis ke la CSV-dosieroj havu
nomon kun sama komenco kiel la dosiero kun kategorireguloj, do mi
devis permane ŝanĝi la nomon de la dosieroj.</li>
<li>Transformi la dosierojn al hledger-formato.</li>
<li>Enmeti la transformitajn transakciojn en la ĝeneralajn dosierojn,
kiuj enhavas transakciojn el pasintaj periodoj. Necesas atenti ke
neniu transakcio aperu dufoje en la ĝenerala dosiero. Tio povus okazi
se mi malprecize elektis la elŝutperiodojn.</li>
</ol>
<p>Tiu procedo ja estas komplika, kaj enhavas permanajn paŝojn kiuj estas
tedaj kaj erariĝemaj, do mi ekserĉis alian programon por spuri spezojn.</p>
<p>(Se vi ne deziras legi pri la diversaj programoj kiujn mi provis, tuj
saltu al la <a href="http://xn--9dbdkw.se/diary-all/index.tp.html#konkludo">konkludo</a>.)</p>
<h1>Gnucash</h1>
<p>En pli frua epoko mi uzis <a href="http://www.gnucash.org">Gnucash</a>. Tiam mi konservis
paperajn kvitancojn, permane entajpis ilin en Gnucash, kaj de temp' al
tempo bilancis komparante al la banka konteltiro. Ĉi-foje mi tamen
deziras sistemon pli aŭtomatan.</p>
<p>Gnucash povas importi QIF-dosierojn (kiajn mi ankaŭ povas elŝuti de la
banko). Tamen estis pli malfacile enkategoriigi transakciojn: dum la
importado, mi povis doni kategorion al ĉiu unuopa transakcio, kaj
supozeble Gnucash iom post iom lernas kiel enkategoriigi transakciojn,
sed mankis al mi la definitivaj reguloj de hledger: ekzemple
transakcioj pri monmaŝinaj elprenoj aperas en la konteltiroj kun la
teksto "CASH" sekvata de la adreso de la monmaŝino, kaj sekve mi volus
ke ĉiuj transakcioj kun tia priskribo aperu en unu kategorio, sed en
Gnucash mi ŝajne devus fidi la lernemon de la programo.</p>
<p>Post la importado, mi elserĉis ĉiujn transakciojn kun tia priskribo,
kaj ekhavis liston. En tiu listo mi provis samtempe ŝanĝi la
kategorion de ĉiuj transakcioj, sed tio ne eblis — en Gnucash entute
ne eblas ŝanĝi pli ol unu transakcion per unu paŝo, kio estas granda
malavantaĝo kompare al la situacio en hledger.</p>
<p>Do mi decidis provi aliajn programojn antaŭ ol findecidi kion uzi.</p>
<h1>Skrooge</h1>
<p>Mi instalis <a href="http://skrooge.org/">Skrooge</a> kaj donis al ĝi miajn QIF-dosierojn.
Skrooge ŝajnis pli promesplena rilate al aŭtomatigo. Ĝi permesas krei
regulojn, kun kondiĉoj kaj agoj, kiuj aŭtomate aplikiĝas al
transakcioj. Tio estas farata per grafika interfaco, kaj postulas
sufiĉe multe da musklakado, sed ĉar sufiĉas tion fari unu fojon, mi
imagas ke ne estas tiom terure. (En hledger, mi ofte aldonis novajn
regulojn kiam aperis transakcio ne kovrata de jam ekzistanta regulo.)</p>
<p>Resume, la programo ŝajnis sufiĉe taŭga. La interfaco estas plena je
funkcioj, por kiujn lerni oni ŝajne bezonas multe da tempo, sed
principe tio estas bona afero.</p>
<p>Ekaperis grava manko nur kiam mi faris duan importadon. La programo
aŭtomate metas transakciojn en konton kun nomo de la importata
dosiero, do mi jam ŝanĝis la nomojn de la kontoj al senchavaj nomoj.
Tamen, je la dua importado mi denove havis kontojn kun nurciferaj
nomoj, kaj mi tute ne povis trovi manieron movi la transakciojn al jam
ekzistantaj dosieroj. Tiu nefleksebleco ĝenis min, do mi daŭrigis
mian serĉadon.</p>
<h1>KMyMoney</h1>
<p>Venis la vico de <a href="http://kmymoney2.sourceforge.net/">KMyMoney</a>. Ĝi sen plendoj importis miajn
QIF-dosierojn, sed kiom ajn mi serĉis, mi ne sukcesis krei kategoriajn
regulojn por importataj transakcioj. Verŝajne la programo ne celas
mian uzostilon, sed tiun de malpli pigraj homoj kiuj mem entajpas
siajn transakciojn, kaj poste elŝutas konteltiron por certigi ke la
banko konsentas kun ili.</p>
<p><a name="konkludo"></a></p>
<h1>Reen al hledger</h1>
<p>La rezulto de mia esplorado konfuzis min. Mi volis foriri de mia
antaŭa sistemo pro tio, ke ĝi estas tro komplika kaj postulas tro da
permana traktado — ĝi aspektas kiel sistemo farita de "nerdo" por
"nerdo". Tiuj ecoj igis ĝin tro malfacile uzebla por ke mi havu la
emon daŭre enmeti novajn konteltirojn. Mi ankaŭ tion timis, ke mia
sistemo eble estis tro ligita al la komputilo en kiu ĝi rulis, tiel ke
estus malfacile movi ĝin al alia komputilo se bezonatus. Tial mi
serĉis programon celatan al pli vasta celgrupo, sed tio kion mi trovis
ne kontentigis min.</p>
<p>Do mi decidis resti ĉe hledger, kaj pliefikigi mian uzon de ĝi:</p>
<ul>
<li>Mi kreis skripton kiu alinomas elŝutitajn dosierojn laŭ la datoj
de la entenataj transakcioj. Tiel mi povas facile konservi
sinsekvajn konteltirojn en unu dosierujo, kaj per unu rigardo vidi
kiujn konteltirojn mi havas kaj kiujn ne.</li>
<li>Mi kreis skripton kiu konvertas la elŝutitajn dosierojn al dosieroj
laŭ la formato de hledger. (hledger intertempe jam permesas ke la
elŝutita konteltirdosiero kaj la regulardosiero havu diversajn
nomojn.)</li>
<li>Mi kreis skripton kiu kreas dosieron kiu referencas ĉiujn
konteltirojn en la dosierujo, tiel ke mi ne plu bezonas mem kunglui
la sinsekvajn konteltirojn.</li>
</ul>
<p>Ankoraŭ la alinomado estas iom malglata; necesas permane alinomi la
elŝutitan konteltirdosieron, kaj poste permane ruligi la alinomadan
skripton. Mi tamen esperas ke la ĝisnunaj faciligoj povos venki mian
pigrecon kaj inspiri min daŭre elŝuti kaj enkategoriigi transakciojn,
tiel ke mi havos ĉiujn haveblajn informojn pri kien iris la mono.</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/monspuraj_programoj/index.eo.html" rev="flattr;language:eo_EO;category:text;tags:esperanto hledger gnucash kmymoney skrooge;" title="monspuraj programoj">Mi komencis scivoli, kial restas tiel multe da monato je la fino de la
mono, kaj entreprenis esploron pri librotenaj programoj…</a></p>
la prezo de vantecohttp://xn--9dbdkw.se/diary/la_prezo_de_vanteco/index.eo.html2012-10-11T23:50:14Z2012-10-07T16:47:03Z
<p>De temp' al tempo mi vidis ĉe Guglo serĉrezultojn apud kiuj aperas la
nomo kaj foto de la aŭtoro. Tio ekinteresis min pro du kialoj. Unue,
mi interesiĝas pri kiel komputiloj (ĉi-kaze la serĉilo de Guglo)
"legas" retpaĝojn, eltiras el amaso de teksto informojn por uzi en
struktura maniero. Iusence la komputilo "komprenas" simplan paĝon de
teksto, kvankam tio principe devus postuli veran inteligentecon. Due
— pro vanteco, kompreneble.</p>
<p>Mi esploris pri kiel igi mian retejon aperi en serĉrezultoj kun mia
nomo kaj foto, kaj rapide trovis ke tiu funkcio estas forte ligita al
profiloj ĉe Google+. Tio iom malemigis min pri la afero. Mi efektive
<a href="https://plus.google.com/110837891466549138033" rel="author">havas
profilon</a> tie, sed ne tre ŝatas <a href="http://www.jwz.org/blog/2011/08/nym-wars/">kiel Guglo+ insistas pri "veraj
nomoj"</a>, kaj malmulte uzis la servon.</p>
<p>Do, tio devigis min pensi pri la prezo de vanteco ☺</p>
<p>Mi eklegis <a href="http://support.google.com/webmasters/bin/answer.py?hl=en&answer=1408986">paĝon ĉe "Retejestraj iloj" de Guglo</a> kiu
priskribas kiel fari. Ĝi proponas du opciojn: unue, konekti
retpoŝtadreson ĉe la domajno de la retejo kaj mencii la nomon de la
aŭtoro en ĉiu paĝo — mi provis tion, sed ne sukcesis igi la testilon
rekoni mian nomon — due, krei ligilon al mia profilo ĉe Google+ en ĉiu
paĝo kiu aperu kun nomo kaj bildo en serĉrezultoj.</p>
<p>La dua opcio ja kontraŭus la ĝenerale minimumisman aspekton de mia
retejo, do mi kreis tian ligilon nur en la <a href="http://xn--9dbdkw.se/diary-all/../">ĉefpaĝo</a>. Kaj
kelkajn tagojn poste aperis sukceso:</p>
<p><a href="http://xn--9dbdkw.se/diary-all/../photos/mia-retejo.png"><img class="img" height="91" src="http://xn--9dbdkw.se/diary-all/../photos/mia-retejo.png" width="379" /></a></p>
<p>Do, mi ricevis mian vantaĵon, kaj Guglo ricevis ligilon al sia
profilservilo. Kiu venkis?…</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/la_prezo_de_vanteco/index.eo.html" rev="flattr;language:eo_EO;category:text;tags:esperanto,google;" title="la prezo de vanteco">Mi esploris pri kiel igi mian retejon aperi en serĉrezultoj kun mia nomo kaj foto…</a></p>
kiel igi nnmaildir bone funkcii kun offlineimaphttp://xn--9dbdkw.se/diary/getting_nnmaildir_to_play_nice_with_offlineimap/index.eo.html2014-10-18T16:38:09Z2012-09-13T08:51:25Z
<p>Iuj homoj ŝatas legi sian retpoŝton en Emakso. Kompreneble, Emakso
inkluzivas
ne nur unu sed du retpoŝtlegilojn, el kiuj la plej funkciriĉa estas Gnus.
Uzante Gnus vi povas elekti inter pluraj diversaj formatoj por konservi
retpoŝton en la loka disko. Eble vi volas uzi offlineimap por elŝuti
retpoŝton el IMAP-servilo, kaj ĉar offlineimap uzas la formaton Maildir, vi
eble imagus ke la modulo nnmaildir estas ĝuste tio kion vi serĉas.</p>
<p>Tamen, jam estas <a href="http://lists.debian.org/msgid-search/%3c87hdrivzuk.fsf%40scabbers.bignachos.com%3e">dokumentite</a> ke ekzistas kelkaj
problemoj pri nnmaildir. Precipe, nnmaildir kaj offlineimap ne
konsentas pri kiel marki mesaĝon legita. Normale, offlineimap
intersamigas tiajn markojn inter la servilo kaj via loka mesaĝujo,
tiel ke mesaĝo kiun vi legis en unu loko fine estos markita kiel
legita ankaŭ en la alia loko, sed ĉi-kaze ni malbonsortas; oni devus
marki malnovajn mesaĝojn legitaj en ambaŭ lokoj, kio pli-malpli
sensencigas la intersamigadon de offlineimap.</p>
<p>Alveninte al tiu punkto, plej multaj homoj rezignas pri nnmaildir kaj
instalas en sian komputilon Dovecot, malgranda IMAP-servilo, igas ĝin
servi la Maildir-dosierujon per IMAP, kaj konektas Gnus al ĝi per la
modulo nnimap. Tio estas tre racia solvo, kaj verŝajne la plej
sendolora.</p>
<p>Kompreneble, per tia solvo oni maltrafas ŝancon atingi eternan famon
per skribado de kodo, do mi ekfosis en <code>nnmaildir.el</code>. Mi trovis ke
ĝi ne atentas tion kion diras <a href="http://cr.yp.to/proto/maildir.html">la specifo de Maildir</a>
pri mesaĝomarkoj, sed konservas markojn laŭ formato propra al Gnus en
la Maildir-dosierujo. Tiu formato restos bezonata, ĉar ne ĉiuj
markoj, kiujn uzas Gnus, estas prezenteblaj per Maildir-markoj, sed la
plej gravaj ("legita", "respondita" kaj "atentenda") povas esti
konservitaj en parto de la dosiernomoj de la mesaĝoj. Mi verkis
<a href="https://github.com/legoscia/gnus/compare/nnmaildir-flags-may-eat-your-email">flikaĵon</a> kaj afiŝis ĝin en la <a href="http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8055#41">cimraporto</a> pri
tiu ĉi funkcio. Ekde 2012-09-05 ĝi estas inkluzivita en la ĉefa
branĉo de Gnus, kaj la ŝanĝo aperis en GNU Emacs 24.3.</p>
<p>Do, jen ĝi, preta por testado. Ŝajne estas iuj problemetoj, tiel ke
ĝi iam ne markas mesaĝon legita kvankam ĝi devus, sed ĝis nun ĝi ŝajne
ne kutimas manĝi ies retpoŝton.</p>
<h1>Ne sufiĉe rapida</h1>
<p>Restas pliaj farindaĵoj pri nnmaildir; ĝis nun miaj ŝanĝoj nur celis
korektan funkciadon, do la sekva paŝo estas igi ĝin rapida. Ĝi
funkcias sufiĉe bone por retpoŝtujoj kun miloj da mesaĝoj, sed kiam
temas pri dekmiloj startado de Gnus longe daŭras. (La logika solvo
por tio estas neniam eliri el Gnus, sed…) Mi ankoraŭ ne tute certas
pri ĉio ĉi, sed mi pudris informmesaĝojn sur la kodon kaj ĝis nun ili
sugestas ke la plejparto de la tempo uziĝas en
<a href="http://github.com/legoscia/gnus/blob/17e4da771f56d2f954e02ab46cc25abbbcd94696/lisp/nnmaildir.el#L565"><code>nnmaildir--grp-add-art</code></a>. Se mi ĝuste legas tiun kodon,
ĝi ŝajne enmetas ĉiun artikolon, unu post alia, en laŭordan liston
nomatan <code>nlist</code>. Evidente, en la plej malbona kazo tio havas
kvadratan tempokomplikecon. Miaj pensoj ĉi-momente estas jenaj:</p>
<ul>
<li>Ĉu tio ĉi bezonas esti laŭorda listo? (Aliaj partoj de la kodo faras
operaciojn je laŭvicaj partoj de tiu ĉi listo, sed eble ni povus uzi
arbon aŭ ion tian…)</li>
<li>Ĉu ni vere bezonas teni ĉion ĉi en la memoro? Temas pri datumoj pri
ĉiu mesaĝo en la dosierujo; plej verŝajne ni la plejmulton neniam
uzos.</li>
</ul>
<p>Jen la nuna stato. Mi plu laboros pri tio ĉi, dum liberaj tempoj.</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/getting_nnmaildir_to_play_nice_with_offlineimap/index.eo.html" rev="flattr;language:eo_EO;category:text;tags:emacs,email,offlineimap,gnus;" title="Kiel igi nnmaildir bone funkcii kun offlineimap">nnmaildir, la realigo de Maildir en Gnus, ne konsentas kun offlineimap pri kiel aspektas legita mesaĝo. Mi provas ripari tion, kaj ankaŭ aliajn problemojn pri nnmaildir.</a></p>
De kiu vi lernis Esperanton?http://xn--9dbdkw.se/diary/de_kiu_vi_lernis_esperanton/index.eo.html2012-08-28T00:05:48Z2012-08-28T00:08:43Z
<p>De kiu vi lernis Esperanton? Kaj de kiu lernis tiu persono
Esperanton? Kaj de kiu…</p>
<p>Mi ekhavis ideon, ke estus interese "spuri" kiel scio de Esperanto
iris tra homoj dum la historio, kaj tiel krei kvazaŭ parencaran
arbon. Kompreneble ekzistas malklaraj kazoj — mi mem eklernis
Esperanton per letera kurso enretigita; ĉu en tiu kazo oni konsideru
la verkinton de tiu letera kurso mia "instruisto", aŭ ĉu mi estas
"memlerninta"? Kaj tiel plu.</p>
<p>Ĉu iu simila esploro jam ekzistas?</p>
<p><a class="FlattrButton" href="http://xn--9dbdkw.se/diary/de_kiu_vi_lernis_esperanton/index.eo.html" rev="flattr;language:eo_EO;category:text;tags:esperanto;" title="De kiu vi lernis Esperanton?">De kiu vi lernis Esperanton? Kaj de kiu lernis tiu persono Esperanton? Kaj de kiu… </a></p>