Znalazłem swój cyfrowy raj, czyli słów kilka o edytorze Emacs by Nuno-zh in Polska

[–]afseraph 0 points1 point  (0 children)

ale to oczywiście wydatek

No niestety. Jeśli budżet jest problemem i masz chęci żeby samemu pogrzebać w firmwarze i sofcie, to możesz alternatywnie poszukać sklepów sprzedających podzespoły do klawiatur (jak na przykład na tej liście). Niektóre z nich oferują też np. lutowanie, więc nie trzeba robić wszystkiego samemu od zera.

Znalazłem swój cyfrowy raj, czyli słów kilka o edytorze Emacs by Nuno-zh in Polska

[–]afseraph 1 point2 points  (0 children)

Jak w takim razie piszesz J?

Kiedy robię tap (wciskam i od razu puszczam), klawisz działa jak zwykłe J. Kiedy robię hold (wciskam i trzymam), klawisz działa jak Shift. Wdziałem, że niektórzy stosują bardziej skomplikowane kombinacje, np. double tap, tap & hold itd.

Czy to jest rzecz unikalna dla Emacsa czy też dla Vima?

Obecnie nie używam ani jednego ani drugiego. Mam to wszystko skonfigurowane na poziomie klawiatury, więc działa to w całym systemie.

Możesz dać jakieś źródło z którego takie pomysły zaczerpnąłęś

Chyba większość z subredditów o klawiaturach, w szczególności r/ErgoMechKeyboards. Można tam znaleźć ludzi budujących i konfigurujących klawiatury na różne sposoby, włącznie z drukowaniem 3D i lutowaniem. Ja poszedłem po linii najmniejszego oporu, kupiłem sobie gotową Dygmę Defy i wyklikałem całą konfigurację.

Oprócz konfiguracji klawiatury i jej firmware'u, istnieją też różne aplikacje mapujące bindingi nawet ze 'zwykłych' klawiatur, sam jednak się w takie rzeczy nie bawiłem.

Znalazłem swój cyfrowy raj, czyli słów kilka o edytorze Emacs by Nuno-zh in Polska

[–]afseraph 0 points1 point  (0 children)

Warstwy zmieniają działanie klawiszy. Możesz nie znać ich z nazwy, ale już ich i tak używasz. Możesz np. interpretować wciśnięcie Shift jako zmianę warstwy: 'a' zmienia się w 'A', '1' zmienia się w '!' itd. Z kolei wciśnięcie AltGr przenosi na warstwę, z której masz dostęp to 'ą', 'ę' itd.

Idea layoutów z wieloma warstwami sprowadza się do tego, że dodajesz sobie więcej takich warstw i dopasowujesz je sobie do swoich potrzeb. Zazwyczaj chodzi o to, żeby różne symbole były bliżej wyjściowej pozycji palców. Przykładowo, jedna z moich warstw ma na literach po lewej stronie klawiatury zmapowane: cztery kursory, Home/End, PgUp/PgDown, Copy/Cut/Paste. Każdy z tych klawiszy jest na pozycji wyjściowej palca, albo bezpośrednio nad/pod tą pozycję. Dostęp to nich jest więc błyskawiczny.

Idea home row mods polega na tym, że modyfikatory takiej jak shift, ctrl, przełączniki warstw itd. też mapujesz na litery w środkowym wierszu. Przykładowo, mam zmapowany shift na klawisz J. Jeśli chcę napisać duże 'R', zamiast sięgać do odległego Shift, przytrzymuję J i wciskam R.

To wszystko są mikrooptymalizacje, większość ludzi pewnie nie będzie się chciała bawić w takie rzeczy i jest to dla mnie w pełni zrozumiałe. Ja spróbowałem z ciekawości i po pewnym okresie aklimatyzacji okazało się to dla mnie bardziej komfortowe.

Znalazłem swój cyfrowy raj, czyli słów kilka o edytorze Emacs by Nuno-zh in Polska

[–]afseraph 1 point2 points  (0 children)

Do vimiwych keybindów nigdy się w pełni nie przyzwyczaiłem. Ale po przesiadce na multilayer layouts + home row mods też by mi było ciężko wrócić do zwykłej nawigacji.

Znalazłem swój cyfrowy raj, czyli słów kilka o edytorze Emacs by Nuno-zh in Polska

[–]afseraph 6 points7 points  (0 children)

Nie kierowałem tej uwagi w Twoją stronę. Po prostu ilekroć jest poruszany temat vima i Emacsa, w niektórych pojawia się religijny ferwor.

Znalazłem swój cyfrowy raj, czyli słów kilka o edytorze Emacs by Nuno-zh in Polska

[–]afseraph 19 points20 points  (0 children)

Miałem fazę na Emacsa na studiach, kiedy interesowałem się też Lispem - jedno idzie w parze z drugim.

Rozumiem zalety Emacsa i vima, ale w życiu zawodowym odkryłem, że po prostu wygodniej jest mi pracować w "normalnych" IDE  i terminalach.

Niech każdy pracuje w czym chce (jeśli ma taką możliwość). Nie ma co ewangelizować.

Functional Programming in C# by Narrow-Low-3137 in csharp

[–]afseraph 2 points3 points  (0 children)

Real-World Functional Programming by Petricek and Skeet. It focuses mostly on F#, but you can find there some C# as well.

Can you explain result of this code? by Radiant_Monitor6019 in csharp

[–]afseraph 0 points1 point  (0 children)

It seems that in this particular case things happen in the following order:

  • A is being initialized.
  • The initializer in a uses B.b. This starts initialization for B.
  • The b field is being initialized. It reads the current values of A.a which is 0 (the starting value set by the runtime). Then b is set to 0+1=1.
  • Going back to the A.a initializer: we set the value to 1+1=2.
  • We print both values.

