« first day (395 days earlier)      last day (4539 days later) » 

sbi
8:02 AM
@RMartinhoFernandes hey, Amazon wrote they sent The Mote in God's Eye last night. It might even arrive today, but certainly will before I'm finished with the current book. :)
 
Cool. Soon you'll have "Crazy Eddie" in your vocabulary :)
 
I need to head off and get my mouse
bought some shitty five quid mouse and my MX518 is in the post
 
What's that? An hardcore gamer's mouse?
Seems so.
 
it has thumb buttons and on-the-fly sensitivity adjustment
and a nice shape and feel
idiot Logitech discontinued it and then decided that they wouldn't bring out it's successor for several months
I grabbed like, the last one on Amazon
 
Logitech did the same thing to their trackball line. They're going for $300 on Amazon.
 
8:12 AM
SDL is driving me mad. anyone know a good game library (2d please) , except Direct 2d bec. a lot of pcs still use xp. and it should be c++. I am tired of porting sdl's lousy api to C++.
 
I think you're out of luck.
 
@RMartinhoFernandes and be far more attentive to coffee making :-)
 
@IntermediateHacker Have you tried SFML? It's not great but it's better than SDL
2
 
you could try SFML?
 
hi
 
8:15 AM
ok then. I'll try it. thanks.
 
@sbi yep, I got a new job in August. Sup?
 
sbi
@jalf @Dead was just confusing me with someone who recently got a new job, so we were trying to rehash who recently got a new job.
 
Hmm, SFML at least is C++. But they don't use exceptions.
 
sbi
@AlfPSteinbach I drink about half a dozen cups of coffee – per year.
 
8:18 AM
I never drink coffee
 
OMG, I used to drink that like, in a day.
 
@RMartinhoFernandes i know, but at least it uses cpp classes and references instead of all those ****ing pointers
 
I'd argue that exceptions are the most important aspect by quite some distance
 
Pointers are C++ too :) No exceptions means you have to test return codes at every corner.
 
ah, well. As long as there isn't a better library, I'll have to check the return codes. :(
 
8:21 AM
hmm, sounds pretty intense in New York right now :/
 
why?
 
@IntermediateHacker you can always write an >> operator for that
 
@IntermediateHacker You can always do like some people and not check them. Then spend hours trying to find out which call is failing.
@AlfPSteinbach Ooh, sounds monadic.
I like how you think.
 
@AlfPSteinbach nice. but can u give me a simple example?
 
8:24 AM
Something like fopen("blah", "r") >> test_this_shit?
 
I see thanks.
 
And void operator>>(bool b, tester_type) { if(!b) throw runtime_error("fucked up"); }
 
oh that sounds like fun
 
sbi
@RMartinhoFernandes I used to drink like 5 liters of black tea a day. But that was 15 years ago.
 
@DeadMG What sounds fun? The operator or the protests?
 
8:26 AM
the protests
 
good thing ESRB doesn't rate open-source games. :)
 
What's the problem?
 
the problem is that my parser is consuming way too much input for some constructs, and I'm not sure why, nor how to find where the problem lies
 
@IntermediateHacker I think I maybe went a little overboard when I wrote about it. Enthusiasm difficult to stop. alfps.wordpress.com/2010/07/18/…
 
@DeadMG Maybe if you fed it better, it wouldn't be so hungry.
 
8:29 AM
@AlfPSteinbach thanks.
 
lol
 
> In the 1990’s I came up with the idea of using the C++ >> operator to transfer a function result to the exception throwing logic, said exception throwing logic embodied in some object.
I knew it! You just invented monads!
4
 
Transfer the blame! (Uh, result)
@AlfPSteinbach nice. I like ur site. u should write a book.
 
due to idea of someone here, i now dont't write (n > whatever) || throwX( "!" ), but instead hopefully( n > whatever ) || throwX( "!" )
with bool hopefully( v ) { return v; }
 
user457812
Speaking of writing, I need to write a blorg post about plagiarism and why I'm a petty asshole...
 
8:39 AM
@nil what do you mean
 
user457812
I reported a classmate for plagiarizing an email I wrote, and therefore I have decided that I am a petty asshole.
 
Plagiarizing an email?
 
user457812
Yep. Copy/pasted my email almost verbatim and used it for their own assignment. O_o
 
user457812
Wasn't even a particularly good email, but they copied it anyway.
 
8:42 AM
How did they get a hold of it?
 
how do u stop the destructor of a local variable being called when the function ends?
 
@IntermediateHacker Why would you even want that?
 
user457812
I sent the original email to my class, and then they sent their copy to the class again
 
@RMartinhoFernandes WinApi hacks etc...
 
you can't, and you should never ever want to
 
8:43 AM
@IntermediateHacker Placement new?
 
UB!
Or an even uglier hack.
You can probably do fine with a boolean member in the object and a condition check in the destructor.
 
Hello taken back :P
 
you should never want to
 
@DeadMG but with the winapi i've got to. or else my code just exits with a runtime error
 
@IntermediateHacker u can make the variable static
 
8:45 AM
@DeadMG I can think of a few select scenarios :)
@IntermediateHacker Needs more detail!
 
