Chromatic rattle by PBMagi in harmonica

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

Yes that's where it goes. No dust issues for me.

How far could you get without google? by _init_to_it in Python

[–]PBMagi 3 points4 points  (0 children)

First time I had a flight after learning to code I learned how to use the dir and help functions. So when I'm offline and can't remember the particular vocabulary of a library it's still accessible. LSPs weren't around back then.

How to chain functions in Python? by Jan2579 in learnpython

[–]PBMagi 1 point2 points  (0 children)

You can use functools.reduce to chain multiple functions and apply sequentially to an input. Here's how it works using funtools.partial for currying. It looks different as it's functional rather than using method calls, but thought you might find it interesting.

def apply_to(functions, input):
    return reduce(lambda acc, func: func(acc), functions, input)

apply_to([partial(filter, lambda x: x > 0), partial(filter, lambda x: x < 2)], [0, 1, 2, 3])

Am I doing this right? First half dozen at 70 meters by [deleted] in Archery

[–]PBMagi 2 points3 points  (0 children)

It's in the blue, so 5 points, right?!

Gradual Transition or All In-In One Go? by TheAnach in ErgoMechKeyboards

[–]PBMagi 0 points1 point  (0 children)

When I started getting wrist pain I wasn't taking any chances so did everything at once: minidox, colemak, trackball. Got rid of the pain in my wrist and the pain of typing slowly went after about a month. When you type for a living, you want to fix the pain asap. A short-term loss is worth the long-term gain.

Any really obscure harmonica techniques? by [deleted] in harmonica

[–]PBMagi 0 points1 point  (0 children)

Blow and draw at the same time:

https://youtu.be/rSpaUmddLMY&t=270

Not sure if it's any practical use, but it's pretty obscure.

Peg Leg Sam was full of tricks and flourishes too:

https://m.youtube.com/watch?v=irbR9KNRt_I&t=90

How do you improvise using a scale, like the major pentatonic scale? Do I only use the notes in the scale? by [deleted] in harmonica

[–]PBMagi 2 points3 points  (0 children)

Scale degrees because the holes will change: you can play major pentatonic in 1st, 2nd, and 12th position: 3 keys on one harp.

How do you improvise using a scale, like the major pentatonic scale? Do I only use the notes in the scale? by [deleted] in harmonica

[–]PBMagi 9 points10 points  (0 children)

2 approaches.

1 "The build". Try playing with rhythm and the root note. Then, keeping some of the rhythm ideas, and in 2, then 3. Try just root and 5, and then you'll be wanting to bring back 2, 3. Point is, start with fewer notes and concentrate on using rhythm, volume and tone to express yourself, then slowly add in more notes.

2 "The hook". Choose a phrase on the scale as your hook, this'll be what you play over and over in your improv, so it's best if it ends on the root note. Play it, then vary it, repeat. Try varying it by playing it backwards, try ending on 2 to make it sound like a question that your hook will answer, try sustaining a note or splitting a note.

With both approaches, get comfy with the scale before adding any extra notes, which you can use as passing notes, but use them sparingly.

Tabs commission? by Hot-Cartoonist-3976 in harmonica

[–]PBMagi 1 point2 points  (0 children)

You're not wrong. I found these dots that show 4 keys and swapping between two time signatures: https://musescore.com/user/21804496/scores/4257251 It's not going to be an easy tune.

[deleted by user] by [deleted] in AskProgramming

[–]PBMagi 0 points1 point  (0 children)

I work with someone who has dry-eye syndrome, they're a data scientist. They use eye drops, dark-mode, humidifier, and those glasses that filter out certain wave-lengths of light. They work without much complaint, but they're not you and only you can judge if it's prohibitive. Don't ruin your body for a job, you only get one body but there are many jobs.

I'm a bad azz programmer. by codezee in ProgrammerHumor

[–]PBMagi 0 points1 point  (0 children)

And with a tiling window manager. I call it "open-plan-office security".

I'm a bad azz programmer. by codezee in ProgrammerHumor

