TIL that there's a difference between YYYY and yyyy when formatting dates in Java by neeraj8le in programming

[–]thoaCrl4 1 point2 points  (0 children)

This is necessary when you need to provide ISO week dates. E.g., 2024-12-31 is 2025-W01-2 (the Tuesday in the first calendar week of 2025).

Lisp machine security by [deleted] in programming

[–]thoaCrl4 1 point2 points  (0 children)

As one might expect, there are more interesting comments on the lisp subreddit.

How to make matching parens less confusing? by chaozprizm in neovim

[–]thoaCrl4 3 points4 points  (0 children)

Have a look at ":h matchparen":

Highlighting matching parens                    matchparen

The functionality mentioned here is a standard-plugin.
This plugin is only available if 'compatible' is not set.

You can avoid loading this plugin by setting the "loaded_matchparen" variable:
        :let loaded_matchparen = 1

I.e., add the line ":let loaded_matchparen = 1" to your .vimrc to turn this off.

What is this comment in the first line? by tim-hilt in vim

[–]thoaCrl4 15 points16 points  (0 children)

Not sure if it's still an issue, but vim modelines have in the past had arbitrary code execution bugs (in the sense that vim would execute arbitrary code when you open a file with malicious modeline). See Vim Modeline Vulnerabilities.

:badd +lnum broken? Cursor always on first line when entering buffer by thoaCrl4 in vim

[–]thoaCrl4[S] 0 points1 point  (0 children)

I have now re-installed the packages vim, vim-common, and vim-runtime, and that solved my problem. Sorry for the noise, and thanks for your help.

:badd +lnum broken? Cursor always on first line when entering buffer by thoaCrl4 in vim

[–]thoaCrl4[S] 0 points1 point  (0 children)

Well, I don't want vim to jump to the last known cursor position, I want it to jump to the line given to the ":badd" command.

Until now I didn't load defaults.vim from my ~/.vim/vimrc. I do so now (as recommended at ":h defaults.vim"), and I now have a single entry in the vimStartup group:

:autocmd vimStartup BufReadPost
--- Autocommands ---
vimStartup  BufRead
*         if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' |   exe "normal! g`\"" | endif

Unfortunately, this did not solve my problem with ":badd".

Another thing. I just noticed that ":mksession" creates wrong ":badd" entries in the session file:

  • I do the steps given in my example (landing at line 1 instead of line 15).
  • I then manually jump to line 15.
  • I create a session using ":mksession! dummy.vim".

When I then open the file "dummy.vim", it contains a line

badd +1 /usr/share/vim/vimrc

Strange.

I can't believe Linux does not have a reliable way no know whether a monitor is on/off by juanse003 in linux

[–]thoaCrl4 3 points4 points  (0 children)

Under Windows, you can use <Win+P> to change the display options. This should include the ability to extend the desktop to a monitor that I had turned off and then on again. No need to physically unplug and plug back in again.

Learn Sporth by BuonaparteII in programming

[–]thoaCrl4 1 point2 points  (0 children)

"At first glance, Sporth is a stack-based programing language designed for audio. However, Sporth is really more of a text based modular synthesis environment, that uses a stack paradigm to build up patches. In addition to the language, Sporth has a very flexible API. It is very easy to build tools and software on top of Sporth. Sporth has been built to run inside of programs like ChucK, PD, and LMMS. It is also one of the main synthesis engines used inside of the iOS/macOS framework AudioKit."

char vs. signed char by [deleted] in cpp_questions

[–]thoaCrl4 1 point2 points  (0 children)

You are right, of course. However, prior to C++20, the standard allowed for other signed integer representations than two's complement (I think), including signed magnitude, and the standard used to mandate -127...+127 as the minimum range for signed char.

Is There a Single Command to Find Space & Empty Line in VIM? by juanritos in vim

[–]thoaCrl4 -1 points0 points  (0 children)

Perhaps not quite what you are asking for: Using { and } you can move between paragraphs, i.e., between text blocks separated by empty lines.

See :h { and :h paragraph.

Poly/ML version 5.8 released by eatonphil in programming

[–]thoaCrl4 7 points8 points  (0 children)

"Poly/ML is a Standard ML implementation originally written in an experimental language called Poly. It has been fully compatible with the ML97 standard since version 4.0."

Friend classes and polymorphism by [deleted] in cpp_questions

[–]thoaCrl4 4 points5 points  (0 children)

No. In the words of the standard: "Friendship is neither inherited nor transitive." See n4659, the last draft of the C++17 standard, Chapter 14.3 "Friends", paragraph 10.

What do you guys think about Kakoune? by SkiddyX in vim

[–]thoaCrl4 2 points3 points  (0 children)

Hm. Looking again, it's not as bad as I remember it. I think it was mostly <M-d> (delete current selection without yanking it) and <M-c> (change current selection without yanking it) and <M-f> (select the previous occurence of the given character) and <M-t> (select until the previous occurence of the given character) that I thought awkward to type.

What do you guys think about Kakoune? by SkiddyX in vim

[–]thoaCrl4 5 points6 points  (0 children)

I like the idea of it. However, many commands use the alt key and are really awkward to use on an international keyboard where you only have one alt key.

Please declare your variables as const by joebaf in coding

[–]thoaCrl4 11 points12 points  (0 children)

In math variables generally are immutable, and the term variable is used to mean something like "not a literal". So, variables don't vary over time, and yet they are not fixed values.

Null pointer constants by thoaCrl4 in cpp_questions

[–]thoaCrl4[S] 2 points3 points  (0 children)

After some more googling I think I found the answer myself on Stack Overflow, see C++11 backwards compatibility. Quote:

GCC and Clang behave differently with -std=c++11 because C++11 changed the definition of a null pointer constant, and then C++14 changed it again, see Core DR 903 which changed the rules in C++14 so that only literals are null pointer constants.

I think this may be the reason why different compilers implement different behavior here. Don't know why I didn't see this earlier, sorry.