« first day (523 days earlier)      last day (4430 days later) » 

3:00 PM
The more appropriate solutions however is to write a polymorphic functor, I have namespace operators for that. So that would be operators::push_back {}, or val<operators::push_back>() if I needed to imbue that into the EDSL specifically.
 
@sbi sigh, I just want to transplant some feet... where's my saw
 
sbi
To that mean bastard who un-starred my wonderful message: You are a mean, mediocre sucker. I am seriously grumpy now. I hate you. May you die tonight.
3
 
someone just pissed off the bonobo
 
@sbi Mmmh are you sure you didn't miss yourself that in the case that both feet are transplanted it would still be called a 'foot transplant'?
 
3:01 PM
@sbi huh... I was sure I had stared that, and I never un-stared it... come here post of witty
oh, that's handy
wait, that's not what I want
 
can't star it again
sucks
 
Woot, starred it back.
 
(╯°□°)╯︵ ┻━┻
why cant I star it
 
Stupid chat telling me I can't star it again.
I win.
Noooh, I lose.
Dammit.
 
:(
nice song
 
3:05 PM
which one of them?
 
And now that I unpinned it, I can't pin it again :(
 
oh sorry, didn't see it was a youtube link
and yes, it is :)
<-- R.E.M. fanboy
 
REM are ok
 
I just like that song
 
3:08 PM
well, pretty much all their more recent stuff is garbage
 
@jalf I thought you said you were a fanboy.
Fanboys love unconditionally.
You fail at fanboyism.
 
:/
Fucking BA asks for details, complains the data is wrong and won't let you fix it
 
What's BA?
 
British Airways
 
Xeo
Hell yeah. The sun's shining brightly through my open windows and I'm just sitting here sipping banana juice and eating strawberrys. I love days like this.
 
3:19 PM
"Hey juice, sup?"
^ supping banana juice.
 
Xeo
Too slow for my editing skills!
Okay, I found a downside to the sun. It's heating up the side of my keyboard a bit too much
 
sun is heating up my legs a tad too much
 
1
Q: What does the macro ((void(*)())0)() mean?

MM.The outcome of the following macro is clear: #define CRASH() do { *(int *)(uintptr_t)0xbbadbeef = 0;\ ((void(*)())0)(); } while (false) My question is, what does the line ((void(*)())0)(); break down to, in English? For example, "this is a function that returns a pointer to a...."

 
Xeo
Heh, double null-deref. just to be sure.
Oh, wait, the first one isn't
 
Why need a CRASH macro?
 
Xeo
3:26 PM
112
Q: What is the easiest way to make a C++ program crash?

jonathan topfI'm trying to make a Python program that interfaces with a different crashy process (that's out of my hands). Unfortunately the program I'm interfacing with doesn't even crash reliably! So I want to make a quick C++ program that crashes on purpose but I don't actually know the best and shortest w...

 
@Pubby to crash things
 
I like main;
 
lol
I didn't realize there was a difference between an "abstract data type" and just a "data type"
 
@Pubby /s/CRASH\(\)/assert\(0\)/
 
#define NDEBUG
 
3:35 PM
removes the asserts
 
@JinuJD wtf is this?
 
Can somewone help write my own strstr function stackoverflow.com/questions/9813572/more-strings-strstr/… ? :)
 
@Beginnernato can you stop asking us over and over?
 
@thecoshman It's bin material!
 
@thecoshman:Relax relax.
 
3:37 PM
sorry lol ..
 
Xeo
Gotta love our bin
 
@Beginnernato ah, I'm just in a cranky mood
 
JinuBin
 
Its just cause i can't think of way to search through a string, and see if another string is in that string .... I was looking at the kmp algorithm, but i dont think that will run in O(n*m) time :(
 
I don't know how much longer I can stand this job for...
 
3:40 PM
until you resign
 
@JinuJD Are you aware that dumping links into other chatrooms like that will get you nothing but a suspension?
@Beginnernato KMP usually runs faster than O(n*m).
 
actually not
 
TIL there's a string searching algorithm
 
@thecoshman: I might have missed the beginning of the talk, but what is so awful about your job ?
 
@ereOn All the shit that goes around doing anything
 
3:43 PM
@Beginnernato Start by writing a loop that checks if a string begins with another.
 
@RMartinhoFernandes I could try it but it doesnt look like something i would code, since im a beginner
 
Xeo
@ereOn It's a Java job
 
Then you loop over the haystack and check if the string from haystack + n is starts with the needle.
 
@Xeo that doesn't help either
 
@Xeo: Ouch. That would hurt me too.
 
Xeo
3:44 PM
@thecoshman I justed wanted to point out another awful thing about your job :P
 
