I had windows 10 installed on my asus laptop. Yesterday I installed ubuntu on it but in hurry i clicked clean installation of ubuntu. Which results in deletion of all drive which had so important data in it. I tried testdisk but it is not showing the deleted partition. I also tried many recovery softwares but they also are not showing lost partition. Is there any way to recover it back. Help me as soon as possible!

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


Finding the limit below..:  $$\lim_{n \rightarrow +\infty}\frac{n}{2^n}= ?$$  I really think its 0. But intuitively, infinity over infinity. how can that be? indeterminate forms? Thanks

In other words, how to prove:  For all real constants $a$ and $b$ such that $a > 1$, $$\lim_{n\to\infty}\frac{n^b}{a^n} = 0$$  I know the definition of limit but I feel that it's not enough to prove this theorem.


I'd like to delete a few commits from showing on the commit history on GitHub.  However, I don't want to actually delete the code associated with the specific commit. I'd just like to delete the commit from appearing in the commit history. Is this possible? If so, how?  Thanks!

I "accidentally" pushed a commit to GitHub.  Is it possible to remove this commit?  I want to revert my GitHub repository as it was before this commit.


Let $d \in \mathbb{Z} \setminus \{0, 1\}$ square free, $K = \mathbb{Q}(\sqrt{d})$, $\mathcal{O}_K$ the corresponding ring of integers, $\mathfrak{a} \subseteq K$ a fractional ideal $n, n' \in \mathbb{N}$ with $n\mathfrak{a}, n'\mathfrak{a} \subseteq \mathcal{O}_K$.   I'm currently trying to prove that the definition of the idealnorm for fractional ideals is well defined. Inside this proof I need the following result: $[n\mathfrak{a} : nn'\mathfrak{a}] = [\mathcal{O}_K : (n')]$ or more general $n\mathfrak{a} / nn'\mathfrak{a} \cong \mathcal{O}_K / (n')$ as abelian groups.  I don't know how I could approach this step. Any help is welcome!  Duplicate claim: My proof looks similar to the one posted , but the linked post doesn't prove the question I asked here.

Sorry. This might probably be a really easy question, but I am only a beginner in algebraic number theory. So, please bear with me.  Let $K$ be an algebraic number field and $\mathcal{O}_K$ its ring of integers.  Preludium   In my lecture we have defined the norm $N_{K/\mathbb{Q}}(x)$ for an element $x \in K$ in the usual way. In a following lecture we "extended" this to the norm of an ideal $\mathfrak{a}$ of $\mathcal{O}_K$ by setting $$ \mathfrak{N}(\mathfrak{a}) := [\mathcal{O}_K : \mathfrak{a}] := \left| \mathcal{O}_K / \mathfrak{a} \right|$$ and showed that for the principal ideal $(a)$ with $a \in \mathcal{O}_K$ we always have $\mathfrak{N}((a)) = \left|N_{K/\mathbb{Q}}(a)\right|$. Later, we introduced the notion of a fractional ideal in $K$ being a non-zero, finitely generated $\mathcal{O}_K$-submodule of $K$. And we showed that a non-zero $\mathcal{O}_K$-submodule $\mathfrak{a}$ of $K$ is a fractional ideal iff there is a $c \in \mathcal{O}_K \setminus \{0\} $ such that $c\mathfrak{a} \subseteq \mathcal{O}_K$ (thus $c\mathfrak{a}$ is an ideal of $\mathcal{O}_K$). We now extended the norm $ \mathfrak{N}$ by defining for each fractional ideal $\mathfrak{a}$ of $K$ the norm $$ \mathfrak{N}(\mathfrak{a}) := \frac{[\mathcal{O}_K : c\mathfrak{a}]}{\left|N_{K/\mathbb{Q}}(c)\right|}, $$ $c$ being an element of $\mathcal{O}_K \setminus \{0\}$ such that $c\mathfrak{a} \subseteq \mathcal{O}_K$ (exists according to 2.).   Question  How can I show that this latter definition is independent of the chosen $c$?  Edit  I changed the definition in (3) from $ \mathfrak{N}(\mathfrak{a}) := \frac{[\mathcal{O}_K : c\mathfrak{a}]}{N_{K/\mathbb{Q}}(c)} $ to $\mathfrak{N}(\mathfrak{a}) := \frac{[\mathcal{O}_K : c\mathfrak{a}]}{\left|N_{K/\mathbb{Q}}(c)\right|} $ and added the absolute value everywhere else, too. I think that was a typo in my lecture notes.  Thoughts (Is it better to add them as comments? I was not sure.)   Let $c, c' \in \mathcal{O}_K \setminus \{0\}$ such that $c \mathfrak{a} \subseteq \mathcal{O}_K $ and $c' \mathfrak{a} \subseteq \mathcal{O}_K$. At the moment I am contemplating if and in which way $c$ and $c'$ are related. I was wondering whether one always has $c'=bc$ (or vice versa) for an $b \in \mathcal{O}_K$. Then we had $$ \frac{[\mathcal{O}_K : c'\mathfrak{a}]}{\left|N_{K/\mathbb{Q}}(c')\right|} = \frac{[\mathcal{O}_K : bc\mathfrak{a}]}{\left|N_{K/\mathbb{Q}}(bc)\right|} = \frac{[\mathcal{O}_K : bc\mathfrak{a}]}{\left|N_{K/\mathbb{Q}}(b)\right| · \left|N_{K/\mathbb{Q}}(c)\right|}$$ and it remained to show that $[\mathcal{O}_K : bc\mathfrak{a}] = \left|N_{K/\mathbb{Q}}(b)\right| · [\mathcal{O}_K : c\mathfrak{a}]$ (maybe because $[\mathcal{O}_K : bc\mathfrak{a}] = [\mathcal{O}_K : (b)] · [\mathcal{O}_K : c\mathfrak{a}]$ ???).


With regards to:   The link fully answered the question right from the boost documentation. What is wrong with it?


Using u-substitution I'm able to integrate the following two integrands:   $$\int \frac{1}{2x+3}dx = \frac{1}{2}\ln|2x+3|+C$$  $$\int \frac{1}{2x+5}dx = \frac{1}{2}\ln|2x+5|+C$$  Following this pattern I would assume:  $$\int \frac{1}{2x+4}dx = \frac{1}{2}\ln|2x+4|+C$$  However when I enter this expression into wolfram alpha I get:  $$\int \frac{1}{2x+4}dx = \frac{1}{2}\ln|x+2|+C$$  I can even arrive at this result myself by factoring out the $\frac{1}{2}$ before integration like this:  $$\int \frac{1}{2}\cdot\frac{1}{x+2}dx = \frac{1}{2}\int \frac{1}{x+2}dx$$  But I don't understand how this can be the case? How can two different techniques give me different results? Is there a property of logs that I don't understand?   I would think that  $$\frac{1}{2}\ln|x+2|+C \neq \frac{1}{2}\ln|2x+4|+C$$  Or are they actually equal somehow? PLEASE help me understand what's going on here.

Given the very simple integral  \begin{equation} \int -\frac{1}{2x} dx \end{equation}  The obvious solution is  \begin{equation} \int -\frac{1}{2x} dx = -\frac{1}{2} \int \frac{1}{x} dx = -\frac{1}{2} \ln{|x|} + C \end{equation}  However, by the following integration rule \begin{equation} \int \frac{1}{ax + b} dx = \frac{1}{a} \ln{|ax + b|} + C \end{equation}  the following solution is obtained \begin{equation} \int -\frac{1}{2x} dx = -\frac{1}{2}\ln{|-2x|} + C \end{equation}  Why are these solutions different? Which is correct?   The second solution can be simplified \begin{equation} -\frac{1}{2}\ln{|-2x|} + C = -\frac{1}{2}\ln{|-2|} -\frac{1}{2}\ln{|x|} + C= -\ln{\frac{1}{\sqrt{2}}} - \frac{1}{2}\ln{|x|} + C \end{equation} but they still differ.


Question I use refrigerator just for keeping 2-3 water bottles, 1colddrink bottle, and maximum 0.5 kg of fruits and nothing else (no food items)! So is it better to off my refrigerator at night and start it in morning? (As i will lost no food) and I think, I will save some amount of electricity and may be my refrigerator will last longer with me? Note: I had purchased new refrigerator and I am from India and tempreture range of my hometown is (24°c - 44°c) in complete year.

Now that I'm looking into home automation, I'm thinking about automatically cutting off the fridge power from 3am ~ 5am. Given that modern refrigerators are well insulated, it should be able to withstand 2 hours of non powered cooling.  If I proceed with this project, will I see a big reduction in my monthly electrical bill?


I am using Linux Mint and tethering Internet through my phone.  Every time I enable tethering, my DNS on computer is being set to 127.0.0.1 which results in being unable to resolve any name. I have to manually open "network settings" panel and change DNS to 8.8.8.8 (google's DNS). It works till next time I enable tethering (that is, multiple times per day).  I have tried saving them in network connection panel for this particular connection, but it seems to be completely ignored.  I have also tried to edit /etc/resolv.conf and even remove write permissions, but sooner or later it gets overwritten anyway.  What is changing my DNS settings and how to make it stop?

Right now, my /etc/resolv.conf looks like this:   # Generated by NetworkManager nameserver 10.165.246.33 nameserver 192.135.82.60 nameserver 10.165.74.2   The first two nameservers are automatically configured through DHCP; the last one is the one I added manually, in NetworkManager. It's also the most important one, since it resolves our internal domain names (e.g. build-server-17.our-company-domain.com).  The trouble is, NetworkManager adds it to the bottom of /etc/resolv.conf, so when accessing an intranet URL, my browser tries to resolve it using the first two servers, and it takes ages.  How do I make NetworkManager add the manually-configured DNS server before the automatically-configured ones?


I have a JSON like text file of records with duplicate ids that look like:  {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"93" , "ST":[42,77,51,29,63]} {"ID":"73" , "ST":[21,20]} {"ID":"94" , "ST":[65,11,4]} {"ID":"77" , "ST":[87]}   I am trying to filter the duplicates and always keep the first occurrence of such a match. The field ST could be the same but also different for the records with the same id.  The output would look like:  {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"73" , "ST":[21,20]} {"ID":"77" , "ST":[87]}   A similar question has already been asked , but for this case the data file being edited was a comma separated file. Here we are dealing with a JSON data and the goal will be to find the lines that have the same id values(may be a regex match) and keep the latest one. Anyone has an idea how to tackle that with awk, sed or pure command line tools?

I have a file containing two columns and 10 million rows. The first column contains many repeated values, but there is a distinct value in column 2. I want to remove the repeated rows and want to keep only one using awk. Note: the file is sorted with values in column 1. For example:    1.123 -4.0 2.234 -3.5 2.234 -3.1 2.234 -2.0 4.432 0.0 5.123 +0.2 8.654 +0.5 8.654 +0.8 8.654 +0.9 . . . .   Expected output  1.123 -4.0 2.234 -3.5 4.432 0.0 5.123 +0.2 8.654 +0.5 . . . .


I'm doing a round trip between the US and the UK with Delta, and intend to take my laptop. Unfortunately, the battery recently began to stop holding charge: when I plug in the charger and turn on my laptop, it works fine, but as soon as I remove or turn off the charger my laptop shuts down.   Will I still be able to take my laptop onto the plane in hand luggage and/or hold luggage?  The reason I ask is because I've been on domestic flights where they've required smartphones/tablets/laptops to be at least 20% charged when boarding.  is a somewhat old link regarding minimum charge of electronics on flights to the US.

According to some reports, your electronic devices are checked whether they turn on before you can get on a US bound flight. What if I carry around a laptop without a battery?


Today i was working on a lightsaber for my unity project, but after i was nearly finished I saw, that there were some polygons not visible in Unity. I searched for that problem and found, that the reason could be that those polygons were N-Polygons, but after cutting the two polygons into tris, it still wouldn't show up. While writing this i also found out, that my materials are not being exported correctly, that all worked half a hour ago.  octagon -> cut into tris (the flat thing is a bone)    octagon missing (on top too, not only on sides)    materials in blender project    materials in blender trough FBX ex- and import    how it should look like in the end in unity    how it should look expanded    EDIT: all disappearing polygons would be inside the object, if it had no pose, maybe that's why they are not visible in Unity, but there has to be a fix for that somehow.  EDIT2: importing through .blend to Unity does not take the materials or those missing polygons

I'm importing a mesh i made into unity before exporting I always rotate it by -90 degrees in the X axis, then set the orientation to Y forward and Z up so when the object is imported to unity the object's orientation will fit into unity's native orientation, However whenever I do this after being importing to Unity the mesh is inside out or transparent but When I don't do the rotation of -90 on the X axis the mesh loads correctly aside from the orientation of the mesh being incorrect and it doesn't match unity's native orientation, i really can't figure it out this is the first time I'm having this problem My setup usually works in the meshes i import to unity but this time i got this problem.


I have a Samba4 AD-DC configured with internal DNS. I followed the configuration at     I use this samba as my DNS for the network, but I find that it does not resolve names that don't have the domain suffix. Example:  # dig tarl.domain.example.com ...  ;; QUESTION SECTION: ;tarl.domain.example.com.         IN      A  ;; ANSWER SECTION: tarl.domain.example.com.  900     IN      A       10.0.0.2 ...   But, if I query without domain:  # dig tarl ... ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;tarl.                          IN      A ...   I have read and searched but could not find how to make Samba DNS resolve without domains. All I found was configuring DHCP to send a list of domains to try for these cases, but I prefer samba to handle this.  Thanks in Advance! Regards.

I have a network with DHCP/DNS/AD setup with Windows 2012 server. Users cannot resolve computer names on the network without entering their FQDN, i.e. "server", but "server.domain.com" does.  The only way for me to make this work is to specify a DNS domain in the DHCP scope options, but that breaks some linux servers which are on another domain.  Is there a way for computers to resolve computer names without adding DNS domain in DHCP? From what I understand WINS is a dead technology so shouldn't be used.


My wife and I like Asian meals (Curry, Niku Jaga, et cetera) and without fail we tend to make more rice than we need.   I would encourage her to cook less rice, but a preferable solution would be to use the rice with the meal - since we tend to have leftovers anyway, and it would be more convenient to cook the amount of rice needed to go with the meal and leftovers.   However, rice in the microwave always comes out either soggy, grainy, or both at once.  This is hardly appetizing, and I suspect the reason for it is an improper method of storing leftover rice.   Normally we simply put the rice in a plastic Tupperware container in our refrigerator and then microwave it when we want to use it.  Is there a better way to store or cook our leftover rice so that we don't wind up with soggy, unappetizing rice leftovers?

Let's say, I only want to make 1 sushi roll right now.  Is there a good way to store the rest of the rice for tomorrow's rolls?  And what about storing the nori?


How would I convert ú into u in javascript. I might possibly need it for other non-english characters too.

For a poor man's implementation of near-collation-correct sorting on the client side I need a JavaScript function that does efficient single character replacement in a string. Here is what I mean (note that this applies to German text, other languages sort differently):  native sorting gets it wrong: a b c o u z ä ö ü collation-correct would be:   a ä b c o ö u ü z  Basically, I need all occurrences of "ä" of a given string replaced with "a" (and so on). This way the result of native sorting would be very close to what a user would expect (or what a database would return). Other languages have facilities to do just that: , in , , . But what about JavaScript? Here is what I have right now. // s would be a rather short string (something like  // 200 characters at max, most of the time much less) function makeSortString(s) {   var translate = {     "ä": "a", "ö": "o", "ü": "u",     "Ä": "A", "Ö": "O", "Ü": "U"   // probably more to come   };   var translate_re = /[öäüÖÄÜ]/g;   return ( s.replace(translate_re, function(match) {      return translate[match];    }) ); }  For starters, I don't like the fact that the regex is rebuilt every time I call the function. I guess a closure can help in this regard, but I don't seem to get the hang of it for some reason. Can someone think of something more efficient?  Answers below fall in two categories:  String replacement functions of varying degrees of completeness and efficiency (what I was originally asking about) A  of  , which is now  among JS engines (not so much at the time of the question) and could solve this category of problem much more elegantly.


$f$ and $g$ are continuously differentiable functions such that $f(x) = g'(x)$ and $g(x) = f'(x)$ and any product of $f, g, f', g'$ is commutative for all $x \in \mathbb R$  I need to show that $f^2 - g^2 = C$ , where $C$ is a constant.  Logically this makes sense if you for example use a trig function $\sinh(x)$ but how can I show this to be true?

Suppose $f$ and $g$ are continuously differentiable functions such that $f(x) = g'(x)$ and $g(x) = f'(x)$ and that any product of $f, f', g$ and $g'$ is commutative for all $x ∈ R$. Show that $ f^2 − g^2 = C $ for some real constant C  I have actually no clue how to solve this, and would be really greatfull for all the help i can get


I do have this short file  \documentclass%[colorlinks=true] {memoir} \usepackage[pdftex]{hyperref} \begin{document} %\chapter{first} Here goes the figure. \begin{figure}[!h] \label{fig:MyFigure} this is the figure itself \caption{The figure caption} \end{figure}  Next part of text. Refer to Fig \ref{fig:MyFigure} on page \pageref{fig:MyFigure}. \listoffigures \end{document}   The result shows up like this:  Next part of text. Refer to Fig on page 1.  I.e. the Fig number is missing. When I uncomment [colorlinks=true], some very narrow rectangle is visible after Fig, so I guess somehow \ref{} generates nothing. At the same time, \pageref{} seems to work OK. Also, \listoffigures "sees" the figure. After uncommenting \chapter{first}, the compilation is OK. (The same effect also on ShareLaTeX, so it is not a TeX configuration problem.)  Also, I do have figure number "1.1", and in the reference I see "1". when having more than one figure, the figure sequence number is OK, but in the reference I see some increasing number, with 3-4 step size; at the same time the hyperref jump seems to take  to the right place.  Do I miss something, or it is a bug?

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


If I have a page on my ASP.NET MVC site called     but someone tries to access   http://www.example.com/documents/first http://www.example.com/first   The page will error and application_error will fire because it can't find a controller for documents.  How do I get the error address in Application_error.  I don't seem to get the whole raw url i.e. /documents/first  Before there's the suggestion of adding a route or a URL Rewrite, I don't want to do that because there can be tens of different possible error addresses.  I just want to know the web address of the missing page in the application_error.  After the application-error function has been called, it goes to the error page that I've set up in the web.config and that gets the URL and processes it accordingly but I want to do the processing in the global.asax so there's no redirecting involved.

I have a general exception handler, Application_error in my global.asax where I'm trying to isolate all the uncaught exceptions on all my many pages. I don't want to use Page_error to catch exception because it's inefficient to call that on so many pages. So where in the exception can I find what page actually caused the exception?


For groups, there is a solid foundation to classify them  What art exists for monoids?

Is there a semigroup analogue to the classification of finite simple groups?  If so what are some of the major results?  --Edit, reference links---


When dividing fractions, you can find the quotient by multiplying them with the second fraction reciprocated.  e.g. 5/6 divided by 7/8 = 5/6 times 8/7.  Why does this work?

For dividing two fractional expressions, how does the division sign turns into multiplication? Is there a step by step proof which proves  $$\frac{a}{b} \div \frac{c}{d} = \frac{a}{b} \cdot \frac{d}{c}=\frac{ad}{bc}?$$


I have a requirement to compile and run java programs from C# dynamically by passing parameters. Ex: below is java code i have to execute this code from c# by passing parameters num1, num2. How to do in c#?   import java.util.Scanner;  public class AddTwoNumbers2 {  public int CalAdd(int num1, int num2) {      return num1 + num2;        }  }     I am looking for calling Java code file in c# like below, python code called in c# example code        var engine = Python.CreateEngine();         var scope = engine.CreateScope();         //try         //{          var compilerOptions = (PythonCompilerOptions)engine.GetCompilerOptions();      ErrorSinkProxyListener(errorSink);         var scriptSource = engine.CreateScriptSourceFromFile(@"C:\Nidec\PythonScript\download_nrlist.py", Encoding.UTF8, Microsoft.Scripting.SourceCodeKind.File);         var compiledCode = scriptSource.Compile();         compiledCode.Execute(scope);         engine.ExecuteFile(@"C:\Nidec\PythonScript\download_nrlist.py", scope);          //get function and dynamically invoke         var calcAdd = scope.GetVariable("CalcAdd");                    result = calcAdd(34, 8); // returns 42 (Int32)

We've developed a Java application and would like to use this application from a C# client. The application has dependencies on Spring, Log4j, ...   What would be the most efficient mechanism - make DLL(s) from Java code, ... - to achieve this ?


so i’ve been messaging a sugar daddy back and forth. we agreed on a certain amount of money a week but he ended up saying he was going to send me 3x the amount of what we agreed on. he told me i was going to do something with that money, a way for him to trust me. basically he ended up saying i would keep the rate we agreed on first and then pay his friend the remainder. i wearily agreed. so he sent me the check for $3,200 and i’m waiting for it to clear, they estimate 4 days. my sugar daddy is assuring me saying the check will clear and to send $500 to his friend because it’s urgent. something about his daughters health. is it a scam?

I met a guy on a sugar daddy dating site and we talked, I told him my situation and he said he would help.   He asked for my bank account information and I told him you can use cash app or PayPal to go through. He said his account manager deals with his finances. So I set up an account with a bank that I don’t use so that my primary account isn’t used.  Eventually he was in the process of sending me money and we had agreed on a amount that wasn't crazy. But then he asked for my address and I asked why and he said just wondering. Then said he wanted to send me a surprise for being his baby. Which I didn’t give.  Then later on he sent the money and said he sent me a bonus and that I was supposed to use that to pay his mothers caregiver, which he didn’t mention until after.  I kept questioning him and he was saying that he works in construction and he’s trusting me to carry out the errand. Then he said don’t let him down and I asked him if he was threatening me and he kept saying I need this done but didn’t really answer my question.  Am I being scammed? I’m about to change my password but is this a scam?


I'm working with an oracle database and I need to instantiate an oracle collection in the way that oci-collection would. See:   However, I am using PDO and I don't see anything in the php docs () that looks equivalent. Is there a way to use the PDO connection to call the OCI-COLLECTION functionality? Or what other solutions to this might I not be seeing...  I could instantiate an oci_connect but that seems redundant, unnecessary, and potentially wrong...


Is there an elegant solution to do this?  I have a counter running from nmin to nmax. I want to convert these numbers to strings of a fixed length.  Let me illustrate it with an example:  for j in range(nmin,nmax):     if j<10:         testval='0000'+str(j)     elif j>9 and j<100:         testval='000'+str(j)     elif .....:         testval=.....     else:         testval='00000'   Although it does the job, I found it rather inelegant. Is there a neater and elegant solution to convert the integer to string of a fixed length?

What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?


To begin with, I'm clearly not a physicist but I'm certainly interested by several physics questioning. So, my question here is, according to Einstein's relativity, I understood that travelling at the speed of light would be instantaneous due to space and time dilation. Then, from the point of view of a photon that goes from the sun in direction of the earth, what is the duration of its journey? I know that from our point of view it takes about 8 minutes. Could you please indicate me if I missed something?

Quite a few of the questions given on this site mention a photon in vacuum having a rest frame such as it having a zero mass in its rest frame. I find this contradictory since photons must travel at the speed of light in all frames according to special relativity.  Does a photon in vacuum have a rest frame?


I asked a question whithout paying attention that it was already answered in StackExchange, I understand and agree that this question should be marked as duplicate.  But, what should we do when that question got new answers and suggestions which were not provided in the first one? Moreover, is it even normal that the question remain marked as duplicate?

I have seen this many times, a question is being asked because a previous, duplicate question was asked and answered a few years ago and has no longer relevant answers.  The  is to edit the old question, or add new answers to it, but it is not always happening.  I was wondering, should I still mark it as duplicate and vote to close it? Or just leave it as is?


What is the sum of all the factorials starting from 1 to n? Is there any generalized formula for such summation?

I came across a question where I needed to find the sum of the factorials of the first $n$ numbers. So I was wondering if there is any generic formula for this? Like there is a generic formula for the series: $$ 1 + 2 + 3 + 4 + \cdots + n = \frac{n(n+1)}{2} $$ or $$ 1^{2} + 2^{2} + 3^{2} + 4^{2} + \cdots + n^{2} = \frac{n(n+1)(2n + 1)}{6} $$  Is there is any formula for: $$ 1! +2! +3! + 4! + \cdots + n! $$ and $$ {1!}^2 +{2!}^2 +{3!}^2 + \cdots + {n!}^2 $$?  Thanks in advance. If not, is there any research on making this type of formula? Because I am interested.


As a Swedish citizen I need a visa to travel to Russia but not to Malaysia.  If I book 2 separate flights:  Stockholm → Moscow → Stockholm Moscow → Kuala Lumpur → Moscow  I would fly Stockholm → Moscow → Kuala Lumpur and back.  I do not intend to leave the Moscow airport, would I still need a Russian visa? If yes, would it be a normal visit visa to Russia?

On June 29th 2015, I will be traveling for the first time to Italy from USA. I will have a 10 hour layover in Moscow Russia. My question is, do I need a visa to visit the city?


Can I install Ubuntu like desktop version to my xiaomi mi pad?instead of android. Im very interested in. Please ,help me. Thank you

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


if the logic behind: "if a=b and b=c then c=a" is true. why it is also true that: $\sqrt{9}=3,-3$ if $\sqrt{9}=3$ and $\sqrt{9}=-3$ but $3\neq -3$

It is perhaps a bit embarrassing that while doing higher-level math, I have forgot some more fundamental concepts. I would like to ask whether the square root of a number includes both the positive and the negative square roots.  I know that for an equation $x^2 = 9$, the solution is $x = \pm 3$. But if simply given $\sqrt{9}$, does one assume that to mean only the positive root? And when simply talking about the square root of a number in general, would one be referring to both roots or just the positive one, when neither is specified?


Currently an active service(telegraf) is running on a machine. Want to automate few steps in which the initial is to check the service is running from a shell script. I am running systemctl status telegraf command to check the status of the service manually. and the output is, telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB    Loaded: loaded (/usr/lib/systemd/system/telegraf.service; enabled; vendor preset: disabled)    Active: active (running) since Wed 2021-05-19 12:26:17 UTC; 3 weeks 5 days ago      Docs: https://github.com/influxdata/telegraf  Main PID: 1297 (telegraf)     Tasks: 9 (limit: 49778)    Memory: 106.3M    CGroup: /system.slice/telegraf.service            └─1297 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d  I want to capture the value active (running) in my script, how to do it in Shell script?

My problem:  I'm writing a bash script and in it I'd like to check if a given service is running.  I know how to do this manually, with $ service [service_name] status.  But (especially since the move to systemd) that prints a whole bunch of text that's a little messy to parse. I assumed there's a command made for scripts with simple output or a return value I can check.  But Googling around only yields a ton of "Oh, just ps aux | grep -v grep | grep [service_name]" results. That can't be the best practice, is it? What if another instance of that command is running, but not one started by the SysV init script?  Or should I just shut up and get my hands dirty with a little pgrep?


I found out that when I run a command which executes a software that has continuous output lines e.g. traffic monitor like tcpdump or tshark the command keeps counting numbers on screen like 4, 8, 12 ... and so on.  command... | awk -F ' ' '{ANY COMMAND}'   I want my bash script to do actions after every single line of output and not every one thousands of lines. How can I achieve that?  There's a good example when running a software generating a lot of output and you place pipe operator like this:  command... | awk -F ' ' '{print $1}'   It will count numbers from 0 to 1000+ and then it simply prints out all correct information once, but not immediately on script execute.  If I put output into file using:  command... > file.txt   ... then data is there immediately when command provides any output. I'm wondering what is causing the delay when using a pipe operator?

I have a script which calls two commands:  long_running_command | print_progress   The long_running_command prints progress but I'm unhappy with it. I'm using print_progress to make it nicer (namely, I print the progress in a single line).  The problem: Connection a pipe to stdout also activates a 4K buffer, so the nice print program gets nothing ... nothing ... nothing ... a whole lot ... :)  How can I disable the 4K buffer for the long_running_command (no, I do not have the source)?


Why is there a null exception pointer error being thrown and how can i fix this thank you. If you could explain what to do. I am trying to store each line from a txt file into an arraylist which goes into a larger array list of seperate lines.       public static ArrayList<ArrayList<String>> addAfter(String file1)throws IOException{     Scanner scanner = new Scanner(new File(file1));     ArrayList<ArrayList<String>> arr = new ArrayList<ArrayList<String>>();      ArrayList<String> a = null;     boolean check = false;     while(scanner.hasNextLine())     {         String str = scanner.nextLine();         String[] stringArr = str.split(" +");         for(int i=0; i<stringArr.length; i++){             a.add(stringArr[i]); //null exception being thrown here         }         stringArr = null;         arr.add(a);         a.clear();     }     return arr;     }

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?


Consider the unit square $S =[0,1]\times[0,1]$.  I'm interested in the average distance between random points in the square.  Let $ \mathbf{a} = \left< x_1,y_1 \right>$ and  $ \mathbf{b} = \left< x_2,y_2 \right>$ be random points in the unit square.  By random, I mean that $x_i$ and $y_i$ are uniformly distributed on $[0,1]$.  The normal approach is to use multiple integration to determine the average value of the distance between $\mathbf{b}$ and $\mathbf{a}$.  I would like to try another approach.  $\mathbf{a}$ and $\mathbf{b}$ are random vectors, and each element has known distribution. So, the vector between them also has known distribution.  The difference between two uniformly random variables has triangular distribution.    So $\mathbf{c} = \mathbf{b} - \mathbf{a}$.  Then, the average distance is the expectation of $\lVert \mathbf{c} \rVert$.  Perhaps it would be easier to calculate the expectation of $\lVert \mathbf{c} \rVert^2$.  In any case, I am not sure how to calculate the expectation for $\lVert \mathbf{c} \rVert^2$.  Can someone guide me in the right direction?

A square with side $a$ is given. What is the average distance between two uniformly-distributed random points inside the square?  For more general "rectangle" case, see . The proof found there is fairly complex, and I am looking for a simpler proof for this special case. I expect it could be significantly simpler.  See also .


If a 2 times bigger mass collides with an object in which a 2 times smaller mass collides but with 2 times the speed which one will produce more force on the object?  The object is stationary before and its mass is comparable to the 2 mases.

Is there an equation linking velocity, mass and force? I want to find the maximum force that an object of any given mass could exert. Assuming, the object with the given velocity stops dead in an instant, I thought of using F=ma but there is no time frame for the slowing down of the object since it's instant. Thank you


The description of man in its  contains the statement,      The default action is to search in all of the          available sections following a pre-defined order ("1 n l 8 3 0 2 5 4          9 6 7" by default, unless overridden by the SECTION directive in          /usr/local/etc/man_db.conf), and to show only the first page found,          even if page exists in several sections.   What exactly is meant by "1 n l 8 3 0 2 5 4 9 6 7"?

So, for example, when I type man ls I see LS(1). But if I type man apachectl I see APACHECTL(8) and if I type man cd I end up with cd(n).  I'm wondering what the significance of the numbers in the parentheses are, if they have any.


The protagonist, is the main actor, no matter what his character is--good or bad. Normally, it centralized the story with the protagonist. On the other hand, the antagonist is the opposing character of the protagonist, with conflicting characteristics with the protagonist. What if the protagonist and antagonist change roles? Is there any special term for that? Like when either the protagonist and antagonist lead the story, having different plots, and both have the part in causing the trouble. Some stories use an interrelated parallel story plot that helps one another develop each plot. So, back to the question, how do you call that instances? How if the protagonist act as the antagonist, and vise verse for the antagonist? What's your idea about this?

The dictionary lists these as antonyms, although the definitions of both don't really oppose each other.  I mean a case where the central figure of a story (and possibly simultaneously the narrator) is a black character, a meddler, evil guy with no redeeming values, who causes all the trouble, while the rest of the "crew", all secondary roles, are the opposition.  The traditional approach equates main character = the good guy = protagonist, and the opponent = "person causing problem" = the antagonist, but what if the protagonist is the one causing the problem?  What do we call the protagonist's opponents then? Or maybe one should cease to call the central character "protagonist"?


I am having a problem with housing --- NPCs won't move into the houses on the right. I have already tried making them bigger, but it didn't help. What is wrong with these rooms?

I read on the wiki that people will move in under the following conditions:   You do something to please them An empty house is available with a light source, table, and chair (also with walls).   I have a house which is about 7x8, then a roof space above that; about half the area. I could put furniture up there too, but will anyone move in?


I am using qgis 2.6 for the first time. As I was using 2.2 previously, it was easy for me to create a new vector layer from a part of the current layer with the help of option "save selection as a new vector layer" from Layer menu. But I don't seem to find this in qgis 2.6.

I am using QGIS 2.4.0 Chugiak version.   Is there an option to save selected features from a shapefile?   I couldn't find such an option in this version. I am using stand alone application.


When I go to the sound settings, the only output device listed by Ubuntu is "Dummy output". I can't hear any sound. My bluetooth headphones still work if I connect those. These symptoms appeared recently, around the same time as .  I ran aplay -l and it says no soundcards found.  Also worth noting that I dualboot Windows (although I never use Windows) and Windows can play sound through my speakers just fine.  Ubuntu 19.10 on a laptop.

I am using Ubuntu 19.10 for few months. Suddenly voice output is not working. In-spite of trying reinstalling sound drives and tried all options despite that  it is not working. Any inputs to it?


In blender 2.8 I made a model of a door. I put a texture on the door mesh but it does not fit correctly. It needs scaling down. How do I scale it?

SO basically my texture is showing off way to big and when i tried to fit all my unwrapped parts in the 2D editor, i had to scale them very small which caused this problem.  I have red somewhere else that i had to do: Add>Vector>Mapping and change the scale. I tried to connect the cables as the pictures showed (I have plugged it into UV now, not object as the pic shows btw) , but im sure i am missing some plugs here.   What else needs to be done?   Appreciated if it could be explained in clear steps, im only a beginner.   EDIT: here to show the multiple UV maps.. at least i think they are :)


Both in the Late Answers and First Posts queue, clicking "edit", not editing the post and clicking "Save Edits" triggers the dimming of the "No Action Needed" button and the appearence of the "I'm Done" button:        Aside from the "per se" harmless GUI bug, the problem is that this allows to click the "I'm Done" button, which has the effect of marking the item as reviewed, even if it was not: , .  As you can see, despite the fact that the post hasn't been touched (the edit doesn't appear in the ), the item in the review has still been marked as reviewed.  A similiar thing happens also in the Suggested Edits queue, although I was able to do this only once; I don't have screenshots for this one but I have the links; clicking "Improve Edit", not editing the post and clicking "Save Edits" has the effect of marking the item as reviewed (as approved and edited), even if it was not: , .  As you can see, despite the fact that the post hasn't been touched (the edit doesn't appear in the ), the item in the review has still been marked as reviewed.

In the First Posts review queue, it's possible to click edit to edit the post, then to immediately click Save Edits without having actually modified anything. If we do so, the button I'm Done becomes available even if we didn't actually do anything.  It's not really important, but it shouldn't be possible to click I'm Done unless we actually did something relevant.


What is this kind of argument parsing?    $RES="${SOME_VAR##foo/}"

I'm quite confused about the following regular expressions I found in a shell script:  ${0##*/} ${0%/*}   How do they work?


I installed terminator and it changed my default terminal. I want to reset it to GNOME terminal. How can I do it?

How can I set the default terminal used in Unity?  I would like to use the Ctrl+Alt+T hotkey to start a non-default terminal. The default terminal is gnome-terminal.   Where can I change the default terminal value?


In MS Access you can do the following using both tables and SELECT queries  FROM Product INNER JOIN outputQry ON Product.ProductId = outputQry.ProductId   Assuming Product is a table and outputQry a query, how to do the same in T-SQL ?  I wrote a function that returns a table, how do I execute it within another function/procedure so I can (for example) INNER JOIN the result with some tables?  My function looks like this  ALTER FUNCTION [dbo].[PreconfiguredConfigs_GetNoOfOutputs]() RETURNS @outputTable TABLE      (          ProductId int,      NumberOfOutputs int      ) AS BEGIN DECLARE @table TABLE      (         ProductId int,         NumberOfOutputs int      )     INSERT INTO @table     SELECT Outputs.ProductId, Count(Outputs.ProductId) AS NumberOfOutputs     FROM [dbo.PreconfiguredConfigs].[Outputs]     GROUP BY Outputs.ProductId;     INSERT INTO @outputTable     SELECT ProductId, NumberOfOutputs FROM @table     RETURN END   edit: one additional requirement would be that I can 'chain' the functions, so the results from one written above can be used in the another function (INNER JOINing it with other columns), and that function results could be used as well in another function (JOINing these as well).  Can it even be done or do I have to drastically change my designs? The requirements come from the way the database was designed in Access.   to put the SELECT query inside a table-value function, which I did, but I do not understand this line:  SELECT * INTO CustList FROM CustomersbyRegion(1)   what is CustList? Is it a table in the database that gets overwritten whenever the function gets called? I guess that would be a solution, because then I could INNER JOIN it all I want and avoid all the Invalid column name errors I've been seeing when using variables and temporary tables (more on that in my comment to )

How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp table]?  Select all data from BusinessLine into tmpBusLine works fine.  select * into tmpBusLine from BusinessLine   I am trying the same, but using a stored procedure that returns data, is not quite the same.  select * into tmpBusLine from exec getBusinessLineHistory '16 Mar 2009'   Output message:     Msg 156, Level 15, State 1, Line 2   Incorrect syntax near the keyword   'exec'.   I have read several examples of creating a temporary table with the same structure as the output stored procedure, which works fine, but it would be nice to not supply any columns.


I was testing an answer locally on someone else's  recently, only for it to be marked (in error) as duplicate.  Whilst I can see why the duplicator (for want of a better word) did what they did; it did basically address one issue the OP was having, but IMO not the main issue.  I wanted to remove the duplicate tag, but there isn't a clear answer of how to do this.  I thought of using @ on one of the duplicator's posts, and letting them know before removing the comment, but thought that was an odd way to do it.  I figured flagging it would get a moderator to remove it, but it got declined as a request declined - flags should only be used to make moderators aware of content that requires their intervention.  I read , but this feels like it's what the OP should have done, not a random answerer.  How should I have done this?

Today I have stumbled across a question that was closed . When reading this question , I thought it was valid, and I even might have an answer for it . So I went and read  and  along with some other related questions here on meta . The issue is that because :  I do NOT have 3000 points to vote for opening,  The said question is not my own ,  The person who closed it did not leave a comment, It seems that I have no option to reopen it and answer.   What one should do in that case ? Flag it for moderator ?  I would think this is not the appropriate action here . Contact the closer personally  ? - Same as Above (and also , how ?) Leaving a simple comment ? By reading the above mentioned questions - leaving a simple comment will do nothing by itself to reopen or to catch attention (unless someone else stumbles upon it ..) So what are my options for action ?? (the question is  for reference)


I'm experienced with Windows, not so much with Mac. I've just been given a 27" iMac (it's a mid 2011 model) by someone who no longer needs it. It has 4 memory slots and presently two are occupied with 2Gb modules each (4Gb total RAM).  Another friend has offered me a 4Gb module and a 2Gb module. I've checked the specs and they are compatible with this model iMac.  Is it an option to put each of these in the 2 remaining slots, so that 3 slots have 2GB and 1 slot has 4Gb?  While this question:  is similar, it does not address the following question I have:  And if one of these is bad memory, can I only use one? By this I mean 2 slots have the original 2Gb modules, one slot has either the 2 or 4Gb module, and the last slot is empty.

I recently came into possession of a 27 inch mid 2011 iMac. It only has 4GB RAM and I have been pricing compatible memory modules online.  I  then remembered I also have a 13 inch mid 2012 MacBook Pro that was damaged some time ago. It has 8GB RAM that I have no reason to suspect has any faults as it worked fine before the damage which was not anywhere near the bottom case. So I thought I would investigate the types of memory modules the iMac and MacBook Pro use.   I found the iMac uses 204 pin PC3-10600 (1333 MHz) DDR3 SO-DIMM modules. I found the MBP uses 204 pin PC3-12800 (1600 MHz) DDR3 SO-DIMM modules.   Obviously I'm thinking that if I can use the MacBook Pro RAM in the iMac I can save some money and it's a good way of recycling.  I understand this RAM would not operate at 1600 MHz in the iMac. My questions are:   Would the MBP RAM work okay otherwise? If it would work, does it make a difference if I add them to the original RAM so I have 12GB in total, or will I have to remove the old modules and just use the 8GB instead?


What is a practical function of the third derivative? For example, the function $y=x^3+x^2+x+1$ has a third derivative of $d^3y/dx^3=6$. What is the practical application of this? I know that the first derivative of a function $f(x)$ is how the function is changing. Given that $f'(x) = g(x)$, I know the change in $g(x)$ is equal to $f''(x)$. That is the change of the change.  Does $f'''(x)$ have any practical application that is not miniscule?

(Originally  by AJAY.)  What is the geometric, physical, or other meaning of the third derivative of a function at a point?  If you have interesting things to say about the meaning of the first and second derivatives, please do so.


public class Test     {         public static void main(String[] args)        {         String s = new String("test");// ***          String s1 = s.toUpperCase();          String s2 = s.toLowerCase();          String s3 = s1.toLowerCase();          System.out.println(s==s1);//first case          System.out.println(s==s2);//second case          System.out.println(s==s3);//third case        }     }   1) Why does it return false for the third case(commented). Both s3 and s  are pointing test yeah? But it seems JVM creates another object named test for s3 in the heap memory. But it is not the same for the second case(commented). It uses the object which was previously created as s(commented as *** in the code). Why is that?   2) And what happens to s1 object TEST because s3 is created from s1. Will s1 be destroyed or will it be in heap?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have a laptop with dual os windows 7 and ubuntu 13.03.  I wanted to uninstall ubuntu from it. So, I formatted partitions of ubuntu from windows Disk management and make that free space into a new volume.  After that I restarted my system, then it shows "error: no such partition.grub rescue>" Then I came to know that I need to reset MBR.  I tried everything like boot-repair tool, boot from windows 7 live-usb but it shows 'boot error' everytime. I need my windows back. please help me.  Thanks in advance for your kind assistance.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


After reading the Hulk's entry at  I'm still unsure what exactly Bruce's alternate form is technically classified as. The only description given about the Hulk is "monster", but it's used in different ways:   (literal)     Gamma-powered psychiatrist Leonard "Doc" Samson captured the Hulk and successfully separated Banner and his alter ego. Without Banner's psyche to restrain him, the Hulk became a greater danger than ever before. Realizing there was only one way to reign in the Hulk, Banner agreed to merge with the monster.    (figurative)     During the brawl Skaar accidentally placed several innocents at risk. Hulk saved their lives, proving he wasn't the monster Skaar or Banner made him out to be. Father and son finally reconciled and decided to act as a family.   So it seems like the term "monster" isn't really how people in-the-know would consider the Hulk.  So what is he? Is the Hulk a mutation? A limited evolution? An involuntary super power? Is he still considered human? If there are multiple, conflicting possibilities, then the most recent one will do.

Hulk has extraordinary powers, well above that of a normal human being.   Can we say that Hulk is a mutant?


So I'm transfering data from my 3TB hard drive to a new 8TB hard drive, they are both formatted in NTFS. I just right clicked and did cut/paste from root to root. So why does it says that the path is too long since it was fine on the 3TB drive? Thanks.

I need to make backups of some files on a network share. However, I need to copy those files to my local drive before burning the disks because those files might be in use. Some of the files won't copy because the file path is too long. Is there any workaround other than changing the file structure?


In the Player's Handbook for DND 5e some of the maneuvers (distracting, disarming, menancing strike etc.) for the battlemaster fighter have this writen at the start:     When you hit a creature with a weapon attack, you can expend one superiority die to [...] (frighten, disarm, distract) [...] You add the superiority die to the attack’s damage roll [...]   I interpret this as meaning that you can decide to make a maneuver of this type after you have already rolled your attack hit, and that means you could potentially spare the superiority dice for attacks when you rolled a 20 and crit. Am I correct in this interpretation?

Certain damage kickers are put into effect at the attacker's option after it is determined that an attack is a hit. Examples include:   The Divine Smite of  and of  The Battle Master's Trip Attack The Combat Inspiration feature of the College of Valor bard Expending charges from several magic staves, including the , , and    The rules on a  seem pretty clear (PHB. 196):     Roll all of the attack’s damage dice twice and add them together.…      … If the attack involves other damage dice, such as from the rogue’s Sneak Attack feature, you roll those dice twice as well.   It seems clear that (a) the player decides to apply the kicker after seeing the die roll, and (b) "all of the attack's damage dice" includes the kicker. But this gives the player quite an advantage to choose to apply a damage kicker on a known critical hit, so I am seeking to confirm (or correct) my understanding.  Can the attacker wait to add optional damage dice until after seeing if the roll is a critical, ?


I am trying to create a long table that will be multicolumn. In one of the columns, I have a DNA sequence that is very long. I am trying to use the \multicolumn but the text is not wrapping possibly because it treats the DNA sequence as one word so the word continues and overflows into the next column. Also I do not want to introduce either hypher  or next line to my DNA sequence. Please help. TIA My code gives me this output  \documentclass{report}  \usepackage{array} \usepackage{longtable}  \begin{document}     \begin{longtable}{c c c} \caption {Primers}\\ Code & Sequence (5' to 3') & Use \\    D10520 &CCCTGCGGTGCCCCTCAAG &\multicolumn{1}{m{6cm}}{Anneals upstream of the EcoRI site in pRW50/ PRW224/pRW225. Used for sequencing and amplification of inserts in this vector.}\\  D812443 &\multicolumn{1}{m{6cm}}{GGGGGGGAATTCGTCTGCACAGTGGTGTTTATTTATCTTTTTAGTAACTTTGTTTTAAGTCGCATATTAAC} &\multicolumn{1}{m{6cm}}{aafD upstream primer containing an EcoRI site for amplification of aafD96-65C promoter fragment.} \end{longtable} \end{document}

Here, it is just a example. I have a line:  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa   Now, I want to let LaTeX automatically wrap the line according to the width of the text block/margins.


I use function to show dialog with custom headline and text in it. (jQuery)  function callDialog(headline, text_in) {         $("#spinner-wrapper").after("

" + headline + "

" + text_in + "

<button style='float: right;' id='Dialog_Button' class='btn btn-primary'>Okay</button>

");     }   (Dialog shows exactly how I want) And I use function to hide it, but this function don't work for some reasons. I tried using click() and on("click", function() {}); etc...  $('.darker-background').on('click', function(){         alert("Clicked");         $('#Custom_Dialog').fadeOut(500);     });

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 am using LyX to prepare an article. The document class is 'IOP article' and I am using the mhchem package to typeset chemical formulae in the paper. I include \usepackage[version=3]{mhchem} in the LaTeX preamble.  I am thrown 11 errors when I try to preview the document:   LaTeX Error: Command \leftroot already defined. LaTeX Error: Command \uproot already defined. etc..   Suggestion/solutions much appreciated.

I am using iopart class for IOP publication, and I want use the mhchem package for writing chemical equations. I ran into the same problem as  and , old topics without answer. I compile with pdflatex in Texmaker the following code:  \documentclass[12pt]{iopart} %Uncomment next line if AMS fonts required %\usepackage{iopams}  \usepackage[version=3]{mhchem}  \begin{document} \title[mytitle]{mytitle} \author{myauthor}  \begin{abstract} A minimal non-working iopart + mhchem example \end{abstract}  \ce{P ->[\sigma_{P}] T}  \end{document}   This throws back the error   ! LaTeX Error: Command \equation* already defined.                Or name \end... illegal, see p.192 of the manual.  See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  ...                                                l.2664 }   I added the advice in :  \makeatletter \@namedef{ver@amsmath.sty}{} \makeatother \usepackage{amstext}   before \usepackage[version=3]{mhchem}. I have no clue what it means. But it raises plenty of errors :  ! Undefined control sequence. <argument> \rightarrowfill@                              \displaystyle  l.18 \ce{P ->[\sigma_{P}] T}  ?  ! Missing $ inserted. <inserted text>                  $ l.18 \ce{P ->[\sigma_{P}] T}  ?  ! Extra }, or forgotten $. \@begin@tempboxa ...begingroup #2\color@endgroup }                                                   \def \width {\wd \@tempbox... l.18 \ce{P ->[\sigma_{P}] T}  ?  ! Missing $ inserted. <inserted text>                  $ l.18 \ce{P ->[\sigma_{P}] T}  ?  ! Missing } inserted. <inserted text>                  } l.18 \ce{P ->[\sigma_{P}] T}   EDIT: Following comments below I tried :  \documentclass[12pt]{iopart} %Uncomment next line if AMS fonts required %\usepackage{iopams}   \makeatletter \@namedef{ver@amsmath.sty}{} \makeatother \usepackage{amstext} \usepackage{chemformula}  \begin{document} \title[mytitle]{mytitle} \author{myauthor}  \begin{abstract} A minimal working iopart + chemformula example \end{abstract}  \ch{P ->[$\sigma$] T} \par  \end{document}   And it does the job !


The question was initially: $$\int{\frac{1}{x^4+1}dx}$$ By trig substitution I reached the below equation and I'm stuck here: $$\int\frac{1}{2}{(\cot x)^{1/2}dx}$$ How can I proceed from here?Any simple methods are appreciated.

I am trying to evaluate the integral  $$\int \frac{1}{1+x^4} \mathrm dx.$$  The integrand $\frac{1}{1+x^4}$ is a rational function (quotient of two polynomials), so I could solve the integral if I can find the partial fraction of $\frac{1}{1+x^4}$. But I failed to factorize $1+x^4$.   Any other methods are also wellcome.


I installed Ubuntu over a year ago on my Dell PC.  I have just decided to try to run FreeBasic on the Ubuntu system.  On powering-up my PC I have used the 'select Ubuntu' option but even after an hour has elapsed, all I get on the screen is your purple'ish-coloured background (same as background on this page), and it periodically displays a log-on/sign-in box for about 2 seconds.  I have no idea what to do next.  (Am using Internet Explorer & WindowsXP, unaware of version no. for Ubuntu)

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


During the "in-app purchase" I am unable to switch the Google account I would like to use for "in-app purchase". Currently, in order to change the primary Google account on Android operating system, we have the following ways:   Remove other Google accounts, leave only one Google account. Perform factory reset on our devices.   If we perform factory reset, we will lose all data that we have not backed up or unable to do backup. And, we have to re-install the applications that we need to use.    If we choose to remove other Google accounts from our systems and leave only one Google account, if there are applications installed from Google Play Store by using the Google account that we want to remove from our systems, then we will not be able to remove the account from the system unless we remove those applications. However, sometimes we may forget which account we used to install an application from Google Play Store.  My question is that is there any other way to switch between the accounts?

What is the procedure to change email account which you want to use to make in-app purchase?  Take a look at the image.    Click to enlarge the image  I am using 2 Gmail accounts and only 1 has a credit card attached. The primary account has a credit card, the secondary does not. But my secondary account is always in the payment dialogue. The secondary account is also not the account used in Play Store app.   I found no way to change this email.


Is there a straightforward step-by-step instruction to replace Ubuntu OS with Google OS on a BQ Aquaris M10 HD tablet.  I know nothing about computer code and nothing can be assumed. These instructions need to be precise. I.e. do I need another computer to perform this operation If so, what kind? If it can be done entirely on the tablet, then exactly how is this done?

Many people want to try/use Android without buying a new Android phone.  How can I install Android on my current phone or device running Nokia Symbian, Maemo, or MeeGo; Microsoft Windows Mobile or Windows Phone 7/8/10; Apple iOS (iPhone); RIM's BlackBerry OS; Palm's WebOS; Samsung's Bada; HP's WebOS; Mozilla's Firefox OS; or other phone / operating system?


A document in Overleaf compiles fine with references. However, using the same compiler locally yields "Citation x on page n undefined (...)", and the references are not showing, only the bracket with the labels: [label]  Using biblatex as so:  \documentclass{report} \usepackage[utf8]{inputenc} \usepackage{biblatex}  \addbibresource{references.bib}  \begin{document} \paragraph{} yoyo \cite{kniberg2015}  \printbibliography  \end{document}   with references.bib:  @book{kniberg2015,     title     = {Scrum and XP from the trenches - How we do Scrum},     author    = {H. Kniberg},     year      = {2015},     publisher = {C4Media} }   As mentioned, this works fine in Overleaf. I do have biblatex installed locally.

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


It is possible to write one method that can set value to different variables which are loaded by parameter?  I think something about like this:  void SetBooleanValue(bool myVariable, bool newValue) {     myVariable = newValue; }   and then use this like that:  bool isConnected = false; bool isFinished = true;  public ClassConstructor() {     SetBooleanValue(isConnected, true);     SetBooleanValue(isFinished, false); }   The problem is my method only gets value of isConnected and isFinished and can't modify original values of those variables.  How to get reference to them?

If I am passing an object to a method, why should I use the ref keyword? Isn't this the default behaviour anyway?  For example:  class Program {     static void Main(string[] args)     {         TestRef t = new TestRef();         t.Something = "Foo";          DoSomething(t);         Console.WriteLine(t.Something);     }      static public void DoSomething(TestRef t)     {         t.Something = "Bar";     } }   public class TestRef {     public string Something { get; set; } }   The output is "Bar" which means that the object was passed as a reference.


I would like to return a JSON objet containing informations retrieved from my database. Today, i only check that the username/password couple is correct and return a string "success".  The structure of tbl_user table is the following :  ================================ ============ tbl_user ========== ================================ - id - username - password - name - surname - city ================================ ================================   If the username/password couple exist in database, i would like to return a JSON object like that :  {    username : ..,    name : ..,    surname : ..,    city : .. }   How can i do this ?  Here is my PHP code :  <?php $hostname_localhost ="localhost"; $database_localhost ="database"; $username_localhost ="myusername"; $password_localhost ="mypassword"; $localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);  mysql_select_db($database_localhost, $localhost);  $username = $_POST['username']; $password = $_POST['password']; $query_search = "select * from tbl_user where username = '".$username."' AND password = '".$password. "'"; $query_exec = mysql_query($query_search) or die(mysql_error()); $rows = mysql_num_rows($query_exec); //echo $rows;  if($rows == 0) {   echo "fail";   }  else  {     echo "success";  } ?>

How do I use the json_encode() function with MySQL query results? Do I need to iterate through the rows or can I just apply it to the entire results object?


How can I refer to a man using his first name while showing some respect? Can I say  "Good morning, Sir William or Mr William" like Monsieur in French?

Is it correct to use Mr/Mrs with a first name?


Is there any way to get LyX to directly convert a LyX Math Formula directly into its Microsoft Word Equation equivalent, when converting a LyX file into a Word file?  I keep getting a bad text approximation, which seems to ignore things like fractions entirely.  Its seems that with MSWord able to use LaTeX in its Equation Editor, the kind of direct conversion I mentioned should be possible.  Also, I just opened this StackExchange account, so I'm not allowed to create my own tags, or some such thing, so if someone could help me find existing tags to include for this question, that might help.

Let's say I have a (comparatively) lovely-looking document in LaTeX, full of lovingly typeset, (relatively) complex equations. Now, let's say some barbarians come along one day and decide that the document has to be put into Microsoft Word (2007). ...after the usual mourning period associated with such events, let's say I value my job (more specifically, the bread it provides) enough to get all the text and tables formatted and references organised into the Word document. –...related questions  and – Now I'm looking at the equations with fear and dread. One option of course is to just lift screenshots from the original document, but this is painstaking if I need to refer to parts of the equation in the text. Also, I might need to edit equations on the fly. Anyone know of a free application which allows embedding LaTeX math into MS Word? I've looked at  and  which do roughly what I want... they build LaTeX images from source and embed them into the Word document, allowing to edit the source later... but both are commerical. ...any help in these troubling times will be greatly appreciated. EDIT: Just a note that  offers a 30-day free trial and is working out really nicely... but still, it's not free. Might be a good solution for those with short-term needs, or money.


I have installed Ubuntu 18.04 on my HP notebook and installed Wi-Fi drivers successfully but if I try to create a Wi-Fi hotspot, it shows that the hotspot is on but I cannot find the given hotspot on any other device so I guess it was never created. Any help? Chip ID: BCM43142 PCI ID: 14e4:4365

I want to create WiFi hotspot for android device using Broadcom BCM43142 chipset. OS : 14.0.4but I am stuck at a STEP which says your Wireless card should support AP mode!The current  driver: wl0 which I am using does not support AP(access point) mode.     iw list    Result :  Supported interface modes:        * IBSS        * managed   I found many drivers for other broadcom chipset like BCM4312 that support AP mode ex : b43 driver but failed to find for BCM43142.  Is their any driver available for Broadcom BCM43142 that support AP mode? OR  Is their any other way I can create hotspot for my android device using Broadcom BCM43142 card (os : Ubuntu 14.0.4)?  Thanks.


Let $V$ be a $n$-dimensional vector space. Let's also say that we have two linear operators: $A,B\in L(V)$ and $AB=0$. Then how do I prove that the sum of the ranks of operators is smaller than $n$, i.e. $r(A)+r(B)\leq n$?   The trivial case that popped into my mind is that $A=0$ or $B=0$, so the equality holds then, but I wonder what to do in the general case, when both $A\neq0$ and $B\neq0$. Is it even possible to have both of them differ from the null-operator and their composition be a null-operator itself? Thank you.

Let $A,B\in M_n(\mathbb{R})$ such that $AB=0$. Prove that   $$\mathrm{rank}(A)+\mathrm{rank}(B)\leq n.$$   From the given information, I only know that $\mathrm{rank}(AB)=0$.


EDIT: this question is based around my notion regarding the  possible role of potential energy in the momentum energy tensor T$_{\mu\nu}$,   The answer below resolves the question and I have deleted my incorrect reasoning originally contained within the question. As the post contains an answer,  I cannot delete it, which I would normally do. END EDIT.  I am confused as to where potential energy is contained within T$_{\mu\nu}$, or if it is included in the first place.  If this question is rubbish, then how do we allow for the P.E, associated with the other forces within T$_{\mu\nu}$, or do we need to?    If my question is so wrong that you can answer by simply directing me to page X of a particular textbook that provides the correct derivation of p in T$_{\mu\nu}$, that's fine and will be  appreciated.

There is an image in the Wikipedia about the :    I have a rough understanding of the stress tensor: you imagine cutting out a tiny cube from the fluid and form a matrix out of the forces on each side of it: it's not hard to see that the forces that push the faces outwards so the x direction of the force on the x side, the y direction of the force on the y side, etc. is the pressure, while other forces directions are the shear stress (these can be non-zero is some jelly-like substance).  Now the first question: Why is the lower half of the spatial part is the momentum flux, while only the upper one is the shear stress on the image? Is the image wrong? Isn't the spatial part describe the classical stress tensor?   The second question is: what's the intuition behind the temporal part?  So if I have a Minkowski spacetime and cut out a cube of it, then it's quite hard to see why "pressure" on the temporal face means density, also why "shear stresses" on the temporal face translate to momentum density, not speaking of the "temporal force components" the spatial faces...  Also stresses are measured in Pascals, mass density is measured in $kg/m^3$ while momentum density is in the units of $Ns/m^3$. These units doesn't seem to be compatible, but still they are in the same matrix, why?  EDIT: It has been pointed out that momentum flux refer to the entire blue part, it indeed have a lighter frame I didn't notice. Then yet another subquestion: what's the difference between the momentum density and momentum flux?


I want to find the location(s) of a specific item in a list of lists. It should return a number, where the number represents the indexes for a specific instance of the item. For example:  list = [['1', '2', None, '6'], ['7', None, '1', '4']] getPosition(not None)  #returns [1]   I'm always want to check the third element in every list.

Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?


I get a weird error on my Android app. I couldn't found any useful source about this error:  java.lang.NullPointerException at org.uusoftware.burclar.a.a$1$1.onClick(Unknown Source) at android.support.v7.a.d$a$3.onItemClick(Unknown Source) at android.widget.AdapterView.performItemClick(AdapterView.java:308) at android.widget.AbsListView.performItemClick(AbsListView.java:1509) at android.widget.AbsListView$PerformClick.run(AbsListView.java:3467) at android.widget.AbsListView$3.run(AbsListView.java:4830) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5602) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) at dalvik.system.NativeStart.main(Native Method)   I couldn't detect where gives this error neither which code block gives this error in the app. Thanks.  Addition: Here is the my project on Github:   Addition 2: Here is my app on Google Play:   Addition 3: I suspect app crashes on these code block but I don't know why it crashes:  View.OnClickListener clickListener = new View.OnClickListener() {     @Override     public void onClick(View view) {         ViewHolder holder = (ViewHolder) view.getTag();         final int position = holder.getPosition();          AlertDialog.Builder builder = new AlertDialog.Builder(mContext);         builder.setTitle(R.string.chooseaction);         builder.setItems(R.array.choose_actions, new DialogInterface.OnClickListener() {             @Override             public void onClick(DialogInterface dialog, int which) {                 // Get Uri                 String path = Environment.getExternalStorageDirectory().toString() + "/GÃ¼nlÃ¼k BurÃ§lar";                 File f = new File(path);                 File file[] = f.listFiles();                 Intent intent = new Intent();                 if (which == 0) {                     // Show                     intent.setAction(android.content.Intent.ACTION_VIEW);                     intent.setDataAndType(Uri.fromFile(file[position]), "image/*");                     mContext.startActivity(intent);                 } else if (which == 1) {                     // Share                     intent.setAction(Intent.ACTION_SEND);                     intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file[position]));                     intent.setType("image/*");                     mContext.startActivity(intent);                 } else {                     // Delete                     file[position].delete();                     Toast.makeText(mContext, R.string.deleted, Toast.LENGTH_SHORT).show();                     intent = new Intent(mContext, FavoritesActivity.class);                     mContext.startActivity(intent);                     ((FavoritesActivity) mContext).finish();                 }             }         });         builder.show();     } };

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?


I can remember these details:    The ship is disintegrating because years ago it passed through a cloud containing organisms that are now eating through its hull Nobody is able to figure out how to get rid of the organisms It's a generation ship. The main characters were born there and are the latest of many generations who have never lived on a planet The ship is not going to make it to the new earth colony before it disintegrates The main characters encounter some other beings (can't remember details) that help them travel faster than light to arrive at their destination   I got this book at a school book fair when I was in maybe 6th or 7th grade (early 80s). I can't remember the author or the title, but would love to rediscover it and/or share it with my kids.   Thanks for your help!

In the late 1970s I bought a book at a school book fair (likely published by Scholastic) about a young boy who lived on a generational starship.  The ship was failing.  I remember some bit about an icey cold airlock.  One of the constellations (Cygnus) somehow took on actual fleshy form and manifested as a talking swan, which somehow helped the starships reach their destination.  Pointers?


I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


I have a question regarding this limit (of a sequence): $$\lim_{n\to \infty} n|\sin(n)|$$ Why isn't it infinite? The way I thought this problem is like this-$|\sin(n)|$ is always positive, and n tends to infinity, so shouldn't the whole limit go to infinity? What is the right way to solve this and why is my idea wrong?

How would you evaluate the limit inferior of the sequence $n\,|\mathopen{}\sin n|$? That is, $$\liminf\limits_{n\to\infty} \ n \,|\mathopen{}\sin n|$$    Edit. Let $\mu$ be the irrationality measure of $\pi$. Since $\mu$ is not known, I will split the question:   Assuming $\mu > 2$, what is $\liminf\limits_{n\to\infty} \ n\,|\mathopen{}\sin n|$? Assuming $\mu = 2$, what is $\liminf\limits_{n\to\infty} \ n\,|\mathopen{}\sin n|$?     I kind of like its graph...


I installed gnuplot on my yosemite system using brew. When I try to plot cos(x) the way I would on ubuntu, I get this:  gnuplot> plot cos(x) WARNING: Plotting with an 'unknown' terminal. No output will be generated. Please select a terminal with 'set terminal'.   I also notice that when gnuplot loads, it says Terminal type set to 'unknown'. I would like to load the graphs in a new window, so I tried set terminal xterm, which seems to work at first glance, given the message Terminal type set to 'xterm'. But then I try plotting again, and it produces garbage:    How do I get the terminal to function correctly, as it does on ubuntu?

I am trying to plot with gnuplot on my Mac (OS X 10.8.5). I have installed X11 and XQuartz 2.7.4 and after that I installed gnuplot, but unfortunately gnuplot couldn't plot.   Simple plots like the following fail to render and have no error message to help understand what is amiss:   [1/10/13 $gnuplot >plot sin(x)


The screen of my Macbook pro cracked from the bottom left, and vertical + horizontal lines appeared. While waiting to repair it, is there any way to decrease the used space from the display to fit only in the non-damaged area? For example 90% width (right to left), 90% height (top to bottom).

Recently, something went wrong with my Macbook Pro 13" 2019 model's display. About 1.5 inches (in length) of my display went completely black and there are some vertical lines on the edges of this black portion. It appears to be a hardware issue.  I was wondering if I can do something so that my entire screen appears in only the part to the right of this black portion, until I can find the time to give my laptop for repair. I know I can just rescale my window each time, but I don't want to keep doing that every time I open a new window. Can I use software to remap the entire display area to a smaller section of a physical display?


I am starting with Quantum Mechanics, learning online. I can't seem to find the reason for $|\Psi|^2$ being the probability density of finding an electron. They've just taken it for granted everywhere. I am learning all this math but I am not able to fully grasp the intuitive idea behind all of it. If anyone could explain this with proper reasoning, I would be grateful.


I try to download a pdf on an https server (with an authenfication) but this is unsuccessful with Chrome or LG Browser. This is ok with Firefox. I found this answer/comment : .  Is there a solution for a non-power user ?

On my Galaxy S3 / ICS handset, and also I expect on my previous Galaxy S / Froyo I'm unable to save any links from my web server due to the fact that it requires a user authentication. I can browse the site happily in Chrome and the default browser, but when I go to save a link, whatever it is that does the downloading sends in an HTTP request with no user agent not authentication header set, so the download fails, with a 401 error being returned.  What gives, peeps?


I'm trying to overload operator << in my template class and I get error where i want to   NSizeNatural<30> a(101); cout << a;   Without this whole program compiles  Error:  error LNK2019: unresolved external symbol "class   std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<<30,unsigned int,unsigned __int64,10>(class std::basic_ostream<char,struct std::char_traits<char> > &,class NSizeNatural<30,unsigned int,unsigned __int64,10> const &)" (??$?6$0BO@I_K$09@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABV?    $NSizeNatural@$0BO@I_K$09@@@Z) referenced in function _main   My Numbers.h file :  template<int size, typename basic_type = unsigned int, typename long_type = unsigned long long, long_type base = bases(DEC)>  class NSizeNatural {        // this is how I decelerate friend function        friend ostream& operator<<(ostream& str, const NSizeNatural<size, basic_type, long_type, base> & n); }   In  Numbers.cpp file :  template<int size, typename basic_type, typename long_type, long_type base> std::ostream& operator<<(std::ostream& out, const NSizeNatural<size, basic_type,   long_type, base> &y) {    // For now i want to have my code compile-able     return out << "gg";  }    I have no idea how to do it correctly. And where is a bug ...

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.)


I have a large buffer of strings (basically 12GB) from a C app.  I would like to create PyString objects in C for an embedded Python interpreter without copying the strings. Is this possible?

I have embedded a Python interpreter in a C program.  Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text with a certain encoding (e.g., ISO 8859-1, Windows-1252, or UTF-8).  How do I decode the contents of this char array into a Python string?  The Python string should in general be of type unicode—for instance, a 0x93 in Windows-1252 encoded input becomes a u'\u0201c'.  I have attempted to use PyString_Decode, but it always fails when there are non-ASCII characters in the string.  Here is an example that fails:  #include <Python.h> #include <stdio.h>  int main(int argc, char *argv[]) {      char c_string[] = { (char)0x93, 0 };      PyObject *py_string;       Py_Initialize();       py_string = PyString_Decode(c_string, 1, "windows_1252", "replace");      if (!py_string) {           PyErr_Print();           return 1;      }      return 0; }   The error message is UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 0: ordinal not in range(128), which indicates that the ascii encoding is used even though we specify windows_1252 in the call to PyString_Decode.  The following code works around the problem by using PyString_FromString to create a Python string of the undecoded bytes, then calling its decode method:  #include <Python.h> #include <stdio.h>  int main(int argc, char *argv[]) {      char c_string[] = { (char)0x93, 0 };      PyObject *raw, *decoded;       Py_Initialize();       raw = PyString_FromString(c_string);      printf("Undecoded: ");      PyObject_Print(raw, stdout, 0);      printf("\n");      decoded = PyObject_CallMethod(raw, "decode", "s", "windows_1252");      Py_DECREF(raw);      printf("Decoded: ");      PyObject_Print(decoded, stdout, 0);      printf("\n");      return 0; }


I want to make a slowly waving(?) flag, but it must be a loop, and i don't know how to do it :( Help me please  P.S. Also interested in making more realistic material with cycles, but that's not necessary

I have created a waving flag simulation by pinning a set of points, adding cloth physics, and setting up wind forcefields. The result is just fine when I render the scene except that I want the resulting png files to be a continuously looping animation.  The resulting animation is currently jumping when the loop transitions from the last frame to the first frame.  I have tried exporting to lightwave format, importing it back in and inserting appropriate shapekeys to get an interpolation between the last and first frame, (as described ), but it seems the export-import step messes up both the orientation and the basis for the shape keys. I tried  twice and I also tried using a custom plug-in that ,  but my shape keys at 1.0 value are always stretched out and rotated compared to the same shape key at 0.0.  The result is that after interpolation, the flag not only waves, but also rotates and stretches.  I am thinking about trying one of the following routes:   Somehow edit the necessary shapekeys at value 1.0 so that it matches the orientation and rotation at 0.0.  Look into the export-orientation problem and see if I can fix it myself. Try to morph from last frame to first frame of the rendered result using some other tool.   What do you think is the easiest and best way to go to get a nice loop transition?  Edit:  After trying sambler's suggestion using two modifiers with varying influence in the transition between last and first frame, the mesh seems to be rotated and scaled in the frames where the modifier influence is interpolated.


In the following multilevel analysis in R (taken from , page 57):  > Model.1<-lme(WBEING~HRS+G.HRS,random=~1|GRP,data=bh1996, control=list(opt="optim")) > summary(Model.1) Linear mixed-effects model fit by REML Data: bh1996      AIC      BIC  logLik 19222.28 19256.81 -9606.14  Random effects: Formula: ~1 | GRP            (Intercept) Residual StdDev:             0.1163900 0.8832353 Fixed effects: WBEING ~ HRS + G.HRS             Value     Std.Error  DF    t-value  p-value (Intercept) 4.740829  0.21368746 7282 22.185808 <.0001 HRS        -0.046461  0.00488798 7282 -9.505056 <.0001 G.HRS      -0.126926  0.01940357   97 -6.541368 <.0001  Correlation:        (Intr) HRS HRS    0.000 G.HRS -0.965 -0.252  ...   How can the latter table (Correlation) be interpreted? What do these correlations mean?

I have the following output:   Generalized linear mixed model fit by the Laplace approximation  Formula: aph.remain ~ sMFS2 +sAG2 +sSHDI2 +sbare +season +crop +(1|landscape)    AIC   BIC    logLik deviance  4062  4093  -2022   4044  Random effects: Groups    Name        Variance Std.Dev. landscape (Intercept) 0.82453  0.90804  Number of obs: 239, groups: landscape, 45  Fixed effects:             Estimate Std. Error z value Pr(>|z|)     (Intercept)  2.65120    0.14051  18.868   <2e-16      sMFS2        0.26922    0.17594   1.530   0.1260     sAG2         0.09268    0.14529   0.638   0.5235     sSHDI2       0.28345    0.17177   1.650   0.0989   sbare        0.41388    0.02976  13.907   <2e-16  seasonlate  -0.50165    0.02729 -18.384   <2e-16  cropforage   0.79000    0.06724  11.748   <2e-16  cropsoy      0.76507    0.04920  15.551   <2e-16   Correlation of Fixed Effects:            (Intr) sMFS2  sAG2   sSHDI2 sbare  sesnlt crpfrg sMFS2      -0.016                                           sAG2        0.006 -0.342                                    sSHDI2     -0.025  0.588 -0.169                             sbare      -0.113 -0.002  0.010  0.004                      seasonlate -0.034  0.005 -0.004  0.001 -0.283               cropforage -0.161 -0.005  0.012 -0.004  0.791 -0.231        cropsoy    -0.175 -0.022  0.013  0.013  0.404 -0.164  0.557   All of my continuous variables (denoted by a small s before the variable name) are standardized (z-scores). season is a categorical variable with 2 levels (early and late), and crop is a categorical variable with 3 levels (corn, forage, and soy).  This correlation of fixed effects matrix is really confusing me, because all of the correlations have the opposite sign that they do when I look at the simple regressions of pairs of variables. i.e., the correlation of fixed effects matrix suggests a strong positive correlation between cropforage and sbare, when in fact there is a very strong NEGATIVE correlation between these variables - forage crops tended to have much less bare ground compared to corn and soy crops. Pairs of continuous variables have the same issue, the correlation of fixed effects matrix says everything is the opposite of what it should be ... Could this just be due to the complexity of the model (not being a simple regression)? Could it have something to do with the fact that the variables are standardized?   Thanks.


I would like to compare 2 strings and have True if the strings are identical, without considering the accents.   Example : I would like the following code to print 'Bonjour'  if 'séquoia' in 'Mon sequoia est vert':     print 'Bonjour'

I have a Unicode string in Python, and I would like to remove all the accents (diacritics). I found on the web an elegant way to do this (in Java):  convert the Unicode string to its long normalized form (with a separate character for letters and diacritics) remove all the characters whose Unicode type is "diacritic".  Do I need to install a library such as pyICU or is this possible with just the Python standard library?  And what about python 3? Important note: I would like to avoid code with an explicit mapping from accented characters to their non-accented counterpart.


Is it possible to show two or more labels for one layer? For example - one label will show the name of a school and the 2nd label will show the number of students? They should be completely different labels. Editing one label (its buffer, font, background etc.) will not affect the other labels

How to create vertical labels (each label in new line) like:  1998 150 pipe name   and not horizontal:  1998 150 pipe name


How can microwaves pass through opaque objects in spite of having lesser energy than visible light(which doesn't pass through opaque surfaces)?? What makes an object "opaque" in the first place?

Both light and radio waves are electromagnetic waves.that means they have almost similar properties. Both are EM waves ,E and H fields are there in both waves.....but My question is "radio waves can pass through walls ,but why can't a light pass through walls or opaque medium???


I love  and do not want to disable them everywhere, but the ls colors are useless on ntfs-mounted (and probably other similar file systems - like exfat) partitions, because all files there have 777 permissions. They are also distractive because directories are shown in inverse video and thus have poor contrast.  Is there a way to selectively disable colors on some partitions?

I have Xubuntu 14.04, and I have an NTFS data partition that mounts at startup via fstab. How could I adjust the color settings for xfce4-terminal beyond the GUI options? For example how could I set up specifically the color or font-weight of directories or files for 'ls'? Most importantly for now, I would like to make my partition directories appear exactly as they do in my Xubuntu partition (or at least remove the highlighting). Screen shot posted here. Much thanks in advance.


hope that everyone is doing okay , I have a question , i want to know if it possible to install packages from 12.04 to 14.04 not all of them just a few (for exemple i want to transfer the packages that i installed on 12.04 two days ago on the 14.04 version) it is possible ?  thank you for your help

I installed 12.04 in a separate partition. Right now, I would like to install the software that I have installed on my 10.04 in my 12.04 too. I was hoping there would be a workaround for this using aptonCD. But I figured out 'restoring' using apt on cd only copies the .debs into the cache file and that might mess things up for me considerably.  The rough idea that I have is :   Run an 'apt' command on 10.04 that will give me all the package names that I have currently installed on my 10.04. Bring those names to 12.04 and tell apt to fetch the same softwares, but the versions of them that belong to 12.04. Install them.   Is there anyway to do the above steps or is there a totally different way in which I can achieve this?


I'm using biblatex to build my citations and my bibliography for a math paper. However, I have certain portions like this:    As you can see, I am trying to say "as d tends towards 1" but with the superscript citation it seems like I'm saying "as d tends towards 1 to the power of 17". To prevent misinterpretation, I have decided to enclose each superscript in square brackets. How can I do this?  Here is my MWE:  \documentclass[british, 11pt, reqno]{amsart} \usepackage[utf8]{inputenc}  \usepackage{babel} \usepackage{csquotes} \usepackage{amsmath, amssymb} \usepackage[backend=biber, style=apa]{biblatex} \DeclareLanguageMapping{british}{british-apa} \addbibresource{Biblio.bib}   This is a test script\footcite{BrinPage1998}. As $d \longrightarrow                          1$\footcite{BrinPage1998}.   Here is the Biblio.bib:  @article{BrinPage1998, author={Brin, Sergey and Page, Lawrence}, title={The Anatomy of a Large-scale Hypertextual Web Search Engine}, journaltitle={Computer Networks and ISDN Systems}, volume={30}, issue={1-7}, pages={107--117}, date={1998-04-01}, url={http://dx.doi.org/10.1016/S0169-7552(98)00110-X}, urldate={2017-04-02}, publisher={Elsevier Science Publishers B. V.}, address={Amsterdam, The Netherlands, The Netherlands}, }

I have written my dissertation with LaTeX, but my teacher has suggested to put the number of footnotes in braces / parentheses. I thought it would be easy, but I haven't found the answer anywhere! I would like it to look as follows:     I would like (1) it to look like this.      (1) and not 1.


Provide a reason for each step of the proof. Prove the identity $$\arctan(1)+\arctan(2)+\arctan(3)=180^{\circ}$$Proof:\begin{align*}\arctan(1)+\arctan(2)+\arctan(3)&=\text{arg}(1+i)+\text{arg}(1+2i)+\text{arg}(1+3i)\\&=\text{arg}\left[(1+i)(1+2i)(1+3i)\right]\\&=\text{arg}(-10)=180^{\circ} \hspace{4cm}\blacksquare\end{align*}

Playing around on wolframalpha shows $\tan^{-1}(1)+\tan^{-1}(2)+\tan^{-1}(3)=\pi$. I know $\tan^{-1}(1)=\pi/4$, but how could you compute that $\tan^{-1}(2)+\tan^{-1}(3)=\frac{3}{4}\pi$ to get this result?


When I click the Migrate option in the close vote (in off topic), it lists a few sites. To be exact, it lists Meta (this), SuperUser, TeX.SE, DBA.SE and sharepoint.SE. There's not an option for programmers.SE. How do you request a question to be moved to programmers.SE?

When I vote to close a question because it is off topic, the only other SE I can recommend the question to are the following 5:    In this instance I feel the question should have been posted at wordpress.stackexchange.com, but I have no way to suggest this?


Hi so I just added a circle with vertices 32. and when i go into edit mode they dont show up on the circle? I need to do some work with it and i need to see the vertices. Any ideas why its not showing up?  I have tried alt-H and that wont work.  Thanks

Is there a shortcut for switching between these three modes?


how to get host name from bellow Example.     I/P:  | O/P: stackoverflow.com      I/P: stackoverflow.com/users/login | O/P: stackoverflow.com      I/P: /users/login  | O/P: (return empty string)   I checked parse_url function, but doesn't return what I need. Since, I'm beginner in PHP, it was difficult for me. If you have any idea, please answer.

I need to build a function which parses the domain from a URL.  So, with   http://google.com/dhasjkdas/sadsdds/sdda/sdads.html   or  http://www.google.com/dhasjkdas/sadsdds/sdda/sdads.html  it should return google.com  with   http://google.co.uk/dhasjkdas/sadsdds/sdda/sdads.html  it should return google.co.uk.