« first day (1817 days earlier)      last day (3146 days later) » 

5:03 AM
@Mysticial +1'd
@ElimGarak I want to work on that ;_; instead of silly finance
@orlp Wrong channel format
 
@GregorMcGregor it's not though, I pass the image data compact
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, &data[0]);
my data is 3 bytes per pixel (in RGB order), compact
that is my full code
to load a PPM image to a texture
 
You input image might be screwy, have you checked that?
 
yes
it's fine
I even loaded up a PNG encoder, wrote the data vector back to a PNG, and got the original image back
so the image sits just fine inside data
 
Oh you might be passing the whole std::vector
instead of the pointer to the data portion
 
&data[0]
not &data
 
5:11 AM
data.data()
 
same thing
C++11
(I had &data[0] before)
 
Are you aware that PNG encodes pixel data row by row, but also separates channels (R, G, B) to exploit higher run lengths?
 
check the damn data in the vector
dump it to .bin and use imagej to view it
 
@Mikhail how does imagej know the dimensions of the image?
 
you tell it
drag and drop and answer the questions in the dialog
 
5:22 AM
@Mikhail @ElimGarak just checked .bin with ImageJ, data in vector is perfect 24-bit RGB
 
And I am assuming you're using a power of two square texture?
 
@ElimGarak no
 
dimensions?
 
165x68
 
Ah... Row alignment must be on a 4-byte boundary.
 
5:32 AM
Doesn't opengl throw errors if you don't bind the right size?
 
@ElimGarak could you elaborate?
 
I wrap every opengl call with glGetError in my debug builds
 
Ask OpenGL to be tight with packing.
 
@ElimGarak how?
 
glPixelStorei(x, 1); where x GL_UNPACK_ALIGNMENT and GL_PACK... (two calls) Or make the row size a multiple of four.
Or use a power of two texture for your practicing.
 
5:36 AM
@ElimGarak thanks a ton
that did it
why is that not fkin mentioned in tutorials?
 
Because OpenGL :D Also, GPUs really don't like non-powers of two :D
 
half of them use floating point data
 
seems like pretty crucial information that a beginner will never find out on him/herself
 
CPU's don't like powers of two when it comes to memory. :)
 
@orlp Always use the documentation as much as you can.
> By default, these texels are taken from adjacent memory locations, except that after all width texels are read, the read pointer is advanced to the next four-byte boundary. The four-byte row alignment is specified by glPixelStorei with argument GL_UNPACK_ALIGNMENT, and it can be set to one, two, four, or eight bytes.
 
5:40 AM
@ElimGarak I only need to set unpack though?
I'm not requesting data from opengl
only uploading
 
Ah, the pack one pertains to readbacks. yeah. Best to spill all the info at once. :D
That is just basically defering the responsibility of actually dealing with something like 165x68 behind the scenes.
 
oh well, it's done now
loading a texture in ~30 lines without any libraries is not bad
 
You an do it in like 3 lines using the windows api, https://msdn.microsoft.com/en-us/library/windows/desktop/dd183370%28v=vs.85%29.‌​aspx
50% chance you can blit anything
 
We're sorry, the page you requested cannot be found.
 
Probably talking about WIC
 
5:48 AM
BitBlt function
FYI, https://valelab.ucsf.edu/svn/micromanager2/trunk/DeviceAdapters/GenericSLM/Gene‌​ricSLM.cpp
 
@Mikhail 404 not found
you seem to be excellent in linking non-existent resources :P
 
god fucking damnit
 
Ahahahah :D
 
hi guys, can i have some help with forms? I'm using visual studio 2013 and I've created a form, the only thing is that, the program does not run. I'm very new with forms.
 
5:53 AM
Have you tried AVX512?
 
Dude, use Qt
Also this question is complete, where is the close button?
 
Not Qt. Always try PHP first.
 
Ruby on Roids
 
And Java with doubletons.
 
Both JRE and JDK!
 
5:55 AM
@GregorMcGregor Guess I just thought you would appreciate some staged corporate happiness. :)
 
Lol: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4459053

`Humans benefit from the redundancy of the type declaration`
 
Cinch?
 
