« first day (3078 days earlier)      last day (1751 days later) » 

9:10 AM
0
Q: Multi-user CRUD: Valid, Problem, or Error?

Kevin CruijssenIntroduction: Ever used Dropbox with some other people and you both modified the same file? Ever had a multi-user application with a relational database, and two people were modifying (or worse, one was deleting and the other modifying) the same object? Well, let's simulate that with this challe...

 
0
A: Sandbox for Proposed Challenges

Kevin CruijssenArk of Noah Integer Lists code-golfintegernumber Introduction: I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. Here a rather simple challenge based on that: Cha...

 
10:06 AM
 
@Adám Should be done now :)
 
@trichoplax Thanks!
 
10:30 AM
-1
Q: Count Fish Fry from Color Image

Riccardo MelisI want to create a object detection algorithm able to recognize and counting mutiple objects (in my specific case fish fry) from images collected from fry hathery (see representative attached image) I actually try it by using both HSV-space color detection as well as morphological operators illu...

0
Q: CCG Army Clash Simulator

Dmitri NesterukTwo armies are about to clash on a battlefield. Each army is composed of one or more creatures. Each creature is defined by a number pair P/H, where P is the creature's power (the damage it deals), and H is the creature's health. Each army is led by a hero. A hero (typically) cannot attack, but ...

 
 
1 hour later…
11:42 AM
@NewSandboxedPosts My own take: Given an integer N, generate a sublist of distinct integers [1..N] or [0..N) as preferred with the highest possible sum, but only using each digit exactly 0 or 2 times. e.g. for N=101 you could have 1, 22, 33, 44, 55, 66, 77, 88, 99, 100.
 
 
2 hours later…
1:52 PM
0
A: Sandbox for Proposed Challenges

User ACan the cursor reach the bottom? A cursor position is valid if either of its two sides touches whitespace (i.e. a space or a newline(CR+LF or LF, depending on your OS)). The input will always consist of valid cursor positions. This takes one input(a character matrix), and for a cursor on the up...

 
2:50 PM
0
Q: Print the previous answer in reverse - with a catch

Geza KerecsenyiYour challenge is very simple: output the previous answer, in reverse. However, as with this similarly-titled question, there's a catch: in this case, you can only use characters from the answer before the last. For example: Let's say the first answer looks like this: 1 - Python print(...

 
3:12 PM
0
A: Sandbox for Proposed Challenges

JitseAtomic Handshakes code-golfnetworkconnectionintegerarray Introduction Here you are. At a party, with two drinks in your hands. Your friend just went to the bathroom and you don't really know anyone else here. And so you wait. Or do you? There is a century old hypothesis known as Six Degrees o...

0
A: Sandbox for Proposed Challenges

Stefan MeskenThe first instance of Machine Learning Golf received a lot of intention but also revealed some problems (mostly caused by people in this community being too clever ;-)). I intend to address those issues in this second installment: Fashion MNIST is a dataset of 60,000 labelled 28x28 pixel graysc...

 
3:30 PM
0
Q: How to execute random assignment (count of assignments could be different)?

Ivan GerasimenkoThe task is to assign a random field of JSONObject with random value (assuming that the second part is known "with random value" how to do). Here is an example: JSONObject valueToSet = new JSONObject(); switch (new Random().nextInt(3)) { case 0: valueToSet.put("name", "EditMe " + SpecialDate...

 
@lirtosiast technically, rule changes don't apply retroactively, and the answer was posted before the rules were changed
Note that marking an answer non-competing does not make up for it's being invalid. When the question stabilizes please either add a valid answer or delete. — lirtosiast 12 mins ago
 
3:49 PM
@NewMainPosts I miss my VTC privilege :c
 
 
1 hour later…
5:18 PM
@J.Sallé Time to write some challenges:)
 
5:51 PM
0
Q: Print the previous answer in reverse - with a catch (pt. 2)

Geza KerecsenyiYour challenge is very simple: output the previous answer, in reverse. However, as with this similarly-titled question, there's a catch: in this case, you cannot use characters from the answer before the last. For example: Let's say the first answer looks like this: 1 - Python print('h...

 
@flawr I'd love to, but my creativity for these kinds of challenges is very limited to be fair. Most of the ideas I've had already have challenges about them hahahahah
I'll settle for the trickle of rep for the APL answers I post
 
6:07 PM
@J.Sallé haskell is also good for getting rep:)
 
6:21 PM
Man, writing small concise code comments to do the
```
$code $code #This is what this line does
$code2 $code2 #This is what this does
```
format is hard
Without text wrapping, mind you.
 
6:51 PM
1
Q: How many Jimmys can fit?

Sriotchilism O'ZaicIn this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /, o, and \ arranged like this /o\ Platforms are represented with -. Jimmy will fall off their platform iff they have two or more body parts that are not directly a...

 
 
2 hours later…
9:06 PM
CMC: Given an integer and a list of integers, remove all elements from the list that are not divisible by the integer, leaving only those that are divisible by the integer. E.g. 3 and [3,1,4,15,9,26,53,5,8,9,7,93] gives [3,15,9,9,93].
 
Anonymous
@Adám Actually, 7 bytes: ;)♀%♂Y░
 
