« first day (4442 days earlier)      last day (404 days later) » 

12:03 AM
@ASCII-only sorry to see you feel the need to perform certain GitHub activity
 
12:32 AM
If anything, an organisation makes it easier to invite collaborators to work on code
It's a net positive
 
1:00 AM
The best solution I can come up with to this one question is 42% NOPs which feels slightly ridiculous
 
 
3 hours later…
4:19 AM
@lyxal yeah, it's mostly because i figured I'm not very active of a contributor anymore... like i don't mind contributing but i'm not active here enough to know what needs doing
 
Organisations are good for helping with that - once you appoint other co-owners, they can add new contributors as needed
they also greatly simplify permissions management :p
 
 
1 hour later…
5:38 AM
@ASCII-only would you recommend that? like I haven't done enough research into it but it (deno) looks cool; are deno and discordeno stable enough?
I'll have to look into if it supports the other libraries I need but if it has noticeable stability or performance benefits I might want to rewrite my bot (again...) in it lol
I have noticed that djs is pretty annoying to use with ts
especially that one version where they half-implemented discord adding text-in-voice to stage channels so they'd pass .isTextBased() but not have a .send() meaning I'd need to use "send" in channel which is horrifying and terrible
 
6:26 AM
Deno itself is probably stable enough
Given that Discordeno seems to support Node.js too, it's probably safe to use it even if you might have to switch from Deno to Node later on
Although Discordeno itself may stop being maintained ig
 
7:14 AM
@hyper-neutrino deno should be very stable nowadays, discordeno... is full-featured enough for me but i dont use anywhere near all of discord's API so i cant really say whether itll cover your usecase
i guess you could do a quick search in issues for some of the more obscure features (if any) if there are any they still havent implemented or something
@user tons of deno packages support node thanks to an official build tool
 
 
2 hours later…
9:16 AM
@ASCII-only not sure about "needs" but I had a few ideas it would have been nice to run past you, such as Pivot(:Right); to set the pivot direction absolutely, multidimensional indexing for AtIndex and AssignAtIndex, or I was also pondering a complete rewrite of the canvas handling code since it didn't like it when you skipped lines out completely
 
 
2 hours later…
11:29 AM
Why does & have lower precedence than ==? In what world does that make sense?
 
bitwise and?
 
yea
3 & 7 == 3 is 0 because the intermediate step is not 3 == 3, it's 3 & false
 
why would it have higher precedence
oh the other way around
what the hell
what language is this
 
JS, but JS inherited this from C
 
huh, could have sworn c had it the sane way
 
11:32 AM
Swift has it the sane way
 
maybe it's a holdover from some early version before logical &&
 
But in C, the bitwise operators are lower precedence than literally everything, even +
(actually idk whether & or && has higher precedence)
but in Swift, a << b + c is (a << b) + c, while in C it's a << (b + c)
 
oh yeah c even has a warning for that because you almost never want to do that but they couldn't fix it for backwards compatibility lmao
why the hell would js and swift not fix it
 
Again: Swift does. But JS, and presumably Java and C#, do it like C
 
yep java also has it like that
and c#
 
11:38 AM
@Bbrk24 B
 
so we've got swift, python, and rust for sane
 
42 secs ago, by lyxal
@Bbrk24 B
 
but basically every other c descendant is fucking senile
 
cm.bell-labs.co/who/dmr/chist.html
go to the Neonatal C section
 
isn't c not completely backwards compatible with b though or
 
11:40 AM
It's more that C had the features from B, introduced && and ||, and needed backwards compat with C
 
ahh
> In converting from B to C, one wants to replace & by && in such a statement; to make the conversion less painful, we decided to keep the precedence of the & operator the same relative to ==, and merely split the precedence of && slightly from &.
 
@lyxal Of course.
 
12:23 PM
well now I know what not to do with Rabbit's bitwise operators :p
 
12:35 PM
Why is this on physics lol physics.stackexchange.com/q/230685/338689
 
1:30 PM
@user yeah my only concern about discordeno is it might stop being updated at some point if it doesn't have as much of a community and dev team backing it as djs does; djs is too large for people to just abandon it (presumably)
I looked into it and it seems stable enough? and the way it does things looks pretty nice at least
@ASCII-only alright, thanks
oh, one thing I needed to find a weird workaround for in my current code was being able to dynamically unload/reload files which I ended up doing by setting my compiler output mode to convert my imports to require and then using require and deleting stuff from require.cache - seems like deno supports that natively though with deno cache --reload=file.ts though which could be really nice
 
Actual TS code I just wrote:
    defaultSettings.hasOwnProperty(key)
      ? `\nDefault: \`${defaultSettings[key as keyof typeof defaultSettings]}\``
      : ""
Maybe it's just me but I feel like that as keyof shouldn't be necessary
 
