Does radiated energy of black body radiation due to the transition of electrons to higher energy state? or due to the increasing vibration of atoms themselves?

By conservation of energy, the solid is left in a lower energy state following emission of a photon.  Clearly absorption and emission balance at thermal equilibrium, however, thermodynamic equilibrium is a statement of the mean behaviour of the system, not a statement that the internal energy is constant on arbitrarily short timescales.  The energy has to come from somewhere during emission, and go somewhere during absorption.  Energy in a solid can be stored as kinetic and potential energy of electrons and nuclei, either individually or in collective modes such as phonons and plasmons.  In thermal equilibrium energy will be stored more or less in various forms depending on the temperature and material.  However, even if most of the thermal energy in a particular solid at temperature $T$ is stored in the form of phonons, it could be that phonons primarily interact with light indirectly via electrons, e.g. a phonon excites an electron in a phonon-electron interaction, which can interact with light via the EM field.  Given that light is an EM field, it makes sense to me that it is emitted and absorbed by charged particles.  The electron-photon interaction is probably dominant for visible and ultraviolet light, given that metals are opaque, while semiconductors and insulators are transparent to (visible and UV) light with energy lower than their bandgap. However, once you get into energies in the IR and below, or X-rays and above, other mechanisms apparently take over.  For example, on the high-energy end of the spectrum I've heard that gamma rays can interact directly with nuclear degrees of freedom, which is reasonable considering that gamma rays are emitted during a lot of nuclear reactions.  A review of  might give clues to important light-matter interactions over a broad range of wavelengths.  Whether all of the these processes are involved in blackbody emission is a somewhat different question.  What physical processes mediate energy transfer during blackbody emission, and in which energy ranges are the various processes dominant?


I want add an image to my footer and then I want show the number of current page / total pages:  So I added this three lines:  \setbeamertemplate{footline}[text line]{      \includegraphics[width=\paperwidth,height=1cm]{footer}      \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}      }   But as result I can't see the numbers.  How can I fix it?  This is my entire configuration of beamer:  \documentclass[smaller]{beamer}  \usepackage{xcolor} \usepackage{comment} \usepackage{multirow} \usepackage{colortbl} \usepackage{xspace} \usepackage{textpos} \usepackage{tikz} \usepackage{csquotes}  \usepackage{graphicx} % already used by beamer \graphicspath{{img/}} \DeclareGraphicsExtensions{.png,.jpg}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % BEAMER CONFIGURATION - START %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  \hypersetup{pdfpagemode=FullScreen} \beamertemplatenavigationsymbolsempty  \usetheme{Singapore}    % red, quite simple \usecolortheme{orchid}  % Make margines wider \setbeamersize{text margin left=1em,text margin right=1em}  % Select itemization and enumeration style: default, ball, circle % \setbeamertemplate{enumerate subitem}[default] \setbeamertemplate{enumerate items}[square] \setbeamertemplate{itemize items}[triangle]  %%% The navigation bar on top \setbeamertemplate{headline}{} % \setbeamertemplate{headline}[infolines theme]  \definecolor{UofTBlue}{RGB}{0,47,101} \setbeamertemplate{frametitle}{%     \nointerlineskip%     \begin{beamercolorbox}[wd=\paperwidth,ht=2.8ex,dp=.9ex]{frametitle}         \hspace*{1ex}\insertframetitle%     \end{beamercolorbox}% }  \setbeamercolor{structure}{fg=UofTBlue} \setbeamercolor{frametitle}{fg=white,bg=darkgreen} \setbeamercolor{section in head/foot}{fg=white,bg=UofTBlue}    %\makeatletter %\setbeamertemplate{footline} %{ %  \leavevmode% %  \hbox{% %  \begin{beamercolorbox}[wd=1\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}% %%     \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em} %    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}  %  \end{beamercolorbox} %  }% %  \vskip0pt% %} %\makeatother  \setbeamertemplate{footline}[text line]{ \includegraphics[width=\paperwidth,height=1cm]{footer}  \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}  }  \end{document}

I'm using the Madrid theme but I would like tu use images instead of colored backgrounds for the frametitle and the footline. This is what I have so far    I want to do the same thing I did for the frametitle in the footline. I've tried many things, the only one that has worked is   \setbeamertemplate{footline}[textline]{ \includegraphics[width=\paperwidth]{image}}   but I can't fill the width of the page nor move the image, and the text is covered by the image. This is an example of what i just described  \documentclass{beamer} \mode<presentation>{   \usetheme{Madrid}   \setbeamercolor{frametitle}{fg=yellow}   \setbeamercolor*{palette primary}{use=structure,fg=red}   \setbeamercolor*{palette secondary}{use=structure,fg=red}   \setbeamercolor*{palette tertiary}{use=structure,fg=red}   \setbeamerfont{frametitle}{size=\huge} } \usepackage{textpos} \usepackage{graphicx} \usepackage{tikz} \usepackage[export]{adjustbox}  \setbeamertemplate{footline}[text line]{ \includegraphics[width=\paperwidth]{foot_image}}  \addtobeamertemplate{frametitle}{ \begin{textblock*}{\paperwidth}(-30pt,0pt) \includegraphics[width=1.1\paperwidth,height=1.3cm]{frametitle_image} \end{textblock*} }  \title[Title]{\textbf{{\huge Big Title}}} \author[email]{Author} \institute[]{Department\\University} \setbeamertemplate{navigation symbols}{}  \begin{document}  \begin{frame}{Frametitle} slide 2 \end{frame} \end{document}   Which produces


I tried to upgrade with the manager but guess what? My version is 11.04 and the manager try to upgrade to 11.04.  What can I do and is it possible to upgrade through all those End-of-Life versions, step by step?

I am currently using Ubuntu 10.04. I know there is a 10.10 release, but can I upgrade directly to 11.04? Could you walk me through the steps please?


I need to process a latex command if and only if the current date is between certain months, say between april 15  and june 15 of any given year. I imagine it's possible with datetime.sty but all the examples on the web seem to involve relative dates (i.e., the date relative to the current day)  rather than absolute dates.   Also I want the conditioning event to depend only on the day and month and not on the year.      Is this possible?    Thanks very much.  I've added my own answer, which is not elegant, but works.   I didn't want to put it into a comment for obvious reasons.  \documentclass{minimal} \usepackage{datenumber} %#1-#2 is start month-day %#3-#4 is end   month-day %#5: do this if within the range %#6  do this if outside the range \newcounter{doIt} \newcommand{\doInDateRange}[6]{     \setcounter{doIt}{0}     \ifnum\thedatemonth>#1         \ifnum\thedateday>#2             \setcounter{doIt}{1}         \fi     \fi     \ifnum\thedatemonth<#3         \ifnum\thedateday<#4             \addtocounter{doIt}{1}         \fi     \fi     \ifnum\value{doIt}=2         #5     \else         #6     \fi } \begin{document} \doInDateRange{3}{20}{5}{22}{Your are within the date range}{You are outside the date range}\\ \doInDateRange{3}{22}{12}{31}{Your are within the date range}{You are outside the date range}\\ \doInDateRange{1}{1}{5}{22}{Your are within the date range}{You are outside the date range} \end{document}

I'd like to be able to print text that varies depending on whether the date matches a given date string  For example  suppose there was a command   \iftoday#1#2#3   which printed #2 if \today matched the string in #1 and #3 otherwise.  So a sample of my proposed usage would be:     \iftoday{February 3, 2016}{There's no garbage today}{Please put out the garbage}    I've tried various commands like pdftexcmd's strcmp, to no avail.    I suspect the problem may have to do with matching the string generated by \today.    While on screen it appears that \today returns February 3, 2016. I can't get it to match February 3, 2016 when I compare strings.  Obviously, I'd be perfectly happy if I could get this to work by represent today's date in any of the standard date formats.  Thanks very much in advance for any suggestions.


I have two folders, one that I know the name of, and one that I don't: ~/foobar-as9df7 # I know the name of this one ~/foobar-7fq92h # I don't know the name of that one  How can I delete the folder that starts with foobar- and is NOT ~/foobar-as9df7, and that I don't know the name of? Said differently, I want to rm -rf ~/foobar-as9df7 except that I don't know it's called foobar-as9df7, I only know its name starts with foobar- and it's not foobar-as9df7. I've tried doing: find foobar-* ! -name "foobar-as9df7"  -exec rm -rf {} \;  which works but strangely this triggers a message saying: find: ‘foobar-7fq92h’: No such file or directory  -- EDIT the output of this command: find ~/ -type d -name 'foobar-*' ! -name 'foobar-as9df7' -exec echo .rm -r {} +  is as follows: .rm -r /home/ubuntu/foobar-7fq92h

I know how to delete all txt file under current directory by rm *.txt. Does anyone know how to delete all files in current directory EXCEPT txt file?


I'm trying to complete this question but it has me a little stumped!   Let $k, m, n \in\mathbb Z^+$, where $k$ and $m$ are relatively prime. Prove that if $k|mn$ then $k|n$ ($k|mn$ implies that $k$ divides $mn$ and $k|n$ implies that $k$ divides $n$) .

Suppose that $a,b,m,n$ are natural numbers, prove the following statement:  If $a({m \over n})=b$ and $(a,n)=1$, then ${m \over n} \in \mathbb{N}$


Im planning to transfer my domain from my current provider since there have been problems with hosting,webmail and poor support.  Will transferring the domain and changing the host affect my search engine ranking and SEO in anyway?

I have been hosting in a server from last 2 years. I am planning to change the hosting server. Before I change the hosting server I would like to know whether it affects my site's rankings or not?


I'm working on a website that would have a mass of uploaded images, each with a max of 2mb but adding up, in total, to much more than my VPS hosting (which has a max of 100gb used up by a lot of other similar projects) allows. I can not pay for a bigger plan and the website itself, as a .org, will likely not have advertising on it.  Everything including the PHP, CSS, JavaScript and website logos and artwork can be stored locally. It's just the images that cannot.  What I'm looking for is something that is free, doesn't track people, is reliable and easy to work with using PHP/JS and HTML. I don't want something that would require all the people using my website to also be logged into the image host.  Cheers, MyUser

This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting.  Pro Webmasters no longer accepts new questions about how to choose hosting.  All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see .    How to find web hosting that meets my requirements?  What we're looking for in answers to this question are the basics about web hosting:   What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host.   What we do not want is:   Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please)


Next is a riddle that I found interesting and I decide to share it with you. Try solve it by yourself before reading the answer.  A merchant has 13 fair gold coins with one fake among them. The fake coin have been made by a skillful thief and look identical to the real coins, except for it's weight, its different, it might be lighter or heavier then the real one. The merchant has a balance that allows him to compare the weight of two groups of coins. Can he distinguish the fake coins from the fair coins with only 3 weights?   13 coins 1 of the 13 is fake Fake coin is lighter or heavier 3 weights