what do you answer when your manager asks you how many codes you have written last week?
do you say "8 codes sir"?
 
Where did that manager come from? McDonalds? :D
 
Okay the market data produces several gigabytes of logs per sec
._.
 
6:03 AM
I should ask him how many monies he has made
"I have made 44 monies"
 
@GregorMcGregor Do you guys log everything and its grandmother?
 
what if you wrote 0 codes?
 
@orlp 8 instances of a singleton?
or maybe answer in flops?
 
Do managers these days even have programming experience?
 
hi guys, is there a text area available for c++ forms?
 
6:10 AM
@ElimGarak Yes
@rocky QTextArea
 
@GregorMcGregor oh, is it also a listbox?
 
It's anything you want it to be, bby
 
QListBox
The general pattern for "how do I widget ([a-zA-Z]+)" is Q\1
 
QSOChat
 
 
why is it that this code inside a listbox is not working? "listBox1->Items->Add("Sample");" This suppose to print "Sample" in a form, right?
 
Is this QLounge<QWidgets>? I don't think so.
 
Nope. There must have been a QUIProQuo
 
Hi loungerz
 
Hellounge
 
6:41 AM
sup
 
inf
 
@GregorMcGregor yet
@rocky put your code inside the text area of your ide, then if you click "Run" it will execute it
 
often you'll have to click "yes" when asked if you want to rebuild, though
but there's a setting for doing that automatically I think
 
unless you have that fucking checkbox checked
 
right
 
6:45 AM
QUIt
 
if you do that then you'll have to open the Settings window
 
"always run broken code"
 
and under VS at least you'll find a Build and Run menu
there you should be able to reset the correct option
hth, cheers!
 
thanks @sehe
 
Weird, my system is one hour early
Though it uses a MTP server
 
Fuck, I replaced my error codes with throws, now I can't find where my errors are coming from in my mulithreaded code
 
Truly exceptional code, brah.
 
Hah.
 
Whats messing with me is that the exception is always caught from some dedicated thread rather than the one throwing it (or MSVC breaks in some other thread). Is this a feature?
 
> A codebase that I had to work with written by mechanical engineers was 250k lines of code in a single file, aptly named core.cpp.
 
7:07 AM
SIGQUIT
 
mov ax,4C00h
int 21h
 
@ElimGarak hardcore
@Mikhail bye! (luckily the exit code is 0)
 
> "Je respecte profondément l'indépendance de la justice", a soulipolicier blességné Manuel Valls.
Looks like a failed copy/paste @LucDanton
 
> soulipolicier
@GregorMcGregor If you the deveop by dumping core.cpp, you can expect the program to implement features at runtime
 
you sexy bitch you <3
 
7:26 AM
Writing a paper. :(
On the sonic properties of this Bach song.
I'm really scraping the bottom of the barrel with my description here.
It all feels so inadequate.
 
> Update 3: this implementation has recently become part of MoreLinq - Thanks guys!
3
Woot! Fame
Now it's just a matter of time before I am rich :)
 
Lawsuits inbound from sehe!
 
It's CC-SA right
I intend to get rich from anonymous donations and occasional appearances on talk shows
 
@sehe Wow, really like the spirit of atifaziz
 
7:42 AM
@Rerito ? who/what is that
 
@sehe Here
 
@Rerito Ah, that guy. I have a way with names.
A way of forgetting them, mostly.
Yeah, that was a really nice move. Now I can also link back to MoreLinq from the answer
 
I was just happy to emphasize that behavior. I really appreciate to see that :)
 
@sehe you had another huge PR merged this week
 
rofl
 
7:54 AM
(To me, PR means Personal Record...)
But given the context, is it Push Request?
 
Post Rektum
@Rerito Pull*
 
Push Request, interesting concept
 
@GregorMcGregor Fuck off filthy scotsman
 
Carte blanche for pushing anything
 
8:10 AM
@JohanLarsson there's this nice trance track called carte blanche but I'm looking for a particular remix I heard ages ago and I can't find it and now I must find it thanks
 
by veracocha?
 
yes
but I don't know whose remix it was
it was in a compilation along with...
 
robert's
I'm pretty confident it was the famous Robert Remix
Aka Robmix
 
Rebert
 
