« first day (822 days earlier)      last day (4125 days later) » 

user142019
3:00 AM
Blast away by a star that exploded.
 
stupid stars going nova.
 
user142019
:P
 
user142019
The leftmost pillar is 3.78421136e16 meters in length.
 
some are going holes when big enough
 
@JerryCoffin I suppose I could...somehow...send a message to my "UI" thread, would that be less involved?
 
user142019
3:02 AM
 
user142019
^ Eagle Nebula
 
i like the one who says all of heavy elements more than Carbon or Oxygen ar from a supernova that created all of our heavy elemnts( gas metals and so on)
 
user142019
> The appearance of the cloud suggests a supernova would have destroyed it 6000 years ago. Given the distance of roughly 7000 light years to the Pillars of Creation, this would mean that they have actually already been destroyed, but because of the finite speed of light, this destruction is not yet visible on Earth, but should be visible in the next 1000 years.
 
from a former solar system than ours
 
@melak47 Yes, usually. The UI thread spends its time processing messages, so when you can let it just do more of that, it tends to be simplest.
 
3:03 AM
Damn it! I shouldda answered this!
Free rep!
 
@JerryCoffin my UI thread isn't processing any messages right now :p
it's more of a "everything except that stupid message pump" thread
 
@melak47 So what is it doing? That's essentially all a typical UI thread does.
 
@Zoidberg what supernova is it ?
 
@JerryCoffin at the moment? it renders a blank screen
 
user142019
@StephaneRolland not mentioned.
 
3:05 AM
in the future? draw stuff. geometry, and also UI I suppose.
 
pilars of creation i don't know of any NGC called like this
 
@melak47 Ah -- not much of a UI yet...
 
so what, does my UI thread get a message pump, too? >_>
 
@melak47 Yes, at least normally.
 
how would this work. how can I send messages to another thread?
 
3:07 AM
Yeah, there's definitely a minimum score (at least on SO) to make the multicollider.
 
@StephaneRolland Well, nova anyway -- I don't think a supernova is truly necessary.
 
I don't see how it's possible for that question to not be on the multicollider already.
 
@melak47, There's PostThreadMessage.
 
@melak47 You normally want to post not send (post is asynchronous). Just use PostMessage though.
 
i can't be sure, but if a supernovae exploded in our near neighbourhood, I guess we would at least have recorded gravity waves, and we have still not
 
3:08 AM
Wtf is multicollider?
 
@chris This is for a UI thread, so he probably doesn't need that.
 
@Mysticial because it's an awful question
Seriously I'm surprised it even got upvoted and attention
 
@JerryCoffin, Oh right, it has a window. Duh.
I was thinking of my hook threads for some reason.
 
