« first day (543 days earlier)      last day (4387 days later) » 

11:00 AM
@jalf if only write int a; int****** silly_ptr = &&&&&&a; do you only have one pointer and one int?
 
hi all!
guess, how long will execute the following program:

http://ideone.com/VYuKR
 
@thecoshman afaik you can't take the adress of a temporary like &a so that wouldn't compile
@user1131997 0.01s, can't you read?
 
@KillianDS it's still running
printf() each of combo after each swap in random generating arrays, where there may be 100k values
will take a lot of time
array could be 100k capicity
and priting each swap in algo, will give you very long-runtime
 
thank you for sharing that incredible insight with us
 
@thecoshman you can't do that :)
 
11:07 AM
@KillianDS with pleasure
 
but if you do int**** silly = nullptr; int***** very_silly = &silly, then you only have two pointers, not 5
 
@jalf the joke is from family of "If I shall install Win 7 64bit twice, shall I get Win14 128 bit" :) no?
 
11:26 AM
@jalf unless you #define int sometype and sometype overloads operator&(), which would of course be even more silly.
 
@daknok_t #defines aren't allowed to redefine language keywords. :)
That's UB
 
Still UB.
 
UB? I thought it was against the rules.
 
@Caffeine what?
 
11:34 AM
@Pubby You can have UB while compiling a program. Which does fall under 'against the rules'.
 
Rules are there to break them, and nobody is going to stop me! :D
 
@LucDanton Yeah, but I thought that code should be rejected. The fact that it compiles simply being an extension. Dunno though.
 
@Pubby Tbh I couldn't find the reference to #defineing keywords last time I tried. So I don't know if a diagnostic is required. If it isn't, then producing a program without saying anything is one possible, correct instance of UB.
 
'correct instance of UB'? Yuk.
 
11:39 AM
I think we are talking about programs that are not wellformed as they say. The result of compiling it is undefined. And the result of running is likewise undefined, if you can even run it
 
@LucDanton oh, I might be wrong then. Pretty sure I found it before though. But I don't have a copy of the standard at hand right now
 
@LucDanton I have read it too. No required diagnostic
 
@jalf I've read it mentioned a lot, but didn't think of looking for it myself until a few days ago. I suppose it's in one of those parts of the Standard I'm not overly familiar with.
 
Among other instances:
> § 17.6.2.1 - 7 Identifiers that are keywords or operators in C++ shall not be defined as macros in C++ standard library headers
 
hmmm, but that's just in std lib headers... I wonder if it's legal in user code then
 
11:42 AM
> 17.6.4.3.1 Macro names [macro.names] 2 A translation unit shall not #define or #undef names lexically identical to keywords, to the identifiers listed in Table 3, or to the attribute-tokens described in 7.6.
@jalf You impatient lot :) Go find it yourself?
 
I find it interesting that [[foo::double]] int f(); is legal.
[[Attributes]] unkeywordise keywords.
 
Ok I admit I cannot find it a.t.m. in relation to user code. And my kids deserve attention. Wanted to go visit a local music/ballet school this afternoon, so I'll be afk
 
@sehe That is in relation to user code.
§17.6.4 is "Constraints on programs".
 
@RMartinhoFernandes n3337 says: 17.6 Library-wide requirements [requirements]
 
Missed one level.
Ooops.
 
11:47 AM
Thx that helped. 17.6.4 indeed
@jalf: so 17.6.4.3.1 ad 2 (and surrounding) is what you wanted
Shame it wasn't 17.6.5.4.3.2 ad 1
 
Your 'n' key seems broken.
I emailed a guy handing out minecraft for free and asked him to take down the site. He challenged me to quake 3. THIS IS HAPPENING!
 
