12:23 AM
@ACuriousMind I made it out ;)

1:22 AM
@dmckee @ChrisWhite Either of you around?

Sorta. What's up?

@dmckee Do you know memory bug debugging in C++?

I'm out of practice and might not know your particular environment, but I've done it in the past.
Do you have a leak, or something more concrete?
Can you make it do it on command or does it pop up unexpectedly?

*** Error in ./ackermann.o': double free or corruption (fasttop): 0x0000000000c
as soon as it starts
I know where the bug is
I just don't know why it happens

Know how to run with the debugger?

1:25 AM
@dmckee I know how to run it, just not what to do with it

First question: does the bug occur with the debugger running?
If no, you probably have an uninitialized variable.
If so, then when you get the crash ask the debugger what line it occurs on.

That's not it I think. The bug only happens when I try to clear memory of variables I no longer need. Let me try this into gdb

All those commented out mpz_clearss?

Yep
Even if I use only the first one (that clears m and n) it breaks
are function arguments constants in C?
no right

No, though changes to them are in local execution context only.

1:32 AM
Yeah, so I thought

You don't have a lot of code and aren't calling new/delete (or alloc/free) yourself. SO the problem is likely one of understanding how the library is suppose to work. I've never used GMP so I can't help much.

It doesn't crash on Valgrind .-.
AH
AAAAH

Oh. Uhm. Your m and n are local to main and are loop variables.

Got it :)
you shouldn't call clear in the C++ API

Mmmm. Good. But I'd also think carefully about what you should be doing to those variables; their automatic and shouldn't be delete(free)ed.

1:37 AM
@dmckee Yeah, I'm still getting the hang of C++. It's a funny language

Well, it's built on a C foundation, and C is a very raw language. On 1970s hardware there was very nearly a 1-to-1 correspondence between language constructs and features of the chips.
Since then the chips have gained more features, but C still presents almost the same virtual machine.

C is cool, but I just can't get around to using it more, it's too much work to do simple things at times
and string management is dreadful