@chris and how do I send a message to a std::thread with that? I'm guessing I don't? :(
 
The formula, roughly speaking is:

(question score) * (# of answers) / 5 + (sum of top 3 answer scores)
 
3:09 AM
@Rapptz You advertised it. :P
 
Where (# of answers) is capped at 10.
 
@StephaneRolland If it was very nearby, we'd all just die (sends out massive gamma radiation, if memory serves).
 
There's also a logarithmic factor of # of views.
 
@melak47, Just use PostMessage since it has a window.
 
I'm not 100% sure on the /5. The meta posts have it at 5, but I believe it's out of date.
 
3:10 AM
@chris ...who has a window? the UI thread doesn't own the window
 
@JerryCoffin but we would have a phenomenon firework before
@JerryCoffin and I would love to see it
 
Well, if it didn't create it, I think there's std::thread::native_handle. I'm not too experienced with thread, as it never worked on my MinGW.
 
i must sleep it's not serious, bye
 
@StephaneRolland I'm not sure we'd live long enough to recognize it, but oh well.
 
@JerryCoffin so, my main thread gets and dispatches messages to my wndproc, my wndproc does stuff with messages, and sends messages the UI thread cares about to my UI thread?
 
3:20 AM
@melak47 At least as terms are usually used, your main thread is the UI thread. It runs the message loop, calls DispatchMessage, which ends up (indirectly) invoking your WndProc and processing the message (all in the same thread). Other threads post messages to the window for it to process.
 
how do I stop the poop you guys
 
-2
Q: use of atoi() function in C

YevgenigI tried reading in the atoi() description on some sites but couldn't get an answer. What will int i = atoi("000000000000000000003"); printf("%d", i); result in? Will it be 3 or will it return an error (0 in atoi()'s case)? I don't currently have any means of compilation available so I c...

^ Maybe the stacked crooked site should also be listed but i don't have the address.
 
user142019
@Cheersandhth.-Alf stacked-crooked.com
 
@JerryCoffin but...then I am where I was before, where dragging or resizing a window blocks updates because the messageloop gets over 9000 messages to process
 
@melak47 What 9000 messages to process? Generally speaking, your monitor only updates ~60 Hz, so if the UI thread receives messages that are supposed to update the screen much faster than that, you have a design problem.
 
3:23 AM
@Zoidberg thx!
 
@JerryCoffin while you drag or resize a window, you get a continuous stream of messages
that, or peekmessage blocks?!
 
@melak47 Yeah, it redraws the content while you drag...
 
user142019
What is Cartesian product?
 
user142019
It is {a, b, c} * {d, e, f} = {{a, d}, {a, e}, {a, f}, {b, d}, {b, e}, {b, f}, {c, d}, {c, e}, {c, f}}?
 
@JerryCoffin right. but I don't want it drawing and presenting for every pixel the window moves, that would take too long and make the window unresponsive because it's stuck rendering instead of being moved
 
3:27 AM
@melak47 Perhaps you want to double buffer? Draw the data to a bitmap, and just use BitBlt to update the screen during drags? Alternatively, you can just return from a WM_PAINT without doing any drawing during a drag/move (but I've never needed to do that).
 
@JerryCoffin that leaves the window not updating while it's being dragged
 
@melak47 The latter does, yes. Double buffering doesn't.
 
@melak47 not problem on modern OS
 
@JerryCoffin >_> I don't want it redrawing the same old image either
I want the game/render loop to draw and present at it's own pace, regardless of what the window is doing
 
@Zoidberg yes every record matched with every record or N^2
@Zoidberg or N*M if not self
 
3:31 AM
@melak47 you don't get any extra invalidation for dragging. you can get for resizing. that depends on whether you've specified V... in window class style.
 
"extra invalidation for dragging"?
 
dragging does not foul up things
 
when you move a window, it moves it for you, it doesnt wipe it
 
to put it in more easy language
 
unless I specify what
 
3:32 AM
yonly uncovering something clipped off actually triggers a draw
 
because I must have
 
@melak47 Why? If the user is moving/resizing, he's usually concentrating on that for the duration. In any case, if you really want that, I'd have the background thread do the real drawing, to an off-screen bitmap. It sends that bitmap handle to the UI thread in a message, then goes ahead and draws another. The UI thread blits from the bitmaps it receives to the actual window.
 
oh I see what you want
 
@JerryCoffin ...if the other thread does the drawing, then how is it the UI thread?
 
you are asking for trouble if you are trying to render to a context from a thread that isn't the window thread for the render window
 
@melak47 The other thread only draws to a bitmap. The UI thread draws (from there) to the window.
 
way better idea: do all the bitmap processing work in some other thread, and at the end, send a message to the thread that owns the window and do the rendering there
in the message handler in the thread that owns the window
 
@doug65536 That's what I just said.
 
@doug65536 i think that's what Jerry's suggesting.
 
oh ok then we agree
sorry didnt read everything :)
 
3:36 AM
hey, don't do what jerry says. do the rendering in a separate thread instead, to a bitmap!
he he
 
I didn't see anyone say do the draw calls from the window thread did they?
Oh I see right now sorry lol
 
I don't understand why that is necessary. drawing and presenting from the second thread works fine - it's just the resizing I need to somehow get to that thread so it can resize the buffers
 
apply some faith?
 
@Cheersandhth.-Alf Hey, you're right. Why didn't I think of that?
 
not enough beer
(in reality i'm reduced to drinking coffee. too much sugar/starch in beer)
 
3:39 AM
can't I just..I dunno, share an atomic<bool> dont_draw_right_now_plz with the other thread, so the main thread can use the D3D resource real quick to resize the buffers? :/
 
@Cheersandhth.-Alf I never liked beer anyway (but don't like coffee any better).
 
^ I didn't know, coffee beer exists!
seems to be quite common also
 
@Cheersandhth.-Alf Oh my -- nasty bitterness mixed with...more nasty bitterness! I think I'll stick to wine and chocolate (not that I can do that very often either -- both bad for gout).
 
@melak47 UI threads in Windows are based on the concept of waiting for message between frantic short work sessions. so you post or send a message to it. that's how thread synchronization works in COM by the way. there's even a special window class to support the concept for non-UI threads, a pure message window (with no graphical presentation).
 
@melak47 no that won't work at all. What if you set the "dont check" flag one cycle after the other thread reads it and proceeds to go ahead and use it at the same time. Don't be cute. Use a lock.
 
3:51 AM
locking a mutex is what I tried first
it works a couple times, then doesn't
 
mutex is too heavyweight for that. its for cross-process sync. use critical section
its windows?
 
@Cheersandhth.-Alf I'm pretty sure bears have enough taste to dislike coffee.
 
ok i'm going to have some coffee and breakfast
 
@Cheersandhth.-Alf Enjoy.
 
4:03 AM
@JerryCoffin can't I just have my other thread do the presenting through D3D/DXGI whenever it wants, and somehow get a message to it from the "UI" thread that gets the messages from windows?
I know that presenting while the windows is resizing from the other thread is not an issue, because that is working fine. all I need is to somehow notify it of the size change
 
@melak47 I suppose you might be able to get that to work, but I've never done it, so I doubt I can help much.
 
how would I send a message to the other thread? I tried PostThreadMessage with GetThreadId of the other threads native_handle, but that doens't seem to arrive
 
@melak47 you can just use SendMessage. it blocks. very synchronized.
 
@Cheersandhth.-Alf but I don't want it to block ;_;
still not
not ever ;_;
 
do dogs like tea?
 
hmm perhaps I should make my dog tea
 
^ it might fall asleep
i think this proves that almost no matter what you think of, if you google it there's a picture of it
 
There's also porn of it
if you turn off the filter
 
@melak47 IMO, you should generally use messages when going to the UI thread, but something else (e.g., setting an Event) is usually easier in the other direction.
 
4:23 AM
@Rapptz Yes. Yes it is.
 
Likewise, I've never used sscanf
 
@Rapptz For that I should add links to the periods too... :-)
 
Well, I actually don't have a use for sscanf
 
@Rapptz As noted in my comment on the post you linked, about the only substitute in modern C++ is Spirit (well, there are a few others, but they're all bigger and more complex).
 
I'm playing around with it a bit
That's pretty cool.
 
4:31 AM
@JerryCoffin how would I go about "setting an event" ?
 
If it doesn't match the formatted input i.e. std::scanf("%d+%d=%s",&x,&y,str); it prints out garbage?
 
@melak47 Create the even with CreateEvent and set it with SetEvent.
 
and how does one get events?
 
@Rapptz Yes -- if it doesn't match input, the variables are left unchanged. The return value from scanf will tell you how many fields it read in (e.g., you'd want a return value of 3 in your example).
@melak47 WaitForSingleObject, WaitForMultipleObjects, etc.
 
anyone familiar with using matrices to resize images?
 
4:44 AM
@Crowz Vaguely -- I've written code to do it, anyway. More often used existing code though.
 
Hmmm I want to scale an item porportionally
mathematically, how is that done?
 
@Crowz For pixel-based images, it's non-trivial. Scaling nearly always requires interpolation, and you have to make some choices about how to do that (e.g., bilinear, trilinear, bicubic, etc.)
 
4:59 AM
Area averaging
Image.SCALE_AREA_AVERAGING hah
 
For what it's worth, the wiki article on it looks halfway decent.
 
How do I pass variadic arguments by reference?
 
@Crowz I haven't read through this but perhaps tinaja.com/glib/pixintpl.pdf might help you
 
@Rapptz, No idea, but passing std::ref(var) might.
 
I think Args&... args worked
 
5:03 AM
Or that. I've only seen Args... and Args&&... lol.
 
@Rapptz Yes.
 
well this is weird.
int ratio = Math.min( width/finalImage.getWidth(), height/finalImage.getHeight() );
                    	int thewidth = ratio * width;
                    	int theheight = ratio * height;
where height and width are the height and width of the window, and finalImage is my image.
It says that the number is negative.
 
:( my half ass implementation of scanf sucks.
a lot better than I expected though
 
lunchtime! :D
 
5:19 AM
@Ianthe Hmmm...looks pretty tasty!
 
:| this answer isn't even that good but it has 2 upvotes
 
@JerryCoffin, yeah and spicy too! (hot level 8/10!)
 
@Rapptz What answer is that?
 
the one on the scanf question
I mean it isn't horrible but it's convoluted in comparison.
 
@Rapptz If you use iostreams for this, that's going to be hard to avoid.
 
5:23 AM
yeah I guess. I was working a variadic template solution
it worked fine but I have to keep pressing enter so :/
kind of defeated the purpose imo
 
Okay this is stupid but the name of the *nix program to set read/write/execute rights for a file or directory escapes me right now.
Of course, as soon as I express my frustration I remember it's chmod.
 
chmod?
ah.
 
@LucDanton Of course.
 
@JerryCoffin I wish I would know the name of that phenomenon.
 
Remember: Unix is user friendly. It's just very choosy about its friends.
 
5:26 AM
According to a recent-ish QI you are in fact supposed to say aloud the name of the thing you're looking for, to help you remember.
 
@LucDanton If I could say it aloud, I wouldn't need help remembering.
 
It's more to help remember when you misplaced e.g. your keys.
 
@LucDanton That sounds more sensible. I suppose saying things aloud triggers different parts of your brain.
 
hello
can I ask a C question here? theres no one in the C chat room
 
@FunBeans Hi!
 
5:32 AM
AT&T syntax should first be burned with fire. Then nuked from orbit. Burning is obligatory to ensure a long and painful death. — Mysticial 14 secs ago
 
@FunBeans You would have been able to, but you just used "C" in two sentences, which used up your allotment.
 
I also dislike AT&T syntax.
derped for a moment.
I think I'm going to give up on this scanf thing :(
 
@Rapptz You right both times. Zilog syntax FTW!
 
Why you assembly!?!?
 
@Rapptz I'm pretty sure it'll take a while to do it well at all.
@Borgleader Forget beer and speech. Assembly is true freedom! :-)
 
5:35 AM
Well that was fun. An hour because I am bad at making stuff the right type hah
 
Hmm, how do you think a "Is there a case where naming the parameter in a function prototype makes a difference in compilation?" question would go? I found a case where it does that I actually ran into while coding.
 
@JerryCoffin If by that you mean the freedom to hang yourself by your own ballsack than I agree.
 
I think the only Zilog microprocessor I've used is the Z80
 
@Borgleader Freedom to do pretty much anything, and yes, that definitely includes fucking things up by the numbers. It builds character though.
 
I did assembly back in my first year at Uni
I hope never to do that again
 
5:38 AM
once you get used to it, it isn't that bad
 
Everything takes so long
 
@Rapptz That's all practically anybody's ever used. They still build processors, but kind of faded from the mainstream after the Z80.
 
I didn't even use it directly, it was just on some of my devices.
Off the top of my head, gameboy, TI-83 and arcade games.
 
@Rapptz I wrote stuff for CP/M, once upon a time.
 
I should head to bed, I'm tired.
 
5:41 AM
I spent months getting Ron Cain's "Small C" compiler working (did initial bootstrap by translating most of it to Turbo Pascal). Never did get it to really work well though.
@Rapptz Sleep well.
 
Thanks, good night :P
 
user142019
I slept for about an hour.
 
user142019
Now I'm awake but it feel like I'm sleeping.
 
@Zoidberg Maybe you're really asleep, and just dreaming that you're awake.
 
6:01 AM
Is that what they call a sleep cycle.
 
6:17 AM
Anyway this winter is making me feel much more sleepy than usual.
 
@StackedCrooked I've also been sleeping what feels more than usual this winter.
 
Normally it doesn't affect me that much.
However, right now, I really wish I could go back to sleep.
 
@chris seems strange to ask a question to announce something you found. was it a macro expansion?
 
Increase brightness on monitor should help.
 
@chris unless you meant answering it yourself too
 
6:27 AM
it's a space walruuuus <3
 
@Borgleader exactly, you have to go really slow to make sure you don't screw it up and get it right the first time because the debugging assembly code later will be hard.
@FunBeans don't ask to ask. just ask. people looking at scrollback will see it
 
@doug65536, Yes, I was planning on giving an answer. It doesn't involve macros.
Though I guess one would make it a little bit more readable.
 
user142019
@JerryCoffin What a horrible nightmare.
 
@chris how? you're saying removing the names fixed your problem? or adding them?
 
Adding.
 
user142019
6:34 AM
But how can I tell? I'm already in the train and there haven't been any major jumps in time.
 
user142019
@StackedCrooked ligt er in Bels ook zo belachelijk veel sneeuw?
 
@chris what compiler?
 
A few centimeters, not too much.
 
@doug65536, So far, GCC 4.7.2.
 
user142019
Here's almost 15 cm. xD
 
6:37 AM
@chris if the repro is small enough to pastie, I'll put it through VC 10 compiler if you like
 
2am is the best time to start cooking
 
Sure, but I just need to figure out the last of what's necessary and what isn't.
 
especially with roommates!
 
user142019
>RWWJQXUQJQXHWDFQGZRTWNWFJATNBJUSYYMQYNTNMDTJWTWITNUJUXUSUTJNPQYJUQRTWXWJDDTSJLK‌​SGJUHTWTIWFFQZFUHWRGAFWGNWSJXUJXLXSFXXTTHXFJFSJYYTPFYHSMTXWFQGSUIDUXRYQFQJFQNRPZS‌​TJQXQXFXYFIXKBUNXWQSHSTNSFRTZYUWJJXWJDNJRFTPUXWJJWFHJKNLZUNYJYDYTIJZTXXFZFNIZHUHJ‌​EFHWMJRBWYYYGJFNXAJNWYYYGNEKBTQHYNTFTNTU
 
user142019
Nice editorial.
 
6:39 AM
Coffee!
 
user142019
I wish I had that. :(
 
user142019
I feel zombie-like.
 
user142019
Also OS X Y U NO xmonad.
 
@Zoidberg Because Apple.
 
user142019
Stupid Apple. :(
 
6:42 AM
@Zoidberg rofl you have no coffee
 
user142019
@StackedCrooked You're mean! D:<
 
Not having coffee is a mistake.
 
user142019
I hate the taste of coffee.
 
customers can't configure apple itself either
 
user142019
Just extract the caffeine and send it to me, please.
 
user142019
6:43 AM
I demand caffeine.
 
user142019
Or MDMA.
 
user142019
Or something else that's equivalent.
 
"Is there an options screen or something? Oh wait, nevermind, thats an i-phone"
 
@doug65536, The goal was to get this working so I would end up with a const S<T> & as the second parameter without changing main.
 
user142019
This article sucks.
 
user142019
6:46 AM
> A typical Haskell idiom to get the status of a file is the following:
 
user142019
exists <- doesFileExist file
when exists $ do
    stat <- getFileStatus file
    ...
 
For the most part, all that's really worked was this.
 
user142019
EPIC FAIL
 
user142019
> Both doesFileExist and getFileStatus issue the stat system call. Since they are slow, we decided to use getFileStatus without doesFileExist and catch errors for better performance.
 
user142019
No, you should do that anyway, idiot. Otherwise you have a race condition. T_T
 
6:47 AM
@chris so not naming the definition's parameters caused it?
@chris the last foo
 
@doug65536, Well, I needed to name it for the decltype.
I guess get template argument deduction for the first parameter and copy the type of the result to the second or something.
 
@MarcusStuhr Nope not much, fun problem though and I have been trying. Though I had it for a while but lost it, dunno if I had it :)
 
@Zoidberg, Stop hogging the star board.
 
user142019
Star board?
 
user142019
I have only two messages on the star board.
 
6:50 AM
@chris This is what MSVC 10 x64 command line compile says pastebin.com/5US7ms0U
 
Just noticed the precious cock cycles. Lol.
 
@Zoidberg, I see 4.
 
@chris I think its too C++11-like
 
user142019
@chris your monitor is bigger.
 
@chris I'll get rid of = default
 
6:51 AM
@Zoidberg it caps at eight I think
 
user142019
I have a 13" laptop.
 
user142019
My monitor is smaller than my dick.
 
@doug65536, Yeah, MSVC doesn't do = default.
 
user142019
Also GIVE ME CAFFEINE OR MDMA.
 
6:52 AM
lol
 
@chris This is what I get now pastebin.com/9hAZ5EwJ
 
@doug65536, Seems about right. What about the other one?
 
@chris didnt see before. trying...
 
Clang does the same as GCC.
 
@chris works
@chris Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
 
6:55 AM
@doug65536, Thanks, it should.
 
@chris command line is cl test2.cpp
 
I hope the macro is correct.
 
@chris LGTM
 
For whatever reason, const decltype(param1) doesn't do the same thing.
 
@StackedCrooked did you stop with Euler?
 
6:57 AM
I guess you can't mix and match with decltype then?
 
@chris can you typedef then const the typedef ?
 
@JohanLarsson Yeah. I solved up to 14.
 
@chris you're trying to cram it into a parameter declaration though. nevermind
 
@doug65536, Isn't that basically what remove_cv etc does?
 
@chris how about putting a typedef in struct S then using S::whatever
 
6:59 AM
Isn't that exactly what it does?
 
why is S(int) there
 

« first day (822 days earlier)      last day (4125 days later) »