Below is an example of childs daily activity. I want to select the next rows after the last 'Play' activity based on user id.  id          timestamp               activity 567     1541300537817000            Play 567     1541300584959000            Games 567     1541300711884001            Play 567     1541300749548000            Study 567     1541300804865000            Movie 678     1542073550481000            Computer 678     1542073551422000            Play 678     1542073551478000            Play 678     1542073561885000            Play 678     1542073567663000            Sleep      908     1543580126943000            Tv      908     1543580212409000            Sleep      908     1543580245227000            Play  Expected output  id          timestamp               activity 567     1541300749548000            Study 567     1541300804865000            Movie  678     1542073567663000            Sleep    I tried doing this:  SELECT DISTINCT t1.* FROM `table` t1, `table` t2 WHERE t1.id = t2.id   AND t1.timestamp > t2.timestamp   AND t2.activity = 'Play';    But it is giving me events after 1st Play activity.


I am working my way through the Think Python Textbook, and one of the problems it gives is to make a function that takes a list and returns a list with only unique elements from the original. What I have so far is this:  def remove_duplicates(l):     index = 0     new_l = []     dup_l = []     while index < len(l):         if l[index] in l[index+1:] or l[index] in new_l:             dup_l += [l[index]]             index = index + 1         elif l[index] in dup_l:             index = index + 1         else:             new_l += [l[index]]     return new_l   I feel like there must be a more succinct, pythonic way to write this function. Can somebody help this beginner programmer?

Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:


I am very new to Mac and Apple world, please excuse me for my ignorance if any. I do see Macbook pro or Air doesn't come with Hard Disk drive..!! It comes with flash storage with just storage like 128GB etc (which is very low I feel). Can anyone let me know why no Hard Disk on Macbook pro? Is it possible to install third party hard disk to it?

I have a 2011 MacBook Air(11-inch), I am using OS X 10.9, but I only have 64GB Flash Storage, and I  want to expand the storage of MacBook Air's hard disk. I asked geniuses at Apple and they told me the answer is no. So, is this possible?


