« first day (1209 days earlier)      last day (3722 days later) » 

user3010322
4:00 AM
@Code-Guru He's the world record holder for most records of pi computed.
 
cool
 
user3010322
 
> the world record holder for the most records...
 
boost::math::constants::half<float>()
 
Is there a Russell-like paradox in there somewhere?
 
4:01 AM
Ugh... watch window "std::string is undefined" y u do dis
 
what the shit
it's defined as 0.5
 
lol
why?
 
What a waste of time.
@Mysticial 0.5 is too short.
 
user3010322
This reminds me.
 
user3010322
4:01 AM
I need to overhaul Mathema to be better.
 
user3010322
I need to also overhaul limits
 
> From a high-school project that went a little too far...
 
user3010322
@Rapptz I wonder why they would need half....
 
@R.MartinhoFernandes java.lang.Math.Constants.ConstantsSingleton.Factory.SinglePrecisionFloatingPoin‌​t.PositiveOneDividedByTwo.
 
4:03 AM
> All the constants are accurate to at least the 34 decimal digits required for 128-bit long doubles, and most are accurate to 100 digits or more when used with a suitable arbitrary precision type.
Step it up Mysticial.
They've got your 50 digit pi by the balls now
5
 
fuuuuuuuuuuuuccccccccckkkkkkkkkkkkkkkkkkkkkk
 
Is 0.5 accurate to 100 digits or more?
 
I guess so
 
Why not zero and one?
 
0.5 can be represented exactly in binary, right?
 
4:04 AM
0.1
 
user3010322
@Code-Guru YES, YES IT CAN.
 
user3010322
._.
 
yay!
 
user3010322
Fucking Floating Point piece of shit mother fuckin'....
 
man, you have a lot of rants today, @ThePhD
 
user3010322
4:05 AM
Q for life.
 
=p
 
  BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000e-01, "5.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01")
5
 
wut
 
user3010322
LOOOOL.
 
4:05 AM
How
 
user3010322
@Code-Guru Sorry, I had to do a bunch of floating point math by hand.
 
user3010322
So I'm angry at floats right now.
 
user3010322
Smarmy little wormy shits.
 
With a finite automata?
 
user3010322
4:06 AM
@Code-Guru No, it's separate, thank GOD.
 
sounds like a fun exercise...
 
user3010322
@Code-Guru It wasn't. u.u;
 
user3010322
But! I got to use UB to check my answers.
 
@Rapptz Doesn't fit on Twitter.
 
4:07 AM
lmao
 
Well that explains it: (std::basic_string<char,std::char_traits<char>,std::allocator<char> >*)&data -> string.size = 3435973836
 
@Mysticial Not really necessary, as long as you don't mind using an x87 instruction (fldpi).
 
What's the character limit on twitter?
 
@JerryCoffin There's an x87 instruction to get Pi?
 
back to parsing protein strings...
 
4:08 AM
@Rapptz A positive number, so it's larger than it should be.
 
user3010322
@Borgleader o.0 Wat.
 
user3010322
unions don't give strict aliasing warnings~
 
@ThePhD Yknow that segfault I was having? Well now that nonius is VS compatible, I used the watch window to inspect the aligned_storage as a string.
 
4:10 AM
What's the UB? My C++ is a bit rusty in this area
 
@Mysticial Yup. Also for a few other constants (1, 0, base 2 log of e, base 2 log of 10, base 10 log of 2, natural log of 2).
 
What a waste of silicon. lol
 
user3010322
@Code-Guru The union type-punning in test
 
@Code-Guru There's no float object to read.
 
SAM
@Ell Hahaha again! Wrong Sam by the way... :)
 
4:12 AM
oic
that's a pretty slick trick
 
user3010322
You should use it~
 
@Mysticial Sort of, but some of them are pretty handy when you're hand writing assembly language.
 
user3010322
@Code-Guru You can formalize the trick with this:
 
user3010322
template <typename TTo, typename T>
TTo cowboy_cast ( const T& cow ) {
	union u {
		T hat;
		TTo boy;
	};
	return u(cow).boy;
}
 
user3010322
It's a wonderful trick~ ♡
 
4:15 AM
@Code-Guru UB is not slick.
 
user3010322
much slick, such skills, so trick~
 
