« first day (2368 days earlier)      last day (2474 days later) » 

2:26 PM
0
Q: Resources to prepare for general electric interview

user55926I am preparing for general electric interviews. Have heard that they have a coding round, where they ask the candidates to solve a problem programmatically. Very few people have been able to crack it. Can someone please help me with resources / sites where I could practice and prepare myself for ...

 
> Applying as java dev at GE
> Can't even read "Programming Puzzles and Code Golf"
 
XD
 
(when you try to click close(4) but it says "This question has already been closed. Please refresh the page")
 
and someone upvoted it too 0.o
 
I beat ya to it
 
2:29 PM
Who upvoted that? It's at +1/-2 ninja'd
 
I don't personally like downvoting those questions, but upvoting may give the wrong message :P
 
That user now has 2 rep.
 
Nope back to 1
 
rep is dumb, 10 downvotes and then one upvote will net you positive rep gain
 
@StepHen Questions that are at -3 or below don't show on the main page
4
 
2:31 PM
(if you are 1)
@AdmBorkBork oooooooh that makes sense thanks
 
@AdmBorkBork Learned something new today!
Now at +1/-7
 
@StepHen you always have positive rep
 
NewMetaPosts is taking too long
 
@AdmBorkBork I will now downvote offtopic questions that are above -2
 
0
Q: Prevent crypto while allowing string idx, etc in CnR

programmer5000In my new sandboxed challenge, I'm looking to ban crypto / one-way functions that make it impossible to get the input from the output. I started out requiring only using functions that are bijectve, but that bans functions that "gets a character from a particular index of a string", as pointed o...

 
2:33 PM
@programmer5000 ninjad
 
There we go
 
@programmer5000 5 minutes is quick for NMP, it usually takes about an hour
 
An hour?! Ain't nobody got time for that.
 
@programmer5000 one of mine was posted here the day after (about 15 hours)
 
Noice
 
2:38 PM
There should be a threshold of 2 stars for something to be on the starboard.
 
@programmer5000 It decays off pretty quick if it has low stars
 
I can clear the stars from every message that gets one star, if that helps?
 
@trichoplax that prevents someone from starring a 1-star message and putting it on the starboard.
 
@trichoplax if you do that then I'll never have any starred messages :P
 
2:39 PM
I'm looking for feedback on this before I post to main:
3
A: Sandbox for Proposed Challenges

programmer5000 I'm looking for final feedback before I post this to main. code-golf cops-and-robbers Will it halt? Cops: This is the cops' thread. The robbers' thread is here. Your challenge is to make a program that runs forever without halting1, unless it gets a particular input or inputs2. If it rec...

 
@programmer5000 Wait, though, wouldn't that be the solution to star spamming? Kind of...
@cairdcoinheringaahing Or that time that NMP put 7 challenges at once, like ~18 hours worth
 
I would like to see a threshold feature for stars though. There's a feature request for an adjustable threshold per room:
15
A: Chat Feature-Request: Thumbs-Up

Adam DavisIf several people "agree" with a given chat post, then it should be starred. Let's instead change the star sidebar so it requires at least 2 or 3 stars before a post shows up on it. The star function is meant to be the "awesome"/"I agree"/etc vote, and duplicating it and/or dividing it up will ...

 
@programmer5000 you've gotten 3 upvotes, if all issues in the comments are cleard, it should be good to go
 
@trichoplax Just put anything Dennis says longer than 10 words on the starboard, it'll get there anyway
 
@cairdcoinheringaahing If the votes come in early, they can sometimes mean "Nice idea" rather than "Ready to go", so checking in here before posting is worthwhile
 
2:43 PM
^^
 
I've witnessed the sandbox effect: a few votes in the sandbox, a few issues in comments fixed, and then when posting to main it gets +5/-5.
 
@programmer5000 Well, if you hadn't Sandboxed it, it would be +1/-9, so be happy you did :P
 
@programmer5000 Exactly. I always like to get last minute eyes on my posts before deciding for certain
 
There is significantly more traffic to main than to the sandbox; that's just inevitable.
 
Anybody working on/know how to solve A000036?
 
2:45 PM
@StepHen it was chosen by Peter Taylor, its not going to be nice
 
