« first day (2357 days earlier)      last day (2492 days later) » 

1:26 PM
hi all
 
The ultimate regex password matcher: [A-Z][a-z]+[0-9]+\W*
 
0
Q: How can we get more feedback on our Sandbox questions?

ckjbgamesOften, I have proposed a question to the sandbox and I never got any feedback on it; sometimes, I never got feedback until I had already posted the question. I want a way to fix this. I want Sandbox questions to get more recognition and more feedback so that we can have better end-result question...

 
@Mayube Explain.
 
Hey @Lembik, thanks for your tip with f m n a b as (m#n)a b! I always forget about that ^^
 
@Adám Follow the link
 
1:30 PM
it wasn't my tip @BruceForte !
 
wtf :S
 
Okx
@Mayube Improved: [A-Z]?[a-z]+[0-9]*\W*
 
@Okx Also the linked answer specifically states exactly 1 uppercase
 
@Okx I'd go for [A-Z]?[a-z]+[0-9]{0,2}\W*
 
otherwise you might as well do [A-Za-z]+[0-9]*\W*
 
1:33 PM
True though! Seem to have mixed that up..
 
@TheLethalCoder that wouldn't match mine though, which has 4 digits
 
.+
 
@Mayube We want to allow the weaker passwords as well though for maximum safety...
 
@TheLethalCoder [0-9]{0,2} does not allow weaker passwords than [0-9]*
 
[0-9] can become \d
 
1:34 PM
@Mayube I thought it'd allow 0, 1 or 2 numbers?
 
right, wheras [0-9]* allows 0 or more, meaning it also allows 0, 1 or 2 numbers, it just also allows more than that
 
@Mayube So less numbers == weaker, right?
 
in theory
 
@Cowsquack \d allows numbers other than 0-9 so should be stronger though.
 
Gvyf
 
1:36 PM
what other numbers does it allow?
 
anyway, I'm off to do some work and listen to some Alternative Japanese Metal.
Have fun, fellow golfers
 
Probably differs between flavours but see: stackoverflow.com/questions/6479423/…
 
The best password regex: .*
 
Essentially other languages digits as well
 
@musicman523 adam already pitched .+, I don't know of any site that allows blank passwords
 
1:39 PM
@Mayube Websites generally don't but you can have an empty passphrase on an RSA key, for example
 
I say screw it and go for passphrases: [A-Za-z0-9 ]{8,}
Obligatory xkcd. (Someone had to post it...)
 
We have a vote to reopen in the house
 
To reopen what?
 
Look at the user list
 
1:47 PM
@TheLethalCoder have you read the flavor text
 
how about this challenge? Whatever key I press, output its name
what do people think?
(this is to include prtscn, sysrq, scroll lock, etc.)
 
@Poke I have...
 
@Lembik that'll be hard.
 
@Adám hard is good. Impossible not so good :)
so .. how hard?
 
@Lembik you'd need to explciitly list the "name" of every key, and possibly a keyboard layout, and it'd exclude a lot of languages, but yeah it could work
 
1:50 PM
@TheLethalCoder then you realize that the comic makes no sense
 
@Lembik Shift? ? Pause?
 
what is [tag:⊞] ?
what is ⊞ ?
 
@Lembik messed up markdown.
 
windows key
 
@Lembik ninja'd
 
1:51 PM
yes that too
 
@Poke I wasn't saying it did... I was saying it was related to the discussion.
 
Ctrl, Shift, Alt could be difficult
 
@Lembik What about combos? Shift+A?
 
I suppose assuming a standard US layout "With the @ over the 2"
@Adám maybe miss out the combinations? What do you think?
 
@Lembik How about + L ?
 
1:52 PM
I think Processing can do Ctrl, lemme check
 
would Shift+2 be @ or Shift, 2 though?
I'd say ignore key combos
 
ignoring
 
and just literally output the keys pressed
 
Just return scan codes?
 
