« first day (754 days earlier)      last day (4187 days later) » 

12:00 AM
@sehe Later.
 
I need some upboats.
 
user1357851
I saw a large neightbourhood parrot went to play with 5 magpies
 
user1357851
like it purposely flew to the magpies and picked a mock fight with one of them
 
Oh yeah? The man painted the broom in the closet.
 
user1357851
makes me think birds can be bored and play interspeciely sometimes
 
12:14 AM
@Chimera have you done things upboat worthy?
 
user1357851
gee e-reputation
 
user1357851
you should care so much
 
@MooingDuck Yes, my recent Fortran tagged answer.
Just because it's Fortran!
Remember about a week ago or so I said I was going to ask about cold fusion on physics.se and try to got Ron Maimon involved? Mission accomplished!
6
Q: What are the challenges to achieving cold fusion?

ChimeraI am an absolute neophyte regarding physics. What are the challenges to achieving it? I'm not sure this is a duplicate of Why is cold fusion considered bogus?, because that question is talking largely about the validity of some claims of cold fusion being realized. This question is specifically ...

@Telkitty Yes, I like reputation.
Thanks for the upboats.... glad I am worthy.
 
Can I overload operators in my main function?
 
user1357851
Here is how I am going to fix pride & prejudice, twilight and 50 shades of grey up and make a super(failure)romantic novel
 
12:26 AM
or is operator overloading only for classes
 
user1357851
@Howdy_McGee what do you mean
 
@Howdy_McGee operators are functions like any other function. They just have an additional special notation when calling them.
 
user1357851
overload is for an object
 
But always be sure your flux capacitors are charged and you don't feed them after midnight.
 
@Telkitty overload is for functions, not objects
 
user1357851
12:27 AM
@MooingDuck not additional, replaced is more accurate
 
@Telkitty No additional is correct because you can have more than one
 
@Telkitty except you can still use the old notation
std::operator<<(std::cout, myint); works fine
 
user1357851
yes functions for object
 
user1357851
@MooingDuck yes
 
user1357851
or + for doing something else
 
12:29 AM
@Borgleader operators have two syntaxes for calling. no more, no less (with exceptions for primitives)
 
@MooingDuck 2 is often more than one ;)
 
> But always be sure your flux capacitors are charged and you don't feed them after midnight.
^ thought it was funny
 
@Chimera you said that already
 
@MooingDuck I know. :-)
 
I want to go home
 
12:30 AM
But have I said don't get them wet?
 
Xeo
Anyways, off to sleep I go, tomorrow's going to be a rather busy day. G'night.
 
@Xeo G'night mate
 
user1357851
continue with
Here is how I am going to fix pride & prejudice, twilight and 50 shades of grey up and make a super(failure)romantic novel
 
user1357851
I will make the male lead a sadistic super rich vampire
 
user1357851
and female lead a brain dead marilyb morone alike
 
user1357851
12:33 AM
xeo is still here
 
user1357851
Then the super vallian being a evil 90 super hacker grandma
 
My broker sucks, I want a P&L breakdown on FX and spot
 
user1357851
all broker sucks
 
user1357851
they take a share of your profit
 
user1357851
or whatever even if u do not make $
 
12:35 AM
Well, good luck going out and buying shares yourself
 
user1357851
they are like glorified financial instrument sales person
 
user1357851
I trades index (ETF)
 
user1357851
but sold them all when I bought my current property
 
user1357851
now I am half a miilion in debt (mortgage) and my tenants look at me as if I robbed them
 
user1357851
traded*
 
12:37 AM
That's a fucking big house you must have
 
user1357851
I live in sydney
 
user1357851
property here is not cheap
 
Oh
 
user1357851
it is a fibro house on a main road
 
I thought you lived in the US for some reason
You know houses made of wood, that kind of stuff
 
user1357851
12:40 AM
timber?
 
What ?
 
Yes, timber ~ wood
 
Anyway, gonna sleep
WIsh me luck
 
user1357851
laterz
 
user1357851
luck for what?
 
12:42 AM
Hard to sleep @kbok?
 
user1357851
your profit & loss broken down by forex and spot?
 
@kbok G'night (and good luck).
 
& good dreams!
 
user1357851
yes dream about being lucky
 
user1357851
;D
 
12:45 AM
& after wake up, good dream gone & sad!!
 
user1357851
I didn't say that
 
guys when i get this warning :
'=' : conversion from 'float' to 'int', possible loss of data

Should i just use floats or ignore it ?
 
add a static_cast
 
