« first day (592 days earlier)      last day (4356 days later) » 

12:00 AM
AND is a super annoying operator
if you know the result and an operand, it might tell you about the other operand- but it might not
 
Try NAND, comes with more on a chip too, usually
 
if you know one operand, it might help- but it might not
 
@DeadMG meh. That's why they call it algebra
 
@sehe Very true.
now what I need is the Level 1 equations- perhaps there are some simultaneous in there I could be solving
 
12:21 AM
Night'
 
Xeo
night
 
Sleep well
 
nightnight
 
 
1 hour later…
Xeo
1:28 AM
-2
A: How to implement a restaurant order from a restaurant menu using Objective C

Steve TamerWell I create a similar online ordering system, take a look around and you can see How this is possible, I'm in the restaurant biz, we create an online ordering system, I´m very interested in your feedback to improve the system and what do you think about this option for my restaurant Eat Online

nuke it please
 
Done.
 
Xeo
@JamesCuster rolled back
 
I reported it, too
 
Xeo
-1
A: tinyscroll doesn't work for chrome and safari

user1417815I'm using safari right now, it work with me. I recommend you to read about jquery, as it cross browser and should work. IE 6.0+, FF 3.6+, Safari 5.0+, Opera, Chrome Try go: http://randomexamples.host22.com/scroll_example.html dont refresh, go back and return to it. It start works, something i...

Another nuke please
Oh, and comment flag
 
user406009
1:37 AM
Someone is certainly pissed.
 
What's up with him and paying money for stuff on SO?
"I'll pay!" "No one will do that unless you pay them on here!"
 
people are strange
 
Xeo
@JamesCuster I decided to nuke that question after all, it was unsalvageable (imho).
 
so, i answered yet another question
0
A: C++ function to return array

Cheers and hth. - AlfNote: main must have result type int, by both the C and the C++ standards. It's also a good array to use const just about everywhere that it’s possible, because that adds constraints to the code which makes the code easier to understand (less to consider). And finally, and most important,...

 
@CheersandhthAlf "It's also a good array to use" ?
 
1:50 AM
i meant "idea"
ok, fix
fixed, thx
why is @Cicada reading penises? is that like reading tea leaves? what?
 
I like to note when I'm using C++11 features (especially to someone who is clearly a beginner)
 
user406009
@CheersandhthAlf Looking at the past comments it looks like she read the word pennies as penises.
 
it could be a good idea for a feature that's not supported by all main compilers
 
If they go and try to use that code it will spit out an error?
 
1:53 AM
no
you can just try it
 
Xeo
If you are new here, please read the newbie hints and keep the acronym list under your pillow. Thank you.
15
 
@CheersandhthAlf error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 
Xeo
@JamesCuster -std=c++11
 
@JamesCuster oh, tool usage. henceforth, when you get a message like that, read it
 
Xeo
It even says so in the error.
 
1:55 AM
I suppose that error message is pretty descriptive, though
@Xeo I understand that... :)
Personal preference I guess...
clang spits out this:
`array.cpp:1:10: fatal error: 'array' file not found
#include <array>
^
1 error generated.`
 
nobody sane use clang
except on apple machine
it's not a major compiler
it's not even a minor one, yet
 
Isn't it used in Xcode?
 
Xeo
@CheersandhthAlf wat.
 
I'm pretty sure apple dropped support for gcc and is using clang now for Xcode
 
1:58 AM
that could possibly be what "except on apple machine" was about
anyway it's again tool usage
most probably clang accepts the same -std=c++0x option as g++ does
try it
 
I know it does, I don't have to try.
 
so, you're just being argumentative
oh well
 
Not really, I was trying to justify my original statement, that's all.
Your argument is also a sound one.
 
i think apple has a less than optimal business strategy. they could have made a fortune selling their OS for PCs in general. also, they could have made clang a multi-platform compiler instead of mac-specific. it's so utterly dumb. i have no words.
but then, they don't need to earn a fortune
it's the most valuable firm already
 
