« first day (491 days earlier)      last day (4447 days later) » 

9:01 AM
@FaheemMitha What do you mean? I don't know of any physically starving people
 
@KianMayne : Well, I was asking how you found it.
Though it is a vague question, yes.
 
@ScottW I built one.
 
@FaheemMitha Well it's been OK but I don't manage the finances in my house
 
holy $h@R75 I need to sleep, and yes scott, I'm also calculating the values of PI while watching youtube videos, life is good
 
Wow, my net connection actually stayed up for 20 min. Amazing. (We have low expectations here in India).
 
9:04 AM
I'm also figuring my own gene sequence, just for kicks
 
@Hoxieboy That looks like $horse or shorse
 
@FaheemMitha it must be beautiful over there in india though no?
@KianMayne it was sharts
:P
@ScottW what? I couldn't hear you over my bach symphony
bad spellin'
watch this
@DeadMG Ding
 
@Hoxieboy : Except for a few areas which haven't been trashed, emphatically no.
 
@CatPlusPlus Ding?
 
The popn of India is 1.2 billion. In an area roughly the third of the continental united states. And they are mostly poor people. The ecological devastation must be staggering.
 
9:08 AM
rouse from thy slumber, foul beings
 
@ScottW Hahaha what if you had cleaned it out?
@Hoxieboy He's sleeping
 
But there are a few nice areas left. India must have been really beautiful a few hundred years ago, before the British arrived and trashed the place.
 
@FaheemMitha D: I'm sorry to hear that, I haven't really heard anything about india
@KianMayne thats the whole point ;P
I'm going to recharge my battery pack
catch your guys' pixels later
 
I need some help figuring out some jargon called parametrized type . template <typename T> struct foo { T bar;} here foo is parametrized type and so is bar correct?
 
@ScottW : Bombay, yes.
 
9:19 AM
@ScottW brilliant :D
 
@ScottW : This chatroom needs some dancing. youtube.com/watch?v=8uwp6sqhDw4
@ScottW : Incredibly.
 
sbi
@FaheemMitha The news constantly assure us that Germany's economy still thrives, and our jobs currently are not endangered. We do depend on exports, though...
 
The local subdivision/district where I live, Marine Lines, was listed in Wikipedia as the most crowded subdivision (whatever that means) on earth. At over 200,000 people, its popn is roughly equal to that of the city I was previously living in, Durham NC.
@sbi : Do you agree with that news? :-)
 
sbi
@FaheemMitha What do I know? I still have my job. The company I code for currently makes half of its sales in Germany.
 
Apparently now at no 2 - en.wikipedia.org/wiki/…
@sbi : Hmm, Ok. Do your environs appear prosperous?
@ScottW : Yes, that's India.
 
9:24 AM
How do you even fit that many people in 1.8km^2?!
 
@ScottW : Where is that?
@KianMayne : I dunno. I wouldn't take those numbers too literally, but it is very crowded around here. All of Bombay is, really.
There are lots of people living many people to a room.
 
Can any please answer my question too?, I'm struggling figure it out since on internet , that jargon has different meaning.
 
@FaheemMitha Where are living spaces?
 
@KianMayne : All over, I guess. In apartment buildings and suchlike. Not that different from the west, but much more crowded.
 
The source listed on wikipedia actually lists 202,922 as the population
 
9:27 AM
The US is very much more spacious than India. The differences are really quite striking.
@ScottW I think Europe is more crowded than the US. And some of the cities are pretty expensive and crowded too. Like Paris/London.
 
sbi
@FaheemMitha What do you mean, "environs"? Nature? My friends? The economy in Berlin?
 
@sbi : Your neighborhood. The coffee shop you go to. The clubs. The restaurants. The parks/playgrounds if you go to them. The overall city and the people in it. I recall when I was living in Chicago and went to Germany I was struck by the fact that people looked happier on average... That sort of thing.
 
anyway, did someone mention India and China?
 
Isn't it 7 billion now?
 
9:33 AM
@sbi : Big admirer of Germany, by the way.
 
@ScottW yeah. and you would be disillusioned for ever, if you were under the impression that humans are smart.
damn...studying history has turned me into some kind of human-race hater.
 
