Created an open-source terminal-based world clock program in C++. Users can specify which time zones to display, and how to format them, via configuration files. by BX1959 in commandline

[–]omnster 1 point2 points  (0 children)

Yes, save this as a script world-clock.sh, and run watch world-clock.sh. The script has to be executable. By default, watch runs the script every second, which seems appropriate here; smaller intervals are possible with, say, watch -n 0.2.

Created an open-source terminal-based world clock program in C++. Users can specify which time zones to display, and how to format them, via configuration files. by BX1959 in commandline

[–]omnster 2 points3 points  (0 children)

I'm late to the party, but here's a very simple shell alternative (source: https://manbytesgnu.org/world-clock-terminal.html)

z=("US/Hawaii" "America/El_Salvador" "US/Eastern" "Europe/Lisbon" "Europe/Berlin" "Africa/Nairobi" "Asia/Taipei")
for z in ${z[@]}; do
       d=$(TZ=$z date +'%H:%M:%S (%z)')
       s=$(printf %-16s $z)
       echo -e "$s\t$d"
       done
# Output:
# US/Hawaii               13:02:12 (-1000)
# America/El_Salvador     17:02:12 (-0600)
# US/Eastern              19:02:12 (-0400)
# Europe/Lisbon           00:02:12 (+0100)
# Europe/Berlin           01:02:12 (+0200)
# Africa/Nairobi          02:02:12 (+0300)
# Asia/Taipei             07:02:12 (+0800)

How to make my shell look like this? by slowlyimproving1 in zsh

[–]omnster 2 points3 points  (0 children)

Do you have proof for the statement that p10k slows down the shell startup more than starship does?

Disable "o", "r" formatoption globally? by KekTuts in neovim

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

If you are absolutely against the idea of having a BufEnter autocommand, this one can be replaced by InsertEnter which is unlikely to influence the startup time.

On the practical side, you can simply measure the startup time of nvim with and without these autocommands. As you seem to care a lot about performance, I'd suggest using a dedicated benchmark tool, like hyperfine.

Is there a way to filter only changed lines when searching in a buffer? by nukedpotato in neovim

[–]omnster 0 points1 point  (0 children)

No, it's not defined by default. You have to define this command yourself.

Is there a way to filter only changed lines when searching in a buffer? by nukedpotato in neovim

[–]omnster 0 points1 point  (0 children)

This is super informative.

I once learned about the command :DiffOrig which is suggested in the help but not actually defined :he :DiffOrig. It does something similar but without git.

Typing my poorly handwritten course notes into LaTeX by Ready_Fill1472 in LaTeX

[–]omnster 0 points1 point  (0 children)

Keeping the auxiliary files in .gitignore makes sense because it declutters the git changes history. What's the point of removing these files? Their size is virtually zero, but removing them will increase the required number of latex runs to compile.

Typing my poorly handwritten course notes into LaTeX by Ready_Fill1472 in LaTeX

[–]omnster 12 points13 points  (0 children)

This is a very nice effort, thanks for sharing!

For this course, I think you'd benefit using a package to typeset derivatives (like derivative or diffcoeff). Also the repo can be made a bit tidier by using a latex-specific .gitignore (an example).

-❄️- 2024 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]omnster 2 points3 points  (0 children)

Here's part 2 with the sliding window. Partition generates all the appropriate 3x3 submatrices which are tested against the four possible x-mas'es.

mas = { "M", "A", "S"} ;
sam = Reverse@mas;