The 12-item balance scale puzzle is very familiar.  The object is to find the lone non-standard item (if one exists) out of a group of 12 seemingly identical items, using a balance scale and a maximum of three weighings. Did you know that it is possible to accomplish the same outcome given a set of 13 seemingly identical items?  I've scoured the web for a discussion of this problem/solution and have not found one. Am I the only one that has solved this problem?  BTW: If you allow four (4) weighings on a balance scale, how many seemingly identical items can you analyze and be assured of finding the lone non-standard item within the group?  If there is sufficient interest, I will publish the answers in a future post.


I would like to programmatically capture a subset of a latex document, something like:  doc = new Doc("foo.tex") node = doc.getNode("bar") print node.text   where node "bar" would be delimited by some tags, put for example in comments:  %% <bar> This the \textbf{node content} %% </bar>   How to do this?

Is there any way one can use \input to insert only a specific section of a document into another? I intend on using this to improve the readability of an article with lots of pgfplots graphs in it, by moving all of my graphs to another file, and using something like \input{file.tex:graph1} to insert each graph where it is needed, rather than have all of them displayed together


I made travel arrangements to travel to France between July 27 and August 10 with my family. I received a Schengen visa from the consulate of France from July 27 to August 10 for myself and my spouse, while my two children (12 and 17) received their visas from July 26 to August 9.  When I checked with the consulate, they told me it's not a problem if they stayed one additional day since they are with their parents. Is that normal?

I had applied for Schengen visa of my wife and received it today. But there is a typo in her name. Her middle name has been spelt wrongly. Vinay has been written as Vijay.    Can we travel with this typo in the visa or should I apply for correction? I need to travel next weekend and I am afraid that if I apply for correction then will I get the corrected visa in time or not ?


I'm sorry to ask such an elementary question. I am wanting to know how to type the following symbol in LaTeX, it is written with a subscript 'l' in the image below,     I feel quite illiterate because I don't even know how to read this symbol. I have tried typing the (English) alphabet in various font styles but nothing matched.   Many thanks

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


Here's what I'm tasked with showing: Let $(a_n)$ be a convergent sequence with $a_n\rightarrow a$ as $n\rightarrow\infty$. By the Algebraic Limit Theorem, we know that $(a_n^2)\rightarrow a^2$. Now prove this using the definition of convergence. In doing so, I have the following: Let $\epsilon>0$ be given. Choose some $N\in\mathbb{N}$ so that for all $n\geq N$, $|a_n^2-a^2|<\epsilon$. By algebra, $|a_n^2-a^2|=|a_n-a||a_n+a|$. Consider $|a_n+a|$. By the triangle inequality, $|a_n+a|\leq|a_n|+|a|$, thus $|a_n|$ is bounded by some $M\in\mathbb{N}$. I know I'm trying to choose $M$ so that $|a_n-a|<\epsilon+M+|a|$. Where should I take it from here?

Question:  Let ${a_n}$ be a sequence in $\mathbb{R}$ with $\lim_{n\to\infty}a_n=a$  Prove that  $\lim_{n\to\infty}a_n^2=a^2$  Attempt: Without using any properties of limits (this is a question in a section of the book that came before any list of any limit theorems)  By definition:  $|a_n^2-a^2|<\epsilon$   $|a_n^2-a^2|$ $\leq$ $|(a_n+a)(a_n-a)|$ $\leq$ $|(a_n+a)| |(a_n-a)|$ $\leq$   $(|a_n | + |a|)(|a_n -a|)$ $<$ $\epsilon$  And since I know that $\lim_{n\to\infty}a_n=a$, I'll subsitute that in for $|a_n|^2$ as $a^2$   $\therefore$ $a^2-|a|^2 < \epsilon$ which is true since $a^2-|a|^2$ in my case.  I wonder if this is a possible solution?


Note: I am asking this question as a simple introductory question to proofs by induction, to which I will give also my formal answer (which should be correct, if not, please comment) for future visitors of this website.  I know that to prove something by induction, we need formally 3 steps (2, if we considere inductive hypothesis and inductive step together):   Base case or basis:  We determine what is the base case for our statement $P(n)$, and we immediately prove it. Inductive hypothesis:  We assume our statement $P(n)$ is true for $n$. Inductive step:  We try to prove that our statement is also true for $P(n + 1)$. If we can prove that, we can also prove that our statement is true for $n + 2$ (we don't need to do it), and so on.  This step is usually the most difficult part, because it involves some algebraic manipulation, or some imagination in some way. For this last reason, it might be helpful watching other similar proofs by induction to solve the current one.   For example, suppose our $P(n)$ is the following:  $$\frac{n(n + 1)(2n + 1)}{6} = 0^2 + 1^2 + 2^2 + 3^2 + ... + n^2$$  which is basically saying that the sum of all squares of the natural numbers from $0$ to $n$ can be determined by the formula on the left side of the equation.  How would we prove $P(n)$ is true for all $n \in \mathbb{N}$?  For more information about the proof by induction, see the Wikipedia page about induction called .

I am just starting into calculus and I have a question about the following statement I encountered while learning about definite integrals:  $$\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}$$  I really have no idea why this statement is true. Can someone please explain why this is true and if possible show how to arrive at one given the other?


Looking for a proof check. I've written out the argument as it reads most easily to my own eyes.  Let $S$ be a set and suppose by contradiction that $\exists f:S \to P(S)$ with f surjective. Define $B = \{x \in A: x \notin f(n)\}$. $f$ surjective $\implies B = f(x_0)$ for some $x_0$. $x \in B \iff x \notin f(x)$ but $B = f(n_0)$ so $n_0 \in f(n_0) \iff n_0 \notin f(n_0)$ which is a contradiction. Therefore $\nexists f$.

$\DeclareMathOperator{\card}{card}$From Problem-Solvers Topology  Prove the following: CANTOR'S THEOREM If $A$ is a set, then $$\card A < \card \mathcal{P}(A)$$ where $\card A$ stands for the cardinality of set $A$.  My Answer If $A = \emptyset$, then $\card A =0$ and $\card \mathcal{P}(A)=1$. If $A = \{a\}$, then $\card A=1$ and $\card \mathcal{P}(A)=2$. So suppose that $A$ has at least two elements. Define a function $f: A \rightarrow \mathcal{P}(A)$ such that $f(x) = \{x\}$ for all $x \in A$. Then $f$ is injective. But it cannot be surjective, because for any two distinct elements $a,b \in A$, there is no element in $A$ that is sent to the set $\{a,b\}$ in $\mathcal{P}(A)$. Therefore, there is no bijection, and $\card A < \card\mathcal{P}(A)$. Do you think my answer is correct? Thanks in advance


Show that if series $a_n$ converges then series $(-1)^n a_n$ converges.    Is that true? A quick proof is highly appreciated.Thanks

I have this statement and I need to say if it is true or false:  Let $\{a_n\}$ be a real sequence.  $$\lim_{n\to +\infty} a_n = 0 \quad \implies \quad \sum_{n=1}^{\infty}(-1)^na_n \quad \text{converges}$$  I know, from the Leibniz criterion that:     If $a_n \to 0$, $a_n$ is decreasing and positive then $\sum_{n=1}^{\infty}(-1)^na_n$ converges   From this fact I believe that the statement is false but I couldn't come up with an infinitesimal sequence that isn't decreasing and for that reason is divergent. I tried some function with $sin(\frac{1}{n})$ without any luck. Any help would be very appreciated, thank you!


I have been looking some question posted in here, but I still can't find the problem w/ this code:  template <typename ItemType> class List {   public:     List();    private:     template <typename ItemType>     struct Node     {       ItemType m_value;       int      m_count;       Node*    m_next;       Node*    m_prev;     };     Node* m_head;     int   m_uniqueSize;     int   m_size;     Node* find(const ItemType& value) const; };   then in the cpp file, I declare the find function like this:  template <typename ItemType> typename Multiset<ItemType>::Node* Multiset<ItemType>::find(const ItemType& value) const {    //linear search code in here }   is there anything wrong with my code? thx

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


At the cafe..  I : Coffee please. Staff : No milk?  In that case, how should I answer if I don't want milk?  No. Yes.

