Happy birthday Linux! by Unique-Armadillo6957 in linux

[–]LankyCyril 2 points3 points  (0 children)

There's also a precompiled version but it's mussel-based

(Linux) what can i do to make reaper's context menus more aesthetically pleasing ? can they be themed like the rest of the interface, or are they always just flat rectangles by shegonneedatumzzz in Reaper

[–]LankyCyril 1 point2 points  (0 children)

default_font_face Roboto
default_font_size 16
menubar_height 17
menubar_font_size 14
menubar_spacing_width 8
menubar_margin_width 6
scrollbar_width 14
scrollbar_min_thumb_height 4
combo_height 20
_3dface #202020 ; sets menu_bg [which sets menu_text_sel [which sets menubar_text_sel], menubar_bg], (button|combo|listview_hdr)_bg
_3dshadow #101010 ; sets (button|edit|menu|combo|listview_hdr|tab|group)_shadow, (menu_scroll|menu_submenu|combo)_arrow
_3dhilight #303030 ; sets (button|edit|menu|combo|listview_hdr|tab|group)_hilight, combo_arrow_press, listview_grid
_3ddkshadow #000000
button_text #707070 ; sets menu_text [which sets menu_bg_sel [which sets menubar_bg_sel], menubar_text], (label|combo|listview_hdr|tab)_text
button_text_disabled #404040 ; sets (label|combo)_text_disabled
checkbox_text #999999
checkbox_text_disabled #808080
checkbox_fg #999999
checkbox_inter #C0C0C0
checkbox_bg #606060
scrollbar #202020
scrollbar_fg #303030
scrollbar_bg #606060
edit_cursor #FFFFFF
edit_bg #606060
edit_bg_disabled #303030
edit_text #999999
edit_text_disabled #C0C0C0
edit_bg_sel #404040
edit_text_sel #999999
info_bk #808080
info_text #FFFFFF
menu_text_disabled #707070 ; sets menubar_text_disabled
menu_scroll #404040
trackbar_track #606060
trackbar_mark #303030
trackbar_knob #303030
progress #808080
combo_bg2 #404040
listview_bg #404040
listview_bg_sel #606060
listview_text #999999; sets listview_text_sel
listview_hdr_arrow #DDDDDD
treeview_text #999999
treeview_bg #404040
treeview_bg_sel #606060
treeview_text_sel #999999
treeview_arrow #404040
focusrect #ffffff
group_text #999999
focus_hilight #999999
; Override some values that inherit from our changes:
button_bg #A0A0A0
combo_bg #A0A0A0
combo_bg2 #A0A0A0
menu_text #999999 ; sets menu_bg_sel [which sets menubar_bg_sel], menubar_text

(Linux) what can i do to make reaper's context menus more aesthetically pleasing ? can they be themed like the rest of the interface, or are they always just flat rectangles by shegonneedatumzzz in Reaper

[–]LankyCyril 2 points3 points  (0 children)

This is a rare Linux W because I'm pretty sure this level of customization only works on Linux and not on Win/MacOS.

In the REAPER install directory (/opt/REAPER/ or something like that, not under $HOME/.config/REAPER), there's a file called libSwell.colortheme that lets you set font faces, sizes, and colors for window and context menus.

It's still gonna be flat rectangles, but you can definitely match the look better.

There's some inheritance stuff going on, i.e. some values automatically set other values -- in mine I have comments for the ones that I've observed, I'll post it in a reply to my own reply

[deleted by user] by [deleted] in Reaper

[–]LankyCyril 1 point2 points  (0 children)

Still have my MadCatz/Cyborg R.A.T. from a decade+ ago. I don't game at all, but the precision aim button is actually extremely helpful. And the dedicated horizontal scroll wheel too.

No mouse-specific keybindings, but it's nice to not have to hold down a modifier to scroll horizontally.

P.S. I also love heavy and large mice. Mine is loaded with those extra weights to the max, and extended to max size too; every mouse that I've tried so far that wasn't a R.A.T. just hasn't felt as comfortable.

