« first day (986 days earlier)      last day (3964 days later) » 

user142019
5:00 PM
Ah, so that's why. :)
 
user142019
I still want to learn Fortran.
 
@Rapptz I've been working with mathematica for several years :P
 
@Sosi I've worked with matlab for 3 different classes and fuck it. It feels like it took inspiration from 4 different languages and mashed them all together in a frankenstein piece of crap.
 
Matlab's pretty old man.
 
:(
 
5:01 PM
And it didnt age well
 
but no one knows the answer to my question :(
 
You should post it on Stack Overflow.
Where you're far more guaranteed to get an answer than here.
You could also try the PHP room.
There are wizards of vast knowledge in that place.
 
ehhehe
thanks @ThePhD
I will ;)
 
@rightfold not really
matlab is focused on matrix operations and engineering simulations with Simulink, and it targets engineers more
Mathematica is for mathematicians
Well, they overlap a bit, because Matlab is much older and back then mathematica was lame
Still, newer symbolic components of Mathematica are better, and symbolic calculations are completely optional for Matlab (our uni's licence didn't have them for example)
 
Matlab's a piece of shit.
 
5:06 PM
I have mixed feelings about it
I wouldn't call it a total shit, though.
 
@BartekBanachewicz yet, I seem to see more engineers and mathematicians use Matlab, they say they "prefer developing the full algorithm so that they know everything that is going on". Well, I use mathematica and I also do... ;)
but yea, I also prefer mathematica
 
I don't even like Mathematica either.
 
well fuck algorithms
 
But I like it more than Matlab.
 
funny thing, I should redirect some of my colleagues here, they would be very happy know that Matlab is a shit xD
 
5:07 PM
Sweet.
 
whenever I hear "algorithms" I instantly think "sorting, binary trees, heaps, booooring"
 
I figured out how to split my check up with no additional charge.
 
I liked Maple.
 
And to have it serialized directly to cash.
 
"oh, matlab is so much better than mathematica"
 
5:08 PM
@Rapptz Maple was a pain in the ass.
 
"OH YEAH? Go say that to Stackoverflow!"
 
well I guess I will have to wait with my template question until someone who knows C++ appears
 
@ThePhD Yeah I wouldn't call it user friendly.
What template question?
 
He's trying to be silly with templates.
 
here you go
0
Q: Is Octave compatible with the CobraToolbox?

SosiI need to use the CobraToolbox for a course and I am wondering if it is compatible with Octave. Even googling for this doesn't return much results.. Thanks in advance

 
5:09 PM
@Rapptz start here
 
0
A: Should C++ programmers use std::flush frequently?

7studNo.........................................

 
Pompopom.
 
The question needs more info.
Is T a template parameter?
 
@Mysticial I got the feeling he's just parking an answer.
 
@Rapptz obviously.
Well I can expand on why I need it
It's for Lundi; We managed to parse function signature and generate Lua API calls from that. Now I wonder if I would be able to generate loops that would allow me to easily move the containers back and forth to Lua.
Because I can only "pass" a single value at once, I was wondering if I will be able to generate recursive call stack that will move all of the data
 
5:12 PM
template<template<typename...> class V,
         typename Map = map<string,V<int>>,
         typename T = V<V<Map>>>
 
@Rapptz Can I do that to arbitrary depth or will it be fixed?
 
What do you mean?
Also.. sec. It's a bit more than that.
 
Xeo
template<class T> struct template_of{};
template<template<class...> class TT, class T, class... Ts>
struct template_of<TT<T, Ts...>>{
  template<class U> using type = TT<U>;
  using head = T;
};
Wasn't it something like that?
 
@Xeo seems legit.
 
Xeo
And there, also a way to get the next head
 
5:16 PM
I think that has the same issue as mine, unless he didn't care about it (i.e. I misread what he actually wants).
 
I gotta try it soon. ish.
 
Xeo
@Rapptz Which issue?
 
I kinda imagined him doing it because he didn't want to type it twice in a function or something.
But I guess not :v
My stomach's been hurting a lot lately. :(
 
@Rapptz Join the motherfuckin' club
 
Xeo
@DeadMG y u working on useless syntax highlighting?
 
5:20 PM
I actually wonder if flushing is necessary if you're using raw I/O.
 
to prove that my components are suitable for it
undoubtedly, I will write the shittiest highlighter/outliner/etc ever
 
@EtiennedeMartel I parked my own answer to that question, and I referenced @StackedCrooked
 
13 secs ago, by Etienne de Martel
Alright people, let's Lounge that up.
 
but firstly, it looks a lot nicer to be demoing your language with even some tooling already existing
 
