« first day (4455 days earlier)      last day (685 days later) » 

00:32
Cli / sockets is quite a pain to set up, and java is the worst possible option.
00:54
intuitively cli would make sense but i don't want to deal with installing a ton of languages
i am definitely not doing it in java
The main advantage of JS / stack snippets is that anyone can run it
^ ... and can run it without having to install anything, and it's (relatively!) easy to do graphical output, which makes it very fun to watch the entries even if you didn't submit one.
@Simd Depends--what kind of Greek? (Ancient? Modern?)
01:24
@emanresuA java's actually a pretty good option provided you let other jvm languages in :P
(which is usually why)
01:42
I feel like Python and JS are somewhat more commonly used than JVM languages here on CGCC
yeah they're by far more common
that's just why there are like two or three in java :P
@Jacob also we've entertained elm as a default; don't think it's caught on yet but you can blaze the trail :P
 
4 hours later…
06:14
How to get better at code golf?
But I'm bad at code golf :(
Get better at coding and get better at golfing (the physical sport). I'm sure you'll get better at code golf that way :P
/srs Probably practice?
CMA: Introducing everything.rs, a Rust port to rule all ports. You know how there's all these repositories popping up that are "X Unix tool, but in Rust"? Well, this will make all of them obsolete. I, user, have managed to port every single Unix tool ever made (and even tools that haven't yet been made) to Rust
8
(let me know if this has been done before, I'll delete the repo if it isn't anything new and funny)
06:37
What does CMA stand for?
Chat Mini Announcement
@user CMC This is 290 bytes, do it in less
C makes it a little easier, right?
Or maybe not, since execvp? needs a NULL at the end of the arguments
You'd still need to replicate the error checking
06:53
@mousetail Zsh, 6 bytes: env --
you could argue that the 0 byte answer is valid here
@mousetail Ah, I was assuming you meant just something to run whatever you're passed in, not something with that exact behavior
I don't care about the exact error messages but it should print something in case of error or no arguments to have the same vibe, think that would make it more interesting
Ah, that would disallow 0 byte answers then
 
1 hour later…
08:11
@user It's hard to get enough practice when you're not good enough, because the better you get at it, the more you like it. And getting good at it requires practice, so we're back to the start :(
09:03
@TwilightSparkle How is it harder to practice when you are bad? If anything it's easier since there is more to golf from your initial solution
10:27
@DLosc enough to understand ibb.co/r40cg8M
Line 4
11:00
@user Finally, I can have Rust, in Rust, in RUST
@user me on my way to pour Coca-Cola on your program (it dissolves rust apparently)
Rust programs may be memory safe and thread safe, but they sure aren't acid safe :p
Yea, only SQL is ACID compliant
11:40
@mousetail The better you're at it, the more you like it. If you can't golf down the bytes from your solution, it's not fun and soon you will stop doing it.
0
A: Sandbox for Proposed Challenges

HippopotomonstrosesquipedalianHow boring is it? The boringness index of a function is the number of times you have to differentiate that function to reach 0, or \$\infty\$ if it will never reach 0. The lower the index, the more boring a function is! Your task is to write the shortest code that can evaluate the boringness in...

