« first day (1717 days earlier)      last day (2764 days later) » 

1:29 AM
@Szabolcs Well Mathematica is no help at automatically giving me some intuition lol
2 Pi*Integrate[
   Sqrt[1 - t^2] Sqrt[D[t, t]^2 + D[Sqrt[1 - t^2], t]^2], {t, a, b},
   Assumptions -> b < 1 && a > 0 && b > a] == 2 Pi (b - a)
I don't have any suggestions yet beyond the straight forward visualization of showing that they form two different rectangles when unwrapped and that by shading different sections of the rectangles you can show they are the same area.
 
1:59 AM
Well I guess the unintuitive part is that the extra area from the curve of the sphere as opposed to the straight edge of a cone exactly makes up for the reduction in area from the decreasing radius. And I guess it's unintuitive because if you try to think about doing the transformation with paper it wrinkles or tears.
 
2:43 AM
@R.M. With the pygments highlighter for Mathematica and pelican, do you have any idea why a > sign should be marked as error, when the rest looks fine?
A minimal example is a>b.
 
3:21 AM
@halirutan In my eagerness to cover all operators, I missed the most common ones — > and < :P
I've fixed this, pushed to master and pypi. The latest version has this + a fix for backslashes in strings :)
 
@R.M. Really? Did not expect that. Thought I made some noob mistake :)
@R.M. I did
sudo -H pip install --upgrade pygments-mathematica
and it seems I'm on version 0.3.3 now.
 
@halirutan Yup, that's the correct version :)
 
@R.M. Is there an easy way to test a>b from the commandline?
(or do I have to clear some cache)
 
@halirutan I don't know about passing input as text from the command line, but if you put a>b in a file, then you can run it from the command line with pygmentize -O full,style=mathematica -f html -l wl -o file.html file.m.
 
@R.M. The thing is I still get the error:
pygmentize -f html test.m
<div class="highlight"><pre><span></span><span class="nv">a</span><span class="err">&gt;</span><span class="nv">b</span><span class="w"></span>
</pre></div>
 
3:37 AM
@halirutan Hmm... I get this:
<div class="highlight"><pre><span></span><span class="nv">a</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="nv">b</span><span class="w"></span>
</pre></div>
I think it might be picking up the wrong version from somewhere
When you install with sudo -H, where does it install to? Do you have python on a different path that takes precedence over this?
 
@R.M. Here:
sudo -H pip install --upgrade pygments-mathematica
Requirement already up-to-date: pygments-mathematica in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: Pygments>=2 in /usr/local/lib/python2.7/dist-packages (from pygments-mathematica)
 
and when you do which python and which pygmentize, what do you get?
 
which pygmentize
/usr/local/bin/pygmentize
(and python is under /usr/bin/python)
 
Hmm... I have a strong feeling that it is picking up the wrong python. Can you put /usr/local/bin/ ahead in your path? The other solutions I can think of involve a virtual environment, but that seems overkill for this
 
@R.M. the pygmentize script calls /usr/bin/python. I'm currently trying to get a formatted text directly in the python interpreter.
But it's almost 6 in the morning. I guess I'll give up soon and try tomorrow.
 
3:54 AM
@halirutan Ah, yep. That's definitely the problem. You can probably hack the script and replace it with /usr/local/bin/python
It probably should be calling /usr/bin/env python anyway, not hardcoding it
 
@R.M. but there is no /usr/local/bin/python :)
It seems only the additional things like pygmentize are installed there.
 
Oh, interesting.
 
@R.M. OK, final question:
I have a token object created with token = pygments.lex("a>b",lexer)
can I somehow iterate through it manually and get a string representation?
(no idea about python whatsoever)
 
from mathematica.lexer import MathematicaLexer

lexer = MathematicaLexer()
list(lexer.get_tokens('a > b'))
This should give you something like this:
 
@R.M. for gods sake..
 
3:59 AM
[
    (Token.Name.Variable, 'a'),
    (Token.Text.Whitespace, ' '),
    (Token.Operator, '>'),
    (Token.Text.Whitespace, ' '),
    (Token.Name.Variable, 'b'),
    (Token.Text.Whitespace, '\n')
]
 
OK, here I get the correct output it seems:
[(Token.Name, u'a'), (Token.Operator, u'>'), (Token.Name, u'b'), (Token.Text.Whitespace, u'\n')]
@R.M. So why I do this with /usr/bin/python and it works and my pygmentize script looks like
#!/usr/bin/python

# -*- coding: utf-8 -*-
import re
import sys

from pygments.cmdline import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
what else could be wrong?
 
@Szabolcs Maybe something like
 
@halirutan This is really weird. It shouldn't behave like this... I'll take a look to see if there are any caches or something, but I don't have an answer right away. Also, your setup is a little different than mine, so not sure if there are some subtleties there...
 
