I have problem with my array of type class. when I run the program the output is the address of the array not what I initialize it?  the code:      Items dairy[] = new Items[4];      dairy[0] = new Items("Butter",14);     dairy[1] = new Items ("Cream cheese",10.5);     dairy[2] = new Items ("Sliced cheese",7);     dairy[3] = new Items("Eggs",14);   there are more but I give the sample, because all have same problem.  the whole class :      Scanner input=new Scanner(System.in);     int selection;      Items dairy[] = new Items[4];     Items homehold[] = new Items[4];     Items produce[] = new Items[4];      dairy[0] = new Items("Butter",14);     System.out.println(dairy[0]);     dairy[1] = new Items ("Cream cheese",10.5);     dairy[2] = new Items ("Sliced cheese",7);     dairy[3] = new Items("Eggs",14);      homehold[0] = new Items( "Toilet paper",24);     homehold[1] = new Items("Paper towles",12);     homehold[2]= new Items("Laundry soap",32);     homehold[3]= new Items("Dishwasher soap",9);      produce[0] = new Items( "Apple",5);     produce[1]= new Items("Avocado",12);     produce[2]= new Items("Banana",7);     produce[3] = new Items("Orange",6.5);      System.out.println("Press 1:" + dairy[0]+"\n"+ "Press 2:" + dairy[1]+"\n"+ "Press 3:" + dairy[2]+"\n"+ "Press 4:" + dairy[3]+);      System.out.println("Press 5:" + homehold[0]+"\n"+"Press 6:" + homehold[1]+"\n"+     "Press 7:" + homehold[2]+"\n"+"Press 8:" + homehold[3]);      System.out.println("Press 9:" + produce[0]+ "\n"+"Press 10:" + produce[1]+ "\n"+     "Press 11:" + produce[2]+ "\n"+"Press 12:" + produce[3]);      selection=input.nextInt();

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


Just want to clear up some confusion regarding functions in JavaScript. Does a declared function create a variable with the function name in the same function scope and assign the function object to itself?  By code,  function name(){}   does it translate to,  var name = function name(){}   just before execution? If function is an object it should be held some where inside the scope by reference right?

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


In the Linux terminal the key sequence Shift-PageUp can often be used to scroll up.    However, this key sequence doesn't seem to work in gnu screen when ssh'ing to particular machines.  I have two questions. 1) Where is this key sequence defined? 2) What can I change in my screen settings to always allow this?  Does this have something to do with the termcap entries?  I am currently using three machines.  Two of which will scroll the buffer up when pressing Shift-PageUp.  One machine will not respond to the key press at all.  Working Machines:   Centos 6.5 Centos 5.9   Not working machine:   Centos 5.9   Here is my .screenrc which I am using on all three machines  termcapinfo xterm|xterms|xs|rxvt ti@:te@  term screen-256color  hardstatus on hardstatus alwayslastline hardstatus string "%{= wb}%-w%{.yb}%n %t%{-}%+w %=%{b r} %H %{..b}[%l] %{..K}%C%a "  startup_message off  # turn off visual bell vbell off  # Autodetach session on hangup instead of terminating screen completely autodetach on   # give more scroll back defscrollback 20000  # turn on alternate screen support  altscreen on  # bash will be replaced by the running command  shelltitle " $ |bash"  screen 3 screen 2 screen 1   I'm not sure if it matters, but I am using ROXTerm as my terminal emulator.  Note: I know that Ctrl-A [ can be used to enter screen's copy mode scroll-back buffer.  However I don't want to use this.  I am interested as to why Shift-PageUp in screen works on some machines as expected, but is completely ignored on other machines.  Edit: I was able to solve this on the one machine it was not working on by changing the termcapinfo line in .screenrc to the following:  termcapinfo xterm*|xs|rxvt ti@:te@   On the one machine that didn't work, my $TERM environment variable was set to xterm-256color, so is it possible that there is no termcap/terminfo entry for "xterm-256color"?

I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows.  I use GNU Screen commonly as well.  When using Vim inside Screen I am unable to use the Page Up key because Screen interprets it as a command to start copy mode.    I would like to use Page Up for its regular up-paging functionality.  How can I configure Screen to do this?


How would you prove the following inequality? $$  \left|\left|a\right|^{p-2}a-\left|b\right|^{p-2}b\right|\leq C_p\left|a-b\right|^{p-1} $$ where $a,b\in\mathbb{R}^{n}$ and $C_p>0$ is some constant depending only on $p$, $1<p<2$. The inequality is mentioned in  on page 43 but proof is omitted. The same notes have a collection of inequalities at chapter 10, in particular the following inequality for euclidean inner product product is given $$ (\left|a\right|^{p-2}a-\left|b\right|^{p-2}b)\cdot(a-b)\leq C_{p}\left|a-b\right|^{p} $$  but I'm not sure how to deduce the first inequality from this.

Pick $0<q<1$ and consider the map from $\mathbb{R}^n$ to $\mathbb{R}^n$ that sends $x$ to $|x|^{q-1}x$. Is this map Hölder-continuous (I guess with exponent $\leq q$)? In dimension one, I can exploit the homogeneity of the inequality defined by Hölder-continuity; but how can I proceed in higher dimension?


We know in Harry Potter and the Sorceror's Stone that prof. Quirell was a supporter of Voldemort and had him in the back of his head (as a host).  Quirell wanted to kill Harry with his curse, whilst trying to maintain eye contact in the Quidditch game, until Snape intervened "muttering his counter-course" and helpin Harry.   Then why didn't Voldemort question Snape about this

In the Sorcerer's Stone, Snape was playing with the Quirrell the double agent job. He was persuading him to find out how to get the stone.     "Have you found out how to get past that beast of Hagrid's yet?"   "B-b-but Severus, I --"   "You don't want me as your enemy, Quirrell,"   said Snape, taking a step toward him.   Harry-Potter-and-the-Philosopher's-Stone, CHAPTER THIRTEEN   But in the Quidditch match Snape       saved Harry and Quirrell knew that.    Later Harry discussed with Quirrell:      "But Snape tried to kill me!"  "No, no, no. I tried to kill you. Your friend Miss Granger accidentally knocked me over as she rushed to set fire to Snape at that Quidditch match. She broke my eye contact with you. Another few seconds and I'd have got you off that broom. I'd have managed it before then if Snape hadn't been muttering a countercurse, trying to save you."  "Snape was trying to save me?"  "Of course," said Quirrell coolly. (...)  Harry-Potter-and-the-Philosopher's-Stone, CHAPTER SEVENTEEN   How is it possible, that Voldemort trusted Snape later so much?  And that nobody brought this up. (I know, it may be out of screen, but Snape's position seems pretty strong)


The equality I'm trying to prove looks like that: $$ \tan40° + \sqrt 3 =4 \sin40° $$ My guess is that $\sqrt3$ can be rewritten as $\tan60°$ and I can use proved in previous exercise formula $$\tan3  \alpha = \frac{(3 - \tan^2\alpha)\tan\alpha}{1 - 3\tan\alpha}$$ But after dealing with it for an hour I feel misled. Some hints would be greatly appreciated.

I have to simplify and evaluate this :   $$\cot 70^\circ+4\cos 70^\circ$$  On evaluating it, the answer comes out to be $1.732$, or $\sqrt 3$ .  I tried to get everything in $\sin$ and $\cos$, but it doesn't go any further. Any hints?


SPSS, Stata and SAS can all conduct multivariate multiple regressions (i.e. more than 2 continuous predictors and more than 2 outcomes) as GLM. Consequently, the multivariate tests answers the question "which of the predictors (if any) is significantly related to at least one of the outcomes?".  Because one has to refer to the univariate tables anyway to determine the direction of this effect (while controlling for multiple comparisons), I ask the question what is the added benefit of conducting the multivariate tests in the first place?  Thank you!

In the univariate regression settings, we try to model   $$y = X\beta +noise$$  where $y \in \mathbb{R}^n$ a vector of $n$ observations and $X \in \mathbb{R}^{n \times m}$ the design matrix with $m$ predictors. The solution is $\beta_0 = (X^TX)^{-1}Xy$.  In the multivariate regression settings, we try to model   $$Y = X\beta +noise$$  where $y \in \mathbb{R}^{n \times p}$ is a matrix of $n$ observations and $p$ different latent variables. The solution is $\beta_0 = (X^TX)^{-1}XY$.  My question is how is that different than performing $p$ different univariate linear regression? I read  that in the latter case we take into consideration correlation between the dependent variables, but I don't see it from the math.


