Thursday, March 17, 2016

Chronology for cwebmac.tex

texhax fith: Mon Feb 1 09:35:34 CET 2016
first letter to Scherer: 31 January 2016 at 19:45
first letter to texhax: Wed Jan 27 23:52:52 CET 2016
first reply from ascherer: 1 February 2016 at 00:46
letter to Karl about second bug in cwebmac.tex: 25 January 2016 at 09:45
date of release of fix to first bug: 2016-01-20
first post of Scherer to tex-k: Mon Feb 1 11:51:41 CET 2016

Wednesday, February 3, 2016

How to use gettext

#include<libintl.h>
#include<locale.h>
#include<stdio.h>

#define _(String) gettext (String)

int main()
{
    setlocale(LC_MESSAGES, "ru_RU.UTF-8");
    setlocale(LC_CTYPE, "ru_RU.UTF-8");
    bindtextdomain("helloworld","dir");
    textdomain("helloworld");
    printf(_("Hello World\n"));
    return 0;
}

$ xgettext -d helloworld -o helloworld.po -k_ -s helloworld.c

Now edit .po file (set UTF-8 and translation):

-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
 #: /tex_tmp/test.w:14
 msgid "Hello World\n"
-msgstr ""
+msgstr "привет\n"

$ msgfmt helloworld.po -o helloworld.mo

In the end you must get the following picture:

$ ls -l
total 24
-rwxr-xr-x 1 user user 7184 Feb  3 15:45 helloworld
-rw-r--r-- 1 user user  277 Feb  3 16:14 helloworld.c
-rw-r--r-- 1 user user  439 Feb  3 15:44 helloworld.mo
-rw-r--r-- 1 user user  668 Feb  3 15:43 helloworld.po
lrwxrwxrwx 1 user user    1 Feb  3 16:16 LC_MESSAGES -> .
lrwxrwxrwx 1 user user    1 Feb  3 16:17 ru -> .

now type `pwd' and put the result to "bindtextdomain" in program source.

now compile the program and run with `./helloworld'

Thursday, December 3, 2015

Saturday, November 28, 2015

TTY

http://a3nm.net/blog/unbuffering.html
http://technostuff.blogspot.ru/2008/10/some-useful-socat-commands.html
http://rdiez.shoutwiki.com/wiki/Serial_Port_Tips_for_Linux
http://www.linusakesson.net/programming/tty/
http://wiki.bash-hackers.org/howto/redirection_tutorial

Thursday, November 5, 2015

AVR

Extremely useful articles:
http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers-reading-and-writing-data/
http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers/

atmega168/328p: avrdude -c usbasp -p <MCU> -U lfuse:w:0xff:m -U hfuse:w:0xd7:m -U efuse:w:0x07:m -qq

FUSE:
-U lfuse:w:0xFF:m
tick EEPROM
untick BOOTRST, untick BOOTSZ*
untick all BODLEVEL

http://eleccelerator.com/fusecalc/fusecalc.php
http://www.martyncurrey.com/arduino-atmega-328p-fuse-settings/

http://www.appelsiini.net/2011/simple-usart-with-avr-libc

Read comments here: https://github.com/tuupola/avr_demo/blob/master/blog/simple_usart/Makefile

Thursday, October 15, 2015

lmfonts

https://www.tug.org/TUGboat/tb24-1/jackowski.pdf
http://texdoc.net/texmf-dist/doc/fonts/lm/lm-info.pdf