We can never have more than $\frac{n}{2}$ edges of a graph $G$ of order $n$ that are colored the same. Why?

I was going through the text: A First Course in Graph Theory by Chartrand, Zhang, where I came across the following claim, [here graph $G$ is of order $n$] :  Any two edges of $G$ that are colored the same cannot be adjacent of course. This says that we can never have more than $\frac{n}{2}$ edges of $G$ that are colored the same.  Which means that maximum number of non-adjacent vertices in a graph $G$ is $\frac{n}{2}$. The text does not give any reason or logic behind the same, which makes me feel that this fact is quite obvious and can be obtained quite intuitively. But I could not quite obtain it intuitively but rather I tried out a sort of small proof. Let $G$ be a graph with $n$ vertices. Let $G$ be such that $C_n$ is a subgraph of $G$. [The number $\frac{n}{2}$ made me feel that we are using the alternate edges from the maximum possible cycle in the graph.]  $\quad\quad\quad\quad\quad\quad$The edges highlighted with yellow indicate the non adjacent edges in the graph If $n$ is even in the above diagram we shall attain the number $\frac{n}{2}$ of non adjacent edges. But suppose,of the sake of contradiction, there were $\frac{n}{2}+1$ non adjacent edges. But since the edges highlighted in yellow have covered all the vertices in $C_n$, not is impossible for us to incorporate another edges $e$, which is not adjacent to any of the above yellow edges. So we arrive at a contradiction. But is it possible to understand the above bound more intuitively (unlike  where a rigorous proof is asked, but my main intention is not to get a proof but rather understand the claim, in an intuitive manner, which even the authors I guess had in their minds, while writing the book) ?


Construct new table by dropping rows that don't have highest "priority"

I have a table that contains a list of names used to designate objects (represented themselves by an id). It is created with: CREATE TABLE all_names (     id       integer NOT NULL,     name     varchar(64) PRIMARY KEY,     priority integer NOT NULL, );  (The priority field is mostly used to sort the list of synonyms of an object with given id.) I would like to create from this table another table that associates to each object its name with highest priority. Columns should be like this: CREATE TABLE objs (     id       integer PRIMARY KEY,     name     varchar(64) NOT NULL UNIQUE,  );  How can I fill the new table with only the top names? Example all_names: id name priority ---------------- 1  A    3 1  AA   2 1  AAA  1  2  B    1  3  C    4 3  CC   3 3  CCC  2 3  CCCC 1  should give me: objs: id name ------- 1  A 2  B 3  C  as the name of object 1 with highest priority is A, etc. EDIT


Can I make an opportunity attack against a grappled creature if it's being moved out of my reach?

We just recently started using the grapple mechanics in D&D 5e. I was wondering if it was possible to set up multiple opportunity attacks by grappling an enemy creature and then moving it out of your allies reach.   Since it is not specifically forbidden in any of the rulings pertaining to grapple or opportunity attacks, I'm inclined to allow it in my games. This does create a power balancing problem though, giving advantage to the bigger group (which seems only logical). Making an encounter with 10 low level enemies possibly more dangerous then an encounter with 1 high level enemy.  I would like to know if any other DM's have run into this issue, or maybe its no issue at all.


How to ensure that 2 couples of figures are on 2 facing pages?

I would like to reproduce the following layout with two figures on one page and two others on the facing pages.    I would like the first couple to be on an even-numbered page and the second on an odd-numbered page so that all four figures can be seen together when the manuscript is printed and bound.


What does the degree of a loop in $S^1$ means *intuitively?

I'm trying to understand what the degree of a loop in $S^1$ means intuitively from the definition and how it relates to the winding number of a loop in $\mathbb{R^2}$.  My lecture notes define degree to be     Let $p$ be a loop in $S^1$, and let $\tilde p$ be a lift of $p$.   Define the degree of $p$ to be $\tilde p(1) - \tilde p(0)$.   What does this definition actually mean intuitevly, and how does it relate to 'the number of times it winds round itself'?  Also, either I've missed something or my lecture notes seem to assume that the degree in in $\mathbb{Z}$, is this an obvious fact that I'm just not seeing?   Thank!


Proof: $\cot(7.5^\circ) = \sqrt2 +\sqrt3 + \sqrt 4 + \sqrt6$

I am working on this problem, but I am not able to simplify the expression.   So please help me.  Thanks in advance