@IntermediateHacker No, you don't have to. If you show us the code, we can almost certainly change it so you don't have to.
 
@IntermediateHacker u can end the function via a call to abort or exit
 
@AlfPSteinbach thanks. that works
 
@IntermediateHacker u can make sure that the function never ends
 
@RMartinhoFernandes I am counting the FPS using GetTickCount() etc.
 
8:46 AM
@IntermediateHacker What? abort?
 
no, static .
 
you should really use QueryPerformanceCounter for such things
 
@IntermediateHacker And what does the destructor do?
 
@IntermediateHacker you can construct the object via placement new in a buffer
 
"The resolution of the GetTickCount function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds."
which is not very good res at all
the High Performance Timer is much more suitable
 
8:48 AM
@DeadMG Sounds good enough for counting FPS :)
Wait, maybe not.
Bad math.
 
you'll start dropping whole frames as soon as you go over 60FPS
 
@IntermediateHacker u can do function return via longjmp
 
that's not very accurate at all, for a simple 2D game which will probably run at thousands of frames a second
 
sbi
@nil When I taught, the first time I caught someone turning in someone else's work for an assignment, I gave a very stern last warning (on top of not giving any credits for that assignment) that a second offender would have to leave the course and try again next semester. I never caught a second such case in a single semester.
 
Yeah, I was thinking of microseconds.
 
8:49 AM
i think that's about it, i cannot think of more ways
 
@DeadMG thanks, QueryPerformanceCounter may be better than my current solution.
 
but back to my previous question
 
user457812
@sbi Well, person who did this is getting a warning, since it'd be really absurd to fail them or dismiss them from the school over an e-mail.
 
what the hell makes you think you need to avoid calling the destructor?
 
What "bad thing" is the destructor doing?
And if so, why is it doing it?
 
user457812
8:50 AM
If someone plagiarized one of my papers or something else that's actually important to me, I would go old testament on their asses. No resting until their education is scorched earth and in tatters.
 
@DeadMG frankly I have no idea. but when my pro::timing_engine class is destroyed it gives a weird runtime error.
 
you could save yourself a whole lot of trouble by fixing the problem with that destructor, rather than hacking around it and messing your program up even more
 
@IntermediateHacker FIX IT.
 
the longer you try to work around and hide errors, the harder they get to fix
 
well, that probably suggests that instead of simply avoiding the problem, you should actually fix it
 
sbi
8:52 AM
@nil If that email contains an assignment? Where I taught, this was handled, I think, pretty well. The students had three chances to pass a course. Getting caught they wouldn't pass that semester, effectively losing one of these chances.
 
ah, life is hard for an intermediate hacker...
 
user457812
It's something leading up to an assignment, but it's not part of the assignment itself.
 
sbi
@nil It wouldn't matter to me. You pass in someone else's work as your own, you are cheating.
 
guess I'll have to spend another half hour finding the problem and fixing it...
 
Would you rather spend five seconds creating more problems?
 
8:53 AM
if your code doesn't work, you'll have to fix it, and there's nothing you can do about that simple fact
 
@RMartinhoFernandes that's one of my favorite pastimes
 
I spend whole weeks making problems for myself
 
a problem that cannot be created in 5 seconds is not worth creating
2
 
sbi
@DeadMG You young whippersnappers! I did little else for decades!
2
 
user457812
8:54 AM
I have to go by the school's policies as far as plagiarism is concerned, and in this case it just doesn't fall under grounds for failure or dismissal. I personally don't mind this since they're still getting warned for being an unethical dipshit, plus I would probably feel bad if I got someone kicked out for copy/pasting an email I wrote when it wasn't a particularly good email.
 
@sbi lol.
 
morning
 
user457812
And as much as I would love to see someone kicked out for plagiarizing my work, I would kind of hope the work being plagiarized was something really good and not an email.
 