sbi
@FaheemMitha Berlin is famous for its underground culture. Clubs, strange art, etc., despite the fact that it's one of the, if not, the, poorest cities in Germany, And in a city of 4 million people, you will always find some rich folks that proser in plain sight, no matter how poor the rest of the people are.
@FaheemMitha Are you? Well. I'm not admiring it, but it's Ok to live here.
 
@sbi Oh, I was not aware Berlin was poor.
@sbi : Heh. It is easier to admire from afar. :-) Are you German?
 
sbi
@FaheemMitha You wouldn't see it as a tourist. But when it comes down to money spent on child education etc., there's much better German cities to live in.
 
@IntermediateHacker Studying history is still very worthwhile, though.
 
sbi
9:35 AM
@FaheemMitha Born and grown up in East Germany.
 
It would be a better world if more people did.
 
sbi
@ScottW Yeah, I do. Und Du?
 
@sbi : Ah, Ok.
They would be less likely to believe all the lies their governments tell them.
 
sbi
@FaheemMitha Studying is very worthwhile, and this world would be a better place if more people did.
See, no "history" needed in that sentence.
 
@ScottW Calculating with 7 bn people for one minute, it would take 13308.9968819 years :)
 
9:37 AM
one thing studying history has taught me though, besides being paranoid, is that war is bad, and never achieves anything. Look at the Iraq War, 500,000 people killed........... terrorism actually increased , no WEAPONS OF MASS DESTRUCTION (TM) found, Iraqi refugees over-populated the town I live in.
 
