- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Nothing can beat jsFuck, only Discourse. Tried to paste this code converted to JsFuck:
But it was almost 100000 characters, exceeding the maximum post length 3 times.
Check it out here: http://www.jsfuck.com/
Admin
I swear when I read the article in my reader the source code was in brainf*ck. probably a joke Remy put in. I was hardly impressed to see it was horrible VB instead.
Admin
https://github.com/golang/example/blob/master/stringutil/reverse.go
Admin
Scala stolen from StackOverflow:
Admin
My favourite thing about Ben's golang snippets is the oneboxer doesn't even get to the code.
Admin
https://github.com/golang/example/blob/master/stringutil/reverse.go#L18-L27
Admin
Enterprise: [image]
Admin
These days, I'd have half a mind to write a string on a piece of paper, and then turn the paper upside down on the desk and say "Done."
Followed by, "I feel uncomfortable working with a company who cannot come up with a good password hashing algorithm, and especially one that wants me to implement it by hand."
Admin
Go's not one-liner? Lame.
Admin
http://play.golang.org/p/MZcvgGLF_P
Admin
Still, using a function doesn't count as one-liner unless it's in standard library.
Admin
It's basically the same as
new char[strlen(s)]
, except with 32-bit chars (no surrogate pairs!) and a unicode-correct strlen.Admin
I know what it is. I'm just saying the name is stupid. Especially that everyone else calls it code points.
Admin
I was given this exact same question when I was interviewed for a job I recently started.
The interviewers know that there are built in functions for this and they know that you know this as well (and tell you not to use them).
This test is not designed to prove your knowledge of a language or a framework. It's about proving that your mind can handle the thought process to write them should they not exist.
String reversing is still probably a bad example because most languages will already have a function for it, but chances are you will need to write code in your job which which is way more complex for which no function currently exists.
This is what the test is for.
Admin
I'm fairly certain rainbows wouldn't have anything to do with it.
Admin
Admin
Admin
On an unrelated note: WTF Discourse keeps cycling between comments #3, #7 and #8 on my tablet. Had to use my computer to read the reactions (and post this rant).
OT: I think his solution is actually a nanosecond faster in execution than e.g.
Optimized code, what more do you want!
Admin
I'd post the solution in Unary, but it would probably go over the character limit for a post
Admin
That's insane...
Admin
When golfing Unary code, it's not uncommon to remove 10100 characters
Admin
I'm sorely tempted to give them a recursive algorithm (please excuse quasi-PL/1 pseudocode syntax):
reverse: function(string) returns char(*) if length(string)=0 then return '' else return reverse(substr(string,2)) || substr(string,1,1)
Admin
I already hated clowns before I saw that picture. Now I've lost my appetite for breakfast. Thanks.
Admin
You're welcome.
Admin
Wow, you managed to find a domain that's blocked here (for being a dyndns provider, if I read the error correctly).
Admin
Found an interesting bit of Discomath relating to this:
http://i.imgur.com/qObKGfx.png
In creating this, I forgot that that check means, can award to a single person more than once.
That's more of a Discobehavior
Admin
that's not is the badge awarded multiple times IIRC. that's can the badge be awarded multiple times....
Admin
2 slow 4 my edit
Admin
hmm.... but who hanzo'd whom?
your edit hadn't loaded on my page when i posted mine. :-P