keyof is needed for sure, typeof maybe not in a ideal world
 
the actual type is long enough that it's shorter to write typeof defaultSettings
It's Readonly<Omit<IServerSettings, "server">>, iirc
 
can't you alias the type?
 
@mousetail If I change hasOwnProperty to in then I don't need the cast
 
1:41 PM
yea but in is vulnerable to prototype polution
 
exactly
why do they make the more correct way more clunky
 
Can't you do defaultSettings[key]! ?
 
Nope, it complains that there is no index signature that takes a string
There are some places where I just give up and have @ts-expect-error followed by foo.bar?.baz because of this
 
You could cheat by doing hasOwnProperty(x) && x in defaultSettings but that's ugly
 
What about this one? github.com/xsduan/conniebot/blob/dev/src/helper/utils/… DMChannel doesn't have the permissionsFor method, but other channel objects do, and the only way I know of to convince TS this is safe is, once again, in
 
1:58 PM
my final exams are over!
 
you could also just use defaultSettings[key as any]
 
I think I have a linter rule that prevents me from using any
 
@Bbrk24 assuming the message is supposed to be in a guild, you could try replacing Message with Message<true> in your function's signature
 
It's allowed to be a DM
 
2:01 PM
But, good to know
 
yeah ts doesn't really like you using ?. to reference fields that may not exist which I actually find very annoying
hm, I would just use in to get rid of the error
but idk what best practice is
 
Well I've removed as much in from the codebase as I could find, after the string "__proto__" caused it to crash
 
ಠ_ಠ
 
If I ever write another Discord bot, I'm not using JavaScript
 
I'm sorry you're doing what
 
2:06 PM
18 hours ago, by Bbrk24
I want to be clear on something: I did not write the majority of this bot. I've been its primary maintainer for the past couple years, but was not for the majority of its existence.
 
I'd advise you to burn it all and start over
like I did with Vyxal Bot
 
Burn it alllllllllll.
 
the problem with me rambling about Rabbit in the Rabbit room is that there's nobody else there to keep me from making giant mistakes in my design :p
 
I'm also not hosting it, which may cause problems once discord.js bumps their required node version above what the host has installed
 
Rabbit's development process is Cunningham's Law as an art form: I post my godawful code, everyone's like "nooo Ginger you should be doing it this way instead", I steal their code while laughing evilly, and rinse and repeat
 
2:12 PM
@Ginger Maybe invite @Seggan and/or @RydwolfPrograms? I've seen them talking with you about Rabbit when it was in here
 
@Bbrk24 they're the only two people who're normally in the room
 
Ah
 
but neither are online right now :b
 
If you think the Rabbit room is lonely, check out the CGR room. Last message was several days ago :P
 
l + ratio + no messages + This room has been frozen due to inactivity.
 
2:26 PM
@Bbrk24 which bot is this?
 
but also yeah what ginger said probably isn't a bad idea; especially if (not saying you are, but if) you're the only person really working on it it's probably worth the time to rewrite it into something you can more easily work with
interesting
 
As I said, I'm also not hosting it. If I want to do it in basically anything other than JS (the host has node) or C (the host has gcc) I'd almost certainly have to switch to hosting it myself
 
hm, I see
is the person who is hosting it inactive or smth and you can't contact them to get them to either change it or give you access?
 
Can you build python on the server?
 
2:38 PM
^
Does it have a JRE?
because that'd let you use Rabbit
 
I don't have root access and they haven't responded to me in months
ew Java
 
you don't need root to build python
 
JRE != Java
^^
 
though some optional features might not work
 
correct
 
2:39 PM
But I mean I can't install python/java/etc if it's not already there
 
You can build python from source
 
there are a few modules that require extra libraries to be built
 
Ah, there is a python3 already installed
3.10.8
 
nice
 
oh that's recent
 
2:40 PM
that's a recent version
 
no java that I can find
 
seems someone has been keeping things up to date
 
@mousetail it might have unattended upgrades on
or whatever the equivalent tool for its OS is
 
They use this to host their own website, they just let my bot live there because it's not resource-intensive
 
whose bot is this? I could host it
 
2:42 PM
^ do this, then Ginger can go AFK for 6 months
 
it was using 600MB RAM and 1kBps networks last I asked
 
I'd be fine with making you a user account on my droplet (assuming Radvylf's okay with it)
 
Is Docker installed?
 
My bot, I suppose? I am the maintainer, but I'm neither the license holder nor the current host
 
If you're in the docker group you can get root access pretty trivially
 
2:43 PM
well I guess it's technically Radvylf's droplet, because he's paying for it q:
 
How would I determine that? I've only used docker on Mac, which uses a GUI
 
Just docker info and see if it works
 
imagine using Docker
 
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., 2.12.2)