5:20 PM
Oh, haha.
 
Raw I/O has no buffering. But I wonder if a program block until a raw I/O is complete. (Flushing guarantees that it will block.)
 
and secondly, other people can build better stuff on top
 
11
A: In simple terms, what is the purpose of flush() in ostream

MysticialIf I had to guess, the word flush comes from exactly what you'd flush in real-life. So let's try a toilet analogy: Flushing every time a new one drops into the bowl is very time-consuming and a complete waste of water. That's a big problem today where everyone's trying to be environmentally fri...

How's that question different from this :(
 
Oh, it's not.
maybe we should close as a dupe?
 
Wow that answer's old.
 
5:24 PM
@DeadMG module is a keyword? :O
 
@Rapptz Clearly,
it's because you don't have cereal.
@Rapptz I don't think I can vote to close as a dupe. =[
 
@ThePhD yup.
 
@ThePhD It's okay.
We don't close questions anymore. We put them on hold.
 
Lul.
Ooh, yay, 1530 rep. <3
Maybe one day I'll catch up to @Rapptz.
 
5:30 PM
doubtful
 
Apply water to burned area
 
so
1 hour 30 until Herb's keynote
 
Xeo
Brb, changing pants.
 
lol
 
What is the C++ map type?
 
5:33 PM
map
 
Xeo
Think, Google, seriously?
 
user142019
Hmm.
 
Maybe.
 
user142019
      program hello
        print *, "Hello, world!"
      end program hello
 
user142019
This prints " Hello, world!", not "Hello, world!" :|
 
user142019
5:34 PM
@Pawnguy7 std::unordered_map<K, V>
 
johannes
 
wtf language is that
Holyshitmylanguagehastheworstnameever?
3
 
inb4 zoidlang
 
user142019
5:46 PM
@DeadMG Fortran
 
Is there any way to "link in" shared object dependency files such as libstdc++.so.6 into my compiled binary (with g++) so that I don't need to distribute the libraries?
 
user142019
Maybe. I think not.
 
Yeah you can.
Static linking.
 
How?
I'm using already compiled .so files though
 
I don't know.
I could look it up but I don't feel like doing that.
:P
 
5:50 PM
Looked it up; didn't find anything
 
have you considered not using shared libraries, if you don't intend on them being, well, shared? Like, you want to statically link them into your executable, so... use the statically linked versions?
 
31 mins ago, by DeadMG
user image
looks cute, what lang is that
 
Wide
 
Lol.
Telling Johannes about your programming language.
 
-1
Q: Difference Between WINAPI in C and C++

user2178841I am reading data from driver. The driver came with examples on how to develop applications based on the driver. The examples were written few years back. They use WINAPI and C. Now I will use their some header files. They have data structures and various other stuffs defined. I tried creating a...

 
Now you're going to have Riddles in your standard before you can even blink. :3c
 
Why do you use := for assignment?
 
why does Main not have return type int?
 
hmm, a bit over an hour until Herb Sutter's talk, I think? Should be interesting
 
5:52 PM
yep
1 hour 8 minutes
 
what will he talk about? where?
 
@JohannesSchaub-litb At Build
 
you mean he will talk on channel-9 live?
ohh
 
"The Future of C++" (as far as MS is concerned)
 
@DeadMG // comments are nice but a nestable multiline comment syntax would nice as well.
 
The future of C++ or "How were catching up to a standard from 3 years ago" ?
 
I have /* */ comments
 
@StackedCrooked I think he has that.
 
which can be nested in Wide.
 
Excellent! :D
Now I want to use Wide.
Where can I download it?
 
5:54 PM
@Borgleader The Future of C++, or "How we double-move initializer list arguments"
 
user142019
@StackedCrooked := is initialization.
 
@ThePhD oh? Their initializer lists are broken?
 
user142019
IIRC.
 
Ah, type is deduced?
 
@jalf Extremely.
 
5:54 PM
That's cute...
 
@StackedCrooked Er, yeah, it's initialization with type deduction. I accidentally made 2 variables named "x".
 
It doesn't properly move things.
 
12pm to 1pm?
 
@StackedCrooked From my repo.
 
So initializer-list based stuff is kind of horrible.
On the bright side, it has Unicode identifiers. So you can go bananas.
 
5:55 PM
it's now 6pm
 
@ThePhD Cute. Given their track record, that means it'll be fixed in VS2014 at the earliest
 
so it's still 6hours till he talks
 
@ThePhD One banana for you, one banana for me!
 
or is my math off?
 
wrong timezone.
he's talking in an hour.
 
5:56 PM
@jalf Well, this is the preview and that's a pretty high-priority bug I think..
 
