What is $$\lim_{p\to0}\left(\int_0^1\left(f(x)^p\right)dx\right)^{1/p}$$  ?  Where f is continuous  It was an exam question and I don't know how to even get started with it, could you help? (It is not $f(x^p) $ but $\left(f(x)^p\right)$ so the p-th power of $f(x)$ )

The $L^p$ norm in $\mathbb{R}^n$ is \begin{align} \|x\|_p = \left(\sum_{j=1}^{n} |x_j|^p\right)^{1/p}. \end{align} Playing around with WolframAlpha, I noticed that, if we define the "scaled" $L^p$ norm in $\mathbb{R}^n$ to be  \begin{align} \| x \|_p = \left(\frac{1}{n}\sum_{j=1}^{n} |x_j|^p\right)^{1/p} \end{align} then \begin{align} \lim_{p \to 0} \|x\|_p &= \left( \prod_{j=1}^{n} |x_j| \right)^{1/n}, \end{align} which is the geometric mean of the coordinates' absolute values. This is interesting maybe because the $L^p$ norm doesn't have a nice limit at zero.  My questions:   How do I prove this? Is this definition of "scaled $L^p$ norm" interesting, or known by another name, or used anywhere? Is there any interesting reason to define the $L^0$ norm as the geometric mean, as above? Further reading?   Thanks!


I bought vacuum packed vine leaves quite some time ago. Stupidly didn't get round to using them so they are still in the fridge. They are well passed their sell by date of March 2011. Should I just bin them or do you think they are still fine to use? I think they look okay...  Thanks very much for your help!  Kate

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


Consider that you're tossing a coin $1000$ times. First $999$ times, it came up heads. Is it $50\%$ chance that the coin tails after $1000^{th}$ trial? Are these discrete events?  Since the mean of these experiments is $500H$ $500T$, each heads increases the probablility of tails, doesn't it?  Edit: Let me ask the question that way: If I toss the coin 10 times, $5H$ and $5T$ is the mean.  If $TTT$ comes up, then probability of $H$ would be $\frac{5}{7}$, would it not?

I have little knowledge of probability and have recently been thinking of a math problem I am sure you guys could answer  If for example I tossed a coin ten times and got all heads, would the odds of the next coin toss beeing heads be 50 50 or s very low as the odds of getting 11 in a row is tiny?   Thanks


sql> SELECT * FROM runners; +----+--------------+ | id | name         | +----+--------------+ |  1 | John Doe     | |  2 | Jane Doe     | |  3 | Alice Jones  | |  4 | Bobby Louis  | |  5 | Lisa Romero  | +----+--------------+  sql> SELECT * FROM races; +----+----------------+-----------+ | id | event          | winner_id | +----+----------------+-----------+ |  1 | 100 meter dash |  2        | |  2 | 500 meter dash |  3        | |  3 | cross-country  |  2        | |  4 | triathalon     |  NULL     | +----+----------------+-----------+   What will be the result of the query below?  SELECT * FROM runners WHERE id NOT IN (SELECT winner_id FROM races);   The above query will return nothing because the races table contain null winner_id. But what is the reason behind this?

I had a query (for Postgres and Informix) with a NOT IN clause containing a subquery that in some cases returned NULL values, causing that clause (and the entire query) to fail to return anything.   What's the best way to understand this? I thought of NULL as something without a value, and therefore wasn't expecting the query to fail, but obviously that's not the correct way to think of NULL.


Let $n \in \mathbb{N}_{\geq 1}$ be a number of pairs of people, so in total there are $2n$ people and every person has exactly $1$ partner. Furthermore, if person $A$ is the partner of person $B$, then person $B$ is the partner of person $A$.  The people want to play the game "Secret Santa", which involves giving gifts to people. Every person must give away exactly $1$ gift and must receive exactly $1$ gift. It is not allowed to give a gift to oneself or to ones respective partner.   How many possibilities are there to play this game?  The first few values of the sequence we are looking for are $a_1 = 0, a_2 = 4, a_3 = 80,...$  If we drop the restraint that the people are organised in pairs, then the wanted number is just the number of fixed-point free permutations of $2n$ elements, but the pair requirement seems to substantially complicate things.

My family does a gift exchange every year at Christmas. There are five couples and we draw names from a hat. If a person draws their own name, or the name of their spouse, all the names go back in a hat and we re-draw names. This happens maybe 7 times out of 8.  Using a computer, I know that the probability of this happening is   1 - (440192 / 10!)   or about 88%.  (It's been too long since I took combinatorics) What's a general expression for n couples?  Edit Oct 19, 2011: I was so impressed with the answer, I wrote a blog post about it:


Prove by complete induction that any natural number $n\ge2$ is equal to a product of prime numbers.

I'm trying to get through Spivak's Calculus on my own and even though I kinda understand induction I'm not so sure that's the case when it comes to complete induction. So I tried to do a starred problem which involves using it. But I'm not sure that my proof is valid, can someone check this for me?  So the problem is that I have to prove that     For every natural $n>1$, if $n$ is not prime we can write it as a product of primes.   I'm starting with a base case. For $n=2$, $n$ is prime, so the assumption holds.  Let's assume that for some $n > 1$ and also all numbers $p <= n$ the assumption holds.  Then $n+1 = cd$. If $n+1$ is not prime, then $c < n+1$ and $d < n+1$, but as they are natural numbers, we can also write that $c <= n$ and $d <= n$. But we assumed that if $p <= n$, and $p$ is not prime, we can write it as a product of primes. So if $c$ or $d$ are not primes, we can write them as a product of primes. That means that $n+1$ can be written as a product of primes if it's not prime, which completes the proof.


In the question:   Now I'm running sed inside script to append a large text. But how to not concatenating strings in one sed command. That is to say for example, I want to insert the following text:  firstline secondline thirdline fourthline   And in sed, I want to write something like the following in a script file:  sed -i '/Hello World/a \\ firstline\\ secondline\\ thirdline\\ fourthline' file   Instead, now i'm matching many unordered strings.  Dont know how and where to break like this after requiring matching multiple strings. The \\ is definitely nicer and easy to modify especially if there are large numbers of appended lines.

I'm trying to use sed to append appendstring after a line that contains both Hello and World.  Hello something here World World fsf Hello   This works if I do consider order:  sed -i '/Hello*World\|World*Hello/a appendstring' file   But if I have many strings to match and they are not in order, this is definitely not effective.  Then I tried solutions from another link which discussed deleting a line that contains both strings without considering their order.     However,  sed -i '/Hello/!b;/World/d' file   This does not even work for deletion.   The following one, also one of the answers to that question:  sed -i '/Hello/{/World/d}' file   works, so I tried to implement it to append. Using:  sed -i '/Hello/{/World/a} appendstring' file   But received error:  sed: -e expression #1, char 0: unmatched `{'   Update: The post in the link stated the solution with !b, and it was not working in cshell because of the exlamation mark, but it is working in sh and bash. And it can also be easily extended to inserting many lines when running sed inside a script and the appending a large paragraph.  sed -i '/Hello/!b; /World/a \ addline \ addanotherline ' file


I understand MATE is a desktop environment, but what is the difference between ubuntu with a MATE desktop environment and  ?  EDIT:  is not a duplicate of my question because there is a dedicated distribution called ubuntu-mate

Hai all I just want to know is there any Difference Between  and . I love to use Ubuntu... But I hate the Unity desktop... So want an Ubuntu system with GNOME 3. So if I install Ubuntu GNOME is that same as that of a usual Ubuntu with the GNOME desktop installed?  I just want to know, does this mean if I install Ubuntu GNOME 14.04.2 then everything other than the desktop is same as in Ubuntu 14.04.2?


I can't find a booze barrel for the quest to get the dwarfs drunk and kill them in the slammer thing. Whatever it's called.

In the Tiny Tina DLC "The Beard Makes the Man" quest, the objectives are (1) Crush five drunk dwarves, (2) Pick up five beards, and (3) Get five dwarves drunk. (The last one's optional.) I found the miner dwarves in the mine on the minimap, but they won't follow me into the crusher machine. How do I lure them? Does it have to do with getting them drunk, and how can I do that with no alcohol around? I thought getting drunk was optional?


I'm dealing with this big dataset which has:   1 categorical variable with 90 levels that represent some sort of "geographical area" 3 continuous variables   What I'm trying to do is to "aggregate" the levels of the categorical variable, to a maximum of 10.  I don't know exactly which technique I should use to accomplish this, for example whether I should use factor analysis or some clustering (unsupervised)

I have a dataset that consists of only categorical variables and a target variable. I want to predict the (binary) target variable with the categorical variables.  I am trying to do this in Python and sklearn.  The categorical variables have many different values. I was thinking to create dummy variables for each value in all the categorical variables. However, in the end this results in a sparse data set with thousands of variables.  How would you go about to reduce the number of dummy variables? Would you use Chi2 to select useful features?  Or would you not make dummy variables at all?


I am building a ecommerce checkout flow and am looking for best practices for the billing/shipping entries. Every site I use and every one I've looked at for inspiration has the address entries as a separate field for each part of the address. I don't understand why I don't see any sites that allow the user to enter their address in a single free-form textarea box? I'd imagine a single textarea would be much quicker and simpler to use.  I'm seriously considering using the single textarea for my checkout flow but a concern is that it will be different to the common multi-box approach and possibly confuse the customer or at the very least make them stop and think?

Both customers and companies want a quick and easy checkout experience. From what I've seen, a big UX bottleneck at checkout is the billing and/or shipping address(es) because there are so many input fields per address.  The traditional way of typing an address is something like:     Street address: 123 main st      Unit: 101      City: Schenectady      State: NY ▼      Zip code: 12345      Country: United States of America ▼   This is usually frustrating for me, because some addresses are "edge-cases" and don't necessarily fit into the format required by the web page.  And often, these fields are duplicated to populate both shipping and billing addresses. My question isn't how to prevent that duplication (there are "Ship to my billing address"  checkboxes for that), but it's about reducing the number of fields on the form from 6+ to just 1:     Address: 123 main st #101, schenectady, ny 12345      (could be a small, multi-line textarea too)   Is it a more positive user experience to combine all the fields for an address into a single input field?


Hi I am building a pocket altitude, temperature and humidity meter with 1.8" TFT display. I have a 1000mah 3.3v Li-ion battery to power the whole system. I also need to display the battery level in percentage in the device. I am confused about which way i need to use. The same battery is powering the device so using voltage divider is not useful because of the ADC reference depends on the battery. Can you guys help me to overcome this?

I'd like to estimate the remaining battery life of a battery that powers a microcontroller. Could I accomplish this by simply leading the battery into the MCU's built-in ADC?  My idea is that I could plot the voltage over time to figure out how much battery life remains. But would the change in voltage be noticeable? And would it be a problem that the same battery powers the MCU (and ADC)?


Im using ajax to render a table on my page. In the last row of the table Im trying to display a button which is handling my "edit" function like so: $(".editPersonnel").on("click", function () { $("#editPersonnelModal").modal("show"); $tr = $(this).closest("tr");  var data = $tr   .children("td")   .map(function () {     return $(this).text();   })   .get();  $("#idPer").val(data[0]); $("#updateLastName").val(data[1]); $("#updateFirstName").val(data[2]); $("#updateJobTitle").val(data[3]); $("#updateEmail").val(data[4]); $("#updateDepartment").val(data[5]); $("#updateLocation").val(data[6]); console.log(data);  }); Im trying to render that button using jQuery but when I do this:  $("<td>").html(              '<td><button class="btn btn-info editPersonnel">Edit</button>'             )  the button shows on the page but doesn't work. Can anyone help me to solve this problem? Im still such a newbie... Thanks!

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.


So this is the first project that Ive worked with were I am NOT working with a pre built CMS and i'm trying to make sure that the data that is submitted is secure.   My question is in two parts: a) Is the way that I am checking $_POST values secure enough? here it is:   function validateInput($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data;    }  $id = validateInput($_POST['id']); $name = validateInput($_POST['name']); $address = validateInput($_POST['address']);   b) if not, how can I make it more secure and less likely to be SQL injected?  I would really appreciate some help on this. Thanks guys

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


What is meaning of "??" and why not return "(dbContext = new TeduShopDbContext())" instead of  return dbContext ?? (dbContext = new TeduShopDbContext())     public TeduShopDbContext Init() {     return dbContext ?? (dbContext = new TeduShopDbContext()); }   thank for helping

Ran across this line of code:  FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();   What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google.


Express First kind Chebyshev polynomial in terms of monomials   I have a function as   (1)  $f=\sum_i^n a_iT_i$ ,   where $T_i$ are first kind Chebyshev polynomial of order "i". I want to express $f$ in terms of monomials (powers of x). Hence, I need to write $T_i$ in terms of monomials.This can be done using following recursive formula: $T_0(x)=1; T_1(x)=x; T_{n+1}(x)=2xT_n(x)−T_{n−1}(x)$ for $x \in [-1, 1]$.  So function $f$ in terms of monomials and the original function in (1) should match over $x\in [-1 1]$  However as "i" increases ($i\ge45$), the two functions do not match.  For example, following Matlab plots function $f=T_{50}$ both in monomials space and Chebyshev space.  clc;clear;close all; % f=T_n;  n=50; x=[-pi:0.1:0]; plot(cos(x),cos((n-1)x),'k-')  syms x; Tr(1,1)=1+0*x; Tr(2,1)=x; for i=2:n-1; Tr(i+1,1)= expand(2*x*Tr(i,1)-Tr(i-1,1));end; hold on;for x=-1:0.01:1; plot(x,eval(Tr(end)),'--bo'); end;

Express First kind Chebyshev polynomial in terms of monomials   First kind Chebyshev polynomial of order n ($T_n$) is defined in terms of cosine function as follow:  1)  $T_n(\cos x)=\cos n x$    Instead of working with cosine functions, I want to express Chebyshev polynomial in terms of monomials (powers of x) using the following recursion formula: $T_0(x)=1; T_1(x)=x; T_{n+1}(x)=2xT_n(x)−T_{n−1}(x)$ for $x \in [-1, 1]$.  For example, first kind Chebyshev polynomial of order 2 can be expressed as:  Usig formula 1) $T_2(cosx)=cos(2x)$, Usig recursive formula) $T_2(x)=2xT_1(x)-T_0(x)=2x^2-1$  If we plot $cos2x$ vesrus $cosx, cosx\in [-1,1]$ and also $2x^2-1$ versus $x,  x\in [-1, 1]$, the two plot should match.  However as "n" increases ($n\ge45$), the $T_n$ obtained as a polynomial by the recursive formula doesn't match the Chebyshev polynomial of formula (1).  Why is that????? The recursion formula is not valid for higher orders????  here is my Matlab code that compares two formulas:  clc;clear;close all; syms x;  n=45;  Tr(1,1)=1+0*x; Tr(2,1)=x; for i=2:n; Tr(i+1,1)= expand(2*x*Tr(i,1)-Tr(i-1,1));end; hold on;for x=-1:0.01:1; plot(x,eval(Tr(n)),'--bo'); end;   t=[0:0.01:2*pi]; plot(cos(t),cos((n-1)*t),'k*-')


