I have a weird situation:  I had a disk on a Debian 9 server that had one partition with an ext4 filesystem mounted to /opt/foobar. I then unmounted the partition and deleted it using fdisk.  I then   Created a PV on that disk Added it to a VG Created an LV Created an ext4 filesystem   which I now want to mount to the old mountpoint /opt/foobar. The command finishes without error, but when I check with df or lsblk I can see that the mount is not there.  Update: I just realized, that mounting the LV to another mountpoint, say /mnt works.  Here are some outputs:  root:~/ # grep optsdc /etc/fstab /dev/mapper/vg1-lvoptsdc  /opt/sdc  ext4  defaults  0  0  root:~/ # mount /dev/mapper/vg1-lvoptsdc /opt/sdc root:~/ # echo $? 0 root:~/ # dmesg [Thu Oct 17 16:34:54 2019] EXT4-fs (dm-9): mounted filesystem with ordered data mode. Opts: (null) root:~/ # lsblk NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT sdb                8:16   0   50G  0 disk └─vg1-lvoptsdc   254:9    0    5G  0 lvm root:~/ # lvdisplay -m /dev/mapper/vg1-lvoptsdc --- Logical volume --- LV Path                /dev/vg1/lvoptsdc LV Name                lvoptsdc VG Name                vg1 LV UUID                ol90ME-v6Tv-fpUC-8cb6-NwlZ-0UjF-l2c7d8 LV Write Access        read/write LV Creation host, time hostname, 2019-10-17 09:02:07 +0200 LV Status              available # open                 0 LV Size                5.00 GiB Current LE             1280 Segments               1 Allocation             inherit Read ahead sectors     auto - currently set to     256 Block device           254:9  --- Segments --- Logical extents 0 to 1279:   Type                linear   Physical volume     /dev/sdb   Physical extents    9722 to 11001

This is a followup to .  I figured out something is unmounting my device right after I mount it.  This device is being used by a database (Vertica), which is down and not using the directory while I'm running the mount command.  I'm trying to figure out:   Is systemd the one which unmounts the device? How can I debug why is that happening? How do I fix it?   Here's an example of what is happening:  [root@mymachine systemd]# mount -t ext4 /dev/xvdx /vols/data5; ls -la /vols/data5; sleep 5; ls -la /vols/data5 total 36 drwxr-xr-x   5 dbadmin verticadba  4096 Jul 23  2017 . drwxr-xr-x   9 root    root          96 Jul 16 18:52 .. drwxrwx--- 503 dbadmin verticadba 12288 Jul 23 13:51 somedb drwx------   2 root    root       16384 Nov 30  2016 lost+found drwxrwxrwx   2 dbadmin verticadba  4096 Jun 20 08:32 tmp total 0 drwxr-xr-x 2 root root  6 Jun  8  2017 . drwxr-xr-x 9 root root 96 Jul 16 18:52 .. [root@mymachine ~]#    fstab:  # # /etc/fstab # Created by anaconda on Mon May  1 18:59:01 2017 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 /                       xfs     defaults        0 0 /dev/xvdb swap swap defaults,nofail 0 0 /dev/xvdy /vols/data ext4 defaults 0 0 /dev/xvdx /vols/data5 ext4 defaults 0 0   Some more logs as per 's suggestion:  Aug 01 16:55:19 mymachine kernel: EXT4-fs (xvdx): mounted filesystem with ordered data mode. Opts: (null) Aug 01 16:55:19 mymachine systemd[1]: Unit vols-data5.mount is bound to inactive unit dev-xvdl.device. Stopping, too. Aug 01 16:55:19 mymachine systemd[1]: Unmounting /vols/data5... Aug 01 16:55:19 mymachine umount[353194]: umount: /vols/data5: target is busy. Aug 01 16:55:19 mymachine umount[353194]: (In some cases useful info about processes that use Aug 01 16:55:19 mymachine umount[353194]: the device is found by lsof(8) or fuser(1)) Aug 01 16:55:19 mymachine systemd[1]: vols-data5.mount mount process exited, code=exited status=32 Aug 01 16:55:19 mymachine systemd[1]: Failed unmounting /vols/data5.


I have data set with date features like 01/01/2019 and I would like to use KNN. However, I cannot find a good transformation for dates that has a meaningful distance result for the last feature.  For example:  f1 | 1 | 2 | 3 | 4 | 01/01/2019  f2 | 10 | 3 | 12 | 1 | 14/01/2019  Does anyone have any recommendations?


Let $f:[0,1] \to \{0,1\}$ be continuous, where the spaces have the usual topology inherited by $\Bbb R$. Must $f$ be constant? I think it should because $[0,1]$ is connected and it can't be divided into two open disjoint sets, which should be the preimages of $0$ and $1,$ but I'd like to know if that is correct or not.

Is it possible to find a continuous function $f$: $[0,1]$ $\rightarrow$ {$0,1$} that is onto?  My thoughts: I know if $A$ & $B$ are two subsets of a top. space $X$ and if there exists a continuous function $f$: $X$ $\rightarrow [0,1]$ s.t $f(A)=${0} & $f(B)=${1}, we say $A$ & $B$ can be a separated by a continuous function $f$.  But the problem is $[0,1]$ is connected and hence can't find a separation of it.Is it possible to find such a function?.   Alternatively, I know Urysohn lemma and the definition of a completely regular space(which are somewhat related to this but not quite). Any thoughts?


What is the equivallent of RGB color in the Ubuntu terminal preferences menu?   The code is something like #F3532525 and i have a RGB color code that i want to set as my default color in my terminal. How can i do that?

I can change the colour through preference , but how can I change the background colour and text colour of terminal through the command line?


I'm using preview in my context menu which opens the default image viewer, Windows Photo Viewer.  Actual behavior  When opened, an animated gif file is opened, but the animation is not played--it's like the image is paused.  Desired behavior  I want Windows Photo Viewer to go through the animation.    Questions  Is the desired behavior possible via Windows Photo Viewer?  If not, can I replace the preview action with another action--have preview open a different app?  If so, which softwares take hotkeys, like the left-right d-pad arrow keys to go to the next/previous image?

Is there any way to play GIFs with Windows Photo Viewer or with Picasa Viewer in Windows 7 when Internet Explorer isn't my default browser?


Referring to this question: , a kind user explained us how to read the following statement from the :.      Increasing carbohydrate intake was associated with increasing stroke   risk (HR = 2.01, 95%CI = 1.04–3.86 highest vs. lowest quintile; p for   trend 0.025).      Multivariable Cox modeling estimated adjusted hazard ratios (HRs) of   stroke with 95% confidence intervals (95%CI).   In the answer I was told to interpret this as:     The confidence interval suggests that we can conclude, with 95%   certainty, that the true hazard rate in the population could fall   anywhere between 1.04 and 3.86. In the broader population, the stroke   risk associated with increased carbohydrate consumption could be as   high as 3.86 times or as low as 1.04 times that of the comparison   group.   I don't understand what part of the original text gave this information on the confidence interval.

It seems that through various related questions here, there is consensus that the "95%" part of what we call a "95% confidence interval" refers to the fact that if we were to exactly replicate our sampling and CI-computation procedures  many times, 95% of thusly computed CIs would contain the population mean. It also seems to be the consensus that this definition does not permit one to conclude from a single 95%CI that there is a 95% chance that the mean falls somewhere within the CI. However, I don't understand how the former doesn't imply the latter insofar as, having imagined many CIs 95% of which contain the population mean, shouldn't our uncertainty (with regards to whether our actually-computed CI contains the population mean or not) force us to use the base-rate of the imagined cases (95%) as our estimate of the probability that our actual case contains the CI?   I've seen posts argue along the lines of "the actually-computed CI either contains the population mean or it doesn't, so its probability is either 1 or 0", but this seems to imply a strange definition of probability that is dependent on unknown states (i.e. a friend flips fair coin, hides the result, and I am disallowed from saying there is a 50% chance that it's heads).  Surely I'm wrong, but I don't see where my logic has gone awry...


I have no clue how to do this, I manage to get I get that $11^{36} \equiv 1  \hspace{0.1cm} \text{mod} (13)$ but I can't get anywhere from there.

Problem :   Solve in $\mathbb N$ :   $8n+9\equiv 0\pmod{1163}$  The mathematics give me : $n=435+1163k$ , $k\in\mathbb N$   $1163$ is a prime number   $8n\equiv -9\pmod{1163}$   $8n\equiv 1154\pmod{1163}$   I don't know any ideas to complete my work ?   I have to see your hints


I just decided to give a try to Ubuntu 17.10, but as soon as I tried to set my compose Key, I can't find the place to do it.  Usually it was in Settings > Devices > Keyboard > Typing, but in this section I only find two options:  Switch to next input source Switch to previous input source   Any ideas? Thanks in advance!

Now that Unity is gone, the usual way of setting a Compose Key (via Keyboard Preferences > Layout) no longer works (because in Ubuntu 18.04, Devices > Keyboard has no Layout tab).  How do we set a Compose Key in Ubuntu 18.04 Bionic Beaver?


I have a log file consiste of 240 float digits in the following format: 5.4 5.1 5.2 5.4 5.4 4.9 5.0 5.2 5.5 5.3 5.6 5.4 5.1 5.3 5.3 5.1 5.2 .. 4.8  Accesing to this log file in bash environment I need to compute mean value for this data (the sum of the elements devided by the number of elements) and then store the resulting value as a new variable that I am going to use inside the same bash script for some purposes e.g. I need to store a variable mean = 5.0 Is it possible to do it directly in one bash script ?

I understand bash and some other interpreters only perform arithmetic for integers.  In the following for loop, how can I accomplish this?  I've read that bc can be used but am not sure how to use bc in this situation.  total=0 for number in `cat /path/to/file`; do         total=$(($total+$number)) done average=$(($total/10)) echo Average is $average   file:  1.143362 1.193994 1.210489 1.210540 1.227611 1.243496 1.260872 1.276752 1.294121 1.427371


I am trying to get Anki to work with LaTeX. I have a custom card type with the following header: \documentclass[12pt]{article} \special{papersize=3in,5in} \usepackage[utf8]{inputenc} \usepackage{amssymb,amsmath,amsfonts} \pagestyle{empty} \setlength{\parindent}{0in} \newcommand{\OO}{\mathcal{O}} \usepackage{stmaryrd} \begin{document}  and footer: \end{document}  I have a cloze card in my deck with the following code: [latex]{{c1::Test}}[/latex]   When I try looking at the card, I get a broken image icon, and below that, the following message:  Error executing latex. Generated file: /tmp/anki_temp/tmp.tex Have you installed latex and dvipng/dvisvgm?  I am using Kubuntu 20.04. I have texlive-full, dvipng as well as dvisvgm installed. The LaTeX code used on Anki cards compiles without problems in TeXStudio. The problem is only present on cloze cards: basic cards are displayed properly. There are several questions of this sort on this and other sites, however none of the answers there solved my problem.

I'm trying to get LaTeX working on Anki.  I am the only admin on my system but when I try and run the terminal command "tlmgr update --self && tlmgr install dvipng" I get an error saying I need to run the program as an admin. I am the admin! How do I run this program?   PS:  Due to lack of reputation, I am unable to vote or bump any existing material, so I am asking a new question.  The comment to the linked top answer below  is identical to my query, hence the identical text.    PPS:  Crossposted from Apple StackExchange because I wasn't sure which forum was more suitable.


As the title says, can a blocking creature fight? If so, what happens if the blocking creature dies before damage is dealt? How would damage be dealt during combat?  Example: Creature A is a 2/2 and it is blocking creature B, which is also 2/2. Before combat damage, I cast an instant forcing creature A to fight creature C, another 2/2, so that both A and C die.

Suppose Player 1 has a Dragon on the table and  in hand, while Player 2 has two Spiders on the table.  Player 1 chooses to attack with the Dragon and Player 2 chooses to block with one of the Spiders.  Before combat damage is to be dealt, Player 1 uses Unsummon on the blocking Spider.    Does Player 2 take any life damage from the attacking Dragon?


Can anyone use tikz to draw a three-dimensional schematic diagram of the mesh surface


I'm doing a test file for my Fourier transform algorithms.   Everything seems fine in my code, but I'm getting the 'request for member which is of non-class type as an error'...I've tried parentheses and such as recommended elsewhere, but nothing has worked.  I've already tried parentheses and checking the parameter types.  For Fourier Methods I do Cooley-Tukey(FFT) and Brute-Force(DFT)     Fourier test function (fourier_test.cpp):       void FOURIER_TEST(void){        //complex vectors which will be used as references       std::vector<complex<double>> cooley_ref;       std::vector<complex<double>> brute_ref;        //created cooley-tukey and brute force objects       Brute_force<double> brute();       Cooley_tukey<double> cooley();        brute.DFT(makeTimeVector, makeValueVector, &brute_ref);       cooley.FFT(makeTimeVector, makeValueVector,        &cooley_ref);   Brute Force Class:      template<typename T>     class Brute_force: public Fourier<T>     {       public:         Brute_force();         Brute_force(std::string file_name, double frequency_step, std::string output_name);          void DFT(std::vector<double>* index,           std::vector<double>* value, std::vector<complex<double>>& result);      };      #endif   Cooly Tukey Class:  template<typename T> class Cooley_tukey: public Fourier<T> { public: Cooley_tukey(); Cooley_tukey(std::string file_name, double frequency_step, std::string  output_name);  std::vector<complex<T>>& getData(void) {return data; }  void FFT(std::vector<T>* index, std::vector<T>* value,  std::vector<complex<T>>& result); private: std::vector<complex<T>> data; };  #endif

Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed?


i'm using Courant's book for self study, i would like to know if my proof that $\sqrt[p]{n}$ is irrational if $n$ is not a perfect pth power. Also would appreciate if someone do know where i can look for the solutions.    If $n$ is not a perfect pth power i can express it in terms of $n^{pm + 1}$. Assuming that $\sqrt[p]{n^{pm+1}}$ is rational i would have:  $$ \sqrt[p]{n^{pm+1}} = \frac{k}{j} \\ n^{pm + 1} = \frac{k^p}{j^p} \\ n^{pm + 1}j^p = k^p \\ n^mn^{\frac{1}{p}}j = k \\ j^p = \frac{k^p}{n^{pm+1}} \\ j = \frac{k}{n^mn^{\frac{1}{p}}} $$  Which is a contradiction because they do have a common factor.

It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational?


Find $\lim_{n \rightarrow \infty} A_{n}$, where $A_{n}=\frac{1}{n+1}+\frac{1}{n+2}+ \cdots +\frac{1}{2n}$ with $n \in \mathbb{N}$. Intuitively, I thought this limit might be zero, nerverthess it isn't. I found in a book (Calculus, Spivak) that this limit can be seen like upper sums and lower sums. The answer of the problem is that: $\lim_{n \rightarrow \infty} A_{n}= \int_{0}^{1}\frac{1}{1+x}dx=log(2)$ But I still don't understand how to achieve this result, and how the upper sums and lower sums are involved in the limit of that sequence. Please help me to understand.

How do I prove that the limit of the sequence exists: $$a_n = \frac1n +\frac 1{n+1} + \frac1{n+2} + \dots + \frac1{2n}$$  I can find the limit as n goes to infinity, $\frac1{2n}$ goes to $0$, so the limit is $0$ right? But how do I prove that the limit exists? Do I have to use the $\varepsilon$ $\delta$ definition of a limit?    For part b) I have to show that the limit is less then $1$ but not less then $\frac12$, I thought the limit was $0$?


The problem I wish to solve: I need to figure out where in my system a specific program stores its files. I thought there might be a way for me to monitor which files this program changes. Is this possible?

I have a program which I am trying to run, however when I run it; it just complains that it can't find a particular file.  However I have no idea which folder it is trying to find this particular file in. I have a copy of the required file, I just need to know which folder to copy it too.  Is there any way to show in real time which files are being accessed or which files are trying and failing to be accessed?  I am using Ext4 filesystem if that helps.  Thanks


This question suddenly came to my mind (May be very silly question...)     Suppose $f$ is a continuous function over $\mathbb{R}$ and twice differentiable. Can $f$ ever has uncountable number of Local maxima or minima? (Twice differentiablity can be ignored for finitely many points).   I was thinking of counter-example (obviously), but could not find one.(I am really really bad at finding counter-example actually!)  I thought about the example $x^2\sin\Big(\dfrac{1}{x}\Big)$ when $x\neq 0$, and $0$, when $x=0$, but this function is not twice differentiable everywhere.  Added:  Note: Twice differentiablity can be ignored for finitely many points (Because I think if I impose this condition the problem will be interesting...)

Does there exist a continuous function from $[0,1]$ to $R$ that has uncountably many strict local maxima?


I encountered this question when I took the Mathematics Aptitude Test yesterday and I had no clue how to approach it.  The question goes quite simply, "Is $3^{2015}-2^{2015}$ a prime? Show it very carefully."  I had knowledge about the fact that $x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+\cdots+xy^{n-2}+y^{n-1})$. It gives  $3^{2015}-2^{2015}=(3-2)(3^{2014}+3^{2013}\times 2+\cdots+3\times 2^{2013}+2^{2014})=3^{2014}+3^{2013}\times 2+\cdots+3\times 2^{2013}+2^{2014}$.  I hope some kind souls can give me some thoughts how to proceed on. Thank you!


We are dangerously close to maxing out a mailbox size and would like to get some suggestions on what to do. Where should we ask about this? When searching for questions on Exchange Server, found that Server Fault and Super User both have categories. Server Fault has the most activity but the Office 365 Exchange has no activity.

Which Stack Exchange site is best for Microsoft Exchange questions?  It is related to public folders and exporting them out to an SMB file share with a predefined folder hierarchy. A solution could possibly include scripting.


Let $G$ be a group. Prove that      $G$ is solvable $\iff$ $G'$ is solvable $\iff$ $G/Z(G)$ is solvable.   $G'$ is the commutator subgroup.  I've figured out the first of the stated equivalences but don't really know where to start on the second.

I recently read the well known theorem that for a group $G$ and $H$ a normal subgroup of $G$, then $G$ is solvable if and only if $H$ and $G/H$ are solvable. In my book, only the fact that $G$ is solvable implies $H$ is solvable was proven. I was able to show that if $H$ and $G/H$ are solvable, then so is $G$, but I can't quite show that $G$ is solvable implies $G/H$ is solvable.   My idea was this. Since $G$ is solvable, there exists a normal abelian tower $$ G=G_0\supset G_1\supset\cdots\supset G_r=\{e\}. $$ I let $K_i=G_i/(H\cap G_i)$, in hopes of getting a sequence $$ G/H\supset K_1\supset\cdots\supset K_r=\{e\}. $$ My hunch is that the above is also a normal abelian tower. However, I'm having trouble verifying that $K_{i+1}\unlhd K_i$ and that $K_i/K_{i+1}$ is abelian.  Writing $H_i=H\cap G_i$, I take $gH_{i+1}\in K_{i+1}$ for some $g\in G_{i+1}$. If $g'H_i\in K_i$, then I want to show $g'H_igH_{i+1}g'^{-1}H_i$ is still in $K_{i+1}$, but manipulating the cosets threw me off. I also tried to use either the second or third isomorphism theorems to show that $K_i/K_{i+1}$ is abelian, but I'm not clear on how to apply it exactly. I'd be grateful to see how this result comes through. Thank you.


What is the preffered version of building XML tags for returning a list of name/value pais?  <variables>   <item>ok</item>   <another>123</another>   <catch>me</catch> </variables>   or  <variables>   <variable name="item" value="ok"/>   <variable name="another" value="123"/>   <variable name="catch" value="me"/> </variables>   I think the second form is better, but are there any official W3C recommendations or "desing patterns"?

Which would be the correct format for this XML data, are they equivalent or are there trade offs between the two?  1.  <sitemap>   <category name="Animals">
       <page url="/pics/greatdane.jpg" title="Great Dane"/>
   </category> </sitemap>   2.  <sitemap>   <page>     <category>Animals</category>
Dogs
     <title>Great Dane</title>     <url>/pics/greatdane.jpg</url>       </page> </sitemap>   I've implemented the first example with my style sheet and it seems to work fine, but I'm unsure what the correct form should be.


$$A = \begin{pmatrix}0&5\\ 7&4\end{pmatrix}$$  (i) Write $A$ as a product of 4 elementary matrices.  (ii) Write $A^{-1}$ as a product of 4 elementary matrices.  I have managed to solve for $A^{-1}$, which is: $$\begin{pmatrix}-\frac{4}{35}&\frac{1}{7}\\ \frac{1}{5}&0\end{pmatrix}$$  But I am struggling to figure out how I would split each of these into 4 elementary matrices.  I know that if I can solve the 4 elementary matrices of one of them, I just need to invert them to get the elementary matrices of the other.  Any help?

Let $A=\begin{pmatrix}0&5\\ 7&4\end{pmatrix}$.      1) Write $A$ as a product of $4$ elementary matrices.      2) Write $A^{-1}$ as a product of $4$ elementary matrices.   My work. I have managed to find $A^{-1}$, which came out to be this:  \begin{pmatrix}-\frac{4}{35}&\frac{1}{7}\\ \frac{1}{5}&0\end{pmatrix}  However, I am struggling to figure out how I would split each of these matrices into $4$ elementary matrices. Any help?


Question: Let $p$ and $q$ be distinct primes and let $n=pq$.  Prove that if $a=p+n\mathbb{Z}$ and $b=q+n\mathbb{Z}$, then $a^{q-1}+b^{p-1}=1.$  I'm not entirely convinced that the above is true.  I have applied Fermat's little theorem.  Since $p$ and $q$ are distinct primes - $a^{q-1}\equiv 1 \pmod q$ and $b^{p-1}\equiv 1 \pmod p.$  Where I am getting stuck is how to apply that second given: $a=p+n\mathbb{Z}$ and $b=q+n\mathbb{Z}.$ Added due to player3236: $a^{q-1}+b^{p-1}\equiv 1 \pmod q$ since $b^{q-1}\equiv 0\pmod q$.  Similarly for $a$ and $p$.  This shows that $a^{q-1}+b^{p-1}-1\equiv 0 \pmod {pq}$,or that $a^{q-1}+b^{p-1}-1$ is divisible by $pq$ since $p$ and $q$ are distinct primes.

I would like to prove the following equality: $$k^{\phi(l)} + l^{\phi(k)} \equiv1\pmod{lk}$$if $\gcd(l,k)=1$. What methods can I use? Thank you for your help.


So i tried to install the updates, but i got an error message saying that: Failed to download repository information Check your Internet connection. (it is ok).   When i tried to do it in command line i got this:  valo@Castor:~$ sudo apt-get update [sudo] password for valo:  Hit:1 http://es-mirrors.evowise.com/ubuntu cosmic InRelease Ign:2 http://ppa.launchpad.net/tualatrix/ppa/ubuntu cosmic InRelease          Err:3 http://ppa.launchpad.net/tualatrix/ppa/ubuntu cosmic Release              404  Not Found [IP: 91.189.95.83 80] Reading package lists... Done                       E: The repository 'http://ppa.launchpad.net/tualatrix/ppa/ubuntu cosmic 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.   Can someone help please?

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?


list = sorted(set(list)) list[:] = sorted(set(list)) list[::] = sorted(set(list))   I am new to Python, and the first thing I am noticing is that the syntax is concise, but non obvious.  For example, it is not clear what is going on in the three statements above. I ran them and got some results and seems like statement 1 is not updating the list, while statement 2 and statement 3 are. But, I am sure there is more going on here.  What do each of the above assignments mean?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I wonder if its possible to use Java as a scripting language in unity to create a basic 2d game?

I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read somewhere in Unity documentation that adding behaviour to objects in Unity requires use of scripts, and that unity only supports C# , .Net , and Boo scripts. Is there no use of Java at all?


is there any way to change this behavior to working on releasing keyboard? i am using ubuntu 18.04 with gnome 3, and if i bind switching layout to alt + shift i am not able to use some shortcuts which contains alt + shift in other apps (intelij idea for example), or it is not possible to change this behavior?

I have Ubuntu 16.04 with GNOME shell. I set ctrl+shift for the "Modifiers-only switch to next source" option.   This shortcut conflicts with apps hot-keys. I can't use ctrl+shift+i to open devtools in Chrome, it just switches the layout. In VS code IDE if I press shortcuts with ctrl+shift (for example ctrl+shift+f), shortcuts work but always switch a keyboard layout. When I used Windows this problem didn't exist.  Can I set the ctrl+shift shortcut in such a way that it causes a switch action only after the keys are released and only if this 2 keys were pressed (without additional keys)?


Why the following document does not compile correctly? I would like an output drawing n consecutive semicircles. For n=4 an output like this:    Is there a way to fix my code?  \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide}  \begin{document}  \begin{tikzpicture} \def \n{4} \foreach \i in {0,...,\n}   {   \tkzDefPoint(2*\i/\n,0){t_\i}   \tkzDrawPoint(t_\i)   }  \foreach \i in {0,...,\n/2} { \tkzDrawArc(t_(2*\i+1),t_(2*\i+2))(t_(2*\i)) } \end{tikzpicture}  \end{document}   Here is a manual solution without foreach:  \begin{tikzpicture} \tkzDefPoint(0,0){A0} \tkzDefPoint(.25,0){B0} \tkzDefPoint(.5,0){A1}   \tkzDefPoint(.75,0){B1}   \tkzDefPoint(1,0){A2}   \tkzDefPoint(1.25,0){B2}   \tkzDefPoint(1.5,0){A3}   \tkzDefPoint(1.75,0){B3}   \tkzDefPoint(2,0){A4}   \tkzDrawSegments(A0,A4) \tkzDrawArc(B0,A1)(A0) \tkzDrawArc(B1,A2)(A1) \tkzDrawArc(B2,A3)(A2) \tkzDrawArc(B3,A4)(A3) \end{tikzpicture}

I'm trying to follow an example of arc drawing from one  question:  \begin{tikzpicture}     \tkzDefPoint(0,0){O}     \tkzDefPoint(2,-2){A}     \tkzDefPoint(60:2){B}     \tkzDrawLines[add = 0 and .5](O,A O,B)     \tkzDrawArc[rotate,color=red](O,A)(180)     \tkzDrawPoints(O,A,B)     \tkzLabelPoints[below](O,A,B) \end{tikzpicture}   And I keep getting this error message  Undefined control sequence. \tkzDrawArc [rotate,color=red](O,A)(180) ?   I'm using the following packages:  \usepackage{fullpage,amsfonts,amsmath,amssymb} \usepackage{txfonts} \usepackage{tikz} \usepackage{tkz-euclide} \usepackage[margin=0.5in]{geometry} \usepackage{yhmath}   What am I missing?


I have the following bash command in which I'm taking a tcpdump and then saving the file using the date command. I want to embed this command directly in my Python script instead of having to call the bash script separately.  #!/bin/bash timeout 2 tcpdump -i eth1 -s 96 -w /usr/src/pcapFiles/dump$(date +%y%m%d-%H%M%S).pcap   I get the following kind of file names when I run the above script, which is just what I need(i.e. the date and time is rendered in the name):  dump131104-191834.pcap  However, I'm having difficulty in replicating the above command from within Python. I have gotten this far with embedding the command in Python. I'm unsure about how to break the date command so that it can render the file name just like the way I need it. The following is my Python command:  tcpd = subprocess.Popen(["timeout", "2", "tcpdump", "-i", "eth1", "-s", "96", "-w", "/usr/src/pcapFiles/dump$(date +%y%m%d-%H%M%S).pcap"], stdout=subprocess.PIPE) output, err = tcpd.communicate()   With this command I get the following output file names from tcpdump  dump$(date +%y%m%d-%H%M%S).pcap

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?


I'm running a Bayesian model and I'm stuck on some aspect of the model that I have difficulty to understand. Since my knowledge about Bayesian inference is limited, I would like to have some good references to understand Bayesian statistics.   People are teaching Bayesian statistics could be interested in how to think in . But I'm interested in finding  and how should we create, from scratch new models and diagnose them.   A good reference , but I need something more practical.

Which is the best introductory textbook for Bayesian statistics?  One book per answer, please.


Is it possible to generate  from within a BIOS machine? If so, how do you make this bootloader installation with Kickstart? AFAIU bootloader kickstart command installs the bootloader for BIOS as it is running in a BIOS machine.   EDIT:  We are trying to build a disk image with Koji. To do so, it spawns a QEMU VM, which by default is using BIOS. Then it runs a kickstart file for configuring it. We want this configuration to allow this image to run on both BIOS and UEFI machines. Avoid having one image for each. We have seen that this is possible with  as it boots fine in both.

I am trying to build a . To do so you specify a kickstart file to be used. Since QEMU is spawning a BIOS VM, my kickstart is doing only BIOS related stuff.  My issue here is that I want this image to run on UEFI-only machines as well. How could I accomplish that with just one kickstart file? Bear in mind building always happens in a BIOS machine, so my idea is whether it is possible to "install both bootloaders" for both BIOS and UEFI so this image can run on every machine no matter what it uses.  This is the Kickstart file I am using:  (...) ignoredisk --only-use=vda # System bootloader configuration bootloader --append="console=ttyS0,115200 console=tty0 inst.gpt" --location=mbr --timeout=5 --boot-drive=vda # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --disklabel gpt  part biosboot --fstype=biosboot --size=1 --ondisk=vda partition /boot/efi --fstype=efi --label EFI  --size=200 partition /         --fstype=xfs --ondisk=vda --label ROOT --size=2800 --mkfsoptions="-n ftype=1"  (...)  /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg /usr/sbin/grub2-mkconfig --o /etc/grub2-efi.cfg # We are installing bootloader with the bootloader command, but this only adds bios compatible, so we force both: https://unix.stackexchange.com/questions/273329/can-i-install-grub2-on-a-flash-drive-to-boot-both-bios-and-uefi # Should not be necessary to add --directory=/usr/lib/grub/x86_64-efi/ /dev/vda /usr/sbin/grub2-install --target x86_64-efi /usr/sbin/grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg


He proposed that this meeting to be held annually instead of monthly.      Should to be omitted or kept?

We will make the convention that exact categories be skeletally small.   Is this construction (used in a mathematical context) correct? There is something that strikes me as odd in that "be". Should it be "are"? I know I've seen a similar way of using "be" like that, without conjugating the verb, but I'm not completely sure when it should be used.


Example1:  x =[] def func():      print('x value is:', x)     x.append('member1')     print('x value is now:', x) func() print('x value is', x)   After run, the result will   ('x value is:', []) ('x value is now:', ['member1']) ('x value is', ['member1'])   example2:  y = 50 def func():     #global y     print('y value is:', y)     y = 2     print('global y is change to:', y) func() print('y value is', y)   after run:  UnboundLocalError: local variable 'y' referenced before assignment   the solution is un-commment the line global x but why python treat list and interge in different way ? why list x don't require global? why python don't respond for example 1 for list like this:  local variable 'x' referenced before assignment  Thanks!

I'm trying to understand Python's approach to variable scope. In this example, why is f() able to alter the value of x, as perceived within main(), but not the value of n?  def f(n, x):     n = 2     x.append(4)     print('In f():', n, x)  def main():     n = 1     x = [0,1,2,3]     print('Before:', n, x)     f(n, x)     print('After: ', n, x)  main()   Output:  Before: 1 [0, 1, 2, 3] In f(): 2 [0, 1, 2, 3, 4] After:  1 [0, 1, 2, 3, 4]


When reading some reviews on lenses in cons or pros are noted speed of lens. What does it means when we are talking about analogue cameras without autofocus?

It seems very counter intuitive that the amount of light let in by a lens is referred to as the lens speed. This term confused me for a while because I couldn't logically see how a speed would be associated with a particular lens, being either fast or slow.   Is there any reason why this is referred to as the speed of the lens?


How can i count the object of my request?  I am using ajax and  requesting json data to this url pbxApi+"/conference/participants/"+circle+"/"+data.conference+"/"+data.uniqueid+'?jsonp=response'; and i want to count the object of the response .   This is my code    var uri = pbxApi+"/conference/participants/"+circle+"/"+data.conference+"/"+data.uniqueid+'?jsonp=response';         getJsonData(uri, function(res){             console.log(res.length); });   This is my functiion:    var getJsonData = function(uri,callback){     $.ajax({       type: "GET",       dataType: "jsonp",       url: uri,       jsonpCallback: 'response',       cache: false,       contentType: "application/json",       success: function(json){         callback(json);       }     });   }   This is my response   response({"_id":"561713a78693609968e3bbdd","event":"ConfbridgeJoin","channel":"SIP/192.168.236.15-00000024","uniqueid":"1444352918.94","conference":"0090000293","calleridnum":"0090000288","calleridname":"0090000288","__v":0,"status":false,"sipSetting":{"accountcode":"0302130000","accountcode_naisen":"201","extentype":0,"extenrealname":"UID1","name":"0090000288","secret":"Myojyo42_f","username":"0090000288","context":"innercall_xdigit","gid":101,"cid":"0090000018"}})   Thanks :)

What's the fastest way to count the number of keys/properties of an object?  It it possible to do this without iterating over the object?  i.e. without doing  var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++;   (Firefox did provide a magic __count__ property, but this was removed somewhere around version 4.)


Let's consider the usual setup for time independent perturbation theory: $$H=H_0+\varepsilon H'$$ and we can then set up the usual expansion: $$(H_0+\varepsilon H')[|n_0\rangle+\varepsilon |n_1\rangle+\varepsilon ^2 |n_2\rangle+...]=(E_n^{(0)}+\varepsilon E_n^{(1)}+\varepsilon ^2 E_n^{(2)}+...)[n_0\rangle+\varepsilon |n_1\rangle+\varepsilon ^2 |n_2\rangle+...]$$ Long story short: when we have to solve a problem using perturbation theory the only thing we are interested about is how to calculate the corrections to the eigenstates and the eigenvalues. If we are in the case of time independent non degenerate perturbation theory then this task is preatty straight forward once you know the formulas for the corrections: $$E^{(k)}_n=\langle n_0|H'|n_{k-1}\rangle$$ $$|n_k\rangle=\frac{1}{H_0+E^{(0)}_n}|_{|n_0\rangle}[(E_n^{(1)}-H')|n_{k-1}\rangle+E_n^{(2)}|n_{k-2}\rangle+.....+E_n^{(k)}|n_0\rangle]$$ Done! Wonderful! But of course what if our Hamiltonian is degenerate? On textbooks I have found reasons why the old formulas do not work. I also understood that in some cases the perturbation cancels the degeneracy and in some other cases it doesn't. And there are also talks about the need to diagonalize the matrix in the degenerate space (this last point is not clear to me at the moment). Ok. But in practice: How can I set up and solve the perturbative expansion in the degenerate case? What are the formulas for the correction? (Knowing why the formulas work would also be nice but it is not the main point of this question) Those are simple questions but I cannot seem to find any direct answer in my books or lecture notes. I would like a nice and concise answer. This topic seems really complicated to me as a beginner and I would like a summary of what is going on here. Especially from a practical point of view, on how can we solve exercises and expansions in the degenerate case.

As far as I gather, before a perturbation is applied, the eigenspace associated with the degenerate energy is multidimensional but after applying the perturbation this space 'splits' into different eigenspaces. If we use Non-degenerate perturbation theory, then we would end up dividing by zero when calculating the coefficients for the linear combination of the perturbed state. The way to get around this is apparently to diagonalise the perturbation Hamiltonian with a basis of the unperturbed degenerate eigenstates, and this is what I fail to understand.  Why is it that diagonalising the perturbation Hamiltonian will solve the problem of dividing by zero? Also how can I understand visually what is happening to the linear transformation on the eigenspace before and after diagonalising the perturbation Hamiltonian?  Another problem I have is understanding the process of calculating the energy and state corrections after finding a basis in which the perturbation Hamiltonian is diagonalised. Every example or explanation I have found is incredibly abstract. I would love to see a simple example with matrices and vectors if possible if anybody has links to good resources or can be bothered to go through one in an answer. I find matrix/vector representations to be much more intuitive.   Lastly, another question that I have just thought of: Are these eigenstates that we find to diagonalise the perturbation Hamiltonian with precisely the eigenstates of the new total Hamiltonian? And in that case, are they regarded as the first order corrections to the space of eigenstates whatever that would mean?


How do I calculate the pmf of $X_N$, where $X$ is the number of people out of $N$ getting back their own hat after a random hat exchange?  How can I calculate it without listing all the possible outcomes?

I am trying to figure out how many permutations exist in a set where none of the numbers equal their own position in the set; for example, $3,1,5,2,4$ is an acceptable permutation where $3,1,2,4,5$ is not because 5 is in position 5.  I know that the number of total permutations is $n!$. Is there a formula for how many are acceptable given the case that no position holds its own number?


What are pros and cons of using single page with anchors vs section with subpages in menu? I'm asking in context of "About us" section where we have such information as: basic facts, offices, team and values.

I am working on trying to re-design the site for the agency I work for and a recommendation was made that we should move to a single page site with a vertical scroll which which walks through all the work that has been done. I am not a big fan of that since I am not sure how intutive that would. Is there research into what are pros and cons of a single page and when they should/should not be used as opposed to using a multipage site.


I have a 2019 MacBook Pro and this is about the first Mac I've worked with. The metal case above the keyboard gets extremely hot even when I'm not using the MacBook but have it on. Under normal and high loads that part of the case gets hot enough to burn if touched for about a second.   I can't tell if this is normal considering it doesn't seem to have a fan or a fan moving fast enough to be audible. I am almost wondering if it's intended and the Metal case is used to dissipate heat.

I have a macbook (2.26 GHz Intel Core 2 Duo upgraded to 8GB 1067 MHz DDR3 RAM) running OS X version 10.6.8. I do a lot of prototyping for high performance computing on this macbook (running c++, fortran, mathematica, matlab, etc) and often work in parallel.  I have noticed that my computer gets hot so I have installed 'Temperature Monitor' and find that, when running difficult jobs, it can break into the 90 degree (C) range. I know this is not good, but is this incredibly dangerous? after seeing what values should i begin to get worried?  Secondly, I would like to clean (and maybe even replace?) the fan to make sure I am getting the best ventilation possible. Will a can of compressed air do the trick? how expensive/worthwhile would it be to open up the case and replace the fan?  Any help would be great - thanks!


I am writing this sentence:  There are many fruits available, including apples, bananas, oranges, to choose from.  I am confused where I should put "available". Which of the following is correct?  (1) There are many fruits available, including apples, bananas, oranges, to choose from.   (2) There are many fruits, including apples, bananas, oranges, available to choose from.   Thanks in advance! :)

There are several reasons proposed for the collapse of the bridge.   Is this present simple tense or the present perfect tense? I thought it might be the latter since there is a retrospective aspect to the sentence. However, I am quite unsure.


Is there a shortcut, plugin or code to wrap text with quotation marks ("" or '') in Notepad++?   Eg "text".  I don't know Python and other advanced programming languages, so please explain in a simple way ...

I have quite a large list of words in a txt file and I'm trying to do a regex find and replace in Notepad++. I need to add a string before each line and after each line.. So that:   wordone wordtwo wordthree   become   able:"wordone" able:"wordtwo" able:"wordthree"   How can I do this?


I'm using Ubuntu 13.10 with Unity.  I'm willing to have an indicator for my Gmail inbox.      My current situation :   I now use unity-mail, which works great with indicator-messages and is fully integrated in Unity. But I have one thing that I don't like, check this screenshot :     As you can see, indicator-messages still shows me status "available", "away", "invisible", and such. I would like to only have my emails, I don't care about the other things this package can do.      A way to achieve this :   I saw  this screenshot : this is exaclty what I would like to have !    I also saw  that I could use the sources to recompile indicator-messages, by modifying some lines. Unfortunately, the sources seems to have been rewritten, I can't follow the answer given, one file doesn't exist anymore and the code in the second file isn't the same.     So, here's the question :    How can I recompile indicator-messages to hide the status on 13.10 ?

I would know how to remove or hide in Ubuntu 12.04 the  (available, away, busy, invisible and offline) from Messaging Menu as I am not using any instant messenger. I do not want to remove the entire menu, just that section.  Thank you very much and best regards!!


man apparently uses less -s as the default pager, which does reflow text when the terminal window is resized, but this does not happen in man.  Is there any way of making man reflow text, so that it uses all the space in a resized window which has been made wider? (preferably while still keeping the right margin justification)

One common workflow of mine is to open a manual page in a terminal, then another terminal in which to test things. The man page is formatted to the initial dimensions of the first terminal. When I now resize my windows (or have my WM do that for me automatically), there is either a gap to the right of the preformatted page, or lines wrap. At this point I usually q(uit) and !! (run again), which loses my position in the page.  I assume the formatting process is quite CPU intensive, or maybe it stems from ancient times of fixed terminal sizes. The less pager dynamically reacts to terminal resize events, so it should be possible in theory.  I tried perusing man pages, searching the Web, asking on IRC -- the whole lot -- but couldn't come up with anything.   Can I trigger reformatting from within or outside of the man utility? Is there a version of the man utility that resizes the page dynamically?  Is there way to customize some part of the formatting/display process to make it update on SIGWINCH?


How can I convert a date in the following format to a unix timestamp?  Thu, 26 Dec 2013 17:53:05 +0100   Thanks, Regards !

How do I get timestamp from e.g. 22-09-2008?


Between levels six and seven, I clicked the wrong part of the level select screen and got dropped back onto the first level. No matter what I do, I can't get back to where I was -- if I quit back to the main menu, the 'continue previous game' option drops me back to level 1.   How do you go back to the level select screen? Do I need to fully replay the first level? Or am I now stuck replaying back to where I was?

There is a "bonus" level in Theme Hospital where you get to shoot as many rats as you can in the time it takes for your super inefficient cleaning crew to clear the building. According to the internet, it's triggered as a reward for killing off lots of rats in the regular levels. This  makes it clear that it has no consequences or rewards, and can be triggered by entering cheat codes on the fax machine.  I personally hate the rat shooting mechanic in this game, so this "bonus" is like a punishment to me. I keep accidentally triggering it because I happen to kill rats in my hospital during the normal course of business.   Is there a way to skip the rat shooting level? Or do I just let it run while I get some coffee or something?


i'm trying to do a basic calculator in angularJs and in a piece of code  i've run into an unexpected problem:  let stringOperation = 'a - b'; let operationScope = {a: 0.8, b: 1}; var result = $parse(stringOperation)(operationScope);   I expcted the output -0.2, but the actual output is -0.199999 etc..  Any idea ? thx

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


The book covers multiple story lines, and takes place over different times. The main story is about a multi-universal war against winged-spider like aliens that feed on the fear chemicals in sentient beings.  One protagonist is a centipede-like alien from another dimension/universe from which the spider creatures are scooping out pieces of the centipede alien's universe to convert to energy. One story line is a love story involving a space city that hurls itself into a black hole to escape the spider aliens. The book was written prior to 2004, and was part of a series exploring time, space, and dimension.

This was a small hardback book I read in the UK in the late eighties. No memory of the cover.  Some kind of space war and a long lived alien female escapes the conflict in her starship, her side had lost.  An evil enemy that she needs to trap so she gets (I think) human  DNA from space dust and sets up on a habitable planet. The story then gets like episodic and looks at the world every couple of generations while she hides out there.  Plants bud on the world and people pop out from big seedpods, the population listens out for babies crying and rescue them.  There are legends of the 'Earth mother’ who secretly guides them to become high tech.   In reality she is creating attractive food bait for the bad aliens.  I think an early human and her are attracted to each other and she (maybe) gives him long life or (maybe) uses reincarnation to keep seeing him.  Edit:- the name 'Rimstalker' has just now popped up in my brain!


All these days, I was using the below code to get any value from web config.  string someValue= WebConfigurationManager.AppSettings["SomeKey"]   When I came to know that  and it was explained there that   ...First of all in ASP.NET you want to ensure you access configuration sections through the   HttpContext object's GetSection method (this uses the cached copies managed by ASP.NET)...   Is WebConfigurationManager.AppSettings will always fetch value from web config and not from cache? If Yes, How do I fetch config value from cache?   P.S How caching works with app.config? Is it stored on windows RAM or .. ?

I read somewhere in the Microsoft documentation that the content of the ASP.NET's web.config is cached. If that is true, where is it cached - in memory or on disk?  And a follow-up question: are there any performance considerations I have to make, if I have to access the web.config intensively?


I have 100 pre-written SQL Server table insert statements, to pull data from a Progress database via openquery into 100 SQL Server tables e.g.  insert into table1 (col1 varchar(50), col2 varchar(10)) select X,Y from aprogresstable insert into table1 (col1 varchar(40), col2 int, col3 varchar(15)) select X,Y,Z from anotherprogresstable for 100 tables..   However, this is slow over openquery. Therefore, I'd like to import these data nightly from Progress into existing SQL Server tables using SSIS.   What is the best way to achieve this, without needing to create 100 data flow components (e.g. 100 sources, 100 destinations).  SQL Server Import/Export wizard is an option here but I've found it has data mapping issues with date fields.  Therefore, is it possible to create a For/Each loop to loop through 100 SQL insert statements via SSIS to pull data from Progress/Push to existing SQL Server Tables?  Thanks!

Based on my analysis, a complete dimensional model for our data warehouse will require extraction from over 200 source tables. Some of these tables will be extracted as part of an incremental load and others will be a full load. To note, we have about 225 source databases all the with the same schema. From what I've seen, building a simple data flow in SSIS with a OLE DB source and OLE DB destination requires the columns and data types to be determined at design time. This means that I will eventually end up with over 200 data flows just for the extraction alone. From a maintainability perspective, this strikes me as a big problem. If I needed to make some kind of sweeping change to the extraction code, I would have to modify 200 different data flows. An an alternative option, I wrote a small script which reads the source databases, table names and columns I want to extract from a set of metadata tables. The code runs in multiple loops and uses dynamic SQL to extract from the source tables via a linked server and OPENQUERY. Based on my tests, this is still not as fast as using an SSIS data flow with an OLEDB source and destination. So I am wondering what kind of alternatives I have. Thoughts so far include:  Using  to programatically generate SSIS packages with simple data flow. The tables and columns to extract would come from the same metadata tables mentioned earlier. Purchase 3rd party software (dynamic data flow component)  What is the best way to approach this? When it comes to .NET programming I'm a beginner, so the time required to ramp up just with the basics is also a concern.


We sent paper to a reputed journal. After 4 months we get: Reviewers have now commented on your paper. You will see that they are advising that you revise your manuscript. If you are prepared to undertake the work required, I would be pleased to reconsider my decision.    Im confusing about revise? what it does means? The reviews was easy and we already resbmit them. Does the paper will be reviewed by the same reviewers? What is our change for our paper to be accepted? how long in average will take to get the decision?

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


I recently purchased an imac on ebay and installed ubuntu on it but ther is no wifi available.I ran the command to find out the wifi card and this is what i got.                                   michael@michael-iMac:~$ lspci -nnk | grep -iA2 net 02:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller [11ab:4362] (rev 22)     Subsystem: Marvell Technology Group Ltd. Marvell RDK-8053 [11ab:5321]     Kernel driver in use: sky2 03:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11a/b/g [14e4:4312] (rev 01)     Subsystem: Apple Inc. AirPort Extreme [106b:0089]     Kernel driver in use: b43-pci-bridge michael@michael-iMac:~$    Could someone please provide me with with the terminal command to install the drivers to make wifi available on the mac. Thank you in advance.

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


Can I install ubuntu on my Huawei gra L09 - smartphone? My smartphone has Emui version is 4.0.1.; operating system Android 6.

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


i have Ubuntu 13.10 , but now i want Windows Xp.   1.I insert cd press F12 (my computer dell n5050) use CD-DRIVE and press enter. When come boot CD I press enter and see black screen.  So how install Windows Xp?  Thank you for your Advice

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


I have this sample bash command:  FILE='/tmp/1.txt' echo "file: $FILE"   and the output is:  file:   Why the output doesn't contain defined earlier variable FILE?

One of my coworkers has provided me with a Bash syntax that I am unfamiliar with.  My Google foo has failed me on figuring out what it does and why/when I should use it.    The command that he sent me was of this form:  someVariable=something command   Initially, I thought that this was equivalent to the following:   someVariable=something ; command   Or  someVariable=something  command   But this doesn't appear to the be case.  Examples:   [Jan-03 11:26][~]$ # Look at the environment variable BAZ. It is currently empty [Jan-03 11:26][~]$ echo $BAZ  [Jan-03 11:27][~]$ # Try running a command of the same format     [Jan-03 11:27][~]$ BAZ=jake echo $BAZ  [Jan-03 11:27][~]$     [Jan-03 11:27][~]$ # Now, echo BAZ again. It is still empty:     [Jan-03 11:27][~]$ echo $BAZ  [Jan-03 11:27][~]$     [Jan-03 11:28][~]$     [Jan-03 11:28][~]$ # If we add a semi-colon to the command, we get dramatically different results: [Jan-03 11:28][~]$ BAZ=jake ; echo $BAZ jake [Jan-03 11:28][~]$ [Jan-03 11:28][~]$ # And we can see that the variable is actually set: [Jan-03 11:29][~]$ echo $BAZ jake [Jan-03 11:29][~]$   What does this syntax do?  What happens to the variable that has been set?  Why does this work?


IIRC there was up to recently an option to "subscribe" to specific questions that interest you, and get email notification on these on a per-question basis. Was this option removed?

Suppose I want to subscribe to all activity in response to a question I am interested in. I am  aware of the , but I want email notifications. How do I do this?


Can any of the following licenses be chosen by the end-user, at their discretion, as the ConTeXt distribution/code license:  GPL 2.0, LPPL, New BSD?   states:  For practical purposes distributers may also choose the LATEX project licence, which is considered to be a bit more TEX friendly. (BSD alike licences also apply well for ConTEXt.)  I am trying to understand what the above statement means and its implications.

This webpage, , and many others explicitly state that ConTeXt must not be used for some purposes; e.g. competing with Pragma ADE.  However, the source code is GPL(ed), which explicitly states the exact opposite!  What is the real usage policy of ConTeXt, or isn't there one?


I get this error when I try to join Hypixel, a Minecraft server. I just updated to Windows 10.I'm not using any mods at all. Here's the crash report:  Completely ignored arguments: [--nativeLauncherVersion, 301] [19:45:31] [Client thread/INFO]: Setting user: Wombatorks [19:45:34] [Client thread/INFO]: LWJGL Version: 2.9.4 [19:45:35] [Client thread/INFO]: Reloading ResourceManager: Default [19:45:35] [Sound Library Loader/INFO]: Starting up SoundSystem... [19:45:36] [Thread-5/INFO]: Initializing LWJGL OpenAL [19:45:36] [Thread-5/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org) [19:45:36] [Thread-5/INFO]: OpenAL initialized. [19:45:36] [Sound Library Loader/INFO]: Sound engine started [19:45:38] [Client thread/INFO]: Created: 1024x512 textures-atlas [19:45:53] [Client thread/INFO]: Connecting to mc.hypixel.net., 25565 [19:45:57] [Client thread/INFO]: [CHAT]                           [19:45:57] [Client thread/INFO]: [CHAT]                           [19:45:57] [Client thread/INFO]: [CHAT] Wombatorks joined. # # A fatal error has been detected by the Java Runtime Environment: # #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd55e62177, pid=8508, tid=4976 # # JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops) # Problematic frame: # C  [ig75icd64.dll+0x12177] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # An error report file with more information is saved as: # C:\Users\Locke\AppData\Roaming\.minecraft\hs_err_pid8508.log # # If you would like to submit a bug report, please visit: #   http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

When I try to launch Minecraft 1.7.4 or newer, the game crashes on startup, and the game output screen says this:  #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=*, pid=*, tid=* # # JRE version: Java™ SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13) # Java VM: Java HotSpot™ Client VM (* mixed mode, sharing windows-* ) # Problematic frame: # C  [ig4dev32.dll+0x3e88] OR # C  [ig4dev64.dll+0x55ec] OR # C  [ig4icd32.dll+0x104a77] OR  # C  [ig4icd64.dll+0x84930a]   This happens with both Java 7 and 8.  What causes this error, and what can I do to fix the issue?


Jabba the Hutt kept scantily clad humanoid slaves.  Jabba even tried to kiss Leia.  But IIRC Hutts are hermaphrodites and of course should by all biological reasoning not be attracted to creatures of a specific sex (don't recall sexy dudes hanging around) with radically different body design.  So do Hutts find humanoid females hot, and if so why?  Or do they just do this for status and to show off to the largely humanoid populations that surround them?


NB: this is Hard. It is not a homework problem and it is a question that I would like on the one hand to share with you and on the other to help gain insight into myself.  Let $G$ be a set (which you may assume if you wish to either be finite, or in the infinite case the axiom of choice if you need it) on which we define an associative binary operation between any two elements $x,y \in G$ with $xy \in G$. Suppose that for every $a \in G$ there exists a unique $a^* \in G$ such that $aa^*a=a$. Prove that $G$ is a group.  So we need inverses and an identity. The closest I got to any meaningful progress was placing equivalence relations on elements in $G$ so as to partition it into smaller sets that have nicer structure. In particular, with one equivalence relation I constructed, I almost (but not quite) partitioned $G$ into sets which were groups under the binary operation, which I'm pretty sure would lead to the whole of $G$ being one equivalence class (or a contradiction). As an example, one of my first attempts was $x \sim y$ if and only if $x=ayb,y=cxd$ for $a,b,c,d \in G$. (Later attempts had things like $x=ay=y^*b, y=cx=x^*d$ etc). I don't know if this is fruitful but I'm putting it out there.  A couple of questions I found here that may prove useful:       Hope you enjoy!

The following could have shown up as an exercise in a basic Abstract Algebra text, and if anyone can give me a reference, I will be most grateful.  Consider a set $X$ with an associative law of composition, not known to have an identity or inverses. Suppose that for every $g\in X$, there is a unique $x\in X$ with $gxg=g$. Show that $X$ is a group.  Note that I’m not asking for a proof (though a really short one would please me!), just some place where this has been published.


Initial actions: I wanted to copy some files that were very close in total size to the USB stick memory size (<8G). So I checked size of all files vs available space. A few more KB were needed for everything to fit, so I checked if the drive is completely blank.  Problem: But when I checked the USB stick, it had 67MB used space, although it was completely empty (as in no hidden files or partitions). Formatting it while monitoring space usage with my own software, reveled that while formatting it NTFS via windows explorer, the system it does allocate all space and after a few mili-seconds a temporary file appears and disappears removing 67MB from the drive's space. (7.48 became 7.41GB available).  System info: Win 7 x32 running on notebook, no viruses, no antviruses, no 3rd party programs installed (just blank OS).  Fix: What I did to have all space: I switched from DevMng to optimize for performance and reformatted to FAT32, 64k cluster size. That made the 67MB of windows spy-stuff gone and showed me an allocated space of only 64kb. The difference was enough for my files to be fit and copied in one run.  So can anyone tell me what was that 67MB of system-hidden space ?    Thank you for your answers but, as I mentioned initially, there is no hidden anything on the drive; no System information, no recycler or any type of file/folder, fake ones included (the new pseudo-folders W7 uses). I check this independently of windows and explorer, with personal FM that shows everything in a file structure, including the unseen even if 'show hidden' is on.  The space is somehow allocated outside the file system, probably directly into the allocation table.

I just bought a new external hard drive (). In a PC with Windows 7, I formatted it by Right-clicking the drive > Format (Quick Format - NTFS) before using it and, and then checked out its Properties.     I noticed that it already has 118 MiB of its disk space already used, despite being newly formatted and no files transferred to it.   Questions: Is the disk space occupied by the disk overhead, metadata, etc. correlated to the total disk space capacity of an NTFS-formatted hard drive? If yes, how is it computed? (How much disk space will be 'used' by default on a brand new, newly formatted hard drive, given its disk space capacity and if it is formatted to use NTFS?)  Screenshot of the 1 TB drive's Properties after being formatted:   Related SU question:


Every time I restart chrome it opens with all extensions disabled. I uninstalled/reinstalled chrome and this did not fix the problem, and I still have to manually enable every extension each time I start Chrome.

I am running the latest version of Google Chrome 23.0.1271.97 (Official Build 171054) m on Windows 7. Any new extension I install simply disappears (not disabled, total disappearance) once I close and re-start Google Chrome. This is not happening to any of my old extensions; they stay there across Chrome re-starts.  I tried everything Google Help suggested:   I created new user profile by renaming the Defaults folder I checked for any permission change that the extensions might have undergone. This is not the case. I am not running in developer mode.   This happens when I close all instances of Google Chrome. Even if one instance of Chrome is running, this doesn't happen. But I can't have an instance of Google Chrome always running.  I even reported the issue to Google Chrome team to no avail and  is offline. And I skimmed through many threads opened for the same issue only to find souls like me. Stack Exchange is my last resort.


I've seen many people put an extra "DO" in a sentence. I know it's for emphasis, but is there an official name for it?  For example: "I like her" is perfectly correct, yet "I DO like her" is also pretty common.   One of my students asked me this and I just said it's for emphasis, but I can't figure out whether it's just colloquial usage or if there's an official rule for it.

This morning I read this sentence (see ):     On July 24th and again on July 29th,   Egyptian police did shoot dead unarmed   African migrants attempting to cross   that border.   Why "did shoot" and not "shot"?


I am working on a test assignment where i have to take name and phone number from the user ans save them to the arraylist. I created three classes    Contacts: to store contact details.  MobilePhone: to store the contacts objects.  Mobilemain : begins program execution.   Following is the content of the classes:   Contacts.java      package mobilephone;      public class Contacts {     private int number;     private String name;      public Contacts(String name,int number ) {         this.name = name;         this.number = number;     }      public int getNumber() {         return number;     }      public void setNumber(int number) {         this.number = number;     }      public String getName() {         return name;     }      public void setName(String name) {         this.name = name;     }  }   MobilePhone.java  package mobilephone;  import java.util.ArrayList;  public class MobilePhone {     private ArrayList<Contacts> phonebook = new ArrayList<Contacts>();      public void addPhone(Contacts contact) {         phonebook.add(contact);     }      public void showContacts(){         for(int i=0 ;i< phonebook.size();i++){         System.out.println(phonebook.get(i).getName()+" => "+phonebook.get(i).getNumber());         }     }   }   Mobilemain.java  package mobilephone;  import java.util.Scanner;  public class Mobilemain {     static Scanner scanner = new Scanner(System.in);     static Contacts contacts;     static MobilePhone mobilephone;     public static void main(String[] args){         addContact();                mobilephone.showContacts();     }      static void addContact(){         System.out.print("Enter name: ");         String name= scanner.nextLine();         System.out.println("Enter phone number");         int number= scanner.nextInt();         mobilephone.addPhone(new Contacts(name,number));      }   }   But on executing the  main class i am getting below error.  Enter name: fgsdg Enter phone number 234234 Exception in thread "main" java.lang.NullPointerException     at mobilephone.Mobilemain.addContact(Mobilemain.java:19)     at mobilephone.Mobilemain.main(Mobilemain.java:10)   I verified that the object i am passing at line 19 in Mobilemain.java is not null

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 am trying to understand whether the limit infimum of a set is related or a generalization of the limit infimum of a sequence of real numbers. Suppose that $X_n$ is a sequence of sets, and so the limit infimum of $X_n$ is defined as saying that from some stage onwards, all of the $X_n$ occur.   Concretely:  $$ \liminf_{n \to \infty}X_n = \bigcup_{n=1}^{\infty}\bigcap_{k\geq n}X_k $$  Now, suppose that we let $X_n(\omega) = (-1)^n$ and let $X(\omega) = 1$. Then, we have that:  $$ \liminf_{n \to \infty}X_n = -1 $$  Here it appears that after some time, only $-1$ occurs. But, I know that both $1$ and $-1$ alternate, and so there shouldn't be a time after which $-1$ only occurs.   I am wondering if I am somehow confusing something here between the limit of sets and the limit of a sequence? It also seems that the definition of the limit infimum/supremum of sets has no direct connection to that of a sequence and is an arbitrary definition. Am I wrong here?

I am reading a book on probability theory and I have troubles understanding why the following holds  $$    \sup_{k \ge n} A_k = \bigcup_{k\ge n} A_k $$  $$ \inf_{k \ge n} A_k = \bigcap_{k\ge n} A_k $$  I know how to define infimum and supremum, but I have troubles proving the above expressions. Unfortunately, the book states those expressions as a definition without proving them. A graphical explanation in terms of a Venn diagram will be very helpful.  Thank you in advance


When right clicking my hard drive in This PC, there is no Eject option on the context menu. Also the Eject button on the ribbon toolbar is greyed out so it won't let me click it. It only appears in safely remove hardware. How do I  get it back so it appears?

When I plug in my external hard drive (again, NOT USB stick), and right click on the icon in This PC, there is no option to eject the drive.     There is a system tray option to "safely eject" it, but that doesn't work at all.     The only way for me to remove it at the moment is to shut down the PC.   I am not looking for a third party solution (cuz they don't work anyway - I've tried a range: Unlocker, the Quickandeasysoftware one, etc..). I've also disabled drive indexing.  And before you mark this as a duplicate almost ALL of the internet / SU articles are either on USB sticks, or on this shutdown method (e.g. )  I just want to know if this is possible (it should be right?), and if so how.


Currently, I'm using Windows 7 as my Operating System. But I want migrate from Windows to Ubuntu totally. So, I want to fresh Install an Ubuntu OS.  My laptop (ASUS X453MA), has a Bay Trail proccesor. I'm using a flashdisk to install the Ubuntu.  When I reboot my laptop, the Ubuntu 19.10 on my flashdisk is working perfectly. It show Ubuntu loading screen, and of course I can try Ubuntu for some seconds.  Yes from some seconds, and the problem is, when I try Ubuntu for a minute, it keep freezing randomly. Even when I tried to install, it keep freezing at select keyboard or partition steps.  As  say, it causes Bay Trail affected by c-state bug. And the solution is set intel_idle.max_cstate=1 in GRUB.  What I'm asking is, Is possible my Laptop using Ubuntu? How to set the intel_idle.max_cstate=1 while I'm trying to install Ubuntu?  I'm totally new to Ubuntu / Linux.

My system freezes completely at random, frequent intervals. I started to have the same problem in Ubuntu 14.04 but after recent upgrade to 16.04 there is no improvement, in fact it seems worse.  When it happens, it's impossible to do anything. I've tried everything in this thread:  but nothing works, I have to hard reset. I have read all the system logs and journalctl but there is never any information that could help diagnose the problem.  This is a dual-boot system with Windows 10 and there's no problem there, so it's not defective hardware.  My laptop has an Intel Bay Trail processor (Pentium N3540)


So I'm taking an online Java course and the task is as follows:  In this program we are going to practice using the Math class by computing some important values on the unit circle. Starting at 0 and going up by  PI/4 radians (or 45 degrees), print out information of the format below.      Radians: (cos, sin)     0.0: 1.0, 0.0     0.79: 0.7, 0.71     1.57: 0.0, 1.0     2.36: -0.71, 0.7     3.14: -1.0, 0.0     3.93: -0.7, -0.71     4.71: 0.0, -1.0     5.5: 0.71, -0.71   Hint: You’ll need to use the Math.sin, Math.cos methods  and the Math.PI constant!  You’ll also need to loop from 0 to 2*PI  Here is what I came up with:      public class UnitCircle extends ConsoleProgram     {         public void run()         {             System.out.println("Radians: (cos, sin)");             for(double count = 0; count <= Math.PI * 2; count += Math.PI / 4)             {                 System.out.println(count + ": " + Math.cos(count) + ", " + Math.sin(count));             }         }     }   However when I run it, this is what I get:      Radians: (cos, sin)     0.0: 1.0, 0.0     0.7853981633974483: 0.7071067811865476, 0.7071067811865475     1.5707963267948966: 6.123233995736766E-17, 1.0     2.356194490192345: -0.7071067811865475, 0.7071067811865476     3.141592653589793: -1.0, 1.2246467991473532E-16     3.9269908169872414: -0.7071067811865477, -0.7071067811865475     4.71238898038469: -1.8369701987210297E-16, -1.0     5.497787143782138: 0.7071067811865474, -0.7071067811865477     6.283185307179586: 1.0, -2.4492935982947064E-16   What's up with that? Could it be that I need to limit the calculations to round to 2 decimal places? What else am I doing wrong? Any help would be greatly appreciated.

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


We know that the order of an element in a finite group must divides the order of the group by Lagrange theorem. Is the converse true ? How do we prove it. I know that the converse is true for nilpotent groups.

Can a kind algebraist offer an improvement to this sketch of a proof?     Show that $A_4$ has no subgroup of order 6.     Note, $|A_4|= 4!/2 =12$. Suppose $A_4>H, |H|=6$. Then $|A_4/H| = [A_4:H]=2$. So $H \vartriangleleft A_4$ so consider the homomorphism $\pi : A_4 \rightarrow A_4/H$ let $x \in A_4$ with $|x|=3$ (i.e. in a 3-cycle) then 3 divides $|\pi(x)|$ so as $|A_4/H|=2$  we have $|\pi(x)|$ divides 2 so $\pi(x) = e_H$ so $x \in H$ so $H$ contains all 3-cycles but $A_4$ has $8$ $3$-cycles $8>6$, $A_4$ has no subgroup of order 6.


I am planning to fly from Delhi to Dublin-Ireland, transit will be at Istanbul for about 4 hrs.   Do I need transit visa for Istanbul?

I have an Indian passport and am planning to visit Germany with a valid visa. To book a flight for Germany (Mumbai – Dusseldorf), I came across some connected flights that stop at Istanbul.  Do I need to have visa for Turkey?  This is the first time I am travelling outside my country, and any information on this will be helpful.


I will be applying for PhD positions in the UK. I have three years of previous research experience, and I worked with four professors who could write me recommendation letters.  I will be applying to many schools, so I would like to ask a recommendation letter from all of the professors.  My other primary advisor came from a different culture, and it was occasionally very difficult to work with him. He was sometimes very upset, and so was I, but things never escalated into anything horrible. He moved away about 1.5 years ago; we departed in good spirit. I have been contact with him after that. It is difficult to guess how he sees things at the moment. I appreciate him in many ways but I don't know if he knows that. I think he is a good person.  Should I ask a recommendation letter from him? Most schools ask for 2-3 recommendation letters, so I would not send it to every place I apply to.  (Academically, my performance is very good. I have received big prizes, have a good publication record, etc.)

How essential is having my advisor's letter for post doc application?   I had a pretty bad relationship with my advisor for more than 4 years since I joined his lab and sometimes the relationship feels like slow inflammation that can easily flare up. We had very different opinion on how I want to approach my thesis and we argue very often on the experimental approach and the angle of attack. After that, he turned passive aggressive and completely hands-off. I noticed that he started slow to response to my email and given me very small amount time for meeting in comparison to other people in the lab. However, I proved to him that my approach was right and wrote the full paper myself and got published.   Recently, I got contact by a post doc employer who interested in my own work and request letter of recommendation. I asked my advisor for letter and he told me that I should write my own from which he can modify. I feel this is quite strange as he had wrote for all the other people in the lab, including a departing post doc who is currently interviewing for job. He told me he had done the same for other people but obviously he lied to me.   I further asked if he can provide me a copy of a completed version of the recommendation but he refused.   My question is should I still trust him to write my letter and is it essential? This post doc position is a great opportunity for me and either way I do is a big gamble.  Update: I decided to let my advisor wrote a letter for me and I think I may have made a big mistake. Since he wrote my letter, I asked the post doc lab head if my letter is completed and I no longer be able to hear back from him. Before that, he was quick to response to my email and showed great enthusiasm. As an insurance, I use one opportunity I have less desire to as bait to test the water and I still have one more shot at another position I really want.  Now, I'm thinking requesting open letter from advisor from now on for any future position or use letter service to check the letter.   Any suggestion? Thanks.  update: Great news! Got interviewed and offered at top ones! Thanks everyone!


I am new to java. I have been trying to connect from intelliJ using to postgresql using pgadmin4  I have tried to create a table and it was created but when I am trying to insert data using prepared statement it is giving me an error about nullpointerexception. I understand that it is because something is null but i can't seem to figure out what is null. The error seem to be at the prepared statement  here is the code:   package Datatypes1;  import java.io.IOException;  import java.sql.*;  import java.sql.SQLException;  import java.util.Scanner;    public class Database2 {     Scanner input = new Scanner(System.in);      public static void main(String args[]) throws IOException {       char ans;       System.out.println("Welcome tp the coffee shop management system");       Database2 database2 = new Database2();       database2.connect();       database2.createTable();       do{         database2.obtaindata();         System.out.println("Do you want to enter more data:y/n?");         ans =(char) System.in.read();       }while( ans == 'y');        database2.disconnect();    }  //create the connection String url="jdbc:postgresql://localhost:5432/dreamhome1"; String user = "postgres"; String pass = "postgres";   //database variables Connection con = null; ResultSet rs = null; Statement stmt = null;    //connect with the database public void connect(){     try{         //open connection         con=DriverManager.getConnection(url,user,pass);          //show that is it connected         System.out.println("Connection successful");      }catch(SQLException e){         e.printStackTrace();     } }  //create table in the database public void createTable(){     try{         stmt=con.createStatement();         String sql="CREATE TABLE IF NOT EXISTS product (product_id SERIAL PRIMARY KEY NOT NULL,"+                 "product_name VARCHAR(100) NOT NULL,"+                 "product_price REAL)";         stmt.executeUpdate(sql);         System.out.println("table created successfully!");         stmt.close();     }catch(SQLException e){         e.printStackTrace();      } }  public void obtaindata(){     System.out.println("enter the data you want to insert");     System.out.print("Product Name");     String productname=input.nextLine();     System.out.println("Product Price");     Double productprice=input.nextDouble();     Database2 database2=new Database2();     database2.insertRecord(productname,productprice);  }   public void insertRecord(String prodname,Double prodprice){     try{          PreparedStatement st=con.prepareStatement("INSERT INTO public.product(product_name,product_price) VALUES (nextval('productid_sequence'),?,?)");         st.setString(1,prodname);         st.setDouble(2,prodprice);         int i =st.executeUpdate();         st.close();     }catch(SQLException e){         e.printStackTrace();     } }  //disconnect with the database public void disconnect(){     try{         if(con != null){             con.close();         }          if(stmt != null){             stmt.close();         }          if(rs != null){             rs.close();         }      }catch(SQLException e){         e.printStackTrace();     }  }  }   here is the error:  Welcome tp the coffee shop management system Connection successful table created successfully! enter the data you want to insert Product Name latte Product Price 2.40 Exception in thread "main" java.lang.NullPointerException     at Datatypes1.Database2.insertRecord(Database2.java:80)     at Datatypes1.Database2.obtaindata(Database2.java:72)     at Datatypes1.Database2.main(Database2.java:15)


We have noticed when the main part of our company name is searched in Google (Premier Disability) it shows 3-4 of our pages on the very top (home, contact us, current clients, about ssdi). However, when we search using a longer and more specific version of our name (Premier Disability Services or Premier Disability Services, LLC) it only displays 1 page (home page). When searching these terms we used Chrome desktop in incognito mode.   Most searches for our company are using "Premier Disability" and not our longer version. However, we're interested in seeing why more of our pages don't show when searching a more exact term of our name. I know this is a bit nebulous of a question but any help would be appreciated.

My website used to have sitelinks and now it doesn't. It's very possible that it's due to changing the website to a sidebar design instead of having an "interstitial" type landing page which limited the number of choices, but I'm not sure.  Here is how sitelinks might look for a site:    What are some things that I can do to improve my chances of getting sitelinks?


I am rendering with GPU and sample rate is 300 [no ambient occlusion] But i am getting too noise and fog type things here in this image you can see. can you please tell me the best rendering settings for this types of render. also a tutorial about to nice studio light setup.

I know that this question is a bit old or maybe overdone, but I'm running the latest edition of Blender and when I use the Cycles engine I get really fuzzy results and I can't find a simple, non-compromising solution to the quality.  I don't know exactly what I'm doing wrong here, but I'm sure others share my frustration.  Leaving everything in default settings, I started a new project and switched to the Cycles render.  I duplicated the cube and set colors for two Diffuse BSDF shaders, then went ahead and made walls and a floor all sharing the same diffuse shader.  I made two windows to emit blue light.  The screenshot has gaps between the walls because of the setup:  I'm aware that it's considered very incomplete and many have come to terms with some amount of noise, but is this normal?  Furthermore, with default settings or not, I can't change the amount of noise produced.  Supposedly, using "progressively refine" in the rendering tab should make it refine itself indefinitely, however Cycles only counts to 10 refines and then stops, creating a render which is a pixel-perfect match of the ordinary rendering method when it's completed.  I understand that there are tricks that can be used to reduce noise, but at the cost of extra processing time and usually small quality conflicts, like blurring.  My question essentially boils down to is this Cycles' current limit?


I'm somewhat new to network interfaces and I'm confused with the difference between the 4 terms. I've seen the related question here: , but this discusses the difference between all of the above and NetworkManager. I'm looking for something more specific between the 4 terms above.  I know that interfaces refers to the file at /etc/network/interfaces but all I see there is the lo interface. I would assume that I would see wlan0 and eth0 over there as well, as when I call ifconfig. I also know that the lo interfaces is activated by ifup -a at boot time.  Looking forward to your explanations.

Ubuntu seems to provide at least two network "toolsets" (for lack of a better term). I'm running into conflicts between these two.    Something which is more like the  (e.g. ifconfig, 'ifup',    I am often running into conflicts between these different sets of tools. For example, I'm running Ubuntu Desktop at home and I'm using software like KVM/libvirt which recommends that I , but disabling Network Manager causes other things to break.  What is the difference between Network Manager and the traditional network tools? Can these two suites run side-by-side or must I stick with one or the other? Is there a document which summarizes the difference between these different tools? I have been unable to find one.  (Forgive the vagueness of this question. I've searched and searched for an answer, but I have only found many vague answers which don't seem relevant to Ubuntu 10.04/Lucid, and I may not fully understand the purpose of NetworkManager. However, this seems to be a frequently asked question. If you have advice for clarifying this question, please post a comment.)


I'm trying to programmatically model a damped harmonic spring for use in mobile UI animations (physics isn't my background, please pardon any misconceptions).  Having derived the parameters for the general case equation, I can iteratively calculate values until I reach a suitable threshold, though because this is bound to "simple" C math trig and exp functions on the CPU, the 4000-some-odd steps can cause about 0.25 seconds on slow devices lag while it calculates. I'd like to speed this up using my platform's super-optimized vector and BLAS/LAPACK functions.  The requirement for doing this is precalculating the number of steps necessary to reach my threshold value.  In the underdamped case, where the roots of the characteristic function of the differential equation are non-real, I can use algebraic tricks to get my values:  $$x(t) = c_{1}e^{r_{1}}\cos(i_{1}t) + c_{2}e^{r_{2}}\sin(i_{2}t)$$  (Given $r_{1}$, $i_{1}$, $r_{2}$, and $i_{2}$ are the real and irrational components of my two roots, respectively.)  Knowing that $r_{1} = r_{2}$ and $i_{1} = -i_{2}$, I can simplify to:  $$x(t) = c_{1}e^{r_{1}}\cos(i_{1}t)$$  And get my desired value of $t$ for my threshold $a$:  $$t = \arccos(a / c_{1} / e^{r_{1}}) / i_{1}$$  When the roots are real, the equation is a lot simpler:  $$x(t) = c_{1}e^{r_{1}} + c_{2}e^{r_{2}}$$  But I don't have my trig functions floating around to help me solve it (even if I did, the irrational components being 0 would cause problems, of course).  Take the concrete example on pages 3-4 of  (my bible during this process), since they at least solve cleanly:  $$x(t) = 1.5e^{-t} - 0.5e^{-3t}$$  I know how I would solve for $t$ to get my for when $x(t) = a$ on paper, by setting $x=e^{t}$, solving, and back substituting, but I don't have that luxury here.  How would I go about solving for my threshold value in this (supposedly) simplified case?

(A kind soul at  suggested I post here as well, sorry if out of bounds.)  I'm trying to programmatically model a damped harmonic spring for use in mobile UI animations (physics mathematics isn't my background, please pardon any misconceptions).  Having derived the parameters for the general case equation, I can iteratively calculate values until I reach a suitable threshold, though because this is bound to "simple" trigonometric and $e^{x}$ functions on the CPU, the 4000-some-odd steps can cause about 0.25 seconds lag on slow devices while it calculates. I'd like to speed this up using my platform's super-optimized vector and BLAS/LAPACK variants.  The requirement for doing this is precalculating the number of steps necessary to reach my threshold value.    In the underdamped case, where the roots of the characteristic function of the differential equation are non-real, I can use algebraic tricks to get my values:  $$x(t) = c_{1}e^{r_{1}}\cos(i_{1}t) + c_{2}e^{r_{2}}\sin(i_{2}t)$$  (Given $r_{1}$, $i_{1}$, $r_{2}$, and $i_{2}$ are the real and irrational components of my two roots, respectively.)  Knowing that $r_{1} = r_{2}$ and $i_{1} = -i_{2}$, I can simplify to:  $$x(t) = c_{1}e^{r_{1}}\cos(i_{1}t)$$  And get my desired value of $t$ for my threshold $a$:  $$t = \arccos(a / c_{1} / e^{r_{1}}) / i_{1}$$    When the roots are real, the equation looks a lot simpler:  $$x(t) = c_{1}e^{r_{1}} + c_{2}e^{r_{2}}$$  However, I don't have my trig functions floating around to help me solve it (even if I did, the irrational components being 0 would cause problems, of course).  Take the concrete example on pages 3-4 of  (my bible during this process), since they at least solve cleanly:  $$x(t) = 1.5e^{-t} - 0.5e^{-3t}$$  I know how I would solve for $t$ to get my for when $x(t) = a$ on paper, by setting $x=e^{t}$, solving, and back substituting, but I don't have that luxury here.  I can make a few assumptions: the roots and constants are all real. I'm always going to be looking for the smallest, first, positive value of $t$. Obviously, the iterative solution is the simplest for this case, but in the end that would involve more steps and therefore be slower no matter what my other optimizations would be. How, then, would I go about solving for my threshold value algorithmically in this (supposedly) simplified case?  Addendum  The underdamped solution presents an extra requirement. The motion curve will oscillate back and forth a few times across the endpoint. Therefore, "first and lowest" $t$ requirement is not necessarily true. In my current, iterative code, the threshold value is both checked against the distance from the current $x(t)$ to the endpoint, as well as to the distance from the previous $x(t)$ as well to allow for a number of oscillations. This might make a more efficient solution nearly impossible.


I'm planning to do a fresh OS installation, but first I want to backup my .ssh folder in order to keep my ssh keys. Can I copy it into a usb stick and if so how can I do this? Do I need to do any extra steps in order to "restore" the ssh keys on my new installation?

I am planning to do a fresh install of ubuntu 11.10 in my system. Before that i have setuped key based ssh authentication in this machine. Is it possible to take backup of those ssh keys, so that i  can use that in my new installation. Or else i must setup keybased ssh authentication again? If i can take backup, what are the files i need to copy? Can someone explain it in detail pls. Thanks in advance.


What is the difference between UNION and UNION ALL?


I am just wondering if QGIS has anything like Esri's geodatabase versioning?

Are we planning to have in QGIS implementation of Versioning like Esri?   There is a general need for the the implementation where QGIS is used for planning and planned design in utility can be cancelled. So in a given area two user can plan and edit the existing features. If one job is cancelled, then edits don't be that job is cancelled.   Both users don't see each other work until finalised.


I have installed  Seaborn  in my machine. The Seaborn is working fine. I need to find the version of Seaborn installed. What command do I use to find the version of the Seaborn?

Is there a standard way to associate version string with a Python package in such way that I could do the following? import foo print foo.version  I would imagine there's some way to retrieve that data without any extra hardcoding, since minor/major strings are specified in setup.py already. Alternative solution that I found was to have import __version__ in my foo/__init__.py and then have __version__.py generated by setup.py.


I have tried to show that $cos(\theta)=0$ by substituting what is given into $(\vec{a}-\vec{b})\cdot(\vec{a}+\vec{b})=|\vec{a}-\vec{b}||\vec{a}+\vec{b}|cos(\theta)$ but after simplifying i get stuck at  $cos(\theta)=\frac{(\vec{a}-\vec{b})\cdot(\vec{a}+\vec{b})}{|\vec{a}+\vec{b}||\vec{a}+\vec{b}|}=\frac{(\vec{a}-\vec{b})\cdot(\vec{a}+\vec{b})}{(\vec{a}+\vec{b})\cdot(\vec{a}+\vec{b})}$

Have some  non-null $\vec{a}$ and $\vec{b}$.      I am trying to prove this to no avail:  $$||\vec{a}+\vec{b}|| = ||\vec{a}-\vec{b}|| \iff \vec{a} \perp \vec{b}$$    If we start with  $$||\vec{a}+\vec{b}|| = ||\vec{a}-\vec{b}|| \implies \vec{a} \perp \vec{b}$$  Our hypothesis is  $$||\vec{a}+\vec{b}|| = ||\vec{a}-\vec{b}||$$  Which tells us that both horizontal sides of this triangle have the same length, so we got an isosceles triangle. Not sure what to make out of that though.  Anyway, the hypothesis is equivalent to  $$\sqrt{(\vec{a} + \vec{b})\cdot (\vec{a} + \vec{b})} = \sqrt{(\vec{a} - \vec{b})\cdot (\vec{a} - \vec{b})}$$  I can't make much out of that.    A hint to begin tackling this problem would be appreciated.


I understand this:  If $\gcd(a,b)=d$ and $\gcd(ac,bc)=e$, then $d|a \Rightarrow dc|ac$ and $d|b \Rightarrow dc|bc$, so this is equivalent to multiplying $c$ by $\gcd(a,b)$.  What I don't understand so well is why the $|c|$ (absolute value). Why can't $c$ be negative?

The definition in my text reads, An integer $d$ is said to be the greatest common divisor of two non-zero integers $a$ and $b$ iff,  $d|a$ and $d|b$ and if $k$ is any other common divisor of $a$ and $b$ then $k|d$  Now here's the thing, if $d|a$ and $d|b$ then surely $-d|a$ and $-d|b$ as well, also $k|-d$ What I take from this? GCD is not unique! That is if $\mathrm{gcd}(12,8)= 4$ then by the definition, $\mathrm{gcd}(12,8) = -4$ as well. Yet I never ever seen a negative gcd. Someone please explain. Maybe, $4>-4$, and we want the "greatest common factor" so...? But that still doesn't justify the definition.