Xeo
@CheersandhthAlf Wat. Clang isn't "mac-specific" at all
 
2:02 AM
@Xeo it is. it is unusable in windows.
 
What? Clang also works on linux...
 
market share of linux = ?
 
Servers...
 
i guess one could use it to write the next apache, yes
server side software
didn't think of that
a C++ compiler for server side software
 
scientific software
 
2:04 AM
huh
 
lots of things
 
but it's the future on windows
since microsoft stops supporting native program development with their free tools
that makes a big VACUUM that nature abhors
 
I actually don't program on Windows at all
 
void UStrProperty::DestroyValue( void* Dest ) const
{
	for( INT i=0; i<ArrayDim; i++ )
		(*(FString*)((BYTE*)Dest+i*ElementSize)).~FString();
}
^ unreal engine, Y U DO THIS?!
 
void* and C style casts = dumb programmer
 
2:08 AM
P->DestroyValue( (BYTE*)Dest + i*ElementSize + P->Offset ); - another line
@CheersandhthAlf no, it's GameDev
 
@CheersandhthAlf I'm wondering if all the bad press will force them to change their mind
 
oh jesus, also all uppercase type names
@Abyx well it's a dumb programmer, yes
 
it's a bunch of programmers...
 
Game programmers are without a doubt the worst programmers, in terms of maintainability, clarity, and correctness.
 
2:12 AM
meh... there is a lot of great games, but inside of them you'll find such code
 
Right, I didn't say they're not profitable or entertaining, they just don't know how to look beyond their immediate problems.
 
HI....a beginners doubt
regarding c++ application
I have developed a simple socket application with visual studio 2010 in windows 7
 
Xeo
@GManNickG I think I ought to take offense to that. :(
 
but when i try to run the exe in the windows xp ..it says msvcr100.dll is missing
why is that?
 
Xeo
VC redistributables missing
 
2:17 AM
@Xeo It's a generalization, silly. :) I graduated from DigiPen, so I'm a "game programmer" too.
 
Xeo
Well, it's not as if I don't know what you mean
When I look at code my class / team mates wrote... shudder
Or even my own code from early on
 
well i think there's a difference
 
Old code from when I was in high school...oh god why.
 
looking back, even just a few days, one realizes that one was dumb at the time
smarter now! :-)
 
1
Q: why did K&R make &&, || logical and &, | bitwise, not the other way around?

luxunI know that == was chosen for equality and = for assignment because they thought that people did more assignment than checking for equality---but surely they didn't think that there would be more bit fiddling than boolean logic? Why not go the other way around, with & and | being logical ope...

 
2:23 AM
but really Bad Practices(TM) like void* and C style casts applied at inappropriate places and so on, that's more serious, because it should have been rooted out at a very early stage, not a matter of gradual improvement but of general aptitude
i get so exasperated at close voters
1
Q: why did K&R make &&, || logical and &, | bitwise, not the other way around?

luxunI know that == was chosen for equality and = for assignment because they thought that people did more assignment than checking for equality---but surely they didn't think that there would be more bit fiddling than boolean logic? Why not go the other way around, with & and | being logical ope...

^ This question has a definitive, simple answer.
The close voters think "I don't know how to answer that, it must be impossible to answer" -- they think they're all knowing and geniuses, when by their actions they just say loudly that they're utterly incompetent.
It's very frustrating. I want to have them nearby and flog them. Or something.
 
well, the final comment says all
I suppose it's an interesting question, now that someone's asked it
 
@stdOrgnlDave does it?
 
@stdOrgnlDave it's been asked a great many times before, and answered. perhaps just not on SO.
@stdOrgnlDave that's a pretty irrelevant link. nothing to do with the question asked.
 
how so?
I hope netbeans works well on my single-core 2.3GHz 768mb virtual machine I made for it
 
2:30 AM
@stdOrgnlDave The only relevance to the question is the allusion to the state of affairs then, "... were added". Otherwise, the link is about precedence. The question is about operator symbol size.
Perhaps the close voters are not really dumb, but rather intelligent and anti-social, aiming to annoy other people and harass the questioner.
Yes I think that's it.
 
