« first day (995 days earlier)      last day (4179 days later) » 

09:00
no i mean pastebin?
@user2345661 ideone.com
It's really self-explanatory
@user2345661 what exactly do you want?
something like this with spaces.
triangles of * speparated by traingles of spaces
my code acutually works perfect but i am just wondering if there is a better way to do it
09:11
a neater way maybe....
this is my code with the output i need ideone.com/cngl49
@user2345661 You could start by writing the code in C++ ( Console.WriteLine(); indicates your current code is C++/CLI, or something similar).
Condition variables are really good at causing deadlocks.
Iam just trying to improve it
09:14
@BartekBanachewicz Hi old friend...
@JerryCoffin it is not c++ but C#. I am just trying to understand the loops.
@user2345661 they suck
i mean, that's apparent
here's a hint: you can execute loops in loops
@user2345661 And why would you discuss C# in Lounge<C++>? Why would you think we want to discuss C#?
@JerryCoffin and when did i ask C# question? I am just asking a general question about loops which i thought was relevant to c++.
Sorry for posting here but I need a moderator quickly
09:18
@AhmadAlfy Sorry, this is a mod-less room.
@JerryCoffin he's got a point.
where can I find a moderator? some douchbag is making tons of edits and some guys are approving them
@AhmadAlfy really that urgent? uh. @Flexo @BoltClock
yeah
it wouldn't be a problem if reviewers are rejecting them but it seems they are clicking the approve button as fast as they can :S
@AhmadAlfy well if they're offline there's nothing we can do. Just flag one of those and explain
09:20
I flagged all of them but this guy is on steroids! he's retagging all the questions!
@AhmadAlfy can you link one of those?
@BartekBanachewicz i did use loops inside a loop. So, i have basically used an outer loop and then, 8 loops to print 8 triangles inside.
I gave you the link to the whole list
all those edits
@user2345661 put a Triangle in a class perhaps?
@AhmadAlfy these are comments.
ah there
No, click the edits he is "Changed alloy-ui tag for the proper titanium-alloy one"
09:22
oh come on
it's like 5 questions
it's 17 edit
check again
@user2345661 If I were doing the job in C++, I wouldn't use any (explicit) nested loops at all. ideone.com/lcJY6F
@BartekBanachewicz found the answer from a book and it is actually same as mine. thanks anyways.
09:25
@user2345661 In python it's a one liner... codepad.org/Ymx5vDLQ
@ShuklaSannidhya that's as bad as his one. Look at Jerry's answer
I once read about <iomanip> in my school... setw is pretty useful...
@AhmadAlfy looking into it
@Flexo thanks
Oops -- off-by-one error. ideone.com/lcJY6F
09:29
@AhmadAlfy are the tag changes actually correct? (I know nothing about either tag, but some of them look like they might be sane just minor)
@ShuklaSannidhya Not to be overly argumentative, but that looks a lot like two lines to me. :-)
OK, that's it for today already: it's too hot. Powering down all computer machinery, A/C to max. BYE!
@MartinJames Later. Stay cool (if you can!)
@ShuklaSannidhya you know, you can write OP's solution in one line too. What does it show exactly?
09:32
@ShuklaSannidhya Nicely done. :-)
@AhmadAlfy you can just flag the question and describe why in the text field
@Flexo no it's not restricted to Titanium.
@AhmadAlfy the wiki on says it's a JavaScript framework though which none of the questions being edited are.
Xeo
Xeo
@CatPlusPlus: CubeWorld registrations are up!
3
Q: Tagging confusion/inconsistency with alloy-ui

ByranI've noticed that many questions tagged as alloy-ui, are incorrectly tagged. Namely topics involving Appcelerator's Alloy framework for the Titanium SDK. I've attempted to re-tag these questions with moderate success. But was stopped by some who felt my edits were: This edit is too minor; su...

09:35
@Flexo ohh
That explains everything
0
A: Expression must be an lvalue