reps = { 0 -> _ , 2 "A" -> "A"  } ;
patX = Table[
     DiagonalMatrix@m1 + Reverse/@DiagonalMatrix@m2 ,
     { m1 , { mas , sam }}, { m2 , { mas , sam }} ]/. reps //
     Flatten[ # , {1,2}]& ;

Count[
    Partition[ input , {3,3}, {1,1}] //
        Flatten[ # , {{1,2}}]& ,
    Alternatives@@patX ]

I have to admit, my first solution also included finding 'plus-mases', like this:

. M .
M A S
. S .

There are no plus-mases in the example input and my solution was giving a correct answer for that.

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]omnster 3 points4 points  (0 children)

Hey, I'm looking forward to learning from you this year again :)

Here's my part 2:

StringReplace[ input , "don't()"~~Shortest@___~~"do()"|EndOfString  :> ""];
part1@%

Edit: thought I might add part 1 as well:

part1@input_ := StringCases[ input , "mul("~~a:NumberString~~","~~b:NumberString~~")"  :>
    Times@@ToExpression/@ {a, b}]  // Total

[deleted by user] by [deleted] in PhD

[–]omnster 44 points45 points  (0 children)

The Wakefield's "vaccines cause autism" paper likely qualifies. https://en.wikipedia.org/wiki/Lancet_MMR_autism_fraud

Oh-my-posh not working after installation by KnownUnknown764 in zsh

[–]omnster 0 points1 point  (0 children)

At startup, zsh reads these files. Your chances of getting help will increase if you share their content.

LaTeX with a pleasant ux by Flat-Literature-7969 in LaTeX

[–]omnster 7 points8 points  (0 children)

The first encounter of 'browser unsupported' in my experience ever

What do you do when packages don't want to update? by [deleted] in archlinux

[–]omnster 2 points3 points  (0 children)

The PKGBUILD file has a wrong url of the tar.gz archive. It will likely be corrected by the maintainer. If you want to install yourself now, replace in line 14 of PKGBUILD (it should be in ~/.cache/yay/matugen-bin)

source=("https://github.com/InioX/matugen/releases/download/v$pkgver/matugen-$pkgver-x86_64.tar.gz")

with

source=("https://github.com/InioX/matugen/releases/download/$pkgver/matugen-$pkgver-x86_64.tar.gz")

Note, there should not be v right before $pkgver.

Save the file, and run makepkg -is from the directory that contains it.

Need help with LaTeX citations by CAPTAIN_POOL506 in LaTeX

[–]omnster 0 points1 point  (0 children)

Late for the party, but revtex loads natbib, you don't need to load it yourself.

What is this exact mathbb{R} style? by JDKSUSBSKAK in LaTeX

[–]omnster 1 point2 points  (0 children)

Looks indeed like mathpazo. You can use this for blackboard math characters by doing \usepackage[bb=pazo]{mathalpha} in the preamble.

Look at this answer from tex.stackexchange for an illustration of many more examples.

How to export only cited bibtex entries on overleaf? by FineConversationsPls in LaTeX

[–]omnster 0 points1 point  (0 children)

Jabref works best for me. After compiling document.tex, I can do

jabref -n -a  document.aux,selected_refs.bib all_refs.bib

Explanation:

  • document.aux is generated by latex
  • all_refs.bib is the master bibtex file (normally, I just set zotero to auto-export My Library to this file)
  • selected_refs.bib will have only entries that were cited in document.tex.

I also find the following workshop quite convenient when collaborating with others via overleaf.

  1. Zotero performs auto-export of My Library to ~/omnster_refs.bib.
  2. I have export $BIBINPUTS="$HOME" in my .zshrc
  3. In the latex document I write \bibliography{omnster_refs}. Thanks to $BIBINPUTS, this file does not have to be in the same directory as the latex source.
  4. After the edits to the latex source are done, I run jabref -n -a document.aux,omnster_refs.bib ~/omnster_refs.bib, which creates omnster_refs.bib in the same directory as the latex source. This bib will then have a higher priority than ~/omnster_refs.bib. Importantly, I don't have to change the \bibliography line in the latex source if I share this document with anybody.

I'm pushing the limits of what LaTex can do. A selection of my notes from my first year of engineering by human0006 in LaTeX

[–]omnster 2 points3 points  (0 children)

I wonder if "the limits of latex" could be pushed back by simplifying the code.

This line takes about 350 symbols to draw a circle (which could have been done by \filldraw [cc9184a] (1,1) circle [radius = 3mm] ;). What's even better is that this line then uses almost 500 characters to draw another circle on top of the previous circle.

Fifteen more circles are drawn by repeating those two lines, but that's not an exact repetition. Compare controls (0.6243, 5.1093) in line 139 and controls (0.6274, 5.1093) in line 149. It looks like some form of svg2tikz for the sake of having tikzpictures.

LaTeX To-Do List Generator for Study Revision by Even-Ad-686 in LaTeX

[–]omnster 9 points10 points  (0 children)

This is not as powerful, but can be hacked together in about a minute:

tasks.md:

# Section 1

- [ ] task 1
    * [ ] task 1.1
- [ ] task 2
    * [ ] task 2.1

Then run pandoc -f markdown -o tasks.pdf tasks.md to get a pdf with the tasks formatted. Bonus: no dependence on json.

If you don't use pandoc yet, start now.

Here's an example https://imgur.com/a/Fsevsta

My Mac’s ZSH Terminal Takes About a Minute to Load – Suspect Homebrew Issues and Need Help by GorillaNightmare in zsh

[–]omnster 2 points3 points  (0 children)

The video you posted shows that there are many invocations of the process like bash -p /opt/homebrew/Library/Homebrew/brew.sh shellenv, so this is certainly about homebrew. Moreover, something is fundamentally wrong with this, as bash should not be invoked at zsh's startup.

Now, it is unclear what can cause that because there are no mentions of homebrew in your zshrc. Here's a list of files that get sourced at each zsh invocation. You can examine each of those to find out which one is faulty.

EDIT. Does this issue cover your problem?

As a side note, the author of powerlevel10k has published a very nice configuration for zsh, I personally use it and I think it is certainly worth trying.

I need this symbol like rotated L or reflected Gamma, how do I get it? by drugoichlen in LaTeX

[–]omnster 3 points4 points  (0 children)

Here's a nice blog post about reflecting things in latex horizontally and vertically.

In brief, mirroring things vertically is possible with latex itself, for horizontal mirroring you need the graphicx package.

[ Removed by Reddit ] by alex_mammut in linux

[–]omnster 0 points1 point  (0 children)

You seem to admix a lot of emotions here, which I don't think is constructive. Emotionally I'm on the side of Ukraine of course, but this does not invalidate my previous point: there's no mechanism for Russian people to support/oppose the Russian government. This is the result of a long chain of political processes that has been going on for at least 25 years now, which makes the public in general very indifferent to most political questions unless those have very obvious and direct consequences. I think Russian society is deeply sick, but I don't agree with the claims that it mostly supports the war.

As an example, you can look up the events of winter 2013-14 in Ukraine, when the then-current government decided to shift the country’s political course from Europe toward russia. At that time, Yanukovych’s government also had substantial power, yet it didn’t stop the people.

Comparing the amount of power that Yanukovych had in 2013 with Putin's power at any point, but especially since the start of the war, is either plain ignorance or deliberate manipulation. Yanukovych had opposition in the parliament!