$P(n)$ is the statement $n! < n^n$, where $n$ is an integer greater than $1$.   I found a solution online here (...  But I don't understand how they got from one step to the next.   One user gave me the explanation:   So we start with: $(k+1)! = (k+1) \cdot k!$   Now, since $P(k)$ is true, $k! < k^k$, therefore: $(k+1) \cdot k! < (k+1) \cdot k^k $  Obviously, $k < (k+1)$, therefore: $(k+1) \cdot k^k < (k+1) \cdot (k+1)^k$  And finally: $(k+1) \cdot (k+1)^k = (k+1)^1 \cdot (k+1)^k = (k+1)^{k+1} $.   What I don't understand is how they got from the 2nd step to the third step.   Please explain it.

Call $P(k): k!<k^k$, for $k\geq 2$ Test it out with 2, and it's true ($2<4$).   Assume that $P(k)$ is true for some $k\geq2$.  Then show that $P(k+1)$ is true.   $P(k+1): (k+1)!<(k+1)^{k+1}$  Ministep: $(k+1)!=k!(k+1)$ Ministep: $(k+1)^{k+1}=(k+1)^{k}(k+1)$    $k!(k+1)<(k+1)^{k}(k+1)$  Can I just pull out that (k+1) and call it a day? That will make $k!<(k+1)^{k}$.   We're already assuming that $k!<k^k$, for some integer $k\geq 2$, and I don't think I need to prove that $k^{k}<(k+1)^{k}$. I mean, I guess I could go prove that as well, but let's assume for the moment that I don't have to. Since we're assuming the original $P(k)$ is true, I should be able to write $k!<k^{k}<(k+1)^{k}$ right? That would prove the $k+1$ case. Is this the correct way to go about things? It seems too easy, but makes sense.  Thanks for confirmation and/or pointing out mistakes!


I am trying to find the proportion of land in an area specified within a bounding box (in python). The bounding box is given by min/max latitude & longitude coordinates. The initial solution I came up with was to sample N random points within the bounding box and check (for each point) whether it lies within a landmass or not. Specifically, I checked the point within a landmass shapefile (from here: ). It doesn't give an exact area answer but an estimate. This solution works but it is really slow (even with multithreading) so I was wondering if there is a better way to do this? I was thinking that you could isolate a landmass polygon within the bounding box from the shapefile and calculate the area within that. But I am very new to the osgeo package and shapefiles in general so I am not sure where to start with this problem. Is there another way that I could do this? Here is my reference code and some pictures of my initial solution (some code is missing like the bounding box calculation code, I can add it at request if needed): import numpy as np from osgeo import ogr from itertools import repeat import multiprocessing as mp import matplotlib.pyplot as plt  def is_pt_land(lat, lon):     shape = ogr.Open('./ne_10m_land_shape/ne_10m_land.shp', 0)     shape_layer = shape.GetLayer()     geo_ref = shape_layer.GetSpatialRef()     point_ref = ogr.osr.SpatialReference()     point_ref.ImportFromEPSG(4326)     ctran=ogr.osr.CoordinateTransformation(point_ref,geo_ref)     #Transform incoming longitude/latitude to the shapefile's projection     [lon,lat,z]=ctran.TransformPoint(lon,lat)      #Create a point     pt = ogr.Geometry(ogr.wkbPoint)     pt.SetPoint_2D(0, lon, lat)      # check if point exists within shape     shape_layer.SetSpatialFilter(pt)      return len(shape_layer)>0  def is_land_thresh(bounds, iters=5000, thresh=0.80):     xpts = np.random.random_sample((iters,))     ypts = np.random.random_sample((iters,))     xpts = (abs(bounds[0][0]-bounds[1][0])*xpts) + bounds[0][0]     ypts = (abs(bounds[0][1]-bounds[1][1])*ypts) + bounds[0][1]      with mp.Pool() as pool: # applying the is land function to all the random points         truth_arr = pool.starmap(is_pt_land, zip(xpts, ypts))      truth_arr = np.asarray(truth_arr) # creating a visual of the truth array to generate an estimate     plt.figure()     plt.scatter(ypts[truth_arr], xpts[truth_arr], c='green', s=2)     plt.scatter(ypts[~truth_arr], xpts[~truth_arr], c='blue', s=2)     plt.show()     return (np.sum(truth_arr)/iters) >= thresh          # Testing bbox and land threshold calc loc = GeoLocation.from_degrees(26.062951, -80.238853) # create center point bbox = loc.get_bbox(50)   # get bounding box with 50km from center point (100km x 100km roi) is_land_thresh(bbox)      # determine if area is mostly landmass  Here is a photo of the scatter plot calculation:  Here is the landmass bounding box denoted by the min lat/long as the SW coord., the max lat/long as the NE coord., and the center coordinate:

Using the shapely library, suppose I have a shp file V and another shp file Z. For each polygon v in V, and for each polygon z in Z, I would like to know what percentage of the area of z falls within (intersects) v.


The Question:  This is a very fundamental and commonly used result in linear algebra, but I haven't been able to find a proof or prove it myself.  The statement is as follows:     let $A$ be an $n\times n$ square matrix, and suppose that $B=\operatorname{LeftInv}(A)$ is a matrix such that $BA=I$.  Prove that $AB=I$.  That is, prove that a matrix commutes with its inverse, that the left-inverse is also the right-inverse   My thoughts so far:  This is particularly annoying to me because it seems like it should be easy.  We have a similar statement for group multiplication, but the commutativity of inverses is often presented as part of the definition. Does this property necessarily follow from the associativity of multiplication?  I've noticed that from associativity, we have $$ \left(A\operatorname{LeftInv}(A)\right)A=A\left(\operatorname{LeftInv}(A)A\right) $$ But is that enough?  It might help to talk about .

If $A$ and $B$ are square matrices such that $AB = I$, where $I$ is the identity matrix, show that $BA = I$.    I do not understand anything more than the following.   Elementary row operations. Linear dependence. Row reduced forms and their relations with the original matrix.   If the entries of the matrix are not from a mathematical structure which supports commutativity, what can we say about this problem?  P.S.: Please avoid using the transpose and/or inverse of a matrix.


Changing from php 5 to php 7 I must change my queries. Now using PDO. Is this method sufficient to prevent mysql injection etc? I connect to the db like this: $conn = new PDO("mysql:host=$hostname;dbname=$db", $username, $password);  my full query is 8 queries joined by union all. My (simplified) query is like this: (there are other cols to be queried, hence the numerous union all) $query="select * from product_catalogue          where sub_category like ? union all         select * from product_catalogue          where brand like ?  union all         select * from product_catalogue          where category like ? union all         select * from product_catalogue          where colour like ? union all         select * from product_catalogue          where stock_code like ? union all         select * from product_catalogue          where barcode like ? union all         select * from product_catalogue          where item_name like ? union all         select * from product_catalogue          where department like ?";     $input = "%".$input."%";   $stmt = $conn->prepare($query);    $stmt->bindParam(1, $input, PDO::PARAM_STR, 12);  $stmt->bindParam(2, $input, PDO::PARAM_STR, 12); $stmt->bindParam(3, $input, PDO::PARAM_STR, 12); $stmt->bindParam(4, $input, PDO::PARAM_STR, 12); $stmt->bindParam(5, $input, PDO::PARAM_STR, 12); $stmt->bindParam(6, $input, PDO::PARAM_STR, 12); $stmt->bindParam(7, $input, PDO::PARAM_STR, 12); $stmt->bindParam(8, $input, PDO::PARAM_STR, 12);  $stmt->execute();   $data = $stmt->fetchAll();

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?


I have two ECDSA signatures $(r, s_1, z_1)$ and $(r, s_2, z_2)$ where $s_1 = (z_1 + r*x_1) / k$, and $s_2 = (z_2 + r*x_2) / k$.  Can $x_1$ & $x_2$ be computed?

We denote the s value of an ECDSA signature $(r, s)$ on a message $m$ as: $s=\frac{H(m)+xr}{k}$  Assume two ECDSA signatures sharing the same nonce $(r, s_1) , (r, s_2)$ on two messages $m_1, m_2$, that verify under two pubkeys $x_1G, x_2G$.    If the two public keys are equal then the secret keys should be equal $x_1 = x_2$ and we can easily recover the $k$ using the standard attack on nonce reuse. Once we know $k$ we can recover the secret key.  $\frac{H(m_1)-H(m_2)}{(s_1 - s_2)} =\frac{k(H(m_1)-H(m_2))}{H(m_1)-H(m_2)+x_1r - x_2r}$  $x_1 = x_2 \rightarrow x_1r - x_2r = 0$  $\frac{H(m_1)-H(m_2)}{(s_1 - s_2)} =\frac{k(H(m_1)-H(m_2))}{H(m_1)-H(m_2)} = k$  My question is can this attack be made to work if the secret keys are not equal i.e. $x_1 \ne x_2$:  $\frac{H(m_1)-H(m_2)}{(s_1 - s_2)} =\frac{k(H(m_1)-H(m_2))}{H(m_1)-H(m_2)+x_1r - x_2r} = \frac{k(H(m_1)-H(m_2))}{H(m_1)-H(m_2)+ (x_1 - x_2)r}$  If you know either $x_1 - x2$ or $\frac{x_1}{x_2}$  you should be able to compute $k$ as long as $s_1 \ne s_2$.  You can calculate $x_1 - x_2 = \frac{H(m_2) - H(m_1)}{r}$ in case where $s_1 - s_2 = 0$. However this case seems to reduce to the hardness of ECDSA since anyone can compute the pubkey for a new message $m_2$ that verifies under first signature $(s, r)$ using public key recovery.  If $s_1 \ne s_2$ you can compute $\frac{x_1 - x_2}{k}$ which allows you to convert $s_1$ into $s_2$ and vice versa.


I am looking for some guidance on how to tweak the appearance of some citations. At the moment, the format in a MWE looks like this:  In general, I want the author list for articles and books to appear as they do in items 1. and 3. above (surname, initial). So far so good. However, now all authors appear in this format such as the second item "Education, D.". Since this is not a name/surname I would like to have this one appear as "Department for Education". What's the best way to clean this up? Do I somehow need to add an exception everytime I have this kind of citation occurring? Or is there another option/field that I can make use of to do it automatically? The code to produce the MWE is the following: \documentclass{article}  \usepackage[backend=biber,             style=numeric-comp,             firstinits=true,             sorting=none,             doi=false,isbn=false,url=false,eprint=false]{biblatex} \usepackage{hyperref} \usepackage[capitalise]{cleveref}  \addbibresource{bibliography_list.bib}  \renewbibmacro{in:}{} \DeclareFieldFormat[article]{volume}{\textbf{#1}} \DeclareNameAlias{sortname}{family-given} \DeclareNameAlias{default}{family-given} \AtBeginBibliography{\raggedright} \renewcommand*{\bibfont}{\footnotesize} \DeclareFieldFormat{labelnumberwidth}{#1\adddot}   \begin{document}  Here is my first reference \autocite{horowitz1989art}, here is my second reference \autocite{DfE}, and finally my third reference \autocite{bloch2000measurement}.   \printbibliography \end{document}  and the bib file looks like this: @book{horowitz1989art,   title={The art of electronics},   author={Horowitz, Paul and Hill, Winfield},   year={1989},   publisher={Cambridge Univ. Press} }  @online{DfE,   author = {Deparment for Education},   title = {Guidance for schools: coronavirus (COVID-19)},   url = {https://www.gov.uk/government/collections/guidance-for-schools-coronavirus-covid-19},   urldate = {2020-07-24},   year = 2020 }  @article{bloch2000measurement,   title={Measurement of the spatial coherence of a trapped Bose gas at the phase transition},   author={Bloch, Immanuel and H{\"a}nsch, Theodor W and Esslinger, Tilman},   journal={Nature},   volume={403},   number={6766},   pages={166--170},   year={2000},   publisher={Nature Publishing Group} }

I want to list a company name in the author field of a bibliographic entry:  @book{CUDA,   author    = {NVIDIA Corporation},   title     = {NVIDIA CUDA Compute Unified Device Architecture Programming Guide},   publisher = {NVIDIA Corporation},   year      = {2007} }   But the entry keeps showing up "N. Corporation".  Is there a way to get the full author name to show up?  I'm currently using the siam BibTEX style.


I want to write a sed (or awk) command to replace a string from one file with the entire contents of another file. Note that second file from which I want to get the content has more than one line. I tried this:  sed -e "s/PLACEHOLDER/$(sed 's:/:\\/:g' TestOutput.txt)/" SQLInput.txt   but got an error saying sed: -e expression #1, char 22: unterminated 's' command

I have a script that reads a text stream and generates a file of sed commands that is later run with sed -f. The generated sed commands are like:  s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g   Assume the script which generates the sed commands is something like:  while read cid fileid do     cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"     echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' >> sedscr done   How can I improve the script to ensure all regex metacharacters in the cid string are escaped and interpolated properly?


Given  $z_1 = 1\;\;$  For $\;\;n \,\in \,\mathbb{Z^+}, \;z_{(n+1)} = \sqrt{1 + z_n}.$  To Do  Prove that $\;\langle z_n\rangle\;$ is convergent and find its limit.  My Work Let $\;t \;=\; \dfrac{1 + \sqrt{5}}{2}.$  $\forall \;x \,\in \,\mathbb{R}, \;$ let $\;f(x) = (1 + x) - x^2.$  Then $\;f^{\prime}(x) = (1 - 2x) \;\Rightarrow\; $ $\forall \;x \,\in \,[1, t), \;f^{\prime}(x) < 0.$  Further, $\;f(1) = 1\;$ and $\;f(t) = 0.$   Therefore, $\;\forall \;x \,\in \,[1, t), \;f(x) > 0 \;\Rightarrow $  $(1 + x) > x^2 \;\Rightarrow\; \sqrt{1 + x} > x.$  Therefore, $\;\forall \;z_n \,\in \,[1, t), \;z_{(n+1)} > z_n.$  Also, $\;x \,\in \,[1, t) \;\Rightarrow\; (1 + x) < (1 + t) = t^2.$  Therefore, $\;x \,\in \,[1, t) \;\Rightarrow\; \sqrt{1 + x} < t.$  Therefore, $\;z_n \,\in \,[1, t) \;\Rightarrow\; z_{(n+1)} < t.$   Consequently, $\;\langle z_n\rangle\;$ is a strictly increasing sequence  that is bounded above by $\;t \;=\; \dfrac{1 + \sqrt{5}}{2}.$  Therefore, $\;\langle z_n\rangle\;$ is convergent.  However  In order to find the limit of $\;\langle z_n\rangle\;$, I must find its least upper bound. I know that $\;t\;$ is an upper bound for $\;\langle z_n\rangle\;$.  I know that $\;\langle z_n\rangle\;$ is strictly increasing in the interval $\;[1, t).$   I suspect that $\;t\;$ is the least upper bound.  But, I am unable to prove that $\;\langle z_n\rangle\;$ does not have  some other upper bound that is slight less than $\;t.\;$  Request Help proving the last link.  Addendum It was suggested that the following link is on point:   If I'm not mistaken, that link focuses on demonstrating that the sequence is bounded and convergent, which is not the issue in my query.

Having trouble with the following exercise in Bartle's Elements of Real Analysis.      Let $a, z_1 \gt 0$. Define $z_{n + 1} = (a + z_n)^{\frac 1 2}$ for $n  \in \Bbb N$. Show that $(z_n)$ converges.   Now the hints section suggests $(z_n)$ is monotone and bounded. I disagree. If you pick $a = 100,00$ and $z_1 = 1$ this is apparent. But I think the sequence is monotone for $n \gt 1$. And I tried the following ugly argument (not even sure if I'm right):    If $z_1 \le (z_1 + a)^{\frac 1 2}$ then $(z_1 + a)^{\frac 1 2} \le \left({(z_1 + a)^{\frac 1 2} + a }\right)^{\frac 1 2} \implies z_2 \le z_3$. If $z_n \le z_{n + 1}$ for $n \gt 1$ then $(z_n + a )^{\frac 1 2} \le (z_{n+ 1} + a )^{\frac 1 2} \implies z_{n + 1} \le z_{n + 2} \implies z_n \le z_{n + 1} \;\; \forall n \in \Bbb N \setminus \{1\}$. So the sequence is monotone increasing. OR we have that $z_1 \gt (z_1 + a)^{\frac 1 2}$ and using pretty much the same argument we can show that the sequence is monotone decreasing. For the second case the bound is $0$.   But I am unable to find a bound when the sequence is monotone increasing.


