« first day (2854 days earlier)      last day (2286 days later) » 

00:00
The coin with the Queen's head plus the coin with running legs combine into a pretty great picture
Maybe that's the 25p one and a few of them are slightly less than they say (we know they do partial p) so rounding gives the visible values, while summing the rounded values gives 102.
@Veskah Hidden message?
@Adám Deepest Lore
0
Q: Densely packed decimal (DPD) to decimal

BubblerBackground Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three decimal digits (000 to 999) in 10 bits, which is much more efficient than naive BCD (which stores one digit in 4 bits). Notations The lowercase alphabets a to i are the bits that ar...

 
1 hour later…
01:21
@Adám only 3 months? huh, my bank will only show 3 months on a page, but you can choose those three months from a range of several years
@flawr nice, I've got several sets of coins, I've always wondered whether there's a diagram I can print out and then stick them to for posterity
01:56
@flawr they're fine they're just normally like that :p
02:49
I'm crap at JS, codegolf.stackexchange.com/a/176372/78849 Is this answer actually able to produce all patterns? I've ran it several times and only got permutations of !!!..
Which is what it seems to do
03:10
@Veskah That's exactly what the [...'!.!.!'].sort part is written to do. You'll need to generate 5 random characters instead, e.g. [...Array(5)].map(x=>'!.'[Math.random()*2|0])
other than that, the answer looks very good :-)
@ETHproductions Alright, glad I'm not losing my mind
Actually [0,1,2,3,4] would be shorter than [...Array(5)]. I'm just so used to the trick that I forgot you could do anything else, haha
[...Array(5)].map(x=>'!.'[Math.random()*2|0])
[0,1,2,3,4].map(x=>'!.'[Math.random()*2|0])
[...s='!.!.!'].map(x=>s[Math.random()*2|0])
03:38
do you prefer global sin(x) or a math object? Math.sin(x)
@Downgoat I'm so used to golfing languages that I expect way too many things to be global
04:27
@Downgoat The latter
Sin/cos can be in a module but sqrt must be global
i think python having sqrt in a module but abs be global is one of the most annoying things about it
@quartata Pretty much all nice math in Powershell is behind .net's [math]
@quartata what about log functions then?
That can go in math too
I mean technically you can always do x ** .5
should Int ** Double be a thing?
on one hand lets you do what I said above but then again kinda weird
04:48
Feels like it should promote the int to double
However, allowing Int ** Double while keeping it as int might be neat in a handful of applications. Otherwise, seems like it'd be a gotcha waiting for the unaware
The result of ** is complex in worst cases, be the base int or double
05:46
0
Q: Flipkart coding question hackerrank

manas sahooYou are working in Samara, Russia for a few days. Each day has a new pay per unit of work and a new cost per unit of food. Working 1 unit costs 1 unit of energy, and eating 1 unit of food adds 1 unit of energy. Here are some specifications of your employment: You arrive with no money, but with e...

