« first day (4465 days earlier)      last day (676 days later) » 

01:36
CMQ: Say I have a language where programs are bit strings of any length. And say the length of the bit string is important, meaning that padding it to a whole byte is out of the question. Could I use an encoding like a = 0, b = 1, c = 10, d = 11, e = 100, f = 101... up until any arbitrary length to shorten the bit string for code golf answers?
So like if my program is 11000001 could I place something split into 11000 0 0 1 in my answer?
Because long bit strings in answers doesn't exactly sound the most aesthetic, but there's no character set that maps one character to one code token
(the "encoding" system wouldn't really be encoding at all - it would be like a compressed thing just for posts here. The actual program would remain a string of bits)
It sounds like this would just be like an explanation tool
Well it's mostly to avoid having long bit strings in answers
If you can't recover the bitstring from the code you post that's a problem. If you can tho, it's fine IMO and I can't see any reasonable argument to the contrary
I mean an SBCS is just a special case of that exact thing right
@RydwolfPrograms even if it has to go through a conversion program first?
01:49
flags are just a special case of that exact thing right
@Seggan not what I'm thinking of
same difference tho
the "read as sbcs" flag does the same thing
@lyxal Sure, IMO
We allow posting hexdumps of machine code
What's that if not a more convenient representation of binary
And it has to go through a conversion program unless your CPU has experienced some very unique quantum tunneling
 
3 hours later…
04:59
@lyxal Yeah, it's no different from machine code submission explained in assembly, or literate charcoal, or binary lambda calculus explained in regular lambda calculus notation
For Cerebellum, a language I've been working on, I won't have a code page at all. Instead, there is a verbose version where all commands are written down in words. Then this can be automatically converted to a compact version for scoring.

If what you see isn't how you score anyways I don't see why you would need to make your code unreadable
@lyxal Actually it would be massively more helpful to post the raw bits (unformatted) and then a more human-readable version of it than 11000 0 0 1
maybe a few first answers explaining the encoding as well
It will also have proper long variable names that will not be included in the score at all
05:29
0
Q: Is Timber Flooring in Adelaide the Right Choice for Your Home?

Jaxon HealyYes, Timber Flooring in Adelaide is a great choice for your home. Along with adding a touch of elegance and warmth to any room, it is also highly durable. Timber is a natural insulator that helps regulate temperature and reduce energy bills. This makes timber flooring an eco-friendly option as we...

@NewPosts lol what
LOL WHAT
theres an answer too now
nvm its deleted
Flag as spam
@mousetail did that within the first ten seconds it was posted lolol
06:00
Oddly specific Australian Advertising
Hey guys and gals,,, :)
This is as off-topic as it goes, but I wonder if you have any input to this.
I have a job I like today that's interesting and relatively well-paid, considering my experience. Let's say $100k (I don't live in the US). I now have the opportunity to start in a temporary job, 1.5 years, that seems even more interesting.
What do you think is reasonable to except when it comes to salary? I might end up without a job in 1,5 years (very unlikely) or I have to take a job that's not so interesting as the one I have today (more likely).
Add a fifth of what you currently earn, so ~120k?
Individual experience may vary
@StewieGriffin fwiw theres a room dedicated to off topic discussions called the sand trap

 The Sand Trap

Room for discussions off-topic to CGCC (on-topic discussions s...
@ATaco I would consider this a minimum for a full-time position. I don't want to change jobs after all, so they would have to be on the generous side.
 
3 hours later…
08:53
@Bubbler even when it's a string of bits translated from sbcs?
09:19
@lyxal Yes. Writing it in "regular Vyxal style" (1 char per element) is already a massive improvement compared to a bit stream, even if it is "tokenized"
(improvement in readability)
10:02
@Ginger it's part of my code that runs 100s of millions of times
10:17
I solved the problem. It turns out adding 1 to a uint64 changes the type to int64 in numba
which seems crazy to me
phenomenal
Is 1 unsigned?
@mousetail I don't know . This is using numba/python
I literally have end = end + 1
which seems to convert end to a signed type
which then slows down the code by 40%
is there a way to make the 1 unsigned
I can do numba.uint64(1) and that speeds things up!
so it must be that 1 is signed
that is pretty annoying
I mean it's fine now I know it but it does mean I have to go through my code worrying about any constants
10:29
Well noone uses numba for the convenience
I do! Otherwise I would use cython :)
I only use numba because it is easier than using cython
Just because a worse version exists doesn't mean it's good
Normally you'd use C or Rust for performance
I refuse to code in C :)
I wrote a few thousands lines of C recently and it reminded me why no one should do that
hence, rust
the bugs you can't fix are possible overflows and serious weirdnesses about unicode
yes I should learn rust
10:33
I highly recommend it, it does require a significantly different way of thinking than other languages though
it's just that my mother always taught that you should be neither a lender or a borrower :)
Just lend with high interest and borrow with low interest
:-D
I feel another financial crisis coming on
When lending to friends just consider it a gift, if you get some back it's nice but don't expect it
very wise
 
2 hours later…
12:54
Is it just me, or does this have ChatGPT vibes?
Yea it does
Not so much chatgpt, maybe some other LLM
Nevermind
I stand corrected
@cairdcoinheringaahing it's not just vibes
The number of topologies on a set with n elements is equal to the nth Bell number, which we denote by Bn.

The Bell numbers can be defined recursively as follows:

B1 = 1

For n > 1,

Bn = sum[k=1 to n] C(n-1, k-1) Bk