@Xeo I wouldn't actually mind coding in Java, if I actually got to do it
 
Is it even possible to have a job where nothing sucks ?
 
@RMartinhoFernandes yeaa i have something like that but for strings with multiple similiar characeters like "abcaabe" if i wanted to look for "aa" I would loop to check if haystack[0] == needle [0] and since they do and check if [1] == [1] .. but since it doesnt i get stuck :S
 
I thought my job was fine until I found out everyone was afraid of exceptions and had even modified new to behave like malloc() instead of throwing.
 
if I didn't owe money, I wouldn't be staying here
 
3:47 PM
@ereOn So basically like new (std::nothrow) T()?
 
@Beginnernato Write the first part I told you to.
 
@Konrad: Some specific Microsoft solution.
 
@ereOn Oh boy, they not only want stupid semantics, but also reinvented them.
 
@Konrad: They link with some library... (its name has fallen out of my head right now)
Anyway, nobody told me that until I found out on my own. At the time, my project was almost done and obviously, I was never testing for a NULL return
 
3:50 PM
Hm, that sucks, yes.
I mean, there are actually legitimate uses of such strategy (hence std::nothrow) but not pervasively like this …!
 
The worst thing is : even if I could convince them to restore the usual behavior or use explicit std::nothrow, obviously nobody wants to change all his code back.
 
@RMartinhoFernandes ideone.com/KGdDj ?
 
@ereOn Could you not define a nonothrow? checks for null and throws std::bad_alloc if so.
 
@Konrad: Yes absolutely. It can make sense in some cases. But as it states, this behavior is hidden and enforced everywhere.
@CheersandhthAlf: Well I guess I could. Not sure if that wouldn't be perceived as a "crazy hack".
Remember that, in my job's world, exceptions are the devil.
 
@Beginnernato check my answer to your question
 
3:54 PM
@thecoshman Thanks i'll try that
 
@RMartinhoFernandes I think MFC is still based on no-throwing new. But one has to keep in mind that MFC had exception support in the early 90's. And RTTI. All macro based, all before C++ got language support for it. So it's backward compatibility with a once technically advanced solution (the original name was AFX, not MFC).
Oh joy! The MVC awards are not yet decided, so I still have a chance! For free tools... :-)
Except maybe I then have to refrain from offending people. :-(
 
@Beginnernato though I wasn't sure what you want the function to return, positions of matched string, or count of matches or even just boolean match or no match
 
@CheersandhthAlf What's the MVC awards?
 
I meant MVP, sorry.
MVC was Model View Controller, I think.
 
@Beginnernato That's not what I said.
"a loop that checks if a string begins with another."
So it would say true for "close" and "closed", but false for "closed" and "disclosed".
 
3:58 PM
@thecoshman Well mainly i want it to return the string with teh first occurance of the needle, but i want to make a boolean to check if the needle is in the haystack in the first place
 
@Beginnernato sounds like you want to return the position of the first match then
 
@RMartinhoFernandes Aren't i looping through haystack till i check if needle[0] starts with it ?
@MooingDuck yeaa pretty much
 
@Beginnernato which in the example I showed you, would be i
 
@Beginnernato No, that finds an ocurrence of the first character of the needle.
 
This must be one of the most WTF codes I’ve seen in quite some time
0
Q: convert serial finite difference time domain code into parallel version

user1285136Finite difference time domain is an algorithm for simulating electromagnetic waves. I write a serial code and for decreasing the runtime I want to write it in parallel form.I did it but my code has two problem: 1)because each processes has the whole simulation stuffs the amount of memory that my ...

 
4:05 PM
@RMartinhoFernandes Ohhh... use a loop and iterate like haystack++ ?
 
Interestingly, the one asking the question doesn’t seem to be an idiot – at least the maths here is quite advanced. But the code is completely unusable.
 
Oh, a triple star coder!
 
Wow, three stars. I don't think I've even done more than two.
 
watching a documentary about overweight people and fat
 
While we’re at puerile humor, I currently execute the command !bj every few minuts on my command line
… which in turn executes bjobs
 
4:10 PM
makes me so hungry :P
 
@KonradRudolph What does that do?
 
hi everyone
 
@RMartinhoFernandes makes honey
 
man bj if you're not afraid of being gay
 
@RMartinhoFernandes It’s an LFS cluster command to list the currently running jobs from the job queue
 
4:13 PM
any1 knows automatic makefile generator?
 
I think it’s similar to qjobs on qsub systems
 
:3034611 while (*haystack != *needle || *haystack != '\0')
   {
    haystack++;
   }
 
I need something VERY simple
 
@NahumLitvin Premake
 
@Beginnernato That's the same.
 