2 days ago, by ThePhD
D: How is that a meme here? :c
 
user3010322
Heeey, he was curious!
 
user3010322
I was just showing him the ropes!
 
@ThePhD Showing him the ropes is one thing. Tying a noose around his neck is quite another.
 
user3010322
4:19 AM
Oh come onnnn it's not thaaaat bad!
 
user3010322
Besides, he'd almost never have a use for something like this anyhow.
 
Give me some credit. I'm not such a noob that I blindly copy and paste code...especially not from @ThePhD =p
 
Hmm, FFTW is GPL.
 
besides I'm too busy learning Haskell to dive too deep into C++ atm
 
I wonder what we use at work, then.
 
4:22 AM
mini-pi
 
@R.MartinhoFernandes Would it be possible for operator() not be const for benchmark functors?
 
Hmm, what for?
Mutation is not a good idea because this should be called zillions of times.
 
Feb 2 at 21:22, by ThePhD
And why is make const either?!
^ the discussion is around there
 
user3010322
@Code-Guru I'm lost already on my homework. :D
 
@ThePhD Ask away...or start another chat if you want
 
user3010322
4:27 AM
I'm trying to define a DFA for the language L = { 00, 11, 101 }. I've got q0 = { empty set }. I'm trying to draw a diagram.
 
user3010322
Right now I have q1, which represents when we receive a 0. and then there's q2, which represents when we receive a 1 to start with.
 
@Xeo Totally necessary.
 
@ThePhD Sounds good so far
 
user3010322
q1 can only go to itself, and hits the failing-state qDead if it encounters a 1 from q0
 
so what transitions do you need from q1?
I don't think q1 should go to itself.
 
user3010322
4:29 AM
Right, because q1 represents a certain state, right?
 
q1 -- 0 --> q3 (accepting state)
exactly
 
user3010322
Ah.
 
user3010322
That makes it a lot more clear.
 
q1 represents the first 0
q1 -- 1 --> q4 (failing state)
 
@Borgleader This is why nonius-8 depends on nonius-7. You cannot just destroy the object in the destructor because the destructor will run once, but op() will be called thousands of times.
 
4:30 AM
@ThePhD Usually a "loop" means you are doing something equivalent to "*" in a regex
 
@R.MartinhoFernandes I see.
 
It needs a distinct teardown/cleanup/watchamacallit step in the execution that is excluded from the measurements.
 
I'll hold off on getting this to work then.
 
Like setup(); start = now(); op(); end = now(); teardown();
 
SAM
@Code-Guru C++ atm?
 
4:34 AM
atm == at the moment
 
SAM
@Code-Guru Ohh... I started googling "C++ atm" hahaha I thought its something new... :) :D
 
C++ assembled time machine
 
lol
 
SAM
@Rapptz he he good one
 
good morning Lounge
 
4:36 AM
Shit. It's morning.
 
SAM
@ArneMertz Good Morning!
 
@R.MartinhoFernandes yes. early, but morning ;)
u still up?
 
I really don't want to bike home in the cold ;-(
 
@ArneMertz whistles
If I go to sleep now I can sleep four hours and be about half an hour late to work. Hmm.
Now the question is: will I sleep four hours, or six?
 
@R.MartinhoFernandes seven, probably ;)
 
SAM
4:39 AM
@R.MartinhoFernandes What about having a half-day at work? and sleep for 8 hours?
 
user3010322
@Code-Guru Mind if I take a picture and show you my finished diagram?
 
@R.MartinhoFernandes Sleep at work. Everybody wins!
 
I could do that.
 
@ThePhD sure
 
There's a nice comfy sofa.
 
4:40 AM
as long as it's not a picture of your junk =p
 
SAM
Btw why the title is Lounge<Google> today?
 
user1174868
god I hate linux, it is such a buggy pile of shit
 
@SAM You need a G+ account to know that.
 
user1174868
of a backslash? you didn't want to input that anyways
 
SAM
@R.MartinhoFernandes I have one.. but haven't yet logged in...
 
4:45 AM
lol
It's a joke poking fun at Google requiring everything to use G+
 
@R.MartinhoFernandes So now that nonius is VS compatible, will you consider doing the same for ogonek?
 
