« first day (686 days earlier)      last day (4262 days later) » 

2:03 PM
@R.MartinhoFernandes Turning into?
 
Oh well. I hope you won't start murdering everyone.
 
does conversion happen when using input/output with textfiles?
 
What kind of conversion?
 
@DeadMG Did you vote to delete the -3 answer (VC6) in the pointers question? (you should – it simply doesn’t belong there and is clutter because it’s so long)
 
I can't vote to delete
 
2:12 PM
@R.MartinhoFernandes When i send an int to a textfile , does it get converted to another type of data when it gets stored in the textfile?
 
@KonradRudolph Am I reading it wrong or is it advocating some form of UB?
Or is it simply about mistaking a memory leak for something else?
 
@DeadMG Wot? Weird, you have more than 10k points, isn’t that a privilege then?
 
Delete requires 20k.
 
I think you have to have more downvotes if it's on a popular question
 
ah, ok
not for an answer, -3 should be enough
 
2:15 PM
@KonradRudolph -1 is enough.
 
yup, just read it myself
 
@MohamedAhmedNabil Text files contain text. I don't understand the question.
 
@R.MartinhoFernandes Ok perfect they contain "text". Text in C++ is either . c-string or std::string. Which one is the text file considered to be? (or neither)
 
Xeo
Still not following my advice to get a book?
 
@Xeo begginer books dont go into such details
 
2:20 PM
@MohamedAhmedNabil Now that question doesn't make sense. The content of files is outside the scope of C++. It doesn't have a type.
@MohamedAhmedNabil There are no such details.
 
@R.MartinhoFernandes OK. I kinda understand now i just need someone to confirm this:
When i send a variable to a text file, the value stored in it will be stored in the text file as "text".
 
even int and double and std::string ?
 
@Xeo Second warning! :p
 
Xeo
2:23 PM
@StackedCrooked Huh?
 
you guys didn't plonk that troll yet?
 
@DeadMG Oh, it's a troll?
 
mohamedahmednabil
 
If you mean me, I respect the people here too much to troll them
 
Ok, question time with Konrad again
 
Xeo
2:25 PM
Yay, fun times
 
what was the reason again that C++ forces me to write this:
[](std::string const& a, std::string const& b) {
    return a.length() < b.length();
}
instead of this:
[](a, b) { a.length() < b.length(); }
 
Xeo
Concepts.
 
… which were dropped.
(Also: how so?)
 
Xeo
for now
 
Dave Abrahams wrote something about this, didn’t he?
 
2:26 PM
@KonradRudolph But the lambdas were not changed so as to not make concepts next to impossible in the future.
 
Xeo
They want to add them to a later standard, and they didn't want to make it impossible by allowing polymorphic lambdas without resolving the issues yet
 
@KonradRudolph Yes.
 
hmm. So IIRC the objections are now well and good obsolete?
 
Hi everyone, did you guys know where I could find some code in C about drawing primitive objects, like square, circle, etc ?
 
And we can expect the lambda syntax to be streamlined in the next release of the standard?
 
Xeo
2:26 PM
Hopefully
 
@ValterHenrique drawing on what?
 
Xeo
I atleast hope to find such a proposal in the next mailing
 
@FlorianMargaine it's just to show on the windows
 
@ValterHenrique Lounge(C) ≠ Lounge<C++> … but here’s a bone: libsdl.org
 
2:27 PM
which windows?
if it's the terminal... you don't really need a library
if you're using a library, see with it
 
@KonradRudolph I know, it's just more easier to change C++ to C
 
Xeo
wat.
 
@R.MartinhoFernandes obrigado
 
int c = 5;
obj << c; //converts the value of C to text
obj >> c; //converts text to an int value and stores it in c
 
@ValterHenrique It's not easy to change either of them to the other. But it's harder to change C++ to C than vice-versa.
@KonradRudolph :)
 
2:29 PM
Is this right (especially the the input part)
 
@R.MartinhoFernandes sure
But I need raw code, without using libraries
just stdio.h and stdlib.h
 
Xeo
No
The C (or C++ for that matter) standard has no notion of "windows", "drawing" and stuff
Also, <stdio.h> and <stdlib.h> are part of a library - the standard library.
 