4:14 PM
To be honest, I find writing makefiles myself the simplest. CMake for instance is horribly complicated, albeit powerful
 
@Beginnernato did you actually read over my answer?
 
I turned a 300 line CMake into a 100 line plain makefile. CMake sucks.
 
@thecoshman i did ... I'm string Martinho method first ? :S
i;M TRYING*
 
ahhh I hate no gui stuff
 
@NahumLitvin funny, I hate gui stuff
 
4:16 PM
@Pubby Unfair comparison, the CMake-generated Makefile was probably thousands of lines long, so the CMakeList.txt was short by comparison! ;-)
 
dame you all C programers!
windows rulez
 
@NahumLitvin :O C++ I think you'll find
 
@NahumLitvin Uh, wrong chat, no C programmers here
 
Trolling?
 
erm
yeah
just noticed
 
4:18 PM
@RMartinhoFernandes how would i check if a string starts with another ? I'm not familiar with checking of the whole string starts antoher string ... I've just been comparing characters so far :S
 
@NahumLitvin also, pretty much every language works natively with command lines, but most have bits for GUI stuff. I don't think C is that related. Laziness is.
@Beginnernato check each character one by one. if they don't match, stop. If either is zero, stop.
 
welll yes
 
@Beginnernato You compare character 0 from one with character 0 of the other, character 1 of one with character 1 of the other, ... and so on, until one of them ends, or they're different, whichever happens first..
 
I am very lazy
 