tobiOkay, I have solved it by changing the getTexture() method to: ID3D11ShaderResourceView* const* Texture::getTexture() const { return &mTexture.p; // this is a CComPtr<ID3DShaderResourceView> mTexture; }

look, he solved it
@thecoshman DX boys have fun ways, don't ya think? ^
I mean if it was T* const* * * const* const* * it would be easy
Of course, in C++ (or C) it's mostly a question of how much you're willing to stuff one line. e.g.:

char const s[] = "**********";
for (int i=1; i<10; i++) printf("%-10s %-10s %10s %10s\n", s+10-i, s+i, s+i, s+10-i);
2
@ShuklaSannidhya Could all be on one line if you wanted.
maybe add the tag to the room : modless
wait but that will refer newbs but attract trolls
@JerryCoffin I am wordless
@JerryCoffin char const s[] = "**********"; // lemme store some stars for later
09:46
@Telkitty猫咪咪 If we're going to add a tag on that order, I'd prefer .
I thought I knew C.
@ShuklaSannidhya don't worry, we didn't
@BartekBanachewicz How's your guitar?
@BartekBanachewicz I did at one time, but really don't any more.
Jerry Coffin > Chuck Norris. Here is the proof - codepad.org/AonCHYae.
09:49
@JerryCoffin modeless window but modeless room? >_<
@FlorisVelleman well, it's great. I think I'll finally sit down to practice today.
+1, thanks Pete for your valuable contributions. It's really powerful to have committee members/designers on board of a QA site. — sehe 11 secs ago
@Telkitty猫咪咪 Modeless code and modeless editors.
@modeless your webiste is ugly.
@BartekBanachewicz Still waiting for that "Lounge Song" you promised the other day
09:50
@FlorisVelleman I've been experimenting with a few ideas, I don't want to make a cover.
Also I don't sing.
Similar to a modal window, a modeless window is a feature that was first introduced in Internet Explorer 5. It launches a secondary (child) window that stays active on the user's screen until dismissed. Modeless windows can be minimized or hidden behind other windows. Unlike a modal window, a modeless window will  allow the user to continue working with the application while the modeless window is open.
so basically a modeless lounge would be the one that can be minimized and hide behind other rooms
sadness ...
@Telkitty猫咪咪 Where in the world did you get that? Modeless windows (and "modaless") predate IE by quite a while.
@EvgenyPanasyuk Cool...
09:57
@Telkitty猫咪咪 but your website webiste is still ugly
webiste is certainly a better word for it
Just FWIW, CreateDialog (which creates a modeless dialog) goes back to at least Windows 2.x (circa 1988). I think it was in Windows 1.0 as well, but no longer have any documentation to check.
@BartekBanachewicz iste = here. And "locus iste" is a commonly used phrase for "this holy place". So... it's actually not that inappropriate
@BartekBanachewicz i have plans for dxdr
@thecoshman blergh
@sehe i thought it means something bad :/
10:00
@BartekBanachewicz cyste?
@sehe but ... beauty is in the eyes of beer holder :'(
@Telkitty猫咪咪 your name sounds like girl. You should make your website better looking. :D
wait. wat.
@BartekBanachewicz Hmm....somehow prompts the Portmanteau of "web parasite" as "webisite".
10:01
@JerryCoffin web parasite! sweeet
@billz this is the first time someone tells me my name sounds like a girl's name >_<
@BartekBanachewicz Brilliant
@Telkitty猫咪咪 really? Do you know Chinese character?
It's very girly. :)
10:03
@sehe I saw that earlier today and figured it's too good to go to waste
it iz
I thought about editing it and adding "let me go; I can haz answer in [boost.spirit]"
@billz Good thing that I am still have my femininity intact :p
@ShuklaSannidhya yeah well I know you're a damn troll and stuff, but have you even seen my code? Like, once?
10:06
@BartekBanachewicz That would have rocked. Alas ...
@BartekBanachewicz umm... yeah... saw that quad-tree...
@sehe Sure about iste = here? Isn't it some pronoun along the lines of "that"?
@BartekBanachewicz man, I was kidding...
I'm being naughty and using a "uchar" style of string handling.
@BartekBanachewicz lol
10:09
It's actuallly working quite well for basic char*-wostream interop on Windows.
And I can drop the conversions when I call API functions.
@NikiC Pretty sure.
@rubenvb It will byte you sooner rather than later
@sehe I think I got a good idea how to handle everything I need.
@BartekBanachewicz Wait... I didn't find any C in your git hub...
@rubenvb portably?
@sehe wchar_t on Windows, char on Unix. No communication between the two.
10:11
@ShuklaSannidhya So, do we know you?
@sehe "we"?
The reason is really that w* stuff has overloads for plain char, so I don't need to decorate my string literals.
@ShuklaSannidhya and?
@ShuklaSannidhya "we" the lounge
Oh. @sehe's back.
Back from @not.
10:14
how much rep did you get on the clippy account?
oh god I can't photoshop
@sehe If "we" refers to Lounge then sure "we" knows me... BTW, "we" includes me too...
@ShuklaSannidhya no, it doesn't; you use raw pointers
@BartekBanachewicz Just leave it man... we're not talking about it any more...
@BartekBanachewicz so does Jerry Coffin...
@ShuklaSannidhya we are :D
@ShuklaSannidhya but he knows they suck
10:16
@BartekBanachewicz what does "suck" mean... in context of pointers?
@ShuklaSannidhya "should be avoided when possible"
shhh. fighting and bickering: outside!
@BartekBanachewicz I do avoid them when possible...
@BartekBanachewicz Wasn't there a small performance difference?
@FlorisVelleman huh?
10:17
for smart pointers vs raw
@FlorisVelleman Who said anything about smart pointers? Also, which smart pointer?
@sehe who's fighting? all I see is lots of love between bartek and raw pointers...
@FlorisVelleman yes, pointers are slower, because they involve runtime address resolving
@ShuklaSannidhya :)
@BartekBanachewicz that's what I meant. Why would you use raw then
10:18
@BartekBanachewicz ...
@BartekBanachewicz there is no such truth. also "runtime address resolving"? Just name it like it is: other methods (e.g. custom allocators and pseudo pointers, iterators) can sometimes improve locality of reference and thereby improve performance. Profile first. Argue later.
function pointers are really slow </sarcasm>
@sehe yeah, should've stated that as "can be slower", my bad.
@FlorisVelleman when building a smart one?
Note: smart pointers can be slower too. As can raw indexes on memory realms optimized for locality of reference (false sharing, anyone?). You see, it depends. It always depends.
@Telkitty猫咪咪 sarcasm is slow
@sehe only for the dumb slow people
10:23
@Telkitty猫咪咪 your sarcastic answer was kinda slow; does it mean you're dumb?
apparently you were the one who is slow to get my sarcasm
Which is the most starred post of this room?
@Telkitty猫咪咪 the one with function pointers? It's plain bullshit, so I didn't really get anything sarcastic in it
Hmmm, was just looking into qualifications needed to become an airline pilot
not as bad as I thought it would be
@Telkitty猫咪咪 Guess why runtime polymorphism isn't used for micro-microcontrollers.
10:24
maybe you have never used function pointers before
the only thing I'd need to find out is if I qualify medically
@TonyTheLion what about $$$?
@TonyTheLion you need to accumulate a lot of flight times in order to fly big planes
FAA website says that physical disabilities don't immediately disqualify you, it depends on circumstance
@BartekBanachewicz yea and that
@Telkitty猫咪咪 this is true
fly lessons here aren't expensive: $200 for half a day
10:26
no harm in looking and wondering
@TonyTheLion "physical disabilities"... You have any? just curious...
and doesn't take long to get a licence to be a pilot
@Telkitty猫咪咪 yawn
but if you want fly boeing 747 then you need lots and lots of flight time
which will cost ordinary people (like me) a fortune
@ShuklaSannidhya I do.
10:28
@TonyTheLion In theory true. In reality most disabilities probably disqualify you.
@JerryCoffin I would imagine a lot of them do, but one can always inquire
@TonyTheLion ohh... Sorry man...
@JerryCoffin I wonder. Would it depend on the type of plane one wants to fly?
@Telkitty猫咪咪 Many (most?) commercial pilots got most of that flight time by flying for the military.
@JerryCoffin The other thing I heard other people do is to teach others to fly
gives you fly time too :p
irony ...
10:32
@sehe Yes, to an extent. Private planes certainly have less stringent requirements than commercial, and single engine less stringent than twin engine.
@TonyTheLion eye sight problem? :p
@Telkitty猫咪咪 I think you have to be qualified as an instructor before the flight time can count toward their qualifications.
@JerryCoffin I don't think so. The amount of time in the air is what matters.
@Telkitty猫咪咪 Do you ever pay any real attention to what gets posted here? He's posted about it a number of times (hint: related to ankles/feet, not eyes).
10:36
@JerryCoffin I think he doesn't mind that some factions are unable to figure it out. That's what they get for being lazy bums :/
@sehe Yeah, I guess.
@not-kbok Should be a Clang library for it. I simply build every Clang library in the list.
@Telkitty猫咪咪 chat.stackoverflow.com/…
@ThePhD How, exactly? WTF is ".\\", anyway?
@Tony stop shooting yourself in the foot. It's not bulletproof.
(bad joke I know, sorry)
10:39
@DeadMG Uh.. the current directory...
@JerryCoffin I do, I blame the difference in time zones :x
@Rapptz I suspected that, but in that case, how does it solve the problem of needing another copy of MinGW in every place you run Wide from?
@rubenvb quite
@DeadMG I don't know truthfully.
@TonyTheLion sry, I will never call you a weak puss now <3
10:43
indeed, requiring it to be in the working directory seems to me to be the epitome of that specific problem.
Since we are discussing sickness I must confess I have weak tummy - even iced coffee seem to upset it
and knee injuries from excess jogging
use a freaking environment variable. Default it to .\mingw\bin?
Marvelous code snip:
const char* get_mingw_basedir(const char* default_val = ".\\mingw\\bin")
{
    auto e = getenv("WIDE_MINGW_BASE_DIR");
    return e? e : default_val);
}
What's the specific problem?
Developers will have this directory in PATH anyways...
I don't
10:52
& occasional lower abdomen disconform - doctors never found anything. I don't like to go to the doctors. Sometimes I imagine it is cancer and I would be dead soon. But it always goes away ... for a long time ... before it is back.
// always this round-aboutness
auto future = packaged_task.get_future();
std::thread(std::move(packaged_task)).detach();
return future;
@DeadMG you should. It's how stuff works.
define "stuff"
I don't seem to have any stuff that's broken by not having it in PATH
11:07
Woot! I made the leap and bought a ticket to Meeting C++ 2013!
Now someone of you guys is morally obligated to come too... and make me feel less out of place :/
/cc @R.MartinhoFernandes @not-kbok etc. ^
@sehe going native?
Well, I'm going native, but that's a different venue :)
ah, ok :)
hmmm
does anyone here have experience with boost::program_options?
11:13
@rubenvb careful with the @not gun. That's easily prone to ping half the lounge population these days
@sehe I have checked, air tickets from my place is <$500 - much less than going native's 2700$
@sehe you had any track in mind?
@DeadMG Tried to use it once. Don't recall the specifics
@FlorisVelleman Yeah, the cool tracks. Probably sticking to metaprogramming and c++1y (that's all of it... :( still having to choose)). But perhaps a bit of Qt/UI is good for my soul!
Heh, boost options uses ()()()... syntax.
@sehe The multimedia part from Qt seems interesting
11:15
hmmm
Indeed. I haven't decided on any of the session yet. Lemme have a quick look to draw up a provisional chart
ISTR that it used to be possible to download prebuilt versions of Boost, at least for Windows, but their downloads page only seems to list what I'm gonna guess is a source package
@DeadMG There is. Boost consultancy org boostpro.com/download or something
0
A: Why wont this object get created? c++

T.J. CrowderTo create an object, use new: Player player1 = new Player;

It's getting a bit out of date I see
11:18
@sehe Yeah, I checked that, but it doesn't support VS2012
ah well
looks like I'm building from source
@DeadMG Not easily satisfied are you. If you want bleeding edge and IDE hand holding, you're gonna have to do some things yourself :/ Then share it with the rest of us
Hey, he's just asking.
Oh, no, he's not.
lol
doesn't Boost do that "Magically link to the right lib" stuff?
Bin knows all
Xeo
Xeo
@DeadMG Yes, if it recognizes your compiler.
@DeadMG On MSVC, yes
11:32
awesome
well I've really been putting off creating useful functionality via command-line instead of having hardcoded stuff, so I figure that this has been a bit overdue anyway
Quick question, if I'm inside a constructor that is populating a container (std::vector) and something throws. What happens? I'd hope that the vector is properly released and all the elements that made it in have their destructors called.
@Mysticial of course
*the vector is a member of the object. Not a local variable.
still the same. of course. This is what C++ is for
So in the more general case, if the constructor throws, the destructors are called on all members regardless of whatever state they are in?
11:35
Nope. They get destructed iff they had been constructed. So, not regardless
@Mysticial All members whose construction successfully completed will be destructed, including if initializing with a member init throws.
It's like this throughout all of C++
Ah
So once you get past the initializer list, then all members are constructed. So in that case, the destructors are called on all the members.
Even with goto's across declarations with initializers, potentially in switches, with RAII semantics and the whole shebang.
yes
11:36
C++ is super effective! You gotta love the no-compromise spirit of the core language design there
even in the initialization list, if a member's constructor throws, all the already-constructed members will be destroyed.
pretty much the only case where C++'s built-in language semantics are WTF-unsafe is the lack of sequencing with function arguments and new and such.
It would have been so plausible and easy to take shortcuts in the specs there
@DeadMG You mean sequencing and lack thereof
So now the next part. Suppose I'm not using a smart pointer, and I'm just newing objects and passing them in a vector. The way to be exception safe is to throw a try-catch over the loop. Do a catch(...), manually delete all the pointers that got in, and rethrow with throw?
@Mysticial Er, this is the exact example of why you should use a smart pointer.
@Mysticial Smart pointer and function-level try: struct X { X() : member2(), member2() try { .... } catch { ...} }; FTW
11:38
I'm just trying to understand a few things. Since I've never done exception safe C++ before.
for example, you're still fucked if push_back throws.
if you do vec.push_back(new T) and the allocator throws bad_alloc, you will leak the new T.
new (nothrow) T
won't save you from the allocator throwing.
@Mysticial (nice edit)
@DeadMG true. Emplace?
@sehe Can still throw.
11:40
Anyways. Smartpointers FTW
@DeadMG Reserve up front :/
@Mysticial The trick to that is always wrap every resource in an RAII object as soon as obtained.
that's the only way to really be safe.
if you manually handle the exceptions and the resources, you will find several corner cases you forgot.
Even I recently realized that I have a resource-handling bug and memory leak w.r.t. a custom resource allocation jobby.
Here's a quick idea of talks I'd like to attend: MeetinCPP track /cc @EvgenyPanasyuk @FlorisVelleman
I could swap 1 or 2 out with UI sessions. Or maybe the german one. That'd fun
can't access
ye
Good. Fixed.
what are the odds of a program recovering from a std::bad_allow anyways?
11:45
100% The chance is big that the compiler will even trap it at compiletime
in most applications, if you run out of address space, it is a program-terminating bug.
exactly.
@rubenvb In the past I was playing with a few things where the application would do a fall-back algorithm if malloc() ever returned NULL.
the thing I don't like about exceptions
But that's a corner case.
11:45
is that they pessimize run-time even if not thrown.
I finally understood why exceptions don't count as "Don't pay for what you don't use".
@DeadMG that's untrue.
oh yeah?
what's the condition for move semantics instead of copy semantics in a std::vector resize?
@rubenvb No it's not untrue. It's very true
@DeadMG Also, vastly complicates code generated, allowing for proper unwinding
if I have a vector full of strings, and move constructing a string might throw, when I push_back another one, I will pay a MASSIVE extra cost compared to if it could not throw.
@DeadMG You need to compare puppies with puppies.
11:48
the footprint of exception handling per se is probably irrelevant.
If you handle an error, you'd need handling code without exceptions as well.
yes, that's quite true.
@rubenvb That's true. But exceptions enable proper cleanup by default, which has overhead compared to sloppy error handling by default. LOL
I guess that I should simply say "errors" rather than "exceptions", since arguably the exact error-reporting mechanism in this case is irrelevant.
the point is that if std::string's move constructor even might throw, you pay a big cost, even if it never does.
@DeadMG Stroustrup made a case against exception handling in embedded realtime systems
11:49
And we're back to: return an error code if mission-critical.
@rubenvb Indeed
@rubenvb I don't think that would actually solve the problem.
It's old hat, and many things are true. I commend this room for reaching the essential point in <10 minutes :)
@DeadMG what was the problem, anyway?
if you had an equivalent system based on error codes, you would probably still have to make the same decision.
@sehe this is like... the zillionth time this point has come accross.
11:51
@sehe It seems quite interesting though I am quite interested in the cross compilation part.
@rubenvb IKR
@FlorisVelleman Which track is that? The Black Berry or the Embedded?
@sehe The problem is that, a) having a function that might throw can be vastly more expensive than one that won't throw, even if it never actually does, and b), memory allocation ops are extremely common and necessary in lots of places, so lots of functions might throw when they really won't throw almost all the time
for Wide I am certainly considering having the default allocator terminate if allocation fails.
@sehe UI prototyping and development for multiple devices in C++
9
A: In what ways do C++ exceptions slow down code when there are no exceptions thown?