From , we are given a system of equations and a restriction:     Let $a,b,c > 0$ for      $$\begin{cases}     \log_a(b^x) & = & 2 \\     \log_b(c^x) & = & 2 \\     \log_c(a^x) & = & 5 \end{cases}$$      $x =\,\,?$      $$\log_a(b^x) = 2 \iff b^x=a^2$$   We now have $$     b^x = a^2 \\     c^x = b^2 \\     a^x = c^5 $$  Adding these up and rearranging, we have  $$a^x + b^x + c^x = a^2 + b^2 + c^5$$  Now $x$ does not seem to have a consistent solution. How is this possible?  A comment suggested this might be due to  an over-determined system, but  shows that it has the unique solution $x^3 = 20$.  From the original post, we have the following question (which was not answered)     Looks to me like x is equal 2 different numbers at the same time which is strange, what am I doing wrong here?

$Let$ $a,b,c>0$  $$\begin{cases}\log_a(b^x)=2\\\log_b(c^x)=2\\\log_c(a^x)=5\end{cases}$$  $$x=?$$  So my attempt is just to use the logarithmic definition:  $$\log_a(b^x)=2\iff b^x=a^2$$  By similar logic,  $$a^x=c^5$$ $$c^x=b^2$$  So, if add everything together, we should get:  $$a^x+b^x+c^x=a^2+b^2+c^5$$  Looks to me like x is equal 2 different numbers at the same time which is strange, what am I doing wrong here?  I'm going to be a maths student in the upcoming year, this is taken from the Tel-Aviv university preparation material - shouldn't be too complex.


Sometimes I get an edit to review that has comment which has nothing to do with the edit. Such as a retag edit commented as fixed grammar or improved formatting. These comments confuse me a lot and make me think the user did something else then he intended to do or thought he was doing. Yet I would accept the edit without hesitation if it wasn't for the comment.

I must get up to 5 or 6 of my daily Suggested Edits that have the following as Edit Summary:     Fix bad grammer [sic]   Maybe I'm just a spelling/grammar/syntax Nazi, but it makes me angry that people who are supposedly improving the grammar of a post can't write 3 words without making a blatant error.  Is it OK to not even give a glance to the actual changes and reject the edit solely based on badly spelled Edit Summary?


Find all function $f:\mathbb{R}\to\mathbb{R}$ such that $$f(f(x)+y)=f(x^2-y)+4f(x)y, \forall x, y\in\mathbb{R}$$ By substitution $y\to\frac{x^2-f(x)}{2}$, $$f(x)(x^2-f(x))=0$$. Now I want to prove that if there os some $x_0\neq0$ such that $f(x_0)=0$, then $f(x)=0,\forall x\in\mathbb{R}$ Substituting $x\to x_0$, $$f(x_0^2-y)=f(y)\implies f(x_0^2)=f(0)=0$$. Then by induction $f(x_0^{2^n})=0$. But I can't finish that. Can anyone help me?

Determine all $f : \mathbb R \rightarrow \mathbb R$ such that $$f\big(f(x) + y\big) = f(x^2 - y) + 4yf(x)$$ for all $x,y\in\mathbb{R}$.   $f(x) = 0$ is obvious , but how can we find all other functions?  Thanks in advance!