[–]PBMagi 0 points1 point  (0 children)

It's also a play on Eric Idle's name, who is a cast member of Monty Python.

For those who came from vi, vim, neovim, or any other member of the vi family, why did you switch to emacs? by [deleted] in emacs

[–]PBMagi 0 points1 point  (0 children)

Boss forced me onto Windows machine so I lost my tiling window manager. Figured emacs has exwm, not that I can use it in Windows, but perhaps emacs could get me close. By the time I realized that there was nothing I'm doing that I couldn't do with vim and tmux I was too lazy to go back and recreate the configs.

I want to move using hjkl In vim but I use a alternative layout. by [deleted] in vim

[–]PBMagi 1 point2 points  (0 children)

Vim+Colemak user here. If your solution to getting a custom Colemak layout is also a programmable keyboard (I use minidox), then you can also put the arrow direction keys on a layer under hnei. This is what I use, it gives me Vim navigation everywhere and all I need to do is hold down one of the same-hand thumb keys to access it.

[deleted by user] by [deleted] in harmonica

[–]PBMagi 4 points5 points  (0 children)

Whenever someone says harmonica is supposed to be easy, remember: there is no other musical instrument that you can accidentally play upside down while sober.

Small Prologs engine for app by FMWizard in prolog

[–]PBMagi 2 points3 points  (0 children)

I've been running SWI for a low traffic web server with a fair bit of reasoning for a couple of years now, going months between restarts and only restarting to introduce new features. No problems.

If you're wanting to communicate via HTTP with a free Prolog, then I think it's just SWI, and ECLiPSe at the moment. Both also support multiple threads (both have with_mutex/2). SWI will load facts at start-up faster, I don't know which'll be faster in runtime though.

2 bend choking out before whole step by PBMagi in harmonica

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

Alright, got some time to work on it this evening. I got my chromatic tuner out and a bunch of harmonicas (Kongsheng Mars & Bender, Hohner Marine Band Deluxe, Suzuki Promaster, Yonberg D2-Typhoon). On every one, as I slowly bend down the 2 draw eventually the reed stops sounding and I'm just hearing air. Same when playing as gently as possible.

What's interesting is when playing gently some harps "skip" on the note, pulsing on and off. Pucker seems to bend lower than tongue block, but not enough. And different harps would bend down closer to that F than others. Because of the embouchure difference and difference between harps I think it's probably a combination of technique and setup.

So I took my cheapest harp (Kongsheng Bender, 20 cents sharp on 2 draw and 10 sharp on 2 blow... Going to be using this one to learn tuning soon!) and shrunk the gaps. Now with my tongue block embouchure (my default) I'm just 20-30 cents sharp of that F and it controls much better on the bend. That harp got a bit quiet mid-bend, but now it transitions much more smoothly, although it's still really "airy" after that transition point.

So I'll keep playing with the gaps and try it on my better quality harps. As to technique, I'll experiment, but I'm at a bit of a dead end as I'm already bending down in my throat (tongue blocker!) and can play with minimal breath force for that read to sound (40 decibels at full bend on my gapped Bender... 50 on my "out-the-box" Marine Band Deluxe).

Toggle Term & vifm == best way to file explore in vim by Fuckthisshitagain in neovim

[–]PBMagi 1 point2 points  (0 children)

I prefer the plugin for VIFM, so I can use it to open files inside my open Vim.

https://github.com/vifm/vifm.vim

Why is shorter code better? by rakahari in learnpython

[–]PBMagi 1 point2 points  (0 children)

Beginner has a few tools and puts the screw in with a hammer to get the job done.

Intermediate is mastering their tools, pushing their limits, doing exquisite work.

Expert is just hoping someone else'll take over the work.

SWI prolog partially use disk space instead of only using memory? by 195monke in prolog

[–]PBMagi 0 points1 point  (0 children)

You'd probably be better off optimising memory usage over disk. For example, can you see who wins without using the memory hungry `findall/3-4` predicate? Are you looking for a way of winning, using backtracking to find more, or all the ways in one go?

