Keyboard shortcut to “Comment” a line in NANO?

The simplest workaround I’ve found: Comment-out: set the cursor at the first row that should be commented-out hit twice ‘M-R’ (or ‘Alt-r’; in order to Replace a RegExp) Search for: ‘^’ Replace with: ‘# ‘ Replace this instance?: ‘y’ press ‘y’ for each row to be commented-out Comment-in: The same procedure, replacing ‘# ‘ by … Read more

Declaring Text Decorations such as Underline, Strikethrough in a Style

Underlining text can be done either with <Underline>…</Underline> or with the TextDecorations attribute set to Underline. You can include the latter in a style definition: <Style x:Key=”Underlined”> <Setter Property=”TextBlock.TextDecorations” Value=”Underline” /> </Style> <TextBlock Style=”{StaticResource Underlined}”> Foo </TextBlock>

Text comparison algorithm

Typically this is accomplished by finding the Longest Common Subsequence (commonly called the LCS problem). This is how tools like diff work. Of course, diff is a line-oriented tool, and it sounds like your needs are somewhat different. However, I’m assuming that you’ve already constructed some way to compare words and sentences.

saving cProfile results to readable external file

Updated. You can get output of profiler using io.StringIO() and save it into file. Here is an example: import cProfile import pstats import io def my_func(): result = [] for i in range(10000): result.append(i) return result pr = cProfile.Profile() pr.enable() my_result = my_func() pr.disable() s = io.StringIO() ps = pstats.Stats(pr, stream=s).sort_stats(‘tottime’) ps.print_stats() with open(‘test.txt’, ‘w+’) … Read more

Always show scrollbar – Flutter

Updated Answer April 2023 As of v2.9.0-1.0.pre, isAlwaysShown is deprecated and you should use thumbVisibility instead. Check jayjw’s more complete answer: https://stackoverflow.com/a/71357052/9777674 Original Answer June 2020 As of Flutter version 1.17, on Scrollbar you can set isAlwaysShown to true, but you must set the same controller for your Scrollbar and your SingleChildScrollView (and that applies … Read more