I thought it explained it quite clearly, I'm not sure why you're having trouble. the reason is that early C had a complicated system for determining when to use bitwise or logical and they added new operators to clarify it. backwards-compatability dictated && was logical.
 
@stdOrgnlDave sorry, that's bullshit. early C didn't have any complex system for determining when to use bitwise or logical. early C didn't have logical. get it?
 
oh I guess that link is a lie
 
@stdOrgnlDave the link does not support any of your contentions. i'm sorry, but your conclusions from that link (if that's what you mean, that you concluded from what you read) are invalid. they do not follow, and they are, in historical fact, wrong.
 
OK, please provide me with a better link so that I can learn better
 
2:38 AM
why not do that yourself?
it could be a good exercise
start with wikipedia
i'm sorry but you sound stupid
i think i'll do other things
 
13 mins ago, by Cheers and hth. - Alf
^ This question has a definitive, simple answer.
 
@CheersandhthAlf surely if it's definitive and simple you can share
 
the question is closed
you are annoying me
 
Xeo
@CheersandhthAlf it's not
 
2:40 AM
@CheersandhthAlf it's OK, I ignored you before you ignored me
@Xeo what's up lately
 
Xeo
Sleep deprivedness.
Speaking of which, I surely should go to sleep now..
g'night
 
goodnight.
 
@RMartinhoFernandes Wtf? alias<T> totally is useful, as are temporary arrays :(
 
2:57 AM
@stdOrgnlDave you can look at the answer posted to the question. simply, & and family came first, as I directed you to earlier (above).
 
3:31 AM
@LucDanton I'm trying to decide if I should take that seriously, or as sarcasm.
 
I got curious and I actually grepped for alias and I use it in one spot in the library itself.
Ah, I just recalled. You can use alias in things like p->~alias<std::string>().
 
I've never made use of it given that I only use pseudo-destructor calls in generic code where ~T() is always valid, but you never now.
 
Well, I still stand by my "mostly useless" assertion.
 
have any of you ever worked with SP for xml parsing? I'm trying to find a decent way to generate a tree of all possible xml entities and their attributes (and whether they're required, optional, etc.) from the dtd itself. the reason is that I have about 20 or 30 relatively complex dtd files based on 15 years of revisions, and of course none of the entity names remained consistent
 
Xeo
4:13 AM
@RMartinhoFernandes: Time for your operators again: stackoverflow.com/q/10808497/500104
 
4:31 AM
@Xeo, IIRC you went to sleep two hours ago
 
Sleepchatting.
 
Xeo
@Abyx IIRC, I never go to sleep when I say so. :P
Atleast not the first time
 
so... you never sleep?
 
Xeo
Nah, I just procrastinate on sleeping a few times
and then go to sleep
 
 
1 hour later…
5:42 AM
@ScottW eat... and eat... and become bigger... and then blow.
hm... "explode"? nvm, just don't eat very much
it seems everyone is sleeping now
 
Xeo
Not yet!
 
u'r mad
 
Xeo
Not quite yet
It's only been some 38h or so
 
even @robot don't have such uptime
hm... does @robot plink to @RMartinhoFernandes?
 
Xeo
6:05 AM
nope
 
0
A: Three "const"s in const func (const scalar& a) const, why?

FredOverflowSince nobody has mentioned it yet: there is absolutely no difference between const int some_function(); and int some_function(); The const on scalar return types (such as int) is ignored; it only matters for class types. related

@Evgeni Every language feature can destroy readability if used inappropriately. — FredOverflow 18 secs ago
 
Xeo
6:25 AM
@FredOverflow Yay, another question that's still tagged !
And you can't even search for them anymore since the search is automatically redirected to , which sucks
 
@fredoverflow: const is in my opinion a design bug of C++. Ever wondered why no other language (including ones invented after C++) went down that path?
 