Server:
ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": dial unix /var/run/docker.sock: connect: permission denied
errors pretty printing info
 
F
 
2:44 PM
Nope, you're not in the docker group then
 
Any unusual SETUID binaries?
 
Last I asked the server was running NixOS, iirc
 
oh, Nix
it oughta be pretty easy to install whatever then
don't quote me on that though I'm not very good with Nix
 
Try running this: find /bin -perm -4000
 
Oh yeah, $HOME/.nix-profile/bin is in $PATH
 
2:45 PM
it should tell you what binaries have setuid
 
lol I like how we're just jumping straight into privilege escalation. Should we try rowhammer next? :p
 
@mousetail Nothing
 
You started that
 
ooh maybe it's vulnerable to Log4J d:
 
@Bbrk24 Sad
He said it didn't have java
and it seems there's some kind of automatic updates
 
2:46 PM
everything has Java
 
Java runs on 13 billion devices
 
Well, which java found nothing, at least
 
the laptop I'm typing these words on has at least 3 copies of the JRE on it
 
and $JAVA_HOME is empty
 
it pervades all
 
2:47 PM
Check /usr/bin too, /bin might be a symlink
As it is on Fedora
I'd expect at least something to be setuid
 
@RydwolfPrograms and (my copy of) Debian
honestly "java runs on 13 billion devices" sounds like a threat
"...and your device is next"
 
@RydwolfPrograms Neither of the two are in $PATH...?
 
Most easily-difficulty CTFs I've done are just python being setuid or something like that
 
My path is set to /run/wrappers/bin:/home/beberka/.nix-profile/bin:/etc/profiles/per-user/beberka/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
 
Or a script so you can hack the import system to load your file
A setuid bash script can also easily be hacked
 
2:49 PM
@Bbrk24 yeah that's definitely a Nix system
 
I wonder how you can tell :p
 
@RydwolfPrograms cries in replit
I'm so thankful I don't have to use replit anymore lol
oh wait you were making a joke about how "nix" is everywhere
whoosh
 
r/itsanixsystem
 
I was just commenting on those specific (and rather strange) path entries being typical of Nix systems
 
NixOS doesn't act much like other Linux distros
/they could've chosen to make it a BSD or something too
It's revolutionary and all but it doesn't help when something assumes things about where things are stored
 
3:16 PM
were there a Linux family tree NixOS would be about halfway between Android and normal Linux
no, that's too kind to Android
 
Why Android?
 
it's got the Linux kernel and basically nothing else IIRC
 
It has glibc, right?
 
no clue
 
Gotta have either that or musl, right?
Not gonna be able to do much otherwise
 
3:25 PM
I say that because the Swift standard library contains code of this form:
#if canImport(Darwin)
// iOS, macOS, Apple Watch, Apple TV
import Darwin
#elseif canImport(Glibc)
// Linux, Android
import GlibC
#elseif os(Windows)
import CRT
#elseif os(WASI)
import WASILibc
#else
#error "Unsupported OS"
#endif
 
hm
 
If you're linking against Foundation, that already has these (and re-exports them even) so you don't have to do this. But some libraries, especially for server-side Swift, try to avoid Foundation.
Foundation is dynamically linked on Darwin platforms but statically linked everywhere else; it really bloats your binary size if you're not compiling for Darwin
 
@Ginger thou hast summonedest me?
 
whar ?
 
i got a ping by you in here
 
3:35 PM
hm
 
@Ginger BTW the JRE isnt available separate from the JDK anymore
 
w h a t
bruh
 
it hasnt been since like java 14 i think
 
@Seggan Ginger said there was nobody in the Rabbit room and I suggested they invite you
 
oh wow Rust is officially supported in the Linux kernel
 
3:41 PM
just learned that?
 
@Bbrk24 which gcc and which clang both error so now I'm thoroughly confused
 
@Seggan yus
 
$ ls -l .nix-profile/bin
lrwxrwxrwx 2 root root 62 Jan  1  1970 .nix-profile/bin -> /nix/store/shpy4sb7k20x9ilry8r6y8cr75b1q2x9-nodejs-16.14.0/bin
what
 
@Bbrk24 normal nix behavior
 
How do I make it follow the link and then ls -l the contents
I guess I could copy the link destination
$ ls -l /nix/store/shpy4sb7k20x9ilry8r6y8cr75b1q2x9-nodejs-16.14.0/bin
total 38320
lrwxrwxrwx 8 root root       45 Jan  1  1970 corepack -> ../lib/node_modules/corepack/dist/corepack.js
-r-xr-xr-x 2 root root 39238832 Jan  1  1970 node
lrwxrwxrwx 8 root root       38 Jan  1  1970 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 8 root root       38 Jan  1  1970 npx -> ../lib/node_modules/npm/bin/npx-cli.js
 