@Rapptz u mean his presence alone at work boosts the productivity of his coworkers even when he'ssleeping? ;)
 
@Borgleader It's lots more work :S
 
Fuck VS.
 
SAM
@Rapptz Ohhh.. come on... I thought it was real...
 
4:47 AM
Even my basic sol code needed an assload of reworking to work with dumb VS
 
@ThePhD whenever you're ready =p
 
SAM
@Rapptz VS :\ even the name is stolen from Vi ;)
 
@R.MartinhoFernandes Alright, gimme a month to read my book on templates, and then another to Alexandrescu's book, and then I'll give it a shot ;)
 
Fuck I'm doing windows programming again
wtf is this shit
If you think of the building as an application's process, each apartment is a distinct area in which a COM object can be created. But just as there may be lofts, studios, and 2- or 3-bedroom apartments in the same building, there can also be different types of COM apartments within a process. Apartments may also be vacant or have any number of people/objects living in them.
 
SAM
@Mikhail I can understand the pain... :(
 
4:53 AM
@Mikhail lol have fun gl
 
@Mysticial what's the license on mini-pi?
I want to steal your fft_inverse.
 
@R.MartinhoFernandes public domain
 
good guy @Mysticial
 
@R.MartinhoFernandes It probably won't do what you want it to do though.
 
4:54 AM
Why?
 
The input needs to be bit-reversed order.
 
Yeah, I was going to ask about that.
 
Real World Haskell lies!
 
The forward FFT takes in-order input and outputs in bit-reversed. The inverse FFT takes bit-reversed input and outputs in-order. So they cancel each other out.
 
> No instance for (RegexContext Regex [Char] [(Int, Int)])
 
4:56 AM
What does bit-reversed mean, exactly?
 
If you take the index of each array memory. Bit reverse the index. That will be the new index.
{0,1,2,3,4,5,6,7} -> {0,4,2,6,1,5,3,7}
 
Oh, I see.
 
user3010322
@Code-Guru The picture is coming out really fuzzy because I don't have a real digital camera. =[
 
You generally don't want to bit-reverse copy an array. Because the memory access is absolutely horrible -> almost guaranteed cache miss on every access.
 
@Mysticial does FFTW do a bit reversal? Author (stevie johnson) claims there is some way around it?
 
4:58 AM
@Mikhail They do actually do it. But they probably merge it into the FFT computation to "spread out" the cache misses.
 
@Mysticial Meh, this is for outputting pretty charts, so it's fine.
 
I still vote for the MML or Mysticial Math Library
 
user3010322
But, here it is @Code-Guru
 
@Rapptz lol
 
@Mysticial is that the same as not missing?
 
4:59 AM
The world needs more non-GPL math libraries
7
 
@ThePhD homework?
 
user3010322
@melak47 Yeah.
 
If you do a direct copy to bit-reverse something, then you cache miss on every one access. But you can do it on Log(N) passes over the data and have almost no cache misses.

If this log(N) approach is taken, it's often better to merge it into FFT computation itself.
 
@melak47 You awake too?
 
@Rapptz s/ math//
 
SAM
5:00 AM
@Borgleader good one
 
@R.MartinhoFernandes isn't it obvious by now that my sleep schedule is a bit broken? :)
 
@ThePhD owe my eye!
 
@Borgleader Other libraries are rather easy. Math libraries are indeed fucked up.
 
@ThePhD All joking aside: looks good to me!
 
user3010322
@Code-Guru Sorry. x3 I guess I'll just have to wait until I get a better digital camera to share.
 
5:00 AM
@R.MartinhoFernandes unicode is easy?
 
ICU is not GPL.
 
@ThePhD I was able to parse it ;-)
 
@R.MartinhoFernandes This bit-reversal is the reason why FFTs that are specialized for convolution are much faster than generic implementations like FFTW.
Convolution doesn't need to look at the fucked up order frequency domain. So there's no need to fix the order. (i.e. bit-reversed copy)
@R.MartinhoFernandes Why do you need an ifft? Doesn't FFTW provide one?
 
FFTW is GPL.
 
@R.MartinhoFernandes My point is, I'm sure there are non trivial non-math libraries that could use a non-gpl counterpart
 
5:04 AM
I need it for IDCT.
 
@R.MartinhoFernandes oh
 