user1357851
depends whether it is float to start with
 
depends on what you're doing. if the conversion is expected / desired, use an explicit cast so you don't get a warning; else switch to floats throughout
 
user1357851
12:57 AM
if it is 5.12 and you cast to int
 
the warning is there in case the conversion is accidental (bug in your code).
 
user1357851
there is possible loss of of data
 
well i do this:
i sent ints then i divide by 2 but i round up or down back to an int
 
which do you want?
 
it's expected, just add the static_cast<int>(theOffendingFloatValue);
 
12:59 AM
Have we forgotten about proper capitalization when writing?
I don't want to see another sentence begin with a lower case letter!
 
so static cast will convert the float to int ?
 
user1357851
m_MyVariable
 
@Chimera HOW ABOUT FUCK YOU! :P
 
> hungarian notation
 
@Borgleader Much better! :-)
 
1:01 AM
Is this lounge strictly for C++, or can I also ask a more general question here?
 
user1357851
Oo I must be hungry I thought I saw burgerled
 
you can ask
 
depends if they like you @Hans-PeterE.Kristiansen
 
user1357851
but they might not answer
 
user1357851
also depends how much they have already drunk
 
1:02 AM
@Dave static_cast<aType>(myVar) casts the myVar to aType. There are other cast types (dynamic, reinterpret) but I won't get into those.
 
ok ill go read up on static cast :) thanks for the hint :D
 
My question was closed - In the comments, I got the impression, that people could answer, but they just did not wan to. I think it is unfair.
 
It's like, basic C++. Have you done basic C-style casts before?
 
user1357851
is reinterpret cast even used nowadays
 
Create a batch script, type "echo [alt+07]" (actually pressing alt and the 0 then 7 keys). This gives you the ASCII bell character. Run it and you'll get a beep. — jjokin 28 mins ago
 
1:03 AM
int(myVar) or (int)myVar
 
Yes sure, but I want to control the duration, and freq.
 
no c++ is my first strict language i came from JS / PHP world :P
which is why i struggle
 
@Telkitty when it's needed, yes
 
@Rapptz There are nuances between a C-style cast and stat_cast iirc
 
@Hans-PeterE.Kristiansen Your question got closed by a mod, which means it can't be reopened
 
user1357851
1:04 AM
@MooingDuck see most dynamic_cast in its place
 
user1357851
always check null after conversion
 
Yes - bad. I do not agree with his argument though:o)
 
338
Q: When should static_cast, dynamic_cast and reinterpret_cast be used?

e.JamesI am reasonably proficient in C++, but I do not have a lot of experience using the cast operators to convert pointers of one type to another. I am familiar with the risks and benefits of pointer casting, as well as the evils of using C-style casts. What I am looking for is a primer on the proper ...

 
maybe I can actually use C++ (even thoug it is not simple)
 
/cc @Dave
 
1:05 AM
@Telkitty dynamic_cast is UB if the type has no virtual functions, and static_cast works on non-pointers
 
/cc ?
 
carbon copy
Read the question I posted, it's pretty good info
 
Does C++ has a beep function with freq and duration?
 
@Telkitty also static_cast is sometimes MUCH faster, and does much more magic than dynamic_cast
 
user1357851
@MooingDuck not talking about static_cast, was talking about reinterpret_cast
 
1:06 AM
@Hans-PeterE.Kristiansen no
 
then i guess the answer is no
 
@Dave ? For what?
 
@Rapptz I'm not looking for the difference between all types of casts I know them. I was merely confirming with you that C++ casts are not strictly equivalent to C-style casts (mostly because C-style is a one size fits all unlike C++ casts)
 
@Telkitty reinterpret_cast and dynamic_cast DO NOT do the same thing. They're 100% different.
 
C-Style casts..
im assuming you were asking me that question ..
 
1:07 AM
OK - seem like this simple thing is not so simple after all. -and thus a valid question.
 
user1357851
@MooingDuck as names imply, dynamic cast is done at run time
 
user1357851
static_cast and be for primtive types
 
user1357851
reinterpret_cast is casting object into differnt type and can cast into the wrong object
 
@Telkitty so far so good
@Telkitty static_cast is for statically converting types mainly.
 
@Telkitty You can use static_cast on something else than primitive types...
 
user1357851
1:09 AM
@Borgleader true
 
user1357851
but I am talking about in practice
 
@Telkitty in practice most people use c-casts instead of static_cast, yes.
 
@Dave Well don't do C-style casts :P They're bad.
 
@Telkitty So am I... I've used that on non-primitive types in the past...
 
