« first day (527 days earlier)      last day (4424 days later) » 

7:00 PM
Gentoo wastes so many cycles compiling.
 
can array's store strings ?
 
@JohannesSchaublitb Thanks anyway.
 
why do you say "anyway"
 
@Beginnernato what kind of strings? and yes
 
@MooingDuck like names of people for examples
 
7:00 PM
@JohannesSchaublitb Because it wasn't your fault that I wasn't notified.
 
that sounds like I did something bad but since I did also do something good you needed to still say "thanks"
ohh i see now
lol
 
Cycles are never "wasted".
 
@Beginnernato what kind of string? char*? CString? std::string? what kind of array? char* [30]? std::array? std::vector?
 
Global singleton array of void* pointers.
 
@MooingDuck char*
 
7:01 PM
Ew.
 
@Beginnernato char* array_of_strings[50];
 
That's array of pointers, not strings.
 
@Beginnernato if you're learning C++, you'll want to use std::vector<std::string> array_of_strings; instead
 
char* i_am_a_lying_bastard_array_of_strings[30]
 
And if you're not learning C++, you'll want to use std::vector<std::string> instead, too.
 
7:03 PM
@MooingDuck im in C ... i think i should be using the vector one
 
Hmm Lying Bastard was the name of the ship used in Ringworld.
 
im trying to write a program where i store names and intergers from input, that's why i was wondering
 
@Beginnernato if you're in C, then yeah. char* static_array[40]; if you can, char** dynamic_array; if you have to.
 
Ew, C.
 
7:04 PM
hmm, I have a query on Data.StackExchange.com that runs in 64ms when sorted by DESC, but times out for sorting by ASC
oh, it stopped timing out. I guess I brought the posts into the cache? data.stackexchange.com/stackoverflow/query/65096/…
 
ARGH
 
You suck at SQL.
 
I hate you and your pathetic error messages, Visual Studio
 
@RMartinhoFernandes me? yes. That's my first query ever in 3 years, and the first ever where I wasn't walked through by a teacher
I've never particularly liked SQL
 
Nobody does.
That's a little secret in the industry.
 
7:11 PM
WTF.
-11
A: How do you select a particular option in a SELECT element in jQuery?

MikeWe need to be notified in some way if an answer was causing a problem so that we can fix it. Four years later is too late. The question is open to interpretation, as Aaron notes. But if the answer is confusing people, suddenly, four years later, then let's just delete it. jQuery is extremely...

BTw, your query is producing wrong results somehow.
 
@RMartinhoFernandes that's not particularly surprising, it took me half an hour to craft it :/
or an hour and 15 minutes. That's almost half an hour
@RMartinhoFernandes why do you say it's the wrong results?
 
right
now only three files giving compiler errors
what could le possibly go wrong
 
GHC FINISHED BUILDING.
 
The compiler could explode in a fiery explosion of fire.
 
7:18 PM
@CatPlusPlus JOY IN CAPS.
 
lol
 
BUILT ALL THE CODE!!!
 
build your mother
 
Hey guys
 
Hi @shookees
 
7:19 PM
Oh, hey, it's another cat.
 
I'm building an army.
 
Of cats.
 
the best material for an army, you know
 
> James Gosling wanted Java to be C++ without the mistakes.
 
TAKEOVER.
 
7:20 PM
18
Q: Is there a way to simulate the C++ 'friend' concept in Java?

Matthew MurdochI would like to be able to write a Java class in one package which can access non-public methods of a class in another package without having to make it a subclass of the other class. Is this possible?

 
Gah. Even moving Boost on the same filesystem takes forever.
So many little files.
 
It seems like everyone's and their mother's programming language wanted their "language <x> to be C++ without the mistakes"
 
@Insilico That's because C++ has great potential.
 
Unfortunately has it has C's syntax
 
the problem is that if you ask X people what C++'s mistakes were, you will get X very different answers.
 
7:21 PM
"he felt that friend was a mistake because it violates OOP principles. Packages provide a reasonable way to organize components without being too purist about OOP."
 
@Insilico Ironic.
 
Well, he replaced C++'s mistakes with his own.
 
So his original plan was for Java to be C++ without C?
He slipped somewhere.
 