@Borgleader Yeah but I think they have an alternative probably.
Math actually doesn't
There was I think TTMath which was BSD but it was only Big Integer I think, which is pretty simple
 
I need it for IDCT which I need for KDE.
 
@Borgleader That said, I have plenty of closed source projects. Mini-Pi is sort of my "gift" to everyone. (if you can even call it that)
 
The stack is getting too big for my taste.
 
5:08 AM
?
 
Stack of things that I cannot implement because I need something else.
 
Hey @Mysticial Why don't you use std::complex?
 
@Rapptz I do. In the unoptimized version.
 
What's wrong with std::complex?
 
is it because it interleaves real and imaginary instead of having two sepearte arrays, float* real,*imaginary?
 
SAM
5:12 AM
@Rapptz Well... its complex :p
 
@Rapptz I use it in the unoptimized version. But not in the SSE version because there's no guarantee that complex<double> is the same size as __m128d.
 
user3010322
Arf.
 
TMI :D
 
user3010322
@Mysticial Sorry.
 
5:13 AM
@ThePhD wutttttttttttttttttt
 
@ThePhD :)
 
relevant
 
Hm
sizeof(std::complex<double>) returns 16
The standard guarantees some things
If z is an lvalue expression of type cv std::complex<T> then:
— the expression reinterpret_cast<cv T(&)[2]>(z) shall be well-formed,
— reinterpret_cast<cv T(&)[2]>(z)[0] shall designate the real part of z, and
— reinterpret_cast<cv T(&)[2]>(z)[1] shall designate the imaginary part of z.
Moreover, if a is an expression of type cv std::complex<T>* and the expression a[i] is well-defined
for an integer expression i, then:
— reinterpret_cast<cv T*>(a)[2*i] shall designate the real part of a[i], and
 
user3010322
Yeah, but it's still size-agnostic, it seems.
 
user3010322
T could be anything. =[
 
5:17 AM
It's meant to be usable just like an array of floats.
@ThePhD What.
 
@ThePhD @Mysticial specifically said complex<double> so T is double.
 
user3010322
And T could be any size, too.
 
@ThePhD It's unspecified for types that aren't double, float, or long double
 
complex<bool> ? :)
 
user3010322
@Borgleader double isn't guaranteed to be 64 bits, is it?
 
5:18 AM
o.O
 
@Mysticial Seems it has all the guarantees you would need.
 
@Rapptz Oh ok. Didn't know it actually guaranteed that. In which case it would be a valid change to the program.
 
The effect of instantiating the template complex for any type other than float, double, or long double is unspecified.
 
I thought C++ stuck to IEEE754 when it comes to floats?
 
user3010322
Make sure to static_assert( sizeof(double) == 8, "Woof!" ); so it works properly with __m128d
 
5:21 AM
No need.
It has no padding.
 
user3010322
I thought double just had to be at least 64 bits?
 
user3010322
Can't it be more on certain platforms?
 
Not in platforms where __m128d exists.
 
user3010322
Mmm. This is true.
 
lol
 
5:23 AM
There's no point in supporting other platforms when you are requiring this one.
 
__m128d is so old school now. lol :)
 
Any Haskel regex-perts online?
 
Effects: inserts the complex number x onto the stream o as if it were implemented as follows:
template<class T, class charT, class traits>
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& o, const complex<T>& x) {
basic_ostringstream<charT, traits> s;
s.flags(o.flags());
s.imbue(o.getloc());
s.precision(o.precision());
s << ’(’ << x.real() << "," << x.imag() << ’)’;
return o << s.str();
}
but... why
am I missing something?
 
why would they make a stringstream?
Why not write to the stream directly
 
5:29 AM
Atomicity.
 
user3010322
What does that do for the meaning?
 
@ThePhD It inserts the output as one indivisible unit into the stream.
 
user3010322
@R.MartinhoFernandes Oh, so failures are a result of a single operation, rather than several failed herpderps?
 
I pass a reference to an objects in a vector as an argument like my_func(&my_vec[0])
should that not work for some reason?
 
user3010322
5:34 AM
That's a pointer.
 
user3010322
A reference is just my_vec[0]
 
user3010322
 
SAM
^ wut?
 
5:36 AM
as far as I understand what the reference says
 
user3010322
Yaay!
 
