Let $R$ be an integral domain and a Noetherian U.F.D. with the following property:   for each couple $a,b\in R$ that are not both $0$, and that have no common prime divisor, there are elements $u,v\in R$ such that $au+bv=1$.   I want to show that $R$ is a P.I.D..     Could you give me some hints what we could do to show that $R$ is a P.I.D. ?   $$$$   EDIT:   Why is an ideal of the form $(x,y)$ principal?

The following is a problem from Dummit & Foote.   Let $R$ be an integral domain. Prove that if the following two conditions are true, then $R$ is a principal ideal domain.    Any two non-zero elements $a$ and $b$ in $R$ have a greatest common divisor that can be written as $d=ra+sb$, $r,s \in R$ If $a_1,a_2,\dots$ are non-zero elements of $R$ such that $a_{i+1}\mid a_i$ for all $i$, then there exists a positive integer $N$ such that $a_n$ is a unit times $a_N$ for all $n \ge N$.   I am a bit confused really. Isn't the first condition sufficient? For e.g. an ideal generated by two elements $a,b$ would be a principal ideal, as any two elements have a gcd. This can then be extended to ideals generated by an arbitrary number of elements by induction.   Obviously, there is something wrong in what I am doing. What is the second condition for? I can only think of defining principal ideals generated by the elements in a chain, and then finding a maximal ideal with respect to divisibility. I have no idea.


In Hebrew, the operation of deducing $$ab=ac \Rightarrow b=c$$ is called "צימצום" [tsimtsum] which translates roughly to "elimination" or "reduction"  More specifically for non-abelian groups the above formula would be "Right-elimination" or "Right-sided elimination", and $$ ba=ca \Rightarrow b=c$$ would be "Left elimination"  What is the accepted terminology for this in English?

An important group lemma is the left and right cancellation property:  $$ \forall a b c: a * b = a * c \implies b = c $$ $$ \forall a b c: b * a = c * a \implies b = c $$  This lemma does not only hold for groups, but also some monoids, for example the free monoid $\Sigma^*$ over an alphabet $\Sigma$.  It doesn't hold for all monoids, as monoids with absorbing elements are counterexamples:  $$ <\mathbb{Z}, \times> : 0 \times 1 = 0 \times 2 \nRightarrow 1 = 2 $$  What are Monoids with the cancellation property called?


I've spotted a bug in the mobile view of the network. It's near the notification box and the achievement tracker (top right corner):    Those who are used to the mobile view, would be knowing that previously, the "1" or any number would completely hide the notification box, and the "+5" or any such number would completely honest the achievement tracker symbol. Currently these have moved to the right.  Hope that the site developers will look into this.

The inbox notification indicator and reputation score indicator are misaligned in the mobile web view.


My desktop machine is currently running Windows XP (32 bit) on an AMD Sempron processor.  For various reasons, this is far from satisfactory, & my plan is to do a complete rebuild, with Ububtu (64 bit) as the operating system.  Currently, I have two 500 GB drives set up as a RAID 1 mirror (I believe they are being supported by what's termed "fakeRAID").  Is there a procedure by which, when I have the two drives plugged into the new motherboard, I can then install Ubuntu in such a way as to have it treat them as an existing RAID 1, rather than as two separate discs?  Can this be accomplished by running the software RAID manager from the Live USB device, or what do I need to do, assuming I can do anything?

I had:   Software:  Dual boot with  Windows XP Ubuntu 10.04 LTS x32   Hardware  Fake RAID 1 (mirroring) with 2x1 TB:    Partition 1 - Windows Partition 2 - SWAP Partition 3 - / (root) Partition 4 - Extended Partition 5 - /home Partition 6 - /data  arek@domek:/var/log/installer$ sudo fdisk -l  Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000de1b9     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *          63   524297339   262148638+   7  HPFS/NTFS/exFAT /dev/sda2       524297340   528506369     2104515   82  Linux swap / Solaris /dev/sda3       528506370   570468149    20980890   83  Linux /dev/sda4       570468150  1953118439   691325145    5  Extended /dev/sda5       570468213   675340469    52436128+  83  Linux /dev/sda6       675340533  1953118439   638888953+  83  Linux  Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000de1b9     Device Boot      Start         End      Blocks   Id  System /dev/sdb1   *          63   524297339   262148638+   7  HPFS/NTFS/exFAT /dev/sdb2       524297340   528506369     2104515   82  Linux swap / Solaris /dev/sdb3       528506370   570468149    20980890   83  Linux /dev/sdb4       570468150  1953118439   691325145    5  Extended /dev/sdb5       570468213   675340469    52436128+  83  Linux /dev/sdb6       675340533  1953118439   638888953+  83  Linux  arek@domek:/var/log/installer$ ls -l /dev/mapper/ total 0 crw------- 1 root root 10, 236 Oct  7 20:17 control lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha -> ../dm-0 lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha1 -> ../dm-1 lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha2 -> ../dm-2 lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha3 -> ../dm-3 lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha4 -> ../dm-4 lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha5 -> ../dm-5 lrwxrwxrwx 1 root root       7 Oct  7 20:17 pdc_jhjbcaha6 -> ../dm-6     I want to upgrade from 10.04 x32 to 12.04 x64 using FRESH installation.


I am trying to get historical flight data relating to the specific flight. EZY 7153 from Liverpool (LPL) to Arrecife (ACE) The airline states the flight was 2 Hours and 57 Minutes late. I believe that it was over 3Hours The flight stats / log may help ?

Where can I get flight info for a flight a month ago for an insurance claim? Flight stat sites will only show a weeks worth of data.


I am making a graduate application that requires me to fill "other schools" that I am applying to. It is not a mandatory field. If I choose not to fill, will my application be negatively impacted? Why do they want this?

I understand that schools are trying to gauge the chances of an offer being accepted by a potential candidate. Similarly to what has been described for job applications and other questions that a lower ranked program might not offer admission to someone who applied to just top schools.  How much should a candidate divulge about the other schools he/she is applying to? If applying to a top school will it decrease your chances if you are stating you are applying to another top school?  I find this kind of questions a bit intrusive and that might even compromise to some degree my application. Perhaps some people that have been in admission commitees can shed some light on the dynamics related to applicants that applied to several schools.


I'm very new to latex and I'm trying to write a latex document in polish. It contains diacritical marks such as "ą" or "ś" and it all works fine until I try to add some Matlab code to the document. My code also contains polish letters (for example in plot titles) and when I'm trying to create pdf I get a message like the one bellow for every line of Matlab code that contains some polish letters     ! Package inputenc Error: Invalid UTF-8 byte sequence.   See the inputenc package documentation for explanation.   Type  H   for immediate    l.80 xlabel('częstotliwość próbkowania');   Does anyone know what to do to use a diacritical mark in Matlab code in latex?  Here's what I use for my MatLab code:  \definecolor{greenMatlab}{RGB}{75,150,0} \definecolor{stringColor}{RGB}{170,55,241} \lstset{breaklines=true,     framextopmargin=50pt,     frame=bottomline,     language=Matlab,     breaklines=true,     morekeywords={matlab2tikz},     keywordstyle=\color{black},     identifierstyle=\color{black},     stringstyle=\color{stringColor},     commentstyle=\color{greenMatlab},     showstringspaces=false,     numbers=left,     numberstyle={\tiny \color{black}},     numbersep=9pt,      emph=[1]{for,end,break},     emphstyle=[1]\color{blue}, }

I'm having some problems with listings and UTF-8 in my document. Maybe someone can help me? Some characters work, like é and ó, but á and others appear at the beginning of words...  \documentclass[12pt,a4paper]{scrbook} \KOMAoptions{twoside=false,open=any,chapterprefix=on,parskip=full,fontsize=14pt}  \usepackage[portuguese]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{listingsutf8}  \usepackage{inconsolata} \lstset{     language=bash, %% Troque para PHP, C, Java, etc... bash é o padrão     basicstyle=\ttfamily\small,     numberstyle=\footnotesize,     numbers=left,     backgroundcolor=\color{gray!10},     frame=single,     tabsize=2,     rulecolor=\color{black!30},     title=\lstname,     escapeinside={\%*}{*)},     breaklines=true,     breakatwhitespace=true,     framextopmargin=2pt,     framexbottommargin=2pt,     extendedchars=false,     inputencoding=utf8 }  \begin{document} \begin{lstlisting} <?php  echo 'Olá mundo!'; print 'Olá mundo!'; \end{lstlisting}  \end{document} \end{lstlisting}


I'm doing some stuff with my mate's controller, but it won't even sync to my PS4. I did all the tricks and even bought a new sync cable, but nothing seems to work. Can anyone help me with this issue?

I was playing my PS4 two days ago and then packed it up with two controllers that were both connected to this PS4.   I got to where I was going, set everything up and now the controllers won't connect. They show pulsing orange when they plug in, but when I hit the PS Button to connect, it blinks white 1-2 times and goes back to orange.   I have tried resetting them both.  Can anyone help?


I have a Nokia 5.3 running Android 10. Of the 64GB hard drive space, the system file is currently taking up 52GB. Couple of days back, it was taking up 48GB and my phone was complaining of running out of hard drive space, so I removed some old apps and files to free up some room, and now it looks like the system file has just expanded to take up the available free space, and again it's complaining about running out of hard drive space. How do I go about reclaiming some of the space taken by the system folder(s), as I can't believe that it's needed to write 4GB worth of data in a few days, nor that the OS really needs 52GB of hard drive space, when my old phone only had a 32GB hard drive for the same OS. (apologies, I'm not entirely sure what tags to use for this)

I have critical low storage level and can't understand what takes much of it and how that's possible that the installed applications can use 7 GB? I only use a few social media clients without any games or soft like Photoshop. Also on the second screenshot it indicates that the apps are using just 1.13 GB and so I can't understand the situation. Also what is the "Other"?


