« first day (478 days earlier)      last day (4482 days later) » 

8:00 PM
@DeadMG bash. Wait, it was invented 2011? We have a new sort!
 
eh, I wouldn't really call it that
it's not exactly the most practical sort ever
 
Xeo
But it's awesome!
 
@DeadMG I just mean, anytime I find a cool algorithm, it was invented 60+ years ago :/
 
8:03 PM
well, not sleepsort
 
@Xeo i don't think 42 will work for all the inputs lol
 
Xeo
@MooingDuck The & says that the function is detached from the parent (new process), and the shift just shifts the arguments (to the left, IIRC)
 
@renatofernandes sure it does. It just doesn't give the intended result
@Xeo amazing
 
@MooingDuck aha i guess 42 does solve most things thou
 
@DeadMG oh, I do that in my sleep
 
8:06 PM
what, sort?
 
@renatofernandes wait, I misread something
 
yea
:P
meh LR parsers
 
sbi
That's one ugly monkey.
 
so production rules are the rules defining what things can be replaced by something else? Like what nonterminals can be replaced by some other string?
@sbi ugh, looks like a big cock on it's nose
 
usually a combination of terminals and other non-terminals
 
8:09 PM
ah I see
 
sbi
@TonyTheLion Of course you would see a phallus in this.
3
 
but what kind of thing (in C++ for example) would be replaceble by a parser?
not the keywords?
 
the whole shebang
 
like int ?
 
the entire source input must be parsed
 
8:10 PM
yes
but some of the symbols are terminals (not able to broken down into smaller units), I guess like int keyword, and others are nonterminals, which can be replaced, but by what?
 
@MooingDuck so what should i do with this new field?
 
they are replaced by their contents
 
or more accurately
they replace their contents
 
@MooingDuck should i edit icons to malloc memory to like a counter or something?
 
8:12 PM
like int x = 5; would be replaced just by 5?
 
no, it would be replaced by the non-terminal variable_declaration or smth
 
oh right, because the parser only verifies that the code is syntactically correct
 
yep
 
it doesn't care about semantics
 
Hey guys
 
8:14 PM
hey
 
I haven't been here in a while
 
@renatofernandes what? no. icons should simply assign the new field a value. Don't get allocator happy :D
 
But I fixed my computer so I'm back :D
 
@MooingDuck shouldn'y my main ilength function just return something like "return il->length;"
 
@renatofernandes something like that yes
 
8:20 PM
@MooingDuck iunno where icons come's in all of this?
 
@renatofernandes when you use icons to allocate a new ilist_node, what is that nodes length member set to?
 
@MooingDuck its set to a counter to keep track of the nodes?
 
@renatofernandes what is the value of that counter at construction?
 
@MooingDuck 0 ...
@MooingDuck or is it 1 ?
 
@renatofernandes it should hold the value 0. But which function gave it that value?
 
8:25 PM
@MooingDuck icons?
 
@renatofernandes right. That's where icons comes in all of this.
@renatofernandes my bad, icons should not initialize to 0. It should initialize to the number of elements in the newly created list. I misread the API
 
@MooingDuck ohh i see um now im confused when to increment the counter?
@MooingDuck yea i did that .. should i count increment in the ilength fuction?
 
@renatofernandes the length keeps track of the number of nodes it knows about. The length only changes when you add or remove to the middle or end of the list. Which functions do that?
 
sbi
Herb: expects full C++11 library implementation this year, full compiler support early 2013. #cpp #wg21
 
@MooingDuck doesnt icons do that too?
 
8:30 PM
@renatofernandes ilength should return the length member.
@renatofernandes add to the end of the list? no, icons only adds to the front!
 
@sbi is he serious? Since when did Microsoft start promising things that were more than 6 months into the future?
"early 2013" doesn't sound like them at all
 
sbi
@jalf I read this as speaking for the C++ community, not for his employer.
 
@jalf probably clang
 
ah hm
 
@MooingDuck iempty() ? ohh and should i se my counter to a global variable?
 
8:33 PM
well, the "full library implementation this year" sounds very much like what MS is promising with VC11
 
@renatofernandes what? Why would you have a global variable? You shouldn't have a global. The length member should be an int, not a pointer.
 
and then it'd be tempting to assume that the other half is talking about VC as well
 
@jalf don't all of them have basically complete library implementations?
 
0
Q: 16bit Real Mode C Compiler for Mac OS X

ExtremeCoderI am looking for a C compiler that runs on mac and it needs to compile to 8086 16 bit real mode machine code.

lol
 
@MooingDuck but MS has said that they'll achieve that milestone with VC11 (apart from the bits they can't implement because of missing features)
other compilers are the better part of a decade ahead, sure
 
8:35 PM
@MooingDuck but if i need to increment in other function shouldn't i use it globally then?
 
but as I'm reading it, he's paraphrasing Herb, who works on the MSVC team, and at least half of what he's saying is a very good fit to what MS has stated previously
 
@renatofernandes which function needs to increment it?
 
@MooingDuck irest?
 
Hm, interesting question -- are the argv[i] strings mutable?
 
@renatofernandes does irest change the number of elements in a list?
 
8:38 PM
@MooingDuck only icons does, but now im lost when you said at the end of the list
 
@KerrekSB I can't think of a reason they wouldn't be, other than possibly "spec says so"
 
sbi
@KerrekSB Syntactically they are (no const when C was invented), semantically I suppose you'll invoke UB if you modify them.
 
@renatofernandes The only functions that should change length are those that add nodes to the middle or end of a list.
@renatofernandes You do not have any functions that add nodes to the middle or end of a list
 
@sbi Yes, that is the question.
 
@MooingDuck i have to make them ? :(
 
sbi
8:40 PM
The guys that made this incredible video, have done it again: youtube.com/watch?v=MejbOFk7H6c
 
@renatofernandes Ergo, you do not have any functions that should change length, and only one (icons) that should assign it.
 
sbi
Boost folks appear not so happy with the suggestion of *another* staging area for library proposals. #cpp #wg21
(That refers to this earlier tweet.)
 
@DeadMG hmm, I put that on facebook, and now some of my friends are sending death-threats :D
 
lol
 
I hate my coworkers.  Here's some java code:
prompts = new PromptPlayable[new_prompts.size()];
prompts = ((PromptPlayable[]) new_prompts.toArray(new PromptPlayable[0]));
 
8:52 PM
What.
 
@MooingDuck so i have this
ilist icons(int in, ilist il) {
   int i = 0;
   ilist r = malloc(sizeof(struct ilist_node));
   r->first = in;
   r->rest = il;
   r->length = i;
   return r;

}
 
@EtiennedeMartel Basically, it (in every case) will allocate two PromptPlayable arrays that are never used.
@renatofernandes that's a start. (1) you don't need i at all. (2) what if il contains 2 ints already?
 
This is horrendous.
 
replaced with: prompts = ((PromptPlayable[]) new_prompts.toArray();
 
@sbi I noticed a glitch here too 1:35 quite disturbing even if you can really see what happens the first time round
 
8:57 PM
@sehe There's lots of instrument misses. What are you referring to?
 
@MooingDuck 1:35, continuity fail.
 
@sehe watched it four times, I still don't see it
 
Mmm. Watching it more times, it is possible that the curve tightens very abruptly.
@MooingDuck in fact, now that's definitive: it is not a continuity error, just the last part of the curve is 'drifted' so hard precisely where the camera cuts over, that it was hard to see where all those blue barrels were coming from all of a sudden :)
 
@MooingDuck i dont need i? i need a counter thou?
 
@sehe oh yeah, camera work makes that confusing
 
sbi
9:01 PM
@sehe I am absolutely sure they didn't do this in one take. And I am not sure they used as many pianos. So what?
 
@renatofernandes produces a new ilist where in is the first element and il is the rest. If il has a length of 2, what is the length of the newly created list?
 
That must have been messy.
 
sbi
@EtiennedeMartel That?
 
@MooingDuck 3?
 
The video you shared.
 
9:04 PM
@MooingDuck should i increment in the line with malloc?
 
sbi
@EtiennedeMartel That was two. This evening. I think I already shared one or two during the day.
 
I meant the one that was there before you edited it away.
 
@renatofernandes increment? No. You do not need a counter. If il has length 2, the new node's length is 3. If il has length 42, the new node's length is 43. so r->length = ????;
@renatofernandes protip: you just wrote a function called ilength
 
sbi
@EtiennedeMartel It's still there. (This always linked to the review, never to the original video. You can check the message's history.)
 
9:14 PM
Oh.
 
@MooingDuck ((sizeof(struct ilist_node)) ? im actually so consufued :( ...
 
@renatofernandes I... can tell. Do you understand what the ilist looks like in memory?
@renatofernandes You really need to talk to your teacher about this. I already feel like I'm helping you cheat with the massive amount of hints I've given.
 
@MooingDuck like boxes and pointers....?
 
@renatofernandes yeah
 
@MooingDuck Alrite thanks for the patience you had with me ... i'll ask a prof :)
@MooingDuck you said before that if il has a length two? how do we know it has a length two?
 
9:39 PM
Hi
The survey is not working ... :(
 
Yeah, same problem here.
 
Oh gee, I've been making ridiculous claims about return type inference. Just fixed one of my answers, I'm sure I have other wrong answers and comments.
3
A: Omit return type in C++11

Ben VoigtEDIT: oops, I just realized that there's a scoping difference between the trailing-return-type specifier and the return statement. Specifically: auto f(int a) { char r[sizeof(f(a))+1]; return r; } Kaboom! Previous answer: It's unfortunate that the language does not provide a synta...

And please help close this as a duplicate:
0
Q: Return type deduction

deft_codeIn C++11 lambda can deduce their return type if the body consists of only a return statement. A proposal is the works to remove this restriction, and apparently it's already working in GCC. Is there a reason this couldn't be extended to all auto returning functions? Has this extension already b...

 
hello virtual friends
 
@TonyTheLion we don't exist. it's only your imagination.
 
@TonyTheLion Hi !
 
9:49 PM
oh hai
 
It's a shame that I only allow myself to hang around here at times of total absence of activity.
 
@kbok been a while since you were last here
what you been up to?
 
Not so much
Writing "financial" C++ is really much more about finance than about C++ I guess.
I'm not sure if I actually like my current job after all.
 
@renatofernandes no, I was talking you through what r.length should be if il has a length of two (and 42). It can be any number.
 
@MooingDuck r.length? wat's the "." do?
 
10:04 PM
@renatofernandes if r is a node (not a pointer), it accesses the length member. However, for your code, all inodes are pointers, so in this case, it's a typo. You should have r->length
 
@MooingDuck im just confused how to count the nodes, without a counter ... are there some built-in functions that can do that?
 
@renatofernandes ah, that's the problem. The trick is "don't count". Because that's slow. Simply remember how long each list is. If you make a list with three elements, it should have a int length member set to 3. Then you never have to count.
 
@renato: If you have two lists, one with length x, one with length y, and concatenate them, what's the length of the resulting combination?
 
@BenVoigt the addition of the lengths?
 
Right. So if you were writing that concatenate function, you'd set the length of the brand-new list equal to the length of the left half plus the length of the right half, right? You'd use the length of the pieces.
Now if the left list is just a single node, and the right list has length y, what the length of the combination?
 
10:11 PM
@MooingDuck 1 + length(y)
@BenVoigt 1 +length(y)
 
y is the length in my example
so 1 + y
 
oh ok
how do i know what y is thou?
 
Now, if the right hand list was named tail, and the combined list was named r, what would you say?
 
Anyone take a look at my lecture notes earlier?
 
@BenVoigt the right hand list is named il in all his code, for some reason
 
10:12 PM
@BenVoigt hmm r = tail - lefthand list?
 
@MooingDuck Yeah well, we wouldn't want to give him the code outright!
 
@BenVoigt or the addition ..?
 
@BenVoigt it's been hours, I kinda do :(
 
Wait, what's the problem?
 
Yes, you're going to need addition.
 
10:14 PM
3 mins ago, by renato fernandes
@MooingDuck 1 + length(y)
 
Remember you're trying to figure out r's length, which you don't know, from the right-hand list, which you do know, and carries its own length with it.
 
@Moshe ???
 
@Pubby Yea? C++ Lecture notes.
 
@Moshe: Your professor's explanation of recursive is terrible.
 
@BenVoigt Why is that? And perhaps my notes are terrible?
 
10:15 PM
Yeah, that's not at all recursive
 
Because he described iteration, which is how you'd handle many files in one directory.
 
@BenVoigt how do i access this length?
 
Process one first, then the next, then the next, until they're all gone.
 
@renatofernandes you just wrote an ilength function, use that
 
@BenVoigt is it stored in memory?
 
10:16 PM
@renato: You have a pointer to a struct. How do you access data stored in a struct?
@Moshe: But recursion is how it handles the directory tree.
 
but my ilength, just return's il -> length
 
@renatofernandes that's fine for now
 
For each directory, iterate through all files and all subdirectories, processing every subdirectory in like manner.
 
@MooingDuck is this what your implying r->length = 1 + ilength(il); ?
 
@renatofernandes yup
 
10:17 PM
@renato: Yes!
 
@MooingDuck i assume i need to edit my ilength now
 
@renatofernandes Why? Probably, but not in the way you are (probably) thinking
 
@Moshe You've got missing parens on your conditional op code
And actually, that's a terrible use of the conditional op
 
@MooingDuck cause i get an error when i run it, since my ilength only return's il->length
 
@renatofernandes what is the error, and what is the real length of il when you get the error?
@renatofernandes namely, does this work? ilist test = itempty(); int tl = ilength(test);
 
10:21 PM
@Moshe: His description of the effects of buffer overrun is also terrible (or about 30 years old). You cannot crash Word by writing to a wild pointer in your own program. We have this thing called virtual memory. You can't touch Word's memory from your program no matter what value you put in a pointer or array index, because your pointer doesn't hold a physical memory address, but goes through a mapping.
 
im testing like so,
int main(void){
   ilist x = iempty();
   ilist y = icons(1,x);
   ilist z = icons(2,y);
   ilist w = icons(3,z);





   printf("%d\n", ilength(w));


   idelete(w);
 
@BenVoigt oh wow, now I want to read those notes
@renatofernandes what is the error, and what is the real length of il when you get the error?
 
= Invalid read of size 4
=    at 0x80484C7: ilength (ilist.c:46)
=    by 0x8048484: icons (ilist.c:18)
=    by 0x8048660: main (ilistui.c:15)
=  Address 0x8 is not stack'd, malloc'd or (recently) free'd
= Process terminating with default action of signal 11 (SIGSEGV)
=  Access not within mapped region at address 0x8
=    at 0x80484C7: ilength (ilist.c:46)
=    by 0x8048484: icons (ilist.c:18)
=    by 0x8048660: main (ilistui.c:15)
=  If you believe this happened as a result of a stack
=  overflow in your program's main thread (unlikely but
 
@BenVoigt He explains that as well. Read the whole thing. "Therefore, the operating system takes care of this for you."
 
@BenVoigt the heck is this: weeksVacation = years < ? 2 : 3
 
10:24 PM
@Moshe The correct way to find the smallest in an array is std::min_element.
 
@Moshe: Oh yeah, that's just a poor way to explain it, if what was meant was "code running inside Word".
 
@MooingDuck the real length is 3?
 
@Moshe the wording is still wrong.
@renatofernandes I doubt it. Do you have a debugger? Are you using visual studio or gcc?
 
@renato: Somewhere you're using a NULL pointer.
 
@BenVoigt yea the empty list where things initally gets consed on
 
10:25 PM
If real estate is so expensive why didn't he write for(int i=1;i < n;i++) if(arr[i] < result) result = arr[i];?
 
@MooingDuck im on a linux
 
Ok, now what's the length of an empty list.
 
@renatofernandes exactly. What happens when you give an empty list to ilength
 
@renatofernandes look at your code, is that what your code does?
 
10:26 PM
Where's the 0 come from, inside ilength?
 
yesss .... ?
O_O
 
@BenVoigt I admit, this ilist thing is confusing, treating a pointer as an object...
 
@Moshe "In C++ an array is just a list of numbers." ???
 
do i need to make a case for it will that break O(1)?
 
@MooingDuck That's what the compiler does.
 
10:28 PM
@BenVoigt it's confusing to reason with. He's got a null object
 
@renato: If NULL is a valid ilist, then it can be passed to ilength, so you need to make ilength not crash when NULL is passed in.
 
@Pubby Well, for our purposes.
 
@sbi Interesting, too bad there aren't any videos of C++ standard meetings.
 
@Pubby I know, but we're not up to it yet.
 
Are we still doing linked lists in C?
 
10:29 PM
@FredOverflow yeah. Current assignment is to alter it to have a length member
 
Complex operator+(const Complex &rhs) {
return (Complex((x + rhs.x) , (y + rhs.y)));
}
 
renato is, while Moshe is doing arrays and calling them lists.
 
I have this
 
@Moshe And no, Bash has nothing to do with Bjarne
 
@ZoZo123 good job
 
10:29 PM
Please remember that most folks in my class aren't hanging around C++ chat rooms with professional programmers. I happen to do that. Then again, I've been writing code for a lot longer than most people.
that was my own idiocy.
:-)
 
and i would like to define it with Complex&
so I can do complex + complex +complex
 
@ZoZo123 what do you mean "define it with Complex&"?
@ZoZo123 you can already do that. Did you try?
 
@Moshe: That's ok, as long as you keep them straight. In C++ std::list is a linked-list. In other languages List is an array.
Just don't confuse a linked-list with an array.
 
@ZoZo123 Many unnecessary parenthesis, just say return Complex(x + rhs.x, y + rhs.y);
 
YAYAAAAA!!!!
i got it :DDDDD
 
10:31 PM
Show your new ilength.
 
better yet, show us the whole file in ideone.com
 
 int ilength(ilist il){
 if(iempty_huh(il)){
 return 0;
 }
 else{
 return il->length;
 }
 }
 
rofl
 
When is length computed?
 
@RMartinho: oy robot, ping-back
 
10:32 PM
@BenVoigt I think he was trying to contrast with Java arrays, which are length aware.
 
@FredOverflow icons, we went over than with him
 
thanks guys!
 
@MooingDuck Why the 0 special case?
 
@renatofernandes looks right to me. Verbose, but right
 
10:32 PM
@FredOverflow ilist is a ilist_node*, ergo, can be NULL.
 
@Moshe "Homework: Take the array functions and make it work for an array of strings. No deadlines yet." Use templates?
 
@Fred: It's an immutable (I guess) list node.
@Moshe: std::vector is the C++ "length aware" array.
 
@MooingDuck Oh, the empty list is a null pointer? What a strange design.
 
@Pubby I don't know what that is, but I'll bet he'll get to that.
 
@FredOverflow yeah :(
 
10:33 PM
@BenVoigt I'v heard about them.
I'm an Objective-C dev, not C++, so have a little mercy folks. These are freshman C++ notes for a reason. :-)
 
@Moshe You better hope he gets to actual C++ soon too! So far I've only seen C.
 
@renatofernandes looks good to me
 
Except that std::vector is actually more like Java's ArrayList, in that it knows how to copy to a larger array when it gets full.
 
@MooingDuck :2561071 Thankks guys !! if i could pay you guys i would ! lol
 
@Pubby I'm sure he will. It's been some review stuff so far. I hope I can keep up though.
 
10:35 PM
@Moshe Good luck. Well-written notes btw.
 
@renatofernandes You pay us by sacrificing a goat to Dennis Ritchie.
3
 
@Pubby Thank you. (Quick: How many flavors of Heinz ketchup are there?)
 
@FredOverflow i'll see what i can do
 
@Moshe fifty... something.... seven?
 
@Moshe 57
 
10:36 PM
Yup, it's in my notes.
:-D
 
saw that :D THat's the only reason I knew
 
It's on the front of the bottle, hehe
 
Is there an emacs chat here?
 
What happens in GCC when you say -fno-except? Can you still use containers?
 
Ok, gonna get back to working on some iOS apps.
 
10:37 PM
How do they react when there's an allocation failure?
 
Oooh, librarian sounds angry.
> You're back aren't you?
 
@KerrekSB they probably die horribly
 
(not with me, heh)
 
How many flavors of Dr Pepper?
 
Ok, Tschüß!
 
@renatofernandes If you don't have a goat at disposal, you can also sacrifice a goto. Browse through some old code of yours and replace a goto by higher-level control structure.
4
 
lol
 
reddit is down
my life is useless
3
:(
 
@Moshe: Biss spaeter
 
ugh, goto
 
IMO, even the idea of -fno-except in the general case is a bad one
 
hmmmm
 
@DeadMG The more I think about the, the more I fail to see how it could even be done.
 
it can't
not unless you choose to liberally sprinkle error codes all throughout everything
 
ugh
so C, error codes are
 
10:44 PM
It seems that allocators cannot be made to work without exceptions.
 
it seems that good code in general cannot be made to work without exceptions
 
except when it can
 
nah
 
@TonyTheLion Not in C++
@TonyTheLion Think about constructors.
The magic of C is that it doesn't have constructors. That makes is a lot simpler.
 
10:45 PM
Java and C# do, of course, have the same problem.
any language with constructors, in fact, except C's pseudo-constructors
 
@KerrekSB really? I'd think it could be. In fact, I know there's a template library replacement that doesn't use exceptions. Lemme find it
 
So this is a weird little GCC option...
 
@KerrekSB I'm thinking about ctors, I don't see what you're saying?
 
@MooingDuck That doesn't make it even remotely comparably useful.
@TonyTheLion Constructors can't return values. So even if you did ejaculate error codes throughout your codebase, you could never indicate construction failure.
 
@DeadMG I think it's stupid, but a lot of gaming companies think exceptions make stuff slow so they won't use them
 
10:47 PM
@MooingDuck A different library that isn't the standard library and doesn't use allocators... perhaps.
 
Can I only watch day 2 at the GoingNative live stream?
 
@DeadMG didn't think of that
 
@MooingDuck That's their own exceedingly dumb fault.
 
@KerrekSB I didn't use the word "standard" for tha treason
@FredOverflow yes
@DeadMG I don't disagree
 
@MooingDuck I wanna see the panel at the end of day 1 already :(
 
10:47 PM
@DeadMG valid point, never thought of it
 
moreover
 
@FredOverflow I only saw half of day1 as well :(
 
@MooingDuck Even then... you'd have to think hard about what to do when you, say, resize a vector and there's a problem with the copy half-way through, or when you can't get enough new memory.
 
error codes are not polymorphic
you can't get an error message out of them
 
@KerrekSB open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html here it is. EAGames uses it widely
 
10:48 PM
they're much more rigid
 
@TonyTheLion Constructors are the one-word reason why you need exceptions, intrinsically and fundamentally in the C++ language.
@MooingDuck I know EASTL
Still uses allocators, and doesn't get around constructing sequences of objects.
 
the potential for errors with error handling when using error codes is extreme
exceptions are more reliable
 
@MooingDuck Yes, I know. Their solution is: The user guarantees that there is enough memory so that allocations never fail, or otherwise it is UB.
@MooingDuck Also, that doesn't address how range construction works if object constructors can throw. Basically, it goes all the way down to say, nothing must ever throw.
 
@KerrekSB I'd imagine they're supposed to set a global flag since that's the only workaround. I have no idea, I just glanced over it once
 
10:54 PM
what is wrong with this :
string operator << (const Complex &rhs) {

return string("x = " << rhs.x << "y = " << rhs.y);
}
 
@KerrekSB oh, here it is: "The allocator calls a user-callback upon failure, whereby the user callback frees up memory in an application-specific way."
I actually wish the STL did this, with the default being throw stuff
It'd make it easier to make caches in a program
 
Has anyone played with BGL? Originally, I planned on using graphviz in my project and then I discovered BGL - its power leveraged through generic programming is really compelling
 
@KerrekSB oh wow
ok, I'm off for a bit, tvtropes.org got me
 
harhar
 
@KerrekSB I've always wondered why constructors didn't return a reference to themselves. Syntactically it seems like they do. That doesn't address error handling in any way however
 

« first day (478 days earlier)      last day (4482 days later) »