06:37
People keep talking about this "nandgame", but I assume it would be boring to just make circuits for a desired function because NAND isn't esoteric enough.
Is there anything more to it?
i figured it was someone trying to trick me into doing their digital logic design HW And closed the tab immediately and disinfected my computer with a blowtorch
Yeah see, that's why I'm asking before opening it.
they cant stump me. i am Protected from help vampires in all walks of life
What about nerd snipes?
no but i have someone on retainer to snipe back upon the event of my demise
For real though didnt we all do NAND gate to an ALU at least. i was only slightly joking when i said this was homework
if theyre really just logging all the answers for their homework I Admire their Creativity
this is how frontend people solve hardware problems
06:46
@feersum At least it requires more thinking than clicking out paper clips or feeding ants.
'Tis so much more noble to solve a problem with 10 hours of coding, than 10 minutes of pencil and paper.
2-3 of the levels I completed, I didn't get it in the smallest number of components. I'm still a bit irritated
and 10 hours of mood board construction
@DLosc wait theres golf
ok now its good. its good again
However, if you try it with fewest NAND gates ...
... which it doesn't track
no point though
and & or are still straight up CMOS
nand is just cool to have one primitive in theory
06:53
I think after like 3 years I have finally got dynamic memory in VSL to work :DDDD:
define i32 @main(i32, i8**) {
entry:
  %2 = call i8* @FSTCPointerNallocAcountTCUInt64.generic.TCUInt8(i64 1)
  %3 = alloca i8*
  store i8* %2, i8** %3
  %4 = load i8*, i8** %3
  call void @free(i8* %4)
  ret i32 0
}
now with generics you can do a Pointer<T>.alloc(count: UInt64) and it'll generate a malloc() & free() call where it expects
what's cool though is unless an object has a possibility of being assigned somewhere we can generally predict where to place deallocation calls
What other kind of memory did you have?
this is glibc malloc ?
@feersum stack allocations
technically dynamic memory kinda sorta existed but no direct pointer-access
and also it wasn't actually managed so it wouldn't be cleaned until program exists
@quartata yeah
Or whatever C runtime you're using.
i love having the os reclaim all my memory. true userspace power move
@Downgoat are you going to try to make your own allocator
06:58
@quartata in that case you can just disable the memory optimizer pass and have no free calls but also no slow ref counts :P
@quartata i dont think my allocator could be better than what the smart people who make glibc can make
actually youd be surprised
the problem is threads
The glibc malloc creates per-thread arenas, so supposedly it shouldn't be locking on every call...
ngn
ngn
@Downgoat glibc's is crap. creating your own is easier than you think
@feersum that got duct-taped on
real ancient malloc hours
what syscall do I do to ask OS for memory?
ngn
ngn
07:02
@Downgoat mmap
or brk
or is it sbrk, I don't remember
sbrk is relative
brk is absolute
It does become unportable if you do this stuff
rust uses jemalloc now yeah?
ngn
ngn
"sbrk() is implemented as a library function that uses the brk() system call" --man
@feersum who cares about windows :)
07:08
@ngn do you have link to any numbers?
ngn
ngn
i heard once that windows can run linux elfs. i don't know if it's (still) true
@Downgoat no, but i can feel it :)
Like WSL or something else?
ngn
ngn
in my language i got rid of libc altogether
i mmap a lot of memory in the beginning and manage it as a buddy system
it's very simple and efficient
@feersum ah, so that's what it's called...
I still have never tried WSL.
@feersum If you've used Linux ever you really won't be surprised by anything. The terminal is kinda crappy and the fact that your Windows home isn't the same as your WSL $HOME aren't the same is annoying.
07:19
Hmm personally I think it would be more annoying if WSL home was the same.
If you use not-WSL it's annoying when ~ refers to different things
Oh, mixing WSL and other unixy shells?
is it just me or does LLVM not have bitwise not O_o
Seems not very important since you can -x -1
@Downgoat you mean logical? it has bitwise
@feersum assumes twos complement
07:33
@quartata looks like doesn't natively have bitwise but the IRBuilder/BinaryExpression class expose helper function to create
@quartata Which LLVM does.
@Downgoat google says BinaryOperator::CreateNeg(nbits, "bitwiseNEG", insertBefore);
(is this not how youd normally make it, I never used LLVM frontend)
@quartata O_o your compilers directly write IR?
In my LLVM-based language I just generated textual IR with Python string format operations.
> Is binary operator so must have 3 args — source
this is why it took me a day to unbreak operators :P
07:45
0
A: Sandbox for Proposed Challenges