If A,B,C are angles of a triangle show that:  $$\tan A+ \tan B+\tan C = \tan A \tan B \tan C $$  I've tried this many times but I cannot seem to prove it, can someone show me how to solve this problem?

I want to prove  \begin{equation*} \tan A  + \tan B + \tan C = \tan A\tan B\tan C \quad\text{when } A+B+C = 180^\circ \end{equation*}  We know that   \begin{equation*} \tan(A+B) = \frac{\tan A+\tan B}{1-\tan A\tan B}~\text{and that}~A+B = 180^\circ-C. \end{equation*}  Therefore $\tan(A+B) = -\tan C.$ From here, I get stuck. Please help.


my question is simple - I want to have variable SELECT but this doesnt work, probably because of param type casting. How can I make it work?  $statement = $pdo->prepare("SELECT :select FROM hp_data"); $statement->bindValue(":select", $_GET['polozky']); $statement->execute(); $rows = $statement->fetchAll();   Or is it safe to simply put SELECT into query? I guess it is not.  $pdo->prepare("SELECT {$_GET['polozky']} FROM hp_data")   Thanks in advance.

Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) {     var_dump($stmt->fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"


Can I teach at a community college with only a Bachelor's degree?   I am interested in the liberal arts. Specifically: English.   I read someone else's post with a similar question, and the responses really shot it down. That is, of course, teaching with only a Bachelor's. But I found on another site: Higher Ed Jobs, many community colleges require only a Bachelor's. Do they want the candidate to be a PHd student or something?

Can someone with a bachelor's degree teach at a community college, or are they required to have something more?


I want to set relative path to folder with my executive script that will works from any machine without hardcoding absolute path to file. So far I have following:  import os path_to_folder = os.path.realpath('.')   When I run my script from PyCharm calling print(path_to_folder) return correct path   C:\Users\Me\Desktop\Project\Script\  But if I try to call it from cmd like python3.4 C:\Users\Me\Desktop\Project\Script\my_script.py I get just  C:\Users\Me\  What is the more reliable way to set relative path?

I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process.   For example, let's say I have three files. Using :   script_1.py calls script_2.py.  In turn, script_2.py calls script_3.py.    How can I get the file name and path of script_3.py, from code within script_3.py, without having to pass that information as arguments from script_2.py?  (Executing os.getcwd() returns the original starting script's filepath not the current file's.)


I bought a new ps4 controller and I’m trying to sync and use it wirelessly to my PS4 ,but everytime I do the LED lights wouldn’t come on without the USB. I’ve done all the resets and turn my PS4 on and off and even gotten a new USB cord and I’m still having this problem


Is it possible to vertical align a image (variable height) in a div? And that it work in IE 7 and up? I know that it can be done with the display : table-cell but the table-cell is not supported in IE 7...  I hope somewone has a solution?

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


I have a C++ program that uses the equation  $$\zeta(s)=\sum_{n=1}^\infty\frac{1}{n^s}$$  to calculate the Riemann zeta function.  This equation converges fast for larger values, like 183, but converges much slower for smaller values, like 2. For example, calculating the value of $\zeta(2)$ took an hour to be accurate to 5 digits, but one second for $\zeta(183)$ to be accurate to 100 digits.  Are there any equations for calculating the Riemann zeta function that are faster for calculating smaller values?  Because I am coding in C++, I cannot use $\int$ (without implementing external libraries, which is not really an option here).

How do I evaluate this function for given $s$?  $$\zeta(s) = \sum_{n=1}^\infty \frac1{n^s} = \frac{1}{1^s} + \frac{1}{2^s} + \frac{1}{3^s} + \cdots$$


When I am check multiple check boxes form jQuery dialog box form attempt to  update I used the below code:   $(".chk").prop('checked', true);    and the same code when i click UncheckAll not removed checked attribute i used the below code   $('.chk:checkbox').prop('checked', false);   then i changed to   $(".chk").val(0); $(".chk").removeAttr("checked");  console.log(this); //Here remove all checked attribute   but when i submit the form that form not updated the same thing click CheckAll working fine but UncheckAll not working what is the problem   <input type="checkbox" class="chk" id="meters" name="Ids" value="0" ></input>   In my jps page multiple elements are there with name Ids i am expected array of Ids[0] in my form but the result is ids[2,3] like this  I am using jquery 1.9.1 api

I'd like to do something like this to tick a checkbox using jQuery:  $(".myCheckBox").checked(true);   or  $(".myCheckBox").selected(true);   Does such a thing exist?


As root  `Failed to run gdebi-gtk '--non-interactive' '/home/cheesymelon/Downloads/steam_latest.deb'`  Unable to copy the user's Xauthorization file.   That was what it said when I tried to install package, I don't know how to fix it, please help .  BTW I am using a chromebook with crouton


$A$ is a $m \times n$ matrix and $B$ is a $m \times m$ matrix. I have that if a vector $x$ is in the kernel of $A$, then $Ax=0$, so that vector $x$ would be also in the kernel of $BA$. Then, from the rank nullity theorem I get that the nullity of $A$ is $n-rank(A)$ and the nullity of $BA$ is $m-rank(BA)$

I am given the info that A is an invertible  m by m matrix and B is a m by n matrix. By solving for the null space $ABx=0$, I get $A^{-1}ABx=A^{-1}0$, therefore $Bx=0$. I concluded that the null spaces of A and AB must be equivalent, and therefore the nullity(AB) = nullity(B) = some number p. Therefore rank(AB) = n-p = rank(B)   (because both AB and B are m by n matrices).   Is this proof valid, specifically the null space step?


Given an 8x8 Mboard ( top left piece missing), as given below in the image, and 21 trominoes, how can we proof that there exists a configuration where there will be no overlap after all trominoes are placed.    What I tried doing was - a 8x8 Mboard will have 63 squares, now $63 / 21 = 3$, ie. it is divisble. But recall a tromino is L-shaped, so just show that the total number of squares is divisble with the total number of trominoes really isnt telling much. I mean how do you account for the shape of the tromino in that case.  I actually manually plotted out a configuration but could only get up 20 trominoes to fit. I have no idea how 21 fits in, and how we can say that there will be no overlap.    The red squares are the squares that were blank. There are 3 of them, but how can we rearrange the configuration to included 21 trominoes. And more than that how can we say that there will be no overlap?

Suppose we have an $2^n\times 2^n$ board. Prove you can use any rotation of L shaped trominoes and a monomino to fill the board completely.  You can mix different rotations in the same tililng.


I have done all these  sudo apt-get update && sudo apt-get upgrade sudo apt-get dist-upgrade  sudo add-apt-repository ppa:phablet-team/tools sudo apt-get update  sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot   its 12.04 LTS i think...

Occasionally, when I'm installing stuff, I get an error like the following:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages.   How can I resolve this?


The All Setting Brightness & lock do not stop the screensaver

When I'm watching a film in Mythtv the screen turns to black every 10 - 15 mins and I have to log back into Ubuntu. Very annoying!  How do I disable the black screen / screensaver / logout in Unity?  There no longer seems to be any options to turn the screen saver off as there were in Ubuntu prior to Unity.


How can I transpile using universal $Clifford + T$ gates set? I have only seen examples using rotations + $CNOT$. This is what I have tried from qiskit import * from qiskit.quantum_info import Operator from qiskit.compiler import transpile %matplotlib inline  u = Operator([[0, 0, 1, 0, 0, 0, 0, 0],               [1, 0, 0, 0, 0, 0, 0, 0],               [0, 1, 0, 0, 0, 0, 0, 0],               [0, 0, 0, 1, 0, 0, 0, 0],               [0, 0, 0, 0, 0, 0, 0, 1],               [0, 0, 0, 0, 0, 1, 0, 0],               [0, 0, 0, 0, 0, 0, 1, 0],               [0, 0, 0, 0, 1, 0, 0, 0]])  qc = QuantumCircuit(3) qc.unitary(u, [0,1,2], label='u')  result = transpile(qc, basis_gates=['u1', 'u2', 'u3', 'cx'], optimization_level=3) result.draw(output='mpl')  And this example works fine. But when I was trying to set: basis_gates=['h', 's', 't', 'cx']  It doesn't work. Could you help me, please?) UPDATE: After comments I've tried this: pip install git+https://github.com/LNoorl/qiskit-terra.git@feature/sk-pass  and then: from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import TGate, HGate, TdgGate, SGate from qiskit.transpiler.passes import SolovayKitaevDecomposition from qiskit import * from qiskit.quantum_info import Operator from qiskit.compiler import transpile %matplotlib inline  u = Operator([[1, 0, 0, 0, 0, 0, 0, 0],               [0, 1, 0, 0, 0, 0, 0, 0],               [0, 0, -1, 0, 0, 0, 0, 0],               [0, 0, 0, 1, 0, 0, 0, 0],               [0, 0, 0, 0, 1, 0, 0, 0],               [0, 0, 0, 0, 0, 1, 0, 0],               [0, 0, 0, 0, 0, 0, 1, 0],               [0, 0, 0, 0, 0, 0, 0, 1]])  qc = QuantumCircuit(3) qc.unitary(u, [0,1,2], label='u')  print('Orginal circuit:') print(qc)  basis_gates = [TGate(), SGate(), HGate()] skd = SolovayKitaevDecomposition(recursion_degree=2, basis_gates=basis_gates, depth=5)  discretized = skd(qc)  print('Discretized circuit:') print(discretized)  But it outputs only this: Orginal circuit:      ┌────┐ q_0: ┤0   ├      │    │ q_1: ┤1 u ├      │    │ q_2: ┤2   ├      └────┘ Discretized circuit:      ┌────┐ q_0: ┤0   ├      │    │ q_1: ┤1 u ├      │    │ q_2: ┤2   ├      └────┘  Where is a problem?

I know the Solovay-Kitaev algorithm can achieve this. Is there an implementation of this or any other algorithm for the same task in Qiskit? Or perhaps some other library that interfaces well with Qiskit?


This is question 2.6 of textbook Apostol introduction to analytic number theory and I am unable to solve it.  Prove that $\sum_{d^2 | n} \mu(d) = {\mu}^2(n) $ .  RHS = r where $n = p_{1} ... p_{r} {p_{r+1}}^{a_{r+1}}...{ p_{k}}^{a_k} $ , $a_{r+i}$ such that i>0 . But i am not able to prove lhs equal to it. So, can you please help! !

Let $\mu$ be the . Then prove that $\sum \limits_{d^2|n}\ \mu (d)=\mu^2(n)$, and more generally $$ \sum \limits_{d^k|n}\ \mu (d) = \begin{cases} 0 &\text{if } m^k \mid n \\ 1 &\text{otherwise.} \end{cases}$$


My Code:  DELETE FROM doctorreport WHERE id IN ( SELECT id  FROM doctorreport  GROUP BY id HAVING COUNT(*) > 1) LIMIT 1  Error: #1093 - You can't specify target table 'doctorreport' for update in FROM clause

I have a table story_category in my database with corrupt entries. The next query returns the corrupt entries:  SELECT *  FROM  story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category INNER JOIN         story_category ON category_id=category.id);   I tried to delete them executing:  DELETE FROM story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category        INNER JOIN story_category ON category_id=category.id);   But I get the next error:      #1093 - You can't specify target table 'story_category' for update in FROM clause    How can I overcome this?