he's in USA?
will it be live?
 
//build is in the USA I'm pretty sure... I think.
 
@ThePhD So? VS2010 never managed to fix its broken lambda implementation, in its entire lifetime :)
 
@JohannesSchaub-litb It's live now on channel9.
Not yet herb though.
 
5:57 PM
but it says "Video will not be available until 24-48 hours after the session ends"
oh you mean on the frontpage of channel9
 
@JohannesSchaub-litb I think the live stream will be... live streamed, and a separate downloadable version will be available later on
 
... i have never used that webpage, dunno how it is organized
 
@JohannesSchaub-litb That's the VoD. The live stream is live streamed.
 
@EtiennedeMartel What's up with the guy on the right?
 
I need a container that uses contiguous storage and that allows fast prepending and appending.
 
6:00 PM
circular buffer
 
@StackedCrooked magic_vector?
 
It may allocate extra storage for offset.
 
@EtiennedeMartel what does that pic have to do with butt plugs?
 
user142019
@EtiennedeMartel repost
 
i guess i missed the joke
 
6:01 PM
preallocate a large vector and put your data in the middle, so there's some room to grow in both directions?
 
@StackedCrooked a vector with capacity on both ends? I wrote one of those once. I have it somewhere. Probably never finished it though
 
@JohannesSchaub-litb The one guy in the front smiling
 
user142019
@JohannesSchaub-litb only one person is smiling.
 
@jalf Yes, that's what I want and what I have. But I was wondering if boost has it.
 
user142019
6:02 PM
me too
 
@StackedCrooked There is a boost::circular_buffer, I believe.
 
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. — BoltClock's a Unicorn 14 secs ago
 
@DeadMG most circular buffers do not have contiguous storage
 
@DeadMG I don't think it meets my requirements.
 
(unless you do funky tricks with memory mapping)
 
6:03 PM
I want it to expand if needed. Not overwrite previous data.
 
user142019
@StackedCrooked std::vector
 
user142019
Fast enough. :)
 
Lol, you may be right.
 
user142019
Of course I'm right. I'm not wrongfold.
12
 
no push_front on vector though?
i thought that was a requirement?
 
6:05 PM
@StackedCrooked It's not a super hard container to write yourself
@Borgleader it's not
 
@MooingDuck I already have. But I wanted to check if maybe there is something better.
@rightfold I'm a lefty.
 
7 mins ago, by StackedCrooked
I need a container that uses contiguous storage and that allows fast prepending and appending.
 
@Borgleader ah, misunderstanding. I thought you changed the subject to ask if a standard conforming vector was required to have a push_front member.
 
is there any bound on how often or how much it is expected to grow downwards?
 
Are you asking me?
 
6:08 PM
@MooingDuck Oh that makes sense, my statement was ambiguous
 
@StackedCrooked yeah
 
user142019
@Borgleader Doesn't mean you cannot insert an element at the front of a vector.
 
@jalf yes, I have this information. let me check..
 
5 hours ago, by melak47
well, we can't have proper working initializer lists, but at least MSVC supports bananas
^^ Is banana support in the standard? Or just an extension?
 
@Mysticial Banana-Oriented Programming?
 
6:13 PM
 
@DeadMG Does Wide support bananas?
 
nope
well, actually
 
@jalf Bananas are already wide even in UTF-16.
 
you probably could get away with it.
I don't know.
although
 
... Oh. I just saw that ti was about buttblugs. So that's why he's smiling.
 
6:15 PM
I do support numerically-introduced identifiers
 