> nmax = 6*10^4; A[n_] := 1 + 4*Floor[Sqrt[n]] + 4*Floor[Sqrt[n/2]]^2 + 8* Sum[Floor[Sqrt[n - j^2]], {j, Floor[Sqrt[n/2]] + 1, Floor[Sqrt[n]]}]; V[n_] := Pi*n; P[n_] := A[n] - V[n]; record = 0;
That should be portable to any language
Err I guess there's more to it
 
@programmer5000 The only question I have is this: Is the input taken at the start of running? That is, the program takes input and then the timer starts and you have to find an input that terminates in 60 seconds?
 
@BusinessCat pity that mathematica went early
 
Mathics hasn't been used, if that counts as a different language
 
2:49 PM
0
Q: Threshold of 2 for messages to be on the starboard

programmer5000On The Nineteenth Byte chat star "spamming" where a random user stars a random message, polluting the starboard. I suggest requiring 2 stars for a message to be on the starboard, but only in TNB.

 
I believe it does
 
And it looks like it will work with some minor modifications
 
@BusinessCat unless the syntax is completely identical in every aspect, they're different
 
@NewMetaPosts @programmer5000 That's something that would need to go on mother meta - the functionality is currently not available (AFAIK) for any chat room to do that
 
@cairdcoinheringaahing I don't know enough about either language to respond to that one way or the other
 
2:50 PM
@cairdcoinheringaahing It has less builtins (so I was told when I asked)
And it's a free implementation and it's on TIO
 
@trichoplax If the input is from a GUI, than assume the user can type in 0s so that the time waiting for input dosen't count. For instance, while(prompt()!=="h"){} is valid JS.
 
The other option is to just figure out what reap and sow do, everything else can easily be ported to another language
 
@Nico Welcome to TNB! You'll need 20 rep on the main site to chat here.
 
@programmer5000 rep system actually is more messed up
 
Because I'm gonna be honest, I don't understand the definition of that sequence
I don't know the notation
What is the purpose of # before the { ... }?
 
2:55 PM
It means oeis is weird
3
 
And is P(n) the sequence for this one? Even though it's usually A(n)?
 
also anybody know what's up with the editing a message makes a new one on mobile?
 
@programmer5000 we need a bot to do that. Like on SO
Can you sort the stars page by number of stars?
 
@cairdcoinheringaahing bot's aren't allowed in thb.
 
@programmer5000 NMP/NSP are bots
 
3:02 PM
0
Q: Canonical words from chemical element symbols question

Peter TaylorThe creation of words from chemical element symbols seems to be a popular pastime, judging by the number of questions that are asked about it. Most of them are closed as duplicates: Words from periodic table of elements Checking periodic table words Find the Chemistry of a name Chemical sentenc...

 
Jul 20 at 22:29, by programmer5000
May 15 at 15:59, by New Sandboxed Posts
I AM A BOT THIS IS DISCRIMINATION
 
they're feeds and they're exceptions
Nov 12 '15 at 22:26, by Doorknob
okay seriously stop abusing stars
 
That's the most starred message in tnb.
 
Ok so A(n) = #{(i,j): i^2 + j^2 <= n} means A(n) is the number of solutions to i^2 + j^2 <= n
 
3:05 PM
So I think this isn't nearly as hard as we thought
 
yes it is oeis is weird stop trying to justify it
:P
 
I'm gonna see if I can do it Python, then I'll try to port it to something else
 
aaa lasers
 
@totallyhuman if a bot doesn't hurt the room, why shouldn't it be allowed to moderate it
 
3
Q: When Fibonacci meets the Queens