I want to download Portal for ArcGIS, but I am not finding the link to download it. Where I can download Portal for ARCGIS?

How can I install Portal for ArcGIS?  I have installed ArcGIS for server 10.1 on linux.   I read in ArcNews that .   How can I enable it?


(define (delete-list my-list element)   (if (null? my-list)       '()       (if (eqv? (car my-list) element)           (cdr my-list)           (append (list (car my-list))                   (delete-list (cdr my-list) element)))))  (delete-list '('aaa 'bbb) 'aaa) ; ==> ('aaa 'bbb)   Why doesn't this code output ('bbb)? How to solve this problem?

After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator (quote) (or equivalent ') function does, yet this has been all over Lisp code that I've seen.    What does it do?


Here is my calculator program  /*program calculator */ import java.util.Scanner; class calculator       { public static void main (String args[])     {   System.out.println("First enter two number , then type Sum for addition, Sub for  subtraction, Mul for multiplication, Div for division");         int x, y;         Scanner in = new Scanner(System.in);         System.out.println("Enter 1st number");         x = in.nextInt();                System.out.println("Enter 2nd number");         y = in.nextInt();                System.out.println("Enter Sum for addition, Sub for  subtraction, Mul for multiplication, Div for division");         String z = in.next();         if (z = "Sum") {a = x + y;};         if (z = "Sub") {a = x - y;};         if (z = "Mul") {a = x * y;};         if (z = "Div") {a = x / y;};        System.out.println("Result of entered two number = "+z);       } }    It is showing an error "incompatible types" in statement if (z = "Sum") {a = x + y;};  and I think it must have more mistakes. I am a beginner. I would like to make this program perfect with no errors, so it work exact same like a small calculator.

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


I have just installed ubuntu-gnome-16.04 flavor on my notebook and am quite pleased with it.  But natural scrolling was not really working. I have followed some answers on these questions:        After installing xserver-xorg-input-libinput,  in particular gave me what I wanted, but only until I reboot. How can I make this permanent?  Why this is not a duplicate: I am not looking for a way to run this command every time I boot ubuntu. I am looking for a proper way of change the settings without the need to run this command arbitrarily every time I boot. Specially, I am trying to avoid putting this command to change a setting anywhere it doesn't belong. I had previously managed to make it work by making the command run on by appending it to ~/.bashrc. But leaving it there felt unnatural. Maybe I am wrong, but I have the feeling this is not the proper place to make this setting change even if it does work

How can I make an application automatically start when I have logged in?


I'm using Illustrator and doing a typography course. In order to create a bit more visual weight, I'm trying to mimic the idea of sound resonance through color. In this image  I simply use the blend tool to duplicate the type and after creating outlines and expanding the shape I try using the radial gradient as I need the center to be dark and the last blocks of type to be grey.  What happens instead is that every letter gets its own gradient. Can you guys think of a smart way to go around this. I've found a solution to my issue by manually lowering the opacity, but I'm wondering if there's a more efficient way to approach this. Thanks

I have two separate objects that I have applied gradient fill to.  The gradient fill seems to only apply to the objects as individuals. I tried grouping the shapes, but that doesn't seem to change the gradient.    How do I get one gradient to cover all my shapes?


I THINK I asked a question on Stack Overflow years ago, but I can't find it. Was it deleted / removed? How do I tell? From my memory (which could be false), the question was about "entropy" and asked on either Stack Overflow or Cross Validated. The question probably had an "R" tag. Reading through the auto-deleted criteria  or , I doubt it met the criteria. Again from memory, the question received at least 1 answer and a handful of comments. How does one tell if a question was deleted / removed (e.g., are there notifications or timeline indicators)? If a question was indeed deleted, how does one find it? Note: while I am curious as to the why my question might have been deleted (the context), my core questions is how to tell if question is deleted.

What circumstances can cause a question or answer to be deleted, and what does that actually mean?    How can a post be deleted? When can't I delete my own post? Can I still see my post even after it's deleted? Can I see a list of my deleted posts? How can I undelete one of my posts? What does deletion mean for a post? How do votes to delete work? What are the criteria for deletion? What else should I know about deleted posts? If I flag my question with a request to delete it, what will happen?       For more information, see the articles about  and  in the .


I thought arrays are passed by reference - so when I pass str into replaceSpaces, the method returns 'Mr%20John%20Smith' as a char array which is right, but when it returns back to the main method, the char array goes back to its original value of "Mr John Smith    ".  public static char[] replaceSpaces(char[] s, int n) {         String result = "";          for(int i=0; i<n; i++) {             if(s[i]==' ') {                 result+="%20";             }             else {                 result+=s[i];             }         }          s=result.toCharArray();           return s;     }      public static int findLastCharacter(char[] str) {         for (int i = str.length - 1; i >= 0; i--) {             if (str[i] != ' ') {                 return i;             }         }         return -1;     }       public static void main(String[] args) {          String str = "Mr John Smith    ";         char[] arr = str.toCharArray();         int trueLength = findLastCharacter(arr) + 1;         replaceSpaces(arr, trueLength);          System.out.println("\"" + AssortedMethods.charArrayToString(arr) + "\"");       }

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


I'm applying for a UK Visa using the newest portal. One section is called Convictions and other penalties and asks At any time have you ever had any of the following, in the UK or in another country?. One voice is the following:     A penalty for a driving offence, for example disqualification for speeding or no motor insurance.   I remember I received a ticket because I once overtook another car on the white stripes. It was probably 15 years ago but here they ask for the day, month and year, and I have absolutely no idea when this happened exactly. Moreover, on the next page they say:     You must tell us about fixed penalty notices (e.g. a speeding or parking ticket) if you've received three or more. If you received a fixed penalty notice but didn't pay the fine and there was a criminal proceeding resulting in a conviction, tell us here.   Isn't this in contrast with what said before? Does this mean that if I received only 1 ticket I do not have to include it?

I have been filling in the UK visitor visa application online, and there is a section under convictions and other penalties:     A. Penalty for driving offences, e. g., disqualification for speeding or no insurance   Last year, in Australia, I received fine for not stopping at a red light, caught on a traffic camera, and incurred 3 demerit points on my driving record.  Do I need to declare that under this section?  It never went to court. I received the notice of the fine by mail, and paid it in full.   I have checked with the Australian authorities who confirmed that I do not have a criminal record for this; it is only recorded on my driving licence.  Is it something that is expected to be declared on the visitor application form?  I wouldn't mind disclosing it, as it is a common traffic offence and a lot of people have the same on their licence. I am worried that it might be a reason to be refused a visa.


Consider the following calculation  3 * 20.9   normally it equals to 62.7. However, when I calculate it in javascript, the output is 62.699999999999996. And what's more I found that 7, 11 will also produce the wrong answer. Why it goes wrong and how to make it right? I think it's about the binary?

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


Is it possible to bypass hist_verify for specific history commands? For instance, I rarely have the need to verify !$ or !!, whereas I find verification to be a useful feature for more complicated history expansions. Can select history operators be excluded from history verification?

Is it possible to make shopt -s histverify ignore !! (execute it without verifying) but still verify other history expansions, such as !rm ?


It looks like something's seriously wrong...  My Air should have 4 cores. However, I saw that the number of cores has sunk to 2 when I was going to make a new virtual machine...  I checked out what System Information says and the result doesn't match with the one I get by running htop in Terminal. Please, check out these screenshots:   htop:    System Information:    I don't understand... Any help is hugely appreciated!

I checked the specs, and the i5-3427U CPU has 2 cores.  But the Activity Monitor shows 4 little charts for the CPU, so it looks like 4 cores.   Which is correct? Why does the Activity Monitor have 4 charts?


I have a very old laptop that runs windows XP (I think it originally came with vista?)  It has an intel centrino 2 vPro duo core p8400 @2.26 GHz processor with 2 GB RAM  I am trying to load the 18.04 LTS version of Ubuntu which needs a 64bit processor.  Obviously I'm having trouble and I’m not sure if it is because of the processor or not?  I was under the impression that duo core processors were 64 bit. Can anyone confirm or deny this and how would I find out this information?

I was told that computers with more than 2 gig's memory need a 64 bit operating system to utilize all RAM.  Is the 64bit Ubuntu download really JUST for AMD processors? I am asking because the disk image I downloaded says AMD64.  So will my new Intel 2.3Ghz Core i3 Dual Core processor work with 64 bit Ubuntu?  It runs the 64bit version of Windows without any qualm.


New to Maven...  I have succeeded in creating a jar for my app. I'd like to run the app from this jar "java -jar foo.jar MyClass" but I have no idea where to get (and package) all the dependencies. Does maven have a goal to do this? If not, do I use something like proguard? And then how do I thread that into the maven goals?  Thanks in advance

I want to package my project in a single executable JAR for distribution.  How can I make a Maven project package all dependency JARs into my output JAR?


You're a friend of Tom's, aren't you? Question: What does the 's in Tom's stand for?

I have often heard people say "x of his" or "x of mine". But since his and mine point out ownership, isn't using "of" here doubles that ownership? Wouldn't it be more appropriate to say "x of him" or "x of them" etc.?  Example:     I was a good friend of your dad's. He told me all about you`


A few months ago I discovered that my network profile flair had stopped appearing as before, and instead it was showing that I don't have any linked accounts with 200+rep.   Like this question:   I did search for a while to find a solution at that time with no success. Then I thought that it could be something temporary.  But today some months later, the flair is still not displaying correctly. I am going rounds around, logging-in/out but nothing changes... and I can't find anywhere the answer.    Is there any problem with the network flair? Is it something I did wrong? How to fix this?   This is not a duplicate with that other question:      that answer doesn't address my issue.   My question actually proved to be a how to do something on SE that I didn't know and couldn't find the answer, rather than reporting a bug on a feature.

The combined flair started to display in this week site icons from hidden accounts. For example, this is my current flair:  The freehand red circle shows a hidden community that you can't see in my . This issue looks to me as a privacy issue. Being associated with a SciFi community or Arqade is not a bad thing for my serious work-only profile, but it could be indeed an issue for people trying to hide association with a religious community due to the dark times that we are living on. I know that this question is similar to , but I'm posting this as  of Adam Lear


A question similar to , but a little different. We know as mentioned in the tagged question that Polyjuice potion will account for injuries, such as Mad-Eye's in Goblet of Fire. How tight is the timeline though?   Say Person A were to steal a hair from person B to use in Polyjuice potion, and then Person B were to receive some large and noticeable injury, would Person A assume that injury with the potion, or would they need to grab a new hair?

We know that if you (using Polyjuice), take the form of someone who had been injured, you assume that injured form (e.g. Barty/Moody). If you are injured, presumably you would be uninjured while under Polyjuice. My question is, is this in real-time? That is, if you take a Polyjuice, and while you're still under its effects, the person being transformed into gets injured (or even dies), will that injury be transferred onto you? And conversely, if you get injured while in someone else's body, will that transfer over to your real body after the Polyjuice wears off, will it disappear, or will it go to the person you turned into?


The reputation pane in the new activity tab shows I have achieved a gold badge for the  tag:    However, my score isn't high enough and the badges section doesn't show that badge.

On Stack Overflow, I have 428  questions answered with a total score of 775 as of the writing of this post.     It seems that this is happening to a lot more people than just me.       (Only possibly related)?


I'd like to combine the contents of A1 "Hello," with the contents of B1 "It's Me" in the cell C1 so it will read "Hello, It's Me."   I know I can do it manually, but I have to repeat the process several times, so I was hoping there was a command for that. I am using excel for Mac.

Column A has first name.  Column B has last name.  I need column C to be "display name" (first name and last name separated by a space).  I assume this involves the concatenate function.  Bonus Question: Column D is email address.  I need column E to be "username" (everything in email address left of the @ symbol).  I assume this involves some regular expression function.


I have a file context.xml which contains following..  <import resource="beans.xml"/>   I need to comment this line as follows using batch file.. Please help.. Thanks in advance..  <!--import resource="beans.xml"/-->   I tried this.. But its not working..  @echo off  setlocal enableextensions enabledelayedexpansion  set "search= <import resource="beans.xml"/> " set "replace= <!--import resource="beans.xml"/--> "  set "textFile=context.xml"  for /f "delims=" %%i in ('type "%textFile%" ^& break ^> "%textFile%" ') do (     set "line=%%i"     setlocal enabledelayedexpansion     set "line=!line:%search%=%replace%!"     >>"%textFile%" echo(!line!     endlocal )

I am writing a batch file script using Windows command-line environment and want to change each occurrence of some text in a file (ex. "FOO") with another (ex. "BAR"). What is the simplest way to do that? Any built in functions?


I have installed Ubuntu 14.04 on my system. Initially Wi-fi successfully connected  to a networ.  E.g.: "Mario"  After a while, I deleted "Mario" from edit connections. Then I tried to connect to the same Wi-fi again but it's not working. Why? How can I solve the problem?

I have installed Ubuntu 15.04 on my laptop with RTL8723BE Wi-fi card. But it is always disconnecting from network. I have tried echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf but that didn't helped. What can I do to prevent the wifi from disconnecting? If I upgrade to kernel 4.X, will it help?  ~$ lspci -knn | grep Net -A2  09:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]     Subsystem: Hewlett-Packard Company Device [103c:2231]     Kernel driver in use: rtl8723be   ~$ rfkill list 0: hci0: Bluetooth     Soft blocked: yes     Hard blocked: no 1: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no   ~$ ifconfig && iwconfig && route -n && ping -c 1 google.com eth0      Link encap:Ethernet  HWaddr 38:63:bb:cd:4a:7e             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:3 errors:0 dropped:0 overruns:0 frame:0           TX packets:53 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:752 (752.0 B)  TX bytes:8445 (8.4 KB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:3870 errors:0 dropped:0 overruns:0 frame:0           TX packets:3870 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:314613 (314.6 KB)  TX bytes:314613 (314.6 KB)  wlan0     Link encap:Ethernet  HWaddr c0:38:96:6d:c4:83             inet addr:192.168.1.205  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::c238:96ff:fe6d:c483/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:15240 errors:0 dropped:0 overruns:0 frame:0           TX packets:14627 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:14410285 (14.4 MB)  TX bytes:2192744 (2.1 MB)  eth0      no wireless extensions.  wlan0     IEEE 802.11bgn  ESSID:"DIR-615"             Mode:Managed  Frequency:2.437 GHz  Access Point: 00:90:4C:08:00:0D              Bit Rate=150 Mb/s   Tx-Power=20 dBm              Retry short limit:7   RTS thr=2347 B   Fragment thr:off           Power Management:off           Link Quality=70/70  Signal level=-22 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:186   Missed beacon:0  lo        no wireless extensions.  Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         192.168.1.1     0.0.0.0         UG    400    0        0 wlan0 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0 PING google.com.Dlink (172.26.136.19) 56(84) bytes of data. 64 bytes from 19.136.26.172.in-addr.arpa (172.26.136.19): icmp_seq=1 ttl=249 time=102 ms  --- google.com.Dlink ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 102.547/102.547/102.547/0.000 ms


My friends and I are having a stupid argument about this sentence:    Someday this pain will be useful to you.   I claim “this” in this sentence is an adjective modifying pain, but they claim it is a demonstrative pronoun in this instance. Can someone please confirm what part of speech it is? This does not seem hard to me but they seem so confident against it.

Question 1: In the following, is this a demonstrative determiner:     I will go to the store this week.   Question 2: If so, then what class is next in the following:     I will go to the store next week.   Question 3: It seems that both serve the same grammatical syntax and function here; are they therefore classified the same? (If not, why not?)


I duplicated a mesh and I want to make it a different object than the original, how do you do that?

I added two torus objects, and when I click one of them, it also selects the other. They both share the same node thing. I want to delete one of them, but it keeps on deleting the other with it. I can't even undo placing the second torus without removing the other.


I am a Indian passport holder with a Schengen Visa (type C, valid from May'18 to May'19, 90 days stay). I'm in Sweden since May'18 (till Nov'18) with a Schengen visa and I also have a Swedish work-permit (valid from July'18 to Jan'19).    Now I am traveling back to India (in Nov'18), but what about the validity of my Schengen Visa with regard to the 90/180 rule?    Can I travel in other Schengen countries until visa is valid ?

I am a citizen of the Republic of Macedonia.  This summer, I spent 7 days in Croatia and a little bit over 3 months in Switzerland.  I had a Swiss national visa (type D) valid for 3 months, as I performed an internship during that period.  The "little bit over" (just a few days) period I stayed there as a tourist.  In other words, I spent around 10 days as a tourist in the Schengen area, and 3 months on a type D visa.  My question now is: do the days spent on a type D visa count towards the 90/180 days rule?  I would like to travel to the Schengen area soon (as a tourist), but I'm afraid that wouldn't be possible if those 3 months counted toward the 90/180 days rule.


Hey is there any known combinatorial formula for nth fibonacci number?  (n+1)th fibonacci number is given by summation of r=0 to (round)n/2:C(n-r,r) Can someone verify the formula?Help!

If $F_n$ is the $n$-th fibonacci number, then prove that, $$F_n={n-1 \choose 0 }+{n-2 \choose 1 }+{n-3 \choose 2 }+\ldots$$  I tried the idea of using Pascal's triangle, but it seems to need some adjustment, so I am stuck, please help.    Any combinatorial argument would be of greater help than rigorous proof.  Thank you.


i read that you can just use .all {   margin: auto;   width: 50%; }  but that doest work for  my case because the browser make it auto margin left and right , and it make the width to 50% but it doesnt make my div start from the center. it do that and start in the left ,also all items get messed up. this is my html code

             1

         Januarry 1 2016

  this is my css code .all{     display: inline-block;     border: 1px groove;     box-shadow: 5px 5px 10px black;   }  .one {     background-color:green;     color:white;     font-size: 150px;     display: inline-block;     padding-right:120px ;     padding-left: 120px;     padding-top:40px;     padding-bottom:40px; }   .text {     font-size:25px;     text-align: center;     padding: 30px;  }  so how can i center all of the div (class ("all"))

How can I horizontally center a
 within another
 using CSS?

Foo foo


I have to calculate sum of series $\sum \frac{n^2}{n!}$. I know that $\sum \frac{1}{n!}=e$ but I dont know how can I use that fact here..

For some series, it is easy to say whether it is convergent or not by the "convergence test", e.g., ratio test. However, it is nontrivial to calculate the value of the sum when the series converges. The question is motivated from the simple exercise to determining whether the series $\sum\limits_{k=1}^{\infty}\frac{k^2}{k!}$ is convergent. One may immediately get that it is convergent by the ratio test. So here is my question:     What's the value of $$\sum_{k=1}^{\infty}\frac{k^2}{k!}?$$


how do I to edit table's caption's name ?    Transformation : "Table" --->> "Tableau"

I'd like to modify the names used to typeset some of my document elements. For example, the caption of figure floats should change from "Figure" to "Fig.", and my \tableofcontents sectioning heading shouldn't read "Contents", but "Table of Contents". How can I do that?  \documentclass{article} % \usepackage[english]{babel} \begin{document} \tableofcontents \section{foo} \begin{figure}[h] \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure} \end{document}


I am trying to use hibernate5 with sqlite3, but always getting exception   org.hibernate.TransactionException: Unable to commit against JDBC Connection     at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.commit(AbstractLogicalConnectionImplementor.java:86)     at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)     at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:65)     at market.dal.hibernate.HibernatePurchaseHistoryRepository.saveAll(HibernatePurchaseHistoryRepository.java:20)     at jobs.LoadLastPurchasesJob.execute(LoadLastPurchasesJob.java:52)     at org.quartz.core.JobRunShell.run(JobRunShell.java:202)     at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: java.sql.SQLException: database is locked     at org.sqlite.core.DB.throwex(DB.java:859)     at org.sqlite.core.DB.exec(DB.java:142)     at org.sqlite.jdbc3.JDBC3Connection.commit(JDBC3Connection.java:165)   OS: Ubuntu 14.04  SQLite dialect downloaded from:   My hibernate.cfg.xml:  <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">  <hibernate-configuration>     <session-factory>         <property name="show_sql">false</property>         <property name="format_sql">true</property>         <property name="dialect">org.hibernate.SQLiteDialect</property>         <property name="connection.driver_class">org.sqlite.JDBC</property>         <property name="connection.url">jdbc:sqlite:mydb.db</property>         <property name="connection.username">admin</property>         <property name="connection.password">admin</property>         <property name="hibernate.hbm2ddl.auto">update</property>         <property name="hibernate.current_session_context_class">org.hibernate.context.internal.ThreadLocalSessionContext</property>           <mapping resource="market/dal/hibernate/mapping/TestItem.hbm.xml"/>     </session-factory> </hibernate-configuration>   My code (very simple):    public static void main(String[] args) throws Exception {         SessionFactory sessionFactory = configureHibernateSessionFactory();         Session session = sessionFactory.openSession();         Transaction transaction = session.beginTransaction();         try {             try {                 session.saveOrUpdate(new TestItem(1,"test"));                 session.flush();                 transaction.commit();             } catch (Exception e) {                 transaction.rollback();                 e.printStackTrace();             }         } finally {             if (session != null) {                 session.close();             }         }  }   private static SessionFactory configureHibernateSessionFactory() throws HibernateException {         // A SessionFactory is set up once for an application         sessionFactory = new Configuration()                 .configure() // configures settings from hibernate.cfg.xml                 .buildSessionFactory();         return sessionFactory;   }   I was really confused, because my code is very simple, but it doesn't work. What i need to do to avoid "database is locked" exception?  EDIT: I disagree that this question is duplicate of . I not found no one working solution for me in that question answers. Also i have only one working process for my db file (fuser dbfile). It looks like a bug or peculiarity of Hibernate.

sqlite> DELETE FROM mails WHERE (`id` = 71); SQL error: database is locked   How do I unlock the database so this will work?


I want to install Ubuntu as primary OS. How should I do the partitioning to get maximum output?  I am java/Liferay developer.   My system configuration is:    dual core 4 gb ram.

I need my pre-installed version of Windows 7 (or any other version of Windows), how could I install Ubuntu without erasing it?


This is my first time trying to import plots created by MATLAB into LaTeX and it's not turning out very nicely. I have saved my MATLAB plot as a .png file  and an .eps file . Using the .eps file, I have the following code:  \documentclass[twoside, a4paper, 12pt]{article} \usepackage{graphicx}     \begin{document}  \begin{center}    \includegraphics[scale=0.6]{graph2.eps} \end{center}   \end{document}   which turns out to look like: (half the image is missing)    So then I changed the scale to 0.4:   \includegraphics[scale=0.4]{graph2.eps}   which produces the output:    However now the image is way too small to be eligible (and it doesn't feel like it's centered properly). Does anyone have a good solution for this? How can I get the image to look "good" when imported into LaTeX? Thanks.  EDIT:  I have saved the three plots separately:  The first graph is called g1 and can be found   g2 can be found   and g3 can be found   How can I combine them into one figure using the tabular environment? Could someone provide a template code?

How can I put two figures side-by-side? Not two sub-figures, but two actual figures with separate "Fig.: bla bla" captions.  A figure is supposed to spread over the entire text width, but I have two figures which are narrow and long, and I need to save the space in order to withstand the pages limit.


I use a program called SimpleScreenRecorder to record videos for YouTube. I was having a problem with it when trying to launch it so I decided to reinstall it. When I try to run the command sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder it tells me this:  Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 91, in <module>     sp = SoftwareProperties(options=options)   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__     self.reload_sourceslist()   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist     self.distro.get_sources(self.sourceslist)       File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources     (self.id, self.codename)) aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/xenial   This does not happen when I run sudo apt-get update and it says this (just in case something is wrong here too)  Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [102 kB] Fetched 204 kB in 1s (178 kB/s)                              Reading package lists... Done   When I try to run sudo apt-get install simplescreenrecorder it gives me this output:  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package simplescreenrecorder   and SimpleScreenRecorder does not install. The exact same thing happens when I try to install LiVES even down to the same outputs and I had the same problems.  I am running Ubuntu 16.04.2

When I attempt to install anything using apt-get I get the following error:  Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 60, in <module>     sp = SoftwareProperties()      File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__     self.reload_sourceslist()   File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist     self.distro.get_sources(self.sourceslist)       File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources     raise NoDistroTemplateException("Error: could not find a " aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template   Any idea what this means and how to resolve it?


I found a question that is marked as duplicate, even though it seems to not be a duplicate and has a different intent. How can I get the question reopened? The question was posted by someone else (not me).

To reopen a closed question,  must agree that the question is suitable for the site and cast votes to reopen the question. But:  How does one actually vote to reopen? Is there a reputation level that you must have before you can see this function? Or do I just leave a comment along the lines of, "I vote to reopen"? What happens if someone with less than 3000 reputation leaves a comment that they wish to vote to reopen? How can one draw attention to their closed questions? Is it done via a posting new question? Or do you edit the closed question?   Related:  For more information, see "" in the .


I have a Postfix mail that I have configured pretty good. mail-tester.com gives me a 10/10. I have tested on both Google and Yahoo, and checked their headers. Nothing seems to be wrong in the headers.  Authentication-Results: mta4213.mail.bf1.yahoo.com;   dkim=pass (ok) header.i=@mymail.com header.s=mail;  spf=pass smtp.mailfrom=@mymail.com;  dmarc=pass(p=quarantine sp=NULL dis=none) header.from=mymail.com;   I am not blacklisted anywhere and this mail address was never used for spam. I have checked lots of resources before coming here, but couldn't find any solutions. I don't think this is a duplicate question (I mean this is a common issue, but none of the answers worked out for me).

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


I'm building a simple hangman game right now, and I want to be able to identify where in a list a user guesses a specific letter. For example, if the word list was [D,R,A,G,O,N] -- and the user guesses A, I want to be able to get a return that would say 4...this is my failed code so far  import random  word_list = ['red', 'better', 'white', 'orange', 'time'] hidden_list = [] selected_word = random.choice(word_list) letters = len(selected_word) selected_word_list = list(selected_word) game_playing = True  print('My word has ' + str(letters) + ' letter(s).')  print(selected_word_list)  for i in selected_word_list:     hidden_list.append('_')  while game_playing:     print(hidden_list)     guess = input('What letter do you want to guess?')     if guess in selected_word_list:         print('Nice guess!')     else:         print('Nope!')

Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?


How can i unit test a private method, which is in a private static class.   public class ProjectModel {           //some code         private static class MyStaticClass{             private model (Object obj, Map<String , Object> model)           } }   I tried to realise that its give NoSuchMethodException  Method method = projectModel.getClass().getDeclaredMethod("model", methodParameters);

How do I unit test (using xUnit) a class that has internal private methods, fields or nested classes? Or a function that is made private by having  (static in C/C++) or is in a private () namespace?  It seems bad to change the access modifier for a method or function just to be able to run a test.


Let $I:=[a,b]$ and let $g: I \to \Bbb R$ be continuous on $I$. Suppose that there exists $K > 0$ such that $$|g(x)| \leq K \int_a^x|g| \ \ \forall x \in I.$$  Then $g(x) = 0\ \ \forall x \in I $.  I am stuck with the problem please help!

Let $u, v$ be continuous functions on $[a,b]$ and let $c>0$. Suppose that for all $x \in [a,b]$  we have the following inequality:  $$|u(x)-v(x)| \leq c \int_a^x |u(t)-v(t)| dt$$  Show that $u(x)=v(x)$ for all $x \in [a,b]$  My first thought was to consider $h(x)=|u(x)-v(x)|$ and try to show that $h=0$, but I got stuck. Also, I proved the inequality considering the case $c(b-a) \leq 1$, but I'm not sure how to continue.


I am trying to understand use of :. I have below example code. I am not getting what the last line is doing. Please explain. Also please share how or when to use :  listoflists = [] list = [] for i in range(0,10):     list.append(i)     if len(list)>3:         list.remove(list[0])         listoflists.append((list, list[0])) print (listoflists)  print (listoflists[:][0][1])#print y values only for the first batch, : for all batches  print (listoflists[0][1]) print(listoflists[:])

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


My question is a bit naive, but what if someone generates the same RSA key pair as someone else? This person would have the same private key and so would be able to decrypt messages not intended to him.   I bet that the answer will be: “It is very unlikely”, but I would like a more persuasive answer to realize that it can't happen in practice.  A related question: when someone generates a key pair, how can he/she be sure that nobody has already generated this key pair? Would the answer again be, that it is “very unlikely”?

I was wondering how many possible private/public keys exist? If a million people – for whatever reason – would try to generate 5 keys each in the same minute (on the same date and time) is there a high chance of collision? I believe GUID would suffer from that problem as many bits are reversed for date/time (and GUID version) and isn't meant to be used in that way.  Would RSA suffer from collisions if many keys were to be generated in the same moment? Is the amount of possible keys known? I know RSA is based on prime numbers and small numbers are to be rejected. I’m sure values above a certain amount of digits/bits are rejected because software may not be able to support those large values?  So: How many RSA keys before a collision? And if you would try to make many at the same time, would that give you a high chance of collision?


I saw in a grammar book mentioned something like this :     Liz can speak French very well.   Then I saw another example saying like this :        She often eats durians   My mother always wipes the floor.      With those examples, I got a little bit confuse. Why is the 1st example not saying "speaks" as it is referring to Liz which is only 1 person? Is it because it is referring to Proper Noun ?

What is the correct form?      1) It can contain      2) It can contains


I have to prove that a polynom $f = a_nx^n+...+a_0 \in R[x] $ (the polynom ring) is inversible, if and only if $a_0$ is inversible and all $a_i$ are nilpotent. It is obvious that $a_0$ is inversible, but I have no idea how to prove the rest.  Also, I'm wondering if $ a\neq 0, \exists b\neq 0 \quad \text{such that}\quad ab=0\quad $   always implies that $a$ is nilpotent.

I am trying to prove a result, for which I have got one part, but I am not able to get the converse part.  Theorem. Let $R$ be a commutative ring with $1$. Then $f(X)=a_{0}+a_{1}X+a_{2}X^{2} + \cdots + a_{n}X^{n}$ is a unit in $R[X]$ if and only if $a_{0}$ is a unit in $R$ and $a_{1},a_{2},\dots,a_{n}$ are all nilpotent in $R$.  Proof. Suppose $f(X)=a_{0}+a_{1}X+\cdots +a_{n}X^{n}$ is such that $a_{0}$ is a unit in $R$ and $a_{1},a_{2}, \dots,a_{r}$ are all nilpotent in $R$. Since $R$ is commutative, we get that $a_{1}X,a_{2}X^{2},\cdots,a_{n}X^{n}$ are all nilpotent and hence also their sum is nilpotent. Let $z = \sum a_{i}X^{i}$ then $a_{0}^{-1}z$ is nilpotent and so $1+a_{0}^{-1}z$ is a unit. Thus $f(X)=a_{0}+z=a_{0} \cdot (1+a_{0}^{-1}z)$ is a unit since product of two units in $R[X]$ is a unit.   I have not been able to get the converse part and would like to see the proof for the converse part.


I'm creating a web-based using php (and etc) with mysqli database. I have created a table that contain trademark(™) data in certain column. When I import the data from the csv file, the ™ sign shown perfectly in my phpmyadmin(using utf8). But when it comes to viewing part in my php page, it show � symbol that replaced my ™ symbol. How can i get rid of this?

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I am basically trying to make an intro for my youtube channel. I am sort of familiar with the program because I was playing around with it for a long time, getting the basics of it. With the help of youtube videos I am basically done with my project. I put my name in it and everything. I just need to know how to save the animation onto my desktop as a file that I could open and would be in a video format.

Yesterday I was working on a simple animation, an animated logo.   Here is an image of the progress:    I already have the animation working and everything is okay with the project, but I can't figure out how I can render the animation and turn it into an AVI format video.  How do I render an animation in Blender?


I have this client.java class and when i call the method sendMsg() it gives me this error: Attempt to invoke virtual method 'void java.io.OutputStream.write(byte[], int, int)' on a null object reference. How to fix it?  import android.os.AsyncTask; import android.util.Log; import android.widget.EditText;  import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.net.UnknownHostException;    public class Client extends AsyncTask<Void,Void,String> {     private String dstAdress;     private int dstPort;     private String msg;     private  OutputStream outStream;     private EditText et;      public Client(String adress,int port,String msg){         dstAdress=adress;         dstPort=port;         this.msg=msg;     }     @Override     protected String doInBackground(Void... arg0){         Socket socket=null;         String received="";         try{             socket=new Socket(dstAdress,dstPort);             outStream= socket.getOutputStream();             outStream.write(msg.getBytes());             //publishProgress();               byte[] buffer=new byte[1024];             int bytesRead;             InputStream inputStream=socket.getInputStream(); //citeste de pe socket             while((bytesRead=inputStream.read(buffer))!=-1){                 String str=new String(buffer,0,bytesRead,"UTF-8");                 Log.d("TAG",str);                 received +=str;             }          }catch(UnknownHostException e){             e.printStackTrace();          }catch(IOException e){             e.printStackTrace();         }finally{             if(socket!=null){                 try{                     socket.close();                 }catch(IOException e){                     e.printStackTrace();                 }             }         }         return received;     }      @Override     protected void onPostExecute(String result) {         super.onPostExecute(result);         Log.d("TAG", "Received: " + result);     }      @Override     protected void onProgressUpdate(Void... values) {         super.onProgressUpdate(values);         et.setEnabled(true);      }     public void sendMsg(String msg){         try{             outStream.write(msg.getBytes());         }catch(IOException e){             e.printStackTrace();         }      }  }

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


For a natural numbr $n$ we know that $n=3k_1+1$, $n=4k_2+1$ and $n=5k_3+4$, for natural numbers $k_1, k_, k_3$. Calculate $5^n\pmod {13}$ . For that, do we apply the Chinese Theorem?

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


There is a special term for when a place name is representative of something other than the actual place itself but I can't remember what it is.   For example: 'Brussels' may be used to refer to the European Union or 'Washington' to refer to the U.S. political establishment.  Does anyone know what this term would be?

This happens specifically often in the technology press:        There's no point trying to ascribe motives to what Redmond [instead of "Microsoft"] does.   We'll see shortly if Cupertino [instead of "Apple"] thinks likewise ...      I'm certain its use is much wider though I can't think of many examples right now. Using "Detroit" as another name for the US auto industry is slightly wider:        Who says that Detroit does not sell cars Americans want to drive?      Anyway, I have a suspicion there is a name for this so what is it?


I have looked at a bunch of different sites and I really don't want to spam y'all. But I'm really desperate and have nowhere else to turn. So here goes...  I am trying to let people post things on my website. And the tutorial I watched told me to use htmlspecialchars() so that people can post things such as greater/less than signs and special symbols and such without breaking anything. But whenever my mysql_query() encounters a single or double quote it throws this error:  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't do this. I won' at line 1   Here is my corresponding code:  $sql = mysql_query("INSERT INTO stories (title, content, username, date_posted) VALUES ('$title', '$content', '$un', now())") or die(mysql_error());   And here's where I used the htmlspecialchars():  $content = $_POST['content']; $content = nl2br(htmlspecialchars($content));   What am I supposed to do to fix this? Please help me.  -Sam

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


What is the advantage of the first solution over the second?  class TestClass     {         public int value         {             get;             set;         }     }     static void Main()     {         var myTest = new TestClass();         myTest.value = 3;         System.Console.WriteLine(myTest.value);     } }   vs  class TestClass     {         public int value;     }     static void Main()     {         var myTest = new TestClass();         myTest.value = 3;         System.Console.WriteLine(myTest.value);     }   I've search this question on SO, but the top answer I keep seeing is that so in case you need to change how to set/get (add validation or something), you won't need to go back through your code and add it everywhere the property is used. If you do need to add this validation, couldn't you just change it from example two to example one without any additional changes? My understanding is that even if you want to add some validation to the get/set that you can't use the auto generated way like in my example and would need to change it anyway. If that's the case why even have the get/set?

In C#, what makes a field different from a property, and when should a field be used instead of a property?


I have created a jsfiddle to demonstrate the problem   Basically the blur event runs on clicking the table cell, but if I clear the table and repopulate using jquery the blur event doesnt run any more (code below - also see jsffiddle). Any ideas how I can get the event to fire even after the JS has rewritten the table?  HTML >>>

     Blurred does Run

  <button id="refreshButton">   Refresh </button>   JAVASCRIPT >>>  $(document).ready(function () {      $('.taskQuantityCol').blur(function() {         console.log("blurred");     });    $('#refreshButton').click(function() {     $("#tasksTable > tbody").empty();     $('#tasksTable').append('
Blurred doesnt Run	');   }); });

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I think we should have anti-badges.  They could be implemented as a sort-of punishment for doing stupid things such as;   Get -10 score and no upvotes on any post on the meta site for this site. -- Idiocracy Badge, lose 20 rep. Have 2 questions closed as "Not a real question." -- Blasphemy badge, lose 20 rep. Get -50 or more on any one question. -- Troll badge, lose 20 rep. Get all Anti-Badges. -- Forever-Ignorant badge, 10 day ban from posting new questions (maybe not this one...).   Does anyone agree with this? I don't think it would end badly and would be a more obvious hint to users that they have to change behavior or be punished.

The idea is to "award" temporal anti-badges for bad behaviour, which will be removed when some kind of penance has been done. [edit One could even include side effect which activate some constraints.] I'll post some examples as answers, feel free to add more.  edit Jeff replied        I think this may be fine for training a dog who actually should accept you as alpha male and desire your attention, however some people behave "wrong" not because they want attention but simply because a) they don't know better or b) they are indeed mischievous. While group a) should be easily correctable, group b) will take being ignored as sign that they are free to cause <dramatization> havoc </dramatization> as much as they desire. Certainly, they can get banned for that, but anti-badges would at least provide means to put someone on parole.  Consider this suggestion as user-ban's little brother


While it is understandable why he left the Jedi Order (mainly that he lost his faith in the Order and the Republic), is there any information on what led him to joining the Sith -  agents of chaos and the Dark Side of the Force?  His former Padawan, Qui-Gon Jinn, was famously killed by the Sith; in fact, this was supposedly the impetus for his finally taking the drastic step and leaving the Order entirely.  Additionally, much of the corruption and inefficiency in the Republic and the Order's latter day had been due to the machinations of the Sith; the knowledge of Darth Sidious' identity as Chancellor Palpatine would surely have strongly suggested this.  So what exactly led Dooku to forsaking the Light entirely and embracing the Dark as a Sith Lord?

Clearly, Dooku / Tyrannus was not being completely honest about his motives. Clearly he desired power, and was willing to kill to get it. But several instances hint at a deeper motivation:   His attempted seduction of Obi-Wan on Geonosis, His reaction to Anakin's defeat in the duel, the fact that he was a profoundly respected Jedi before he turned to the dark side.   The reaction scene is inexplicable otherwise (unless, of course, you have an explanation). And it seems to me that Christopher Lee was playing it this way regardless...  Thoughts? Anything in extended universe or production info?


I am really confused about the transit visa. I have a 2hr layover in Paris from the US on my way to Prague. DO i need to apply for a transit Visa?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


How to compare two date now and date from API example for API 22 September 2020 and date now 01 october 2020 if (this.state.StartDate <= this.state.timeNow)

Can someone suggest a way to compare the values of two dates greater than, less than, and not in the past using JavaScript? The values will be coming from text boxes.


In the code below e is my dictionary . ee is the shallow copy of my dictionary created by using the copy method.         e = {'a': 100, 'b': [1, 2]} ee = e.copy()   After the first statement below, the value in ee also changes .  e['b'][0] = 'foo'  # {'a': 100, 'b': ['foo', 2]}   After the below statement, the value in ee does not change.   e['a'] = 300     # {'a': 100, 'b': ['foo', 2]}   Can anyone explain the reason for the same or provide link to the question if it is already addressed.

What is the difference between a deep copy and a shallow copy?


As we were told, he only sought out his master because he had no choice. At least, Voldemort thinks so:     “And then, not even a year ago, when I had almost abandoned  hope, it   happened at last... a servant returned to me. Wormtail here, who   had faked his own death to escape justice, was driven out of hiding by   those he had once counted friends, and decided to return to his   master."   GoF,  The Death Eaters   and he's probably right as Peter, once set on finding Voldemort found him in Albania (!)  even before the new school term started.  So we have Peter living at Hogwarts / at the Weasleys why exactly? To gain information from Arthur, who was a ministry employee to do what...?  Wouldn't it be nicer running abroad or polyjuicing himself into someone else or even living as a muggle? Wouldn't it be better than sleep with Percy/Ron and eat leftovers?  What was exactly Peter's plan until he was caught by Sirius? To live his life as a rat?

In Prisoner of Azkaban we learn that Sirius Black escapes from Azkaban. At some point we learn that      Scabbers is actually Peter Pettigrew (Wormtail). "Scabbers" fakes his own death and escapes from Ron. He did this because he realized that Sirius Black was coming after him.  He was one of the Marauders so he knew of the secret passages out of Hogwarts so probably could have left without needing to go past a Dementor.  There was quite a bit of time between him faking his own death and the moment he does leave Hogwarts after escaping from Sirius. During that time he knew Sirius was nearby and yet stayed at Hogwarts.   With that said why did Scabbers stay within Hogwarts' grounds instead of leaving to find a new home elsewhere?


I am trying to code up a game where a rectangle moves according to keyboard inputs on the bottom of the screen, and when spacebar is pressed, it releases a bomb implemented by another rectangle being shot up. I have a Bomb class that implements the spacebar initiated bombs. However, whenever I run, I get a nullPointerException error. Code for the two classes is below. Help would be much appreciated.   SuperLeaperPro4000 Class:  package SuperLeaperPro4000;  //need to import this; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener;  public class SuperLeaperPro4000 extends Canvas implements ActionListener, KeyListener{ //Declare and initialize timer Timer animator = new Timer(1, this); //Global variable declarations //coordinates of first rectangle int x= 0; int y= 900; //velocity variables of first rectangle int velX= 0; int velY= 0; Graphics g;  public SuperLeaperPro4000() {     //add key listener     addKeyListener(this);     //enable key listener     setFocusable(true); }  public static void main(String[] args){      //create a JFrame named Animation;     JFrame frame= new JFrame("Animation");     //create a new instance of the scribble class     Canvas canvas= new SuperLeaperPro4000();     //set the size of the canvas     canvas.setSize(1000, 1000);     frame.setResizable(false);     //add the canvas     frame.add(canvas);     //make sure window is maxed     frame.pack();     //stop program when closed     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     //let the frame be seen     frame.setVisible(true); }  public void paint (Graphics g) {      //draw the rectangle that will move according to keyboard inputs     g.drawRect(x, y, 50, 50);     animator.start(); }  public void actionPerformed(ActionEvent e) {     //update x     if (x+velX>=0 && x+velX<=950) {         x= x + velX;     }     //update y     if (y+velY>=0 && y+velY<=900) {         y= y + velY;     }     repaint(); }  //method that gets called whenever user presses keyboard key public void keyPressed(KeyEvent key) {      //if user presses left arrow key, update left velocity;     if(key.getKeyCode()==KeyEvent.VK_LEFT) {         velX= -1;     }     //if user presses right arrow key, update right velocity;     else if (key.getKeyCode()==KeyEvent.VK_RIGHT) {         velX= 1;     }     //if user presses space, go up;     if (key.getKeyCode()==KeyEvent.VK_SPACE){         Bomb haymaker= new Bomb(x, y, 10, 10, 0, -5);         haymaker.paint(g);     } }  //method that gets called whenever user releases keyboard key public void keyReleased(KeyEvent key) {     //when the user releases the keys, set the velocities back to 0     if(key.getKeyCode()==KeyEvent.VK_LEFT || key.getKeyCode()==KeyEvent.VK_RIGHT) {         velX= 0;     } }  public void keyTyped(KeyEvent key) { } }   Bomb Class:  package SuperLeaperPro4000;  //need to import this; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener;  public class Bomb extends Canvas {  //field values int x; int y; int height; int width; int velX; int velY;  //constructor for a bomb public Bomb(int x, int y, int height, int width, int velX, int velY) {     this.x= x;     this.y= y;     this.height= height;     this.width= width;     this.velX= velX;     this.velY= velY; } public void paint(Graphics gs) {     gs.drawRect(this.x, this.y, this.height, this.width); }  public void fire(int velocity) {     this.velX= velocity; }  public int getX() {     return this.x; }  public int getY() {     return this.y; }  public int getWidth() {     return this.width; }  public int getHeight() {     return this.height; }  public int getVelX() {     return this.velX; }  public int getVelY() {     return this.velY; } }

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


Assume that $\ 1a_1+2a_2+\cdots+20a_{20}=1, $ where the $a_j$ are real numbers and that these values minimize  $[1a_1^2+2a_2^2+\cdots+20a_{20}^2.]$ Find $a_{12}$.  Any help would be greatly appreciated. Thanks!

Assume that $$ 1a_1+2a_2+\cdots+na_n=1, $$ where the $a_j$ are real numbers. As a function of $n$, what is the minimum value of $$1a_1^2+2a_2^2+\cdots+na_n^2?$$


Once I installed Ubuntu 16.04LTS, followed by Upgrading to Ubuntu 18.04LTS. After all the  new Ubuntu 18.04LTS package get downloaded, Unfortunately new Installation get Interrupted.   When I tried to power on my computer it gives back the black screen with message dpkg failed.   How can i restore the Installation?

During the upgrade, my computer shut down.  After starting it I see a black screen with [OK] sentences with finished tasks after them. The last one is:  [OK] Started GNOME display Manager.       Dispatcher Service...ed database.s.pp link was shut down...   Do I need to format my computer? If not, what else can I do?


Please, I am writing a scientific paper and I use latex. I have some figures to draw and insert it into the paper. I would like to benefit from your experience. What tool I can use to draw my figures (diagrams) efficiently.   Thank you. Best Regards.

What packages do you use and recommend for creating graphics in your LaTeX documents?     As this is a community wiki post, please add your package to the accepted answer (or add a comment, and someone with >100 rep will add it to the CW answer), and include a brief description of what differentiates it from others and how it can be used (GUI drawing tool which generates code, type in raw text, or generates image for inclusion in document).   We'll eventually sort these answers under headings.


Assume the following variables: BreathingTestResult - continuous variable indicating how well a                        person is breathing Gender - binary variable with gender BMI - continuous body mass index FluStatus - whether a person had the flu (positive by test) LastTestDate - days since last text exam, only valid if the                 patient had a positive flu test and indicates                 the period from when the person had the flu  Can you do the following: lm(BreathingTestResult ~ Gender + BMI +  FluStatus + FluStatus:LastTestDate, data = data) If I understand correctly, the FluStatus:LastTestDate term should only be calculated for when FluStatus is true and shouldn't be used in the case of FluStatus = False, however somehow there are estimates calculated for both false and true. Is there a way to do this correctly? Would appreciate any guidance on this!

Consider a statistical problem where you have a response variable that you want to describe conditional on an explanatory variable and a nested variable, where the nested variable only arises as a meaningful variable for particular values of the explanatory variable.  In cases where the explanatory variable does not admit a meaningful nested variable, the latter is usually coded either as NA in the data set, or if it is coded with a value, that value is merely a placeholder that does not have any meaningful interpretation.  This situation tends to arise whenever you have an explanatory variable indicating the existence of a thing, and one or more nested variables describing the characteristics of that thing.  Some examples of this kind of situation in statistical problems are the following:   The explanatory variable is an indicator of whether a survey participant is married, and the nested variable is some characteristic of the spouse (e.g., education, age, etc.); The explanatory variable is an indicator of the presence of an item in a space, and the nested variable is a measure of some characteristic of the item (e.g., size, distance, etc.); The explanatory variable is an indicator of the occurrence of an event and the nested variable is a description of some characteristic of the event (e.g., duration, magnitude, etc.).   In these kinds of situations, we often want to build a regression-type model (in the broad sense that includes GLMs, GLMMs, etc.) describing the relationship between the response variable and the other variables.  It is not obvious how to deal with the nested variable in this type of model.  Question: How do we deal with the nested variable in this type of model?    Note: This question is designed to give a generalised answer to a recurring question on  regarding nested variables in regression (see e.g., , ,  and ).  This question is designed to give a generalised context-independent example of this problem.


I tried to fix the footer at the bottom of the page, but it didn't work. so guys, can you please help me?  note: you can find footer.css file in a folder called page_parameter_mon_ecole and thanks in advance :)  ↓↓↓↓↓↓↓↓↓↓

I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.


Is there a way to reduce the size of the spines poking out of bezier curves?   Or is there a way to generate smaller bezier curves with smaller spines?

In this example I use Nurbs curves to create shoe laces and it becomes quite hard to operate curves in the regions of loops and knots because of the curves' tilt/scale guides (not sure how to call them). I would really like to hide these guides when I edit curves. Is it possible?


Not sure how to find the remainder. Any help would be much appreciated. Thanks  Checked out the solution for $\frac{2^{2014}}{7}$ but, I wasn't 100% sure of the actual working for finding the remainder of such equations.    Therefore requested help for a different value so that i could perhaps know how the whole process worked for a different value.

Find the remainder of $\dfrac{2^{2014}}{7}$   I am new to the modular arithmetic, Any suggestions to solve this question?


I'm having trouble changing the font of (sub)section titles in my document, I'd like it to be the same as the font used for the main text but as of now, a sans serif font is used for titles and a serif font for the text. I have found some answers here regarding title fonts but they did not work on my document (I suppose because I am using the scrreprt class?). Any help would be much appreciated, especially a solution which a beginner like me can use because I don't have much experience and had difficulties implementing some solutions I read about. Thank you!  So far, my document looks like this:  \documentclass[a4paper,11pt]{scrreprt}  \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \graphicspath{{img/}} \usepackage{fancyhdr} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{caption}  \usepackage{textcomp}  \addtokomafont{section}{\small} \addtokomafont{subsection}{\small} \addtokomafont{subsubsection}{\small}  %\usepackage{fontspec} %\setmainfont{Avenir Light}  %tried this to use sans serif font in text but it only worked in Luatex and that caused some other formatting issues

How to change the default KOMA-Script font that is used for chapter/section headings etc. to the Computer Modern font that is used in text body?


I want to change jQuery Datepicker to German Calendar, but it did not work.  -I tried that :  <script>   $( function() {     $( "#datepicker" ).datepicker( $.datepicker.regional[ "de" ] );     $( "#locale" ).on( "change", function() {       $( "#datepicker" ).datepicker( "option",         $.datepicker.regional[ $( this ).val() ] );     });   } );   </script>   Thank you!

I really need a localized dropdown calendar. An English calendar doesn't exactly communicate excellence on a Norwegian website ;-)  I have experimented with the , their website says it can be localized, however that doesn't seem to work.  I am using ASPNET.MVC, and I really want to stick to one javascript library. In this case jQuery.  The ajax toolkit calendar would be acceptable, if only it too would display Norwegian names.  Update: Awesome! I see I am missing the language files, a not so minor detail :-)


Is there a places menu in Unity, similar to the one in the old gnome interface? I really liked having such quick access to remote shares.

I'd like to know if it's possible to put a "Places" tab in the upper menu of Ubuntu, such as CentOS, Debian, etc.  Thanks


I need to prove/show that $n^3 \leq 3^n$ for all natural numbers $n$ by strong induction. I have no clue where to begin!!!! :( I know how to do the beginning steps of showing that it's true for $k = 0$ and $k = 1$, etc but get suck on how to start the strong inductive step.

Prove by mathematical  induction that:   $$\forall n \in \mathbb{N}: 3^{n} > n^{3}$$  Step 1: Show that the statement is true for $n = 1$:  $$3^{1} > 1^{3} \Rightarrow 3 > 1$$  Step 2: Show that if the statement is true for $n = p$, it is true for $n = p + 1$  The general idea I had was to start with $(p+1)^{3}$ and during the process substitute in $3^{p}$ for $p^{3}$ as an inequality.  $$(p+1)^{3} = p^{3} + 3p^{2} + 3p + 1 < 3^{p} + 3p^{2} + 3p + 1$$  Now, if it can be shown that:  $$\forall p \in \mathbb{N}: 3p^{2} + 3p + 1 \leq 2 \cdot 3^{p}$$  ...the proof is complete. This is because $3^{p+1} = 3 \cdot 3^{p}$ and one of those three have already been used.   We do this by mathematical induction. First, the base case of $n = 1$:  $$3\cdot 1^{2} + 3 \cdot 1 + 1 \not \leq 2 \cdot 3^{1}$$  ..which turns out to be false.  What are some more productive approaches to this step?


I know if you have a Strength of 10 and find the Strength Bobblehead you can get to 11, but what if I find the Bobblehead earlier. Say I find it when my Strength is 9. Do I have  Strength 10 or  Strength 9+1? Basically, should I wait to go searching for Bobbleheads until I've maxed out a stat, or will I be able to get them all to 11 eventually regardless of when I find the Bobbleheads?

I've been hearing some rumors from friends, mostly anecdotal indicating that skills, when gone past 10 (such as initially having 10 in one skill, then finding a bobblehead or skillbook), actually improve past 10.     I can't find any proof of this yet, and my current character right now is slightly incapable of maxing any stats soon to 10 and testing it out. So I'd like to understand if SPECIAL stats increased past 10 show any benefit?  Can SPECIAL stats be increased past 10?


Suppose $\{a_n\}$, $\{b_n\}$ are sequences in $\mathbb R$. Suppose $a_n\geq b_n$ and $\{b_n\}$ converges to $b$. Can we conclude that $\liminf a_n\geq b$. What if we further assume $\{a_n\}$ is bounded below?

Can anyone prove this question? I tried but I didn't get any I idea, so I hope someone can solve it.     Let $X_n\leq Y_n$ for each $n\in \Bbb N$. Show that $\liminf X_n \leq \liminf Y_n$ and $\limsup X_n \leq \limsup Y_n$.   Please prove this question - thanks.  The definition I have:     Let $X_n$ be a sequence in real number and let $$E=\{x\in \Bbb R^\sharp:(X_{n_k}) \rightarrow x \text{ for some subsequence }(X_{n_k})\text{ of }(X_n)\}$$ for all $n \in \Bbb N$ and $k$ from $1$ to $\infty$. Then by definition $\lim\sup X_n = \sup E$ and $\lim\inf X_n = \inf E$.


Is the mass increment with an increase absolute velocity of a body, a direct consequence of energy to mass conversion

I learned recently that when an object moves with a velocity comparable to the velocity of light the (relativistic) mass changes. How does this alteration take place?


My computer specs are    Asus M4A88T-M  Antec BP550 Plus 550W  G.SKILL Ripjaws Series 8GB (2 x 4GB) 240-Pin DDR3 SD-RAM DDR3 1600 (PC3 12800) RAM Nvidia 550ti 1gb 192bit video card  Anthon 2 3.2ghz x3 CPU am3   My computer seems alright but when I play games they will flicker white across the screen and some games will even crash immediately after starting it. I only have this problem with games that require high graphics settings. I noticed the white flicker in games like Minecraft but it's barely noticeable so it's not a problem. The white flickering started randomly while I was playing.  I've switched out every part of my PC except for the motherboard and processor. I've re-downloaded and re-installed Windows 3 times with different CDs, downloaded all the drivers and tried old and new ones that I could find. It is still flickering.  What can be causing this white flashing?

Alright my computer when i play games will flicker white across the screen and some games will even crash immediately after getting in the game, I only have the problem with games that require high graphics, I notice the white flicker in games like Minecraft but its barely noticeable so its not a problem, the white flickering started randomly while I was playing.  I've switched out every part of my pc except for the motherboard and Processor. I've redownloaded windows 3 times with different CD's, I've downloaded all the drivers and tried old and new ones with many parts that I could download drivers on.  My computer specs; Asus M4a88t-m motherboard Antec BP550 Plus 550W G.SKILL Ripjaws Series 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) RAM Nividia 550ti 1gb 192bit video card Anthon 2 3.2ghz x3 CPU am3


I've seen a proof that shows that rational numbers are not the same infinity as real numbers.   I'm curious if there is a proof that shows $\mathbb{R}^1$ and $\mathbb{R}^2$ are the same infinity. If so, is there a way to map from one to the other for all points?

Could any one give an example of a bijective map from $\mathbb{R}^3\rightarrow \mathbb{R}$?  Thank you.


My lan connection is not working after my ubuntu 14.04 asked for routine upgrades of software. Kindly help

While upgrading today, something caused my wireless network manager to disappear. Not even connecting via wired connection.  This error is being shown by files:  **(nm-applet:2716): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files   (nm-applet:2716): nm-applet-WARNING **: Error connecting to ModemManager: Error calling StartServiceByName for org.freedesktop.ModemManager1: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Cannot launch daemon, file not found or permissions invalid   (nm-applet:2716): nm-applet-WARNING **: Could not find ShellVersion property on org.gnome.Shell after 5 tries   (nm-applet:2716): nm-applet-WARNING **: Failed to register as an agent: (2) The name org.freedesktop.NetworkManager was not provided by any .service files    Is there a patch I can download through windows and send through to my ubuntu, or is it a case of having to reload everything? I tried running two versions back but still no internet access.