float a = 3.41;
float *pa = &a;
float c = 6.41/*pa;
cout << c;
what's wrong with that code!?
 
like, say, 3DScene is a valid Wide identifier.
@JohannesSchaub-litb Comment, obviously. Try harder.
 
user142019
Even then, it's still wrong because of the missing std:: and the extraneous pointers.
 
user142019
It's bad code and you should feel bad.
 
6:17 PM
pointers are good if you teach them behave
 
user142019
Ah, like puppies.
 
Puppies don't point. They bark.
 
WOOF WOOF MOTHERFUCKER
7
wait, what were we talking about?
 
@DeadMG But something like 3 isn't a valid identifier, right?
 
le nope
 
6:19 PM
There's a lot of times where I wish I could do that in C# and C++./
 
who else knew that std::flush in MSVC doesn't write to disk? Apperently Mysticial thought it did.
 
It's probably fine
 
@MooingDuck Clarify?
It flushes the stream, as the name implies. Which sends the data to whever the stream is pointed at, which might be the file system, in which case it goes straight into an OS buffer from which it may or may not be written to disk
Assuming, of course, that there actually is some stream data to flush
 
@jalf std::fstream("myfile.txt") << "HI" << std::endl; executes, and then complete power failure. File is empty, because Microsoft didn't flush to disk.
@jalf that is correct. Many people seem to think it guarantees a flush to disk.
 
6:23 PM
@MooingDuck ah, sure, because (1) flushing to disk is expensive and no OS does that eagerly, and (2) even if the OS attempts to flush (fsync() or similar), a ridiculous number of harddrives use drivers which optimize it away and internally buffer it again
 
heh, so that's at least three buffers? awesome
IMO, std::flush should go to disk, or at least provide another function to allow it. Such a thing is required for certain types of code.
 
Well, pretty much all harddrives have their own internal buffer (at least mechanical ones. Not much point on SSD disks, I guess), and yeah, all the OS can do is send the data to the disk, and then ask it to flush, but often, the disk will actually ignore that request and just keep the data in its buffer
 
std can't offer it if OS doesn't offer it
 
because looks good on benchmarks
@MooingDuck Have you seen how incredibly slow code requiring a flush to disk gets?
 
user142019
Fast enough.
 
6:25 PM
@DeadMG std can't offer files if the OS doesn't offer it too. But it the capability is there, it ought to be used. I'm not proposing a change to the spec, merely the implementation.
 
@rightfold no
 
@jalf fine, don't use std::flush if you don't mean it
 
user142019
Yup.
 
@MooingDuck "certain types of code" have other mechanisms for telling the OS to flush
 
Flush != fsync, I don't know what you were expecting.
 
6:26 PM
@jalf true, but it'd be great if streams had a standard manipulator for it
 
I need to build a Desktop PC...
 
@MooingDuck Except that often, all you care about is getting the data out of your process (so that if your process crashes, the data is not lost, but will eventually be written out by the OS)
And then you certainly don't want to pay for an fsync on every goddamn flush
 
@jalf True. We need two separate manipulators.
 
@MooingDuck And what should that standard manipulator do when used with a network stream? Or a printer stream? Or a stream going to the console?
fsync is a disk operation, not a stream operation.
 
@jalf I usually use FlushFileBuffers() since I usually use the WinAPI for critical I/O anyways. At least that one is guaranteed to go all the way to disk.
 
6:28 PM
@jalf flush to "host", and flush to device, whatever the device may be
 
@Mysticial No. It is guaranteed to go as far towards the disk as possble (see above comment about lying disk drivers)
 
@Mysticial No, it's not.
fsync/FFB is a filesystem operation.
 
@jalf note, every stream in C++ has a sync member that's used here.
 
Hardware has its own buffering.
 
@MooingDuck But the stream is an in-process thing. It doesn't know anything about "host" vs "device". It just knows "I write my data to here when I write it, and when you flush me, I write my data"
A C++ stream is not a file. Nor is it a socket, or a printer or anything else
 
6:30 PM
30 minutes to Herb speech
 
30 minutes to disappointment
 
15 minutes to my next tea.
 
@jalf Yeah I saw that. But is the HD acknowledge I/O events back to the OS? I'd assume that a flush to disk is supposed to block until the acknowledgement is received.
 
@StackedCrooked I'm excited. Not for what he's going to say, but I anticipate the reaction :)
 
You are a specator.
 
6:31 PM
@Mysticial HDD hardware can respond immediately to flush command and keep the data in a buffer anyway.
 
@jalf it ought to be able to handle two types of flushes. "Flush to host", and "flush to host and tell host to flush to device". That applies to files and sockets and printers and consoles and stringstreams.
 
first, people are going to applaud because (1) when you're there in person it feels kind of rude to not do that, and (2) the people who are there are probably more favorably disposed towards MS than most, and then, within the next hour or two, all hell is going to break loose on their blogs and twitter and whatnot
 
What's the speech about?
 
@CatPlusPlus Good point.
 
(Obviously, for stringstreams, both flushes do nothing, and that's fine)
 
6:32 PM
@Mysticial Sure, but how does the OS know if the HD is honest? "Huh? yeah, sure, I flushed everything to disk. It's definitely not just lying around in my cache, nossir!"
The OS has no way to check. It just tells the disk "please flush everything you have in your cache. I need it to be stored reliably on disk", and then the disk replies "ok, done!" after doing precisely nothing at all
@CatPlusPlus Herb's speech? About "the future of C++"
 
@jalf Right. So then it's up to the HD specifications.
 
@Mysticial no, it's up to the HD implementation :)
 
@jalf Well, if the HD isn't specified to have completed a write upon acknowledgement, then that's the problem right?
 
@Mysticial msdn.microsoft.com/en-us/library/windows/desktop/… "...then the data is immediately flushed to disk without going through the Windows system cache. The operating system also requests a write-through of the hard disk's local hardware cache to persistent media."
 
6:35 PM
My old database teacher always said that this was the main reason why serious databases should use enterprise-class disks. Not because of performance or more robust and reliable hardware or anything, but because those are more likely to actually be honest about flushing
 
I flush the toilet every time I use it
 
@Mysticial Most of the time, no, not for most users. And it looks good in benchmarks ;)
 
@MooingDuck I often use FILE_FLAG_NO_BUFFERING for computational stuff.
But it's a bitch to manage though.
 
@CatPlusPlus -that's a good link. "If the power went out in the middle of the call to FlushFileBuffers (say, after it wrote out the data containing the new index but before it wrote out the data the index points to), you would've gotten partially-written data anyway. If you're not doing transactional work, then your call to FlushFileBuffers didn't actually fix anything. You still have a window during which inconsistency exists on the disk."\
 
if you enter "cd .. && cat /tmp/*-*/main.cpp" you can print out everything ever pasted into coliru's stack-crooked!
 
