« first day (802 days earlier)      last day (4145 days later) » 

sbi
9:00 PM
@DeadMG The instantiation traceback only.
 
ok
ohhh, I get it
 
it's the nested bind thing
 
user142019
His posts. His downvotes. So chanceless.
 
try
function<int()> f3 = bind( &Y::call_it
                     , this
                     , function<bool()>(bind(&X::foo, ref(x_))) );
 
sbi
9:01 PM
@DeadMG Yes. And it's unable to deduce the result. This compiles:
function<int()> f3 = bind( &Y::call_it
                         , this
                         , bind<bool>(&X::foo, ref(x_)) ); // note the explicit template arg
 
@sbi No.
 
sbi
@DeadMG Yep, had tried that already, and it made me try ^ this.
 
nononono
 
sbi
Then what?
 
when you use bind(..., bind(...)), then the nested bind is executed at call time.
 
user142019
9:02 PM
Oeh this MongoDB driver has LINQ support. :3
 
it's not treated as a real argument
 
sbi
???
 
so the resulting object, effectively, calls f(args, bind(...)());
but you want f(args, bind(...));.
that's why it works when you construct a std::function.
 
sbi
I can't wrap my head around that. What's the problem?
 
aright
consider the expression bind(f, args);.
when you execute the result, it calls f(args), right?
 
sbi
9:05 PM
Uh-uh.
 
but when you call bind(f, args, bind(otherargs))
it does not call f(args, bind(otherargs))
it calls f(args, bind(otherargs)());
we used this before- it's when otherargs uses one of the parameters
so you can do f(args, f2(otherargs)); as a bind expression.
 
sbi
waitwaitwait
@DeadMG You mean it executes whatever bind(otherargs) creates at the time I call register_call(), rather than passing it forward?
 
yes.
 
sbi
Why?
 
because then you can call f(args, f2(otherargs)) in one bind
I used it for you before
it's what lets you compose binds together
 
sbi
9:09 PM
Ah.
But if that's the case, you can never nest std::bind()!
 
nah
it's just an ambiguity
in this case, you want the result of bind() to be the parameter, but in most cases people want the result of bind() to be called.
to produce the paramter
I've never had to resolve this ambiguity the other way previously
 
sbi
No. In most cases people want to pass the result of std::bind() to somewhere else in order for it to be called from there later. But I can see that std::bind() itself wouldn't know the difference.
 
so I've never really experimented with it
 
sbi
Interestingly, this again does not compile:
server->register_call<MAGIC_FOO>( bind<int>( &Y::call_it
                                           , this
                                           , bind<bool>(&X::foo, ref(x_)) ) );
Note that I added both of the result types to std::bind().
 
how strange
but tbh
I understand the issue, and your previous code worked, so I'd just roll with that
 
sbi
9:14 PM
Yeah, of course, I'll use that. It's still puzzling, though.
Oops.
Now this
function<int()> f3 = bind( &Y::call_it
                         , this
                         , bind<bool>(&X::foo, ref(x_)) ); // note the explicit template arg
doesn't compile either.
 
huh
it did before
 
sbi
I must have done something silly when I tried it before. Like not saving before building, because eclipse seems to be unable to do that by itself. Sigh.
Anyway, this
function<bool()> f1 = bind(&X::foo, ref(x_));
function<int()> f2 = bind( &Y::call_it, this, f1 );
server->register_call<MAGIC_FOO>(f2);
still compiles, so this is what I'll use.
 
wow, sbi
that's rather arbitrary.
 
sbi
Indeed.
 
user142019
lol
 
user142019
9:21 PM
Google Chrome commercial on TV.
 
Ell
Let's say I have about 70 different images all of the same size - I want to take an arbitrary bitmap of that same size and choose which of the 70 tiles it matches - does anyone know a quick algorithm for this?
 
no, it's going to be O(n).
unless
you can guarantee "matches" as "pixel perfect equivalence"
then you could try some kind of hash-based system
 
Ell
Yeah it's pixel perfect equivalence
it's recognizing tiles
 
then hash the image content
 
Ell
In my old system, I hand coded pixel positions
 
9:22 PM
and use a hash lookup
 
sbi
Hey, not only that none of you suckers were able to answer my question (although I, reluctantly, admit that you have been helping me to find it), you didn't even give me a single vote! Really, what's this place come to?
 
Ell
so each tile had 4 or 5 pixels which made it unique - I'm guessing this is very quick (I haven't benchmarked it though)
 
@sbi I don't vote for people who call me a sucker.
 
@sbi Go and upvote every single one of my questions about Clang's C++ API and I'll upvote your bind question
 
Plus, I don't have the rep for it to matter.
 
sbi
9:23 PM
@DeadMG I wasn't involved here when you asked them. (In fact, I didn't even know you asked them.)
 
@sbi I upvoted you already.
 
sbi
@ShotgunNinja That might well be. However, you also didn't upvote before I sad that! :)
 
@Ell If you use the appropriate hash algorithm, it should be no more than O(size), where size is the size of the bitmap.
 
Ell
@DeadMG Right okay, do you know any hashing algorithms of the top of your head suitable for this?
 
@Ell Eh. Honestly, who cares? Even something like MD5, CRC or whatever would be absolutely fine.
oh, and by the way
I decided to start offering bounties on questions which are important to me
and since I've got so much rep, it's 500 every time
 
Ell
9:26 PM
@DeadMG okay :) anything that is quick I guess
 
if anyone's desperate to gain a lot of rep in a short time, then get acquainted with the Clang C++ API and chuck me a hand :P
 
Ell
Although I might write something to do what I did by hand automatically for a challenge :3
@ScottW that was quick
 
at this point, I could care less about rep; I just wanna be done with school so I can stop accruing loan interest.
 
Well. In Anno 2070, you have to build special structures that satisfies the need for "information" at one point. For the Ecos, we have the "Education Network", and for the Tycoons, we have the "Ministry of Truth". Uh. /cc @R.MartinhoFernandes
 
@ScottW Depends on the loan issuer.
@EtiennedeMartel lol, the Ministry of Truth.
 
9:30 PM
Nope. With the loans I get, I accrue interest from when the loan money disburses to the school, up until the loan is paid off. I have the option of paying off my interest before the loan enters the repayment period.
 
There's also a mission called "Unforeseen consequences". I wonder if it's a Half-Life reference.
 
I don't have the money to cut my interest.
 
@ScottW Welcome to 1995
 
@EtiennedeMartel Yes.
 
No, but it was typical troubleshooting tip for windows 95
 
9:31 PM
@yetihehe And it's still effective today.
 
For mac ;)
 
there's a reason why "Reboot" and "Reinstall Windows" are the only two troubleshooting techniques I use for the vast majority of the time
 
@ScottW It's not from a bank, lol; it's a private educational loan.
 
and it's because they guarantee effectiveness for a quick, fixed cost
 
Ell
@Zoidberg'-- what is c# lambda syntax?
I know I could google. This is a test.
 
user142019
9:33 PM
@Ell I think (int a, int b) => a + b.
 
@Ell x => expr
 
Also, @ScottW, I have about $600 to my name right now, and my rent is $500 a month.
 
Ell
ta zoid, puppy.
 
user142019
"ta"?
 
user142019
There is also delegate if you want multiple statements rather than a single expression.
 
9:37 PM
delegates are fun.
 
user142019
delegate { a(); b(); c(); }
 
user142019
@ShotgunNinja dat pun.
 
@Zoidberg'-- IIRC, x => { statements; } works fine.
 
cpx
@sbi Did you remove yourself from mod list? I missed it.
 
9:38 PM
@cpx That was like, fifteen billion years ago.
 
user142019
@DeadMG Oh. Well, I've only got less than two hours experience with C# so I don't know. :^)
 
user142019
@ScottW Then what's the point of delegate? xD
 
@Zoidberg'-- Backwards compat, what else?
 
Ell
@ScottW is ta region specific? Are you north or south?
 
user142019
@DeadMG I see.
 
user142019
9:39 PM
but
 
user142019
What if you want a nullary lambda?
 
no idea
oh, wait
 
@Ell Region-specific where? This is the internet.
 
() => shit
 
user142019
=> foo()?
 
user142019
9:40 PM
oh okay :p
 
Ell
@ShotgunNinja in the uk
 
user142019
Nice.
 
user142019
And captures are implicit and by reference, I presume? Or by-value for value types?
 
cpx
Oct 3 at 9:58, by sbi
I would appreciate if someone could pin my explanation of why I am resigning. I forgot to do that before I locked my self out. :-/
 
You crazy UK folk, can't even speak the language you invented the same way between the north and south.
 
cpx
9:40 PM
I missed the farewell speech :S
 
Ell
@ShotgunNinja It's not our fault :P
@ScottW Really? I always thought ta was an english thing :P
 
@ShotgunNinja That last panel is remarkably accurate.
 
I'm from Wisconsin, just across the lake from Michigan, and I've never heard it.
 
We wish we would be making Art, but in the end someone has to clean after the mess the upper management or that idiot intern did.
 
just placing a regional barrier on that.
@ScottW ikr
 
sbi
9:43 PM
@cpx Yes, I did a while ago.
 
cpx
Ah.
 
@cpx, your Gravatar looks like a fancy swastika.
 
@cpx I still haven't dropped the projet to bring him back on that list.
 
Ell
@ShotgunNinja trudat
 
tru.dat, size: 486 bytes.
 
user142019
9:47 PM
Man.
 
user142019
C# is made for humans.
 
Ell
C# is the new Haskell for @Zoidberg'--
 

C#

General discussions about the c# language, Squirrels | gist.gi...
 
cpx
@ShotgunNinja Oh right, I never noticed that.
 
sbi
9:48 PM
@ShotgunNinja Hey, they copied the habit of having funny taglines from us!
@EtiennedeMartel Against your own better judgement, huh?
 
@sbi The rest of the room is unfunny though.
 
cpx
I can't think of any interesting picture for my Gravatar. It has always been like that.
 
@sbi They even copied most of our syntax, what did you expect?
 
@sbi What judgement?
 
cpx
Maybe I should write "cpx" in bold letters.
 
9:51 PM
@ScottW You know you want to
Yeah baby, hit that rebuild all button harder
8
Yeah show me some more toolbars ~
Pin them awwww
Hmm that Microsoft Squigglesense ~
 
Visual Stud-io
 
Haha nice one
 
sbi
@Zoidberg'-- It's not made for humans who are comfortable at wielding C++, though. You'll miss the raw power of templates very soon.
 
@sbi That's one of the things I miss in C# :( Template specialization is awesome
 
sbi
@yetihehe LOL!
 
user142019
9:54 PM
@sbi so, we need Template C#?
 
sbi
@NolwennLeGuen Yes, that's a serious letdown. Lambdas I loved, though, while I did C#. But now that C++ has lambda. too...
 
user142019
Or C#++.
 
@sbi What what?
 
sbi
@Zoidberg'-- We already have that. It's spelled C++.
 
user142019
lol
 
sbi
9:56 PM
@NolwennLeGuen What what what?
 
@sbi Also LINQ!
 
LINQ is, IMO, C#'s main selling point.
 
sbi
@NolwennLeGuen Yeah, that does have a neat syntax and is very expressive.
 
@ScottW Said no one ever.
 
@ScottW WHAT!?
 
user142019
9:57 PM
In C# is it conventional to use []-arrays or a container such as List?
 
@Zoidberg'-- Yes
 
sbi
@ScottW That's a very stupid statement.
 
@Zoidberg'-- Use List<T> instead, is array internally manages resize and stuff for you
 
sbi
@Zoidberg'-- You apply type modifiers to the type, though, not to the variable. Makes more sense, but is strange at first.
 
user142019
@JohanLarsson I see. Does it have operator [] overloaded?
 
9:59 PM
@Zoidberg'-- Eric Lippert had an article on that. Let me find it.
@Zoidberg'-- There.
 
@Zoidberg'-- you get better performance, skip boxing if for value types also drop a lot of casts
 
user142019
@EtiennedeMartel Dankesch"on.
 
@Zoidberg'-- it has toarray
int[] is not bad I think I'm no expert, I ussualy pick list if I need to add or similar
 
user142019
Awesome.
 
@JohanLarsson There's no boxing if you use the generic containers.
 
10:01 PM
@JohanLarsson Not typesafe
 
Arrays (and programming generally) are like knives. If you use them incorrectly, you will hurt yourself.
It's not news
 
@EtiennedeMartel I'm 95% sure, that usually means I'm wrong :)
 
@JohanLarsson List<T> uses a T[] internally. Since C# generics are not type erased (unlike in Java), then no casts are involved. So, no boxing. The behavior is similar with other generic containers.
 
List<T> uses a T[]? Why not a linked list?
 
... because they're horrifically slow and not random-access?
 
10:04 PM
They're only slow when used for random access.
 
@KonradRudolph How was the present delivery?
 
user142019
What's the default visibility if I don't specify anything? internal?
 
another nice thing with List<T> or IEnumerable<T> is Linq, Linq is god's gift to C# programmers
 
@Zoidberg'-- Yeah
 
user142019
In Java it's package I believe.
 
10:05 PM
@ShotgunNinja List<T> is a vector. LinkedList<T> is a linked list. Don't ask me why.
 
user142019
lol
 
@EtiennedeMartel clearly, because someone was hitting the hashish that day.
 
@Zoidberg'-- internal at global scope, private at class scope. IIRC.
 
user142019
Well, a vector is a list of things. :P
 
Dictionary<TKey,TValue> typed hashtable
 
10:07 PM
@ScottW A hash map, to be precise. SortedDictionary is a tree (a RB tree, IIRC).
 
Ell
Hmm. Why is a vector called a vector in the first place?
Clearly :L
 
a std::map is not a hashmap - it's a rb-tree
 
@Ell Because it's a tuple of values where all components have the same type. Or something.
 
you meen "omit"?
 
Xeo
I think he means for parsing with Clang.
 
user142019
How can I disable ClearType in Windows 7? It looks terrible.
 
@Zoidberg'-- adjust it, don't disable it. without cleartype is worse. have you enabled it?
 
user142019
10:38 PM
I turned ClearType off but Visual Studio doesn't obey. :<
 
anyway, right click desktop, choose screen resolution, in that window click on adjust font size, in the bar that appears to the left click adjust clear type
yeah, those are very logical menu choices
microsoft style
 
user142019
Ah. Much better without ClearType. It hurted my eyes.
 
user142019
ClearType looks terrible on Macs.
 
user142019
I don't know why. On my secondary monitor it looks fine.
 
10:40 PM
oh :-)
 
Why doesnt spType == NULL give the same result as spType == 0?
 
@JustinDearing it does
 
@Cheersandhth.-Alf not in my code
no wait forget it
 
@JustinDearing in a car crash, it may be that the car was stupid, or the driver was stupid
 
user142019
@Cheersandhth.-Alf I saw all red and green artifacts around black text:
 
10:41 PM
PEBKAC
 
user142019
 
@Zoidberg'-- I think there is a tuning applet for that
 
@Cheersandhth.-Alf Im glad I was stupid
 
he he
easier to fix
 
@JustinDearing You're not alone
Ohai
 
user142019
10:43 PM
Hello.
 
user142019
Nothing.
 
Ell
Incorrect
the sky
 
Oh my. Christmas has had it's usual debilitating effects
 
10:59 PM
ate too much?
 

« first day (802 days earlier)      last day (4145 days later) »