@R.M. I uninstalled pygments-mathematica with pip and it is definitely not there anymore. Still, I can highlight Mathematica code (with the missing > operator)
I guess this is a starting point. Somewhere is another installation.
 
@halirutan Yup, this is my suspicion. Maybe another which pygmentize might reveal something
 
 
5 hours later…
user147238
9:32 AM
Can anyone try evaluating LogPlot[x^x, {x, 1, 5}, Frame -> True] // AbsoluteOptions on 11.0.0 and/or 11.0.1 and tell whether the output is like this or an error window pops up stating that gobject-2-vs12.dll is missing?
 
10:19 AM
@R.M. Finally I got it. Is it possible that you had a different name for the package in the past: `Mathematica-Pygments-Lexer`? That was still installed. Unfortunately, I was on a different track first because I thought it had something to do with the python3 installation.

What python version do you use? It seems that 2.7 is still very popular.
 
 
4 hours later…
2:21 PM
@Xavier I see the ticks messages as described in the linked question and then it prints the options. v11.0.1 Win 10
 
user147238
2:46 PM
@MichaelHale Thanks for checking. I get the error with gobject-2-vs12.dll on both 11.0.0 and 11.0.1, even though I have the library in these two versions. I thought installing them in two different folders would be safe enough, but apparently not. Thanks.
 
user147238
"... installing 11.0.0 and 11.0.1 in two different folders..."
 
3
Q: Mathematica 11 crashes when using Plot[] with Label-option within a GraphicsGrid[]

Tschibistarting with the new Mathematica 11.0.0 version on a Windows 7 machine I ran into a problem I am not able to solve. While using the Plot[] functionality I am able to draw plots with or without a Label: Plot[Sin[x], {x, 0, 1}, PlotLabel -> "Test"] Nevertheless I am not able to integrate this ...

@Xavier Could it be that Mathematica uses some library x.dll which needs gobject-2-vs12.dll, but for some reason on your machine it picks up a different x.dll, not the one it ships with? Just a wild guess.
I'm not on Windows so I cannot try.
@MichaelHale Sorry for the late response, I had to make a drawing. This is the best I have so far:
Take the slice with infinitesimal thickness Δz. The little red triangle is similar to the larger black triangle which has sides R (radius of sphere) and r (radius of circular slide).
The amount of crust this slice has is not 2π r Δz, but 2π Δz r R/r due to the rim (hypotenuse of red triangle) being slanted.
2π Δz r R/r = 2π Δz R is independent of r, i.e. independent of which infinitesimal slice we're taking.
 
3:26 PM
@halirutan Ah, yep! That would do it. So here's what happened: The first version was indeed called Mathematica Pygments Lexer, but it was not available in pypi and you had to install it manually from Github. Later when I set it up to allow pip install, I realized that this name was too long and it was also case sensitive... So I changed it to pygments-mathematica.
You must have installed one of the first versions (thanks for being an early adopter :D). Unfortunately, python packaging, while appearing to be easy for the end user, is a little complicated and messed up under the hood (for developers). I think that the way it installs when you do a manual python setup.py is different from a pip install, so you ended up with two versions in the same distribution and one of them was taking precedence over the other.
@halirutan I use 3.5 or higher for most things these days. 2.7 is still popular among people who 1) refuse to move on 2) don't want to learn some of the syntax and subtle differences between 2.7 and 3.5 3) depend on a library/package that is not supported for python 3 and 4) already have a large existing codebase that would be too expensive to migrate to python 3.
If you are starting out with python, I would highly recommend going with python 3. It is the future and 2.7 has a hard deadline (end-of-life) of 2020...
 
4:27 PM
@Szabolcs I think I misunderstand your statement, (i.stack.imgur.com/7PklL.png)
these areas are not equal
 
4:41 PM
@chuy It's for 3D. Look up "Archimedes' hat-box theorem"
 
5:04 PM
posted on September 30, 2016 by John McGee

Introduction A Mersenne prime is a prime number of the form Mp = 2p – 1, where the exponent p must also be prime. These primes take their name from the French mathematician and religious scholar Marin Mersenne, who produced a list of primes of this form in the first half of the seventeenth century. [...]

 
5:19 PM
@MichaelHale ah got it
 
 
1 hour later…
6:26 PM
@Szabolcs @chuy Another attempt
 
 
1 hour later…
user147238
7:41 PM
@Szabolcs Thanks for the link and the idea. I'll dig in this direction.
 
8:12 PM
Hi all
 
 
2 hours later…
10:07 PM
@chuy These surface areas are equal:
 
 
2 hours later…
11:54 PM
@Szabolcs In projecting from the sphere onto its circumscribed cylinder, the horizontal displacements are scaled by R/r and the (differential) vertical displacements are scaled by r/R. The net effect is that the areas of projected segments are unchanged.
The result of the vertical displacements follows from your figure above, if it's rotated so that Δz is vertical
 

« first day (1717 days earlier)      last day (2764 days later) »