There has been talk of how to answer a negative question without ambiguity, most often with a qualifying phrase needed for clarification. (For example, "yes, I do"/"no, I don't.)  I've noticed that other languages have a single word to address a negative question on the contrary. In German, ja means yes and nein means no. Alternatively, doch is used to respond in the positive to a negative question, in essence meaning "No, I intend to do the opposite of what your question presumes."  Take for example the question, "You don't want to go to the movie then?" German speakers could simply reply, "nein" if they don't want to go or they would say "doch" if they did want to go; an unambiguously positive response to a negatively phrased question. No need for, "no, I actually would like to go" or "yes, I'll come actually". In French, the respective equivalents of ja, nein, and doch are oui, non, and si. I imagine many other languages contain this set as well.  I am wondering whether there was at one time an equivalent word in the English language that has since (unfortunately) disappeared. Any ideas?


I am trying to create an easy way to include a number of equations in multiple spots of a report (or reports) without having to retype them each time and keep nomenclature consistent across all equations. I have an "equation library" that I want to include in various files to make the equations available. % eq.tex \def \a {\nomenclature{$a$}{Coefficient}} \def \b {\nomenclature{$b$}{Coefficient}} \def \c {\nomenclature{$c$}{Coefficient}} \def \m {\nomenclature{$m$}{Slope}} \def \x {\nomenclature{$x$}{Variable}} \def \y {\nomenclature{$y$}{Variable}}  \def \line { \label{line} \b \m \x \y $$y=mx+b$$ }  \def \parabola { \label{parabola} \a \b \c \x \y $$y=ax^2+bx+c$$ }  This way I can just include \line in a file and have the necessary nomenclature available. % main.tex \documentclass{article} \usepackage{nomencl} \makenomenclature \input{eq} \begin{document} \printnomenclature  \line     \parabola  \end{document}  This produces the nomenclature as you would expect  Nomenclature a   Coefficient b   Coefficient c   Coefficient m   Slope x   Variable y   Variable  However, I would like to have an equation number and label available to reference in the text. When I introduce the equation environment, the nomenclature section has duplicate entries. I've tried both \begin{equation} \line     \end{equation}  \begin{equation} \parabola \end{equation}  and \def \line { \label{line} \b \m \x \y \begin{equation} y=mx+b \end{equation} }  \def \parabola { \label{parabola} \a \b \c \x \y \begin{equation} y=ax^2+bx+c \end{equation} }  which both yield duplicate entries in the nomenclature  Nomenclature a   Coefficient b   Coefficient b   Coefficient c   Coefficient m   Slope x   Variable x   Variable y   Variable y   Variable  Is there something special about the equation environment that is throwing this off? Am I missing some fundamental understanding about defining terms? I also tried using \newcommand and the document wouldn't compile

Is there a way to automatically remove duplicates from the generated Nomenclature?  E.g. adding multiple times:  \nomenclature{HTML}{HyperText Markup Language}   in your TeX file should generate only one entry in the Nomenclature.  This minimal example shows what happens:  % This is test.tex \documentclass{book} \usepackage{nomencl} \makenomenclature \begin{document}  Some text \nomenclature{HTML}{HyperText Markup Language}  \newpage \chapter{Chapter}  Some text \nomenclature{HTML}{HyperText Markup Language}  \printnomenclature \end{document}   The nomenclature was generated with makeindex test.nlo -s nomencl.ist -o test.nls and here is the test.nls:  \begin{thenomenclature}  \nomgroup{A}    \item [{HTML}]\begingroup HyperText Markup Language\nomeqref {0}         \nompageref{1}   \item [{HTML}]\begingroup HyperText Markup Language\nomeqref {1.0}         \nompageref{3}  \end{thenomenclature}   Problem comes with lines at test.nlo are not identical:  \nomenclatureentry{aHTML@[{HTML}]\begingroup HyperText Markup Language\nomeqref {0}|nompageref}{1} \nomenclatureentry{aHTML@[{HTML}]\begingroup HyperText Markup Language\nomeqref {1.0}|nompageref}{3}   In my real tex \nomeqref's content is \relax x.x for duplicate entries.


I want to achieve the following behavior for my audio outputs:     if HDMI is connected use it as audio output device   else if headphones are connected use them as output device   else use built-in speakers     I already used this answer  to set HDMI as default audio output on system boot. Now I have the problem that whenever headphones are connected the audio output switches to them. So, headphones have higher priority than HDMI.  Is there any way to change the priority in the described way?

I list sources and sinks as follows:  pactl list sources pactl list sinks   The output I get is:  ...     Ports:         analog-input-internal-mic: Internal Microphone (priority: 8900)         analog-input-headphone-mic: Microphone (priority: 8700)         analog-input-headset-mic: Headset Microphone (priority: 8800) ...     Ports:         analog-output-speaker: Speakers (priority: 10000)         analog-output-headphones: Headphones (priority: 9000, available)    How do I change the priorities listed above and have them fixed at what I change them to? Note that I am not looking to set a default source and sink or to delete unwanted sources or sinks, I just want to be able to assign them different priorities.


I am building a model with the following requirements:   Items may have attributes Attributes may be of type: 'Choice', 'FreeText', 'Number'   I am not quite sure how to relate the item to attribute properly. I currently have a table: 'ItemAttribute' which has both the item key and the attribute key and then just a value field which currently is simply a varchar field.   However, I would like to keep the integrity between the 'Choice' and the ItemAttribute which my current design does not help with.   How would you design this?  Thanks so much for your suggestions

We process a routine data feed from a client who just refactored their database from a form that seems familiar (one row per entity, one column per attribute) to one that seems unfamiliar to me (one row per entity per attribute):  Before: one column per attribute  ID   Ht_cm   wt_kg   Age_yr  ...  1      190      82     43    ... 2      170      60     22    ... 3      205      90     51    ...   After: one column for all attributes  ID    Metric   Value  1     Ht_cm     190  1     Wt_kg     82  1     Age_yr    43  1      ...  2     Ht_cm     170  2     Wt_kg     60  2     Age_yr    22  2     ...  3     Ht_cm     205  3     Wt_kg     90  3     Age_yr    51  3     ...   Is there a name for this database structure?  What are the relative advantages?  The old way seems easier to place validity constraints on specific attributes (non-null, non-negative, etc.) and easier to calculate averages.  But I can see how it might be easier to add new attributes without refactoring the database.  Is this a standard/preferred way of structuring data?


How to move window control buttons to the right in 14.04? The previous solutions seems not to work in 14.04.  Note: Please do not mark this question as a duplicate of , as 174292 is about 12.04. Now, with 14.04, the situation is completely different.

Downloaded Ubuntu tweak and set window controls to the right side. Only some programs follow the rule. Pidgin as an example has window controls on the right. But Chrome, Thunderbird, Geany, still have controls on the left.  How can I move ALL window controls(close/min/max) to the right (or left)?


I created a script that renders and saves the selected objects. The script is quite large and I don't think it is necessary to post it completely.  def myRenderFunction(self,context):     for o in context.selected_objects:         ###some coordinates for camera position         ###some functions to hide         myPath = "C\:blah blah" + os.sep + o.name         data_blocks = {o}         bpy.data.libraries.write(myPath+".blend", data_blocks)         bpy.ops.render.render(write_still=True)         context.scene.render.filepath = myPath   My issue is that I can't find a way to stop it once executed because Blender's Interface is completely frozen while rendering the images.  Q: How can I allow the user to stop the rendering process at any given time?

I'm trying to make a script where I have to render several images of the same scene at the same frame, and write to disk with appropriate names. The problem is that although this works fine with a non-responsive UI, it doesn't work well when the render progress appears in the Blender UI.  I mean,  bpy.ops.render.render()   uses "EXEC_DEFAULT" when called from a script. This leaves a blocked User Interface until the render finishes, meaning that you can't cancel the process, except by killing Blender. The problem is that the render may be too big in resolution, and the user could want to stop the process when realizing that the render could take hours, so the idea is to cancel this process without losing the currently opened project.  If I call,  bpy.ops.render.render("INVOKE_DEFAULT")   I get a nice preview bar in the Info Window with a clickable "X" button. I want the user to be able to press that button to cancel the operation if needed, but for a series of renders (not animation).  The problem here seems to be when trying to loop this command with the INVOKE_DEFAULT context to write several renders. I made a lot of testing, and this way of calling the render operator seems to continue with whatever is next in the script, so it loops very fast and ends before the rendering actually finishes.  I think that I need some way to stop the script and make it wait until render finishes to continue looping with the next ones. I tried the "render_complete" and "render_cancel" handlers, but I can't use them to start a new render or even make the rest of the script wait until the loop of renders is complete. I tried threading and events without success either. Maybe I'm doing something wrong.  import bpy  render = bpy.context.scene.render path = render.filepath = "/tmp/" shots = ["one", "two", "three"]  for x in shots:     render.filepath = path + x     bpy.ops.render.render("INVOKE_DEFAULT", write_still=True) # this doesn't work      # but if I use:     # bpy.ops.render.render(write_still=True)     # without the INVOKE thing, images are written as expected,     # but losing the possibility to see the progress and cancel rendering


d is a string list where each item is composed of two parts (connected by a dot). I want to extract the parts before and after the dot for each string item.  Here is how I did it.  d = ['a1.b1', 'a2.b2', 'a3.b3'] b = [c.split('.')[0] for c in d] a = [c.split('.')[1] for c in d]   But I guess there is some more pythonic way?

I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item.  For example:  original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4])   Is there a builtin function that does that?


I get the following LaTeX Error for the xcolor class. ! LaTeX Error: Option clash for package xcolor. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.109 \definecolor {lightgray}{rgb}{.9,.9,.9} The package xcolor has already been loaded with options: [prologue] There has now been an attempt to load it with options [table,xcdraw] Adding the global options: prologue,table,xcdraw to your \documentclass declaration may fix this.  Now as it was suggested here, , I have already added prologue,table,xcdraw in the documentclass: \documentclass[sigconf,prologue,table,xcdraw]{acmart}  But even after adding this to the documentclass, it still does not compile and I still get the following error: ! LaTeX Error: Option clash for package xcolor. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.109 \definecolor {lightgray}{rgb}{.9,.9,.9} The package xcolor has already been loaded with options: [prologue] There has now been an attempt to load it with options [table,xcdraw] Adding the global options: prologue,table,xcdraw to your \documentclass declaration may fix this.  A minimal working example is here: ACM Proceedings Template acmart.cls file is here:  And you can create a file and just create a file main.tex and copy the following content and it will be failing: \documentclass[sigconf,prologue,table,xcdraw]{acmart}  \usepackage[table,xcdraw]{xcolor}  \begin{document}   \title{Tile}  \author{Anonymous author(s)}  \maketitle  %%% add page numbers to make it easier for reviewers. Remove after paper is accepted. \thispagestyle{plain} \pagestyle{plain}  \renewcommand{\arraystretch}{1.3}  text text text .....    \end{document} \endinput  Found one solution: I see in the ACM template acmart.cls it has the following: \RequirePackage[prologue]{xcolor}  So I have to modify the ACM default template acmart.cls with the following: \RequirePackage[prologue,table,xcdraw]{xcolor}  However, I really don't want to modify the ACM default template. Is there any other option?

I have a problem with LaTeX packages. My problem seems to be with xcolor, and very close from this , but their solution does not work for me.   Unfortunatly, even if I put \usepackage[table,xcdraw]{xcolor} before \usepackage{xcolor} the problem continues...   Is there a simple/magic solution?  Here is the packages I use:  \documentclass[ 11pt, % The default document font size, options: 10pt, 11pt, 12pt %oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side french, % ngerman for German singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing %draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated) %nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single %liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents %toctotoc, % Uncomment to add the main table of contents to the table of contents %parskip, % Uncomment to add space between paragraphs %nohyperref, % Uncomment to not load the hyperref package headsepline, % Uncomment to get a line under the header %chapterinoneline, % Uncomment to place the chapter title next to the number on one line %consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout table, ]{MastersDoctoralThesis} % The class file specifying the document structure  \usepackage[utf8]{inputenc} % Required for inputting international characters \usepackage[T1]{fontenc} % Output font encoding for international characters  \usepackage{amsmath} % Use the Palatino font by default  \usepackage[table,xcdraw]{xcolor} % pas OK  \usepackage{xcolor} %OK  \usepackage{hyperref}  \usepackage[bottom]{footmisc}  \usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)  \addbibresource{example.bib} % The filename of the bibliography  \usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography  \usepackage{capt-of}  \usepackage{subfigure}  \usepackage{caption}  \usepackage{float}  \usepackage{graphicx}  \usepackage{amssymb}  \usepackage{amsfonts}  \usepackage[framemethod=TikZ]{mdframed} \usepackage{lipsum} \mdfdefinestyle{MyFrame}{%     linecolor=black,     outerlinewidth=2pt,     roundcorner=20pt,     innertopmargin=\baselineskip,     innerbottommargin=\baselineskip,     innerrightmargin=20pt,     innerleftmargin=20pt,     backgroundcolor=gray!20!white}   And here is the table I used in one of the chapters ():   % Please add the following required packages to your document preamble: % \usepackage[table,xcdraw]{xcolor} % If you use beamer only pass "xcolor=table" option, i.e. \documentclass[xcolor=table]{beamer} \begin{table}[] \begin{tabular}{|c| >{\columncolor[HTML]{FFFFFF}}c | >{\columncolor[HTML]{EFEFEF}}c | >{\columncolor[HTML]{FFFFFF}}c | >{\columncolor[HTML]{EFEFEF}}c | >{\columncolor[HTML]{FFFFFF}}c | >{\columncolor[HTML]{EFEFEF}}c | >{\columncolor[HTML]{FFFFFF}}c |} \hline Row 1: & \#1   & \#2  & \#3   & \#4   & \#5      & \#6     & \#7     \\ \hline Row 2: & 12 \% & 1 \% & 15 \% & 25 \% & 18.75 \% & 12.5 \% & 6.25 \% \\ \hline \end{tabular} \end{table}