@Xeo you're right, what I mean it's I need to draw some circle (as example) and show it, I have to use DEV C++ (yeah I know that's horrible IDE =] )
 
@ValterHenrique Sorry, I don't know what that means.
 
Xeo
The IDE is unimportant
 
2:34 PM
@R.MartinhoFernandes, @Xeo, imagine if I tell you guys, draw a circle using C, that's it
 
The only circles you can draw with <stdio.h> and <stdlib.h> are ASCII art circles.
@ValterHenrique We'd tell you to use something like SDL.
Because that's how people draw circles in C.
 
but I can't, it has to be something more lower
it's a demand from my teacher
I know glut and opengl
 
Then use OpenGL.
 
but he don't want this libraries, he thinks that way I will understand what these librais do
 
Just FYI, OpenGL is a library.
 
2:36 PM
*libraries do
 
Then ask him what he wants.
You can't do this in C without external libraries. It's a fact.
 
for example, I initialize a matrix, like matrix[1280][1024]
and after some calculations I will able to initialize some of these points with '@' for example
and then draw a circle
 
Ah, now that sounds like something that can be answered.
 
room topic changed to Lounge<C++>: Would atopic qualify as a topic? [c++] [c++11] [c++-faq] [mooning-ducks]
 
How's your trigonometry?
 
2:38 PM
@R.MartinhoFernandes sorry if I didn't explain myselft correctly
 
@R.MartinhoFernandes Committing sins all the time...
@ValterHenrique You probably want matrix[1024][1280] instead. y usually comes before x because of nicer memory layout.
 
@R.MartinhoFernandes my trigonometry it's fine
but I would like to see some codes before starting to code
 
Well, basic code for drawing a circle is easy: just loop from 0 to 2π at some interval and paint at {center_x + radius*cos(angle), center_y + radius*sin(angle)}.
 
@R.MartinhoFernandes great, I was thinking something similar
I think I found what I was looking for
thank you guys
 
0
Q: Constructor requirements in C++11 for POD

Nikita TrophimovWhat kind of constructors can structs in C++11 have to keep this struct as POD? Only initializer-list acceptable? Or maybe there are no any restrictions?

Dupe votes welcome
 
2:48 PM
@ValterHenrique That code is ancient.
byte *VGA=(byte *)0xA0000000L;        /* this points to video memory. */
word *my_clock=(word *)0x0000046C;    /* this points to the 18.2hz system
                                         clock. */
 
@R.MartinhoFernandes on your word that it actually is
@FredOverflow More importantly, it simply doesn’t work.
 
@FredOverflow, you're right
 
I still don’t understand what’s wrong with SDL though …
 
@FredOverflow Oh gwad.
 
@KonradRudolph, it doesn't work, I tested here
 
2:50 PM
That just won't work.
It only works in real mode.
Or whatever that mode is called.
 
@KonradRudolph, I can't use any library, just pure C
 
@ValterHenrique Sure it works, you’re using it wrong.
 
Whatever. It needs to be run as if it was an OS.
 
@ValterHenrique I still don’t understand that either
 
@KonradRudolph, it's a demand from my teacher
 
2:51 PM
@ValterHenrique You cannot draw a circle with only C, unless you restrict yourself to text mode.
 
@FredOverflow, that's fine, I would use '*' as a dot
 
@ValterHenrique I’m sure that it isn’t, you merely misunderstood the requirement.
 
@KonradRudolph, no, I understand very well, he was very clear about this
 
puts("  ****");
puts(" *    *");
puts("*      *");
puts("*      *");
puts(" *    *");
puts("  ****");
 
I prefer working with SDL or OpenGL or GLUT
 
2:53 PM
@ValterHenrique There you go.
 
@FredOverflow hahahahahaha
@KonradRudolph, how did work the code for you ? How did you make it work ?
 
@ValterHenrique Are you implying that SDL doesn't work in general? :)
 
@KonradRudolph Well, the question was created for this sole purpose :) and my answer there covers all that.
 
@FredOverflow, no no, I'm implying that I can't use it, I would like, but I can't
 
@ValterHenrique why are you laughing? That's the only way you can make a circle in C. C has no graphics, no VGA memory, nothing excpet stdout/stderr, which lets you output plain text. Anything else is a library.
 
2:57 PM
@jalf And even stdout comes from a library ;P
 
You can make your computer get hot with pure C.
 
@jalf, I laugh because I can't do that simply, I have to use trigonometry, not just as Fred did
 
