« first day (553 days earlier)      last day (4621 days later) » 

00:10
You should write a native Brainfuck compiler.
That optimizes.
Somehow.
00:28
#define sizeof(x) rand()
4
Well, I finished the D3 beta. Took about two hours.
I don't think so.
01:05
@jalf I rewrote my test using only C++ standard libraries. On Mac using GCC 4.7.0 it produces a segmentation fault.
I'll also test on Linux.
It's the same on Linux.
Unless my test is buggy.
@Maxpm Won't compile if the code relies on sizeof(x) as a compile-time constant.
Aw.
Laaaaaame.
01:24
#define true rand()
Hey guys I have a quick question, not sure if I need to make a SO question for it: My code seg faults on Macs but not on a Linux machine -- what would cause this?
@JamesRoseman Undefined behavior, generally.
It means there's a bug in your code, it's just that it goes silently on Linux, but not on Mac.
Yeah.
01:40
@EtiennedeMartel Took me less time.
the Wizard is more fun than the Demon Hunter, really
the DH has no AoE damage skills and they're essential in the beta content
I played WD. Great crowd control, I just dump stuff on the battlefield and watch things die.
the DH had some pretty good CC
you could leap around and slow things down
but no AoE actual damage
not like the Wizard, who got this giant glob of hurt you could lob at groups and watch them melt
Yeah, the DH seems good at taking down priority targets quickly.
anyway
time to sleep for me
02:02
@EtiennedeMartel, so memory leaks? I've tried gdb (told me little), is there anything else I can do to "fix" this undefined behavior?
@JamesRoseman Memory leaks are not the issue.
You're probably trying to access some part of memory that you don't have the rights to access.
Are you playing with pointers?
Yeah, heavily.
But it compiles perfectly on Linux, it's frustrating.
Also, I have a lot of classes, so posting code may not be feasible.
And, as an update, I just commented out everything in main except for 'return 0' and it seg_faulted...
Back, it worked now without anything in there.
Seems to be a problem with my hash table...
@ScottW Ha.
@JamesRoseman It compiled perfectly on both platforms. I suggest stepping through it with a debugger.
Or couts, if that's your preferred method.
02:18
Hahaha I didn't even think of that
What debugger, I can't put "couts" in places.
Every time I comment something out it tells me that something else is the problem.
God this is frustrating. It's for a CS Project for school that's due in two weeks. Thought I'd "start" last night and ended up coding for 4 hours, put in another 4 hours today and got it flawless on the Solaris machines, and now that I'm home for the weekend trying to work on it it won't compile!
Haha
user34537
@JamesRoseman: Have you tried valgrind on linux?
@acidzombie24 no but that's a great idea, someone earlier said that memory leaks were doubtfully the problem
user34537
It doesnt just do memory leaks. It checks for out of bounds access ;)
user34537
both read/writes IIRC
user34537
I recently dealt with a segfault issue. It frustrated the heck out of me. But, it won't be your problem unless your forced with using C and are using implicit functions
02:32
I don't really know how to interpret these results.
user34537
Me neither. How many warnings do you get?
user34537
with -Wall
None with Wall I fixed them all
Same with Wextra
"Conditional jump or move depends on uninitialized value(s)"
user34537
Are you sure your not using an old binary on mac?
user34537
sounds strange
02:38
Hahaha!
user34537
Only twice have i had a problem when i compiled w/o warnings. Once it was with C the other time... actually it was in my C++ code but still involved C.
I didn't initialize my array of pointers...
user34537
LOL
user34537
ouch
user34537
how did you figure that out?
user34537
02:39
hmm i think visual studios (ultimate will do this, i'm not sure which edition will) tell you if you forgot something silly like that
I used valgrind
Posting pic of error message in a sec.
But basically that error of jumping.
But it says I have 8000+ bytes of memory lost
user34537
lol dont worry about it
user34537
ESPECIALLY if its homework
...Probably because of my lack of deconstrutors...
...awkward
user34537
C++ is win that way
user34537
02:42
I'm really interested in D
user34537
and their whole scope feature (exit, success and failure, i forget what its called)
@acidzombie24 Have you tried Db? They announced it not too long ago. :)
user34537
@Mysticial I don't see any sample code
user34537
i dont think i'll be interested in a db language...
When will a non managed C++ like language come? D is the only one, go doesnt want to do what C++ does so it doesnt fit. I want a new language =(
Hint: It's pronounced "D-flat".
user34537
02:51
@Mysticial: That seems to find articles making fun of C#
It came out on April 1st. Pretty professionally done...
user34537
Got a link to sample code? and lolz@thedate
When sbi linked it, I think it took me about 5 seconds to realize it was an April Fools joke... But that's cause I have a strong enough music background to immediately recognize Db and C#...
user34537
03:09
@Mysticial ahahahahah
04:16
@jalf FYI, here's Valgrind DRD report and a Valgrind memcheck report. (And here it is explained how to read the DRD file.)
^ "resolved" by forwarding into oblivion, I think -- I can't see anything about where it ended up
04:51
Question: Any good way to debug memory (like valgrind) for Macs?
I wonder what a valid use case would be for std::timed_mutex.
It could be used as a hackish solution to deadlocks.
But that's about all I can think of.
user868935
anyone use Visual Assist X?
Finally, I hit 1k rep on meta... Finally can see those vote counts...
05:10
Since it's so silent here:
0
Q: Valid use cases for `std::timed_mutex`?

StackedCrookedIn which situations would a std::timed_mutex be preferred over a regular mutex? The only use-case I can think of would be as a (IMO hackish) way to prevent deadlocks. In what other situations would a std::timed_mutex be a good choice?

Ha, I stumbled on your question, saw it was by you, came here, and saw you linking it.
It's probably the worst time to post a question now. Everyone is asleep.
Both Americans and Europeans :D
I'm not. It's just one in the morning here.
Same 12AM here... be at least a few more hours before it's bed-time for me.
That's good then.
05:17
@StackedCrooked i think, for liveliness. you don't want your app to wait FOREVER.
Real-time requirements perhaps.
I think liveliness should be obtained by keeping the lock durations are small as possible.
In lunix, if you have a number of .cpp files with names starting with "hello.", and want to remove that prefix, is it reasonable to do it with shell for loop and sed?
@StackedCrooked but if other thread or process (i'm not familiar with std::timed_mutex) keeps on holding the lock forever?
Actually, I would probably use piped combo of find and and some other commands.
05:20
@StackedCrooked could you show me? I'm very rusty on *nix shell usage. Since 1986 or thereabouts...
@CheersandhthAlf That's essentially a bug then.
@CheersandhthAlf Actually I don't know how to do this immediately. I'm experimenting a little on the terminal right now. Something else I often do is use Vi to create a script quickly using macros.
:r ls hello* to load all filenames into the current file. Then: gg to move to the top of the file and start the macro by pressing: qq. Rename the first file: yypkJ5x^jq. (5x deletes the 5 characters that make up 'hello' and the final q stops the macro.). Then press: 1000@q to repeat the macro 1000 times. (Which should be sufficient.)
That should be crystal clear, not?
Since it's interactive it's really easy. It's one of the most powerful Vim features imo. Yet so few people know how to use it.
he he completely cryptic to me...
05:43
Best way to interpret/read valgrind results?
user868935
06:02
Qt Creator or Qt Designer
Aww... poor guy can't allocate 24 GB of memory on 32-bit... :(
2
Q: Allocating a large amount of space for vector

asdfasdfasdf asdasI need to allocate a vector with 6227020800 elements. Its obviously too big for a regular call: vector<int> largevector(6227020800) I tried using new and its even too big for that: vector<int> largevector= new vector<int>[6227020800] Is there a way to allocate a vector tha...

> I tried using new and its even too big for that
Ahem.
If you allocate a vector with new then they can be bigger?
:D
He probably had a bad experience with a stackoverflow before. That's probably why he thinks new will help in this case.
Or rather new algorithm. It's not a sin to have less than 24 GB of memory. :)
Even I only have one machine with more than that.
06:40
If you allocate a vector on the heap they can't be bigger, only smaller. The stack is pre-allocated anyway, the heap isn't.
So you have a few bytes less of available space on the heap, where the vector puts its contents.
3 words.
Fuck that question.
I have seen so many duplicates. People try to allocate huge amounts of memory and then they are surprised it doesn't work.
Speaking of duplicates... It's been at least a month since I've seen a i++ + ++i question.
Something's definitely wrong...
Can somebody star that? I can't star unstarred messages in this moronic mobile version.
Star what?
06:46
Scott's message.
meh...
Ah never mind I switched to the desktop version.
The mobile version needs an epic rewrite.
-5
Q: takes too much time to fetch all images from website

user828122I have fetched all images from given url. I am using this code for getting all images from website $url = "http://cricket.yahoo.com/"; $homepage = @file_get_contents($url); @preg_match_all("<img.+?src=[\"'](.+?)[\"'].+?>", $homepage, $matches, PREG_SET_ORDER); It fetches all images but t...

> It fetches all images but takes lot of time.
And then regexing through the HTML.
Using the wrong RegEx.
07:14
Buy a faster hard disk.
Why don't they just put VS in a zip file and then just let you extract it wherever you want and then just run it?
Why do all Windows apps need a fucking installer…
An application can do that on its first launch.
Photoshop is even worse: you first need to install the installer.
Which also takes years to complete.
At my school they are wiped each week, along with all .exe files on the network disk.
So I need to reinstall Firefox each week.
And GHC.
And Cygwin.
Yeah, and IE is reset to the default browser on each login.
You can use Putty.
But yeah, I could better buy a MacBook then and bring it. I don't want somebody to install a keylogger or whatever on the school's computers and then use remote desktop.
No, it's Microsoft.
It's because Windows locks currently running images for writing.
Whether that's good or bad is a different story.
That one doesn't require restart.
Disregard.
Something else that I dislike about Windows is that when you are editing a file in say Word, and you move or rename that file you either get an error, or Word doesn't find out that you moved or renamed it.
The worst thing that can happen is that running software will continue to use older CRT.
INSTALL ALL THE SP
Does Windows 7 still refuse to boot when autoexec.bat is missing (instead of just creating it when it doesn't exist) or did Microsoft fix that stupid thing?
Like, that's fixed with only five LOC.
You can reduce it to one LOC using the ternary operator.
Oh, and to me one LOC is one statement.
07:44
That's like asking a snail to arrive in five minutes when it's in Paris.
True, they'll only crash and cause frustrations.
I seriously doubt that anyone will feel safe in a car that says "Microsoft" on it.
And when you don't do that manually within one minute it'll restart itself.
"You signed in from another location." Well fuck someone hacked my MSN account.
Or found out my password.
It's actual.
Meh I'm gonna delete my account. If people wanna talk to me they should just come over, use Facebook or send me an email.
Seriously, you don't want that.
They speak Dunglish and their jokes are worse than mine.
Also: they'll never get 20 reputation on Stack Overflow. xD
Nah, they should increase it to 100.
"Omdat een Microsoft e-mailaccount (Windows Live Hotmail) aan uw account is gekoppeld, kunt u het account van Windows Live niet meteen sluiten." -_-
MICROSOFT Y U NO MAKE IT EASY TO DELETE ACCOUNT?!
MICROSOFT Y U NO MAKE <insert anything here> EASY?!
I want to work for Microsoft just to find out why their software is so crappy.
Not that my software is less crappy…
Why do you want to work here?
Well, I have always hate- I mean loved Microsoft and especially Mac OS X I mean Windows and I like to improve my skills and not err also Microsoft's products.
xD
I'm going to install Linux. What's better Gnome or KDE?
Is there something Mac OS X-like?
Especially using Cmd instead of Ctrl.
3
Q: How do I remap command key to be the control key on a Macbook 4,1?

SamuazHow I can switch the left command key on the keyboard of my macbook, with the left ctrl key? and if it is possible that the command right, continue acting like the super key / windows

Looks good.
The worst thing is that somebody read through the license in order to find out that it contains that clause.
TORRENT Y U NO DOWNLOAD FASTER?!
BAND Y U NO GET WIDER?!
403 KB/s -_-
08:17
@classdaknok_t 403 kb/s isn't that bad... try dling a 66GB torrent at 50kb...
that sucked...
66GB? Were you downloading an enormous porn collection or something?
Oh "try" I read "I once tried".
I better wake up, but yeah that would really suck.
But normally it goes over 600 KB/s.
@classdaknok_t A 26-episode Anime bluray rip.
I ended up using two computers on different ip addresses, but with a 10MB/s point-to-point between the two computers.
It was pretty amusing to watch it...
as soon as one machine finished a piece, the other machine would get it in less than a second
How long was it? I mean the duration of the episodes combined.
08:20
26 standard length episodes
25-min. each I think
Then it's worth it.
Oh hey, @classdaknokt is a chick.
Quite literally. :)
Also, I thought you had more rep.
23 hours ago, by class daknok_t
Meh daknok.com is some korean site about chickens…
08:23
Well, I was drunk 23 hours ago, so I didn't notice.
user142019
@CatPlusPlus I have.
Or asleep. Or quite possibly both.
So, you're a sockpuppet!
Gah, Internet y u slow.
09:21
Netbeans y u no understand C++11.
Now it does, fuck yeah.
really?
lambdas?
Move constructors.
Haven't tried lambdas yet.
Oh wait it doesn't. WTF.
That does compile, I don't get the problem.
But it does understand auto.
well compiling is not a netbeans thing
True, that's clang's job. But I wanted to say that the code isn't wrong.
My code gets a clangjob. Mmm…
09:49
Is it safe to use the same std::ofstream from multiple threads if I guarantee that no more than one thread will stream at the same time?
I don't see a reason why it wouldn't be unless you mess around with a file pointer "simultaenously"
Morning lads
Unable to resolve identifier lock? WTF Netbeans, it's just a public member function.
I managed to login to b.net and can't resume game because "request timeout".
Meh.
10:26
This feels bad…
template<class T>
void add_ostream(T& stream, TakeOwnership take_ownership = DoTakeOwnership) {
  std::shared_ptr<std::ostream> stream_ptr;
  if (take_ownership) {
    stream_ptr = std::make_shared<T>(std::move(stream));
  } else {
    stream_ptr = std::shared_ptr<T>(&stream, [](T*){});
  }
  streams_.push_back(stream_ptr);
}
Taking ownership based on a parameter.
10:52
@classdaknok_t Worse than that is that you are creating a shared pointer from a non-shared pointer parameter. How do you know the caller won't invalidate your data?
@PaulManta the caller tells me that I shouldn't take ownership.
Through the second parameter.
That's how I know.
@classdaknok_t Using a shared_ptr means you do take ownership.
This is the most problematic line stream_ptr = std::shared_ptr<T>(&stream, [](T*){});
I use [](T*){} as a deleter to make sure the shared_ptr doesn't clean up. But as I said, this feels bad.
@classdaknok_t What exactly do you want to do? (What is the context of this code?)
hi guys, what's the difference between cout <<'\0'; which display a whitespace and cout << "\0", which doesn't ?
10:56
@PaulManta store ostreams in a vector, and stream them all at once. The reason I want the caller to decide if I should take ownership is because I don't want to delete for example cout or cerr, and ostreams don't have a copy constructor.
@classdaknok_t I'd rather have the vector not deal with ownership at all then. If that make sense for your purposes.
@classdaknok_t Use std::reference_wrapper.
@LucDanton the problem then would be that someone else needs to take care of the ownership.
@classdaknok_t That's not really 'a problem'. Someone always have to take care of ownership.
Again, what makes the most sense depends on your design though. Perhaps go with two vectors?
@LucDanton good idea.
11:00
Is it okay if I ask a design question here, but mostly related to games?
This is what I've got right now: gist.github.com/2436619.
@PaulManta yeah.
Let me clarify what I meant earlier: if somewhere a part of your program handles the ownership of a stream but wants another part of the problem to be a client of that stream, then you have to think of the relationship between those two parts. And not just try to find a solution that 'fits' at the client-end of the relationship (i.e. a vector of std::shared_ptr, (ab)using type-erasure to specify lifetime on a by-case basis).
If you know that by design the part that manages the stream will anyway outlive the client code (e.g. that vector), then the client doesn't have to know about ownership. If the part that manages the stream doesn't need the stream, then it can hand over the streams outright.
Whether you end up with one vector or several depends on how many parts of your program have to pass streams to it I suppose.
I'm coding a Bomberman AI and I'm looking for ways to make it easier to tweak. Do you think I should separate the algorithms for deciding whether or not to place a bomb and the one for deciding what direction to move in? The decisions are not entirely independent, so that's why I'm not sure if the separation would be helpful.
:3395615 That would be one (good, imo) option. Leave it up to the caller to pass an appropriate deallocator for the shared pointer. Then you don't have to deal with special cases in your vector of streams.
That significantly simplified my code.
void add_ostream(std::shared_ptr<std::ostream> stream_ptr) {
  mutex_.lock();
  streams_.push_back(stream_ptr);
  mutex_.unlock();
}
The caller can now just do add_ostream(std::make_shared<std::ofstream>(filename)); for example.
Please use a lock guard.
11:11
@LucDanton Is that in the standard library?
Oh yeah got it.
Assuming std::mutex then that would be std::lock_guard<std::mutex>.
Man I love deleting lines of code.
I reduced that mess to this.
Oh cool Kubuntu is done downloading.
@ScottW Placing a bomb and moving aren't at all entirely different. Placing a bomb or not may make certain moves more dangerous. My current approach is to analyze each decision (move + bomb), give each one a score, and pick the best one.
But the problem is that I analyze the decision to move in a certain direction and the decision to place a bomb together. This makes some things simpler, but makes tweaking some parts of the behavior hard.
Thanks for the help, @LucDanton and @PaulManta!
@ScottW What examples of states do you have in mind? The game is very simplistic, there no power-ups or things like that. Each player's set of abilities is constant.
@ScottW I already take care of proximity to enemies and being in range of a bomb, but algorithmically, not with states. Given how simple the game is, I don't think states are warranted.
11:36
@ScottW It's a bit hard to explain. Basically, I decide whether or not to place a bomb mostly on where I start from, not where I will end up. Atm it's hard for me to take my final position into consideration when deciding to place a bomb or not.
That's not to say that I kill myself. But sometimes it is easy for enemies to trap me, because by placing a bomb I've placed myself in a spot where I'm easy to trap.
@ScottW Of the full path.
My current trai of thought is this...
Have a function generate possible paths, mostly in the same way std::next_permutation generates permutations.
Then I'd have each path analyzed from how many points of view I like. I should easily be able to analyse it both at the start and at the end.
Or anywhere else in the middle, for that matter.
@ScottW It is, but so far I haven't ran into any problems. My current algorithm checks all possible moves in a range of 7 cells distance. The whole thing (analysis and everything else) takes less than 50 ms. I could do the same thing here: limit the paths to some distance that generates the best results.
11 hours ago, by Maxpm
#define sizeof(x) rand()
^ ingenious!

« first day (553 days earlier)      last day (4621 days later) »