« first day (2825 days earlier)      last day (2021 days later) » 

1:15 AM
We really need to change the programming puzzles part, because it makes new users think they can post their homework here because it is a "puzzle"
 
I really don't think that's really what's causing the posts.
I've never seen somebody say "But it's a puzzle!" when trying to post their homework. (Not to say it's never happened). Most people see the word "Programming" and "Code" and decide it's a place to post programming stuff
 
Yeah, I think any site where people post code problems will attract homework code problems.
 
 
1 hour later…
2:49 AM
Yeah, except we get the luxury of saying this isn't a site for people who are puzzled by programming :p
 
 
4 hours later…
6:21 AM
 
 
1 hour later…
7:26 AM
-1
Q: Array indexes to number and number reversed

guest271314Given an input array having minimum length 2 and maximum length 9 having any initial values output an array having length 2 consisting of the 1-based indexes of the array represented as either an integer or string in forward and reverse order. Test cases Input -> Output ["a","e","i","o","u"] ->...

 
8:13 AM
hi @user202729
SO is full of homework questions
 
So is in PPCG but most are closed
codegolf.meta.stackexchange.com/questions/2140/… sorry for advertising my proposal again but I need some comments
 
 
1 hour later…
9:43 AM
@ShieruAsakoto On SO they seem to be very happy with homework questions, at least according to the two moderators I spoke to once who said that was part of the point of SO
 
Well they're not off-topic.
 
bc SO is the place suited to those homeworks
 
But, obviously, nobody wants the OP to copy the answerers' code and submit it.
 
hi @user202729 . I wanted to write a follow up question to my fastest-code one (actually the question I meant to ask the first time)
 
aka Homework Overflow
4
 
9:48 AM
but I am having problems with test cases
(did they really figure out how to block youtube-dl?!)
 
@Anush Just use a brute force solution to generate all possible initial arrays. (is it too slow?)
 
10:01 AM
@user202729 that's fine but I need to test each one to see if it is unique
this seems harder
say I make all arrays containing 1 and 2 of length 5
how can I test each one to see if it is unique with respect to all other arrays of length 5
 
Compute the subset sum, use the solution in the old challenge to see if the output only has that array (and its reverse) (it's slow...)
 
@user202729 I will see if I can get that work. Do you mean the set of sums when you say subset sum?
 
Yes...
 
It would help if there were some non code-golf solutions :)
 
You can use the Husk solution, it's quite fast.
(Husk <-- Haskell)
The method, it just looks like normal BFS. I don't know why it's faster than other solutions.
 
10:15 AM
I would need to be able to call that from python.. but maybe I can work that out
 
@Anush subprocess.Popen :)
 
:)
 
Wait a minute... it has terrible overhead.
Then... just reimplement that in Python.
 
right.. there is a python solution already
 
By the way: the old challenge can be converted into a SAT problem.
 
10:16 AM
@user202729 oh that's interesting!
I like that sort of thing
 
@Anush Not interesting. Any problem can be converted into SAT.
 
@user202729 well any problem in NP :)
 
What I'm thinking is whether any SAT problem can be converted into that one.
 
right.. that would be very interesting
 
which would also prove that this one is NP-hard (right?)
 
10:17 AM
yes indeed
 
(anyway, the way to formulate this problem as a SAT problem: For each element in the set of sums, it's either the sum of a prefix, or it's not - that way we can create n boolean variables. For each element, if it's not the sum of a prefix then it's the difference between two prefix sums -- which creates the restriction. Besides, there are exactly n non-zero prefix sums.)
 
can you formulate the question "Is this array unique" as a SAT problem?
 
Hm...
Well, first assume each number in the array is a k-bit integer
Then there are n(n-1)/2 pairs of numbers, for each one check if they're equal...
 
10:41 AM
@user202729 that's not what I meant :)
I mean check if there is any other array with the same set of sums
(except for the array reversed)
 
11:04 AM
CMC: Given a representation of a non-negative integer, output the vi command that takes the least amount of typing to move that number of characters to the right. In particular, 0 should output the empty string, 1 a single l, 2 a double l, and all powers of 10 should output a row of 9s followed by a double l. Everything else just concatenates the l.
 