@EtiennedeMartel: If he wanted Java to be C++ without C then he could've dispensed with the C syntax
It's a horrible syntax that people keep emulating for some reason
 
I find it superior to most other syntaxes I've seen
 
7:23 PM
class foo { int[] bar()[] { return null; } } // valid Java
 
Familiarity or something.
 
except the whole declarations thing, which sucks balls
 
> I believe he felt that friend was a mistake because it violates OOP principles.
 
Layout-based syntax is superior.
 
@DeadMG: I think that was my biggest pet peeve about C syntax
 
7:23 PM
Wait, isn't friend supposed to reinforce encapsulation?
 
@EtiennedeMartel Just like public methods do.
 
@CatPlusPlus What's that?
 
@EtiennedeMartel Indeed it does.
 
what's the term for an object containing itself? For example:
struct test { int value; test *next; }?
 
Composition, I think.
 
7:23 PM
@Insilico But practically nobody who kept C syntax kept that.
 
@Pubby Python- or Haskell-style
 
@shookees recursion? nesting?
 
@EtiennedeMartel You're talking about language where you have getX and setX for every field in every class.
Damn fast moving text.
 
@shookees I'm not sure there's a word for it
 
But you're not containing another instance of test.
 
7:24 PM
Well recursion's a bit too general, probably nesting?
 
@RMartinhoFernandes With whitespace?
 
@CatPlusPlus Sometimes I wish C++ had properties like C# does.
 
oh
 
In computer programming languages, a recursive data type (also known as a recursively-defined, inductively-defined or inductive data type) is a data type for values that may contain other values of the same type. Data of recursive types are usually viewed as directed graphs. An important application of recursion in computer science is in defining dynamic data structures such as Lists and Trees. Recursive data structures can dynamically grow to a theoretically infinite size in response to runtime requirements; in contrast, a static array's size requirements must be set at compile time. So...
 
@RMartinhoFernandes Not really a fan of Haskell-style syntax
 
7:24 PM
I don't really miss properties.
 
@Pubby Yes. The layout of the code determines the blocks and such, instead of delimiters.
 
@EtiennedeMartel: I saw an open-std.org paper about it
 
@DeadMG Haskell has semicolons and braces too
 
Let me see if I can find it
 
Semicolons and braces is kernel syntax, nobody uses that.
 
@Pubby I only realized you can use braces and semicolons on lets yesterday.
 
That paper was rejected.
 
Right but at least it was considered
 
But still, when was the last time you needed a property?
 
It seems like everything in that paper could be implemented as a library-only solution.
 
7:26 PM
"bound pointers" == std::function?
 
I never know how to format Haskell code. Any guides?
 
Which is what Bjarne prefers when it comes to language features
 
Less general than std::function.
Member function pointers that carry this along.
AFAIR.
 
Oh, like .NET delegates.
 
@DeadMG: Actually it's more like my answer to this question
58
A: 5 years later, is there something better than the "Fastest Possible C++ Delegates"?

In silicoUpdate: An article with the complete source code and a more detailed discussion has been posted on The Code Project. Well, the problem with pointers to methods is that they're not all the same size. So instead of storing pointers to methods directly, we need to "standardize" them so that they ar...

 
7:27 PM
eh
I really don't care about that
 
Mine is just a stupid thing that carries a this pointer along with the member function pointer
 
who would want something that can only be a member function?
 
Java programmers.
 
@DeadMG: My answer is actually a bit more general than that. :-)
 
no lambda, no bind == big, big problemo
@CatPlusPlus Nobody cares about them :P
 
7:29 PM
@CatPlusPlus Reminds me of that "Aliens" meme.
 
What meme?
 
@DeadMG Java only has member functions. So, no loss there.
 
That guy from "aliens built pyramids" theory.
 
Java doesn't have member functions, it has methods.
 
Same thing, different nomenclature.
 
7:30 PM
@EtiennedeMartel Yeah, but nobody cares about Java programmers :P
 
@EtiennedeMartel Static methods don't carry this.
@CatPlusPlus Stargate much?
 
@RMartinhoFernandes Yeah, but you could patch it by making this null in static methods.
 
@RMartinhoFernandes Stargate was based on his ideas, AFAIR.
 
@EtiennedeMartel And that's why you end up with these kinds of questions
26
Q: How do I explain a "Hello World" program for beginners?

