I'm a Java programmer transitioning to C++ and need some clarification on how Java is considered "pass-by-value", rather than a "hybrid".  Java's baz() behaves identically to the C++'s foo() below, which is a pass-by-reference trait.  Edit: What I'm trying to understand is why bar() and baz() are pass-by-value despite different behavior.  I can't find this specific answer on the forums.  Java  public class CountKeeper {    private static void baz(CountKeeper ck) {     ck.inc();   }    public static void main(String[] args) {     CountKeeper ck = new CountKeeper();     System.out.println(ck.count()); // 0     baz(ck);     System.out.println(ck.count()); // 1   }    private int count;    private int count() {     return count;   }    private void inc() {     count++;   } }   C++  #include <iostream>  class CountKeeper { public:   CountKeeper();   CountKeeper& operator++();   int count(); private:   int count_; };  CountKeeper::CountKeeper() :   count_(0) {}  CountKeeper& CountKeeper::operator++() {   ++count_;   return *this; }  int CountKeeper::count() {   return count_; }  //pass by reference void foo(CountKeeper& ck) {   ++ck; }  //pass by value void bar(CountKeeper ck) {   ++ck; }  int main() {   CountKeeper ck;   std::cout<<ck.count(); // 0   foo(ck);   std::cout<<ck.count(); // 1   bar(ck);   std::cout<<ck.count(); // 1   return 0; }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


