Export beamer slides to powerpoint/openoffice-impress/keynote editable format

Question: I usually prepare my talks using powerpoint/openoffice-impress/keynote, where I explaing programs, pseudocodes, etc. Recently I was thinking about creating text-only, code-only and pseudocode-only slides with beamer and then exporting them somehow to powerpoint where I modify them to add figures or some minor details for polishing the presentation, which are usually hard to do with beamer. I googled a bit around and found that beamer can export to PDF or PS but not to powerpoint. I wonder anyway if you know some possibility of conversion from beamer to on-screen editable powerpoint/openoffice-impress/keynote.
Comment: "beamer can export to PDF or PS", beamer doesn't export anything. It is a LaTeX class and LaTeX compiles the document to PDF (`pdflatex`) or DVI (`latex`) which then is mostly converted to PS. There is of course no `powerpointlatex`, so you will need to convert the PDF or PS somehow to a format PP can read, which would be RTF (Rich Text Format) or some Windows vector format like EMF or WMF. However, I would do it either with one or the other software. They do not mix well.
Comment: I think this is a great question. Of course beamer exports to PDF or PostScript, BUT I have an idea. What if we could use the (xe)latex code to produce slides with the nice beamer header/footer and then use those slides as a kind of template for a presentation in openoffice, keynote, or powerpoint. This means: easy formatting of presentation structure using (xe)latex (with TOC and slide guides in header/footer), plus ability to add media content to slides (for example videos). I do not know how to do this, but if I find out, I will post an answer!
Comment: In short: probably not. [Pandoc](http://johnmacfarlane.net/pandoc/) supports `.tex` to `.doc` translation, but converting to `.ppt` would be significantly harder and almost certainly _very_ ugly.
Comment: Similar question on different sites: ■ [ms office - Converting PDF to Powerpoint, importing each slide as a singular picture - Ask Different](https://apple.stackexchange.com/q/366417) ■ [libreoffice - Is there any tool to convert pdf to ppt/odp slides in Linux/ Ubuntu offline? - Ask Ubuntu](https://askubuntu.com/q/797836) ■ [microsoft powerpoint - How to convert PDF to PPT or ODP? - Super User](https://superuser.com/q/268244) ■ [conversion - Export beamer slides to powerpoint/openoffice-impress/keynote editable format - TeX - LaTeX Stack Exchange](https://tex.stackexchange.com/q/21986)
Comment: @Martin Since this question has no real answer other than your comment, maybe you should turn your comment into an answer.
Comment: @AlanMunn: done
Comment: See also here: http://tex.stackexchange.com/questions/61140/beamer-generated-slides-to-ppt
Answer: "beamer can export to PDF or PS", beamer doesn't export anything. It is a LaTeX class and LaTeX compiles the document to PDF (pdflatex) or DVI (latex) which then is mostly converted to PS. There is of course no powerpointlatex, so you will need to convert the PDF or PS somehow to a format PP can read, which would be RTF (Rich Text Format) or some Windows vector format like EMF or WMF. However, I would do it either with one or the other software. They do not mix well.
Answer: I have a partial solution for exporting beamer slides to PowerPoint
Purpose: If you want to create your background, header, and footer in (Xe)Latex, like this:

but you still would like to edit the content in PowerPoint (or whatever you have), you could use this solution.
For this you will need a Mac with OS X (Automator and AppleScript needed). I followed the following procedure:

Compile Beamer Slides to PDF
Use Automator to each page of PDF into separate PDF Files

Use AppleScript to add each separate PDF file into an individual slide (see below NOTE: original code from http://macscripter.net/viewtopic.php?pid=152809#p152809)

tell application "Finder"
     set picFolder to every file in folder (choose folder)
     log (count picFolder)
     sort picFolder by name end
tell

tell application "Microsoft PowerPoint"
--activate
    make new slide at end of active presentation with properties {layout:slide layout blank}
    set numberofslides to (count of slides of active presentation) as integer     >         set theIncrementValue to 1 as integer
    repeat numberofslides times
         set picName to item theIncrementValue of picFolder as string         >              set properties of slide theIncrementValue of active presentation to {layout:slide layout text slide, follow master background:true}
     set myPic to make new picture at slide theIncrementValue of active presentation with properties {file name:(picName as text), top:0, left position:0, height:540, width:722,lock aspect ratio:true, save with document:true} --makes pictures full sized
         z order myPic z order position send shape to back--tip from Ben Waldie
         set theIncrementValue to theIncrementValue + 1
  end repeat
end tell

UPDATE 2: Ben Waldie helped me move the picture (beamer slides/individual pdf "images") to the back, such that the beamer slides do not cover an text boxes in Powerpoint.
Practical Usage: Create your presentation in Powerpoint, using text-only slides (titles in your tex code) or title-text slides (titles not included in tex code). You will have to coordinate the orientation of these text fields and your pdf slides, such that it is aesthetically pleasing. In your TeX editor, add the number of frames you have in powerpoint.

My original post (which is most likely obsolete):
I have a possible solution for you:
PDF-to-Powerpoint
It is not free, $12.95 at the moment. This should do what you want. I will continue to seek an open-source alternative. I would really like to be able to have latex generated templates for my Keynote presentations. I especially want the ability to have something like the following picture, except I would want to use it as a template background for my slides in Keynote. All bullet points, pictures, and videos would be added from within Keynote. In essence, Xe(LateX) becomes just a template creator. Have a look, paying attention to what I call the "slide guide" in the header:
Answer: Here (https://github.com/martinGithub/beamer2pptx) is a small python script that extracts elements of the beamer using regular expressions, creates an image for each equation and generates a powerpoint with the same number of slides with the equations and the images. It does not keep the layout, but it can help as a first step before reediting the exported presentation in powerpoint.
Comment: Duplicate answer here https://tex.stackexchange.com/a/301117/13173
Answer: Here some free solutions for Beamer to PPT/Impress conversion - after testing a lot of things (Python scripts, pandoc, conversion to HTML or RTF before PPT, etc.):

From PDF with LibreOffice (referred to hereafter as "LibreOffice method"): best finish but less easy to edit.
From '.tex' with pandoc (referred to hereafter as  "Pandoc method"): workable but less finish.
NON editable from PDF (one image per slide, so exact match with the PDF):

Use pdf2pptx.
OR follow this workflow (see user202729's answer for an "automated inline" workflow and much more details):

First, convert your PDF to image (one image per slide) with (i)  GhostScript, OR (ii) imagemagick, OR (iii) a free PDF Viewer Software (e.g. Adobe Acrobat, PDF-Xchange Viewer, etc.).
Second, insert the images in PowerPoint with Insert->PhotoAlbum OR in LibreOffice Impress with the Photo album Plugin (also decribed here).

It is also possible to insert the "images slides" as background with LibreOffice in order to be not directly "clickable" (see Carlos' answer).

Content

Solutions comparison
LibreOffice method
2.1. Approach No. 1: One step command line
2.2. Approach No. 2: Manual method
2.3. Results
2.4. Issues
Pandoc method
3.1. Method description
3.2. Results
3.3. Issues and workarounds
3.4. Results with improved code for PPT conversion
'.tex' example code
4.1. Code for the fisrt example (§2.3. & §3.2.)
4.2. Adapted code for better Pandoc conversion (§3.4.)
Additional materials to generate the custom-reference.pptx template
Other solutions & Related posts

1. Method comparison

Method
Pro
Cons

LibreOffice
Good template conversion
The navigation symbols on foot right corner are not removed

Full automation from '.tex' to 'PPT'
Not full automation from '.tex' to 'PPTX'

Fully Editable
'PPT' file editable with one text box for each line and each character in equation which could be cumbersome if someone wants to really "work" with the PPT

Some equation are not well converted

Pandoc
Full automation from 'tex' to 'PPTX'
No perfect template conversion (but perfectible thanks to  customizable template)

Fully editable and easy to work with
No glossary

Biblio OK
No customizable display of references

Quite good equation conversion
No TOC

Some workarounds could be find in the '.tex' code to improve the conversion (thus, this method is more flexible than the LibreOffice method)

NON editable from PDF (one image/slide)
Exact match with the PDF (no font difference, conversion issues, etc.)
Non editable

2. LibreOffice method
This method uses soffice (as mentioned by user202729) and makes it possible to obtain a relatively faithful conversion (quite good template conversion) and fully editable (but not very practical to really work on the PPT, see §1. above and §2.4. below).
Completely automatable - form '.tex' to 'PPT' - on linux or on a Windows Subsystem for Linux (WSL) and probably on Windows.
This method is declined in two approaches:
1. Inline method (one step from PDF to PPT).
2. Manual method (several steps). For each step, the corresponding inline command is also given (when possible).
Two approaches (One result):
2.1. Approach 1: One step command line
One step method from PDF to PPT on Linux terminal (thanks to this ask.libreoffice.org answer):
soffice --infilter=impress_pdf_import --convert-to ppt filetoconvert.pdf for PPT conversion
soffice --infilter=impress_pdf_import --convert-to odp filetoconvert.pdf for impress conversion
After, open with Power Point software in order to convert from PPT into PPTX if needed...
2.2. Approach 2: : Manual method

First, open the PDF with LibreOffice Impress and save it in ODG format (LibreOffice Draw) because Impress will actually redirect to Draw after opening the PDF...
On Linux terminal: libreoffice --headless --convert-to odg filetoconvert.pdf

OR force Impress to open the PDF by selecting this file type in the open file screen Ctrl-o: "PDF – Portable Document Format (Impress) (*.pdf)" details here. Then, you can skip step no. 2 below.

Second, convert the Draw (ODG) file to an LibreOffice Impress (ODP) file (only possible with unoconv command line). On Linux terminal: unoconv -f odp filetoconvert.odg

Third, open the ODP file with OpenOffice Impress (and not LibreOffice Impress) and do "Save As" in "Power Point 97-2003" format. On Linux terminal (thanks to this answer): soffice --infilter=impress8 --convert-to ppt filetoconvert.odp

Fourth, open with Power Point software in order to convert from PPT into PPTX if needed

2.3. Results
With this Beamer "generated" PDF:

It gives the following PPT:

Note that some slides look relatively the same as the PDF.
2.4. Issues

The navigation symbols on foot right corner are not removed.
Gradation of blues not well converted in the header.
TOC bullet not well converted.
Equations not well converted (square root, sum) and a lot of brackets () are missing (e.g. after abs function).
Extra space after \verb command sometimes.
Table vertical lines not perfectly vertical.
Here a picture showing the text boxes in the PPT (one text box for each line and each character/string in equation). Note that not all the text boxes are selected in the picture below, just some of them to give an idea:

3. Pandoc method
As mentioned by Psychonaut and Seamus in comment, pandoc can be used for '.tex' to DOCX/PPTX conversion with the recent possibility of using a customized DOCX/PPTX template.
3.1. Method description

First, generate a template file (called custom-reference.pptx in this example) with (also works with DOCX, see details here):

pandoc --print-default-data-file reference.docx > custom-reference.docx

Second customize your template manually by open it with PowerPoint software. You can change a lot of things like slide size, color theme and also header and footer with the "Slide Master" view (be careful in some MSOffice version you can have bad conversion of picture you put in the header and/or footer with the "Slide Master" view. A workaround is to insert the pictures into "shapes": a rectangle for example, by filling it with the picture you want).

Third, convert your '.tex' file (called main.tex in this example) into PPTX with Pandoc (as you can see, you can specify a bibliography file with --bibliography=mybib.bib):

pandoc main.tex --reference-doc=custom-reference.pptx --bibliography=mybib.bib --pdf-engine=lualatex -o main.pptx
The conversion is far from prefect (strange behavior of section title, equations, pictures, no glossary) but the PPT is fully editable and more practicable to work with than with the LibreOffice method and it's more possible to find a workaround in the '.tex' code when something is not well converted.
3.2. Result
With the same Beamer example presented in section 2.3. (see '.tex' code in section 4.1.), one can obtain the following PPT.
Note that you need to create the image called "example-image.png" because pandoc will not find it (as LaTex does) from graphicx package. Also, you need to modify the custom-reference.pptx template (with the Slide Master view) in order to get the same PPT as below: create the appropriate shapes in the "Title Slide", change the header/footer picture on background (see §6. giving picture of header/footer in order to reproduce the output given here) and also the size of the font in text boxes - set to '12+'' in the example below on "Title and Content Slides" or 28 and 20 for title and subtitle in the "Title Slide":

Note that reference citations and footnote are quite well converted as well as equations, gls command, verbatim, table, picture and also "simple" SIunitx commands.
3.3. Issues and workarounds
Section §4.2. will present an improved code tacking into account some of the workarounds shown below in order to obtain a better pandoc conversion.

Issue
Workaround(s)

No TOC displayed and no "TOC" title on header

Frametitle title alone on separated slide or on top of slide (see Equations slide)
(i) Redefine frame enviroment to ignore the title argument OR (ii) Use \frametitle command and redefine it to display nothing

No "progression bullet coloration" on header

Citation display modified

Table caption apears on bottom

No figure side by side with subfigure but on different slide (and the next slide has no title)

No tikzpicture display
(i) Use Lua filter OR (ii) pandocfilters OR (iii) First convert the tikzpicture to image see standalone package and include it as a picture with \includestandalone. Second, redefine the \includestandalone to become the \includegraphics command

Figure size changed

No glossary (but gls command works)

Ref. Bib. list style modified

Footnotes at the end of the document (but hyperlink works)

3.4. Result with adapted MWE

4. '.tex' example code
4.1. Code for the first example (§2.3. & §3.2.)
\documentclass{beamer}
\usetheme{Warsaw}% Theme of the presentation
\useoutertheme{miniframes}% Display the contents in header in minimal form
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{verbatim}
\usepackage{standalone}
\usepackage{biblatex}
\addbibresource{mybib.bib}% File containing the bibliographies entries
\usepackage{glossaries}
\makenoidxglossaries

\newglossaryentry{LATEX}
{
    name={\LaTeX},
    description={LaTeX is to a book what a set of blueprints is to a building \cite{Dul13}}
}

\title[A short title]{A  very very very very long title to see if some text overlaping occrus when converting this \gls{LATEX} Beamer file.}
\subtitle{This is a PDF test for Beamer to PPT conversion}
\author{Me}
\date{\today}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}{TOC}
    \tableofcontents
\end{frame}

\section{Equations}
\begin{frame}[fragile]{Equations}\small
         \begin{subequations}
            \begin{align}
                {ErrIm}(i) =  \frac{abs \left( Im_{Ny_1}(i) - Im_{Ny_2}(i) \right)}{\frac{ max \left( abs \left( Im_{Ny_1} \right) \right) + max \left( abs \left( Im_{Ny_2} \right) \right) }{2}} \times 100 \\
                S =  \sqrt{\frac{1}{N-1}\sum_{i=1}^{N} \lvert  A(i) - \mu \rvert ^2}
            \end{align}
            \end{subequations}
        Two inline math expression (\verb§$e=mc^2$§ ; \verb§$\lambda_g=2$§)\footnote{\textit{verb} is well converted!} $e=mc^2$ ; $\lambda_g=\num{2}$ inserted into some text.

        A citation (\verb§\cite{Dul13}§): \cite{Dul13}.

        Two SI unitx quantity (\verb§\SI{0}{\degreeCelsius}§ ; \verb§\SI{1}{\kilogram}§): \SI{0}{\degreeCelsius} ; \SI{1}{\kilogram}.
\end{frame}

\section{Table}
\begin{frame}{Table}
     \begin{table}
        \caption{A table caption.}
        \begin{tabular}{|c|c|}
            \hline
            01A&01B\\02A&02B\\03A&03B\\04A&04B\\05A&05B\\
            \hline
        \end{tabular}
     \end{table}
\end{frame}

\section{Picture \& Tikzpicture}
\begin{frame}{Picture \& Tikzpicture}
    \begin{figure}
    \begin{subfigure}{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{example-image.png}
        \caption{A figure caption.}
    \end{subfigure}
    \begin{subfigure}{0.45\textwidth}
        \centering
        \begin{tikzpicture}[scale=0.7]
            \node[draw] at (0,0)  (Nod1) {A node};%
            \node[draw] at (2,2)  (Nod2) {Another node};%
            \draw (Nod1) -- (Nod2);%
        \end{tikzpicture}
        \includestandalone{GenerateTikzpictureImage}
        \caption{A tikz picture caption.}
    \end{subfigure}
    \end{figure}
\end{frame}

\begin{frame}{Glossary}
    \printnoidxglossary[title=Glossary]
\end{frame}

\begin{frame}{Bib}
    \frametitle{Bibliographic References}
    \printbibliography[title=Bib,heading=bibnumbered]
\end{frame}

\end{document}

4.2. Adapted code for better Pandoc conversion (§3.4.).
There is two differences between the original code example presented in §4.1.:

The file 'myPandocConversionPreambule.tex' is loaded in preambule. Note that the code in this file is not written for standard LaTeX compilation (with pdfLaTeX, LuaLaTeX, XeLaTeX, etc.) but only for pandoc conversion.
The file 'myPandocConversionPreambule.tex' does two things:

Redefine the frame environement in order to not use the frametitle argument to avoid the display of the frametitle at the beginning of each slides (see Issues in §3.3.).
Redefine the \includestandalone to \includegraphics command in order to include the previously genereted tikzpicture as an image because pandoc doesn't directly convert Tikzpicture (see Issues in §3.3.).

The tikzpicture is now generated by an external '.tex' file called GenerateTikzpictureImage. Thus, the tikzpicture is now inserted with \includestandalone{GenerateTikzpictureImage} (which will be redefine as \includegraphics by 'myPandocConversionPreambule.tex' - only for pandoc conversion). This file needs to be compiled once before pandoc conversion in order to convert the tikzpicture into a png image.

\documentclass{beamer}
\usetheme{Warsaw}% Theme of the presentation
\useoutertheme{miniframes}% Display the contents in header in minimal form
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{verbatim}
\usepackage{standalone}
\usepackage{biblatex}
\addbibresource{mybib.bib}% File containing the bibliographies entries
\usepackage{glossaries}
\makenoidxglossaries

\newglossaryentry{LATEX}
{
    name={\LaTeX},
    description={LaTeX is to a book what a set of blueprints is to a building \cite{Dul13}}
}

\title[A short title]{A  very very very very long title to see if some text overlapping occurs when converting this \gls{LATEX} Beamer file.}
\subtitle{This is a PDF test for Beamer to PPT conversion}
\author{Me}
\date{\today}

\begin{filecontents*}{myPandocConversionPreambule.tex}
    % Redefine frame env in order to not use the frametitle argument
    \let\oldFrame\frame
    \let\endOldFrame\endframe
    \renewenvironment{frame}[1][]
    {\oldFrame}
    {\endOldFrame}

    % Redefine the `\includestandalone` to become the `\includegraphics` command in order to include the previously generated Tikzpicture as an image
    \renewcommand{\includestandalone}[1]{\includegraphics[width=\textwidth]{#1.png}}
\end{filecontents*}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}{TOC}
    \tableofcontents
\end{frame}

\section{Equations}
\begin{frame}[fragile]{Equations}\small
         \begin{subequations}
            \begin{align}
                {ErrIm}(i) =  \frac{abs \left( Im_{Ny_1}(i) - Im_{Ny_2}(i) \right)}{\frac{ max \left( abs \left( Im_{Ny_1} \right) \right) + max \left( abs \left( Im_{Ny_2} \right) \right) }{2}} \times 100 \\
                S =  \sqrt{\frac{1}{N-1}\sum_{i=1}^{N} \lvert  A(i) - \mu \rvert ^2}
            \end{align}
            \end{subequations}
        Two inline math expression (\verb§$e=mc^2$§ ; \verb§$\lambda_g=2$§)\footnote{\textit{verb} is well converted!} $e=mc^2$ ; $\lambda_g=\num{2}$ inserted into some text.

        A citation (\verb§\cite{Dul13}§): \cite{Dul13}.

        Two SI unitx quantity (\verb§\SI{0}{\degreeCelsius}§ ; \verb§\SI{1}{\kilogram}§): \SI{0}{\degreeCelsius} ; \SI{1}{\kilogram}.
\end{frame}

\section{Table}
\begin{frame}{Table}
     \begin{table}
        \caption{A table caption.}
        \begin{tabular}{|c|c|}
            \hline
            01A&01B\\02A&02B\\03A&03B\\04A&04B\\05A&05B\\
            \hline
        \end{tabular}
     \end{table}
\end{frame}

\section{Picture \& Tikzpicture}
\begin{frame}{Picture \& Tikzpicture}
    \begin{figure}
    \begin{subfigure}{0.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{example-image.png}
        \caption{A figure caption.}
    \end{subfigure}
    \begin{subfigure}{0.45\textwidth}
        \centering
    % The Tikzfigure is generated with a separated 'tex' standalone text file and included here:
        \includestandalone{GenerateTikzpictureImage}
        \caption{A tikz picture caption.}
    \end{subfigure}
    \end{figure}
\end{frame}

\begin{frame}{Glossary}
    \printnoidxglossary[title=Glossary]
\end{frame}

\begin{frame}{Bib}
    \frametitle{Bibliographic References}
    \printbibliography[title=Bib,heading=bibnumbered]
\end{frame}

\end{document}

The content of the GenerateTikzpictureImage '.tex' file:
\documentclass[convert]{standalone}% Need the -shell-escape compiler option
\usepackage{tikz}

\begin{document}
    \begin{tikzpicture}[scale=0.7]
        \node[draw] at (0,0)  (Nod1) {A node};%
        \node[draw] at (2,2)  (Nod2) {Another node};%
        \draw (Nod1) -- (Nod2);%
    \end{tikzpicture}
\end{document}

5. Additional materials to generate the custom-reference.pptx template
Below the header/footer background that you can use in the "Slide Master View" of PowerPoint software in order to reproduce the examples given above:

"Title Slide":

Below the example-image from the graphicx package:

6. Other solutions & Related posts
The following table summarize some solutions for Beamer/PDF to PowerPoint (some links thanks to user202729's comment).
Legend : PP = PowerPoint
TBD = To be determined

#
Source
Conversion
Editable
Automatable
Insight
Question Link

1
bloodworks' answer
'.tex'->PPT
Partially (text)
No
use htlatex to extract text and imagemagick to convert the PDF (without text) into image and faithfuler insert it to PP.
Beamer-Generated slides to PPT? [duplicate]

2
philosodad's answer
PDF->PPT
Yes
No
with LibreOffice (manually with the software GUI): same result as LibreOffice method (§2).
//

3
Martin's answer (duplicate of Martin's answer here)
'.tex'->PPT
Partially (text)
Yes
use a "small python script", result partially editable (text), equations as images, no layout conservation.
//

4
ArTourter's comment
PDF->MSWord
TBD
TBD
with "Adobe Acrobat Standard (or above)".
//

5
AJN's comment
PDF->PPT
No
TBD
first convert your PDF in image files (with imagemagick for e.g.) and use the Insert->PhotoAlbum of PP, (apparently not available on MacOS PP) more details here (also possible with LibreOffice Impress as mentioned by Jos in comment: Insert->Image->Photo Album - more details here).
Convert beamer presentation to (non-editable) powerpoint [closed]

6
Matthew Leingang's answer
PDF->PPT
No
No
use PDF2Keynote and after Keynote to save as PP (pgfpages is used to deal with custom margin).
How should I convert my beamer slides to PowerPoint according to these odd specifications?

7
Steve Rindsberg's answer
'.tex'->PPT
Partially (text)
No
first convert the '.tex' file into "ascii text" and after import it with PP.
Export beamer slides to powerpoint editable format [closed] (stackoverflow)

8=5
rindPHI's answer
PDF->PPT
No
TBD
use GhostScript to convert the PDF into images and then insert the images into OpenOffice/LibreOffice (with the Photo Album plugin Insert->Image->Photo Album - details also here).
How to convert PDF to PPT or ODP? (superuser)

9
BBlake's answer
PDF->PPT
No
TBD
mention several online converters from PDF to PPT. For e.g. PDFPowerpoint which permit to convert a PDF without login in (thanks to Josir's comment)
//

10=5
Greg Ramey's answer
PDF->PPT
No
TBD
use use imagemagick (options given by macieksk's comment to obtain good image resolution/quality) to convert the PDF and after insert the images into Impress (with the Photo Album plugin Insert->Image->Photo Album).
Is there any tool to convert pdf to ppt/odp slides in Linux/ Ubuntu offline? (askubuntu)

11
Digger's answer
PDF->PPT
Yes
TBD
uses directly LibreOffice Impress to open the PDF and force Impress to not redirect to LibreOffice Draw when opening the PDF (from here).
//

12=5
hanxue's answer
PDF->PPT
No
TBD
use first imagemagick (or GhostScript) and use the Insert->PhotoAlbum of PP (apparently not available on MacOS as mentionned by hanxue's comment).
Converting PDF to Powerpoint, importing each slide as a singular picture (apple.stackexchange)

13
Teddy van Jerry's comment
PDF->PPT
No
Yes
"the beamer [PDF] is converted to high-quality images"
Produce a pptx or keynote file from a beamer presentation [duplicate]

Related

converting LaTex pdf into a powerpoint [duplicate] but NO solution proposed.
Comment: This answer has been set to *Community wiki* in order to be easily editable. So, please don't hesitate to improve it, for e.g. add other methods, add issues and associated workarrounds, improve the pro/cons table, improve the english ;), etc.
Answer: One mornign I was bored, and I wrote a small script named pdf2oo. The obtained presentation is not editable (but it is obviously overlayable) and the worse, it's bitmap. Today, it would be possible to add vector graphics easily using svg, but I never found the motivation to do that. It's open source software so you could consider modifying the script to your needs or improving it.
http://pdf2oo.sourceforge.net
Answer: PDF to Keynote does exactly this.  (At least for Keynote)
http://www.cs.hmc.edu/~oneill/freesoftware/pdftokeynote.html
And it's free!
Comment: I use this all the time (for Keynote's presenter mode), but it should be pointed out that the result is not editable. One can, of course, add additional Keynote elements, but each page of the pdf is simply place into Keynote as a full-slide image. It looks great though.
Answer: This answer essentially embed each PDF page as a PowerPoint image (similar in spirit to the pdf2oo answer).
convert -density 200 input.pdf tmp.pdf
soffice --infilter=impress_pdf_import --convert-to pptx tmp.pdf

Assuming original file is input.pdf this will generate tmp.pptx. The second line is taken from https://tex.stackexchange.com/a/633247/250119.
Unfortunately, this does not make the text editable (for my purpose it isn't necessary. Technically it's still "editable" in the sense that you can add new text box on top of it and/or delete certain parts), but the advantage is that there's no imprecision (misplaced formula, missing font ⟹ text get broken at wrong places, etc.) issues.

To convert it to vector graphic instead (warning: the generated file loads extremely slowly) you can do:
gs -o tmp.pdf -dNoOutputFonts -sDEVICE=pdfwrite input.pdf
soffice --infilter=impress_pdf_import --convert-to pptx tmp.pdf

Use method from https://tex.stackexchange.com/a/561693/250119 to convert all fonts into "paths" before converting to PowerPoint.
Assuming original file is input.pdf this will generate tmp.pptx.

Remark: Using svg appears difficult. I tried
using python-pptx but from the discussion it appears that inserting svg into pptx is difficult https://stackoverflow.com/questions/71046000/python-to-powerpoint-export-svg-to-a-pptx-file / https://github.com/scanny/python-pptx/issues/394
Answer: Since Beamer's output is a PDF, there are several free online PDF-to-PPT converters out there. I have just used Adobe's:
https://www.adobe.com/acrobat/online/pdf-to-ppt.html
and I have finally made it. Good luck!
Comment: The Adobe web tool worked well for me. Just for completeness (and in case someone is concerned about converting slides online), it's worth noting that Adobe Acrobat Pro has an Export To -> Microsoft PowerPoint Presentation menu option that seems to work just as well as the web option and the files remain local to your computer.
Comment: Note that this option will change the font of text in the slides as well as possibly introduce some imprecision issues.
Answer: The solutions from previous answers didn't work for me, either because they can't produce editable presentations, or because they're not available for my operating system, or because they choke on certain LaTeX markup.  For cases where I just need to extract the presentation text, and maybe preserve some very basic formatting (bold, italic, quotations, bulleted lists, etc.), I've found the least-worst solution is to use Pandoc and then manually post-edit the output.  This still saves considerable time over manually retyping the entire presentation.
While Pandoc doesn't do a good job when converting Beamer LaTeX documents directly to a presentation format such as PPTX, it does work fairly well when converting them to OpenDocument text (ODT) documents:
pandoc my_presentation.tex -o my_presentation.odt

The resulting file can be opened in a word processor, and the contents can be copied and pasted into individual slides of a presentation.
Answer: On Windows 10, I first used Adobe Acrobat to convert the .pdf to images, and then used LibreOffice to merge the images into a .pptx as backgrounds. This method produced visually identical results to the original slides, but the text could not be edited directly. The advangages of the method is that you can easily add common components of PowerPoint such as gifs and shapes.

Open the .pdf file by Adobe Acrobat. Edit the text here (Once converted into images, the text cannot be modified). Select File → Export To → Image → PNG. Click the setting and choose a resolution as large as you like, e.g. 600 pixels/inch. Save these .png images into a directory.

In LibreOffice, click File → New → Presentation to create an empty presentation. Then click Tool → Marco → Organize Marco → Basic → New to create a new marco. Fill in the marco with the following code (see details in Fill the background of a presentation file with pics via commandline), where the number of loops  and the path of .png images in Test1 should be modified accordingly.

Sub InsertSlideWithBackgroundImage(imageFilePath)
    imageFileURL = ConvertToURL(imageFilePath)
    oDoc = ThisComponent
    oBackground = oDoc.createInstance("com.sun.star.drawing.Background")
    oBitmaps = ThisComponent.createInstance( "com.sun.star.drawing.BitmapTable")
    iBitmap = 1
    Do
        sBitmapName = "bk" & iBitmap
        iBitmap = iBitmap + 1
    Loop Until Not oBitmaps.hasByName(sBitmapName)
    oBitmaps.insertByName(sBitmapName, imageFileURL)
    oBackground.FillStyle = com.sun.star.drawing.FillStyle.BITMAP
    oBackground.FillBitmap = oBitmaps.getByName(sBitmapName)
    oBackground.FillBitmapMode =  com.sun.star.drawing.BitmapMode.STRETCH
    oSlideList = oDoc.getDrawPages()
    oSlide = oSlideList.insertNewByIndex(oSlideList.Count)
    oSlide.Background = oBackground
End Sub

Sub Test1
    For i = 1 To 20
        If i< 10 Then
            Call InsertSlideWithBackgroundImage("D:/temp/slides_Page_0" & i &  ".png")
        Else
            Call InsertSlideWithBackgroundImage("D:/temp/slides_Page_" & i &  ".png")
        End If
    Next
End Sub

Run the marco Test1. Save the resulting file as .pptx.Then you get an identical but uneditable powerpoint.
Comment: @SylvainRigal In the final output `pptx`, there are no objects to choose from, the images are presented as backgrounds.
Comment: Thanks for sharing but I don't fully understand what this solution provide at the end: a pptx with an image on each slide?


Translated text on multiple national level domains

Question: I am a bit confused about multilingual websites and SEO and would be grateful if somebody could explain me how they are ranked at the moment.
For example, my company's website domain is "problemsolver.com". I sell a range of products and one of them, for example, simplifies cow milking a lot.
In order to increase sales for this particular product I started working on SEO and one of the SEO specialists advised me to create a landing page specifically for that product. This guy will provide me a few SEO-optimized articles about my product, cows, milking, etc. Also
we identified that one of the best search phrases to optimize for would be "efficient cow milker".
Since the product is pretty niche I don't expect to receive many incoming links (if any at all). So my SEO strategy is based purely on the available content.
Since I'm going to create a separate landing page, I need a new domain name. My personal favorite is "efficient-cow-milker.com" because it is very explicit and easy to remember.
But will it bring me additional ranking points? This answer says no, this answer (refers to https://moz.com/search-ranking-factors) states the opposite.
UPDATE: this newer article states that full keywords match has very little effect at best BUT keyword in the subdomain helps ranking
Now the problem is that my product is sold in multiple non-English speaking regions where people don't google "red cow milker" but rather something like "effizienter Kuhmelker". Therefore all the content must be translated and SEO-optimized for each region separately.
Taking into account these facts, what do you think about:

Multiple regional domain names like "efficient-cow-milker.com", "effizienter-kuhmelker.de" and "mungitrice-efficiente.it"? I read here that regional domains are better for targeting and people open regional websites more often. Also in my case domain names are easy to remember and fully match relevant search phrases. Will it help ranking?
Won't google ban my regional domains? As I said, content will be translated and optimized, so technically each website is a copy of an English version. I could introduce some uniqueness for each text translation but not for graphics. Should I bother or Google won't notice duplication?
if all of the landing pages with similar content are hosted on the same IP address, won't it be recognized as something bad and penalized? Or is it the opposite: Google sees multiple websites with similar content but in different languages on the same IP and doesn't penalize them?
should I link all of the landing pages between each other or better not to?
Answer: I wouldnt do it. From my experience, exact match of keyword in domain name doesnt worth it. It does work, yes, but from my perspective it is more reasonable in your case to create multi language site.


How to deal with oil and water mix when pumping oil from ocean in new Tekkit

Question: When pumping oil out at sea in the new Minecraft Tekkit, how can you deal with the mixture of water and oil that you get? Is there a way to "sort" them?
Comment: for what it's worth there is a liquid router available in feed the beast, dunno about tekkit.
Comment: @Ender, there is! add it as an answer and I'll accept it. Much cleaner solution :)
Answer: There are a few methods to dealing with ocean oil:

the first (although ugliest) is to simply put make 2 tanks, a water
tank and oil tank. since liquid can only occupy one tank at a time,
it will sort itself out(just empty the water tanks often)
Another(much better) method of seperating the water and oil involves building a wall of gravel/sand. Use a Lily Pad to drop sand/gravel AROUND the 1x1 main oil spout, cutting off the water. This method is perhaps best for oil deposits at sea
if you have access do it you can also use Water Strainers to separate oil from water. just slap one along the main pipeline. it'll even generate some EU for you in the process (this method also leaves a giant hole in the ocean though, so careful)
Comment: http://minecraft.wikia.com/wiki/Lily_Pad
Comment: The Lily Pad is just something you can stand on and place the blocks of sand/gravel next to it so they fall. I cant really get a picture but I'll try to explain it in detail: you place the Lily pad 2 blocks away from the oil source block, then you shift+walk to the edge of it, finally you place gravel on the outer edge of the lily pad(the side) so the gravel is on the inner part, one away from the source and falls down. repeat this for all sides of the oil (diagonally as well)
Comment: Ah! so the Lily Pads themselves didn't have anything to do with it. It's just a way to do it that doesn't involve horizontal nerd poles from the coast to be able to place the blocks. Makes sense :)
Comment: What is a Lily Pad?
Comment: I think I'll have to ask for a picture of what you mean, cause I'm not sure I'm understand what I should do with that Lily Pad, haha. Could you supply a demonstration picture?
Answer: The Minefactory Reloaded mod has a Liquid Router that does exactly what your asking for.

The Liquid Router acts as a filter for liquids. It has six input/output faces, each with a set color: purple for the top face, blue for the north, yellow for the east, green for the south, red for the west, and black for the bottom face. It has a simple GUI with six colored slots for each of the faces; adding a liquid to any of these slots will set the router to filter that liquid to the corresponding input/output face. The Liquid Router is compatible with Buildcraft Waterproof Pipes and Thermal Expansion Liquiducts; however, it does not work with Redpower Fluid Pipes.
Answer: I would suggest using a water strainer, as they are pretty inexpensive, and destroy the water whilst keeping the oil. To use one, you should just be able to pump the water and oil into it and it just puts out oil. See the tekkit classic wiki for more info.
Comment: Welcome to Arqade. You may not have noticed but one of the existing answers already suggests using a water strainer. Please try not to add answers which make points which have already been made before.


Why can't I parent two bones together?

Question: I am trying to parent two bones together on the human body I made. For some reason, on 2.77, no matter what parent option I use, the bottom abdomen bone and the upper leg bone wont "connect" (as much as they can when it comes to parenting). I'm using this video to learn how to rig, but what it tells me to do doesn't match up with what is happening on my screen. Any suggestions, tips, or option changes I don't know about?   Blender Rigging 1/2
Comment: Please show some screenshots of what you are trying to do. With respect, people aren't going to watch a 19 minute video to try and see where you went wrong.
Comment: It's around the time 4:30 to 5:00 in the video. Sorry, I didn't think about that XD
Answer: The linked video shows parenting with an Offset. If you'd like the two bones to actually connect in your own rig, select Connected instead. Better yet, select the bone roots and hit F afterwards, so your original thigh bone stays nice and aligned with the rest of the leg.

Why can't I parent two bones together?


About anti symmetric tensor $B_{ab}$ in gravity

Question: If the symmetric tensor $g_{ab}$ represents the graviton, what particle does the anti symmetric tensor $B_{ab}$ in supergravity represent?
Answer: The antisymmetric tensor field in string theory is a sort of generalized gauge boson. It has no realization in the compactified theory, and decomposes into gauge fields under Kaluza Klein reduction.
However, if you're asking for a nice intuitive understanding of $B_{\mu\nu}$, consider a charged point particle coupled to an electromagnetic field $A_{\mu}$ in the classical theory. The action of the interaction between the point particle and the electromagnetic field is given by
$$S_{I}=q\int_{\Gamma} A_{\mu}\,\mathrm{d}x^{\mu}=q\int_{\Gamma}A,$$
where $\Gamma$ is the world-line of the point-particle. Similarly, in a string theory, we can couple a string to a two-form field as
$$S_{I}=q\int_{\Sigma} B_{\mu\nu}\,\mathrm{d}x^{\mu}\wedge\mathrm{d}x^{\nu}=q\int_{\Sigma}B,$$
where $\Sigma$ is the string world-sheet. Thus, the two-form field plays the same role in the string theory as the electromagnetic field plays in the classical point-particle theory.
I hope this helps!
Comment: Definitely helps, but why is it there in the first place? What is the source of a B field? The interaction indicates it to the presence of some "charge" in the string. So, does this represent some kind of new charge?


Cant enter recovery mode Galaxy Tab S 8.4

Question: I have an issue on my device (Galaxy Tab S 8.4). I´m either stuck on boot loop (flashed with TWRP that worked fine for months until recently after a restart) or I can enter download mode and get stuck at the "Download... Do not turn off target!"-screen. Cant ever enter recovery no matter how I try... If I let the battery die it boots up into the boot loop as soon as I plug in the power chord. Is my device bricked or whats going on?
Comment: It is late to answer the question but for others: in download mode you can connect tablet to pc via usb cable and use samsung kies (windows app) to flash stock rom. And probably problem will solve.
Answer: I had the same exact problem. I flashed a Marshmallow ROM from KitKat, not realizing I had to update the bootloader to Lollipop. I got stuck and couldn't get past the boot screen and when I used pwr+vol dwn+home I got the Download...Do not turn off target msg. What worked for me was to plug in my Tab to my pc, start up Odin 3.09 (not sure if the version matters, I didn't try 3.12) and I was able to flash the Lollipop boot loader. The Tab restarted and I was good to go. Hope that helps
Answer: Not enough data in question - and not enough rep to ask with comment, do you try to enter recovery by holding volume up + home + power? (You mentioned just letting battery die, which is not going to help any good). You mentioned You can enter download (vol down + home + power) so I'm guessing you know about recovery too.
If You cannot enter recovery even holding proper combination You need to flash just recovery.img, preferably checked and working with your model.
Comment: Thanks for the fast answer! Problem is that when I enter Download mode I get stuck at "Download... Do not turn off target!" and cant any further. In the boot loop I can only get into download mode. Have tried getting in to recovery mode with volume up + home + power but I cant get it to work. Tried it when Im stuck in download mode and tried it when I´m stuck at the boot loop.
Comment: Yes, but how about recovery mode (You enter recovery same as download, from device turned off, just different keys)? If You tried that from powered off, and failed then its basically reflashing recovery.img in download mode, from PC.
Comment: I cant turn off my device at all, thats why I tried to let the battery die out to see if it fixed it (which it didnt). The only time I get into the download mode is when the device is stuck at TWRP-logo. Entering download mode -> stuck at "Download... Do not turn off target!"-screen. From there I can only reboot normally (power + vol down + vol up). Can not go into recovery mode from there either...
Comment: You can use a better trick to power it off. Plug charger,  hold power key ~10 seconds, wait for battery charging img, unplug charger. It should be  off. But since You are sure that You  cannot enter recovery there is not much to do,  first You need to be sure that kernel (boot.img) is flashed correctly, and then recovery.img. You might unpack Your ROM and flash those two separately.
Comment: As soon as I plug the charger (even when the battery is empty) the device boots up and get stuck at the TWRP-screen... Doesnt help that I hold the power button.
Comment: @JakobStrand, consider incorporating your comments into the question because users who may be interested to answer would need that info.
Answer: I have exactly the same problem Jakob has described.
The Tab S is stuck in in a boot loop. The power off button has no affect.  Vol Up + Home + Power has no affect,  Vol Down + Home+ Power reboots straight into the boot loop.
The hope was that letting the battery drain to power off, then charge to try Vol Up + Home + Power ( as this should be done when the device is already power off).
The action of charging sends the device back into the TWRP boot loop.
The Tab S had been working great with CM12.1 for many months. But after a factory reset, which I did in order to be able to gift this to someone else, has resulted in this situation.


Bitcoin not reaching Recipient

Question: I would like to find out if its possible for a Bitcoin recipient not to receive a payment while on my side(Sender) it shows that the payment was successful? See print screen of payment below, the payment was done more than 36 hours ago.
Comment: Either the payment went through or it did not. Are you sure that 1Pnw... is the correct address? Did you click the verify on blockchain.info button?
Answer: Have a look at https://blockchain.info/address/1PnwbcQPfWwBPayBvvpcVwK6NjuEmubQTB?sort=0 to check if your payment is on it.

Bitcoin not reaching Recipient


TVS diode Clamping voltage

Question: How to choose TVS diode?
What's clamping voltage?
If in case TVS diodes clamping voltage 57V if anything more than 57V what will happen to diode and circuit?
Would it break? Or pass the voltage?
Answer:
How to choose TVS diode?
  The threat characteristics must be understood and the needs of the circuit to be protected must be understood.

If the circuit can only cope with 5.5V and the threat potential is 1500V then the upstream protection must ensure no more than 5.5V is presented to the circuit.

Packet shaping
By means of Resistors, Capacitors, Inductors... aspects of the strike waveform are attenuated to limit what the downstream circuitry is presented with
Clamping.
Using TVS, Gas discharge tubes or MOV's the energy is dissipated in these devices to protect downstream circuitry.
Combination of above.

What's clamping voltage?

The voltage at which the TVS will clamp at. TVS's generally have a minimum breakdown, maximum breakdown and a maximum clamping voltage. These are all current dependent so the specific clamping voltage is dependent on what is being presented to the TVS (source impedance, clamping voltage etc...)

If in case TVS diodes clamping voltage 57V if anything more than 57V
  what will happen to diode and circuit?

The voltage at the cathode will be held at some voltage between minimum breakdown and maximum clamping. The interaction of the source impedance and this voltage determines the resultant clamping voltage.

Would it break? Or pass the voltage?

Well... IF the source impedance is such that the pulse current is below the maximum stated then it will clamp the voltage at the maximum clamping voltage. If the source impedance permits more current to flow OR the duration is longer then the power dissipating capability then the TVS will break. They tend to fail open-ciruit due to the power blowing them off the card.
In short. Understand the threat characteristics (double-exponental, source impedance etc...), understand your circuit (can normal operation cope with slewed signals) and finally run the calculations on the dissipation needs of the TVS to ensure it is suitable
Answer: Assume the normal voltage range through your wire is max 57 V (maybe a bit more for some headroom). Than you should use a diode with a clamping voltage just above that. If you chose it too high (e.g. 80 V), than signals from upto 80 V will pass through the wire without any problem, causing damage maybe, if you chose it too low, 57 V signals will not pass.
If higher voltages goes through the diode, it will not break, but it will pass a lower voltage (probably upto the clamping voltage).
So chose the value of the TVS just above the maximum expected voltage.

TVS diode Clamping voltage


Is there a word for "the colonised"?

Question: I'm searching for words that encompass the group of people who were subjugated and/or colonised. Words like "slave" don't really fit what I'm searching for because they're not broad enough. So is "the colonised" the best way I can describe this group of people, is there a single collective term like "colonisers" but for people at the other end of the stick?
Comment: 1) Is there a reason you don't want to use "colonized"? 2) You'll get better answers if you tell a bit more about what meanings you want to encompass or exclude.
Answer:
I'm searching for words that encompass the group of people who were subjugated and/or colonised.

For those who found themselves colonised, the usual adjective is indigenous, which is not used as a noun.
Merriam Webster:

indigenous adjective

b: of or relating to the earliest known inhabitants of a place and especially of a place that was colonized by a now-dominant group
// Indigenous peoples.

OED:

indigenous, adj.

a. Born or produced naturally in a land or region; native or belonging naturally to (the soil, region, etc.). (Used primarily of aboriginal inhabitants or natural products.)

2013 "Trans-Colonial Urban Space in Palestine: Politics and and Development" Maha Samman.  However, settlement colonies themselves were three types that differed in use of labour forces; the first included importing workers to displace indigenous population.
Comment: Although the forces of colonization almost always impact indigenous peoples, this might narrow the meaning in ways that are undesired. For instance, a very broad discussion of colonization might even include modern "gentrification" of neighborhoods, in which incoming demographics displace longtime residents and aggressively redefine the culture of the area. Although the "colonized" existing demographics were in a sense "there first," "indigenous" could be a misleading or inapplicable term. Personally, I don't see what's wrong with "colonized"...
Comment: @AndyBonner I think the only thing going against 'the colonized' is that it is not common. It doesn't -sound- like the single word that should fit for 'original inhabitants'. 'The colonized', while grammatically well formed and  having all the right sememes, just sounds weird, like it's obvious what it means but do people actually use it? The very formal term that is actually used is 'autochthonous' (adj) or 'autochthon' (noun), but that has it's own problems (like hyper erudition and how do you even spell that?)
Comment: @AndyBonner, while I can agree in the wider sense with your idea of gentrification, I am responding to *I'm searching for words that encompass the group of people who were subjugated and/or colonised.*
Comment: @Mitch I guess my point is that "single word that should fit for 'original inhabitants'" is an assumption, not present in the OP question. Colonization is a broader topic.
Comment: @Mitch When it comes to sounding weird—I mean, by parallel with "colonizer" we *could* say "colonizee"... but I sure don't want to!
Comment: I rejected "colonial" as the general nuance is one of the group who colonise, although specifically it means anyone in a colony.
Comment: @Greybeard I think your answer stands well, Andy and I are just exploring the tangent on just the word 'colonized'...yes, this would be better as a comment chain on a possible answer by Andy.
Comment: @AndyBonner While there may be nuances, if the context of colonization is already established, I think "indigenous" fits the need pretty well.

Is there a word for "the colonised"?


Calculate the probability that at least one random variable in one set greater than all random variables in another set

Question: I have two sets of random variables. Denote
$$A=\{X_1,...,X_m\}$$
and
$$B=\{X_{m+1},...,X_{m+n}\}$$
All random variables are independent and take values in $(0,\infty)$. We know the probability that
$$Pr(X_i>X_j)=p_{ij},\ j\neq i$$
How to find the probability that at least one of $X_1,...,X_m$ is greater than all of $X_{m+1},...,X_{m+n}$?
Answer: Let event
$$E_k=\{X_k>\max_{i\neq k}X_i\},\ k=1,...,m$$
It's easy to observe that $E_k,\ k=1,...,m$ are mutually exclusive. Therefore, we have
\begin{align}
&Pr(At\ least\ one\ of\ X_1,...,X_m\ is\ greater\ than\ all\ of\ X_{m+1},...,X_{m+n})\\
=&Pr\left(\bigcup_{k=1}^mE_k\right)\\
=&\sum_{k=1}^mPr(E_k)
\end{align}
Since all random variables are independent, we have
$$Pr(E_k)=\prod_{i\neq k}p_{ki}$$
Therefore, we have
$$Pr(At\ least\ one\ of\ X_1,...,X_m\ is\ greater\ than\ all\ of\ X_{m+1},...,X_{m+n})=\sum_{k=1}^m\prod_{i\neq k}p_{ki}$$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The above method was partially wrong according to the comment. The mistake lies on the calculation of $Pr(E_k)$, which is not simply the product of $p_{kj}$. Actually, the probability to be found not only depends on the probabilities that $X_k$ is greater than $X_j$ for all other $j$'s, but depends on the distributions of the random variables.
Assume that random variables $X_1,...,X_{m+n}$ have CDFs $F_1,...,F_{m+n}$. We may calculate
$$Pr(E_k)=Pr(X_k>X_{(-k,m+n-1)})$$
where $X_{(-k,m+n-1)}$ is the largest order statistic of $X_1,...X_{(k-1)},X_{(k+1)},X_{(m+n)}$, which is independent of $X_k$. Let $F_{(-k,m+n-1)}$ and $f_{(-k,m+n-1)}$ be the CDF and PDF of $X_{(-k,m+n-1)}$, respectively, we have
$$F_{(-k,m+n-1)}(x)=\prod_{j\neq k}^{m+n}F_j(x)$$
and
$$f_{(-k,m+n-1)}(x)=\frac{\partial}{\partial x}\prod_{j\neq k}^{m+n}F_j(x)$$
Then we have
\begin{align}
&Pr(E_k)\\
=&Pr(X_k>X_{(-k,m+n-1)})\\
=&\int_0^{\infty}Pr(X_k>x)f_{(-k,m+n-1)}(x)dx\\
=&\int_0^{\infty}\left[1-F_k(x)\right]\frac{\partial}{\partial x}\prod_{j\neq k}^{m+n}F_j(x)dx\\
=&\left.\left[\left[1-F_k(x)\right]\prod_{j\neq k}^{m+n}F_j(x)\right]\right|_0^{\infty}+\int_0^{\infty}f_k(x)\prod_{j\neq k}^{m+n}F_j(x)dx\\
=&\int_0^{\infty}f_k(x)\prod_{j\neq k}^{m+n}F_j(x)dx
\end{align}
Therefore,
\begin{align}
&Pr(At\ least\ one\ of\ X_1,...,X_m\ is\ greater\ than\ all\ of\ X_{m+1},...,X_{m+n})\\
=&\sum_{k=1}^m\int_0^{\infty}f_k(x)\prod_{j\neq k}^{m+n}F_j(x)dx
\end{align}
Comment: **This argument is incorrect and so is the answer.** The error originates in the "mutually exclusive" claim. As a counterexample, suppose the $X_i$ are continuous iid variables, so that $p_{ij}=1/2$ for all $i\ne j$  Let $m=n-1.$ The only way there cannot be at least one of the first $m$ variables exceeding the last is for the last to be largest, which has a chance of $1/n,$ so the answer should be $1-1/n.$ However, the products in your formula will all equal $2^{1-n}$ so their sum is $(n-1)2^{1-n},$ but for $n\gt 2$ that does not equal the correct value.
Comment: @whuber yes I think your comment is right. However, the mistake may not be "mutually exclusive", but the calculation of $Pr(E_k)$. The multiplication is wrong, since the events are not independent.
Comment: Re your edit: see https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle.
Comment: @whuber Here we have $E_j\cap E_k=\emptyset$ for $j\neq k$.
Comment: Consider a slightly different definition of the $E_j:$ compare them only to the last $n$ variables, as is relevant in this question, and apply the PIE: then you should obtain a correct answer.
Comment: @whuber I'm kind of confused on your points. Could you give an example of outcome that is in both $E_j$ and $E_k$?
Comment: I was trying to lead you in the direction of considering the trivariate (and then the tetravariate, etc) marginal distributions, as demanded by the PIE, because that reveals you don't have enough information to answer the question.
Comment: @whuber Thanks, now I got your point. In the edit, I meant the probability can be decided uniquely if we know their CDF. And we don't have to use PIE.
Answer: The question has no unique answer.  In particular, any putative formula based solely on the $p_{ij}$ cannot be generally correct.
There are two reasons.  The first is that when there is a positive chance of ties among any of the values, the answer will obviously depend on how frequently ties occur. Let's deal with that by assuming there is no chance of ties among the $X_i.$
The second reason is that the pairwise probabilities $\Pr(X_i\gt X_j)$ still don't provide enough information to deduce the full distribution of how the variables are ordered.  A good way to appreciate that fact is to construct a counterexample.  It must exhibit two sets of random variables $X_i$ that (a) have the same values of all the $p_{ij}$ but (b) for which the answers differ.
A simple counterexample uses $m=1$ and $n=2.$ The question asks for the chance that $X_1$ is the largest of the $m+n=3$ variables.  Let $X_1, Y_2,$ and $X_3$ be iid continuous variables symmetrically distributed around $0.$ Pick a number $e$ and define $X_2=eY_2.$ $X_2$ remains symmetrically distributed, implying all the $p_{ij}=1/2$ regardless of the value of $e.$  Two different values of $e$ will provide the counterexample.
Note that since $X_1$ and $X_3$ play equivalent roles in this setup, they have equal chances of being the largest, no matter what value $e$ might have.

First, let $|e|$ be tiny, so that $X_2$ is essentially $0.$  The
chance that $X_2$ will be largest is approximately the chance that
$X_1$ and $X_2$ are simultaneously negative, which (because they
independently have $1/2$ probability of being negative) is
$1/2\times1/2 = 1/4.$ Therefore one of $X_1$ or $X_3$ is largest with
a chance of $(1-1/4),$ implying $X_1$ is largest with a chance
close to $3/8.$
Second, let $|e|$ be huge, so that compared to $X_2$ the other
$X_i$ are essentially $0.$ Evidently $X_2$ will be the largest of the
three variables almost half the time.  Now one of $X_1,$ $X_2$ is largest only
half the time, implying $X_1$ is largest with a chance close to
$1/4.$

Because there are different possible answers for a given set of $p_{ij},$ the problem is indeterminate.


What would be the equivalent C# for this VB.net?

Question: When I create a new empty web application project in VB.net I see the file Application.myapp under My Project.
The same file does not appear in C#. So what does get created in C# project which is equivalent to this file?
Answer: The equivalent of Application.myapp in C# is app.config


How can Ping not use a transport protocol?

Question: I just learned that Ping uses ICMP directly, i.e. it bypasses the transport layer. How is that possible? Shouldn't an application (L5) use UDP or TCP in the transport layer (L4)? The way I know it is that every layer is blind to everything that is 2 layers down, i.e. an application interfaces with L4 using sockets, but is blind to L3 down to L1.
Comment: The OSI model is an abstract that has never been fully implemented as written in any stack, so keep in mind that none of the layers above 2 are actually mandatory. an application at layer 7 can perform tasks at layer 2, or 3, or 4 should it choose. check out my answer here, on how an application uses the Sockets library to setup a connection using sockets function calls that work at differant layers of the stack: https://superuser.com/questions/984182/what-are-the-detailed-osi-model-steps-involved-in-connecting-to-a-website/984253#984253
Answer: When one says "Ping", they refer to ICMP ping, as that is what the original ping is. ICMP actually works on a lower level than the UDP & TCP transport protocols and does not use ports[1]:

ICMP, uses the basic support of IP as if it were a higher    level
protocol, however, ICMP is actually an integral part of IP, and must be implemented by every IP module.

That is mostly because ICMP is used to report errors as IP is not completely reliable on its own. So, ICMP is a lower-level protocol that uses IP, not TCP/UDP. Ping is just a tool that uses ICMP (thanks to low-level C), however, ICMP isn't just ping or traceroute, its main purpose is completely different as I noted.
And I don't know how you've learned that layers are blind for below layers. That is not true, or at least to my knowledge.
Ping can use any protocol it wishes by implementing it in C.
Low-level languages like C have direct access to system IP-based modules, thus it is possible to use any such protocol by using C (and almost any other language written in C nowadays).
To explain more explicitly (tl;dr):
Ping is an ICMP-based tool, it does not use TCP and UDP, thus it doesn't work with ports (as a protocol does not need ports, only services do). It does not require the functionality of higher-level protocols such as TCP, so it doesn't implement them. And despite ping being an application, it works on ICMP and uses no port.
Comment: *Ping can use any protocol it wishes* I think you can additionally explain that when one say "Ping" he means "ICMP Ping".
Comment: Yes, I know, I believe it was actually a misinterpretation coming from my side, I'll edit my answer so as not to imply that.
However, as I've answered, ping's source simply isn't based on tcp or udp, it's based on icmp.
Comment: Thank you for mentioning that @Akina. I've updated my answer accordingly.
Comment: @Fanatique Thank you for the clarification. I did not imply that ICMP was an application level protocol. Perhaps the confusion is about the "it" in the first sentence. By "it bypasses" I mean "Ping bypasses".


What limits physical size of capacitors and inductors becoming really small?

Question: For same capacitance C or same inductance L, one wishes to shirink the physical size of capacitors and inductors (by whatever methods - shrinking down the size of wire, etc.). What limits size becoming small? Planck length limitation is obvious, so I am asking other sources of limitations.
Comment: Breakdown voltage for capacitors and "melt" current for inductors. Also saturation current for inductors (ferrite parts).
Comment: Soldering 0402's is difficult enough!
Comment: I would think the manufacturing process plays a part.
Answer: Physics (among other things)!
If you wish to shrink a capacitor in physical size, while keeping the capacitance the same, some other property has to go up, as in every capacitance the actual dimension does matter for the size of the capacitance. In this case you would need to increase the relative permittivity of the dielectric material. As this is a material constant you cannot increase it arbitrarily.
Another noteworthy effect is that you will have a reduced breakdown voltage, so reducing the size will also lead to a reduced voltage handling capability of the capacitor, which is probably unwanted.
On the side of inductors you have similar effects. Shrinking the wire will lead to increased ohmic resistance of the inductor which is generally unwanted (less optimal inductor). You can see that already if you look up an inductor with same inductance but different sizes.
Small wires will also have a problem with the current they are supposed to carry as there is a limit on the current density a material can handle.
Another major factor is the magnetic saturation of the core, which will also limit how small you can make the core for a given inductance.
There are of course practical things like production and handling to keep in mind and you can probably find some more things which will cause trouble. These came to my mind first. Also note that I saw this from an engineering perspective, if you would choose a very minuscule value for C or L, their sizes could become very very small I guess. If you are looking for limits in those regions, I guess Physics SE would be a better place to ask.
Answer: Inductors and capacitors are defined in a model of nature where matter is continuous. In actuality nature seems to be quantized. Of course the size of the quantization is so small that it essentially appears continuous at our length scale. However, if you were to build a capacitor on the scale of say 1000 atoms or less this quantization would become much more physically significant and the entire theory of capacitors and inductors would totally break down. My understanding is that this puts a lower limit on the size of a classical transistor, and that will ultimately cause an end to Moore's Law (unless we can/have figure(d) out how to make quantum transistors).
Edit: I dunno what I was thinking. We have quantum transistors. They are will simply quantum states of an electron/atom/photon etc. (see qubit). This kind of computing is rather different than classical computing though.


Is there a way to send a music file from Finder to an iPhone's music library?

Question: I have files in, for example, <code>~/Downloads/music</code> that I'd like to have on my iPhone's local music library. Is it possible to do this via Finder or some Terminal command, rather than having to connect a USB cable and use iTunes? Maybe something with Airdrop? Finder also has a "Quick Actions" command if you right-click a file, is there an extension that would do this?
Comment: I'm going to assume you don't want to just scrip moving the file into Music on the mac so the file adds to the library and then syncs. That's the clear easiest way to do this, but I get the feeling you've discarded using Apple to sync the library from mac to iOS. Can you confirm. Also - not at all critical of your question - I kind of went off to a "general observation" about this - lemme know if you'd rather my answer have less about Apple in general.
Answer: There isn't a filesystem based local library on iOS. You will want to put it into Files app and use a different player if you really need to play files from an arbitrary box of files.

Files.app can play most songs without needing an app.

It multitasks and I have some FM radio recordings that are 2-3 hours long and they play amazingly well from Files app. I don't want these in my iTunes library so even though I'm all in with Apple Music and a cloud library - I have some esoteric stuff and audio books, lecture notes, radio performances I choose to store in the filesystem. Files on demand from iCloud works so well for my case I encourage anyone to try that.
Is there a reason why you're using Music app and not syncing the libraries via Apple Music? Same question for using iCloud to sync files same as box.com / Dropbox / google and other file sync options between macOS and iOS.
It's easy to automate moving files on macOS with services, folder actions and more, the problem here is Basically to chose a different player that works with files dumped in a directory as opposed to adding them to a music library that then syncs.
You are among some very smart and sophisticated People that have this understandable misconception about Photos / movies / books / music. Without an insight into how the ecosystem is designed, people revert to dumping files in a folder and hoping the apps read from a filesystem. No judgement, but this is a common request for something Apple design rejected about a decades ago as a sub-optimal experience on the platform. Since then Apple has doubled down time and time again on managed libraries and incremental sync. You don't have to buy in to that, just find apps that buy in to how you like to store your data.
Comment: I often wish I could just add a song here and there directly on the phone, but so far Apple has said no. Oddly enough you can play audio files directly in Dropbox. I tried that. I found that not having music in the iOS music.app resulted in me ignoring the music in Dropbox.
Comment: @SteveChambers I should add - just playing the song from the Files app or from another app is super pleasant if you can't stomach Apple Music. Hey Siri, play whatever still blows my mind. I do that twice a month and I'm listening to a concert I would have paid $65 to see and I get it all for pennies a day. I don't blame anyone for rejecting Apple's design, but recognizing that design unlocks the need to do some work to find other apps that can work from files app sync.


TCP syn attack prevention

Question: I am new to implementing information security. However i am trying to harden a windows server.I am using regedit to create parameters like SynAttackProtect,TcpMaxHalfOpen and TcpMaxHalfOpenRetried and set values to them. But i am not sure if this is a good way to do it. As in i browsed to this location  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpIp\Parameters and manually adding these parameters. Kindly suggest if this is okay
Answer: Completely preventing TCP SYN flood attacks is impossible; the best you can do is to mitigate them.  Those registry settings are a valid option and may help you if you are under a weak or mild SYN flood attack.  They work by simply limiting the duration and amount of half open connections when undergoing the symptoms of a SYN flood.  In other words it makes the server less patient in waiting for the client to complete the three-way handshake (i.e. completing the connection).
Here are a few other common defenses to help mitigate SYN flood attacks:

Increasing the server(s) resources (e.g. adding more memory, or more servers for load balancing)

If filtering IP addresses is an option, this would be the most effective approach.  For example, if you know your website will only be used by a certain IP address range (or geographical location) you could filter the IP addresses that are allowed to connect.  A white-list of IP addresses of known legitimate clients could also be used to give higher priority to those connections.

You could also check out SYN Cookies which is a creative mitigation method that could help as well.

For additional reading on these SYN flood mitigation methods, I suggest reading section 3 of RFC 4987
Hope this helps!
Comment: thanks for the comment. Pls comment about the way i am editing the registry values. is it a good way?
Comment: shiva, your way is fine, but any time you modify anything in the registry, it is always a good idea to back it up first (right click the item and select Export).  The following MSDN link goes into detail about how to change these registry values:  http://msdn.microsoft.com/en-us/library/ee377058%28v=bts.10%29.aspx

TCP syn attack prevention


Image Hosting Azure

Question: I'm creating a website where users will be able to upload various images when creating a new page on my website. What service does Microsoft offer to host many user uploaded images. Would a Blob suffice? If so, if I were to add a CDN, would it be worthwhile? From what I understand, a CDN copies the images on various servers. If my local server has 1 million images, would that mean all the other locations will have 1 million images as well? Would that be very costly?
Answer: Blob storage is the perfect place for images in Azure.
CDN is great for when your images are at least somewhat static and will be viewed more than once.
With CDN you do not pay for storage costs (on the CDN), but instead for transfers out of the CDN - http://azure.microsoft.com/en-us/pricing/details/cdn/
I should also mention that if you're using Azure and Blob storage is your primary facility for storing images, Azure's CDN does not have to be your primary CDN - and any CDN will work.  CDN's are pretty commodity service these days.
HTH
Comment: Sure.  Please mark the response as Answered to let others know that it was helpful
Answer: A CDN on top of Azure storage would be useful if you have lot of users fetching the same file(hot files/Cache hits) Accessing files that are not heavily  used will result in a Cache Miss. The CDN will then fetch the file from the origin (Azure Storage) before delivering it to the user. For such a scenario adding a CDN on top of Azure storage provides very little benefit.

Image Hosting Azure


Is Fury still a Colonel?

Question: Nick Fury holds the military rank of colonel in the original canon of the Marvel universe. In the new Marvel Movie Universe, is Fury still Colonel Fury? I only remember him being referred to as "Director Fury" in the Avengers film.
Comment: It isn't mentioned below that I can see, but in the Captain Marvel movie he says he reached the rank of full blown colenel in the army. After that, presumably he left the military.
Answer: Short Answer: probably not.
Long Answer:
The cinematic version (Earth 199999) of Nick Fury has not had his past fully revealed as of yet. The Earth 616 Fury is the one who is a colonel, having served in WW2.
The Ultimate Nick Fury, whom the cinematic version is largely based on, is a colonel and a war hero, having participated in the Cold and Gulf wars in some capacity.
It's important to remember that S.H.I.E.L.D is not a military division despite having access to equipment and assets otherwise only available to military. The Earth 616 version was originally a law-enforcement version (which might have ranks such as colonels), but has since been updated to being a government agency, which typically do not have those ranks. Similarly, Ultimate SHIELD was a military organization. The Earth 199999 version, however, was founded by Howard Stark and possibly Fury - implying that it has never been a military organization.
Comment: Additional proof toward your assertion: General Ross treats Fury as an equal and goes to his bosses, rather than just ordering him to turn over the things Ross wants.
Comment: General Talbot treats Coulson somewhat differently :)
Answer: In Captain America: Civil War during the ending scene if you observe Fury's grave you will see that "Col. Nicholas J. Fury" is written.
Comment: As seen in Winter Soldier; https://www.reddit.com/r/MovieDetails/comments/72udq6/in_captain_america_the_winter_soldier_2014_nick/
Comment: I took the liberty of adding in a similar picture to the one Valorum referenced. This evidence really takes this answer to the next level.
Answer: My guesstimate is that Colonel was his highest rank before joining S.H.I.E.L.D., and though it is unclear what he was referred to as before becoming its Director, both titles may now be applicable.
In all of the official MCU comics up until at least about the end of Hulk and Iron Man 2, he is almost exclusively referred to as Colonel Fury, even by Coulson:
Comment: That's certainly the case with Nick Fury, Sr. in the comics. But, are you aware of any MCU reference to him as a Colonel? I believe that's what the question asks for.
Comment: Whereas I have not yet encountered that comic, as I'm assuming it is not considered cannon (and frankly that was a pretty dumb joke in Iron Man since they had been around for some time and surely came up with the acronym first, as joked at in Agents of S.H.I.E.L.D.'s 1st episode), the name Colonel Fury comes up in any number of offically canon issues. I've neither encountered any other continuity concerns.
Comment: -MCU Fury, that is. Hah: These down arrows resemble Iron Man 2's chest reactor :p
Comment: -Actually yes, as that's what confused me enough to look this up: In all of the official MCU comics up until at least about the the end of hulk and iron man 2, he is almost exclusively referred to as Colonel Fury, even by Coulson :o![Agent Coulson addresses "Director" Fury ](https://i.stack.imgur.com/s2378.png)
Comment: One of the problems here is that these early tie-in comics had a lot of continuity problems. One of the early Iron Man tie-in comics had a scene where Coulson mentions the name "SHIELD" instead of the longer full name, and Fury says that they'd never thought of using the abbreviated name before. This fits with the gag "we're working on a shorter name" from IM1, but doesn't fit at all when you consider the rest of the MCU history.
Comment: I was just perhaps pleasantly surprised to hear Fury indirectly referred to as "The Colonel" after Cap's shield is discovered during The First Avenger's icy prologue, confirmed on the other end of the call as The Director himself in the final Issue of Fury's Big Week!
Answer: I'm pretty sure that the organization in the movies is not a military organization, and is similar to some of the three-letter agencies in the US. Since his authority is at least as high as a general, I think Director is the best title that fits.

Is Fury still a Colonel?


Does it matter where your shots land in Planetside 2?

Question: I know there is a word for this but I just can't recall. What I'm asking is "is hitting someone on the head going to kill them faster than shooting only their legs/torso (like some games) or is it the same damage wherever I shoot (like some others)?".
Comment: Welcome to the game by the way! Thanks for posting all these questions, they're of good use to others.
Comment: Thanks MapCavalier, cool to know people appreciate it :)
Answer: You mean locational damage/different hitboxes? Headshots definitely do more damage, but I'm not sure about torso/extremities. Tanks also take more damage from behind and the sides.
Comment: Locational damage, yes, that's the word =)
Answer: As the answers are outdated, I think it can be necessary to provide an update for future readers.
Shooting the torso will do normal damages (as you can see in the weapons stats).
Shooting the arms or legs will reduce the damages.
Now when shooting the head, the rules are:

Every standard weapon has a 2x headshot multiplier.
The sniper rifles have a 2.1x headshot multiplier.
Some special weapons break these rules (For example, the Daimyo has a 4x headshot multiplier)
Comment: A discussion about whether code tags are allowed as a stylistic choice has been [moved to chat](https://chat.stackexchange.com/rooms/98852/discussion-on-answer-by-fareanor-does-it-matter-where-your-shots-land-in-planets).
Answer: It depends what kind of weapon you are using. Most infantry weapons do bonus damage when they hit the player's head hit box. Different types of infantry weapons do different amounts of bonus damage.
To my knowledge, none of the weapons on vehicles or aircraft do bonus head shot damage.
I thought this PS2 Weapon Data Sheet has the exact modifier for each weapon, but I can't seem to find it anymore...
From memory (this may have changed or I could be totally wrong)

Sniper rifles do a 2x bonus damage modifier on head shots
Rifles do 1.5x damage modifier
shotguns do 1.25x damage modifier
Mini-Chaingun does no bonus damage.
Comment: @dbemerlin I agree that you can hit a player's head using vehicle weapons. However, I do not think it does any bonus damage. If you can link a source that indicates otherwise, I will change my answer.
Comment: Vehicle weapons ARE able to do headshots. I've done quite a few headshots with my AP Vanguard.
Answer: Yes, headshots do more damage. With the bolt action sniper rifles a headshot is an instant kill (most of the time). You always need to aim for the head. If you get a kill headshot you also gain 10xp more. But there are a few things to note.
Some weapons might have 0% headshot bonusdamage multiplier and others might have 200%.
http://www.planetside-universe.com/news-clarification-on-headshots-2507.htm
Comment: it's quite misleading as it's currently written. A zero multiplier implies that the end result is zero, you don't mention that you're treating headshot damage as additive (is it actually additive in PS2?). It would be clearer as "Some weapons might do no additional damage on a headshot, whilst others might deal as much as 3x normal." Or something like that. 1x - 3x multiplier is easier to understand than 0x - 2x on an additive value that is the same as base value.
Comment: "0% headshot damage multiplier" - you mean they do no damage at all if you hit them in the head? :S
Comment: @Ian No it means it just does normal damage -> 100damage + 100damage * 0/100 is still 100 damage
Comment: That source is pretty outdated. It's a statement by a developer during development, and ends with the disclaimer ***"Exact balance for this is not final, but that's the general idea that we're going with and we'll tweak as necessary."***, so it should be taken with a grain of salt.
Comment: @Philipp The question is does it matter where you hit? And it does for the head....


Detect Mip mapping level in the shader?

Question: Is there a way to do this in pixel shader 2.0/3.0?  I've got on or off transparency so when the mipmapping level is different the transparency can take up too much of the texture and make it invisible.  Or is there a way to manually create the mip maps in XNA 4.0?
Answer: Regarding your Mip selection, I am using a custom texture atlas shader. In my case, the following snippet is accurate enough. You do have to provide it your own texture size.. i.e. you need to know the width X height parameters of the texture you want to "mip". In my case, these are just defines.. If you use dds textures, direct x compatible, they should already have mip levels embedded.
<code>  #define SUB_TEXTURE_SIZE 128.0
  #define SUB_TEXTURE_MIPCOUNT 8

  float MipLevel( float2 uv )
  {
    float2 dx = ddx( uv * SUB_TEXTURE_SIZE );
    float2 dy = ddy( uv * SUB_TEXTURE_SIZE );
    float d = max( dot( dx, dx ), dot( dy, dy ) );

    // Clamp the value to the max mip level counts
    const float rangeClamp = pow(2.0, (SUB_TEXTURE_MIPCOUNT - 1) * 2.0);
    d = clamp(d, 1.0, rangeClamp);

    float mipLevel = 0.5 * log2(d);
    mipLevel = floor(mipLevel);

    return mipLevel;
  }
</code>
Answer: You do have several alternatives which should be sufficient:

Use the mipmap lod bias render states, though this is more or less
deprecated in modern APIs
Manually select the mipmap yourself in the shader with the functions
like tex2dlod.  You could simply set it to 0 and have it always select the highest rest mip (although this will cause some aliasing on-edge and in minification cases)
Don't upload a full mipmap chain for the image, just create the
texture with 1 or only a few (2-3) of the mipmap levels.

Detect Mip mapping level in the shader?


Problems with build.xml when using the Android ADK to communicate with an Arduino Mega ADK

Question: So a few days ago I got my hands on an Arduino Mega ADK board, and the last couple of nights I have been setting up my development environment, getting to grips with the tools etc. The tools and libraries all work fine, for example I can get a program written in the Processing IDE to compile and run on an Asus Eee Pad Transformer TF101 running Android 4.03. But when I get it to try to compile and run one of the pre-written examples, it gives me a compiler error:
Android SDK Tools Revision 20
Installed at C:\NVPACK\android-sdk-windows
Project Type: Application
Project Target:   Android 2.3.3
API level:        10
Library dependencies:
No Libraries

API<=15: Adding annotations.jar to the classpath.
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
No AIDL files to compile.
No RenderScript files to compile.
Generating resource IDs...
Generating BuildConfig class.
BUILD FAILED
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:680: The following error occurred while executing this line:
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:693: Compile failed; see the compiler error output for details.
Total time: 7 seconds
And that's all the console seems to output as well, which is rather frustrating! As far as I'm aware all of my SDK versions, tools and plugins are all up to date. I've tried this using a Linux partition I have on my hard drive and it produces the same error message, although it mentions a problem with the package com.Android.future.UsbAccessory. Given what I've seen, it seems that the problem is with the tools, either my directory structure doesn't match up to what the correct setup is, or something else is wrong :S. If anyone has had similar problems, some help would be smashing! (For the record, my setup was done using the instructions on the Arduino website, although I already had the Android SDK tools installed).
Will Scott-Jackson
Answer: It sounds like your haven't added in the support library to your project and/or you haven't downloaded it into your Android SDK.
The ADK1 demokit app targets API Level 10 (Android 2.3.3); That means you need to use the support libraries in your project and that's why the compiler is complaining about level 10 library dependencies not being available. The support libraries are a separate download in the SDK Manager, so you might not have them in your development environment.
In Android API Level 12 and higher, the USB Accessory protocol was added to the framework API, so there are two different ways to use the accessory protocol. So, you don't have to use the support libraries if you are targeting Honeycomb and higher versions, but you'll have to update the demokit app code to make this work.
Hope this helps.
Answer: So I've double checked my setup and started working on a project I had in mind, it seems to import the libraries appropriately. So far so good, but when I input:
<code>ArduinoAdkUsb arduino;

void setup() {
     arduino = new ArduinoAdkUsb(this);
     //Other UI initialisation etc.
}
</code>
I get this error:
<code>##name## ##version## by ##author##
FATAL EXCEPTION: Animation Thread
java.lang.NoClassDefFoundError: com.android.future.usb.UsbManager
    at cc.arduino.ADKCommunication.<init>(Unknown Source)
    at cc.arduino.ArduinoAdkUsb.<init>(Unknown Source)
    at
    processing.android.test.sketch_120730a.
    sketch_120730a.setup(sketch_120730a.java:48)
    at processing.core.PApplet.handleDraw(Unknown Source)
    at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
    at processing.core.PApplet.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:856)
</code>
After the app has been built and installed onto the Android tablet I am using. Any thoughts how I can over come this? From what I can tell, this has no problem finding com.android.future.usb.manager to compile and install the program, but once it tries to run it can find it.
Answer: Based on this tutorial from http://stream.tellart.com/controlling-arduino-with-android/
In the examples RGB_Arduino the name, version and author variables are set at the top of the sketch.
Try adding in this section of code at the top of your arduino sketch just underneath the library imports
<code>// accessory descriptor. It's how Arduino identifies itself to Android
char applicationName[] = "Mega_ADK"; // the app on your phone
char accessoryName[] = "Mega_ADK"; // your Arduino board
char companyName[] = "Freeware";

// make up anything you want for these
char versionNumber[] = "1.0";
char serialNumber[] = "1";
char url[] = "http://labs.arduino.cc/adk/"; // the URL of your app online

//initialize the accessory:
AndroidAccessory usb(companyName, applicationName,
accessoryName,versionNumber,url,serialNumber);
</code>


How to reduce heat loss from windows

Question: Small apartment with 8 single-pane windows with wooden frames that are not winter-friendly. The place is rented so can't replace or do anything major. Already filled in gaps in frames to stop drafts. Is there anything at all that can be done to the windows themselves to help improve the situation?
Comment: You could add some inexpensive pull down shades. They're usually considered an upgrade and if not, easy to remove.
Answer: Simple solution would be curtains, but they block the light during the day.
More complex solution would be acrylic glass.
Since you can not do modifications to the windows get some acrylic glass (plastic) cut to the dimensions of the current glass. Then just mount it on top of the glass. It comes in 4x8 foot panels, so lay it out to get maximum cuts, since it is not cheep. It is flexible light weight and easy to cut.
You can find it in Home Depo and others.
Here is an example of my patio window with acrylic glass (4X8) that I installed 5 Yr ago, and still looks great.
Answer:
Curtains are your friend, the heavier the better.  Although be weary of blackout curtains.  Make sure you check the packaging for any kind of "reflective cooling technology" or similar wording.

Buy some high quality reflective film, make sure to check the packaging to ensure it's multi-seasonal.  The current film on my windwows drops the temperature of the glass by 6 degrees in the summer and raises it 3 degrees in the winter.

As Ruskes said in his answer, acrylic glass can help out a lot, it's terribly expensive nowadays, so if you've got a second-hand/discount hardware or construction store, keep an eye out for undamaged sheets.  And be very careful while installing...  If your cut is too large, don't try to force it.  Chips on your edges will grow.

It's also worth mentioning working shutters.  Every layer of insulation you can put between you and the outside helps.  Not sure if that's too much for a rental though.

How to reduce heat loss from windows


What (linux) directories are written to most/constantly?

Question: When I read articles on running Linux from a flash drive, many recommend that directories that see many or constant writes be mounted in ram (e.g. as tmpfs). My question is - Which directories will these typically be, and is there any way to monitor disk activity that would show which directories see many writes?
Comment: The swap partitions
Comment: hmm... /var and /proc?

Can't give you a list complete enough to qualify as an answer, but that's what seems logical at first glance.
Comment: Also, `/tmp` earns a few frequent flyer miles.
Answer: /proc is generally a procfs system which doesn't live in disk. So I wouldn't worry about that.
The obvious one would be /tmp -- this is where any temporary files that get generated are going to be stored.
/var/run and /var/lock can be mounted as tmpfs since they do not need to persist over a reboot.
/var/log could be a possibility as well as long as you are OK not keeping logs over a system reboot.
Answer: /var and /tmp are obvious candidates.
Ksfmd may be of help (I don't have direct experience with it, but it seems to have the potential to help you monitor your system to decide what gets mounted where).
You might be able to build a more exact match to what you want to do with the inotify toolkit.
Answer: The new utility fatrace can show you exactly. See: https://launchpad.net/fatrace/
sudo fatrace

For example:
# sudo fatrace
chrome(6514): W /home/xxxx/.config/google-chrome/Default/Current Session
chrome(6514): R /home/xxxx/.pki/nssdb/cert9.db
chrome(6514): R /home/xxxx/.pki/nssdb/cert9.db
chrome(6514): W /home/xxxx/.cache/google-chrome/Default/Cache/data_1
chrome(6514): RW /home/xxxx/.cache/google-chrome/Default/Cache/data_0
chrome(6514): W /home/xxxx/.cache/google-chrome/Default/Cache/data_1
wicd(29613): RO /lib/x86_64-linux-gnu/ld-2.19.so
ifconfig(29613): R /lib/x86_64-linux-gnu/ld-2.19.so
ifconfig(29613): CO /etc/ld.so.cache


Are DVD laser diodes single transverse mode?

Question: I am looking for a cheap source of low power single transverse mode laser diode in order to focus them to a very small point. I thought I would get that from a DVD drive but the pattern I see at the focus point isn't a single point at all (2 or more points). I find that strange. Could you confirm that the DVD diodes aren't single transverse mode? (suggestions and reference of suitable diode are welcomed)
Answer: Diode lasers consist of many tiny emitters that are stacked together for power scaling, which has negative effects on beam quality. For the same reason, the laser beam also behaves different in both axes in respect to divergence and beam quality. That might be the reason why you see multiple focal points.
Reaching an actual single transverse mode for a laser is usually done with a special optical resonator (pun with my username not intended lol), containing elements to increase losses for higher modes. There is no room for that in a DVD drive.
According to wikipedia, you can also achieve single transverse mode by using a special structure in the semiconductor, for example a DBR (distributed bragg reflector).
However, the laser diodes in a DVD player are cheap mass produced diodes, so I don't expect such sophisticated structures to be used in them when they are not needed.


Backpropagation proof and usage confusion

Question: I've been taking Andrew Ng's course on Coursera, and although it has been great so far, I loathe his lack of supplementary documents on proofs. Thankfully, there are some great articles found pretty good article on the backpropagation proof, namely, this one by Sudeep Raja.
There are some notation differences and even some formula differences that are really throwing me off and would like more insight. Here is the slide specific to Andrew's lecture.
For notation's sake, assume there are three layers, with $\Theta^1, \Theta^2, \Theta^3$ as the weights. $a^1=x$ is the input, $a^2$ is the output of layer 1, and $a^4$ is the expected output of layer 3 and the final output.
$\Delta^1$ is $\partial J/\partial\Theta^1$, $\Delta^2$ is $\partial J/\partial\Theta^2$, ...
Note: This notation is identical to Andrew's but different from Sudeep's.
Andrew has:

$\delta^{(4)} = a^4-\vec y$,
$\delta^3=(\Theta^3)^T\delta^4.*g\prime(z^3)$,
$\Delta^3=\delta^4(a^4)^T$

Sudeep has

$\delta^{(4)} = (a^4-\vec y).*g\prime(z^4)$,
$\delta^3=(\Theta^3)^T\delta^4.*g\prime(z^3)$,
$\Delta^3=\delta^4(a^4)^T$

Notice the difference in $\delta^4$. Why?? Update: Answered in edits.
Also, in Sudeep's proof, when he's deriving $\partial E/\partial W_2$, he got
$$
\frac{\partial E}{\partial W_2} = \delta_3 \frac{\partial}{\partial W_2}(W_3x_2) = W_3^T\delta_3\frac{\partial}{\partial W_2}x_2
$$
$W_3$ is a constant so it comes out, but why is it transposed? I understand that you have to to get the dimensions to line up, but I don't think that's a sufficient argument as to why you do it.
Lastly, in Sudeep's proof, when he's deriving $\partial E/\partial W_3$, he got
$$
\frac{\partial}{\partial W_3}(W_3x_2) = x_2^T
$$
Again, why is $x_2$ transposed?
Edits
After more googling, I've learned that the reason Andrew's solution doesn't have the $g(z^4)$ is because he's using the cross-entropy cost function, explained further here, which leads to $g\prime(z)$ being canceled.
Comment: The book: Neural Network Design ( Hagan, Demuth..) provided a nice and not-complicated solution for the backpropagation algorithm, my lecture suggested me that book :))
Hope you understand thoughtfully!
Comment: Here's an article giving a vectorised proof of Andrew Ng's formulas.
https://towardsdatascience.com/a-10-line-proof-of-back-propagation-5a2cad1032c4 The plus here is that not so many indices are used, and you can clearly see where the transpose and the order of matrix multiplication come from.
Answer: Here, the derivatives are taken with respect to the vector, as a result, rules of differentiation are slightly different. My suggestion is when in doubt, perform derivation for each index of the vector and then extend to the general case. For example, to answer the second question you can find derivatives for each index, e.g. $\frac{\partial E} {\partial W^{j}_2}$ and then generalize. Similarly for $\frac{\partial E} {\partial W^{j}_3}$
Comment: Is it respect to a vector or a matrix? Because I'm trying to do it with two indexes $i,j$ and failing miserably. I understand that the product $W_3x_2$ is a vector, but $\partial / \partial W_2$ is a matrix differentiation, so shouldn't you do matrix differentiation? E.g., $\frac{\partial}{\partial (W_2)_{11}} (W_3x_2) = (W_3)_{11} \partial (x_2)_{11}$, $\frac{\partial}{\partial (W_2)_{12}} = (W_3)_{12} \partial (x_2)_{12}$, .. in which case I'm getting the matrix $W_3$, not $W_3^T$


Feedback stabilizes unstable systems?

Question: Can feedback stabilize a unstable system?I guess so since we may get rid of any poles in the positive complex plane by feedback but I am not sure.
Answer: I'll try a somewhat "sloppy" answer

Systems without feedback are always stable
Ergo: any unstable system already has a feedback path.
We can add a second feedback path. The resulting feedback is simply the sum of the two feedback paths.
The resulting feedback can be smaller or larger (and/or have a different phase) than the original feedback by itself.

Can feedback stabilize a unstable system?

Yes, if the additional feedback path reduces the feedback of the already existing feedback path below the stability threshold.
This, of course, can all be expressed formally in terms of poles and zeros and stability criteria but the general idea is: adding feedback to an unstable system can indeed make it stable, but only if the new feedback cancels "enough" of the feedback that's already there.
Comment: I like the sloppy answer; it adds an interesting intuition beyond simply ensuring all poles are in the left half plane (inside the unit circle for discrete) in the new closed loop system.
Answer: One thing you might wanna look into are concepts we learn in Control Theory about Observability and Controllability.  A prerequisite to these concepts is the State-variable linear system.
I believe that an unstable system must be both "completely observable" and "completely controllable" in order for it to be stabilized with feedback.  If there is an unstable state inside the system that cannot be observed at the output or cannot be controlled from the input, yer sorta screwed.

Feedback stabilizes unstable systems?