@sbi : I see. I don't really know Germany first hand. Spent two weeks there once. Didn't really go anywhere. :-( But was very impressed by it, and how green it was, in particular.
 
sbi
@ScottW Na für "ein bißchen studiert" scheinst Du aber sehr gut zu sprechen schreiben.
 
@sbi : No, I was talking specifically about history.
 
I am currently memorizing the lyrics of John Lennon's Give Peace a Chance.
 
sbi
@FaheemMitha I got that. And I didn't agree that this was specific to history.
 
9:38 AM
It amazes me how so many people from europe and India all speak english
 
sbi
@FaheemMitha Mhmm. Here in the city, it's mostly gray. :(
 
@sbi : Well, I think history is particularly important to study. And my experience is that people are appallingly ignorant about it. I mean, really, really, ignorant.
Like it takes my breath away.
 
Yet if you come to england I reckon the monority will speak a second language fluently
 
@sbi I was in a place called Saarbrucken.
 
@KianMayne do you know why they all speak english? [History has made me a pessimist]
 
9:40 AM
Saarbrücken (; , ) is the capital of the state of Saarland in Germany. The city is situated at the heart of a metropolitan area that borders on the west on Dillingen and to the north-east on Neunkirchen, where most of the people of the Saarland live. Saarbrücken used to be the industrial and transport centre of a great coal basin. Production included iron and steel, sugar, beer, pottery, optical instruments, machinery, and construction materials. However, over the past decades the industrial importance of Saarland has declined, as the mining industry has become unprofitable. Historic ...
 
@ScottW You can't really call it a city but Torbay
 
It was very pretty. There was a castle nearby and stuff.
 
wow, Germany is pretty.
 
sbi
@ScottW Ein anderer Amerikaner namens Scott, den ich kenne, übt Deutsch mit mir. Inzwischen hält er Seminare auf deutsch.
 
9:43 AM
@IntermediateHacker : Germany is one of the greenest places on earth. Maybe no 1, I'm not sure.
 
sbi
@IntermediateHacker That's in spring. Not everything is really green yet by then. :)
@FaheemMitha What? Every rain forest has more green than we do.
 
It's awesome. Is there air pollution in Germany?
 
sbi
@IntermediateHacker Of course. Although it's probably low compared to Bombay.
 
@sbi don't remind me of Bombay. It's choking over there, my dad once went there, came back with asthma.
but seriously, visiting Germany has now become my top tourist priority.
 
sbi
@FaheemMitha They say that those who don't study their history are bound to repeat it. The trouble is that those who do study history see the repetitions coming, but still can't prevent them...
3
 
9:58 AM
@sbi What rain forests are those? I thought they had all been cut down.
@IntermediateHacker Yes, Bombay is known for giving people respiratory problems.
@sbi : Well, at least it enables them to vote more intelligently. They can see through governmental lies and so forth.
My connection went down again, so if I didn't reply to anyone, that's because I didn't see it.
 
@Pubby I posted this a while back (: It's really good
 
@KianMayne Oh, didn't see that. Yeah, it's pretty cool.
 
If I get at least three A's in O' Levels, I may get admitted to this awesome high-school is Al-Ain , UAE. Guess I should get serious about my grades.
 
sbi
@ScottW Ja, wir schreiben uns Mails auf deutsch. Und er möchte immer, daß ich ihn korrigiere, wenn er was falsch macht.
@FaheemMitha A lot are cut down, but some still exist.
@ScottW What is this? My 7yo boy wants me to open it, but I need to be sure it's Ok for him.
 
10:11 AM
Really nice music (:
 
sbi
@ScottW Ah, Ok.
@ScottW Yeah, I showed him the first few seconds, and nothing moved, so he was content with canceling it.
Anyway, I got a chicken to do for dinner now, and then there's this boy I promised to build a Lego train with. See you guys later!
afk
 
@IntermediateHacker : Where are you now?
 
I want to play the new DF but it's not in the package repo :(
 
 
1 hour later…
11:20 AM
Hi@all
Is here someone familiar with the linux kernel or buildroot? i have a problem look here
 
11:41 AM
Someone wrote a multi-threaded C program and yet he doesn't know what memory leaks are.
 
Curses to whoever invented the multithreaded garbage collector.
 
12:00 PM
@Pubby you mean this guy?
-1
Q: My C program uses about 1.4 GB of ram after it has run about one week

Jay's AlgorithmMy C program uses about 1.4 GB of RAM after it has run about one week. At first, it used only about 3 MB. I'm wondering why it takes that large amount of memory when it runs for a week. Is there any way to reduce it? The program is a simple network connection and multi-thread. Thank you for yo...

 
Ell
hey guys
if I have two maps, say <int, string> and <int, bool> is it bad practise to combine them using a pair e.g. <int, std::pair<string, bool>> over using a class for the specific purpose? e.g. <int, MyClass>; class MyClass { string GetName(); bool IsHappy();}
 
@daknøk how can I see unter linux how much memory a programm uses?
 
@rekire I don't use Linux, so I don't know.
Probably using a tool that shows you that.
 
Ell
ps ?
 
@rekire top shows you interactively, try man ps for the swiss army knife of process info utilities.
 
12:14 PM
i'm reading the man page of ps
 
@Ell It's fine for prototyping but in the long run you'll get sick of it.
 
Ell
Yeah after 30 seconds I thought it just looked ugly so wrote a little class
 
Semantically, no, no problem
 
ps tells me only the mem usage in %
 
Ell
is it correct that in general, I should prefer returning references when returning stuff other than ints or other fundamental types (what are they called?)
 
12:18 PM
and the startdate is just last year :(
 
@rekire On OS X, ps -o command,rss does the trick
@Ell No! There is no general rule about that. Return whatever is semantically correct.
 
ps -eo pid,lstart,cmd works
 
Ell
@Potatoswatter what is semantically correct with getters? If I return a reference they can change it, which is probably more flexible than using the getter isnt it? it just doesn't seem right.
 
my small network demon is running since 19.11.2011 and uses just 1,6MB ram :)
2
 
@Ell The getter/setter pattern is used way too often. If you want to return a reference from the getter, you should probably just make the member public and let the user have it.
@rekire Celebrate the non-leak by getting pissed!
 
Ell
12:26 PM
@Potatoswatter I never like to make the member public because if I ever need to change it, it is just easier. I prefer the look of it as well :)
 
I just wanted to check if I'm leaking memory
 
@Ell Well, you can return a reference to a member, but be aware that there is little semantic difference between that and just making the member public.
Unless there's a particular difference you want, it doesn't matter though.
If you want to be super object oriented, you could make the getter virtual, have it return by value not reference, and supply a separate setter. The pattern for the setter would be
foo set_member( foo new_value ) {
    swap( member, new_value );
    return new_value; // new_value is now the old value
}
i.e., pass and return by value.
 
Ell
why would I have to use swap?
 
@Ell Avoids making unnecessary copies.
 
Ell
oh kk
thank you :)
 
12:33 PM
NP. Don't be afraid to experiment with non-OO design patterns, though ;v)
 
Ell
yeah :L
I can't really seem to think out of that mindset though
OOP just seems so perfect :D
Right, if my class has a map<TileID, Tile> member, can my GetTile(TileID id) function return a reference to a tile object that cant be changed? as in, you can't use the reference to modify the class?
is this a const reference?
 
Oops, I forgot, you should add using std::swap; at the top of that function. Annoying detail.
@Ell Yes, that's exactly what you should do.
 
Ell
I get compiler errors and I'm not entirely sure why, this is my declaration Tile const & GetTile(TileID id) const;
wait, the subscript operator probably isn't const for a map
 
@Ell No, you need the find function instead.
Because the subscript operator performs an insertion if the key isn't found.
 
Ell
Yay I got it right :D
its a good feeling when you get it right :P
 
12:39 PM
What's OB?
 
Yeah, the satisfaction of just being able to use C++ correctly beats all the other languages hands-down.
@Pubby obstetrics.
 
@Potatoswatter What does that have to do with C++?
And why am I looking at pictures of fetuses?
 
@Pubby You didn't say anything about C++
@Pubby Because I wanted you to.
 
Someone said this:
> Why the c++ answer must use templates? C++ answer should use OO not OB
Any idea what he means?
 
@Pubby maybe obfuscation?
 
12:44 PM
Well, Google isn't helpful. ob is a common dumb name for a variable, and indeed obstetrics is on the first page of results, above any potential new paradigms.
 
@FaheemMitha Maybe. I think I'll just ask the guy.
 
Ell
if my function throws an exception, does it need to return a value?
 
@Ell No, technically return is never required, except in a lambda using auto.
Falling off the end with no return is undefined behavior. It's only up to you that it never happens.
 
@Pubby : Always a good plan.
 
I'm in for a lot of pain - I need a 6-level nested C++03 'variadic' template :S
 
sbi
12:51 PM
@Ell See this PDF doc for why getters and setters are an abomination and are actually mocking true OO programming.
 
@Pubby : Consider switching to another language. :-)
 