I am writing a code which reads the following input  3 Ruby Diamond Sapphire   Here is my program   import java.util.Scanner;  public class GemStones {      private int numOfStones;     private String[] gemArray;      public void solve() throws Exception{          Scanner in = new Scanner(System.in);          //Reading the integer         numOfStones = Integer.parseInt(in.nextLine());         //in.nextLine();         System.out.println(numOfStones);           //reading the strings         for(int i=0;i<numOfStones;i++){             gemArray[i] = in.nextLine();             System.out.println(gemArray[i]);         }           for(int i=0;i<numOfStones;i++){             System.out.println(gemArray[i]);         }         in.close();     }       public static void main(String[] args) throws Exception {         GemStones check = new GemStones();         check.solve();       }  }   I have a problem reading the strings following it. Whenever I try to read the strings it shows me error! please help me..  The following is the error I get in the console  3 Ruby Diamond Sapphire3Exception in thread "main"  java.lang.NullPointerException     at com.sudarabisheck.easy.GemStones.solve(GemStones.java:23)     at com.sudarabisheck.easy.GemStones.main(GemStones.java:37)

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?


How can I rename Desktop, Download, Music, Pictures & ... folders names to desktop, download, music, pictures & ... .  NOTE: I'd simply rename them by mv command, but still have troubles. Because when clicking on places panel, get the following error:  Unable to find the requested file. Please check the spelling and try again. Unhandled error message: Error when getting information for file '/home/mehrshad/Documents': No such file or directory

I'd like to know if it's safe to rename user folders like "Desktop", "Documents", "Music" (I want them to start lowercase)?  Are there any programs in a default installation of Ubuntu (10.10/11.04) that expect those folders to exist and that cannot be configured to use different ones?


Today I downloaded the ISO files of Ubuntu: 64-bit and 32-bit.  Still, the 64-bits one has the error: "This kernel requieres an x86-64 CPU, but only detected an i686 CPU. Unable to boot - Please use a kernel appropiate for your CPU."  And the 32-bit one has it's icon blank, wich makes it kinda weird, and when I try to use it in VirtualBox, it says that the file isn't a CPU/ISO file.  What can I do?

I'm trying to install Lubuntu on my laptop (sorta old 2005). [Laptop stats: Intel® Celeron® CPU 410 @ 1.46 GHz 1.47GHz, 448 MB of RAM]  I press Install and this message appears:   This kernel requires an x86-64 CPU, but only detected an i686 CPU.  Unable to boot - please use a kernel appropriate for your CPU.   What can I do to install Lubuntu on my computer?


I've got Blender version 2.68a and I'd like to update it, but I'm afraid that all of my setup will be deleted and I will have to set it again... Is there some way to keep all this stuff when I will be updating?  Tnaks for help.

I know Blender is free software and bugs happen. But my question is, is it good practice to update Blender every time there is an update? Even if a minor one? (i.e I'd consider 2.56 to 2.56b minor or even 2.63, no?)  I haven't been updating very often for fear that updating frequently causes issues like broken settings, non-compatibility or lost user configs?  Or is updating often recommended to keep up to date and adapted to the new changes, i.e like upgrades in the GUI and functionality?


I can't found Res command on Detexify. So, how to write Res on LaTeX? If I use \text{Res} it becomes italic when I'm using \begin{theorem} environment. And I want it to be as usual normal text (straight form). I've tried to search on this site and can't found about this and am now asking for help.

Mathematical operators, such as function names, should be set in roman type, not italics. Latex already has commands for some operators, including \max, \min, and \log.  How can I define additional such commands?


I have to travel to Germany soon and there are no dates available at the German consulate for a visa appointment for a month. I was thinking of getting a Schengen visa via the French embassy since that's the only one with dates available. I would be spending 12 or more days in Germany and a couple of days in Switzerland and Spain. Sadly, none of those embassys have dates either.  Is that something I can do or would it land me in trouble?

In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa?  Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa?  What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)?


My impression is that is an already answered question. However, I am really stuck with this:  This code:  \documentclass[french]{book}  \usepackage[utf8]{inputenc} \usepackage{babel}  \usepackage{lipsum} \usepackage[backend=biber, uniquename=false, uniquelist=false, style=apa, doi=false, isbn=false, url=false, maxcitenames=3, uniquelist=false, natbib]{biblatex}      %%Bibliography format \addbibresource{allbiblio.bib} \DeclareLanguageMapping{frenchb}{american-apa}  \AtEveryBibitem{\clearfield{labelmonth}} \AtEveryBibitem{\clearfield{note}}  \DefineBibliographyStrings{frenchb}{bibliography = {Bibliographie}, references = {Références},}   \begin{document}  \lipsum  An example of citation \citet{Aslin1998}  \printbibliography  \end{document}   gives the following error:  ! LaTeX Error: Missing \begin{document}.  See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  ...                                                l.515   \StartBabelCommands*{\BabelLanguages}{d                                                ate}   I tried some other thing in place of "french" :   "francais" and "frenchb" give the same output Other language as "english", "canadian"... are ok when I delete the .aux files   And when I try to just remove the babel package :  \documentclass{book}  \usepackage[utf8]{inputenc}   \usepackage{lipsum} \usepackage[backend=biber, uniquename=false, uniquelist=false, style=apa, doi=false, isbn=false, url=false, maxcitenames=3, uniquelist=false, natbib]{biblatex}      %%Bibliography format \addbibresource{allbiblio.bib} \DeclareLanguageMapping{frenchb}{american-apa}  \AtEveryBibitem{\clearfield{labelmonth}} \AtEveryBibitem{\clearfield{note}}  \DefineBibliographyStrings{frenchb}{bibliography = {Bibliographie}, references = {Références},}   \begin{document}  \lipsum  An example of citation \citet{Aslin1998}  \printbibliography  \end{document}   I can't get rid of this error:  ! Undefined control sequence. <argument> \mkbibdateapalongextra                                    {labelyear}{labelmonth}{labelday}\iffieldu...   Question:  Is there a way to create document in french (and keep the american APA formatting for the bibliography) ?

biblatex-apa gives me this:  ! Undefined control sequence. <argument> \mkbibdateapalongextra                                {labelyear}{labelmonth}{labelday}\iffieldu...   I'm using the default (english) language, and have done the:  \DeclareLanguageMapping{norsk}{norsk-apa} \DeclareLanguageMapping{english}{american-apa}   thing.   Here's a short example:  \documentclass[english]{memoir} \usepackage{babel} \usepackage{roffe} \usepackage[backend=biber,date=short,maxcitenames=2,style=apa]{biblatex}  \DeclareLanguageMapping{norsk}{norsk-apa} \DeclareLanguageMapping{english}{american-apa} \addbibresource{Papers2.bib} \addbibresource{R.bib}  \begin{document} \cite{R-base}  \printbibliography \end{document}   This one replicates the problem.


Err http://ppa.launchpad.net utopic/main amd64 Packages                           404  Not Found Get:63 http://in.archive.ubuntu.com utopic/universe Sources [6,736 kB]          Err http://ppa.launchpad.net utopic/main i386 Packages                            404  Not Found  W: Failed to fetch http://ppa.launchpad.net/cdemu/ppa/ubuntu/dists/utopic/main/binary-amd64/Packages  404  Not Found  W: Failed to fetch http://ppa.launchpad.net/cdemu/ppa/ubuntu/dists/utopic/main/binary-i386/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.   What to do in this case ??

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


Hello I have a bash script that is one liner for executing a piece of long running C++ code. Running ps -xaf the script is running and C++ code is its child  script.sh \_ long_main.cpp   When i run the code from the command line and press ctrl+C the bash script and the c++ code are interrupted and stop the execution. I love that.  However when i run a script and execute kill -SIGINT PID on my script the script dies, and C++ code runs on. When i run ps -xaf i see that sh script is dead indeed, but C++ code is running on its own, and it is now a top level process like so:  long_main.cpp   Could you please elaborate on what is the difference between CRTL+C and kill -SIGINT  in this case.

Is there a way to kill a process tree using the terminal?  By killing a process tree, I mean killing all descendants of a process along with the process it self.  I tagged this question htop because I am using that utility a lot these days and it would be cool if there was an easy way to kill a process tree inside htop (something better than just selecting all the processes in the subtree).


this command is not run on my pc:- sudo add-apt-repository ppa:morphis/anbox-support duggal@duggal-X556UQK:~$ sudo add-apt-repository ppa:morphis/anbox-support [sudo] password for duggal:     More info: https://launchpad.net/~morphis/+archive/ubuntu/anbox-support Press [ENTER] to continue or Ctrl-c to cancel adding it.  Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease                    Ign:2 http://ppa.launchpad.net/morphis/anbox-support/ubuntu focal InRelease     Hit:3 http://in.archive.ubuntu.com/ubuntu focal InRelease                       Hit:4 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease               Hit:5 http://packages.microsoft.com/repos/vscode stable InRelease               Hit:6 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease             Err:7 http://ppa.launchpad.net/morphis/anbox-support/ubuntu focal Release         404  Not Found [IP: 2001:67c:1560:8008::15 80] Hit:8 http://security.ubuntu.com/ubuntu focal-security InRelease                Hit:9 https://debrepo.freedownloadmanager.org bionic InRelease                  Reading package lists... Done E: The repository 'http://ppa.launchpad.net/morphis/anbox-support/ubuntu focal Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.  it gives me the error

When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do?


I have a table with 260 rows of information (Im taking from an XML column in NAMES table) , I want to take the first names of each row of that table and insert to a new table USR_BBUSXMLTNS. My insert statement: begin try     -- handle inserting the data     insert into dbo.USR_BBUSXMLTNS         (ID, ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED,FIRSTNAME)     values         (@ID, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE,         (SELECT  CAST(REPLACE(REPLACE(CONVERT(nvarchar(max), Data),          '<?xml version="1.0" encoding="utf-8"?>', ''),          ' xmlns="urn:books.RET.XDATA"', '') AS xml).value('(//Donor/FirstName/text()) [1]',          'nvarchar(max)') FROM Names) )      end try  I want the insert statement to loop through the Names table and get the name value for each row and add it to the insert , ideally I will have the 260 names in the USR_BBUSXMLTNS table when it completes. Ive searched the site and tried different solutions but not certain that they are designed for what I need. when I run this I get : Subquery returned more than 1 value. This is not permitted when the subquery follows =, as there is multiple results - Can I do a loop? Any advice would be great. David.

I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the SQL engine of the day (, , , , and ).  Is there a silver-bullet syntax coming from an SQL standard (for example, ) that would allow me to insert the values without worrying about the underlying database?


I'm trying to figure out how can I get variables from the outside in a function, inside a function in jQuery but i get Uncaught ReferenceError: myvar is not defined. Is there any way of doing this?  A simple example of my code:  $(function(){     var myvar = "stackoverflow"; });  $(function(){     alert(myvar); });   But when I define the variable outside the function it works:  var myvar = "stackoverflow";  $(function(){     alert(myvar); });   Why?  Any help is appreciated! Thank you!

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I'm getting the following error running the command to create a new version of my package. In this version I just added the translations for Brazilian Portuguese.     ERROR running force:package:version:create:  pt_BR: Not available for deploy for this organization   The scratch org definition file is quite simple:  {   "orgName": "Callout Company Co.",   "edition": "Enterprise",   "features": [],   "language": "en_US",   "settings": {     "languageSettings": {       "enableEndUserLanguages": true,       "enableTranslationWorkbench": true     }   } }   No idea of what could be causing this issue. Translations and Custom Object Translations are two fully supported metadata types (as seen in the ).

In a scratch org where the translation workbench is enabled, I added English as a supported language (the language for the organization is Japanese) and ran the command sfdx force:source:pull, which adds force-app/main/default/translations/en_US.translation-meta.xml to my project. However, when running package:version:create I get the following error:  en_US: Not available for deploy for this organization  Has anyone else encountered this error or know how to fix it?


There are claims that the  could be simulated in physics.  See  and in particular Paul's answer there.  Also a solution of the Einstein-Podolsky-Rosen paradox using extended probabilities as invented by Dirac, Bartlett, and Wigner has been considered.  W. Mückenheim: "A resolution of the Einstein-Podolsky-Rosen paradox", Lett. Nuovo Cim. 35 (1982) 300-304.   But are they really physical? An opinion refusing this is:     'If nontrivial set theory, non-constructive mathematics or a non-measurable set is used in an essential way, it cannot be physically relevant'.   Jakob Kellner: "Pitowsky's Kolmogorovian models and super-determinism", .  My question: Are there genuine physical examples supporting or contradicting this opinion?

Since the  makes a statement about domains defined in terms of real numbers, it would appear to invalidate statements about nature that we derived by applying real analysis. My reasoning is this:  If you can "duplicate" an abstract 3-dimensional ball defined, in the usual way, using the domain of real numbers, then clearly the domain of real numbers must be unsuited to describing physical objects (for instance The Earth), because duplicating them would double their mass (and thereby energy). But we use real numbers to reason about nature and derive new laws (or basic results) all the time in physics.  In the same way as we could integrate over the earth's volume to determine its mass from its density (for instance), we could apply the Banach-Tarski theorem to show that we could generate as many earths as we liked, right?  Does this mean that the mathematical foundation of physics is flawed? (I hope this question is not too provocative!)


I have used the following negtaive binomial model: p3<-glm(formula = Infected ~ log(1 + PopDensity) + log(1 + GDPPPP)+ LifeExpectancy,family=negative.binomial(1),maxit=10000,data=df)  How can I justify the following questions?  What is the rationale behind the explanatory variables,  log(1+Popdensity), log(1+GDPPPP)? Why do we need such unusual transformation for those variables?  What is the problem if we use Popdensity and GDPPPP as covariates?   My intention was to use log transformation because I had some countries like India with high population density. Some countries had very low population density. I don't know how to justify this log transformation. I appreciate your suggestions! Thanks!

Am I looking for a better behaved distribution for the independent variable in question, or to reduce the effect of outliers, or something else?


I understand the licensing model between these two partner programs and what to use based on the needs.  I wanted to understand how developing force.com embedded differs from ISVforce. Is the difference only during the packaging stage? How do we packages force.com embedded apps? How do we sell them? etc etc.  Can we create an app on ISVForce and also have it available as force.com embedded with minimal effort?  I am finding it difficult to find resources related to force.com embedded. Any pointers are highly appreciated.

I'm having a tough time trying to determine the differences between the  program models for creating an app on the AppExchange.  A couple questions.  1. Are Embedded/OEM the same thing?  On , there's a comparison chart of different OEM versions.  To me, this looks like a comparison of the options listed in the  I posted above.  In constrast,  (which is referenced by other answers on this forum), states in step (3) that the Embedded version is synonymous with OEM.  Does anyone out there have a clarification on the difference?  2. Do Embedded users pay for a Salesforce license + an additional fee?  Based on the answer I , it seems that a customer would have to pay for full-price Salesforce licenses in addition to any extra fees that my company would charge.  Then Salesforce would take a 25% cut of that extra fee.  Am I right?


i have problem with the tense of this sentence:      i would like to work as doctor when i finish my     degree. maybe i should use it like this:     i would like to work as doctor when i am finishing my degree.  i want to know the exactly tense of the verb after when. i know that when we want to explain a plan in the future we should use present continuous but for above situation i am confused.

Non-native speakers often get confused about what the various tenses  and aspects mean in English. With input from some of the folk here I've put together a diagram that I hope will provide some clarity on the matter.  I offer it as the first answer to this question. Consider it a living document. Input is welcome, and good suggestions will be  incorporated into the diagram.    Nota bene: What this is not is a discussion of whether there are  more than two tenses in English. , to which this question is not intended to supply arguments one way or the other.  Here, the aim is to provide an overview of what constructions English-speaking people use for conveying information about actions referring to past, present, and future, and to provide it first and foremost to precisely the people who are likely to use "tense" as a catch-all term in their search, rather than to linguists who know better.  Breaking News There is now an excellent ELU blog article titled  . It is highly recommended reading.


My problem is the following $G$ is a group and $N,M$ are normal subgroups of $G$.  $N\cap M = \{e\}$.  Prove that $nm = mn$ for every $n\in N,m\in M$.   What i did - I know that $gng^{-1}\in$ N  for all g $\in G$  So also $mnm^{-1}\in N $  Now if $nm =mn$ then i can make the above be $n \in N$.  but if not .. then I can't find a contradiction.  Any help will be appreciated.

Let $H,K⊲G$ be two normal subgroups such that $H∩K = \{1_G\}$. Prove all elements in $H$ commute with all elements in $K$.  I have no idea how to do this.


If i use my unity plus to remove the default splash screen from someone else project (that person are using free version of unity) , then export the project also using my unity plus , what are the legal concern ?

Heavily related to , as of now,  has changed dramatically. And searching in the TOS, it looks like I'm allowed to remove the Unity logo in my exported game. Looking at Section 4.1, it still retains:     You will not remove, alter or obscure any copyright, trademark,   service mark or other proprietary rights notices incorporated in or   accompanying the Services.   However looking at how "Services" is defined in the first paragraph of the TOS:     Unity Technologies ApS (“Unity”, “our” or “we”) provides   game-development and related software (the “Software”),   development-related services (like Unity Analytics (“Developer   Services”)), and various Unity communities (like Unity Answers and and   the Made with Unity Platform (“Communities”)), provided through or in   connection with our website, accessible at unity3d.com or unity.com   (collectively, the “Site”). Except to the extent you and Unity have   executed a separate agreement, these terms and conditions exclusively   govern your access to and use of the Software, Developer Services,   Communities and Site (collectively, the “Services”)   It does not seem to include the exported game itself. And even if Section 4.1 says "accompanying the services", I assume it still wouldn't include the game as the game does not need to accompany them. Otherwise it would be illegal to remove the logo from the splash screen from a game made in Unity Pro since the TOS applies to all tiers of Unity. Furthermore, I haven't found anywhere that says you can't modify or hack into the produced executables (I even looked  which contains another part of the TOS). Does this mean I can remove the logo from the splash screen no matter what Unity tier (personal, plus or pro) I'm using?  (My aim is to actually move it to a dedicated credits section accessible from the title screen of the game rather than having it appear in the splash screen. Players of the game will still know that it's made in Unity.)


I have an educational background of biological sciences. I do not have formal education in mathematics or stats. I have been involved in medical research that has statistical methods like regression, survival analysis, Markov chains or discrete event simulations etc. I have been trying to understand these concepts, not systematically though, however I have developed a keen interest in stats. I want to develop a serious understanding of stats and want to achieve expertise. I understand that this will take years and lot of study and practical experience. I have started with books like Probability by Pitman or Statistics by David Freedman. Could you please suggest me few books, online resources, or other methods for systematically developing an understanding good enough to make a career in data analytics.

What book would you recommend for scientists who are not statisticians?  Clear delivery is most appreciated. As well as the explanation of the appropriate techniques and methods for typical tasks: time series analysis, presentation and aggregation of large data sets.


Imagine you have a straw in a glass of water. If you put a turbine inside it somehow and move the glass, pour water in and out of it etc, you would see the water level rise and fall, and the turbine would spin, generating power.  I'm sure you can see where I'm going with this:   Our atmosphere far from a static glass of water, there are colder and hotter parts that create air flows, that can be very fast, and could output a lot of energy. So is it possible/feasible to generate energy this way; by placing turbines in a long straw from Earth to space? I know it may not be practical, but is it physically possible?  Similar methods are already being used to harness energy from ocean waves, so i wondered if this would be possible as well.

If I built a tube from Earth's surface to the exosphere, would all the air be sucked out to space?  If this pipe reached to a big planet, like Jupiter, would its gravity through the pipe suck our atmosphere?  If one end of the pipe was at the Earth's core, and other in the exosphere, would the magma go there, like in giant volcano?


Is it possible to get password from hash produced by following function by any method?  $salt is random 128 characters alpha numeric string.  function Get_Hash($pwd, $salt)         {             if ( CRYPT_BLOWFISH == 1)              {                 $pwd = hash("sha512",$pwd);                 $cost = "07";                 $hash = crypt($pwd, '$2a$' . $cost . '$' . $salt);                 return $hash;             }              else               {                 $pwd = hash("sha512",$pwd);                 $hash = crypt($pwd, '$1$' . $salt . '$');                 return $hash;             }         }   There is already basic level brute force protection, system locked for 3-5 minutes after 3 failed attempts.  Is this good hashing function for small level application?   Thanks for your help.

It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.  This question,   suggests that hashing multiple times may be a good idea, whereas  suggests using salt.  I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters.   The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?)   Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer?  In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism.  Related questions that don't quite cover my question:


I need to calculate my text with using JavaScript. But can't find a simple and working method. Please, help me :) Thanks in advance.

I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface?  If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting  and different type sizes (and all browsers for that matter).


I'm attempting to use the Split Vector Layer tool in QGIS (see screenshot below) in order to separate a larger shapefile into its constituent components by object ID. The tool accomplishes this perfectly, but by default exports everything as a geopackage file.     I instead require these files as shapefiles, not geopackage files. Is there any way to specify within QGIS that I want to export these files as such?

QGIS 3.6.0  I am new to QGIS software and not very technical on its deep workings. I am trying to split a .shp file using split vector layer. I need .shp file outputs but it auto creates .gpkg files.  I cant seem to find any settings that will change the default from .gpkg to .shp


I downloaded a Blend from Blend Swap and the materials are behaving much differently than I am used to - I think it has something to do with Cycles maybe? Here is what I see:    On the left is my "normal" materials tab, and the right is from Blend Swap. What is going on here? Why are they different? Also, with the screen on the right I cannot assign a different material to different parts of the mesh:    Any ideas what I'm into here?

Complete beginner here.  I'm trying to follow  tutorial on Anisotropic shaders, but my property panel looks nothing like the property panel in the tutorial.  For example, when creating a material, this is what his property panel looks like:    But this is what mine looks like, if I follow the same path:    I'm sure I'm missing something obvious.  How can I see the property panel shown in the tutorial?