AdmBorkBork(inspired by Helka's response to my random pairing of "chess" and "Fibonacci" tags in chat) Fibonacci The Fibonacci numbers are one of the more well-known sequences in mathematics, where each number is composed by adding the two previous numbers together. Below is a definition of the zero-ind...

 
3:18 PM
@NewMainPosts => VTC as dupe
 
We've established that a fibonacci challenge must be as good as the sum of the previous 2 fibonacci challenges, and I think this one meets that criteria
3
 
Oh my. I'm making progress on A36
 
@Mayube Thanks! :D
 
Jul 20 at 20:14, by trichoplax
To escape closure, a fibonacci challenge has to be as good as the previous 2 fibonacci challenges put together
 
3:37 PM
I got it! Now I just need a new language I can port this to...
 
well, making another one will be tough.
 
@BusinessCat I hear PowerShell is great and does all things.
 
Well PowerShell hasn't been used yet so I could potentially use it
 
Should there be a tag for cops' threads and one for robbers' threads?
 
Though I'm not really familiar with it
 
3:50 PM
0
Q: Will it halt? (Cops)

programmer5000This is the cops' thread. The robbers' thread is here. Your challenge is to make a program that runs forever without halting1, unless it gets a particular input or inputs2. If it receives that input, it must terminate in a finite amount of time3. This is code-golf, so the shortest answer that ha...

0
Q: Will it halt? (Robbers)

programmer5000This is the robbers' thread. The cops' thread is here. Your challenge is to crack a cop's submission by finding an input that makes it halt. You don't have to find out why, or all inputs that make it halt if there's more than one, or the input the cop intended, just one input will do. Once you ...

 
@programmer5000 Separate tags? No.
 
+70 rep from 2 questions & an answer in 10 minutes. Rep cap, here I come!
 
hi folks, how's it going?
 
4:05 PM
How do you read STDIN in TIO Node.js again?
 
anybody from Denmark?
 
@aditsu Adam is
 
@Adám?
 
@BusinessCat how's A36 going?
 
I need to figure out a new language to write it in, but I got a solution in Python
 
4:09 PM
75
A: How to read from stdin line by line in Node

leviYou can use the readline module to read from stdin line by line: var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false }); rl.on('line', function(line){ console.log(line); })

 
@BusinessCat what's your solution?
 
c'mon man y u asking question on stack exchange chat when you have stack overflow
 
@BusinessCat you could ask AdmBorkBork for help to make it into powershell
 
Afternoon gents
 
4:12 PM
hey
 
@programmer5000 I just noticed that you don't have a winning criteria in your CnR
 
Oh come on, the next sequence in the OEIS challenge is uncomputable because it is equivalent to the halting problem.
 
oh don't worry next thing you know somebody solves the halting program
 
@HyperNeutrino hard code it
 
lol that's one way to do it
I mean the sequence only has 4 terms lol
now I need to find a language that's relatively useless for non-hardcoded solutions. Anyfix might do.
 
4:16 PM
If anyone's going to invent a golfing language that somehow bypasses the halting problem, it's probably going to be Dennis
 
@Xanderhall he's already done it, just doesn't want to break modern day computing. Him and Jon Skeet finished it in a day, back in 1990 :)
 
@cairdcoinheringaahing Cops or robbers thread?
 
@programmer5000 cops
 
> This is , so the shortest answer that has not been cracked by a robber within one week of posting wins.
 
@programmer5000 didn't see that. Maybe you should put it at the end, or bold it
 
4:18 PM
Hmm. My train of thought there led me to a question. Is there a term or phrase for when someone solves a problem by relying on unintended behaviour of a system?
 
Oh come on I have lists in Anyfix but no way to get an element from a certain index of the list...
 
6
Q: Good Subjective and Knowledge Questions vs Problems You Face

AJ HendersonCurrently the Don't Ask page of SE sites indicates "You should only ask practical, answerable questions based on actual problems that you face" however Good Subjective, Bad Subjective, as well as a great many non-technical Stack Exchange sites delve in to topics which aren't always problem based....

 
@HyperNeutrino o0
 
probably relevant for you guys as well
 
@Xanderhall "Using C++" :P
 
4:20 PM
Well someone else did it
 
I'm going to attempt something very stupid. I'm going to push untested Python code onto GitHub using the GitHub editor directly and ask Dennis to pull it into a test arena to check its functionality. Good luck me :P
 
Oh well, the next one being hardcoded means I can use some terrible esolang to do it which is nice
 
@BusinessCat too slow
 
aw man
i was going to do ,,,
 
:P
 
4:23 PM
i had the answer too ><
 
Well the next one is really easy so do it now
 
oh the next one's easy
ninja'd
 
