« first day (760 days earlier)      last day (4183 days later) » 

5:01 AM
I demand a legion of virgin goats.
 
t = shuffle(u) if the sizes are exact and there's a permutation available, t = match(u) if the sizes are different?
 
I have a question about recursion...
Say you did a function like so:
int blah() {
doStuff();
sleep(1000);
blah();
}
Would that stack overflow, or would it go forever?
 
Xeo
Depending on compiler optimizations, you might just get an infinite loop
 
> (branches are permanent and global, did you want a bookmark?)
This is new to me. I can't find anything relevant on the interwebs. Is this a case of FUD? Is there a better alternative to a branch?
 
user1357851
@Xeo people usually don't do it that way. The usual way is:
 
user1357851
5:07 AM
while(1)
 
user1357851
{
 
user1357851
doStuff();
 
user1357851
sleep(1000);
 
user1357851
}
 
But would it be popping blah off of the function stack every 1000 milliseconds, thus making it never overflow?
 
Xeo
5:08 AM
Yes, that's what the compiler might optimize it into
@Crowz Why would it do that?
You either have infinite recursion and a stack overflow at one point, or you get a tail-call-optimization and have an infinite loop.
 
Oh I'm just wondering... it would overflow, or it wouldn't?
 
Xeo
Either way is bad, so fuck it.
 
@Xeo TCO is fine.
 
Okay, is there a way, outside of openGL, to make a program that does something every 1000 milliseconds until the program closes?
 
Xeo
@LucDanton I don't think unconditionally recursing infinitely in the source is fine
@Crowz Threads?
Or just cooperative multi-tasking?
 
5:11 AM
@Xeo Well where you do you want your unconditional recursion to take place then?
 
Xeo
And what does OpenGL have to do with this?
@LucDanton Nowhere. :)
 
You suck.
 
Because OpenGL has that syncronized display function that does the display, right?
 
Xeo
Oh hey, LWS is atleast half-way back
Now I get a white page with "error".
 
Can't say I'm super enthusiast at the idea of Mercurial bookmarks.
 
user1357851
5:16 AM
My life mission is to feed backyard birdies until they are all obese :x ... I sound so evil @_@
 
Oh well, time to make some eats.
 
I'm exceptionally ashamed of having to ask this question, but...
 
.... Does anyone know a Java IDE? <_<
 
Netbeans, Eclipse
 
user1357851
5:19 AM
Eclipse, it is free
 
.... Yerp. My fears confirmed. Back to Netbeans. ;~;
 
I have an answer with 15520 characters...
 
user1357851
or Vim if you use Linux
 
user1357851
:x
 
@ThePhD Eclipse > NetBeans.
 
5:20 AM
Fine, I'll use Eclipse then.
 
soo why do structs exist when a class can do the same thing using public:
i'm not seeing a difference between them
 
@Dave Backwards (Sideways?) compatibility with C.
 
so should i just stick to classes?
 
Xeo
@Mysticial 8340 is my longest. :s
 
Doesn't matter.
 
5:21 AM
@Dave Because structs existed back in C. In C++, it's mostly a matter of style.
 
@Dave structs have the feel of being POD structures.
 
And my shortest answer has an embarrassingly large number of upvotes.
 
ok well classes seem to do the job fine so ill stick to it for consistency purposes
 
I use structs when it means I'll have to type less (essentially, if I have no private members, then I go for structs).
 
Interesting... that query includes deleted answers.
oh awit
Haha, you're deleting them.
Don't delete more than 4 a day
 
Xeo
5:23 AM
I know.
 
There's a 30k character limit for posts.
I can't believe I've hit half of that... lol
 
Xeo
Which answer was it?
 
flops
That answer doesn't seem that long. But the code is pretty dense.
 
My longest answer is a 1900 character answer that I'm slightly ashamed of now, because I recommend using new and delete in it.
(I always confuse "answer" and "question" for some reason)
 
new and delete aren't that bad.
 
5:26 AM
Looks like a third of my answers are 1000+ characters.
 
At least, not unless you make a dedicated memory manager/allocator for everything you're doing.
 
Skeet's longest is 13k.
 
Xeo
@ThePhD They are most of the time, if written explicitly in source text.
 
;c
Well, unfortunately for me, new and delete are everywhere in my engine until I create my Free-Function memory manager.
I think I have to make the... um.... what's it called...
When free-functions can be overridden by source code written after it...
weak ?
weak function references, I think.
 