NaifI am going to give some beginners a presentation about writing first program in Java. This program will be about printing "hello world". I'm not sure how can I explain the concepts such as main method (and public and static keywords and the args argument) and class definition. Any ideas how can I...

 
7:31 PM
Damn.
 
@EtiennedeMartel I was just thinking that myself
 
You know, it's one thing I hate about C-like languages: the ridiculous amount of boilerplate you have to handwave away when you teach to beginners.
 
@EtiennedeMartel I always thought the History channel was about... you know, history.
 
Or maybe I misremembered.
 
Yeah, right.
 
7:33 PM
!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:
Yay Hackage.
 
damn
ok
changing the root bone thing was a DUMB idea
dumbo mc dumbpants
 
#if !defined( CPP_DECLARE_UNUSED )
#   define CPP_DECLARE_UNUSED( argName )    \
        ((void)(true? 0 : ((argName), void(), 0))); struct argName
#endif
// For the extreme-hacks in the first expression, see discussion at
// stackoverflow.com/questions/4030959/…
^ Evolution at work again
 
What extreme hacks?
 
Do you really need the #if?
 
CPP complains when you redefine macros.
 
7:37 PM
@CatPlusPlus: If you have two or more definitions of CPP_DECLARE_UNUSED, I would like to know about it.
 
It also allows a compiler-specific definition to be supplied.
 
Well, I don't. CPP warnings are annoying and rarely useful.
 
@RMartinhoFernandes One is Johannes' trick to avoid invoking a user-defined comma operator.
 
Oh great, hg convert is bugged in 2.1.1.
 
But I think further evolution could simplify this thing again, because a bit was introduced to support sizeof operator application, which then turned out to Not Work as warning-suppressor with Visual C++...
 
7:40 PM
@CheersandhthAlf Oh, when I read "extreme hack" my brain immediately looks for stuff that looks really hacky.
 
67
Q: Weird "[]" after Java method signature

Johannes Schaub - litbI looked at some Java code today, and I found some weird syntax: public class Sample { public int get()[] { return new int[]{1, 2, 3}; } } I thought that can't compile and wanted to fix what I thought was a typo, but then I remembered the Java compiler did actually accept it! Can some...

 
Like reinterpret_casts and shit.
 
@RMartinhoFernandes Like all of template metaprogramming
 
Tip: if you get 'abort: invalid mode ('r') or filename', create empty splice map.
 
7:41 PM
@Moshe: Should've also gave them these notes.
 
argh!
const y u even exist
 
Meh, all those low-level pointer details and no mention about alignment.
 
@Insilico It's a uni class.
 
@Moshe: So? :-P
 
@CheersandhthAlf In fact I'll sit right down and simplify it (that's what's hard work, simplifying)
 
7:42 PM
> Nowadays, our computers have two kinds of data. Programs themselves, and other data.
Isn't that Harvard arch and not Von Neuman?
 
int main(){
    const int CAPACITY = 100;
    int arr[CAPACITY];
 
That's also not true.
 
warning: MAGIC_BUFFER_SIZE code detected!
 
@Insilico We're not learning it for any good reason, don't judge the content.
 
@DeadMG Yes, that's one of the point of the lecture. Read on.
 
7:43 PM
@Moshe: I didn't say "your notes and everything in it are crap"
 
In college, never question the motive of a lecture, there never is one.
@Insilico Oh, I know. :-)
 
I'm just sick and tired of some uni students graduating and not knowing jack shit :-)
 
@LucDanton I did read the whole thing. No mention of MAGIC_BUFFER_SIZE being idiotic.
 