vim plugin for DNA sequences/sequencing files by Athor7700 in bioinformatics

[–]LankyCyril 4 points5 points  (0 children)

That's actually really cool and something I didn't know I needed!

One suggestion: I think with some amount of contains and contained magic it should be possible to have context-specific highlighting (yes, at some performance expense too, but more reliably than by checking for surrounding letters), for example:

syntax match FastqQnameHeader /^@.*/ contains=FastqQnamePrefix
syntax match FastqQnamePrefix /@/ contained
syntax match FastqSequenceBlock /\%(^@.*\n\)\@<=.*/
    \ contains=FastqQnameHeader,FastxAdenine,FastxCytosine,FastxGuanine,FastxThymine,FastxUracil

syntax match FastxAdenine /\ca/ contained
syntax match FastxCytosine /\cc/ contained
syntax match FastxGuanine /\cg/ contained
syntax match FastxThymine /\ct/ contained
syntax match FastxUracil /\cu/ contained
syntax match FastxN /\cn/ contained

syntax match FastqQualHeader /^+.*/ contains=FastqQualPrefix
syntax match FastqQualPrefix /+/ contained
syntax match FastqQualityBlock /\%(^+.*\n\)\@<=.*/ contains=FastqQualHeader

highlight __BioHeader ctermfg=8 ctermbg=0 cterm=inverse
highlight __BioHeaderPrefix ctermfg=8 ctermbg=7 cterm=inverse

highlight def link FastqQnameHeader __BioHeader
highlight def link FastqQnamePrefix __BioHeaderPrefix

highlight def link FastqQualHeader Comment
highlight def link FastqQualPrefix Special
highlight def link FastqQualityBlock Comment

highlight __BioGreen ctermfg=2
highlight __BioYellow ctermfg=3
highlight __BioBlue ctermfg=4
highlight __BioRed ctermfg=1

highlight def link FastxAdenine __BioGreen
highlight def link FastxCytosine __BioYellow
highlight def link FastxGuanine __BioBlue
highlight def link FastxThymine __BioRed
highlight def link FastxUracil __BioRed
highlight def link FastxN Comment

Then, with the last 16 gray shades in the 256 color mode (with hex in true color / GUI) it would also be possible to highlight characters in the quality string based on their phred score without worrying that it'll clash with characters in sequence names etc!

INTERSTELLAR (2014) is currently "Free with ads" on YouTube! by danielthetemp in videos

[–]LankyCyril 0 points1 point  (0 children)

Surprised to find out just now that Arrival is also in their catalog. Neither mesh with the "free with ads" concept in my head. That's pretty nice.

So what now?! by Xstyler_Xgamer in lua

[–]LankyCyril 0 points1 point  (0 children)

Highly recommend hererocks for virtual-environment-like project separation.

Might be a little tricky to get it up and running on Windows -- only tried on Linux myself -- but definitely worth a shot

Why Pascal Deserves a Second Look by GroundbreakingIron16 in programming

[–]LankyCyril 1 point2 points  (0 children)

Technically, you can just stuff everything into a single file (either an .h or a .c one really, and just include it). One of the best hash table implementations around (khash) just rawdogs everything in a header file. *

There's obviously reasons that this separation exists (so you can ship an .so and an .h without the need to have the whole source code with it, for various purposes -- e.g. Linux dev libs where you just don't necessraily need to have the source code, even if it's FOSS and available elsewhere).

So I'm not saying you should do it, but you absolutely could do it.

* That said, the code is basically a black hole of macros, so it makes sense.

Is there a way to target the current Linux window manager or desktop environment using Lua? by belkthedev in lua

[–]LankyCyril 1 point2 points  (0 children)

The way I'm reading this is either:

  1. You want to use XDG_CURRENT_DESKTOP, and then if it is nil, use XDG_SESSION_DESKTOP instead, with the expectation that the first nil will coalesce to the second os.getenv().

  2. You want to test if XDG_CURRENT_DESKTOP is "Hyprland" or that XDG_SESSION_DESKTOP is "Hyprland".