meh, I'm currently patching ARM assembler
 
1:07 PM
Lions do "wraooohhhh" not "meh", it's a ship call you know. @TonyTheLion
 
@TonyTheLion It's too bad your teacher got you stuck in a mire. There is also a right way to do embedded programming, but some folks just think programming is supposed to be tedious :v( .
 
my teacher?
this is isn't school
but a job
 
1:27 PM
yes
 
Ell
I really don't see the problem with getters and setters, some people think they look ugly, but surely if the internal representation changes, they make it a lot easier?
 
getters and setter break encapsulation
which is supposed to be the essence of OO
why have private members if you allow access anyways via some getters/setters mechanism?
kind of defeats the point
might as well just have a plain struct too
 
Ell
because if you change whats inside, then you just change the getter/setter and dont have to worry about all of the uses of it
and getters dont always just return the member, they often do other stuff too, like bounds checking or whatever
 
user784668
@Ell Don't change what's inside, then.
 
Ell
i dont see how it breaks encapsulation
 
1:32 PM
encapsulation is data hiding
when you expose your data to world, it's no longer hidden
you need to have a higher level of abstraction when you get into getter/setter mechanism
 
Ell
well how are getters/setters breaking encapsulation while public data isn't?
 
user784668
@TonyTheLion Which is not necessarily a bad thing.
 
what do you need to do to change the private variable, expose that as a class function
 
user784668
@Ell Because with public data you don't pretend you have any kind of encapsulation.
 
@Fanael not saying it's bad, it's just no point having them private then in the first place
 