Doing more timing of my expressions vs Boost.Phoenix today. Timing one expression with one (function) application yields 2s vs 6s. But if I add more instantiations (i.e. the expression takes three parameters, so I mix ints with longs`), with 7 applications I'm already at 6s vs 6s.
Very explicit results but I still don't know where to start to improve my stuff :(
 
@RMartinhoFernandes nope. See etymology 3: en.wiktionary.org/wiki/ad#Etymology_3
 
I don't care about etymology. Take this: translate.google.com/#tl|en|pikachu
 
@RMartinhoFernandes I like how the alts are Ben, Pikachu, Superman and Batman
 
11:53 AM
@RMartinhoFernandes I wonder how much he is willing to put on his Q3 'skills'
 
 
@sehe ah, there we go. Yeah, I thought I'd seen it
 
@josefx - this shows a problem in the C++ standard - there's no way to raise smart pointers to powers. We must immediately demand an extension to support e.g. (pow (std::shared_ptr, -0.3))<T> x; for -0.3 levels of indirection. — Steve314 12 hours ago
Challenge accepted!
 
@LucDanton I like this commit message: Sheer genius
 
It was!
 
12:02 PM
(Except I'm not doing floats)
 
@RMartinhoFernandes @Mysticial How on the face of this (or, for that matter, any) Earth did that question get so many upvotes...
3 hours ago, by sehe
@Mysticial Nope. I'm not into fashion. If people didn't care about popularity, SO would have far less problems with keeping quality at the core - and reduce meta police cramp
@Mysticial and the same thing applied to
3 hours ago, by Mysticial
plus points if you can make them all "goes to" operators.
 
@thecoshman Doesn't need to put much: twitter.com/#!/notch/status/190045868928409600
Arrghh, using ideone is no fun now.
I need my traits.
Gotta go. Bye.
 
> As a foundation upon which other TMP-heavy libraries will be built, Proto itself should be as lightweight as possible. That is achieved by prefering preprocessor metaprogramming to template metaprogramming.
 
does any one know of a web based regex checker that check against multi-line stuff?
 
Guess I won't spend time tuning my stuff and will just switch to a future Boost.Proto that is C++11-enabled then.
 
12:21 PM
@thecoshman regexpal.com First hit on google and seems to support multi-line
 
saw that one, I cant seem to work it out though. will stick to it though
 
I love linker errors.
 
oooh, you need to turn on the use of ^ and $ and not wrap the regex in //
 
hey robot
is my bitbucket repository still open to the public to clone?
 
link
 
12:31 PM
never mind
realized I'm not logged in so if I can clone it, anyone can :P
 
1:09 PM
...silence
 
Oh wait, my stuff takes longer to compile than Phoenix when turning on optimisations.
 
1:38 PM
Hi all.
I am getting back into C++, does anyone know how to set eclipse so it builds my project before it runs?
 
@Neal Is eclipse managing the build? It should do that automatically
 
@Collin It doesnt seem to be. Right now I just keep running make in terminal, which I would rather not do...
 
I don't really remember how to set it up.. how was the project created?
 
For some reason it only runs make when I change settings in the Project Properties.
@Collin File > New Project. Then I chose the source dir
 
does the build button work?
 
1:43 PM
@Collin I see no such thing
 
I haven't used eclipse in a long time, but I seem to remember a little hammer or something for building
 
Y TEH ECLIPSE HAZ NO BUILD BUTTON?
 
use MSVS
 
Meh Eclipse…
 
Hmmm idk... Also I am using Qt, which I can't seem to set up correctly for eclipse
 
Ell
1:47 PM
arghhh why do hardly any languages have typedefs :O
 
@Abyx ?
On Linux?
 
@Ell because they don't need them?
 
Ell
@daknokt c++ doesnt need typedefs (I don't think?) but they are still useful :o
 
@Neal use Windows, what's problem
 
@Ell good luck with implementing type traits without typedefs.
 
1:49 PM
@Abyx This needs to be developed for Linux.
 
In C++ they are extremely useful because you have templates.
Other languages don't have templates, so typedefs aren't worth their complexity.
 
Ell
yeah but for example in c# I have Dictionary<KeyValuePair<Color, Point>, TileColour> and its annoying
 
@daknok_t what's complex about a type alias?
 
Ell
they still have generics which often mean bit lists of typed
C doesn't have tempaltes but it still has typedef
 
it's really only a #define with benefits.
 
1:50 PM
I even use typedef for function pointers and membter function pointers too
 
am I stupid or is there something wrong with this statement: char* extension = ".txt"; ??
besides the fact it's char*, but this is C
 
Ell
I don't think there is anything wrong with that?
 
It's correct. Maybe there's a #define extension somewhere?
 
@TonyTheLion did you got compiler error or something?
 
@Neal Doesn't QT have it's own IDE just for building QT things?
 
1:54 PM
It needs be const in C++ I think
 
Ell
yess thats it
 
@TonyTheLion should be fine in C...
 
@TonyTheLion const char*
 
11
Q: String literals in C

missingfaktorA quick question... What is the type of string literal in C ? Is it char * or const char * or const char * const ?

 
but it's C... so const is stupid anyways.
 
1:55 PM
And not required in this case.
 
@Collin I am not rly a fan of it
 
cpx
or const char* as long as its not char *const
 
yeah, well, C is stupid... again.
 
cpx
Oh I still remember C++ after 3 months of not paying attention to it
 
Ell
I have no idea how to use C
 
1:58 PM
@TonyTheLion Is there an error or something?
 
Ell
if someone asked me to write a programme I would be clueless :L
 
@Ell write a hello world program in C.
 
does strlen include the null termination char?
 
@TonyTheLion no
 
@Collin just a null pointer
 
Ell
2:01 PM
@daknokt
int main(char* argv, char** arvgs) {
println("Hello world");
}
or something :L
 
@TonyTheLion No
 
@Ell printf instead of println, and the arguments to main aren't required.
And it's incorrect C99 and C11.
But in previous versions it's fine.
 
concatenating strings in C is SOOOOOOOOOOOOO painful
meh
 
@TonyTheLion hahahah It's not that bad...
 
<insert anything here> strings in C is SOOOOOOOOOOOOO painful
 
Ell
2:03 PM
@daknokt I wasn't that far off then :L
 
char* newBuff = malloc(strlen(string1) + strlen(string2) + 1);
if(newBuff) {
    sprintf(newBuff, "%s%s", string1, string2);
}
 
Check for malloc returning NULL.
 
if(newBuff)?
 
Whoops xD
Sorry.
 
:-D
Go C go
 
2:06 PM
Exceptions ftw.
 
why not strcat ?
 
@Abyx probably a bit faster than sprintf, but I always forget it exists
Really I tend to forget everything in string.h exists
 
@daknok_t Why is that? The naming and types of main's params?
 
Ell
what does sprintf do?
 
@Ell printf to a char* instead of stdout
But you have to allocate memory for it and all
 
2:09 PM
@rubenvb printf had no prototype/declaration/signature/whatever. He forgot to #include <stdio.h>. In C99 and C11 it's not allowed to call functions without a signature.
 
Ell
@rubenvb oh kk
 
fuck everything about strings in C
I HATE THEM
 
Ell
:L not as bad as no strings at all
 
@TonyTheLion Use struct string {char* data; size_t len;} and write functions to manipulate them?
 
@TonyTheLion and they hate you too
 
2:15 PM
meh
it's just annoying you have to keep thinking about null terminating chars
and all that shit
 
Ell
should I give a function its technical name (sort of breaking abstractness, "CalculateColourPoints") or a generic name? "Prepare" or something?
 
@daknok_t oh wow, missed that completely :P. Is it allowed in C++?
 
@Ell CalculateColorPoints
 
Ell
kk :)
 
@rubenvb nein, it's not allowed in C++. Imagine how much it would suck in C++ due to function overloading. void foo(double a); then call foo(3.14f); and you'll get a linker error.
 
2:18 PM
always use descriptive function names. Only abbreviate if it's very clear what the abbreviation stands for
@daknok_t OK, but I'm guessing it is allowed in C89 then, otherwise your statement would make no sense.
 
Ell
@daknokt this is why I want typedefs :L
`Templates = new Dictionary<Bitmap, List<Dictionary<String, Tuple<Point, Color>>>>();`
 
It was allowed in C89, yes.
IIRC.
@Ell Is that C#?
 
Ell
@daknokt yeah :P I'm a noob though so :L
 
using EpicDictionary = Dictionary<Bitmap, List<Dictionary<String, Tuple<Point, Color>>>>; :)
Note that it's file scope at most.
56
A: Equivalent of typedef in C#

Jon SkeetNo, there's no equivalent of typedef. You can use using directives within one file, e.g. using CustomerList = System.Collections.Generic.List<Customer>; but that will only impact that source file. Fortunately, the example you give does have a fix - implicit method group conversion. You ...

 
Ell
Oh awesome! I actually read that answer but forgot like a second later xD
 
Ell
2:33 PM
I have added ColourPoint now instead of Tuple<Point, Color>
it just seems to clarify it really
 
Fuck you, QThread
2
 
Ell
:L
 
@Ell if you want to be more consistent, make it ColorPoint (American spelling).
 
@daknok_t that would be wrong if Point can be n-dimensional :)
 
@jalf why do you actually have to use it?
 
2:43 PM
because qt is our "preferred" third-party lib at work
as in, when we need something that isn't in the standard lib, we use qt if it does what we need
otherwise, boost, and otherwise whatever else we can find
And unfortunately Qt has a thread class
 
@jalf no C++11?
 
nope
well, we'll probably be able to use some bits and pieces of it soon
but since this particular project has to run on XP, it won't ever be able to build with VC11, which means it won't ever get access to the std lib threading
 
EDIT: dumb question as you can't answer it honestly now anyways
 
@jalf MinGW-w64 is not an option?
 
nope
well, theoretically we could switch to that, but I don't think we really want to have to deal with yet another compiler
 
2:51 PM
@jalf: Isn't XP support going to end any time soon ?
 
XP will live for 2-3 years, or even more.
In beginning of 2010 I had to support Win2k for certain application, fortunately there is a workaround for VC++10, which adds Win2k support.
If you have thousands of users, running different OS, there will be some users running old OS, and such users will disturb other users by writing posts like "hey, that program is a crap, it even doesn't run"
 
@jalf I can't wait until we get rid of the last XP machine at work
 
You can build XP apps with the WDK compiler, and use code.google.com/p/ontl as a C++11 lib.
it seems like it's awesome, but I don't know if it's really worth anything.
 
What's the problem with VC11 and XP ?
Can't we install the C++ runtime for VC11 on XP ?
 
3:06 PM
@ereOn VC11 uses CRT which doesn't support XP
that CRT uses new Win API functions
 
@Abyx: Ok... that's unfortunate indeed.
 
but maybe there is a chance to emulate that API, like EncodePointer used by VC10 CRT
 
> Research suggests that 24 per cent of people identify themselves as chronic procrastinators. Presumably this figure underestimates the scale of the problem, given that it can only be based on people who completed the questionnaires on time.
2
love it
 
Hey guys
@DeadMG hahaha
 
3:34 PM
This shit is retarded. I turn off all lighting, everything's dark. Then, I turn on a single point light at position (0, 0, 0), and suddenly the whole scene turns bright as if I cranked global ambient lighting up to eleven.
 
You guys are logical people right?
How did you revise when you were in school?
 
@KianMayne Not if we can help it.
 
Haha
 
@JerryCoffin Zing!
@KianMayne Revise what?
 
@sehe You know all the stuff for exams
 
3:40 PM
@KianMayne When I was in school? "Revise" meant finding a different cave wall to paint on.
 
Oh, you mean the ancient art of trying to compensate for the fact that you didn't listen at all in class?
 
hahah
@EtiennedeMartel No I listen, just there's like 3 A4 books worth of material and I don't know if I remember it all
I probably remember most
 
What's the subject?
Farts in ancient babylonia?
 
:L Biology
 
@KianMayne Concentrate on the ideas and understanding rather than memorizing specific facts. If you understand the basics, you can usually derive enough on the spot to complete most exams. That, of course, assumes you're dealing with something like science, not something like many history exams, which are mostly just trivia games in disguise.
 
3:44 PM
And when stuck, improvise.
 
Yeah, that's what I do normally
@JerryCoffin Luckily the only real humanity subjects I'm taking are philosophy & ethics and you can basically talk about anything a bit related to the question, and the hardest parts of those exams are time management and "engaging with the final question to get all the marks"
 
4:02 PM
@JerryCoffin Or my university's examinations
 
@DeadMG Ewww... sorry 'bout that.
@EtiennedeMartel That can help too. In a lot of cases, you can also glean answers to some questions from the other questions. Just for fun I've taken a few of the "can you pass this test" kinds of things online, and was able to figure out enough from the questions to pass the test despite total ignorance of the subject matter.
 
I find that looking at actual exam papers or doing a bunch load of exams helps me both pick out my weaknesses in the subject and practise the timing
I also have a problem with my IT (not comp-sci)
 
4:17 PM
One of them was a nursing test. Question N was "which treatment (A, B, C, or D) is suitable for disease X. Question N+1 was something like "what are the common side effects when treating disease X with C".
 
Because I tried to apply computing and boom 0 marks on that question
Hahaha they're hard to find in my tests these days :(
 
@KianMayne Yes -- it's amazing how many people think those are essentially the same, when in reality they're almost exact opposites...
 
Yeah one is like ok this is how you use a system and the advantages and disadvantages
then the other is like
LOOK AT ALL THIS COOL STUFF with actual mathematical basis and logical foundation
and now LETS BUILD COOL STUFF
Much more interesting that "Discuss the different methods of registration that are used in schools, lookin at both the benefits and drawbacks that they bring to schools" o.O
It exams now, you have about 2 questions per paper (in basically all subjects) that assess 'quality of written communication'
Which I tend to do badly (5/10 marks D:)
 
I think of them a bit differently than that. Most of IT is about maintenance -- doing the same basic things, over and over and over (e.g., there's no significant difference between the backup you run tonight and the one you ran last week, last month, or last year). Comp-Sci is about doing something once, and never doing it again until something changes significantly enough to require a different solution.
 
That's a good point
When I was in primary school I was taught how to fix hardware issues by the network lady while I learnt QBASIC
But I always found programming more interesting, and repair was more a necessity
 
4:27 PM
@KianMayne Wow, what a concept. When I was in primary school, GWBASIC (the predecessor of QBASIC) hadn't been invented yet. "Network" meant ABC, CBS or NBC.
Computers were still in the "there might be a market for as many as 5000 worldwide" stage...
 
Haha seems so foreign - my earliest memory was probably moving coloured blocks to make stairs on a computer
QBASIC was pretty old by the time I got there
 
Hi Fred, how are you today?
 
Hey guys, anyone got a suggestion for a low-overhead CMS to run a coding blog-type-thing that makes syntax highlighting easy? Don't say Drupal or I will meta-meta-program you to death.
 
you're asking about a CMS in the C++ room???
are you srs?
 
Well, I figured C++ coders would have better experience with C++ blogs than say, PHP coders
 
4:42 PM
oh, but aren't CMS's written in ASP.NET or PHP or something like this?
 
I'm not looking to write one, but use one. for a C++ blog.
 
I need to run another *.exe from a c++ program. I have researched and found that fork followed by exec would be the best way (Instead of my earlier plan of using system). Now,... is there a way to capture that fork's std output?
 
@OrgnlDave just pick any, which has Syntax highlighting
 
how do I initialize a twodimensional array to all zeroes
 
@nulltorpedo what kind of program are you forking?
 
4:45 PM
vector< vector<int> > vec(a, vector<int>(b));
 
@JohnSmith are we talking std::array, malloc'd array, what?
 
user1182183
Anyone familiar with boost::graph's ? :P
 
@OrgnlDave Not a standard program. Another c++ program that accesses a database and outputs a file. I need to check the stdout of that program to see if it successfully did that
 
@nulltorpedo no I mean what is your program that you are fork()ing. fork() is an extremely intensive process that involves duplicating EVERYTHING in your running process, all its memory, internal states, threads, etc.
@JohnSmith I can only think of std::fill() which will only work with one vector at a time
 
@JohnSmith that should work fine, yes
 
4:51 PM
@OrgnlDave see this thread: cplusplus.com/forum/lounge/17684
 
@JohnSmith or possible std::vector<std::array<int, 10>> vec(a), if you know the rowsize at compile time.
 
user1182183
Seems boost graphs and dijkstra stuff works weird, I have visualized a map of nodes in a separate program and did a small calculation in the boost graph program and it seems the calculated route is not the same size, the output of the boost program is 4 in lenght and the stuff I see in my other program is that the route is 10 in lenght. So can somebody explain, in a way a newbie understands, how the boost dijkstra stuff works? :P
 
@OrgnlDave The description I provided earlier (access database) is the program that will be forked
 
it will default to all 0's?
 
user1182183
if you have a vector you'd better be off looping it, or not?
 
4:54 PM
@JohnSmith you can have the Vector default-initialize. let me cook for a second
 
@JohnSmith yes
 

« first day (543 days earlier)      last day (4387 days later) »