6:40 PM
@CatPlusPlus nice link
So in Windows, it actually goes an extra step to make sure the HD's ram is cleared.
And then HDs cheat that as well?
 
We should get rid of storage devices altogether and just have buffers obviously :v
 
Actually, if you come to think of it, the HD is required to properly respond to a command that asks it to flush everything to disk.
That's because the HD doesn't know when the machine is legitimately shutting down.
And when the machine shuts down, the power is cut out without warning.
 
Power isn't cut abruptly when machine shuts down.
 
@CatPlusPlus To the HDs.
 
Unmounting?
 
6:47 PM
From the HD's perspective, the power just cuts out.
 
@Mysticial they have capacitors to sustain them just long enough to park
 
It doesn't know when it will come, so it must rely on some signal (such as the OS) that it is coming and it must flush its buffers.
 
if they didn't a HDD would be fucked in a power cut, but funny enough, they are not
 
@thecoshman They have enough to park. But not necessarily enough to flush the buffer.
So they need to rely on a signal from somewhere to flush the buffer before the power goes out.
So if it's the OS that sends that signal, then you could implement a FFB by sending that signal.
 
hmm... not sure... they could store enough charge to flush their buffers... not sure if they do or not...
 
6:50 PM
@thecoshman If they have enough to flush the buffer, then that's perfect. The whole thing we want to avoid is partially written data after FFB returns.
Because you assume that if FFB returns, all the data is safe.
"Safe" also includes, "power is out, but there's enough residual power to write to disk".
 
Whether it's required or not, HDDs lie anyway.
 
*barring shit corner cases such as a CRC fail during a write.
 
wanna see rockstar herb. 8 minutes left!
 
thing is though, power outage is a something that should hardly ever affect a server.
 
We're not talking about servers.
 
6:53 PM
I can't fathom who in their right mind would be running software that requires that level of 'faith' that data is wrote to disk without using a UPS
 
JBL
@JohannesSchaub-litb I'm completely ignorant about the guy, (except a lot of SO question are from people reading his content). Worth it ?
 
@CatPlusPlus meh
 
@JBL i dislike his "auto"-pornos
 
A what?
 
UPS - Uninterruptible Power Supply (stupid name I know)
 
6:56 PM
lately he tries to use "auto" everywhere, even if it decreases readability IMO
 
Type inference never decreases readability.
 
unnecessary <insert things here> always decreases readability
 
:laffo: C++ world.
 
put a thousand spaces betweenthesewords and you decreased readability
 
@JohannesSchaub-litb not really. Well, the fact you are using auto should not impact readability.
 
6:58 PM
saying "auto x = Widget{};" when you could have said "Widget x{};" decreases readability
 
yes, but that is just bad code
 
1) unnecessary second type name involved ("auto") 2) unnecessary initialization overhead involved ("= ...")
 
Oh my god the overhead is just TOO MUCH
 
@thecoshman i'm glad you agree.
 
:lol:
 
6:59 PM
@JohannesSchaub-litb no, you missed my point
 
@thecoshman The important part isn't getting the data intact on disk. It's knowing that it isn't intact when it isn't. FFB returning is supposed to indicate that the data is intact. If it doesn't return, or the HD outright dies, then you know that the data is not intact.
 
@thecoshman i'm all ears
 
@JohannesSchaub-litb What if there are several such variables being initialized in a block?
 

« first day (986 days earlier)      last day (3964 days later) »