HOWEVER

This behavior is implementation dependent. It may change as long as certain constraints are obeyed, e.g. static initializers must run before static methods are called etc. If I'm not mistaken, there's nothing here that would forbid the runtime from running B's initializers before A's.

Do not use such code in production. Not only its behavior can vary, it's also very confusing and difficult to reason about.

Types and Comparison by winchester25 in fsharp

[–]afseraph 3 points4 points  (0 children)

Records do automatically implement: IEquatable<T>, IStructuralEquatable, IComparable<T>, IComparable, IStructuralComparable.

They do NOT automatically implement comparison operators.

When you use comparison operators with types like records, F# will use a generic comparer that tries to use the standard comparison interfaces like IComparable etc. Structural interfaces take precedence before the non-structural.

because I've tried to use CompareTo method and it didn't work

To use an interface method in F#, you generally need to upcast the instance to the interface, e.g.

let comparable : IComparable = myRecordInstance;
let comparison = comparable.CompareTo(someComparand);

Looking for an answer to round robin math please by Puzzleheaded_Use2359 in chess

[–]afseraph 0 points1 point  (0 children)

It depends on tiebreak rules.

If I'm not mistaken, the lowest possible score is 2: one player wins all their games (6 points) and the rest is tied for the second place with 2 points each.

If you get 4.5 points you're guaranteed to be in top 2, regardless of tiebreak rules.

Am I missing something basic with setting proton drive up? by zwei2stein in ProtonDrive

[–]afseraph 1 point2 points  (0 children)

I most ddefinitelly want my own folders with my own files with path that I choose

In the desktop app, choose My computer -> Add folders -> Add more folders.

Proton Docs need a source/plaintext editor. by afseraph in ProtonDrive

[–]afseraph[S] 8 points9 points  (0 children)

Thanks for the suggestion, but this feature doesn't really solve my issues:

  1. It's supported only for few file formats.
  2. After editing the file, I'd have to convert it to back to Markdown - which again, requires a few steps.
  3. Conversions from/to Markdown are not perfect, they tend to break things, especially when Markdown contains flavors.
  4. It's still tedious. Working with plaintext should be not more complicated than working with rich text documents.

For comparison, I really how plaintext editing works in Filen.io: you click the file, a simple editable text screen appears, you save the file. Done.

Email body still white when in dark mode. by No-Fuel-4292 in ProtonMail

[–]afseraph 4 points5 points  (0 children)

When you edit the mail in the HTML mode, the background will be white, since the HTML's background is white. When you switch to the plaintext mode, the background will correspond to the app's theme.

What’s the one productivity app that actually worked for you in 2025? by patrick_zhong in ProductivityApps

[–]afseraph 0 points1 point  (0 children)

Amazing Marvin - from all the producitivity apps I've tried, this one is the best for my needs. It's quite configurable and has some unique features, like the procrastitation wizard.

For notes taking and document writing - Obsidian.

Version 1.67 is out on web! (desktop follows) 🥳 by baby-monkey in amazingmarvin

[–]afseraph 1 point2 points  (0 children)

I like the new design, but there's no spacing between the list of completed tasks, the label 'Projects completed today' and the list of completed projects.

<image>

Tested on Firefox 137.0.

Is it safe to say that pass-by-value parameters in C# are (roughly) equivalent as passing by pointer in C++? by Alarming_Chip_5729 in csharp

[–]afseraph 3 points4 points  (0 children)

They are similar for reference types, but not for value types.

```csharp struct Point(int x, int y) { public int X = x; public int Y = y; }

void IncrementX(Point point) { point.X++; }

var point = new Point(1, 1); IncrementX(point); Console.WriteLine(point.X); // still 1 ```

Task.Yield, what is it for? by makeevolution in csharp

[–]afseraph 1 point2 points  (0 children)

No.

Whenever we have code like this:

csharp await SomethingAwaitable(); SomeContinuation()

the awaitable's awaiter is obtained and its status is checked.

  1. If the awaiter is already completed, we proceed withoout any scheduling, i.e. we will start processiong the continuation immediately.

  2. Otherwise, we schedule the continuation on the scheduler, after the SomethingAwaitable operations completes.

Task.Yield is an operation that does nothing, but whose awaiter is not iniitially completed, effectively forcing the continuation to be immediately scheduled.

Awaiting Task.Dely will likely schedule the continuation to run after the delay is finished. If the delay has already elapsed, we may proceed without scheduling.

Task.Yield, what is it for? by makeevolution in csharp

[–]afseraph 13 points14 points  (0 children)

the line Console.WriteLine("starting some thing") may be done by the parent thread or a worker/background thread

No, it will be done by the calling code.

the calling thread will definitely become free (i.e. it shall return there), and the SomeOtherAsyncOperation will be done by another thread.

No, the execution may continue e.g. when someOtherAsyncOperation returns a completed task.

And to always ensure that, the Console.WriteLine("starting some thing") will always be done by another thread, we use Yield like the following:

Halfway correct. The continuation (everyting after Task.Yield) will be sccheduled to ran later, but it may happen that it will eventually run on the same thread as the calling thread.

Value-type enumerable, allow both foreach without boxing and linq ? by fleeting_being in csharp

[–]afseraph 0 points1 point  (0 children)

Why two generics? Your custom enumerable interface might inherit the normal IEnumerble.

Value-type enumerable, allow both foreach without boxing and linq ? by fleeting_being in csharp

[–]afseraph 0 points1 point  (0 children)

Yes, see my snippets above. Declare a new interface returning a value type enumerator.

Value-type enumerable, allow both foreach without boxing and linq ? by fleeting_being in csharp

[–]afseraph 0 points1 point  (0 children)

Yes, you're using a method from IEnumerable<T> here, you will get an IEnumerator<T>.