A lot of pros don't use the stdlib.h and string.h string interfaces for real projects. They bring in safer and more featureful libraries to manage strings for them.
If you do use them you use getline for IO and always use the n` variants of the string functions.

What I like about C is that it's so kick in the balls
it takes 0 bullshit home
that makes you better

It will teach you discipline or break your spirit in the attempt.

1:46 AM
Lol

@BernardMeurer The core language, and any reasonable library, will always have malloc/new-ish and free/delete-ish commands in pairs. Whenever you use one of the former, immediately write exactly one of the latter.

2:24 AM
Have you guys ever written a toy code to simulate and calculate diffusion coefficients?

2:40 AM
In double slit interference, will we see interference pattern, if we send protons from one slit and neutrons from other?

Why not? They both have a de Broglie wavelength.

@Mikhail In feynmanlectures.caltech.edu/III_01.html , they had problem in identifying which slit did electron came from. If they pass proton from one slit and neutron from 2nd slit, can't problem be solved. They know which slit did particles come from and also they would see interference pattern?

The experiment was done already with nuetrons, indeed it is not clear if there were some stray protons in the group.
The real problem with using protons it that I expect them to anti-bunch due to the charge.

What is anti bunch?
Was experiment tried actually for electrons?

3:29 AM
@ChrisWhite Got it. Thanks for the tip :)

3:49 AM
@AnubhavGoel electron interference is the mechanism for electronic (SEM) image formation. Actually people have been able to interfere larger multi-atom structures.
Also the famous bose-einstein condensation interference

4:14 AM
@JohnRennie hello

Morning
Or I guess it isn't morning in your part of the world :-)

4:53 AM
@JohnRennie Today I learned of a cool way of integrating over a nonorientable Riemannian manifold

I probably don't know enough about the subject to be suitably impressed :-)
When you say integrating over a manifold do you mean an integral like $\int something dx^n$ ?

@JohnRennie Yes.

Why are non-orientable manifolds different from orientable ones in that respect?

@JohnRennie $\mathrm d^nx$ encodes orientation so it's only defined for orientable manifolds.

Aaaaaaaaaaaaah, I get it.

4:57 AM
There's now two solutions to the problem that I know of

I remember last year, I got an A- in physics 'cause the teacher hated me

OK so what do you with a non-orientable manifold?

Said I asked too many questions above the scope of the class

@JohnRennie It turns out you can define a scalar density known as the Riemannian density
In the orientable case it's just the volume form $\sqrt g dx^1\wedge\cdots\wedge dx^n$

Hello, Anyone here worked on VASP ?

4:59 AM
@JohnRennie you basically construct it like this:
you pick a bunch of open sets that cover your manifold, and each one of these open sets is an orientable Riemannian manifold
then you take the volume forms on each of these pieces and glue the whole thing together

@Gowtham I've seen few comments about VASP, but right now is a bad time as most of the site members are asleep. Around 17:00 UTC is the liveliest time.

this isn't really well-defined but it turns out if you integrate it, it is
so you get a density $\mu$ and then you can integrate functions like $f\mapsto\int_M f\mu$.
But there's a really neat way that I learned today

@JohnRennie thanks

The key concept is something called the "cut locus." It's a set of the manifold that basically describes where geodesics fail to minimize length.
The cut locus of a point $p$ is denoted $C(p)$
Now, one can show that (a) $C(p)$ has measure zero in $M$ (b) $M-C(p)$ is homeomorphic to an open ball

5:05 AM
This means that $M-C(p)$ is contractible
By a theorem of topology, any fiber bundle defined on $M-C(p)$ is trivial
In particular, $T(M-C(p))=(M-C(p))\times\Bbb R^n$
By another theorem of topology, this implies that $M-C(p)$ is orientable

$M-C(p)$ is what's left if you snip out the troublesome bits?

@JohnRennie I guess so! I'd have to explicitly calculate it for some nonorientable manifold to be sure!
But it's often said that $C(p)$ carries all topological information of $M$
Oh I forgot
If you give $M$ a Riemannian metric you need a theorem by Nomizu and Ozeki that says there is a complete metric globally conformal to $g$
And we use this conformal metric to calculate $C(p)$
cut locus stuff only works with complete metrics.

So you do the integration on $M-C(p)$ then do some clever trick with the remaining bit?

So, because $C(p)$ has measure zero, $\int_{M-C(p)}\equiv \int_M$
@JohnRennie no, that's the cool part

@0celo7 Aaaaaaaaaaaaahhh (again)

5:10 AM
it's like integrating over $\Bbb R^2$ vs. $\Bbb R^2-\{0\}$
there's no difference

That feels somehow like cheating ....

But on ${M-C(p)}$ you can define an orientation

But I guess it works.

So you just restrict your original metric to this set
and find the volume form
and ta-da you used a bunch of high-powered theorems to define the integral in a really cool way

I'd be cautious about anyone's views on the consequences of Brexit. The truth is that no-one knows what's going to happen.
My guess is that things will change less than we think. It's in everyone's interests to find a compromise solution that keeps things much as they are.

5:50 AM
@JohnRennie I just want to say, there's a certain satisfaction to knowing I've been doing the right thing all along (even if my motivation was really one of laziness).

@ChrisWhite :-)
Soap is dreadful stuff. It destroys cell membranes. You'll hear people say that soap is very good at killing bacteria. Well yes, that's because it's very good at killing everything including your skin cells. The reason it stings when it gets in your eyes is because it's killing the cells in your eyes!

Is that just from its alkalinity? Or is there a more nuanced chemical reason?

Cell membranes are basically surfactant bilayers, where the surfactants are phospholipids. Foreign surfactants disrupt this bilayer structure and rupture the cell membrane, which kills the cell.
Soap is a mixture of sodium salts of carboxylic acids, and these happen to be particularly good at disrupting the phospholipid bilayers.
By contrast sodium lauryl ether sulphate doesn't get into the lipid bilayers so it doesn't damage them. Well, that's not strictly true, but it damages them a lot less.
See, colloid science is just awesome! I can't understand why everyone doesn't want to study it :-)

6:06 AM
::pours another glass of milk::

@JohnRennie Because colloid sounds like something nasty
"Yeah he couldn't stop seizing so he got his colloids removed"