« first day (1132 days earlier)      last day (3713 days later) » 

12:25 AM
ungolfed:
if (y%2==0) return f(x)*y;
else return f(x);

golfed:
return f(x)*(y&1?y:1);

is there any way to further shorten this C code?
 
Yes.
 
Are you sure the second one is correct?
I suspect you have to swap y and 1
 
yeah, sorry, noticed it now
2
A: Write a function that takes (x, y) and return x to the power of y WITHOUT Loops

izaberaC, exponentiation by squaring int power(int a, int b){ if (b==0) return 1; if (b==1) return a; if (b%2==0) return power (a*a,b/2); return a*power(a*a,(b-1)/2); } golfed version in 46 bytes (thanks ugoren!) p(a,b){return b<2?b?a:1:p(a*a,b/2)*(b&1?a:1);} should be faster than ...

this is correct
 
Actually, I didn't see the golfed version before.
 
it's 1:27 AM here and i'm a bit tired, sorry
anyway, i can't figure out a better way to golf "*(y&1?y:1)"
 
12:44 AM
Yay! Fanatic badge.
 
1:02 AM
Haha, David, I passed you! Watch out Keith Randall; you're next
@Quin Hooray! :-D
 
I have 25 days on SO and 29 here until Fanatic.
Good job, @Quincunx.
 
You don't get any notifications about upvotes on Meta?
 
@TimWolla No, because it doesn't affect your rep.
Still no answers on this:
3
Q: Popularity Contest, ASCII Art, and Code Golf

hosch250I am mulling over a challenge to draw the Eiffel Tower in 3D with ASCII art, similar to this: http://codegolf.stackexchange.com/a/22763/10766. However, it has a problem. If I do it code-golf, it will be a boring kolmogorov-complexity problem and will produce some pretty ugly Eiffels. If I do i...

 
@hosch250 Let's see whether there is a feature request on MSO for this kind
3
A: Proposed questions sandbox - Mark IX

TimWollaKeystrokes needed to type the text We all know that programmers tend to be lazy. In order to maximize your free time you decide to write a program that outputs a minimal number of keystrokes for text fed into it. Input: A text that has to be converted into keystrokes. You may decide on how to...

Any opinions on the scoring system?
 
I think you should supply a few test cases.
 
1:17 AM
I suspect that this will cause people working towards the test case instead of thinking about a good algorithm
 
@TimWolla
 
There is no single correct solution
 
I know, but otherwise, how will you know how they compare to each other?
You could do both.
 
So you favorite the second scoring system (using a predefined text instead of your own code)?
 
Yes.
I probably won't do this challenge anyway - I am busy doing my own.
 
1:19 AM
Thanks for your opinion.
 
You know, you could write a version yourself.
Then have that be the test case.
 
I have already written a naive solution myself, good idea.
 
Then, it would be similar to them using their own source code.
 
I'll have to check my code before though, otherwise it will just get embarassing :D
Especially as I don't use QWERTY myself
 
Yes.
Do you use Dvorak?
 
1:22 AM
Nope, German QWERTZ
 
Oh.
 
But I want to learn NEO (like Dvorak for German)
 
I use QWERTY, but Dvorak sounds interesting.
 