1:33 PM
@Ell The change to the getter+setter is just as likely to break client code as a change to a public member.
 
Ell
@Fanael when I write getters/setters I'm not pretending to have any kind of encapsulation, I understand it's the same as public data
@Potatoswatter I would disagree but then again I'm a noob and have no experience :S
 
user784668
@Ell So why you're not making it public in the first place?
 
Ell
@Fanael because if the inside changes, it still looks the same
also, I like the look of GetX and SetX :P
 
fuck getters and setters
4
 
Ell
And we can use getters to have read-only public data
 
user784668
1:35 PM
@Ell If the inside changes, you often have bigger problems than whether or not it looks the same.
 
Ell
what about read only data then?
 
user784668
@Ell const
 
Ell
I'm actually having this problem as we speak
I have a TileSet class, who has TileWidth and TileHeight members, they can be set on construction, but shouldn't be changed after the tileset is loaded. but I don't like loading the image on the constructor, instead I would prefer to use a static Load function, what should I do to set the width/height?
make the width/height protected?
wait nevermind about the protected bit
seriously what should I do there? :S
 
Is it necessary to have the same object represent loaded and unloaded images? Those sound like completely different interfaces — the only think to do to an unloaded image is call load.
 
Ell
so you think I should just load the image on the constructor?
its just incase the loading needs to be delayed
 
1:43 PM
Maybe have a std::map< image_identifier, loaded_image > which lives as a static local variable inside the image const &get_image( identifier const &id ) function.
 
Ell
or maybe i should have a member Load fucntion?
 
Then get_image can load them lazily into the map, so you never have "unconstructed" objects.
 
@TonyTheLion Actually there are few cases where getters/setters are not absurd, take a look at the autogenerated classes from google's protocol buffers for example, where setters provide a minimum data-consistency check. But to be honest, outside such pure data-proxy structures I also look very suspicious if I see getters/setters
 
right
valid point
 
@Ell What I'm suggesting is a factory, which is usually what you want when the client initiating a request for an object doesn't also want ownership. It could be a static member, but partially constructing an image and later loading it completely is very un-C++.
 
Ell
1:46 PM
yeah
I think i'l just load it in the constructor then
I can't see a need to delay loading anyway so it was probably a bad idea in the first place
 
@Ell Before it's loaded, you have the image_identifier. Which is all you would have anyway. That can be used to delay loading as I've described, yet still load from the constructor.
 
Ell
aghh c++ is melting my brain :s
 
@Ell If you notice a class has delayed loading (like it has an init function) you should have an automatic alert: "I made some design error here"
Why exactly do you not want to do that functionality in the constructor in the first place?
 
Ell
I don't know really it just didn't seem right :S
 
@KillianDS well in some cases it's difficult to do right, or neatly. i think the basic example is to wrap an existing hierarchy of instantiable classes. when you try that exercise, then unless genius you find that it's amazingly difficult to do in clean way.
 
1:51 PM
Dear God! What do I see here? Saying that encapsulation isn't necessary is like saying something utterly bullshit. Getter and setters are there to disallow accessing to private members directly, but instead using getters and setters which manipulatively handle the type processing.
 
@DzekTrek why call my name?
 
I didn't call your name at all, I just referred to a discussion about encapsulation.
 
oh, Good.
 
@DzekTrek Except the only type processing that anyone ever does is slicing, which is pure trouble. It is reasonable to make a getter that returns a copy, but that semantic is uncommon.
 
Haha :) Nice one. @AlfPSteinbach
 
Ell
1:53 PM
how can I assign a raw pointer to a unique_ptr or do I just not do that?
 
@DzekTrek better late than never :)
 
@Ell reset()
 
@AlfPSteinbach Yes, it is sometimes extremely difficult, I agree with that :). But I cant' count the number of init functions I've seen just because they wanted to return an error code if something failed, or because they're used to declaring their variables at the beginning of the function iso where they need them.
 
@Ell Do it from the constructor or use reset. Be aware that the unique_ptr then takes ownership, so you don't delete the raw pointer. That is unique_ptr's purpose
 
I think
 
