Things that live here:

  1. Work log, where I note things I feel I'll have to Google later.
  2. Journal, very similar but about non-IT topics.
  3. Blog for rare longer-form posts (last one below).
  4. Links blog, formerly my personal wiki.

Feel free to look at what you can find here and enjoy yourself.


~17% of my country is occupied by Russia, and horrible things are happening there. You can help stop this! If you can donate - I contribute to (and fully trust) Come Back Alive and Hospitallers, but there are also other ways to help.

If you're in Germany, DHL sends packets with humanitarian help for free!

Latest posts from the Work log

Day 1935

Latex centering wide tables

… is hard and nothing worked. If it’s over the margin at least.

After trial and error I got this1.

% \centerline{
\begin{table}[t]
% \begin{center}
\footnotesize
\centering
    \addtolength{\leftskip} {-2cm} % increase (absolute) value if needed
    \addtolength{\rightskip}{-2cm}
% \begin{adjustbox}{center}
% \resizebox{1.0\textwidth}{!}{% Adjust the scale as needed
\begin{tabular*}{1.25\textwidth}{lrrrrrrrrr}
\hline
                          &   LOW &   WIS &   cats\_bin &   cats\_mc &   wordalpha &   wordlength &   UA-CBT &   UP-masked &   UP-unmasked \\
\hline
 BASELINE-human           &       0.97 &       0.94 &            0.97 &           0.98 &             0.92 &              0.94 &     0.94 &        0.84 &          0.88 \\
 BASELINE-random          &       0.09 &       0.05 &            0.50 &           0.20 &             0.50 &              0.50 &     0.17 &        0.10 &          0.10 \\
 Mistral-7B-Instruct-v0.2 &       0.34 &       0.19 &            0.59 &           0.71 &             0.48 &              0.71 &     0.46 &        0.75 &          0.86 \\
 Ms-Inst-Ukr-SFT          &       0.31 &       0.16 &            0.66 &           0.55 &             0.48 &              0.66 &     0.42 &        0.82 &          0.87 \\
 Ms-Inst-Ukr-Slerp        &       0.35 &       0.19 &            0.66 &           0.66 &             0.49 &              0.70 &     0.45 &        0.79 &          0.87 \\
 Ms-Inst-Ukr-sherl        &       0.37 &       0.19 &            0.69 &           0.76 &             0.50 &              0.75 &     0.55 &        0.88 &          0.92 \\
 gpt-3.5-turbo            &       0.68 &       0.34 &            0.68 &           0.91 &             0.78 &              0.89 &     0.61 &        0.77 &          0.86 \\
 gpt-4-1106-preview       &       0.67 &       0.39 &            0.86 &           0.93 &             0.85 &              0.95 &     0.97 &        0.96 &          0.97 \\
\hline
\end{tabular*}
% }
% \end{adjustbox}
% \caption[Evaluation scores]{\TODO{Scores of selected models}}
\label{tab:eval}
% \end{center}
\end{table}
% }

The width 1.25\textwidth has to be manually chosen otherwise the table lines are too long or short for the text.

If it’s too low or too high it causes this (left is low):

2024-04-18-140659_239x215_scrot.png 2024-04-18-140750_112x229_scrot.png

As usual, when doing these things, Overleaf’s draft mode is golden.

For positioning on the page, quoting Overleaf2:

The parameter `h!` passed to the table environment declaration establishes that this table must be placed _here_, and override LATEX defaults. The positioning parameters that can be passed-in include:

`h`
Will place the table _here_ approximately.

`t`
Position the table at the _top_ of the page.

`b`
Position the table at the _bottom_ of the page.

`p`
Put the table in a special page, for tables only.

`!`
Override internal LATEX parameters.

`H`
Place the table at this precise location, pretty much like h!.

Footnotes inside table latex

Fought long and hard on this till I got enlightened. The trivial stupid way works.

\providecommand{\dagtab}{%
{\textsuperscript{\dag}}
}
\providecommand{\asttab}{%
{\textsuperscript{*}}
}

% put it wherever in the table