3:46 PM
oh btw java 20 was released last thursday
 
So I don't have write permission there, darn
 
@Seggan huh?
 
no new stable features, but a bunch of previews and incubating apis
 
like what?
 
im excited for when the new FFI api comes out
 
3:46 PM
hmmmmmmm
 
wow
 
@Ginger rust style pattern matching
 
it WHAT
 
saw that
pretty neat
 
3:47 PM
coroutines, finally a vector api
java 21 set to include sequenced collections and string templates
ooh its an lts release too
 
I'm mad 20 isn't an LTS release
Gotta wait until later this year to switch to the next LTS
 
@user yeah lol
but hopefully they stabilize at least record patterns
 
ye I love records
I ove pattern matching
@Bbrk24 It's so that you can have multiple generations at once, I think. If your current generation is messed up, you can boot into a previous generation instead
You know what I hate? Scripts that use #!/usr/bin/bash rather than #!/usr/bin/env bash or #!/usr/bin/sh
 
I’ve seen someone call env bash a security risk
 
14
Q: /usr/bin/env as a shebang - and its security implication

taifwaI have seen advice in several places to use the following shebang line #!/usr/bin/env bash instead of #!/usr/bin/bash My knee-jerk reaction is, "what if somebody substitutes this executable for their own in say ~/.local/bin ?" That directory is often set up in the user's path before the sys...

According to an answer here, there's no risk
 
 
2 hours later…
5:59 PM
could anyone check this challenge? is it ready to go live? codegolf.meta.stackexchange.com/a/25678
 
> Hello.
 
@HuỳnhTrầnKhanh this is , right?
 
correct
there's no input and you gotta print all the boards satisfying a condition
 
could you provide the complete output for checking purposes? (if it's too long you could put it in a Gist)
 
6:07 PM
done
is it fine now
gotta get my daily dose of internet fame :p
 
sorry, was afk
@HuỳnhTrầnKhanh lgtm, but you should ask at least one other person before posting :p
hey @Seggan does it look fine to you
 
6:33 PM
yes
 
ok cool
 
6:57 PM
@Bbrk24 C started off without && and ||, so you had to use & and | instead. Obviously they couldn't change things when they did add && and ||.
oh, somebody already said. that's scrollback for you. sorry about that
 
7 hours ago, by lyxal
42 secs ago, by lyxal
@Bbrk24 B
turns out there was never actually a version of c without &&, but they decided to keep the precedence from b anyways just to make it easier to port lmao
 
7:24 PM
& can be slightly faster than && in some very specific situations, in early computing that was much more imporant
 
Modern optimizers are probably aware of this
 
if the righthand side is a simple expression
Yea but when C was designed
In those days people optimized by hand
 
Yeah early C optimization had a lot of room for improvement, hence things like Duff's device
 
7:47 PM
It works only in C because switch case is just goto actually
 
@Bbrk24 Same thing in QBasic: 3 AND 7 = 3 is 3 AND (7 = 3) (AND is bitwise)
 
Yeah if you only have one "and" for both it makes sense
 
@RydwolfPrograms but was still just as ugly :P
 
I've never been so offended by something I think is 100% true :p
 
Lol
 
8:19 PM
lmao
bruh why tf is untarring this taking so long
it's only 5 megs
 
8:37 PM
0
A: Sandbox for Proposed Challenges

SpitemasterYour bots went to the mall together, but they got lost! Worse, they didn't agree on any strategy to find one another again. Here's what they do know: There are \$n\$ stores, and bots can only meet each other in the stores. Each time step, each bot must choose one store to be in. Two bots go t...

 
9:05 PM
mono go brrrr
 
9:25 PM
FINALLY
wow that was a pain in the ass
 
 
1 hour later…
10:40 PM
augh I hate how long Cargo takes to "Updating crates.io index"
@RydwolfPrograms how do you cope with this
Rabbit won't have these problems, which clearly makes it superior
 
@Ginger By not installing fifty million libraries
I mean I spend 30s waiting for tokio or whatever to install, once per project, big deal
 
11:00 PM
@user you're the only person I know who can list file directory paths and leave me wondering if you mean a generic path or an absolute path you have on your computer
 
@Ginger Use sparse index, it almost finishes instantly
 
11:16 PM
@RydwolfPrograms I'm sorry are you accusing me of having fifty million libraries installed
 
Ooh have you moved past your duct tape phase?
 
no, it's more that I don't use Rust :p
haha lol man you thought
 
Why are you using cargo then
Are you doing industrial espionage?
Spying on other package managers to steal their tricks? :p
 
I need to compile something that does use Rust
also yes but that's beside the point
@Bubbler damn that's fast
wow
 
Will be the default in 1.70 or something
 

« first day (4442 days earlier)      last day (404 days later) »