@Beginnernato if(haystack[0] == needle[0]){ // strign start the same }
 
4:19 PM
wrote a whole ansi C project in MSVS2010
but they demant it to work on linux
so now need to create a makefile somehow
 
@thecoshman That's not a test if one string starts with another.
 
I doubt it was ANSI if it was on VC
 
@NahumLitvin so write portably, and test with MinGW or cygwin.
 
it is, passsed gccc --asni -strict -pedantic -Wall
on first try
 
@RMartinhoFernandes -_- oooh, I think I miss read what he was exactly ask here :P
 
4:21 PM
@NahumLitvin I dunno anything about makefiles :(
 
but didn't need to write a makefile so far, and eclipse won;t give me one I can understand
@Mooing me too
 
@NahumLitvin so why do you need one now?
 
@NahumLitvin Did you try Premake? All you really have to is list the directory of the source.
 
@PubbyOK gonna try it
 
@MooingDuck I wrote an introduction in my blog a few years ago. It's in Portuguese, though, so you can't go there and laugh at my mistakes.
 
4:21 PM
got a hebrew version maybe?
 
makefiles are not that hard to get to grips with
not the nicest though either
 
int i = 0;
 while (haystack[i] == '\0' || needle[i] == '\0')
   {
    if (haystack[i] == needle [i]) {
    break; }
    else { i++; }
   }
O_O ?
 
I took the GNU make manual on a 4 hour plane trip once. I found Skymall magazine more interesting x_x
 
if you read my answer, you would see that I clearly told you that you will need an inner loop
 
@thecoshman okay lemme try your wat
 
4:24 PM
@Beginnernato Close. The test in the if is reversed.
 
well, to solve the actual problem
 
And in the while should be with != and &&.
 
hmm
it wants premake script
 
Why are you testing if it equals \0?
 
The loop you have there only test if the start the same, you need two loops to find if the needle string is in the haystack string
any way, best of luck, I am heading home now
see ya
 
4:26 PM
@thecoshman alrite thanks for ur time :)
 
@thecoshman they're working on a variant of strcmp at the moment, as a sub-component of strstr. Your comments in that context might be misleading to the poor guy.
@Beginnernato do you have an IDE with a debugger?
 
> Actually, now that you mention it, since this template function must also be in all TUs, that makes this a very silly solution. – Mooing Duck 20 mins ago
lol
 
@MooingDuck I'm on a linux ? O_O ..
 
@Beginnernato so do you have an IDE with a debugger?
 
I need to write a "How to wet your toes on gdb without blood involved" post.
 
4:32 PM
@MooingDuck i doubt it
@MooingDuck All i have is valgrind ?
 
@Beginnernato you should download eclipse or netbeans then. They make writing working code so much easier.
 
You're very likely to have gdb installed.
I heard QtCreator is good. Code::Blocks is also mentioned from time to time.
 
@MooingDuck Oh really, ? arrite ill look those up
 
gdb is possibly the most powerful debugger, but I have no idea how to use it. IDEs tend to have buttons and be really easy to learn.
 
@MooingDuck I'm far from an expert, but I really need a link to drop in comments on beginnner's questions.
(Also, I'm pretty sure I'll learn a lot just by researching for such a post)
 
4:35 PM
@Beginnernato they let you edit multiple files at once with syntax highlighting and other goodies made especially for coding. You press a button and it compiles and runs, or clearly shows errors. You can also set a line of code as a "breakpoint" which causes it to stop at that line and show you every detail of what your code is doing and how it works. It's essential for programming.
 
Xeo
19
Q: c++ optimize array of ints

a432511I have a 2D lookup table of int16_t. int16_t my_array[37][73] = {{**DATA HERE**}} I have a mixture of values that range from just above the range of int8_t to just below the range of int8_t and some of the values repeat themselves. I am trying to reduce the size of this lookup table. What I h...

Wow, pretty nice answers in there
 
@Xeo I helped!
 
Xeo
62
Q: The Terms of Service prohibit editing other users' content

sharptoothThe second paragraph of section 4 of the Stack Exchange Terms of Service, "Restrictions," reads: Under no circumstances will Subscriber use the Network or the Service to ... (d) post any false, inaccurate or incomplete material or delete or revise any material that was not posted by You. Th...

AHAHAHAHA
 
lol
> @Pekka: Excellent! Sounds like All v All case is on the way. – sharptooth 7 hours ago
 
@Everyone. Is any research/review/survey paper which talks about the difference between Fortran and C/C++ for matrix/array based programming? I have read a lot of information on SO and SciComp but everything is anecdotal. Has anyone published anything as yet? (P.S. I didn't post this as a question since I believed it would be flagged off as duplicate)
 
4:41 PM
*Void where prohibited.
 
Hi guys!

Does exist some stuff for pure c ( not C++ ) , which is like templates in C++ ?
 
OK! It's normal questions, not trolling. I just want to do the same in pure C, in what way should I do this in pure C to emulate template in this language?
 
Xeo
You can't
 
@Xeo Hey, did you notice that if you click the up/down vote arrows on meta, the number flashes?
 
Xeo
4:43 PM
You can't overload in C, which rules templates out.
@RMartinhoFernandes Doesn't for me
But I noticed the popup when downvote-testing just now
 
Hey, it stopped working!
@Xeo What popup?
 
Xeo
Also, C is outdated as fuck, even if it got a 2011 standard.
@RMartinhoFernandes Just downvote something
 
This is getting weird.
@Xeo I did.
 
@Xeo But overloaded function is some mechanism too? which is in C++? so, what is the solution to emulate it in pure C?
 
How come I can't find a C11 support table for GCC?
 
4:45 PM
Overloaded functions can be emulated in C11 with _Generic.
 
Oh hey, 4.7 released today.
 
Xeo
@user1131997 In C, overloading is emulated with different names, aka no overloading at all.
 
for example , to emulate RTTI in C is the way with creating some hash-table, which will be always in memory, right?

So, maybe there are always some ways to emulate such stuff, which doesn't exist in C, but exists in C++
 
@LucDanton Oh, damn, I just lied in a comment then.
Anyway, this means I no longer need to have any qualms with using aliases all over my answers.
 
@Pubby Who'd want to support C?
 
4:48 PM
@user1131997 for "templates", you have to write the function different for each type you want to use. Also, because C doesn't have overloading, each has to have a different name.
 
Xeo
@RMartinhoFernandes Clang had aliases since 3.0, non?
 
(possibly. R Martinho mentions _Generic which I know nothing about)
 
@Xeo I couldn't post lambdas and aliases together (no released compiler had both features).
Now I don't need to think about it.
Just post.
So, when is Clang 3.1 coming out?
 
Xeo
dunno
 
I'm going to give -Wzero-as-null-pointer-constant a go.
 
4:51 PM
Does that force nullptr?
 
Oh, awesomez.
> Improved scalability and reduced memory usage. Link time optimization of Firefox now requires 3GB of RAM on a 64-bit system, while over 8GB was needed previously. Linking time has been improved, too. The serial stage of linking Firefox has been sped up by about a factor of 10.
 
Oh look, either false positives (how would that be possible?), or errors that point out at the site of use rather than the instantiation that triggered the error in the first place. Not sure if I can -isystem my way out of thise.
Oh god the horror default arguments trigger the warning.
 
Makes sense. If you don't want to use 0, you don't want to use it anywhere.
Oh, wait.
Third party code may use it without you having problems.
 
Can't have SCons bail me out via -isystem apparently :|
 
> G++ now properly re-uses stack space allocated for temporary objects when their lifetime ends, which can significantly lower stack consumption for some C++ functions. As a result of this, some code with undefined behavior will now break:
Serves them right.
 
Xeo
4:59 PM
Sounds like GCC had some huge improvements towards efficiency
 

« first day (523 days earlier)      last day (4430 days later) »