I have found an error in Bibtex file, i.e.  in bib file  @article{Hello, title = "2D and 3D implementation of a method ... }   the resulting Pdf is 2d and 3d implementation of a method  why we cannot get "2D, 3D" in PDF?  Best


In Drupal 7. I am printing a cck field image to my page.tpl like this  <?php print render(field_view_field('node', $node, 'field_slide_photo1',  array('label'=>'hidden'))); ?>   and I get this error php  Strict warning: Only variables should be passed by reference in include() (line 59 of var/www/html/upgrade2a/sites/all/themes/themea/page.tpl.php  But I can use this in node.tp with out errors?     print render($content['field_upload_thumbnail']);  How do a print a field that is available in the page template?


Trying to get Image to import but the I am getting an Error

I am trying to add an image to my JOptionPane and I have been piecing things together to see if it will work but I am getting a NullPointerException  Here is my code:  public class MonitoringSystem {  public static void main(String[] a) throws IOException, UnSupportedLookAndFeelException{  FileInputStream fileBytesStream = null; Scanner inFS = null; { { try{  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());             } catch (ClassNotFoundException | InstantiationException |     IllegalAccessException | UnsupportedLookAndFeelException ex) {             }  ImageIcon icon = new ImageIcon(MonitoringSystem.class.getResource        ("C:\\Users\\Zoltek\\Desktop\\Zoo.jpg"));  Object[] options = {"Animals","Habitats","Exit"}; int n = JOptionPane.showOptionDialog(null,         "Zookeepers would you like to view animal activities or monitor        habitats?",         "Welcome to the Brooklyn Zoo!",         JOptionPane.YES_NO_CANCEL_OPTION,         icon,         options,         options[1]);    System.out.println(n);    JFrame animal = new JFrame("Animals");   JFrame habitat = new JFrame("Habitats");   if(n==0){    animal.setVisible(true);  String[] choices = {"Lions","Bears","Giraffes"}; String input = (String) JOptionPane.showInputDialog(null,"Select  Animal:","Zoo Animals", JOptionPane.QUESTION_MESSAGE,null,choices,choices[1]);


How can I use an attribute value from a mesh's material in another material?

I want a lamp to emit as much light as a fire. I have a property in my fire material that says "flame". It seems like a good value to copy to my point light's material strength value. I've considered drivers but I'm too new to the concept and I'm not sure how I can pull it off. If anyone has an idea...  I understand that this question has already been answered in the case of constant input values, but the Attribute node I want to use is linked to a mesh, making it trickier to use for another object.  Here is a blend file with what I want to do: . Light and fire on separate layers so it is possible to see the effect on the plane behind.


Why won't my horse show hearts when tamed?

I have ridden this horse a lot and have stopped getting thrown off, but I never got any hearts. Even Golden Apples and Golden Carrots don't give me hearts like the Minecraft wiki says they will when fed to a tamed horse. Am I doing something wrong?


I found on this website  proof that the probability of two people in a room having the same birthday equates to 50% when when there are 23 people in the room  The only thing is, the explanation is too complicated for the average Middle School student to comprehend. So, my question is, is there any simplifies explanation of how this works? I tried Wikipedia but the explanations were even more complicated.  Thanks!


The line distance in my title of my Master Thesis changes from the second to the third line. My code looks as follows:  Cover sheet:  \thispagestyle{empty} \begin{center}  \sffamily  \textbf{\huge\title}  \vspace*{2.8cm}  \framebox[15.5cm]{\textbf{\huge\thesis}}  \vspace*{1.6cm}  ...   Definition file:  \documentclass[a4paper,bibtotoc,oneside,10pt]{scrreprt}   \def\title{Latex changes the line distance of my title from the second to the third line. I don't know whats the problem...}


Command to open new tab in the current terminal and pass command to run on new tab

I know that gnome-terminal will open a new window, I wondered is there a way to open a new tab, not just a new window?  After this, is there a way to pass a command to the new window for example  gnome-terminal && cd /  Which will result in   New Terminal Opens New Terminal then runs cd /   [Edit] Will these answers will say how to pass cmds to another terminal, it does not answer how to open a new TAB. Which is what I am after, I do not want more than one terminal open.


Should Stack Overflow/Exchange have a mechanism for marking obsolete questions?

I was viewing some old posts on Stack Overflow (two-year-old posts) and found that due to "fast technology trend changing," some of them are no longer valid. Stack Overflow (and the Stack Exchange sites generally) should have some sort of criteria to tag questions as Obsolete, or a vote-based system to mark them as such.  I am not in favour of closing obsolete questions.


Determine which process (b)locks a file, programmatically (under Windows >= XP)

How to programmatically determine from a process P, which other process P' has a lock on a file, that prevents P from recreating that file ?  I know there are tools to do that, but how do they achieve that ?  (Context: a batch program that runs overnight fails because of a locked file. Running an admin tool the next day may be too late to get useful information. So it would be nice if the batch program itself was able to determine the culprit.)  EDIT: Added complexity: the file resides on a DFS and P' might not run on the same machine as P (but maybe does). But a solution that works locally would be a good beginning.


How can I ask for clarification on a question I'd like to answer if I can't add comments?

I've been trying to break the 15 barrier for about 2 years now (much less the 50 barrrier!), and I want to try and answer this question:    But the question needs some clarification before I can answer it. How can I get this clarification if I can't post a comment? Or do I just have to sit this one out?


Which characteristics of a Radio signal are involved to be selected by radio receiver?

the radio antennas receives millions of signals. how our radio selects the appropriate signal as it's input?  which characteristics of the signal are involved for this selection.


I flagged  because I mis-read it and thought it was a thank-you answer and not a real one. I know my flag will be rejected and rightly so, but I wish I could have retracted it myself. The close-vote pop-up allows retraction, I request the flagging pop-up be given the same feature.


remove packages with error on apt-get update

I am very new to linux. I tried to install sopcast on it but it failed and then I installed it on wine. But now every time i run the sudo apt-get update it is taking very long trying to install(?) the sopcast package and fails every time. How can i completely stop ubuntu from trying to install this package?  Here is whats going on in the terminal when i run sudo apt-get update. A lot of Ign: lines, like   Ign:24 http://ppa.launchpad.net/ferramroberto/sopcast/ubuntu xenial/main i386 Packages   and it ends with  W: The repository 'http//ppa.launchpad.net/ferramroberto/sopcast/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: http//ppa.launchpad.net/lyc256/sopcast-player/ubuntu/dists/vivid/Release.gpg: Signature by key 732241F9E505AA9CBC15CC719A2E47237733638E uses weak digest algorithm (SHA1) E: Failed to fetch http//ppa.launchpad.net/ferramroberto/sopcast/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   I am not having any big issues with this, its just that every time i run the update command i need to wait for 4-5 minutes. Is there any file I need to edit to stop it from trying to install the sopcast package? I tried sudo apt-get --purge remove sopcast* but this did not change anything


forEach in JavaScript not working collecting Object Values

The output of the following snippet should return the names of 5 cities in an array, but the result is a blank array. Why?    arr = [   {name: "London", population: 30},   {name: "Moscow", population: 20},   {name: "Delhi", population: 50},   {name: "New York", population: 35},   {name: "Paris", population: 42} ]  var temp = []; arr.forEach((item, index) => {   temp.push[item.name]; }); console.log(temp);


Suppose we have two third order systems (a and b), with three poles and two zeroes,poles for both the systems are at the same positions in frequency domain but these systems differ in the placement of their zeroes as shown in the figure below:  The abovve figure is a plot of the loop gain of the systems. Here za1 and za2 are the zeroes for system a and zb1 and zb2 for system b. The exact shape of the magnitude plot of loop gain would differ for the two plots, I only intend to highlight the position of zeroes for the two systems. In system a the zeroes lie before the unity loop gain frequency whereas in system b they lie after the unity loop gain frequency. Suppose unity gain frequency lies away from the zeroes of both the systems. Clearly the phase margin in case a is close to 90deg while that in case b is close to 270deg. Thus we would conclude that system b is unstable. My question is, since the stability depends only on the system poles which are same in both the cases, how do these systems differ in their stability?


How many different sudoku puzzles are there?

The answer: 6, 670, 903, 752, 021, 072, 936, 960, according to this site:  I have tried to get this number using direct methods but basically I have found the question too hard. There are too many possibilities, but I am likely missing some strategic ways to solve the problem. Any help would be greatly appreciated, thanks.


Does heat sink of laptop contain any coolant?

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


Create an example of a function $f: \mathbb{R} \to \mathbb{R}$ such that $f(f(f(\mathbb{R}))) = f(f(\mathbb{R})) \neq f(\mathbb{R})$.


my laptop keeps crashing and freezing now it will not boot up properly I get a blank screen with no programme icons visible, any ideas


Show that $S=\{\frac{p}{2^i}: p\in\Bbb Z,  i \in \Bbb N \}$ is dense in $\Bbb R$.  Just found this given as an example of a dense set while reading, and I couldn't convince myself of this claim's truthfulness. It kind of bugs me and I wonder if you guys have any idea why it is true. (I thought of taking two rational numbers that I know exist in any real neighborhood and averaging them in some way, but I didn't get far with that idea..)  Thank you!


Recall the definition of the Weyl Chambers: A Weyl Chamber is a region of $V \setminus \bigcup_{\alpha \in \Phi} H_{\alpha}$, where $V$ is underlying Euclidean space, and $H_\alpha$ the hyperplane that is perpendicular to $\alpha$ the elements of  $\Phi$ in $V$.   I want to show that:   The Weyl chambers are open, convex and connected.   My attempts:   A single hyperplane $H_\alpha$ separates the space $V$ into two half-spaces: positive half-space $H_\alpha^+=\{x \in V \mid (\alpha,x)>0\}$ and negative half-space $H_\alpha^-=\{x \in V \mid (\alpha,x)<0\}$. It is clear that $V \setminus H_\alpha = H_\alpha^+\cup H^-_\alpha.$ As the result, the Weyl chambers can be regarded as components of  $$V \setminus \bigcup_{\alpha \in \Phi} H_{\alpha}= \bigcap_{\alpha \in \Phi} \left( V \setminus H_{\alpha} \right)= \bigcap_{\alpha \in \Phi} \left( H_\alpha^+\cup H_\alpha^- \right).$$ By the discussion above, a Weyl chamber is simply a $\textbf{intersection}$ of finite half-spaces. It is the case since one may write $$\left( H_\alpha^+\cup H_\alpha^- \right) \cap \left( H_\beta^+\cup H_\beta^- \right) =\left( H_\alpha^+\cap H_\beta^+ \right)  \cup\left( H_\alpha^+\cap H_\beta^- \right)  \cup \left( H_\alpha^-\cap H_\beta^+ \right)  \cup\left( H_\alpha^-\cap H_\beta^- \right).$$ Therefore openness and convexity of the Weyl chambers are straightforward since half-spaces are open and convex, so are their intersections. Moreover, we would replace $V$ by $\Bbb R^{\dim V}$ since they are isomorphic. Now we can prove that the Weyl chamber is connected by showing that every convex set in $\Bbb R^{\dim V}$ is connected. And I'm sure that proof of this statement existed. So am I done?


How a Gmail username can be taken but not recognised simultaneously?

Being at  I enter a desired username (without @gmail.com which is supposed), and I get error:     "That username is taken. Try another."   But when I try to login into Google with that xxx@gmail.com at  it fails with:     "Sorry, Google doesn't recognise that email."   How that can be?  P.S.: I want that username still.


What do spacelike and timelike intervals represent?

I've understood that with timelike intervals all observers agree on the order of events and with spacelike intervals the order of the events can be changed with the reference frame. However, I wanted to know what these two types of intervals physically/intuitively represent?  So what physical difference separates a spacelike and timelike interval?


The complement of a proper subgroup generates the whole group

$H$ is subgroup of $G$ with $H$ not equal $G$.  Be $S=G-H$. I am being asked to prove that $\langle S \rangle=G$.  Some tip to solve this? I think in $S_3$ is possible but I can´t prove.


Why graph of $\sin(x+{45}^\circ$) shifts to left instead of right

Why does the graph of $\sin(x+{45}^\circ$) shifts to left instead of right comparing with $\sin x$. With respect to point at which line passed from origin.  Mathematically i know , I can fill in values and plot to verify , but is there any other easy to understand explanation for this ?  Sorry if this sounds foolish question.  Thanks  See graph


Can't adjust Resolution on a virtual Ubuntu 14.04

I have recently created an Ubuntu Virtual Machine, but the resolution is way off, and I am not able to change it to a more appropriate size.   My host machine is a MacBook pro running 10.7.5 with a 1280x800 resolution. My virtual machine is running Ubuntu 14.04 and everything except the resolution is working fine. The resolution is not just "not ideal" but it is impossible to work with at 640x480.   I have researched a lot and looked all over askubuntu, but none of the answers I have found work for me. And I do have guest additions installed.   What I have tried    seems to be a very informative and exhaustive answer, yet none of the solutions he has offered have worked for me.  1. Use Mouse to adjust screen size     Adjusting the screen by resizing the Virtual Box Windows with the mouse allows for any screen resolution up to the host screen resolution.   I have tried that but the resolution remains the same and gray bars are added around the outside of the window.   2. Use predefined standard screen sizes      If you need a fixed (standard) resolution you may also choose System Settings -> Monitors (for 11.04) or Displays (for 12.04) for a selection of fixed resolutions (here shown for 12.04):        For maximum host screen resolution you will need to run Virtual Box in Fullscreen mode (Host + F)   For a fixed host screen resolution we need to disable Auto-resize Guest Display (HOST+G) from Virtual Box Manager View menu.   1: The only option I have is 640x480.  2: When I go to fullscreen, it just makes the gray bars larger without affecting the  resolution.  3: Auto-resize Guest Display is grayed out and I am unable to disable it. Host+G also does nothing.  3. Define new geometry with xrandr     If you need a fixed geometry that is not in the list of resolutions for monitors you will have to use xrandr to define a new resolution:      First we use gtf for calculating the modeline of possible resolutions:   gtf <xres> <yres> <refresh> [-x]      Give the desired values for x-resolution, y-resolution and refresh rate. The flag -x is default and can be omitted. For a portrait resolution 480x640 at 60 Hz you will get the following output:   $ gtf 480 640 60 -x $ 480x640 @ 60.00 Hz (GTF) hsync: 39.78 kHz; pclk: 24.82 MHz Modeline "480x640_60.00" 24.82 480 504 552 624 640 641 644 663 -HSync +Vsync      From this we can copy & paste the modeline to add it to xrandr list of known resolutions:   xrandr --newmode "480x640_60.00" 24.82 480 504 552 624 640 641 644 663 -HSync +Vsync      and add this for the Virtual Box Monitor:   xrandr --addmode VBOX0 480x640_60.00      Replace VBOX0 with the appropriate monitor if you have setup Virtual Box with multiple monitors (or any other output name the driver reports).      We can now switch to the newly defined geometry as described above (2.).   I have done as he said ^ there. Here is what I wrote in the terminal and what the terminal said back.  VirtualBox:~$ cvt 1280 800 # 1280X800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 Mhz Modeline "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync VirtualBox:~$ xrandr --newmode "1280X800" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync xrandr: Failed to get size of gamma for output defualt  VirtualBox:~$ xrandr --addmode default 1280X800_60.00 xrandr: Failed to get size of gamma for output defualt xrandr: Cannot find mode "1280X800_60.00"   Any help would be appreciated, I'm pulling my hair out over this!


The following is an extract from my LaTeX file which describes a table. The table has a fair amount of space below it. I would, therefore, like to increase the arraystretch. However, by increasing it slightly, the table moves to the next page.  Why does LaTeX think the table is too big for the first page? How can I force it to put the table right after the text?  Thanks!  \documentclass[a4paper,12pt]{article}  \usepackage{amsmath,graphicx,fullpage,microtype,hyperref,subfig,hypcap,amsfonts,parskip,multirow,titlesec}  \titlespacing\section{0pt}{20pt plus 4pt minus 2pt}{2pt plus 4pt minus 2pt} \titlespacing\subsection{0pt}{16pt plus 4pt minus 2pt}{2pt plus 4pt minus 2pt}  \widowpenalty=2000 \clubpenalty=2000 \hyphenpenalty=400 \interfootnotelinepenalty=400 \DisableLigatures{encoding=*,family=*} \numberwithin{equation}{section} \hypersetup{colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black}  \begin{document}  \section{Payoff Matrix} \label{sec:Payoff Matrix}  From the brief description in section~\ref{sec:Model and Assumptions} and the full description of section~\ref{sec:Extensive Form}, it is straight forward to create the payoff matrix, which shows the expected payoff to the sender and to the receiver as a function of their strategies.  \vspace{6mm}  \begin{table}[h] \small \renewcommand\arraystretch{1.05} \begin{center} \begin{tabular}{l||lr|lr}  &\multicolumn{2}{c|}{AA}&\multicolumn{2}{c}{AK}\\ \hline \hline \multirow{2}{*}{GGGG}& &$1$& &$1$\\ &&&&\\  &$p$& &$p$& \\ \hline \multirow{7}{*}{GGGB}& &$p(1-e_{1})+$& &$p(1-e_{1})+$\\  & &$p(e_{1})(1-e_{3})+$& &$p(e_{1})(1-e_{3})+$\\  & &$(1-p)(e_{1})+$& &$(1-p)(e_{2})+$\\  & &$(1-p)(1-e_{1})(1-e_{3})$& &$(1-p)(1-e_{2})(e_{3})$\\ &&&&\\  &$p(1-e_{1})+$& &$p(1-e_{1})+$& \\  &$p(e_{3})(1-e_{3})+$& &$p(e_{1})(1-e_{3})+$& \\  &$(1-p)(1-e_{1})(e_{3})$& &$(1-p)(1-e_{2})(e_{3})$& \\ \hline \multirow{4}{*}{GGBB}& &$p(1-e_{1})+$& &$p(1-e_{1})$\\  & &$(1-p)(e_{1})$& &$(1-p)(e_{2})$\\ &&&&\\  &$1-e_{1}$& &$p(1-e_{1})+$& \\  &$ $& &$(1-p)(1-e_{2})$& \\ \hline \multirow{4}{*}{GBGB}& &$x$& &$x$\\  & &$x$& &$x$\\ &&&&\\  &$x$& &$x$& \\  &$x$& &$x$& \\ \hline \multirow{7}{*}{GBBB}& &$x$& &$x$\\  & &$x$& &$x$\\  & &$x$& &$x$\\  & &$x$& &$x$\\ &&&&\\  &$x$& &$x$& \\  &$x$& &$x$& \\  &$x$& &$x$& \\ \hline \multirow{2}{*}{BBBB}& &$0$& &$0$\\ &&&&\\  &$1-p$& &$1-p$&  \end{tabular} \end{center} \caption{The payoff matrix} \label{eq:Label} \end{table}  \end{document}


Best Approach/Way to Query Single SObject record

To query a single record we have below two approach :  Approach 1. Assign record to a single Account variable as shown below:  Account accountToGet = [SELECT Name From Account where name = 'UniqueAccount' LIMIT 1];   With above line, it throws below error if no record founds : System.QueryException: List has no rows for assignment to SObject  Approach 2. Assign single record to a List variable as mention below :   List<Account> lstAccount = [SELECT Name From Account where name = 'Unknown Account'];    Even if SOQL returns no records, above line doesn't throws an error. We can use below line to avoid NULL errors.  if(!lstAccount.IsEmpty())     System.debug('No Error');   To handle NULL exception in Approach 1, we need to handle NULL exception in try....catch. It looks like an approach where we will error to occur and then handle it in try....catch.  With Approach 2, we can avoid exception to occur and without using try..catch.. also the code will work.  Based on above approaches, I think approach 2 is fine to prevent errors. Can anyone give me suggestion that why should not we use approach 2?


Why does my code not work when I'm adding my panels onto a container but it works when I use JFrame?

As it shows on my code, I'm trying to make a simple JApplet with two JButtons and a JTextfield (which I haven't gotten to). Whenever I place everything on a container, I get a NullPointerException error. When I put it all on a JFrame, it works. I've made simple JApplets without placing all my components onto a JFrame before and they've worked but I can't seem to figure out why this one doesn't.   import javax.swing.*; import java.awt.Color; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.*;  public class ActionListenerPractice extends JApplet implements ActionListener {      Container con;     //JFrame frame;     JPanel panel;     JButton dogButton, catButton;     JTextField descriptionField;      public static void main(String[] args)     {         new ActionListenerPractice();     }      public ActionListenerPractice()     {         init();     }      public void init()     {/*         //Create frame obj and set it         frame = new JFrame();         frame.setVisible(true);         frame.setSize(500, 500);*/          //Create panel obj and set it         panel = new JPanel();         panel.setLayout(new GridLayout(1,3));         panel.setBackground(Color.black);          //Add and set buttons         dogButton = new JButton("I choose a dog");         dogButton.addActionListener(this);         dogButton.setBackground(Color.cyan);          catButton = new JButton("I choose a cat");         catButton.addActionListener(this);         catButton.setBackground(Color.pink);          //Add buttons to panel         panel.add(dogButton);         panel.add(catButton);          //Add panel to container         con.add(panel);           //frame.add(panel);      }      public void actionPerformed(ActionEvent e)      {         if(e.getSource() instanceof JButton)         {             if(e.getSource() == dogButton)             {                 JOptionPane.showMessageDialog(null,"You want to adopt a dog");             }             else if(e.getSource() == catButton)             {                 JOptionPane.showMessageDialog(null, "You want to adopt a cat");             }         }      }  }


I am trying to avoid framed boxes to break when they span on multiple pages (usually 2). Essentially they should get pushed down when the box is too long to fit on the page. This code for example breaks the second box at the end of the page and continues onto the next one, whereas it should be pushed down and start on the second page  \documentclass{article} \usepackage{framed}  \begin{document} \begin{framed} Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text \end{framed} \begin{framed} Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text\\Text \end{framed} \end{document}   Unfortunately I cannot use the \newpage trick as the document is generated automatically from a set of definitions, which keep on changing. Thanks in advance


What about the profiles here, with shadow?

Sometimes I see avatar's users with shadow, and if you hover your mouse on them, they expand with a small bio.  Does that feature have a name? Which are the requirements to get that on your profile?


Show that A*B and B*A have the same order

How can I show that the elements A * B and B * A have the same order?    where A, B belong to a finite group G   How can I prove that 2 elements have the same order? I was thinking of showing that if (A * B)^n=id; and (B * A)^m=id then n=m; Any ideas or tips how I can do that? Thank you!


horizontal alignment of dot over hat over bold greek letter!

For some strange reason, this:   \hat{\dot{\bm{\phi}}}   prints the dot and the hat slightly off the left of the phi letter. Any ideas if this can be fixed? thanks. Using bm package for bold symbols.


I want to clone  without falling prey to the legend rule and without using . Are there any cards that allow you to copy a card's text without copying its name? I was unable to find any but might have failed to search the right wording.


Need hint for $\lim_{x\to 0} \frac{(x+1)^\frac{1}{x}-e}{x}$

Please give me some hints or solution for this limit. I had it on my exam and I'm curious how to solve it. $$ \lim_{x\to 0} \frac{(x+1)^\frac{1}{x}-e}{x} $$


How can I make a complex tartan pattern in Illustrator?

Could anyone tell me how to create the tartan design shown in the attached file? Im using Illustrator CS6


So things are a bit unclear to me. When we are talking about the span of a matrix, are we talking about the span of the columns?   Also, those the number of columns count (the span of the rows I believe)? For example, does a $3 \times 4$ matrix span $\mathbb{R}^3$ or $\mathbb{R}^4$? So, are we just taking the bigger number?


How to see real destination IP using tcpdump?

I'm a newbie with tcpdump. My setup is simple:   1 machine A behind a router B 1 machine C outside, on the Internet   On machine A, I ping machine C, and I want to track what's happening with tcpdump:   tcpdump on machine A shows an ICMP packet from IP (A) to IP (C) Then tcpdump on machine C shows an ICMP packet from IP (B) to IP (C) Then tcpdump on machine C sends an echo reply from IP (C) to IP (B) Then tcpdump on machine A shows an echo reply from IP (C) to IP (A)   So, at some point in router B (I cannot run tcpdump on the router), the IPs are converted from IP (B) and IP (A). I assume that the "real destination IP" = IP (A) should be stored somewhere deep within the ICMP packet, so that the router can redirect it correctly. But I can't find any option of tcpdump to show this "real destination IP" when it's run on machine C? What is this option, or how can I see it?


Consider equation $\exp(-x) = x$.  Solution is so-called $\text{LambertW}(1)$.  It is beautiful special function called .  Now consider $\cos(x) = x$ and $\sin(x) = x$.  What beautiful special functions solve above equations?


Remove downloaded but not installed ios8 ( Settings->General->Usage doesn't work)

The ios8 has automatically downloaded to my iPad Air and I want to remove it. For some reason the solution with Settings->General->Usage doesn't work for me. There is no ios update in the usage list. The current ios version is 7.0.4. Are there any other solutions?


What can I do after getting stocked on hellstone?

I started playing Terraria just a month ago and I'm confused. I have full hellstone armor, all helstone gear, cobalt shield, armored starband, jagged regeneration ring, rocket boots and defense 4 boots (don't know what they're called, they make you run really fast).  I died twice facing the Wall of Flesh. What do I do? I'm stuck. I have a space gun, star fury sword, and deadly musket, flintlock pistol, grappling hook, keen vilethorn and lastly magic mirror.


How likely is it that the mass of all humans was generated by the same supernova?

All humans are brothers.  They came from the same supernova. ─ Allan Sandage (1926 - 2010)  My gut (not a physicist) says not very likely at all. That being said, he was probably referring to the creation of the solar system, Earth, etc.


What are the multidimensional versions of median

What are the multidimensional versions of the median and what are their pros and cons? I confess this doesn't have a single answer, but I think it is a useful question to ask and will be a benefit to others as well.  How stable it is (i.e. how many samples one needs to get a reasonable estimate of it) is one potential, but not necessary, pro and con issue, i.e. if you know that the number of samples necessary grows exponentially with each increase in dimension making it useful in 10 dimensions but effectively useless in 200 dimensions, that would be useful to know. (I would kind of expect all of them have that, really, because there is so much "freedom" in 200 dimensions it just takes a bazillion points to nail the basic middle of a distribution down along that many directions).  Note: I found  after accepting an answer for this. I hadn't seen it before because I didn't realize there was both a multivariate-analysis and a multivariable tag. I am not sure why geometric median was an unpopular answer there (1 vote and near the bottom) but a popular answer here.


Solving trigonometric equations without a calculator or tables

To give some background to the question, I am preparing for an admissions test for a physics course at university (the ), and for this test we are not allowed to use calculators or tables in any form.  In the maths section of the test, there are often trigonmetric equations such as the one below which we have to solve for $x$ within a certain range (usually $[0,\pi]$):     Solve $\sin{3x}=\sqrt{3}\cos{3x}$, for $x$ in the range $0\leq x \leq \pi$.   This problem is easy to reduce:  $$\tan{3x}=\sqrt{3}\implies3x=\tan^{-1}{\sqrt{3}}\implies x=\frac{\tan^{-1}{\sqrt{3}}}{3}$$  However, I am unsure how I can evaluate expressions such as $\tan^{-1}{\sqrt{3}}$ without a calculator, is there any method I can use for expressions like these, or am I required to simply learn various common values of $\tan$ (i.e. $\tan{\pi}$, $\tan{\frac{\pi}{4}}$, $\tan{0}$, etc.)?  Thanks in advance!


Why do we have two of some organs, but not all?

We have two eyes, but we don't have two hearts. Why do humans have two of some organs, but not all?


What is a boot loader, and how would I develop one?

I've met many projects in which an AVR microcontroller uses with a bootloader (such as the Arduino), but I don't understand the concept very well.  How can I make a bootloader (for any microcontroller)?  After writing my bootloader, how it is programmed to the microcontroller (like any .hex program burnt on the flash rom of the AVR, or some other method)?


How do I manage periods for abbreviations with parentheses, right before a period?

"In the case of medical diagnostics, there is a cost associated with each medical procedure that provides additional information (blood test, x-ray, etc.)."   Should that end with "etc.).", "etc)." or "etc.)"?


Comment font size is smaller than others

This  font size looks smaller than others:        Tested in Chrome for Android. Possibly an Android issue.


Learning about ReaderWriterLockSlim. Trying to understand why ReaderWriterLockSlim in better than any other lock like for example Monitor?   What is difference between EnterWriteLock() and EnterReadLock(). I suppose that EnterWriteLock() has more chances to get lock than EnterReadLock(). but I suppose I can use EnterReadLock() in places when I need just write - it only will be slower.     class Program     {          static ReaderWriterLockSlim _rw = new ReaderWriterLockSlim();         static List<int> _items = new List<int>();         static Random _random = new Random();          static void Main(string[] args)         {             new Thread(read).Start() ;             new Thread(read).Start();             new Thread(read).Start();              new Thread(()=>write("A")).Start();             new Thread(() => write("B")).Start();           }           public static void read()         {             while (true)             {                 //_rw.EnterReadLock();                 _rw.EnterWriteLock();                 for (int i = 0; i < _items.Count; i++)                 {                     Thread.Sleep(1000);                 }                 //_rw.ExitReadLock();                 _rw.ExitWriteLock();             }         }           public static void write(string value)         {             while (true)             {                 int newNumber = GetRandom(100);                 _rw.EnterWriteLock();                 _items.Add(newNumber);                 _rw.ExitWriteLock();                 Console.WriteLine("ThreadID={0} added={1}",Thread.CurrentThread.ManagedThreadId,newNumber);                 Thread.Sleep(100);             }          }          private static int GetRandom(int v)         {             lock (_random)             {                 return _random.Next(v);             }          }     }


Ubuntu 13, TeXLIve and home made package

I would like to install an homemade package ? With MacTeX, I put my package in texmf-local and then simply use texhash.  Under Ubuntu, I have to use the plain path sudo /usr/local/texlive/2013/bin/x86_64-linux/texhash. This is a little boring.  Have you a way to avoid the use of the long plain path ?


How to get just the date part of getdate()?

I have a SQL table that has a CreationDate field.  I have getdate() in the computed column specification formula.  I would like to know how to get just the date portion, that is, '2012-08-24' instead of '2012-08-24 10:45:17.740'.


I installed Ubuntu on an USB flash drive but it resets after every reboot

I recently installed Ubuntu on an USB flash drive to get some experience with it and also have a portable OS with my personal files. I used  Tutorial but when I reboot the system it resets back to how it was after the fresh installation. Do I need to use a different method to install Ubuntu on the flash drive or did I do something wrong?


commrads! I have a file:  # cat file '\\.\Aktiv Co. Rutoken S 00 00\USER1@R69-20180109' '\\.\Aktiv Co. Rutoken S 00 01\USER2@R69-20180109'   and i need execute line by line:  for LINE in `cat file`  do /opt/cprocsp/bin/amd64/certmgr -inst -cont $LINE done   BUT! The file has special content like: ' \. . and etc.  And when i start my script with "set -x" i see this:  + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont ''\''\\.\Aktiv' Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont Co. Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont Rutoken Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont S Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont 00 Error + for LINE in '`cat /home/user/Aktiv`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont '00\USER1@R69-20180109'\''' + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont ''\''\\.\Aktiv' Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont Co. Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont Rutoken Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont S Error + for LINE in '`cat file`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont 00 Error + for LINE in '`cat /home/user/Aktiv`' + /opt/cprocsp/bin/amd64/certmgr -inst -cont '01\USER2@R69-20180109'\'''   IN THE IDEAL MUST BE:  /opt/cprocsp/bin/amd64/certmgr -inst -cont '\\.\Aktiv Co. Rutoken S 00 00\USER1@R69-20180109' /opt/cprocsp/bin/amd64/certmgr -inst -cont '\\.\Aktiv Co. Rutoken S 00 01\USER2@R69-20180109'   I think it's all from special content (file).  Any ideas?


How to run .lnk files with spaces using command prompt?

I couldn't seem to find the answer. I know that to run .lnk files it would be like: start shortcut.lnk  It works on shortcuts without spaces. But let's say that the shortcut has a space on it, for example, "short cut", I can't seem to run it.  I tried running:  start short cut.lnk   And it will only read "short".  I also tried running:  start "short cut.lnk"   And it will open a new command prompt running as administrator on the same directory.


I am using Emacs+Auctex. I need additional highlighting in math mode. How can I force Emacs to highlight braces and some commands (like \quad) inside math mode with different color?


Why does the Bayesian posterior concentrate around the minimiser of KL divergence?

Consider the Bayesian posterior $\theta\mid X$. Asymptotically, its maximum occurs at the MLE estimate $\hat \theta$, which just maximizes the likelihood $\operatorname{argmin}_\theta\, f_\theta(X)$.  All these concepts—Bayesian priors, maximizing the likelihood—sound super principled and not at all arbitrary. There’s not a log in sight.  Yet MLE minimizes the KL divergence between the real distribution $\tilde f$ and $f_\theta(x)$, i.e., it minimizes  $$ KL(\tilde f \parallel f_\theta)  = \int_{-\infty}^{+\infty} \tilde f(x) \left[ \log \tilde f(x) - \log f_\theta(x) \right] \, dx $$  Woah—where did these logs come from? Why KL divergence in particular?  Why, for example, does minimizing a different divergence not correspond to the super principled and motivated concepts of Bayesian posteriors and maximizing likelihood above?  There seems to be something special about KL divergence and/or logs in this context. Of course, we can throw our hands in the air and say that’s just how the math is. But I suspect there might be some deeper intuition or connections to uncover.


Program for immediate smaller element in Python

arr = [] try:     test_cases = int(input())     print("testcase: ",test_cases)     for i in range(0, test_cases):         arr_len = int(input())         print("Array Length:", arr_len)         for j in range(0, arr_len):              val = input()              arr.append(val)              print("Array:", arr)              while j < (len(arr)+1):                  if arr[j]<arr[j+1]: print("-1")                  else: print(arr[j]) except EOFError: print("Exception Handled\n")   This is the error I am getting:  2 testcase:  2 5 Array Length: 5 4 1 1 5 3  Traceback (most recent call last):   File "C:/Users/Rupali Singh/PycharmProjects/Geeks_for_geeks/immediate_smaller_element.py", line 15, in <module>     if arr[j]<arr[j+1]: print("-1") Array: ['4 1 1 5 3 '] IndexError: list index out of range 1   Why is it saying that the length of array is 1? please help me with code. Is my logic wrong?


How to customize with the titlesec package?

How to implement with the package titlesec in the preamble to maintain the same vertical alignment and numbering?


Shell string escape for command arguments

I'm trying to create "/tmp/pwet/foo bar" with this:  DIR="/tmp/pwet/foo bar" ARGS="-p ${DIR}" mkdir $ARGS   For integration reasons, I have to keep the ARGS building in 2 steps: ARG = some_options + $DIR This code create 2 dirs: /tmp/pwet/foo and ./bar. this is not what I want.  I've tried a lot of escaping things, without results. I run the script with bash. What's the good solution?


Finding the minimal polynomial, the eigenvalues, and the characteristic polynomial of $T(A)=A+A^t$

Let $M_n$ denote the vector space of all $n\times n$ real valued matrices and for any matrix $A\in M_n$ let $A^t$ denote its transpose. Define the linear map $T:M_n\rightarrow M_n$ as $$T(A)=A+A^t.$$ What is the minimal polynomial of $T$? What are the eigenvalues and the corresponding eigenspaces of $T$? What is the characteristic polynomial of $T$?  I learned about minimal polynomials of operators from $\textit{Linear Algebra Done Right}$ by Axler. In his description he explains how in order to find the minimal polynomial you must find the smallest positive integer $m$ such that $T^m$ is a linear combination of $I, T, T^2, \ldots, T^{m-1}$. That is, the smallest integer $m$ such that $$T^m = a_0I+a_1T+a_2T^2+ \cdots +a_{m-1}T^{m-1}.$$  As for the eigenvalues...since we are working with real-valued matrices, then $A$ and $A^t$ have the same eigenvalues, so if $\lambda \in \mathbb{R}$ is an eigenvalue of $A$ (and hence of $A^t$) wouldn't $2\lambda$ be an eigenvalue of $A+A^t$? I apologize if I am saying utter nonsense...


How to randomly select from existing points within each polygon?

I have a polygon layer (where each feature has a class attribute), and a point layer, and there are at least 10 points within each feature of the polygon. Is there a way to randomly select only "k" points of these 10 points for each feature (class) in QGIS?  Thanks!


One word for someone who doesn't care about anything

A pessimist is someone who always considers negative outcomes of a situation, whereas an optimist always considers the positive outcomes. Is there a word for someone who, in any given situation, doesn't care about the outcome at all?


I have a question about the structure of the QED lagrangian, in particular the free photon lagrangian which is contained in it. My premise is: I only know how to exploit canonical quantization in order to quantize a theory; I don't know how to use the path integral formulation.  The QED lagrangian is: $$ \mathcal{L}=-\frac{1}{4}F^{\mu \nu}F_{\mu \nu}+\bar{\psi}(i\gamma^{\mu}D_{\mu}-m)\psi, $$ so I assume that the free photon theory exploited here is  $$ \mathcal{L_{free}}=-\frac{1}{4}F^{\mu \nu}F_{\mu \nu}. $$ However, I also learnt that $\mathcal{L_{free}}$ jointed with Lorenz's gauge cannot give us a covariant quantization for the electromagnetic field (by means of the canonical quantization, at least). In fact, we introduce the following lagrangian: $$ \mathcal{L_{feyn}}=-\frac{1}{4}F^{\mu \nu}F_{\mu \nu}-\frac{1}{2 \xi}(\partial_{\mu}A^{\mu})^2 $$ with Feynman gauge choice $\xi=1$. This, jointed with Gupta-Bleuer constraint, gives us the physical states of the electromagnetism.  So: why do we adopt $\mathcal{L_{free}}$ instead of $\mathcal{L_{feyn}}$? I know that the latter is not gauge-invariant, but the covariant quantization of the theory is achieved through that, so this point is not clear to me.


Basis for set of nxn matrices with trace = 0

I am trying to find a basis for the set of all $n \times n$ matrices with trace $0$.  I know that part of that basis will be matrices with $1$ in only one entry and $0$ for all others for entries outside the diagonal, as they are not relevant.  I don't understand though how to generalize for the entries on the diagonal.  Maybe just one matrix with $1$ in the $(1, 1)$ position and a $-1$ in all other $n - 1$ positions?


How many dots are needed, when the last word of the sentence is a.m.?

Let's say you have a sentence like this:     The new date of the staff meeting is March 16th, at 10 a.m..   Please make sure that you enter all of the topics into into the   agenda that you want to discuss before the meeting   Do I have to put two dots after a.m., after the sentence is finished or is one enoguh. Like this:     ... at 10 a.m. Please make sure...


Cannot Specify Id in an insert call error

I have been trying to do a bulk load of accounts in salesforce and it keeps triggering the following error     UpdateCSMTeam:execution of AfterInsertcaused by: System.DmlException:   Insert failed. First exception on row 0 with id00rJ000003iFSruIAG;   first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an   insert call: [Id]Class.UpdateCSM.updateTeam Mem   Below I'm including the class and the trigger referenced.  APEX CLASS (Update CSM)  public class UpdateCSM {            public static void updateTeamMember(List<Account> accounts) {                 SObject[] sobs = new SObject[] {};                 for (Account a : accounts) {                       if (a.Customer_Success_Manager__c != null) {                             sobs.add(new AccountShare(                                     AccountId = a.Id,                                    OpportunityAccessLevel = 'Edit',                                     CaseAccessLevel = 'Edit',                                     AccountAccessLevel = 'Edit',                                     UserOrGroupId = a.Customer_Success_Manager__c));                      }                    for (Account acc : accounts) {                              if (acc.Customer_Success_Manager__c != null) {                                     sobs.add(new AccountTeamMember(                                             AccountId = acc.id,                                             UserId = acc.Customer_Success_Manager__c,                                             TeamMemberRole = 'Customer Success Manager'));                            }                                      }                                   insert sobs;                                                                                }                  } }   APEX TRIGGER (UpdateCSMTeam)  trigger UpdateCSMTeam on Account (After update, After insert){     UpdateCSM.updateTeamMember(trigger.new);}


var ext = new List<string> { ".jpg", ".gif", ".png" }; var myFiles = Directory.GetFiles(directory, "*.*", SearchOption.AllDirectories)      .Where(s => ext.Any(e => s.EndsWith(e))); CopyFilesToClipBoard()   And the method CopyFilesToClipBoard()  public static string[] CopyFilesToClipBoard(List<string> file_list) {     foreach (string file_name in Directory.GetFiles(Application.StartupPath))         file_list.Add(file_name);     Clipboard.Clear();     Clipboard.SetData(DataFormats.FileDrop, file_list.ToArray());     string[] file_names = (string[])     Clipboard.GetData(DataFormats.FileDrop);     return file_names; }   The problem is that CopyFilesToClipBoard should get List but var myFiles is IEnumerable


Are two halves of PBKDF output "related"

In other words, in the context of authenticated encryption using Encrypt-Then-MAC, is this stupid?:  derived_key = PBKDF(key, salt, dkLen=32) hmac_key, enc_key = derived_key[:16], derived_key[16:]   It is advised that separate keys be used for MAC and encryption. Is this sufficient? If not, how dangerous is it?


I want to calculate a string in C# using either NCalc or DynamicExpresso library, the problem is, when the calculation gets complex and the numbers are big, it returns the wrong result. For example the code below returns -808182895 when it should return 3486784401  string value = "387420489*9"; value = new Interpreter().Eval(value).ToString();   Am i doing anything wrong? Thanks for the help.


How did this site come to serve more than one purpose?

On one hand, this site is the meta site for "stack overflow."  On the other hand, this site seems to be the meta site for the rest of SE, or at least the other SE meta sites. I joined this site in the latter capacity when one of my questions on another meta site was redirected here.  At the very least, this site seems to be a meta site for other things than "stack overflow."  Is my observation correct, and if so, how and why did this come about.


How to tell if my mean values are not significantly different?

I am looking to test if two mean and standard deviation values I obtain are not significantly different (comparing a sensor method to the gold standard).  I am planning on using a two-tailed t-test in python, but I am getting confused when interpreting the results.  Does a high p-value mean that there is no significant difference and the two methods are similar?  I know this is an incredibly basic question but I don't really know statistics.  I plan on using scipy's ttest_ind and here is a box plot of my data where I am comparing each blue and orange box:


Mavericks input source is set to US keyboard in login screen

I'm from Belgium, and on my own user account, the input source is set to a Belgian (actually French) keyboard. The input sources menu is enabled in the menu bar, so I can switch it to the Belgian keyboard before entering my password, but how can I permanently change the input source used for login? I'm the system admin, and I know how to get root access if necessary.  It worked perfectly in Mountain Lion.


I killed Flowey and reloaded my save file, but he's still not there!

I killed Flowey after a pacifist run and then, realizing that I now could not get true pacifist, I reloaded my save file. But Flowey wasn't there. I did this a few more times, and eventually I just reset, but Flowey still wasn't there. Help?


Cannot boot because: Kernel panic - not syncing: Attempted to kill init!

This is what I've got. I cannot boot and I see the two of three little lights on the keyboard blinking all the time and the cooling is working on full power, almost.  I saw in other askubuntu topic suggestion for memory test. I did it. I didn't have any errors.  I am 99,9% sure it is not a hardware problem, because I have Windows 7 and I can boot it and it works just fine.  This problem came without any warning or something. I just turned off the laptop one day and at the other day I couldn't boot.   From recovery mode I get this:


How to have variable value as an array within an array without it being a pointer? (Python)

I have an array within an array, and I can call its values just fine. However, whenever I try to change the value of something in the second array it changes it for all of the arrays in the first array.  for yAxis in range(len(g.WORLD)):     if yAxis == yPos:         yRay = g.WORLD[yAxis]         print("=====")         print(yAxis)         print(yPos)         print("====")         for xAxis in range(len(yRay)):             if xAxis == xPos:                 print("-------")                 print(xAxis)                 print(xPos)                 print(yRay)                 print("-------")                 yRay[xPos] = 1    This does the same thing    g.WORLD[yAxis][xAxis] = 1


Exporting map as tif in CMYK colour space

I am getting my maps from QGIS ready for publication in a journal. The journal requires colour images to be tif format in the CMYK colour space. I understand how to save images as tif, but I cannot see a way to see whether I am saving them in the right colour space. Can anyone help me??


I have a logging in problem in League of Legends

There was an error logging into the game. Please try again. If the issue persists, please visit the League of Legends website for updates   what should I do now?


When is a programmable logical controller the best choice?

I am studying  as a part of my Elements of Industrial Automation class. Trouble is, I can't imagine why would anyone use such a thing.  For complex tasks, microcontrollers are available. The vast majority of practicing programmers are well-versed in C, so creating a system with an ARM core (for example) is relative cheep. Furthermore, there are numerous free and tested RTOS for hard-realtime design to rest upon.  For massively parallelizable, hard realtime, low-latency tasks, there are FPGA-s. Those are a little harder to program. Yet there are many VHDL/Verilog guys out there in the job market.  Now to address the reliability of PLCs:         the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact   The same can IMHO be acheaved (and far surpassed) by extensive redundancy e.g. 3 identical systems operating simultaniously, upon detection of a problem in the primary system, another one, located at a different place, and programmed in a different way, kick in.  Where are PLCs used in modern industry? Why are they the best solution in those situations, instead of one of the solutions above?


Change pixel size of 30m for 23.5m in QGIS

I need to change pixel size in raster file file with Pixel Size = (28.086057277202915,-28.086057277202915) using Qgis for Pixel Size = (23.951601289061028,-23.952379920305706) what kind of function I can use?


I have some insurance files that I need to be able to view, but they are in the MDI format I can't get them to work at all in Ubuntu.  I've searched the entire forum and I've even installed Microsoft office 2003 & 2007 through Wine, but it still doesn't work correctly.   The only solutions posted in the forum have suggested getting an MDI to pdf converter or installing MS office.  I haven't gotten any of this to work.  How can I view or convert MDI files?


I've a bootable USB with Debian. Normally I clone the disk with dd, write the image on a new USB disk, mount this disk on my filesystem and edit some files. Is it possible to edit files on the image without writing the image to USB and mount the USB? I've tried ISO Master, but that raises an error: Failed to read volume info: 'Failed to read expected number of bytes'.


When I try to start Steam nothing happens. Reinstall doesn't help.  $ steam Running Steam on ubuntu 13.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(1378500910_client) Installing breakpad exception handler for appid(steam)/version(1378500910_client) Installing breakpad exception handler for appid(steam)/version(1378500910_client) unlinked 0 orphaned pipes removing stale semaphore last operated on by process 7278 with name 0eBlobRegistryMutex_DC7EBB4AEA41D3C6C74E5EFFD6757CEC removing stale semaphore last operated on by process 7278 with name 0eBlobRegistrySignal_DC7EBB4AEA41D3C6C74E5EFFD6757CEC removing stale semaphore last operated on by process 7278 with name 0emSteamEngineInstance removing stale semaphore last operated on by process 7278 with name 0eSteamEngineLock Gtk-Message: Failed to load module "overlay-scrollbar" Installing breakpad exception handler for appid(steam)/version(1378500910_client) [0913/182910:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation   How to fix it?


Can I do a negated wildcard on the command-line?

On the command-line *tmp* will match all files with names containing "tmp". Is there a quick way to do the reverse, i.e. match all files with names that don't contain "tmp"? I figured out how to get ls to do it (ls -I "*tmp*"), but that doesn't help if I want to use some other command rather than ls. Is there a general method? I forgot to note: I'm using zsh.


Why is $(n+1)(n+2)\cdots(n+s)$ divisible by $s!$?

Why is  $$(n+1)(n+2) \cdots (n+s), \text{ with } n,s \in ℕ$$  divisible by $s!$ ?  I derived this from the formula that gives the number of combinations of class $k$ with $n$ elements:  $$\frac{n!}{k!(n-k)!}$$


How to set a specific edge length numerically?

I've got this question from one of my best students. The question is the following:  Suppose, that we have Edit mode with some edges, vertices, etc. How to set a selected edge to have a specific length? Numerically?  We already know, that scaling with enabled 'Show edge length' is helpful, but in general, it seems to be easier to just select an edge, and to set its length. This is extremely useful for architecture modeling.


Why should I not use md5() for passwords?

I want to make a  website with a login system.  Which hashing method should I use?  I used to hash my website's passwords with  but everyone said I should not use it.  Why not?  How can md5 get cracked?


Suppose you have two cards: one is painted yellow on both sides and the other is painted yellow on one side and red on the other You select a card at random and view one side.  You notice it is yellow. What is the probability the other side is yellow?


Random question about magnetic fields and relative movement

I'm an undergraduate physics student and we're learning about electrodynamics. While studying, a question popped in my head: We know that magnetic fields are generated from moving electric charges, or currents, but isn't this a matter of relativistic movement? So if I would move along the charges at the same speed, would I feel any type of magnetic field? And how does special relativity fit into this?


Understanding PDO prepared statements to insert data in a database

I'm trying to understand PDO prepared statements. Did I implement them correctly in the code below? $guestFirstName = $_POST['guestFirstName']; $guestLastName = $_POST['guestLastName']; $guestMessage = $_POST['guestMessage'];  //remove whitespace from beginning and end $guestName = trim($guestName); $guestMessage = trim($guestMessage);  $errors = validate_inputs($guestFirstName, $guestLastName, $guestMessage); //if there are no errors received.     if (empty($errors)) {       try {         //open the database         $db = new PDO(DB_PATH, DB_LOGIN, DB_PW);         $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);          //insert the first name, last name, and message into the database         $stmt = $db->prepare("INSERT INTO guest_users(first, last) VALUES(:f,:l);");         $stmt->bindParam('f', $guestFirstName);         $stmt->bindParam('l', $guestLastName);         $stmt->execute();          $insertID = $db->lastInsertId();               $stmt2 = $db->prepare("INSERT INTO guest_message (comment, user_id, date_sent) VALUES (:m,:i, now());");        $stmt2->bindParam('m', $guestMessage);        $stmt2->bindParam('i', $insertID);        $stmt2->execute();          $displayName = $db->query("SELECT * FROM guest_users where id = '$insertID'")->fetch(PDO::FETCH_ASSOC);         $displayMessage = $db->query("SELECT * FROM guest_message where id = '$insertID'")->fetch(PDO::FETCH_ASSOC);   Below this is just HTML code where I'm inserting variables like $displayName['first'], $displayMessage['message'], etc. To display information from the database.


How to construct a Möbius loop using bezier curves

I am a beginner and I am trying to construct a Möbius loop by using a bezier curve and then extruding, or whatever, with a circle. Can someone help me to achieve this in a step-by-step manner?    I know there are many ways to approach this and I wish to know as many of them as possible. I almost achieved it with the screw modifier but the two halves didn't fit together perfectly.


Programming environment: Outside scope of Stack Overflow?

Today I asked a question about which  install package was best for an -based PHP web-development environment. This seems straight-forward enough, and I believed it to be well within the defined scope of Stack Overflow from the FAQ:     "If your question (generally) covers   software tools commonly used by   programmers then you’re in the right   place to ask your question!"   Although the question got four upvotes in five minutes, it also collected one close vote. When I asked why, a user commented that, "by using the verb install multiple times you have disqualified the question for being about the programming tool itself".  This baffled me considering the number of accepted questions on Stack Overflow about installing programming related tools:         Immediately after that user's comment, however, the question was then (unhelpfully) migrated to Super User, a place totally unsuited to questions about preferable programming environments. It lasted a few minutes there before Super User moderators saw it was out of place on and moved it to Server Fault.  A place specifically for server administration.  And there it sits:   Is it really outside of Stack Overflow's scope to ask a question about which version of a programming language is best suited for using in a development environment? I'm not setting up or administering a web server as professional system administrator, just as a programmer.


Inspired by a , here's a list of the 'etymology' for the  hats. For pictures and a list of criteria, see  instead.  The list is a community wiki; feel free to edit it if you have more information about a hat. If you like to do some research, most hats have been featured in earlier editions, so you might be able to find more information in old Meta Stack Exchange questions.


Getting nosuchElement Exception for a web element even though I tried all possible solutions

I am using Selenium with Cucumber to automate one web application, But I am stuck at one element which is not working out with the XPaths and link text   I also applied the implicit and Explicit wait,  hover mouse functionality using actions driver also  there are no iframes involved either  But nothing seems to work out. Can someone help me with this??  This is the web element I need to click and the HTML  I tried following XPaths: Upon validating on console them point to the web element but on when I using it in the script it throws the exception.   //a[contains(text(),'Logout')  //div[@class='pull-right']/a  //*[@class='logout_class curPnt']   Also attaching my code snippet


Hide window indicator from the top bar on Ubuntu 20.04

I am using Ubuntu 20.04. I have hidden the "Activities" button on the left side of top bar. Is there a way to hide where it shows what window is open, next to where "Activities" was?   For example, I want to hide "Google Chrome" from the upper left:   The GNOME extension TaskBar 2020 does not provide this function. I want to keep the top bar, just without showing what window is active.


How to call up high priority responsive terminal window, even if Xubuntu is hopelessly frozen

I've been testing various systems on my pc, and from time to time, my Linux laptop freezes.  On Windows, when this happens, you can press Ctrl+Alt+Del to bring up Task Manager and kill the process slowing the system down, no matter how badly locked up everything else was. I don't know how this was implemented; I guess it's like an emergency command, that forcibly reserves or steals some RAM from other processes.  Some of the questions asked here have similar solutions to that, like cold rebooting, restarting only the GUI or "kill mouse" that kills anything you click on, but I don't like 'em.   I want to make Ctrl+Alt+Del or any other hotkey, no matter what, bring up a "working" terminal with root privileges in seconds, so I have full control over my PC, no matter what programs are running or how much RAM is being used. It should be an emergency app that can be used any time with guarantee it will work. Is this even possible, and how should I do it?


The Partition table format in use on your disks normally requires you to create a separate partition for boot loader code- How to fix?

I am installing Ubuntu alongside Windows 10. I chose the Something else option and manually specified the root, swap and home partitions. Finally, when I click on Install now, I am getting the above-mentioned error(Requires Separate Boot Loader Code). How to Fix it? I am stuck here.


LinkedList (custom) add() return NullPointerException

I am trying to implement data structure Linked List (Singly) however by adding elements returns NULLPOINTEREXCEPTION.  import java.util.NoSuchElementException;  public class Linkedlist<ANYTYPE>{  private Node head;  Linkedlist(){     head = null; }  public void add(ANYTYPE data){     head.next = new Node<>(data, head); }  public void traverse(){     if(head == null) throw new NoSuchElementException("List may be empty");      Node temp = head;      while(temp != null){         System.out.println(temp.data+" ");         temp = temp.next;     } }  public static void main(String[] args) {      Linkedlist<String> l=new Linkedlist<String>();     l.add("one");     l.add("two");     l.traverse(); }   private class Node<ANYTYPE>{      private ANYTYPE data;     private Node next;      Node(ANYTYPE data, Node next){         this.data = data;         this.next = next;     } }  }


I want to remove two bits.  Example:  1 0101000 0 0010001  Result: 0101000 0010001  How can I do this in C++ ;O?


I had Atom Editor in my machine and was using it using the atom command. But yesterday I installed Learn IDE which is a fork of atom with many changes and now whenever I use atom command it opens Learn IDE not the Atom Editor. I uninstalled Learn IDE using       sudo apt-get --purge remove atom       and found it is now removed from my system but using the atom command does nothing it says      bash: /usr/bin/atom: No such file or directory     Atom is still there on my system but I can't use the command atom. Please Help.


Concatenate all the values present in a particular column of a table to a single value

I have a table with three columns.  I want to write a query which joing all the values present in the 3rd row and merge it in a single value seperated by commas.  ex -   Table A   +------+------+------+ | Col1 | Col2 | Col3 | +------+------+------+ |    1 | A    | AB   | |    2 | B    | BC   | |    3 | C    | CD   | |    4 | D    | DE   | |    5 | E    | EF   | |    6 | F    | FG   | +------+------+------+  Result I want :   AB,BC,CD,DE,EF,FG   PS: I am using MS SQL server 2008


Expression-bodied properties vs. {get; set;}

When I have Visual Studio 2017 generate properties for me, it will always use the new expression-bodied properties, for example:  private static string username; internal static string Username { get => username; set => username = value; }   Is there any advantage of using this style over the following or is it just a matter of preference and readability?  internal static string Username { get; set; }


Usage of Some: Does "some" require a plural or singular verb?


I'm unable to see a deleted post. How can I see and undelete it?

I deleted a post today on Hinduism SE and am not able to see the deleted post for undeleting or editing it. Reputation is not yet adequate.


I would like to place some (PHP)functions in a helper files, which requires across modules and themes.  Do I have to create a new module or I can place a simple helper file with list of common functions, what is the best practice for these kind of functions in drupal 8 ?


When Multi-classing Paladin with Sorcerer, could I Prepare Paladin Spells at my Sorcerer Spell Level (5th level spells max)?

I've been playing a level 9 Stone Sorcerer, and I was about to multiclass 2 levels into paladin when I saw that when you prepare your paladin spells, you prepare spells that fit with the level of spell slot you have. Because multi-classing essentially blends your spell types together into a tasty smoothie (for example I already know I could use a 4th level sorcerer spell slot for divine smite if I so pleased), does this mean I could choose Paladin spells like Geas and Destructive Wave to be prepped? Or am I still locked as to what I can prepare with my paladin spells?  Thanks for the help in advance.


Moving footnote text within source without moving labels

I often write documents with fairly lengthy discursive footnotes to discuss tangents or secondary issues without interrupting the flow of the main text. However, this can make it difficult to edit, since the body of the text is broken by sometimes-quite-long notes. What I would like is a way to move the text of the footnote (while still keeping it within the same file) away from the footnote mark without breaking the default placement rules for footnotes.  I have tried using \footnotemark and \footnotetext, like so:  Paragraph containing a footnote\footnotemark and some more text afterward.    \footnotetext{A very long footnote that now doesn't have to appear in the middle of a  sentence in my source file.}   However, this causes my footnote text to sometimes appear on a page following the footnote mark rather than always appearing on the same page as the mark. (Also it gets a bit messy when I have multiple notes in a paragraph.)  Is there a way to separate the footnote text from the location of the footnote mark within the source code while having the output come out as though the \footnote{was in the middle of the text}? (And preferably allowing for multiple footnotes per paragraph?) Apologies if there is an obvious answer; I've been searching around for a while now I and haven't found anything.  MWE (edited to wrap lines):  \documentclass{article} \begin{document}  A paragraph that has a footnote\footnote{Like this one here but even longer and more  intrusive so that it makes reading and editing the text very difficult. It probably goes  on and on and might even have \\ multiple \\ long \\ paragraphs inside of it.} in the  middle of it. The footnote is placed correctly, but the source is difficult to read and  edit.  A paragraph with a footnote in the middle of it\footnotemark{} that then continues onto a  new page. The source is easy to read and edit, but the footnote lands in the wrong place. \newpage    \footnotetext{A footnote that I would like to have appear on the same page as the  footnote mark, but without having the footnote text in the middle of my paragraph in the  source.}  \end{document}


Schengen visa category required for job interview

I am travelling to Austria for a job interview (for 2 days). Which type of visa should I apply for?  My home country is India and the visit to Austria will be be sponsored by the inviting company. The company will also provide me with an invitation letter.


Suggestion: Down vote if you have already answer or made comment in a question

I would like to suggest stackoverflow to fix the down vote system.  Currently, someone can be down voted so so so easily by users that they don't know the problem and or the don't answer questions etc.  Let me give you an example,  The problem:  Example 1:  If user1 asks a question and user2 answers that question, user3 can down vote user2's answer because he/she doesn't get it. Also, user3 will not even make an answer in this question.  The result is that MAYBE users2's answer is correct, and user3 who is a simple reader of the question with or without knowledge down vote user2 on purpose. What a fair voting system....  Example 2:  User 1 makes a question and user2 just down vote it without suggest with a comment for a fixing. Result: User1 down voted without even know the reason and he can not what to fix in his question. Again, what a fair voting system....  This is totally unfair.    Why is this unfair?  If someone wants to down vote he must answer or make a comment somewhere in  the question/answer. If he didn't, he has not any intention to help or he has not the proper skills and knowledge to answer the question.  In this case:   First of all, why stackoverflow allows him to down vote ? and secondly, why is he the correct judge to down vote someone's intention for helping?   Does it look fair for you?   The Solution:  Example 3:  User1 makes a question, and the question is not so good. Nobody can down vote it except if they make a comment or answer. In this case, user2 is FORCED to comment it and after to down vote it.   Fair voting system!  Example 4:  User1 makes a question and user2 answers it. User3 which think that this answer is not good wants to down vote it. But he can not because he didn't answer or made a comment. So, user3 make a comment in user2's answer that "it is poor and it lacks of research" and after user3 down vote it. Now, user2 can understand his mistake and he can FIX his answer with more research, etc.  Fair voting system!  I found that someone has already point that issue 6 years ago:  However, you can not just "suggest" to someone under an amount of reputation to add a comment to explain why he down-vote.   First of all, everyone must explain why he/she down-vote. This is what someone can call fair community.  Also, the problem is not on if you encourage someone to explain his/her down-vote, but to force him to explain the reason that he/she down-vote it.


Careers should be smarter about using location

Within the iOS App, the posts from careers clearly are using some sort of IP database to pick which posts to show in the feed (since sometimes they localize well, others not so much).  It would be far more effective to let people choose to share location information or key those posts off of tags or some other signal and fall back to the algorithm you have at present.  I could easily see this not being a 1.0 feature, but if you are going to post ads why not make use of the platform's capabilities to deliver better results for people that choose to opt in?


I create a file named "--address=16.187.249.27" by accident, and try following methods to delete it, but no success:    $ rm "--address=16.187.249.27" rm: unrecognized option '--address=16.187.249.27' Try 'rm ./'--address=16.187.249.27'' to remove the file ‘--address=16.187.249.27’. Try 'rm --help' for more information.  $ rm "\--address=16.187.249.27" rm: cannot remove ‘\\--address=16.187.249.27’: No such file or directory   How to delete file whose name begins with "--"?


Prove that every edge-coloring of $K_{17}$ with $3$ colors contains a monochromatic $K_3$.

Also, Prove that every edge-coloring of $K_6$ with $2$ colors contains at least two monochromatic copies of $K_3.$ I have no idea how to start these problems. What should I do?


Bibliography contents (Journal names) not abbreviated even with IEEEabrv

I am using the following syntax, with no errors or warnings. However, the journal names are still not abbreviated. I compiled the file numerous times, as well as the bibliography. Everything compiles with no errors.  The syntax:   \bibliographystyle{IEEEtran} \bibliography{IEEEabrv,references}   Additional info: I am using BibDesk and TeXStudio on a macbook.  Do you have any idea what might be the issue? and how to solve it? Thank you.  Edit:  Example entry from the IEEEabrv file:  @STRING{IEEE\_M\_COM        = "{IEEE} Commun. Mag."}   Example entry from my references file:  @article{dai:2015,     Author = {Test, T.},     Journal = {IEEE\_M\_COM },     Month = {September}     }


Is there a content search program/port (*not* index based) that's efficient for files needing text extraction filters

If using FreeBSD as a file server for windows clients, it's useful to be able to run file searches server-side rather than client-side.  A typical example might be: find all files meeting some metadata criteria (name, path, size, date etc) with some literal or regex in their text-extracted content. The search is across a large recursive directory that contains mixed files, and content hits could be in any (or multiple) of: .txt notes, .docx/.xlsx documents, .pdf, .zip/.rar/.tgz/.iso compressed archives, or failing which maybe even strings in a binary file.  The first part is easy, just use find. Searching in one type of file isn't hard either. But FreeBSD doesn't have a notion of "well known" file filters or a specific single API for parsing file data to text that uses pluggable filters to a common format (although there are well-known text extraction filters for many individual filetypes such as pdf, doc/docx, xls/xlsx, archive formats, sqlite databases, binary files containing strings, etc) so you can't just throw grep, find -exec, pdftotext, or unzip | sed using Microsoft XML extraction code universally at the results. I guess you would have to generate a list or stream of filenames with find, then pass each through its appropriate filter based on extension or file, and gather up whatever passes through, as the output.  If I need to do this kind of content search quite often in a large file store, is there a specific tool that's designed and more efficient for it, or what's the most efficient approach out there?   Update - I'm only interested in direct file-by-file CLI search. I'm not interested even slightly, in indexing content and later searching an index. This question relates to file-by-file on-the-spot literal/regex search, as with find, but when the content is also searched and isn't plain text but is multiple file types with varied text-extract filters. So it's not a dup of the existing questions about indexed content searching. Sorry this wasn't clear before, I hadn't realised the ambiguity.


Topology of two letters: showing that two letters are homeomorphic (or not)

Hoe can i check if the letters T, K homemorphic or not? Same about the letters E, W? I guess that it can be shown by using connectedness and connected components but I have no idea how it can be applied. Can you help me in that?


Finding the number of zeros in the right half plane of $\mathbb{C}$.

I am attempting to learn an exercise in the chapter on Rouche's Theorem in Ahlfors Complex Analysis. It comes from page 154, number 3:   Find the number of zeros of  $$f(z) = z^4 + 8z^3 + 3z^2 + 8z + 3 = 0$$ in the right half plane.   My first thought was to try to use Rouche's Theorem, but this has been to no avail.  Does anyone have any thoughts as to how to approach this problem. I am almost sure that I am going to need to use a semi circle (in the right half plane) centered at zero. The question is how.


number of surjective functions from X to Y where card(Y)=k < n =card(X)

Let $X=\{1,...,n\}$ and $Y=\{1,...,k\}$. If $n\gt\ k$ then the number of surjective functions $f:X\to Y$ $\;\;$is  $\;\sum_{j=0}^{k-1}  (-1)^j\binom{k}{j}(k-j)^n$  Here I show what I have done. I can't find my mistake:  Let $A=\{f:X\to Y\}$, $B=\{f:X\to Y:f\text{ surjective}\}$, $C=\{f:X\to Y:f\text{ not surjective}\}$. $\;$ We have that $\;$  $|A|=k^n$ $\;$ so $\;$ $|B|= k^n-|C|$   My strategy to calculate $|C|$ is to differentiate between different cases and I have considered that  \begin{align} |C|&=|\{f:X\to Y:|\operatorname{Im}(f)|=k-1\}|+|\{f:X\to Y:|\operatorname{Im}(f)|=k-2\}|+{}\\ &\qquad+\dots+|\{f:X\to Y:|\operatorname{Im}(f)|=2\}|+|\{f:X\to Y:|\operatorname{Im}(f)|=1\}|\\[1ex] &= k(k-1)^n+\frac{k(k-1)(k-2)^n}{2!}+\dots+\frac{k(k-1)(k-2)\dots(k-(k-1))^n}{(k-1)!}\\&=\sum_{j=1}^{k-1}  \binom{k}{j}(k-j)^n \end{align}  For instance, to calculate $|\{f:X\to Y:|\operatorname{Im}(f)|=k-2\}|=\frac{k(k-1)(k-2)^n}{2!}$   I take out the first element of Y where I have k possibilities. Then I take out the second element of Y and I have k-1 possibilities. As the order doesn't matter I divide by $2!$ . Now I can make $(k-2)^n$ functions with the rest of elements. (excuse my english)  And then $|B|=k^n-|C|=k^n-\sum_{j=1}^{k-1}  \binom{k}{j}(k-j)^n$


I stumbled upon an example, which needed to be compiled with the additional option --shell-escape. Using this option it worked just fine, but I'm curious:     Why or when is this option needed and what does it actually do?


How can I validate a phone number using a regular expression?

In my exercise I'm supposed to validate phone numbers, which of the correct are :  1234567890 123-456-7890 123.456.7890 (123)456-7890 (123) 456-7890 456-7890   I've tried [(]?[0-9][0-9][0-9][).-]? ?[0-9][0-9][0-9][.-]?[0-9][0-9][0-9][0-9], but it seems  it also accepts something like (123.456-7890. How I can handle this? Or I should take completely different way ?  Here are some invalid phone numbers:  123-45-6789 123:4567890 123/456-7890


Webservice call out - Uncommitted work pending

I have batchable class that makes the web-service(REST API) callout to remote service.  In developer sandbox, it is working.  In fullcopy sandbox, it is NOT working and giving following error during webcallout:     System.CalloutException: You have uncommitted work pending. Please   commit or rollback before calling out   Not sure what is going on.  Looks like I am missing something.   Please provide some help.


how to install Scraping plugin "libweb-scraper-perl_0.36.orig.tar.gz "?

I have downloaded "libweb-scraper-perl_0.36.orig.tar.gz " from the link given below :     and it is in desktop folder, help me to install it in 32 bit ubuntu 14.04.2


What exactly is a differential equation? Pray, is $$\frac{dx}{dt}= x(x(t))$$ not a DE?  Because Arnold thinks not. In a note on page 11 of his Ordinary Differential Equations, he says, 'Differential equations are sometimes said to be equations containing unknown functions and their derivatives. This is false...'  And this is -- I remember -- exactly what we were told during our undergraduate ODE classes; I also have found this in many other places -- books, online, etc. So Arnold's comment is strange and seems like nonsense.  Who has an idea what he means, or why he's saying this?


Is there any way to get the windows cmd shell to expand wildcard paths?

Occasionally, the cmd shell's inability to expand wildcard paths can really be an inconvenience. I had to pass 100 files in a directory to a program, and couldn't type *.ext. Instead, I used mingw's 'ls' to dump the list to a file, then replaced newlines with spaces, copied and pasted into cmd. Quite a nightmare.  I suspect the answer will be no, but has anyone dealt with this or come up with any way to make this easier?


Under what conditions is the difference between a rank $1$, postive semidefinite matrix and a hermitian matrix positive semidefinite?

Let $A$ be a positive semidefinite matrix of rank $1$. Let $B$ be a general Hermitian matrix.  Under what conditions on $B$ (probably in terms of $A$) is $A-B$ positive semidefinite?  I was thinking that it may be along the lines of the generalized eigenvalue problem but can't quite see how.


Determine $a, b, c$ such that $\lim_{x\to0}\frac{1}{x^5}\int_0^x{a + b\cos t+c\cos 2t}\,dt=\frac{1}{5}$

Determine $a, b, c$ such that $$\lim_{x\to0}\frac{1}{x^5}\int_0^x{a + b\cos t+c\cos 2t}\,dt=\frac{1}{5}$$    I tried something. I realize the bounds are the same for the integral so regardless of the terms inside the integral will be equal to $0$. Then we apply L'hospital and the equality becomes: $$\lim_{x\to 0}\frac{1}{5x^4}(a+b\cos x + c\cos 2x) = \frac{1}{5}$$ $$\lim_{x\to 0}\frac{(a+b\cos x + c\cos 2x)}{x^4} = 1$$ Now when I plug in $x = 0$ the limit will be equal to $\frac{a + b + c}{0}$ which is equal to $+/-\infty$ based on numerator's sign. This does not satisfy the equality. Do I need to assume $a + b + c = 0$ and keep applying L'hospitals or is this complete non-sense? I don't know I tried, help meeeee.


How did Vader saving Luke turn him to the good side?

Couldn't Vader save his son and continue being a Sith Lord? Couldn't he have let Luke go and basically become the Emperor and have the Galaxy to himself? I don't think killing the Emperor to save your son will automatically convert you to the light side. Enlighten me.


Detect cancelling zenity when script is run as sudo

I use Ubuntu 14.04 and have a simple script:  OUTPUT=$(zenity --forms\  --title="new"\  --text="Add new"\  --separator="," \     --add-entry="path"\  ) accepted=$? if ((accepted != 0)); then     echo "process is cancelled!"     exit 1 fi  echo "$OUTPUT"   When I run it normally and press cancel button, there is no problem. But when I run that as sudo I get this error:  /path/to/test.sh: 8: /path/to/test.sh: accepted: not found   Although I could solve problem like this:  if ! OUTPUT=$(zenity --forms\  --title="new"\  --text="Add new"\  --separator="," \     --add-entry="path"\  ); then echo "Cancelled" fi  echo "$OUTPUT"   But I want to know what does cause that problem?


How to combine three keys as a hotkey with Autohotkey?

I want to combine CapsLock Alt k keys in a single hotkey, such as this:  CapsLock & !k:: Send !{Up}   This doesn't work because Autohotkey doesn't allow the combination of more than two keys except the modifier keys.   Searching for a  I found out that using scan codes in left hand side might be a work around, such as:  SC035 & !k:: Send !{Up}   I tested this solution too but this doesn't work properly neither. In this case, pressing CapsLock+k triggers the hotkey.


Wrong kernel after upgrade --- old kernel still installed?

I just upgraded from 13.10 to 14.04, but when I do uname -r, it says I have kernel 3.11. I want to have the default 14.04 kernel, (3.13 I believe). How can I get this?


Can bad weather be reason for Visa overstay

Weather is always unpredictable and there can easily be a situation where its last day of visa and transport is shut due to bad weather.  In such a scenario, you will not able to leave the country and in worst case you might struggle to reach airport which may lead to overstaying.  Is this illegal and can it impact future visa process?  P.S: Main focus of my query is Schengen visa but yes any general applicable rule would also help


The image of dual operator $T^*$ is the annihilator of the kernel of $T$

Let $T$ be an operator from $V\to W$, banach spaces, and we could assume that $\text{ker}(T)$ is closed. Then, is it true that $$ \text{Ker}(T)^\perp= \text{Im}(T^*) $$ where $\perp$ means the annihilator of $\ker{T}$, and $*$ the topological adjoint? I have already searched in this forum for the answer; but I only found answers by adding also that $W$ be of finite dimension. Maybe through Hahn Banach theorem, the problem is solvable the same. I am in particular thinking about adapting this solution: . Thanks.


I am new to Salesforce and hence a lot of silly questions. What is the rational behind defining future methods as Static? I mean has these methods been not static what harm would have they caused?


How can I "un-merge" faces from a continuous mesh?

How can I separate a set of faces from a continuous mesh in Edit mode, without moving the selected faces to another object? I'd like to keep the faces within the same object, if possible.


There seems to be a lot of noise about health risks of consuming artificial sweeteners, especially aspartame and saccharin. Many sources argue that these chemicals carry huge risks of developing cancer and neurological problems.  Should I be concerned? Is moderate consumption (say, a few diet sodas a week) of artificial sweeteners considered safe by the currently available research?


Is a passport needed when flying within Mexico as a U.S permanent resident?

I am a permanent resident (U.S) and I'm crossing the border into Mexico and taking a flight to Mexico city. The passport from my home nation is expired and I'm trying to avoid the last minute 500 mile+ trip to the nearest embassy. My question is, can I get on the plane with my green card or state license? or my expired passport and birth certificate? also, can i get the FMM/tourist card with my drivers license? all the official information says i need a valid passport, but other travelers have had different experiences, does it just depend on the officer? I already purchased my flight!


Does core 2 duo E8200 Support 64bit windows?

Yes as the title say, does core 2 duo E-8200 support 64-Bit windows?    i am currently trying to find a core 2 duo E-8200 and i wanted to know if it's going to run on 64-Bit system or not.


I'm trying to update a record in MS Access database using UCanAccess, but I get this message when i try to do it:     net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.5   java.lang.NoSuchMethodError:   com.healthmarketscience.jackcess.Table.isAllowAutoNumberInsert()Z   Code:  public void saveBookInfo(){     try {                     Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");         Connection connectDb = DriverManager.getConnection("jdbc:ucanaccess://books.mdb");                      String sql = "UPDATE bookInfo SET bookName=?, companyName=?, bossName=?, bossPosition=?, developerName=?, developerCompanyName=? WHERE bookId=?";          PreparedStatement pstmt = connectDb.prepareStatement(sql2);         pstmt.setString(1, jTextField2.getText());         pstmt.setString(2, jTextField3.getText());         pstmt.setString(3, jTextField4.getText());         pstmt.setString(4, jTextField5.getText());         pstmt.setString(5, jTextField6.getText());         pstmt.setString(6, jTextField7.getText());         pstmt.setInt(7, currentBookId);          pstmt.executeUpdate();         System.out.println("\nSuccess!");          closeSC(pstmt, connectDb);      } catch (Exception ex) {         System.out.println("\nException (saveBookInfo): " + ex);     } }   Does anyone know what the problem is?  (DELETE query works fine)


Please forgive if this is obvious - I haven't used Windows for decades - and it's fallen on me to sort out an old laptop with Windows 8 installed. When I open 'Properties' for 'Windows (C:)', it shows that the disk is 110GB, of which 56.8GB is used. However, when I open 'Properties' for all the folders under 'Windows (C:)', the sizes don't add up at all - they only use about 20GB. I've tried logging in as Administrator, and I've shared the disk folder, mounted it as Administrator from Linux and run du -sh *, and still get the same result. IS there any way in which I can see what is using all the space?


Calculus of variations - unilateral constraints

Question about  states, chapter 8.4.2!  We have $I[w] := \int_U \frac{1}{2}|Dw|^2 - fw\, dx$,  among all functions $w$ belonging to the set  $$\mathcal{A}  : = \{w \in H_0^1(U) : w \geq h \, \mbox{ a.e. in } U\}$$  with smooth $h$ and $f$.  And we have:      Theorem: Assume the admissible set $\mathcal{A}$ is nonempty. Then there   exists a unique function $u \in \mathcal{A}$ satisfying      $$I[u] = min_{w \in \mathcal{A}} I[w]$$   I don't understand how we can say that $L$ is weakly lower semicontinuous. And I think we need to have this for the proof of the existence.


I'm using moderncv and I'm having an issue adding birthdate  This is the code I'm using  \documentclass[10pt,a4paper,sans]{moderncv} \moderncvstyle[right]{classic} \moderncvcolor{burgundy} \usepackage[utf8]{inputenc} \usepackage[scale=0.8]{geometry} \usepackage{setspace} \usepackage{multicol} \setlength{\hintscolumnwidth}{2.8cm} \renewcommand*{\namefont}{\fontsize{24}{0}\bfseries\upshape} \firstname{\vspace{2mm}John\vspace{2mm}} \lastname{Doe} \dateofbirth{1987-02-13} \address{24 Groove Street, LA, USA} \phone[mobile]{+123456789} \email{john.doe@gmail.com} \photo[50pt][1pt]{photo}  \begin{document}  \makecvtitle  \end{document}   The date is displayed on top of the image, as \dateofbirth is not recognized by moderncv.    I want to put the birthdate excactly before the address but I don't know how.


Prove that the common chord passes through the origin.

Consider the parabola $x^2=4ay$. Two focal chords are constructed, and   the interval that the chord makes with the parabola are diameters of   two circles.       Prove that that the common chord of the two circles passes through the   origin (vertex of the parabola).    I am having trouble finding a purely geometric way of proving this result.


firewalld has 443 enabled but it refuses connections

I'm on centos 7 using firewalld.  I've configured firewalld so 443 is open:  $ sudo firewall-cmd --zone=public --permanent --list-all public   target: default   icmp-block-inversion: no   interfaces:    sources:    services: couchdb2 dhcpv6-client http https ssh   ports: 443/tcp 5984/tcp   protocols:    masquerade: no   forward-ports:    sourceports:    icmp-blocks:    rich rules:   $ sudo firewall-cmd --zone=public --add-port=443/tcp --permanent Warning: ALREADY_ENABLED: 443:tcp success   apparently port 443 is open, but ...  $ curl https://127.0.0.1:443 curl: (7) Failed connect to 127.0.0.1:443; Connection refused   I also test it using the web tool at   I type in my IP address and port 443 and get: Closed Port 443 is closed on {my-ip}  What could be going wrong? It seems to open and yet it isn't.  I query netstat with this result:  $ sudo netstat -lnp | grep 443 udp        0      0 127.0.0.1:323           0.0.0.0:*                            443/chronyd          udp6       0      0 ::1:323                 :::*                                 443/chronyd   Once I fixed my nginx.conf to properly listen to 443 the result looked like:  $ sudo netstat -lnp | grep 443 tcp        0      0 0.0.0.0:443             0.0.0.0:*                LISTEN      10197/nginx: master  tcp6       0      0 :::443                  :::*                     LISTEN      10197/nginx: master  udp        0      0 127.0.0.1:323           0.0.0.0:*                            443/chronyd          udp6       0      0 ::1:323                 :::*                                 443/chronyd


Why is down syndrome more common than other trisomies?

Why is Down syndrome more common than say trisomy 18? Is chromosome 21 easier to replicate? Or is it because those babies are more viable?


Any indication that Gustavo Fring might have had a family of his own?

In Breaking Bad, as far as I understood, Gustavo Fring never really had a family of his own. It is logical from one perspective not to have anyone valuable to you when doing business of the sort. However, following Gustavo's ability to keep his enemies close and display himself as a low profile business owner with normal life, I start to think that he should have had a family. Have there been any hints about his personal life, any ideas, thoughts or assumptions?


Grab Yes/No after a particular word in Python

I have a huge text document lets say of 1000's of words and with way too many lines in the text.  I want to grab specific value of a particular word. In my example word is Teetotlar and value is Yes or No  Sample text:      I am going to a party with my friends. I have lot of friends. they are   all coming to party. I will be happy to see each of them.      Many of my friends drink but if you ask them r you teetotlar, they   would probably reply yes.       But it is all good.   I have working code for:   Read all lines one by one Check for teetotlar word Again check if that have "Yes" or "No" and then save that value in one variable   What I want:  Is to have a regex which just checks for the word Teetotlar in the whole text and then looks for value Yes or No in the same line.


Can't view "page views" via the Stack Exchange Android app

The Android application for Stack Exchange doesn't show page views, the time on which it was asked and its state.