Xeo
just overload with a tie-breaker...
No need for linker-specific stuff.
 
5:35 AM
overload new ?
 
Xeo
template<class T> void f_helper(long /*tiebreaker*/){ /* actual functionality */ }
template<class T> void f(){ f_helper<T>(0); } // will select f_helper<T>(int) overloads if available, else f_helper<T>(long)
 
Ugh, I hate not spending time in here, since whenever I do have that off question, I feel like I'm a help leech.
 
Xeo
heh
Ask away.
 
However, I do have a rather odd question, can enum's have functions?
 
Xeo
nope yes, free functions
 
5:39 AM
Damn.
 
Buahahahahaha, my PNG loader is the done.
 
Then static functions it is!
 
Xeo
@Drise See edit. :D void f(my_enum e){ ... }, aka C-style OOP
Why static?
 
class Card
{
public:
  enum Difficulty {EASY, NORMAL, HARD};

 static Card::Difficulty GetDifficultyFromString(std::string diff)
  {
    if (diff == "Easy")
      return EASY;
    else if (diff == "Normal")
      return NORMAL;
    else if (diff == "Hard")
      return HARD;
  }
}
Things like that
My other one is probably going to be GetIndexFromDifficulty
 
You mean, (int)difficulty ?
 
5:42 AM
/media/Storage/StudyBuddy/Card.h:60: error: invalid conversion from 'int' to 'Card::Difficulty' [-fpermissive]
 
GCC. =l
I really hate GCC's way of handling errors and warnings.
 
I never did try an explicit cast though.
 
Oh.
Then nevermind, be explicit first.
 
Also, I'm working with people who don't regularly use C++, so I'm trying to be as verbose as possible while maintaining some sort of dignity.
 
Still, one thing that's always irked me about GCC:

struct Vertex {
Color Color; // ARGGH WHAT'RE YOU DOING (GCC Explodes) // No problem in VC++ ...
};
It means I have to british-ize all my simple colors and stuff.
 
5:44 AM
@ThePhD I'd prefer GCC's response, honestly.
 
struct Vertex {
    Color Colour; // Fish and Chips, anyone?
};
 
Camel Case man, camel case.
Color color; Color myColor;
 
I"LL NEVER USE CAMELCASE AGAHGAHG Table-flip.
I guess it's really just a bad thing I've developed from using C#.
Color Color; just felt so natural and easy to write.
 
I use camel case because I can ctrl-backspace and ctrl-arrow through the individual words.
 
My control-arrow is far more aggressive in Visual Studio for some reason.
Shit consumes all the whitespace -plus- the rest of the first word it encounters.
 
5:47 AM
Which I've found myself using more and more, and windows always adds a ctrl-backspace character, instead of actually deleting a word.
WHY WINDOWS?!
 
itreallydoesn't workoutforstuff     ; // Hit Ctrl + Backspace before the `;`, nuke workoutforstuff and the spaces
 
I've started on the path of hating windows development more and more
 
Yo windows is pretty cracked out, man.
I dunno what editor you're using.
 
Shit, on linux, My program works just fine. But when used on Windows, I get an occasional segfault that I can't reproduce in linux.
I use Qt Creator.
It's still as bad on Windows.
 
I've never gotten around to using Qt* anything. I should probably do that. Exposure and all.
 
5:49 AM
I find it fun, and if you know .Net, a lot of it transfers pretty seamlessly.
 
... Bahahahahahahahahahaha
My god
My PNG loader sucks the biggest dicks.
 