avakarThere is a cost associated with exception handling on some platforms and with certain compilers. Namely, Visual Studio, when building a 32-bit target, will register a handler in every function that has local variables with non-trivial destructor. Basically, it sets up a try/finally handler. The...

@DeadMG True. So we need rigorous noexcept(...)-correctness in libraries and our own code...
@DeadMG I'm not so sure about point a) on decent implementations.
11:53
@sehe You have a plan on how to get there? Seeing as your from the Netherlands aswell
@FlorisVelleman Yeah. That's one on my alternatives radar too
(decent being: MSVC x64, Linux, ...)
@rubenvb It's mandated by Standard.
NS Hispeed. no bookings possible, yet
Oh, I forgot (?) you were from the NL
@sehe Yes. You really need to prove noexceptness whenever you can, really.
11:53
@DeadMG then define Expensive, cause I know of nothing requiring a full-blown runtime hit.
I'm not usually so early bird in making arrangements, either. So I'll see in due time :)
@rubenvb Copying a structure instead of moving it (see my previous example about std::string- if std::string's move constructor could throw, a vector<std::string> resizing would have to copy it's elements rather than move them).
@sehe Yeah, was wondering if you were going by train
@DeadMG that's a bad implementation. (and I'm not saying the Standard itself is not a bad implementation).
@rubenvb There's no other choice if you want to have strong exception safety.
11:56
@FlorisVelleman 99% chance
you cannot have strong exception safety with throwing moves.
hell, you probably couldn't even have basic exception safety in some cases.
then make the moves nothrow
hence being my original point.
even the possibility that the moves might throw pessimizes the function massively- even if it never actually does throw.
in fact, did you know that some Standard containers do not have guaranteed noexcept move because some implementations wanted to allocate memory in their move constructor?
not to mention the conceptual problem of bye-bye move-only types.
@sehe did you get that invite ?

« first day (995 days earlier)      last day (4179 days later) »