Looking for the name of a SF or fantasy novel.  I probably read this in the 70's or 80's.  Believe was first published post 1960.  Could be part of a larger series.  My faulty memory keeps trying to tell me the author was a woman - but really not sure...  Basic plot that I can remember:  Two main characters (probably human, or close) involved in some type of quest (which takes place on a planetary surface, most likely utilizing some type of non-advanced, animal-type transportation - horses perhaps).  One character is a woman who has nobility in her background.  The other character is her faithful assistant, a male.  Somehow, I want to say that a major sub-plot involves the woman's gradual realization of the inherent worth and "nobility" of her assistant.  I want to say that the two were never lovers, but I'm not sure...  The novel was quite good, rather long (as I recall), and had quite an impact on me during my younger years.

I am looking for some help remembering this book series I listened to on audiobook many years ago. It was a good story I just for the life of me can't remember the name, author or any of the character names lol I think this is a long shot as I don't remember many details but I really would like to read it again.  Some of the details I do remember: the story is set in a medieval time, not on this planet.  It's told from the viewpoint of a man, I believe he was a soldier. The main character meets him in a war torn world and allows him to travel with her.  The main character is a woman. She is a wanderer and carries a sword that only she can hold. If I remember correctly the magic is too powerful for anyone else to bear and it physically hurts them.  This sword allows her to pass through portals into other worlds. The portals are stationary and they need to travel to them.  There was also something special about her horse.... Ugh.  Each book is set on a different world.I only remember two of the worlds.  One is doomed world. It's land is sinking and towards the end there is a rush to get to the next portal. The book is set in a bog filled environment.  The other world I remember is more lush. Open plains and dense forest. The man is separated from the woman for some time. He stays with tribes-people, elves maybe? When it's time for them to go to the next world the man is torn between staying with his new friends and leaving.  So that's really all I remember. At the time I remember noting after I had read a few of the books that the author never really finished the series.  Any help would be appreciated :) throw me some guesses so I can do some research!


How can get Mac Address(Media Access Control) by Javascript? i use vue.js Or is there another way?

I know that we can get the MAC address of a user via IE (ActiveX objects).  Is there a way to obtain a user's MAC address using JavaScript?


Fellow friends,  I am in a dire need for help. I have gotten myself in a situation where I am expected to take care of small business computer network. Little background: I'm in sales/marketing sector in company, and because I'm on help desk-level of computer knowledge, the boss thinks a can manage the whole setup.  Oh my God. The setup is a mess. There are 10 computers, one ADSL commercial modem, two 5 port switches. All computers are Windows XP workstation with critical business information on all of them, no antivirus, no updates. And the one workstation is named "server".  What can I do to make a setup that will work with stability, to automate cleanup/patch jobs, to understand what is failing and make my life livable. How to plan for remote work, and how to add a layer of security?  Please advise

Through reasons that don't warrant exhaustive discussion, I find myself in charge of 10 servers:   A domain controller-~500 hosts/~350 users IIS web server-This is where we make our money SQL server-The crown jewels Exchange server Linux box for data entry AV server Backup server A few others tossed around   The company where I work believes everybody is replaceable and therefore believes they can pay a minimum wage for any position. The IT manager and Sysadmin quit recently and I think I was the only person who did not take a big step backward when the call went out for volunteers. This also explains why someone with my background is in this position. That is the reality, as much as I wish it otherwise.  What are the things I should be doing to keep those systems running? There is no written procedure left behind and I crammed the A+ and Network+ certs in the last two months but that leaves me with some theory and no practical experience.  I am in the process of teaching myself powershell but from here to there is a long way. I have no scripting or programming experience.  What tasks should I be performing? What practices should I implement?  I understand I am probably hosed but a lifeline to get me through would be helpful.


I have recently installed Edubuntu in my school computer lab computers so that the students can become familiar with the Linux environment. It's going well except I tried to install the Basic 256 application in Edubuntu, but I am facing problems with it.  The terminal commands which I used are shown below:  saint@saint-System-Product-Name:~$ sudo apt install basic256 [sudo] password for saint:  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package basic256 saint@saint-System-Product-Name:~$

How do I get to the Universe Repository in supported versions of Ubuntu?


I've seen multiple system setups where people connected 3 external displays to their macbook pro retina 13". So I bought 2 Mini-Displayport to VGA and 1 HDMI to VGA adapters. The adapters are working fine, full HD resolutions works great but I cann only connect 2 external monitors. I can use 2 monitors via Mini-DP or 1 with HDMI and 1 with Mini-DP but when I connect all 3 one monitor will keep the black screen.   I read somewhere that I should use active Mini-DP to VGA adapters to use all 3 external screens. Do you have some experience with this or have another solution?

The 15" retina can do three (and itself) via daisychaining two Thunderbolts (or just using the two ports) and with the HDMI port. Is the 13" retina able to do this as well?


After finding the first list1[k] > list2[m,0] I want to increase the the value of list2[m,1]. The main thing is that after the first found value and increase of list2[m,1] I dont want to continue the inner for loop. I tried to use break at the end but it didnt work.Any suggestions?    for k in range(0, rang+1):     for m in range(0, len(dir)): # len(dir) is the row number of list2        if list1[k] > list2[m,0]:         list2[m,1] += 1