sbi
"Any problem that cannot be created in five seconds isn't worth creating." @jalf @ http://chat.stackoverflow.com/transcript/message/1873576#1873576
 
8:56 AM
hi
 
hello, how's things?
 
@LewsTherin (See what did there? I plagiarized your own not so good greeting :P)
 
anyone read the book Tricks of the Windows Game Programming Gurus ? It's from the Windows 98 era but its still awesome. currently reading it...
 
user457812
@RMartinhoFernandes You are totally being dismissed and exiled to the land of horrible jokes for that.
 
I closed that star as a duplicate.
 
8:58 AM
@RMartinhoFernandes He he I will have to make it better :)
 
@IntermediateHacker I sincerely doubt that it is, in fact, awesome
 
@DeadMG why?
 
@DeadMG Not even awesomely hilarious?
 
possibly because nearly everything under the sun has changed since then?
especially in games
the importance of things like concurrency and shaders was nil then and everything now
there are pretty much no libraries that were available then that are still useful now
etc, etc
 
9:00 AM
not to mention the, y'know, whole new C++ language kind of thing
 
CPUs have changed a lot too. They've gotten much faster relative to memory, so techniques that were useful optimizations then might slow you down today
 
or be plain micro-optimizations
and there are functions that were viewed as good then that are now known to be terrible
like IsBadXXXPtr
 
@IntermediateHacker does it teach you how to write games?
 
@DeadMG I know, the book uses GDI and DirectX 6. It thinks COM is a new thing and OOP is the greatest thing on earth. It hasn't even heard of templates etc..... but it's still awesome.
 
9:02 AM
funny ad for organ donors
 
@DeadMG Crap, that was considered good once?
 
@RMartinhoFernandes They're all over Microsoft internals. They were written and used quite a bit.
@IntermediateHacker No templates = no awesome.
then everyone discovered that they suck tremendously
 
Some mindless jerk flagged that ad for the organ donation foundation.
 
I think it's a hilarious ad
 
by the way. COM has the same language independant philosophy and is almost as stupid as .NET, could they be related in anyway?
 
9:06 AM
yes
.NET was supposed to be COM's successor, or something
 
Well, for the mindless jerk that flagged it, here: reborntobealive.be Why don't you complain directly to the authors?
 
they are very closely related and the CLR can interact with COM very closely
 
I don't see a flag
 
it was "invalid"ed away
 
Does anyone know why running a .jar file for the first time takes while to load? Is it because the JVM is translating interpreting the .class files?
 
9:07 AM
ah
ohhh Java, RUN!
 
1
Q: Optimize this function (in C++)

Jakub M.I have a cpu-consuming code, where some function with a loop is executed many times. Every optimization in this loop brings noticeable performance gain. Question: How would you optimize this loop (there is not much more to optimize though...)? void theloop(int64_t in[], int64_t out[], size_t N) ...

 
run away like a scared pussy!
 
@TonyTheLion No! Java doesn't bite
@DeadMG lol
 
@LewsTherin It does- it bites the mind.
 
9:08 AM
@LewsTherin Shoggoths don't bite either. I'd still run.
 
@RMartinhoFernandes Ah, wish I understood the reference. I'm yet to read the book :)
 
criticising java... the reason I starred this chat room. :)
 
@IntermediateHacker Screw you lol
 
Java sucks really quite tremendously
it's almost impossible to imagine a language which would be worse
I'd seriously consider using Perl or PHP instead
 
9:10 AM
@DeadMG why? I don't know why it sucks really.
 
@DeadMG u haven't heard of Euphoria have u?
 
@DeadMG They're different languages compared to Java :S...
 
@IntermediateHacker Is that esoteric? Doesn't count.
 
then I agree. Java sucks the most.
 
@LewsTherin Because it enforces only one coding style and only one way of doing anything?
 
sbi
9:11 AM
Highest-voted comment: "Holy shit, what did I smoke?" – youtube.com/watch?v=jX3iLfcMDCw
 
You must use the GC. You must use inheritance to solve every problem. You cannot overload operators. You cannot create anonymous functions.
 
@LewsTherin > It was a terrible, indescribable thing vaster than any subway train—a shapeless congeries of protoplasmic bubbles, faintly self-luminous, and with myriads of temporary eyes forming and un-forming as pustules of greenish light all over the tunnel-filling front that bore down upon us, crushing the frantic penguins and slithering over the glistening floor that it and its kind had swept so evilly free of all litter.
 
It stifles the mind
 
@sbi On youtube? That's not surprising.
 
