Show more

# toot 0.25.0 released

It's been a little while, enjoy. :)

* Show character count when composing (#121)
* Include changelog and license in sourceballs (#133)
* Fix searching by hashtag which include the '#' (#134)
* Upgrade search to v2 (#135)
* Fix compatibility with Python < 3.6 (don't use fstrings)

github.com/ihabunek/toot/relea

coloncolon.one now points at ::1

Have fun xD

James Mickens - My Love Letter To Computer Science Is Very Short And I Also Forgot To Mail It

youtube.com/watch?v=4vd2rCBjHp

I love this guy.

I've known about snake_case and CamelCase for ages, but today I learned that lisps use kebab-case. :)

en.wikipedia.org/wiki/Letter_c

why do women use common lisp instead of scheme?

girls just wanna defun

Tickets for Brussels acquired. Confirming my presence at 2020. \o/

λ git stash poop

Well, git might not like it, but it expresses what I wanted to do pretty well.

Dear library developers, please add a link to the repo in your docs so I can find the code from hexdocs.pm. Thank you.

So, an hour later I'm no wiser. :) Sounds like it should be pretty easy, and I'm possibly missing something obvious. If anyone knows the solution let me know.

This is trivially solved in code, and I've done so, but I like messing around with regexes and this would make me happy.

Show thread

Finally, I tried matching the character in the lookbehind, and while this kind of thing works for a positive lookbehind, e.g. this matches any letter preceeded by itself:

(?<=(.))\1

It does not work for negative lookbehind. This does not match anything:

(?<!(.))\1\1

Show thread

Another attempt was using the \K delimiter which allows for variable-length lookabehinds by matching anything before it and discarding it. However there is no negative variant of \K so it's of no use here.

Show thread

But if you want to make it generic, e.g. match any letter, you might try using backreferences:

(?<!\1)(\w)\1(?!\1)

This produces the error: "lookbehind assertion is not fixed length" since the regex engine cannot know how big the backref is.

Show thread

It's simple for a single character, e.g. the "c" from the example above:

(?<!c)cc(?!c)

This uses negative lookbehind and lookahead to make sure the two c's are not preceeded or followed by any other c's.

Show thread

Tried solving today's using only regex, and it turns out that it's not easy to match a string containing any character consecutively repeated exactly 2 times (but no more).

For example, I want to match "abccd", but not "abcccd".

TFW you realise you're not the only cat in the flat any longer.

Show more
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!