Given the following code (that doesn't work):  while True:     #snip: print out current state     while True:         ok = get_input("Is this ok? (y/n)")         if ok.lower() == "y": break 2 #this doesn't work :(         if ok.lower() == "n": break     #do more processing with menus and stuff   Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?


Is it too old to start a Physics PhD at 26 ? In average , How many PhD students in physics or mathematics who are older than 25 in their first year ?

Are there any age limits (formal, informal, or guidelines) that schools use when deciding to accept someone into a PhD program? I'm most curious about the upper age limits. For example, will most schools accept someone in their 40's? How about their 50's?


When I run Ubuntu in dual boot will I still be able to use my full 4 GB RAM if I am not running Win 7 at the same time?

I have a dell laptop with 4GB of ram and 500GB of storage.I just finished installing windows 8.1 32bit version, which utilizes 3GB of ram.  Can I install and run Ubuntu to utilize that unusable portion of Ram.Then how?  Thanks in advance


What is the name of the stack overflow service you can buy/rent and set up your own forum?

Is the Stack Exchange engine that powers Stack Overflow available to download or install internally for an enterprise or company?  I think Stack Exchange's engine is very great and could be very cool to use for internal enterprise patterns and practices, like the engine of Wikipedia.


I have a laptop, its configuration is as follows:  Processor: Intel Atom N2600 (1.6 Ghz, 1 MB cache) memory: 1 GB HDD: 320 GB   Which version of Ubuntu is suitable for this PC?

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


The original method calling is like:  public string AskAPI(string uri) {     return api.Query(uri); }   where the api is simply a imported dll reference.  Right now I want to add a time out feature to the AskAPI method, so that if the api.Query takes longer than, say 30 seconds, AskAPI will throw an exception.  Seems I won't be able to get it working. Can anyone share their thoughts about this?  Thanks!

I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout.  TemperamentalClass tc = new TemperamentalClass(); tc.DoSomething();  // normally runs in 30 sec.  Want to error at 1 min   I'm looking for a solution that can elegantly be implemented in many places where my code interacts with temperamental code (that I can't change).  In addition, I would like to have the offending "timed out" code stopped from executing further if possible.


I got Ubuntu this morning, and I'm currently running it alongside Windows 10.  I got steam on Ubuntu, and every time I launch it, it blinks a few times on the side bar and disappears. after that.  Please help, I really want Steam on Ubuntu.

After a botched upgrade from Ubuntu 14.04 to Ubuntu 16.04 I had to wipe my system and start all over. This time I decided to go with a much less CPU intensive desktop environment and installed Lubuntu 16.04-1.  My problem: when I run Steam from the menu shortcut it acts like it is doing nothing. However it does show up in the task manager. If I just type steam in the terminal I get the following.  michael@michael-HP-Pavilion-dm1-Notebook-PC:~$ steam Running Steam on ubuntu 16.04 64-bit STEAM_RUNTIME is enabled automatically grep: symbol lookup error: grep: undefined symbol: pcre_jit_stack_alloc grep: symbol lookup error: grep: undefined symbol: pcre_jit_stack_alloc /bin/bash: /home/michael/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /bin/bash) grep: symbol lookup error: grep: undefined symbol: pcre_jit_stack_alloc awk: /home/michael/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libtinfo.so.5: no version information available (required by /lib/x86_64-linux-gnu/libreadline.so.6) Installing breakpad exception handler for appid(steam)/version(1468023329) libGL error: unable to load driver: r600_dri.so libGL error: driver pointer missing libGL error: failed to load driver: r600 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast   Then nothing happens including steam doesn't show up in the task manager. Now I did find the command.  LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 steam   This does run Steam but it is not a real solution in my eyes. How can I fix it?


I would like to change the default font in Windows 10 that is used by web browsers or websites. I installed some fonts on my system and now websites that use my system default font, like Yahoo Answers, are showing in bold italic Helvetica Neue. This does not seem to be a browser issue as my font has changed on all my browsers. I want it to change back to whatever the standard default was.

I have read the entries for other OS versions.    Changing the MS Shell Dlg (2) entries in FontSubstitues registry key doesn't seem to work (in Windows 10), or it works in two minor places.  I don't have access to a Windows 95/98/etc. machine, the "earliest" I have is Windows 8.1, so I can't use the Plus directory trick either (directory doesn't exist). For the WindowMetrics registry entry, I seem to have all the *Font keys to be set to the font I want, but that doesn't seem to be doing the trick (on Windows 10). For Windows 8/8.1, there was a program called Windows 8 Font Changer, which worked like a charm, but doesn't seem to on Windows 10 (though it was probably that program run that changed the fonts in the WindowMetrics).   Thanks.   Update: One more method that came out that is perhaps still not the solution: Winaero Tweaker (winaero.com), as it has some issues, the biggest two of which seem to be:   If you have changed the size of text etc. from: "Settings –> Display –> Advanced display settings –> Advanced sizing of text and other items –> set a custom scaling level (not recommended)", the changes do not stick upon a logoff-login or restart. You need to have changed it, if at all, only through "Settings –> Display –> Change the size of text, etc." (which goes up to only a certain percentage, depending on the maximum resolution of your device – 125% on a tablet of mine, which I was able to set to 175% or even 200% with the other, older method that is now apparently listed as not recommended).  Even though it lists a number of items to change the font and size of, not everything gets changed. A typical example of this is the right click menu on the desktop, which still shows the View, Sort By, etc. items in the default font, however much it has a clear 'Change menu font' item.


How would I create the model of            The Cinerama Dome is the only concrete geodesic dome in the world. The   theatre is made up of 316 individual hexagonal and pentagonal shapes   in 16 different sizes.   Thanks in advance.

I am trying to build a dome that consists solely of hexagons. They may vary a little in size but should retain their hexagonal shape and should not be squashed at the bottom.  Also, is there a way to make the hexagons a certain size?  Example of the model:   Desired effect (right half):    EDIT:   I found out that what I'm asking for is a mathematical impossibility. The shape I was going for is cald a Icosahedral .  As you can see the mathematical equation for faces by type is:  12 {5} and 10(T − 1) {6}   T = m2 + mn + n2 = (m + n)2  Therefor it cannot exist.  My perception of the desired effect was false as this simply was a 2D tiled image.  What should I do with this question which I can not translate to a correct answer?


I'm am looking for a function similar to mysql_real_escape_string for the SQLSRV library.  Specifically I'm having difficulties escaping single quotation marks. Instead of escaping with a "\" like in mysql you use a single quote in front of the other single quote as the escape method.  I'm working on coming up with a solution of my own using preg_replace but was just wondering if there was something else out there I was missing.

I'm looking for the alternative of mysql_real_escape_string() for SQL Server. Is addslashes() my best option or there is another alternative function that can be used?  An alternative for mysql_error() would also be useful.


I've been playing Clash of Clans perfectly fine up until as recent as last night, when I opened my account it had just started all over again, all my progress was gone.  I cant sign in with the Google account. I was using a blue-stacks on my computer (Windows 7 PC).  How can I recover my account?    Name MARC Level 22 Trophies 871 Clan named CLASHER.PH

I unintentionally and stupidly wiped my Clash of Clans game data. I went to Application Manager on my Android and clicked 'Clear data'. (I used this for fixes before and it never started a new game.)   Now, my level 60 or so base has been wiped as if was to start a new game. Have I doomed myself to starting again or is there a way in which I can retrieve my old game save? Maybe by contacting Supercell? I have a snapshot of my base.


Is there any unix/linux utility that can format (indent) SQL code from stdin to stdout? I wasn't able to find any. I have special logger utility that prints SQL dumps to stdout, but it's hard to read it since it's not formatted.

Does anyone know of a program, a utility, or some programmatic library, preferably for Linux, that takes an unformatted SQL string and pretty prints it?  For example I would like the following  select * from users where name = 'Paul'   be changed to something like this  select *  from users where    name = 'Paul'   The exact formatting is not important. I just need something to take a large SQL string and break it up into something more readable.


HI I wrote the webservice i am updating the field in quote object field based upon the opportuntiy field but it showing an error FATAL_ERROR|System.ListException: Duplicate id in list  Error occur Line------->>>>        qtobj1.StageName = 'Closed Won'; oppitemlist.add(qtobj1); update oppitemlist; // ERROR LINE     global class OrderUpdate {  }  global class Inputcomb{  webservice String tax; webservice String stagename; } global class ResponseClass{   webservice static ResponseClass myMethod3(RequestClass1 req1)    {         map<id,Opportunity> oppitemmap=new map<id,Opportunity>([select Name  from Opportunity  where id In:idlist1]);    if(oppitemmap!=null){           {              if (qtobj1!=null){             qtobj1.Name=icobj1.ordId;            qtobj1.Amount = Decimal.valueOf(icobj1.amt);            String[] str = icobj1.ordcdate.split(' ');           String[] dts = str[0].split('/');           Date myDate = date.newinstance(Integer.valueOf(dts[2]), Integer.valueOf(dts[0]), Integer.valueOf(dts[1]));            qtobj1.CloseDate = myDate;              oppitemlist.add(qtobj1);              } } }     try{   update oppitemlist;   res.resoppId =qtobj1.Id;   res.status = 'Success';   }catch(exception e){    res.status = 'Fail';    }      integer cnt = req1.inputcombList.size(); // to count the total size of the respose array    for(integer i = 0; i< cnt; i++)    {       List<Quote__c>  quotes; // creating the object of quote     quotes = [SELECT Id,Tax__c,Shipping_Cost__c FROM Quote__c WHERE Opportunity__c = :req1.inputcombList[i].oppId]; // selecting the quote details by qoute id    if(quotes.size()>0)    {     quotes[i].Tax__c = Decimal.valueOf(req1.inputcombList[i].tax);// setting the values     //quotes[i].GrandTotal__c = Decimal.valueOf(req1.inputcombList[i].Amt); // setting the values     quotes[i].Shipping_Cost__c = Decimal.valueOf(req1.inputcombList[i].sCost);     quotes[i].StageName__c = req1.inputcombList[i].stagename;     if(req1.inputcombList[i].stagename == 'Ordered')     {       qtobj1.StageName = 'Closed Won';        oppitemlist.add(qtobj1);        update oppitemlist;     }     else     {       qtobj1.StageName = 'Closed Lost';       oppitemlist.add(qtobj1);       update oppitemlist;      }      try{         update quotes; // updating the quote     }catch(exception e){  system.debug('Error : updating tax for quote line items ' + quotes); }  // throwing error message    } }  }  // End Of If Loop  }      return res;           }     }

My service is working fine for single record insert when i send bulk records at that time it showing soapenv:ClientSystem.ListException: Duplicate id in list: 01ti0000002gUP1AAM Class.Sample.behaviourOfWebService: line 235, column 1  the error line is Database.upsert(pList)     p.productCode = pCode;    p.name =pName;    pList.add(p);  }


Suppose $f$ is continuous on $[a,b]$. Show that the functions defined by $m(x)=\inf\{f(y):y\in[a,x]\}$ and $M(x)=\sup\{f(y):y\in[a,x]\}$ are well defined and are also continuous on $[a,b]$  I have already managed to prove that they are well defined, since $f$ is continuous on $[a,b]$ so it is bounded. Therefore for every $x\in[a,b]$, the set $\{f(y):y\in[a,x]\}$ has a supremum and an infimum. To prove that they are continuous on $[a,b]$, I've taken an arbitrary sequence $\{x_n\}$ contained in $[a,b]$ converging to some number $c\in[a,b]$ and am attempting to show that $m(x_n)\rightarrow m(c)$ and $M(x_n)\rightarrow M(c)$, but I'm not quite sure how. Any help would be appreciated, thanks!