@R.MartinhoFernandes sure, but it's a language that is part of the C language :)
@ValterHenrique but the output must be the same (or similar)?
 
@jalf, yes, but the user can enter a different value for the size of the circle (I forgot the name in english)
circle(x,y, radius)
radius was the word
 
18 mins ago, by R. Martinho Fernandes
Well, basic code for drawing a circle is easy: just loop from 0 to 2π at some interval and paint at {center_x + radius*cos(angle), center_y + radius*sin(angle)}.
In computer graphics, the midpoint circle algorithm is an algorithm used to determine the points needed for drawing a circle. The algorithm is a variant of Bresenham's line algorithm, and is thus sometimes known as Bresenham's circle algorithm, although not actually invented by Jack E. Bresenham. The algorithm can be generalized to conic sections. The algorithm is related to work by Pitteway and Van Aken. The algorithm The algorithm starts with the circle equation x^2 + y^2 = r^2. For simplicity, assume the center of the circle is at (0,0). We consider first only the first octant and d...
 
3:04 PM
@R.MartinhoFernandes In rmartinho.github.com/2012/07/06/optimal-tuple-i.html you mention something about a tuple implementation with optimal storage layout. Did you finish that / is the source code available for it?
 
@NikiC I haven't finished the blog posts because I want to clean up the implementation a bit for better presentation. But if you're curious, the implementation is here: bitbucket.org/martinhofernandes/wheels/src/default/include/…
If it looks like a mess, it's because it is.
 
that's a lot of templates ^^
 
^ I drew this to understand how tuple_cat would have to work.
 
@R.MartinhoFernandes you gave me some ideas, time to code now =]
thanks
 
@NikiC It's not particularly great because it was mostly hacked up. I think I can reduce it and make it a lot more readable, but haven't taken the time to do it yet.
 
3:18 PM
I find the number of upvotes for this Q stackoverflow.com/questions/12135518/is-faster-than rather baffling. It is a transparently silly question, originating from a silly statement in one book. The top answer is a thorough, well written one, but still. Any particular tweeter I can blame?
 
@CaptainGiraffe "It is a transparently silly question, originating from a silly statement in one book." Sounds like the usual recipe for highly upvoted questions.
 
@CaptainGiraffe You might be able to blame it on r/programming or HN. I saw it one of them them
 
@NikiC What's HN?
 
HN is where you submit your blog posts to get lots of pageviews :P
 
3:21 PM
lol
 
@R.MartinhoFernandes Did not know about this one. Is it worth spending time on?
 
Honestly, I don't know. I only know it exists.
 
@R.MartinhoFernandes I'll take that as a no =)
 
FWIW, I don't spend time on reddit either.
 
@CaptainGiraffe I think it's interesting
And it is at least less hostile than the r/programming community ;)
 
3:25 PM
@Cicada You never came back. Did you get permabananed?
 
@NikiC k, thanks.
@R.MartinhoFernandes Any interesting transcripts to link? :)
 
Nah, I think it was just an isolated joke.
 
@R.MartinhoFernandes I will replace a register allocation algorithm in one of the JIT compilers for the HotSpot JVM at Oracle.
 
is there a way to change cmake gui output once it's been selected? i picked mingw makefiles, and i think i should've gone with msys
 
@ManofOneWay Oh, kewl.
While you're at it, would you mind fixing a few bugs I'm interested in? ;)
 
3:29 PM
@ManofOneWay Neat. Can you show any code or is it hush-hush?
 
@ManofOneWay That's written in C++?
 
@R.MartinhoFernandes I doubt they write the JVM's JIT in Java.
 
@DeadMG Well, but it could be gasp C.
 
@CaptainGiraffe It's open source
 
Also, why the fuck isn't FileChannel selectable.
 
3:31 PM
@R.MartinhoFernandes Yes, its in C++
 
POSIX files are select()able. There's no freaking reason to not make FileChannel selectable. Argh, right when I was starting to enjoy nio. Threads it is, sigh :(
 
@CaptainGiraffe Yes sir
 
@R.MartinhoFernandes But would the same code work on Windows and whatnot?
what even is FileChannel?
 
@DeadMG Dunno. Can you do asynchronous file I/O on Windows?
(I suppose the answer is yes)
 
3:36 PM
@R.MartinhoFernandes Yes.
 
user784668
@R.MartinhoFernandes Of course.
 
@R.MartinhoFernandes Which bugs do you have in mind? =)
 