I don't know why Android chose Java...
 
sbi
9:12 AM
@RMartinhoFernandes Especially not, when you have watched the video.
 
@RMartinhoFernandes WHAT! It kills Penguins? Hell to Java! But what do you mean "was"?
 
@LewsTherin That scene was in Antarctica.
 
@RMartinhoFernandes Are Shoggoths extinct now?
@DeadMG I have no idea what that means yet.
 
well
 
I'm not sure how I'm supposed to answer that.
 
9:13 AM
in Java, can you write a lambda?
no, you have to use inheritance and Listeners and that bullshit
or how about operator overloading?
 
@DeadMG Anonymous inner classes!
 
@DeadMG Javascript can use lambdas... that's weird
 
it's not like the language can't do it
 
and Generics are actually deprecated .
 
they chose not to have it
because some moron decided that since some people couldn't do it right, nobody should have it
 
9:14 AM
@IntermediateHacker Er, no they're not.
 
@DeadMG Oh right...
 
and they chose not to add delegates bec. they wanted java to be kept as simple as possible
 
I confess I find it easier than C++. I don't get headache when programming, and I finish my assignment like a Flash. :)
 
that's why Java sucks
 
@DeadMG Because it is easy to program with ? lol
 
9:15 AM
if you have the slightest bit of intelligence, it's easy to conceive of an idea that Java banned because they thought you were too fucking stupid
 
@DeadMG They were right ;)
 
no
no, they weren't
if you can't cope with lambdas, nobody is forcing you to write them
but preventing us other people who are smart enough to deal with it from using it is a bad thing
 
in short , Java was made for stupid people, hence people who use java are .... u get the point.
 
@DeadMG Meh, I don't see how lambdas are hard to use.. Not all that different from anonymous classes
 
@DeadMG I don't agree to that either. If they're in language, you have no business using it without understanding them.
 
9:18 AM
@LewsTherin I never said anything about lamdas...
 
no
 
@IntermediateHacker I know I was adding it to the statement. oops sorry.
 
a language should allow everything it can feasibly implement
and people should use everything they can feasibly understand
the two sets have no obligation to line up
how many people use C++ without understanding the intricacies of SFINAE?
probably an awful lot, but it works out just fine
 
@DeadMG There's the fact that what someone can feasibly understand is not the same for everyone.
 
that's why languages should allow more, not less
to accomodate everyone
 
9:20 AM
@DeadMG what exactly is SFINAE? guess I'm one of the afore mentioned people
 
And that leads to stupid teams and coding standards forbidding certain features because someone cannot understand them.
 
better stupid teams and stupid coding standards than stupid languages
what you're proposing is making every user of a language into a stupid team member
 
I don't see much difference. You can't use all the power you can handle in either case.
@DeadMG No, I'm proposing not catering for stupid team members.
Educate them instead.
Make them smart team members.
 
which is exactly what would happen in a hypothetical language that allowed much more than stupid people could understand
 
if only i was educated...
 
9:22 AM
because they would have scope to grow without having to learn a whole new language
 
Or they'd cripple everyone by whining about how they don't understand it.
 
that's the time at which you stop trying to educate them and just fire them instead
 
Even worse if said people are in a position of authority.
 
nobody can protect you from stupid people, and nobody can protect you from having to work for stupid people
all you can do is allow those people who aren't crippled by other idiots to grow and do what they want
 
I'm not advocating making languages less powerful.
I'm against "if you can't cope with lambdas, nobody is forcing you to write them"
If you can't cope with lambdas, you will have to.
2
 
9:25 AM
well
the language isn't forcing you to write them
what your team members/company/coding standards say is, well, not the language's concern
 
27 secs ago, by R. Martinho Fernandes
If you can't cope with lambdas, you will have to.
I disagree
 
@IntermediateHacker How do you expect to understand my code?
 
If u can't cope with lambdas , it doesn't necessarily mean u have to learn them.
 
@DeadMG Ah, sorry, I misunderstood you then.
 
just read code that doesn't use lambdas.
then when i eventually learn lambdas, I read ur code.
 
9:26 AM
You don't pick what code to read like you pick a book.
You read the code your coworkers wrote.
@IntermediateHacker Ah, so you eventually cope with it.
Like I said.
 
in any case
I fully believe that it's the job of the language to permit everything they can realistically implement
 
@RMartinhoFernandes guess I agree then. :D
 
That's different from: "Joe can't do lambdas Lambdas are complicated, so we don't use them".
Ok, seems like everyone is agreeing with everyone then :)
A happy ending.
 