I'm working on this problem from Elementary Analysis by Ross which is intuitive when sketched but keeps stymieing me when I try to write it out.  Let $f$ be a continuous function on $[a,b] \subset \mathbb{R}$. Define $f^\star (x)$ as:  $$ f^\star(x) = \sup \{f(y)\mid a \leq y \leq x \} $$ Prove that $f^\star$ is a continuous increasing function on $[a,b]$.  Things I've figured out: (these are mostly trivial)   $f$ is uniformly continuous on $[a,b]$. Since $[a,b]$ is closed and bounded there exists some $c \in [a,b]$ such that $f(c) \geq f(x)\ \forall x \in [a,b]$. (In words: the supremum is actually attained.) If $c \in [a,b]$ is as above, then $f^\star$ is constant (and hence continuous) on $[c,b]$ (which is possibly a singleton).   This seems completely obvious when you actually draw a continuous function but translating that to a formal proof eludes me...


I have a GMF file. Its last 9 lines are to be considered as footer. The fast line of footer Starts with "Footer" and last line Ends with "End of file".  So far I have written this   while ((sCurrentLine = br.readLine()) != null ) {                     if(headcount<11)                     {                         HeaderArray.add(sCurrentLine);                         headcount++;                         System.out.println("Header["+headcount+"]");                         System.out.println("sCurrentLine"+sCurrentLine);                     }                     else if( headcount>10 &&(sCurrentLine.startsWith("Rerate"))) {                                   RecordsArray.add(sCurrentLine);                                 headcount++;                                 System.out.println("Records");                                 System.out.println("Record"+sCurrentLine);                      }                     else if(sCurrentLine.startsWith("Footer"))                     {                                while(footerFlag!="End_of_file:")                             {                                  FooterArray.add(sCurrentLine);                                 footerFlag=br.readLine();                                 sCurrentLine=footerFlag;                                 System.out.println("Footer");                                 System.out.println("Footer"+sCurrentLine);                               }                     }              }   But this code only goes into an infinite loop. I need all 9 lines of footers in FooterArray. Please help.

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 was wondering: when casting multiple spells per turn, does the leveled spell need to be cast first?  The PHB reads:     Bonus Action      A spell cast with a bonus action is especially swift. You must use a bonus action on your turn to cast the spell, provided that you haven’t already taken a bonus action this turn. You can’t cast another spell during the same turn, except for a cantrip with a casting time of 1 action.   The way it sounds is that, if you cast a spell with a casting time of 1 Bonus Action, you can't cast another spell this turn, unless it is a cantrip with a casting time of 1 Action.  But why couldn't I simply cast my cantrip first, and then a spell with casting time of 1 Bonus Action?

When casting a spell as a bonus action, you can't cast another spell on the same turn except a 1-action cantrip - can the order be "reversed"? Can you cast a cantrip first as a bonus action, then any other spell? If not, would it be broken to allow it?  I'm thinking a Sorcerer casting a Quickened true strike, then casting a leveled spell requiring a touch attack. Seems like a great use of the cantrip + Metamagic feature, but it seems like it is not allowed.


Half of my house does not have any electricity even thou nothing has been plugged it to the outlets on that side of the house. What can I do to fix it. Thank You Terro

Last night, my neighborhood had a blackout, but for some reason, only half of the electrical circuits in my house went out. I was under the impression that there was only one main electrical feed going into a house. Can someone please explain how this works?


I need to convert a string with multiple numbers to an array in jQuery. My string is the one below:  var strVal = "901,235,342,421,345,745,544,324,445,123,232,986,345,678";

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


On the "Related" questions sidebar, when the question vote count is greater than 3 chars it breaks the layout.    The vote count clashes with the question subject text. Also, the grey vote count background seems to stop at the 3rd char.    Grey vote count background seems to break due to: #sidebar .answer-votes { width: 20px; }  I changed the votes on the problematic question to 1111 (Firebug) as this seems to be the smallest spaced chars possible for a number > 1000, and it still breaks.    Did someone code this in the early days not expecting >999 votes? :P (Is understandable!)    (Right click and "view image" for larger view)        Link to the page I saw this on:  I'm guessing (hoping) the problematic related question will stay "related" long enough for users to see it.

Just noticed a minor css issue on this question:    The related questions on the right hand side have some overlapping text in Chrome:        (This only applies to this very site, Meta Stack Exchange)