BubblerDensely packed decimal (DPD) to decimal, with logic gates atomic-code-golf logic-gates Background Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three decimal digits (000 to 999) in 10 bits, which is much more efficient than naive BCD (which store...

^ inspired by nandgame
08:07
for types that haven't overloaded == should the default behavior be to check addresses or just error. I'm thinking of adding a === anyway to check address equality
08:28
@ThomasWard so it is just the photo? you know that photoshop and various other image editing softwares have red eye removal tools? :D
 
1 hour later…
09:30
oh cool, anagol has a one less byte for modular multiplicative inverse spoiler
-1
Q: Increment a number without using ++ or +

mukesh_lokareMy Question is to Increment a number without using ++ and + operators. Input : 5 Output : 6 Same logic should execute with character data type as well, Input : a Output : b

oh wait, that's because they don't have to check for invalid ones hmm
 
3 hours later…
12:44
@flawr are you sure Thomas doesn't want to embrace just how he actually is? :P
@Downgoat better put functions that aren't going to be used outside of certain contexts in built-in libraries for those contexts
 
1 hour later…
14:05
0
A: Sandbox for Proposed Challenges

David LuiExploring generalzations of Cheryl's birthday problem In this challenge we will generalize the Cheryl's birthday problem to arbitrary finite subsets of pairs of integers Challenge Cheryl gives Albert and Bernard a finite collection of pairs of integers S. Cheryl chooses an element (x, y) from ...

 
1 hour later…
15:31
I'm trying to find out what can be done ini 38% off Javascript.
So far I found a way to assign/retrieve variable: spoiler
but it takes 5 bytes, unfortuantey.
Happy thanksgiving to all the people in the U.S.A.
15:48
Yeah happy turkey day guys
ngn
ngn
happy no-fuсk-giving to the rest of the world :)
Anyone have any idea to modify any global variable (in 38% off JS)?
I tried calling functions that modifies this like let y;new Set().add.bind(y)() but the types are not compatible.
Why do both new Object() and Object() works?
16:04
@user202729 because js. Also new Object
0
A: Sandbox for Proposed Challenges

l4m2Output The End Poem. Outputting as array, or with only one \n or three \n to separate sentences, etc. are fine. Upvote to prefer: You can take an input containing all letters in lowercase or uppercase Downvote to prefer: You can take an input containing all letters. You can decide each letter b...

ngn
ngn
@dzaima and {}
@ngn but } is not allowed in the challenge
Ok, got it.
Basically there are some functions that modifies this
and I am thinking that let y; somefunction.bind(y)() may help modifies y.
16:26
However, the only possible values that can be assigned is undefined or NaN, which are both immutable.
tsh
tsh
16:40
If you don't mind to switch Spidermonkey to browser environment (e.g. Firefox) Use parent.b would make the variable name shorter.
And print should be switched to alert if so.
@user202729 So, maybe parent.__defineGetter__('b',''.replace.bind(8>>98));alert(b) in browser?
16:59
Instead of replace, repeat may be more useful.
17:24
@flawr ultimately doesn't matter lol. (I was just being lazy lol)
 
2 hours later…
19:06
I think Sum-It might be mostly done
just need to implement all the important operations
 
3 hours later…
21:44
@Skidsdev Finished work?
22:02
Composed an answer to this question Arbitrary Randomness using JavaScript which is currently 658 bytes. Does that qualify as "non-competing"? Should the answer be posted?
@guest271314 It's the first JavaScript answer, technically it's winning that language
@Veskah Ok. Could more than likely be golfed considerably more. Was concerned with meeting the requirement.
@guest271314 There's no "non-competing" thing anymore. All that matters is that the solution you're posting at least has had an attempt of golfing
hey, don't waste your efforts under "non-competing"!
Non-competing is usually only used for joke answers, retired KoTH entries, or answers that no longer/never meet the spec with no intention to fix
22:08
@EriktheOutgolfer Viewed that terminology at several answers, did not immediately know what it meant (means); read codegolf.meta.stackexchange.com/questions/9761/… and codegolf.meta.stackexchange.com/questions/14988/… before asking here
yeah, that's not a thing anymore
those are probably old answers that haven't been edited yet, we're editing them as we come across them
also, you were never supposed to mark your answer as "non-competing" just for being "too long"
Isn't "Hello World!" in that file-length is source code language like 10 yottabytes?
I don't think I've seen a Hexagony answer in awhile now that I think of it
@guest271314 Also, just for completeness, codegolf.stackexchange.com/a/82454/78849 started at 907 bytes and was golfed to 137
2
22:32
0
Q: Sorting answers

davidSome popular challenges have many many answers and often a language is used more than once, so : Is there a way to sort answers so that they appear in the order according to the name of a language OR just answers written in a specific language ?