@Rapptz I have no problems with c-style casts on objects, I only care about pointers.
 
user1357851
1:11 AM
double a = (double)b + 1.05;
 
Superfluous in this case, 1.05 would force the type coercion (sp?) to happen ;)
 
user1357851
but what if b is an int
 
@MooingDuck What kind of pointers? Because shared_ptr has 3 types of casts for it en.cppreference.com/w/cpp/memory/shared_ptr/pointer_cast
 
@Telkitty still no problems. THe only problem is the other way around
 
Exactly, int would get upgraded to double.
 
1:13 AM
@Rapptz thanks for the heads up on casts :P
 
@MooingDuck Is there anything bigger than a double in the primitive types?
 
@Rapptz all pointers. Be safe with pointers. When converting non-pointer-like objects, c-casts are fine.
 
long double. :P
 
@Borgleader sometimes. On MSVC x86, just long long and unsigned long long.
 
Oh I see
 
1:15 AM
Hm.. What do you mean by bigger? std::numeric_limits<T>::max?
 
what am i looking for in my code when i get this error: unresolved external symbol
 
user1357851
wah u r nu :x
 
@Dave you forgot to define a function, or incorrectly linked against a library
@Dave or linked against a library compiled by different compiler or with different compiler options.
 
@Rapptz Yeah I meant a primitive type who's range of values does not fit in that of a double.
 
user1357851
why sql has no boolean type?
 
1:16 AM
Well that'd depend on the machine.
 
@Borgleader none in MSVC x86 or x64
@Rapptz and compiler
 
Mhm.
 
well apparently its this:

Button(int, int , int , int );
in my header =/
 
@Dave where's the body? And is that a member?
 
    Button(int x, int y, int m_w, int m_h)
    {
		m_y = y;
		m_x = x - m_w/2;
    }
yeh its to create the button offset
 
user1357851
1:17 AM
Button(int x, int y, int m_w, int m_h);
 
user1357851
at header
 
gotta do class_name:: prefix before the function
 
@Telkitty irrelevant
 
button::button() ?
 
@Dave do define a member function, that should be Button::Button(blah blah blah
 
1:18 AM
yes
 
class is called button
 
@Dave yes
 
does my header & cpp have to have button::button
or just one of them
 
just the cpp
 
user1357851
then it is a constructor
 
1:18 AM
@Dave only the cpp one
 
okay :)
 
Use initializer lists btw
 
thank you
 
in the .h you wrote the declarations in the class' namespace already so you don't need the Button::
 
use what? o_0
 
1:18 AM
@Dave the one in the header is inside of class Button { so it already knows it's a member
 
as is the one in my cpp
 
Button(int x, int y, int m_w, int m_h)
:m_y(y), m_x(x - m_w/2)
{}
 
my cpp has:
class Button
	{
	private:
		int m_x, m_y;
		int m_w, m_h;

	public:
    Button::Button(int x, int y, int m_w, int m_h)
    {
		m_y = y;
		m_x = x - m_w/2;
    }
}
 
@Dave class Button { defines the class. That should be in a header, and NOT in a cpp file.
 
oh so dont declare class in the cpp aswell as header
 
user1357851
1:20 AM
declaration goes in header
 
what about private vars?
 
user1357851
implementation goes in cpp
 
@Dave You don't need to declare it in cpp because you #include the header
 
You should read a book!
 
user1357851
private variable in header
 
1:21 AM
i dont get on with books i like fiddling with code :P
 
1736
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

 
ill try put privates in header and the functions cpp then
 
No. What
 
@Dave You still need the member functions to be at least declared in the header
Seriously, you need to read a book; fiddling with code may seem more fun, but you'll never learn the basics if you skip the book reading part
 
user1357851
1:23 AM
class Button
{
private:
int m_x, m_y;
int m_w, m_h;

public:
Button(int x, int y, int m_w, int m_h);


}
 
user1357851
is .h
 
ok yeh i have that in my .h :)
 
user1357851
in your cpp:
 
user1357851
Button::Button(int x, int y, int m_w, int m_h)
{
m_y = y;
m_x = x - m_w/2;
}
 
@Telkitty missing a semicolon at the end, but otherwise good
@Telkitty he's got 4 variables, and use member initialization lists
 
user1357851
1:25 AM
@MooingDuck he tried to get it to run
 
user1357851
he needs to learn to walk
 
the other members are set in a different function
 
user1357851
then he might consider running
 
Doing member initialization in the constructor's initialization list is learning to walk!
 
@Dave safer to set all members to a known value in the constructor no matter what.
@Praetorian it's a completely new syntax, it makes sense.
 
1:26 AM
Just another example
 
ok i got it as telkitty showed so i must be understanding even if the vars are apparently undefined
 
@MooingDuck it is different looking compared to an assignment statement, but it is still basic
I think we both agree on that
 
the variables in my cpp for button::button are all undefined
 
@Praetorian I'm not sure I agree with "basic"
@Dave what do you mean "undefined"?
 
He probably forgot to include the .h
 
1:28 AM
error C2065: 'm_x' : undeclared identifier
same for the other 3
deffinately got menu.h included
 
@Dave the button class is in the menu header?
 
lol
 
group psychic debugging session :)
is your Button class in a namespace? If so, the definition in the cpp needs to be ns_name::Button::Button ( ... ) { ... }
 
 
> screenshot of code
 