And having a decent cross platform GUI framework (that isn't a nightmare to subclass) is a plus.
Why you build new png loader?
Aren't there like a thousand of those?
 
lol hey @billz
 
Shit, I bet Boost has one too.
 
:D hey Dave
 
5:51 AM
even internet explorer, nowadays
 
i replied regarding your Q
 
@Dave I see it :D
 
Alright, so I'm completely done: dl.dropbox.com/u/17644642/ADonePNGLoader.png
Look at that amazing loading. I get photoshop noise filters for free. :3c
 
Trippy.
 
5:53 AM
woah whats going on there
 
I once tried to send bmp's over UDP. Shit came out pretty similar.
 
@Dave Seeing the sounds, man. Seeing the sounds.
 
for a moment i wandered what was in this bannana i was eating
 
@Dave So... many.. errors. Must... resist..
 
it's 5am im allowed to make errors
 
5:55 AM
It's been 9 am after being awake for 36 hours, and I still had perfect grammar. No excuse, my friend.
 
Pure 100% Non-GMO Banana, I'd wager.
But you have to be careful to ensure your Banana is Organic
 
GMO is not as common here as america
 
Anyhow, I'm going to put my cattle prod away and continue my miserable school project in C++ and Qt for a course on Java and Swing.
 
The PNG standard's wording is throwing me for a trip.
 
@Drise my excuse is I don't care
 
5:59 AM
As per the PNG wording it tells me:
For all x < 0, assume Raw(x) = 0.
To reverse the effect of the Sub() filter after decompression, output the following value:
Sub(x) + Raw(x-bpp)
(computed mod 256), where Raw() refers to the bytes already decoded.
But which bytes, PNG standard? WHICH BYTES?!
The ones decoded out of the zlib stream you love to masturbate with, or the bytes you make me unfilter? Huh? HUH?!
 
have u googled the question :P ?
 
A million times. And you know what everyone tells me?
 
i think i can guess
 
'Just use libpng its really ez'
 
ah that reminds me of the days i was in the javascript room.. just use jQuery
 
6:00 AM
@Dave Is pressing the shift key every so often, and adding two extra characters (ou) that difficult at 5AM?
 
no it's not difficult
 
@ThePhD Does Boost not have your needed code?
I thought Boost had everything
 
@ThePhD perhaps you can look at the code for libpng and see how its done then implement it yourself?
 
@Dave Library writers ensure that their C code is the most unreadable, underscore-laden garbage in the world.
 
ah
 
6:02 AM
With complex enum names that aren't really english, but mashup of consotants they decided would be important to have
All uppercase
with more underscores.
 
yuck uppercase
 
user1357851
Arrrgh, I am so retarded, I was going to copy something from my Mac, so I plugged the USB drive on my window's PC.
 
ONTOPOF_MYCODEBEINGSHITTY v;
better_get_used_to_it( &v, I_WILL_ALSO_YELL_AT_YOU );
 
You have a mac... thats why :P
 
user1357851
then I wondered why I did not see the drive on my Mac
 
6:05 AM
thinking of it - i've never used a mac ever.
 
What's even better is that their comments actually attempt to make it seem like you understand what the hell they're writing in the first place.
 
ummm
there is deffinately something in this food im eating...
 
user1357851
 
6:25 AM
okay what is wrong with this :

std::stringstream button = "Button" << checker << "_x"; i get expression must be integral or enum type ?
checker is an int datatype btw
 
Xeo
std::stringstream button; button << "Button" << checker << "_x";
 
oh so no assignment o_0
 
Xeo
What is "Button" << checker << "_x" in isolation? An error. :) Can't initialize a stream from an error.
 
so how does it interpret the datatype of button at that point ?
same as a std::string ?
doesn't seem to like me using button in my map
oh i got it ^_^
 
Cool, Poco has a JSON library now.
 
user1357851
6:35 AM
Json is a subset of XML
 
Uh, yeah whatever.
 
@Telkitty Presumably you mean JSON's capabilities are a subset of XML's? JSON itself isn't (even close to) a subset of XML -- the syntax is completely different.
 
much more practical for just passing data
 
@Cheersandhth.-Alf That would be hard to argue -- JSON is generally a lot more compact, much simpler to parse, and its representations are pretty close to basic data structures (basically structures and sequences).
 
@MooingDuck Dude there were 10 days + competition was extended 1 day :p I feel bad about your score. I warned you to solve at least 2 problems.
 
user1357851
6:45 AM
@JerryCoffin Yeah that's what I meant ... the syntax is similar ... as in tags in tags kind of organization of data
 
user1357851
Err ... I should shut up
 
@MooingDuck Your score didn't sink because of 8 failed submissions. It sunk because you took part in competition and solved less problems than average. And in Long contests number of failures don't count, it counts as 20 minute penalty in short contest. Also compilation error is never counted. If you are still interested you can submit here, as it has been added to practice section.
 
Xeo
7:00 AM
@Telkitty JSON is a subset of YAML, IIRC
That's why they removed comments from JSON, to make it compatible
 
YAML?
 