22:49
:D okay strings are now a thing in VSL!!!
Anonymous
@Downgoat Wow such a big feature, you're really setting the standard for all other languages :P
well at least they now can be dynamically created :P
btw curious if anyone has studied the performance differences between unrolled linked lists and dynamic arrays
trying to think of the best way to implement arrays for VSL
Anonymous
In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored such that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called one-dimensional array. For example, an array of 10 32-bit integer variables, with indices 0 through 9, may be stored as 10 words at memory addresses 2000, 2004, 2008, ... 2036, so that the element with index i has...
Anonymous
Dynamic array is probably the best choice because indexing is usually the most-used feature, followed by inserts/deletes at end, then other inserts/deletes
but in real-world scenarios, what has a greater performance impact? Infrequent reallocations or frequently branching/deallocations?
@Mego hm ok
Anonymous
22:58
Just think about the code you've written with arrays. A majority of array stuff you've done is probably var x = arr[i] (indexing). arr.push(x) (insert at end) is also pretty common, but less so.
@Downgoat IMO the best thing would be if both were accessible to the user as options, but that might not be the nicest option syntactically
Anonymous
Oh wow I can't type backticks >_<
F# has [linked, list] and [|regular, array|]
@quartata can LLVM not do optimizations with the llvm.memcpy.p0i8.p0i8.i64 intrinsic? I have a really simple string concat example but LLVM doesn't want to optimize it even though it knows the constant strings: gist.github.com/vihanb/fb4ed34a89d37abe4ac837053023dbdf
Anonymous
@dzaima That's basically how Java does it. ArrayList is a dynamic array, LinkedList is a linked list (duh), and Vector is a threadsafe dynamic array.
@Mego those can't be accessed with bracket notation though
Anonymous
And then you have your POD arrays, which are fixed-size arrays.
Anonymous
@dzaima No, but they all support the same interface method of List.get(i). If Java had operator overloading, bracket notation could similarly be used.
@Mego but java doesn't. :/
Anonymous
No, but that's a design decision that is irrelevant to my point - Java provides multiple List implementations that all implement the same interface, so they can more-or-less be used interchangeably.
23:04
also, half-relatedly, I tried to make a java-like language that transpiles to C a bit ago because I wanted more syntax for java (e.g. ^^). Made classes half-work, realized I can't continue literally anything off of that, and now it's in my long list of unfinished projects..
Anonymous
C++ does a similar thing: you have POD arrays, std::array (which is a OOP implementation of a POD array), std::vector (a dynamic array), std::forward_list (a linked list), std::list (a doubly-linked list), and std::deque (double-ended queue). All fulfill the SequenceContainer requirements.
@Downgoat you expect it to be replaced with the constants concatenated together?
im not sure what youre expecting
@quartata yes
youre copying it into a buffer you allocated dynamically
so its going to be a memcpy regardless
of the two keeping the constants separate is certainly the least surprising
yeah but 1 memcopy > 2 memcpy :D
23:09
You could at least inline it.
I threw together a Python 3 solution for code-golf.io's divisors problem, 63 bytes. But a whole bunch of people got 57 bytes. I don't see what else I can trim. Using exec for the outer loop is still 63 (because exec requires parentheses in Python 3). What am I missing?
@feersum the memcpy? llvm will
probably
Oh, is this the unoptimized version?
i mean this is an llvm intrinsic thats getting called so llvm is probably not even going to emit a call to memcpy
if its just looking at the one string thats two moves
So what's the actuall assembly @Downgoat is getting out of it?
23:16
he should find out
before deciding what to do
it might do memcpy if youre doing -Oz i guess
but
yeah see
youre not going to get that any better
2 moves for each string
your concern might be more valid for longer strings but at that point i would worry about the call overhead a little less
really though joining together long constants that are only used once like that is probably something that should be done in the compiler
hm ok
in your example though you do see that it doesnt make a difference right
btw for prepending to an array. Is the best way just do malloc(newCapacity) and then memcpy() the existing array contents
23:22
prepending to an array and the array is out of capacity?
@quartata oh, so memmove it
@Downgoat memmove uses an intermediate buffer
shift the elements over starting from the end
@quartata What, no it doesnt
@Bubbler Oh, shoot. Thanks.
I still program too efficiently to be a good code-golfer. :P
23:30
hmm I have just realized that safely allocating memory needs branch instruction to check if malloc fails :| is it bad idea to just not check this and wait for segfault
Oh well, time to roll your own allocator then??
Is this language supposed to have garbage collection?
23:46
@feersum we do some compile-time analysis and reference counting where applicable
That's not an answer..
23:57
Don't need to garbage collect if you don't make garbage :^)

« first day (2854 days earlier)      last day (2286 days later) »