Xeo
@6502 Because they're stupid. And e.g. D has const IIRC
 
@6502 D ?
 
@6502 Because it's too complicated.
Doesn't D have final, const and immutable? :)
 
Xeo
atleast immutable is part of the mix
 
6:34 AM
@fredoverflow: that's half of the problem. It's complicated AND useless... useful in theory but not in practice. Do this experiment... every time you get a const-related compile error write it down if it helped you spotting a true logical error... i.e. not something that is only related to const correctness itself
 
Xeo
geh, 5 flags short of the badge
@6502 Please tell me you're joking.
 
@6502 I think const methods are great documentation. You immediately see if a method only inspects the object, or if it potentially modifies the object.
 
@fredoverflow: most of the time the error is about getting the correct declarations right
 
@6502 But that's only due to missing education. Many beginners simply do not know that you can put const at the end of a member function declaration.
In our University course on C++, const member functions is the first use of const we introduce :)
 
6:39 AM
@fredoverflow: the real issue is that it's a complex machinery that only delivers a single bit of semantic. You don't need only to know if a methods changes the object or not... but also if you need to call a method before or after another for example. Also the syntax doesn't even scale this single semantic bit by composition (see const_iterator).
 
I don't understand this before or after part, could you explain?
 
@xeo: I'm pretty serious... but this is is sort of a blaspheme talk in C++ circles. Even newbies that know nothing at all feel they can insult you for questioning const correctness real usefullness
 
@6502 are you actually saying the concept of const itself is useless or that getting to the point of const correctness in C++ is overly complicated? Because you're stating the first but complaining about the other.
 
@fredoverflow: the change/don't change is just one bit... may be I want to pass you an object and ensure that you will not call a certain method. This also need to be documented. The documentation power of const correctness is true, but the cost is too high for just that (it even includes sometime the need of code duplication!
 
Xeo
@6502 If you have code duplications due to const correctness, it should be insignificantly minor ones.
 
6:47 AM
@killanDS: i'm just saying that the syntax is bad and doesn't scale (for example how to represent a const vector of non-const instances?) and the payout for such an high price is too low. In my experience moreover it rarely (if ever) helps catching true logical errors. Every single time you get a compile error it's about the const declarations themselves (it's not that you were trying to do something that shouldn't be done)
 
@6502 it's just your experience.
 
Xeo
@6502 Guess why you don't do the things that shouldn't be done.. because the const documented that for you and you instinctively coded it correctly.
 
@6502 Having a constant vector of non-const instances doesn't make much sense with value semantics, does it?
 
@6502 You can perfectly declare a const vector<int>, you just won't be able to do much with it (which is normal).
 
Xeo
@KillianDS I think he was more thinking along the lines of a std::vector<T> const& v parameter, and being able to do v[0] = 5; inside the function, but being unable to change the vector size
Which wouldn't make a whole bunch of sense, but well
yay :)
 
6:57 AM
@fredoverflow: hmmm... i see your point. From a practical point of view having a fixed vector of mutable instances is semantically useful. but const correctness only delivers one single bit for the whole thing
@fredoverflow: for anything non trivial you need defining your own types (like const_iterator)... and adding semantic levels makes the cases to explode exponentially
9am... time to go to work... see ya later
 
see you
 
Xeo
@6502 Think of const_iterator as a typedef for T const*, and it becomes very clear why you need another type for that
 
somebody knows a good doxygen tutorial?
 
the doxywizard?
Or you mean, the comment syntax? Just the docs. advice: use only < 5% of available tags (do yourself and others a favour)
 
@sehe yeah ok thanks, I meant the comment style. I will start with the manual then
 
7:04 AM
@6502 How do you get the instances into the fixed vector in the first place?
 
@Xeo Though that looks like arguing from a technical limitation.
@6502 I'd suggest you can trivially have what you describe by using const_iterator ranges.
 
Xeo
@sehe Well, sure, it is a technical restriction in a sense. You can't make your own pointers. :P
@sehe I think you mean normal iterator ranges
 
