« first day (151 days earlier)      last day (2926 days later) » 

00:23
@Jerry Coffin @milleniumbug
Thank you very much for very detailed explanation, sorry for late response, I slept
Consider this code, http://ideone.com/8txwBg
I remember that fgets() is leaving the newline character while gets() is not.
It can be seen that scanf does implicitly similar to ungetc('\n', stdin); call
That's why the string variable contains 10 ASCII value at index 0

Am I right?
Based on your beatiful detailed explanation, please correct my points

(1) We know that stdin is a pointer to FILE structure
(2) the FILE structure will record all the information to manipulate the stream.
(3) While the stdin is definitely a stream which came from the keyboard,
(4) the stdin stream goes straight into the platform implementation-defined temporary storage

@Jerry Coffin @milleniumbug, am I right?
(5) stdout and stderr came from a distinct platform implementation-defined temporary storage.
(6) Both stdout and stderr go straight into the monitor.
00:38
9 hours ago, by milleniumbug
Now, in commonly used operating systems, like Windows and Unix derivatives, you can actually make the program actually read the input from another source, for example, from a file. Not only that, you can make it so the output is written to the file.
IOW (6) is not necessarily true
You are right, it makes sense, so stdin is usually came from the keyboard, but it may came from another source.

Umm, I think the method to make stdin came from another source is like this fwrite(&string, sizeof(string), 1, stdin);
wut
no, not really
@milleniumbug yes as you have pointed in (3) also, it musn't be a monitor.
Ah, I see the stdin stream is usually go into the platform implementation-defined temporary storage, but you can change it, such as this command fread(&string, sizeof(string), 1, stdin);
And stdout and stderr is usually came from the platform implementation-defined temporary storage, but you can also change it too
There must be a default condition where do the stdin stdout and stderr came from and go into, such as the platform implementation-defined temporary storage, am I right?
00:53
@Unknown123 fread is a reading function, just like scanf, fgets and like
@milleniumbug whops, I mean fwrite
fwrite is a writing function, just like printf, puts and fputs
wait, brainstroming, fread will copy from the keyboard into the string, um... but it came from and goes into temporary storage first..

So how do you change the stdin stream source and its destination?
I'm too lazy to read the wall of text on top. What is the question? You probably don't want to change the input/output streams, rather read a file or something similiar?
01:12
@Mikhail No, I'm talking about the most very basic concept of standard stream. I'm talking about the possibility, is it possible to change the stdin stdout std source and its destination?
Yes, you can but what source do you want?
@Unknown123 freopen
also from outside world, by using output redirection and piping (which is outside the scope of C standard)
The correct way is piping
01:27
stdin stream : Keyboard/Other Source <--> Temporary Storage/Other Source
stdout, stderr, stream : Temporary Storage/Other Source <--> Monitor/Other Source

C11 Latest Working Draft N1570 on page 307 at footnote no. 272 state that
"272) The primary use of the freopen function is to change the file associated with a standard text stream (stderr, stdin, or stdout), as those identifiers"

Bravooooooooo, beautifulll,
I understand now, indeed we can change the implementation-defined temporary storage in order to write or read data from it into any another source.
But the correct way is to use pipes
30
Q: Generating random noise for fun in /dev/snd/

jonesRecently I have been exploring the enchanted /dev folder. I want to write some random data to an audio device in order to generate some noise. I am using ALSA. So I instruct cat to pipe some random data to the playback file in the /dev folder... cat file-of-random-data > /dev/snd/pcmC0D0p t...

@Mikhail @milleniumbug
Umm, please correct me if I wrong, I think redirection and piping only temporarily switch the platfrom implementation defined temporary storage into any desired storage.

While the actual stdin stdout and stderr temporary does not change at all.
Am I right?
What are you actually trying to do?
@Mikhail Understanding the concept.......... for two days, it's very difficult for me honestly.....
Basically, if you need to transform text from some non-standard input device (even if its sound!), the best way is to pipe that data into your program
The actual temporary is implementation dependent, magic stuff is done to make pipes fast
hell you might have to recompile your kernel :-)
01:43
Beautiful explanation, so indeed it is also platform implementation defined the me the method of piping and redirecting.

It can be
1. Switch the actual temporary storage stream with the desired one (Does not change the actual temporary storage)
or
2. Change the actual temporary storage stream with the desired one, process something, Change it back from the desired one into the actual temporary storage again
or
anything else

The method is "implementation dependent, magic stuff is done to make pipes fast" hahaha
@Mikhail it's just only the concept of stream that I was trying to understand, it is a wonderful experience indeed lol hahaha
The rabbit hole goes really, really deep. Soon you're going to hit long and far pointers...
02:02
@Mikhail I thought that there is only one type of pointer, after searching a little bit I am wrong.. okay enough for today.. hahahaha
@Mikhail @JerryCoffin @milleniumbug