@Adám Dyalog APL, 11 bytes: {∊⍵⊆⍨0=⍺|⍵} (will golf it when I get the chance)
 
@J.Sallé Whoa, that's long. At least go tacit; it translates directly 1:1.
 
@Adám dzaima/APL, 6 bytes
 
@dzaima OK, now cut that in half…
 
9:18 PM
@Adám hahahah I know, I just did it in a few seconds 'cause the big boss wasn't looking: ∊⊢⊆⍨0=| (sorry for the double ping)
 
@J.Sallé If you use Extended, then ∊=∘|⊆⊢ would work at 6. But I want 3 in normal APL (nothing fancy like dzaima or Extended).
 
@Mego Question: Is there an explanation for this behavior?
 
@Mr.YouKnowWhoIAm Who are you‽
 
@Adám Mister - YouKnowWhoIAm
 
@Mr.YouKnowWhoIAm I'm NotSure. Pleased to meet you.
 
9:25 PM
So, what are some golfing languages that are easy to learn?
 
@Adám I think I can do it with but I can't figure it out just now. I'll try some more in a couple
 
Ruby is reasonably short at points, and always fun to code in
 
@JohnDvorak For example,...
 
@Mr.YouKnowWhoIAm Not a golfing language, but one of very few "real world" languages that stand a chance against dedicated golfing languages: APL. Quite a few people here have found it a pleasure to learn.
 
... and if you're intrigued by APL, but despise the idea of coding on a character picker, try J
 
9:31 PM
… and if you're intrigued by J, but despise the idea of a different array model, try K.
 
1
Q: Radiation-hardened triple quine

Geza KerecsenyiThe challenge here is quite simple: Your program (we'll call it Program A), when given any character 'D' as input, should print its own code, but excluding all instances of 'D'. That output should be valid code in the same language as the original (we'll call this new program Program B). When r...

 
@Adám ... I'm interested
 
@Adám As well as K.
 
… and if you're intrigued by K, but despise the idea of using symbols, try Q.
@JohnDvorak In…?
 
9:33 PM
K
 
Are they all easy to learn and understand?
 
@JohnDvorak ngn transplanted a k tree from the APL Orchard.
@Mr.YouKnowWhoIAm I'm ridiculously biased, but I'd venture to say yes.
 
Thanks. Will check later.
Haskell is also great fun to learn, and occasionally golfy
 
@Mr.YouKnowWhoIAm Actually, these days, they are based on each other. APL is increasingly borrowing (and often improving on) ideas from J.
 
Most programming languages use = for assignment. Pascal uses := . J has =: .
 
9:38 PM
@JohnDvorak You do know that there are various comfortable input methods for APL, right?
 
A keyboard layout, IIRC?
 
@Mr.YouKnowWhoIAm APL, imo, yeah - the symbols actually very much help readability imo. J and k (though I have very little experience with the two) imo suffer from unreadability way more as they either have multichar tokens (J) or overly overuse the same single-char ones (k)
@JohnDvorak k has just :, and then there's APL with
 
In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement (or expression) is a fundamental construct. Today, the most commonly used notation for this basic operation has come to be x = expr (originally Superplan 1949–51, popularized by Fortran 1957 and C) followed by x := expr (originally ALGOL 1958, popularised by Pascal), although there are many other notations in use. In some languages the symbol...
 
@JohnDvorak Golang also uses the same assignment as Pascal, of all things.
 
12 symbol notations listed ^^
 
9:42 PM
Nice!
 
@JohnDvorak Yes, with various ways to access, like prefix key, shifting key, mode switch. There's also tab completion and "overstriking" which are not related to the layout.
@JohnDvorak Did you know that the APL symbols are paired with their keyboard locations with very strong mnemonics?
 
Okay, so can the behavior I asked about some time ago be explained?
27 mins ago, by Mr.YouKnowWhoIAm
@Mego Question: Is there an explanation for this behavior?
 
@Mego would be the best person to answer that, since he's the one who created Actually.
 
10:04 PM
@Adám I'm stuck on the 3 byter for your CMC ⍨
 
@J.Sallé It's so short, you could brute force it. But let me give you a hint: Look at ngn's divisors function:
in The APL Orchard, May 21 at 18:14, by ngn
@J.Sallé divisors: {(0=(⍳⍵)|⍵)/⍳⍵} -> {∪⍵∨⍳⍵}
 
Yeah, I'm trying to use actually. I'll give it another shot
 
10:20 PM
Can't seem to figure it out. Must be something really easy that I'm failing to see
 
@J.Sallé Nah, I had to do quite some reasoning until I was certain.
 
I have three, but it doesn't feel very conceptually to {∪⍵∨⍳⍵} to me
 
@H.PWiz i was just about to say that none of the parts of that seem to be usable in 3 bytes at all, but i still don't have 3 bytes
 
I suppose it requires a similar level of cleverness
 