I thought declaring something with "var" made it local to its scope.  Why, then, does this code seem to have not two distinct variables named "len", but just one?  for (var i=0, len=3; i<len; i++) {     for (var j=0, len=1; j<len; j++) {         console.log('i=' + i + ', j=' + j + ', len=' + len);     } }   In the output, instead of three lines, I get only one.  Why?  (True on Chrome and Safari, haven't checked others.)

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


As there are so many ways to create an app bundle-identifier, which or what is the professional or proper way to be considered while naming an bundle-identifier.?  I used to follow this  com.companyname.appname   Is there any better way to do this or it depends.?  Thanks in advance.!

I'm already familiar with the standard Java package naming convention of using a domain name to create a unique package name (i.e. package com.stackoverflow.widgets). However, I've never seen any recommendations for how to choose package names for personal projects. I assume because this is because this is really a matter of personal taste.  So, how do you choose package names for personal projects that will never make it into production (you might be experimenting with a new framework in your spare time). Assuming you don't have a personal website whose domain you can use to create your package structure, what do (or would) you do? Do you have a logical system in place for generating new package names for hobby projects, or do you just use simple throw-away package names like mypackage?  Since I'm just curious to see what different people's thoughts are on this, I've made this a community wiki.  For me personally, I've never given it much thought, but I wanted to play around with  tonight and it occurred to me that I don't have a clear idea of how I want to organize my hobby projects. A separate, distinct package naming convention for hobby projects (in my mind, at least) would serve as a good way to keep personal and work-related code clearly separate from each other.  I was thinking of a simple hierarchal naming convention, to keep the source for my personal projects in a single root folder:   Use myprojects as the root folder  Append the project name  Add any additional subpackage names   So, my Wicket project would be in the package myprojects.learningwicket and unit tests would be in the package myprojects.learningwicket.tests (for example).


I want to declare a self-referential structure as below         typedef struct     {             entry_t *entry;             node_t *next;     }node_t;   instead of as below for a linked-list    struct node   {          entry_t *entry;          struct node *next;   }*head;   does this work in C? If no why not?

How can I have a pointer to the next struct in the definition of this struct:  typedef struct A {   int a;   int b;   A*  next; } A;   this is how I first wrote it but it does not work.


I would like to clarify if I can specify, both the function prototype and the function definition in a header file?   Is it necessary for me to create a source file to define the functions which are declared in a header file?   Thank you...

You can structure a C++ program so that (almost) all the code resides in Header files. It essentially looks like a C# or Java program. However, you do need at least one .cpp file to pull in all the header files when compiling. Now I know some people would absolutely detest this idea. But I haven't found any convincing downsides of doing this. I can list some advantages:  [1] Faster compile times. All header files only get parsed once, because there is only one .cpp file. Also, one header file cannot be included more than once, otherwise you will get a build break. There are other ways of achieving faster compiles when using the alternate approach, but this is so simple.  [2] It avoids circular dependencies, by making them absolutely clear. If ClassA in ClassA.h has a circular dependency on ClassB in ClassB.h, I have to put a forward reference & it sticks out. (Note that this is unlike C# & Java where the compiler automatically resolves circular dependencies. This encourages bad coding practices IMO). Again, you can avoid circular dependencies if your code was in .cpp files, but in a real-world project, .cpp files tend to include random headers until you can't figure out who depends on whom.  Your thoughts?


I have a dual boot system. I mainly work with Linux and rarely with Windows, so I want to set Linux to boot by default without bringing up the GRUB menu, but to bring up the menu if I press SHIFT so I can boot into Windows.  I already hide the grub menu and boot by default with Linux and only shows the GRUB menu when I press SHIFT, but this only works if I disable the Look for other OS option, and as a result of that Windows doesn't appear as an option in the menu, so I can't boot into it!  How can I get the configuration I want?

Recently I decided to use only Ubuntu and there is no Windows in my laptop. When I turn on my laptop the GRUB menu is showing but I don't need to choose OS anymore.   How can I remove or hide this? And after removing this how could I access to recovery mode?


How do we show that  $X^4-10X^2+1$ is reducible modulo every prime $p$?    I've managed to show it for all primes less than 10, for primes greater than 10 we have $X^4+(p-10)X^2+1$. Where do I go from here?

Suppose $K = \mathbb{Q}(\alpha)$ with $\alpha = a + b\sqrt{D_1}+c\sqrt{D_2}+d\sqrt{D_1D_2}$ with $D_1,D_2 \in \mathbb{Z}$. Prove that the minimal polynomial $m_\alpha(x)$ for $\alpha$ over $\mathbb{Q}$ is irreducible of degree 4 over $\mathbb{Q}$ but is reducible modulo every prime $p$. In particular show that the polynomial $x^4 - 10x^2 +1$ is irreducible in $\mathbb{Z}[x]$ but is reducible modulo every prime. [Use the fact that there are no biquadratic extensions over finite fields.]  So far I have established the following:  $[\mathbb{Q}(\alpha):\mathbb{Q}]=\deg(m_\alpha(x))=4$  $Gal(\mathbb{F}_{p^n}/\mathbb{F}_p)$ is cyclic, hence no biquadratic extension (which is iso to $V_4$) exists over finite fields.  I'm having a problem proving the reducibility mod every prime though. Any hints?


i'm trying to install postgresql-10 via the instructions listed here:     I'm trying to run this step and I keep getting the following unmet dependency errors:   $ sudo apt install postgresql-10 Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  postgresql-10 : Depends: postgresql-client-10                  Depends: libgssapi-krb5-2 (>= 1.14+dfsg) but 1.13.2+dfsg-5ubuntu2 is to be installed                  Depends: libicu57 (>= 57.1-1~) but it is not installable                  Depends: libpq5 (>= 9.3~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.   I'm unsure of how to exactly correct these problems, i've tried running sudo apt update && sudo apt upgrade   What is the appropriate way to update these packages to get postgresql-10 installed on my ubuntu 16.04 instance?  EDIT:   when I try manually installing those dependencies:   $ sudo apt install libgssapi-krb5-2 [sudo] password for chris:  Reading package lists... Done Building dependency tree        Reading state information... Done libgssapi-krb5-2 is already the newest version (1.13.2+dfsg-5ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

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


I obtained a list of all IPs in my network with fing (linux package for analyzing networks).  How can I obtain the names of the machines? And maybe could I obtain the OS too?

If I want to find out how the hostname of a remote linux machine on my LAN is, how can I achieve this given I don't have access via SSH etc.?  Probably depends if linux is part of a WINS domain I suppose.


Do functions which, when composed with themselves, are equivalent to the identity function (i.e. functions for which $f(f(x)) = x$ in general) have a name and if so, what is it?  Additionally, am I correct in saying that a such function has a splinter of two, or is it perhaps splinter of size 2 or something else entirely? Or could I say that a such function has an orbit of size 2?

I can think of several examples of functions such that twice application of the function is equivalent to no application of it.   Additive inverse Multiplicative inverse Fourier transform Complex conjugation Any group built up from $\mathbb{Z}_2$, applying (one of) the $\mathbb{Z}_2$ parts' operation.   "Idempotent" came to mind, but that's wrong. It means $f(f(x)) = f(x)$, not $f(f(x))=x$.  What is the word for this "flip-flop" property?


I'm with a really huge problem. I wrote all my thesis using LaTeX, but recently my supervisor ask me for the file for read and make some corrections in .doc or .docx  I don't know how to convert the .tex file in .doc without losing the format, the figure and tables quality, the equations.  Anyone has a suggestion?

Is there any way to produce doc/docx files from LaTeX?


The distance between Town A and Town B is 450km. Guy A travels from Town A to B at the speed of 80km/h; while Guy B travels from Town B to Town A at the speed of 70km/h. When will Guy A and Guy B meet, if both of them started at the same time?  I don't really understand where to start with. Help!

At 10:30 am car $A$ starts from point $A$ towards point $B$ at the speed of $65$ km/hr, at the same time another car left from point $B$ towards point $A$ at the speed of $70$ km/hr, the total distance between two points is $810$ km, at what time does these two cars meet ?  This is what I have tried,     $t_1 = \frac{810}{65} \,$ km/hr $= 12.46 \, $hr    $t_2 = \frac{810}{70} \,$ km/hr $= 11.57\,$ hr     $t_1-t_2 = 0.89 \,$ hr    $t_1-t_2 = 0.89\cdot 60 = 53.4 \,$ minutes   but this couldn't be the answer because how could these two cars could meet after $53.4$ minutes ?


Is it true that for every non-closed field $\mathbb F$ exists a polynomial of degree 2 that is irreducible over $\mathbb F$? This holds for $\mathbb Q, \mathbb R$ but I can't understand if it is always true.

This  shows that if every polynomial of degree 2 and odd degree has a root in $K[X]$, then $K$ is algebraically closed.   I wonder what examples can I find to see that the condition "odd degree" is necessary so that I cannot prove the statement:     Let $K$ be a field, if every polynomial of degree two is reducible   then $K$ is algebraically closed.   This  seems to give a procedure.  If I start with $\mathbb{F}_p$ then I know that adding a root of an irreducible of degree two over $\mathbb{F}_p$ will give me:   $\mathbb{F}_{p^2}$ by Moore's theorem there is only one field of cardinality $p^2$.  Any other root of an irreducible of degree 2 over $\mathbb{F}_p$ must be here .    The problem is that I do not get the roots of irreducible over $\mathbb{F}_{p^2}$ and therefore this process has to be iterated obtaining at the end the union $\cup_{i \ge 1} \mathbb{F}_{p^{2^i}}$. This does not need to be a fieldso that I shoud take the minimal field over it $\langle \cup_{i \ge 1} \mathbb{F}_{p^{2^i}} \rangle$.   In $\cup_{i \ge 1} \mathbb{F}_{p^{2^i}}$, it is clear that there cannot be a root of an irreducible of degree $3$. However, in principle I could find such a root in $\langle \cup_{i \ge 1} \mathbb{F}_{p^{2^i}} \rangle$. Why is it not the case?


I am trying to install Java 8 on Ubuntu. Due to restrictions on download at my work place, I cannot install using apt-get. Hence, I downloaded the archive from Oracle's website, named jdk-8u25-linux-x64.gz. However, when I extracted it, there was only a file inside it, named jdk-8u25-linux-x64. How to install using that file?

I want to install Oracle's JRE and to update to the latest version with the Software Updater when they released. Is there a Ubuntu package that is provided by Canonical or Oracle?  Before release Java 7, I followed  to install Java 6.  But it doesn't work for Java 7. There is no package sun-java7-xxx. How can you install Java 7?


Does anyone know how to separate the numbering and the subsection title? Below 11.10 works fine but here the spacing doesn´t exist... I would like to be like:   11.10. Cryptography  11.11. Physical and environmental security  And so on....     Update: Sorry I have omitted some information. I have use the next lines to add a pdf parts to the table of contentes:  \includepdf[pages={-},addtotoc={%       9,section,2,  Scope,scope_27002,       9,section,2,  Normative references,norm_27002,       9,section,2,  Terms and definitions,terms_27002,       9,section,2,  Structure of this standard,struc_27002,       10,section,2,  Information security policies,5_27002,       12,section,2,  Organization of information security,6_27002,       17,section,2,  Human resource security,7_27002,       21,section,2,  Asset management,8_27002,       27,section,2,  Access control,9_27002,       36,section,2,  Cryptography,10_27002,       39,section,2,  Physical and environmental security,11_27002,       46,section,2,  Operations security,12_27002,       57,section,2,  Communications security,13_27002},% scale=0.7,pagecommand={}]{pdf/iso27002_2013.pdf}   So when I use addtotoc the spacing doesn't fit well, I have tried what you wrote before, but it didn't work :(  Is there any solution??

I'm preparing a document using the book class. In the table of contents, the space between the subsection number and title is too wide. How to reduce it?


In my campus i am using a power supply unit, in order to supply 5V and 0.02A, to my analog circuit that interacts with a microcontroller.  I am unable to go to the university because of work, and i want to take the circuit and the microcontroller to my house for programming work.  It's easy to carry the circuit that resides in a breadboard and the microcontroller, but i cannot take the big power supply.  So i want to provide 5V and 0.02 amps to the circuit.  I have never worked with power supplies before.  From a multi transformer i have in my house, i can get the voltage right. Heck, even USB proved 5V. I could solder some wires and provide supply to my circuit from the USB cable.  What i don't know is the amps. How will i be able to provide 0.02A to the circut?  Can i buy smoe power supply wit hthis value, or eevn varying amperes? Can i create a circuit that will amke sure i am supplying 0.02A?

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


I got the above error message (started happening ~21:00 UTC, still happening at 21:37). , so I'm not sure what this could be...

The search results on  are blocked because of:     [blocked] The page at  ran   insecure content from .   I am using Chrome.


person in distress here.  Dont ask me how, but I ended up deleting all my 12,000 inbox emails from Gmail into Trash and then erased my Trash as well. Gmail gave me a warning box and took 20 seconds to delete. This was not what I intended. I have searched high and low to check if there is any way of recovering my 10 years worth of emails and could not find any.  Any one here know of a way, ANY WAY, to recover my accidental permanent deletion of all my 10 years worth of email (deleted from Trash as well)?

Is it possible to recover an email that has been clicked on "delete forever" in the trash folder? I have accidentally clicked delete forever for an email but now I need to recover it.


I am using the Latex interpreter for the figures, which I create and save as a .eps-file in matlab. The problem is that I want to change some names of the labels of the axis in these .eps files and I don't have any more the original .fig file or my original matlab-code/-data from which I have created these .eps-files. If I open the .eps files with Inkscape, it doesn't recognize the font of the x- and y-labels and the legend. It just recognize the numbers on the x- and y-tick. Is there any way to recognize the fonts in the .eps-file and change the names of the labels?  The problem is that the .eps doesn't seem to have any font Information of the y- and x-labels. If I want to edit them in Inkscape, they are just objects with nodes:    Thank you very much.

I would like to have a vector graphic with the font I'm using for my captions in my PDF file.  I normally create my graphics in DIA and save them as .eps files. In my .tex file I use following  \usepackage{ifpdf} \usepackage{graphicx, epstopdf} \ifpdf   \DeclareGraphicsExtensions{.pdf,.jpg,.png} \else   \DeclareGraphicsExtensions{.eps} \fi   and  \includegraphics[width=\linewidth]{my_image.eps}   to include images (and auto generate PDF files).  I'm using Windows 7 (64-bit), miktex 2.9 and pdflatex


I have downloaded the latest version of ubuntu Desktop 14.04.1 LTS. The gcc version is gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2. I would like to change it to the 4.7.2 20130108 [gcc-4_7-branch revision 195012].  I will be very thankful if you could please help me through it.

So I have installed gcc-4.4 and gcc-4.3 (same for g++). Now as far as I remember there is a tool in Ubuntu which sets the symlinks for you if you just tell it which version you want. However it does not seem to work in the newest version, which I find disappointing.  root@nexus:~# update-alternatives --config gcc update-alternatives: error: no alternatives for gcc. root@nexus:~# update-alternatives --config cc There is only one alternative in link group cc: /usr/bin/gcc Nothing to configure.   root@nexus:~# dpkg -l | grep gcc | awk '{print $2}' gcc gcc-4.3 gcc-4.3-base gcc-4.3-multilib gcc-4.4 gcc-4.4-base gcc-4.4-multilib gcc-4.5-base gcc-multilib lib32gcc1 libgcc1   Any ideas?


I'm talking about , which are very useful while posting comments. We frequently use [tour] , [help], [ask], [ans] etc. while introducing new users about How Stack Exchange works. On Hinduism Stack Exchange, we educate new users about our . Though we have also  a link to that page in the new answer pop-up, we still frequently need to refer new users to the . So, can we (Hinduism Stack Exchange) have a [guidelines] magic link  pointing to ? Another example is [faq] referring the  instead of referring to the already having [tour] magic link. More generally, can a community have its own magic links? Presently by this question, I'm thinking of having internal magic links within the community or SE network unlike  that introduces or lists most of the external links.

I would like site specific magic links. Currently you can write [so] in a comment, and it links like this: . I would like to be able to have site specific ones, so for example: English Language & Usage  [dictionary] would go to http://dictionary.com and shows as   Ubuntu  [launchpad] would go to https://launchpad.net/ubuntu and shows as   [launchpad#bugnum] would go to https://bugs.launchpad.net/bugs/bugnum and shows as   [forums] would go to http://ubuntuforums.org/ and sows as   [discourse] would go to http://discourse.ubuntu.com and shows as   [paste] or [pastebinit] would go to http://paste.ubuntu.com and shows as   [install-d] would go to http://ubuntu.com/download/desktop/install-ubuntu-desktop and shows as   [install-s] would go to http://ubuntu.com/download/server/install-ubuntu-server and shows as   ppa:peterlevi/ppa would go to https://launchpad.net/~peterlevi and shows as   There is    Ask Different  [applesup] would go to http://www.apple.com/support and shows as   Christianity  [bible] would go to http://biblegateway.com and shows as   Currently, they are all the same, for all sites. I would like devs (mods maybe) to be able to add them on a per site basis. This is just a selection of examples. People can comment or answer with ones they would like and I'll edit them into this question. I asked this because  on Ask Ubuntu Meta wasn't possible right now - because it wasn't a feature.  [The devs] said right now it isn't possible because magic links are network wide, and they weren't sure it was high enough priority to really get done anytime soon, but if you want you can post a feature-request on Meta Stack Exchange requesting site specific magic links and see if you can garner more support for the feature and maybe get a dev to champion it.  So that's what I've done!


We can declare thread in class using two ways   extends Thread class implements Runnable interface   so which scenario is the best way?

From what time I've spent with threads in Java, I've found these two ways to write threads:  With implements Runnable:  public class MyRunnable implements Runnable {     public void run() {         //Code     } } //Started with a "new Thread(new MyRunnable()).start()" call   Or, with extends Thread:  public class MyThread extends Thread {     public MyThread() {         super("MyThread");     }     public void run() {         //Code     } } //Started with a "new MyThread().start()" call   Is there any significant difference in these two blocks of code ?


I have a class like this.  public class Event {  public Event(String objectName, Integer moduleId, Integer actionId) {    if (StringUtils.nullOrEmpty(objectName)) {      throw new IllegalArgumentException("The objectName field is not supplied");   }   if (0 > moduleId || null == moduleId) {      throw new IllegalArgumentException("The moduleId field is invalid");   }   if (0 > actionId || null == actionId) {      throw new IllegalArgumentException("The actionId field is invalid");   }    objectName = objectName;   moduleId = moduleId;   actionId = actionId;  } }   When I test the null value for moduleId and actionId I got the null pointer exception. But it's fine for the objectName. Did I do something wrong?

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


I have a large number of data. If i have to represent the data by the central tendency, which one i have to use, mean or median? The value of standard deviation is so huge too. Thanks.

If you look at       Or this Wikipedia page      Clearly  seems to be the statistic of choice when it comes to ages.  I am not able to explain to myself why  would be a worse statistic. Why is it so?  Originally posted  because I did not know this site existed.


I want to catch the output between 2 different patterns, for example :  sed -n '/^pattern1/,/^pattern2/p;/^pattern2/q'    But I want to catch the output without the patterns in cause.  I know that grep -Ev will help me, but I wonder how it's done with sed.

I'm going to submit form using cURL, where some of the contents is come from other file, selected using sed  If param1 is line matching pattern from other file using sed, below command will works fine:  curl -d param1="$(sed -n '/matchpattern/p' file.txt)" -d param2=value2 http://example.com/submit   Now, go to the problem. I want show only text between 2 matching pattern excluding the matching pattern itself.  Lets say file.txt contains:  Bla bla bla firstmatch It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. secondmatch The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.   Currently, lots of "beetween 2 matching pattern" sed command won't remove firstmatch and secondmatch.  I want the result to become:  It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.


I am trying to find out if increasing current increases the brightness of an LED. I'm pretty sure this is the case now that I have looked into semiconductor band theory physics and p-n junctions. However, I still don't understand how I can calculate the current through an LED if I have been given the brightness and vice versa. I'm also not sure if I understand exactly why the brightness increases with an increase in current (if it does), but this is probably too big of an ask for someone to explain.

When I was young and learning about electricity, a fabulous tool for understanding voltage/current/resistance was an incandescent lightbulb (in my case it was a small 3V bulb). When you doubled the voltage by putting two batteries in series, it glowed 4x as bright, but heated up more and was more prone to burning out. When you put two lightbulbs in series, they glowed 1/4 as bright. When you put them in parallel, they glowed normally, but drained the battery twice as fast. Etc.  This day and age however incandescent bulbs are on the way out, and LEDs are replacing them for a good reason (like not burning out every few months or so). But LEDs are different and follow different rules, which I don't understand myself very well.  I was wondering - can LEDs be used in the same way? I know that for a LED to be usable in a similar way as a classical lightbulb, you need to put it in series with a resistor, otherwise it draws too much current and burns out. I think you can even buy LEDs with built-in resistors. But would they work in the same fashion? Would changes in voltage be accompanied with corresponding changes in brightness?


I need to delete a "~" folder in my home directory.  I realize now that rm -R ~ is a bad choice.  Can I safely use rm -R "~"?

So, Im working in a UNIX environment and I noticed that inside my working directory, which is miles miles away from my UNIX home, there is a ~.  Now, once in the past, I did rm -rf ~ from my working directory and ended up erasing my home directory completely and had to involve IT.  I do not want to do it again. At the same time, I want to know   Why is ~ created in my working directory? Is it a faulty finger slip while saving (:w! but what happens is :w~ ?!!) Before checking in, there is a script that looks for extra files or folders that p4 is not aware so def this ~ might cause an issue. So how can I remove the ~ from my working directory and at the same time not erase my home?   I do have a backup command called del that I use instead of rm -rf. It just places stuff in a temporary location. I could use that and get rid of the ~. But I'm more interested in knowing why this happens, and how I can remove it?


I want to merge the nurbs sphere with a cylinder as shown in the image below. I am a bit new to blender and very unsure how to go about doing it. The way I learnt to merge two objects is with ctrl + j but this does not work in this case.

HELP! I need to know how to join Bezier curves to a mesh. I am trying to make a car with curved rims and the easiest way was to use a Bezier curve and then to bevel it but I need to join it all together in order to put it in my mod.


Statement. Suppose we have a square matrix $A$ of order $n$ over a field $\mathbb{F}$ of characteristics $0$ or $p>n$. There is a theorem that if $\mathrm{tr}\,A^k=0$ for all $k=1,\ldots, n$, then $A$ is nilpotent and $A^n = 0$. The problem is to prove it.  What I did so far.   Let's consider characteristic polynomial $\chi(x)$ of our matrix $A$. The Newton identities relate $\mathrm{tr}\,A^k$ to the coefficients of $\chi(x)$: $$ s_k = \mathrm{tr}\,A^k $$ Since $\mathrm{tr}\,A^k=0$ for all $k=1,\ldots, n$, then $\chi(x) = x^n$ and (since we a over a field) all roots of $\chi$ are $0$. Therefor the only eigenvalue for $A$ is 0.   Now I have trouble proving first item and going from second to $A^n = 0$, How do I do those things?

$\DeclareMathOperator{\tr}{tr}$Let's consider a $n \times n$ matrix and the sequence of traces $\tr(A)=\tr(A^{2})= \ldots = \tr(A^{n})=0$. How to prove that $A$ is a nilpotent matrix (a matrix so that $A^{k} \times u = 0$ for all $u \in V$ and for some $k$)?  Maybe it would be reasonable to consider $A$'s Jordan form (we assume that the action occurs over an algebraically closed field, such as $\mathbb{C}$). For example, suppose that we have found it and $A'$ consists of $m$ blocks of sizes $r_{1}, \ldots r_{m}$ ($r_{1}+r_{2}+\ldots+r_{m}=m, r_{i} \in \mathbb{Z}_{+}$) with $\alpha_{1}, \ldots \alpha_{m}$ as corresponding eigenvalues to each of the blocks. Then, according to the problem will get the system  $$\begin{align} r_{1}\alpha_{1}+&\ldots+r_{m}\alpha_{m}=0 \\ r_{1}{\alpha_{1}}^{2}+&\ldots+r_{m} {\alpha_{m}} ^{2}=0\\ &\ ~\,\vdots \\ r_{1}{\alpha_{1}}^{n}+&\ldots +r_{m}{\alpha_{m}}^{n}=0  \end{align}$$  But the system's analysis over $\mathbb{C}$ seems to be too much complicated.  Actually, the problem must have more or less simple solution.  Any piece of advice would be much appreciated.


I have a problem related to regex in c++. I want to create a regex pattern like that regex special("[~`!@#$%^&()-_+={}[]|/:;"'<>,.?]"), for special characters, i would like to count how many of them are in a string. The problem is i don't know how to get rid of special meaning they have, so that regex_search can just search for chars that they are. I found an information that: \char Forces \char to be accepted as char (that is, ignoring any special meaning of char). But when i added \ before every character it was an error still.

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


Let A and B infinite sets and |A|<=|B|. Is that equivalent to |P(A)|<=|P(B)| in ZF? P denotes the powerset. I think it is equivalent, but I dont know exactly how to prove it.

Is it generally true that if $|P(A)|=|P(B)|$ then $|A|=|B|$?  Why? Thanks.


For example: Brandon's house instead Brandon house. How is that rule named, I'm trying to improve my English.

My best friend of the moment - 'Essential Grammar in Use' for elementary students by Raymond Murphy - says that 'we normally use -'s for people.'     I stayed at my sister's house. (not the house of my sister).   Then, bellow in the same unit (64) says that 'we use of... for things, places, etc.'     Look at the roof of that building. (not that building's roof)   After that I thought:  Finally!!! I understand the rules for apostrophes!!!  But soon I lost all that naif excitement when I saw other written examples on the internet that were not following those 'rules'.     I've learnt that we can apply apostrophes to ...     one year's pay   and, finally, amazingly enough ... to , which means ANY kind of nouns (I deduce uncountable nouns are also part of the possibilities). This demolishes what is said in the grammar. So, it seems that eventually:     That building's roof -> is valid   So, now I need your help.    1) Can you tell me the rules concerning the apostrophe to show possession in respect to its usage with nouns? Can we really apply to all kind of nouns? e.g. teeth's, vehicle's, Paula's, forest's, manager's, Ireland's, etc     Scotland's worst drivers   Metadata improves information's accessibility       2) Is there a sense that justifies what is written in the grammar: 'we normally use -'s for people'? or it does not make sense at all?


I have a situation where i need to parse multiple n number of related fields (Do not want to evaluate):      string exp1 = "10";     string exp2 = "20";     string exp3= "exp1 + exp2 + 30";     string exp4 = "exp5 - exp3";      string exp5 = "exp3 / 10";      Dictionary<string,string> expressions = new Dictionary<string,string>();     expressions.Add("exp1", exp1);     expressions.Add("exp2", exp2);     expressions.Add("exp3", exp3);     expressions.Add("exp4", exp3);     expressions.Add("exp5", exp5);   Now we want to loop through all the expression fields and parse the expression with the actual values (Bodmas should also be applied) .So, after parsing, We want below as output:  exp1 = "10"; exp2 = "20"; exp3= "10 + 20 + 30"; exp4 = "((10 + 20 + 30 )/10) - (10+ 20 + 30)"; exp5 = "(10 + 29 + 30)/ 10";   What would be the data structure I should use here to parse it using a generic way? Would it be Binary Tree, graphs, ExpressionTrees?

If I have a string with a valid math expression such as:  String s = "1 + 2 * 7";   Is there a built in library/function in .NET that will parse and evaluate that expression for me and return the result? In this case 15.


How do I solve $$3\sin t=18(1-\sin ^2t)$$  Because, $$3\sin t=18(1-\sin ^2t)$$ is like quadratic, but using ABC I get not special angles.

This is trigonometry from double angles and compound angles. Thus far I've simplified it up to this point. $$2 \sin^2θ – 3\sinθ +1 = 0$$  I'm trying to factorize this to solve for General Solution. I tried taking out a common but that +1 is giving me a problem. I used the quadratic equation to get 1 and 0.5 as an answer, but i don't know how to write it in terms of 2sin(squared)θ and -3sinθ.  Any help will be appreciated.


I am reluctant to turn off my computer now because I have a specific set of windows  (not web tabs) open that I would rather not close. Instead I keep hibernating. I would like  to be able to turn of my Windows 7 computer and have all the work I had open formerly open  again. Is this possible?

When working on a project, I generally have a couple of Explorer windows open to relevant folders and a couple of applications (e.g. Eclipse and a form development tool) open to specific project-related documents.  There's a lot of value in that context, and I'd like to find a way to save a set of open apps under a project name, then restore that state at a later date.    Thus far all of the utilities I've found are virtual desktop products that don't save/restore state.  I'm specifically looking for something that will run the applications I had running, open the documents I had open, and position the windows as they were.  I'm amazed that such a seemingly simple concept as "Save my workspace state" doesn't seem to be available.  I'm on Windows 7.  Any suggestions?


I am working on the following problem from group theory:     If $G$ is a group of order $2n$, show that the number of elements of $G$ of order $2$ is odd.   That is, for some integer $k$, there are $2k+1$ elements $a$ such that $a \in G,\;\; a*a = e$, where $e$ is the identity element of $G$.

Let $ (G,\ast)$ be a group with identity $e$ and cardinality $2n$ for some $n\in\omega$. Then, does there exist $x\in G$ such that $x\ast x=e$ and $x\neq e$?


Let $A$ be a square matrix. Another square matrix $B$ is called inverse of $A$ if $$AB=BA=I.$$ My question is whether just $AB=I$ or $BA=I$ is not sufficient to call $B$ as the inverse of $A$? If it is not, then give a counter example where $AB=I$, but $AB\ne BA.$

If $A$ and $B$ are square matrices such that $AB = I$, where $I$ is the identity matrix, show that $BA = I$.    I do not understand anything more than the following.   Elementary row operations. Linear dependence. Row reduced forms and their relations with the original matrix.   If the entries of the matrix are not from a mathematical structure which supports commutativity, what can we say about this problem?  P.S.: Please avoid using the transpose and/or inverse of a matrix.


$$\lim\limits_{n\to \infty} \int\limits_0^1{e^{\{nx\}}\cdot x^{2016}dx} = \text{ } ? $$   $\{nx\}$ - Fractional Part Number. Example: $\{-2/3\}=\{4/3\}=1/3$  My solve: $$\lim\limits_{n\to \infty} \frac{1}{n^{2017}}\int\limits_0^n{e^{\{t\}}\cdot t^{2016}dt} , t=nx$$  Please give me a clue what to do next

Can anyone help to compute this limit, please? $\{nx\}$ denotes the fractional part of $nx$.  Tried to replace $nx$ by another variable and write an entire integral as a sum of integrals: $$\sum\limits_{i=0}^{n-1}\int\limits_{i}^{i+1} $$ but it seems not to work out.


I am trying to export images with legible town name sizes but they keep shrinking to an unreadable size when I export them. I have tried a few solutions based on similar questions but to no avail.  I am using QGIS version 2.18.9 and a number of different map sources (OSM, SIX, Google, Bing).

I'm having trouble with the OpenLayers Plugin of Qgis and the map composer:  If I create an OSM-background layer and if I want to export this, the OSM-Layer looks perfectly all right in the normal qgis program window. But in the map composer and after export the layer has shifted relatively to my other shape layers (EPSG:32633 - WGS 84 / UTM zone 33N).  The second thing is that the output resolution of the exported osm-layer is very, very poor.   A really bad way of getting around this whole trouble would be to increase the screen resolution and make a screenshot of the map composition window of qgis. But I don't think this would be very professional. It also would cause a lot of pain :)   I'm using Qgis 1.8.0-Lisboa under Linux. The openlayers plugin is version 0.92.


Example:  $query = $connection->query("SELECT `password` FROM `users` WHERE `userID` = ".$_SESSION['user'].";") or die("error in the query"); if (mysql_num_rows($query) < 1) {     die("Error: no such user"); } while ($row = $query->fetch_assoc()) {     if ($row['password'] != $_SESSION['pass']) {         die("Error: incorrect password");     } }   The above code is my only protection in a PHP script. Is there anything else that can make it more secure? I know that the $_SESSION array can not be changed on the client side. So in my opinion it should be enough. The session is controlled by WordPress.

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?


how can i prove that?  Prove that if $gcd(a, b)=d$, then $gcd(a^2, b^2 )=d^2$

Let $a$ and $b$ be two integers. Show that $\gcd(a^2, b^2) = \gcd(a,b)^2$.   This is what I have done so far:  Let $d = \gcd(a,b)$. Then $d=ax+by$ for some $x,y$. Then $d^2 =(ax+by)^2 = a^2x^2 + 2axby+b^2y^2$.  I am trying to create a linear combination of $a^2$ and $b^2$ but do not know what to do with the middle term.  EDIT: I would be interested in seeing a proof using the Fundamental Theorem of Arithmetic as well. I simply thought it would be easiest to use Bezout's Identity.


I have Ubuntu 12.10 on my system and I want to install Windows 7. I tried it but Ubuntu was not found on the system anymore so I had to install Grub. When I installed the Grub menu on Ubuntu, Windows created a hard disk in NTFS file but when I rebooted, Windows didn't show up. I deleted all the Windows files. Now I want to re-install Windows 7 once again but I don't really know how to do that.

I have installed Ubuntu 12.10 on my laptop, but would like to install windows for the purpose of gaming (Hallelujah). But I haven't left any unpartitioned parts of the HDD so now I am stuck on (How to remove one partition from ubuntu and use it to install win7 in a safe way?) I do not want to reinstall everything all over again, but definitely want to play games on my laptop.  I do not want alternatives with Wine or PlayOnLinux, cuz I have runned a few games and they were all buggy, I want dual-boot.  fdisk -l output:  **Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xe2cf4679     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048     2000895      999424   83  Linux /dev/sda2         2002942  1465147391   731572225    5  Extended Partition 2 does not start on physical sector boundary. /dev/sda5         2002944     4001791      999424   82  Linux swap / Solaris /dev/sda6         4003840     6002687      999424   82  Linux swap / Solaris /dev/sda7         6004736   406003711   199999488   83  Linux /dev/sda8       406005760   606003199    99998720   83  Linux /dev/sda9       606005248   706002943    49998848   83  Linux /dev/sda10      706004992   879212543    86603776   83  Linux /dev/sda11      879214592  1035462655    78124032   83  Linux /dev/sda12     1035464704  1075462143    19998720   83  Linux /dev/sda13     1075464192  1115461631    19998720   83  Linux /dev/sda14     1115463680  1269835775    77186048   83  Linux /dev/sda15     1269837824  1465147391    97654784   83  Linux**


My friends and I are interested in the DMZ, and we are looking to spend a day trip there. I understand that there are Saturday tours, but there aren't a lot of details around regarding that.  How can we take a day tour to the North Korea DMZ?

I am planning to visit the Korean Demilitarized Zone while staying in Seoul and would like to get tour options. Anyone has done this?  Prices, schedule and tips are most welcome.


I have already submitted the PhD thesis for examination. I have started to email potential supervisors yesterday to get information regarding postdoctoral positions in their departments. I am wondering whether it is possible to start postdoctorate while waiting for PhD viva.

I am in a situation where my PhD funding runs out in 5 months and I need to have secured a job regardless of whether I have submitted due to having a family.   Although I think I may be close to submitting by then, it may take longer. Is it worth applying for postdoc positions or would universities not consider you until you have completed the PhD? I assume that the pass rates of PhDs are very high if the candidate has got to the submission stage.   Edit: This question is aimed at the people that are are the submission stage but haven't yet defended their thesis. It is not a question asking if I can get a post-doc without a PhD.


I am new to android programming and am trying to draw a circle on the screen. Eventually I'd like to have the circle move around. But for now I have been having trouble getting the circle to draw. When I run the code, it gives me an error:      "Attempt to invoke virtual method 'long   android.graphics.Paint.getNativeInstance()' on a null"   My Code:   package com...  import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View;  public class MainActivity extends AppCompatActivity {      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(new MyView(this));     }      class MyView extends View {        private Bitmap b;         public Paint p;          public MyView(Context context) {             super(context);             Paint p = new Paint();             p.setColor(Color.GREEN);             b = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);         }          @Override         protected void onDraw(Canvas canvas) {             canvas.drawCircle(50, 50, 10, p);         }     } }

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?


$n$ children are placed in a row from north to south such that all of them look at north; i.e., every child does only see the children before him. After being placed in the row, they aren't allow to move or communicate in any form possible. Every child will have a random bobble hat marked with a color in $0, \dots, k$, with $k \leq n - 1$ on his head. Noone knows which color its hat has, and noone is allowed to look after. After all children have their hats, they shall say which color his hat has. They are only allowed to say "color $i$". If more than one child will say the wrong color, no one gets a present. What is the winning strategy for the children?  I think it could have something to do with the . Otherwise, I can only imagine to speak rhythmically to encode the number of combination, but that seems not to be intended.

There is a common problem in which a long line of N mathematicians are each given a hat that is either red or blue.  They cannot see their own hat but can see all in front of time and can hear any response. They must state their own hat color from the back of the line forwards and no information may be passed besides their guess.  They may have a planning session in advance.  What is the maximum number of correct guesses can they guarantee?  The answer is (look away if you don't know) $N-1$.  If, instead of 2 colored hats, we use $c$ different colored hats, how many can we guarantee?  Assuming $N>>c$  I believe the answer to be $N-c+1$ and have confirmed this for $c=2, 3$, and $4$.  I believe this should be simple to prove by using the concept of "$x$ formulas allow you to solve for $x$ variables" but I am not well versed enough in pure mathematics to answer this.