C11 Latest Working Draft N1570 on page 307 at footnote no. 272 state that
"272) The primary use of the freopen function is to change the file associated with a standard text stream (stderr, stdin, or stdout), as those identifiers"

One last thing, does the standard also confirm that the sterr, stdin, and stdout are opened with text stream? or it is platform implementation defined whether it is text or binary stream?

The only thing I can sure is the orientation
Do the compiler writer must follow those standard footnote?
@Unknown123 Going from memory, text (don't have time to confirm right now though).
@Unknown123 footnotes are non-normative
So it can be concluded that its orientation and its stream are platform implementation defined?
@Unknown123 while the footnotes are non-normative, they usually follow from the paragraphs they're referenced from
umm, so it is compiler writer implementation defined then?
02:13
@Unknown123 no, it usually means "this follows from the other rules, you just have to follow the track"
not really in a mood for doing so right now
 
4 hours later…
06:05
Are you sure that the C11 standard footnotes are not-normative? I can't find in the standard which states like that

I only found this at the introduction section on page xvii
"4 Examples are provided to illustrate possible forms of the constructions described.
Footnotes are provided to emphasize consequences of the rules described in that
subclause or elsewhere in this International Standard. References are used to refer to
other related subclauses. Recommendations are provided to give advice or guidance to
 
4 hours later…
09:42
@Unknown123 It's in the foreword
09:57
"Annexes D, F, G, K, and L form a normative part of this standard; annexes A, B, C, E, H, I, J, the bibliography, and the index are for information only. In accordance with Part 2 of the ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples are also for information only.

This one?
It refers to the annexes right?

I can only find 2 paragraph which contains "foot" word in it using CTRL+F
10:12
@Unknown123 "In accordance with Part 2 of the ISO/IEC Directives, this foreword, [...] footnotes, [...] are also for information only. "
"In accordance with Part 2 of the ISO/IEC Directives, **this** foreword, [...] footnotes, [...] are **also** for information only. "

What does the word "this" on that context refers to?
Notice the word "also"
I think it refers to the annexes A, B, C, E, H, I, J, the bibliography, and the index

What do you think?
this paragraph is located in the foreword section, i.e. it talks about itself
The conclusion is that

(1) Footnotes are not form a normative part of this standard
(2) Footnotes are for information only
(3) Footnotes are provided to emphasize consequences of the rules described in that subclause or elsewhere in this International Standard

Am I correct?
10:27
yes
user1593881
10:47
Is there any reason as to why the OP uses these functions yet passes an enum as arguments? This is the SO post in question
user1593881
The OP has void test(int i, MyVal val) and void test(int i, double* val) overloads yet passes in an enum. What is the logic of having this design?
MyVal has a non-explicit converting constructor from Code
also this is a "why is the language behaving this way" so the code does not really have to make sense by itself
user1593881
I see. Thanks.
15:03
Hi fellow, i have a problem to control a parallel diagonal, in a matrix 2d, at the principal two by two if one is reverse the other. I'm thinking to help me with a support arrays but it's not the best idea. So i'm asking you help
nwp
nwp
15:29
@Andrew What?
How does one control a parallel diagonal, how can it be in a matrix 2d and what does the rest mean?
15:48
Hi.
There was a discussion in our c++ class today.
about some syntaxes like Person(string name, int yy, int mm, int dd) : bdate(yy,mm,dd)
because we don't have a default ctor for bdate:Date(int, int, int), so we are obliged to construct Person like this.

Why c++ has this kind of rules?
C is not C++
any object must be constructed
not being default constructible means the construction can't happen without passing in additional arguments
that doesn't mean you should make all your classes default constructible
in fact, having a Date class default constructible is a very silly idea
there's no "default date" that makes sense
16:04
yes we learned about them years ago.
I know what you mean
nwp
nwp
@m.vincent So what would you do instead? Force every object to be default constructible? Forbid member objects that are not default constructible? Those don't seem like good alternatives.
some languages do require having a default constructor
this results in people using invalid objects
16:50
@nwp That is not my real question. I'm aware of good programming practices.
17:33
Hello, I am facing a library related issue with KMDF in VS2015, can i discuss?
go ahead
I am newbie to Driver Development, i installed Visual studio 2015 then Windows Driver Kit(WDK) 10. after that now i am trying to create a hello world KMDF project, follow all the procedure to create new KMDF project in VS2015, but library path is not set, i do not know where is library file is kept. project is not finding "driver.tmh"
> follow all the procedure
which one
and, if a library path is set, you can just try finding it wherever the KMDF got installed
yes i do know KMDF is install or not
no I mean the specific file
17:41
from where i can install KMDF lib file?
is it located in the directory the KMDF got installed to
i just install VS2015 and WDK10 and nothing else. do i need to install other library related to KMDF
3 mins ago, by milleniumbug
which one
i.e. which instruction are you following
ok, please explain me what should i do?
that was a question
2 mins ago, by milleniumbug
i.e. which instruction are you following
17:48
instruction means, i create a simple hello world project from, File-> New-> Project->Visual C++->Windows Driver->KMDF Project, after that default source file are there, but it is not able file "driver.tmh"
i know KMDF library is missing, but how can i get library for KMDF?
hey milleniumbug, could you please recommend me the best book for Windows Driver, if you know?
sorry, I'm not that familiar with any books
2
I know some low-level Windows books I could recommend, but they aren't driver development specific
Thank you so much for your help. :)
 