@Xeo Did I invert the problem? Oh. again :)
 
@6502 Anyway, on the whole I agree that const is far too complicated for the benefits it offers. I have never seriously missed it in any other language.
 
But yeah, iterator ranges will do and would be idiomatic
@6502 one other thought would be
std::array<int, 4>        mutable_ints    { 3, 4, 42, 6 };
std::array<const int, 4> immutable_ints { 3, 4, 42, 6 };
Of course, that container will always be fixed, regardless of where/how it passed
 
Xeo
7:10 AM
uuuh, I want array_ref
std::array_ref<T> v and there you have your fixed container with mutable values
 
@sehe Quick, what's the difference between std::array<const int, 4> and const std::array<int, 4>? ;)
 
Xeo
@FredOverflow Damn, I wanted to answer "the spelling!" :(
 
The same as const int[4]; vs int [4] const I guess - none practically
 
@sehe There is no such thing as int [4] const.
15
Q: constant arrays

FredOverflowThis is a good old C array: int a[10]; And this is a good old C array that is const: const int b[10]; In C++, there seem to be two ways to define std::arrays that are const: std::array<const int, 10> c; const std::array<int, 10> d; Are these two definitions equivalent? If so,...

 
Good one. Obviously, I never use array<const T> or i'd have realized it myself
@Xeo Haha, that proposals HTML version has nice code samples:
void MyOldRoutine(const int* elems, int N) {
  for (int i = 0; i < N; i++) { assert(elems[i] == N - i); }
}
 
Xeo
7:14 AM
heh
 
Xeo
ugly indeed
 
I'm pretty sure they didn't mean it that way, though
 
Xeo
@sehe You can change the encoding back to UTF-8 though, which fixes it.
It just automatically gets changed to Western for some reason on loading
It even has <meta charset="utf-8">... oh well
 
@Xeo Indeed it does. I never twiddle that kind of stuff. Apparently they failed to set charset in the content-type
 
Xeo
7:17 AM
@sehe We already had that paper in the chat once and I think the robot found this out
 
Ahahah. Nice. Perhaps we could send them a head-up instead :)
Well, I'll rather be lazy
Coffee time
 
I'd like to have llvm::adt in std
and maybe boost.range
 
@FredOverflow: Const isn't supposed to work this way. I want to pass you a const vector with non-const elements. It doesn't mean it's const for me and that it has to be const forever. It's const for the callee... exactly like passing a const X& to someone (may be it's just a non-const X& for the caller).
 
7:37 AM
@6502 use const vector<T*>&
 
@Abyx: Yes... adding a level of indirection can solve any problem in IT :-)
 
Except cache locality
 
and aliasing, and lifetime ...
 
Those can all be explicitely managed. That's really impossible for a vector<T*> because of the guarantee that the pointers itself will be contiguous in memory
 
@6502 Why don't you simply pass two iterators then? Iterators can change the elements, but not the container.
 
7:41 AM
I'm guessing he just doesn't like it.
 
@Xeo I don't see I missed out on, just some talk about perverts and cheese
morning all :D
 
@6502 FWIW const views of containers are a kludge in most any language I know of
 
In "true OO" languages, you can simply have containers implement read-only interfaces.
 
But it means little as you can always discover the real type. Legally.
Also, most implementations could but don't (CLR and (IIRC) Java)
 
Just as you can const_cast your way around const. It's supposed to help programmers from accidental mistakes, not from evil hackers.
 
7:44 AM
As I understand that is UB (when casting away const). I explicitely said legally
 
@FredOverflow or not implement a writeable interface
 
@thecoshman Yeah, that's what .NET seems to prefer: just let f*cking C.Add(x) throw an exception. That's just beautiful.
And, of course you can treat any container as a IReadonlyList<T> or IEnumerable<T> but then just asking for the length becomes a O(n) operation, or at least one encumbered with RTTReflection
 
@sbi ^
 

« first day (592 days earlier)      last day (4356 days later) »