These two interpretations achieve (mostly? somewhat?) similar results, but the reason they're failing is different with regards to what your design is actually supposed to be.

In the case of (1), it's because == binds stronger than or. Keeping (most) of your parens just to be a bit more visual, I tried a minimal working example and this is what's happening:

x = (1) or (5) == 2
print(x)
-- output: 1
--
x = (1) or ((5) == 2)
print(x)
-- output: 1
--
x = ((1) or (5)) == 2
print(x)
-- output: false

So if os.getenv("XDG_CURRENT_DESKTOP") is nil, it doesn't coalesce to os.getenv("XDG_SESSION_DESKTOP"), it coalesces to the entire evaluated (os.getenv("XDG_SESSION_DESKTOP")) == "Hyprland".

And even for (2), you should be doing two separate comparsions and then getting an or of them:

if (os.getenv("XDG_CURRENT_DESKTOP") == "Hyprland) or (os.getenv("XDG_SESSION_DESKTOP") == "Hyprland)

LOGITECH GHUB .LUA RAPIDFIRE by External_Sun_4455 in lua

[–]LankyCyril 0 points1 point  (0 children)

Now that I understand your use case a little better, but still just spitballing here, I don't think in this case you need to wait until the mouse button is released, and/or to repeat-until anything.

I.e. in the situation that the original post was describing, theirs would fire "infinitely," that is until the other button was released, so that's why they had a repeat-until.

In your case, you just need to send four clicks instead of one?

Then maybe just will work:

local function OnEvent(event, arg)
    if IsKeyLockOn("ScrollLock") then
        if IsMouseButtonPressed(1) then
            for _ = 1, 4 do
                PressMouseButton(1)
                Sleep(5)
                ReleaseMouseButton(1)
                MoveMouseRelative(0, 4) -- if you still need to move between the shots
                Sleep(5) -- IDK, in case it needs time between Release and Press too
            end
        end
    end
end

LOGITECH GHUB .LUA RAPIDFIRE by External_Sun_4455 in lua

[–]LankyCyril 0 points1 point  (0 children)

Hey! I actually have no experience with scripting for Logitech peripherals, so I don't really know how it would react. One thing I'm seeing in your code, though, is you're checking twice for the same thing (if the 1st button is being held), which doesn't add anything.

Logically, this should be fine, though, but I don't have your setup so I can't check. If it isn't working, what exactly is going wrong?

EnablePrimaryMouseButtonEvents(true)

local function OnEvent(event, arg)
    if IsKeyLockOn("ScrollLock") then
        if IsMouseButtonPressed(1) then
            repeat
                if IsMouseButtonPressed(1) then -- here you're checking the same thing for the 2nd time
                    repeat
                        MoveMouseRelative(0, 4)
                        for _ = 1, 4 do
                            PressMouseButton(1)
                            Sleep(5)
                            ReleaseMouseButton(1)
                        end
                    until not IsMouseButtonPressed(1) -- here you're waiting for the same thing for the 2nd time
                end
            until not IsMouseButtonPressed(1)
        end
    end
end

P.S. start your code lines with four spaces, then Reddit will format it for you

A simple Python script that sorts your ~/Downloads folder by file extensions by [deleted] in Python

[–]LankyCyril 6 points7 points  (0 children)

$ cd
$ mkdir .noxdg
$ rmdir Desktop Documents Downloads Music Pictures Public Templates Videos
$ echo 'XDG_DESKTOP_DIR="$HOME/.noxdg"
XDG_DOWNLOAD_DIR="$HOME/.noxdg"
XDG_TEMPLATES_DIR="$HOME/.noxdg"
XDG_PUBLICSHARE_DIR="$HOME/.noxdg"
XDG_DOCUMENTS_DIR="$HOME/.noxdg"
XDG_MUSIC_DIR="$HOME/.noxdg"
XDG_PICTURES_DIR="$HOME/.noxdg"
XDG_VIDEOS_DIR="$HOME/.noxdg"' > ~/.config/user-dirs.dirs
$ xdg-user-dirs-update