5 hours later…
22:36
"267) The three predefined streams stdin, stdout, and stderr are unoriented at program startup."

"272) The primary use of the freopen function is to change the file associated with a standard text stream (stderr, stdin, or stdout), as those identifiers"

So it can also be concluded that (stderr, stdin, and stdout) initial orientation is implementation-defined and whether it is initially text or binary stream is is also implementation-defined?
> are unoriented
this clearly means the initial orientation is "no orientation"
22:53
@milleniumbug wait, if it is non-normative, then it is up to the compiler writer to follow those footnotes or not right? Am I right?
http://isotc.iso.org/livelink/livelink/fetch/2000/2122/4230450/4230456/ISO_IEC_Directives%2C_Part_2%2C_Principles_and_rules_for_the_structure_and_drafting_of_ISO_and_IEC_documents_-_2016_%287th_edition%29_-_PDF.pdf?nodeid=17667902&vernum=-2

The ISO/IEC Directive Part 2 on "26.5 Specific principles and rules" section in page 52 said, "A footnote can appear anywhere within the text of a document apart from terminological entries. Footnotes shall not contain requirements (e.g. use of “shall”, see Table 3) or any information considered indispensable for the use of the document, for example ins
21 hours ago, by milleniumbug
@Unknown123 no, it usually means "this follows from the other rules, you just have to follow the track"
@Unknown123 the entire expression is "statement of fact" and that's how it should be interpreted
@milleniumbug Wait,umm, so even though the footnotes are non-normative, the compiler writer must follow it?
@milleniumbug Umm, actually I still clearly not understand what do you mean by "this follows from the other rules, you just have to follow the track"
23:13
@Unknown123 this means there exist several requirements elsewhere in the standard which pretty much enforce whatever the note is informing you
in fact, for the orientation you have to follow the definition of "stdin" and the definition of "unoriented"
(yes, if something is informative it means it doesn't constitute a requirement. but it doesn't mean that whatever it is saying is wrong)
Umm, what if I can't found any requirement which enforce the informative note?

"Each stream has an orientation. After a stream is associated with an external file, but before any operations are performed on it, the stream is without orientation. Once a wide character input/output function has been applied to a stream without orientation, the stream becomes a wide-oriented stream. Similarly, once a byte input/output function has been applied to a stream without orientation, the stream becomes a byte-oriented stream. Only a call to the freopen function or the fwide function can otherwise alt
> After a stream is associated with an external file
> stderr, stdin, stdout which are expressions of type ‘‘pointer to FILE’’ that point to the FILE objects associated, respectively, with the standard error, input, and output streams.
ok, these don't seem to connect, hang on
23:36
Yes it does make sense, because the directive part 2 said that it must be a fact, it mustn't be wrong, it must be true,

In my understanding, if something is informative it means it doesn't constitute a requirement, and because of it, the footnotes are platform implementation-defined
Am I right?
@milleniumbug Thank you very much sorry for make you busy....
@Unknown123 "Footnotes are provided to emphasize consequences of the rules described in that subclause or elsewhere in this International Standard."
^ from Introduction
@Unknown123 oh, there's a third one
> At program startup, three text streams are predefined and need not be opened explicitly — standard input (for reading conventional input), standard output (for writing conventional output), and standard error (for writing diagnostic output). As initially opened, the standard error stream is not fully buffered; the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer to an interactive device.
state a fact, emphasize, but non-formative and doesn't constitute a requirement.
What kind of footnotes is this..
23:52
actually we need a fourth one
> A stream is associated with an external file (which may be a physical device) by
opening a file
Ahaaaaa, so three of them is initially text streams, NICEEEEEEE

In order to understand the source of footnotes, we must find in the whole standard which state directly to it and it can take a lot of time because ctrl+f might not work well with this

« first day (151 days earlier)      last day (2926 days later) »