@H.PWiz My solution indeed doesn't share any primitives, but it uses the same type of reasoning.
@H.PWiz Did you figure it out or brute force?
 
10:28 PM
Guessed it (although I solved the opposite problem first)
 
hey, I have the 3-byter too!
doesn't require as much reasoning as others have said :P
 
oh i also guessed it! Really feels like it shouldn't work, but it seems to
 
huh? doesn't feel at all like that...
in fact, I've managed to prove it in my head :D
 
{⊢2⎕NQ #'GetBuildID'f⊣(⊂⍵)⎕NPUT(f←'/tmp/hash.txt')1}'xyz' gives me 6a4a2ecd
 
@Adám yep, same thing
 
10:35 PM
@H.PWiz @dzaima Yours' too?
 
@EriktheOutgolfer it's just that i still don't like that kind of usage of the center built-in
@Adám yep
 
@dzaima why? it's not anything weird really...?
 
@EriktheOutgolfer That primitive is oddly (but occasionally niftily usefully) asymmetric.
 
@Adám yes
 
@Adám hm... that's an opinion too ;P
 
Anonymous
10:38 PM
@Mr.YouKnowWhoIAm If you try to divide by 0, the operation is aborted, and the two operands are replaced on top of the stack. and make a temporary stack for each mapped element or pair of elements, and whatever is left on the temporary stack after the operation is appended to the result list. Since x/0 fails, x and 0 are left, so mapping /0 over a list results in appending a 0 after every element.
 
@J.Sallé So all four of us found the same solution. Need more hints/time, or shall we reveal it?
@Mego Actually can't error?
 
Anonymous
Any would-be errors are just NOPs
 
@Adám it's a golflang, so obviously not erroring is always golfier than erroring
 
Anonymous
But the trick is, they are NOPs within the evaluation context, which can actually result in a change when temporary stacks are involved, like the scenario above
 
@dzaima Not in this case, though. Since they are no-ops, they might as well be left out, so they could have been assigned a different meaning.
 
10:41 PM
@Adám the NOP attribute might be useful sometimes
 
CMC: given two numbers A and B, compute A÷B but if B=0 compute A+B.
 
@Adám they're only no-ops with a specific argument. while yes, there are more useful things commands could do than be a no-op, erroring (= stopping the program) isn't one of those.
 
@Adám nah, just tell me. Can't keep working on it since I need to go home soon
 
@J.Sallé ⊢∩∧
 
⊣∩∧
 
10:43 PM
@EriktheOutgolfer Wait, that has a different hash (and swapped arguments)
 
@Adám oh wait... lol just one different letter
aaaaalmost a collision woah
 
:50917085 No, it can't be. and are one bit off, so 6a4a2ecd vs 6a4b2ecd
 
@Adám I see it's quite literally the opposite of the divisors function
 
@Adám yeah, i didn't fully verify lol
 
Makes a lot of sense actually
 
proof: we have integers a < b; if LCM(a, b) = b, that means b is a multiple of a, in other words, a divides b
 
@dzaima ⎕hash cute.
 
I was about to mention that
⎕hash is a cool idea
 
@EriktheOutgolfer My reasoning.
@dzaima Which hash does that compute?
 
i needed a quick way to verify my hashCode implementations were working for the benefit of built-ins utilizing hashmaps, and decided to leave the quad :p
 
10:48 PM
@dzaima We don't expose the hash code because it may change without warning.
 
@Adám a very simple one - matches java
 
@EriktheOutgolfer ok ok
actually why do i manually do this instead of using String::hashCode :|
 
How comes "Java HashCode" only exists on Spanish and French Wikipedia‽
 
@Adám my question would be why does it have any wikipedia articles at all
hmm i don't think this should be a thing
 
10:58 PM
@dzaima It flattens before hashing. Otherwise you need to encode the structure.
 
@Adám it doesn't flatten, but the hash of a singleton is the same as the hash of the item inside it (because {⍺+31×⍵}/⌽ does nothing on a single item) and the shape is ignored, making that effect
 
11:14 PM
@UnrelatedString do you want to join JHT?
 
11:32 PM
0
Q: Write a function

connectyourchargerI honestly can't believe this challenge does not already exist. The challenge Write a function. The specifics Your program must define some sort of callable function. This includes anything commonly known as a function, a lambda function, or a subroutine. All of these types of callables will...

 
unless it entails some sort of commitment to being extremely active in it, yeah
ever since I've started using jelly it's felt really good when it's made any sense at all, so now i'm looking to reduce the number of cases in which it makes no sense at all
 
makes partition for backups GParted: "Editing partitions has the potential to cause LOSS of DATA. You are advised to backup your data before proceeding." ಠ_ಠ
why do i almost never see anything purposefully not display an overly scary message (better yet, a friendly message saying that the operation should be safe) when it knows the operation should be completely safe? If the problem is users doing stupid things, the best you can do is help determine if a thing is stupid, the worst being train them to click trough warnings
 

« first day (3078 days earlier)      last day (1751 days later) »