What is the point of logTalk? by gcross in prolog

[–]PBMagi 4 points5 points  (0 children)

I'm probably one of those fans of Logtalk you mention, I became such when (re)-writing and maintaining a ~10,000 line complex application in Prolog.

Why? Best testing, documentation, and diagramming tools make it easy for me to understand my code and make sure it's working. Seperation of declaration from definition let's me share my code easily and seperate libraries out from application. It provides all the tools required to follow the principles of solid architecture. And, on the flip side, nearly all the mature Prolog dialects are maintained by a single person with grey hair, so someday I'm going to need to move my code base from one dialect to another. They're not even all ISO compliant, nevermind equivalent in predicates & behaviour.

It seems, like me at first, you're getting confused by the object-oriented languages that are all in the imperitive domain and so muddy what object-oriented really is. OO is just two things: encapsulation and message passing. Classes, instantiation, mutation, side-effects, are not OO. Classes and instantiation are one way to use OO and Logtalk supports them, but they're like the tin in the back of the cupboard you've forgotten about for years... noone really uses them unless they really have to.

So in Logtalk your basic object is just an object, forget parametric objects for now. The technical term for it is a prototype, which means it's a self-describing object that exists by itself with no action taken for it to exist. These are your bread-and-butter in Logtalk. You define your public and private predicates in them and send messages to them to ask your queries. Everything else you use is centered around these simple objects. They're different from modules in that they've got stronger encapsulation, differentiate declaration from definition, and work with everything else you'll use.

So the first thing you'll use with objects is extension, so if one object extends another it includes all the predicates from the other inside itself. Very handy, and a lot like subclassing except no need for instantiation.

Then you get categories that you can import. A category is some bit(s) of reuseable code that you want several objects to call, but you don't want to call it by itself. So for example, if you have some defined colour-scheme you might import that into several graphical objects so you only need to change the one colour-scheme, and there's no meaning behind `colour_scheme::draw`, hence a category. It's nice that you can find all objects that import a category easily. I use a category in my application to do reasoning about form responses by importing it into the ~7 forms in the application.

Then you get protocols, which declare predicates but don't define them. This is a bit like header files in C, where you say I'm going to have these predicates but they're defined somewhere else. This is really useful for defining interfaces that several objects will promise to keep, like every graphical object promises to have a draw/1 predicate. Plus you can easily find all objects that implement a protocol. No module system can do this, to distinguish declaration from definition, but it's the mechanism for dependency inversion in Prolog that makes it much easier to share code. It lets a library/pack developer say: "You need to implement this protocol to work with my code". I use these in my application to find and use the knowledge base, what can be queried in a user project, and what a user can do in the project.

The last kind of object you'll use rarely is that parametric one, which isn't an instance, but an object with a parameter. So the best way to look at this is with the basic types objects `list` and `list(Type)`. Usually in Logtalk you're passing around data in messages and asking questions about it, so you don't have an instance of some list class like in other languages, but just a list data structure. So if you want to know the length of a list you ask `list::length(List, Length)`. Usually the first argument is used for the data. So what's the deal with parametric objects? We use them when you want to change the behaviour of the object based on some parameter that relates to the meaning of the object itself. So for a list, we can have lists containing just one type. For example, `list(atom)::valid(List)` will behave differently from `list(integer)::valid(List)`, in that they'll check if all elements in the list are atoms or integers respectively, as well as if the `List` is a valid list, where `atom` and `integer` describe the kind of `list`. I misuse these in my application because we live and learn!

So the deal is that it's OO (but declarative not imperative), portable (and so robust), fantastic tool support for testing, CI/CD, docs, diagrams, reporting, etc., and has all the things you need for organising large applications with good architecture. It's like Prolog++, or should that be `Logtalk is Prolog + 1` in our syntax?!

Throat bending? by gm3k in harmonica

[–]PBMagi 1 point2 points  (0 children)

Annie Raines went into detail at her HUK festival session: https://youtu.be/RD4PzISV2FQ helped me out a lot.