Safari 12 improved the security of the browser by killing off the older API. Unfortunately in doing so it killed the very handy Sessions:    I can easily go find the tabs I had open when I upgraded.   My challenge - where do I find a robust tool that remembers all of your tabs even after a crash?   (Yes I know of the preference "reopen open all windows from last session" - past experience says that this doesn't work if the browser crashes).

I'm looking for a more efficient way to manage my tabs in Safari. Specifically something that allows me to move multiple tabs at once to a new window.  I often find myself following a link for a new subject/idea, then another, and so on and so on, until I find myself with a dozen tabs that should really be in their own window, but it's a pain to manually find and drag each one. I'd love to be able to do it in one fell swoop. Any suggestions?


I plan to apply for a tourist visa for Hungary. It will be a Schengen visa. Out of a trip of 6 days, I plan to spend one night in Vienna (Austria) and the rest of the trip in Hungary.  The point of entry and exit will be Hungary.  I will be mentioning in the Schengen visa application form "Hungary and Austria" under the member states of destination.  If I opt for a single entry Hungary Schengen tourist visa, and if I leave for Vienna, will I be allowed back into Hungary? Or is it once you leave a country you cannot go back to it unless it is 2-times entry or multiple-entry visa.  Sorry for this detailed question, and may sound like a noob, but I wanted to check. I am an Indian national and will be travelling from India.

I am visiting a friend in Switzerland for ten days. I have already got visitor's visa for the same on my Indian passport. Particulars mentioned on my visa are:  1. 'Etats Schengen' , 2. Single entry 3. Dates of visit. & 4. Type of visa : C.  I understand that having already got ‘Etats Schengen' visa, I can travel to all Schengen countries.  I am also planning to visit Paris for a day during my stay in Switzerland. However, I never mentioned this in my visa application. I am planning to take a train from Geneva to Paris and book a hotel in Paris for one night. Can I possibly plan my Paris trip this way as I have Schengen visa, or I am not allowed to travel out of Switzerland as I never mentioned this in my visa application?   Also what does Single entry on my Schengen visa means: does it mean that I can enter and leave Switzerland only once or it means that I can enter and leave the Schengen region only once.


I am having some trouble understanding something that feels very basic in probability theory concerning the past history of repeated independent events.  Consider the tossing of a fair coin. $P(\text{head}) = P(\text{tail}) = 0.5$. Repeated tosses are independent events. Let's say that we already have four Heads in a row.  Here's my dilemma:       The probability of the next toss result being head = $0.5$, if I think of this as an independent event. But the probability of getting five heads in a row = $0.5^5$ given the history of the tossing.   Aren't these statements conflicting? Does the probability of the next toss being a head really differ? So, if were to bet on the outcome, would it be any better to bet on tails?  I can think of rationales for both cases but I can't wrap my mind around how both probabilities for a head can co-exist. An explanation would be deeply appreciated.

I'm confused about how to reconcile the probability of independent events not having anything to do with prior history, but sequences of events do (seemingly) take into account prior history. This question asks a similar question: . However, having read that, I found I had a very specific confusion about the seeming contradiction between two formulas for probabilities that seem equal to me, but will produce different results based on our understanding of P of sequences versus P of independent events: (A) P(HHHHH) = 0.03125 (B) P(H | HHHH) = 0.5 Can anyone explain how the left side of both equations, P(HHHHH) and P(H | HHHH) are different. And does anything change if we shift from a frequentist to bayesian perspective?


I want to know how you can easily create a line connecting two nodes which has more than one corner? One corner is easy, you can just use something like \path [line] (node1) -| (node2);. But what to do if the line consists out of more than two straight segments?  The problem I have now is that a line is going through a node :(. I would like to have it look like a Z and go in between the nodes. So something like -|-, unfortunately that does not work.    \documentclass{article} \usepackage{tikz} \usepackage{amsmath}  \usepackage[tightpage, active,i pdftex]{preview} \PreviewEnvironment{tikzpicture}  \begin{document} \begin{tikzpicture}[node distance=1.5cm] \tikzstyle{level1} = [rectangle, rounded corners, text width=3cm, minimum height=1cm, text centered, draw=black, fill=red!40] \tikzstyle{level2} = [rectangle, rounded corners, text width=3cm, minimum height=1cm, text centered, draw=black, fill=green!20] \tikzstyle{level3} = [rectangle, rounded corners, text width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!20] \tikzstyle{arrow} = [draw, -latex]  \node (lagrangian) [level1] {Evolve Lagrangian};  \node (panel_strength) [level2, below of=lagrangian] {Vortex sheet}; \node (no_slip) [level3, below of=panel_strength] {Ensure no-slip at collocation points};  \node (total_velocity) [level2, right of=panel_strength, node distance=4cm] {Total velocity}; \node (particle_velocity) [level3, below of=total_velocity] {Compute $\mathbf{u}_\omega$}; \node (particle_velocity) [level3, below of=particle_velocity] {Compute $\mathbf{u}_\gamma$}; \node (particle_velocity) [level3, below of=particle_velocity] {Evaluate\\$\mathbf{u}=\mathbf{u}_\infty+\mathbf{u}_\omega+\mathbf{u}_\gamma$};  \node (particle_convection) [level2, right of=total_velocity, node distance=4cm] {Convection}; \node (convect_particles) [level3, below of=particle_convection] {Solve $\displaystyle\frac{d\mathbf{x}_p}{dt}=\mathbf{u}(\mathbf{x}_p)$}; \node (remesh_circulation) [level3, below of=convect_particles] {Re-mesh $\boldsymbol\alpha_p$ onto Cartesian grid}; \node (population_control) [level3, below of=remesh_circulation] {Population control};  \node (particle_diffusion) [level2, right of=particle_convection, node distance=4cm] {Diffusion}; \node (redistribute_strength) [level3, below of=particle_diffusion] {Redistribute particle strengths};  \path [arrow] (lagrangian) -- (panel_strength);  \path [arrow] (panel_strength) -- (no_slip); \path [arrow] (no_slip) -| (total_velocity);   \end{tikzpicture} \end{document}

It is easy to produce a path between two nodes consisting of a single horizontal and a single vertical line (from the manual):  \begin{tikzpicture}   \draw (0,0) node(a) [draw] {A}  (1,1) node(b) [draw] {B};   \draw (a.north) |- (b.west);   \draw[color=red] (a.east) -| (2,1.5) -| (b.north); \end{tikzpicture}   However, what if I wanted the same short syntax to produce a path between (a) and (b) using a horizontal line, a vertical line, and a second horizontal line. It isn't to difficult to calculate the intermediate points, but how could the following syntax be defined?  \begin{tikzpicture}   \draw (0,0) node(a) [draw] {A}  (3,1) node(b) [draw] {B};   \draw (a.east) -|- (b.west); \end{tikzpicture}


I have upgraded my Ubuntu 18.04 to 20.4 but now I can't fin a way to scan something with my P Color LaserJet Pro MFP M176n**. I've tried some solutions that but I have seen here but the only thing that I got was to crate s system corrupted so I had to start with a new installation. Someone could help me ?

Let's assume that one has some modern HP printer and/or scanner which is  supported by HPLIP package from official repository. Or supported by newer version of HPLIP package (see  about installation).  From official documentation () it is known that device needs proprietary/binary driver or plugin.  How should one install such plugin?


There is this program called de4dot which basically reverse obfuscates almost any assembly, such as .NET reactor protected assemblies, etc. Is there really an effective method of protecting your .NET code?

Obfuscation is one way, but it can't protect from breaking the piracy protection security of the application. How do I make sure that the application is not tampered with, and how do I make sure that the registration mechanism can't be reverse engineered?  Also it is possible to convert a C# application to native code, and  is too costly.  C# provides lot of features, and is the ideal language for my code, so writing the whole codebase again in C++ is out of the question.  Secure certificates can be easily removed from the signed assemblies in .NET.


Perhaps a basic question, but is there a method or definition of how to choose the optimum bin size for some data with the intent to plot as a histogram?  At present the best option I can think of is to fit distribution functions to the histograms and choose the bin size where the fit is best.  Is there a definition based on the data size or some other metric?

I'm interested in finding as optimal of a method as I can for determining how many bins I should use in a histogram. My data should range from 30 to 350 objects at most, and in particular I'm trying to apply thresholding (like Otsu's method) where "good" objects, which I should have fewer of and should be more spread out, are separated from "bad" objects, which should be more dense in value. A concrete value would have a score of 1-10 for each object. I'd had 5-10 objects with scores 6-10, and 20-25 objects with scores 1-4. I'd like to find a histogram binning pattern that generally allows something like Otsu's method to threshold off the low scoring objects. However, in the implementation of Otsu's I've seen, the bin size was 256, and often I have many fewer data points that 256, which to me suggests that 256 is not a good bin number. With so few data, what approaches should I take to calculating the number of bins to use?


I am trying to develop a simple qt app, I would like icon for the toolbar buttons, How can I standard icons for these toolbar buttons, new,open,close etc

I am developing a qml-app and I want to put icons on the buttons. I would like to use ubuntu standard icons to get the real ubuntu look for my app. How can I do this?


In Carroll's derivation of the geodesic equations (page 69, ), he starts with $$\tau=\int\left(-g_{\mu\nu}\frac{dx^{\mu}}{d\lambda}\frac{dx^{\nu}}{d\lambda}\right)^{1/2}d\lambda$$ and arrives at$$\delta\tau=\int\left(-g_{\mu\nu}\frac{dx^{\mu}}{d\lambda}\frac{dx^{\nu}}{d\lambda}\right)^{-1/2}\left(-\frac{1}{2}\partial_{\sigma}g_{\mu\nu}\frac{dx^{\mu}}{d\lambda}\frac{dx^{\nu}}{d\lambda}\delta x^{\sigma}-g_{\mu\nu}\frac{dx^{\mu}}{d\lambda}\frac{d\left(\delta x^{\nu}\right)}{d\lambda}\right)d\lambda.$$  He then changes the curve parametrization from arbitrary $\lambda$   to proper time $\tau$   by plugging $$d\lambda=\left(-g_{\mu\nu}\frac{dx^{\mu}}{d\lambda}\frac{dx^{\nu}}{d\lambda}\right)^{-1/2}d\tau$$  into the above to obtain  $$\delta\tau=\int\left(-\frac{1}{2}\partial_{\sigma}g_{\mu\nu}\frac{dx^{\mu}}{d\tau}\frac{dx^{\nu}}{d\tau}\delta x^{\sigma}-g_{\mu\nu}\frac{dx^{\mu}}{d\tau}\frac{d\left(\delta x^{\nu}\right)}{d\tau}\right)d\tau.$$  I cannot see how that substitution works. I've been told it uses the chain rule, but I just can't see it. Can anyone help? Thanks.

I would like to recover the (timelike) geodesics equations via the variational principle of the following action:  $$ \mathcal{S}[x] = -m \int d\tau = -m \int \sqrt{-g_{\mu\nu}\,dx^{\mu}\,dx^{\nu}} $$  Using an arbitrary auxiliary parameter $\lambda$, then one is able to rewrite the action and obtains: $$ d\tau = \sqrt{-g_{\mu\nu}\, \tfrac{dx^{\mu}}{d\lambda}\tfrac{dx^{\mu}}{d\lambda}} d\lambda $$ $$ -m \int d\tau = -m \int (d\tau / d\lambda) d\lambda =  -m\int\sqrt{-g_{\mu\nu}\, \tfrac{dx^{\mu}}{d\lambda}\tfrac{dx^{\mu}}{d\lambda}} d\lambda $$  Now we can vary the paths $x^{\mu}(\tau) \rightarrow x^{\mu}(\tau) + \delta x^{\mu}(\tau)$.  I need the following equation to be true, so i get the geodesics equations, but I don't know how one can say the following: $$ \int d\tau \,\delta g_{\mu\nu}\frac{dx^{\mu}}{d\tau} \frac{dx^{\nu}}{d\tau} = \int d\tau\, g_{\mu\nu, \rho} \frac{dx^{\mu}}{d\tau} \frac{dx^{\nu}}{d\tau} \delta x^{\rho} $$ I know there is a simpler action, which leads to the same equation of motion, but there one has to do the same manipulation, which I sadly don't understand.  Thanks for helping me!


In the following code snippet:          List<Integer> ints = new ArrayList<Integer>();         ints.add(1);         ints.add(2);         List<? extends Number> nums1 = ints;         ints.add(3);         ints.add(4);         System.out.println("nums1 : " + nums1);         List<? super Number> nums2 = (List<? super Number>) nums1;         nums2.add(5.381);         nums2.add(6);         //ints.add(7.61762); // compilation error         System.out.println("nums2 : " + nums2);         System.out.println("ints : " + ints);   The List of Integer (ints here) is printed as : ints : [1, 2, 3, 4, 5.381, 6] So it seems that something is wrong here ?  Actual O/P :  nums1 : [1, 2, 3, 4]  nums2 : [1, 2, 3, 4, 5.381, 6]  ints : [1, 2, 3, 4, 5.381, 6]   <-- Why 5.381 is fine in List

I read about Java's type erasure .  When does type erasure occur? At compile time or runtime? When the class is loaded? When the class is instantiated?  A lot of sites (including the official tutorial mentioned above) say type erasure occurs at compile time. If the type information is completely removed at compile time, how does the JDK check type compatibility when a method using generics is invoked with no type information or wrong type information?  Consider the following example: Say class A has a method, empty(Box<? extends Number> b). We compile A.java and get the class file A.class.  public class A {     public static void empty(Box<? extends Number> b) {} }     public class Box<T> {}   Now we create another class B which invokes the method empty with a non-parameterized argument (raw type): empty(new Box()). If we compile B.java with A.class in the classpath, javac is smart enough to raise a warning. So A.class has some type information stored in it.  public class B {     public static void invoke() {         // java: unchecked method invocation:         //  method empty in class A is applied to given types         //  required: Box<? extends java.lang.Number>         //  found:    Box         // java: unchecked conversion         //  required: Box<? extends java.lang.Number>         //  found:    Box         A.empty(new Box());     } }   My guess would be that type erasure occurs when the class is loaded, but it is just a guess. So when does it happen?


Find the smallest number $a \geq 0$ such that $a \equiv 7^{83} \bmod 11$.  I know that I am supposed to come to the conclusion $a = 2$, but I don't understand how I reach this conclusion using Fermat's or Euler's theorem. I have the order $83$ to $7$ in $\mathbb{Z}_{11}$, but I don't know what I write as an answer, because writing just $a = 2$ is not enough to show that I have understood how I came to the answer without using a calculator to just calculate that $7^{83} \bmod 11 = 2$.

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


I have to archive data from a table into another table whilst the original table is in use. The archival process is to copy the rows into another table and then delete the rows from the original table. The rows to be archived are selected by a column that has the Identity property.  A factor is that the table from which the rows are being archived will be in use - new rows will be written into the table as the archival process is running. This is a 24/7 application that cannot be stopped.  The rows that are being deleted are at the low end of the Identity column numbering whilst the new rows will be being added at the end of the table.  My concern is deadlocks. Is there a chance that deadlocks could occur between the 2 processes?  The archival process will be run from a Stored Procedure? Should I set the DEADLOCK_PRIORITY to LOW to ensure that if a deadlock does occur that the archival process will be killed and not the running application?  Should I also set TRANSACTION ISOLATION LEVEL?  Thanks  Table Definition:      CREATE TABLE [dbo].[DummyName](     [Id] [int] IDENTITY(1,1) NOT NULL,     [Payment Reference] [nvarchar](18) NULL DEFAULT (N''),     [Payment Amount] [decimal](28, 10) NULL,     [Payment Date] [datetime] NULL,     [Payer ID] [nvarchar](34) NULL DEFAULT (N''),     [Payer Account] [nvarchar](174) NULL DEFAULT (N''),     [Payer Name] [nvarchar](174) NULL DEFAULT (N''),     [Payer Type] [nvarchar](35) NULL DEFAULT (N''),     [Bank Reference] [nvarchar](16) NULL DEFAULT (N''), ...   Index Definition:  ALTER TABLE [dbo].[DummyName] ADD PRIMARY KEY NONCLUSTERED  (     [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO


I want to ask a question in mathematics, in which I want to add a table with some alpha numeric values. How can I do this? Can I enter an image in the text?

It seems like a lot of people try to display tables in Stack Overflow questions, but don't do a very good job. Is there Markdown syntax that supports creating a proper table?


I tried posting this yesterday but I messed up typing the problem and I have now deleted that post (EDIT: oops, turns out you can't delete it after a day, sorry).  I'm trying to solve the problem in the title, but I'm having trouble justifying and making sure my answer is correct.  Also, I know that a problem like this has been solved before on here  but the answers on there make this more confusing since they get $1\over4$ as an answer and they don't seem to justify the answers they get.  So you know what experience I have and how I should try to justify my answer, here is a picture of the chapter and its sections.    I don't know which section the problem in the title comes from. This is also from a calculus 2 course.  Ok, first, if I take the limit of $$\sum_{n=1}^\infty {1\over n(n+1)(n+2)}$$ I will end up with $0$ correct? Since as n gets bigger the denominator also gets bigger meaning the number gets smaller. I'm not even sure if I need to take the limit. Assuming what I just did is correct, that means the series is convergent to $0$, but how would I justify the answer I get? If you look at the chapter I uploaded, is there a test I can use? I have tried reading all of it but it just isn't making sense to me.  Thank you for any help anyone can give me, If I can see how someone would go about solving this, then I should be able to solve the rest on my own.

I got this question in my maths paper     Test the condition for convergence of $$\sum_{n=1}^\infty \frac{1}{n(n+1)(n+2)}$$   and find the sum if it exists.   I managed to show that the series converges but I was unable to find the sum. Any help/hint will go a long way. Thank you.


I need to prove the following equation:   $\sum_{j=k}^n \binom{j}{k} = \binom{n+1}{k+1}$  for this equation i need to suggest both algebric and combinatorial explanation.  the only thing I came up with:   as for the right side, combinatorial explanation could be number of ways for choosing subsets of k+1 people out of a n+1 people in total.   left side, though, doesnt work out for me at all.  Thanks in advance.

After reading , the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$  What's the name of this identity? Is it the identity of the  modified.  How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?  Thanks for your help.    EDIT 01 : This identity is known as the  because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed.


I know the command that displays my Linux version : $ uname -a Linux bouleau 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux  What option of uname or order command will tell me that I'm using Debian 10.4 ?

My os was installed from debian 8.5.0 amd64. Execute commands after installation.  cat /etc/issue Debian GNU/Linux 8 \n \l   No 8.5 here.  cat /proc/version Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26)   No 8.5 here too.  Does deb8u2 means debian 8.5?


I'm trying to make a texttwist type game where you get random letters and have to make them into words, kind of like scrabble. I need to figure out how to add a function to my jbuttons to make, for example, the clear button clear the guess panel, or the submit button submit it, etc.  package gui;  import java.awt.Color; import java.awt.Font; import java.util.ArrayList;  import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.BevelBorder;  import gui.event_handlers.GuessButtonHandler; import gui.event_handlers.InventoryButtonHandler; import model.Model; import model.Observer;  public class GUI implements Observer {      private JFrame _window;     private JPanel _wordsToGuessPanel;     private JPanel _inventoryPanel;     private JPanel _guessPanel;     private Model _model;     private JButton _submit;      public GUI(Model m) {         _model = m;         _model.addObserver(this);          _window = new JFrame("TwistyWord");         _window.getContentPane().setLayout(new BoxLayout(_window.getContentPane(), BoxLayout.Y_AXIS));          _wordsToGuessPanel = new JPanel();         _window.getContentPane().add(_wordsToGuessPanel);          JPanel middlePanel = new JPanel();         middlePanel.setLayout(new BoxLayout(middlePanel, BoxLayout.X_AXIS));         _window.getContentPane().add(middlePanel);          JPanel controlPanel = new JPanel();         controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.X_AXIS));         _window.getContentPane().add(controlPanel);          JButton shuffle = new JButton("shuffle");         setButtonProperties(shuffle);         controlPanel.add(shuffle);          JButton clear = new JButton("clear");         setButtonProperties(clear);         controlPanel.add(clear);          _submit = new JButton("submit");         setButtonProperties(_submit);         controlPanel.add(_submit);          _inventoryPanel = new JPanel();         _inventoryPanel.setLayout(new BoxLayout(_inventoryPanel, BoxLayout.X_AXIS));          _guessPanel = new JPanel();         _guessPanel.setLayout(new BoxLayout(_guessPanel, BoxLayout.X_AXIS));          middlePanel.add(new JLabel("INVENTORY: "));             middlePanel.add(_inventoryPanel);             middlePanel.add(new JLabel("GUESS: "));         middlePanel.add(_guessPanel);          _model.start();          _window.setVisible(true);         _window.pack();         _window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);      }      @Override     public void update() {         _inventoryPanel.removeAll();         ArrayList<Character> inventoryLetters = _model.getInventoryLetters();         for (int i=0; i<inventoryLetters.size(); i=i+1) {             JButton b = new JButton(""+inventoryLetters.get(i));             setButtonProperties(b);             _inventoryPanel.add(b);             b.addActionListener(new InventoryButtonHandler(_model, i));         }         _guessPanel.removeAll();         ArrayList<Character> guessLetters = _model.getGuessLetters();         for (int i=0; i<guessLetters.size(); i=i+1) {             JButton b = new JButton(""+guessLetters.get(i));             setButtonProperties(b);             _guessPanel.add(b);             b.addActionListener(new GuessButtonHandler(_model, i));         }         _window.pack();         _window.repaint();     }      public void setButtonProperties(JButton button) {         button.setFont(new Font("Courier", Font.BOLD, 44));         button.setBackground(Color.WHITE);         button.setForeground(Color.BLACK);         button.setOpaque(true);         button.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.DARK_GRAY, Color.LIGHT_GRAY));     }  }

private JButton jBtnDrawCircle = new JButton("Circle"); private JButton jBtnDrawSquare = new JButton("Square"); private JButton jBtnDrawTriangle = new JButton("Triangle"); private JButton jBtnSelection = new JButton("Selection");   How do I add action listeners to these buttons, so that from a main method I can call actionperformed on them, so when they are clicked I can call them in my program?


I am writing a business plan for management, in which I wish to differentiate the options between that something is a must (mandatory) and other thing 'nice-to-have'.   The concatenated word 'nice-to-have' sounds less formal for business proposals, but I am not able to find a proper 'big' word. 'Optional' or 'alternative' might work, but it lacks the meaning that the option is perceived to 'be nice'...  Well, what I am asking is to seek a formal expression, and it doesn't have to be a noun. The context of the business proposal is like below:     After investigation, we believe that (1) The acquisition of XXX is mandatory as it's concerned with XXXX; (2) Taking ownership of XXX is always a nice-to-have, but considering current human resource, we may not take immediate action.

In the example below, I’m looking for a suitable synonym for nice-to-have. I’m specifically looking for an appropriate noun replacement; do we actually have such a thing in English?     Maintenance shouldn’t be a ‘nice-to-have’ but an all-important necessity.


I tried to simulate email validation without regular expression in java and wrote this code. I need help to improve efficiency of this code (or give me a better way to solve this issue please)   regular expression: ^[(a-zA-Z-0-9-\\_\\+\\.)]+@[(a-z-A-z)]+\\.[(a-zA-z)]{2,3}$  public static boolean isValidEmailAddress(String email) {      boolean flag1 = false;     boolean flag2=false;     boolean flag3=false;     int j=0;     char[] emailChars = email.toCharArray();     for (int i = 0; i < emailChars.length;) {         char c = emailChars[i];         if (Character.isLetterOrDigit(c)) {                 i++;             if(flag1==true&&flag2==true){                 j++;             }         } else if (c == '@' && flag1==false&&flag2==false && flag3==false) {             i++;             flag1=true;         } else if(c=='.' && flag1==true && flag2==false&&flag3==false){             i++;             flag2 = true;         }         if(j==2 || j==3){             flag3=true;         }     }     return flag1&&flag2&&flag3;  }

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


I want to write a script that extract lines from line n to m of the input.   doit.sh:   sed -n -e '$1,$2p' input.txt    ./doit.sh 3 10    But it gave me an error sed: -e expression #1, char 2: unknown command: `2'. What went wrong?

I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.  Does anyone know a Unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file?


I have a text file which contains this:  John Jack Jerry   I have another text file:  2017 2015 2018   And I want to make them like this:  John2017 John2015 John2018 Jack2017 Jack2015 Jack2018 Jerry2017 Jerry2015 Jerry2018   How can I do this?

Suppose I have a file (call it sample.txt) that looks like this:  Row1,10 Row2,20 Row3,30 Row4,40   I want to be able to work on a stream from this file that is essentially the pairwise combination of all four rows (so we should end up with 16 in total). For instance, I'm looking for a streaming (ie efficient) command where the output is:  Row1,10 Row1,10 Row1,10 Row2,20 Row1,10 Row3,30 Row1,10 Row4,40 Row2,20 Row1,10 Row1,20 Row2,20 ... Row4,40 Row4,40   My use case is that I want to stream this output into another command (like awk) to compute some metric about this pairwise combination.  I have a way to do this in awk but my concern is that my use of the END{} block means that I'm basically storing the entire file in memory before I output. Example code:  awk '{arr[$1]=$1} END{for (a in arr){ for (a2 in arr) { print arr[a] " " arr[a2]}}}' samples/rows.txt  Row3,30 Row3,30 Row3,30 Row4,40 Row3,30 Row1,10 Row3,30 Row2,20 Row4,40 Row3,30 Row4,40 Row4,40 Row4,40 Row1,10 Row4,40 Row2,20 Row1,10 Row3,30 Row1,10 Row4,40 Row1,10 Row1,10 Row1,10 Row2,20 Row2,20 Row3,30 Row2,20 Row4,40 Row2,20 Row1,10 Row2,20 Row2,20   Is there an efficient streaming way to do this without having to essentially store the file in memory and then output in the END block?


I am planning a 10-day visit to France and Spain. We will be visiting Paris first and then Barcelona and then Madrid.  Which country should we apply for the visa? Our entry point is Paris and we are planning to stay 6 days in Spain.

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


I recently got a warning, that I only have 5.8MB free space in my /boot directory. This information came with the option to 'examine or ignore it'. I examined the file and couldn't do anything, so I decided to close it.   After receiving a notification that an update was available, I clicked upgrade but it said that I didn't have space in that /boot directory, so I looked up hundreds of websites, but couldn't find a solution.   After clicking on something by mistake on the update screen, it gave me a code to paste in terminal to clear my old updates. I closed it after copying, but it didn't paste and I could never find that code again) I've downloaded Synaptic Package Manager and it didn't help, but i really need that code.   Please help - Thanks!

Every time I install a new Linux kernel, it gets left in the grub_config, making the boot menu longer each time.    I know I can manually search through the installed packages and remove them.  Does Ubuntu provide any easier way to clean them up or keep them from showing in the boot list?


Suppose I have a base class:  public class A {     public float someValue;      <Access Modifier Here> float SomeValue {         get {             return someValue;         }     } }   And I want to derive from it:  public class B : A {     public float SomeProperty {         get {             return SomeValue;         }     } }   What access modifier would I use if I want to make the SomeValue property only available to the deriving class and not anywhere else?

All my college years I have been using public, and would like to know the difference between public, private, and protected?  Also what does static do as opposed to having nothing?


Hi all i have new Pacard bell LV44HC intel i3-2350M video Nvidia GT 710m. After boot from usb or cd i can't see anything but laptop still work and load Linux. I try with different distributions but have the same problem.

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


I am looking for a textbook to aid me in self studying linear algebra. I currently own Axler's Linear Algebra Done Right, but I fear it is not sufficient for an initial treatment. Any recommendations?

I recently took an introductory class on linear algebra (covered solving linear systems, determinants, eigenvectors, diagonalization, some vector spaces, basis and combinations, transformations etc.)   Since it was a class for engineering students, it was mostly going through the motions without any insight - felt very mechanical and repetitive. However, I want to get a deeper understanding of the material, how it relates to vector spaces, geometry etc. For this I'd like a textbook recommendation.  Keep in mind I'm just a second-year undergraduate in engineering, so something rigorous might go over my head. Thanks!


Is there a 'Startup applications' app for lubuntu? Or how do I add apps to startup? I attempted a tutorial to add entries to ~/.config/autostart, but it did not work. Isn't there an easy way? Any ideas please?

I've been trying to make xcompmgrto autostart in Lubuntu 11.10 but it just doesn't, I have to start it manually.  I have added the next lines to the autostart script in ~/.config/openbox/  #Run a composite manager xcompmgr &   But whenever I log in it doesn't do anything, I don't really need any special parameters for it I just want it to start at log in.  How can I make it run automatically at login?


If I understand it correctly, nouns for fruits (and certain types of foodstuffs, such as pizza) are used as mass nouns if thought of as "food substance", rather than "portions". So is it correct that I say "I like apple" instead of "I like apples"? Is such reasoning as "I like apple as food, especially in cut pieces", just like "I like soup, pork, etc." (instead of "I like apples as items served as food, especially as whole fruits") valid, or at the very least, applicable in any ways?  I know there's , but the given answer is not satisfying to me. It flat out denies such a phrase as "I like apple" as grammatically incorrect. But is it though? If it is, when exactly do we use the mass nouns instead of the count nouns? Does the same principle go with "chicken" (the meat) and "chickens" the animal?  Edit: "Dog" is NOT a mass noun and the other question is completely irrelevant. This is absurd. My question concerns the use of mass nouns and count nouns for foods.

Why do we say 'I like dogs'? Why can't we say 'I like dog' if we are referring to a particular dog? Most people use 'I like dogs'. Which is correct and why?


Unless they will agree to paint the house red, do not hire them.      I don't want to bother you for a ride to Boston, unless you'll be   driving there anyway.   I don't understand why both subordinate clauses are future. I thought that it was not possible to use "will" with "unless".   It sounds better to me to say:       I won't bother you for a ride to Boston, unless you drive / are driving    there anyway.   and     Unless they agree to paint the house red, do not hire them.   Why is the future tense used in the examples at the top? Is it because the two main clauses are present and do not relate to the future, so if it wasn't phrased like that, we might think these sentences take place in the present (which is not true)?

!! Do not use the future tense after unless   [✓]  I won't go unless you go   [✘] [I won't go] unless you will go. [✘]   Why not? Even if the above is prescriptive, what may be some reasons? In my separate question , I quote: unless = if not. If not can precede future tense; so why can't unless?  Footnote:  motivated this.


Using the basic definition of theta notation prove that $\max(f(n), g(n)) = \Theta(f(n) + g(n))$   I came across two answer to this question on this website but the answers weren't clear to me. Would you mind to elaborate how this can be proven? I am first year student of computer sciences. Thank  you!  Edit:  What  exactly does $\max(f(n), g(n))$ return?

how can be prove that $\max(f(n),g(n)) = \Theta(f(n)+g(n))$  though the big O case is simple since $\max(f(n),g(n)) \leq f(n)+g(n)$  edit : where $f(n)$ and $g(n)$ are asymptotically nonnegative functions.


I must admit, that despite having spoken English for quite some time, i still cannot grasp all the intricacies of articles. My native tongue just doesn't have them, and they continue to perplex me.  The phrase "jump in the air" seems to stand out as something unusual. One is not jumping into the tank with some specific air, but instead is just jumping upwards, whatever air one meets there is quite irrelevant and unknown.  I have read , which was very helpful, but i don't believe is relevant in this example. Would one consider "jump in the air" to be an idiom? If so, that would explain it.

Why is 'the' used before air in the expression in the air? Air is an uncountable noun. However, 'the' (the article) precedes the word 'air'. For example: He hit a ball in the air. How can air be specific?


If I'm not wrong, tty is composed of:   Line discipline TTY driver   In addition, a shell (bash, for example) is a program that execute different commands/programs like ls, mkdir, rm, ...  After reading , I guess the shell is the same as TTY driver, because they share some features like job control, but I'm not sure at all.  So, are the shell and tty driver equivalent?  Please, correct me if something I wrote is wrong.

I think these terms almost refer to the same thing, when used loosely:   terminal shell tty console   What exactly does each of these terms refer to?


I get some options which I must select to install lubuntu 19   Start Lubuntu Start Lubuntu (safe graphics) OEM install (for manufacturers) Check disc for defects    I'm sorry, I'm new to Linux, watch tutorials but these options don't come out, they use others that don't come to me. Please help

I would like to see a full how-to guide on how to install Ubuntu.


Since light beams carry momentum, why would a person holding a flashlight not feel a recoil similar to that of a rifle being fired?

Photons have no mass but they can push things, as evidenced by .   Can photons push the source which is emitting them? If yes, will a more intense flashlight accelerate me more? Does the wavelength of the light matter? Is this practical for space propulsion? Doesn't it defy the law of momentum conservation?  Note: As John Rennie mentioned, all in all the wavelength doesn't matter, but for a more accurate answer regarding that, see the comments in  .  Related Wikipedia articles: ,


Throughout the books, we see a lot of reading, but nearly all of it is for school or non-fiction. The only fiction I can remember seeing mentioned is Ron's comic books and Beedle the Bard. Obviously there's no TV or films, but are there plays? Are there other mentions of magical fiction not in the books that I'm missing, like Pottermore or something JK has said?

Do people read literature in Harry Potter? Fiction books are rarely mentioned in the series, and none of the characters seem to read novels. We understand that a majority of teenage students aren’t prone to pick up Chaucer just for the fun of it, but you would think a bookworm like Hermione would occasionally peruse Dickens, especially since other forms of entertainment, such as television and computers, aren’t common in the magical world.


I will be travelling to the USA from Australia (flights booked) in February 2017 and am planning to visit Cuba (flights not yet booked). I would like to know what the easiest and cheapest method of getting into Cuba with a tourist visa is.  I have so far received conflicting information suggesting the following:  Suggested method 1. Once in the USA, travel to Mexico or Canada where I can purchase a Cuban tourist visa, then fly to Cuba (as the USA will apparently not issue a tourist visa)  Suggested method 2. Contact the local Cuban consulate (in Canberra here in Australia) who will issue a tourist visa (we have contacted the consulate and were told they do not do this, but I know others who have obtained Cuban visas this way)  Has anyone had any recent experience travelling to Cuba and obtaining a tourist visa? If so, what method was successful for you?

How do I get a tourist visa (or a tourist card) for Cuba?  I live in the Netherlands, but I'm not a Dutch citizen, I have an Italian passport.


In this project, I have three polygons, see the image below  'Polygons_From', includes input attributes, i.g. "Value_1", "Value_2", "Value_3", and $area for each quadrate (on the image there are two types of them). 'Polygons_To' polygons for which new values "Value_1_new", "Value_2_new", "Value_3_new" need to be defined 'Border' defines an area where the calculation should be done.   My task is to transfer values from 'Polygons_From' into 'Polygons_To' based on a certain aspect/ratio. Of course, I can simply achieve it with the 'Union' function as was suggested in . It uses $area-factor, but perhaps there are better approaches that will lead me to a much more efficient output? So, I am asking for a recommendation regarding the technique/workflow that can be applied in QGIS 2.18. Shall I consider only $area or there are some other criteria? Moreover, I looking forward to finding some papers that may improve my general understanding of the methodology.  References:

I have two polygon layers, model and ntem, whose features overlap and intersect one another. I would like to calculate the proportion of the area of the model polygons which fit within each ntem polygon. Some model features fully fit within ntem features, others overlap multiple ntem features. Both layers are in CRS OSGB:1936.        For example, model feature 50209 falls partly in each of the three ntem features 2202, 2205, 2206 and I'd eventually like to know the proportion of 50209's area in each ntem area.  From initial research, I understand that the Vector > Geoprocessing Tools > Intersect function should do what I want, however I get a completely blank layer of results when I attempt this. (Shapefile is created, empty attribute table, no features!)  Can anyone either point out if I am doing something wrong and suggest an alternative method of achieving the area proportion calculation?


I have been studying ML for over a year and am actually a Bachelors of Statistics myself and am sick of not knowing the beauty of the Gaussian distribution and why it is so prevalent in nature. I've encountered it in machine learning, Bayesian estimation, mathematical approximation but have never found a great resource to really get it. All I find are hand-wavy introductions to it which state a theorem here and there but never expound on the full power.  I ask you guys to recommend me resources so I can fully understand the normal distribution, its origins and why it so prevalent. I also want to know what's the deal with covariance matrices in multivariate Gaussians and how its determinant ended up there. My professors, peers and almost everyone seem to take it for granted but it really want to 'get it'.  Would appreciate recommendations all forms, not wayyy mathematical, but a sure, giving a strong grasp.

Why did the normal distribution become such a popular (important) distribution? I know one reason is because of CLT. Can you please give more reasons?


This is my proof  Let $m$ be $\gcd(ka,kb)$ then exists $s$ and $t$ such that  $ska+ tkb = m => k(sa+tb) = m $  $=> sa + tb = m/k$   (1)  since (1) is linear combination of $a$ and $b$  and  $m$ is smallest positive linear combination of $ka$ and $kb$ => $m/k$ is smallest positive  then $\gcd(a,b) = m/k$.  Is this proof is good enough to prove $\gcd(ka,kb)=k\cdot \gcd(a,b)$

Here is what I got so far:  Let $\gcd(ka,km) = d$  Then by the Euclidean Algorithm, we have integers $s,t$ such that:  $$s(ka) + t(km) = d \implies k|d  $$  Let $$d/k = g = sa + tm.  \tag{1}$$  So now I need to show that $g$ is indeed = $\gcd(a,m)$. Let  $\gcd(a,m) =  h$  Now since $k|d \implies d|a , d|m  \space $  (since $$\gcd(ka,km) = d \implies  g|  \gcd(a,m) = h \\\implies h = dj  ,$$ for some integer $j$.  Putting this into (1):  $$ h/jk = g = sa + tm $$  since $$h = dj \implies dj/j = kg \\ \implies d = kg. $$   So $g$ is the $\gcd(a,m)$?  Is this a correct proof? Or have I gone in some sort of circle? Many thanks for any hints or direction!


I can't find anywhere on the internet what is the "formula" behind max thread numbers. I have tested the logic that I have read with cpu, virtual memory and ram memory and in any case I used results were always the same in .NET 4.5. But when I dropped version of .NET Framework to 2.0 I noticed there is a logic that max number of threads you can create by default is 250 per cpu core. But I can't find out what logic lies behind .NET 4.5. I doubt that OS defines it just because it is different result with different .NET versions.

What is the maximum number of threads you can create in a C# application?  And what happens when you reach this limit?  Is an exception of some kind thrown?


I am trying to prove the converse (underlined in red) by defining a choice function $f:\Bbb{F}\rightarrow \cup_{\alpha\in I}X_\alpha$ to be $f(X_\alpha)=x_\alpha$ such that $Y\cap X_\alpha=x_\alpha$ where $x_\alpha$ is a unique intersection between $Y$ and $X_\alpha$. Also, $\Bbb{F}=\{X_\alpha: \alpha\in I\}$. I do not understand the problem where the Axiom of Choice does not assume the sets $X_\alpha$ being disjoint. In a same post here , Prof. Brian Scott said that if the family of $X_\alpha$ is not pairwaise disjoint then there's no way we can get the $Y$ we want to use to define $f$. Why?

I have noticed that the family of non-empty sets referred to in statements of the Axiom of Choice is sometimes required to be mutually disjoint, and sometimes not. Why is that?


I am having a problem in Gparted. I am running Ubuntu 16.04. I need to expand my main partition, containg "/", into unallocated space. I have used a live DVD with 18.04 to try to use Gparted to expand the partition. I believe that I have unmounted the partition because the "lock" symbol disappeared and I swich linuxswap partion to Off. Despite my best efforts the partition is not changeable in size. It's shown as Full in Gparted and I am wondering if this condition is somehow inhibiting my desired expansion of the partition. Can anyone suggest what I am failing to do correctly?

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


In QGIS I need to generate two maps on one, I'm aiming to have a large map covering a large area in Europe and in the top right corner place another map zoomed in to a specific country.   Does anyone know the method to do this?  I have seen it mentioned but have not been able to find a tutorial.

i want to create 4-5 detailed maps, and then an overview map that has rectangles that markes the locations of the detailed maps. Best case would be if the rectangles were links to the detailed map.   I have managed to make the overview and the rectangles, and think I know how to make the detailed maps one by one. The rectangles are drawn manually on the overview map. All layers that I plan on using are in the same QGIS project.  The final product that I hope to create would be the overview map on the first page, followed by the detailed maps. The overview would have links to the detailed maps, click on the rectangles to open the right detailed map.  Is there a way to link the detailed maps to the overview in QGIS 2.8 print composer?  I'm still not sure if I'm doing something wrong, when I try to create the overview. I want it to show the extents of all of my detailed maps.   Is this possible?


I often cannot eat all food in a can of ready-to-eat vegetable, cranberry/tomato/spaghetti sauce, or salmon.  I keep the rest in the original can in either the refrigerator or the freezer.  I recently saw on a can of orange juice that "Refrigerate after opening in a separate container". But I haven't found similar words on other cans.  Is it safe to keep food in an opened can in general?  Does my question depend on specific food?

I'd been taught growing up that you should never store canned food in the fridge in the open can. Is there any scientific basis to this, or is it just an old wives tale?   What types of foods should not be stored in their can once open? Would olives, for example, be harmed from this sort of storage? Or only more acidic foods like tomato paste or pineapple be affected?


If a person casts a spell and it's deflected can it hit an unintended target and work as intended?  For example, if a wizard casts a spell at someone to turn them into a dog, and it's deflected and hits another person, will that person turn into a dog?  I know there's the example of Ron's broken wand with the slugs and the charms spells, but I attribute that to the wand just having bad aim by being broken and just casting in the wrong direction.   Please account for Voldemort's casting of the Avada Kedavra spell at Harry and it killing the horcrux inside of Harry. Clearly that was not the intended target for the spell.

In the Harry Potter world, when a magical person casts a spell, sometimes they target a specific object, like when Harry has a wand only and needs his broom, he casts "Accio Firebolt" and his broom comes to him.  But a lot of the time people point their wands just in the direction of someone to cast a spell.  One example would be in a duel.  When they do this, are they casting a spell on a particular person or at that person?  It seems, from what I remember of the movies, that some spells travel in a straight line while others specifically target a person or object.  Do any spells travel in one direction, like a laser beam?  What kind of spells are directional (instead of focusing on a particular person or object)?  And can directional spells be deflected or blocked by something like a mirror or another physical object?  (By "directional," I could have said linear, but didn't want to start sounding mathematical or scientific.  In other words, do they travel in one direction, like a laser beam would, or will they change direction to hit the intended target?)


I'm wondering if there is an easy way to go through our project and find out exactly how many lines contain Chinese symbols?  This also needs to exclude any lines starting with /* or //

I am trying to figure out if it's possible to search through code and stop at lines that contain Chinese characters?


I am traveling from South Africa on Virgin Atlantic to Heathrow airport where I change plane to Aer Lingus for the final leg if my journey to Dublin, Ireland. My bags are being checked through to the final destination. I will not need to go through immigration. My onward flight departs less than 2 hours after landing in Heathrow.   The purpose of my visit is to visit my son and his wife and family and to help care for twins born 16th January 2019.   I have valid SA passport, travel insurance, proof of foreign exchange, letter of invitation from my son (resident on a work permit in Kilkenny); no visa is required to visit Ireland on SA passport.

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


$$X,Y\sim \exp(\lambda)$$ $$S=\min(X,Y)$$ $$T=\mathbf1_{X\le Y}=\begin{Bmatrix} 1 & \text{ if } X\le Y \\ 0 & \text{ if } X\gt Y \end{Bmatrix}$$ I have that $P(S>s)=e^{-2\lambda s}$ (so $S\sim \exp(2\lambda)$) and that $P(T=1)=\frac{1}{2}$ I am now struggling to find out how to show their independence. Using $P(S>s,T=1)=P(S>s)P(T=1)$, I attempted to work out the left hand side of the equation to show it was equal to $\frac{1}{2}e^{-2\lambda s}$ as follows: $$\begin{align}  P(S>s,T=1)&=P(X>s,Y>s,X\le Y) \\ &=P(X>s|Y>s,X\le Y)+P(Y>s|X\le Y)\\ &=P(X>s|X\le Y)+P(Y>s|X\le Y)\\ &=\frac{P(X>s,X\le Y)+P(Y>s,X\le Y)}{P(X\le Y)} \end{align}$$ However, I could not figure out how to work out $P(X>s,X\le Y)$ and $P(Y>s,X\le Y)$ I was thinking something along the lines of: $$P(X>s,X\le Y)=\int_{s}^{\infty}\int_{x}^{\infty}2\lambda e^{-2\lambda s}\mathbf1_{X\le Y}dydx$$ but this diverges so it has left me a bit stumped about where to go from here. Any clues to help me get over this hurdle would be much appreciated! Or if I'm completely barking up the wrong tree it would be useful if I could be pointed in the right direction :)

Assume that $X$ and $Y$ are independent random variables with $X \sim \exp(\lambda)$ and $Y \sim \exp(\mu)$. It is impossible to obtain direct observations of $X$ and $Y$. Instead, we observe the random variables $Z$ and $W$, where $Z = \min\{X,Y\}$ and $W =1$ if $Z=X$ and $W=0$ if $Z=Y$.  How to find the joint distribution of $Z$ and $W$?


I'm thinking of getting the Asus Zenbook FLip 14 UM462DA-AB71 with Ryzen R7-3700U and I'd like to install Ubuntu or some other Linux on it. Did anybody try this yet and can tell me, if I have to expect issues? Thanks

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


I have already install ubuntu by downloading the wubi tool and the image of ubuntu which i want to install in later ubuntu versions like 12.04 and 14.04, by manually downloading the image and the tool side by side in the same folder and disconnect the internet and the installation goes in its right way.  From two days ago i trying to do this way with ubuntu 17.04 but it insist to download the ubuntu image from the internet, i have downloaded these files :-   Wubi for Ubuntu 17.04 (rev 321) Wubi for Ubuntu 17.04 (rev 322) ubuntu-17.04-desktop-i386   and as usual i put them in the same folder and disconnected the internet but it needs to download the file live.  if anyone can help me doing what i used to do, or at least make the wubi tool download the ubuntu-17.04-desktop-i386 not the 64-bit version.

I would like to see a full how-to guide on how to install Ubuntu.


It looks to me that both arrive at the same place, the average velocity. Do I use whichever one based on the data available to me?

Average velocity:  $$v_{\rm avg,1}=\frac{v_{\rm final}+v_{\rm initial}}{2}$$   and average velocity:   $$v_{\rm avg,2} =\frac{\rm total\;displacement}{\rm time \;taken}=\frac{\Delta x}{\Delta t} $$  What is the difference between them and when do we use them?


On the kit 18-55 lens that came with my Nikon D5100 I have noticed that when trying to focus on infinity for shots in dark conditions (star-trails, etc) the lens tends to move past infinity out of focus and need to be brought back a little to get a clear infinity focus point.  Is there a good trick for getting a clear infinity focus when in pitch dark conditions?

Is there a good reason why I can turn the focusing ring on my lenses beyond infinity mark on focusing scale? Following recent questions about focusing in the dark ( and ), it sounds like a real usability issue.  When I'm focusing manually, I only care about the infinity mark on my focusing scale, but there is around 5-10mm of room (depending on the lens) beyond infinity mark. Why is it there?


Let's say I have an infinitely long rod which I use to pass information to my friend on the other end. If the rod moves towards my friend, it means I sent a 1 and if the rod moves away from my friend, it means I sent a 0. Using this rod to transfer binary information to my friend, can I send information that travels faster than the speed of light? Or in other words, can I talk with my friend instantly irrespective of the distance between me and my friend?  Is this theoretically possible? My assumption is that push and pull of the rod is instant. Is it really instant or the push and pull also travels at the speed of light limiting the speed of my communication?

Is it possible for information (like 1 and 0s) to be transmitted faster than light?   For instance, take a rigid pole of several AU in length. Now say you have a person on each end, and one of them starts pulling and pushing on his/her end.   The person on the opposite end should receive the pushes and pulls instantaneously as no particle is making the full journey.  Would this actually work?


I run a repair shop and occasionally we do soldering work, but nothing too crazy. I was wondering what are the documented health effects when exposed to solder smoke. We do have an open space with low ceilings. I'd say we solder maximum of about 10 minutes a day at most. I do have the smoke absorber, but techs don't tend to turn it on if  your just soldering a few points on the board.   What are some documented health effects when exposed to solder smoke 10 minutes a day. I mean we aren't inhaling this stuff directly, its just in the same work area.

I do a fair bit of soldering (lead-free). Is breathing in solder/flux/paste fumes actually going to harm me?  Are cheap fume extractors worth buying?


How can prove or disprove that bounded smooth functions have a bounded derivative ?  For example cosinx is bounded and smooth and has bounded derivative . I can’t think of a proof to show that the claim is true ,nor can I think of a counterexample. Even a hint would be very useful .

Can the graph of a bounded function ever have an unbounded derivative?    I want to know if $f$ has bounded variation then its derivative is bounded. The converse is obvious. I think the answer is "yes". If the graph were to have an unbounded derivative, it would coincide with a vertical line.


I didn't find a specific answer to my questions in my search. i have a website, and I need to target Russia and neighbouring countries ( Moldova, Ukraine, Belarus, Kazakhstan, etc..)  My website is only in Russian language and those countries all speak and understand Russian. I need an href language to insert in my  that defines russian language to these countries and refer to my main website. is it possible? can anyone help?  thanks to all who respond to my question .

I'm a web developer from Myanmar (Burma). Google delivers a ccTLD  to the people searching from our country.   I have a website which is a single language site (English) and it targets the global audience. I have also Facebook page and Twitter page related to my website. When I search my website using some related keywords in  (without ), my site including Facebook and Twitter pages are listed in the first SERP. However, when I search it with the same keywords in , I could not entirely find the site.  So far I have learned about Google SEO, there is an option  which can be enabled/flagged from Google Webmasters Tool. And I know that it is only for geographic data and it is not suitable for my case.     This setting is only for geographic data. If you're targeting users in   different locations—for example, if you have a site in French that you   want users in France, Canada, and Mali to read—don't use this tool to   set France as a geographic target. A good example of where it would be   useful is for a restaurant website: if the restaurant is in Canada,   it's probably not of interest to folks in France. But if your content   is in French and is of interest to people in multiple   countries/regions, it's probably better not to restrict it.   What are the best possible ways to solve this issue to list my site in google.com.mm as well?


Sentinels are mainly based on Mystique's Gene, therefore they can transform and adapt to any target. Then why Mystique herself can't do these? (she just changes her appearance and voice)

The future Sentinels in  are clearly shown adapting to powers thrown at them by copying them. Isn't that what Rogue's DNA would allow for, not Mystique's? Mystique can just change appearance, not copy powers ... right? So why would study of her mutant genes allow for the abilities of the future Sentinels?


Here's my problem:  I have a table of events, with two dates, a starting one and a finishing one for each.  I want to be able to filter all the events which any of it's days fall into the upper and lower filter. Example:  Event 1 start: 2019-1-1 end: 2019-1-5   Using  WHERE (start BETWEEN "'.$filterstart.'" AND "'.$filterend.' 23:59:59")  OR (end BETWEEN "'.$filterstart.'" AND "'.$filterend.' 23:59:59")   this will catch almost all events required, except for this filter:  filterstart: 2019-1-3 filterend: 2019-1-3   Since the filter starts and finishes between the start and end date. How can I also catch those?

I have a table of events with a recorded start and end time as a MySQL DATETIME object (in the format YYYY-MM-DD HH:MM:SS. I want to find all events that occur in a specific date range. However, events can span multiple days (and go outside of my date range, but I want to return them if they even overlap by 1 second or more with my date range).  Suggestions?


I submitted a paper to one of the Springer Journals through Editorial Manager almost 2 months back. The status changed from "editor assignment pending" to  "Reviews Completed" since past three days. Can anybody suggest what does it actually mean ? D

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


These are the two examples, could someone help me by explaining? Example 1 v1=list(range(5)) v1temp=v1 v2=1  def ext(x,y):     return x.append(y)  ext(v1,v2) print(v1temp)  Example 2 a=1 b=2 atemp=a a=b print(atemp)

I'm trying to get my head around mutable vs immutable objects. Using mutable objects gets a lot of bad press (e.g. returning an array of strings from a method) but I'm having trouble understanding what the negative impacts are of this. What are the best practices around using mutable objects? Should you avoid them whenever possible?


Here is my .bashrc config for ps1 i believe ive done it correctly but any time i press up for a previous command it gets all jumbled up. I can write long lines of commands without it wrapping only the "previous history" is giving me trouble.  PS1='\[\e[38;5;9m[\]\[\e[38;5;214m\u\]\[\e[38;5;41m@\]\[\e[38;5;4m\h\] \[\e[38;5;9m\W]\]\[\e[38;5;254m\$ \]'

I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following:  username@someserver ~/somepath $ ssh -i /path/to/private/key myusername@something.someserver.com  The command should render on two lines. Instead it will often wrap around and start writing over the top of my prompt, somewhat like this:  myreallylongusername@something.somelongserver.comh -i /path/to/private/key  If I decide to go back and change some argument there's no telling where the cursor will show up, sometimes in the middle of the prompt, but usually on the line above where I'm typing.   Additional fun happens when when I Up to a previous command. I've tried this in both gnome-terminal and terminator and on i3 and Cinnamon. Someone suggested it was my prompt, so here that is:  \[\033[01;32m\]\u:\[\033[01;34m\] \W\033[01;34m \$\[\033[00m\]  Ctrll, reset, and clear all do what they say, but when I type the command back in or Up the same things happens.  I checked and checkwinsize is enabled in bash. This happens on 80x24 and other window sizes.  Is this just something I learn to live with? Is there some piece of magic which I should know? I've settled for just using a really short prompt, but that doesn't fix the issue.


I fully understand the notion of compactness, but today I as wondering why we restrict the coverings to consist of open sets? I understand there is a separate compactness formulation for closed sets using the finite intersection property, but intuitively, why must the covers be open in the standard definition of compactness?

I'm a beginner in metric space. So many books I've read, there is only the notion of open covers. I want to know why do we worry about open covers to define the compactness of metric spaces and why don't we use closed covers? What is the problem in defining closed cover of a set? Can we use the alternative definition of compactness: "Every closed cover has a finite subcover"?


I got a silicon power 16gb usb flash and it has a bad virus in it. I called "cfsdaacdfawd". I have Windows 10 with bitdefender total security 2015.  tried everything to format it, BUT NOTHING WORKS.   I have tried these:   CMD and diskpart. 3rd party programs. (USB fix - Rufus - USB Format tool & ...)      partition manager. (partition manager 12 in safemode) disabling write-protected in registry.   After plugging in the USB flash, antivirus detect the viruses and deleting them, but when I pull it out and put it in again, all my files and folders coming back again with the virus.  I even deleted the partition with "partition manager 12" in safe mode, but it automatically going to the same old format again and the files and folders are still remains.   More Information:  the virus folder name: cfsdaacdfawd  in the cfsdaacdfawd folder:  aiasfacoafiasksf.vbss  Bitdefender Knows the virus with this name: Trojan.Downloader.JQVE  The flash also has the .lnk virus and make as u see. And the hidden files wont show up if i remove the flash and plug it in again.  when i'm trying to format it, right after i hit the format button, it looks like my taskbar gets refresh, i repeat my taskbar gets refresh, not desktop or my computer. please help with some more Professional suggestion.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I am newbie and using Github, I am stucking with this problem, I am trying to push some files to Git and try to use "git push origin master -f" to make some changes, but nothing change. It just say to me Evething up-to-date but when I see to Github, nothing change. I know my question is just a little bit stupid but could you plese help me? Thank you very much.

Ok, after seeing , I have decided to skip to the end and go with .  So what I need is a beginner's practical guide to Git.  "Beginner" being defined as someone who knows how to handle their compiler, understands to some level what a  is, and has touched source control without understanding it very well.  "Practical" being defined as this person doesn't want to get into great detail regarding what Git is doing in the background, and doesn't even care (or know) that it's distributed.  Your answers might hint at the possibilities, but try to aim for the beginner that wants to keep a 'main' repository on a 'server' which is backed up and secure, and treat their local repository as merely a 'client' resource.  So:  Installation/Setup    How do you set up Git?  Try to cover Linux, Windows, Mac, think 'client/server' mindset.         Working with the code          How do you handle binary files (visio docs, for instance, or compiler environments)? How do you merge files changed at the "same time"?    Tagging, branching, releases, baselines    How do you pull a particular 'release'?   How do you resolve conflicts and complete the merge? How do you merge parts of one branch into another branch?        Other   Describe and link to a good GUI, IDE plugin, etc. that makes Git a non-command line resource, but please list its limitations as well as its good.    - Cross platform, included with Git  - Cross platform history viewer, included with Git  - Mac OS X  - Mac OS X history viewer  - Cross platform, commercial, beta  - console GUI for Linux  - GUI for Windows, Linux  - package for Windows, includes friendly GUI  Any other common tasks a beginner should know?     How do I work effectively with a subversion repository set as my source control source?   Other Git beginner's references                 Delving into Git     (and )    I will go through the entries from time to time and 'tidy' them up so they have a consistent look/feel and it's easy to scan the list - feel free to follow a simple "header - brief explanation - list of instructions - gotchas and extra info" template.  I'll also link to the entries from the bullet list above so it's easy to find them later.


hi i am using custom font xcode 5. its font family name is "Alegre Sans"  i follow many tutorials online  of using custom font in xcode.   I have include custom font file name "alegre.ttf" in xcode resources folder. also i include this file in project .plist under  "Fonts provided by applications". and i am using this fond in viewdidload method of  viewcontroller like this   CustomLabel* lblObj = [[CustomLabel alloc]initWithFrame:CGRectMake(121, 30, 0, 0)];  [lblObj setText:@"FREE TRAIL"]; [lblObj sizeToFit]; [lblObj setFont:[UIFont fontWithName:@"Alegre Sans" size:10.0]];   //  [headerLabel setFont:[UIFont boldSystemFontOfSize:30.0]]; [lblObj setTextColor:[UIColor whiteColor]]; [lblObj setTextAlignment:NSTextAlignmentCenter]; [self.headerBgVw addSubview:lblObj];   but unable to change font.   I have wasted my whole day on it but not able to change font . is i am doing mistake in programing or including font file

I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible?


What is the proper name for references such as:   {!recordId}   It's not a "field".  "id" would be the field.  When creating a custom button, this is referenced as a "merge field".    I'm attempting to use it when customizing the Force.com menu where apparently you can use these references (trying to confirmed) in URLs.  So far, the brackets are being percent-encoded and breaking the resultant URL...

I am being lead to believe this is possible:  A URL on the Force.Com Sidebar Menu which references data from the currently open page.  i.e., /{!recordId}?nooverride=1    However, this does not work.  The brackets simply turn into percent encoded references on the resultant page.  Is it possible to pass information onto a URL on the Force.Com sidebar?


In my Xamarin project, I have an enum with description attribute and i want to populate my xaml listview with the enum value as text and the description attribute as detail. Text="{Binding}" works to refer to the value of the enum but i dont know how to bind detail property with the description attribute. Does anyone how i can do it? Thanks in advance

I have an enum construct like this:  public enum EnumDisplayStatus {     None    = 1,     Visible = 2,     Hidden  = 3,     MarkedForDeletion = 4 }   In my database, the enumerations are referenced by value. My question is, how can I turn the number representation of the enum back to the string name.   For example, given 2 the result should be Visible.


In these sentences:  “You have been riding the same bus for years, but only now have you noticed what the driver looks like!”  And  “It's better than the rubbish you listen to.”  The prepositions “like” and “to” are the ending of sentences. If I want to put them before “notice” and “listen”, how can I do this acceptably?  If do like this:  “You have been riding the same bus for years, but only now have you noticed like how / like what the driver looks!”  And:  “It's better than the rubbish to which you listen.”  are these acceptable?

Like many others, I commonly find myself ending a sentence with a preposition.  Yes, it makes me cringe.  I usually rewrite the sentence, but sometimes (in emails) I just live with it.  To, with... you know who you are.  Should I keep fighting myself on this one, or is it okay in some circumstances?


I find very interesting the example that if we let $Q_n$ be the maximum of n i.i.d. with distribution $U[0,\alpha]$, then $n(Q_n - \alpha)$ converges to an exponential distribution. See e.g.  for this solution.  What other examples are there that are similar in the sense that they are (1) non-trivial and (2) they don't need to rely on other theorems (e.g., like CLT or delta method), but rather can be found directly from taking the limit of the CDF.  I'm interested in both discrete and continuous examples.

The Maximum of $X_1,\dots,X_n. \sim$ i.i.d. Standardnormals converges to the  Distribution according to .  How can we show that?  We have   $$P(\max X_i \leq x)  = P(X_1 \leq x, \dots, X_n \leq x)   = P(X_1 \leq x) \cdots P(X_n \leq x) = F(x)^n $$  We need to find/choose $a_n>0,b_n\in\mathbb{R}$ sequences of constants such that: $$F\left(a_n x+b_n\right)^n\rightarrow^{n\rightarrow\infty}  G(x) = e^{-\exp(-x)}$$  Can you solve it or find it in literature?  There are some , but not for the Normal case:  $$\Phi\left(a_n x+b_n\right)^n=\left(\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{a_n x+b_n} e^{-\frac{y^2}{2}}dy\right)^n\rightarrow e^{-\exp(-x)}$$


Today I came across  that was, basically, asking for a library.  It was closed and OP wanted to know why, so I posted in the comments explaining that questions asking for Libraries aren't really the best type for StackOverflow, hence being close-voted.  However, follow-up comments from OP seem to suggest that he couldn't find anything in the FAQ regarding questions about libraries. Searching the FAQ for "library" or "libraries" yields 0 results.  Basically, can we have clearer information in the  regarding questions for libraries? I feel a little sorry for people like OP who feel (legitimately) that their question could be useful for future visitors but have had it closed because of the voting system options.  I'd like to be able to point to somewhere specifically (and officially) in the FAQ that says the following:     Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

We already have the following in the FAQ under "":        every answer is equally valid: “What’s your favorite ____________?”   your answer is provided along with the question, and you expect more answers: “I use ____________ for ____________, what do you use?”   there is no actual problem to be solved: “I’m curious if other people feel like I do.”   we are being asked an open-ended, hypothetical question: “What if ____________ happened?”   it is a rant disguised as a question: “____________ sucks, am I right?”      Can we add the following to the list, the higher-up the better?        you are asking for a product/tool recommendation, such as "Any recommendations for a ____________" or "Can anyone suggest a ____________ ?"      As I type this, I realize that recommendations could fall under the first bullet point, "Every answer is equally valid", but this tends to be overlooked a lot.    In that case, instead of a new bullet point, could we update the first bullet point to something along the lines of:        every answer is equally valid: “What’s your favorite ____________?”, or “Can you suggest/recommend a ____________?”      This way, recommendations and suggestions are explicitly called out as invalid.


I want to arrange items in the following way.    Special features observed are   Things are arranged in two columns. Enumeration items are arranged in two inner columns nested inside each of the two outer columns, resulting in apparently a total of four columns. (However, if the text is too long to put, then they do not form the inner columns. See item 5-6, 35-42.)  between the inner columns.   How can I do with LaTeX? (For my purpose, feature number 3 above is not a must.)

How can I make two columns in two columns same as in the picture?


My follower Faendal died and I wanted him to still be my follower so I used the resurrect command but now he doesn't let me say "I need you to follow me" and instead he acts like I didn't give Camilla the letter in his favor. How do I make him my follower again?  Edit: He doesn't even let me train in archery.

After using the command ressurect 1 after Ghorbash had died in battle, he stopped following me, and now I can't get him to follow me again. He's acting like he did before I convinced him to follow me in the first place.  Is there anything I can do, or am I going to have to find another good follower?


I have current TXT record for my domain:     v=spf1 a mx ip4:{ip-of-my-server} -all   Both email traffic and website goes to same machine. Now, I have to point website (A record) to other server. Will it broke Sender Policy Framework - note the "a" in TXT record?  If so, should I just strip "a" form current TXT record or reconfigure current record differently, and how?

This is a  about setting up .     I have an office with many computers that share a single external ip (I'm unsure if the address is static or dynamic). Each computer connects to our mail server via IMAP using outlook. Email is sent and received by those computers, and some users send and receive email on their mobile phones as well.  I am using  to generate an SPF record and I'm unsure about some of the fields in the wizard, specifically:   Enter any other domains who may send or relay mail for this domain Enter any IP addresses in CIDR format for netblocks that originate or relay mail for this domain Enter any other hosts which can send or relay mail for this domain How stringent should SPF-aware MTA's treat this?   the first few questions i'm fairly certain about... hope i have given enough info.


I am using  for my IRC but for few days I am having error of open proxy so I asked them they replied on of my application is using open proxy port 8080. So question is how could is find which one using it.

I'd like to be able to find out which process is currently using a certain port in Linux. Is there any way to do this?


I need to use this without python coding. Thanks, is there a shortcut or anything? I tried Crtl+L and just L and it just selects my whole model.

I watched a video of somebody selecting more vertices/edges/faces using the < and > signs in edit mode. He would select one face then using the > sign it would select more connected faces.    The problem is I'm on a Mac and those two keys are under the , and . that will also no work using the the shift key. Is there another shortcut to do this?


Let $R$ be a ring with identity, let $n\in \mathbb N^*$, and let $S=M_n(R)$ be the ring of $n\times n$ matrices with entries in $R$. Let $J$ be an ideal of $S$. Prove that the ideal $K := \{a \in R \mid a$ is the $(1,1)$ entry of some element of $J\}$  coincides with the set of elements of $R$ that occur as entries of elements of $J$.  First, I need to show that $M_n(K)=J$. I see it is kind of ambiguous to show that for any $A \in J$, $A \in M_n(k).$ Also, if $B \in M_n(K)$ it has entries in $K$, but how can we know that this entries are the same entries for a matrix in $A \in J$. I would apprecitate any help with that.

I'm trying to do a few proofs about rings: $(1)$ I want to show that for a ring $R$ and the ring of matrices $M_n(R)$, if $I\lhd R\implies M_n(I)\lhd M_n(R)$ and that all ideals of $M_n(R)$ are of the form $M_n(I)$. $(2)$ Prove that if $R$ is a ring with division then $M_n(R)$ is a simple ring.  The relation $I\lhd R$ implies that with $r\in R$ and $x\in I$ we have $rx\in I, xr\in I$. But how can I prove the statement for matrices?, here's what I would do: Consider $\psi \in M_n(R)$, if is given any matrix $\phi\in M_n(I)$ it must be $\psi \phi \in M_n(I),\phi \psi \in M_n(I)$, if we denote the element $(i,j)$ of each matrix by $\phi_{ij}$ and $\psi_{ij}$, then $(\psi \phi)_{ij}=\sum_{k=1}^n \psi_{ik}\phi_{kj}$ and $(\phi \psi)_{ij}=\sum_{k=1}^n \phi_{ik}\psi_{kj}$.  Since $I\lhd R$ is $\psi_{ik}\phi_{kj}\in I$ and $\phi_{ik}\psi_{kj}\in I$, which means that $I\lhd R\implies M_n(I)\lhd M_n(R)$.  To show that every ideal of $M_n(R)$ are of the form $M_n(I)$ with $I$ ideal: Suppose $I$ is not an ideal of $R$, then exists $r\in R$ such that $rx\notin I$ or $xr\notin I$, then with taking a matrix $\phi\in M_n(I)$ such that $x$ is an entry of $\phi$ and a matrix $\psi$ such that $r$ is an entry of $\psi$ we get that the matrices $\phi$ and $\psi$ have an entry $xr$ or $rx$, in either case this is not an element of $I$ then the matrix is not in $M_n(I)$. This concludes my proof (is it?) for $(1)$.  For $(2)$ I'd like to proceed by absurdum . Let's say that $M_n(R)$ is not a simple ring, then it has at least one ideal. Denote by $\varphi$ this ideal in $I$, then for any matrix $\psi$ we have $\varphi\psi \in M_n(I)$ and $\psi \varphi \in M_n(I)$.  Now, can $R$ be a ring with division?.I'm not sure how to prove that it can't. I believe I could use this theorem: "If $I\lhd R$ and $1\in I$ then $I=R$. The case $I\neq R$ implies $1\neq R$ and since $\varphi \psi$ and $\psi \varphi$ are in $M_n(I)$ then there are at entries in the product matrix which belong to $I$ (using $I \lhd R$) but are not $1$ (1\notin I); then there are elements in $I$ (and therefore in $R$ by $I\subset R$) that are not invertible, follows that $R$ is not a ring with division. But if $I=R$?, here I can't see a why $R$ can't be a ring with division.


It seems that even in SQL Server 2012, the maximum memory usage settings is not a hard limit. I've read some SQLOS Team blogs about this, and those as well as several MSDN articles seem to state that the maximum memory usage is just that - a maximum.  But that doesn't appear to be accurate.  I have a QA environment and the app and SQL are on the same server (this is typical for our application). I've tried setting maximum memory usage to both 8GB and 4GB, but eventually, usually within 24 hours, SQL is utilizing about 13GB (all available) of memory.  Is there an actual way to hard limit SQL Server to not use more than x GB of memory?  Edit: is it possible that the databases themselves being in SQL Server 2008 compatibility mode is causing this?  Target Memory (Performance Counter) is 100% of the 4GB maximum memory value I gave it. Now, of course, it's currently lower because I had to restart SQL Server services to allow anything else to work properly.  select * from sys.dm_os_process_memory:

I've got an instance of SQL Server 2012 SP2 Enterprise Edition consuming ~20GB of memory higher than the max. memory limit. The instance is limited to 65GB but the physical memory in use from the below query shows 86GB  SELECT (physical_memory_in_use_kb/1024)/1024 AS [PhysicalMemInUseGB] FROM sys.dm_os_process_memory; GO   The server is physical with 2 NUMA nodes. Is there a way that can I find out what is consuming the memory outside of the buffer pool (I'm assuming that is what's happening)?  Here's the output of DBCC MEMORYSTATUS:-    And here'e the set memory limit:-    Thanks in advance.  UPDATE:- I've run the query that Aaron suggested  SELECT TOP (20) * FROM sys.dm_os_memory_clerks ORDER BY pages_kb DESC   Here's the output:-    The SUM of pages_kb comes to ~60GB  UPDATE 2:- Full output of DBCC MEMORYSTATUS is here:-   UPDATE 3:- Output of Shanky's scripts in excel file here:-   UPDATE 4:- Screenshot of the output of:-  SELECT (physical_memory_in_use_kb/1024)/1024 AS [PhysicalMemInUseGB] FROM sys.dm_os_process_memory; GO     So this seems to indicate that SQL Server is using more than the 65GB set.


So I've been working on an explosion, with textured planes coming out of a particle system. Too bad it destroyes the whole feeling, when I can't see the texture on one of the planes, but a line, which is the plane, but not aligned to the camera. It also makes the middle of the explosion seen by the camera almost fully invisible, because there are no planes aligned to the camera. I tried to "Track To" the parent texture plane to the camera, but it only worked for that specific object, not the partices.  I couldn't find any solution not even on YouTube or Stackexchange so I'm asking you for help :)

How can I make all the particles in a particle system face the camera?


What are the possible drawbacks of implementing "dropout" in neural network training? (if there is any)? Thank you,

I am playing with  since all state of the art results in machine learning seem to be using it (for example, see ). I am familiar with all the guidelines (train longer, increase capacity of the model, use higher learning rates), but still cannot see it working. I've tried several different examples: , , MLP for MNIST, , and turning off dropout makes all my results better even though the default configurations have dropout (taken from the ). For example, I am attaching my results for one of the models trained on the IRIS dataset. The configuration without dropout has clearly the best performance.   What am I missing?  The code for the IRIS example is .


In an e-mail to a superior, should I write "I shall create a page", or "I will create a page"?

Which is the correct use of these two words, and in which context should one be used rather than the other?


import java.util.Scanner; import java.util.Arrays;  public class rr {  public static void main(String[] args)  {  int i =1; Scanner input = new Scanner(System.in); System.out.print("Please enter the number of data points: "); int data = input.nextInt(); double [] userArray = new double[data]; if(data < 0){     System.out.println("The number should be posotive. Exiting."); } else {System.out.println("Enter the data:"); } while (i <= data) {  int userInput = input.nextInt();        i ++;   }  insertionSort(userArray); }  static void insertionSort(double[] arr) {   int i, j;   double newValue;   for (i = 1; i < arr.length; i++) {         newValue = arr[i];         j = i;         while (j > 0 && arr[j - 1] > newValue) {               arr[j] = arr[j - 1];               j--;         }         arr[j] = newValue;   }   System.out.println(Array.toString(arr)); } }   The program is supposed to take the values inputted by the user, sort them with the insertionSort method, then print it. I think that the values are being sorted but they are not being printed for some reason.

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I am comparing a model's outcome with the actual values for a span of 9 months. I am expecting a very large error, however my MAPE implementation yields 1404512.56 using python, pandas.  Here is my implementation:  def mean_absolute_percentage_error(y_true, y_pred):     y_true, y_pred = np.array(y_true), np.array(y_pred)     return np.mean(np.abs((y_true - y_pred) / y_true)) * 100   There were instances in y_true (the actual values) where they were 0, but I have replaced them with 0.001 to avoid division by 0.   If anyone could provide a hint as to what MAPE means when it's that high, I'd appreciate it.

The  () is a common accuracy or error measure for time series or other predictions,  $$ \text{MAPE} = \frac{100}{n}\sum_{t=1}^n\frac{|A_t-F_t|}{A_t}\%,$$  where $A_t$ are actuals and $F_t$ corresponding forecasts or predictions.  The MAPE is a percentage, so we can easily compare it between series, and people can easily understand and interpret percentages.  However, I hear that the MAPE has drawbacks. I'd like to understand these drawbacks better so I can make an informed decision about whether to use the MAPE or some alternative like the MSE (), the MAE () or the MASE ().


I have written a very basic shell in C. It reads the input, then runs it using system(lineCopy); (lineCopy being a copy of the input). All commands will run fine in it, other than cd. When I try to cd to a different directory, it simply stays in the current directory. If I try to cd to a directory that doesn't exist, it says, as it should sh: 1: cd: can't cd to /some_nonexistant_directory. When I try to cd to a directory that DOES exist, however, it reads that command, but then stays in the same directory. The variable in which I store the current PWD is continuesly updating, so it cannot be that. All other commands work perfectly. But why does cd not?

Is there any intrinsic difference between a builtin command and another command which can nominally do the same thing?     eg. Do builtins get "special" treatement? ... is there less overhead running them? .. or are they just simply 'built in'; like the dashboard of your car?     ...and is there a definitive (current) list of these builtins?


I am trying to get the Standard Report As a csv file and try to split the file and need to do some conditions.  But for the large amount of records am getting error as:     Regex too complicated   Please help me out  Apex:  public List<String> convertToExcel(Id LiseReportId) {      //LiseReportId is the standard report ID             ApexPages.PageReference report = new ApexPages.PageReference('/' + LiseReportId + '?csv=1');         blobcontent = Test.isRunningTest() ? Blob.valueOf('UNIT.TEST') : report.getContent();          System.debug('blobcontent &&report: ' + report+':::'+blobcontent);         String strfile =blobToString(blobcontent ,'ISO-8859-1');         String[] strlineByCsvBody = new String[]{};         strlineByCsvBody = strfile .split('\n');          return strlineByCsvBody;      }        public String blobToString(Blob input, String inCharset){             String strhex = EncodingUtil.convertToHex(input);             System.assertEquals(0, strhex.length() & 1);             final Integer bytesCount = strhex.length() >> 1;             String[] bytes = new String[bytesCount];             for(Integer i = 0; i < bytesCount; ++i)                 bytes[i] =  strhex.mid(i << 1, 2);             return EncodingUtil.urlDecode('%' + String.join(bytes, '%'), inCharset);         }   Getting error at below line:     strlineByCsvBody = strfile .split('\n')

I have created a function wherein I split a string from the csv filecsvAsString.split('\n') . It is working when the string is not so big. But when I try to split a very large string, an error will occur      regex too complicated   what I want to do is to catch if an error occur during the split process. How will I do it ? I've tried to use try and catch but the problem still occur. Is there any other possible solution?


Does $\left(-3\right)^\frac{2}{2}$ not equal $\sqrt{\left(-3\right)^2}$?

I know there must be something unmathematical in the following but I don't know where it is: \begin{align} \sqrt{-1} &= i \\\\\ \frac1{\sqrt{-1}} &= \frac1i \\\\  \frac{\sqrt1}{\sqrt{-1}} &= \frac1i \\\\  \sqrt{\frac1{-1}} &= \frac1i \\\\  \sqrt{\frac{-1}1} &= \frac1i \\\\  \sqrt{-1} &= \frac1i \\\\  i &= \frac1i \\\\  i^2 &= 1 \\\\  -1 &= 1 \quad !!? \end{align}


I want to know how to prove that the below matrix is invertible   \begin{pmatrix} 1 & \frac { 1 }{ 2 }  & ... & \frac { 1 }{ n }  \\ \frac { 1 }{ 2 }  & \frac { 1 }{ 3 }  & ... & \frac { 1 }{ n+1 }  \\ ... & ... & ... & ... \\ \frac { 1 }{ n }  & \frac { 1 }{ n+1 }  & ... & \frac { 1 }{ 2n-1 }  \end{pmatrix}  and that the inverse matrix has integer entries.

This Exercise $12$ page $27$ from Hoffman and Kunze's book Linear Algebra.     The result o Example $16$ suggests that perhaps the matrix      $$A = \begin{bmatrix} 1 & \frac{1}{2} & \ldots & \frac{1}{n}\\  \frac{1}{2} & \frac{1}{3} & \ldots & \frac{1}{n+1}\\ \vdots & \vdots &  & \vdots \\ \frac{1}{n} &\frac{1}{n+1} &\ldots &\frac{1}{2n-1} \end{bmatrix}$$      is invertible and $A^{-1}$ has integer entries. Can you prove that?   I will copy their words before that example:      Some people find it less awkward to carry along two sequences of   matrices, one describing the reduction of $A$ to the identity and the   other recording the effect of the same sequence of operations starting   from the identity.   In this , Adrián Barquero says:      If your linear algebra textbook is Kenneth Hoffmann and Ray Kunze's   Linear Algebra book then I was in the same situation you're right now   a few years ago, but I was adviced at the moment that this particular   exercise wasn't as easy as one might expect at first.      The matrix you have is called the Hilbert matrix and the question you   have was already asked a couple of times in math overflow  and   . They have excellent answers so I will just point you to them.   My question: Is it possible answer the question made by the authors without using high techniques?  I am not allowed to use determinants here.  PS: Those answers in MO don't answer the question above. I apologise if this question is unappropriated or if I was unable to understand their answers.


I came across some youtube videos that they mentioned ubuntu touch can be installed in any device that supports android. is it true? then why it is mentioned separately that only nexus or some bq acquaris can only run ubuntu?

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


, is there an easy and convenient way to install it on Ubuntu 14.04 through the package manager (ie. apt-get)?  I would also appreciate information on how to properly configure my system to use it as its compiler.

How do I install the latest version of gcc and g++?  I am using a variety of C++11 and C++1y features; which is why I need this.