@Neil Don't know vi, so can you give some examples? 10, 20, 21, 100?
@Neil What about moving a bit too far, and then back left.
 
@Adám 10 -> 9ll 20 -> 20l 21 -> 21l 100 -> 99ll
@Adám wouldn't that take more typing?
oh, and I mistyped above, I meant left instead of right, so I'll accept both l and r (but consistently)
 
@Neil What does 100l do?
@Neil I hadn't understood the system from your OP.
 
@Adám it's more typing because you've got to use three different keys
99ll only uses two keys
 
@Neil vtc as unclear.
 
11:09 AM
@Neil ಠ_ಠ
 
@Adám ... I did list all the cases...
 
@Neil So 34 should be 33ll?
 
@Adám ooh, clever
puts CMC on hold
 
@Neil APL: ⍴∘'l' (outputs n ls, as that's always "easiest" by using only one key)
 
@Adám I just kind of assumed length is preferred over key distinctness
 
11:12 AM
yeah, I think I have to tie-break by length first and number of keys second
 
@Neil Canvas, 11 bytes
 
@Neil Use the sandbox!
 
@dzaima fails for 2, 1, and badly for 0
 
@Neil oh right forgot about special-cases
20 bytes; I thought switch would never come in handy :p
 
lgtm
 
 
1 hour later…
12:22 PM
@ShieruAsakoto as a high-level comment: I think you are really going to struggle to get submissions. It's taken me several reads to get a decent overview (I still don't understand the equations).
but, if you are ok with getting 0-5 submissions total, then that's fine
 
 
3 hours later…
3:06 PM
Where should I keep secure notes?
I've got lastpass, but with 2FA, there are often backup codes in case you lose your device
I do not want to put those backup codes in Lastpass, because then 2FA means nothing: If they can get into my lastpass account, they have both forms of 2FA
 
a post-it note?
 
ah, yeah. Make it physical. Duh
 
yeah just stick em in your wallet or something
 
Well, I plan on doing this for all my services, and having 20+ papers in my wallet seems like overkill
 
ooo
 
3:19 PM
I'll just keep em at home as a backup plan
 
@Anush That would be incredibly hard (it involves the numerical value of the input), but definitely possible.
But that's not what we have to do anyway.
 
@NathanMerrill Personally I try to use YubiKey for everything and I also try to have my backup be the google authenticator app or something rather than random codes. I realize not all services support this but in general a real "second factor" is probably better if you have the option
 
Yeah, I don't have a Yubikey (or something similar)
So, as it stands, there's only one extra piece of hardware in my life: my phone, so adding another one (paper) is a good alternative
 
highly recommend it next time they're on sale 8-)
 
perhaps I'll get one though
 
3:23 PM
if i notice a sale i'll try to remember to ping you
i keep mine on the same keyring as my apartment key
actually i might have a spare
i should probably keep it as a backup but i can send it your way if you're really interested
 
Nah, that's fine
I'm not short for money :)
 
that's always nice :]
 
It's simply a matter of hassle and time and deciding if I really want it
 
4:20 PM
@NathanMerrill By "secure" what are you hoping to protect against? Like, which attack vectors are you worried about?
I have a "Notes" app on my phone, and I consider that pretty secure, but I suppose can't really know that the app developers don't read said notes :P
 
4:41 PM
So, I want 2FA: Lastpass is the first factor. My phone is the second factor. The backup codes are there in case the second factor doesn't work. So, if I lose my phone, and they were stored on my phone, then it's a useless backup
So, yeah, I'm not worried about the security of Notes (unless it is synced online), but it doesn't work for backup codes
 
 
1 hour later…
5:55 PM
I realised a while back that there are actually four authentication factors; the fourth is getting someone to vouch for you
this is commonly used as a backup, for example
 
0
Q: Use the smallest number of bytes

Monolicasay$_ x(31&ord)for AWSALILAND=~/./g The code above is created using an older version of Perl v5.010. The code can only be run using the online code running platforms if the version is declared. For example: (use 5.010; say$_ x(31&ord)for AWSALILAND=~/./g) would run this code correctly. your t...

 
@NathanMerrill When you use 2FA don't you constantly find you have left the second factor somewhere else or its battery is dead?
 