It'd take me longer to submit an answer than to write the program in Gaia
 
oh wow I didn't even look at the next sequence
 
If you want an awful esolang, try VTFF
 
4:25 PM
Got it, y'all
 
(turing-complete)
 
Naaah if you want an awful esolang, try Ziim
 
anyways
my language already borked
wtf
i give up on commata
 
rip... or should I say, "rip,,,"
 
11140566368 7571840 9784 32↔• would've been 4147
 
4:28 PM
@totallyhuman nvm, you still have a chance. I screwed mine up xD
 
Do we still have the 1 post per hour rule?
 
but commata is borked
 
@Mayube yeah
 
(trusty)totallyhuman@localhost:~/Downloads/Workspace/commata$ ./commata blah.,,, 0
1.0
(trusty)totallyhuman@localhost:~/Downloads/Workspace/commata$ ./commata blah.,,, 1
2.0
(trusty)totallyhuman@localhost:~/Downloads/Workspace/commata$ ./commata blah.,,, 2
5.0
(trusty)totallyhuman@localhost:~/Downloads/Workspace/commata$ ./commata blah.,,, 3
10.0
 
7 messages moved to Trash
 
4:30 PM
><
 
Wait trashing doesn't unstar?
 
@HyperNeutrino apparantly not >.<
 
wait wat
why does 2^0 give 0 in python
 
because python is not smart
 
waaaat
it does give 1
but commata doesn't
wth
 
4:33 PM
@totallyhuman are you using the ^ symbol?
 
2^0 is 2
 
no it's not o0
 
@HyperNeutrino why does 2#ƈ*‘ not work? :(
 
anything to the power of 0 is 1
 
4:34 PM
@totallyhuman 2 xor 0 is 2
 
@Mayube what is that meant to do
 
except 0 to the power of 0
 
wait nvm I got it
2ƈ#*‘
 
4:35 PM
@Mayube is that Jelly?
 
no
 
No it can't be
 
lol
it's anyfix
 
No I think it's anyfix.
 
@HyperNeutrino quick post it! 2ƈ#*‘
 
4:35 PM
What is it
 
the next OEIS answer ;)
 
next sequence
 
was it changed...
 
2^n+1
 
@HyperNeutrino my commentator answer was wrong
 
4:36 PM
oh wait no someone answered the uncomputable one
 
yeah I did
 
I should try to make a Malbolge program that only accepts one particular input
 
@HyperNeutrino why haven't you posted it yet? Also please keep working on Anyfix it's a fun language and I enjoy it
 
@Mayube Sorry, forgot. Also I outgolfed you :P
also the next one is the easiest thing ever
 
4:45 PM
@HyperNeutrino are the spaces no-ops or code?
 
f(n) := 1
@cairdcoinheringaahing they are ignored
 
@HyperNeutrino wait how did you outgolf me? My answer was 5 bytes yours is 12
 
well actually 4 because I added 8 spaces...
 
Ok I actually got a correct answer with commentator
 
oh right ok
@HyperNeutrino not my fault that « is poorly documented
 
4:48 PM
it is documented
at the bottom
I forgot the double-space to newline it
ok I should edit that soon
 
@StepHen Does a newline count as non-empty?
 
oh no more necklaces
 
@aditsu At your service. (btw, so is Cowsquack)
CMC: Given two strings A and B of lengths a and b, return a matrix of b vertical repetitions of A followed by a horizontal repetitions of B.
 
@Adám hej, from your profile I thought you're from England (but then I'm also not from HK)
 
E.g. Hello and You gives
HHHYou
eeeYou
lllYou
lllYou
oooYou
@aditsu I live in UK. Are you also Danish? ("hej")
 
5:02 PM
I'm going on a trip to Denmark next week, and I know almost nothing about it, was looking for some references :p especially the language (pronunciation) seems tough
I'm Romanian actually :p
 
@aditsu Me too :)
 
@Mr.Xcoder salut :)
 
I understand salut as French o_o
 
@aditsu :-D I'm also going on a trip to Denmark next week. Yes, the language pronunciation is crazy, with pretty much no relation to spelling. Neither is it consistent. Almost all signs are only in Danish, but everyone is fluent in English.
 