1:54 PM
well, it's not a copy, it's a temporary type of your private member( as soon as it leaves out of scope, it dies ), which in turn gives you very secure processing in every single situation. @Potatoswatter
 
Ell
My Tileset class has a map<TileID, Tile> where Tile holds a Passability and a unique_ptr<sf::Sprite> (because the tile owns the sprite and the tileset owns the tiles)
but the Tileset creates the sf::Sprites and needs to pass them to the Tile so do I just use a regular new and then use reset in the Tile class?
 
@DzekTrek It's a temporary copy. If that's what you need, then it's the right pattern. But rarely needed.
 
I just don't get your point now. Isn't temporary type just the answer to all our linkage problems? @Potatoswatter
 
@DzekTrek Types can't be temporary, and the object model has nothing to do with linkage. Totally lost here.
 
George Orwell: Promoting Totalitarianism since 1984!
 
1:58 PM
Well, by temporary types I mean temporary objects, which is very clear here, and by linkage I mean runtime processing, one of which is you don't need to store a value to a memory, instead you pass it to another scope for further processing.
 
@DzekTrek Linkage = the way translation units are connected together into a program.
 
Yes, you can say that too. @Potatoswatter
 
And a type is a different thing from an object. I think that's clear here. Temporary or named is not part of the C++ type system. Do you mean value category, i.e. rvalues and lvalues?
 
@DzekTrek a value is always stored in memory, it could be it are registers, L1..3 caches, RAM, swap or something architecture dependent model, but you always store it somehwere. Scope is a language concept, that does not translate directly in real runtime processing
 
I don't follow you at all? How come temporary objects aren't in c++? What about register or auto modificators?
 
2:02 PM
@DzekTrek Those don't modify the type. (And auto did literally nothing, so it's been re-purposed in C++11. Register was never guaranteed to change behavior at all.)
 
@DzekTrek No you cannot say that too, linkage in C++ means the last build step and has nothing to do with runtime execution. You may be saying something perfectly sane, but your terminology is so wrong/unclear that probably most people here simply don't understand what you try to say
 
yes, they deal with memory handling, which is exactly what I was reffering to. @Potatoswatter
@KillianDS Yes, I need to learn more English terms in order to discuss it here more conveniently.
auto modificator puts data to operative memory, while register puts it in processing registers, how come they don't do anything. Because of it, communication with our memory stack is valid.
 
@DzekTrek Well… everything relates to memory handling somehow. Seems were getting confused between type, value category, and storage class, which are separate things that all combine to describe an object.
@DzekTrek register is just a hint to the compiler that an object should prefer to stay in the CPU's innermost memory bank, but does not make any binding requirements upon the implementation.
 
Yes, you are right, miscommunication occurred because of nescience of the terms used in English.
 
It is an error to take a pointer to a register variable, but that's a requirement on the programmer, not the computer.
 
2:08 PM
0
Q: Solving Complex Parametric Equation involving multiple coefficients of trigonomic functions

Kian MayneHow can I solve: (x/16)^(1/3) = sin(t) for t? If it helps, it's part of a parametric equation: x= 16 * sin(t) ^ 3 y = 13*cos(t) - 5*cos(2t) - 2*cos(3t) - cos(4t)

 
@Potatoswatter Exactly. :)
on the other hand, auto is declared automatically, right?
 
@DzekTrek auto was added to the C language for aesthetic completeness. The latest C++11 standard removed it.
Now auto activates additional type deduction.
 
Didn't know that auto was removed from C++11.
 
I thought auto was because of B
 
Previously, auto meant that a variable's lifetime was bound to its enclosing scope. Which incidentally is also true of a register local variable. @Pubby maybe so, I forget.
 
2:12 PM
yes, @Pubby, you are right, auto was declared for block lifetime.
while register was for CPU registers, right?
 
@DzekTrek B was a programming language that came before C. So auto would be a keyword that introduced a declaration, which C then made superfluous.
@DzekTrek CPU registers are also allocated for block lifetimes. And again, there is no semantic difference between putting data in registers vs somewhere else.
 
I see, didn't know it. @Potatoswatter
 