in "real" languages (APL, C, C#, Java etc) it shouldn't be too difficult, but good luck doing it in Jelly or CJam
 
1:53 PM
In C# if you subscribe to a key down event you'd get two events for Shift+2 (I think) so ignoring combos sounds good to me
 
I have two windows keys
should they be different?
I mean will they give different scan codes?
 
@Lembik They have different scan codes.
 
what are they used for?
I mean who uses the right Windows key?
 
@dzaima where is the palenChars.txt file, you say?
 
also what is the key between the right Windows key and the right Ctrl?
 
1:55 PM
@Lembik I've remapped it to AltGr because I keep hitting the wrong key.
 
The context menu one?
 
@TheLethalCoder No, I have both a RightWin and a ContextMenu
 
nvm, Processing gets 65536 for Shift, Ctrl, Alt, ... keys
 
@EriktheOutgolfer here
 
1:57 PM
Bottom row: Ctrl Win Alt Space Win Alt Menu Ctrl
 
you should move it to a more prominent place ;)
 
still have to mix the SOGLOnline SOGL and SOGL V0.12 together
 
oh yeah I forgot soglonline is the newest version...
what about the older versions? do you use them at all?
 
@Adám Lembik said between the right Windows and right Ctrl so I said context menu. Isn't that what you're saying too?
 
they're there for older programs
 
1:59 PM
code-golf?
what do you think is best?
 
@dzaima oh you don't want to search through commits right?
(btw v0.12 still mentions palenchars)
 
@EriktheOutgolfer partly that, partly that nobody else would want to. Versions in SOGL change only when the change breaks some previous solution posted on PPCG.
@EriktheOutgolfer the chardefs is newer in SOGL V0.12 but palenChars.txt is in SOGLOnline, it's really confusing.
 
@TheLethalCoder My physical keyboard has the stated order, but my keyboard remapper has RightWin and RightAlt swapped.
 
@Adám Ahhh okay
 
The main problem with making V0.13 or something that is the SOGLOnline SOGL is that I've made so many changes that I don't even know if the Processing code even still works
 
2:02 PM
well, I can still use web browser downloading it offline I suppose...right?
 
posted
I am intrigued which languages will do well
any guesses?
 
if python3 does it then probably jelly and 05ab1e can do it better
 
I think APL will probably do it well
 
that is they can compress python source code and eval
 
oh can APL do this?
 
2:03 PM
0
Q: What key did I press?

LembikThe task is to write code to identify which key is pressed on the keyboard. You can assume that only one key is pressed at a time and that there is a standard US keyboard layout. That is the layout with the @ over the 2. Your code should output a unique identifier for any key pressed. This inclu...

 
@NewMainPosts THAT'S FAAAST!
 
@Lembik We ship with a utility for this; ]KeyPress.
 
@Adám who is we?
 
@Lembik Dyalog
 
Why is this challenge not closed? codegolf.stackexchange.com/questions/28672/…
 
2:05 PM
interesting
 
@Dennis
 
@Lembik But it catches combos.
 
Jim
@NewMainPosts I think that is not specified well enough, it will end up with a lot of questions of the type: "Is this key included?".
It should have been sandboxed
 
@Adám so what does it output if you press the Enter on the number pad?
 
@Lembik Input: ER, Char: 13, Key: 13, Shift: 0=[none]
@Lembik I think it just listens for a WinForms KeyPress Event.
 
2:12 PM
0
A: Sandbox for Proposed Challenges

GryphonHow close am I to a palindrome? code-golf number palindrome For the purpose of this question, a palindrome is a number that, if reversed, is equal to the same number. Your Task: Write a program or function that receives a number, and outputs the number that is closest to zero that must be ad...

 
and what about the main Enter key @Adám ?
 
@Lembik Same thing.
 
then that fails :)
 
I've received some downvotes here but I don't know whats wrong. Whats wrong with the answer?
 
@Adám I don't like to ask questions which are too trivial :)
 
2:14 PM
@Lembik I'm on a mac keyboard, is it okay if I don't output anything for F1 but output something for Fn+F1?
 
@WheatWizard I think you're supposed to increment if odd, decrement if even
 
@Cowsquack no! Why would you need to do that?
 
@EriktheOutgolfer Thats what it does.
 
;_; that's what Processing does
 
unless you tell me that no message is received at all my a mac when you press F1
@Cowsquack sorry no in that case
it's not meant to be trivial :)
 
2:16 PM
F1 by itself just lowers the brightness
 
@WheatWizard oh you say it flips the last two bits?
 
but Fn+F1 doesn't, and this is what Processing detects
 
that's not what the question asks for
 
@Cowsquack ok .. but you still have to report that it was pressed :)
 
x+1 isn't always x^3
 
2:17 PM
@EriktheOutgolfer It is, you can do a few tests if you wish but it is the same.
 
@WheatWizard for example, 00111111 -> 01000000 not 00111100
 
I am surprised it has taken 15 minutes to answer my challenge :)
 
@EriktheOutgolfer Works for me
 
I don't think it just flips the last two bits
 
Ok, I guess the explanation is wrong then.
 
2:19 PM
@EriktheOutgolfer in your pull on SOGL the tab seems to be a space?
 
ooh...ignore that pull
 
@EriktheOutgolfer Thanks!
 
@Lembik OK, I asked our Chief Architect. If C# can do it, then Dyalog APL can too. It would seem from this that it is indeed doable.
 
@Adám In C# subscribing to the KeyDown event like KeyDown += (s, e) => Console.Write(e.KeyData); returns Return for both Enter and num pad Enter for me. I can't see how to distinguish between the two. Though the Keys enum does contain Return and Enter.
 
@Adám great!
I look forward to the answer
 
2:25 PM
@Lembik I don't think I can be bothered to write an answer though. It looks like all the special keys will need separate treatment. Ugh.
 
@Adám that's terrible!
 
@Lembik Not APL's fault, more like .NET's fault.
 
you really can't just output the scan codes?
there must be a language that lets you just read scan codes
surely
bash? :)
 
@Lembik C++
 
in terms of golf, is there any reason to have both ints and floats and not just floats?
 
2:29 PM
maybe
 
@totallyhuman Well, in principle, APL has just numbers.
 
You may want integer division
 
does xev|awk '/yc/{print$7}'|cut -d\) -f1 work for any linux users here?
 
@musicman523 But that could be a separate function.
 
then you could repurpose get arrays/strings xth item for a float to something else
that's about all I can think of :p
 
2:30 PM
@Lembik For me it looks like xev pops up an "Event Tester" window that doesn't do anything when keys are typed
 
@musicman523 same with me
 
Oh wait I just saw your comment about the values only appearing on exit
It does seem to work for me
 
right but that's isn't what I wanted
 
Except it duplicates responses
 
I have clarified
 
2:32 PM
0
Q: Is the number binary-heavy?

MayubeAn integer is binary-heavy if it's binary representation contains more 1's than 0's, ignoring leading zeroes. For example 1 is binary-heavy, as it's binary representation is simply 1, however 4 is not binary heavy, as it's binary representation is 100. In the event of a tie (for example 2, with a...

 
@Lembik Personally I think that's okay, that may be a consideration you allow for
 
I am not allowing it :)
 
That is fine
But the only way to get around it in bash would be to fork processes and make a pipe
Which would be a huge pain
I'm not saying that's a good reason to allow it, though
 
bash may not be the right tool.. shock! :)
 
I just made by keyboard unusable.. lol
 
2:36 PM
oops
I wonder if the JS answer really works
 
@NewMainPosts I get deja vu
 
if it turns out to be a dupe feel free to hammer it
 
Somebody please help this guy out
-1
A: Is the number binary-heavy?

Michael FirlusPython 2, 77 bytes i=2 b=str(bin(i))[2:] print str(i)+"->"+b+"->"+str(b.count("0")<b.count("1"))

 
Done
 
3:06 PM
thanks
quick somebody give me a unicode character that could represent count instances of x in y
 
c?
 
@totallyhuman jelly has ċ@ so ċ is mine
 
ñ
 
@Mayube c is already chr(x)
@Mayube wait how does that represent it
 
/shrug
 
3:09 PM
you don't have taco script installed...
 
fine i'll go with jelly's version
 
I do ¯\_(ツ)_/¯
 
i've sometimes hit enter so fast that tacoscript didn't register it ¯\_(ツ)_/¯
 
wait who starred "me too"?
 
shh don't talk about it
 
3:10 PM
/shrug
@totallyhuman I need to otherwise it stays there >.<
and one exception often causes exception flood
 
@totallyhuman like membership, but with a mark for counting
 
@totallyhuman I think I figured out why he was confused - he read the format for the test cases and thought that's what the output format should be
 
too late I think
 
3:28 PM
this is great
I tried connecting to my wifi like 5 times, restarting my computer in between attempts
then I switched to trying to connect to my main network because I was using GUEST earlier
and then it worked first try ><
 
does xev|awk 'NR%2/yc/{sub(/..$/,"",$7);print$7}' work for any linux users here?
 
what's it meant to do
awk: cmd. line:1: NR%2/yc/{sub(/..$/,"",$7);print$7}
awk: cmd. line:1:         ^ syntax error
 
@HyperNeutrino thanks!
 
wait it's meant to break o0
oh wait nvm
that wasn't your answer
whoops
 
@Lembik Why is the Java answer for printing a key invalid? You modified the requirements after 4 answers were provided.
 
3:32 PM
ignore me i'm just being dumb
 
is it normal for chrome to replace ordinary text with weird ligatures?
 
(and a 5th was written, but deleted)
 
@OlivierGrégoire hi...
@OlivierGrégoire I don't think anyone said it was invalid did they?
@OlivierGrégoire or do you mean that a new requirement has made it invalid?
 
The new requirement made it invalid.
 
which requirement has made the answer invalid?
 
3:34 PM
The one you added 10 minutes ago.
"and it shouldn't output anything apart from the unique identifier"
 
@Lembik Should mouse movements be outputted?
 
@OlivierGrégoire why do you think that has made an answer invalid?
 
You tell me, you insinuated I thought incorrectly the answer was valid.
 
@OlivierGrégoire I did not insinuate that the answer was invalid
 
"Are you saying that this answer (the one we are commenting under) is valid?"
 
3:36 PM
@OlivierGrégoire can you quote the insinuation?
 
I just did.
 
no you haven't
 
2
Q: Calculate the MU-numbers

Wheat WizardThe first two MU-numbers are 2 and 3. Every other MU-number is the smallest number not yet appeared that can be expressed as the product of two earlier MU-numbers in exactly one way. Here are the first 10 2, 3, 6, 12, 18, 24, 48, 54, 96, 162 Task Given a positive number calculate and output...

0
Q: Create your original sequence challenge

Dead PossumThere are lots of challanges, that just picks some sequence from oies and asks you to print n-th number or first n numbers or whatever. It's time to stop automate! Task Your task is to parse random sequence page from oeis.org and print it's index, description and example values. Example python...

 
do you mean this line "@OlivierGrégoire The problem is that if you add junk to the end of a unique identifier, the identifier is still unique. It's just not minimal." ?
@OlivierGrégoire I think you have just misunderstood something
 
2 mins ago, by HyperNeutrino
@Lembik Should mouse movements be outputted?
 
3:37 PM
@OlivierGrégoire in short, don't worry. I haven't insinuated what you think I have insinuated
 
Olivier and Lembik: I've figured out the source of the confusion
 
Okay, let's start from scratch. What do you not like about that Java answer?
 