Could you just confirm that { is Shift+[? Or is it otherway round?
 
I have to use shift to get {}
[] doesn't use anything.
 
1:25 AM
And ? is Shift + /?
 
Yes
 
Then I read the image I posted correctly
Thanks
Oh, one quick question: In Germany we have to press backtick + Space to insert a literal backtick and ~ + Space for a literal ~, is this the same using an US layout?
 
I just have to press once for ` and ~
 
Do those keys perform some other function when not followed by space?
 
No.
 
1:33 AM
I meant with the German version where you have to hit space.
 
Yeah, you use them for combining with other characters.
 
ah, I see.
 
I am not entirely sure about the ~ and Windows
 
Like how we can use CTRL + ~ for ñ
In Word.
 
I first used that key to pull down the Quake console.
 
1:34 AM
Yeah
On my German keyboard I have 4 of those characters: backtick, ~, ^, "fronttick": òóôõ
 
I use CTRL+SHIFT+6 to get ô
 
I was able to set up a "compose" key on my debian laptop. But I don't know how to do it with windows.
 
Hot keys? I'm not quite sure where to do that either.
 
For special keys, I copy/paste from charmap.exe or use ALT+octal-code
ALT+0233 = é
 
In Word, it is built in.
 
1:39 AM
I'm prejudiced against word.
 
Why?
 
because Microsoft is evil.
necessary, perhaps, but still evil.
 
Really? I find Google to be more evil.
I would like to work for MS.
 
@hosch HOW DARE YOU SAY SUCH A THING
 
Why not?
 
1:40 AM
>:O
 
Yeah. google's not so squeaky-clean anymore.
 
Especially with Glass.
 
Word should die in a hole
 
Then what would we use?
 
Maybe, if you can get into one of their research wings, you might be somewhat insulated from "marketing pressures".
 
1:41 AM
Nothing else works as good.
 
@luser @hosch please elaborate? prepares for argument
:-P
 
Where else but Word can you find all those fancy functions to get everything just so?
And Visual Studio (by MS) is the best C++ IDE out there. I suppose that should die in a hole too?
 
But you have to do all that futzing to accomplish any little task.
 
No I don't, everything is right in the ribbon one click away.
 
Well, you could tell that to the people at TeX - LaTeX, but honestly I don't understand all their fancy LaTeX stuff either :-P
Sorry for slow typing; I'm on my phone
 
1:43 AM
No problem.
 
If I'm writing something, I use the keyboard. I use the mouse for porn...erhm internet.
 
@luser Right. :-P
 
I can do everything with the ALT key in Word.
Just a few key presses.
 
I wonder whether I should allow „waiting“ in my question, to account for the operating system inserting keys on it's own.
What do you think?
 
Probably not.
 
1:45 AM
@hosch250 that's true, but I just got more and more irritated by the radical changes in each version.
File-type incompatibilities... cross-platform problems.
 
You might want to explicitly say that one "press" equals one character, no hold/repeat until "release"
 
I only have Windows, but I can share to my mother's Mac no problem (she has Word 2011 and likes it).
 
Whatever software I must use, I try very much to save the work in a filetype that conforms to a wider standard.
 
@hosch250 Uh... what's the problem with Glass?
 
Identity theft.
@luserdroog Word can save as PDF.
 
1:46 AM
So for images, that means TIFF, not BMP.
 
@hosch250 How does that have to do with Glass?
 
Is that even a thing? I haven't heard of anyone's identity being stolen because of Glass
 
and that's my mama
s/mama/argument/
 
I really should be finishing my input program now.
Bye.
 
I've got a book about old windows programming where you could actually superclass the system widgets and add custom features to ALL textboxes.
but of course that's way too dangerous nowadays.
 
1:50 AM
If your into security, yes.
 
I'm still trying to make sense of the J incunabulum
 
Hiya @Doorknob. :P
 
@hichris Hi :-P
Hi hi chris
 
I have my double function replace the int-only stoi() done.
 
1:56 AM
:D I should so change my name to hihihichris... or something like that @Doorknob.
Make it meta-meta-y.
 
stoi() converts a string to an int.
 
:-P
 
I should submit it to the C++ committee :)
Bye.
 
Would you guys hate me forever if I admit I'm a Java guy? :p
 
No.
 
1:57 AM
maybe
 
I had to take a Java class in college.
I didn't like it as much as C++ - to much typing.
Bye.
 
Cya.
 
operator overloading bit ya?
I had that too.
But C++ is a monster with no master.
STL failed me when I needed it and I ran sulkingly away.
 
Oh, @CodeGolfUsers I've annoyed convinced Grace Note to come over to meta and talk about the status of our site's graduation and stuff in general! :-D
 
@Doorknob good news!
 
2:01 AM
@Doorknob You didn't annoy Grace... you annoyed Anna. :P
 
Who annoyed Grace, and by the transitive property of annoyance I annoyed Grace :-P
 
I think I am ready
 
@Doorknob That's a new property for math. :P
writes out conjecture on it
 
Any objections to posting this: meta.codegolf.stackexchange.com/a/1184/3396?
 
looks well specified to me. I think it's ready to post.
 
2:23 AM
@luserdroog Were you talking to me? I'm back.
 
yes, about disliking java
 
Oh, I only got to classes.
 
so what's your primary language now?
 
I didn't like System.out.println("text"); when std::cout<<"text\n"; did the job.
Also, if I go using namespace std;, it gets shorter.
 
aha so it was operator-overloading!
 
2:25 AM
Oh.
 
<< is left-shift in C.
 
I can define my own operators in C++.
 
right, but not in java
 
I once wrote one to put text directly from an ifstream to and ofstream.
It worked nifty.
I could just type ifs<<ofs;
 
0
Q: Minimal keystrokes needed to type a given text

TimWollaWe all know that programmers tend to be lazy. In order to maximize your free time you decide to write a program that outputs a minimal number of keystrokes for text fed into it. Input: A text that has to be converted into keystrokes. You may decide on how to input the text (STDIN / reading fro...

It gone out (with a modification of scoring)
Thanks for your help!
 
2:27 AM
Good.
 
Help me make an important decision!
Should I get a black Stack Exchange shirt or a white one?
 
black is always classier.
imo
 
Where are you going to were it?
 
:-P
 
I like white, but it is harder to wash.
 
2:29 AM
and it hides coffee-stains.
 
It would take a good chatbot to make sense of our messages :)
 
My T-Shirts are primarily dark and band merchandising
 
Hehe
 
I think I've watched every anime on netflix
:(
Hmm. maybe not. there's a few I've passed over.
 
@Doorknob I got the black shirt, it's very nice. Have another one due to arrive any day now.
 
2:37 AM
@Doorknob Weirdly enough, I got that email too. Go for the site specific one. :D
 
It is an email? Watch out for phishing.
You know SO was just attacked.
 
@hichris But... SE... :-P Have to show some love for the network too!
 
@hosch250 It's an email... but from one of the CM's, Tim Post (aka lord of the swag).
 
Oh. You sure?
 
Yeah :-P for the election
 
2:39 AM
Yep. As sure as I can be.
 
Oh...
Phishers can be slippery.
 
And it just links to a Google docs form
 
I am studying this for my final paper.
 
Yea, it's legit, same one I got for the meta contest. Docs form for sizes, etc.
 
@Doorknob I dunno why I even got it... I wasn't in the top 10 or anything.
 
2:40 AM
I guess it's for the top 30 :-P
 
Apparently. :D
The top 30 in the election for SITE. :P
 
Lol yeah, I also got that
 
My new stoi() function works perfectly.
 
Getting my daily sleep now. I'll continue working on “the mission” after getting out of bed again ;)
 
2:56 AM
OK, everything done to perfection.
Just need to do the optional string validation part.
 
3:07 AM
0
Q: Shortest code to print ':)' random times

Mukul KumarYou have to create a code which prints :) No white-space and newline character included Random times but ranged between 0-255 Your score : The count in bytes Your Bonus : Each up-vote = -5 from your score Each down-vote = +5 to your score NO need to edit scores according to number of...

Duplicate, or not?
Trivially different.
 
3:21 AM
How do people write tags in questions/answers? For example, "This is (code-golf)" in this answer: meta.codegolf.stackexchange.com/a/1178/14509
 
Use [ tag : name ]
Without spaces.
 
Like [ tag : code-golf ]
Yup.
 
Awesome, thanks.
 
3:35 AM
0
Q: a question about getline in C++!

tiandiao123using namespace std; int main() { string s1,s2; char a; cin.ignore(10000,'\n'); cout<<"please enter an character using your keyboard:"<<endl; cin>>a; cout<<"the S1 and S2:"<<endl; getline(cin,s1); getline(cin,s2); cout<<a<<endl; cout<<s1<<endl<<s2<<endl; return 0; } the input is : b ...

Off-topic question.
@Doorknob Does your chatbot shut down after a while?
It didn't notify about the question.
Does anybody want to help CV this?
 
@undergroundmonorail in general, you can usually find a "source" link for a post, or look at edits->markdown view.
To copy any trick you see on these sites.
 
There's a big SO sandbox with load of useless unicorns.
I'll try to find the link...
279
Q: Formatting Sandbox

Ólafur WaageAs per Jeff's suggestion in this comment: You can use this question as a formatting sandbox. You can edit this question itself (Community Wiki questions such as this one require 100 reputation to edit) post answers to this question (Since this question is protected this requires 10 reputatio...

 
Does anyone know how to recover a program?
I accidently erased mine, and I had two days worth of work since my last backup.
Then I closed it.
I lost almost everything of my input program, and I was almost done.
I don't even remember how I had everything.
 
3:52 AM
some kind disk-recovery util. I haven't used on lately.
 
I found that VS has a backup program, but the folder was empty :('''
 
The ones I've used would show you the dir listing with the first char as ?
 
I don't know. I saved the file and closed VS.
 
then you'd select the file and retype the missing first char of the filename.
For this, you would need to know the exact directory where it was saved.
And usually you need to already have the recovery program installed, to make sure installing doesn't use the space you want to recover.
 
I know the exact directory, but wouldn't the file have overwritten itself?
Also, I don't have one installed.
 
3:55 AM
If you've saved-over it, yes.
 
I did. I am sooooooooo ticked.
 
If you've just "deleted" it, the nodes may still be on disk, just inaccessible.
 
It take at least 2 days to recover.
I saved over it, not deleted.
 
Hm. If the file was large, that may only overwrite the first block.
 
It was about 1000 lines, and I only had about 20 in the new bit.
 
3:57 AM
So disk-recovery could still be useful, but now you're looking for fragments of the file, not a file with a missing first-char.
If you can install the recovery program on a second disk or usb drive, that would be better.
 
Yes, I have one. I will even download it to it
Does this sound good?
 
Looks ok. It says it handles "file overwrites". Which I think is what you have.
You may still have lost as much as 1 disk block of the beginning.
That depends on the file system.
 
That will be alright.
I am on NTFS.
 
I'm out of gummy bears :(
 
It didn't say it would recover .cpp files.
I am hoping...
 
4:04 AM
they're no different from any other file.
 
OK.
 
so it shouldn't worry you if it doesn't list them explicitly.
 
OK.
 
I'm trying to add APL-calculations to Postscript.
 
I don't know Postscript or APl, so I can't help you there.
 
4:08 AM
Just iota and scalar/vector addition so far.
APL uses infix syntax but more mathematics-inspired symbols.
Postscript uses reverse-polish-notation (like an HP calculator).
 
I have a TI.
TI 36XII
 
I haven't used that one. Does it run BASIC?
 
I don't know. It is just a scientific.
No programming.
 
But it follows order of operations: * before +?
 
Surprisingly, no.
 
4:12 AM
Hm.
 
No wonder I had a hard time with Algebra and Calc sometimes.
 
Just left-to-right, explicit parens?
 
Yes.
Parenthesis are handled right.
I had to use them frequently.
 
With an HP calculator, it side-steps that issue because everything is on a stack.
 
Won't I have fun.
Oh.
It has found 40000 files, and it is only 1% done.
I have a 750 GB drive.
 
4:14 AM
And most operations pop 2 numbers as arguments and push one number as result.
... Yes, it may take a while.
 
89.29GB used.
 
An APL calculator would be pretty, eh...
 
I don't know.
 
jeez. Last time I did this it was a 7 GB, I think.
 
I had to write a calculator in C++ a while ago.
That is where I learned error handling and input validation.
 
4:15 AM
I have written a calculator twice, while practicing top-down parsing, and bottom-up parsing
 
My calculator climbed to the top of each sequence, then worked its way down.
 
It seems like an App would be good for apl, since you have a fake keyboard anyway.
 
bye o/
 
Bye. I need to go too.
 
5:00 AM
@luserdroog I agree. Not only have I had a hard time with word (microsoft office), but it costs money (and now it is a subscription :-/). There are plenty of free software out there. I use Open Office, and I love it. However, I have one problem: when I input numbers into tables, they are automatically formatted (ie 00 becomes 0 and 01 becomes 1). My favorite part of this is that I can find/replace with regex. Regex makes life easy
@luserdroog What do you use instead of word?
 
For little notes and things, I use vim, or any text editor.
For more formatted stuff, I've used Lyx and LibreOffice.
But my love of postscript came from wanting to do all my typesetting in ps.
I spent a lot of time working on a document formatting engine.
Which is pretty-much scrapped now. I think it was too monolithic.
I've made do since then by combining different little tools.
But, I'm out of school now, so I don't write many papers.
 
5:26 AM
I do like markdown for formatting. I have dreams of making a document engine with ps output, markdown input and using the TeX linebreaking algo.
I have a prototype that uses the old Scribe input syntax.
As I understand the history, it was frustration with Scribe becoming proprietary that was the direct stimulus to Richard Stallman's creation of the FSF.
So "finally" making a clone of Scribe seems like it would earn some GNU cred. :)
 
5:56 AM
I got up to implementing the polynomial function in my apl.ps. My brain hurts.
/P{ 1 index length i -1 exch + ^ * +,} def
I have a very simple suite of postscript procedures that I can use for formatting: code.google.com/p/xpost/downloads/detail?name=cv.ps
As long as I can get away with "ragged-right-edges".
Arranging the source-code to fit on one page was quite a challenge.
 
7:01 AM
???
http://codegolf.stackexchange.com/users/10933/doorknob
http://codegolf.stackexchange.com/users/3808/doorknob
 
@Doorknob ^
 
 
2 hours later…
8:39 AM
@hosch250 We're talking at cross-purposes: I think this is a "Yes".
@TimWolla I did, but I haven't yet thought hard about it. Since you've posted, I probably won't unless I try to answer that question (and my current preference for a more time-consuming question to answer is the QR-code one).
 
 
4 hours later…
12:53 PM
@Victor @Jan ???
Ooookay
 
1:38 PM
@PeterTaylor It's fine, just wanted some feedback before posting, but that's obsolete now :)
 
1:58 PM
@luserdroog Pandoc will convert from Markdown to LaTeX, and LaTeX to PS is easy.
 
2:30 PM
Hmmm, should I post my ref implementation of battleships?
 
@Doorknob that's someone who changed his username recently apparently: it makes the following conversation quite disturbing I must say :) codegolf.stackexchange.com/a/22500/6741
 
2:47 PM
Just optimized my thing to handle lots of ships of same kind
(especially in no-solution situation)
$ time ./a 10 0 0 0 12 <<< A1
real	0m1.802s
Hm. If I post a reference implementation, should I put a link in the question, or should I make a self-answer?
The argument against self-answer is that it's not really a solution to the task - no golfing attempts were made at all
 
3:18 PM
@plannapus @Doorknob This answer: codegolf.stackexchange.com/a/17071/737 has a comment at the end that shows what that user's name used to be. 'TheWobbuffet' apparently.
 
@Gareth indeed. I flagged one of this user's post so that moderators are aware of it.
 
3:55 PM
Been poked about coming in here for a chat, so I prepped up a little ditty for you guys.
 
I suppose you meant to link this?
 
I did.
 
Did not. You linked http://meta.codegolf.stackexchange.com/
 
Let me rephrase. "I did mean to link that."
 
 
4 hours later…
7:52 PM
I'm afraid we need a new sandbox.
 
negative
sort by active
 
OK.
 

« first day (1132 days earlier)      last day (3713 days later) »