« first day (4437 days earlier)      last day (389 days later) » 
00:00 - 19:0019:00 - 00:00

12:36 AM
2 hours ago, by emanresu A
@RydwolfPrograms I
 
12:56 AM
My laptop was overheating, so I pulled a gallon ziploc bag of ice out of the freezer and set my laptop on top of it. The CPU temperature has since dropped by about 16 degrees Celsius, so I reckon it worked
 
SCIENCE!
 
It's still going down
(Peaked at 89C, now at 70C)
 
Sandbox posts last active a week ago: Task
 
1:23 AM
@ATaco Kotlin
Rust coming in second
 
I'm not surprised :P
 
why not
 
I forgot to say, even though I do like JS for quick testing, for larger projects I prefer(ed) Swift
 
A good chunk of your discussion is about Kotlin
 
You even chose Kotlin for CGR
 
1:27 AM
Kotlin go brrrr
 
The more I use C the more I enjoy it, Although C is a slippery scope to C++...
 
@lyxal in Charcoal they're ceiling and floor for some reason, but I'm wondering whether I should move them to uppercase and lowercase instead
 
 
1 hour later…
2:59 AM
0
Q: I challenge you to write a decorator which flattens inputs, accepts strings, and rounds floats to integers within machine epsilon

Samuel MuldoonThere is an ancient exercise which used to be given to students to write a recursive function named pow which calculates things such as 3.433 raised to the 8th power. I challenge you to write an implementation of pow which can accept input from many different data-types. At its core, pow sometime...

 
3:33 AM
I know CoffeeScript isn't that popular anymore, but it removes so much punctuation that translating my JS to CoffeeScript with idiomatic spacing is about the same size as running it through a minifier
 
4:16 AM
I'm pretty sure it's a Rite of Passage here to have your first challenge be closed.
 
@Bbrk24 But you can't serve coffeescript files and expect it to run on browsers, that's the difference
 
@ATaco dang, guess I was never properly inducted into the code golf community then :p
 
@Bubbler I'm already having to compile C++ -> wasm and Sass -> CSS, so that isn't really a concern for me. I was moreso talking about ease of development, and CoffeeScript seems to address the two problems I was having (scope management and punctuation soup)
 
5:06 AM
@ATaco damn, i dont think i ever had a closed challenge before, even my first one
tho my first challenge did have a load of comments saying how to improve my challenge lol
and it only got one answer lol
wait a fucking minute... was the tio link for that answer wrong the entire time??? i was just revisiting my first challenge and the one answer on it and then click the tio link... the code dont even match in the link
lemme put a comment in the guys answer real quick, how tf i didnt notice this before
 
 
1 hour later…
6:22 AM
what the hell is that example of a decorator
why would it be some convoluted class instead of a bare function unless it needs to be stateful
why is there a __new__ instead of an __init__, why is the goddamn class name lowercase, where is there a callable that necessitates kallable, how the hell does the __getattr__ even not error (is instance supposed to be self?????)
like the challenge wasn't bad enough that code needs to be burned with fire
also just noticed
# many tuples nested
result = pow(((((5.21, 8)))))
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔
 
rofl
 
6:48 AM
@UnrelatedString lmaooooo
@UnrelatedString well they have instance = super().__new__(cls) but i thought super() is supposed to refer to the parent class, yet class decorate isnt inheriting anything??
 
i think there is an implicit superclass of some sort but yeah that still shouldn't, like, do anything
though i have also literally never written or seen a custom __new__ before :P
 
yea lmfao why use __new__ when theres __init__
 
@AidenChow It's normally used for meta-classes
 
> __new__() is intended mainly to allow subclasses of immutable types (like int, str, or tuple) to customize instance creation. It is also commonly overridden in custom metaclasses in order to customize class creation.
 
@mousetail so super() in this case is referring to a meta-class??
that looks completely unnecessary in this case lol
 
6:54 AM
deeply sp
*so
 