@TwilightSparkle You shouldn't golf bytes from other's solutions. Just try the challenge yourself from scratch, ignore any existing solutions. Doesn't matter if yours is 4x as long, it's still a fun challenge
Only when you have golfed the most you can should you look at other solutions for tips to improve
@TwilightSparkle Also why do you even want to golf if you don't find it fun?
There is no benefit
12:03
@mousetail I knew someone will ask this...
My life was meaningful and I had better things to do, but in one day (several days actually) they disappeared from my life.
And you think getting good at golfing will give you purpose again?
idk
Probably it won't.
Yea that seems like a long shot, especially if you don't enjoy it
most likely, actually.
Golfing is really fun, but you need to start slow. It's OK if your best answer is very long. You don't start running for the first time by racing Usian Bolt
12:32
hi, I've got a programming issue that I'd like some help with
I'm working on a program that turns an image into a hexagonal tessellation, but its output has strange gaps between the hexagons:
code available upon request
How are you deciding the position to draw each hexagon?
well, that's the thing; the lib I'm using (Java's Graphics2D) doesn't have a built-in function for drawing hexagons, so I'm calculating the vertices myself
I'm doing it using this pile of spaghetti here:
Hiya, hope I'm not interrupting anything. I have this small doubt about Search Engine Optimization and keywords. Anyone knows where I can ask the question?
fillPolygon(
                                        Polygon().also { polygon ->
                                            (0..Tesselator.SIDES - 1)
                                                    .map { i ->
                                                        arrayOf(
                                                                        (x *
                                                                                Tesselator.RADIUS *
                                                                                2) +
Hexagons look regular enough, I think they are just placed in the wrong spots
12:37
@EroSɘnnin well, definitely not here :p
this is the Code Golf Stack Exchange main chatroom
but lemme see if I can figure out where you should ask it
Yeah I know, thought I'll ask the most active chatroom and see if I get any leads
I don't think they are on topic anywhere on SE
hmm
Thanks tho :)
SEO questions are basically always terrible
12:37
I keep forgetting that we're the most active room :b
i know right
even google cant answer these
what's the question? we might be able to help
or im just bad at googling
and if not you could stay awhile, we love us some new users
So its not really code related. Its about the keyword density
12:38
Only if you do golfing though
everyone has the potential to golf within them
Sorry, I don't. But it's nice to always learn new things lol
Keyword density is bullshit, there is no evidence it actually matters except in very extreme cases
^ agreed
I feel the same
12:39
SEO as a whole generally doesn't work
^ +1000
what're you trying to use it for?
@mousetail lemme put the drawing code in a Gist rq
SEO is like alternative medicine. Nobody known anything and the techniques are just random myths
Here is the situation:
Coworker is a content writer working together with the SEO dept. They have to write blogs that are 400+ words long. Lets say the topic is "Digital Accessibility". The SEO guy says that you can't use that word more than 5 times. Get it? Not more than 5 times.. in a blog about... "Digital Accessibility". So I wanted to call bs on that but i lack the knowledge and evidence.
12:42
I think it's bullshit but I'm not a expert
I wouldn't trust SEO experts either though
that sounds more like an interpersonal problem, and if you want people advice you have definitely come to the wrong place q:
Yea, we all hate eachother here
Lol, yes I know this is not the place to ask. I was asking if you guys knew where i can present this question
if I were you I'd maybe put something on Workplace.SE asking how you can nicely tell the SEO guy to shut up
12:43
Heyy i hate myself
does that count?
er, no
That's cheating, requires 0 bytes
>:c
@Ginger noted
@RydwolfPrograms do you have any advice for this poor soul
(you may have to wait for a while, Rydwolf doesn't get on for a few hours usually)
anyway: @mousetail do you see any issues with the drawing code?
I'm having trouble understanding what's going on
12:45
functional programming go brrr
You really need to watch this: youtube.com/watch?v=CFRhGnuXG-4
most of the code is a bunch of math I copied from stackoverflow.com/questions/3436453/… to figure out the vertices
pretty much everything inside fillPolygon() is what calculates the points
It seems ok, how are you deciding where to place the hexagons?
lines 20-24 and line 36
those calculate and add an offset to the point x and y values
for x the calculation is (x * radius * 2) + (radius * (y % 2))
and for y it's y * radius * sqrt(2)
That's not correct though for a regular hexagon
12:48
if you zoom in to the hexagons, they seem to be squished weirdly
@Ginger is the indenting intentional?
@lyxal it's part of a larger file, the indenting is an an artifact of that
thank goodness
bruh why is my indent size set to 8
some of the code ever
12:50
You really should seperate out this into multiple functions
yeah, probably
0
A: "Hello, World!"

HippopotomonstrosesquipedalianHippopotomonstrosesquipedalian 2, 9465000 Bytes The bytecount is only approximate, and the code is so long that it would hang my browser for a long time if I pasted it, so here is the link.

2
@Hello,World! ...what is this
Hippopotomonstrosesquipedalian 2
obviously
@user fun fact: the official Rust book endorses a grep replacement made in Rust
12:52
Does it use rust's limited regex engine?
I have no clue
anyway, the hexagons in the generated output seem to be squished along the x axis
I have updated the gist to only have the code that calculates the vertices
hopefully it's easier to understand now
Shouldn't the Y position be 1.5 * radius * Y and not sqrt(2) * radius * Y?
maybe? using sqrt(2) makes them slot together perfectly tho
lemme try it
yeah now it looks like this:
which is pretty, but still not correct
My logic, not sure if it's correct
I have no clue lol
using sqrt(2) just made it work correctly
I don't know how or why
I'm wondering if the issue might be the addition of (Math.PI / SIDES) to the result, which I did to rotate each hexagon so their points would be facing up
@mousetail I don't think it is, because the hexagons are slotted together so there's not one full hexagon-height between them
13:02
There is exactly one side length bewteen them
the extra space between the bottom vertex of the vertical sides and the bottom vertex of the hexagon itself is what sqrt(2) accounts for, I think
@Ginger What if you delete that then switch sin and cos to get the same rotation?
hmm
@mousetail it looks identical
wait
when I removed the sqrt(2) thing, it introduced more gaps
The vertical distance should defiantly be 1.5 based on my testing
but it also shrunk the problematic other gaps
so I think 1.5 is correct and there's a different issue somewhere
13:11
I think the horizontal distance should not be x * radius * 2 but x * radius * sqrt(1.25) * 2
@lyxal Yes, i know, 9.5 million bytes just to print "Hello, World!"
Basically like unary
@mousetail nope
brb
Wait nope
It's sqrt(0.75)
Ima see if I can embed the code
oh well... i cant
13:16
I don't think you can embed anything in chat, the markdown is very limited
It only works for single line messages
13:27
@mousetail r will be 1/(2*tan(30°)) as shown here: wikihow.com/…
@PlaceReporter99 That's the same thing
sqrt(0.75) = sqrt(3) / 2 = 1/(2*tan(30))
so ur saying sqrt(12)*tan(30)=sqrt(0.75) so tan(30)=sqrt(3/48)
@mousetail
No, where did you get 12 and 48 from?
tan(30) = 1/sqrt(3)
1/sqrt(3) = sqrt(3)/3
0
Q: Gödel encoding - Part I

lesobrodRelated but different. Taken from the book: Marvin Minsky 1967 – Computation: Finite and Infinite Machines, chapter 14. Background As the Gödel proved, it is possible to encode with a unique positive integer not just any string but any list structure, with any level of nesting. Procedure of enco...

13:56
back
44 mins ago, by mousetail
It's sqrt(0.75)
so 2 * sqrt(0.75)
aight
@mousetail doesn't look right to me :p
That's perfect
Just the half-row spacing is still off
oh wait yeah
but both the horizontal and vertical spacing are perfect now
14:01
great!
thanks
why does that work tho?
See the image I posted
okay, fixed spacing
looks great!
@mousetail that's kinda hard to read, what does it say?
hypotenuse is 1, side length is 0.5, so by pytageron theorem it's sqrt(1-(0.5 * 0.5))
14:04
ohhh
if I change the number of sides does that still work?
I'm not intending to, just curious
No, your only other options are squares and triangles, and you can use similar techniques but the spacing is a bit different
right
14:23
okay, it's mostly done!
final version:
haha I know what you look like now
@mousetail well, unless I look like this:
@EroSɘnnin What counts as a "word"?
I'm afraid you don't really
Surely they're not including "the" and stuff
@Ginger ooh whatcha doin
14:27
I can see you in the reflection
@RydwolfPrograms writing a program that converts an image into a hexagonal tessellation
for that image it generated this:
In the bottom right you can see a faint outline of a cat with a very concerned expression
4 mins ago, by Ginger
user image
@mousetail <srs>I'm not in that image; it's a test photo I got from here</srs>
okay, now time to slap a GUI on it!
The light bounces around the earth via the atmosphere
I don't think that's how that works
14:30
I can see myself too
@Ginger Only because I'm wearing a aluminium foil hat that protects me
@Ginger How does the color averaging work?
Is it just averaging the RGB?
14:50
0
Q: The Dating Game / Secratary Problem

mousetailThe bots are looking for love. Can you help them? The rules The goal of this game is find the bot you have the highest comparability with. However, robots, who are inexperienced at dating are unable to tell how well a date went. In the game, bots take turns "speed dating" some other bot. After ea...

15:31
@Simd That's definitely Modern Greek, which I'm not as familiar with, but let me look the word up on Wiktionary...
@Fatalize ahhhh lmao
of course it would try to make it a list by default
But that doesn't quite match with "Galerie d'art" in French, so maybe it's also the word for an art gallery.
looking up the finnish "lehteri" that also means balcony lmao
or specifically, the definition i found is "balcony, gallery"
in the sense of an architectural feature
so i think the translation just messed that up :P
also come to think of it what's with that circle and pair of brackets with the cuneiform
and is that second sign a rotated 𒀭 or...
15:47
@UnrelatedString Yeah, I'm leaning toward mistranslation of "gallery" too
Looks like maybe it should've been πινακοθήκη in Greek
16:07
@RydwolfPrograms I downscale the input image so that there's a 1:1 mapping between hexagons and pixels d:
16:37
Pixagons
16:52
@Simd Галерия in Russian is "gallery"
@DLosc so youd be right
People still pay attention to those?
Also I'm pretty sure that's been a thing for ages right?
Huh, apparently not
yeah i feel like it's something that everyone already either assumes is allowed or asks about case by case and always gets told yes for
I mean I feel like it's the same as all I/O defaults. Either it makes perfect sense and nobody bothers to challenge it, or it's just abusing loose I/O rules to cut out steps
@UnrelatedString at least we can cut out the second case now
@RydwolfPrograms well it was something I posted
17:42
is this challenge decent? I'm afraid there might be a duplicate lurking somewhere codegolf.meta.stackexchange.com/a/25705
18:12
Why does this error?
c=[];exec("exec('import math\\ndef f(): print(math.sin(30))\\nc[:]=[f]')", {"c":c}, {}) ; c[0]()
Or this:
exec("def q():exec('import math\\ndef f(): print(math.sin(30))\\nc[:]=[f]')\nq()", {"c":c})
Aaæâàáäāãå bsod
ಠ_ಠ
18:28
to nfts, no less
which is like the worst thing to crash
esp since it happened while my backup drive was connected
seems to be fine tho
@mousetail MRE
assignment in a nested exec seems to assign to a local variable instead of a global
it's the same in a single level
Seems to be related to assigning to locals
only if you pass a globals dict though
Yea
According to the docs: If exec gets two separate objects as globals and locals, the code will be executed as if it were embedded in a class definition.
This seems to be what is happening because class definitions are fucked in python but it happens even if I pass just one of globals or locals
@UnrelatedString Not always. :P (If I had a do-over, I'd have given that challenge looser I/O restrictions.)
@mousetail If you only pass one, the other defaults to that of the outer scope, so they are still two separate objects
@pxeger No, " If only globals is provided, it must be a dictionary (and not a subclass of dictionary), which will be used for both the global and the local variables"
So they will be the same object
Class rules are only used if they are distinct
At least, that's my interpretation
@mousetail Ah you were wrong here, it doesn't happen if you only pass globals
This fails though: c=[];exec("def q():exec('import math\\n\\nprint(math)\\ndef f(): print(math.sin(30))\\nc[:]=[f]')\nq()", {"c":c});c[0]()
I'm only passing globals
yet it seems like it's using class-style scoping
that's because def q():...\nq() uses class-style scoping inside q
because "class-style scoping" means
class X: ...
is basically equivalent to
def ___secret_magic_function(): ...
__build_class__(___secret_magic_function, "X")
18:43
Why is it using class scoping though when I only pass globals?
The entire reason to wrap it in a function was to force function style scoping
function style scoping == class style scoping (other than oddities with closures, which are irrelevant here because there are no closures)
I'm literally trying to build a closure that has access to the variable "math" in it's context
ah, that's the difference between function and class style scoping: the innermost exec is still using class style scoping, so math is not closed over
Ok but how do I exec something and force function-style scoping so any functions defined can properly access any global variables defined in the same block?
after those functions "leave" the exec context
ok I think this is actually a bug in Python
x is a local variable, so f should close over x, not use it as a global variable
actually no I think that's expected behaviour: you can't close over variables in "class-style scoping"
18:52
yea but it shouldn't be "class-style" scoping since I'm not passing both locals and globals
In order for this to work, you need two things:
- `math` has to be defined inside a function, so it can be closed over
- `math` has to be referenced in the same level of `exec` as where it's defined
@mousetail But by wrapping it in def q() and then using exec('...') (no dicts), you force it to use class-style scoping, because when q is called it has its own brand-new locals() which is passed implicitly into the innermost exec, (with the implicit globals still being {"c":c}), so exec still ends up with two different objects
this proposed patch to the docs is more technically correct, although arguably a bit less helpful
19:09
Ok so just passing locals() explicitly to the inner functions should fix it?
 
2 hours later…
21:00
CMP: TIL some people pronounce Scala as “Scahla”. I always pronounced it “Scayla”. Since Scala comes from “scalable” that’d make more sense. How do y’all pronounce it?
@DLosc it must also mean gallery, as in art gallery
interesting. I can see a few sensible ways of pronouncing it, scah-la (open a), scoh-la, scay-la, and scale-a (last two are maybe the same? idk they feel different to me)
@Sʨɠɠan cool! As In art gallery?
I pronounce it as scale-a which is how I pronounce the first bit of scalable
21:05
@hyper-neutrino yeah the last 2 are the same to me
5 hours ago, by DLosc
@UnrelatedString Yeah, I'm leaning toward mistranslation of "gallery" too
What's the source of the sign?
TIL V8 has a JIT called “FTL”
21:46
I wonder if it would be possible to create a low level machine code that could be quickly proven (Rust-style) not to have memory issues
Like, where the syntax of the machine code itself prevented dangling pointers and stuff, or where it could at least be validated quickly and in O(n)
22:24
@RydwolfPrograms With a sufficiently complicated Processor, definitely.
@RydwolfPrograms well if rust did it, then obviously an IR (llvm style) could do it. idk about machine code tho
If the machine code contained some sort of borrow/reference counting annotations, I wonder how difficult it would be to do a quick borrow check ahead of time
I guess it would partly depend on what control flow the machine code had, gotos to arbitrary places might make things complex
Pointers are inherently unsafe, you'd need to do away with them completely.
I mean, in a sense. But as long as it could be verified that pointers and integers were kept separate in the machine code, they could be treated like different data types, and arithmetic on pointers could be prevented
And arithmetic on pointers would be the unsafe thing, since pointers that are left unchanged would be subject to the borrow checking
(and in fact, limited pointer arithmetic for things like structs and arrays would still be fine, though that'd probably be too complex to be implemented in the processor)
If you only need it to be varifyably safe, that should be easier than "Always" safe.
22:53
Very helpful lol
(I forget how good SE is at Q&A, until I google something and the only thing that comes up is shudders Quora)
23:38
@Sʨɠɠan I used to pronounce it Scayla, like you, but one of my CS teachers (who had a Scala job), pronounced it Scahla, so now I pronounce it like that
@hyper-neutrino I think it's like a glottal stop or something that prevents the ay and l from smoothly connecting
@hyper-neutrino To clarify for the first two, are those vowels "a" as in "cat" and "a" as in "father"/"o" as in "hot", or "a" as in "father" and "o" as in "cold"?
@hyper-neutrino I don't get how anyone would say the second for "scala"
The three ways I could see are "skall-uh", "skay-luh" or "skah-luh"
I think the second is meant to be "scah" as in "scald", since to me the omission of "a" as in "cat" seems weird
And saying "scala" like an abbreviated version of "it's cola" wouldn't make much sense

« first day (4455 days earlier)      last day (685 days later) »