Unknown user permission: CanInsertFeedSystemFields Unknown user permission: ChatterInternalUser  What could be the possible solution? Thanks in advance.

Trying to deploy to an Org I get this:  permissionsets/Our_Administrator.permissionset -- Error: Unknown user permission: CanInsertFeedSystemFields  I've figured out that the kind of settings an Org will accept depend whether or not a feature is enabled.  So what does CanInsertFeedSystemFields correspond to, and how can I switch it on or off.


Don't really know what more I can say really. That window captured below will simply not get any larger. Are there some settings somewhere that will allow me to resize it?    See, this limited window thing has left me in a bit of a pickle. Basically I've created an application with a command line GUI (With Ruby's Curses Library), and while everything works beautifully on OSX and Ubuntu Terminals, with Command Prompt, if the Curses Windows are larger than the Command Prompt window as shown below, the whole application crashes with a 'window already closed' error.  So, is there a setting that allows users to resize their Command Prompt window, something that I'll have to put in the documentation.  Here's what the holy grail answer would, be though:  Is there a way to do this from the command line? Could my application detect if the Command Prompt it's running on is of fixed width, and actually programatically run the command to allow the Command Prompt window to be enlarged? Or at least give the user a helpful error message?

How can I widen the Windows 7 command prompt window?   It's fixed at 80 columns in width and dragging the window edges won't let me make it any bigger than that.


I just installed MacTeX on a new machine. I'm running into a difficulty I hadn't had before.   I have a .cbx file inside ~/Library/texmf/tex/latex/biblatex/cbx/ that has the same name as another .cbx file inside /usr/local/texlive/2017/texmf-dist/tex/xelatex.   If I run LaTeX on a file calling the corresponding citation style (\usepackage[citestyle=name-of-cbx-file]{biblatex}) the .cbx file inside the texmf tree inside ~/Library is given priority. If I run xelatex on the same file, however, the one that is inside texmf-dist is given priority.   This is the output of kpsewhich -expand-var='$TEXINPUTS':  .:{{}/Users/apc/Library/texlive/2017/texmf-config,/Users/apc/Library/texlive/2017/texmf-var,/Users/apc/Library/texmf,!!/usr/local/texlive/texmf-local,!!/usr/local/texlive/2017/texmf-config,!!/usr/local/texlive/2017/texmf-var,!!/usr/local/texlive/2017/texmf-dist}/tex/{kpsewhich,generic,}//   Shouldn't xelatex and latex be searching for biblatex style files in the same way? If so, why is xelatex not finding the files?

I've just made a minor alteration to a file from a TeX package.  I copied it into my local texmf tree and made the change there.  When I tried kpsewhich <filename> to test that it was finding my local version, it returned the original one and not the new one.  In actual fact, the original file was from my local texmf tree already so I renamed the old one something simple.  Now kpsewhich <filename> returned the system version of the file.  To check that the file was there, I tried kpsewhich -all <filename> and got the correct two versions of the file: my modified one and the system one (in that order).  If I try this with another file that I know exists in both places, then kpsewhich <filename> returns my local file.  Here's the various invocations and their results:  ~% kpsewhich pgfsys-pdftex.def /usr/local/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def ~% kpsewhich -all pgfsys-pdftex.def  /Users/stacey/Library/texmf/tex/latex/bzr/pgfsys-pdftex.def /usr/local/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def ~% kpsewhich tqft.sty               /Users/stacey/Library/texmf/tex/latex/bzr/tqft.sty ~% kpsewhich -all tqft.sty /Users/stacey/Library/texmf/tex/latex/bzr/tqft.sty /usr/local/texlive/2012/texmf-dist/tex/latex/tqft/tqft.sty   Is it something special about the .def extension?  Is there some command that I forgot to run?  Are there some other options to kpsewhich that will help me debug this?


While I know that $$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^{2}}{6}$$  But trying to evaluate this has left me stumped $$\sum_{n=1}^{\infty} \frac{1}{n^2+1}$$  I evaluated it through wolfram alpha, it gave me $\frac{1}{2}(\pi\coth(\pi)-1)$.  What would be a good way to start evaluating this series?

This is a homework question whereby I am supposed to evaluate:  $$\sum_{n=1}^\infty \frac{1}{n^2 +1}$$  Wolfram Alpha outputs the answer as   $$\frac{1}{2}(\pi \coth(\pi) - 1)$$  But I have no idea how to get there. Tried partial fractions (by splitting into imaginary components), tried comparing with the Basel problem (turns out there's little similarities), nothing worked.


I am using Kubuntu operating system, and on my computer I have a Admin account and my working account.   I have forgotten the Admin password, cannot log into that account or authenticate for updates etc. Have looked online and found it is possible to set new password from recovery mode, from grub. But I cannot get onto grub - Have tried pressing Esc, Shift, F2, F12 at computer boot - it does not bring a grub menu (it does give a spool of text - booting process I think).  Have checked /etc/default/grub file and there are two options : GRUB_DEFAULT=0, GRUB_TIMEOUT=0.  I think I have to set Timeout to more than 10, but cannot do this as I do not have write privileges.   What are my options? Would I have to reinstall operating system? Can I get onto Grub from a boot CD or USB?   Thank you.  EDIT : I managed to get the Grub menu by pressing F5 after doing a hard shut-down. Password was changed through recovery mode --> root shell prompt.

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


How to execute multiple statement in PgAdmin 4 like we do in Sql Server/Oracle (press F5)?  select * from employees;  select * from department;   As much I worked with PgAdmin, it allows us to execute only one selected statement or last statement per time, is there any way or any setting to execute multiple dml statement together?

With MS SQL Query Browser I can run multiple queries at the same time and each result set will display in it's own window.  Does PostgreSQL/pgAdmin have this functionality? Plugin perhaps?


I have read something like 6 articles on Markov Chain Monte carlo methods, there are a couple of basic points I can't seem to wrap my head around.   How can you "draw samples from the posterior distribution" without first knowing the properties of said distribution? Again, how can you determine which parameter estimate "fits your data better" without first knowing your posterior distribution? If you already know the properties of your posterior distribution (as is indicated by 1) and 2)), then what's the point of using this method in the first place?    This just seems like circular reasoning to me.

My understanding is that when using a Bayesian approach to estimate parameter values:   The posterior distribution is the combination of the prior distribution and the likelihood distribution. We simulate this by generating a sample from the posterior distribution (e.g., using a Metropolis-Hasting algorithm to generate values, and accept them if they are above a certain threshold of probability to belong to the posterior distribution). Once we have generated this sample, we use it to approximate the posterior distribution, and things like its mean.   But, I feel like I must be misunderstanding something. It sounds like we have a posterior distribution and then sample from it, and then use that sample as an approximation of the posterior distribution. But if we have the posterior distribution to begin with why do we need to sample from it to approximate it?


My form in view is   <?php        $attributes = array('id' => 'myForm');       echo form_open_multipart('', $attributes); ?>
         Main Image         <input type="file" class="form-control-file" id="image" name="image" aria-describedby="fileHelp">

         <button type="button" class="btn btn-primary" id="add">ADD</button>         <button type="reset" class="btn btn-primary">Reset</button>
 <?php echo form_close(); ?>        And my script is as follows      And my addArticleData function inside the controller form contains  if(isset($_FILES["image"]["name"]))       {          $config = array(             'upload_path' => "images",             'allowed_types' => "*",             'overwrite' => TRUE,             'max_size' => "2048000", // Can be set to particular file size , here it is 2 MB(2048 Kb)             'max_height' => "768",             'max_width' => "1024"         );         $this->load->library('upload', $config);         if($this->upload->do_upload('image'))         {             $data = array(                  'image' => $this->input->post('image')              );             //print_r($data);             if($this->modal->insert($data, 'admin')) {                 echo "DATA INSERTED SUCCESSFULLY";             }         }         else {             echo "ERROR";         }     } else {         echo "FILE NOT SET";     }   The problem is that whenever I tried to execute this script it alerts FILE NOT SET. And if I print $_FILES using print_r($_FILES);exit; it alerts an empty array.   Further if I try commented print_r($data);exit; and remove all the lines preceding it then  it alerts the name of the image uploaded as C:\fakepath\image.png  I just can't understand why this is not working. Please HELP

I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); });  File <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/>     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?


How do I add a question to my favorites in the Stack Exchange Android application?

I've found an interesting question when browsing Freelancers.SE. I've tried to star (favorite) the question but I couldn't find the option...  How to star a question from the Android app?


What is the sync point of a Sql Server backup? If I have a full backup that runs from 20:12 to 20:38, when I restore the backup is it restoring to the state at 20:12? 20:38? Some other point?

If I run a SQL Server database backup via Management Studio and there are scripts running at the same time, does the backup reflect the point in time when the backup was started or when it ended? My db is about 10GB so the backup takes some time, meaning there's lots of things that could go on in the meantime.  I'm using SQL Server 2008 R2  I just posted  but think this is probably a better place for it?


I have a dataset of 1931 observations and I intend to predict a binary outcome out of that. There is a list of 128 predictors (both binary and continuous). First I ran logistic regression modeling using all predictors and got a highly significant model (AUC = 0.84). Assuming that the high value of AUC was due to overfitting the model by using too many predictors, I did stepwise modeling to find the effective predictors:   mylogit <- glm(outcome ~ . , data = temp,family="binomial") step <- step(mylogit, direction="both")   Now, I am not sure whether should I have done cross validation before or after stepwise modeling.

I have recently been reading a lot on this site (@Aniko, @Dikran Marsupial, @Erik) and elsewhere about the problem of overfitting occuring with cross validation - (Smialowski et al 2010 Bioinformatics, Hastie, Elements of statistical learning).  The suggestion is that any supervised feature selection (using correlation with class labels) performed outside of the model performance estimation using cross validation (or other model estimating method such as bootstrapping) may result in overfitting.   This seems unintuitive to me - surely if you select a feature set and then evaluate your model using only the selected features using cross validation, then you are getting an unbiased estimate of generalized model performance on those features (this assumes the sample under study are representive of the populatation)?  With this procedure one cannot of course claim an optimal feature set but can one report the performance of the selected feature set on unseen data as valid?  I accept that selecting features based on the entire data set may resuts in some data leakage between test and train sets. But if the feature set is static after initial selection, and no other tuning is being done, surely it is valid to report the cross-validated performance metrics?   In my case I have 56 features and 259 cases and so #cases > #features. The features are derived from sensor data.  Apologies if my question seems derivative but this seems an important point to clarify.  Edit: On implementing feature selection within cross validation on the data set detailed above (thanks to the answers below), I can confirm that selecting features prior to cross-validation in this data set introduced a significant bias. This bias/overfitting was greatest when doing so for a 3-class formulation, compared to as 2-class formulation.  I think the fact that I used stepwise regression for feature selection increased this overfitting; for comparison purposes, on a different but related data set I compared a sequential forward feature selection routine performed prior to cross-validation against results I had previously obtained with feature selection within CV. The results between both methods did not differ dramatically. This may mean that stepwise regression is more prone to overfitting than sequential FS or may be a quirk of this data set.