No, in this case super is the class "object". You need it because if you override new it's impossible to actually create a instance of the object otherwise
 
wait but what does functools.update_wrapper(instance, kallable) even do
 
It copies the __name__ and __doc__ attributes from the inner function
 
@mousetail oh ok
 
That code is actually pretty reasonable for a class-based decorator
There would be no other way to be able to call update_wrapper on self except using __new__
as for why it's called klass, it's because class is a reserved word
 
6:57 AM
*kallable
class is cls
 
Ok yea that's not right
 
oh apparently there is a built-in called callable
 
also the class name is lowercase because it's intended to be used like a function
 
wait then why they need a class in the first place
 
IDK some people prefer class-based decorators
You could implement it as a function like this:
def decorate(funk):
    @funktools.wraps(funk)
    def _inner(*args, **kwargs):
        funk(*args, **kwargs)
    return _inner
It would do the exact same thing
Of course you would normally want to add something in _inner/__call__ so the decorator actually does something
 
7:01 AM
whats funktools....
 
functools
oops
 
tools for gettin' funky
 
note that functools.wraps is just the decorator version of functools.update_wrapper. They do the exact same thing
 
 
3 hours later…
9:45 AM
@UnrelatedString that can only be used on a Friday night
 
⬆️⬇️↪️⬆️⬇️↪️⬆️⬇️↪️⬆️⬇️↪️🔄
 
 
1 hour later…
11:01 AM
@UnrelatedString you spin me right round baby
 
right round, like a record baby right round right right round
 
oh no it's the DK Rap all over again :p
 