Xeo
YAML Ain't Markup Language
 
user1357851
wiki is your buddy
 
Xeo
Got the name wrong. :)
 
Oh, Yet Another Human Readable Format.
While end-user and power-user friendly, binary will always and forever more be my one and only best friend.
And things that try to mix them up, like .ppm (P4-P6) can eat a dick.
 
7:04 AM
I dare you to write a valid YAML document. It sure is easy to read, but very complicated to write.
 
I like ini files
 
I would rather saw off my left nut. With a dull saw.
 
Xeo
I want modules. :(
 
.... Who makes up that kind've complicated shit?
I know Directives is a common thing, but just append like, YAML to it or something
 
Xeo
7:07 AM
@ThePhD people who don't want define clashes.
 
Or just always append the project name to it and be creative for once in your life.
 
I once had a name conflict with an include guard named RECT_H. It was also used (by me) to indicate rect height in Window dialog editor.
 
Xeo
hehe
 
Where was the original RECT_H?
<windows.h> ?
 
The other was also defined by me as an include guard.
 
7:10 AM
Roflmao.
Well, now you know
RECT_H_{Garbage}
 
@StackedCrooked just use #pragma once
 
Apparently, seeing that Directives.h, not all compilers honor it.
 
@Cheersandhth.-Alf Really? I thought include guards were preferred.
 
@StackedCrooked by some. the ultra-conservatives. able to think up ungood ways to do things (like directly accessing source on file servers via umpteen different paths) so that Things Don't Work, and unable to think up the simple solutions.
 
@Cheersandhth.-Alf Does it work on gcc?
 
7:15 AM
@VinayakGarg why don't you check that. one way is to try it. another way is to consult wikipedia.
the former gives you higher confidence for a particular case
the latter gives you a more overall view of things
 
One way is to ask @Cheersandhth.-Alf :p
 
well yes, it works
it was deprecated in g++ for a while, i think in version 3.x. but was accepted anew when they fixed the bugs
 
But I completely agree with you. One should just try it, rather than asking someone all the time.
 
@StackedCrooked your system has some constraints regarding compilation time? By the way i'm very sorry i tried to compile template factorial code :)
 
Wow, my PNG loader is getting tripper and trippier.
If I fullscreen this I'd probably end up feeling like I'm playing Earthbound.
Goddamnit Photoshop
I want to know the RGB>>>A<<< values at the pixel, not RGB and then -nothing- for A = 0 pixels.
 
7:26 AM
@Ivan0x32 Yes 1 seconds max :/ I should probably make it a little longer though..
 
Xeo
7:45 AM
> I’ve always thought that one of the the great thing about physics is that you can add more digits to any number and see what happens and nobody can stop you.
Gotta love xkcd.
 
user1357851
8:02 AM
Tags for this room: C++, C++11,C++-fag ... & emm meow?
 
Xeo
8:17 AM
@Telkitty q != g
 
user1357851
:x
 
@Telkitty woof was superseded
 
8:43 AM
hello evry1!!
trying to make a karaoke ...what sud i use? java or c++?
 
depends
that's like asking us what cake you prefer.
 
Xeo
Woah. Now Wikipedia is getting desperate with a giant green bar in your face.
Atleast German Wikipedia.
 
I'd say wikipedia should just accept the damn advertising money.
It can be soooo much better if they had that money.
 
hi, guys. are there some tools to find out these code who eat up my memory? I'm using Visual C++ 2010?
 
I mean like fuck, if people were willing to give me money to put some (appropriate) ads on my site, I'd take it.
 
8:49 AM
anyone can help me?
i killed the room?
 
valgrind?
oh no that's Linux only
 
user image
5
 
@Triumphant If anyone is willing and able, they will.
 
@Mysticial how would having more money make Wikipedia better?
 
@Mysticial yes, you are right.
 
8:54 AM
@sehe They won't need to keep posting that annoying banner at the top.
I'd rather see computer hardware ads than that.
 
"So much better" s/annoying same banner/annoying varying banner/g <-- I totally follow
 
It's hilarious though. When I'm browsing MAL (MyAnimeList), I get ads for hard drives.
Which is sooo appropriate because the vast majority of MAL users download their Anime...
 
@Mysticial So, in fact it won't get any better, WP already optimal for you: you just want different ads. More commercial ones.
 

« first day (760 days earlier)      last day (4183 days later) »