there we go
it was in a compilation along with this other gem youtube.com/watch?v=HE1E2IkmR34
 
8:15 AM
We do push requests at work.
 
I miss free functions in C# D:
 
Microsoft is selling them at a discount for enterprise users
 
A bit better with namespace import in C#6
 
why are people afraid of free functions
 
8:17 AM
I miss typedefs in Java.
@GregorMcGregor It is called nonmemberfunctionphobia.
Also, I have watched John Wick yesterday. Pretty good revenge flick.
 
@GregorMcGregor because that's not how oop works and C++ is obbviusly oop!!!11111oneoneeleven
 
I use free functions where they make sense, naturally. Folks rarely appreciate that not using things at times is better than using things. But then again, same people think OO is a thing.
 
IRTA C++ is obviously op
 
I need to calculate a mean over a very large number of elements that overflow an int64 help
 
@GregorMcGregor Use floating point numbers?
 
8:21 AM
arbitrary precision libraries
 
What precision do you need? Approx.
 
oh, mean does not make sense for integer type
 
@GregorMcGregor Look at boost.org/doc/libs/1_55_0/doc/html/accumulators/… to see if you cannot find something useful there.
 
Writing dialogue is so fucking boring.
 
8:24 AM
@wilx he's using C# tho
 
@AlexM. facepalm
 
this resharper thing is pretty smart
 
var f = 1.0 / values.Length;
var average = values.Sum(v => f * v);
slow, maybe wrong :)
 
Reasonable approach :)
 
@GregorMcGregor Well, if you do not find useful existing library, just do it in doubles but make sure you add the numbers using a priority queue so that you do not loose precision. What's it called?
 
8:30 AM
robert
 
sprinkle some Kahan summation on that if you need to
 
kakahan
yes i'm 12
 
@GregorMcGregor Using "buckets", the overall mean is the mean of the means of the buckets
(That can be recursive as well with buckets of buckets... of buckets of numbers)
 
@JohanLarsson why do you usually .ToArray() IEnumerables?
performance considerations between arrays and lists?
 
@GregorMcGregor :D
 
8:32 AM
I noticed that Task.WhenAll also returns an array of tasks
 
@AlexM. I rarely need list semantics, array is a bit cheaper
 
@Alex tasks are cheap, and it makes little sense to have WhenAll return a lazy sequence.
Lists are growable, arrays aren't.
 
@R.MartinhoFernandes I meant that Task.WhenAll returns an array of tasks and not a list of tasks
I don't think lists are lazy
 
@AlexM. It makes very little sense to add tasks to the result imo. SHould be IReadonlyList<Task>
 
hi, guys. i'm having problem with my forms in c++. i have two .cpp and .h files. GUI2DLG.cpp,GUI2DLG.h,GUI2.h and GUI.cpp. when a form is created, where is the main function declared? i'm really new to cpp and forms.
 
8:35 AM
@GregorMcGregor: How much is the speed important?
 
not very
 
@R.MartinhoFernandes Not sure they are so cheap, it is often suggested to cache tasks as a perf improvement
 
@Griwes hey guy, why you no put cppcon up on github?
 
@GregorMcGregor Then use the built-in BigInt instead?
 
They improved them in 4.5 though
 
8:36 AM
127
A: Is it better to call ToList() or ToArray() in LINQ queries?

JaredParUnless you simply need an array to meet other constraints you should use ToList. In the majority of scenarios ToArray will allocate more memory than ToList. Both use arrays for storage, but ToList has a more flexible constraint. It needs the array to be at least as large as the number of ele...

 
@thecoshman Oh, did I still not send them the slides? dang
 
this was in 2013
 
Ugh.
 
I had too much on my head this past few days.
 
@JohanLarsson it's just a future.
 
8:36 AM
I hate this warning.
 
Forgot about that.
 
Stupid fucking __LINE__Var exceeds that goddamn internal limit.
 
> In the majority of scenarios ToArray will allocate more memory than ToList. TIL, sounds strange
 
Why is this even a warning anyway?
 
What you should pool is running tasks
 
8:37 AM
@ThePhD are you yesterday's Robot or what
 
I think I'm encountering a bug on youtube
 