(i feel like i got the second to last word wrong because it has been literal years since i've heard that song :P)
 
 
1 hour later…
12:17 PM
time for rabbit
today we are adding mutability controls
 
12:28 PM
I think I can store mutability as a boolean
hmmm
well now I have to figure out if mutability is a property of a type or of its fields
I think it's of the fields
done
that was concerningly easy lmao
next problem: default field values
should they be object instances? should they be types?
I don't know
 
I really wish SE chat would could multiple messages from the same person as one unread
It's annoying when I see "5 unread messages" but it's not a conversation just Ginger talking to themselves again
 
12:44 PM
@mousetail well in this case I'm actually asking for input
LDQ: how should default field values be stored?
it looks like they're stored as instances of their type
wait, this is confusing
 
Often they are basically functions that create instances of the type
 
hmm
the issue I'm having is that a type is a template for an object, in this case a struct, so it can't have any actual objects in its fields
but having default values would seem to violate that restriction
because a default value is an object, but fields are types
(and of course this is made even more confusing by the fact that both types and objects are themselves implemented as objects in the interpreter)
it doesn't look like Rust allows default values in its structs
@RydwolfPrograms plz confirm
 
Default should be a static method on the type
 
yeah, uh, one tiny problem
I don't have static methods yet because they themselves would be a default field
 
I don't understand, why would they be a default field?
 
12:58 PM
because they're an object property of a type
in fact, I currently have no way at all to represent a type as an object
 
Not every type should have a default though
 
huh?
 
I'm extremely confused what you are trying to accomplish. Why would every object property need to have a default?
 
okay so
what are you confused about?
 
Everything. What are you even trying to accomplish. What problem does this complex default system trying to solve?
And why can't types have fields?
 
1:02 PM
like, when I create a struct, I'm trying how to figure out to set properties of that struct automatically
@mousetail because "types", according to Rabbit code, do not exist as things that can be interacted with
if Rabbit had a type() method it wouldn't be able to return anything meaningful
 
Why do you want to set struct properties automatically?
 
¯\_(ಠ_ಠ)_/¯
 
That seems like a huge cause of bugs
 
fair enough
this being next to impossible should've been a sign that I shouldn't be doing it :p
my question has been answered, thanks
 
There can be something like a default trait that can create default values for some types, but making it universal seems a recepie for troble
 
1:35 PM
Yeah Ginger, I also have no clue what you're trying to do here
Rust does have "default" values, which you can define through the Default trait
 
1:53 PM
Projects: Rust
Quick testing: JS
Planning on getting the best of both worlds with Cuprous, which will be a slightly higher level (it'll slightly compromise low-level control in exchange for massive readability/writability advantages) language which transpiles to Rust
@ATaco How would foo be undefined in that case tho?
Oh wait nvm
But I do think it'd be unreasonable to assume map doesn't run more or less instantly
If you wanna break things, you could do much worse
 
2:44 PM
@ATaco Kotlin for big stuff, Python (Rabbit once it's done) for anything web related or quick scripts
and yes, Rabbit can do scripts (in a fashion) using RSH
 
Honestly python is a great choice for projects of any size
 
yknow I just realised my keyboard's end key isn't working :|
 
That's my favorite key :(
I use it whenever I forget to add semicolons
 
@mousetail Gotta disagree there. It's great for small projects, but even for a little website, I quickly started finding it problematic
Refactoring is a real pain
Although I guess using a good linter would help (I was using PythonAnywhere's linter, which is pretty basic)
 
Not if you type hint everytihng properly
And use the full suite of linters
 
2:51 PM
Yeah PythonAnywhere's linter isn't very good, doesn't seem to understand type hints
 
I've worked on very large python projects with my company and they where all just as readable and refactorable or more so than C#/Java projects I've worked on
 
@ATaco Scala for projects, Python for quick scripts
@mousetail Oh
Maybe it's just me then, I've only worked on amateur projects, not professional ones lol
 
@mousetail i just use A; :P
 
Forgive me for talking out of my donkey :P
 
Terrible python is terrible yes
The language enforces very little, you have to enforce guidelines yourself
 
2:53 PM
@ATaco python for everything... i have got no project ideas for C/C++/Rust/...
 
What happened to flax btw?
 
@user my final examples happened :P
 
Final exams?
 
i mean exams
yeah
i cant type as usual
 
If the final examples have been written, is the language done?
 
2:55 PM
Oh dear, did you listen to Rydwolf and feed your hand into a combustion engine?
5
 
@user i fed them to the jet engine instead
 
*Tank of bioengineered bacteria
 
@user what
 
I've already said, I don't think combusting fossil fuel executives directly is an effective option
Processing them into hydrocarbons first is more efficient
 
What about hyrdogen?
 
2:56 PM
@mousetail Let me create a bookmark
 
Just because it's combustible doesn't mean it's not renuable. You can still use combustion engines
 

Hand power

yesterday, 21 minutes total – 80 messages, 3 users, 4 stars

Bookmarked 6 secs ago by user

 
But there's a lot of water and incombustible stuff in hands
Using bacteria to further refine your hand would give you a cleaner burning fuel
 
Dry them out first
 
You'd still gets tons of smoke and ash
 
2:58 PM
That's not really a problem
Use a steam engine
Better suitable for solid, messy fuels
 
It really does make things easier if there's no smoke/ash, see different grades of coal for example
 
True of course, but we're not trying to be as efficient as possible
 
We aren't?
 
We're burning hands
 
For a quadcopter
And quadcopters aren't easy to clean because they tend to be in the sky
 
2:59 PM
It doesn't take a genius to deduce a hand is not the most optimal fuel
 
The less complexity the better
 
oh no not again
 
how did we suddenly start talking about optimal fuels
 
I don't think you could create a engine light enough and with enough power to burn a hand and fly at the same time
 
Bioreacting the hands into clean hydrocarbons would allow the drone to be both much lighter and much less complex
 
3:00 PM
You are looking at single digits efficiency
 
@zoomlogo These are far from optimal fuel sources
 
E.g., you don't need to keep a bunch of weight in bones and water
Or ash from already burnt fuel
 
I have lived to regret this
 
@RydwolfPrograms That will cost so much energy though that you would barely make a profit
 
I don't think the point is making a profit here, it's simply being weird
 
3:02 PM
Wdym? These would be bioengineered bacteria
They would be incredibly efficient
 
They consume most of the energy they extract
Bacteria don't work for free
 
We can make them work more or less for free
If they don't need to spend energy reproducing, they don't need much energy to keep on doing very little
 
They literally die if we don't pay them enough energy
Of course they will reproduce
 
@mousetail Yesterday, Rydwolf said the bacteria would eat the non-flammable stuff, although idk if that would give them enough energy to live
 
But I don't think it'd be that much
@mousetail Why?
We'd just turn that off
It doesn't benefit us to have them reproduce beyond the optimal amount
 
3:04 PM
Bacteria live a matter of hours
If you turn off reproduction they die
 
@user Well, typically flammable == what can be eaten for energy
 
And they reproduce loads when there is a ton of food available
 
We measure food-calories by burning the food in question
@mousetail Once again, bioengineered
We can change that
@mousetail Sure, but you can just replace them
 
You can't bioengineer away the tools you would use for bioengineering
 
?
Just make it so they need some sort of external chemical signal to reproduce
 
3:06 PM
I don't think this is remotely viable
 
I don't think you're correct
 
Maybe some kind of fungus instead?
Less likely to starve to death before even starting
 
Bacteria, fungus, giant sloth, who cares
Just some sort of bioengineered life form
 
It'd be more efficient to burn plants instead
 
Nuh uh, plants have tons of waste stuff too
 
3:07 PM
Isn't there way more plant biomass than human biomass?
 
Wood produces a lot of ash
 
Every level you go up the food chain, you lose a lot of energy
 
A wood powered drone would, frankly, be silly
 
You can turn wood into ethanol
 
Unlike a human hand powered drone
 
3:08 PM
ethanol can be used in internal combustion engines
 
@RydwolfPrograms Yeah, much more sensible :P
 
But the point is we want to power the drone with a human hand
 
You could probably do the same with hands but of course lose most of the engergy in the hand
 
We could use something other than a human hand but like, why
 
Because again any bioengineered life form needs to eat
 
3:08 PM
Btw, should this be moved to the Sand Trap?
 
To do what?
 
To stay alive and reproduce
 
We can just limit it to the bare minimum functions for it to produce the enzymes and stuff that we need for a few hours
 
Aren't you underestimating how easy it is to bioengineer stuff?
 
Even just cracking carbons takes a lot of energy
if it did just that and not any of the other things
 
3:09 PM
@user We embark on this journey not because it is easy, but because I am stubborn
 
It might be easier than cold fusion but it's not the sort of thing you'd achieve within a decade
Y'all want to move to the Sand Trap?
 
Also, y'all fail to account for the fact that a lot of the energy the bacteria would consume would be left behind in their corpses
Which could be eaten by the other bacteria
This is a closed system; only energy lost as heat would be truly lost
 
A lot of energy is lost as heat
 
Some is, but I'm sure you could optimize a lot of that out
 
I'm taking an intro to ecology class rn and my textbook says about 90% of energy is lost at each trophic level
 
3:12 PM
Yeah because we don't optimize to provide energy to the things that eat us
If we did, we could probably get better numbers
("we" being all organisms)
(not just TNBers)
If someone has $30 to waste, this might be a valuable source
Unfortunately I can't find a PDF of it
Ooh "biogeneration of hydrocarbons" is a good search term
 
I can access it thanks to my university, not sure how to attach it here
 
Oh nice
Maybe Google Drive?
 
:D
Gotta do school stuff but I'll look through that later
 
yar har fiddle dee dee being a pirate is alright to be
 
3:28 PM
Is it really piracy?
I won't be reading it, only Rydwolf, so it's basically like I got a free car somewhere and someone stole it rather than me making a copy of the car, right?
 
0
Q: Detect sonar imposters

Wheat WizardYou are the sonar captain aboard an underwater submarine. The way sonar works is that every submarine sends out a ping at regular intervals. Each interval is a whole number of seconds. Each submarine has an identifying amplitude, that is no two submarines send out pings at the same amplitude. Th...

 
3:42 PM
I wonder: how will the Rabbit module site do authentication?
I'm planning to use GitHub for user auth, but how do I get credentials for carrot to use?
(cc @RydwolfPrograms, again)
 
4:03 PM
Not everyone uses GitHub. Might want to allow alternatives
 
4:32 PM
@NewPosts su bmarine s
4
 
 
1 hour later…
5:37 PM
@user like what?
Google's OAuth is a pain to set up (and I'm like 99% sure it costs money), and there's no way I'm implementing my own system
 
5:57 PM
@Ginger allow simple email + password as well
@Ginger mwahaha ive converted you to the kotlin side
 
@Seggan no
> there's no way I'm implementing my own system
I'm frankly surprised you'd trust me with your password :p
I sure wouldn't
 
SHA256 exists
 
don't care
 
@Ginger well say bye to 20% of your potential users
 
I will not be using my own crappy implementation of password storage
@Seggan crates.io uses GH auth, and they don't seem to be suffering for it
 
6:07 PM
@Ginger the point is you dont
hash them on client side, the server only stores hashes
 
no
 
why not
@Ginger i take it back, then
 
I don't trust myself to do it
and anyone turned off of Rabbit by an authentication method needs to get their standards recalibrated
anyway
 
^^
its really simple. prob easier than gh auth
 
n o
I will not be doing email/password authentication
 
6:10 PM
@RydwolfPrograms talk some sense into this person
@Ginger at least username/password then
 
@Seggan he'll agree with me:
in lambda.chat, May 19, 2022 at 22:00, by Radvylf Programs
I mean, piggybacking off an SSO provider is 100× better than making your own account system
 
6:25 PM
@Seggan Noooo
SHA-256 is not a password hash
You need to use scrypt/bcrypt, Argon 2, or PBKDF2
With a salt
 
see?
 
@Seggan Nope don't do that either
Then the hash becomes the password
All that client side hashing protects from is password reuse, but only in one direction, and usually not the one that's actually a problem
 
the whole reason I'm outsourcing this stuff to GitHub is because GitHub pays people to make sure it's secure
I'm just one person with zero cryptography knowledge
 
@Ginger codes away angrily
 
however, if yall have other SSO providers (that aren't a pain in the ass to use) I'll consider adding them
 
6:29 PM
CGCC
 
I know you're (impersonating) Jo King but that's actually not a bad idea
 
The main difficult part of implementing your own username/password system isn't even the password storage, it's things like password resets and requirements
 
good point
 
@Ginger you saw this?
google is a must have imo
 
it's also a pain in the rear IIRC
hmm, that's not OAuth tho (which is what I recall being a pain in the rear)
what... is that?
 
6:32 PM
it is oauth
 
yeaaaah I have to do a bunch of OAuth stuff
maybe later, but for now no
 
You do need a terms of service and privacy policy and those are both annoying
 
^
whereas with GH I fill in a few fields and done
and IIRC GH lets you make an account with Google
 
nope
@RydwolfPrograms ToS is optional
 
hmm, it looks like Codeberg supports OAuth apps
so I can have it as a sign-in provider for people like @Wezl' who don't like GitHub
 
6:40 PM
If you're using Flask, there's modules to help deal with passwords
You don't have to worry about any of that stuff yourself
 
nah, I'm (going to) use Rabbit
that's right it's a self-hosting website :b
 
Ambitious
 
^
(Unless Rabbit can use JVM dependencies)
 
that's how I'll know it's actually usable
@RydwolfPrograms it can lmao
 
6:43 PM
I'm not writing an SSL lib by hand
 
Well usually you do TLS with reverse proxying right?
 
that was an example
 
00:00 - 19:0019:00 - 00:00

« first day (4437 days earlier)      last day (389 days later) »