1:31 AM
the cpp has the function that telkitty posted
 
What's your menu.cpp look like?
 
how about a screenshot of menu.cpp?
 
or pasting it please paste it
 
sure
 
@Dave it's best not to give parameters and members the exact same name. Usually one removes the m in front of the parameters, and moves the underscore to the back
 
1:31 AM
here is the paste:

Button::Button(int x, int y, int m_w, int m_h)
{
m_y = y;
m_x = x - m_w/2;
}
 
@Rapptz oh cmon, screenshots are so much better! :P
 
before that is include menu.h
 
looks fine to me :(
 
Aw never mind, it got deleted.
 
user1357851
m_x etc are only declared in Button
 
1:34 AM
@Rapptz You can see it if you look in the revision history
 
user1357851
so if you use outside Button class it would be undeclared
 
Nov 3 at 8:57, by Pubby
> We need to have a Video of your running code, otherwise we can't help you.
 
but the function is related to button class with button::button ?
 
waaaiiiit
 
Seriously, I think we need a screenshot of your cpp
 
1:35 AM
ok ill screenshot
 
menu.cpp(51) syntax error: '}'
put your cursor to the left of that
press control+}
 
i fixed that
 
@Dave all of those?
 
 
@Dave k
@Dave btw, the full text of each error is in the "output" window
 
1:37 AM
@Dave IsIn also needs to be Button::IsIn since it's a member function
Same for the rest
 
so how come button:button doesnt need a data type ?
 
@Dave constructors don't return anything. I don't know why, but they're an exception to the rule that all functions have a return type
 
@Dave You mean a return type? Cause it's a constructor. See, here's where that book would've come in handy
 
how does it know its a constructor theres nothing reallying telling it thats what it is
 
Same name as the class
 
1:38 AM
ah i see
 
@Dave constructors are the functions with the same name as the class
@Dave destructor is "~classname", also has no return type
 
yeh thats why i wonder why no return type
i need to read up on destructors - haven't worked out their purpose yet
 
Ell
they happen when an object is destroyed
 
@Dave they're almost useless until you learn dynamic scope. Then you use them almost 100% of the time.
 
Ell
which happens when it goes out of scope
 
1:40 AM
but i finally got the window to render w00p
 
You have some weird ass indentation btw
 
hi everyone, what is the best way to send STOP to worker threads, other than polling for a global variable
 
@Rapptz it auto indents for me =/
 
@Gopikanna nothing. interrupting a thread is dangerous and should not be done under normal circumstances.
@Dave highlight that cpp file, hold shift and press tab
 
My Visual Studio doesn't auto indent like that lol
 
1:42 AM
@Rapptz he copy pasted the functions from inside the class definition to outside I bet
 
maybe i started doing it and it followed suit =/
 
user1357851
@Gopikanna why do you want to stop a work thread
 
@Dave it doesn't follow styles like that
 
@Rapptz Theres an indentation fixer somewhere in the menus
 
@Borgleader never knew that. Never came up except for SO code
 
1:42 AM
but, in my scenario when the user sends "stop processing" to master thread all the worker threads have to cleaned up and brought down.
 
ah - dunno then im used to it now - plus its useful for SO questions cos its already indented to highlight it as code
 
@Gopikanna they should clean themselves up and bring themselves down
 
@Dave Ctrl + K to indent 4 spaces in SO
 
oh neat didn't know that. though i don't need to cos copy paste carries my indents
 
yes, thats what how to notify worker threads . I don't want to use a global var and check for it because there are lot of heavy duty functions that workers do
 
1:44 AM
Ugly indentation < Ctrl + K when you copy paste :D
 