for example boost::asio.
 
@DeadMG Then there's no reason not to make it selectable.
 
user784668
@R.MartinhoFernandes Early versions of Windows NT had no synchronous I/O, only asynchronous.
 
3:36 PM
@DeadMG A thingy to do asynchronous file I/O.
 
hmm
 
Which I no longer know how it even does what is promised.
 
if that's all it does, then I guess there's no reason why not.
by the way, I discovered Clang's source goes to new lows
if you want to make semantic entities, you have to create AST.
what the fuck, Clang
 
Oh wait, it's not for async I/O, it seems. There's just no async file I/O API at all. Only for network.
> A channel for reading, writing, mapping, and manipulating a file.
 
user784668
@R.MartinhoFernandes And by early I mean internal builds of NT 3.1, way before it got released.
 
3:38 PM
and their ADL functions takes expressions, not types. Why would you do this?
also their AST stuff is so chock full of Listeners and Visitors I couldn't make heads nor tails of it
 
@DeadMG Ugh.
 
@R.MartinhoFernandes That's kinda suck.
I mean, what I want to do isn't complex or anything like that- I want to make some types, perform some name lookup, mangle some names.
introduce some extra semantic entities
 
Oh wait, there is, in the third I/O API, nio2.
 
@R.MartinhoFernandes rofl
 
@DeadMG The n stands for "new" btw.
 
3:40 PM
I well remember Stroustrup, or maybe it was Sutter, saying how glad they were that they didn't have to go around deprecating huge chunks of their Standard libraries.
@R.MartinhoFernandes I know. Hilarious, isn't it?
 
Yeah.
@DeadMG Well, in this case, the previous two are not deprecated. All three provide different functionality; and by that I mean, functionality that was missing from the previous ones.
And they're all incompatible amongst themselves.
 
lolwotthefuck
I mean, you're not talking about something hard and complicated that people couldn't do for shit until recently, like, I dunno, concurrency
it's file I/O
 
Yep, the new AsynchronousFileChannel is not selectable either. It's a whole different interface, so I can't plug it into my existing asynchronous network I/O code.
Who the fuck designs this crap.
 
dunno
 
user784668
@R.MartinhoFernandes new_nio_v8
 
3:46 PM
@DeadMG So, the simplest way to make some types is to push a string through the parser?
 
@R.MartinhoFernandes That's pretty much all I've got right now.
 
I mean, it's ridiculous
and the Clang mailing list was most unhelpful.
I was like, "Where the fuck do I create a RecordDecl?" and the answer was like "You actually want a CXXRecordDecl for C++ types."
 
Makes sense :P
 
gee, thanks, I had a problem with RecordDecl and now I have a completely identical problem with CXXRecordDecl.
 
3:48 PM
@ManofOneWay They're compiler bugs mostly.
 
namely that they're immutable and I can't find a single function, anywhere, that would permit for their construction.
at least for my immutable objects, I had like x->CreateObject(...); to make them so it was pretty clear WTF to do
I mean, at this rate, I will have to create a C++ string and feed it through the parser
and as for ADL
I don't know what the fuck I'm going to do about that
I mean, the Clang mailing list suggested that I create equivalent C++ expressions
gee, I don't even know if there exist such expressions...
let alone how I could interface them with the stuff I don't need to ADL
 
@DeadMG Implement the first Wide compiler as C++front, lol
 
lol
 
Last night I peeked at the Roslyn samples, and the semantic analysis ones always start by building an AST from a string. I haven't delved into it much, but I hope it's only done for presentational convenience.
 
well, I'd expect a presentation to do that, personally
I mean, you'd want to clearly show the code the semantics came from, else there's not much meaning to it :P
 
3:57 PM
Btw, I need some design input for ogonek.
 
always available
 
As is, my utf16 encoding uses char16_t as the code unit, for obvious reasons.
However, I can't use basic_text<utf16> directly as the native text thingy on Windows, because it would be expected to have wchar_t code units.
 
user784668
Oh.
 
basic_text<utf16> some_text { U"blah blah" };
::MessageBox(..., some_text.storage.c_str() /* needs cast :( */,...);
 
user784668
if ((__aurng() - __aurng.min())
     < __p.p() * (__aurng.max() - __aurng.min()))
    return true;
return false;
 

« first day (686 days earlier)      last day (4262 days later) »