As far as I understand, in classical (not quantum) physics the equations of motion are established experimentally (e.g. Newton's three laws and Newton's gravity law, Maxwell's equations). Then sometimes it turns out to be convenient  to rewrite them as Euler-Lagrange equations for suitably chosen Lagrangian $L$. However $L$ is not determined uniquely by the equations of motions, and  may be chosen in any convenient way  without affecting the physical results. The situation changes when one considers the quantum version of the equations. Usually one has to choose a particular form of $L$ and either substitute it to the path integral, or construct a Hamiltonian out of it, guess a quantum version of the Hamiltonian, and substitute into the Schroedinger equation, sometimes using further analogies (e.g. so it worked with the Pauli equation, I think).  In all the literature I know it is never explained how to choose the right $L$ for quantizing a problem. All textbooks just ignore this step. I realize that the final criterion of correctness of a theory is its consistency with experiment, but still I am wondering whether there are more theoretical arguments to choose a specific $L$?

I have seen in Wikipedia that different quantization methods exist (see Wiki article with name "Quantization"). Moreover, Wikipedia stated that there is more than one way to quantize a classical theory. Why? Why quantization is not unique?  If you hear lectures about quantum theory, you will learn the canonical (commutator relation) quantization and the Path integral method. You will learn that canonical method and Path integral method are equivalent.   Now there also exists a quantization with the Moyal $\star$ product and phase space; this method is also equivalent to the methods I have mentioned previously.  Main question: Which quantization method is completely different to the most convenient one like commutator relations? I am thinking about things like the spin network state quantization that is used in Loop quantum gravity. Can spin networks be used to quantize well-understood theories like quantum chromodynamics also?  Answers would be greatly appreciated.


Previously, using Ubuntu 16, I pressed Alt+Shift to switch the language,  let go of the Alt key, left my finger on the Shift button, and was then able to enter a capital letter.  Now, in Ubuntu 18.04, after using Alt+Shift and releasing the Alt key, lower-case letters continue to be entered, even though the Shift key is being pressed.  I have to press it again to enter a capital letter.  I find this terribly inconvenient and very uncomfortable.  Does anyone know how to fix this?

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


I am using a dual-booting system with Windows 10pro and Ubuntu 16.04 LTS.   I upgraded my nvidia driver in Ubuntu and set it to be used in the Software and Updates settings. The next time I tried to boot and every time since, I get a message saying     The system is running in low graphics mode   and I can't proceed any further.  What should I do?

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


I made this object in javascript.  let list = {    value: 1,    next: {       value: 2,       next: {          value: 3,          next: null,       },    }, };   And also a function to traverse it...  function traverse(list_) {    while (list_) {       console.log(list_.value);       list_ = list_.next; // (*)    } } traverse(list);   Inside of the function I am changing the reference to the passed argument at (*), so at the end of the function I was expecting the value of list object to be null as well, but when I log the value of list after the function, it still shows the same object...   Does this mean that list was passed by value, and not by reference?

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


It's kind of a newbie question but I was preparing to invest in index funds (low-cost index funds) for a while now and I am just thinking what should my strategy look like.  As of the day of writing this post, there was a big drop (around 5%) in S&P 500 and other index funds, what should my strategy look like.  I am not sure if the bear market starts, or this is just a fluctuation.  The question is, how should I invest in index funds under the circumstances?  Shall I just invest a certain amount for the next years and don't care about the bear or bull market at all?   Or maybe I should invest part of the money in index funds and the rest in other commodities?  Shall I invest different amounts depending on the direction of the market?  Thanks

I'm a young person with some money to start investing. I do believe in the superiority of low cost index fund over actively managed fund. But I still freeze up a bit about the timing of when to start my first buy in.  Sure, I understand that there's no way to time the market. But even if I only buy-and-hold instead of day trading, wouldn't the timing of my first investment still matter greatly? For example, a person who started to invest during the 2007 bubble only regained his net worth 6 years later in 2013.  Is this the case of something that does matter but I have no control over so I should not worry about? Or does the timing NOT matter since I'm supposed to invest part of my paycheck every month no matter the economic condition?


I have a problem with alignment in a multicolum, here's the code  \begin{table}[H] \caption{Statistic values of dementia epidemiology over the world.} \begin{tabular}{ccrccc} \hline \multirow{2}{*}{Region} & \multicolumn{3}{c}{ Number of people with dementia (millions)} & \multicolumn{2}{c}{ Proportionate increases (\%)} \\ \multicolumn{1}{l}{}    & 2010               & 2030               & 2050                 & 2010-2030               & 2010-2050               \\ \hline Asia                    & 15,94              & 33,04              & 60,92                & 107                     & 282                     \\ Europe                  & 9,95               & 13,95              & 18,65                & 40                      & 87                      \\ The Americas            & 7,82               & 14,78              & 27,08                & 89                      & 246                     \\ Africa                  & 1,86               & 3,92               & 8,74                 & 111                     & 370                     \\ \hline World                   & 35,56              & 65,69              & 115,38               & 85                      & 225                     \\ \hline \end{tabular} \label{tab:stats} \end{table}   But the result in the second to forth colum is strange,

I'm trying to typeset a table that would have a header in the first row (I'm not looking for a different/better solution to adding a header, but for a fix to this solution. Thanks). I want to achieve this by having a multicolumn cell spanning all the columns of the first row. The problem is that if the text is too long, the column widths are uneven, with the last column accumulating excess width. I would expect all of the columns to be of approximately the same width (although I cannot find a decent source that would say they should), given the fact that all the text in the second row is of approximately the same width.  I find this behaviour quite puzzling and have no idea what the cause could be. I know I could perhaps remedy this by manually setting the column widths, but am curious as to how to fix this without doing that (I do not need or indeed want the columns to be of the same width, but roughly proportional to the length of their content), preferably but not necessarily by using the tabular environment only (some other conflict with the document class I am using).   What is it that I'm doing or assuming wrong? And why?  MWE:  \documentclass{article} \begin{document}  \begin{tabular}{ccccc} \multicolumn{5}{c}{This is a piece of text. The longer it is, the longer the last column.} \\  1 & 2 & 3 & 4 & 5 \\ \hline \end{tabular}  \end{document}   Resulting table. Notice how the last column of the second row accumulates excess width.


I feel like I am stuck. How can I interpret the equation with Einstein summation? Here is the exercise:      you should see that r′ can be written as a linear transformation of r. This means we should be able to write r′=Ar for some matrix A.    The exercise is depicted on the picture.   I will be more than thankful if someone explains that to me in minute detail.

I'm trying to compute the shadow of 3D objects on the ground. To do this I'm assuming parallel rays from Sun origin.   Let's assume the Sun direction is given by azimuth $\varphi$ and elevation $\theta$ angles. So the direction unit vector is retrieved as:  $$ \hat{\mathbf{s}} = \mathbf{R}_y\left(\theta\right)\mathbf{R}_z\left(\varphi\right)\hat{\boldsymbol{\imath}}$$  where $\mathbf{R}_{x/y/z}$ are the rotation matrices along the $x, y, z$ axes given by, for example, Euler-Rodrigues equation, and $\hat{\boldsymbol{\imath}}$ is the unit vector along $x$-axis.  A point on a ray-line has the equation:  \begin{equation} \mathbf{r} = \mathbf{r}_p + \lambda\hat{\mathbf{s}}  \tag{1} \end{equation}  being $\mathbf{r}_p$ a point on that line.  A point on a general plane is given by the equation:  \begin{equation} \left(\mathbf{r} - \mathbf{r_0}\right)\cdot \hat{\mathbf{n}} = 0 \tag{2} \end{equation}  being $\mathbf{r}_0$ a point on the plane and $\hat{\mathbf{n}}$ the unit vector normal to that plane.   Ensuring the validity of both equations (1) and (2) allows to compute the $\lambda$ multiplier and retrieve the position vector of the projected point (writing $\tilde{\mathbf{r}} = \mathbf{r_p} - \mathbf{r_o}$)  \begin{gather} \lambda = - \left(\frac{\tilde{\mathbf{r}}\cdot \hat{\mathbf{n}}} {\hat{\mathbf{s}}\cdot\hat{\mathbf{n}}}\right) \\ \mathbf{r}_\text{proj} = \mathbf{r}_p - \left(\frac{\tilde{\mathbf{r}}\cdot \hat{\mathbf{n}}} {\hat{\mathbf{s}}\cdot\hat{\mathbf{n}}}\right)\hat{\mathbf{s}} \tag{3} \end{gather}  Applying eq. (3) to all the vertices of a mesh $\left\{\mathbf{r}_{p_i}\right\}$ .   A problem can be noted: $\hat{\mathbf{s}}\cdot \hat{\mathbf{n}}$ can be zero (e.g. Sun is horizontal, i.e. the ray is ortogonal to the normal of plane).   Are there some conceptual mistakes in my reasoning? Is there a way to rewrite the operation as a linear operator applied to the set of vertices position vectors?   $$ \left[\mathbf{A}\right]\left\{\mathbf{r}_{p_i}\right\} = \mathbf{r}_\text{proj}$$


As I have a rather long Table of Contents in my beamer document (I have four section, each composed of at least five subsections), I'd like to spread it over two slides rather than just one. How can I do that? My code so far:  \documentclass[leqno,mathserif]{beamer} \usepackage{graphics,bm} \usetheme{Luebeck} \setbeamercovered{transparent} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english,french]{babel}  \newcommand{\diff}{\mathop{}\mathopen{}\mathrm{d}} \setbeamercovered{transparent} \usepackage{enumitem} %the university of bamberg colors % colors to be used \definecolor{fu-blue}{RGB}{0, 51, 102} % blue text \definecolor{fu-green}{RGB}{153, 204, 0} % green text \definecolor{fu-red}{RGB}{204, 0, 0} % red text (used by \alert)   %the usage of the colors in special elements %\setbeamercolor{title}{fg=UBBlack} %\setbeamercolor{frametitle}{UBBlack} \setbeamercolor{structure}{fg=fu-blue}  \usepackage[tightpage]{preview}   \setbeamercolor{block title example}{fg=black,bg=red!20!green!50!white} \setbeamercolor{block title}{fg=black,bg=blue!50!white} \setbeamercolor{block title alerted}{fg=black,bg=red!70!white}   \AtBeginSection[]  {  \begin{frame}<beamer>{Plan}  \tableofcontents[currentsection]  \end{frame}  }   \title[SDE]{SDE} \subtitle{XXXXXXXXXXXXXXXXXXX} \author[XXXXXXXXXXXX]{XXXXXXX}  \institute{XXXXXXXX} \date{\today}  %\setbeamertemplate{navigation symbols}{\insertslidenavigationsymbol}  \begin{document} \begin{frame} \titlepage \end{frame} \section[Plan]{} \begin{frame} \tableofcontents \end{frame}  \section[Introduction]{Introduction} \begin{frame} (introduction) \end{frame}  \section[EDS]{EDS} \subsection[Définition XXX]{Définition XXX} \begin{frame} \frametitle{Définition XXXX} bla bla bla bla  \end{frame}  \subsection[Solution XXXXXXX]{Solution XXX} \begin{frame} \frametitle{Solution XXXX} bla bla bla bla bla \end{frame}  \subsubsection[Diverses notions de solutions]{Diverses notions de solutions} \begin{frame} \frametitle{Diverses XXXXXXXXXXX} \framesubtitle{Solution XXXXXXX} bla bla bla \end{frame}  \begin{frame} \frametitle{Diverses XXXXX} \framesubtitle{Solution XXXXX} bla bla bla \end{frame} \subsubsection{Diverses XXXX} \begin{frame} \frametitle{Diverses XXXX} \framesubtitle{Unicité } bla bla bla   \end{frame}  \subsection{Diverses notions d'existence et unicité des solutions } \begin{frame} \frametitle{Existence et unicité des solutions } \framesubtitle{Sous Condition de lipschitzienne } bla bla bla \end{frame}  \begin{frame} \frametitle{Existence et unicité des solutions} \framesubtitle{Sous Condition de XXXXXXX} \end{frame}   \section[Diffusion]{Diffusion} \subsection{Définition d'une diffusion d'Itô} \begin{frame} \frametitle{Définition d'une diffusion d'Itô} \framesubtitle{Notation} bla bla bla  \end{frame}  \begin{frame} \frametitle{Définition d'une diffusion d'Itô} bla bla bla  \end{frame}  \subsection{Flot stochastique} \begin{frame} \frametitle{Flot stochastique} \framesubtitle{propriété du Flot stochastique} bla bla bla  \end{frame}  \subsection{La propriété de Markov} \begin{frame} \frametitle{La propriété de Markov} \framesubtitle{Notation} bla bla bla  \end{frame}  \begin{frame} \frametitle{Propriété de Markov} \framesubtitle{Propriété de Markov version :Faible et Forte} bla bla  \end{frame}  \subsection{Semi-groupes et générateurs d'une diffusion d'Itô} \begin{frame} \frametitle{Semi-groupes} \frametitle{Définition d'un Semi-groupes} bla bla bla  \end{frame}  \begin{frame} \frametitle{Définition d'un Générateur d'une diffusion d'Itô} \framesubtitle{Notation} bla bla  \end{frame}  \subsection{La formule de Dynkin} \begin{frame} bla bla bla  \end{frame}  \section[Simulation]{Simulation} \subsection{A-1} \begin{frame} bla bla bla  \end{frame} \subsection{A-2} \begin{frame} bla bla bla \end{frame} \subsection{A-3} \begin{frame} bla bla \end{frame} \subsection{A-4} \begin{frame} bla bla  \end{frame} \subsection{A-5} \begin{frame} bla bla \end{frame} \end{document}

I've got a rather long table of contents for my presentation in beamer, and it doesn't fit on one frame. I know I can provide a table of contents per section, or to manually break it between sections into a few frames using \tableofcontents[sections={1-3}] etc., but I was hoping there is a way for LaTeX/beamer to do it automatically for me.  So, in short:      Is it possible to automatically break the table of contents in beamer between frames?   And of course, if yes, how would I go about it?


Goal: create an array from an 'if statement' that I can use for my object.  Here is the code. I want to use the method laneChoice() to determine which array to create, I plan on using more 'else if' statements. but for the time being, I keep getting a NullPointerException Which i assume that the reason being that private String[] Matchup is not updating?      private String[] Matchup;   .  public class ChampionAnalysis {     private String lane;     private int aggression;     private String tankOrDps;     private String damageType;     private int mechanics;     private String champion=null;     private String[] Matchup;      public ChampionAnalysis(String lane, int aggression, String tankOrDps, String damageType, int mechanics) {         this.lane = lane;         this.aggression = aggression;         this.tankOrDps = tankOrDps;         this.damageType = damageType;         this.mechanics = mechanics;      }      public String[] laneChoice(){         if(lane.equals("TOP")){             String[] Matchup = new String[] {"Aatrox", "Camille","Cho'Gath","Darius","Dr.Mundo","Galio","Garen","Gnar"                     ,"Hecarim","Illaoi","Jarvan IV","Kled","Malphite", "Maokai","Nasus","Nautilus","Olaf"                     ,"Poppy","Renekton","Shen","Shyvana","Singed","Sion","Trundle","Udyr","Vladimir","Volibear"                     ,"Wukong","Yorick","Zac"};          }             return Matchup;      }      public String toString(){         return (Matchup[1]);     }

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?


COM doesn't support generics?What would be the best way to replicate this List<T> so that it's COM visible in the tlh file. EDIT::  c#::  [ComVisible(true)]     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]     [Guid("FA677671-5E26-4307-AD2B-19BF1E7AFF8B")]     public interface IEvents     {         IEvents[] CreateListeners();     }   in C++ i have,   CComSafeArray<CSharp::IEvents> ppSA;     pInterface->CreateListeners(ppSA->GetSafeArrayPtr());   My question what i should do in this Create instance function so asto replicate this statement  List evt=new List(); in the managed c#?

I am attempting to return a collection of departments from a .NET assembly to be consumed by ASP via COM Interop. Using .NET I would just return a generic collection, e.g. List<Department>, but it seems that generics don't work well with COM Interop. So, what are my options?  I would like to both iterate over the list and be able to access an item by index. Should I inherit from List<Department>, implement an IList, IList<Department> or another interface, or is there a better way? Ideally I would prefer not to have to implement a custom collection for every type of list I need. Also, will List[index] even work with COM Interop?  Thanks, Mike  Example .NET components (C#):  public class Department {     public string Code { get; private set; }     public string Name { get; private set; }     // ... }  public class MyLibrary {     public List<Department> GetDepartments() {         // return a list of Departments from the database     } }   Example ASP code:  <% Function PrintDepartments(departments)     Dim department     For Each department In departments         Response.Write(department.Code & ": " & department.Name & "
")     Next End Function  Dim myLibrary, departments Set myLibrary = Server.CreateObject("MyAssembly.MyLibrary") Set departments = myLibrary.GetDepartments() %>
Departments
 <% Call PrintDepartments(departments) %>
The third department
 <%= departments(2).Name %>   Related questions:


I have a 1GB-VPS-hosted site running on Ubuntu 10.04 LTS. I am using nginx as the web server. The site has been running in a relatively stable configuration for three years, and handles about 4 million pageviews a month.  For the past 16 hours, I've been seeing what I believe is a "mild" DDoS attack. Outgoing traffic has multiplied by 5, and CPU usage has roughly tripled. I am seeing in my nginx logs a one or two IPs each second sending multiple requests simultaneously (1-10 each). These requests seem not to be going to my URL, but my IP address directly. Since I am somewhat comfortable with the nginx.conf, I set up a separate "default" server block there to catch this traffic and log it. I have it set to log that traffic and return error code 444 to it. I also set up limit_req_zone and limit_conn_zone for this traffic, though since these are different IPs sending requests, that has little impact. Here is the relevant section of nginx.conf:  limit_req_zone  $binary_remote_addr  zone=ddos:25m   rate=1r/m; limit_conn_zone $binary_remote_addr zone=blockedfuckers:20m;     server {     listen 80 default_server;     server_name _;     access_log /var/log/nginx/a2.log hackers;     limit_req zone=ddos nodelay;     limit_conn blockedfrakers 1;     return 444; }   This knocked CPU usage down by about 30%, but outgoing traffic is still high, and the CPU is still over double normal. For some reason, the log shows the requests being sent a 400 response, not the 444 I am trying to send. For example:  109.198.195.28 [12/Mar/2013:22:49:24 -0400], REQLENGTH: 0, STATUS: 400, HTTPHEADER: - 107.199.204.111 [12/Mar/2013:22:49:36 -0400], REQLENGTH: 0, STATUS: 400, HTTPHEADER: - 107.199.204.111 [12/Mar/2013:22:49:36 -0400], REQLENGTH: 0, STATUS: 400, HTTPHEADER: - 107.199.204.111 [12/Mar/2013:22:49:36 -0400], REQLENGTH: 0, STATUS: 400, HTTPHEADER: - 107.199.204.111 [12/Mar/2013:22:49:36 -0400], REQLENGTH: 0, STATUS: 400, HTTPHEADER: - 107.199.204.111 [12/Mar/2013:22:49:36 -0400], REQLENGTH: 0, STATUS: 400, HTTPHEADER: -   These look like "empty" requests to me, so I am trying to configure iptables to just drop those, but the few things I've tried haven't worked. Any ideas on how I can target & drop this traffic?

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?


Any answers to this question I would hope would cite at least one reputable source; I'm really not looking for 40 opinions. As a nonspanker, I'm frequently surprised this is still in practice around the world--probably a majority. Most of my friends (including medical professionals and teachers) start out their defense/explanation "Yeah, but ..."  My concern is: everybody has a breaking point. Traumatic stress beyond a certain level damages the psyche, permanently. That point is different for each child, and once it's reached, you're child will never be the same. You don't know when you start spanking what the cut off is for causing emotional harm rather than "education." Does the evidence suggest my concerns are warranted?  I'm not trying to come across as judgmental, and I'm not looking for anecdotes. I'm wondering if there is bona fide long-term research on this subject. I'll even accept being soft if that's what the research suggests.

Is there any scientific evidence that non-harmful spanking does or does not exist? Furthermore, is it ever effective (whether or not it is harmful)?


I have  been practicing ratio test and root test and it came to my attention that indeed the ratio test is weaker than root test, I have been able to find only one example in the related links. I am aware that it is rare for such to happen but I hope someone could provide me with more examples of where ratio test fails and root tests succeeds.

Question: Give a sequence $(a_n)_{n=1}^\infty$ with $a_n>0$ such that root test works while ratio test does not work, that is,    $$\lim_{n\rightarrow\infty}(a_n)^{\frac{1}{n}} \text{ exists}$$   while    $$\lim_{n\rightarrow\infty}\frac{a_{n+1}}{a_n} \text{ does not exist}.$$   My attempt:   Define a sequence $(a_n)_{n=1}^\infty$ such that      $$ a_n =  \begin{cases}        2^{n-1} & \text{if }n \text{ is odd,} \\    2^{n+1} & \text{if }n \text{ is even}.    \end{cases}  $$         Odd subsequence $(a_{n_j})_{j=1}^\infty$ implies that $\lim_{j\rightarrow\infty}(a_{n_j})^{\frac{1}{n_j}} = \lim_{j\rightarrow\infty} 2^{1-\frac{1}{n_j}} = 2 $ while even subsequence $(a_{n_k})_{k=1}^\infty$ implies that $\lim_{k\rightarrow\infty}(a_{n_k})^{\frac{1}{n_k}} = \lim_{k\rightarrow\infty} 2^{1+\frac{1}{n_k}} = 2.$     It follows that $\lim_{n\rightarrow\infty}(a_n)^{\frac{1}{n}} = 2,$ that is, root test works.      However, for odd subsequence $(a_{n_j})_{j=1}^\infty,$     $$\lim_{j\rightarrow\infty}\frac{a_{n_j+1}}{a_{n_j}} = \lim_{n\rightarrow\infty} \frac{2^{n_j+1}}{2^{n_j-1}} = \lim_{n\rightarrow\infty} 4 = 4.$$     For even subsequence $(a_{n_k})_{k=1}^\infty,$     $$\lim_{k\rightarrow\infty}\frac{a_{n_k+1}}{a_{n_k}} = \lim_{k\rightarrow\infty} \frac{2^{n_k-1}}{2^{n_k+1}} = \lim_{k\rightarrow\infty} \frac{1}{4} = \frac{1}{4}.$$     Therefore, $\lim_{n\rightarrow\infty}\frac{a_{n+1}}{a_n}$ does not exist, that is, ratio test does not work.  Does my example work?


I have written several functions in blender scripting mode. I need to pass their variables through Matlab thanks to the py command (Matlab - Python connection). The problem is that these functions work only in Blender (I have written a simple example below). I was wondering if there is a way to call blender in each python function in order to execute them (Python - Blender connection). I have already read about the possibility to call blender from the script thanks to the "subprocess" function, but I have not understood very well how to do it. A simple function can be: def monkey(x_coord, y_coord, z_coord):     import bpy     bpy.ops.mesh.primitive_monkey_add(size = 2, enter_editmode= False, align = 'WORLD', location = (x_coord, y_coord, z_coord))  How can I modify it in order to run blender everytime the function is called from matlab? Maybe it can be understand better by looking to what happen in matlab. I write my function:  but when I call it from the command window the result is an error:  I think this is due to the fact the the bpy module is only defined in Blender. I was wondering if there was a command to place before import bpy to make Blender run and so, avoid the error.

I'm interested in using Blender for producing images, 3d files, or calculating geometry on a server.  Can I make blender run a python script without opening a GUI?  If not, can I incorporate Blender's python API into my own python script without running a GUI?


I have UK VISA Valid for 10 years with a condition  “only valid if accompanied by father or mother.” Now I have attained 21 year of age can I enter UK without parent now..?

I got a visa with my mother when I was 17 years old. On it was stated "Not valid unless accompanied by my mother".    Can I travel to the UK alone now that I am 18?


My account on Stack Overflow is currently question banned. What should I do in order to be able to ask questions on Stack Overflow again?  I'm beginner on Stack Overflow and Meta. Please advice me on what I should do.   In the last few minutes I asked some java question on Meta because I can't ask question on Stack Overflow. So I asked in Meta but I didn't receive any answer and my question was vote-down but I don't know why!

If you are reading this, you may have been affected by one of our post quality bans. If so, it is important that you  to understand what has happened and how to regain the permissions that you lost. While trying to ask a question, one could see:  We are no longer accepting questions from this account. See  to learn more.  Likewise, for answers:  We are no longer accepting answers from this account. See  to learn more.   Why am I getting this message? Are deleted posts taken into account too? Is a question/answer ban the same as a suspension? How do I avoid getting a question ban? How long do I have to wait before I can post again? What can I do to release the ban? How can I reactivate my account? Can I simply create a new account? I'll just ask somewhere else on the SE network, and they'll migrate my question to the correct site! Will a ban on one Stack Exchange site affect my standing on other sites in the network? Does this apply to meta sites too? My account is in good standing. Why am I still blocked?


I was unable to install subversion on Ubuntu 14.04. I am getting the error message below:  $ sudo apt-get install subversion   Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  subversion : Depends: libsvn1 (= 1.8.8-1ubuntu3.2) but it is not going to be installed               Depends: libapr1 (>= 1.4.8-2~) but it is not installable               Depends: libaprutil1 (>= 1.2.7+dfsg) but it is not installable E: Unable to correct problems, you have held broken packages.   Please could be the problem.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


Consider the following output from df.  Filesystem      Size  Used Avail Use% Mounted on /dev/sda1        23G  6.1G   16G  29% / udev             10M     0   10M   0% /dev tmpfs           397M  420K  397M   1% /run tmpfs           5.0M     0  5.0M   0% /run/lock tmpfs           1.8G  904K  1.8G   1% /run/shm /dev/sda6       890G  324G  521G  39% /home /dev/sdb1       459G  267G  169G  62% /home/user/mnt none            4.0K     0  4.0K   0% /sys/fs/cgroup   How can I only show lines that begin with "/dev" and keep the heading, but  filter out everything else. I'd also like to not have to resort to using using temporary files or variables?  Note: the heading is locale dependent, therefore you can't catch it with a regexp.

Assuming a simple grep such as:  $ psa aux | grep someApp 1000     11634 51.2  0.1  32824  9112 pts/1    SN+  13:24   7:49 someApp   This provides much information, but as the first line of the ps command is missing there is no context for the info. I would prefer that the first line of ps be shown as well:  $ psa aux | someMagic someApp USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND 1000     11634 51.2  0.1  32824  9112 pts/1    SN+  13:24   7:49 someApp   Of course, I could add a regex to grep specifically for ps:  $ ps aux | grep -E "COMMAND|someApp"   However, I would prefer a more general solution as there are other cases in which I would like to have the first line as well.  Seems like this would be a good use case for .


I have a file called draft.tex.  In it are  \documentclass… \usepackage…    … some macros    … \begin{document} \maketitle \input{sec1.tex} \input{sec2.tex}    … bibliography stuff \end{document}   the files sec1.tex & sec2.tex look like  \section{title of sec} text   I would like to edit sec1.tex and then make the document.  The only way I know how to do this is to change the editor focus to a window containing draft.tex, and then typesetting.  Is there a way of doing this in one step, without having to change the editor window focus?  Even better, without opening draft.tex at all?  Apologies if this has been answered before.  I couldn't find it.

My problem is that I want to have different .tex files for the preamble, the presentation aroundings (my target is a beamer PDF file) and the content of the presentation.  Mostly I'll be working on the content file. I even think about partitioning this content .tex file into several chapter files for a better overview. My problem with this solution is that I have to open the presentation.tex file to typeset the whole beamer PDF for looking at the results of my previous changes on the content files. (My presentation.tex file includes the preamble and the content.)  Is there any way to get TeXShop to always typeset one particular file (my presentation.tex) although I'm currently working on a different one (e.g. the content.tex)?  A shortcut? A command in the .tex file? An option in TeXShop? Anything?


I got this question, which I have to prove by induction:     Let $X$ be the topological space and $A_1, \dotsc, A_n$ closed subsets of $X$ with $\bigcup_{k=1}^n A_k = X$.   Then there exists some $i \in \{1,...,n\}$ such that $A_i^\circ \neq \emptyset$.   I really don't know how to prove that, not even how to start... Would be nice if you could give me some tips.

I was studying a text () when in a proof the author stated:  !  If I got it right, the author says that $\widetilde{U}$ (a nonempty open connected set in $\mathbb{C}^n$) is a finite union of closed sets, so one of these closed sets must have nonempty interior.   I tried to prove it but I could not. I think it is a very simple topological detail I am missing.


I am using MapServer to add a WMS layer on a basemap using OpenLayers 3. The WMS generates a png image from a shapefile, which I need to overlay on a basemap. Below is the code which I used to overlay the WMS layer.  var zone_wms = new OpenLayers.Layer.WMS("FEMA Flood Zones", "http://localhost:81/cgi-bin/mapserv.exe?map=/MapServer/maps/femawms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=FEMA_NFHL_POLY_STATUS&STYLES=&SRS=EPSG:4326&BBOX=-69730.2,777408,331075,959674&FORMAT=image/png", {   layers: "Flood_Hazard_Zones",   transparent: "true",   format: "image/png" });  map.addLayer(zone_wms);    However, when I do that, the layer is repeated on each of the tile on the basemap. For example, when I am at a zoom level=1, there are 8 images (one of each tile) displayed. When I am at zoom level=2, there are 32 images displayed on the basemap... and so on. Also, I am not sure how to specify the exact location (lat+long+bounding box) of the WMS layer that is overlaid on the map.  I am sure, you would have figured it out that I am newbie to the GIS world..so please forgive me for my ignorance.

Problem I have: map tiles from my layer are being repeated.  Shapefile is projection 3059. I have specified 3059 is in the mapfile and also when creating map object.  I know OpenLayers.Layer.WMS is recommended, but when I use it I only see empty map. When I use OpenLayers.Layer.MapServer, map is displayed (and tiles are repeated), so I'm using that for now.  My layer (EPSG:3059) looks like this    Versions: Openlayers 2.13.1 MapServer 6.0.3  WMS Server mapfile:  MAP     NAME country_map     STATUS ON     SIZE 800 500     EXTENT 313187.4 146161.56 766469.92 470367.64     UNITS METERS     SHAPEPATH "shapefiles"     IMAGECOLOR 155 155 155      WEB         TEMPLATE "template.html"         IMAGEPATH "C:/MS4W/ms4w/apache/htdocs/gis/output/"         IMAGEURL "/gis/output/"          METADATA             "wms_title"             "MapServer + Openlayers"             "wms_onlineresource"    "http://localhost:1025/cgi-bin/mapserv.exe?map=C:\MS4W\ms4w\Apache\htdocs\gis\mapfile2.map"             "wms_enable_request"    "*"             "wms_srs"               "EPSG:3059"         END     END      PROJECTION         "init=epsg:3059"     END  # example layer     LAYER     METADATA         "wms_title"             "lat_rob_region"     END     NAME "lat_rob_region"     DATA lat_rob_region     STATUS ON     TYPE POLYGON         CLASS             NAME "lat_rob_region"             STYLE                 COLOR 0 255 0             END         END     END END   Javascript:  var lon = 25; var lat = 57; var zoom = 5; var map, layer1;  function init() {     map = new OpenLayers.Map( 'map',{displayProjection: new OpenLayers.Projection("EPSG:3059")} );      layer1 = new OpenLayers.Layer.MapServer( "Country map",              "http://localhost:1025/cgi-bin/mapserv.exe?map=C:/MS4W/ms4w/Apache/htdocs/gis/mapfile2.map", {layers: 'lat_rob_region'},             {gutter: 15},{srs: 'EPSG:3059'});     map.addLayer(layer1);      map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);     map.addControl( new OpenLayers.Control.LayerSwitcher() ); }


I have three identical Windows 7 machines, and the OS is up to date. I just figured out that all three have always a minimum 13% CPU load (1/8 cores) which is due to NT kernel according to the task manager (and not due to a service).  By searching the web I found out that a driver is maybe in cause. I have downloaded the performance monitoring tools from Windows 7 SDK, as well as the UIforETG frontend. I have successfully recorded a trace and visualized it in the SDK GUI. There I can find the "system" process which roughly has 13% of the hits, but I cannot find any information about the drivers.  How can I identify the driver kernel use?

I have noticed that from some time my system is freezing and its probably caused by the high CPU usage which is caused by the system process.  All applications I'm running is the Skype, TeamSpeak and Chrome so it definitely shouldnt eat that amount of CPU.  You can see the problem itself and running processes in the screenshot below:    Sometimes CPU usage is reaching 90%, but the average usage is like 40-65%.  My PC parameters:   Windows 8 (customer preview) Intel Core i3 - 2350M 8 GB RAM   I'd appreciate any help attempt! Regards.  --UPDATE--  As the user below posted a great answer, I have noticed that the process that is eating the most CPU in the system is called Arthurx.sys, simple google tells that it's a TPLink driver (an wifi adapter, I have bought like 2 weeks ago!) drivers has been installed from the Windows MSDN, but also tried to install the drivers from the attached CD, but it doesn't help. From the system start, it is using like 5% of the CPU only, but after 2-4 hours of working it is growing up and reaching 40-60% of the CPU usage.  Device name: TPLink WN722N


If $G$ is a group of order $|G|=10^6$, then $G$ cannot be simple. I hame hoping to get feedback on my proof attempt; I am using: Lemma: Let $|G|=p^am$, where $a>1$ and $m>1$. Assume $G$ is simple, then the following are satisfied:  $n|m$ $n \equiv 1 \pmod p$ $|G|$ divides $n!$ where $n=n_p(G)$  Proof: Assume $G$ is simple with $|G|=10^6=2^6 \cdot 5^6$. We can apply the Lemma from above with $p=5$. Let $n=n_5(G)$. Then, $n\mid 2^6=64 \implies n \in \{2^1,2^2,2^3,2^4,2^5,2^6\}$. Since $n \equiv 1(\mod 5)$ and $10^6\mid n!$, then $2^4 \equiv 1(\mod 5)$ (no other powers of 2 fit this way). Since we assumed that $G$ is not simple, then $n \neq 1$. Thus, $n=2^4=16$. To see if $10^6\mid 16!$, we can look at $5^6\mid 16!$. $16!=1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 \cdot ... \cdot 10 \cdot ... \cdot 15 \cdot 16$. Clearly, there are three $5$'s contained in $16!$.  $\therefore$ The largest power of $5$ to divide $16!$ is 3.  $\therefore$ $G$ is not simple.

Problem: Prove there are no simple groups of order $1,000,000$.   So, I have used Sylow's Theorem to get that the number of Sylow $5$-subgroups is either $1$ (and we're done) or $16$.  I am assuming we have $16$, and let $H$ and $K$ be two of these Sylow $5$-subgroups. I'm trying to show $H \cap K$ is normal in $G$.  So, $|H\cap K| = |H||K|/|HK| > |H||K|/|G| \approx 244.14$  So since $H\cap K<H$, $|H\cap K|$ divides $|H|$. Thus, $|H \cap K| = 625$ or $3125$.  IF $|H\cap K| = 3125$, then $[H \cap K:H] = 5$ which is the smallest prime divisor of $15625$. So $H \cap K$ is normal in $H$ and normal in $K$. This forces $HK$ to be contained in the normalizer of $H \cap K$. Since the normalizer of $H \cap K$ is a subgroup of $G$, then its order must divide $G$. The size of $HK$ is $3125^2$, which is contained in the normalizer. So $3125^2$ must divide $1,000,000$. Contradiction.   So the normalizer of $H \cap K$ is all of $G$, and $H \cap K$ is normal.  I am completely stuck on what to do if $H \cap K$ has order $625$. Any help would be much appreciated.


How can I set straight several edges in one action?  My current workflow is to select each edge, Shift+X+0, but I'm sure there is a more efficient way to do it, as with the Loop Tools -> Relax button.  I know the UV squares has the feature to grid by shape, but what I need is to get several edges on the same axis straight without affect the angle of the edges on the other axis.  Is that possible? Can you help?

How can I straighten ALL the vertical UV lines at once? Is there a hot keyshort cut? Or if I have to do them one by one .. is there at shortcut for that? Thank you!


When I try to start the swing timer using timer.start(); it just brings up a null pointer exception error that I have no idea how to fix. Am I calling it wrong? I've seen examples of it having the timer.start();  in the actual timer method but I don't know where to put it in my code. Any help would be appreciated!!!! Thank you. import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Scanner; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.Timer;  public class Board extends JPanel {     private Timer timer;     @Override     public void paintComponent(Graphics g)     {         super.paintComponent(g);         g.fillRect(30, 30, 640, 640);//makes a black square         for(int i=30;i<=510; i+=160)//adds white columns         {             for(int j=30; j<=510; j+=160)             {                 g.clearRect(i,  j,  80,  80);             }         }         for(int i=110; i<=590; i+=160)//adds black columns         {             for(int j=110; j<=590; j+=160)             {                 g.clearRect(i, j, 80, 80);             }         }         g.setFont(new Font("Monospace", Font.BOLD, 30));         g.setColor(Color.WHITE);         g.drawString("a", 85, 660);         g.drawString("c", 245, 660);         g.drawString("e", 405, 660);         g.drawString("g", 565, 660);         g.drawString("7", 35, 140);         g.drawString("5", 35, 300);         g.drawString("3", 35, 460);         g.drawString("1", 35, 620);                  g.setColor(Color.BLACK);         g.drawString("b", 165, 660);         g.drawString("d", 325, 660);         g.drawString("f", 485, 660);         g.drawString("h", 645, 660);         g.drawString("8", 35, 60);         g.drawString("6", 35, 220);         g.drawString("4", 35, 380);         g.drawString("2", 35, 540);         timer.start();     }     public void showX(Graphics g)     {         g.setFont(new Font("wrongFont", Font.BOLD, 200));          g.setColor(Color.RED);         g.drawString("X", 35, 540);     }     public void boardImage()     {         JFrame frame=new JFrame();         frame.setSize(600, 600);         frame.getContentPane().add(new Board());         frame.setLocationRelativeTo(null);         frame.setBackground(Color.LIGHT_GRAY);         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         frame.setVisible(true);         CoordinateGame game=new CoordinateGame();         frame.addMouseListener(new MouseAdapter()          {             public void mouseClicked(MouseEvent e)              {                 int x=e.getX();                 int y=e.getY();                                  }         });      }     public static void Timer()     {         class TimerListener implements ActionListener         {             int elapsedSeconds = 30;             @Override             public void actionPerformed(ActionEvent evt)             {                 Timer timer = new Timer(1000, new TimerListener());                 elapsedSeconds--;                 System.out.println(":(");                 if(elapsedSeconds <= 0){                     timer.stop();                 }             }         }     }      }

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 been taught in some computer science theoretic courses that two types of infinities exist: dense and countable, e.g. dense (uncountable) : real numbers, countable: integers.  And that therefore dense "sort of" > countable...  I would be interested if someone develops these concepts..  Moreover, could an ''intuitive'' definition be given for ''dense'' with regards to infinities ? Also, can you disscuss if it makes sense to say thant the reals are larger than the integers ? (as it is sometimes said informally)

Can someone explain to me how there can be different kinds of infinities?  I was reading "" by  and came across the concept of countable and uncountable infinities, but they're only words to me.  Any help would be appreciated.


Give a proof of the following identity using a double-counting argument:   $\sum_ {k=0} ^r {m \choose k} {n \choose r - k} = {{m+n} \choose r} $   Then using this result, derive the following special case from it.   $\sum_ {k=0} ^n {n \choose k}^2 = {2n \choose n} $ ?  For the first one, the method that I have is starting with the right hand side:   Assume that k is a small number, which is less than r and m. We choose r from m + n can be divided into 2 parts:   Choose k from m. Choose r - k from n.    My thinking is we can choose k from m and them choose r - k (because we only need to choose r) from n.  I'm stuck with the next part and not sure if my proof for the first part is right or not.

Please feel free to close this is necessary as I didn't see exactly this question (some variations that I tried but didn't seem to apply. Prove: $$\sum_{k=0}^{n}{\binom{n}{k}^2}=\binom{2n}{n}$$ I figured trying to muscle through it by expanding and then multiplying each term by variants of 1 such as $\frac{n^2}{n^2}$ and $\frac{n^2(n-1)^2}{n^2(n-1)^2}$ to get common denominators, but that was NOT the way it seemed as it got ugly pretty quickly.  Then I tried thinking up formulas of the binomial theorem that I could differentiate like other sums of binomial coefficient problems and i couldn't think of one.  Any help here would be great.


There is an acronym- RPD. In a ppt, made by my teacher for the students, there is a sentence-  When the posterior abutment opposes the edentulous space or a RPD.  However as I speak this sentence I automatically use an RPD due to the sound of 'aar' for R. So is it correct that a same sentence is written and spoken but one with 'a' and other with 'an'? Or something is wrong, me or the ppt?

99% of the time, I'm clear on when I should use "a" versus "an." There's one case, though, where people & references I respect disagree.  Which of the following would you precede with "a" or "an," and why?   FAQ FUBAR SCUBA   [Note: I've read the questions  and , but the rules given there don't necessarily apply here.]    [Edited to add]  Here's a shorter (and hopefully clearer) version of the question…  In written English, which is correct (and why): "a FAQ" or "an FAQ"?  Some references with differing opinions:   an: the  and  a: the Microsoft Manual of Style for Tech Publications, 3e either: the  and


So I am writing a program that tokenizes a C program, and so far I have managed to handle most cases that I have been able to think of with one exception. If I have a variable declared as such:  char a[] = "Hello World";   The line gets separated into the tokens char a [ ] = "Hello World" and ; as I ensure that there are always spaces where necessary before I split the string based on spaces. Is there a way to use regexes to split the string only if it has seen an even (0 is even) amount of quotations marks since the last split so that the tokens are char a [ ] = "Hello World" ;?

I'm new to regular expressions and would appreciate your help.  I'm trying to put together an expression that will split the example string using all spaces that are not surrounded by single or double quotes. My last attempt looks like this: (?!") and isn't quite working. It's splitting on the space before the quote.  Example input:   This is a string that "will be" highlighted when your 'regular expression' matches something.   Desired output:  This is a string that will be highlighted when your regular expression matches something.   Note that "will be" and 'regular expression' retain the space between the words.


Folder A has correct ownership and permissions on all its files/subfolders. Folder B exact same content but with ownership and permissions messed up. Need to apply chmod/chown using Folder B as reference on everything under FOlder A.

i have a  tree of files with correct permission. then i have a (filewise) identical tree (with different file contents tough) with wrong permissions.  how can i transfer the permissions layout from one tree to another?


I am trying to resize promoted links tiles to 250px x 250px however am struggling to find a correct method of doing so. These have pictures and title/information text. I've seen some Javascript methods however there appears to be a limitation on how big these tiles can be.  The solution below worked however I am now trying to sort the hover over animation.  The below image shows the tiles I've just created on the bottom row - we'd like them to display the mouseover the same as on the top row and only show the tile description and not the title itself. But only show this on mouse-over. So the tile would be completely clear before hand.

Hello,   I create an app using the Promoted Links in Sharepoint 2013. I chose to do this because the feature has the awesome hover effect and is easy to customize the image.  The issue is that I have been trying to figure out how to change the tile sizes. They are awesome the way they are, however I just need them smaller. I still want the hover effect as well and for the text to match the same ratio as the tile. I have tried web zones, I have done each ID but with no luck. I have attached a sample image of the tiles I'm referring to. Please help.


I like Chrome's feature that lets me restore its pages after it's been closed ungracefully. I use that as a way to save my session (e.g. when just rebooting to install OS updates).  What I've been doing until now:   Open Chrome's Task Manager, look for the Browser process and remember the PID. kill the process with that PID (with kill -9 <pid> in Ubuntu and with the task manager in Windows)   I'm looking for a way to do that in just one click, or as few actions as possible. E.g. with a script that I put on my desktop.  I'm looking for a solution both for Windows 7 and Ubuntu Linux.  Note: I know I could use some session-management Chrome extension instead, but I've tried some of those and they don't work exactly , whereas the method described above works exactly like I want, but is a bit too difficult to use.  Note: On both Linux and Windows all my Chrome processes have the name chrome, so I can't differentiate between tab processes and the browser process by name. I'm saying this because I've seen  to kill the process called google-chrome-stable - I don't have such a process.  Edit: I found  which works very well without the need for an killing any processes. I've voted to close my question as a duplicate.

When my computer shuts down due to automatic updates and I restart it all the tabs I had open are restored. But when I do Ctrl + Shift + Q all the tabs are lost.  Is there a way to have my tabs saved when I manually close Google Chrome? Or should I just kill every single instance of it in the Task Manager or something?


None of the currently posted answers works/answers the question. As per my original question, neither setting PS1 nor PROMPT_COMMAND had any effect.  Using only a command at the command prompt, how do I change the title of the current terminal tab? Many posts suggest this: echo -en "\033]0;New terminal title\a"  but it does nothing. None of the current answers works (some don't answer the question), so for clarity:  Once the title is changed, I don't want it to change if I change directory etc I don't want the same title on all tabs. I only want to set the title for the tab I run the command in I want multiple tabs to each have different titles  Also, the PROMPT_COMMAND variable is not set in my terminal sessions. If I set it: PROMPT_COMMAND='echo -en "\033]0;New terminal title\a"'  it has no effect. What is the correct command?  FYI, the output of uname -a is:  Linux d136172 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

I have several instances of terminals running in my working environment, what I would like is to set a specific title for each one, in order to have a clear idea what purpose the specific terminal serves i.e. Apache, editing_ini, postgres etc...  Of course from the command line.


I want to be able to print the contents of a vector in C++ by using operator overloading.  The operator overloading is defined as follows in the debug.cpp file.  #include <iostream> #include <vector>  #include "debug.h" #include "card.h" #include "player.h"  using namespace std;  template <class T> ostream &operator<<(ostream &out, const vector<T> &vector) {         out << "[";         for (int i = 0; i < (int)vector.size(); i++) {                 out << vector[i];                 if (i < (int)vector.size() - 1) {                         out << ",";                 }         }         out << "]";         return out; }  ostream &operator<<(ostream &out, const Card &card) {         out << "[" << card.category << "," << card.players << "]";         return out; }  ostream &operator<<(ostream &out, const Player &player) {         out << "[" << player.num_cards << "," << player.categories << "]";         return out; }   I also have a debug.h file which looks as follows.  #ifndef DEBUG_H # define DEBUG_H  #include <iostream> #include <vector>  #include "card.h" #include "player.h"  using namespace std;  template <class T> ostream &operator<<(ostream &out, const vector<T> &vector); ostream &operator<<(ostream &out, const Card &card); ostream &operator<<(ostream &out, const Player &player);  #endif   This header file is used in my main.cpp file which looks as follows.  #include <iostream> #include <vector>  #include "debug.h" #include "card.h" #include "player.h"  using namespace std;  // Implementation intentially left blank for decluttering. vector<Card> init_cards(const int &SET_SIZE, const int &NUM_SETS, const int &NUM_PLAYERS) {  }  // Implementation intentially left blank for decluttering. vector<Player> init_players(const int &SET_SIZE, const int &NUM_SETS, const int &NUM_PLAYERS) {  }  int main(int argc, const char **argv) {         int SET_SIZE = 4;         int NUM_SETS = 3;         int NUM_PLAYERS = 3;          vector<Card> cards = init_cards(SET_SIZE, NUM_SETS, NUM_PLAYERS);         vector<Player> players = init_players(SET_SIZE, NUM_SETS, NUM_PLAYERS);          cout << cards << endl;    // [1]         cout << players << endl;  // [2]          return 0; }   At the complete end of this file there are the lines [1] and [2] which should print the cards and the players vectors. However, this only works if I put the overloading function from the debug.cpp inside of the main.cpp file. The code shown here does not work and gives me the following error.  g++ -Wall -Wextra -Werror -pedantic -std=c++11 -Wno-unused-parameter -I inc -c -o obj/debug.o src/debug.cpp g++ -Wall -Wextra -Werror -pedantic -std=c++11 -Wno-unused-parameter -I inc -c -o obj/main.o src/main.cpp g++ -Wall -Wextra -Werror -pedantic -std=c++11 -Wno-unused-parameter -I inc -o quaternity obj/debug.o obj/main.o /usr/bin/ld: obj/main.o: in function `main': main.cpp:(.text+0x2b0): undefined reference to `std::ostream& operator<< <Card>(std::ostream&, std::vector<Card, std::allocator<Card> > const&)' /usr/bin/ld: main.cpp:(.text+0x2d8): undefined reference to `std::ostream& operator<< <Player>(std::ostream&, std::vector<Player, std::allocator<Player> > const&)' collect2: error: ld returned 1 exit status make: *** [Makefile:17: quaternity] Error 1   As can be seen the overloaded function cannot be found. How can I make it that the overloaded function will be found?  I already tried to put a namespace std { ... } statement around the declaration of the overloaded function but this did not work. The confusing thing is that all of this does work when I put the overloading functions in the main.cpp file but not when I include them from the debug.cpp file.

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


I have read "What is the recommended wording for a generic error message" and it's helpful, but doesn't address my main question:  What should I prefer in any written programm: The polite or the straight forward way if my program is interacting with the user (e.g. giving feedback to an action or pointing out that something does not work).    I wonder if it's better if the program responds straight to the point or politely.  Consider the following example: The user clicks a button to print something based on a template. However, the template does not exist.  Which feedback would you prefer:   The template is not defined yet. Please make sure to set the template before you print it out.  Make sure to configure the template before printing.    What is generally better?

What would be the best wording for a generic error message?  With generic error message I mean a message for an error that has occured but there are no details on what the error is or how to recover from it.  It will be used exclusively as a fallback solution when it is not possible to determine the error either because the server did not sent any additional details or there is a "probable" timeout... and other similar edge cases.  It should be aimed to minimize the amount of frustration/anger.  I've read a few threads but none of them seems to be 100% relevant     This is actually a very close match but error reports are out of scope in my case


consider i have many methods in jscript..  method1()  method2()  method3()  Now method1() and method2() are independent. where method3() is called by both the methods. I want to know from which method method3() is getting called. either method1() or method2()

function main() {    Hello(); }  function Hello() {   // How do you find out the caller function is 'main'? }   Is there a way to find out the call stack?


I have camera canon eos6D, and I have problem with ISO. When I`m shooting in daylight, or light indoor places, my camera always chooses to have auto ISO over 500, sometimes even over 1000. When I was shooting outdoors in the evening, ISO level was over 2000, even 5000. When I set it lower, not auto, pictures are very dark. Is there something wrong with my camera? Before 6D I had canon 1200D and there were no problems to shooth with low ISO (about 100) outdoors.

I am shooting in natural light, with my subject facing a full floor-to-ceiling south facing window. You would think my meter would allow ISO between 200-400 in bright light, but I was lucky to get it to 640, with f/3.2 and 1/60 (manual mode).  I've read other places that people say put your ISO down to 100 for indoor shots for greatest clarity (especially sharp eyes) — but don't know how I can with subjects potentially moving. Is there a setting in my camera (Canon 5D Mark III) I am missing, or something that might be making my meter need more light?


So I'm working on a code that lets a user input the GTIN-8 code of a product, enter the amount they want and then gives a receipt. However, when I get to the last part of the code where I am trying to multiply the amount of the product and it's price, I get the 'Can't multiply sequence by non-int type 'str' error. Here's a part of the code:  while IfFinished != "Yes":     ProductsWanted=input("Please enter the GTIN-8 Code of the product: ")     AmountOfProducts=input("How many do you want? ")      with open("Productsfile.txt") as f:         for line in f:                 if ProductsWanted in line:                     Receipt=open("ReceiptFile.txt","a")                     Receipt.write("%r, %r, \n" % (line, AmountOfProducts))                     Receipt.close()      if ProductsWanted not in ["23456945","12376988","76543111","92674769","43125999"]:         print("Product not found")      else:         print("Product found")      IfFinished=input("Are you done? If so, type 'Yes' ")     if IfFinished == "Yes":         print("Thank you for shopping with us!")     else:         print("Please continue")  Receipt=open("ReceiptFile.txt","r") print(Receipt.read()) Receipt.close()  with open("ReceiptFile.txt","r") as file:     for line in file:         currentline=line.split(",") quantity=currentline[3] ItemPrice=currentline[2] Totalprice=quantity*ItemPrice price="0" Total=price + Totalprice  print(Total)

I have a tuple of tuples from a MySQL query like this:  T1 = (('13', '17', '18', '21', '32'),       ('07', '11', '13', '14', '28'),       ('01', '05', '06', '08', '15', '16'))   I'd like to convert all the string elements into integers and put them back into a list of lists:  T2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]]   I tried to achieve it with eval but didn't get any decent result yet.


I have been working at a new company for around 4 months now as a statistical modeling analyst, and the existing data science manager and modeling analysts are very familiar with regression techniques, but not newer techniques such as Random Forest and XGBoost. I have built some models for them using these techniques which have shown good results, but they are concerned with the interpret-ability of the models for business use. They want to be able to explain what is happening within the models so that we can explain to our business units what the model is doing.  I am familiar with Importance in Random Forest, and have messed a little bit with importance in XGBoost, and the model plotting in XGBoost, but I was wondering if any of you had ways of getting more information out of these models in order to better explain what is happening and how many a certain variable might be impacting the model.  I know that these models are somewhat blackboxish as to exactly what is happening, but if I could extract as much information as possible from them then I can make a good case for us as a team to start transitioning to using these models more as a team.  I appreciate any advice that anyone can give.

Random forests are considered to be black boxes, but recently I was thinking what knowledge can be obtained from a random forest?  The most obvious thing is the importance of the variables, in the simplest variant it can be done just by calculating the number of occurrences of a variable. The second thing I was thinking about are interactions. I think that if the number of trees is sufficiently large then the number of occurrences of pairs of variables can be tested (something like chi square independence).  The third thing are nonlinearities of variables. My first idea was just to look at a chart of a variable  Vs score, but I'm not sure yet whether it makes any sense.    Added 23.01.2012 Motivation    I want to use this knowledge to improve a logit model. I think (or at least I hope) that it is possible to find interactions and nonlinearities that were overlooked.


How can I browse windows 8 system files with Ubuntu? Whenever I try to access it it says error 14 and does not let me browse the files like in windows 7.

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


I have work on one Magento 2 project with lots of data ~10GB Database + ~1GB CODE + ~5GB Media. And I want to set up it on my local server. So I want to compress the full project with a database. I have tried to create a database backup with this command # mysqldump -u magento2_user -p magento2_db > magento2_db-20201110.sql It takes half-day ~6h to create DB backup and during this process, my sh connection was backed so I need to recreate the backup. Now, I have the better command for tack backup. website:  tar -czvf ~/multi_dump.tar.gz --exclude=var/cache --exclude=var/session --exclude=var/log --exclude=var/tmp --exclude=var/export --exclude=var/report --exclude=var/backups --exclude='media/*import*' --exclude=media/tmp --exclude=media/downloadable --exclude=media/catalog . && echo OK  database:  mysqldump --single-transaction --add-drop-table -h <host> -u <user> -p <db_name> | gzip > dump.sql.gz  It was a very lengthy and time-consuming task. So, I am finding a way to create a database backup with the automatic process in the background. and I am found Ctrl+Z , bg , jobs. means add this process in the background. but when I disconnect my ssh and reconnect it then I can't found that process in the jobs and bg  command. and also I have tried to add this process in crontab -e  but I haven't access it. So, Anyone has any better solution for this problem? This is os detail.

I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and later, after dinner, I want to check on the process that I started before leaving work. How can I do that with SSH? My understanding is that if you break your SSH connection you will also break your login session on the server, therefore killing the long running process.


I just made the step from "4flags" to Ubuntu on my desktop. Managed to install OS ( Ubuntu 18.04), have my WiFi running, installed Flash on Firefox (CLI ), I can NOT create ANY directory via GUI in any of my HOME directories. I could create a file ( to PDF ) that sits alone in my Documents directory, but when clicking my right mouse (in Documents dir) to create a new one... nothing happens.   It doesn't matter if I click right or left button, once or twice, there is no response. I do NOT get the options to create anything. I have the OS only the second day, not going to do it through CLI yet, there must be some simple reason for it, like having (NOT) the rights on my PC to write or create folders. Where can I check this? What could it be? Thanks.

I have installed Ubuntu 18.04 LTS on my HP Pavilion series laptop. After installing this version of Ubuntu, right click is not working of my touchpad. How can I solve this?  BTW:  does not have any solution which which is working for me. PS:- Problem remains after selection area in gnome-tweak-tool


I'm using TexLive 2016. Is there a way I can get the expanded Latex BEFORE it is converted to PDF? Quick example in case I'm asking the wrong question! i.e.  main.tex:  \documentclass[12pt]{article} \begin{document} \section{Some Notes} \input{"testinput.tex"} \subsection*{Mood} Some sub section \end{document}   testinput.tex:  \section{Include Stuff} Did this get included?   Should give:  \documentclass[12pt]{article} \begin{document} \section{Some Notes} \section{Include Stuff} Did this get included? \subsection*{Mood} Some sub section \end{document}   We have some fairly complex nested files so I'm hoping there's a solution to that. I imagine that Latex MUST "assemble" the document before it can be processed?  Thanks!

Suppose I have a document with multiple include or input statements  \input{fileA} \input{fileB}   etc.   Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the actual content of fileA etc. without copying it manually?


I am trying to get the bandwidth of the domain from one file and its hits details from another file.  The format of the two files is as follows:   bandwidth.txt  aadrivingschool.ws       2840.36M aaspak.org               211.57M aasteknik.com            1419.26M aatonerpk.com            14.87M  hits.txt:  onlinestudyboard.com   received  186     hits  from  31/May/2016  at  1201 aaspak.org             received  184     hits  from  31/May/2016  at  1202 khawajarubber.com      received  183     hits  from  31/May/2016  at  1246 aatonerpk.com          received  182     hits  from  31/May/2016  at  1231    What I'm trying to to get is:  onlinestudyboard.com       received  186     hits  from  31/May/2016  at  1201  aaspak.org                 received  184     hits  from  31/May/2016  at  1202  211.57M khawajarubber.com          received  183     hits  from  31/May/2016  at  1246 aatonerpk.com              received  182     hits  from  31/May/2016  at  1231  14.87M

I have a 2 files with the following:   File1.txt  A 1 B 2 C 5 Z 3  File2.txt A 4 B 7  C 10 D 11   What I would like to do is create something like   A 1 4  B 2 7 C 5 10 D - 11 Z 3 -   Is there a utility that does this? If not how Can this be done? Using a find and awk or something?


Can I use a 12 V DC power supply for an 9V AC gadget? Does it get too hot? Or can it work safely? I tried it already and it seemed to work.  Is it safe? The gadget is a telephone.

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


The proof is:  Show that if $u_{2n}$, $u_{2n+1}$, $u_{3n}$ are convergent sequences then $u_n$ is a convergent sequence  I don't know where should I start to justify this correctly...  I tried to apply the property that "if $u_{2n}$, $u_{2n+1}$ are convergent than those limits will be the only sublimits of the series", and because of that if $u_{3n}$ is a sublimit then the 3 sublimits are equal and the sequence is convergent...  But this is not correct I guess because we can have 2 sublimits equal but the other one can be different...   Can someone give a hint?   Thanks!

My friend and I are currently debating the following question:      Let $y_n$ be a sequence in a metric space and assume that the subsequences    $y_{2n}$, $y_{2n + 1}$, and $y_{3n}$ all converge. What can we say about the sequence $y_n$?    To me it seems that all the subsequences will converge to a limit say $y$. Then any term in the original sequence will be in one of these subsequences, it follows that the entire sequence $y_n$ converges to $y$.  I let $\varepsilon > 0$. Since $y_{2n}$ converges to $y$ there exists an index $2N$ such that $d(y_{2n},y) < \varepsilon$ for $2n \geq 2N$, and since $(y_{2n+1})$ converges to $y$ there exists $2M + 1$ such that $d(y_{2n+1}, y) < \varepsilon$ for $2n + 1 \geq 2M + 1$.  Let $m \geq \max\{2N,2M+1\}$. If  $m$ is even, since $m\geq 2N$ we have $d(y_m,y)<\varepsilon$; if $m$ is odd, since $m\geq 2M+1$ we have $d(y_m,y)<\varepsilon$. Thus $d(y_m,y)<\varepsilon$ for any $m \geq \max\{2N,2M+1\}$, and we conclude that $(y_n)$ converges to $y$.   However, my friend does not think that this is completely correct because I didn't use the $y_{3n}$ in the proof. I think he is right, that I do in fact need it, but I am unsure of how to add it in. All in all, I think that since any term in the original sequence will be in one of these subsequences, it follows that the entire sequence $(y_n)$ converges to $y$.  $2n+1$ covers all the odd terms and $2n$ converse all the even terms, so is $3n$ even needed? I would like to use it since the proof has it in the question, but I am unsure of what to do. Could someone kindly help me construct this proof in a better manner,and is my line of thinking correct? Thank you!


$R$ be a ring and $a\in R$ be a non nilpotent element and define $S=\{a,a^2,a^3,\cdots\}$ and $F=\{A\subseteq R| A-ideal \;, S\cap A=\emptyset\}$ If $P$ is maximal ideal of $F$, is $P$ prime ideal? I am self studying abstact algebra but I didnot understand first of all is the set $F$ a ring? In what operations? Furthermore, how one can show this ?

In the midst of attempting to prove that for a commutative ring $A$ with identity, and an ideal $I$ of $A$, $I = \operatorname{rad}(I)$, where $\operatorname{rad}(I) = \{x: x^m \in I, m >0\}$, implies that $I$ is an intersection of prime ideals, I've run into a little bit of confusion.   An answer to another question on this site, , indicates a strategy that I am attempting to use. I know that if $x$ is an element of $A\setminus I$, then so too is $x^m$ for any positive integer $m$. I use this fact to consider a subset $X = \{x^m : m > 0\}$, which is closed under multiplication, and use Zorn's lemma to find an ideal of $A$ containing $I$ maximal with respect to the constraint that said ideal, $J$, is disjoint from X.  I want to prove $J$ is prime by contradiction. I suppose that $J$ were not prime; this also means that $J$ is not maximal in $A$. Then there would exist two elements, $f$ and $g$, of $A$ so that $fg$ is in $J$, but neither $f$ nor $g$ is in $J$. Following the prompting of the aforementioned answer, I know that $J + \langle a\rangle$ and $J + \langle b\rangle$ would be ideals strictly containing $J$, and since J is the maximal ideal disjoint from $X$, both $J +  \langle a\rangle$ and $J + \langle b\rangle$ contain at least some elements of $X$ (I am tempted to say all of them, but I'm not entirely sure that's true, in case for example $\langle a\rangle$ started containing powers of $x$ at $x^2$, in which case it isn't necessarily true that $\langle a\rangle$ contains $x$ itself), and so both $\langle a\rangle$ and $\langle b\rangle$ must themselves contain elements of $X$.  And this is where I am stuck. I feel like there is something I should know about multiplicative subsets of rings that would help me arrive at the desired contradiction, but I can't remember what it might be.


I am having an array like :  array (   ['fruit1'] => banana,   ['fruit2'] => apple,   ['fruit3'] => grapes,   ['fruit4'] => orange  )   And I want the array Like :  array(banana,apple,grapes,orange);   Please suggest how can I convert it.

I have the following array, which I would like to reindex so the keys are reversed (ideally starting at 1):  Current array (edit: the array actually looks like this):  Array (  [2] => Object     (         [title] => Section         [linked] => 1     )  [1] => Object     (         [title] => Sub-Section         [linked] => 1     )  [0] => Object     (         [title] => Sub-Sub-Section         [linked] =>      )  )   How it should be:  Array (  [1] => Object     (         [title] => Section         [linked] => 1     )  [2] => Object     (         [title] => Sub-Section         [linked] => 1     )  [3] => Object     (         [title] => Sub-Sub-Section         [linked] =>      )  )


I am trying to calculate the sum of S=(1-1/2 +1/3-1/4+...). I used wolfram Alpha but the answer makes no sense to me.    Thank you in advance.

I know that the harmonic series $$\sum_{k=1}^{\infty}\frac{1}{k}  = \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \frac{1}{6} + \cdots + \frac{1}{n} + \cdots \tag{I}$$ diverges, but what about the alternating harmonic series   $$\sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{k}  = \frac{1}{1} - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \frac{1}{5} - \frac{1}{6} + \cdots + \frac{(-1)^{n+1}}{n} + \cdots \text{?} \tag{II}$$  Does it converge?   If so, what is its sum?


I've written a bash script to install some packages on the first boot of my Ubuntu 16.04 VPS. The VPS platform that I'm using runs it during the server commissioning process. When it runs I'm getting this sort of error:  ... Reading package lists... E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ ...   So my question is: How do I sleep until it's okay go go ahead with the install?  I've done quite a bit of Googling to find a solid answer to this (I'm new to bash scripting), and have come across several proposed solutions, but there's lots of noise.  are specific to certain provisioning systems, and other approaches seem .  My solution at the moment is just a sleep 30 at the top of my script which is definitely not a robust solution.  I tried putting together something like this but it doesn't seem to work:  while true do   sudo lsof /var/lib/apt/lists/lock &> /dev/null   [ $? = 0 ] && break   sleep 1 done   On my personal machine it sleeps forever because of an error (WARNING: can't stat() fuse.gvfsd-fuse...), and on the VPS, it doesn't seem to sleep at all.  Any ideas why that doesn't work, or ideas for a better approach?    By the way, if you're interested, the script I'm trying to run is simply:  #!/bin/sh curl -sL https://deb.nodesource.com/setup_8.x | bash - apt-get install -y nodejs   And the full output can be seen in .

I have seen many softwares such as Update Manager and Synaptic Package Manager, they wait if some other program is using the /var/lib/dpkg/lock and is locked. How can we do this through the Terminal? I saw apt-get's manual but didn't find anything useful.


I know that exists a retrocompatiblity, but those PSOne games I've own, were bought before PS Vita being released.

Specifically, those purchased legally through the PSN Store. It seems like it should, but I can't find a definitive answer anywhere.


I have a requirement, for each Accountwhose name contains ‘Sale’, ‘Opportunity’, or ‘Catalog’, set Price_Type__c to ‘Net’.  This is what I code in Anonymous Apex:  set<string> myString = new Set<String>{'%Sale%', '%Opportunity%', '%Catalog%'}; List<Pricebook2> myList = [select Name from Pricebook2 where name LIKE IN: myString]; for (Pricebook2 rec : myList) {     rec.Is_Auto_Maintained__c  = true;     rec.Price_Type__c ='Net;' } update myList;   and it threw an error : "     expecting a colon, found 'IN'   ". So is there any other solution to this?

I have a list of accounts that I would like to perform a LIKE query on. Ideally, my query would be something like:  SELECT id, owner.name FROM Account WHERE name LIKE IN :entityList   Is there any way I can do this?  The issue is that my entity names come from a third party source, which means that small variations in name may be present, i.e     "Bay Ridge apt." VS "Bay Ridge Apartments"   It's hard to predict where the difference in spelling might be, and I was hoping that the LIKE filter might be some magical filter that can figure this out for me and match on a substring (i.e. "Bay Ridge").  The Salesforce guide doesn't include this option in their guide, so it might not be possible to combine a LIKE and an IN. Maybe there's a solution around it?  Maybe there's a way to perform a SOSL query on a list? Something like :     Find {entityList} In Account   I can't seem to find this any where...  Any guidance?  EDIT: It seems that it's not really possible to 'bulkify' SOSL queries. I could have ran a loop, but this would have hit governor limits. Using the LIKE filter with strategic wildcards was key.


\section{Results} In the figures attached in \textbf{Section 0.6} and in this section, two options are show that can be accessed by the user.   \begin{figure}[!h] \centering \includegraphics[width=0.75\textwidth]{bookin2.jpg} \caption{A User entering Specific Data to book a room.} \end{figure} \begin{figure}[!h] \centering \includegraphics[width=0.75\textwidth]{data.jpg} \caption{User can view his data, if he commands the system.} \end{figure}  It has made it much simpler for the user, to simultaneously access his previous booking details, and make a new booking for further use.   I am trying to put these both pictures vertically in one section, but only the first picture is being placed there. the second one is being placed at the end of document after two sections. i am writing a report. Any help with it?

Is there any package or a method to force LaTeX to keep floating environments like table and figure closer to where they are declared?


Suppose I have the following python "module" named bloop.py:  def f(x):     return x+1  def a(x):     return f(x)   How can I make function f(x) unavailable, or unusable, when the script is imported? This means that when the user attempts to do something like the below, it will fail.  import bloop print bloop.f(10)

I am coding a small Python module composed of two parts:   some functions defining a public interface, an implementation class used by the above functions, but which is not meaningful outside the module.   At first, I decided to "hide" this implementation class by defining it inside the function using it, but this hampers readability and cannot be used if multiple functions reuse the same class.  So, in addition to comments and docstrings, is there a mechanism to mark a class as "private" or "internal"? I am aware of the underscore mechanism, but as I understand it it only applies to variables, function and methods name.


Unlike with addition, subtraction and multiplication where the order of operations will lead to an unambiguous result when the rules of BIDMAS (or PEMDAS) are applied, this does not hold true for division.  For example:  5 + 3 x 5 x 7 - 2 = 5 x 7 x 3 + 5 - 2 = -2 + 5 + 7 x 5 x 3  Of course, BIDMAS states we must group our multiplications together but within that grouping the order of multiplications makes no difference to the result.  Furthermore, following the rules of BIDMAS and performing the multiplications first, the subsequent order of the arithmetic also makes no difference.  Right?    In the above example, for instance, 3 x 5 x 7 = 105.  So: 5 + 105 - 2 = -2 + 105 + 5, etc...  However, operation order DOES affect the result when dividing!  For example:  (1/4)/27 does NOT equal 1/(4/27).    We know this, right!  I always took it for granted that the order of operations when presented with multiple divisions must be performed in the order it is presented; ie from left to right.  That is what we were taught at kindergarten, right?  So:  a/b/c/d = ((a/b)/c)/d  Right?    Well that's what I believed all my life and took this for granted.  But now my sanity is being challenged by Casio's most recent scientific calculators which do not obey this rule!!!!  If you were to type in a/b/c/d into a modern Casio scientific calculator using its fraction key for '/' rather than the division button, the calculator yields a/(b/(c/d))!!!!!  Using the division button instead of the fraction key gives a conflicting (but what I believe to be the correct) answer; that is:  a divided by b divided by c divided by d = ((a divided by b) divided by c) divided by d  I feel sure that the older Casio scientifics (pre 1991) gave the correct result following the rules as I have explained above.  But I cannot get hold of one to check my theory.  So my question is: What is the correct order of operation with multiple consecutive divisions?  That is, what is the order of division for:  a/b/c/d   as written without any parenthesis?  Are the new Casio calculators giving the wrong answer or have I been living a lie?  PS:  I am aware that the calculators give what I believe is the correct answer if  the right cursor key is pressed after the keying in of each denominator.  Bu that is a fudge.  By using the right cursor, you are applying implicit parenthesis.  As inputted, either the calculators are giving the wrong answers or I have been living a lie.  Can someone please confirm the order of division should indeed be from left to right!  PS:  I have searched everywhere I could on the internet and in many maths text books but have not been able to find anything that addresses the ambiguity in the order of multiple consecutive division operations.

There is a huge debate on the internet on the value of $48\div2(9+3)$. I believe the answer $2$ as I believe it is part of the bracket operation in BEDMAS.  yields the same answer. I also believe that if $48\div2\times(9+3)$ was asked it would be $288$ which Mathway agrees with as well. However,  says it is $288$ either way. A friend of mine (who is better at math) told me that there is no such thing as 'implicit multiplication', only shorthand so that is in fact done after the division (going left to right, not necessarily because division occurs before multiplication. But he didn't explicitly give a reason) What is the answer and why?


I have a NI Komplete Audio 6, and I want to use its stereo channels separately, not all the outputs combined as 5.1.  It is recognized by Ubuntu, however I only get the choice of using it in 2.1, 4.1, 5.0 or 5.1. To get proper audio on the first stereo channel, I've had to select 2.1 and then disable lfe-mixing in /etc/pulse/daemon.conf so that the low frequencies do no get sent to the non-existing sub-woofer.  I would like at least to be able to use my sound card in 2.0, and at best to have it come up as 3 virtual 2.0 devices in Ubuntu. I have already tried to fiddle with pulseaudio profiles but with no success.  Here is my aplay -L output:   Any ideas?  EDIT: Using the asound.conf provided in  and adapting it to six channels did not work. Also, I am also asking about having my device be properly recognized as 2.0 capable.

I have a Xonar DX (CMI8788 driver) 7.1 surround sound card installed on my Ubuntu 11.10 system.   I want to use the outputs of the card as 4 separate stereo outputs and I am struggling with ALSA to get it to work.  This is my asound.conf:  #/etc/asound.conf pcm_slave.eightchannels {         pcm "hw:0,0"            # or "hw:1,0" for the second card         channels 8 } pcm.stereo1 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 2 3 ]         } } pcm.stereo2 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 4 5 ]         } } pcm.stereo3 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 6 7 ]         } } pcm.stereo4 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 0 1 ]         } }   This is my aplay -l output:  $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: DX [Xonar DX], device 0: Multichannel [Multichannel]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 0: DX [Xonar DX], device 1: Digital [Digital]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]   Subdevices: 1/1   Subdevice #0: subdevice #0   This is my aplay -L output:   The system seems to completely ignore my configuration. However, I am sure that the config is used, because when i insert a random string at the top, i get a parsing error.  Any help is greatly appreciated.


I make egg muffins in a muffin tin, using cubed ham, green pepper, onion etc. plus of course beaten eggs.   How long can I keep these in the fridge after they have been baked in the oven.  I've tried after 3 days and they still taste fine, I just want to know the safety factor

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


NOTE: This is not a duplicate because the link this question duplicates does not solve my problem. OK I've read , but I am getting an error when I try to merge the following accounts:      I want to link all stack exchange accounts (stack overflow, super user, android, english, italian, cooking, software recommendations, home improvement, etc...) so that there will be only one account for all of the Stack Exchange sites where these virtual users have posted. The results should be only one "Jack Maddington" account. But I am getting an error. Can someone please carry out this operation for me? Here is a screenshot of the error that I am getting:

I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit "" in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)


This might seem a silly question, but here it goes:  Of all possible values for a measure of distance, which is the smallest that makes sense talking about?  I mean, I could talk about $10^{-100000}$ meters but in real life this value is smaller than anything we know (i think), so it wouldn't make any sense talking about this value, now would it? Initially I thought about Planck length, but I'm not sure.  Please not I'm not referring to mathematics, any number can be of use in mathematics. But in real life, small values like $10^{-100000}$ meters don't make sense.  So, what is smallest distance value that makes sense talking about?  Thanks.

I know that what  equals to.   The first question is, how do you get the formula $$\ell_P~=~\sqrt\frac{\hbar G}{c^3}$$ that describes the Planck length? The second question is, will any length shorter than the Planck length be inaccessible? If so, what is the reason behind this?


I have a PHP website with lot of JS and CSS files included with the  tag. The problem is whenever I update any JS or CSS and then open my website, chrome is still loading old versions of the JS,CSS . I know client side we can force refresh by Ctrl+Shift+R , but it's too tough to instruct my website users to do this every single time.   I have tried these but still no luck. So please suggest a way to force the browser to reload JS from my server every time instead of cache.    <meta http-equiv="cache-control" content="no-cache"> <!-- tells browser not to cache --> <meta http-equiv="expires" content="0"> <!-- says that the cache expires 'now' --> <meta http-equiv="pragma" content="no-cache"> <!-- says not to use cached stuff, if there is any -->

We are currently working in a private beta and so are still in the process of making fairly rapid changes, although obviously as usage is starting to ramp up, we will be slowing down this process.  That being said, one issue we are running into is that after we push out an update with new JavaScript files, the client browsers still use the cached version of the file and they do not see the update.  Obviously, on a support call, we can simply inform them to do a ctrlF5 refresh to ensure that they get the up-to-date files from the server, but it would be preferable to handle this before that time.  Our current thought is to simply attach a version number onto the name of the JavaScript files and then when changes are made, increment the version on the script and update all references.  This definitely gets the job done, but updating the references on each release could get cumbersome.  As I'm sure we're not the first ones to deal with this, I figured I would throw it out to the community.  How are you ensuring clients update their cache when you update your code?  If you're using the method described above, are you using a process that simplifies the change?


According to the Merriam-Webster Dictionary, a city is "an inhabited place of greater size, population, or importance than a town or village"; a town is "a compactly settled area usually larger than a village but smaller than a city"; and a village is "a settlement usually larger than a hamlet and smaller than a town".   One can deduce from these definitions that the word "city" cannot be used to describe a town or a village, and that the word "town" cannot be used to describe a city or a village.   If, therefore, one wanted to speak of both a city and a town, as for example, "The city of Philadelphia and the town of Hershey", what word could he use to describe both of them, in saying, for example, "Both of these [] are in Pennsylvania"?   Thank you.

There is the German word Ort or Ortschaft which is a hypernym for places where people live like   villages towns cities   etc.  Is there a correspondent word in English?   I don't want to use location or place because they also represent geographical entities where no people live or even just buildings.


I connect to a screen session. After doing some stuff I detach it. Then in history | tail I only see screen -r and previous commands and not the commands run in screen session. Basically history shows different things when screen session is running and after it is detached.  How do I make sure that the commands in screen session are appended to bash history?   Config: screen 4.0.3,  bash 4.1.2

I consistently have more than one terminal open. Anywhere from two to ten, doing various bits and bobs. Now let's say I restart and open up another set of terminals. Some remember certain things, some forget.  I want a history that:   Remembers everything from every terminal Is instantly accessible from every terminal (eg if I ls in one, switch to another already-running terminal and then press up, ls shows up) Doesn't forget command if there are spaces at the front of the command.   Anything I can do to make bash work more like that?


I'm sure there are plenty of schematic tools available.  Which ones do you use/prefer?  Feel free to also list tools which aren't completely free but very popular.

I was going to add a bit of information to my post on a previous day using schematics and some instructions. What programs are being employed for this purpose?  I mostly want to see what others are using and that I can easily use to give descriptive schematics.  In a perfect world, and I know this is a case of me wishing, it would be:   Free. Extremely easy to draw schematics in. Allows simple production of waveforms for the inputs/outputs.