« first day (823 days earlier)      last day (4132 days later) » 

:I welp I'm lost. Quickly! To YouTube!
 
@doug65536, As far as I know, it's the type after conversions such as array to pointer etc.
@MooingDuck, Hasn't MFC been outdated for a while now?
 
@chris yes
 
@chris ah so that somehow makes the compiler find a conversion and pass that, enabling the implicit conversion?
 
@doug65536, I guess the declval worked the same way as the remove_x things I had, but I had to use decay to normalize the return type.
 
2:02 AM
@Crowz in C (and thus C++), obj name[] as a parameter is exactly the same as obj* name. (This is considered a bad thing, but too late to get rid of it)
 
@MooingDuck You're wrong.
 
@DeadMG wait what?
 
for any name that names an array, it can decay to a pointer to the first element.
but it might not
it can still be an lvalue that is an array- for example, sizeof, or when passing arrays by reference.
 
@DeadMG, But in the context of function parameters.
 
oh
 
2:03 AM
@DeadMG "as a parameter..."
 
I failed to read all the context
my mistake
 
@DeadMG I don't think it counts as context when it's part of the same sentence.
 
in that case, they are ... still not equivalent.
 
@MooingDuck nah that's not the problem, all this C++ stuff just looks so foreign to me
 
And yeah, I would've pointed out by reference, but the syntax is a bit different is all.
 
2:04 AM
@Crowz oh
 
particularly when obj is an array type.
 
@DeadMG in what way?
 
consider a multidimensional array.
T[] can decay to T*, but T[][] cannot decay to T**.
 
@chris But then you can't use it in C anymore. A good rewritten C-API would do the job too.
 
so whether or not obj* name and obj name[] are equivalent depends on name and obj.
 