nope. My phone is always on me, and I've never had battery issues with it :)
And even if the battery was dead, I generally always have a USB cable nearby
That being said, I could easily see how this is an issue for others: I don't regularly travel, my life is "boring": I leave for work at the same time and get home at the same time, and have habitualized everything
And it was an issue for me, for example, while I was attending University
I had "lost" my phone 3-4 times, only to find it a week later
 
7:15 PM
CMC, Brain-flak: Given n digits in integer format, join them together and print the result in integer format.
For example, 1, 2, 3 --> 123
Of course, you may not use the -a, -A, or -c flags
 
7:27 PM
I don't know Brain-flak, but wouldn't it be something like push each digit, then pop and multiply by 10*whatever where the "whatever" is incremented starting from 0?
 
Along those lines, yeah
Although all of the inputs are implicitly pushed before the program starts
 
Cool. Now I just need to learn Brain-flak, lol.
 
If you're interested, I'm more than happy to teach
 
@dzaima I've been telling you to do that all along ⍨
 
7:31 PM
@J.Sallé they weren't good reasons though
 
It's Java, you don't need good reasons to blame it >.>
 
@DJMcSpookem The interest is there, the time, not so much, haha.
 
@dzaima on wait no IntelliJ is to blame there, Sl is just equal to this, so Sl.Sp sets Sp
@J.Sallé see, no reason to blame java :p (though I'm very surprised IntelliJ didn't catch that; Probably because without any usage the two are always equal :|)
 
Hahahahah nice. I tried using IntelliJ once. Went immediately back to Eclipse though
 
@J.Sallé No, IntelliJ is very, very awesome; This is the first time I've seen it not be correct, ever, and only to some extent.
 
7:43 PM
Yeah but I couldn't adapt to it. My eclipse has so many extensions it is basically IntelliJ
 
8:00 PM
@DJMcSpookem 44 bytes
 
How do you input a list of integers?
 
@AdmBorkBork put one in each line on the input
 
Or separated by any whitespace
 
@DJMcSpookem How do I sum everything in the stack?
 
@DJMcSpookem Fails for input digits >= 10, like 1 43 3
 
8:11 PM
> Digit, Noun: any of the numerals from 0 to 9, especially when forming part of a number.
 
That's a flaw in my pseudo-algorithm above, too.
 
I wasn't planning on handling those
 
s/digit/integer/in-my-brain
 
@J.Sallé Do you want tips to help figure it out, or do you want the answer?
 
@DJMcSpookem I just need to sum everything I have on the stack >.> I tried doing something like ([]){({}[()]<({})>)} but that didn't work >.>
 
8:15 PM
That's definitely on the right track
 
Yeah but that evals to 0
 
The ({}) is a NO-OP though.
It pops it and then pushes it right back. You probably want something like ({}{}) to add the TOS to the one under it, or ({}<>{})<> where that adds to the top of the other stack
 
@DJMcSpookem the ({}{}) did the trick.
 
Glad I could help! Want a tip to make it easier?
 
I now have a horrible 132 byter
but hey it works >.>
@DJMcSpookem I'll revisit it later today, gotta go home now.
 
8:37 PM
@FireCubez Golfed 78 bytes ;)
 
9:27 PM
@DJMcSpookem Any progress on this? :P
 
Nope, I haven't even thought about it :P
Since both of my languages are so minimalist, I'd have a really hard time making the new one even remotely interesting
 
@DJMcSpookem Thought that might be the case :P
 
@DJMcSpookem make a less minimalistic language that transpiles to one of yours so it'd be easier :p
 
@DJMcSpookem Speaking of which, I introduced Brainflak to someone at my school today. They're now trying to make an interpreter on their calculator ¯\_(ツ)_/¯
 
@dzaima Oooooh
@cairdcoinheringaahing That makes me super happy :D
 
10:05 PM
 
10:44 PM
-1
Q: NOT Expensive - Programming language for OS Development

Paul KingI have the following question related to my subject: I wish to commence a development of basic OS kernel . What is most inexpensive Language i could use for this particular purpose? Any suggestions or recommendations i should take into account? My aim is to create PoC of basic operating syst...

 

« first day (2825 days earlier)      last day (2021 days later) »