To begin, here is a MWE:  \documentclass[12pt]{article}  \usepackage{float} \usepackage{tikz} \usepackage{subfig} \usepackage{ifthen}  \begin{document}  \newcommand{\titlename}[1] {     \ifthenelse{\equal{#1}{a}}{First}{}     \ifthenelse{\equal{#1}{b}}{Second}{} }  \foreach \y in {a,b}{     \foreach \a in {No,Yes}{             \begin{table}[H]         \captionsetup{width=.9\linewidth}         \caption{\protect\titlename{\y}, \a  ~Other Text}         \end{table}     } }  \end{document}   This produces captions:  Table 1: First , No Other Text Table 2: First , Yes Other Text Table 3: Second , No Other Text Table 4: Second , Yes Other Text   My question is simple: How can I get rid of the extra space after First and after Second? In other words, the comma should directly follow First and Second as the case may be.

I see that the code in many packages and examples contains percent signs % at the end of (many) lines. What are they used for? Do they affect the parsing of those lines?


When I am searching my website on Google cache version is showing 404 errors. I tested same for some other competitors also and the same problem is there. Reviewed on Google Search Console, all good there. But does anyone know why is so happening and how can I get cached version now?

My site is getting 404. That’s an error. message when I click on cached from Google search results.  This is the error message from Google:  That’s an error.   The requested URL /search?q=cache:8kxLAgFrhZQJ:www.mysite.com.....&cd=8&hl=en&ct=clnk&gl=uk was not found on this server. That’s all we know.  What I did before I was getting this error is that about 10 days ago, I moved my hosting from Ixwebhosting to Gearhost (cloud based). I also added 301 redirect from non www to www.  I have no idea why I am getting this error. Please advise what might be the reason if there is a solution for it.  All of my pages are indexed by Google though.


I have a spreadsheet of data on my website, which is loaded in from a database, and the result looks something like this:

     <button>Edit</button>	     <button>Delete</button>	     First Name	     Last Name	     ...

   More content (rows) appear as the user scrolls down, and this is done with Ajax, like so:  $(document).ready(function(){ /*Get more clients on scroll*/ var clientCount = 33; $(window).scroll(function(){     var leftToBottom = $(document).height() - $(window).height() - $(window).scrollTop();     if( leftToBottom == 0) {         clientCount = clientCount + 11;         $("#tbody").load("loadClients.php", {             clientNewCount : clientCount         });         } }); });   However, each row of data has something like an edit button which opens a modal, a delete button, a multiple-delete-selection, etc. These are all manipulated through jQuery/JS.  This question gave me an idea of what to do, but I just couldn't apply it to my code:   Someone suggested using the ajaxComplete() function, but this means the jQuery code will only work after the ajax content has been completed (duh).  Aside from using the $(document).ajaxComplete() function, what can I do to apply my jQuery code to the new ajax content?  Problem is, the jQuery code won't work UNTIL the user scrolls down to get more content. So a user cannot edit, delete or select any data until they scroll down all the way to fetch the new content.  Pray, how can I apply the jQuery to both the content BEFORE the ajax call as well as AFTER the ajax call?  Currently I am including the jQuery script in both documents; the original document and the loaded-content. I'm sure this isn't the correct way to do it, but for now it is working.  P.S. the jQuery code contains many click events, preventDefaults, and other basic code to open and close modals.

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I want to retrieve the filenames of all the files with .xml extension present in various subfolders in a single directory,

How do I get a list of all files (and directories) in a given directory in Python?


How can I add my Listings to the \lstlistoflistings?! Here is the Listing with example:  \documentclass[a4paper,11pt]{article} \usepackage[ngerman]{babel}  \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}  \usepackage{listings} \usepackage[many]{tcolorbox} \tcbuselibrary{listings}  \newtcblisting[auto counter,number within=section]{cpp}[2][]{   title={Listing \thetcbcounter: #2},   coltitle=black,   colback=white,   boxrule=0pt,   arc=0pt,   outer arc=0pt,   top=0pt,   bottom=0pt,   colframe=white,   listing only,   left=15.5pt,   enhanced,   listing options={     basicstyle=\footnotesize\ttfamily,     keywordstyle=\color{blue}\ttfamily,     stringstyle=\color{red}\ttfamily,     commentstyle=\color{green}\ttfamily,     breaklines=true,     language=C++,     showstringspaces=false,     tabsize=2,     numbers=left   },   overlay={     \fill[gray!30]        ([xshift=-3pt]frame.south west)       rectangle        ([xshift=11.5pt]frame.north west);   } }    \begin{document}  \lstlistoflistings  \begin{cpp}{iwconfig Aufruf} root:~> iwconfig eth0 eth0      IEEE 802.11-bgn  ESSID:off/any             Access Point: Not-Associated   Bit Rate=0 kb/s  \end{cpp}  \end{document}   Using the code above for it only shows the \listoflistings Title and the listing itself but nothing inside the list of listings:

In a book with figures, tables and listings, I figured out that all listings and some tables and figures look better when presented in a tcolorbox. The book has the usual tables of contents:  \tableofcontents{} \listoffigures{} \listoftables{} \lstlistoflistings{}   but tcolorboxes have their own headlines (and may define their own counters), so it seems redundant (and unattractive) to have the usual captions and labels for figures, tables and listings too.   So my question is how to produce the lists of figures/tables/listings the reader expects after the ToC when    tcolorbox is used exclusively? tcolorbox is used sometimes, while the plain listings package and regular  table/figure environments are used in other cases?   EDIT: Here is a MWE (adapted from T.F.Sturm) that has figures, tables and listings as well as a tcolorbox theorem and listing with a label and a counter. How do I make them appear in the ToC section in the beginning of the file?  \documentclass{article} \usepackage{tikz} \usepackage{here} \usepackage[listings,theorems]{tcolorbox} \tcbset{noparskip} \begin{document} \tableofcontents{} \listoffigures{} \listoftables{} \lstlistoflistings{} \pagebreak{} %---------------------------------------------------------- \section{Colored boxes}  \begin{tcolorbox}[colback=red!5,colframe=red!75!black]   My box. \end{tcolorbox}  \begin{tcolorbox}[colback=blue!5,colframe=blue!75!black,title=My title]   My box with my title. \end{tcolorbox}  %---------------------------------------------------------- \section{\LaTeX-Examples}  \begin{tcblisting}{colback=red!5,colframe=red!75!black} This is a \LaTeX\ example: $\displaystyle\sum\limits_{i=1}^n i = \frac{n(n+1)}{2}$. \end{tcblisting}   %---------------------------------------------------------- \section{Theorems}  \newcounter{mytheorem}[section] \def\themytheorem{\thesection.\arabic{mytheorem}}  \tcbmaketheorem{theo}{Theorem}{fonttitle=\bfseries\upshape, fontupper=\slshape,      arc=0mm, colback=blue!5,colframe=blue!75!black}{mytheorem}{theorem}  \begin{theo}{Summation of Numbers}{summation}   For all natural number $n$ it holds:\\[2mm]   $\displaystyle\sum\limits_{i=1}^n i = \frac{n(n+1)}{2}$. \end{theo}  We have given Theorem \ref{theorem:summation} on page \pageref{theorem:summation}.  \pagebreak{} %----------------------------------------------------------  \section{Tables, Listings and Figures} %---------------------------------------------------------- This is table 1 %----------------------------------------------------------  \begin{table}[H]   \centering   \begin{tabular}{ll}     Header1 & Header2 \\ \hline     Cell1 & Cell2 \\   \end{tabular}   \caption{My Table No1}   \label{tab:tab-1} \end{table}   %---------------------------------------------------------- This is table 2   \begin{table}[H]   \centering   \begin{tabular}{ll}     Header3 & Header4 \\ \hline     Cell3 & Cell4 \\   \end{tabular}   \caption{My Table No2}   \label{tab:tab-1} \end{table}  %---------------------------------------------------------- This is figure 1 %---------------------------------------------------------- \begin{figure}[H]   \centering \begin{tikzpicture}     \draw (0,0) node {A} --           (2,0) node {B}; \end{tikzpicture}    \caption{Figure No1}   \label{fig:fig-1} \end{figure} %---------------------------------------------------------- This is figure 2 %---------------------------------------------------------- \begin{figure}[H]   \centering \begin{tikzpicture}     \draw (0,0) node {C} --           (2,0) node {D}; \end{tikzpicture}    \caption{Figure No2}   \label{fig:fig-2} \end{figure}  \begin{lstlisting}[caption={Java Logic 1},label=java1] public class Main {     public Main(String args[])     {         // Java logic in listing 1     } } \end{lstlisting} %\label{code:Listing-1}  \begin{lstlisting}[caption={Java Logic 2},label=java2] public class Main {     public Main(String args[])     {         // More Java logic in listing 2     } } \end{lstlisting} %\label{code:Listing-2}  \end{document}   Here is the output:


I have installed Ubuntu 15.04 on a Lenovo w550s which has > 200DPI. When I switch into the text-only console (using Ctl-Alt-F1 etc), then the text is so tiny that it can barely be read.   I have tried to fix this using this procedure:      But from the font selection menu, no font that was significantly larger was available (I chose the biggest one from the list) and the text on the console (Ctrl-Alt-F1) is still too tiny to be readable.

I am using Ubuntu 12.04. Recently, the font size for all of my TTYs became much larger.  How can I change the font size back to the default?


I remember reading a young-adult sci-fi novel many years ago (early 90's), but I don't remember much about it, even though I read it at least twice. I recall it being an important transitional book for me, and I think that's why I read it more than once. It was the first time I was intrigued by something more sophisticated.  As I recall, the basic plot involved a manned mission to explore a planet or a moon. There was a multi-legged alien that started out as a pet (but was discovered to be more than that?). I think it even had some kind of interesting color-changing behavior.   There was lots of talk about space-dust being a problem at the speeds they were traveling, and I think there was an emergency or two involving related hull-breaches. They might have sealed them with expanding glue from specialized guns?  The main character was a man.  ...there was a woman as part of the mission.  ...there was a cocoon of some kind. I think related to the pet alien?  The title might also have had the word "topaz" in it.

I recall a book I read back in middle school (ca. 1981), where humanity had sent an astronaut to check out signs of an intelligent race or something like that, but he disappeared.  Earth then sends his younger brother to see what happened, but using an older spacecraft because the first mission used the only up-to-date one Earth had.  Also they refuse to let him take any weapons, to avoid any possible provocation.  On the way something impacts his windshield, punching a hole through it.  He thinks either it was a meteoroid, or a laser beam--but no Earth laser beam could punch a hole that small from more than 1000 miles away.  He later finds the aliens, who are blobs with tentacles or something like that (my memory's hazy), and he's out in his space suit.  He doesn't have a laser to defend himself with, so he uses his communicator (or something like that), setting it to CODE, its most intense setting.  That seems somehow to disable the alien, and soon it's in trouble.  He comes out to it and tries to pull it away from danger, but of course with nothing to push/pull against, his efforts are in vain--but it turns out that convinces the aliens that humanity really means them no harm, so he returns to Earth a hero.  That's as best I can remember the story.  Does it ring any bells for anyone?


I downloaded the files through this website onto my flashdrive and am wondering how to boot it up?

I tried to use the usb-creator.exe from Ubuntu 10.10 desktop i386 ISO image and it does create an USB stick that doesn't boot. When I try to boot from it I get:     Operating System not found.   I try to do this from Windows 7 x64. I'm not looking to create a live Ubuntu media, only an installation USB disk.  I repeated the process several times and I even tried to reformat the USB drive (FAT32), no success yet.  The USB stick is a 8GB one.


I am solving assignments in Real analysis but I am unable to think about how I can solve this question.  Let $f: ( 0, \infty ) \to \mathbb{R}$  be a continuous function. Does $f$ maps any Cauchy sequence to a Cauchy sequence.  I tried by taking $ {x_n} $ and using |$x_n $ - $x_m$| <$\epsilon$ for all  $n, m > N$ ( $N$ is a natural number) . But how can I formulate the Cauchy sequence property of $x_n$  into $f(x_n$) ? I am unable to think about it. Any hints please?

Let $(X,d)$ be a metric space. A function $f:X\rightarrow X$ maps Cauchy sequences to Cauchy sequences. Then if $x_n\rightarrow x$, then $\{x_n\}$ is Cauchy, implying $\{f(x_n)\}$ is Cauchy. But if $X$ is not complete then $\{f(x_n)\}$ may not converge, let alone converging to $f(x)$. So the condition doesn't imply $f$ is continuous.   However what about the converse? If $f$ is continuous does it take Cauchy sequences to Cauchy sequences?


I was working through the proof of the convergence of the Maclaurin series for certain functions, and I came across this limit, which I want to prove, but am not sure how to prove. $\lim_{x\to\infty} \frac{a^x}{x!}=0$, $a>0, a\in N$ For this limit, techinically $x!$ should grow faster than $a^x$ for any value of $a$, but when $a$ is really big, then the limit becomes hard to prove. Using L'Hospital is not really feasible, as an exponential function always has an exponential in its derivative and the factorial function doesn't have a derivative. I then tried using the definition of limits: Limit is true when for all $\varepsilon>0$ there exists $m$ such that if $x>m$, then $∣f(x) ∣ = |\frac{a^x}{x!}|<\varepsilon$. But then I have no clue what value $m$ should be relative to $\varepsilon$. I'm not sure if this is the way to solve the limit.

Why is     $$\lim_{n \to \infty} \frac{2^n}{n!}=0\text{ ?}$$   Can we generalize it to any exponent $x \in \Bbb R$? This is to say, is     $$\lim_{n \to \infty} \frac{x^n}{n!}=0\text{ ?}$$     This is being repurposed in an effort to cut down on duplicates, see here: Coping with  duplicate questions.  and here: .


This has been confusing for me.  Some say:     "I'm laying on/in my bed."   Others say:     "I'm lying on/in my bed."     Which is correct? Do the sentences have any difference?  I'm not sure which preposition to use either. Can ON and IN be used with these verbs?

I'm confused about lay and lie. Please look at these examples:     "Don't lie in the sun for too long."   "The dog was lying dead on the floor."   "She lay back against the pillows."   "I told her a lie about what I was doing."    What are differences between these sentences?


I have installed MinionPro fonts under Windows 7 using Miktex 2.9 by following the steps in the instruction you can read online on Scribd () and load down for free from LaTeX Community ().  Everything works well except that \epsilon is substituted by a rectangle. Here is my MWE:  \documentclass{article} \usepackage[T1]{fontenc} \usepackage[mathlf,textlf,minionint]{MinionPro} \renewcommand{\sfdefault}{Myriad-LF} \begin{document} $\epsilon$ \end{document}   I have seen some solutions suggested here but they require installing cygwin, running different shells and makefile, etc., that for a Windows guy are overwhelming. I was wondering if there exist an easier solution that does not require these steps.

I'm using MiKTeX 2.9 and have recently installed the Minion Pro fonts for use with pdftex. I followed the instructions available on  to install them.  Everything works as expected, but in place of the Greek letter epsilon I get a box with a cross (see below), and the following warning:    I found the issue was reported , but I still can't fix it. xelatex works fine, but I'd like to to stick to pdftex so I can use microtype.  \documentclass{article}  \usepackage[T1]{fontenc} \usepackage{MinionPro}  \begin{document}  Text here. $\epsilon$  \end{document}       UPDATE: a set of instructions for the installation of the up-to-date FontPro scripts with MiKTeX can be found .


My initial concept was:     One should finish one's meal.   When a user logs in to his/her email...   A person bought a cake for his/her work.   However, in the recent (8-10) years, I have been seeing more and more references like these:     One should finish their meal.   When a user logs in to their email...   A person bought a cake for their work.   Which of the two approaches above is correct? Do they have to do something with the difference between British and American English?

Is there a pronoun I can use as a gender-neutral pronoun when referring back to a singular noun phrase?  Each student should save his questions until the end. Each student should save her questions until the end.


Here is my JUnit code for a test case of the cube root method I created that implements Newton's method:  @Test public void standardCase_negative64e9() {   double n = -64E9;   double result = csc143.newton.Roots.cbrt(n);   double delta = n * 1E-8;   assertEquals("Standard cube root -64E9", -4.0E3, result, delta); }   When I do the tests for all my test cases (using DrJave IDE) I only get a failure for this test case, and it reads:  Failure: java.lang.AssertionError: Standard cube root -64E9 expected:<-4000.0> but was:<-4000.0000000003124>   I feel this has something to do with my "delta" value (which is -640 in this case) because when I replace "delta" with 640 (instead of -640) in the assertEquals() method, I do not get a failure...

public class doublePrecision {     public static void main(String[] args) {          double total = 0;         total += 5.6;         total += 5.8;         System.out.println(total);     } }   The above code prints:  11.399999999999   How would I get this to just print (or be able to use it as) 11.4?


I was working on a problem from a MOOC, and had to give up and look at the solution. But I am not sure about a particular part of this solution. Here is the code:  def playGame(wordList): """ Allow the user to play an arbitrary number of hands.  1) Asks the user to input 'n' or 'r' or 'e'.   * If the user inputs 'n', let the user play a new (random) hand.   * If the user inputs 'r', let the user play the last hand again.   * If the user inputs 'e', exit the game.   * If the user inputs anything else, tell them their input was invalid.  2) When done playing the hand, repeat from step 1     """  turn = 0 user_input = ""  while user_input != 'e':     user_input = raw_input("Enter n to deal a new hand, r to replay the last hand, or e to end game: ")      if user_input == 'r' and turn ==0:         print "You have not played a hand yet. Please play a new hand first! \n"      elif user_input == 'r' and turn > 0:         playHand(hand, wordList, HAND_SIZE)      elif user_input == 'n':         hand = dealHand(HAND_SIZE)         playHand(hand, wordList, HAND_SIZE)         turn = 1      elif user_input !='e':         print "Invalid command."   How is it possible that the value of hand doesn't reset to a new value? So for example, user input is "n" the first time around, and second time around the input is 'r'. Shouldn't there be no value for the hand variable? But in reality the value for hand is staying the same. Doesn't everything in the while loop reset when coming back around? Or am I wrong?

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


When I ran a Neural Network modeling for multi-class labeling using Keras, the accuracy, loss, val_accuracy, and val_loss all seems to have nan at some point or other during the training process... Running environment and other info  Keras version: '2.4.0' TensorFlow version: '2.3.0' OS: Ubuntu 20.04.1    LTS GPU: Radeon RX 580 Series Python running in Jupyter Notebook    (there is no library version issue)  Thank you for you kind help. Code I used: # data import n prep data_irr = pd.read_csv( 'https://www.dropbox.com/s/97awk5f9rgn5k87/irrigation_machine.csv?dl=1') df_TRAIN = data_irr.sample( frac=  78./100 ) df_TEST  = data_irr.drop( df_TRAIN.index )  # TRAIN data X_train = df_TRAIN.drop( df_TRAIN.columns[ [0,21,22,23] ], axis= 1 ); X_train Y_train = df_TRAIN[['parcel_0','parcel_1','parcel_2']]; Y_train  X_train = X_train.to_numpy(); Y_train = Y_train.to_numpy()   # TEST data X_test = df_TEST.drop( df_TEST.columns[[0,21,22,23]], axis= 1 ); X_test Y_test = df_TEST[['parcel_0','parcel_1','parcel_2']]; Y_test.head()  X_test = X_test.to_numpy();  Y_test = Y_test.to_numpy()   ## model architecture  model1 = keras.Sequential() model1.add(             keras.layers.Dense( 64, activation= 'relu', input_shape= (X_train.shape[1],) ) ) model1.add(             keras.layers.Dense( 3, activation= 'sigmoid' ) )  model1.compile(                  optimizer= 'adam', loss= 'categorical_crossentropy', metrics= ['accuracy'] ) model1.summary()   model1.fit(              x= X_train, y= Y_train,             epochs= 15, validation_split= 20./100,             verbose= 2 )  The result of the training is: Epoch 1/15 39/39 - 0s - accuracy: nan - loss: nan - val_accuracy: 0.5481 - val_loss: -5.4487e-02 Epoch 2/15 39/39 - 0s - accuracy: nan - loss: nan - val_accuracy: nan - val_loss: nan Epoch 3/15 39/39 - 0s - accuracy: 0.5433 - loss: nan - val_accuracy: 0.7981 - val_loss: 1.8837e-07 Epoch 4/15 39/39 - 0s - accuracy: nan - loss: nan - val_accuracy: 1.1190 - val_loss: 0.3816 Epoch 5/15 39/39 - 0s - accuracy: nan - loss: nan - val_accuracy: 0.8221 - val_loss: nan Epoch 6/15 39/39 - 0s - accuracy: 0.5529 - loss: nan - val_accuracy: 0.9802 - val_loss: 0.2807 Epoch 7/15 39/39 - 0s - accuracy: 0.5473 - loss: nan - val_accuracy: 0.8893 - val_loss: 0.0128 Epoch 8/15 39/39 - 0s - accuracy: 0.5537 - loss: nan - val_accuracy: 0.8287 - val_loss: inf Epoch 9/15 39/39 - 0s - accuracy: 0.6186 - loss: nan - val_accuracy: 0.7756 - val_loss: 1522.9906 Epoch 10/15 39/39 - 0s - accuracy: 0.5905 - loss: nan - val_accuracy: 0.8085 - val_loss: 0.1824 Epoch 11/15 39/39 - 0s - accuracy: 0.6250 - loss: nan - val_accuracy: 0.8007 - val_loss: 0.0545 Epoch 12/15 39/39 - 0s - accuracy: 0.6514 - loss: nan - val_accuracy: 0.8980 - val_loss: 13932.9346 Epoch 13/15 39/39 - 0s - accuracy: 0.5457 - loss: nan - val_accuracy: 0.8000 - val_loss: nan Epoch 14/15 39/39 - 0s - accuracy: 0.5545 - loss: nan - val_accuracy: 1.9837e-07 - val_loss: -1.8476e+10 Epoch 15/15 39/39 - 0s - accuracy: 0.5409 - loss: nan - val_accuracy: 2.0768e-07 - val_loss: 0.5513 <tensorflow.python.keras.callbacks.History at 0x7f92602e0f98>

I'm implementing a neural network with Keras, but the Sequential model returns nan as loss value. I have sigmoid activation function in the output layer to squeeze output between 0 and 1, but maybe doesn't work properly.  This is the code:  def data_generator(batch_count, training_dataset, training_dataset_labels):   while True:     start_range = 0     for batch in batch_count:       end_range = (start_range + batch[1])       batch_dataset = training_dataset[start_range:end_range]       batch_labels = training_dataset_labels[start_range:end_range]       start_range = end_range       yield batch_dataset, batch_dataset  mlp = keras.models.Sequential()  # add input layer mlp.add(     keras.layers.Input(         shape = (training_dataset.shape[1], )     ) ) # add hidden layer mlp.add(     keras.layers.Dense(         units=training_dataset.shape[1] + 10,         input_shape = (training_dataset.shape[1] + 10,),         kernel_initializer='random_uniform',         bias_initializer='zeros',         activation='relu')     ) # add output layer mlp.add(     keras.layers.Dense(         units=1,         input_shape = (1, ),         kernel_initializer='glorot_uniform',         bias_initializer='zeros',         activation='sigmoid')     )  print('Compiling model...\n')  mlp.compile(     optimizer='adam',     loss=listnet_loss )  mlp.summary() # print model settings   # Training with tf.device('/GPU:0'):   print('Start training')   #mlp.fit(training_dataset, training_dataset_labels, epochs=50, verbose=2, batch_size=3, workers=10)   mlp.fit_generator(data_generator(groups_id_count, training_dataset, training_dataset_labels),                     steps_per_epoch=len(training_dataset), epochs=50, verbose=2, workers=10, use_multiprocessing=True)   How can I do?


Always wondered this, but never fully investigated - is there any way to get named parameters in bash?  For example, I have this:  function ql_maybe_fail {   if [[ "$1" == "true" ]]; then       echo "quicklock: exiting with 1 since fail flag was set for your 'ql_release_lock' command. "       exit 1;   fi }   is it somehow possible to convert it to something like this:  function ql_maybe_fail (isFail) {   if [[ "$isFail" == "true" ]]; then       echo "quicklock: exiting with 1 since fail flag was set for your 'ql_release_lock' command. "       exit 1;   fi }

Is there any easy way to pass (receive) named parameters to a shell script?  For example,   my_script -p_out '/some/path' -arg_1 '5'   And inside my_script.sh receive them as:  # I believe this notation does not work, but is there anything close to it? p_out=$ARGUMENTS['p_out'] arg1=$ARGUMENTS['arg_1']  printf "The Argument p_out is %s" "$p_out" printf "The Argument arg_1 is %s" "$arg1"   Is this possible in Bash or Zsh?


I recently bought an external non-standard 7000 mAh battery for my Samsung Galaxy S3 but the phone doesn't seem to recognize it.  Is it possible that the phone needs to be reconfigured or recalibrated so as to recognize the difference in the battery capacity?

I recently purchased an extended battery for my ailing Galaxy S4. It's supposedly rated at 4000 mAh over the previous 2600 mAh OEM battery.  First time I threw it in, I turned on the phone, chucked in the battery, and sat it on the charger for an hour or so.  It actually lasted a pretty long time. About 2 days and 5/6 hrs. SoT (not fantastic for 4000 mAh, but it's new so what the heck).  So, listening to the advice of others, I threw it on the charger until completely topped off while the phone was shut down. Again, I discharged it from 100%. However, this time, the battery drained much faster than usual. There weren't any particular apps draining the battery, it just drained faster.  Seeing as this was strange, I drained it to 0%, and charged it back up. Still, the same terrible battery drain. It may be I have to cycle it a couple more times.  Advice? How should I correctly calibrate an extended battery?


I have received a new winter hat, which is given on vote/post on 25 December:    but in my country it is yet 24 December:    Should not be the hat given using user's local time?

I just got the  hat which states "post or vote on December 21".  Does SE have a time machine now?


My textbook points out the following predicament, and I do not know the answer, despite a lot of thinking:  A spring is hanging of a ceiling and a mass is attached. As a result the spring descends to a lower equilibrium point, crossing (vertical) distance $x$ .  The potential gravitational energy of the mass was $mgx$ . Once at the new equilibrium point, this $mgx$  is now $0$ .  The spring's potential energy is $\frac{1}{2}kx^2$ . However, we know that in this scenario $kx=mg$ , as it was gravity that provided the force.  Thus the spring's potential energy, which is actually $\frac{1}{2}kx^2$ , can be rewritten as $\frac{1}{2}mgx$ .  How come that only half of the original potential gravitational energy was converted into the spring's potential energy? Where did the other half go? Was the law of conservation of energy broken?  (the above was translated to the best of my abilities: I hope it is as clear as in the original!)

If a spring is stretched by a weight of mass m, (so the extension is $\Delta x$) then $ k = \frac W{\Delta x} = \frac {mg}{\Delta x}$. So $ k\Delta x= mg $.  When the Spring is stretched by distance $\Delta x$ (by the weight) then it looses gravitational potential enegry. ($ \Delta GPE= mg\Delta x$)  But, when we calculate the change in elastic potential energy, We get  $ U = \frac 12 k(\Delta x)^2 $. Since $ k\Delta x = mg$, $U=\frac 12 mg\Delta x$  At, equilibrium we have no kinetic energy $E_k = 0$  Doesn't that violate Energy Conservation?  Where does the rest of lost GPE goes?  Here's a illustration


Are PHP sessions automatically destroyed after the browser is closed, or do they stay on the server for ever, and are later accessible by the Server Cookie Id? (in case you do not destroy them before the browser exit).

If I hit a page which calls session_start(), how long would I have to wait before I get a new session ID when I refresh the page?


For some strange reason I cannot insert a username into the database, but when I change the value into any integer it works once I click like, it works.   $postid = $_POST['postid']; $userid = $_GET['username']; $result = mysqli_query($dbh,"SELECT * FROM user_images WHERE id=$postid"); $row = mysqli_fetch_array($result); $n = $row['likes']; mysqli_query($dbh,"INSERT INTO likes(username, postid) VALUES($userid, $postid)"); mysqli_query($dbh,"UPDATE user_images SET likes=$n+1 WHERE id=$postid"); echo $n+1; exit();

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I have an iPhone 4S running iOS 5 and cannot find (after trying) any app that blocks calls. Is there anything out there that can block calls on the iPhone?

How do I block unwanted callers without jailbreaking?


I want to be noticed after a command has finished its execution. And I was thinking that if I hear a sound is a good idea.   For example, because I have a slow internet connection, the following command take long time to execute:  sudo apt-get update && sudo apt-get upgrade   So I let the terminal to run in background running the above command, but I want to hear a sound when it finished.

I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound.


Eggs that were never refrigerated and placed in an ACed room at a constant temperature of 77-78f (25-26c), how long before they start to go bad?

I've read a lot of conflicting advice on whether it's advisable to store eggs in the refrigerator. The case against seems twofold: (1) that eggshells are porous, and eggs can take on unwelcome flavours, or even spoil faster in the fridge, and (2) that cooking with cold eggs can be problematic. But lots of people refrigerate eggs through perceived necessity.  Do eggs last longer in the fridge, and is the shelf life gain worth it? Or should I just stick them in the cupboard?


How does ist come that c and today is not visible in fetchingData() ? I get a NullPointer-Exception when running the code in main-class :/ Thanks for any help!  public class InputData {      Calendar c;     Date today;      String DATE_FORMAT = "MM/dd/yyyy";     SimpleDateFormat sdf;      Double[][] hPrice;     Double[][] qhPrice;     Double[][] qhEua;     Double[][] qhGas;     Integer[][] qhTemperature;     Integer[][] qhAirpressure;      Date[][] qhDate; // may be useful some day     Date[][] qhWeatherDate; // may be useful some day      public InputData() {         Calendar c = Calendar.getInstance();         Date today = new Date();         today = c.getTime();         SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);         System.out.println(sdf.format(today));     }      public void startFetching() {         // +++ Access-Import EUA's +++         Access aQuery = new Access();         c.add(Calendar.DATE, -1);         today = c.getTime();         aQuery.eua(sdf.format(today));

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Dini's Theorem states: Let $[a,b]$ be a compact intervall. Let $f,f_{n}: [a,b] \xrightarrow{} \mathbb{R}$, $ n \in \mathbb{N}$, functions with   $f$ and $f_{n}$ are continuos for all $n$ $\lim_\limits{n \to \infty} f_{n}(x) = f(x)$ $\forall x \in [a,b]$ $f_{n}(x) \leq f_{n+1}(x)$ $\forall x \in [a,b]$ and $n \in \mathbb{N}$.   Then $\{f_{n}\}_{n \in \mathbb{N}}$ converges uniformly to $f$.   Suppose only conditions $1$ and $2$ are satisfied. Are in this case  $\{f_{n}\}_{n \in \mathbb{N}}$ also converges uniformly to $f$?  The reason why I'm asking this quesion ist that I found a variant of Dini's theorem that states if condition $1$ and $2$ are satisfied and we have that $f_{n}$ is a so called commute sequence, i.e. f_{n} has a monotonically increasing and a monotonically decreasing part, then Dini's Theorem also holds

Suppose $f_n$ is a sequence of functions defined a set $K$ with pointwise limit function $f$.  I am confused about the following.      If the following conditions are satisfied:         $f_n$  is continuous on $K$ for all $n$.   The pointwise limit $f$ is continuous on $K$.   $K$ is a compact interval (i.e., a closed and bounded interval in $\mathbb{R}$).   The convergence of $f_n$ to $f$ is increasing or decreasing.         Then does this imply that $f_n$ is uniformly convergent to $f$?   Now a different problem: If one of these conditions is not satisfied, does this imply that $f_n$  is not uniformly convergent to $f$?  If $f_n$ is not uniformly convergent to f, does this mean that one these four conditions doesn't hold?   In general: what is the logical relationship between uniform convergence and these four conditions?  Please, I need answers to all the above questions because this theorem always confuses me when I solve the problems and I don't know how to use it properly. Thanks for your help in advance.


Noether’s theorem can be defined for the invariance of the action under variations of paths induced by a coordinate transformation which depends continuously on a parameter, $\epsilon$, $q_i(t) \rightarrow \bar{q}_i(t, ε)$, $\bar{q}_i(t, 0) = q_i(t)$.  What differences are there between the variations, $δ_{q_i}$, considered in Hamilton’s principle, and the variations considered in Noether’s theorem?

I was reading about symmetry of action when I came before the symmetry variation in Particles and Quantum Fields by H. Kleinert; there he wrote:     Symmetry variations must not be confused with ordinary variations $\delta q(t)$ used to derive the Euler-Lagrange equations. While the ordinary variations   $\delta q(t)$ vanish at initial and final times, $\delta q(t_b) = \delta q(t_a) = 0,$ the symmetry variations $\delta_s q(t)$ are usually non-zero at the ends.   So, isn't $\delta_s q$ a virtual variation? For, if it would be, it should have vanished in the fixed initial and final time, $t_a$  and $t_b$, isn't it?  Could anyone explain me why the symmetry  variation is different from the ordinary variation?


I'm reading a book on basic analysis and came across the result that given a set $X$, there exists a set $\{Y : Y$ is a subset of $X\}$. The proof is left as an exercise and the hint states that one can start with the set $\{0, 1\}^X$ and apply the replacement axiom, replacing each function $f$ with $f^{-1}(\{1\})$.  While the above route isn't difficult to understand, why can't we just define the required set as: $\{f(X) \mid f\colon X \to X\}$? I suppose this also requires the axiom of replacement (the objects in question being $X$ and $f$) and looks fine to me, but there could be a problem with this reasoning, otherwise the author would've used this definition. If so, what's the problem?   Apologies if this is a really basic question, but I'm working on improving my mathematical logic skills.

I'm stuck at one exercise from chapter of sets from Terence Tao's analysis book. I need to proof the lemma:  Lemma: Let $X$ be a set. Then the set $\{Y : Y \:\text{is a subset of}\: X\}$ is a set.  Note: The set $\{Y : Y \:\text{is a subset of}\: X\}$ is known as the power set of $X$, defined as  $2^X $  I can understand why the lemma is true, but I have no clue how to prove it. Furthermore, the author gave a hint that I found very confusing, it follows:  Hint: start with the set $\{0, 1\}^X$ and apply the replacement axiom, replacing each function $f$ with the object $f^{-1}(\{1\})$.


The following figure shows a cylinder resting on a rough horizontal   rug that is pulled out from under it with acceleration $a$   perpendicular to the axis of the cylinder. What is the motion of the   cylinder, assuming it does not slip?         The only horizontal force on the cylinder is that of friction at $P$. Therefore let us take the moments about $P$. The forces of gravity and reaction at the surface pass through the point $P$, as does also the friction force. Also, we know* that:  $$\dot{\mathbf{L}}=\mathbf{M}-m\mathbf{v}_P \times \mathbf{v}_O$$  Where $\mathbf{L}$ - the angular momentum of the system, $\mathbf{M}$ - the net external torque on the system, $m$ - the mass of the system, $\mathbf{v}_P$ - the velocity of point $P$ (as viewed from an inertial system - say, ground) and $\mathbf{v}_O$ - the velocity of the center of mass.   Because $\mathbf{v}_O\parallel \mathbf{v}_P$ we have $\dot{\mathbf{L}}=\mathbf{M}$. So the net torque about $P$ is $0$. Therefore:  $$\dot{\mathbf{L}}=0 \Rightarrow I_P \omega = \text{const} \Rightarrow \omega = \text{const}$$  which is wrong. Only by taking the moments about $O$ we obtain $\omega \propto a$.  Why my approach was wrong in the first place?    *Let $\mathbf{v}$ and $\mathbf{p}=m \mathbb{v}$ be the velocity and the momentum of a particle with respect to a stationary inertial system $S$, and $\mathbf{r}$ - the radius-vector of the particle with respect to the moving point $P$. The motion of $P$ can be either uniform or nonuniform (accelerating). Suppose $\mathbf{v}_P$ is the velocity of $P$. The angular momentum is $\mathbf{L}=\mathbf{r} \times \mathbf{p}$. Taking the derivative we get $\dot{\mathbf{L}}=\dot{\mathbf{r}} \times \mathbf{p} + \mathbf{r} \times \dot{\mathbf{p}}$. Because $\dot{\mathbf{r}}=\mathbf{v}-\mathbf{v}_P$ we get $\dot{\mathbf{L}}=(\mathbf{v}-\mathbf{v}_P) \times \mathbf{p} + \mathbf{r} \times \dot{\mathbf{p}}$. However $\dot{\mathbf{p}}=\mathbf{F}$ and thus we obtain:  $$\dot{\mathbf{L}}=\mathbf{M}-\mathbf{v}_P \times \mathbf{p}$$  However we can express the momentum $\mathbf{p}$ of the system in terms of $\mathbf{v}_O$ - the velocity of the center of mass: $\mathbf{p}=m\mathbf{v}_O$. Thus: $$\dot{\mathbf{L}}=\mathbf{M}-m\mathbf{v}_P \times \mathbf{v}_O$$

I have been told [Warning: I leave this because it's what I asked and allows to understand the dialogues in the comments, but Azad, whom I thank, has pointed that the formula does not hold in general in the form it is expressed] that the angular momentum of and rigid body with respect to any point $P$ can always be expressed as $$\mathbf{L}_{P}=\mathbf{r}_{cm}\times M\mathbf{v}_{cm}+\big(\sum_im_iR_i^2\big)\boldsymbol{\omega}$$ where $\mathbf{r}_{cm}$ is the position of the centre of mass with respect to $P$, $M$ the mass of the body, $R_i$ the distance of the $i$-th point, having mass $m_i$, composing the body, and $\sum_im_iR_i^2=I$ its moment of inertia with respect to the instantaneous axis of the rotation around the centre of mass of angular velocity $\boldsymbol{\omega}$.  I know that the velocity $\mathbf{v}_i$ of each point $P_i$, having mass $m_i$, of a rigid body of mass $M$ can be see as the sum of a translation velocity of one of its points $C$ plus a rotation velocity around that point: $\mathbf{v}_i=\mathbf{v}_{C}+\boldsymbol{\omega}\times\overrightarrow{CP_i}$. If we chose $C$ as the centre of mass I see that $$\mathbf{L}_{cm}=\sum_i \overrightarrow{CP_i}\times m_i\mathbf{v}_{i}=\sum_i \overrightarrow{CP_i}\times m_i\mathbf{v}_{cm}+\sum_i \overrightarrow{CP_i}\times m_i(\boldsymbol{\omega}\times\overrightarrow{CP_i})$$$$=\sum_i \overrightarrow{CP_i}\times m_i(\boldsymbol{\omega}\times\overrightarrow{CP_i}) $$because, if I am not wrong, $\sum_i \overrightarrow{CP_i}\times m_i\mathbf{v}_C=(\sum_i m_i\overrightarrow{CP_i})\times\mathbf{v}_C=\mathbf{0}$ since $\sum_i m_i\overrightarrow{CP_i}$ is the position of the centre of mass with respect to itself, which is $\mathbf{0}$.  How can it be proved that $\sum_i \overrightarrow{CP_i}\times m_i(\boldsymbol{\omega}\times\overrightarrow{CP_i})=(\sum_im_iR_i^2)\boldsymbol{\omega}$? I have searched a lot on the Internet and on books, but I find nothing. To give some background of mine, I have studied nothing of analytical mechanics. I find the formula very, very interesting both in itself and because, if the moment of inertia does not depend upon time, $\forall t\quad I(t)= I(t_0)$, the above expression can be differentiated to get the formula of the resultant torque with respect to the centre of mass $\sum\boldsymbol{\tau}_{cm}=\frac{d\mathbf{L}_{cm}}{dt}=I\boldsymbol{\alpha}_{cm}$ where $\boldsymbol{\alpha}$ is the angular acceleration around the centre of mass. I heartily thank you for any answer!    Some unfruitful trials: by using the "BAC CAB identity" as suggested by Azad, whom I heartily thank, $\mathbf{a}\times(\mathbf{b}\times\mathbf{c})=(\mathbf{a}\cdot\mathbf{c})\mathbf{b}-(\mathbf{a}\cdot\mathbf{b})\mathbf{c}$, I can see that$$\sum_i \overrightarrow{CP_i}\times m_i(\boldsymbol{\omega}\times\overrightarrow{CP_i})=\sum_im_i\|\overrightarrow{CP_i}\|^2\boldsymbol{\omega}-m_i(\overrightarrow{CP_i}\cdot\boldsymbol{\omega})\overrightarrow{CP_i}$$which, by decomposing every $\overrightarrow{CP_i}$ into an axial component $\mathbf{A}_i$ and a radial component $\mathbf{R}_i$, whose norms respectively are $A_i$ and $R_i$, with $R_i$ as the distance from $i$ to the axis of rotation, becomes $$\sum_im_iR_i^2\boldsymbol{\omega}+\sum_i m_i A_i^2\boldsymbol{\omega}-m_i(\mathbf{A}_i\cdot\boldsymbol{\omega})\overrightarrow{CP_i}$$but I cannot prove that $\sum_i m_i A_i^2\boldsymbol{\omega}-m_i(\mathbf{A}_i\cdot\boldsymbol{\omega})\overrightarrow{CP_i}=\mathbf{0}$.


So I changed back to Ambiance from the Macbuntu theme, but the window border is still the Macbuntu one, I have looked and none of the other questions work on 16.04, so how do I change the window border back to the Ambiance one?

I'm using the gnome flashback session with metacity window manager, but I can't change to any metacity theme in any of the tweaking tools, as they're not even appearing in the lists. Is there anything I can do?


how to insall skype in 13.04, i used this command --- sudo apt-get install skype bt it comes like this  sudo apt-get install skype   output:  [sudo] password for sixdee:  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this?


So I have an acer c7 chromebook and I have chrubuntu 13.10 I think and its 64 bit and I installed steam from the software center but when I open it up it tell me I have to install a package and when I type in my pass word and hit enter it says:   You are missing the following 32-bit libraries, and Steam may not run: libc.so.6

I've already installed Steam, but when I click on the program I get this message  ERROR- You are missing the following 32-bit libraries, and Steam may not run: not   I don't know what to install or even do.


I am new to the Linux community and ended up installing 17.04 a while back ago. However, now I really regret that.  I need to have both Windows 10 and want to upgrade to 18.04 LTS as I hear it's available today. Can you please provide me a step by step guide on doing this? I don't have a great understanding of Linux systems yet, so I would appreciate a guide in layman's terms.

I answered  about do-release-upgrade not allowing an upgrade of 14.10 to 15.04 only to 15.10, I assumed it was due to 15.04 being end of life.  A user (@xangua ) posted that it was not possible to skip a release with do-release-upgrade, so I looked in to this information by running the command on my 14.04 box, but this is where the confusion began.  My 14.04 wants to upgrade straight to 15.04?   Of course this invalidates my answer as 15.04 is end of life, but why does this command seem to be skipping versions, if not based on end of life?   There is no indication any thing from 14.10 is being downloaded by the upgrade and software-updater says Ubuntu 15.04 is now available for download, some clarification of this would be great.