Summary:  Safari is running according to the Dock (icon has dot below it, and right-click shows "Force Quit"); however Activity Monitor doesn't show it and ps -ef | grep -i saf returns nothing.  Relaunching the Dock does nothing.  Safari won't open a window, nor will it quit.  Is there anything I can do to repair this short of restarting?    Full details:  I ran into a problem with Safari.  It froze.  So I tried Force Quit.  It seemed to work (blue dot below Dock icon disappeared).  I clicked the icon to restart Safari.  It bounced.  A couple minutes later, I noticed it still bouncing.  I right clicked and Force Quit again.  I clicked Safari and nothing happened.  The blue dot did not appear below the icon.  I right clicked and saw a "Force Quit" option — even though Safari was not running, and there was no blue dot.  I relaunched the Dock.  (Using TinkerTool's button for that purpose.)  The blue dot reappeared under the Safari icon, but clicking the icon didn't accomplish anything.  Right clicking still showed a "Force Quit" option.  I checked the process table and found four processes running with "Safari" in the command name:  $ ps -ef | grep Safari   501  1275     1   0 25Dec17 ??         4:53.91 /System/Library/PrivateFrameworks/SafariSafeBrowsing.framework/com.apple.Safari.SafeBrowsing.Service   501 68080     1   0  3Jan18 ??         0:00.98 /System/Library/PrivateFrameworks/SafariServices.framework/Versions/A/XPCServices/com.apple.SafariServices.xpc/Contents/MacOS/com.apple.SafariServices   501 75536     1   0  4Jan18 ??         0:04.11 /System/Library/PrivateFrameworks/SafariShared.framework/Versions/A/XPCServices/com.apple.Safari.History.xpc/Contents/MacOS/com.apple.Safari.History   501 84790     1   0  8Feb18 ??         0:00.24 /System/Library/PrivateFrameworks/SafariServices.framework/Versions/A/XPCServices/com.apple.SafariServices.xpc/Contents/MacOS/com.apple.SafariServices   501 56333   360   0  7:51PM ttys000    0:00.01 grep Safari   After some more icon clicking, Force Quit-ing and Dock relaunching, I opened Activity Monitor.  I found Safari didn't show in Activity Monitor when view was set to "windowed processes."  I set the view to "all processes" and searched for "saf" and found the same four processes above.  I force quit them with Activity Monitor.  The blue dot remained under the Safari icon on the Dock.  The "Force Quit" option still appears on right-clicking the icon.  Relaunching the Dock doesn't change this.  Clicking on the Safari dock icon doesn't cause it to bounce, nor does anything matching "safari" (case insensitive) appear in the process table.    How do I make the Dock aware that the Safari application is not running?  How can I kill Safari when it's already dead (and not even a zombie process)?  How can I get Safari to start up again?  I'm running Mac OS 10.11.6 and Safari 10.0.    Update: Opening '/Applications/Safari.app/Contents/MacOS/Safari' directly works, but it makes a NEW Dock icon that behaves normally.  The old one is still there.  So, looks like the problem is with a stale Dock icon.  How can I fix that?

I've been encountering an extremely annoying problem since I upgraded to Yosemite. FCPX (but I've been having reports of this problem on other computers with finder.app and safari.app) sometimes will crash on exit (with no detectable log trace) and its icon will remain in the dock with the usual "this application is not responding" menu warning. Force quit won't work Rebooting can only be done the hard way because the stuck app is preventing a soft one yet no single process regarding FCPX is listed when in the activity monitor nor there is one in psaux. No zombie processes to be found; computer performance is fine. If I open an FCPX library, I'll get a dialog stating that "The application "Final Cut Pro" is not open anymore", which is quite irritating q: I'm on a MBP Retina early 2013 15' Does anybody have the slightest clue what's going on here?


Just came across  and noticed there's unknown post author:    Why is it so? Is it a bug, or another fun fact?

Looking at         it says "36% unknown". No user by the name of 'unknown' appears in the  ()  What madness is this? Who is this 'unknown' you speak of?


If I have a111Ta222T  I wish to extract in PHP a111T  The point is to stop match at the first occurence of T, instead of at the last T.  How can I do this using regex?    I don't wish to use  a[\S]+(?=a)  which can have the same result a111T

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Why does Logistic Regression output show Z-test whereas Linear regression shows the t-test in the ouput? Why logistic regression prefers Z-test when the same can be achieved with the help of t-test? Also suggest me if there is something I can read about this.

When testing the difference between 2 proportions why do we use a z-test rather than a t-test?    Further, is there a simple way to conduct an omnibus test for significant differences between more than 2 proportions (in the form of percentages). Is there an equivalent to a one-way ANOVA for this?  I imagine that you could use logistic regression (assuming you have the original data for the proportions in the form of 0s and 1s) Are there other options?


I have an  that is several years old and just recently was marked as on-hold. The on-hold status requests I re-word my question, but since there are already so many answers that some may find value in -- and thus should not be deleted -- I am leaning towards leaving the question as is (i.e., on-hold or changing to closed, but just not deleted).  Alternatively, I could change the question to something like, "What are some cultural norms for piercing child's ears?" or "What are some pros and cons to piercing a child's ears at a young age?", but then is it odd that there are opinion-based answers with many votes?

was closed as "Not constructive" a little while ago by CasperOne. I'm not here to argue about the closure; in fact, I'm forced to agree that, as it stands, the question is explicitly a polling question and eligible to be closed for that reason.  I'd like to see it preserved, however; it's got a fair bit of useful in-depth information for ObjC/Cocoa developers on the "singleton" topic.* It's also (possibly more importantly) a great duplicate target -- have a look at the list of linked questions. I want to try to stave off deletion, and hopefully get it reopened.** (I did vote for reopening, but it expired.)  My thought is to edit the question itself into a "constructive" form, but after spending some time pondering how to do so, I'm not crazy about any of the ideas that I've come up with. Essentially they all involve reworking the question to fit the answers:   Rewrite the question so that the accepted answer fits exactly. "I've got this singleton implementation, but I really want the creation to happen earlier in my app's execution. How can I make that happen?" This is artificial and (in my opinion) doesn't make a particularly good question. Make the question still general, but more concrete and focused on the implementation give in the body. "What are the pitfalls associated with this singleton creation procedure? Are there other features that my singleton should have?" This is still skirting the border of discussion->NC, and none of the answers really respond to this exactly. Remove the implementation from the question and just ask for the "best" implementation. This obviously requires coming up with stringent criteria for "best", and, while it would preserve the relationship between the Q and A's best, might not even move it out of NC territory.   I'm looking for suggestions of ways to re-write this so that it can stick around. Alternatively, if you think I should just be advocating for a historical lock, say so.   If you think my basic premise is faulty and don't think the question should be preserved at all, I respectfully request that you just downvote me instead of answering -- I'd prefer not to turn this into an argument about the merits of the question, and I definitely don't want it to become a(nother) "deletionist"/"inclusionist" skirmish (and I am not infrequently ).    *Quite a bit of it unfortunately in comments.  **Historical locking would also be an acceptable solution to me, but it doesn't seem to fit the "controversial" criterion.


What word would you use to describe a person using gobbledygooks even during casual conversations?

What is a word for a person who reiterates without adding any new content? (This person is not necessarily talkative per se.) Example of a conversation by such a person would be:     "You know if we do this xyz, it will be good. No one has done xyz so it is going to be great if we finish xyz, I don't think anyone has done this.  By summer if this is done then we can send xyz, of course we have to do it before and it's gonna be great and we have to keep doing xyz unless someone will do it, but no one has done it yet, it is going to be great if we do xyz."   It is not overzeal; it is just my example which came out to be like this.


class useTent {     Scanner keyboard=new Scanner (System.in);      public void main (String[] args)     {          Tent t= new Tent();         HireContract hc = new HireContract();         ProcessHire(t, hc);     } }   this is my code, and i keep getting the same error:     " Main method is not static in class useTent, please define the main method as:      public static void main(String[] args) "   and when i make the it static i get the following error:     "C:\Users\Emma\Documents\opps ass1\useTent.java:22: error: non-static method    ProcessHire(Tent,HireContract) cannot be referenced from a static context ProcessHire(t, hc);"   and also still the     "Error: Main method is not static in class useTent, please define the main method as:      public static void main(String[] args)"

The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message:     You can either make the non static method static or make an instance of that class to use its properties.   Why? I am not asking for solutions. I would be grateful to know what is the reason behind it. The very core reason!  private java.util.List<String> someMethod(){     /* Some Code */     return someList;             }  public static void main(String[] strArgs){                // The following statement causes the error. You know why..     java.util.List<String> someList = someMethod();          }


Is there a way to create a brand new object with canonic operations ? I am a bit confused by the example below :  x = 1 y = int.__new__(int, 1) print x is y  >> True   EDIT :   enlights the example above, but doesn't answer the question about the existence of a canonic way to create two different int objects. In the end, it just helps to understand that writing x = 256; y = 256 is not a solution, which is not what I was looking for.

Why does the following behave unexpectedly in Python?  >>> a = 256 >>> b = 256 >>> a is b True           # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False          # What happened here? Why is this False? >>> 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?


I'm currently making a donut using blender gurus tutorial. I have no idea why, but there are holes in my icing. Does anyone know what could be causing it? Thanks for any help.

I tried to follow the new Blender 2.8 tutorial from Blender Guru.   When entering "Sculpting" with the icing there were suddenly alot of holes in it. Why is this?


(New to Ubuntu) I want to run a Minecraft server under a machine with this motherboard- Supermicro X8DTE-F which has a 32Mb SPI Flash EEPROM w/ AMI Bios. This system hovers in the ‘08 to ‘11 era based on research I found. Is it possible to use the newest versions of Ubuntu on a system this old? Preferably without any major tinkering? Thanks in advanced!

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


I saw many of article , clearly saying that pointer is applicable for jvm not for programming level and also if define null to object level(reference),and performing any operation on that object it will give NullPointerException. if any suggestion  please  public class ItCaseContrext_Group {      @Test(expectedExceptions=NullPointerException.class)     @DataProvider(name="td")      public Object[][] datamethod(ITestContext context) throws Exception      {         Object[][] data=null;          for(String g:context.getIncludedGroups())         {             System.out.println(" i am in for loop");             if(g.equalsIgnoreCase("A"))              {             data= new Object[][]                          {                     {"10","20"},                     {"30","40"}                         };                  System.out.println(" A");                         break;             }             else if(g.equalsIgnoreCase("B"))             {                 System.out.println(" B");                 data = new Object[][]                          {                     {"abdul","kalam"},                     {"Steve","jobs"}                         };                         break;             }         }         return(data);     }     @Test(dataProvider="td",groups= {"A"})     public void m1(String a, String b)     {         System.out.println(a+" "+ b);      }         @Test(dataProvider="td",groups= {"B"})     public void m2(String a, String b)     {      System.out.println(a+" "+ b);     }   }

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 have prepared a tool using ModelBuilder. The tool mask the raster data using the selected feature layer. It works perfectly fine in ArcGIS Desktop but when I publish it to the server and uses it for the same analysis I get an error saying that the raster file is invalid. I tried even with another dataset but it also resulted in same error

I have prepared a tool for Masking the specific portion of the raster dataset using the feature dataset. It works fine in ArcMap but shows the following error while running it on the server.  I have used shapefile for the feature dataset and Tiff file for the raster dataset.


If $A.M$ and $G.M$ are Arithmetic Mean And Geometric Mean respectively then prove that $A.M \ge G.M$.  My Attempt :  Let $a$ and $b$ are any two real positive numbers.  Then: $$A.M=\frac{a+b}{2}$$  $$G.M =\sqrt{ab} $$  Now how can we show that $A.M.\ge G.M.$ ? Please help me..

The arithmetic - geometric mean inequality states that $$\frac{x_1+ \ldots + x_n}{n} \geq \sqrt[n]{x_1 \cdots x_n}$$ I'm looking for some original proofs of this inequality. I can find the usual proofs on the internet but I was wondering if someone knew a proof that is unexpected in some way. e.g. can you link the theorem to some famous theorem, can you find a non-trivial geometric proof (I can find some of those), proofs that use theory that doesn't link to this inequality at first sight (e.g. differential equations …)?  Induction, backward induction, use of Jensen inequality, swapping terms, use of Lagrange multiplier, proof using thermodynamics (yeah, I know, it's rather some physical argument that this theorem might be true, not really a proof), convexity, … are some of the proofs I know.


In Europe, travelers can buy a special rail pass that gives them unlimited train rides for a month. And some airlines offer tickets where a list of destinations is chosen in advance, but the flight dates are flexible and can be chosen on short notice.   Is there anything similar for traveling around the US by bus or train? Greyhound used to offer something like it, called the "Discovery Pass," but it seems to have been discontinued. And Amtrak only seems to offer unlimited passes on specific short routes, mainly targeting commuters.

Can you help me decide, what type of transport can I use to travel from one US town to another (it will be a big journey), without flying?  Are buses available, and is there any more suitable method of traveling?


In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below.  0 0 * * * /home/backup.sh > /home/groupz/db-backup/fbackup.log 2>&1     Now, when the cron executes a script the contents of the log get renewed everytime. So, I want the contents to be added to the same file with time stamp of the executed time and below the contents of each time along with the existing contents. How can I do this.

How do I clear the contents of a file before writing to it? For example:  echo one > filename.tmp # filename.tmp now contains "one"  echo two > filename.tmp # filename.tmp should now contain "two", not "one" and "two"   My goal is:   Start a listener  $ nc -l 7007 > /var/tmp/test.log  Send some data  $ telnet localhost 7007 hi second_word  Test the file  $ cat /var/tmp/test.log second_word    I don't want "hi" to show up in the log; I want "second_word" to have replaced it


I know that by $3^{40} \bmod 100 = 1$, I can get $3^{312} \bmod 100 = 3^{32} \bmod 100$, but I don't know how to find $3^{32} \bmod 100$.

What are the last 2 digits of $2017^{2017}$?  Notice that  $$2017 (2017) = 2017 ( 2000 + 10 + 7) = (....000) + (....70) + (2017 \times 7)$$ so the last two digits of $2017^{2}$ are the last two digits of $70$ + last two digits of $17 \times 7$. These are $89$.   Similarly then   $$ (2017^2) (2017) = (....89)(2000 + 10 + 7) = (....000) + (....90) + (....89)\times7 $$  So the last two digits of $2017^{3}$ are the last two digits of $90$ + last two digits of $89 \times 7$. These are $13$.  for $2017^{4}$, the last two digits are the last two of $30$ + last two of $13 \times 7$.    But somehow, I have not find the period for the last two digits of $2017^{n}$. I have tried until $n=36$, still no period.  The answer should be one of $77,81,93,37,57$.     I just found a pattern:  $$ n=1,n=2,n=3,n=4 \rightarrow 17, 89, 13,21 $$ this pattern repeats as: the 1st one with difference 40, 2nd with diff 80, 3rd with diff 60, and 4th with diff 20.  $$ n=5,n=6,n=7,n=8 \rightarrow 57, 69, 73,41 $$ and so on. The overall period begin again from $n=17$.   So the last digit is 77. The math explanation?


I've been reading up on why the value of 0^0 is controversial (see ) and I wondered: is it possible for $i^i$ to have a value? I plugged it into a TI-83 calculator and it returned 0.2078795764 (!) How is this possible and why is the result a real number not a complex number?  Update I realize how to use Euler's Identity of $e^{i\theta} = \cos(\theta) + i\sin(\theta)$ and I understand the oldest answer's value of $\theta = \pi/2$ to solve for $i^i$, but doesn't this mean I can pick any odd multiple of $\pi/2$ (such as $3\pi/2, 5\pi/2$, etc.) as a value of $\theta$? Does that mean that $i^i$ is somehow "periodic" like the cosine curve is?


I am in United Kingdom on a visit c-type.. What if I wish to visit Paris from UK.. How to get a Schengen visa on Pakistani passport?

For a Russian citizen:  If I have a general purpose (6 months) visa for the UK, and am currently in the UK, does that make it easier to get a visa for France.  For example: I'm in the UK on the general purpose visa for a 3 month holiday, and I would like to visit Paris. So if I wander into the French embassy in London are they likely to give a French visa easily on the basis that I already jumped through all the hoops for the UK visa?


<?php // I fetching data from sql table "product".i want to prevent all unwanted characters and all.please add your suggestions in my code.      if(isset($_GET['search'])){     $search_query = $_GET['user_query'];     $get_pro = "select * from product where title like '%$search_query%'";     $run_pro = mysqli_query($con, $get_pro);      while($row_pro=mysqli_fetch_array($run_pro)){    $pro_title = $row_pro['title'];     echo " <span>$pro_title</span> "    } }    ?>

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


I bought a Dell Inspiron N4110, the sound plays fine from the speaker, but when I plug my earphone (which has the 4-segment TRRS jack, i.e. stereo+mic) then human speech gets distorted although background music tends to play fine this causes speech to get drowned in the music (in movies this means I can't hear what they were talking despite my ear getting hurt by the loud background music).  I tried multiple different video, they're all exhibiting the same symptom, the earphone somehow can distinguish human voice and background music and filter out only those human voices in all the videos I tried.  I tried using a different earphone (a 3-segment TRS jack, i.e. stereo), and this plays fine.  It wasn't the TRRS earphone either, as I regularly use it with my mobile phone fine.  So my guess is that the distortion is because I'm plugging TRRS jack into a TRS socket and they doesn't work well together.   The question is:   is there any workaround to use a TRRS earphone on a TRS socket without distortion (I don't need to use the mic)? (bonus) why is it distorting only on human voices?

I have a set of headphones that have a built-in mic for hands-free calling. They work great on my Sony Ericsson Cedar cellphone.  The problem is that when I connect headphone to my Dell N5010 laptop to listen to music, the quality is horrible, with very weak or no vocals.  When I hold down the talk button on the mic, however, it changes: the quality goes up. When I let go, it goes back to sounding bad. When I adjust the jack by pulling it out and moving it around, the quality goes back up, but I have to hold the jack in place.  I've looked for a way to configure the sound card but found nothing.   Is there a solution besides gluing down the talk button on the mic?


So -  Black holes possess a gravitational force so great it can pull anything in. Including light. So placing these side by side, If I were to shoot a laser pointer out of a cannon at a black hole, and also be standing stationary pointing a laser at a black hole, conventional logic would tell me that the light from the cannon-shot laser would be traveling faster than light once captured in the gravitational field of the black hole, as opposed to the light from my stationary laser in the same gravitational field. Am I right? or am I confusing some part of the theory relativity in here?  Thanks!

How do I solve the speed of light in gravitational field?  Should I just add gravitational acceleration in speed of light?  $$c'=c_0+g(r)t~?$$


I was a PhD student and was supervised by one bad supervisor. Our relationship broke up at the time when I tried to graduate. After a "fighting", I successfully graduated. But I left 10 unpublished paper to him. I had no time to publish these paper before I graduate. I put my supervisor's name there because he was my supervisor. I didn't really contribute to the paper.   I'm sure the 10 paper can be published as high quality journal paper because I'm currently working as a staff in another University. I've published a lot paper expect for those 10 so I know what paper can be published. But as the coauthor, my ex-supervisor "refused" to publish these paper. He always told me he needed to have a look, and nothing else happened. Every time I contact him, he would propose some unreasonable questions or tell me to wait for some time to put off the publication and no reply at all after that. It has been 2 years up to now. None of my 10 paper has been submitted yet. He obviously doesn't need the paper as a professor, but I need them desperately as a new lecture.   I've waited for 2 years for the first out of the 10 paper to be submitted. I couldn't wait for 20 years for the 10 paper to be submitted. He doesn't say he want to delete his name from this paper but I have sufficient reason to believe that he doesn't want me to publish these paper. He warned me that I couldn't submit the paper without his agreement otherwise he would withdraw the paper. My question is can I kick him out from the coauthor list and publish the paper by myself? Or is there any other suggestion say contacting the University about this situation to solve the problem?   I'm quite annoying as if I couldn't get rid of him even after I graduate and got my own position. Can anyone help please. Thank you in advance!

Alice and Bob have co-authored a paper together. The contribution (data collection, analysis, writing) was 100% Alice and 0% Bob, except that the original idea was initiated during a conversation between Alice and Bob. Bob acknowledged several times in private that he did not contribute to the project, but he claimed co-authorship for the idea and Alice did not object to that. Alice spent almost an entire year working on the project. Bob spent less than a couple of hours in total. A manuscript with both names has already been circulated, submitted and rejected from one journal.  Bob is now trying to block the publication of the paper due to a personal conflict with Alice. In the meantime, Bob became envious of Alice's early successes and decided to do everything to slow down her career, even at the expense of his own publication record. Bob is already tenured and has no pressure to publish. Alice, by contrast, needs more publications for her forthcoming tenure review. Of course, Bob never explicitly refused to submit the paper. But instead of sending it to a prestigious outlet (where the paper would have a good shot) he insists that they send the manuscript to a non peer-reviewed and unknown journal, which would not help Alice's tenure case. Of course he makes no effort in trying to find an agreement, as he would be happy not to submit the paper at all. Clearly, his decisions are driven by spite and malevolence only and he takes great care into not writing anything incriminating for him.  Is there anything that Alice can do in that situation? Does she have to resign herself to never publishing the paper? What are the risks for her if she removes Bob's name without his agreement and submits the manuscript on her own?  PS: as a response to Captain Emacs' comment, Bob's only contribution was to say "why don't we study the causal effect of X on Y?" in an informal conversation. Alice did absolutely all the rest (literature review, design of the protocol, data collection, analysis, conference presentations, etc.). But there is no evidence of this, other than the fact that Bob would be unable to answer any question that goes into the detail of the paper.


when I am selecting gear teeth for loop cut only one gear tooth is getting selected

Alright so I've seen some postings about loop cuts and done some research. I am very new to blender and modeling overall. I am trying to loop cut this concrete barrier. Now I'm following a tutorial and kind of did my own thing in some areas. I cleaned it up following some instructions in another answer here on stack exchange.  I can't for the life of me figure out why I can loop cut around the whole bottom:   ...but not the whole middle:   I see this marked as answered by another question. That question refers to ngons and inside faces. Now once again I'm totally new to this. I looked on the inside. I don't believe I have inside faces or any ngons by the terms I've read online in my research.  Here is a wireframe picture and the inside view:     Maybe I'm missing something the answers on other posts are saying. If so and you know what it is I'd be very appreciative of what it is.


Heat sink of a laptop consists of copper tube. It is used to cool the processor and other electronics. Does the tube contain any coolant or it is just air filled?

Case: zalman z9 neo  Cooler: deepcool gammaxx 400  According to specs it should fit, but it does not, probably because my motherboard is mini-itx and cooler located a bit to the left  I'm thinking that cutting off those tips of heatpipes on the left would solve that; if I do that, will cooler work worse, like heatpipes would transfer heat not as good or something?


For those who wish to try something other than the default ColorOS ?

There are several reasons to be looking for a ROM:   Upgrading or downgrading your stock ROM Looking for firmware from a different region/language Flashing a custom ROM for different features, removing bloat, etc.   But where can one find ROMs in the first place?  What sites are likely to have the ROM I need?  ; please add to the wiki answer instead of posting separate answers.  See also:


So the rules, to my knowledge, say that a melee attack can be non-lethal. Does this mean that a spell like Inflict Wounds or Primal Savagery can be non-lethal? As for ranged spells, I imagine a volatile spell like Fireball or Lightning Bolt that can hit multiple enemies couldn't be restrained to non-lethal, but what about a single target spell like Chromatic Orb or Eldritch Blast?

I'm working on a Paladin/Warlock combination, based off of , and as part of this, I noticed Miniman's remark that Repelling Blast won't be that useful, because as a Paladin, you want people up close and personal when you're in a combat situation, not further away.  However, as a Paladin, your creed sometimes leads you to not want to engage in full-blown combat with a potential adversary -- you may want to drive them off or incapacitate/capture them instead.  With this, I wonder: can Repelling Blast, or other spells and spell-likes (such as invocations), be made to do non-lethal damage?  If so, I'm thinking that it'd be useful in exactly that sort of situation -- halting someone/pushing them away without having to wade into a melee with them or blow them to smithereens.


When running the below code with  SymPy: print("y1: ", TransY) print("y2: ", TrigoY) print(TransY.equals(TrigoY)) print(sp.simplify(TransY - TrigoY) == 0) print(sp.simplify(TransY - TrigoY))  from looking at the output it seems TransY and TrigoY are equal. but the equality check, with simplify, shows otherwise: y1:  0.707106781186547*L1 + 0.707106781186548*L2 + 0.258819045102521*L3 y2:  0.707106781186547*L1 + 0.707106781186548*L2 + 0.258819045102521*L3 False False -1.11022302462516e-16*L3  any advice?

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I lent $5K AUD to a person close to me around 5 months back and he is repaying me by transferring me the money into my account. I'll be applying for a UK visa next month; would this look like fund parking?  I am able to provide transfer receipts showing that money went from my account 5 months ago, and I can also provide his receipt of returning the money.  I can also show 1 year's bank statements account from two of my savings accounts and, if they investigate and reconcile in detail, they will be able to see that money left my account and returned.  I am just concerned that if it's seen as fund parking, they would refuse my visa.

The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled "other documents you may want to provide" (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is "bank statements" and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning "for example"; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me?


There is a title for a chapter in a book I'm reading, that reads "SHOULD I DO IT WHILE I'M SICK?". I was wondering, how would this be capitalized using the formatting suggested by the Chicago Manual of Style? I'm mostly just confused about the 'do' and the 'it'.  Thank you very much!

Are there any concrete rules that say which words (parts of speech) in a title should start with a capital letter? What would be a correct capitalization for the title of this question?


Suppose $X = (X_1, X_2, X_3)$ is a random vector distributed uniformly on the unit sphere in $\mathbb{R}^3$. What is the probability density function of $X_1$?

If $X=(x,y,z)$ is a random point uniform on the unit sphere in $\mathbb{R}^3$,  Are the  coordinates $x$, $y$, $z$ uniform in interval $(-1,1)$?


As , on Windows 7 machines, by default, when you drag a file to another folder on the same drive, it moves the file there.  This can be overridden by holding down the control key on the keyboard before releasing the file, to force a copy.  Similarly, holding down the shift key forces move behavior.  Only for select folders, I would like to change the default to be copy instead of move.  I was thinking I might be able to share the folder and then mount it as a shared folder from myself to trick the OS into defaulting to copy as the shared folder appears to be non-local storage.  Is there a way to configure a specific folder on Windows 7 to default to copy instead of move for local files being dragged to the folder without doing this convoluted solution of sharing a folder with myself?  Can I add a registry entry that overrides this behavior for a specific directory?

Is there a way to change the default drag and drop behavior in Windows 7?   As of now it seems that if the location is on the same drive it'll move onto the other, otherwise if they are in different drives it'll copy.   Is there a way to change the setting so it'll always copy it?


This question is possibly a duplicate but so far I haven't found any up to date and detailed answer to the following question: could you list step by step the best free procedure (if any) to convert a LATEX file (containing tables, figures, equations) into a Word file in a Macbook Pro OS X 10.9.5?

I have a large .tex draft full of equations, both block and inline, and figures and text. A journal wants us to send a draft in Word format with editable equations. Maybe a long-shot but, is there some quick way to do this?


Tricky question.  I have a class named "Bivio" in which I set a Navigation Drawer and in the first of the fragments there is an ExpandableListView.  I placed the ExpListView in fragment1 and develop all the activities from Bivio.class.  Yet, I get a NPE on my ExpListView at this point      expListView = (ExpandableListView) findViewById(R.id.lvExp);      prepareListData();      listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);      expListView.setAdapter(listAdapter);   It goes without saying that I actually have an ExpListView with ID lvexp, that I declared all the due variables  ExpandableListAdapter listAdapter; ExpandableListView expListView; List<String> listDataHeader;   Bivio.class is declared in manifest.  And here is the logcat   I know by clicking on the link that the flaw lies in here expListView.setAdapter(listAdapter); but I declared all I could!  I guess navigationDrawer poses some challenges for what concerns working in the main activity on Views embedded in Fragments, correct?

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?


The word earth has several meanings; the most central one is ‘soil, dirt’, that thing we walk on when we’re outside. It’s also used as a name for the planet we live on.  The  for this sense has:     (also Earth)   The planet on which we live; the world   Note the word also: the entry is lowercase, and this sense, in which it functions as a proper noun, also appears capitalised.  But proper nouns are as a rule always capitalised. Mars, Pluto, Venus, and all the other planet names in our solar system are always capitalised.  The first two of the following examples of lowercase earth are from the King James Bible and show that this isn’t a new thing; it’s been like this for a long time:  , Authorized (King James) Version (AKJV)        Dead things are formed from under the waters,   and the inhabitants thereof.   Hell is naked before him,   and destruction hath no covering.   He stretcheth out the north over the empty place,   and hangeth the earth upon nothing.   He bindeth up the waters in his thick clouds;   and the cloud is not rent under them.   He holdeth back the face of his throne,   and spreadeth his cloud upon it.   He hath compassed the waters with bounds,   until the day and night come to an end.   The pillars of heaven tremble   and are astonished at his reproof.   He divideth the sea with his power,   and by his understanding he smiteth through the proud.   By his spirit he hath garnished the heavens;   his hand hath formed the crooked serpent.        , Authorized (King James) Version (AKJV)        The earth is the Lᴏʀᴅ’s, and the fulness thereof;   the world, and they that dwell therein.   For he hath founded it upon the seas,   and established it upon the floods.   Who shall ascend into the hill of the Lᴏʀᴅ?   or who shall stand in his holy place?        , Folio 1, 1623     The Lunaticke, the Louer, and the Poet,   Are of imagination all compact.   One sees more diuels then vaste hell can hold;   That is the mad man. The Louer, all as franticke,   Sees Helens beauty in a brow of Egipt.   The Poets eye in a fine frenzy rolling, doth glance   From heauen to earth, from earth to heauen.     , 2011     What makes earth feel like hell is our expectation that it should feel like heaven.     But why is the Earth’s name so different from the other planets’ names? Why is this proper noun so inconsistently capitalised in English?

At the beginning of a sentence is obvious.  I'm referring to the following examples:        A handful of earth.   The earth under this house.   The earth beneath my feet.   What on earth?   The heavens above and the earth below.   The earth moved.   We returned quickly to earth.      Lower: 1,2,3,4 Upper: 7 Not sure: 5,6


I am trying to understand why the following use of regular expressions does not work, i.e. the pattern is not found in the string (general expression of re.sub is re.sub(pattern, repl, string). Can you please tell me why and, if possible, explain how could I have altered the code to make it work?  import re  string = " Many of them are not just serving time in prison, but they are being let out of prison and back into our communities, having committed appalling crimes. They are not being kicked out.

[

Interruption.

]

And no doubt they are indeed receiving benefits. That is why the British people are fed up and want action to be taken. It is unlikely that my hon."  testOutput = re.sub(r'

[

Interruption.

]

',' ',string)  print(testOutput)

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


I am trying to include a LaTeX code within an lstlisting. But the problem is that the LaTeX code includes an lstlisting, so the \end{lstlisting} within the included code is terminating the actual lstlisting. Is there some way to make the compiler not take that as the actual environment end.  \lstset {     basicstyle=\small\ttfamily,     language=TeX,     frame=single,     backgroundcolor=\color{grey},     columns=fullflexible } .. \begin{document}     ..     \begin{lstlisting}         % The lstlisting can be used as follows         \begin{lstlisting}             % Your code goes here         \end{lstlisting} % This example end-statement is terminating the actual listing     \end{lstlisting}     .. \end{document}   Any help is appreciated.

I am not sure if I am using the right wording in title. Basically what I need is to add the following source using the listing package.  In preamble:  \usepackage{listings}   then and is here when I have the problem:  \begin{lstlisting}      \begin{lstlisting}      \end{lstlisting}  \end{lstlisting}   but I am getting Package Listings Error: Extra \endlstlisting.  How can I "mask" the first \end{lstlisting}? I've been through the documentation but I am lost.


C#'s equivalent to encodeURIComponent is  on SO and elsewhere, but what about encodeURI? Basically I want to encode  URL characters only and not reserved characters such as /, :, etc. So   "http://www.example.com/my cool page"   would be encoded to  "http://www.example.com/my%20cool%20page"   Is there something baked into .NET to do this? Or is a regex my best bet?

In JavaScript:  encodeURIComponent("©√") == "%C2%A9%E2%88%9A"   Is there an equivalent for C# applications? For escaping HTML characters I used:  txtOut.Text = Regex.Replace(txtIn.Text, @"[\u0080-\uFFFF]",     m => @"&#" + ((int)m.Value[0]).ToString() + ";");   But I'm not sure how to convert the match to the correct hexadecimal format that JS uses. For example this code:  txtOut.Text = Regex.Replace(txtIn.Text, @"[\u0080-\uFFFF]",     m => @"%" + String.Format("{0:x}", ((int)m.Value[0])));   Returns "%a9%221a" for "©√" instead of "%C2%A9%E2%88%9A". It looks like I need to split the string up into bytes or something.  Edit: This is for a windows app, the only items available in System.Web are: AspNetHostingPermission, AspNetHostingPermissionAttribute, and AspNetHostingPermissionLevel.


I know ? checks for null when placed before a . member access and ?: for conditional statements. Although, I think ?? checks for null as well but I'm not very sure I can't find useful information about ?? on   PS. Actually I didn't look well at the MSDN reference very well. I've just seen its definition now. I though of closing this post before but I won't for the sake of anyone who wouldn't think of referring to ?? as double question marksin their question

Ran across this line of code:  FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();   What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google.


A while ago, I'd say 2 or 3 years ago, I didn't have a Windows 7 License, so I decided to install Ubuntu, because I'd always wanted to try Linux, and because it was free. I decided it wasn't my cup of tea, and decided I just wanted to buy a W7 license.   So, since I uninstalled Ubuntu alongside Windows 7 license-less at the time, I just went into Windows 7's Programs and Features menu, and uninstalled Ubuntu, and wiped the partition and conjoined it with the main one.   Now, at the time, I thought this was all I needed to do, so I didn't do FixMBR before uninstalling and deleting the partitions. Fast-forward to nowadays, I took advantage of the free update to Windows 10 from last(?) year, I've had to live with the minimal bash-like editing is supported... menu and pressing f11 and f12 and selecting boot drive as Windows Boot Manager every time I launch my PC.  As a separate note, if this matters to the situation, in my Disk Management window, there's a EFI partition of 100 MB in my main disk, while my C: drive is NTFS and I have a recovery partition.  Also, I forgot to mention that Fixmbr and similar commands in a recovery drive don't work.  So, I was wondering if there was any way to fix this so that my Windows boots automatically?

I have Windows 8 pre-installed, and then I installed GRUB with Ubuntu. Ubuntu is not my thing, so now I want to remove it along with GRUB. From what I have learned, with UEFI, GRUB does not overwrite the windows bootloader in the EFI partition and is stored elsewhere. How would I remove GRUB and make my PC use the Windows bootloader instead? It should be noted that I created a separate /boot partition when installing Ubuntu.


Exception in thread "main" java.lang.NullPointerException at Course.dropStudent(Course.java:95) at CourseTester.main(CourseTester.java:59)   I'm writing a Course class that works with a Student class(that i'm not allowed to modify) and have been provided a CourseTester class to ensure everything works properly. I've been making my way through it but i noticed that i'm now getting that error. It's happening when i try to compare a Student id from the CourseTester class to the student id's already in the array. The entire program is over 300 lines so i'll just try to copy in the parts where the problem is.   Fist part is from the Course class that i am writing  public boolean dropStudent(Student student) {      boolean dropped = false;      int targetIndex = 0;      Student[] newRoster = new Student[roster.length];       for (int count = 0; count < roster.length; count++) {          if (roster[count].getID() == (student.getID())) {//line95              targetIndex = count;              dropped = true;              }           }   Second part is  from the CourseTester that was provided.  // drop student not on roster or waitlist     studentToDrop = studentsInSchool[14]; // WW     dropped = course.dropStudent(studentToDrop);//line 59     System.out.println("For " + studentToDrop.getName() + ", drop method should return false (student      is not enrolled): \t" + dropped);        System.out.println("\nCourse should still contain AA, DD, EE, FF, and GG on the course roster (in      any order) and HH, JJ, KK, and MM on the waitlist (in that exact order).");     System.out.println("\n" + course + "\n");   Note, I have to use Arrays. The goal here is to find remove a student from the roster(drop from course). I need to do this by searching for his student ID number.