"Excuse me, developer, let me tell you about my horrible deficiencies as a computer program."
 
on every video at around the same % the volume drops down
if I seek on the bar it starts working OK again
wtf
 
@Griwes Is that what the "FUCK YOU MSVC" is about?
 
Oh. I haven't mentioned how FUCK YOU MSVC today.
 
8:38 AM
@ThePhD yes
18 hours ago, by R. Martinho Fernandes
> warning C4503: '__LINE__Var': decorated name length exceeded, name was truncated
 
It's the worst tool in my job. At least GitLab works fine again when I restart it.
MSVC just slows everything down with bullshit.
 
I don't think I could work in a place where I'd have to deal with MSVC.
 
Protip: just run.
Maybe I should take another round of feeding our code to the alternatives.
 
@wilx Didn't know there was BigInt natively
 
@R.MartinhoFernandes not sure what that means
 
8:41 AM
@GregorMcGregor AFAIK since .NET 4 or such.
 
@Griwes that or I don't know what the presentation was meant to be called
 
@wilx I'm completely out of touch
 
@thecoshman No, I think you are right and I did not send it.
Blergh.
 
@GregorMcGregor I am as well. I just used Google. :)
 
Task is immutable so caching for return makes some sense from an allocation perspective
 
8:43 AM
@Griwes Lol
 
@thecoshman Ping me about this again in ~10 hours if you still remember about this by then. I'll try to remember about it, but due to all the stuff that I have to do in near future, it may fall out of my head again.
 
Also, damn, only 194 points from moderator tools.
 
There's nothing in it. I don't see how allocation would be costly.
Especially since .NET allocation is dirt cheap.
 
But it still has a price as it must be cleaned up
 
But there's nothing in it.
 
@R.MartinhoFernandes not completely empty
 
Running ones are expensive because they spawn threads.
The others have nothing in them.
Like the ones returned from WhenAll.
I really hope they don't spawn threads.
 
Yeah :)
 
@Griwes get @sehe to remind you
 
static_cast<int64_t>(high_resolution_clock::now()) is nanoseconds isn't it (or ticks?)
 
8:49 AM
Ugh wtf
.count()
It can be anything.
 
@R.MartinhoFernandes It even returns a cached task (for an empty list)
 
duration_cast it to the unit you want.
 
@GregorMcGregor read API
 
@R.MartinhoFernandes I'm not doing the delta between nows in C++
I am just streaming the time points to a C# process
 
@JohanLarsson dat moment WhenAllPromise and nobody comes
 
8:52 AM
@GregorMcGregor badly
 
In at least one major compiler, it's milliseconds. Just cast to the unit you want.
 
You should still be able to .count() it....
 
@R.MartinhoFernandes Ow. That explains it.
 
VS2013?
Boost.Chrono has proper clocks.
 
Yes. All my timings are off by a factor 1000
 
8:53 AM
And all around non-buggy <chrono>
 
Boost.Chrono fails at high_resolution_clock
 
As long as you're not trying to use <chrono> in any reasonable fashion, 2013's implementation is fine.
 
Er, no, it doesn't.
 
@R.MartinhoFernandes Cool, I'll check, thanks :)
 
THough, that makes me think of how you would serialize the data.
 
8:56 AM
Ints.
 
For <chrono>, would you serialize time_since_epoch().count(), and then reconstruct a time_point from that duration from that underlying (integral) number?
 
Depends
time_t might be better for serialization.
 
There is a from_time_t method somewhere I think...
 
time_t has a guaranteed epoch, I think.
The chrono clocks don't.
 
system_clock has from_time_t.
 
8:58 AM
I keep getting upvotes on one of my answers but the question is active
4 months ago
so it's not like new people see it
 
So you'd need to use to_time_t, serialize to integers, and then pull up from_time_t.
Of course, it'd only work with a system clock.
 
I got +30 in the last 7 days
 
So you'd have to duration_cast to the system_clock if you're not there already,
and then use the time_t methods.
 
Can't?
 
8:59 AM
Yes, that works significantly better, thanks Robot!
 
Clocks don't know how to mix.
 
Now things make sense.
 

« first day (1817 days earlier)      last day (3146 days later) »