Skip to content

Instantly share code, notes, and snippets.

@physikerwelt
physikerwelt / f(x)=1+x\sin x^{2}.xml
Last active August 29, 2015 13:56
MathML of f(x)=1+x\sin x^{2}
<math xref="p1.1.m1.1.cmml" xml:id="p1.1.m1.1" display="inline" alttext="{\displaystyle f(x)=1+x\sin x^{2}}" class="ltx_Math" id="p1.1.m1" xmlns="http://www.w3.org/1998/Math/MathML">
<semantics xref="p1.1.m1.1.cmml" xml:id="p1.1.m1.1a">
<mrow xref="p1.1.m1.1.12.cmml" xml:id="p1.1.m1.1.12">
<mrow xref="p1.1.m1.1.12.1.cmml" xml:id="p1.1.m1.1.12.1">
<mi xref="p1.1.m1.1.1.cmml" xml:id="p1.1.m1.1.1">f</mi>
<mo xref="p1.1.m1.1.12.1.1.cmml" xml:id="p1.1.m1.1.12.1.1">&InvisibleTimes;</mo>
<mrow xref="p1.1.m1.1.3.cmml" xml:id="p1.1.m1.1.3">
<mo xref="p1.1.m1.1.3.cmml" xml:id="p1.1.m1.1.3a">(</mo>
<mi xref="p1.1.m1.1.3.cmml" xml:id="p1.1.m1.1.3b">x</mi>
<mo xref="p1.1.m1.1.3.cmml" xml:id="p1.1.m1.1.3c">)</mo>
<?xml version="1.0"?>
<mws:query xmlns:mws="http://search.mathweb.org/ns" xmlns:m="http://www.w3.org/1998/Math/MathML" limitmin="0" answsize="30">
<mws:expr>
<m:apply xml:id="p1.1.m1.1.4.cmml" xref="p1.1.m1.1.4">
<m:sin xml:id="p1.1.m1.1.1.cmml" xref="p1.1.m1.1.1"/>
<m:apply xml:id="p1.1.m1.1.4.1.cmml" xref="p1.1.m1.1.4.1">
<m:csymbol cd="ambiguous" xml:id="p1.1.m1.1.4.1.1.cmml">superscript</m:csymbol>
<mws:qvar>x</mws:qvar>
<m:cn type="integer" xml:id="p1.1.m1.1.3.1.cmml" xref="p1.1.m1.1.3.1">2</m:cn>
</m:apply>
xquery declare default element namespace "http://www.w3.org/1998/Math/MathML";
for $m in db2-fn:xmlcolumn("math.math_mathml") return
for $x in $m//*:apply
[*[1]/name() ='sin'
and *[2]/name() ='apply'
and *[2][*[1]/name() ='csymbol'
and *[1][./text() = 'superscript']
and *[3]/name() ='cn'
and *[3][./text() = '2']]]
where
<a xmlns="http://www.w3.org/1998/Math/MathML" href="http://demo.formulasearchengine.com/index.php?curid=252#math0" alt="f(x)=1+x\sin x^{2}">
<expr xmlns="" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:mws="http://search.mathweb.org/ns" url="252#math0">
<math xmlns="http://www.w3.org/1998/Math/MathML" id="p1.1.m1" class="ltx_Math" alttext="f(x)=1+x\sin x^{2}" xml:id="p1.1.m1.1" display="inline" xref="p1.1.m1.1.cmml">
<semantics xml:id="p1.1.m1.1a" xref="p1.1.m1.1.cmml">
<mrow xml:id="p1.1.m1.1.12" xref="p1.1.m1.1.12.cmml">
<mrow xml:id="p1.1.m1.1.12.1" xref="p1.1.m1.1.12.1.cmml">
<mi xml:id="p1.1.m1.1.1" xref="p1.1.m1.1.1.cmml">f</mi>
<mo xml:id="p1.1.m1.1.12.1.1" xref="p1.1.m1.1.12.1.1.cmml">⁢</mo>
<mrow xml:id="p1.1.m1.1.3" xref="p1.1.m1.1.3.cmml">
<mo xml:id="p1.1.m1.1.3a" xref="p1.1.m1.1.3.cmml">(</mo>
$ curl -d 'format=xhtml&whatsin=math&whatsout=math&pmml&cmml&nodefaultresources&preload=LaTeX.pool&preload=article.cls&preload=amsmath.sty&preload=amsthm.sty&preload=amstext.sty&preload=amssymb.sty&preload=eucal.sty&preload=%5Bdvipsnames%5Dxcolor.sty&preload=url.sty&preload=hyperref.sty&preload=%5Bids%5Dlatexml.sty&preload=DLMFmath.sty&tex=literal:%5Csin+x%5E2' gw125.iu.xsede.org:8888
{"status_code":3,"status":"Initialization failed.","result":null,"log":"
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/eTeX.pool.ltxml... 0.01 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/pdfTeX.pool.ltxml... 0.01 sec) 0.37 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/LaTeX.pool.ltxml... 0.33 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/article.cls.ltxml... 0.04 sec)
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/amsmath.sty.ltxml...
(Loading /usr/local/share/perl/5.18.2/LaTeXML/Package/amsbsy.sty.ltxm
@physikerwelt
physikerwelt / gist:3de91b173b94f1cd8546
Created July 1, 2014 11:51
php phpunit.php --tap --testsuite extensions
TAP version 13
ok 1 - MathCoverageTest::testCoverage with data set #0 ('e^{i \\pi} + 1 = 0\\,\\!', '<img class="mwe-math-fallback-png-inline tex" alt="e^{i \\pi} + 1 = 0\\,\\!" src="/images/math/9/e/9/9e9a547076c6820b95e439dd1a5d6a32.png" />')
ok 2 - MathCoverageTest::testCoverage with data set #1 ('e^{i \\pi} + 1 = 0\\,\\!', '<img class="mwe-math-fallback-png-inline tex" alt="e^{i \\pi} + 1 = 0\\,\\!" src="/images/math/9/e/9/9e9a547076c6820b95e439dd1a5d6a32.png" />')
ok 3 - MathCoverageTest::testCoverage with data set #2 ('\\definecolor{red}{RGB}{255,0,0}\\pagecolor{red}e^{i \\pi} + 1 = 0\\,\\!', '<img class="mwe-math-fallback-png-inline tex" alt="\\definecolor{red}{RGB}{255,0,0}\\pagecolor{red}e^{i \\pi} + 1 = 0\\,\\!" src="/images/math/6/7/a/67aca9e0de80ac6ab651ed1097b49fe2.png" />')
ok 4 - MathCoverageTest::testCoverage with data set #3 ('\\text{abc}', '<img class="mwe-math-fallback-png-inline tex" alt="\\text{abc}" src="/images/math/4/6/0/46045b1f6fa9dc10a3112ba360d4d9d7.png" />')
ok 5 - MathCoverageTes
sudo apt-get install npm -y && npm install jsdom
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
erubis libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontenc1
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libice6 libllvm3.4
libpciaccess0 libpixman-1-0 libsm6 libtxc-dxtn-s2tc0 libx11-xcb1 libxaw7
libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1
libxcomposite1 libxdamage1 libxfixes3 libxfont1 libxkbfile1 libxmu6
ould not parse configuration file: Certificate names must be lower case; see #1168
^[[0;32mInfo: Sleeping for 0 seconds (splay is enabled)^[[0m
^[[0;32mInfo: Retrieving plugin^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/physicalcorecount.rb^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/apt.rb^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/root_home.rb^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/default_gateway.rb^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb^[[0m
^[[0;32mInfo: Loading facts in /var/lib/puppet/lib/facter/meminbytes.rb^[[0m
@physikerwelt
physikerwelt / a_mml.xml
Created August 5, 2014 22:04
minimal LaTeXML $a$
<math xmlns="http://www.w3.org/1998/Math/MathML" id="p1.1.m1" class="ltx_Math" alttext="{\displaystyle a}" xml:id="p1.1.m1.1" xref="p1.1.m1.1.cmml">
<semantics xml:id="p1.1.m1.1a" xref="p1.1.m1.1.cmml">
<mi xml:id="p1.1.m1.1.1" xref="p1.1.m1.1.1.cmml">a</mi>
<annotation-xml encoding="MathML-Content" xml:id="p1.1.m1.1.cmml" xref="p1.1.m1.1">
<ci xml:id="p1.1.m1.1.1.cmml" xref="p1.1.m1.1.1">a</ci>
</annotation-xml>
<annotation encoding="application/x-tex" xml:id="p1.1.m1.1b" xref="p1.1.m1.1.cmml">{\displaystyle a}</annotation>
<annotation encoding="SemanticTeX" >a</annotation>
</semantics>
</math>
[INFO] Compiling 35 source files to /mnt/mathosphere2/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /mnt/mathosphere2/src/main/java/de/tuberlin/dima/schubotz/fse/MainProgram.java: Some input files use unchecked or unsafe operations.
[WARNING] /mnt/mathosphere2/src/main/java/de/tuberlin/dima/schubotz/fse/MainProgram.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :