Help! I'm brand new to Ubuntu and need some hand holding. I just created a Live CD of Ubuntu and installed version 12.10 when I think I may have been better off just trying it:( I started my Ubuntu journey after reading a post that touted its diagnostics (lifehacker.com/5551188/best-computer-diagnostic-tools). I'm  hoping to get a critical look under the covers of my desktop PC (Gigabyte MB, AMD Phenom II X4 965 Processor, 4GB RAM). Some apps (Google and iTunes) are incredibly slow to start, and although I've confirmed with a separate ISO boot CD of memtest-86 that my RAM is error-free, I'm looking to learn more about this machine and why it might be running slow.  Now that Ubuntu is installed I think I need to retrace my steps, and I would like to know how to do so safely. I'm not sure I'm finding a lot of value in having another OS on my machine when all I really wanted was some dependable and free diagnostics...I'm not a heavy enough user of XP to notice its flaws, and although Ubuntu may be wonderful (and free thanks to the selfless efforts of many), it represents to me at best a learning curve with little payback if I boot to Ubuntu, and at worst an annoyance in the form of having to bypass the Ubuntu OS at start-up in favor of Windows XP (when my wife starts using this machine that will freak her out).   Furthermore, I'm gravely concerned that my partitioning activity during installation has somehow robbed me of otherwise usable space on my rather modest 200GB Western Digital drive. I did not know how to tell what the partitioning "slider" tool was going to do, e.g. how much would be allocated to Ubuntu versus XP, so I just left it set at the values shown during the install dialog (122GB on the left, 63GB on the right), hoping and thinking that the installer would automatically apportion modestly. Now my drive has only 63GB of usable space with the other 122GB used for something, which I suspect is Ubuntu).  So I'm looking for some wisdom in the following areas:  1) Does Ubuntu give the ability to critically evaluate (other than memtest) the condition of hardware as well as the overall health of a system (registry, etc etc), enabling one to intelligently diagnose and correct performance issues? If so, are these tools/utilities available WITHOUT installing Ubuntu (e.g. to those "trying" it)?  2) Is there a way to safely uninstall Ubuntu, returning the system to Windows XP only?  3) If there a way (either with or without uninstalling Ubuntu) to optimize the partition sizes of my disk, to allow for maximum availability to Windows XP  (with a modest amount allocated to Ubuntu should I choose to leave it installed)? Currently I have 122GB  used and I can say with almost 100% certainty that my sparsely populated machine is naturally consuming nowhere NEAR that amount of data...rather, I believe I "clobbered" this storage during my partitioning activity during the install.  4) If I choose (or am forced for practical reasons) to leave Ubuntu installed, is there a way to default to Windows XP at boot instead of to Ubuntu, if no keys are depressed within the allotted timeframe?  Thanks to all who offer me advice!!  Dennis

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.


#include <stdio.h> #include <conio.h> #include <math.h>    float t, delt = 0.004000,n;  printf("enter the value for t="); scanf("%f", &t); n = t/ delt; printf("n is %f",n); getch();   output: enter the value for t=1 n is 249.999985  I am expecting 250. What am I doing wrong??

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


So I'm building my first application and I want to make it so the person using the app cannot put text in any of the text boxes. Also I'd like to put some built in barriers so the program doesn't crash when they put nothing in the TextBox's.  Please help! Much appreciated!  Below is a picture.

I have a windows forms app with a textbox control that I want to only accept integer values. In the past I've done this kind of validation by overloading the KeyPress event and just removing characters which didn't fit the specification. I've looked at the MaskedTextBox control but I'd like a more general solution that could work with perhaps a regular expression, or depend on the values of other controls.  Ideally this would behave such that pressing a non numeric character would either produce no result or immediately provide the user with feedback about the invalid character.


Model: Samsung NP300 Intel HD Graphics 3000 Nvidia GeForce gt 520mx Port VGA: 1 Port HDMI: 1 OS: Windows 10  I want to connect in expanded mode (not duplicated mode). I connected both monitors to HDMI and VGA ports. Only one of the monitors is always active. If I activate another monitor, the previous monitor will fail. Is there a way to activate both monitors with this hardware? Or with the help of a converter? I tested the HDMI splitter but it only gives the same screen.

I'm getting a new Lenovo T520 with Intel integrated graphics.  Is it possible to use three screens with Intel HD 3000 (the laptop internal screen + two external screens)?


suppose i define $$C=\{ (x,y)\in \mathbb{R}^2 | x^2+y^2=1\}$$ $$A=\{ (x,y)\in \mathbb{R}^2 | x,y\in \mathbb{Q} \wedge x^2+y^2<1\}$$ and i define a graph $G= \langle C,E \rangle$ when $E$ is the set edges, and 2 vertices are connected iff the chord between them does not contain any points in $A$ (every point on the chord has at least one irrational coordinate).  i want to prove that for every countable set $B\subseteq C$ there is a point $(x,y)\in C-B $ that has an edge to any point in $B$. It feels like transfinite induction but im not really sure on how to start it  thank you!

Here's a question that I share:  Show that if $D$ is a countable subset of $\mathbb R^2$ (provided with its usual topology) then $X=\mathbb R^2 \backslash D $ is arcwise connected.


How can i make if statement with TextView which consists of any text except  month_name + " " + today + ", " + thisYear?  This is part of my code which is not working correctly:  int today = calendar.get(Calendar.DAY_OF_MONTH); datum2.setText(month_name + " " + today + ", " + thisYear);     if(today == 1 & datum.getText().toString() != (month_name + " " + today + ", " + thisYear))     {         hiddenBonus.setText("0");         hiddenCelkovo.setText("0");     }   Thank you.

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


My question is replacing Gaussian distribution with chi square distribution in following codes. So it should show a chi-square distribution instead of a normal distribution. Thanks in advance.   \documentclass{article} \usepackage{pgfplots} \begin{document}  \pgfmathdeclarefunction{gauss}{2}{% \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% }  \begin{tikzpicture} \begin{axis}[  no markers, domain=0:8, samples=100,  axis y line = none,  axis x line* = bottom,  every axis x label/.style={at=(current axis.right of origin),anchor=west},  height=5cm, width=12cm,  xtick={2.5,5.5}, xticklabels = {$$ , $$}, ytick=\empty,  enlargelimits=false, clip=false, axis on top,  grid = major  ]  \addplot [fill=cyan!20, draw=none, domain=0:2.5] {gauss(4,1)} \closedcycle; \addplot [fill=cyan!20, draw=none, domain=5.5:8] {gauss(4,1)} \closedcycle; \addplot [very thick,cyan!50!black] {gauss(4,1)};  \draw [yshift=-0.3cm, latex-latex](axis cs:4,0) -- node [fill=white] {$0.35$}  (axis cs:4,0);  \draw [yshift=+2cm, latex-latex](axis cs:2.5,0) -- node [fill=white] {$H_0$  Do not Reject} (axis cs:5.5,0);  \draw [yshift=+2cm, latex-latex](axis cs:0,0) -- node [fill=white] {$H_0$  Reject} (axis cs:2.5,0);  \draw [yshift=+2cm, latex-latex](axis cs:5.5,0) -- node [fill=white] {$H_0$  Reject} (axis cs:8,0); \end{axis}  \end{tikzpicture} \end{document}

I have tried without success to plot the curve of the chi-squared distribution. Is there a generous soul who can come to my rescue.


I know that it's possible to generate DH parameters that lead to it being easy to attack (e.g. trivial composite numbers), but is it possible to create a malicious parameter that is not a composite number (and thus passes an arbitrary number of Miller-Rabin tests) but still makes attacking the DH group easy? It should be trivial to detect if the parameters have been generated to intentionally fall victim to the small subgroup attack, and the SNFV becomes impractical with realistic key sizes.  Questions similar to this have been , but they seem to focus on composite numbers.

I know it has been already asked and answered whether .  But "recentely" we experienced the , which makes use of the pre-computation capabilities of the GNFS to quickly break many discrete logarithm problem (DLP) instances.  Now I know that the main workload of the GNFS is to do the pre-computation for the given group (more than 99% of the required workload).  Now I've asked myself: Is it possible to generate DH parameters that allow for speeding up the GNFS pre-computation given some (secret) knowledge?


Title mostly says it all. I've never had chickenpox. I was given chickenpox vaccine shots twice, once as an infant, and once at around 12-13 years old. I am now 23 years old. Am I safe? Or should I not meet this person until the other person (a 5 year old child, being cared for NOT by the person I might meet) has recovered? I'm not pregnant or otherwise in a category that should NOT risk chickenpox even a tiny bit, but obviously I'd rather avoid getting it.  I am asking both, the contagiousness of a housemate of a sick person, and whether my vaccinations are still effective (I understand it can't be 100% guaranteed).

My 21 year old son has chicken pox and has been home for a few days now. The spots are just starting to crust over.  I work with elderly people but have had chicken pox as a child - should I carry on working while he is here (hes usually away at Uni) and infectious?


How do you differentiate the integral from $e^{-x}$ to $e^x$ of $\sqrt(1+t^2)$ with respect to t?  $$   \int_{e^{-x}}^{e^x} \sqrt{1+t^2}\,dt $$  I know the answer is $$ e^x\sqrt{1+e^{2x}} + e^{-x}\sqrt{1+e^{-2x}} $$ but I'm not entirely sure how to get there. I know it involves using FTC part two to get F(b)-F(a), and I can see you plug in b and a right into the equation, but why doesn't it look like it's an antiderivative?  EDIT: forgot to change the dummy variables


Hi I recently installed Ubuntu for the first time and I am trying to install and use virtual box. I am using Ubuntu 20.04. I downloaded the deb package from the virtual-box website and installed the software. Then I tried to import a virtual machine I was using on a mac. I got the following error.  Kernel driver not installed (rc=-1908)  The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing  '/sbin/vboxconfig'  Then I ran the command /sbin/vboxconfig as root. I also turned off the UEFI from boot menu. (secure boot). Then I got the following error message. vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: You must sign these kernel modules before using VirtualBox:   vboxdrv vboxnetflt vboxnetadp See the documenatation for your Linux distribution.. vboxdrv.sh: Building VirtualBox kernel modules. debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable vboxdrv.sh: Failed to enroll secure boot key.. vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.  There were problems setting up VirtualBox.  To re-start the set-up process, run   /sbin/vboxconfig as root.  If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.  Any help on how to fix the error?

I tried to use my Virtual Box and this is the error I received - (I just updated to the new Ubuntu also) and I am VERY new at this Linux OS.     Kernel driver not installed (rc=-1908)      The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or   there is a permission problem with /dev/vboxdrv. Please reinstall the   kernel module by executing      '/etc/init.d/vboxdrv setup'      as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS   package first. This package keeps track of Linux kernel changes and   recompiles the vboxdrv kernel module if necessary.


Problem:  Title for references are formatted automatically in lower case.  Minimal Working Example:  \RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @book{RN518,    author = {Naughton, J.},    title = {What you really need to know about the Internet: From Gutenberg to Zuckerberg},    publisher = {Quercus},    address = {London},    year = {2012} } \end{filecontents}  \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[swedish,english]{babel}  \usepackage[natbibapa]{apacite} \bibliographystyle{apacite}  \begin{document}  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque varius maximus enim in scelerisque. Aliquam dictum mollis fringilla. Donec eu ullamcorper erat. Curabitur sit amet dolor eget tellus convallis rutrum consectetur elementum ligula. In a cursus magna. Maecenas nec tristique tortor. \citep{RN518}.  \bibliography{\jobname}  \end{document}   The title is:  What you really need to know about the Internet: From Gutenberg to Zuckerberg  But renders as (notice the words Internet, Gutenberg, Zuckerberg):

Titles of articles I'm about to cite contain upper case letters and when using BibTeX it converts them to lower case ones. This happens only in the title and only the first letter conserves its case. For example, when I cite an article about HF, the reader won't know if it is about Hafnium (Hf) or fluorine acid (HF).  I know that I can fix it manually in the .bbl file but I would like to avoid it, or fix it automatically.


Can I connect two external monitors to my Macbook Pro's (non-retina, mid-2012) mini displayport ? I got one mini displayport to dvi converter and dvi-male to 2*dvi female splitter but this setup didn't work. My question is, can I use one display port to connect to two different monitors (both the monitors should be independent and not mirror)

I have a MacBook Pro (13-inch, Mid 2012) and would like to set up two 24" Acer monitors so I can have an easier working life. The monitors support CDMI, DVI and VGA, I am new to MacBooks, so I'm not sure where to go or what to do, anything you can advise will be wonderful.  Thanks in advance :)


I have tried to access an element of my Arrays.asList - List, but I get an NPE. Main Class: public class Game  {     List<Cell> cells = null;       public Game  () {         cells = new ArrayList<>();         cells.addAll(Arrays.asList(new Cell[80])); //Target: Add 80 additional list elements     }      public int getSelectedValue () {         return cells.get(10).value;   //Here I get the NPE, but I need the 10th cell     }  }  Subclass cell: public class Cell {     int row;     int col;     int value; }  How can I instance a List with many objects (100 are required) and have access to those elements with the get() operator?

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


I have quite some problems installing TeXlive on Kubuntu. I used the installation file provided by  and followed  but skipped those steps  Interfaces to the installer: text, GUI, batch   and   Choosing a download host  since I worked with  ./install-tl    Afterwards I set my PATH and tried   tlmgr update --all   as well as  tlmgr --gui   followed by      couldn't find »tlmgr«, did you mean: ...   (I don't know the English version of this). Then I thought, maybe TeXlive is not installed properly, so I tried   latex small2e   resulting in:     warning: kpathsea: configuration file texmf.cnf not found in these   directories:   /usr/share/texmf/web2c:/usr/share/texmf-texlive/web2c:/usr/local/share/texmf/web2c.   This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)      kpathsea: Running mktexfmt latex.fmt /usr/bin/mktexfmt: 975: .: Can't   open /usr/share/texlive-bin/debianize-fmtutil I can't find the format   file `latex.fmt'!   What the heck is going on. I don't have a clue. BTW I am really new to Linux.

Debian and Ubuntu have very good texlive packaging. But I'd like to use tlmgr to have a more fine-grained control about upgrades and which packages I want to be installed.   So how do I install "vanilla" TeXLive on Debian/Ubuntu?   Also how do I make dpkg aware that I have TeXLive installed?


There are a lot of spells and even weapons the have multiple damage types in the same attack. For example, Meteor Swarm has 20d6 bludgeoning and 20d6 fire damage.  Let's say an unfortunate PC gets hit with meteor swarm and has 90 max hp, he first takes the bludgeoning damage of 91 and then the fire damage of 85. does this all register as 1 hit and become unconscious or would he become unconscious from the bludgeoning damage and then take the failed death saves from the fire damage?  In short: do multi element attacks count as 1 hit or does each element count as a different hit?

Inspired by the efforts to kill a , the GM in me got in a fight with the engineer.  Per the text from Death Saves, taking damage while you have 0 hit points will cause a death saving throw failure (PHB, 197).  Of the first bullet, what qualifies as a source of damage? Specifically, how does evaluate an attack that has multiple components, such as:        An attack action that is able to take multiple attacks, each requiring an attack roll. Fighter     A spell that can produce multiple elements, each require an attack roll. Eldritch Blast, Scorching Ray      RAW, I expect each would be an independent source. As a GM, this seems overly brutal against the party, and a bit anti climatic against a non player character that has been raised to using death saves.


I often experience people who when they get to the end of what they were saying, they finish their sentence with the word "so" as if they are going to say something else, but they don't.  Example: "I asked him if he would fix my computer, but he said he didn't have time, so..."  I ran an "experiment" on a friend who does this all the time, and after he finished his sentence with "so," I didn't say anything. He acted as if he was done speaking, even though I waited for him to continue. I finally said, "So...what?" He said he had nothing else to say.  I thought to post this question here when I noticed the man in this video also finish his sentence with "so" but not have anything else to say:   (start at 1:10)  Why do people finish speaking by saying "so" when they have nothing else to say?

Sometimes when I speak with my fellows at work, I start my sentences with "so" or "um". I don't know if this a bad behavior in business speak or not? If so, how can I get rid of those filler words?


Let $X,Y$ be iid real random variables where $\ln X\sim \exp(1) $. How can I determine the cdf of $Z:=XY$? I would know how to do so for $X \sim \exp(1)$, but not sure how to deal with the $\ln.$  Some help would be much appreciated.

Let $\ln X \sim \operatorname{Exp}(1)$ and $X,Y$ i.i.d.  What is the distribution of $Z=XY$?  My attempt: $$P(Z\le z)=P(XY\le z)=P(\ln(XY)\le \ln(z))=P(\ln(X)+\ln(Y)\le \ln(z))$$  We need the convolution, since $\ln X $ and $\ln Y$ are independent we get, $$\int_0^{\ln(z)} f_{\ln(X)}\circledast f_{\ln(Y)}=\int_0^{\ln(z)}e^{-y}e^{-x+y}\,dy=e^{-x}ln(z),$$ i.e. $e^{-x}\ln(z)$ is the density of $XY$


I have a WPF application. I have written the application in MVVM design pattern & calling My main View model from App.xaml.cs.      public partial class App : Application     {       private MainViewModel myVM;       **other variables declaration...................       protected override void OnStartup(StartupEventArgs e)       {        udocVM = new MainViewModel(window, msgBoxService, udocBl, docBl);        mainWindow.DataContext = udocVM;        }     }   So I am getting Code Analysis Critical Error for this:--  MainViewModel.MainViewModel(IWindowFactory, IMessageBoxService, IBl, IDocCenterBL, AutoResetEvent)' contains a call chain that results in a call to a virtual method defined by the class.  So how to fix this issue? Do I need to move this code in Xaml code behind file (MainWindow.xaml.cs)?

I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor.   Why would this be something not to do?


In Linux. Say I want to run a command and it takes too long. I just want to ensure it's done. How?

Sometimes I want to start a process and forget about it. If I start it from the command line, like this:  redshift   I can't close the terminal, or it will kill the process. Can I run a command in such a way that I can close the terminal without killing the process?


I need to know how i can check if the folder exist, and if it does not exist, create it  For Example:  If File.Exists(File Path) Then     Else        'Create a new folder following the path(Path here) End If   And Thanks for your help.

I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with  a clean install of Windows, without actually going on the net.  Unfortunately I'm having problems creating the folder I want to put them in and am unsure how to go about it.  I want my program to download the apps to program files\any name here\  So basically I need a function that checks if a folder exists, and if it doesn't it creates it.


I want to understand the difference between the following two ways of initializing a 2-dim list in python: r1=2 c2=2  result = [[0] * r1] * c2  This makes a 2x2 list initialized with all zeros and when I write: result = [[0,0],[0,0]]  This also creates a 2-dim list initialized with zeros (is this true?) Now when I insert values in the first case, like this: r1=2 c2=2  result = [[0] * r1] * c2  for i in range(r1):     for j in range(c2):         result[i][j] = i+j     print()   print(result)  This does not insert the correct values, and rather the same values are repeated in both rows However, when I insert values like this, in the second case: r1=2 c2=2 result = [[0,0],[0,0]]  for i in range(r1):     for j in range(c2):         result[i][j] = i+j     print()   print(result)  This inserts the correct values. What is the reason of wrong values insert in the former case and correct values in the latter case? Thanks.

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


but for ubuntu 16.  I was trying to open google earth on chrome but was getting a message along the lines that I did not have any hardware accelaration.  So I followed some askubuntu questions and was able to get it working by enabling something in chrome's flags. But know I have the black bars and borders everywhere in ubuntu. Even the terminal is black and I can't see anything.  Please help

I installed or upgraded to Ubuntu 16.04, but I'm having some problems with my graphics card.   The display is blank The display flickers Items on the screen do not display correctly Certain programs complain of graphics issues The computer boots to low-graphics mode Your specific issue may not be here, but try the solutions described in the answers anyway.   This question is very broad, but each one of these issues likely has one solution.    If you are experiencing a login loop, check the last part of my answer.    If you experience one of the listed issues and have your own solution (mine didn't work, or there's a faster way), feel free to post another POLITE answer, describing your problem and how you fixed it.    Those attempting to install Ubuntu, please refer to the section titled: If you are unable to enter a TTY or are trying to install Ubuntu.


How to prove that for $m>2$ $$\sum_{k=1}^m \cos^2\left(\frac{2 \pi k}{m}\right) = \frac{m}{2}.$$  This could be useful for me solving a Differential Geometry problem. And Wolfram Alpha says it's true. But i can only be certain with a proof

I've tried solving it, but I'm not familiar with these kind of progressions and I couldn't get to a result. Also, I've found that the result is just $N/2$, but I don't get why would that be the answer, as it doesn't work for $N=1$ or $N=2$. Appreciate your help :)


If a group $G$ has no nontrival proper subgroups, prove that $G$ is a cyclic group with order $p$, where $p$ is a prime number.

If $G$ has no proper subgroup, prove that $G$ is cyclic of order $p$, where $p$ is a prime number.     I know that since $G $is a group with no proper subgroups, $g \in G$ is not just the identity. I don't know where to go from there.


I am trying to figure out why 32 bit apps are being installed on Windows 8 64 bit. On my wife's PC, there are a number of 32 bit versions of popular applications that are installed where I would expect 64 bit versions to be used. How does a download page determine which version of Skype, for example, gets downloaded? Same problem with MS-Office and a few others.

Why are some processes in Windows 8 32-bit? For example: I have the 64 bit version of iTunes, but it is a 32 bit process(in Task Manager). Why is this so?


To be recognized in the Saddle River Donors List and help the Saddle River community, please include your tax free donation:   Should it be Donors or Donor?

When should a noun that’s used attributively to describe another  noun be plural, and when should it be singular?  And when should it be possessive, like baker’s dozen and when should it be plural possessive, like farmers’ market?  In other words, why do we say teachers union rather than teacher  union?  And why do we say wedding planner rather than weddings planner?  Which of these variants is or are correct?        student union   students union   student’s union   students’ union      What about community values versus community’s values?  Please note I am looking for a general rule or at least some tips.  These are only examples.  Update: It seems even native speakers follow their personal  style to write such compound words. I wonder why in the IELTS listening section, the language learner has to write a specific form and there is no rule for this.


I'm trying to write section numbers to a file with the newfile package. In details, this MWE basically tries to write to a .ref file with lines like A-B. The A and B are generated by \label and \ref commands: if \ref{A} is written in section 2 and \label{A} is defined in section 1, then we should write 2|1 in the file.  This example actually fails to expand the \ref command, probably due to the insertion of the hyperref package, which makes \ref robust. How can one avoid this?  \documentclass{article}  \usepackage{newfile} \newoutputstream{refFile} \openoutputfile{\jobname.ref}{refFile}  \let\oldref\ref \let\oldAutoref\autoref \usepackage[linktoc=all,backref=page]{hyperref}  %%  %% Write SRC-DST of \ref to file %% \newcommand{\myref}[1]{%     \def\val{\thesection|\ref{#1}}     \addtostream{refFile}{\val} }  %%  %% Redefine \autoref %% \let\oldAutoref\autoref \renewcommand{\autoref}[1]{%     \oldAutoref{#1}     \myref{#1} }  \begin{document}  \section{S1}\label{sec:one} \autoref{sec:three}  \section{S2}\label{sec:two} \autoref{sec:one}  \section{S3}\label{sec:three} \autoref{sec:two}  \closeoutputstream{refFile}  \end{document}   The current content of the .ref file is  1|\ref {sec:three} 2|\ref {sec:one} 3|\ref {sec:two}   but I would like the expansion of the \ref to give:  1|3 2|1 3|2

I'm editing a book that includes about 25 papers written in LaTeX by different authors.  Since many of them use the same \label, to avoid collisions I redefined the \label command (and \ref and \pageref and \cite and \bibitem)  so that if the third paper has  \label{main_theorem} the aux file actually uses the tag "iii:main_theorem", and \ref{main_theorem} actually refers to the same tag.  I did a similar thing for \cite and \bibitem.  %*************** bib/cite hacks \let\TheReal@citex=\@citex \let\TheReal@bibitem=\@bibitem \let\TheReal@lbibitem=\@lbibitem \gdef\@lbibitem[#1]#2{\TheReal@lbibitem[{#1}]{#2\roman{chapter}}} \gdef\@bibitem#1{\TheReal@bibitem{#1\roman{chapter}}} \gdef\@citex[#1]#2{% \toks@={}\count@=0% \@for\@citec:=#2\do{% \advance\count@ 1 \ifnum\count@=1\edef\0{\the\toks@\expandafter\expandafter\noexpand\@citec\roman{chapter}}% \else\edef\0{\the\toks@,\expandafter\expandafter\noexpand\@citec\roman{chapter}} \fi% \toks@=\expandafter{\0}}% \TheReal@citex[#1]{\the\toks@}% } %************** label/ref/pageref hacks  %%%%%%%%%%%%% must be before ams pkgs \let\TheRealLabel=\label \let\TheRealRef=\ref \let\TheRealPageref=\pageref \gdef\label#1{\TheRealLabel{\roman{chapter}:#1}} \gdef\ref#1{\TheRealRef{\roman{chapter}:#1}} \gdef\pageref#1{\TheRealPageref{\roman{chapter}:#1}}   This all worked fine until I used hyperref, which seems to ignore the redefinition of \label, whether I load it before or after the above code.  Any suggestions?  It would be nice if the redefinition would work whether or not hyperref was loaded, so I don't want to just grab the defintion of \label out of the package and tweak it.  I'm also open to alternative methods.  Redefining \label and \ref just seemed the most straightforward (to me) solution.  Note that I also want to be able to refer to the inner labels from outside, as well.  For example, I might want to say "the main theorem of the third paper is  \ChapRef{iii}{main_theorem}  from within the introduction (a different chapter).


So before dealing with some software to repair my registry, I created a backup to it (simply by exporting the existing one), as I should have, and couple of days later, I decided to use my registry backup file, and that for some reason changed my password and even removed my PIN code...  I've also created a restore point in case I'll need one, but I guess it's not possible to access it without a password with windows 10.  I also have no windows CD because I received my laptop with an installed one so I can't use that method.  Is there any way to make a system restore/system reset without a password on windows 10? Even access to CMD would help.  Edit:  So I've decided to install new windows 10 since I wasn't able to gain access...neither using system restore worked.  Is there any way I can access the old windows using this 1?

I got a brand new Windows 7 machine, installed the operating system, created one account and forgot its password. What can I do?  There is no external CD, the operating system is loaded from somewhere inside the machine.  I already tried to remember passwords and tried all candidates with all possible combinations of caps lock, num lock etc.


I have a file. I want to select the lines that does not start with www. and does not contains slashes. I want to output the result into result.txt  To achieve the first requirement:   grep -v '^www\.' myfile.txt > result.txt.   To achieve the second, I will take result.txt and execute:  grep -v '/' result.txt > result2.txt   Is there any better shorcut to execute several commands on the file and store the result into one output file: result.txt  I am aware of | to execute several commands where the output of the command on the left of | is input of the command in the right of |. What I do not know is, in case of grep or any other command, should I use the file name in the command on the right of |. In other words, should it be:  grep -v '^www\.' myfile.txt | grep -v '/' > result.txt   OR  grep -v '^www\.' myfile.txt | grep -v '/' mfile.txt > result.txt

I would like to get the multi pattern match with implicit AND between patterns, i.e. equivalent to running several greps in a sequence:  grep pattern1 | grep pattern2 | ...   So how to convert it to something like?  grep pattern1 & pattern2 & pattern3   I would like to use single grep because I am building arguments dynamically, so everything has to fit in one string. Using filter is system feature, not grep, so it is not an argument for it.    Don't confuse this question with:  grep "pattern1\|pattern2\|..."   This is an OR multi pattern match.


Which architecture os do I use? I have a 32-bit processor, but I also have 4GB of RAM, the download page says the 32-bit system is for computers with less than 2GB of RAM.

What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.  If so, why not promote 64-bit over 32-bit?


We had this situation come in a game last night, and I wanted to make sure that we played it correctly and that I understood the rules.  Player A had an  in play. During this turn, he cast an . He then ended his turn. During the upkeep of his next turn, he targeted the Javelineers with the Free-Riders' ability and then responded by tapping the Javelineers to use their ability.  By my understanding, the Javelineers ability would resolve first and he'd get to do a point of damage. Then the Free-Riders' ability would resolve, returning the Javelineers to his hand, and allowing him to cast them again. That seemed to be within the rules.  However, I wasn't sure when the Javelineers' summoning sickness wore off. Does it wear off in time for him to use this ability before they get returned to his hand by the Free-Riders?

Note: this is intended to be a canonical question about summoning sickness.  "Summoning sickness", broadly, is the rule that stops you from attacking or paying {T} costs with a creature that you just played. But how exactly does it work? How does it interact with other rules and effects?  For example, if I'm trying to figure out how a creature is affected:   Does the status matter (tapped/untapped, face down/face up, etc.)? What if it came into play, but I didn't cast it? What if it's a token? What if it was on the battlefield when my turn started, but it wasn't a creature? What if it stops being a creature? What if it's a creature and also another card type? What if it's a double-faced card that just transformed? What if it changes control? What if it's a copy of another creature? Which of the creature's activated abilities can I use? Are any of its other abilities affected? Can I tap the creature to pay a cost that is not a {T} cost?   (These examples are primarily taken from questions about summoning sickness that have already been asked on the site)


I have a funny situation where I am unable to add custom highlighting definitions to my nano text editor.   The funny thing is that the predefined work like a charm and can be edited.  But I have created a new one for js with  $ sudo touch js.nanorc $ sudo nano js.nanorc   my current js.nanorc looks like this:  syntax "JavaScript" "\.js$"  color blue   "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>" color blue   "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" color blue   "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" color brightblue "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" color black    "[(]" color cyan  "\<(break|case|catch|continue|default|delete|do|else|finally)\>" color cyan  "\<(for|function|get|if|in|instanceof|new|return|set|switch)\>" color cyan  "\<(switch|this|throw|try|typeof|var|void|while|with)\>" color cyan  "\<(null|undefined|NaN)\>" color brightcyan "\<(true|false)\>" color green     "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>" color green     "\<(Number|Object|RegExp|String)\>" color red "[-+/*=<>!~%?:&|]" color magenta   "/[^*]([^/]|(\\/))*[^\\]/[gim]*" color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'" color magenta   "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]" color brightblack "(^|[[:space:]])//.*" color brightblack start="/\*" end="\*/" color brightwhite,cyan "TODO:?" color ,green "[[:space:]]+$" color ,red "    +"   If anyone can see the problem then please tel me

Can nano do syntax highlighting like gedit and vim? How can I enable it? I need at least bash and python syntax highlights.


I was wondering about this for a while now.  Since people really only gain reputation and don't really lose it over time (barring extreme cases), will the various reputation levels stay consistent or will they move? Will an upvote always be 10 points and a downvote 2?  Since there is no real 'sink' to take reputation away, everyone will eventually have tons of it and everyone will be a 10k+ moderator. What will be done to prevent this? Or is this the ideal?

Overall reputation scores are headed nowhere but up.  Pretty soon there will be thousands of mods.  What to do?  Thoughts on possibilities:   Thousands of mods is fine.  Carry on. Adjust the threshold values for high-level SO privileges. Do a straight-up inflation adjustment.  You had x rep, then at the turn of the year we applied the Consumer Rep Index to all scores, now you have (x / inflation) rep. Implement a rep decay mechanism, so that inactivity sheds some of the overall rep that's built up.


Here I got  public class Planet {      ArrayList<Person> person  = new ArrayList<>();     Iterator<Person> itr = person.iterator();      public String getFemaleName()     {          for (int a = 0;a < person.size();a++)         {             if (person.getGender == "female")             {                 return person.get(a).getName();             }         }     } }   Now I'm having 2 problems, 1st is i just want return female's name,but it seems I have to return something even there is no female in my ArrayList. 2nd is how to use an Iterator instead of using a for loop.

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


After getting "can not write bytes : broken pipe" message and being unable to boot, I reloaded 12.04, my user name had some upper case letters in it and I was unable to log in.  Maybe the password changed also.  How can I log in and reset my password and user ID ?

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


In HP, I don't understand why Muggles accept that Hogwarts, or really any part of magic, is real, much less send their kids to Hogwarts. As it says in P/SS:      “Nobody in my family’s magic at all, it was ever such a surprise when I got my letter, but I was ever so pleased, of course, I mean, it’s the very best school of witchcraft there is, I’ve heard – I’ve learnt all our set books off by heart, of course, I just hope it will be enough – I’m Hermione Granger, by the way, who are you?” - Philosopher/Sorcerer's Stone, Chapter 6, The Journey from Platform Nine and Three-Quarters   Here, Hermione says that she (and presumably her family, since they let her go to Hogwarts) was "ever so pleased" to find out she was magical. However, how do the Muggles believe this? How can they simply just read a letter, assume that the magical world they are not allowed to interfere in is real, and send their child to a school in the magical world?

This is left vague in the books, but I can’t imagine parents sending their children off to a school they know nothing about. Do you think they’re well-informed, or told just a bare minimum, or are they outright lied to?


I'm using an algorithm with recursion to calculate 30 perfect numbers, but only calculates the first 4 and then the program throws an error.    public class PerfectNumbers {   /**   * @param args the command line arguments   */   public static void main(String[] args) {     getPerfectNumbers(1,1);   }    static void getPerfectNumbers(long out,long number) {     long total = 0;     if(out==30) {       return;     }     for ( int i=1;i<number;i++) {       if(number%i==0) {         total+=i;       }     }     if(total==number) {       System.out.println("Perfect Number "+number);       out++;     }     number++;     getPerfectNumbers(out,number);     } }   What's wrong with the algorithm?

What is a StackOverflowError, what causes it, and how should I deal with them?


Is there any way to find out when a table was created in PostgreSQL or Greenplum, other than finding the underlying table and looking at the OS creation timestamp?

I've recently finished a project, during which many DB tables were created.   Most of these tables contain temporary garbage, and I am looking for a simple way to list all these tables.  Is there a way to list all DB tables sorted according to their creation date?


This picture was on my Windows 10 lock screen and I can't find any information.

Windows 10 has an extensive collection of lock screen photos, many of which have  here on Travel.SE.  Is there a website which lists the location of all of these photos? I imagine Microsoft has purchased an official license, so they should have a record about the photographer and the place where the photo was taken.


Hi i am working on javascript and here i am working on sum of float numbers but i am getting wrong result   var studentsList = [   { name: 'A', rollNo: 1, mark: "6.75" },   { name: 'B', rollNo: 2, mark: "3.5" },   { name: 'C', rollNo: 3, mark: "4.25" },   { name: 'A', rollNo: 1, mark: "3.5" } ];  var byName1 = {}; for (var student of studentsList) {   if (student.name in byName1) {     byName1[student.name].mark += parseFloat(student.mark);   } else {     byName1[student.name] = { ...student };   } } console.log(Object.values(byName1));    But the actual result is 10.25. How to do it? TIA.

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


I have a function1 that takes whatever parameters you give it and display it:  void function1(string a){     std::cout << a; }  void function1(int a){     std::cout << a; }  void function1(double a){     std::cout << a; }  void function1(char a){ cout << a; } void function1(float a){     std::cout << a; }   is there a way to call for a kind of universal variable so i dont need to write so much code?  Something like this:  void function1(UNIVERSAL a){     std::cout << a; }

Can anyone recommend any good resources for learning C++ Templates?  Many thanks.


// get the name of the chosen form             string myMenu = Convert.ToString(treeView1.SelectedNode.Tag);             Form frm = new Form();             frm.Name = myMenu;             frm.MdiParent = this;             frm.Show();             frm.BringToFront();  // opens a blank form and not the one in the solution.

Is there a way to create an instance of a class based on the fact I know the name of the class at runtime. Basically I would have the name of the class in a string.


I'm trying to break down a mathematic expression into pieces and I was trying to use the Regex /\([^)]+\)/ to do the trick (). But reading that answer, I understood that this Regex will be searching for the first closing parenthesis ) to finish, giving me trouble when handling, for instance:   (2*x^2 + 5*x - (2*x - 3)^(1/2))/(1 + x) ^                      ^      ^ START                IGNORE FINISH   Since I'm not really good with coming up with Regex, I'm wondering if I should handle this with strpos, substr and str_replace or is there a different Regex to apply to preg_match_all and get the correct set of parenthesis?   Note: This function will be recursive in order to solve inner parenthesis.  EDIT:   My expected output in this case:   $array = null; $expression = '(2*x^2 + 5*x - (2*x - 3)^(1/2))/(1 + x)'; $expression = str_replace(' ', '', $expression); preg_match_all('MAGIC EXPRESSION HERE', , $array); print_r($array);  // Output array(     [0] => (2*x^2+5*x-(2*x-3)^(1/2))     [1] => (1+x) )   Thanks.

Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times? For example, can a regular expression match an opening and closing brace when there are an unknown number of open/close braces nested within the outer braces?  For example:  public MyMethod() {   if (test)   {     // More { }   }    // More { } } // End   Should match:  {   if (test)   {     // More { }   }    // More { } }


In the TV series Supernatural, almost all episodes have a darkish colour scheme. The only exception is for episodes partly set in another universe, e.g. S05E08 "Changing Channels" where they brothers were put through a number of TV shows, or S06E15 "The French Mistake" where they are thrown into this world. The effect on the viewer is that the Supernatural universe is darker and "grittier" than our own (and other series).  Is there a technical or colloquial term for this effect?

I don't know if "colour template" is the word for that. What I mean is the colour of the movies, especially Globet of Fire and the ones after it, seemed to be very dark but also with so much depth to portray the evilness of the Harry Potter world. And I rarely see such a colouring in any other movies.  Is there a technical term for this kind of rendering? Do they use some special camera to achieve this result?


I want to rename all files within a directory to match the parent folder's name.  Now I've found several results that sort of do what I want, but they all seem to rely on a static filetype, path, format, etc.  I need one that takes any crazy folder name and applies it to any files within, leaving their extension unchanged. I don't want the Parent's Parent's Parent, etc. Just something I can run in a current folder to affect all sub-folders within that folder.  For example:  Folder structure  This.Is.A.Crazy.Name.S00E00.720p | | asdfasdfasdfasdfasdfasdfafs.mkv | | info.nfo | | proof.jpg | You.See.Where.This.Is.Going.14x01.480p.crappo | | video.mp4   Expected result  This.Is.A.Crazy.Name.S00E00.720p | |_This.Is.A.Crazy.Name.S00E00.720p.mkv | |_This.Is.A.Crazy.Name.S00E00.720p.nfo | |_This.Is.A.Crazy.Name.S00E00.720p.jpg | You.See.Where.This.Is.Going.14x01.480p.crappo | | You.See.Where.This.Is.Going.14x01.480p.crappo.mp4   Could anyone advise how this can be done in a script or a single, long command?

I want to rename file name with its parent folder name, adding the folder name before the current name.  for example:  Folder structure  SOCH NC KT 633-ROYAL BLUE-MULTI | | 1.jpg | | 2.jpg | | 3.jpg   Expected Result  SOCH NC KT 633-ROYAL BLUE-MULTI | |_SOCH NC KT 633-ROYAL BLUE-MULTI1.jpg | |_SOCH NC KT 633-ROYAL BLUE-MULTI2.jpg | |_SOCH NC KT 633-ROYAL BLUE-MULTI3.jpg  SOCH NC KT 710-BLACK-MULTI   Could anyone advise how this can be done in a .sh file? Is there any utility is available to do the operation?


I have a javascript array of object like this let Object  = [    {"Form Factor": "2.5 inch"},    {"Capacity": "1 TB"},    {"Memory Components": "NAND 3"} ]  i want to reduce it to just an object like this resultObject = {   "Form Factor" : "2.5 Inch",   "Capacity": "1 TB",   "Memory Components" : "NAND 3" }

I need to be able to merge two (very simple) JavaScript objects at runtime.  For example I'd like to:  var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }  obj1.merge(obj2);  //obj1 now has three properties: food, car, and animal   Does anyone have a script for this or know of a built in way to do this?  I do not need recursion, and I do not need to merge functions, just methods on flat objects.


On an exam the following question was given:  Determine the number of zeros of $p(z):= z^4 + z^3 + 4 z^2 + 2 z + 3$ in the right half plane $\{z : \text{Re} z > 0\}$.  I have a solution, but I want to know if there is a slicker way that could be done quickly on an exam.    Here is my solution:  Begin Solution  We want to apply the argument principle by integrating $\int \frac{p'(z)dz}{p(z)}$ over a large half circle in the right half plane.  We examine the image of the imaginary axis under $p(z)$.  Plugging $z = i t$ where $t \in \mathbb{R}$ we get that  $$p(it) = (it)^4 + (it)^3 + 4(it)^2 + 2it + 3 = (t^4 - 4t^2 + 3) + i(-t^3 + 2t).$$ Note that $t^4 - 4t^2 + 3$ has zeros $t = 1, -1, \sqrt{3}, -\sqrt{3}$ and $-t^3 + 2t$ has zeros $0, -\sqrt{2}, \sqrt{2}$.  With this information we can see where $p(it)$ crosses through the axis's.  As $t$ increases $p(it)$ first passes through the the positive imaginary axis, then the negative real axis, then the negative imaginary axis, then the positive real axis, then the same thing again except that the second time around the curve does not pass through the positive real axis but stays below it as $t \rightarrow \infty$.  Moreover, the ratio of the imaginary part to the real part of $p(it)$ approaches zero as $|t| \rightarrow \infty$.  Thus the argument change of $p(it)$ over the interval $[-R, R]$ approaches $4 \pi$ as $R \rightarrow \infty$.  Let $I_R = \{ it : t \in [-R, R]\}$, $C_R = \{ Re^{i \theta} : \theta \in [-\pi /2, \pi /2]\}$ and $\gamma_R = I_R \cup C_R$.  Then  $$ \int_{\gamma_R} \frac{p'(z)dz}{p(z)} = \int_{I_R} \frac{p'(z)}{p(z)} + \int_{C_R} \frac{p'(z)dz}{p(z)} = (-4\pi + o(1)) + (4 \pi + o(1)) = o(1).  $$ Where we are using the fact that  $$\int_{C_R} \frac{p'(z)dz}{p(z)} = \int_{C_R} \frac{\frac{d(z^4)}{dz}dz}{z^4} + o(1) = 4\pi + o(1)$$ which follows from the natural estimates.  Thus we can conclude from the argument principle that $p$ has no zeros in the right half plane.  End Solution  This solution is not quick and only worked because I could luckily find the zeros of the real and imaginary parts of $p(it) = (it)^4 + (it)^3 + 4(it)^2 + 2it + 3 = (t^4 - 4t^2 + 3) + i(-t^3 + 2t)$.  Is there something quicker?

This question has been asked but I am stuck with my method.   I have shown that the roots can not be on the real and imaginary axis. Since the coefficients are real and thus the roots must be in conjugate pairs. So If there is no root in first quadrant (or right half plane), then we have 2 roots in second quadrant and third quadrant respectively. (this is the answer to this question)  So I am going to show that there is no root in right half plane. Consider the integral along the semi-circle in right half plane with radius $R$  $$\int_{C}\dfrac{f'}{f}dz=\int_{-Ri}^{Ri}+\int_{-\pi/2}^{\pi/2}\dfrac{4z^3+3z^2+8z+2}{z^4+z^3+4z^2+2z+3}dz$$  For the second part, $$\int_{-\pi/2}^{\pi/2}\dfrac{4z^3+3z^2+8z+2}{z^4+z^3+4z^2+2z+3}dz=i\int_{-\pi/2}^{\pi/2}\dfrac{4z^4+3z^3+8z^2+2z}{z^4+z^3+4z^2+2z+3}d\theta=4\pi i$$ as $R\rightarrow \infty$.  For the first part, \begin{align*} &\int_{-Ri}^{Ri}\dfrac{4z^3+3z^2+8z+2}{z^4+z^3+4z^2+2z+3}dz\\ &=\int^R_{-R}\dfrac{3y^2-2+i(4y^3-8y)}{y^4-4y^2+3-i(y^3+2y)}idy\\ \\ &=\int^R_{-R}\dfrac{(3y^2-3)(y^4-4y^2+3)-(4y^3-8y)(y^3-2y)+i[(4y^3-8y)(y^4-4y^2+3)+(y^3-2y)(3y^2-2)]}{(y^4-4y^2+3)^2+(y^3+2y)^2}idy\\ &=\int^R_{-R} i(even \,\,part)-(odd \,\,part) dy\\ &=\int^R_{-R} i(even \,\,part) \,\,dy \end{align*} It is expected that $\int^R_{-R} i(even \,\,part) \,\,dy=-4\pi i$, then we are done, but how?  Also is there any method using Rouche theorem?


Now that I've installed 16.04, I'm not able to view news that require Flash for streaming on Chromium. I've installed Flash, and the plugin works on Firefox. Is there a different plugin I should try for Chromium?

I have Chromium web browser on my Lubuntu 13.04 (pre-installed).  I use LX Terminal (pre-installed) to write commands. I am trying to download flash player on Chromium using instructions on this :  sudo add-apt-repository ppa:skunk/pepper-flash   After typing in my password, this worked. Now   sudo apt-get update   I didn't need to type in my password, as I continued on the same terminal, but got W:/ and E:/ fetch file errors  sudo apt-get install pepflashplugin-installer   I continued on the same terminal despite the fetch file errors... and they said pepflashplugin-installer could not be found.  Is the last error because of fetch file errors, or because I need to download pepflash-plugin-installer somewhere? Or is it because of something else?  I cannot download the Chrome browser, and not looking to use flash player on my Firefox web browser (installed using lubuntu software center).


Is there a way to purge all packages installed via apt-get from the very moment you installed the Ubuntu OS, up till this very point?  One could call it a a "mega apt-get purge".  The purpose of this operation to clear the system of everything I've installed so far (from apt) on top of the Ubuntu OS itself. This would bring me the closer to a fresh install of a Ubuntu OS, without any added software (of course, the only thing I'll have left is to clear all non-apt software and individual files I've added, but that is of course another issue).  The reason for this operation is because this is done on a VPS machine in which I can't install and uninstall operating systems in the traditional way; I can indeed use the "rebuild" functionality of my hosting provider but I find it a bit annoying to use from personal reasons so I just want to go closest I can to a fresh install without that.  How will you do the desired "mega apt-get purge"? Thanks.

I'd like to get a list of packages installed manually by apt or aptitude and be able to find out whether a foobar package was installed manually or automatically. Is there any neat way of doing that from the command line?


I am watching a tutorial on how to UV map a model and I have this horse I created.  There should be a section named 'Surface' beneath the section named 'Preview' which is required to select the image. I have tried restarting blender and it just isn't there. I really hope that I don't have to re install blender.

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


I have an Acer Predator G3610 desktop with Windows 7 - the last computer I have without Ubuntu as either dual-boot or sole OS.  I shrunk the Windows partition so there's a good 300GB of unallocated space on the 1TB hard drive.  I popped the Ubuntu 16.04 live cd in, click Install, and get this:  16.04 install attempt:   Ubuntu detects my Win7 install but will not give me the option to install Ubuntu alongside it.  So, just for a goof, I pop in my old 14.04 live cd and get... this :    the option to install alongside Win7. What gives? And yes, I checked to make sure there wasn't any funny UEFI issue -Both liveCDs boot from BIOS just like the Windows partition.   I have half a mind to just install 14.04 and upgrade later at this point, but I'd really like figure out why 16.04 hates my Windows partition so much.

I currently have Windows 7 on my computer and I want to install Ubuntu alongside Windows safely.  Could someone please provide clear instructions?


New to all of this. Which ranges of inner tube would fit in a 29 X 1.4 SLICK MOUNTAIN BIKE TYRE WILD RUN'R? Should I also worry about valve size? If possible, can I have a good source for learning what those numbers mean?

I have 40-622 (a.k.a. 28x1.5") tires, and  offers  two different sizes of tubes - their models "17" and "19" - as applicable for that tire size.  Ok, either one would surely fit well. But apart from weight difference (150 vs. 220 grams), is there any reason to prefer one over another? Is it better to have as small & light tube as possible? Or perhaps a bit larger and heavier one would be more durable, as it wouldn't be stretched as much? Err on which side?


I'm working on a Python script that scrapes a website based on user input.  For practice, I'm using a sample website from which I am scraping data.  The issue I have is in my use of the wait(10) method.  The code reads as follows: from os import wait from lxml import html, etree import requests  def select_PA_city(self):     pa_city_list = ["Philadelphia", "Pittsburgh", "Harrisburg", "Erie", "Scranton", "Allentown"]     print("The major cities in Pennsylvania are Philadelphia, Pittsburgh, Harrisburg,"           "Erie, Scranton, and Allentown.")     city_found = False     while not city_found:         pa_city = input("Select a Pennsylvania city from this list:")         for city in pa_city_list:             if pa_city == city:                 print("You selected " + pa_city)                 city_found = True             else:                 pass         if city_found:             print("That city is one of the top 6 listed.")         else:             print("That city (" + pa_city + "} is not in the top 6.  Please try again.")             os.system.wait(10)     return pa_city  Now I'm using PyCharm community as my Python IDE and the first import statement is not being recognized.  I checked the os.py module in my c:\Python38\Lib\ directory, and cannot find the wait method in there.  How do I locate the actual wait() method definition in another Python module, or is there another Python module that contains the wait() method?  If not, what alternate method should I use for initiating a 10-second delay?

How do I get my Python program to sleep for 50 milliseconds?


Is there some way to get a visual or list of every Stack Exchange user in each sub site by reputation and badges or is this information private?

In addition to showing reputation scores, SO should rank users. In the users section, users are ordered by the reputations they have.  Each user should also have a unique rank, since many users can have the same reputation score.  Rank must follow the order laid out by reputation, but for those having similar reputation, an additional formula should be defined which can rank users based on tags, time since registration, frequency of activity and/or helpfulness of their answers.  What are your thoughts on this?


I have installed ubuntu in windows8 .but dual boot is not showing. when i am starting system ,Ubuntu only getting starting. how to change in dual boot. i want get back windows8 and its files. please help out. Thanks in advance.

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I have been asked to shoot a wedding for one of my co-workers. I am not a professional but the bride to be has see some of my pics from parties and such and she really liked my style. This will be an outdoorsy in a barn type wedding. I live in SW Florida and plan to make 2 trips (about 50 miles each way) to the venue - one before the wedding to scope it out and take casual family and bride & groom pics, then the 2nd time for the actual wedding. My thought is that I will give them everything I shoot on DVDs and will touch up a few of their favorites if they need touching up. As I'm not a professional and have no intention to do any other weddings - what are people's general thoughts of what to charge? I was thinking $500. Is that too much?

I am an amateur photographer as far as event photography is concerned. I have done private event shoots only for my family and friends (weddings on two occasions and few new born and other small events).  Last weekend, I was invited to do a wedding photo shoot for an office colleague in local Bay Area, California. Apparently, they did not find any professional photog on a short notice, so they called me as they know I am a good photog.  I spent about 6 hours at the event in total and additional couple of hours in post-processing the pictures. I showed them some selected pictures and they loved them. They do not want any prints or albums. They just want soft copies of the selected photos. And now I have to tell the total price of my service.   I am not really sure how much I should charge for this event.  Any help in suggesting how I should go about determining the price of this service would be appreciated.  I don't know if this will help but here's what I shot with: Canon 5D MII, Canon 24-105 f4 IS, Canon Speedlite 430EX II and on the spare Canon T3i, Canon 50 f1.8.


As many videos are telling about the future when batteries would be exchanged by , which would charge fast and with larger power density. How much amount of these capacitors with what specifics would be needed for this?

What is the current state of things when it comes to super capacitors and batteries? Are super caps anywhere near rivalling LiPo's in capacity?  I've often heard people talking about super caps as being a viable replacement for batteries, in that you can charge virtually instantly and recharge millions of times, but is this just a pipe dream?


The more time you spending in measuring your experiment (thus standard deviation will become smaller) the more precisely you will measure energy of this system.... energy time uncertainly principle implies this.... and in most systems (i have seen,or may be all systems ) the lowest possible energy is ground state energy, this energy cannot be removable.. for example in a infinit square well .. Then how can ''universe from nothing'' i would say sentence makes sense? if there is uncertainly how there is something like nothing... if minimum energy possible is ground state energy..how nothing(no energy exist)???

In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim – does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this?


After I grapple a foe can I drag him off a cliff or do I have to push/shove him at the end?

Suppose the Fighter is successfully grappling an Orc. The Fighter then drags the Orc into the area of his Druid friend's Moonbeam so that, grid-wise, the Orc's space is fully inside the Moonbeam's AOE while the Fighter is right at its edge, with his space fully outside of the AOE. The Fighter is maintaining the grapple throughout this time, and he intends to just hold the Orc there and cook him under the Moonbeam.  In the specific scenario, is the Fighter subject to the effects of the Moonbeam spell?  I know that different DM's handle this differently (I'm personally on the "Not Affected Because He's Not Fully In The AOE" camp), so what I'd really like is as close to RAW an interpretation as I can get. Thanks. :)


i want to remove ` symbol from below string .  how can i do that?  For example :  string StateName = "Québec"; in the above string e character has special symbol, how can i remove special symbol from the string to make it as Quebec;

I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert é to e, so crème brûlée would become creme brulee)  What is the best method for achieving this?


When proving that if $d$ is a metric, then $d'(x,y)=\dfrac{d(x,y)}{1+d(x,y)}$ is also a metric, I have to prove the inequality:  $$\dfrac{c}{1+c}\leq\frac{a}{1+a}+\frac{b}{1+b}$$ for $0\leq c\leq a+b$. This is obvious by expanding, but is there a nicer way to see why it is true?

With $x+y\ge z$ $(x,y,z\ge0)$, prove that: $$\frac{x}{1+x}+\frac{y}{1+y}\ge\frac{z}{1+z}$$  I'm aware that using analytic view this is easy since $f(x)=\frac{x}{1+x}$ is concave in $[0,\infty)$. However I want to prove it using merely algebraic techniques. Is that possible?


I have a very simple code that takes a floating point number, and uses a while-loop to keep subtracting 1 until it reaches zero:  nr = 4.2 while nr > 0:     print(nr)     nr -= 1   I expected the output to look like this:  4.2 3.2 2.2 etc...   But instead, I get this:  4.2 3.2 2.2 1.2000000000000002 0.20000000000000018   Where do these weird floating numbers come from? Why does it only happen after the third time executing the loop? Also, very interestingly, this does not happen when the last decimal of nr is a 5.  What happened and how can I prevent this?

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


I have a group of order $2187=3^7$. I used Sylow's theorem and got Sylow 3-subgroup as my group. How do I continue?

Let G be a group of order $729$.   $729 = 3^6$ so by Sylow's Theorem G has a Sylow $3$-subgroup of order $729$. And there are $x$ of them. $r \equiv 1 \pmod 3$ and $r\ |\ 1$. So $x=1$? Is this correct?


I've recently noticed that on the Stack Exchange Android application, if I cast a vote on a post the vote action (red arrow) is only shown for around half a second and then the vote appears to be retracted (similar to when a vote is immediately reversed when the reputation requirement isn't met).  Let's use :    Have not yet cast a vote on it; let's cast an upvote:    half a second later, this gets 'reversed' but however still shows the upvote I cast, but doesn't show that my user has voted yet:    if I try to re-cast the same vote, the upvote count increases to 5 before it is reversed, with the 'You have already voted' error:    then if I refresh the question (by pulling down on the question), it now shows my user voted.  This is on the Stack Exchange Beta Android app (1.0.72) on a Huawei Ascend P8 Lite. I also temporarily left the Beta program, and can confirm this bug exists on the full public (non-beta) version of the app also. This question has a very similar issue to , but however this bug exists without any further input (such as scrolling).

Related:   I am using 1.0.71 on KitKat.  Immediately after voting, the arrow is displayed in red and the vote count is correct. However, when I scroll to read answers and then back to the top, the arrow is grey again and the vote count is reset to the previous value.  A reload of the question (pulling the finger down) is needed to show the correct situation, which is kept from then on.  This case was on security.stackexchange.com but I observed the same behavior on other sites too.  Screenshots   original state:  upvoted:  scrolled down and back up  after a reload


Convergent, absolutely convergent or divergent:   $$\sum_{k=1}^{\infty}\frac{2^{k}\cdot k!}{k^{k}}$$   I have used ratio test because we got a fraction here and I think I did alright till the end:  $$\lim_{k\rightarrow \infty}\frac{\frac{2^{k+1}\cdot (k+1)!}{(k+1)^{k+1}}}{\frac{2^{k}\cdot k!}{k^{k}}} = \lim_{k\rightarrow \infty}\frac{2^{k+1}\cdot (k+1)! \cdot k^{k}}{(k+1)^{k+1}\cdot 2^{k}\cdot k!} = \lim_{k\rightarrow \infty}\frac{2^{k}\cdot 2^1\cdot k! \cdot (k+1)\cdot k^{k}}{(k+1)^{k}\cdot (k+1)\cdot 2^{k}\cdot k!} = \lim_{k\rightarrow \infty}\frac{2k^{k}}{(k+1)^{k}}$$ $$=2\lim_{k\rightarrow \infty} \left( \frac{k}{k+1}\right)^{k}$$  Now I don't know (without a calculator) to what this would converge / diverge to... In the exam we are not allowed to use a calculator... So what to do?  The denominator will be greater than the enumerator by 1, so dividing each other we got something $<1$. We take exponent $k$ which is $\geq 1$, so we will end up with $<1$ again. Multiply this with 2 we get something $< 1$ but $> 0$ and thus the series is convergent...?  I hope I have described it well? Would you give me full points to this task? :D  Edit: I haven't described it well in the end. See the accepted answer and its comments! Thanks a lot to everyone - from every question I ask here, I always learn new things :-)

I have the following problem: $$\sum_{k=1}^{\infty}\frac{2^{k}k!}{k^{k}}$$  I only need to find whether the series converges or diverges. My initial thinking was to use the ratio test. I hit a stump after simplifying my limit, though:  $$\lim_{k}\frac{2k^{k}(k+1)}{(k+1)^{k+1}}$$  Normally I'd just derive by L'Hopital's Rule, but the derivative is pretty long and complicated. I doubt that's the correct route.


I have a file which is having following content:  zdk aaa b12 cdn dke kdn   Input1: aaa and cdn  Output 1:  aaa b12 cdn   Input 2: zdk and dke  Output 2:  zdk aaa b12 cdn dke   I could use below commands to achieve:  grep -a aaa -A2 file # Output 1 grep -a aaa -A4 file # Output 2   But in the file I don't know what is the exact occurrence (position) of end string pattern (file is having 20000 rows)  How can I achieve this?

I want to start grepping from the lines that has CK at the end of line and stop grepping when the line has D at the end. I tried grep "$CK" "$D" file..txt, but it didn't work.  Input:  kkkkkkkkkkk    jjjjjjjjjjjjjjjjjj   gggggggggggg/CK   JHGHHHHHHHH    HJKHKKLKLLL    JNBHBHJKJJLKKL   JLKKKLLKJLKJ/D   GGGGGGGGGGGGGG   GGGGGGGGGGGGGG   The desired output:  gggggggggggg/CK   JHGHHHHHHHH    HJKHKKLKLLL    JNBHBHJKJJLKKL   JLKKKLLKJLKJ/D


Suppose we have two groups, $G,H$ and that $\rho:G\rightarrow H, \tau:H\rightarrow  G$ are $1-1$ morphisms. Is it true then that $G,H$ are isomorphic? I don't think so, but I can't come up with any counter-example. This definitely holds for finite groups obviously. But what about infinite groups? Moreover, if it doesn't hold in general, does it hold for some large class of groups?

If I have two groups, $G$ and $H$ and two injective homomorphisms $\phi:G \to H$ and $\psi: H \to G$, then by the first isomorphism theorem applied to $\phi$, we have that $G \cong \mathrm{Im} (\phi)$, a subgroup of $H$. Similarly, $H$ is isomorphic to a subgroup of $G$. For finite groups, this guarantees that $G \cong H$ but does this hold for infinite groups?  Weird things can happen for infinite groups, e.g $n\mathbb Z \subsetneq \mathbb Z$ but $n \mathbb Z \cong \mathbb Z$. I'm wondering if this kind of thing stops an isomorphism from occurring.  I think this question generalises to rings, modules, fields and so on. Can this be answered for all of these structures?


I need to know the proper place to ask the following question:  In Messenger mobile for Android some emojis, when posted as the only character in a message, explode into a burst of floating emojis that flood the sender's and receiver's message area.  The 'Kissy face' emoji and the red 'Heart' emoji do this.  What is that behavior called and are there other emojis that have similar behavior when posted?

I would like to know where I can ask Android apps and other mobile related questions. Is there a Stack Exchange site for such questions?


Let $V = \mathcal P_2$ be the vector space of polynomials of degree less than or equal to $2$ with real coefficients, and let $W$ be the subset of polynomials $p(x)$ in $\mathcal P_2$ such that  $$\int_{-2}^0p(x)\,dx =4 \int_{0}^2p(x)\,dx.$$  Find a basis for $W$, and compute $\dim W.$  Plugging in $a+bx+cx^2$ and solving for both integrals gives me the equation $$8a+8b+\frac{32}3c = 2a-2b+\frac 83c,$$ which means I have the equation $$6a+10b+8c=0.$$ How do I write a basis of polynomials for this? And is the dimension $2$?

Let $V = P_{2}$ be the vector space of polynomials of degree less than or equal to $2$ with real coefficients, and let $W$ be the subset of polynomials $p(x)$ in $P_{2}$ such that:  $$\int_{-2}^{0}p(x)\,dx = 4\int_{0}^{2}p(x)\,dx.$$  $b)$ Find a basis for $W$, and compute $\dim(W)$.  For $b)$, I know after plugging in an example p(x)=a and p(x)=a+bx+c^2 I get that a = 0, where do I go from here?


I'm trying to learn rigging, so I started with very very simple character model. But when I weighted head vertexes and tried to rotate bone, the head became deformed as top of the head had lower weight then the bottom part of head.  Weights:   Head bone rotated to front site:   Any idea what did I do wrong? I tried to follow video tutorial on youtube, where it worked correctly right away, but with a bit complicated character model.  Thanks a lot for all help!

I'm practicing rigging a finger. Why is the tip getting smaller when I rotate it? And hopefully someone has tips on rigging a hand/fingers.


What is the relation between the convergence of $\sum a_{n}$ and $\prod (1+a_{n})$ where $a_{n} \in \mathbb{C} \ \forall n$ ?  Where can I find some references about this topic ?

Does there exist a sequence $a_n$  of complex numbers such that $\sum _{i = 0}^\infty a_n$ converges and the product $\prod _{i = 0}^\infty (1+a_n)$ does not converge to any complex number(not even 0).  And conversely a sequence  $a_n$ s.t. $\prod _{i = 0}^\infty (1+a_n)$ converges to a non zero complex number. But $\sum _{i = 0}^\infty a_n$ does not converge.  We all know that if $\sum _{i = 0}^\infty a_n $ converges absolutely iff the corresp product converges absolutely. So i tried alternating serieses like $ a_n = (-1)^n /n $ and $(-1)^n / \sqrt n $  but that did not work. i tried like $ \sum _{i} \sum _ {k} \frac{ e^{2(pi)i/k}}{k} $but i couldn't go furthur. Can anybody help?


I'd like to automate the simultaneous key press of command, option and "s" on my MacBook, but unfortunately, I don't know Apple Script well enough to programme this. Any suggestions? Thanks!

Is it possible to automate the key press of a key (such as "a" or "<") in Mozilla Firefox, Google Chrome or Safari (in this order)? I'd like to automate the key press of "a" for example in Mozilla Firefox for 100 times every x seconds. With x being a value between 1 second and 10 seconds chosen randomly at every key press. What Applescript could make the trick?  Also, where can I find a list of all codes for each key of the keyboard?


When trying to format printf output involving strings containing multi-byte characters, it became clear that printf does not count literal characters but the number of bytes, which makes formatting text difficult if single-byte and multi-byte characters are mixed. For example:  $ cat script #!/bin/bash declare -a a b a+=("0") a+=("00") a+=("000") a+=("0000") a+=("00000") b+=("0") b+=("├─00") b+=("├─000") b+=("├─0000") b+=("└─00000") printf "%-15s|\n" "${a[@]}" "${b[@]}"  $ ./script 0              | 00             | 000            | 0000           | 00000          | 0              | ├─00       | ├─000      | ├─0000     | └─00000    |   I found various suggested work-arounds (mainly wrappers using another language or utility to print the text). Are there any native bash solutions? None of the documented printf  appear to help. Would the locale settings be relevant in this situation, e.g., to use a fixed-width character encoding like UTF-32?

If I execute the following simple script:  #!/bin/bash printf "%-20s %s\n" "Früchte und Gemüse"   "foo" printf "%-20s %s\n" "Milchprodukte"        "bar" printf "%-20s %s\n" "12345678901234567890" "baz"   It prints:  Früchte und Gemüse foo Milchprodukte        bar 12345678901234567890 baz   that is, text with umlauts (such as ü) is "shrunk" by one character per umlaut.  Certainly, I have some wrong setting somewhere, but I am not able to figure out which one that could be.  This occurs if the file's encoding is UTF-8.  If I change its encoding to latin-1, the alignment is correct, but the umlauts are rendered wrong:  Fr�chte und Gem�se   foo Milchprodukte        bar 12345678901234567890 baz


By default, the rank function in Excel gives duplicate numbers the same rank but for the next score it will skip a rank. So if there are 2 scores on rank 5, the next score will get rank 7.  I want to use a function that will give the same scores the same rank but without skipping a rank.  See following example:  Score   rank 60       1 60       1 55       2 49       3 38       4 38       4 32       5   So the scores get a rank from high to low and there is no gap in the ranks.

How can I get an equivalent of dense rank from SQL in Excel?  I have unsorted data (number of data varies from week to week) and the duplicates should have the same rank, i.e.  number    rank 6          1 12         2 23         3 6          1 6          1   I have found this solution   =SUMPRODUCT( (FREQUENCY($A$1:$A$10, $A$1:$A$10) > 0) * (A1 >= $A$1:$A$11) )  Note the extra row required in the second expression.    but I cannot use it as I do not know how many entries I will have and this one assumes I know the data set a priori.


I have written a latex document, and in this document I reference to equations, tables, and figures. Everything works perfectly.  Now I discovered that I have to use a specific template. Therefore I copy-past my latex code into the template .tex file, and now equation reference is broken. References to tables and figures still work, the bibliography is still fine, but any reference to an equation ends up with a (??).   I am not sure what could be causing this, maybe some loaded packages? (I only load hyperref last).  This is the list of packages I load:  \documentclass[11pt,a4paper,english,oneside]{book} \usepackage{etex} \usepackage[left=1in, right=1in]{geometry}  \usepackage[Lenny]{fncychap} \usepackage[utf8]{inputenc} \usepackage[british]{babel} \usepackage{dsfont} \usepackage{fancyhdr}  \usepackage{booktabs}  \usepackage[hang,bottom,stable,multiple]{footmisc}  \usepackage{appendix}  \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathtools} \usepackage[sort,round]{natbib}  \usepackage{etoolbox}  \usepackage{amsthm}  \usepackage{thmtools}  \usepackage{setspace} \usepackage{lipsum}  \usepackage{datetime}  %\usepackage{tocloft} \usepackage{graphicx,listings,xcolor,textcomp} \usepackage{mcode}  \usepackage[margin=10pt, font=small, labelfont=bf, labelsep=endash]{caption} \usepackage{chngcntr}  \usepackage{epstopdf} \usepackage{xparse} \usepackage{cleveref} \usepackage{array,hhline} \usepackage{rotating}  \usepackage{tabularx}  \usepackage{arydshln} \usepackage{tikz} \usepackage{multirow} \usepackage{csquotes} \usepackage{wrapfig}  %instructions to make the algorithm pseudo-code package work \usepackage{algorithm} \usepackage[noend]{algpseudocode} \makeatletter \def\BState{\State\hskip-\ALG@thistlm} \makeatother  \usepackage{hyperref}    Please tell me what other informations I should include.

The hyperref documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors.  However, there are exceptions, for instance the amsrefs user's guide notes that amsrefs has to be loaded after hyperref.  To avoid problems when adding hypertext functionality: do you know further such exceptions?


The first one is this: n = int(input()) a = [] for i in range(n):     a.append(int(input()))  The second one is this: n = int(input()) a = [0]*n for i in range(n):     a[i] = int(input())  I have always been using first one, but the second one just came up to my mind. I don't know how append works, but I thought the second one could be more efficient than the first one. Can I get answer of this problem?

Code like this often happens: l = [] while foo:     # baz     l.append(bar)     # qux  This is really slow if you're about to append thousands of elements to your list, as the list will have to be constantly resized to fit the new elements. In Java, you can create an ArrayList with an initial capacity. If you have some idea how big your list will be, this will be a lot more efficient. I understand that code like this can often be refactored into a list comprehension. If the for/while loop is very complicated, though, this is unfeasible. Is there an equivalent for us Python programmers?


When I use \includegraphics all of my figures say "chesches" at the bottom left of the figure.  Here is the code:  \begin{figure} \includegraphics[width = 6 inches]{HHCircuit.png} \end{figure}

I know there are different ways of expressing sizes or dimensions in LaTeX such as points (pt), inches (in) and ex.  As some commands, such as \hspace , I would like to have a reference or complete list of possible dimensions or sizes including a description of what they mean.


When I click with the left mouse button, a white and red circular scope-target-looking-pointer moves to the location of the click. I can't make any sense of it and would like to find it in the manual. What is it called?

I know the 3D Cursor can be used to position new objects, or snap existing ones to a certain location - but what else can it be used for?  An exhaustive list of every possible use would be great (without repeating similar things like "pivot for spin tool", "pivot for screw tool" - which could simply be said as "Pivot for modeling tools").


I love vim, but one common gotcha is:   yank a line go to where you would like to paste it delete what's there paste your yank, only to discover that it pastes what you just deleted   Obviously the workflow is delete first, yank second.  But it would be reeeeeaaaaaalllly nice if I didn't have to.  Anyone have a trick for this? Does vim have a paste buffer that works well, or is there a .vimrc setting I can change?

Using Vim I often want to replace a block of code with a block that I just yanked.  But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, but with large blocks of code this gets messy trying to keep the inserted block and the block to delete separate.  So what is the slickest and quickest way to replace text in Vim?   is there a way to delete text without putting it into the register? is there a way to say e.g. "replace next word" or "replace up to next paragraph" or is the best way to somehow use the multi-register feature?


Issue    I am having an issue creating a regex to accept any string and the ENTER key, at the moment i have this:  ^$|^.+$   I have looked around and people have said to add \n but this does not work.  An example of the string is should allow is as follows:  Hello this is a test string   and i want this to be accepted

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


How many different sums of money can be made from penny, a nickel (5 pennies), a dime (10 pennies) and a quarter (25 pennies)?  I am having trouble sorting out the answer. As far as I have made progress, my answer would be $\binom{4}{2}$, but I still have doubts.

You have one penny, one nickel, one dime, and one quarter. How many different amounts of money can you make using one or more of these coins? Please help me! I'm having trouble! I'm having trouble I know the obvious ones like $5,10,25,1,15,26,36,16,\ldots$ Help? And I need to know the coin combinations too. I found $15$ different ones! Anyone who can find more??


The set of points where an arbitrary function $f: X \to \mathbb{R}$ defined in a set $X \subset \mathbb{R^m}$ admits a strict maximum or minimum is enumerable.  Proof: Let $E \subset X$ be a dense enumerable subset and  If $A$ is the set of points where f attains a strict local maximum,  then for each point $x \in A$ that is a strict maximum of $f$, choose $e_{x} \in E$ and $r_{x} \in \mathbb{Q}$ with $|e_{x} - x| <r_{x}$ and $y \in B(e_{x}; r_{x}) - \{x\} \Rightarrow f(y) < f(x)$. Define the application  $g:A \to E \times \mathbb {Q}$ such that $x \mapsto (e_{x}, r_{x})$.   I have done this demonstration up to this point, but I just need to prove that $g$ is injective. Could someone give me any suggestions to do this, please.

The set of points where an arbitrary function $f: X \to \mathbb{R}$ defined in a set $X \subset \mathbb{R^m}$ admits a strict maximum or minimum is enumerable.  [Hint: Let $E \subset X$ be a dense enumerable subset. For each point $x \in X$ that is a strict maximum of $f$, choose $e_{x} \in E$ and $r_{x} \in \mathbb{Q}$ with $|e_{x} - x| <r_{x}$ and $y \in B(e_{x}; r_{x}) - \{x\} \Rightarrow f(y) < f(x)$. The application $x \mapsto (e_{x}, r_{x})$ is injective].  I have the following proof but I don't know if it is correct because $ f:X \to \mathbb{R}$ and $X \subset \mathbb {R^m}$. What do you think about this test?:  Let $M$ be the set of strict local minima of a function $f$. Then for every $p\in M$ there is an open interval $(a,b)$ such that $f(p)$ is smaller than $f(x)$ for any $x\in(a,b)\setminus\{p\}$. We can now choose rational numbers $a_p,b_p$ with $a<a_p<p<b_p<b$, and $f(p)$ will be the smallest value on $(a_p,b_p)$.  Define a map $g:M\rightarrow\Bbb Q^2$ taking $p$ to a pair $(a_p,b_p)\in\Bbb Q^2$ like above. It's clear $g$ is injection, since $f(x),f(y)$ cannot both be smaller than each other for $x\neq y$. Hence $g$ is an injection into a countable set showing $M$ is countable.  Could another demonstration be better than this one?


I was playing modern with the owner of a shop.  He played a  which he used to bring in 7 lands: 5 basic mountains and 2  cards.  He then claimed that each  triggered 5 times (killing me).  I am doubting this now.    Here is my reason: The two  cards entered at the same time as the other 5 basic lands.  That means when they were on the battlefield and their ability was in effect, the other 5 basic lands were already there too.  That seems too late to trigger a "Enters the Battlefield" effect.  So here is my question.  Am I right or wrong?  If I am wrong, please show me how the enter the battlefield effect can trigger for something that enters the battlefield at the same time as itself.  If I am right, please show me the rules that prove it.  I now have two shop owners that are convinced that this is a legal play.  If it is not legal, I am going to need clear rules citations to convince them.    Side note:  If I am wrong and it is a legal play, then I have a follow up scenario.  Say I have 2  cards and 5 other human cards in my graveyard.  If I play a spell that lets me return all of them to the battlefield at the same time (say ), would the  cards get 6 +1/+1 counters on them?    To me, if the trick that was played on me with  is legal then my  cards should also get the +1/+1 counters.

Let's say I have  on the board. He is a 2/2 that says:  Whenever another creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.  I play a . It says:  Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step.  The sacrifice portion is not important to this question. What is important is how these two cards interact with each other. Playing this card in my first main phase, assuming no counters or other shenanigans by my opponent, I will have my Commander and 3 tokens on the battlefield. What will happen in terms of the power/toughness of my tokens and Commander? Option A The tokens will be 1/1 each. They don't see each other come in at all. The Commander is 3/3, as one "enter the battlefield" trigger happens. Option B The tokens will be 1/1. They don't see each other come in at all, because they weren't on the battlefield to see any of the triggers. The Commander is 5/5, as he saw three "enter the battlefield" triggers occur. Option C The tokens will all be different, with one being 3/3 as he saw the other two come in, one being 2/2 as he saw only the last one come in, and 1/1 as the last one saw none come in. Option D The tokens will all be 4/4, as three creatures entered the battlefield this turn. I am obviously hoping for this option. It may be supported by a ruling on Goldnight Commander that says, emphasis mine:  The creature that entered the battlefield will also get +1/+1 until end of turn if it's still on the battlefield when the ability resolves.  The key being the ability resolving. So my thought is thus:  Thatcher Revolt goes on the stack. Thatcher Revolt resolves, and three separate "enter the battlefield" triggers go on the stack as the three humans enter the battlefield as 1/1. The last (it is a stack) "etb" trigger resolves. This puts an ability from Goldnight Commander on the stack. This resolves and the humans are now all 2/2. The next "etb" trigger resolves. This puts a new ability from Commander on the stack, and resolves with the humans being 3/3. The first "etb" trigger finally resolves, puts a Command ability on the stack, which resolves putting the humans at their final state of 4/4.  Option E The tokens will all be 2/2.  Thatcher Revolt goes on the stack. Thatcher Revolt resolves, and one single "enter the battlefield" trigger goes on the stack. The "etb" trigger resolves. This puts an ability from Goldnight Commander on the stack. This resolves and the humans are now all 2/2.  I would really like to have a complete understanding both of the result and how this result is calculated by the game engine.


In photoshop, i have a "speech bubble" of sorts.  I need to be able to move the little triangle bit of the bubble left, right, and to the side.  Then "rejoin" it with the rectangle, and apply all the gradent/bevel effects of the original.  photoshop has a selector tool, but i cannot seem to cut, coppy, delete with it - actually, i do not understand why the rectangle selector exists (unless maybe there is a market for people who like pretty transient rectangles?)  So, for pictures -   this is the intial image i want to move around:   this is the image with all the  stuff removed, i just want to move that triangle around!!   And then of course reapply the effects that i disabled. I imagine this is a super simple job - how do i do this?

I'm wondering if anyone has any tips, tutorials or templates on how to 'fake' a printed effect. I want to make it look in my portfolio like I have printed business cards and other collateral without doing so.


Does a reaction that causes me to move out of range after the spell is cast but before the spell hits cause it to miss?  A couple ways this can be done are   Readied action to move with a trigger: target casts the spell Mage Slayer feat with a melee weapon attack that moves the caster

Let's say that a player uses the ready action and says "If a character aims at me with a weapon, I'll use Teleport to move behind cover."  What happens? Does this work? If not, please cite the rules to explain why not.


Is it possible to compile a latex-document in such a way, that you can search for math formulas in the resulting pdf file by searching for the corresponding latex code? For example open the resulting document in evince and search for \int_3^5 f and you will find all occurrences the typeset math formula where the source contained \int_3^5 f.  The normal pdf search function should be unaffected.   I think in principle this should be possible since you could parse the math information at compile time and add them appropriately to the pdf ocr layer. However is there already a package or option which implements this?

I would like to write a .pdf, where my readers could copy the rendered formulae and paste them directly in their TeX documents.    And the copied text would automatically be:  \int x\sin ax\;\mathrm{d}x = \frac{\sin ax}{a^2}-\frac{x\cos ax}{a}+C   Is this possible?


I'd like to use a sequence of boxes to show how TeX works. I read some time ago that everything (or almost) in TeX are boxes.  So, how to show only the TeX boxes that surround each character, each line, each paragraph?  I'd like something similar to the image below, not fbox which contains blank space around it.

How can I take input text and replace each character with a solid (and/or hollow) rectangle representing the bounding box for that character? In the case where two characters are closer together from kerning (e.g. microtype) the boxes would overlap. The addition of the boxes should not change the spacing of the text - I'm looking for a "draft mode" for the letters.  Solutions and Problems  Both solutions presented by Yiannis Lazarides and egreg seem to do a reasonable job for single words, though as mentioned, it seems that kerning was not completely respected. Below are the results (without markup/egreg/Yiannis):    Both solutions fail however when multiple words are involved. One of the answers completely eats a space while the other overcompensates. Both of them seem to choke on a line break as well.


I am new to programming and I am trying to figure out how to calculate the Big O of algorithms. For example:  int selectkth(int a[], int k, int n){     int i, j, mini, temp;     for(i=0, i < k, i++){       mini = i;       for(j = i+1; j < n; j++)        if(a[j] < a[mini])          mini = j;          temp = a[i];          a[i] = a[mini];          a[mini] = temp;          }       return a[k-1];     }    I know there are 9 steps taking place here and that the nested loops are supposed to be multiplied together.  I got O(n^2) when I first attempted but I don't think that is correct.  Can someone explain how to properly calculate Big O in a simplified way for a rookie like me? Any explanation will help or examples of your own. Thanks :)

I'd prefer as little formal definition as possible and simple mathematics.


Not sure how to do this one. If $S$ is a field, then I was considering that $\exists r_1,\ldots, r_n\in R$ s.t. $1 = r_1s_1+\cdots+r_ns_n$ so for $r = rr_1s_1+\cdots+rr_ns_n$. Maybe that is somehow useful for taking inverses of elements.    The assumption that $S$ is an integral domain is necessary because otherwise we could have $S = \mathbb{Z}_p[x]/f(x)$ where $f(x)$ is not irreducible. This is still a finitely generated $\mathbb{Z}_p$-module, but its not a field.   Any hints or solutions would be much appreciated. I feel like this isn't that hard and I'm missing something simple  Source:

I'm reading Galois Theory by Steven H. Weintraub (second edition), and finding that I'm at least somewhat short on the prerequisites. However the following proof looks wrong to me - am I misunderstanding something, or is it actually an incorrect proof?  Lemma 2.2.3. Let $F$ be a field and $R$ an integral domain that is a finite-dimensional $F$-vector space. Then $R$ is a field. Proof. We need to show that any nonzero $r \in R$ has an inverse. Consider $\{1, r, r^2, \cdots\}$. This is an infinite set of elements of $R$, and by hypothesis $R$ is finite dimensional as an $F$-vector space, so this set is linearly dependent. Hence $\sum_{i=0}^n{c_i r^i} = 0$ for some $n$ and some $c_i \in F$ not all zero.  It then goes on to show, given the above, that we can derive an inverse for $r$. However, if I consider examples like $r = 2 \in Q[\sqrt{2}]$, $r = \sqrt{2} \in Q[\sqrt{2}]$ or $r = 2 \in Q[X]/{<X^2>}$, the set $\{1, r, r^2, ...\}$ doesn't look linearly dependent to me. I do believe the lemma is true (and might even be able to prove it), but this does not look like a correct proof to me. Am I missing something? [Edit] Well yes, I am. Somehow I had managed to discount the possibility of any $c_i$ being negative, despite repeatedly looking at each fragment of the quoted text in an attempt to find what I might be misunderstanding.


I've been stuck on the following puzzle:  There are $2$ one-letter words in English ("I" and "a"), and there are $124$ two-letter words. Let $a_n$ be the number of strings of $n$ letter that may be formed from some sequence of one- and two-letter words, by concatenating them all together. Prove, by induction on $n$, that $a_n \le 13^n \ \forall n$.  I would appreciate it if people could please take the time to explain this.

There are two one-letter words in English (“I” and “a”), and according to  there are 122 two-letter words. Let $A_n$ be the number of strings of n letters that may be formed from some sequence of one- and two-letter words, by concatenating them all together.  Find $a_3$  Give an expression for an in terms of $a_{n-1}$ and $a_{n-2}$, that works for all n ≥ 3.  So far a1 makes sense to just be "I" and "a" so a total of 2. a2 would be the 122 two letter strings plus a combination of adding the one letter words (i and a) giving ai, ia, ii and aa.  This would give a total of 126 for $a_2$.  doing the combinations for $a_3$ gives 495 but that doesn't seem right as there is no evident patter to use the formula $a_n=a_1r^{n-1}$.


Let $X$ and $Y$ be two independent random variables. If $X$ and $Y$ are both standard normal, then what is the distribution of the random variable $$\frac{1}{2}(X^2+Y^2)$$  Is it right that the answer to this question is $$\frac{1}{2}(X^2+Y^2) \texttt{ ~ }  EXP(1)$$? But how? Thank you very much, any help will be much appreciated.

The sum of squares of $k$ independent standard normal random variables $\sim\chi^2_k$  I read  that if I have $k$ i.i.d normal random variables where $X_i\sim\mathcal{N}(0,\sigma^2)$ then $X_1^2+X_2^2+\dots+X_k^2\sim\sigma^2\chi^2_k$. How do I go about obtaining the pdf?  If I have $k$ independent normal random variables where $X_i\sim\mathcal{N}(0,\sigma_i^2)$ then what is the distribution of $X_1^2+X_2^2+\dots+X_k^2$?