user784668
@Potatoswatter Note that GCC has an extension that actually forces a register variable to be stored in specified hardware register.
 
yes, you are right register do tend to use both block and register lifetime. But, lets say you want to put data into block, but not into CPU registers, you would have to assign auto, not register modificator. @Potatoswatter
I'm going out to study, see you later guys.
 
@Fanael That means you need to specify the register… which means using GCC's attribute syntax, not the storage class specifier. Does the attribute even affect the storage class?
@DzekTrek NO, this is what I've been saying, when you specify register it can and will still put it into memory, not registers. The register keyword does not require the machine to do anything differently.
 
user784668
2:20 PM
@Potatoswatter Dunno. But it doesn't use GCC attributes: register int some_variable asm("some-reg");
 
@Fanael Bizarre, didn't know that one.
 
@Potatoswatter What I ment to say is that it is put into stack( found proper term ) while declaring auto and not into CPU registers. Either way( auto and register ) it is classified and processed in memory block.
OK, now I am really off. See you later guys.
 
@DzekTrek Even if it's declared auto (using the old, C meaning of the keyword), it will still be put in registers too. I'm telling you, the auto and register specifiers are useless.
That's why they were deprecated.
 
No, it won't be put into registers. See under storage duration specifiers en.wikipedia.org/wiki/C_syntax @Potatoswatter
 
@Fanael Interesting, if I omit the register storage class from that line, GCC still accepts it but apparently ignores the register binding.
@DzekTrek Do you understand what a register is? The CPU cannot perform any kind of operation on a value without loading it into a register.
 
user784668
2:27 PM
@Potatoswatter Strictly speaking, in some circumstances IA-32-compatible CPUs can do that.
 
@Fanael Not an architectural register, maybe, but certainly a hardware register. It's all fairly academic.
 
What about blocks? Ever heard of it? @Potatoswatter
 
user784668
@Potatoswatter Yeah, cores are RISC since late 80's or early 90's.
 
@DzekTrek Block scope helps the programmer understand when variables are accessible. But the compiler essentially strips that information away before performing lifetime analysis, which determines when values are put in registers.
The compiler backend can't rely on the programmer writing in a particular way. Code written without use of { block scope } should run just as fast as neat and tidy code.
 
We agree with that, and we have found what was troubling you since beginning. Auto after all is just for stacks, and not for CPU registers. @Potatoswatter
I have to admit, you have a great knowledge! Thanks for pointing me out some things. :)
 
2:39 PM
@DzekTrek So what happens if I do auto int a = 3, b = 5, c = a + b;? How can an x86 CPU add two numbers without putting at least one into a register?
 
data c is put into registers, not data a and b
they are in flow, ie stack.
 
user784668
I love the syntax for member function templates inside a class template. template <typename T> template <typename U> just rocks.
 
@Fanael the semantics for that GCC extension are bizarre. If I use asm("rbx") but omit the register specifier, at local scope it errors out, but at global scope it seems to emulate the register by binding the variable to an anonymous global, which serves perhaps no purpose but to ensure you don't pretend to bind two things to the same global register.
 
@CatPlusPlus you recommended oglplus yesterday, have you ever used it? With me compilation failed from the moment I included the headers (const<-> non-const mismatch).
 
However, aliasing a local variable to the global one does not work. (Unless I use the register specifier on both. For some reason, aliased globals are illegal but aliased locals are fine.)
 
2:51 PM
@KillianDS Compiler?
 
gcc 4.6 (opengl version = 4.1)
It complains on MultiDrawArrays, where the wrapper uses const GLint* and passes those to the gl* function that expects non-const pointers
 
Bob
When you do test driven development
do you write test code, minimum functional code to pass, refactor and then repeat? what does minimum functional code to pass mean? That it should only make the test pass or that it actual are some working code that makes it pass?
Like if you have a function that is expected to return 0
do you make the code around that ensures it is 0, or just return 0
 
glMultiDrawArrays takes pointers to const, in both 3.3 and 4.2.
Your GL implementation is crappy.
 
That's <2.0.
 
2:58 PM
ah, indeed
 

« first day (491 days earlier)      last day (4447 days later) »