Lol, we both have exactly 2472 on SO @aditsu
 
5:03 PM
@Adám Oh, so it's just like English then
 
@Adám SOGL, 8 bytes: čd⁄*ld∙┼]
 
I have exactly 20000 on SO
 
I have... 1375... lol
 
But both exactly 2472.
 
I don't even have an account on SO
 
5:06 PM
@Adám can you explain how Odense is pronounced? :)
 
@BusinessCat Well, kind of, but different. Danish has some rare features:
The phonology of Danish is similar to that of the other Scandinavian languages such as Swedish and Norwegian, but it also has distinct features setting it apart from the phonologies of its most closely related languages. For example Danish has a suprasegmental feature known as stød which is a kind of laryngeal phonation that is used phonemically. It also exhibits extensive lenition of plosives, which is noticeably more common than in the neighboring languages. Because of that and a few other things, spoken Danish is rather hard to understand for Norwegians and Swedes, although they can easily read...
@aditsu O as in old, d as in the, en as end, se as in set.
 
@Adám that looks like a great reference, except I need to learn another foreign language (the one that has words like "affricated", "allophone" or "alveolar") to understand it
 
@aditsu Good luck with Danish stød:
Stød (Danish pronunciation: [ˈsdøð]) is a suprasegmental unit of Danish phonology (represented in IPA as ⟨◌ˀ⟩ or as ⟨◌̰⟩), which in its most common form is a kind of creaky voice (laryngealization), but it may also be realized as a glottal stop, especially in emphatic pronunciation. Some dialects of Southern Danish realize stød in a way that is more similar to the tonal word accents of Norwegian and Swedish. In much of Zealand it is regularly realized as something reminiscent of a glottal stop. A probably-unrelated glottal stop, with quite different distribution rules, occurs in Western Jutland...
 
@Adám oh, that's a "th"? my friend said it's more like "l", except I heard nothing like that when checking online
 
@aditsu Definitely not an L. YOu can leave it out completely if you want to sound like the locals in Odense.
 
5:12 PM
the soft d seems to sound like an L at the end of the word though, at least in some cases, right?
 
@aditsu Actually, in general, if in doubt about the pronunciation of a letter in a Danish word, leave it out.
@aditsu Not to me :-)
 
LOL :)
@Adám what about "hud"?
 
@aditsu h as in house, u as in zoo but short and with stød, d as in the.
 
still "th"? ok..
thanks:)
 
@aditsu d is usually as in the, except in the beginning of a (sub-)word or after l or n or g where it is silent.
@aditsu No, not that th, the other th!
 
5:17 PM
I know
 
@HyperNeutrino the OEIS challenge is 2 answer (deleted as well) away from 100. :P
 
flip i can't think of a tricky way of answer the halting challenge in python
 
@totallyhuman Python will be cracked instantly
 
@Adám let me try that, to get back on topic :p
 
@aditsu Some of the craziest words: også is like us! prakke is p as in pat, r as in Scottish loch, a as in arm*, kk as in gift, e as in entymology.
@aditsu Yes, ok, sorry.
CMegaC: Given a Danish word, return IPA.
 
5:22 PM
@Adám wanna get a room to discuss more?
 
@Adám lambda w:"IPA" :P
 
@aditsu Nah, I have to cook dinner.
 
aw man i was just about to crack a solution but they deleted it ;-;
 
@Adám CJam, 21: q~]_:,W%\:a.*~\z\.+N*
can probably be golfed more
 
@aditsu 13: q~_,@a*z\f+N*
 
5:30 PM
nice!
 
11 bytes (prints a trailing newline): q~f{_,@*\N}
 
APL, 7 bytes: ∘.⊣,∘.⊢
 
@BusinessCat wow
@Adám that looks like a Korean smiley.. maybe
 
@aditsu ⍨
 
シツ
oh, another thing, I recently wrote an editor if anyone is interested
 
5:36 PM
Hit the repcap.
 
lucky
I have yet to hit repcap
 
@programmer5000 for the CnR, can we take as many inputs as we want?
 
I got my first bounty today :D In SQL/SEDE
I wonder who gave it :P
 
@Christopher you're welcome
 