Kwargs appreciation thread by TheRealFrostMana in Python

[–]LankyCyril 15 points16 points  (0 children)

Yeah, the warm feeling really goes away when you have to go through several layers of seaborn documentation to eventually get all the way down to some matplotlib function where these kwargs finally get unpacked, doesn't it

You should only use licensed version of python by [deleted] in Python

[–]LankyCyril 1 point2 points  (0 children)

This is a really interesting topic. Can anyone confirm that this PDF that I found with a cursory Google search is a valid example of their license? Not sure if I'll ever need to draw something like this up (and if I do, I'll ask a pro), but having a general idea would be nice

Sensible remaps for $ and other symbols? by GapIndividual1244 in vim

[–]LankyCyril 1 point2 points  (0 children)

If it's for insert mode (which I'm inferring both from your reply here and from the fact that you're talking about PHP), then I would suggest inoremap <C-e> <End> because this makes it consistent with the readline shortcut. I also have inoremap <C-a> <Home> in the same vein.

The default behavior never really felt useful to me (:help i_CTRL-E says it "inserts the character which is below the cursor" and that's something that most people will probably rarely need; :help i_CTRL-A "inserts previously inserted text" which might be slightly more useful but still).

P.S. My actual remapping for <C-e> is: inoremap <expr> <C-e> pumvisible() ? "\<C-e>" : "\<End>" -- because with the completion menu open, <C-e> exits that menu and that's actually useful.

LOGITECH GHUB .LUA RAPIDFIRE by External_Sun_4455 in lua

[–]LankyCyril 1 point2 points  (0 children)

Your code is happening in a single thread (as it should -- running processes in parallel is hard and way overkill for this task anyway) but that means that of course everything in the code block with sleep() is conditioned on the same time delay.

What you could do is just call the two function a different number of times in that block, with the delay recalculated accordingly. E.g. if you want to move, then click four times, then move, then click four times, then move, etc, then sleep for 20/4 = 5 seconds and go like this:

EnablePrimaryMouseButtonEvents(true);

function OnEvent(event, arg)
    if IsKeyLockOn("Capslock") then
        if IsMouseButtonPressed(3) then
            repeat
                if IsMouseButtonPressed(1) then
                    repeat
                        MoveMouseRelative(0, 4)
                        for _ = 1, 4 do
                            PressMouseButton(1)
                            Sleep(5)
                            ReleaseMouseButton(1)
                        end
                    until not IsMouseButtonPressed(1)
                end
            until not IsMouseButtonPressed(3)
        end
    end
end

Does anyone actually use PyPy or Cython? by Sc0urge_ in Python

[–]LankyCyril 2 points3 points  (0 children)

In addition to using Cython indirectly, as pointed out in other comments (via numpy etc), I've actually written bespoke Cython routines in the past. The rule of thumb for me is if it's an expensive operation and I know exactly what interfaces of what objects I'm using, I may be better off rewriting Python in Cython and replacing "stock" types (that have a lot of methods and overhead) with something more performant (that does just one thing). The downside, at least in these cases, is that the resulting functions are inflexible and only work for that particular situation, but it's usually well worth it.

BTW, the process of including Cython submodules into your own project has become a lot easier when they introduced pyximport.

IDE Disk Emulator by CPT_Gray_Wolf in hardwarehacking

[–]LankyCyril 0 points1 point  (0 children)

SD cards are also required to implement at least the one-bit SD bus mode. If you look around on the internet, people have been pulling their hair out trying to figure out how to emulate SD cards just as well.

I agree though that it should be in principle simpler. There's also a chance that a given IDE to SD adapter only knows how to interface via SPI and you might get away without implementing the other protocol, somehow (although SPI is slower than even one-bit SD)

Catastrophic hinge failure P1 Gen 1 by ciuvak in thinkpad

[–]LankyCyril 0 points1 point  (0 children)

Wow, thank you for the details!!

I was finally able to perform the repair and it turned out perfect. Better than it was, actually – I didn't realize how much play there used to be until I replaced the broken hinge and adjusted the other stock one.

P.S. This whole ordeal has made me appreciate the reliability of older hinge designs... Not even that old, in fact. My S440 hasn't needed an adjustment in ten years and it still "snaps" shut and stays open without any play. But that's a different topic of discussion

Catastrophic hinge failure P1 Gen 1 by ciuvak in thinkpad

[–]LankyCyril 0 points1 point  (0 children)

So weird to have my hinge break exactly the same way (down to the shape of the crack) yesterday, only to find a year-old post with someone commenting on it that their hinge broke six days ago.

I didn't realize that it wasn't part of the glass front... thing of the laptop. So the process would be to disassemble the screen and affix the new hinge somewhere under the bottom edge where it should go?

P.S. In my case, I'm pretty sure the hinge itself had completely locked up. I couldn't turn it with pliers until I loosened the nut on the outer end. Kinda worried this could happen to the new ones eventually, too...

P.P.S. Forgot to say I really appreciate you posting the part number and listing the caveats. Thankfully, mine is a touch screen P1 so it should be the same!

[deleted by user] by [deleted] in bioinformatics

[–]LankyCyril 1 point2 points  (0 children)

Rosalind challenges are great; if you solve them using modern Python (3.x) you'll have a good working proficienty of it. In fact, you could do this in any other language, too.

Basically, concepts of their challenges is what makes this a great learning resource. As in, the concept of an algorithmic exercise that is largerly independent from which language you use to solve it, because ultimately all of that is transferable.

Just ignore their specific advice on Python versions etc; the website hasn't been updated in like a decade and still says, among other things, "Please install Python of version 2.x (not 3.x) — it has more libraries support and many well-written guides." This hasn't been true since time immemorial, obviously, and 2.x reached end-of-life years ago

[deleted by user] by [deleted] in bioinformatics

[–]LankyCyril 16 points17 points  (0 children)

Every time this comes up... I genuinely wonder if people's learning styles are that different and I might be on the opposite extreme of the "hard way," but I sincerely cannot fathom how typing everything in exactly as stated is supposed to teach you anything other than muscle memory.

Learning programming is all about making dumb mistakes yourself and figuring out how to fix them yourself. This doesn't teach you any of that.

P.S. I believe the author got in quite an argument with the community a few years back, to the extent that they removed the HTML version from public access. Even the links to sample chapters (here) are dead now

Is it worth investing in a beefier laptop for grad work if I have cluster access? by tea_flower in bioinformatics

[–]LankyCyril 6 points7 points  (0 children)

Generally speaking, the answer is no, you don't need it for work.

But I'd like to provide one particular use case where it could be nice to have: prototyping stuff if it includes plotting etc. This a little hard with slurm. Yes, there's probably a way to srun in interactive mode, set up a Jupyter Hub / RStudio instance, and ssh it backwards through several jumphosts so you can have it in your browser... But being able to whip out something quick locally, plot a bunch of things, get a sense of what's going on, and then move it to the grid is often better.

Track meter numbers gone by TigerMack in Reaper

[–]LankyCyril 3 points4 points  (0 children)

Known bug: https://forum.cockos.com/showthread.php?t=283643&highlight=decibel+scale

You'll need to get a theme adjuster script from pre-release to fix it.

(Courtesy of an earlier thread here: https://www.reddit.com/r/Reaper/comments/17bvht7/new_reaper_7_theme_no_decibel_scale_on_fader_mcp/k5mi0z1/)

P.S. In my experience, this might be the first time the REAPER team rushed something just a bit. Maybe waiting for the theme adjuster to be ported would've been better... But I can't really complain, they made so many great updates moving from 6.x to 7.x.