nothing!
 
Lembik states: You have given more output than requested
 
@OlivierGrégoire why do you think I don't like it?
 
3:38 PM
Meaning, the keys he asked for in the question
 
that is true @musicman523
 
Olivier, you interpreted this as: The actual output format of the program is undesirable
 
@musicman523 thanks
 
"You have given more output than requested", but the question is "unique identifier", not "minimal unique identifier"
so from this, I deduced you thought the answer is invalid.
 
Lembik's comment was about which keys were given as examples in the answer, not how the answer is formatted
 
3:39 PM
@OlivierGrégoire no.. I asked for "Tab, Pause, Enter, Enter on the number pad, left Windows key, right Windows key, Insert and Ins on the number pad." and the answer also includes other keys
that's all
@musicman523 thanks again :)
I will leave you now.... the answer is great!
 
It's a reasonable misunderstanding for sure
 
I wait for the python answer now :)
thank you
 
@OlivierGrégoire he asked to provide example output for 8 specific keys, you gave more than that, that's all he's saying
 
wait what rep +100 suddenly hold on what
 
@HyperNeutrino did you recently join a different SE?
Association bonus?
 
3:41 PM
oh bounty
 
Well, given that the answer also gives dozens of extra characters per key press, I thought those were the "more outputs".
 
@Lembik is it fine that when I press PrtScr it prints the identifier and then still opens the print-screen dialog?
 
Okay, I'll go and delete my comments, @Lembik
 
@Lembik Finally for the C# version working, horrible code though, might be a better way but I can't see how at the moment. Now for golfing it -_-
 
0
Q: Java is to JavaScript as Car is to Carpet

Steven VascellaroTitle stolen inspired by Greg Hewgill's answer to What's the difference between JavaScript and Java? Introduction Java and Javascript are commonly used among programmers, and are currently the most popular tags on Stack Overflow. Yet as we all know, aside from similar names, the two have almost...

 
3:53 PM
I'm surprised nobody FGITW'd the trivial Python solution yet :P
 
@Adám oh that's a good one thanks
 
@totallyhuman Any time. APL uses it for "find": 1 2 1 ⍷ 0 1 2 1 3 1 2 1 2 1 gives 0 1 0 0 0 1 0 1 0 0
 
@HyperNeutrino because it has 30 views? :P
 
@Adám how do you iteratively fibonacci in APL?
 
4:03 PM
Wow. So that just happened
 
FGITW
 
nice
 
dammit
there's an oeis python package
but it's not for The OEIS
def choose(a, b):
        if a < b:
                return 0
        r = 1
        for i in range(0, b):
                r *= a - i
                r /= i + 1
        return r
that's literally all there is to it
the nCr function
this is sad
 
I'm surprised there isn't a tag for [pattern-matching]
 
4:14 PM
@HyperNeutrino how is it sad?
@HyperNeutrino an optimization would have it become range(0,min(b,a-b))
or range(0,b)[:-b]
 
Does anyone mind giving feedback on my recent Sandbox post? It has an upvote but I'm not sure whether it's ready to be posted
 
@HyperNeutrino I'm wondering what tag would be fitting for my Java vs JavaScript question.
 
out of 420 USD in my paycheck I may be able to spend about five bucks
After expenses
 
@LeakyNun Because I was hoping for an OEIS python package to solve the recent challenge
 
@StevenVascellaro At it's heart, it's a but with restricted I/O. Is there a Restricted I/O tag?
@HyperNeutrino I would be willing to write one with you if you'd like
 
4:19 PM
That would be cool. I'd like to do that.
brb making github repository :P
 
@Christopher Welcome to adulthood.
6
 
@BusinessCat I don't like it
 
@HyperNeutrino If you want to do it alone, that's fine too. If you'd like my help, I'm willing
 
@BusinessCat Actually I think i have no money. NOPE I am in debt by like 1.3k
 