and adding checks for a global var now would make it painful
@MooingDuck
 
i dont think its ugly :O
 
If you say so. Not stopping you.
 
anybody?
 
guna go learn about arrays back later - thanks for the help guys
 
1:49 AM
See I learned about arrays before classes.
 
any hint
 
user1357851
@Gopikanna maybe do not commit/do the change until the end
 
i just learn as i need them whilst i build my scripts
 
user1357851
like have smaller functions
 
user1357851
if stopped nothing else gets called
 
user1357851
1:52 AM
@Gopikanna workable or not?
 
@Telkitty , there is no issue with consistency, the problem is that a thread pool is used, and want to make threads immediately available if no useful thing is done by it
and the functions are already written and huge, the user can stop any time
 
user1357851
all I can think of is break the process up
 
user1357851
but then you dont want to rewrite the functions
 
user1357851
break the whole process x into a, b & c
 
its not just one single thing
its a huge code base
 
user1357851
1:58 AM
lazy ass :D
 
user1357851
but I can understand why you dont want to retest multhread functions
 
 
user1357851
especially when the code base is huge
 
theres a lazy ass :P
 
guys, you should know the pain :)
 
1:59 AM
i was warned of the pain before i started :P
 
^ It feels a bit weird to mix C++11 lambdas with low-level Microsoft COM stuff; two widely separated levels of abstraction
Looking at it, the last function is buggy. Argh.
 
0
Q: platform independent inter thread communication

GopikannaI have a process which receives multiple jobs and picks a thread from thread pool and assigns a job to it, this thread in turn may spawn another set of threads from its own thread pool. Now when a STOP request for a job comes to the main process, it should be forwarded to corresponding thread for...

 
2:22 AM
will VC 32bit compile a 64 bit app for me?
or do you need to install the 64 bit compiler
that is if 64 bit visual studio comes with a 64 bit compiler
 
@sabgenton All (reasonably) current versions of VS include 64-bit compilers.
 
@JerryCoffin isn't there a 64 bit cd and a 32 bit cd to chose from?
 
user1357851
@sabgenton the usual practice is to compile 64 bit app on 64 bit compiler
 
user1357851
32 on 32
 
user1357851
compile and test them separately
 
2:28 AM
@Telkitty oh so it has both compilers installed at once?
 
@sabgenton no, it's all bundled in one package
 
is there two seperate cd? I saw someware vs 2012 x86
 
@Telkitty I complie 32bit even though im on a 64bit machine because a few libraries i use dont come in in 64bit flavors
 
implying theres a seperate 64 bit cd
yes no?
 
@sabgenton No. You install once, it includes both compilers. When the installation is done, the "Visual Studio Tools" directory in the start menu will have separate command lines for 32-bit, 64-bit on a 32-bit system, and 64-bit on a 64-bit system. In VS itself, you just change the target from 32-bit to 64-bit, and it selects the compiler appropriately.
 
2:35 AM
@JerryCoffin so there's no such thing as a 32bit only 2012 cd it allways comes with 64?
 
@sabgenton At least to my knowledge yes. 64-bit has been included on the CD at least as far back as VS 2008.
 
ok I saw some guide someware showing a x86 cd but mabye that just means x86/64
@JerryCoffin so a 32 bit machine can compile 64bit exe's as well?
(just not run them)
 
@sabgenton Yes (though I can hardly imagine using a 32-bit machine for development anymore).
 
ok so 32 bit complier would be used to compile in that case
 
@sabgenton There's a native 32-bit compiler, and an x64 cross-compiler (runs on 32-bit, produces 64-bit executables).
 
2:41 AM
but on a 64 bit machine 64 bit complier is used for 64bit.exe and 32 bit compiler is still used for 32bit.exe (even on 64 bit machine)
getting it now I think
@JerryCoffin ok third compiler
@JerryCoffin am I getting right now :S?
 
@sabgenton Yes, as I said a while back: "separate command lines for 32-bit, 64-bit on a 32-bit system, and 64-bit on a 64-bit system." Each of those has the path (and such) set up to point to the appropriate compiler.
 
I swear I've seen an x86 disc some ware if they mean x86 like it's not a Itanium fair enough but I wish they'd just say x86 / x86_64 if that's what they mean.
@JerryCoffin thanks for this
 
2:57 AM
@jerry what would you recommend as an alternative to ATL .rgs scripts for specifying registry config?
i'm thinking just building up a hierarchy of c++ objects
i.e. point being not using ATL
 

« first day (754 days earlier)      last day (4187 days later) »