and if a company, or an individual, feels that they're too fucking stupid unable to cope, then that's their decision
 
I hope everyone agrees that Java is stupid.
what exactly are Multi-threaded Low latency servers ?
 
9:30 AM
Servers with multiple threads, and low latency.
 
my uncle develops them for the American Bank in Singapore.
why would a bank need them?
 
to serve it's customers and transactions
 
... with low latency.
:P
 
So does anyone know why it takes while for .jar to start for first time? I'm worried I'm doing something wrong. But after it starts pretty fast.
 
i don't get it. all the banks I've seen just use a normal network with something like Windows Server 2008
 
9:33 AM
@LewsTherin It's normal.
The second time around, stuff is cached.
 
@IntermediateHacker because high frequency trading relies on near-zero latency
 
@LewsTherin it's the same with every JIT compiled language
 
Ah cool, thanks :) ... was worried there.
@IntermediateHacker Does Java use JIT? Thought it was C#
 
If you're going to sell stocks you bought 0.04 second ago because it's now worth 0.2% more, then extremely low latency is pretty essential
@LewsTherin sometimes
 
I see, guess there is still market for C++ developers it low latency servers development then.
 
9:34 AM
@LewsTherin Since 1.3 or thereabouts, it does.
 
@IntermediateHacker absolutely
 
@jalf @RMartinhoFernandes I didn't know that, great I guess.
 
depends on the VM implementation, of course. Suns/Oracles/whoevers JVM initially acts as an interpreter, iirc, and then when a piece of code has been executed sufficiently often, it is JIT'ed
 
@jalf Are the .class files interpreted only once then?
Or it just optimizes..
 
@LewsTherin no clue :)
 
9:38 AM
@jalf lol great answer :)
 
but basically, there's a tradeoff because JIT'ing code takes time. The JVM won't do that unless it knows that the code is going to be called often enough to make up for that lost time
a function will probably have to be called a few hundred thousand times at the least before it gets JIT'ed
of course, the .class file is only loaded once, though
 
@jalf Yeah. So if it sees which piece of code executes regularly it may do an optimization.
 
There, dished a slew of downvotes all over this: stackoverflow.com/q/8133403/46642
 
How can you measure the execution time of a loop? Without using all that timers crap. Isn't there an inbuilt way>
 
How do you expect to measure time without some sort of clock/timer/whatever?
 
9:46 AM
@RMartinhoFernandes I've been using that..but isn't there some other way?
 
@LewsTherin For serious business, you run your code under a profiler.
 
@RMartinhoFernandes I assume this profiler isn't free...
 
What kind of "free" are you talking about?
Money? Performance?
 
@RMartinhoFernandes No I mean do you have to buy a Profiler, or can you just download it..
 
Like everything else, there are commercial profilers, and non-commercial ones.
 
9:49 AM
I will try and find one to download thanks.
 
Valgrind is popular on Linux.
Some versions of Visual Studio have a builtin profiler too.
 
@LewsTherin measuring execution time without a timer? That's tricky. I guess you could leave it run while counting out loud yourself
If you want to know how much time is being spent where, a profiler is a nice tool to have. If you just want to know how long X takes, just put a timer around it in the code
 
@jalf lol
 
@LewsTherin it's a couple of lines of code to use one of the built-in timing functions
 
@RMartinhoFernandes It is for Java..
@RMartinhoFernandes I will try and get that
 
9:56 AM
@jalf It could be argued that that's just using a meatbag timer.
 
How does one know how to optimize code?
 
@LewsTherin Maybe there's something for Eclipse (there's all kind of plugins for Eclipse, I'd be surprised to find no profiler)?
@LewsTherin First step is to know that you need to.
Then it helps to know what's worth optimizing.
 
@RMartinhoFernandes There is! Cool :D
@RMartinhoFernandes I don't know, I just assume it needs it.
 
You can probably optimize many things in your code, but not all will pay off the effort.
 
@LewsTherin by understanding your code, and the environment in which it runs. Are we talking about low-level optimizations, or general algorithmic stuff?
 
9:58 AM
 
@RMartinhoFernandes I suppose it might be different on OS
 
@LewsTherin it's mostly the hardware that makes a difference. Windows or Linux doesn't really matter for the most part, but different CPUs have different performance characteristics
 
@jalf I know what my code does. I just don't know if it is efficient. Kinda algorithmic, yeah pretty much
 

« first day (395 days earlier)      last day (4539 days later) »