@HyperNeutrino Would be a fitting tag?
 
4:20 PM
Alright. If I have anything I need help with I'll be sure to keep that in mind :)
@StevenVascellaro I think it's just
 
@StevenVascellaro Only if the challenge requires use of regex or is somehow about regex
 
Or no it's (note the lack of a trailing s)
 
@HyperNeutrino and are synonyms
 
but no that's not fitting because regex is not required (see: my solution lol)
 
Oh ok. Thanks
 
4:21 PM
@StevenVascellaro right that's why it redirected
 
So there isn't a tag for standard pattern matching
 
apparently not
If enough people decide it would be a good idea I could create that tag right now (you need 150 rep :P just a bit more :P)
 
I could see it...
 
4:26 PM
no
wait nvm
caching
 
@HyperNeutrino aHA! I knew it had to exist somewhere. Downloading now
 
ok
@musicman523 lol ninja'd caret reply?
 
Or misclick reply, it happens to me a lot
 
Oops
Yeah misclick
 
or that :P
 
4:27 PM
^fixed it
 
@StevenVascellaro I made the tag and tagged your question
 
how does caret reply work
 
@Christopher Thanks!
Guess I won't be getting that tag author badge on Code Golf. :P
 
@musicman523 Type one caret per message you want to respond to. Get the message preview if you want to make sure the user is right
 
4:28 PM
you type n carets before your message and it replies to the message that was the n-th last message at the time you started typing (avoids ninjas in most cases unless someone sends a message just before you start typing and you don't count it, or internet lag ninjas you)
@Christopher darnit ninja'd :( how ironic (almost)
 
^^^ how do you get the preview?
 
@musicman523 ataco has a github m8
 
(might be worth mentioning it's a userscript)
 
Ah.
 
lol I still feel like making my own OEIS python package :P
 
although I'm not sure how I'd make it work
I can use /A<seq>/b<seq>.txt but that only goes up to so far
 
@Mayube Jelly can eval arbitrary Python code. No luck needed.
 
Well, that one was a bit more hardcore, as it actually redefines one of Jelly's atoms. :P
 
@HyperNeutrino What was the original question?
 
4:42 PM
How to increment all integers in a list in place.
 
@Dennis How are you doing today?
 
Not worse than usual.
 
So not a good day?
Mine was good until real life expenses like insurance came in
 
uhm couldn't you do this: “globals()['atoms']['¹'].call=lambda l:[i+1for i in l]”ŒVṛ¹
 
Could you and should you are very different
 
4:46 PM
or this: “atoms['¹'].call=lambda l:[i+1for i in l]”ŒVṛ¹
 
@totallyhuman no that doesn't do it in place
@totallyhuman nor this
 
@totallyhuman That just mimicks . The idea is to modify the list, not create a new one.
 
@Dennis VTC observable requirement
 
s/o/uno/
 
4:48 PM
@totallyhuman in place
 
@Christopher Perfectly observable. tio.run/##AU4Asf9qZWxsef//…
 
@Dennis Perfe tly? Hit space a bit early.
 
@Christopher i don't think it was timing typo...
 
In comparison: tio.run/##y0rNyan8//…
 
@Dennis comparidon?
Today is not a good day for you XD
 
4:51 PM
³ holds the input, which is no longer the input.
@Christopher You've mocked me twice after I had already corrected the typos. Bit pointless.
4
 
@Dennis You may 11 them
(I swear if you edit them to just say 11 XD)
 
In other news, the JavaScript-Carpet challenge lead to this gem.
408
A: What's the difference between JavaScript and Java?

Shog9One is essentially a toy, designed for writing small pieces of code, and traditionally used and abused by inexperienced programmers. The other is a scripting language for web browsers.

3
 
@Dennis Oh my. That is perfect
 
4:59 PM
@Riker do you two just share links half the time o.o
 

« first day (2357 days earlier)      last day (2492 days later) »