user3010322
I finished all of problem 1!
 
user3010322
And it only took me 2 hours.
 
I'm so glad I finished school... I just wish I had a job
 
SAM
@ThePhD Which problem?
 
5:37 AM
passing a pointer to an element in a vector is fine
thanks :)
 
SAM
@VitaliusKuchalskis But reference would be more elegant
 
Any bit twiddling for reversing bits?
 
@R.MartinhoFernandes yes
 
b = (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;
Weird.
 
yeah, but i want to change that element in a function
if i would pass a reference
the functions would receive a copy
AFAIK
 
5:39 AM
@R.MartinhoFernandes The more straight forward way is to go a logarithmic number of mask/shifts.
 
But I've never tested it to see if it's faster than that trick you found.
 
Oh.
I know how to turn your BigFloat functions to take one parameter now
 
@Rapptz Putting the precision into the object?
 
Yes
I'm not sure why that didn't occur to me last year
 
5:44 AM
Boost multi-precision does that too.
When I was first designing y-cruncher, I thought about doing that as well. But I realized that I needed absolute control over the precision. So I left it as a parameter.
And it also avoids the problem of precision conflicts when your operands have different precisions.
 
How so?
Just take the highest precision by default
 
@Rapptz But that might not be what you want.
So you could override it.
 
I guess
 
But I felt that keeping the precision explicit was less prone to errors.
Since precision is one of the things that have screwed me over in unusual and weird ways.
Normally, you just "spam" maximum precision everywhere. But that doesn't work too well if you care about performance.
 
user3010322
Why am I bleeding everywhere. ;~;
 
user3010322
5:48 AM
What the hell, did I get chewed on by a dog while I was sleeping or something?
 
Are you on your period?
 
user3010322
@Rapptz You're so mean. D:
 
Mini-Pi does actually do maximum precision spamming. It doesn't try to do the fancy shit that I do in y-cruncher.
 
@ThePhD Says the guy who revoked my repo viewing privileges!
 
user3010322
@Rapptz What repo viewing privileges?!
 
user3010322
5:49 AM
I don't own any of your repos. u.u
 
Your repos
 
user3010322
The only one was Furrovine, and that was because the code was terrible. :C
 
user3010322
It's not like you needed to see it. It wasn't even a good example. :c
 
user3010322
Pluuuuus,
 
user3010322
if you really wanted to see it, IIRC @Borgleader made a copy of the repo and pulled it onto his HDD, so it's forever frozen in time on his stuff.
 
5:51 AM
@ThePhD How goes the rest of that HW?
 
Keep making those excuses buddy!
 
user3010322
@Code-Guru Defining an NFA for a language L = { ... 1101 }, E = { 0, 1 }
 
user3010322
@Rapptz They're not excuses! :c
 
@ThePhD I deleted it after your revoked my viewing privileges. I figured if you didn't want me to have access to a repo, I should also get rid of my local copy.
 
user3010322
@Borgleader Oh. Uh. Well that was nice of you I guess.
 
user3010322
5:52 AM
You didn't have to?
 
@ThePhD What's the "..."?
all binary strings up to 1101?
 
user3010322
@Code-Guru "Any number of symbols, ending in 1101"
 
user3010322
I don't know the symbol for "bunch of crap"
 
oic
.*
or just *
 
[01]*
 
5:53 AM
even better
 
user3010322
Oh okay. I'll just erase all the ... and replace with [01]*
 
user3010322
@Rapptz Do you really want to see it? :c
 
that would be faster than typing your smart ass comments =p
 
I just think it's RUDE. >:(
 
user3010322
But wwwhhhhyyy?
 
5:55 AM
3
Q: Indices of all matches of a regex

Code-GuruI am trying to match all the occurrences of a regex and get the indices as a result. The example from Real World Haskell says I can do string =~ regex :: [(Int, Int)] However, this is broken since the regex library has been updated since the publication of RWH. (See All matches of regex in Has...

Where's the haskellers when you need them?
 
All 11 of them are asleep
 
user3010322
Xeo, R.MartinhoFernandes, Rapptz, rightfold, BartekBaneschewiz, CatPlusPlus, and I think also LucDanton do Haskell.
 

« first day (1209 days earlier)      last day (3722 days later) »