> This pointer is nothing more than an integer.
:(
 
@Pubby ? There could be typos there. What should that say?
 
7:45 PM
Hee, I've downsized GC repo from 200MB to 10MB.
@Moshe Pointers are not integers.
 
@Moshe A pointer is nothing more than a pointer!
 
Pointers are not numbers at all.
 
I guess you could say addresses are integers, dunno if that's correct though.
 
@DeadMG Those are notes, not the whole lecture.
 
array's doesnt use heap storage right ?
 
7:46 PM
@Pubby I think that's the point. I could be wrong.
You guys can leave comments on my blog.
 
It's largely irrelevant point.
 
@Beginnernato: In the code above, yes. arr does not use the free store.
 
About pointers.
Also, from 2055 changesets only 1964 survived.
Getting rid of the old crap is nice thing.
 
Yeah, that.
 
7:48 PM
Haha, thanks folks.
Always a pleasure.
 
@Moshe Dereferencing is getting the value to what the pointer is pointing at. Think *
 
It's getting a reference to that thing, not the value.
 
?
So that's using &x
 
@Moshe You should know that that history lesson is Untrue. The first one to build a general programmable electronic computer was (the Swizz?) Konrad Zuse, in Germany, I think 1938 or something. Then in England, during WWII there was the Colossus etc. Von Neumann met Alan Turing at the end of the war, and presumably got some ideas; he also got ideas from the computer design seminars he was attending. What he did was to write up his lecture notes & ideas, and neglect to credit anyone else.
 
*x = 42;
Well, lvalue at least. Dunno about further technicalities.
 
7:50 PM
Yeah, I would't call that a reference.
 
It's a reference.
Why do you think you can take its address back?
&*x
 
No, it's an lvalue
 
no, it's an lvalue
 
I think
 
Not to belittle von Neumann's general genius. Like, he worked on the Manhattan project, creating the first atomic bomb. He published his electronic computing memorandum right after calculating the optimum detonation height for the Hiroshima bomb.
 
7:50 PM
it should be a reference, but it isn't
 
It's an object!
I object!
2
 
decltype(*ptr) == T
 
@DeadMG No, that's T&, due to how decltype is specified.
 
@StackedCrooked Isn't IObject an interface in C#?
 
wow, really? I always thought that had to be decltype((*ptr))
 
7:51 PM
@StackedCrooked References are not objects.
 
Time to be pedantic and look at the C++ standard!
(at least the draft of it)
 
@DeadMG Yeah, it's a bit weird like that but in the end it works. At least I haven't noticed any pain point.
 
Or do something fun instead.
 
is there built-in boolean that will check if an input is a string or a number ?
 
decltype pisses me off
 
7:53 PM
Lol.
 
Hmm, type to rebuild my draft.
 
@LucDanton Personally, in Wide, I dropped that whole thing and simply made ALL THE THINGS a reference
 
Someone fixed the typeface somewhere.
 
@Beginnernato: How are you getting the input?
via std::cin?
 
I can't live with a wrong typeface somewhere in my standard draft.
 
7:53 PM
@DeadMG What are they referencing then? More references?
 
@Insilico through the interaction window ? O_O
 
OCD much.
 
@Beginnernato built-in booleans are true and false.
 
@Pubby Not my problem :P
 
7:54 PM
Not built-in boolean is file_not_found.
enum real_bool : bool { true, false, file_not_found };
I know it doesn't compile, shut up.
 
@DeadMG It's true that references and reference types are 'bolted on' on top of the preexisting C (i.e. the [g]lvalue/rvalue dichotomy), so I wouldn't be surprised there'd be better systems when starting from scratch.
 
@Beginnernato: I'm not aware of a standard function that can tell you "this is a string of characters" and "this is a number" given a string.
 
ctype.
 
@LucDanton The existing lvalue and rvalue reference system works fine, IMO.
 
C character classification is an operation provided by a group of functions in the ANSI C Standard Library for the C programming language. These functions are used to test characters for membership in a particular class of characters, such as alphabetic characters, control characters, etc. Both single-byte, and wide characters are supported. History Early writing in C under Unix began developing idioms at a rapid rate to classify characters into different types. For example, in the ASCII character set, the following test identifies a letter: if ('A' However, this idiom does not ...
 
7:56 PM
it just needs to be back-dated
 
What does "back-dated" mean?
 
Killed with an ax and resurrected.
 
@DeadMG Absolutely, but that makes reference types sort of second-class. They only exist to annotate declarations. Not that's inherently wrong of course.
 
it means "The old C system cut out entirely"
 
Declarations are inherently wrong.
 
7:58 PM
Oh.
 
@LucDanton I don't see how. They'd be used more than currently, not less.
 
this shakes fist
 
oh yeah, and that
although what I really don't get is
why are there several types of rvalue and lvalue?
I mean, I know that there are, but I never asked why
 

« first day (527 days earlier)      last day (4424 days later) »