\caption[Evaluation scores]{Scores of selected models. 

\dagtab LMES tasks (shortened for brevity)

This was so easy.

\ddag double dagger also exists
! as well

Day 1934

Insights on my writing with Grammarly

The UNLP workshop generously included a 3 months trial of Grammarly Premium, and this was interesting.

  • Shown in Fig. XXX

  • Oxford commas — Grammarly wants them, I seem to not, but I should decide on one

  • it specified the requirements, THE complexity of the story, … — when I list things I can’t use one article for all of them!

    • I would never write “I have a cat, dog, rabbit”, and that’s the same thing
  • e.g. requires a comma only in American English

  • I do A LOT of errors with duplicated words (the the)

    • A book I’m reading suggests using a different font and column width when proofreading just to catch such things
  • I don’t know how to spell a number of English words

    • accommodate
  • Many typos are acoustical ones if I’m tired, e.g. doc instead of dog

  • I use too many words

    • A lot of my passive can be really neatly rephrased into not-passive, for shorter sentences with fewer words
    • verb+noun often can be just a better verb (like make predictions => predict)
  • it removes many of my commas

    • I know it’s my Slavic language interference, but in many cases it makes the text way less clear imo

General impressions

  • It even knows that written in python requires Python to be capitalized!

i.e. and e.g. and commas

Comma after ‚i.e.‘ and ‚e.g.‘ – Business English & Übersetzungen:

  • i.e. means that is / in other words (from id est)
  • e.g. means for example

They are followed by commas in American English but not in British English.

Day 1933 / CLI webservice for easy sharing of files via curl

kubectl cp failed with errors, so.

file.io - Super simple file sharing



(rapids) root@lm-eval-sh:/data/output# curl -F "file=@more.zip" https://file.io

{"success":true,"status":200,"id":"xxx","key":"xxx","path":"/","nodeType":"file","name":"more.zip","title":null,"description":null,"size":46277219,"link":"https://file.io/xxx","private":false,"expires":"xxx","downloads":0,"maxDownloads":1,"autoDelete":true,"planId":0,"screeningStatus":"pending","mimeType":"application/octet-stream","created":"2024-04-16T15:19:10.227Z","modified":"2024-04-16T15:19:10.227Z"}

Generally, free curl file sharing online - Google Suche returns many services with potential.

Day 1932

Seaborn barplot ordering gotcha

seaborn.barplot — seaborn 0.13.2 documentation:

passing order=[list,of,cats,in,order] decides the ordering.

Otherwise “it will be inferred” except that it’s not always trivial to understand how exactly (or I’m too sleep-deprived).

And if I’m drawing horizontal lines on top of the bars in the barplot based on indexes then the order may be sligthly different.

Latex automated title case in titles

With the help of ChatGPT

\documentclass{article}
\usepackage{titlecaps}
\usepackage{etoolbox}

% Specify words to remain in lowercase unless they are the first word
\Addlcwords{the and but or nor for a an at by to in on with of}

\let\oldchapter\chapter
\renewcommand{\chapter}[1]{\oldchapter{\titlecap{#1}}}

\let\oldsection\section
\renewcommand{\section}[1]{\oldsection{\titlecap{#1}}}

\let\oldsubsection\subsection
\renewcommand{\subsection}[1]{\oldsubsection{\titlecap{#1}}}

\begin{document}

\section{an example of a section with and without uppercasing specific words}
This is some text.

\subsection{exploring the integration of tools in the workplace}
More text here.

\end{document}

Day 1929 / In LaTex you can put multiple labels to the same object

The same thing can have multiple names and that’s alright!

\label{old-subsection-name-maybe-linked-to-elsewhere}
\label{sec:eval-task-2}

Day 1928

Latex quotations

symbols - What is the best way to use quotation mark glyphs? - TeX - LaTeX Stack Exchange:

``this'' / `this' is the proper way
"this"/'this' produces two closing quotes and 'is annoying to readers'

There’s also CTAN: Package csquotes that ‘is fantastic’, including smartly doing nested quotes, correct quotes for diff languages, and ‘generally always doing what you want it it’:

\usepackage[autostyle]{csquotes}

...
\enquote{My quoted text}

Another answer suggests

\newcommand{\q}[1]{``#1''}

...

\q{whatever}

I’ve been using more custom latex commands lately and this goes in that direction.

I guess creating a \q that does autoquotes w/ csquotes is the way to go?

Latex margin notes

Margin notes - Overleaf, Online-LaTeX-Editor:

\marginpar{text} is the vanilla option, but this works in all cases ever:

\usepackage{marginnote}
\marginnote{text}

EXCEPT I couldn’t find a way to add footnote markers to have numbered margin notes separate from the real footnotes.

But this solves everything, quoting directly1:

\newcounter{mgncount}
\renewcommand\themgncount{\arabic{mgncount} }
\newcommand\marginfootnote[1]{\refstepcounter{mgncount}\marginpar{{$^\themgncount$}#1}\footnotemark}

\begin{document}
Can we put a footnote with number in the margin and a number in the text?\marginfootnote{There's a number here!}

Another test\marginfootnote{Working!}

One more try\marginfootnote{Successful!}
\end{document}

EDIT: actually it doesn’t and uses the number from footnotes in the text itself. :(

Ah, the sidenotes package exists: https://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/sidenotes/sidenotes.pdf

But uses only 1…3-type numbers.

Yes this is it! CTAN: Paket sidenotesplus

%\usepackage{sidenotes}
\usepackage[mark=Alph]{sidenotesplus}
...

\sidenote{does basically what footnote does}

It has a lot of options and can do a lot of things, yes, this is it, it’s perfect. The example page has everything: https://ctan.math.illinois.edu/macros/latex/contrib/sidenotesplus/tests-sidenoteplus.pdf

See also CTAN: Marginal topic.

marginpar - Footnote and number in margin - TeX - LaTeX Stack Exchange


  1.  ↩︎

Day 1925 / Masterarbeit final checklist

  • Punctuation

    • all citations to word~/cite{xxx}.
    • all footnotes to sentence.\footnote{}1
      • either full sentence or lowercase part
    • for both, it’s sent~\cite{}.\footnote{}
    • all numbers to 132,32.99
    • Consistent quoting (using the correct latex quotes or \enquote{} with italics for longer sentences.)
    • all refs to autorefs
      • Autoref fails with appendix subsections, do it manually.
    • tightlists everywhere
    • Overleaf ‘stop on first error’ to fix the errors
    • Title Case in all Titles
  • Bits

    • CBT-UA -> UA-CBT
    • LMentry-static-UA shorten to LMES once and keep using LMES.
    • Eval-UA-tion should be captialized
    • Thesis always capitalized
    • gpt2/GPT2 -> GPT-2.
    • check for stray ‘we’s in the paper
      • “our”/“we” “paper”
    • look for sticking out over-the-line bits
  • Not bits

    • go through all latex comments
    • go through all todos in home.md + taskwarrior

====== Open research questions:

  • Research
    • look into whether translated datasets are worse at stuff
    • monolingual VS multilingual models incl Ukrainian performance
    • Whether prompt language makes a differenec on Ukrainian task
  • Datasets:

SH, [10 Apr 2024 14:58:39] LMES — дослідити robustness моделей, і наприклад глянути яка залежність accuracy людей і ШІ в залежності від мммм різниці в довжині слів чи номеру слова (“яке стотринадцяте слово в реченні …”) CBT-UA — нормально evaluate, а ще для людей і машин — глянути scores якщо давати тільки challenge segment. Я це тестив з нейромережами (не попало в paper), але там дуже часто були кращі результати з фрагментом ніж з усією казкою

SH, [10 Apr 2024 14:59:57] Зробити датасет по biases і фемінітивам, у мене написаний код для генерації нульової версії, там по суті речення типу “моя жінка займається програмуванням компʼютерних систем, тобто за професією вона — ….”

SH, [10 Apr 2024 15:00:20] Мрія всього життя таки зробити Russian-Ukrainian interference dataset на предмет русизмів та російських помилок

SH, [10 Apr 2024 15:02:57] UA-CBT — взяти казки з project Gutenberg, взяти іноземні казки перекладені українською, і порівняти scores моделей на тасках по казкам з цих різних джерел. Можна забити на фільтрацію, чисто зробити human baseline на частині згенерованого датасету. Так можна зробити нереально великий датасет і знати що там максимум умовнио 80% бо 20% тасків сміття

Also:

  • CATSMC and friends — much larger datasets can be generated from the given data, a lot of combinations are possible.

Day 1913 / More latex tricks for spacing and references

\autoref is like \ref but it adds the word, not just the number. 3.2 -> Figure 3.2 : cross referencing - What’s the difference between \ref and \autoref? - TeX - LaTeX Stack Exchange

j

Day 1902 / Latex trivial TODO command

Wrapping stuff in this command makes it stand out; also greppable by TODO which removes the need to remember commands

\newcommand{\TODO}[1]{{\color{magenta}#1}}

Day 1900 / Locally debugging Huggingface Dataset scripts

Previously:

Is there a suggested way of debugging dataset generators? - 🤗Datasets - Hugging Face Forums

Instead of committing etc. every time, one can clone the dataset path locally through git and then point load_dataset() to that local folder with the dataset script file!


Latest post from Blog

'The Hacker Manifesto', переклад українською

Оригінал: .:: Phrack Magazine ::.
Контекст: Маніфест хакера — Вікіпедія / Hacker Manifesto - Wikipedia
Існуючий дуже класний переклад, не відкривав, поки не закінчив свій: Маніфест хакера | Hacker’s Manifesto | webKnjaZ: be a LifeHacker

                               ==Phrack Inc.==

                    Том I, випуск 7, Ph-айл[0] 3 з 10

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Наступне було написано невдовзі після мого арешту...

	                        \/\Совість хакера/\/

	                               автор:

	                          +++The Mentor+++

	                           8 січня 1986р.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

	Сьогодні ще одного спіймали, пишуть у всіх газетах. "Кібер-скандал:
підлітку повідомили про підозру", "Кіберзлочинця затримали після
проникнення в систему банку".
	Тупа школота[1], вони всі однакові.

	Та чи ви, з вашою трафаретною ментальністю[2] та знаннями 
інформатики зразка першої половини пʼятидесятих[3], коли-небудь дивилися 
в душу хакера?[4] Чи вас колись цікавило, що є причиною його поведінки[5], 
які сили на нього впливали, що його сформувало?
	Я хакер, ласкаво прошу у мій світ...
	Мій світ почався ще зі школи... Я розумніший за більшість інших
дітей, і дурниці, які нам викладають, мені набридають.
	Тупий відстаючий[6], вони всі однакові.

	Восьмий, девʼятий, десятий, одинадцятий клас[7]. В пʼятнадцятий
раз слухаю, як вчителька пояснює, як скорочувати дроби. Мені все ясно. "Ні, 
Вікторія Миколаївна[8], я не написав проміжні кроки, я розвʼязав все усно..."
	Тупий підліток. Мабуть списав. Всі вони такі.

	Сьогодні я зробив відкриття. Я знайшов компʼютер. Ха, почекай-но,
це круто. Він робить те, що я від нього хочу. І якщо він помиляється,
це тому, що помилився я. А не тому що він мене не любить...
                         Або відчуває від мене загрозу...
                         Або думає що я тіпа самий умний[9]...
                         Або не любить викладати[10] і йому тут не місце...
	Тупий підліток. Він постійно тільки грає в свої ігри. Всі вони такі...

	Потім це відбулось... відчинились двері в світ... несучись телефонною 
лінією як героїн венами наркомана, надсилається електронний пульс,
шукається спасіння від невігластва навколо...[11] Знаходиться борд.[12]
	"Це воно... це те, до чого я належу..."
	Я з усіма тут знайомий... попри те, що я з ними ніколи не 
зустрічався, не розмовляв, і колись можливо більше нічого не чутиму про 
них... Я їх всіх знаю...
	Тупий підліток. Знову займає телефонну лінію... Вони всі однакові.

	Та можете не сумніватись,[13] що ми всі однакові... Нас годували
дитячими сумішами з ложки, коли ми хотіли стейк... а ті куски мʼяса, які 
до нас все ж потрапляли, були вже пережовані і без смаку. Над нами
панували садисти, або нас ігнорували байдужі. Для тих, хто хотіли чомусь 
нас навчити, ми були вдячними учнями, але їх було як краплин дощу в
пустелі.

	Цей світ зараз наш... світ електрона і комутатора, світ краси
бода[14]. Ми користуємося існуючою послугою не платячи за те, що могло б 
бути дуже дешевим, якби ним не завідували ненажерливі бариги[15], і ви 
називаєте нас злочинцями. Ми досліджуємо... і ви називаєте нас 
злочинцями. Ми шукаємо знання... і ви називаєте нас злочинцями. Ми 
існуємо без кольору шкіри, без національності і без релігійної 
нетерпимості... і ви називаєте нас злочинцями. Ви будуєте атомні бомби, 
ви ведете війни, ви вбиваєте, обманюєте, і брешете нам, намагаючись 
заставити нас повірити, що ви це робите для нашого блага, і попри все - 
це ми тут злочинці.

	Так, я злочинець. Мій злочин - моя допитливість. Мій злочин - 
оцінювати людей по тому, що вони кажуть і думають, а не по тому, як 
вони виглядають. Мій злочин в тому, що я вас перехитрив, і ви мене 
ніколи не пробачите за це.

	Я хакер, і це мій маніфест. Можливо ви зупините мене як особу, але ви 
ніколи не зупините нас всіх... зрештою, ми всі однакові.
	

Замітки:

  1. Ph-айл: worst of both worlds between phile and файл
  2. Damn kids: тупі/кляті/грьобані діти/школота1/малолітки2? Дякую цьому твіту Букви, який дає мені моральне право використовувати слово “школота”, бо нічого інше не клеїлося (“Окаяні дітлахи!")
  3. three-piece-psychology: інтерпретую як невисоку оцінку розвитку внутрішнього світу. Тому: пересічним/шаблонним/банальним/трафаретним3/примітивним/нехитрим/безхитрим; psychology: ‘інтелект’ але не зовсім, мені подобається ‘ментальність’
  4. and 1950’s technobrain: Німецький переклад, який сподобався англіцизмами та дав ідею перекласти technobrain в значенні “знання про компʼютери”, а не слово в слово: Berühmte Manifeste 2 – openPunk
  5. хакер/гакер: Вікіпедія вважає обидва допустимими; сам Авраменко ссилаючись на ті самі правила українського правопису теж вважає обидва допустимими, але все ж любить “г” більше (Хакер чи гакер - експрес-урок - YouTube). А я не можу і не буду. Хакер. I will die on this hill.
  6. what makes him tick: TODO, нічого не подобається. Що його рухає/надихає, що у нього в середині, …
  7. underachiever: хай буде “відстаючий”. Хоча пригадую з ЗНО, що суфікси уч/юч обмежені у вживанні, правильніше ВІДСТАЛИЙ мені не подобається.
  8. junior high or high school: тут додаю драми замість дослівності, тому що все ближче до оригіналу, що я можу придумати, занадто канцеляристично: “я закінчую базову чи повну загальну середню освіту”..?
  9. Ms. Smith:
  10. I’m a smart ass
  11. doesn’t like teaching: оплакую невикористаний варіант від душі “ненавидить себе, дітей, і педагогіку”. Дуже оплакую.
  12. a refuge from the day-to-day incompetencies is sought
  13. a board is found: мається на увазі електронна дошка оголошень (BBS — Вікіпедія), дід форумів і прадід іміджбордів. Найцікавіше слово для перекладу. Якщо буде “борд” то збережеться драматизм оригіналу, але є шанси, що хтось спутає з іміджбордами. Коли вони були популярні, нормальні люди в Україні їх не називали ніяк, російською були варіанти “доска”, “бибиэска”4. “BBS” був би найпростішим виходом; “електронна дошка оголошень” знову ж таки канцеляризм. По контексту далі очевидно, що мова йде про якесь спілкування, тому хай буде “борд”, принесу в жертву однозначність і зрозумілість милозвучності.
  14. you bet your ass we’re all alike: як же складно підбирати такі речі. Умовні embeddings з ML тут були б в тему. “Дай мені щось на кшталт ‘авжеж’ тільки більш emphatical”. Попередня версія “Авжеж ми всі однакові!”
    1. You bet – phrases: базара нет, по любому, я вас умоляю
    2. Будьте певні5
    3. ЩЕ Б ПАК — СИНОНІМІЯ | Горох — українські словники
      1. Авжеж?6
  15. the beauty of the baud: Бод — Вікіпедія Нехай мій (і єдиний можливий) переклад буде всім настільки ж зрозумілим, наскільки мені був зрозумілий оригінал, коли я його читав вперше.
  16. profitteering gluttons

Hat tip to:

Random: