« first day (427 days earlier)      last day (4747 days later) » 

00:01
@RMartinhoFernandes Does the "Read As Bob" button work for you?
Ah, never mind, it does work
I gave it the wrong input!
Hey. It's not like I get meaningful errors out of this thing
You should add parseInt around match[x], to prevent nasties at the source.
I forgot that.
Or parseBignum or something.
parseYourMother
oh wait, undefined behaviour
Are we allowed to ask grammar questions here?
00:06
I discuss my grammar all the question
3
@DeadMG The grammar in that sentence is totally wrong.
It is "a hospital" instead of "an hospital" right?
"A user" and not "An user?"
wait
rofl, don't know wtf I said
00:07
@RMartinhoFernandes Quick edit :D
"a hospital" is the modern way to say it
in Ye Olde English, all h were silent if not uncombined
words beginning with aeiou gets an "an" isn't it?
I made an "associative" container adapter that gives list/vector/array/deque a std::map interface (without the iterator/reference guarantees) Then it dawned on me it should probably work on a std::set as well. In which case, there's no reason for std::map to exist. Does anyone have a counterexample off the top of their head?
so they used to pronounce it "an otel" and "an ospital"
@rekire A uniform.
00:08
What about an user though?
but in modern english, "h" is pronounced and it has "a" instead
@rekire It matters how you pronounce it.
it's "a user"
It's like "you-ser"
exactly
00:08
"you-zer".
Alrighty, thanks
Silly half-consonants.
the rules for "an" vs "a" are more about pronunciation than spelling
An hour.
Xeo
Xeo
an lvalue, a lvalue - should be former, eh?
00:09
oh i see... so much school english and i know nothing^^
yes
"an el-value"
@Xeo Unless you say "a levalue".
Please don't.
counterexample occurs to me: std::lower_bound is not specialized for trees for some reason.
@CatPlusPlus Yes, the "h" still tends to be silent in that word, unusually.
Xeo
Xeo
That "an/a" is pretty annoying
00:09
meh
if you actually speak the language, then it's very natural which is which, because the wrong way around is hard to say
the tongue's in the wrong place
@MooingDuck Counterexample to what? What are you talking about?
@RMartinhoFernandes: Why we have std::map instead of a generalized associative container adapter
Who's talking about that?
the problem only occurs because pronunciation vs spelling isn't a very reliable thing, and especially since it changes a lot over time, you can find a lot of samples in the wrong way
because it was the right way fifty or a hundred years ago
Xeo
Xeo
1
Q: Casting from base class to unknown derived class

Andrew MarshallGiven an object initialized like so: Base* a = new Derived(); Container<Base> = new C<T>(a); where class Base { ... protected: ~Base(); } class Derived : public Base {...}; template <typename T> class Container { private: T* object; public: Container(T...

I label this question as "unanswerable".
Atleast with the constraints presented at the bottom
00:12
Neat, yesterday ended in 440 rep :-)
@RMartinhoFernandes just me :<
Xeo
Xeo
@KerrekSB Curse you and your many answers! Only 260 for me :<
@Xeo I don't know where they all suddenly came from... some are from October!
Xeo
Xeo
@RMartinhoFernandes Noticed the tag on that question? Maybe the presented code is given by the professor or something
@Xeo My solution would be to fix the base class anyway.
Xeo
Xeo
00:14
Yeah
I'm known for not answering silly questions in homework and exams :)
Xeo
Xeo
:)
I'm known for leaving witty // comments at the right side of the exam paper.
Instead I just present valid reasoning as to why the question is silly. Sometimes it works, sometimes I get screwed anyway.
On an English test, there was a question at the end to provide an argumentative text in favour of something I can't remember. Instead of doing that, I provided an argument about why I couldn't decently provide such an argumentation. The teacher was a good one and gave me full score :)
OK, the code works in principle, now we just need the bignum support
00:32
@Xeo: Container<Base> = new C<T>(a); What is this?
Xeo
Xeo
@RMartinhoFernandes I don't know.
I suspect he's not showing us the code that was given to him.
OK, it is up. Anyone fancy a test?
Because if that was the code given to him, it doesn't even compile.
@KerrekSB: I dislike the URL.
00:36
@MooingDuck It's unixy - short and to the point
@KerrekSB Which one is the big one? p or g?
@RMartinhoFernandes Both. p is prime, though.
g is the generator of a multiplicative subgroup of Z/pZ
@KerrekSB: For people with dirty minds can you just call it exchange instead?
or something
With with a good choice of p, namely p = 2q + 1, g will have order q
@MooingDuck I'll consider it once you chip in some CSS contributions.
So... anyone up for a test?
Xeo
Xeo
[23, 5; 16]
00:39
That's not big.
Xeo
Xeo
:P
It's a test
@Xeo 14
Xeo
Xeo
Okay, I got something now.
Now we should have a shared secret
What is it?
Xeo
Xeo
13
00:40
No
That's wrong...
Xeo
Xeo
damn enter key
Put 14 into the input box and "read as alice"
Xeo
Xeo
I did
And I revised the above message because I pressed enter in between :P
Hm. The shared secret should be 13
My secret is 87. What was yours?
Xeo
Xeo
00:41
1 min ago, by Xeo
13
Xeo
Xeo
I get the feeling that half of my messages is ignored sometimes.
So you used 8 as your secret, huh?
Xeo
Xeo
Oh noes, he got a decoder!
@RMartinhoFernandes Get out, Turing
OK. Next step is to add LARGE primes. I just want to add the on from the RFC actually
00:43
@KerrekSB I helped!
@LucDanton Er... wait? What? Did you post the RFC link? I mean, your presence in this room is a general moral boost, of course.
My browser is dying trying to exponentiate this stuff
Isn't there a power-mod in the bignumber library?
What's it called -- modular exponentiation
Ugh, how annoying there isn't
It should be easy to whip up your own, no?
00:48
maybe. In JS I'm never sure I'm not accidentally concatenating strings...
Wait, what happened here?
Xeo
Xeo
Why'd you delete that? @Cat's message is gonna get unpinned soon.
Atleast it should
@Xeo I saw it get unpinned, then pinned my replacement, and... Cat's one came back!
Xeo
Xeo
lol
I'm not drunk.
Xeo
Xeo
00:55
Maybe it'll get unpinned in ~2hours eventually.
Wow the anti-java message got 29 stars. I think that's a record here.
Apparently it's one thing that we all agree on.
Yep. Not even the "C++0x FDIS" and "C++11 published" messages got that many stars.
[1089608001925554529906369695223616073286752318983812652013490611232497534983790‌​4709848892197372465644738314550151508445373651656876470812244371, 41533412676544299905810425850764061426631266154156477769055042131602174018865915‌​479274947739921909022638076624087091531001696286624187332779591808885849722485562‌​2325; 16868714275240032505397313902218371511826752121218915826511696588094785472390248‌​6141636751221434045796488842965137381015726686079155440781454]
If you are new here, please read the newbie hints. Thank you.
15
Oh. This isn't quite as pastable as I would have hoped
00:57
Best was Cobol, followed by C++ and then Visual Basic. Strange combination.
@KerrekSB That blows up my regex!
"match is null".
WTF?
@RMartinhoFernandes It broke during the SO pastage. There are some odd characters in there...
It works locally
Now, if I just hardcode g and p, then we don't need the regex
then we just transmit one thing
Why not. OK, so now we just need a scheme to modulate arbitrary text onto the shared secret
I'd say any ASCII string that's at most 100 characters long. Just XOR it onto the shared secret
Length-prefixed
Xeo
Xeo
@RMartinhoFernandes Did you manually unpin @Cat's message?
01:01
This is not reusable.
@KerrekSB But, but, it's such a beautiful regex! /^\s*\[\s*(\d+),\s*(\d+);\s*(\d+)\s*\]\s*$/ Look at all the optional whitespace!
@RMartinhoFernandes True, it's very neat
@Xeo Yeah, I don't have patience for messages that disappear before my eyes only to reappear again.
OK, in that case we replace numbers by indexes
so it'll be [1, 1; 9862864097093]
Xeo
Xeo
Bad message! Drop it!
01:02
How do you write an array of strings in Javascript?
var arrayOfStrings = ["blah", "blah", "blah"];?
No Array()?
Xeo
Xeo
@KerrekSB Index into what?
@KerrekSB There is that too. But AFAIK it behaves differently sometimes.
Don't know when.
@Xeo I want a drop-box that says "Prime 1, Prime 2, Prime 3" etc
01:04
You know how it is with JS.
Xeo
Xeo
@KerrekSB Ah
Or actually, it should always be pairs of primes and generators I suppose
I hate to have to code that sort of bs
Xeo
Xeo
Why not just use one constant one?
Yeah. But RMF wants this to be regex powered
Oh, no, I was joking about the beauty.
Xeo
Xeo
01:06
@KerrekSB Also, why bother sending the indices instead of the primes / generators? The array will be visible in the source anyways.
Unless you pull it from some db
@Xeo The primes are very big (i.e. scary for human consumers).
Xeo
Xeo
Mmm, okay, that's a good point.
Alright, it's up again. Fixed parameters now; just one single exchange token.
Anyone?
I'm worried that a remark about some stupid regex I wrote was making you consider changing some design just to accomodate the regex.
15549393405003454437331312818284972928882799753997818982253531442337752096592328‌​33838326986051759420738252334766642814943646432722594872057183
57947105746693225371762114190019825049775974613363389154274119014209847041366609‌​36973764088090730630169460690745816769230727755224211946986673
@RMartinhoFernandes I want power! :-)
01:10
This thing hurts my Firefox.
So, how do I use the secret to send you a message?
What's the MD5 of the SS?
It's cb447311d2a3e0ed204e57081f80cb81 on my end
@RMartinhoFernandes I think I'll just XOR the message onto the SS
Maybe padded to 128 chars with some PKCS scheme
This is tricky. The message length depends on the lenght of the SS
Hmmm, hash doesn't match.
How did you compute it?
You should make the textboxes bigger btw.
I used echo -n **** | md5sum
@RMartinhoFernandes I will happily grant heaps of appreciation and stacks of goodwill on everyone who contributes CSS! :-)
As well of general UI redesign
01:15
Nope, no matchy.
Does it start with 9 and end with 0?
142 characters.
Xeo
Xeo
Maybe my 2yr old brother decides to stay in his bed this time
@KerrekSB Zero-pad?
@LucDanton You really want some PKCS padding, to discern padding from content
@RMartinhoFernandes No
Oh.
Wait
It does. I was computing the wrong thing (my secret, not the SS)
Damn, now you know the hash of my secret
a4648f1c9c57fe9e7c0ea60304d2e0e3
So, does it hash to a4648f1c9c57fe9e7c0ea60304d2e0e3?
Yep.
Yay
Awesome. Now on to the line protocol
@KerrekSB Well, last (and only) time I did this I delegated to a symmetric scheme implementation.
@LucDanton I've never delegated a thing in my life!
@LucDanton You wouldn't happen to have one ready?
AES keyed on the hash of the SS?
01:25
Well, when it comes to cryptography, it's the best thing to do.
But remember, this is for manual pasting!
Ease of use is paramount
@KerrekSB I don't own the code. Also, it was C.
Anything is possible in C... it's the JS that adds the real challenge :-)
@KerrekSB IIRC that was exactly the thing, yes. AES256.
Can someone pen down the JS code to XOR a text string with a number bytewise and return the new number?
Xeo
Xeo
01:33
Okay, my little brother did not decide to finally sleep.
sigh It's 2:36am here. -.-
var xorIt = function(input, secret) {
    var r = "";
    for(var i = 0; i < input.length; ++i) {
        r += String.fromCharCode(input.charCodeAt(i) ^ secret.charCodeAt(i));
    }
    return r;
}
This produces non-printable characters, though. And requires the secret to be at least as long as the input.
OK, I just want the output to be a number again
And how do you plan on doing that?
Well, just the bytes of the SS XORed with the bytes of the message....
Ah, you're just treating the SS as a string?
Won't that produce terribly gigantic numbers?
01:48
@RMartinhoFernandes We already have terribly gigantic numbers, remember?
We could unravel the SS from the rear and divide by 256 repeatedly
Like this ideone.com/S4bJi then?
Damn, missing a var.
@RMartinhoFernandes Yes, precisely
Cheers. Let me put that in.
Needs a decoder too.
And has a bug.
That String.fromCharCode is not supposed to be there.
Hmm, should change that to take two numbers instead of a string+number. Then just write functions String->Number, Number->String.
user406009
02:05
Since when did C++ chat become javascript chat?
Next thing you know those darn java people are going to start sneaking in.
No, they stink.
Xeo
Xeo
Well, JS just is better for webstuff than C++. No use arguing here.
Especially since the browser only supports JavaScript.
@RMartinhoFernandes Yeah, I already fixed that
It's done
Let me upload
OK, done. I'm Alice: 10896331477480422416324828713952347858967785634798798175088098287009569468833591‌​74836592026988297493895300108919360553301886931841877980146945
02:13
Oh no, the pasting failed again
WTF You can't even paste correctly?
10896331477480422416324828713952347858967785634798798175088098287009569468833591‌​74836592026988297493895300108919360553301886931841877980146945
WTF
After the "91" there's box?
OK ignore the box
108963314774804224163248287139523478589677856347987981750880982870095694688
3359174836592026988297493895300108919360553301886931841877980146945
Paste that thing minus the linebreak
77845383866436935085266112825393923800376
That's very short?!
Hmm, I don't think it's working.
02:17
Are you giving me your token, or are you encrypting already?
It's a message.
Oh, right, I need to give you the stuff.
I haven't got your token yet!
You comedian
31562745566221089353954366893888491620615395466710410476123987383782269381556627‌​5883828263658305635243281738761317243970822100752973700999583
Shall we confirm with MD5?
Hashes down to eb3bb726efaec72eb4d984ab56565504.
02:19
eb3bb726efaec72eb4d984ab56565504
Kewl.
Now read my message.
Message: 300783142660420384121733153
Is your message 56 chars long?
I supposed you didn't try to tell me "°D³òÂ/ÁžŸfPä‚,bí햔lÜ&S'˜W±ºG´°„ÝìÎBÔ¼(œóó¿:Óiú*GW7úe" with a bunch of zeros in front?
No
Curses
Then it's not working.
02:22
No, it's not working at all. One moment
Oh d'oh of course
When building the number you're adding and then shifting. Shouldn't it be the other way around?
This way you'll always get a null byte at the end.
My lenght-prefixing scheme is totally fubar
I want to be able to read the length first
Oh wait that's on purpose.
When encrypting I need to store the last byte of the secret and use that to XOR the length in the end
But even that's buggy still
Ah, I think I got it
No
lol
If you write String->Number and Number->String, you can use the same function for both encryption and decryption.
02:30
I think I'm taking the string from the wrong end during one of the operations
Yep, you're encoding the first character with the last byte of the secret. And then decode the last character with the first byte. (modulo the length thing).
Wait, that makes sense.
Yep. I need intermediate storage in the decryption
Done now
It's updated
You need to remove your debugging alerts.
Let's resume with the previous SS
Message: 271152773431862954721562551
@RMartinhoFernandes Eeks
Ugh, Firefox choked on something.
02:42
:-S
@KerrekSB Did you make a typo on purpose?
I get "Ehlo world".
I'm a mail server
So it works?
If that was your message, yes.
Grandiose. Send one back, just to be safe
106867036299996765434862136996470043103192682541538022947720450813373184095138
We could star all the messages with the numbers and confuse the hell out of everyone looking at the starboard.
02:46
Haha! This is easily the most inefficient implementation ever! The throughput of a carrier pigeon combined with the latency of the Royal Mail
It's called the "starboard"???
It takes about 10 seconds to decode that short message
@KerrekSB It's where the stars go to, and it's on the right.
not to speak of the 30 sec for the handshake
@KerrekSB What browser?
@RMartinhoFernandes Yes I got that, but that's an amusing name
@RMartinhoFernandes Opera
Let me try Iron
Here on FF it does it in about 5 seconds.
02:48
I tried it with a longer secret
Xeo
Xeo
0
A: How to access members by both name and as an array?

XeoNote: Updated and improved the code a lot. The following code uses a macro to keep the code clean and partial specialization to provide the members. It relies heavily on inheritence, but that makes it very easy to extend it to arbitary dimensions. It's also intended to be as generic as possible,...

the secret really should be unforceable, too, i.e. many bits long
Xeo
Xeo
I love dem templates!
So, while you guys did something cool and productive, I played around with templates. :(
And inheritance. Too bad unions can't be used in an inheritance hierarchy.
With a 20-digit secret, even Iron takes its time...
OK, now that this is out of the way, who wants to Super-Melee?
Xeo
Xeo
I think you scared the few willing ones away already.
@Xeo They were insecure...
Otherwise we could have a brute-forcing contest.
We'll exchange XOR-encoded jokes about DeadMG's mom, until someone breaks the code.
3
lol
Sometimes I feel like a laughter track.
Xeo
Xeo
Hm. I wonder what would be the easiest way to let my vec template convert from higher-dimensioned instantiations to lower-dimensioned ones.
Hm, that prime I hardcoded into the program doesn't seem to be prime at all
02:55
Who was it who gave it to us.... Luc!! fist-in-air
Did you convert from hex correctly?
You can check the code...
I just used literals
Xeo
Xeo
            void func(int x){
                for(int a = 0; a < x; a++){
                    func(x - 1)

                }
            }
Hm. That bignum library isn't all that great methinks
Xeo
Xeo
I hope I'm not the only one that thinks that function is useless?
02:58
Where did you find that?
Xeo
Xeo
0
Q: How to convert this recursive function to iterative

Mike GI've been thinking about this for a while now how do i convert this function to iterative instead of recursive: void func(int x){ for(int a = 0; a < x; a++){ func(x - 1) } } note this is not! homework i had a job i...

0
Q: How to convert this recursive function to iterative

Mike GI've been thinking about this for a while now how do i convert this function to iterative instead of recursive: void func(int x){ for(int a = 0; a < x; a++){ func(x - 1) } } note this is not! homework i had a job i...

Woah, calm down.
Xeo
Xeo
@Mysticial, stop stalking my visited questions! :P
> Obviously this is not homework
Right.
If this is production code somewhere, oh my.

« first day (427 days earlier)      last day (4747 days later) »