where C(n, k) is the binomial coefficient, which counts the number of ways to choose k elements from a set of n elements.

Using this recursive formula, we can calculate the Bell numbers as follows:

B1 = 1

B2 = C(1,0) B1 + C(1,1) B1 = 1+1 = 2

B3 = C(2,0) B1 + C(2,1) B2 + C(2,2) B1 = 1+2+1 = 4
If add one to a uint64 in C what is the type of the result?
@lyxal ...those aren't even the Bell numbers
@Simd If you add 2 numbers of the same type you'd get that type
13:00
Basically, is 1 treated as signed or unsigned?
@mousetail yes but what type is 1?
@cairdcoinheringaahing LLMs be like that sometimes :p
Depends on the context
Consider val = val + 1
Where val is uint64
Is the result of type uint64 or int64?
Yes
But it doesn't even matter in C
Since it doesn't check for wrapping
It seems to matter for optimization
But which is it?
13:02
It won't matter in C because there are no bounds checks
If you added a int32 it would need to be sign extended
but if they are the same length it doesn't matter
I think in the python case the actual performance cost was changing the length, not the sign
And maybe bounds checks
For numba it must be the type change as end = end + np.uint64(1) prevents the slowdown
So 1 must be signed and converting end to a signed type
Sign shouldn't really matter
The slowdown happens when end is then used as the end of a range in a loop
Could it be converting between python int and normal int at runtime?
That seems so be the problem with types and loops
13:11
Might not be properly inferring the type of "1"
Have you looked at the generated code? Not sure what numba compiles to
I am really bad at reading assembly
@mousetail would you be able to read/interpret it for me?
...maybe. Or someone else here could
I mostly read the formatting, if that's done well I can tell what is going on
I really wanna drop an entangled photon into a black hole now
We can create very tiny short-lived back holes right? Or is that just sci-fi. I can't tell the difference anymore
2
I know we can create analogs (e.x. making water go down a drain or sonic black holes) not not actual ones iirc
besides, micro black holes would evaporate too quickly I think
If we launch enough entangled photons at it one is bound to go in
"A paper by Choptuik and Pretorius, published in 2010 in Physical Review Letters, presented a computer-generated proof that micro black holes must form from two colliding particles with sufficient energy, which might be allowable at the energies of the LHC if additional dimensions are present other than the customary four (three spatial, one temporal"
@mousetail true, but idk if the instruments are fast enough to do science with the infallen photons
We'd need to do science with the entangled one right? Which went the other way thus can be measured for longer
Yes but the black hole would evaporate by that time, and we’d not be able to do any science while that black hole is active, that’s my point
13:27
In [2]: i = np.uint64(2**64-1)

In [3]: type(i)
Out[3]: numpy.uint64

In [4]: type(i+1)
Out[4]: numpy.float64
Madness :)
Depends on the purpose of the experiment I guess
Or maybe that would prove entanglement is broken at the event horizon, but that was apparently disproven according to this physics.se question
So 1 is a floating point number
If it's not broken the entanglement must still exist even after the black holes disapearance right?
One of the particles in the hawking radiation must be our original photon
still entangled
Yeah that’d be my guess, somehow
13:28
Then how can it be used in range?
It makes no sense
@Simd It's inferring the type wrong for sure
@mousetail but what if black holes never fully evaporate? Iirc we’re describing the information paradox rn
What if ure left with a naked singularity, that’d be interesting
According to current physics we predict it would last less than a nanosecond
Though a naked singularity would be interesting
Wait that’s less than the planck time
It’s impossible?
Me is confused
What we know about physics kind of breaks down at those scales
Until we have a theory of quantum gravity we can't really know
 
4 hours later…
17:34
I want to nominate some answer from Is it a plausible chess move for Best Mathematical Insight, but I'm not sure which one to nominate.
I think loopy walt's Python answer has the clearest explanation, but their Octave answer is older, and Jonah's J answer that also uses complex numbers is still older.
17:53
Nominated the one with the best explanation.
id nominate the oldest one
 
1 hour later…
19:02
any feedback on this challenge? codegolf.meta.stackexchange.com/a/25730/108687
i want to get a working reference implementation as a stack snippet before i post it but i'll get to that later
19:29
Just realised I featured the wrong Best Of 2023 post :/
The nominations post is much better to have visible than the categories
Yeah i saw that but assumed to be intentional
Never assume anything I do is intentional :P
Maybe HN did it
No, I did it :P
19:43
@cairdcoinheringaahing Sorry to bother you again. The MATL room becase frozen again just 1 day after you unfroze it. I thought it was always 14 days?
@LuisMendo If no messages are sent after unfreezing, it re-freezes after 24 hours
Aww. I didn't know. So can you unfreeze again and I will send something?
Already unfrozen :P
And posted a message. Thank you so much!
I'd suggest posting one as well, just to be sure, cause chat and mods can be weird. But no problem :)
19:45
I will. Thanks!
20:21
0
A: "Hello, World!"

Jacobhyperscript, 27 24 bytes init log 'Hello, World!' <script src="https://unpkg.com/[email protected]"></script> <script type="text/hyperscript"> init log 'Hello, World!' </script> Calls the log command when the document is initialized.

 
3 hours later…
23:17
0
A: Sandbox for Proposed Challenges

Samuel MuldoonWhat is the shortest python code which implements a string-to-float function? Goal Write the shortest variadic to_float, str2float, or standardizing function you can write subject to the constraint that the code is written in python. Rules and Examples The variadic str2float shall be some calla...


« first day (4465 days earlier)      last day (676 days later) »