@cairdcoinheringaahing Yep
 
5:40 PM
@cairdcoinheringaahing Yeah I like it :D
Every day I link this KotH. It has 100 rep bounty
 
@aditsu INteresting. I just use Notepad++ on Windows. Seems to do all that.
 
For the winner ofc
@Adám Notepad++ is nice.
 
@Christopher If you onebox that everyday, you're gonna get chatbanned
 
@Adám so I've heard, but I don't use windoze (most of the time)
 
I used to use Notepad++ but now I really like Sublime
 
5:41 PM
@cairdcoinheringaahing Removed onebox
 
I used sublime too
 
18
Q: Create a simple line editor

AdámIn: a string without line breaks* Allow the user to edit and submit the line Out: the modified string (optionally with a trailing linebreak) The line editor must at minimum allow the user to: move a visible cursor left and right insert and/or overwrite characters at the cursor position remove ...

 
Atom is the best
 
8
Q: Line editor (more text here)

ChristopherIn the misty years of yore, when fanfold terminals walked the earth, there lived a strange creature. Oddly crippled and yet oddly powerful, the line editor teemed across the programming landscape in untold numbers; covering the earth as far as the eye could see. Now it is fallen on hard times. T...

 
22
Q: ...And Mexico will Pay for It!

geokavelDonald Trump is very impressed with the work of the people on this site. He saw how amazing of a job you did helping Ben Carson, so he even hired you to build his wall. He thinks you're terrific. Now he needs your help again. While he has successfully built his wall, now he needs the Mexican gove...

 
5:46 PM
@programmer5000
 
@DJMcMayhem I don't have know git, because it comes with a git package
I can commit & push & pull & fetch & amend without using a command-line
 
CMC: n ~> [n << 1, n << 2, n << 3, ... n << n]
5 ~> [10 20 40 80 160]
 
@Christopher That's really not necessary
 
(n is positive)
7 ~> [14 28 56 112 224 448 896]
 
5:51 PM
@Mr.Xcoder SOGL, 3 bytes: {«T
 
@Mr.Xcoder What is ~> and what is <<?
 
@dzaima The mac link thing
 
lambda n:map(n.__lshift__,range(1,n))
 
@Mr.Xcoder there, I should add a button to link to it :p
 
@Adám ~> doesn't mean anything, it's just the test case input output sepractor. << is left bit shifting
 
5:53 PM
@Mr.Xcoder Explain <<, please. Some of us are dumb.
 
impossible
 
@totallyhuman This is an exact equivalent: lambda n:[n<<i for i in range(1,n+1)] .
 
is it shorter? i can't tell
 
@Adám a<<b = a*(2^b) (^ = power here)
 
@Adám Writing an explanation now
 
5:54 PM
CJam, 10: q~_,:)fm<p
 
@Mr.Xcoder Jelly 4 bytes: Try it online!
 
> x << y Returns x with the bits shifted to the left by y places (and new bits on the right-hand-side are zeros). This is the same as multiplying x by 2**y.
 
@DJMcMayhem æ«R saves a byte.
 
@Mr.Xcoder Ah, the ol' -shl operator.
 
Nice
 
5:56 PM
I have 5151 rep :D
 
@Mr.Xcoder APL, 9 bytes: ⊢×∘(2∘*)⍳
 
@Adám Nice
@Anyone Now you give me a CMC
 
@Mr.Xcoder APL, non-tacit is shorter: {⍵×2*⍳⍵}
 
@DJMcMayhem k
 
@Mr.Xcoder Surprisingly terse in Brain-Flak: (({})){({}<((({}){}))>[()])}{}{}
 
5:58 PM
@Dennis You said your algorithm should save 3 bytes. I only managed to golf it by 2 bytes: &P_QP_a3+%Q6. Can you give me any hint on the third byte?
 
@Mr.Xcoder CMC: given x, multiply x << x by x >> x
 
@DJMcMayhem Nice, Brain-falk is nearly tied beats with Python
 
I love finding tasks that the least convenient language in the world is super convenient at
 
@Mr.Xcoder Replace _a with -.
 
@Dennis Thanks
 

« first day (2368 days earlier)      last day (2474 days later) »