2:05 AM
@DeadMG Why not? (or why can't it?)
 
@MarkGarcia, It decays into a pointer to an array.
 
pointer to the beginning of an array of pointers
 
Incrementing it moves it up by the size of a whole array, not just one element of the inner array.
 
Oh that 70s show how i miss you
 
2:06 AM
Anyway, I'm glad I can use range-fors in multidimensional arrays.
 
@chris no it doesn't how does it know the size?
 
@doug65536, You have to specify it.
 
@DeadMG I'm going to go with that being merely syntactical (though accurate syntactically, yes)
 
you said incrementing it moves it up the whole array? Im pretty sure it would move one pointer ahead on the array of pointers
 
void foo(int[][]) won't compile.
 
2:08 AM
oh that yes
thats different
I was thinking only of main(... char *argv[]
 
The most nooby question of the day
 
Can't we just use int main(std::vector<std::string>)!!!
 
thankfully, no
 
@MarkGarcia no, main follows a C API
 
I made a class called Camera, and there's Camera::Camera(void) and Camera::~Camera(void). What is that?
 
2:10 AM
int main(int argc, char**argv) {
    std::vector<std::string>(argv, argv+argc); //done
 
@Crowz, Those are a constructor and destructor.
 
@crowz constructor and destructor
 
@Crowz default constructor and the destructor
 
@crowz don't put (void) in C++, it's superfluous, just use ()
 
Ooooh I see
 
2:11 AM
@MooingDuck You could write a wrapper main to call an overloaded main with std::vector<std::string>>
 
@doug65536 I assume he copied from the compiler somewhere
 
@doug65536 That's the Microsoft style.
 
@doug65536 Visual Studio does it by default
 
@bash0r true
 
really?
 
2:11 AM
@MarkGarcia it's the C style
 
yes, you need it in C
 
Does it also turn your struct S{}; into typedef struct tagS{} S; by default?
 
@MooingDuck And it's Microsoft that always likes to do it.
 
@chris no
 
() means unspecified parameters in C
 
2:12 AM
Why are there penises all over the starboard?
8
 
@MarkGarcia because Microsoft makes C APIs
 
Like... I come back from class and... yeah...
 
@MooingDuck, Well I'm grateful they at least don't do that.
 
@chris they do do that. That's Why they use the C form.
 
@Mysticial Ironically now the answer is you
 
2:13 AM
windows kernel is C
 
@MooingDuck, I mean the typedef. I thought you said no to that.
 
the vast majority of windows drivers are C. crazy people have managed to get c++ drivers to work well
 
@chris oh, yeah they don't do the typedef thing. That'd be invalid.
@doug65536 every major kernel is C
 
Besides ATL, are there other Microsoft libraries that use templates?
 
@MarkGarcia don't think so. Their version of the STL is
 
2:15 AM
In accordance with the room topic
 
a bit of template stuff in directx IIRC
helper things
 
@doug65536 Not in 10 & 11.
 
@doug65536 coud have sworn directx has a C API
 
it's COM, so its based roughly around structs of function pointers
 
@MooingDuck It's just a C++ wrapper.
 
2:16 AM
so yeah you could call it a C api
 
@MarkGarcia ah
 
the struct happens to also work in C++ as vtbl
 
@MooingDuck, Most of it does. They actually have #ifdefs inside classes to add operator overloading.
 
@doug65536 if it compiles in C, it's a C API
@chris that's cool
 
It's nice when that class is a matrix
 
2:17 AM
@MooingDuck It's more like of a deception. Like, they do it in the OO way.
 
I think C++ is reminding me how much of a noob I am hah
 
@Crowz careful, you get stars that way
 
Unless it's Crowz obviously.
 
@Crowz C++ is the most depressing language.
 
Yeah, you getting stars would be a shame. It would push the penises off.
2
 
2:19 AM
@MarkGarcia Nope it isn't. Think about BrainF.
 
Malbolge.
 
I like languages where there's already libraries for everything :(
 
@bash0r At least, a "real-world language".
@Crowz "like" and ":(" ?
 
@MarkGarcia Oh Sorry I meant
;_; </3
 
Honestly, I don't see how whoever decided against operator overloading in Java thought it would be more confusing than == not actually comparing strings etc.
 
2:20 AM
@MarkGarcia thc.org/root/phun/unmaintain.html Just use Fortran and have fun. : >
 
@Crowz You mean Python?
 
@bash0r That's the rule for writing code obfusticators!
 
@Rapptz Python and java are the two languages I use
 
@MarkGarcia Poor maintainers. :x
 
I wonder what would happen if we all started starring everything
 
2:24 AM
@doug65536 Why not try it?
 
think the site is clever enough to catch that?
probably
 
@MarkGarcia Not right now. At least let the penises stay until our EU regulars wake up.
 
lol
yes dont star everything lol
 
I know! I'll make each variable I have in my Java summative be a different number of underscores.
 
@Mysticial How thoughtful.
 
2:26 AM
use confusing combinations of i j 0 O i I 1
m n
 
what the hell is a namespace?
 
@Mysticial Haven't gone to sleep yet.
also, penis.
 
@crowz a scope
names go into scopes
 
I'll give one variable the name myvariable, and the other myvaríable in the same scope.
 
so you can put names aside in a separate scope.
say you were making some parser. would you put XParser in front of all the enums and functions and types? no, you would make a namespace X, then save yourself repeating the prefix everywhere
 
2:28 AM
In my scripting language I have an easy name scrambling scheme: FunctionIdent 28 ParameterTypes 29__2D__3E ReturnType. Do you guys have any idea how I can scramble functions to this via a C macro?
Great, it ate a few underscores...
 
@bash0r you know the ## operator right?
 
Yes, but I got problems when I started using a variadic macro.
 
@bashor wait you're trying to do reflection in C in a macro? not gonna happen AFAIK
 
Not directly a reflection, I just want the name scrambling.
 
2:31 AM
Reflection is a bit too much to do it via macros, isn't it? ^.^
 
what are the inputs to the macro?
 
@bash0r Impossible. You cannot gain information about a function's signature from a macro.
 
28 29 2d 3e?
 
The function singature is the input for the macro.
 
you'd have to use variadic macro arguments for the parameter types.
 
2:32 AM
from a symantic analyzer?
 
That are the HEX codes for these ASCII characters: ( ) - >
 
but it's still impossible, as you cannot gain the canonical type from the parameters.
for example
consider typedef int lol_typedef; MACRO(lol_typedef); MACRO(int);
they would give different names, even though they are the same function.
you would have the same problem with name lookup- qualified, unqualified, dependent, ADL, using decltype, etc.
 
It's not for C/C++ calls, it's for my scripting language. It doesn't care about C/C++ types. String will be an char* (llvm i8*) internally, but it is name scrambled as String.
 
you want to convert preprocessor tokens into hex and then paste them together in the preprocessor?
 
2:35 AM
then why the hell do you want a macro to do it?
just write a regular function
you can't write a macro for that purpose anyway because... the function idents and signatures are not known to the preprocessor of any interpreter or compiler.
 
it's pretty safe to say the preprocessor can't do it
 
I don't want to write functions like this:
void foo_28_String_2C_Int_29__2D__3E__Void(const char *, int) { }
 
why would you in any case?
if you are writing the C++ code, then let the C++ compiler implement name mangling.
 
anything is possible with a ridiculous mess of #includes and macros #if trees. but realistically I don't think so
 
When I write them like this I can use them via LLVM directly without addGlobalMapping
 
2:37 AM
if you are writing the compiler for X language, then implement name mangling at run-time, like the C++ compiler does.
@bash0r Right, but you need a function, not a macro, that deals in your representation of types and such.
and there are many details you must take care of to have a true mapping.
 
It's thought for API calls.
 
interop?
 
where is std::begin defined?
 
ah, and ##... didn't work
 
nvm, <iterator>
 
2:39 AM
obviously
 
Maybe I just do it via C++ templates to map a class to a module. : /
Via addGlobalMapping...
 
are you overcomplicating it though?
 
wtf, dude.
how could you possibly use a template.
you're interpreting X language- the names and types aren't known at compile-time.
 
Again, it's thought for API calls.
 
I failed to understand that
 
2:41 AM
When I add an API-Element to the interpreter then it's already known at compile time.
^.^
 
a simple tool comes to mind. you pass it input and it spits out all the functions
 
right, but you don't need to mangle it at compile-time.
in fact, you can't really do anything with it at compile-time.
everything in the interpreter happens at run-time, effectively.
 
you can do it with a scripting language for that matter, if you take that approach
 
and secondly
name mangling is only useful for languages which require binary linkers.
if you are implementing your every-day language, you do not need a binary linker, and therefore do not need name mangling.
 
I don't have enough context to know what you're talking about really, nevermind
 
2:42 AM
LLVM JIT compiles. All functions you declare/define need to be unique.
 
@bash0r Right, but they don't have to have names that correspond in any way to their names in the source code, nor their arguments or return values.
you can just name each function "1" and "2" and whatnot if you want.
 
ok, and you want JIT'ed code to call back into your native code?
 
or even nothing.
 
your C++ code or whatever
 
That's awkward to debug.
@doug65536 I want to JIT compile my scripting language.
 
2:44 AM
not really
if you ever intend to JIT another call to that function, you will need a mapping from name to function
 
and these API calls might be kernel32 or some shared library or something, direcly callable from script?
 
but that mapping is quite arbitrary
there's no reason to do anything except unordered_map<std::string, llvm::Function*>.
if you want to write a debugger that can remotely cope with a non-trivial language, then you'll need internal interpreter-specific information anyway.
LLVM doesn't know jack shit about anything about your language
 
@doug65536 LLVM can call C functions out of module for some reason. Because of this I wanted to add a bit 'name scrambling' for C functions to be callable from my scripts.
 
why bother?
and secondly, only C functions? umad?
 
@DeadMG How would you map it native events?
 
2:46 AM
it's your language right? can't you make syntax for declaring them
 
@DeadMG No never ever. I just thought about some extern "C" functions to implement an API. ^.^
 
right
 
@doug65536 I can do, but I did not want to add C++ name scrambling.
OK guys, for now I'm out. I'm really tired.
 
well, the most obvious way to go about it is to simply add a mapping in your infrastructure, probably a hash table, that maps from a name to llvm::function
 
tracert is cool
 
2:55 AM
Java Update.
 
we know
 
@MarkGarcia Better: just uninstall Java and be done with it.
 
@JerryCoffin It just pops and installs itself out of nowhere!
 
@MarkGarcia I don't mean uninstall the browser plug-in. I mean remove the whole JDK (or JRE, if you're into that sort of thing).
 
@Rapptz: I'm looking at the Nexon registration form, next to Date of birth there's (translated by google: Lift, Lunar, what the heck is taht?)
 
3:08 AM
I haven't seen the registration form in forever.
@Borgleader 양력?
 
The two things filmmakers don't understand: explosions and hacking
 
@Rapptz Yes that
 
tick that option
or tick Lunar
 
What's the difference?
 
how you determine your age
it's a cultural thing
 
3:11 AM
I'm thinking of putting the wrong date anyway
 
second one is 음력 right
 
I was just curious of what it was
yes
 
East Asian age reckoning is a concept and practice that originated in China and is widely used by other cultures in East Asia and Vietnam, which share this traditional way of counting a person's age. Newborns start at one year old, and each passing of a Lunar New Year, rather than the birthday, adds one year to the person's age. In other words, the first year of life is counted as one instead of zero, so that a person is two years old in their second year, three years old in their third, and so on. Since age is incremented on the new year rather than on a birthday, people may be 1 or 2 yea...
That it?
 
Yes.
 
3:13 AM
One way to distinguish good action movies from the crappy ones: sniper rifle crosshairs.
 
good ones dont have any?
 
Like I said, it's completely cultural.
 
@Borgleader Crappy ones have this techy-scopes with random numbers showing at wrong places.
 
oh lol
 
@Rapptz @LucDanton yes, we count 10 months pregnancy time as well
 
3:15 AM
.... There's so much penis on the starboard. D: What's been going on while I was gone?
 
@ThePhD Stop copying @Mysticial :(
 
@Borgleader I'm not really interested in why, though.
I rather have a suggestion: why don't we put some vagina up there so the penises aren't lonely?
 
because we were discussing penis
 
@Rapptz This does not sound homoerotic at all.
 
@ThePhD homoerotic?
 
3:18 AM
[[Saint Sebastian, by Carlo Saraceni (c1610-15), Castle Museum, Prague. The image of Sebastian pierced by arrows has regularly been described as homoerotic.]] Homoeroticism refers to the sexual attraction between members of the same sex, either male–male or female–female. The concept differs from the concept of homosexuality: it refers specifically to the desire itself, which can be temporary, whereas "homosexuality" implies a more permanent state of identity or sexual orientation. It is a much older concept than the 19th century idea of homosexuality, and is depicted or manifested throug...
 
grats, that is now on your search history
 
... Oh god, what have I done. ;~;
 
My delicious soup is too hot, I keep burning my lips.
 
is using constexpr with templates redundant? No right?
 
No.
 
3:24 AM
Damn, it's asking me for a KSSN fuuuuuu
 
@TheRationalist I'm too lazy to type up a proper answer. So I'll let someone else have it. And I won't be getting any rep from it anyways... — Mysticial 8 secs ago
^^ Free rep
 
holy shit drawing pisses me off
 
well guys, I effectively just remade boost::irange
 
Sorry about that.
 
it was actually my intention.. you can tell how bored I am right now
 
3:29 AM
Is your implementation chock-full of C++11 goodness?
 
does constexpr count
 
constexpr functions don't.
 
then no :(
 
Most unfortunate.
 
it works though!
 
3:32 AM
Well.
 
doing reverse shouldn't be too difficult either..
like range(10,0) instead of boost::irange(0,10) | boost::adaptor::reversed or w/e
 
What if it's range(10u, 0u)?
 
is it ub to subtract from an unsigned integer? As long as it doesn't overflow?
 
No overflow on unsigned types.
 
hm.
 
3:39 AM
I was referring to the fact that if you co-opt range(10u, 0u) to mean range(1u, 11u) | reversed, some users might then be prevented to express 'from 10u to 0u'.
 
@Rapptz Tried 410 yet?
 
Nope, haven't even seen it
I've been working on other things.
reversing ended up being more complex than I thought :(
0
Q: How to iterate through a list of numbers in c++

DbzI have a simple question: how do I iterate through a list of numbers, and how many different ways are there to do it? What I thought would work: #include <cstdlib> #include <iostream> #include <list> using namespace std; int main() { int numbers[] = {2, 4, 6, 8}; ...

lol
 
Oh wow, Boost 1.53 will have Coroutine. Not sure how I missed that.
Tons of new library goodness, even. I'm amazed.
 
wow... i thought only matlab did stuff like this
 
Did what?
 
3:52 AM
@LucDanton Thanks for the 1.53 update.
And there's lock-free data structures!!!
 
@Rapptz Ordinary Diff Eq solvers
 
multiprecision library O.o
wth
these are cool..
 
@Rapptz Isnt that what you were working on?
 
Boost.Variant will be made move-aware!
 
@LucDanton Why's that a big deal again?
 
3:56 AM
I always wanted to make something that solved equations
like mathematica or wolfram alpha
 
I actually felt like doing that too recently
 
@Borgleader Well, otherwise at best it makes too much copies and at worst it doesn't work for some types.
 
wolframalpha is baws
 
@Borgleader Also I forgot I wanted to make a Decimal class until you mentioned it.
lol
@Borgleader something like integrate("3x^4")?
because that's the way I thought about it which is why it was difficult for me to think of how to do it
 
@Rapptz yeah well id start with +,-,/,*
 
4:00 AM
it'd be easier if you had regex I think for the parentheses order of operation.
 
I'd use regex for parentheses
I'm pretty sure I can handle order of operations with recursive descent
 
A regex can't count, so it can't track nested parens properly.
I'd use SNOBOL for parentheses.
For those who haven't used it/aren't aware of it, SNOBOL is a language (an old language) that's basically what Perl6 is (unwittingly) trying to become when it grows up.
 
4:19 AM
You mean for a string like "((4+3)/17)*14"?
 
@Rapptz Yes. A regex can't even tell you whether the parens are balanced correctly (without external logic to keep track of balancing).
 
there has to be one way to do parentheses..
 
yeah- a parser.
there is no regex possible that can match parantheses
 
@FunBeans You can do it with any array.
 
4:41 AM
Can't say I've ever had this problem.
 
Me neither.
 
@Rapptz Because they're not advertised as footlong over there, duh.
 
4:58 AM
isOrthogonal or isPerpendicular for a function that returns bool if the dot product between vectors v and w == 0?
Sometimes I wonder the dumbest things.
 
That's orthogonality.
 
5:36 AM
playing with stxxl - v.nicely engineered
 
isn't that very dead?
 
it's not very active, but the recent version seems to work fine (at least with the parallel test code in the docs)
is there a newer/better alternative?
 
what's wrong with the Standard lib that comes with your compiler?
 
size
 
specifically?
 
5:47 AM
stxxl handles really big data
like if you want to sort 1 billion records, etc...
 
the Standard guarantees the complexities of many operations
 
but I'll run out of memory
 
and it's a lot simpler to re-roll one function or one container than the whole damn thing
 
stxxl will do external sorting
and do it in parallel if need be
 
6:08 AM
penis discussion? COUNT ME IN!
 
Please. Enough of this Nonsense. It's so Stupid.
 
6:32 AM
posted on January 16, 2013 by Scott Meyers

I'm very pleased to announce that the ninth book in my Effective Software Development Series has recently been published, David Herman's Effective JavaScript. In my comments to David on a pre-publication manuscript, I wrote: These chapters are a very pleasant read.  The text flows well, and the explanations are such that I generally had no trouble understanding them, even though I don't

 
Hmph.
 
6:53 AM
ooo angliche èxame toudeye
it choudente bi tou arde!
@kfmfe04 "stxxl handles really large elements, for example if you want to sort my penis"
you missed an opportunity right there
 
@NolwennLeGuen ty for your comment - on my ignore list
 
I sorted my penis once
That was back in my college days. Those were wild times
 

« first day (823 days earlier)      last day (4132 days later) »