Why do graph degree sequences always have at least one number repeated?    $(1, 2, 2, 3)$ = Valid, as you can see, because the $2$ is repeated. $(1, 2, 3)$ = Not possible to construct a graph with because all numbers are unique.    I know that the graph degree sum must be even, but in this case, both are even.  Our professor said it had to do with Combinatorics, but we never touched that topic.  EDIT: Loops are not allowed.


Possible trivial counterexample to exam question

So doing an exam question for set theory this was the question:  Let X be a set. Prove there is no injection $f : P(X) → X.$  Would X being an empty set be a counter example because in this case the powerset is a set of a single element $\{\}$ hence it is mapped to a null element.   However would this be the case that $f$ would not be a function, since there isn't $(a,b)\in f$ hence $f$ isn't defined for the whole of the domain hence $f$ is not a function.  So yes I understand that this isn't a proof for this problem but while thinking about the problem I was trying some examples and non-examples and couldn't work out why this failed until I actually put it into words.  Sorry for a convoluted question, I don't really have the correct notation to explain myself.


How to program an ARM microcontroller using JTAG?

The JTAG interface is pretty new to me. I know most of nowadays ARM mcu's are programmed via JTAG. However what programming cable is usually used? I found this one, and I've seen some people use it in the past:   But it is not sold anymore. What are other alternatives? Is it sufficient to connect the TCK, TMS, TDI and TDO of the mcu to the TCK, TMS, TDI and TDO of the programming cable, via a boxheader or so, in order to program it or is additional circuitry necessary?  I've heard there is something as SWD as well, but that's only for debugging not programming if I understand it correctly.  I am working with this mcu: cortex M4 TM4C1294NCPDT


I am getting this while trying to compile literally my first document  This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=latex)  restricted \write18 enabled. entering extended mode (./t1.tex LaTeX2e <2015/01/01> Babel <3.9l> and hyphenation patterns for 79 languages loaded. (/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo)) (./t1.aux) ! Undefined control sequence. l.6 \latex  ?


If $K_6$ has its edges coloured using $2$ coulours, it contains two monochromatic triangles

NOTE: I am looking for a probabilistic solution only. For a non-probabilistic solution, see .     Show that if the edges of $K_6$ are coloured using two colours, then it contains two monochromatic triangles.   We first define the random variable $X$. Given any colouring of $K_6$, $$X=\text{number of monochromatic triangles for that colouring}$$  Now, we number the vertices of the  graph with numbers from $1$ through $6$. We define $$X_{i,j,k} = \begin{cases}   1, & \text{if i, j, k form a monochromatic triangle}  \\   0, & \text{otherwise}. \end{cases}$$  It is easy to see that $X=\sum X_{i,j,k}$. Now, by linearity of expectation, $$\mathbb E[X]=\sum \mathbb E[X_{i,j,k}]$$  Since there are $\binom63=20$ triangles, the sum on the right side has exactly $20$ terms. By symmetry, we can say that $\mathbb E[X_{i,j,k}]=\mathbb E[X_{a,b,c}]$. Hence, $$\mathbb E[X]=20 \mathbb E[X_{1,2,3}]$$  Now note that the triangle formed using $1,2,3$ can form $2$ monochromatic triangles (one of them blue, the other red), and the remaining $15-3=12$ edges can be coloured in $2^{12}$ ways. Hence there are $2^{13}$ edge-colourings where $1,2,3$ form a monochromatic triangle. The total number of edge-colourings is $2^{15}$, and so $\mathbb E[X_{1,2,3}]=\dfrac{2^{13}}{2^{15}}=\dfrac14$. Thus $$\mathbb E[X]=20 \mathbb E[X_{1,2,3}]=20\cdot \dfrac14=5$$  But this is clearly incorrect. There can't always be $5$ monochromatic triangles. So what am I doing wrong?  Thanks in advance.


There are $101$ positive integers that sum to $300$. Can we find a subset of these integers that sums to $100$?

We are given a set of $101$ positive integers that sum to $300$.  Since summation of $101$ distinct numbers cannot be $300$, repetition among the $101$ positive integers exists.  Can we choose a group of numbers from the $101$ positive integers such that the sum of the elements in the group is $100$?  If not, please tell me a counter-example.


I can't edit others incomplete questions?

Previously I was able to edit others question. But last time I edited an question. but that was not accepted. Now when I see the question edit button inactive, how can I enable it again?  Please help me.


Is there a way to see HDD average response rate like on windows?

this is my first time writing in here. so, sorry if i did something wrong. so here's my question, Is there a way to see HDD response rate(in ms) and Disk active rate like on windows 10? Im using Kubuntu 20.10.


Is there a way to compute accurately a float power to base 2 in Python?

I used log to obtain the exponent base 2 to a very large number and I want to be able to retrieve the number back by reversing the function (2**x). However math.pow(2,x) is truncating the answer drastically. Note that x is a very large power in the range of 100000.00000001. The original number has to be retrieved in full.


I developed a question for a Mock test by modifying .     There are 100 students. 85 chosen Math, 80 chosen Physics, 75 Chosen Chemistry, 70 chosen Biology. What is the minimum number of students choosing all 4 subjects? Assume each student chosen at least one subject.      (A) 15   (B) 10   (C) 5   (D) Data is insufficient     And I provided the following explanation:      Let A,B,C,D ⊂ {1,2,…,100} be the four sets, with |A| = 85, |B| = 80, |C| = 75, |D| = 70. Then we want the minimum size of (A∩B∩C∩D). Combining the fact that      |A∩B∩C∩D| = 100 − |A’∪B’∪C’∪D’|      where A’ refers to A complement, along with the fact that for any sets |X∪Y|≤|Y|+|X| we see that   |A∩B∩C∩D| ≥ 100 − |A’|−|B’|−|C’|−|D’| = 10.      So, option (B) is correct.     I am pretty sure that explanation is correct. We can subtract the complement of these set from universal set, and remaining quantity would be answer because that is common.  But, my friends are arguing that this explanation is not correct as well as question is not correct. I tried to tell them this is correct explanation as my level of knowledge.      Could you please provide an alternative explanation(s) for this question?   One of my friends is arguing that option (D) Data is insufficient is the correct option.  Thanks in advance.


How can I add images taken from my device (an Android phone) to my questions on Stack Exchange? Whenever I try to upload one it says image_mime_type must be set. I haven't learned JS, so I don't understand this error. Please tell me what I can do.


Is there any Stack Exchange site about book recommendations, reviews, feedbacks, etc.?

I am looking for this, but cannot find yet. Do we have any Stack Exchange site which serves the purpose of book recommendations, reviews, analysis, feedbacks, etc.? This would have been great, as people could discuss, or give a heads up, or just leave a good overview/feedback on a particular book that another might find interesting. I think I do not do bad if I ask this here; however, if this questions is not supposed to be here, kindly let me know.


When I originally installed Ubuntu, I opted to have my hard drive encrypted, which is fine, but all of a sudden I can't seem to type my password.  After the third or fourth attempt I am finally able to type in my password correctly and then progress to the login, which then I have to type in the same password (three or four more times)...  Is it possible to change the encryption password?


When is the violation of OpenID 11.5.2 going to be fixed?

The Open ID spec requires that relying parties differentiate between HTTP and HTTPS URLs:     11.5.2. HTTP and HTTPS URL Identifiers      Relying Parties MUST differentiate between URL Identifiers that have different schemes.   But StackExchange (et al) strips the URL provided down to the base domain, dropping the scheme, thereby allowing either HTTP or HTTPS to be used. This leaves the user open to MITM attack, with no recourse, per  as noted by .  This is especially true for users using OpenID delegates.  When is StackExchange inc. planning to address this issue?  There's No Mitigation  Now, if it were merely a matter of me always using HTTPS I wouldn't care so much, but my doing so does not avoid the risk (as a matter of fact, my website only responds for the OpenID delegate over HTTPS).  Unfortunately, by their refusal to correct this security flaw, SE leaves me perpetually vulnerable to an MITM hijacking of my account at any time because they will make the request using HTTP if that's what the attacker types into the login field.  And contrary to claims that it's doesn't really matter, "it's only your SE account(s)", it does matter to me - someone could do a significant amount of damage to me in my professional community by taking over my SE account, some of which could never be reversed no matter what moderation capabilities there are (because the damage is done in the minds and perceptions that other people acquire of me as a result of the malicious activity).


Keep program running after logging out SSH -X, and reopening it later

I need to login to my school computer where I am running an experiment. I am logging via SSH -X since it uses a custom made GUI application. I want to be able open the program, make it start collection data, then logoff and check on it a few hours later.  I found many similar questions but but could not find a answer that would work for me. Screen and tmux are not available. Neither are byobu or similar stuff. The computer runs on some kind of old debian and I don't have root access.  I tried nohup which I understand should do the job but I could get it to work. I did:  nohup myprogram & exit   after I do exit the terminal doesn't close and the window of "myprogram" is still there. I have to close the terminal which asks me if I want to kill all open process.  I also couldn't find how to open a program that I have "nohuped" in a previous session. I tried doing nohup myprogram & again but it did not open the previous state of the program.


How can I draw the capacitor smoothing effect?

I want to draw a rectified signal with (blue) and without a capacitor  (black). This is what I'm getting     This is what I want     Code:  \begin{figure}[H]  \begin{tikzpicture}     \draw (0,0) -- (12,0);     \draw (0.2,1.5)node[left,font=\tiny] {$y=12$} -- (11.8,1.5);     \draw (0.2,-1.5)node[left,font=\tiny] {$y=-12$} -- (11.8,-1.5);      \foreach \x in {0,0.5,...,12}{     \draw (\x,-0.2)node [below,font=\tiny,] {\x} -- (\x,0.2) ;     }     \draw[ thick, black] (0,0) sin (1,1);    %% the real business in this line     \draw[ thick, black] (1,1) cos (2,0);    %% the real business in this line         \draw[ thick, line join=round , blue] (1,1) to (4.1,0.35);     \draw[ thick, black] (2,0) to  (3,0);    %% the real business in this line     \draw[ thick, black] (3,0) to (4,0);    %% the real business in this line         \draw[ thick, black] (4,0) sin (5,1);    %% the real business in this line     \draw[ thick, black] (5,1) cos (6,0);    %% the real business in this line     \draw[ thick, black] (6,0) to (7,0);    %% the real business in this line     \draw[ thick, black] (7,0) to  (8,0);    %% the real business in this line     \draw[ thick, black] (8,0)  sin (9,1);    %% the real business in this line     \draw[ thick, black] (9,1) cos (10,0);    %% the real business in this line     \draw[ thick, black] (10,0) to (11,0);    %% the real business in this line      \end{tikzpicture} \caption{nach  gleischrichtung}     \label{halb_welle_schaltung}     \end{figure}


Escaping slashes and left square brackets when using sed replace

I have to write short script to replace line in file. Some of the lines contains slashes and left square brackets (probably right also).   I know that another delimiter should be used to replace line with slashes.  My code:  sed -i -e "s|${oldLine}|${newLine}|g"   This throws an error because line contains [.   Example String in line to change (oldLine variable):  // List exampleList = [   Example how like should look after change:  List exampleList = [   How to make it works when there are some chars like [  To reproduce:  sed -i -e 's|// List exampleList = [|List exampleList = [|g' test.txt


Trim, strip_tags or mysqli_real_escape_string for protection of user input?

In php, what would be the better way to protect against malicious user input:    $password = trim($_POST['password']);   $password = strip_tags($password);   $password = htmlspecialchars($password);   Or   mysqli_real_escape_string(connection,$_POST['password']);   Or is there a even better way?


What happens to the temperature when an ideal gas is compressed?

I am rather confused about this. I know from Charles' law that under constant pressure, the volume of a gas is directly proportional to its absolute temperature i.e.  $$\frac{V_1}{T_1} = \frac{V_2}{T_2}$$  Thus accordingly, during compression, temperature of the gas would decrease. But in Lectures of physics ,vol 1 by Feynman, it is written:     Suppose that the piston moves inward, so that the atoms are slowly compressed into a smaller space. What happens when an atom hits the moving piston? Evidently it picks up speed from the collision. [...] So the atoms are "hotter" when they come away from the piston than they were before they struck it. Therefore all the atoms which are in the vessel will have picked up speed. This means that when we compress a gas slowly, the temperature of the gas increases.   (Constant pressure?) So, this is contrary to Charles' law. Why does this happen? Who is right? Or are they both correct? I am confused. Help.


Run a separate PHP file not related to wordpress?

WordPress is installed in the root public_html directory. E.g.,   public_html/index.php public_html/wp-config.php public_html/wp-admin/   Now I want to run a totally separate PHP file in the same directory. E.g.,   public_html/mystuff.php   How do I run it without WordPress thinking it's part of it?


Cardinality of the quotient ring $\mathbb Z_5[i]/\langle 1+i\rangle$

Find the cardinality of the quotient ring, $$\mathbb Z_5[i]/\langle 1+i\rangle$$  My Attempt:  Since, $$\mathbb Z_5[i]\cong Z[x]/\langle x^2+1,5\rangle$$  Hence, $$\mathbb Z_5[x]/\langle 1+i\rangle\cong \mathbb Z[x]/\langle x^2+1,x+1,5\rangle$$  In the quotient ring we have the following,  $x^2+1=0,x+1=0$ and $5=0$, i.e., $x=-1\;\; \implies 2=(-1)^2+1=0$  And, $5=0 \implies 1=0$. Thus, $\mathbb Z_5[i]/\langle 1+i\rangle\;\;=\{0+\langle 1+i\rangle\}$.   Is the above reasoning correct?  Initially, I had come across the following argument,$$1=(3+2i)(1+i)\implies 1\in \langle 1+i\rangle$$  And hence the quotient ring has just one element namely the zero element. This argument is quite good but it is not always easy to make such guesses. So I wanted to use the traditional method to find the cardinality.  Moreover, is there any different approach to the problem?


One of the former student    One of the former students       Which one is correct, and why? Can any one explain it clearly?


Trig substitution; why can we ignore the absolute value?

If we have to integrate $$f(x)=\frac{x}{\sqrt{1-x^2}}$$ and we substitute $x=\sin \theta$ then we eventually have to take the square root of $\cos^2x$ which is equal to $|\cos x|$.  But in my textbook and class lectures, we simply remove the absolute value sign and replace it with $\cos x$.  Why do we do this? I don't understand how we can do this.


Pass by reference versus value in variable versus array element

I know this question apparently has many duplicates like  and .  My question is different though.  Consider the following example:  public class MyClass {     public static void test(int a, int b) {         System.out.println("In test() at start: "+a+" "+b);         int temp=a;         a=b;         b=temp;         System.out.println("In test() at end: "+a+" "+b);     }      public static void main(String args[]) {         int a=1, b=2;         System.out.println("a: "+a+" b: "+b);          test(a, b);         System.out.println("a: "+a+" b: "+b);     } }    for the above snippet is:     a: 1 b: 2   In test() at start: 1 2   In test() at end: 2 1   a: 1 b: 2   This shows that the original values of a and b in main() have not been swapped when I called test(), thereby implying (if I understand correctly) that it was passed by value.  Now, consider the following code snippet:  public class MyClass {     public static void test(int[] arr) {         System.out.println(arr[2]);         arr[2]=20;         System.out.println(arr[2]);     }      public static void main(String args[]) {         int[] arr={0,1,2,3,4,5};         System.out.println(arr[2]);          test(arr);         System.out.println(arr[2]);     } }    for this code snippet is:     2   2   20   20   This shows that the value at arr[2] was changed in the original array in main(), thereby denoting (if I understand correctly) that the array was passed by reference.    Could someone please point out what is going on?  Why does it show different behaviors?  Thanks!


How can I use the ls command to find out a folder's owner and group, and what rights they each have?

Just switched completely from Windows to Ubuntu and am happy.   I have a problem; there is a folder called /root. I want to know how I could use the ls command to find out the owner and group associated with this folder, and what rights they each have.


I would like to send a http request with METHOD=HEAD using python 2. In mechanize there is a nice function called mechanize.Request. Unfortunately i only can set METHOD to either GET or POST but nothing else. Do you know whether there is a way to do that?


could someone please help me out, why these guys get edits for  that was done by me:   where nothing was changed? (mhitza) where only my changes were accepted? (psxls)   Please don't get me wrong - i'm not interested in the reputation, but just curious why edits with no changes are even allowed.


How to evaluate this integral using complex analysis techniques?

integrate $\int_{-\infty}^{\infty}\frac{\sin^2(x)}{x^2}dx$. Just a helpful tip would do just fine


how to use where for operators at generics class c#?

Hi I would like to have a class:  class Matrix <T>     where T : // I don't know what to write here {     T[][] elements; }   I would like T to be addable and multiplyable by + and * operators


In Tolkien's stories, we know that the Elves went into the West, but where did the Dwarves go? Did they just die off like the petty Dwarves (Mim and his kin)?


I used Drupal 7 and the  module to import a table into Drupal. I could import the orphaned table, but my table has a column of type "timestamp" which does not show up when I try to edit the schema of the data table. I get the following error:     PDOException: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'published': ALTER TABLE {resource_profiles} CHANGE published published INT NOT NULL DEFAULT 'CURRENT_TIMESTAMP'; Array ( ) in db_change_field() (line 2988 of C:\xampp\htdocs\drupal\includes\database\database.inc).   I followed , and added the timestamp datatype to /includes/database/mysql/schema.inc.  Where can I edit the schema information for my data table?


I'm trying to access all of the repositories but i am unable to change the settings in the software center, command line, or right from the source list. I have a hypothysis that it may be due to unistalled updates but when i run "sudo apt-get install update" it says that it is unable to locate package update. help?


jQuery Validator functionality Overriding Issue

I am trying to override the functionality of 'required' and 'minlength' validators provided by jQuery Validator plugin. Following is my code:  jQuery(".form-cls").validate({              errorElement: "span",              errorClass: "error-msg",         rules: {             email:{                 required:true,                 email:true,                 alreadyExistEmail: true             },             user_email:{                 required:true,                 email:true             },             password:{                 required: function (element) {                                     return checkIfPasswordIsRequired();                                 },                                 minlength: function (element) {                                   return passwordLengthCheck(element);                                   }                     }         }     });  function checkIfPasswordIsRequired()     {         if(jQuery("#facebook_id").length > 0 || jQuery("#linkedin_id").length > 0 || jQuery("#xing_id").length > 0) {             if(jQuery("#facebook_id").val() != "" || jQuery("#linkedin_id").val() != "" || jQuery("#xing_id").val() != "") {                 return false;             }         }         return true;     }      function passwordLengthCheck(element)     {         if(element.value.length < 6)         {           return false;         }         else         {           return true;         }     }   Now here the first check on password field is working fine that is of 'required' but the second check is not working. If have checked it my console.log(element.value.length) and it gives the length of value in password field each time the value is changed/altered but depending on the condition in function passwordLengthCheck it never shows/displays error. Kindly help!!


Time it takes two objects to collide with gravity?

So say there are two point masses, m1 and m2. There is no gravity affecting them besides the gravity between themselves. How long does it take them to collide with a given distance? The acceleration will change at the rate of x^2, so the objects will experience constant jounce, the second derivative of acceleration.  There are a couple problems i am having with solving this equation. The first is how to find the acceleration toward the other obejct of each individual mass. If i had the initial acceleration, I could make that a function of acceleration vs time, and making a differential equation solve for distance vs time. With that, all I would have to do is find out how far the objects have to travel to reach each other, which leads into my second problem.  How can i find where the objects will collide? It makes sense that they will meet at their inital barycenter, but I am not completely sure.


Ways to evaluate $\int_0^1 \int_0^1 \frac{1}{1-xy}dxdy = \frac{\pi^2}{6}$

A classmate told me this, but he didn't tell me how to evaluate the integral.  $$\int_0^1 \int_0^1 \frac{1}{1-xy}dxdy=\int_0^1 \int_0^1\sum_{n=0}^\infty (xy)^n dxdy=\sum_{n=1}^\infty \frac{1}{n^2}=\zeta(2)$$  So if you can evaluate that integral this might be an easy way to solve the Basel problem.  I tried substituting $\frac{1}{x}=v$ and $\frac{1}{y}=t$ to get $$\zeta(2)=\int_1^\infty\int_1^\infty\frac{1}{vt-1}-\frac{1}{vt}dvdt=\lim_{N\to\infty}\left(\int_1^N\int_1^N\frac{1}{vt-1}dvdt-\ln(N)^2\right)$$  The areas of the cross sections of $\frac{1}{vt-1}$ are going to be infinite near $(1,1)$ so this seems like a dead end.


Why does a user who has direct edit privileges have to vote for approving suggested edits?

I have come across something strange: I have direct edit privileges on Stack Overflow, that is, I can make edits without having my edits approved from other users. Though, when I come to approving edits made by other users, I can only vote for the edit to be approved, then wait for another vote for the edit to take place. I am wondering, what is the logic behind this? I can make edits myself, but can't approve other edits? One would simply think of rejecting that edit and making their own.


Interpretation of ArcGIS Kernel Density legend parameters

In ArcMap 9.3 I've used Kernel Density to map various incidents, but the resulting shapefile doesn't display any units of measurement. Is there a good, not-to-technical source that would explain in lay terminology the interpretation of the output values in terms of the input cell size and search radius?


Definition of a 'well received question' for the purposes of the Curious badge

I am curious about the definition of the well received question for the purposed of the Curious badge. For example, on Linux and Unix Stack Exchange I have several questions with a positive score, including two with a score of 2 (closed) and one with a score of 5, but overall I'm only seeing 2/5 for the Curious badge progress.  This is interesting to me, because I'm starting to wonder what 'well received question' might mean in this context. Might there, for example, be a specific formula that can be over-ridden under particular circumstances, or at the discretion of the mods? Or is the formula itself liable to change over time or when people decide their servers are a little bit bored.  Inquiring minds..


Simplifying $\sum_{i=1}^n{\lfloor \frac{n}{i} \rfloor}$?

In a few programming contexts, I've come across code along these lines:  total = 0 for i from 1 to n     total := total + n / i   Where the division here is integer division. Mathematically, this boils down to evaluating  $$\sum_{i = 1}^{n}\left\lfloor\, n \over i\,\right\rfloor.$$  This is upper-bounded by $n H_{n}$ and lower-bounded by $nH_{n} - n$ using the standard inequalities for $\texttt{floor}$'s, but that upper bound likely has a large gap to the true value.  Is there a way to either get an exact value for this summation or find some simpler function it's asymptotically equivalent to?


Has the lightsaber cross-guard from the Star Wars 7 teaser trailer been seen before?

Has a  ever been fictionalized previously in the Star Wars universe of any canon? Or is this a new saber technology completely written for the new Star Wars film?  I'm unsure how Disney works the canon now in the Star Wars universe. I did find this article on the , but I'm not sure how canon that article is.


Why does the $\lim \sum{n^{(1/n)}-1}$ diverge as $n\rightarrow \infty$? I suspected it would converge as $\lim {n^{(1/n)}}=1$ as $n\rightarrow \infty$ but computation show otherwise. So, now I am trying to show the partial sums are unbounded but didnt get far.


If someone is injecting MySQL statements to my PHP-based app. I use MySQLi real escape strings, however the attacker simply injects SQL statement. Let's assume:    The attack simply injects a statement:  LIMIT 10  And, even after escaping the strings, the code is executed as follows.  SELECT * FROM ex WHERE id = 1 LIMIT 10


Rounding values in dictionaries (Python)

I have some issues with floating point numbers and rounding them.   I have a function that takes a dictionary as an input. It finds the average of all the values and then calculates the difference between each value and the average. The answers should be rounded to two decimal places.   I can't figure out why it's not returning floating point values that are properly rounded. The funny thing is that when I print out x[i] inside the for loop, it looks exactly how I want it. Also, I want to keep the values a number and not a formatted string.    def avgstuff(x):     ppv = sum(x.values())/float(len(x))     for i in x:         x[i] = round(x[i] - ppv,2)     return x  print avgstuff({'A': 40, 'C': 10, 'B': 25, 'E': 58, 'D': 153})   current output: {'A': -17.199999999999999, 'C': -47.200000000000003, 'B': -32.200000000000003, 'E': 0.80000000000000004, 'D': 95.799999999999997}  Output I want: {'A': -17.20, 'C': -47.20, 'B': -32.20, 'E': 0.80, 'D': 95.80}  Output I don't want: {'A': '-17.20', 'C': '-47.20', 'B': '-32.20', 'E': '0.80', 'D': '95.80'}


Check all / uncheck all Checkbox not worked in Ajax Called Page

Select All Input Checkbox is doesn't work.  I checked the code without ajax call, then select all checkbox is perfectly worked.  When select all checkbox is checked all the checkbox shown inside the while loop is checked.But when i integrated with main html page the select all checkbox is not worked.  please tell me What changes i need to apply for the correct working of select all checkbox with below code.  HTML Page                <form  name="form1" method="post"  enctype="multipart/form-data" action="pras.php" class="form-horizontal" >                                                 <fieldset>
 Select Division
 <select name="divis" id=division class="form-control" onchange="showUsers(this.value)">                                           </select>

          <input class="btn btn-primary" type="submit" name="submit" value="submit">

 </fieldset> </form>      get_user_div.php   echo "

  Register Number	  Prasent/Abstent
 Select All <input type='checkbox' name='select1' id='select1' class='parent' />
";  while($row = mysql_fetch_array($result)) { $sql="SELECT * FROM attandance WHERE register_no= '$row[register_no]'"; $res = mysql_query($sql); $col = mysql_fetch_array($res); echo "
"; echo "" . $row['register_no'] . "	"; echo "         <input type ='checkbox' name='present[]' value='$row[register_no]' class='child' id='check[]'/>       	";  echo "
"; }    echo '
';   echo "
";


In a $\triangle ABC,$ If $\cot A+\cot B+\cot C =\sqrt{3},$ Then prove that $\triangle$ is equilateral.   $\bf{My\; Try::}$ Using Jensen's Inequality,  Let $f(x)=\cot x\;,$ Where $x\in (0,\pi),$ Then $f'(x) = -\csc^2 x$ and $f''(x) = 2\csc^2 x\cdot \cot x$  So we get $\displaystyle f''(x) = \frac{2\cos x}{\sin^3 x}>0$ in $\displaystyle x\in (0,\pi)-\left\{\frac{\pi}{2}\right\}$  So $$\displaystyle\frac{\cot A+\cot B+\cot C}{3}\geq \cot\left(\frac{A+B+C}{3}\right)=\frac{1}{\sqrt{3}}$$  So we get $\cot A+\cot B+\cot C\geq \sqrt{3}$  But i did not understand how can we prove that $\triangle$ are equilateral  Thanks


Prove the following equality: $ \sum_{i=0} ^n j {n \choose j} = n 2^{n-1} $

I'd like some help. My first idea was to use induction, but then I get stuck. The base case works just fine, as you'd imagine, and then...   If  $ \sum_{i=0} ^n j {n \choose j} = n 2^{n-1} \rightarrow  \sum_{i=0} ^{n+1} j {n+1 \choose j} = (n+1) 2^{n}  $ $$ \sum_{i=0} ^{n+1} j {n+1 \choose j} =  \sum_{i=0} ^{n} j {n+1 \choose j}  + n+1 = \sum_{i=0} ^{n} j (n! / ((n-j)!j!))*(n+1)/(n+1-j)  + n+1$$ And well I can't seem to do anything else.   Another way, also using induction.  $$ \sum_{i=0} ^{n+1} j {n+1 \choose j} = \sum_{i=0} ^{n} j ({n \choose j} - {m \choose j-1}) + m + 1$$  And then I also get stuck.  I know there's another way of proving this without using induction and only with some properties and a couple of tricks I do not see to see.  Any help? Thanks.


What is the opposite word to "indent"—"outdent" or "unindent"?

I'm looking for the opposite word to "indent." Is it "outdent", or is it "unindent"?  Corresponding to "Tab" and "Shift Tab" in most editors.


Replacing "and" by "og" and "In"by "I" in references and bibliograpy using natbib

Since I am writing in norwegian, I would like to chang the two words "and" and "in" into norwegian. "And" appears both in references in the text and in the bibliography, while "in" appears in the bibliography.  My document:   \documentclass[a4paper, norsk, 12pt]{article}  \usepackage[latin1]{inputenc}        \usepackage [norsk] {babel}                           \usepackage[round, longnamesfirst]{natbib}        \begin{document}  If I have more than one author, the reference would be a list of alle the authors the first time i cite it \citep{fysdid}.  The problem is that I can not have the word ''and'' in the reference when I am writing i norwegian. I would like to replace it by ''og''.  \renewcommand{\refname}{Litteratur} \addcontentsline{toc}{section}{\refname} \bibliography{litteratur} \bibliographystyle{abbrvnat}   \end{document}        the bibtex-file:  @book{fysdid, title= {Fysikkdidaktikk}, author= {Carl Angell and Berit Bungum and Ellen K. Henriksen and Stein Dankert Kolstø and Jonas Persson and Reidun Renstrøm}, year= {2011}, publisher={Manusutkast}, }   The result:  If I have more than one author, the reference would be a list of alle the authors the rst time i cite it (Angell, Bungum, Henriksen, Kolst, Persson, and Renstrm, 2011). The problem is that I can not have the word "and" in the reference when I am writing i norwegian. I would like to replace it by "og".  Litteratur  C. Angell, B. Bungum, E. K. Henriksen, S. D. Kolst, J. Persson, and R. Renstrm. Fysikkdidaktikk. Manusutkast, 2011.


Restriction of a diagonalizable linear operator $T$ to any nontrivial $T$-invariant subspace is also diagonalizable using a given lemma.

Lemma  Let $T$ be a linear operator on a finite-dimensional vector space $V$, and let $W$ be a $T$-invariant subspace of $V$. Suppose that $v_1, \dots , v_k$ are eigenvectors of $T$ corresponding to distinct eigenvalues. Prove that if $v_1+\dots+v_k$ is in $W$, then $v_i ∈ W$ for all $i$.  Use the above lemma and prove the given result. Question  Prove that the restriction of a diagonalizable linear operator $T$ to any nontrivial $T$-invariant subspace is also diagonalizable.  I could prove the above lemma using induction. My attempt: A linear operator $T$ on a ﬁnite-dimensional vector space $V$ is diagonalizable if and only if $V$ is the direct sum of the eigenspaces of $T$. Let $\lambda_1, \lambda_2,..., \lambda_k$ are the eigenvalues of $T$, $V=E_{\lambda_1} \bigoplus E_{\lambda_1}\bigoplus ...\bigoplus E_{\lambda_k}.$ Let $W_{\lambda_j}=E_{\lambda_j}\cap W(1\leq j \leq k)$. Will we get $W=W_{\lambda_1} \bigoplus W_{\lambda_1}\bigoplus ...\bigoplus W_{\lambda_k}?$ Claim 1:  $W=W_{\lambda_1} \bigoplus W_{\lambda_1}\bigoplus ...\bigoplus  W_{\lambda_k}.$  $$V=E_{\lambda_1} + E_{\lambda_1}+ ...+ E_{\lambda_1}.$$ $$V\cap W=W \cap (E_{\lambda_1} + E_{\lambda_1}+ ...+ E_{\lambda_k}).$$ Claim 2:  $W \cap (E_{\lambda_1} + E_{\lambda_1}+ ...+ E_{\lambda_k})=(W \cap  E_{\lambda_1}) + (W\cap E_{\lambda_1})+ ...+ (W\cap E_{\lambda_k})$  $x\in (W \cap  E_{\lambda_1}) + (W\cap E_{\lambda_1})+ ...+ (W\cap E_{\lambda_k})\implies$ $x=x_1+x_2+...x_k \implies x \in W \cap (E_{\lambda_1} + E_{\lambda_1}+ ...+ E_{\lambda_k})$. How do I prove the converse? Does there exist any counter example to prove that result is false? How do I use the above lemma and prove the result?


Show that f(x) = inf{g(x1)+h(x2)} is convex subject to x1+x2=x and where g(.) and h(.) are convex functions.  Can I just go about this by using the regular definition of a convex function or which properties should I use? I know that the sum of convex functions is convex, but the infimum part confuses me. Thank you


TV Detective who travels back in time to solve crime

A British television series from the mid/late 90s, where the protagonist is a detective (?) somehow able travel back in time a few days (perhaps a week?) to solve crimes. I think other characters were unaware of his time travels...  I remember one episode where, during his investigation in the past, he saw a colleague and slipped him a piece of paper with some lottery numbers to play. When he arrived back, the rest of the team were celebrating his win with "bubbly", it then transpired it wasn't actually "real" champagne, confused we find out that:      his colleague had put down the numbers upside-down, somehow meaning he'd got four numbers (several hundred pounds) rather than all of them (several million).   The premise sounds a lot like , though I think this programme was aired prior to that...  Any ideas?


Add a toggle to collapse the hot network questions list

While the hot network questions list can be entertaining, there are a few situations in which it harms the experience of using SE sites, especially when you use SE sites at work.  I know that variations of this have been asked before, but I think the way the SE network changed in the meantime does merit a new discussion about this. We have far more sites that are more entertainment than professional now, and the mix of entertainment and professional topics makes the HNQ list problematic in some cases.  There are a few situations I can think of where the presence of the HNQ list has a negative effect:   the appearance of pretty much random questions about all kinds of topic can be a bit annoying in a work setting. The other people looking at your screen might not see that you're only trying to solve a programming issue, when there is some inappropriate content in the sidebar. it exposes you to spoilers or information about recent TV series, movies, books, etc. While titles are usually written to avoid major spoilers, this is not always the case, and it's still at least a distraction. in any case, the hot network questions are a distraction. It's pretty much their purpose, but sometimes I don't want to be distracted.   I know this can be solved by a user script, but that is not a real solution and has several drawbacks. It's seriously annoying when you use multiple devices, it only solves the problem for a tiny amount of users. User scripts are a workaround, not a solution.  We don't have any control over the HNQ list, especially on work computers where the workarounds can be disallowed. We can choose which SE site to visit, but the HNQ list is always there, mixing professional and unprofessional content.   What I'd propose is to make the HNQ sidebar collapsible, and remember the collapsed state for the user session (or forever for that user). A single click would collapse the list to only the title, and a second one would expand it again to the full list. This would make it easy to hide the HNQ list for a short time, e.g. mondays when Game of Thrones is running, or essentially permanently as well, if you simply don't care about them at all.


babelbib styles format first and second author names differently

I use babelbib and I have a source with two authors. Contrarily to when using the plain bib style, as soon as I switch to babplain, the author names are formatted like this:  [1] Müller, Jan und Eva Schulze: Name of the book, 2015.   While I would like both author names to be formatted the same way, that is one of these:  [1] Müller, Jan und Schulze, Eva: Name of the book, 2015. [1] Jan Müller und Eva Schulze: Name of the book, 2015.   sources:  % test.tex \usepackage[ngerman]{babel} \usepackage[fixlanguage]{babelbib} \selectbiblanguage{ngerman} \bibliographystyle{babplain} \bibliography{test}  % test.bib @manual{foo,     author = "Müller, Jan and Schulze, Eva",     title = "Name of the book",     year = "2015", }   I can fix it by specifying and {Schulze, Eva}, but that way all is treated as the last name, that cannot be the solution, can it?


Use system fonts (Mac OS) while using book template

I'm new to LaTeX and all that stuff, but due to the fact, that I may be using it in the future at university, I just try to get along with it.   To test, I want to have a story in a pretty book. On the web, I found a template for doing so and actually I got pretty far. Unfortunately, I can't change the font, everything I try just results in 1. no change at all or 2. the same font everywhere.  As requested, here is a MWE:  \documentclass[twoside,12pt,german]{book} \usepackage[german]{babel} \usepackage{fontspec}  \setmainfont{Handwriting - Dakota}  \begin{document} This is a test. \end{document}  These are the error messages I get:   LaTeX Font Warning: Some font shapes were not available, defaults substituted. LaTeX Font Warning: Font shape EU1/Handwriting-Dakota(0)/m/sl' undefined (Font) usingEU1/Handwriting-Dakota(0)/m/n' instead on input line Error 256 (driver return code) generating output; file xetest.pdf may not be valid.   No .pdf-file is created.


Is a countably infinite Cartesian product of countably infinite sets uncountable?

I've read that such is the case but I've thought up of a bijection which makes me think otherwise. My apologies if this has been asked before...  Let $\mathbb{W} = \mathbb{N} \cup \{0\}$. Let $P$ be the set of primes. Denote by $p_{k}$ the $k$th prime number.  Let $\{W_{p_{n}}\}_{n=1}^{\infty}$ be a sequence such that $W_{p_{i}} = \mathbb{W}$ for all $i \in \mathbb{N}$.  Then $S := W_{p_{1}} \times W_{p_{2}} \times \cdots = \mathbb{W} \times \mathbb{W} \times \cdots$ is a Cartesian product of countably infinite copies of $\mathbb{W}$, since the set of primes $P$ is countably infinite.  Now, consider $f : S \rightarrow \mathbb{N}$ such that $f(w_{1},w_{2},\dots) = p_{1}^{w_{1}}p_{2}^{w_{2}}\cdots = 2^{w_{1}}3^{w_{2}}\cdots$  We know that the every natural number has a unique prime factorization, so that $f$ is a bijection, from where it follows that $S$ is numerically equivalent to $\mathbb{N}$.  Where is the fault in this proof?


align numbers based on their decimal point

I have the following table:      \documentclass{article} \usepackage{booktabs} \begin{document}     \begin{table} \centering \begin{tabular}{ lcccccccc }  \toprule \multicolumn{5}{c}{\textbf{Training time per fold}}  \\  \toprule \textbf{Average per fold}     & 1462.20 & 1482.31 & 1487.15 & 1496.49    \\[2pt] \hline \textbf{Stddev per fold}      & 35.13   & 28.09   &  30.10  &  31.30   \\[2pt] \hline \textbf{Average per sequence} & 365.55  & 370.58  &  371.79 &  374.12   \\[2pt]  \midrule \multicolumn{5}{c}{\textbf{Time for classification per fold}} \\  \midrule \textbf{Average per fold}     & 1092.39 & 1101.13  & 1102.03 & 1080.47 \\[2pt] \hline \textbf{Stddev per fold}      &  53.17  & 43.73    & 46.43   & 45.66   \\[2pt] \hline \textbf{Average per sequence} & 273.10  & 275.28   & 275.51  & 270.12  \\[2pt]  \bottomrule \end{tabular} \end{table} \end{document}   I would like to align all numbers with respect to their decimal position, that means all dots should be aligned.


Discrete Mathematics Symmetric Diffirence Proof

I've been trying to find a proof for the following problem but have been unable to come up with anything myself:  Say we have A, B, C part of a universe U show that if $$A \Delta C = B \Delta C \rightarrow A = B$$  I've been able to use set operations to change the form of the problem into a logics one:  $${x | X \in A \cup C \vee x \notin A \cap C}  $$ $${x | x \in A \vee x \in C \vee x \notin (x \in A \wedge x \in C)}$$  A second thought was using the definition of symmetric diffirence where $$A \Delta C = (A \cup C) - (A \cap C)$$  Can anyone provide a step by step proof or point me in the right direction?


Why is the volume one third of that? I mean, where's the fault in my logic?

The volume of a cuboid is $l \times b \times h$. That is, it is equal to base area times height. I think it means that the base is added up height times, it becomes volume (It makes sense if we think about it)   And if we think about cylinder, the above mentioned logic still holds. The volume of cylinder is $\pi r^2 \times h$ . Which is same as saying the area of bottom circle (i.e. $\pi r^2$) times the height $h$.    But when it comes to a cone , it doesn't makes sense. In above examples  2-d shapes have been collected one upon another, a specific number of times(h). In a cone its kinda same except that now a triangle isn't collected one upon another (that would make a prism), but collected in  a circular way. We can imagine a cone to be group of right triangles with their axis being one of the sides (except hypotenuse, that would make a compound shape of two cones ). We can also imagine it this way, A right triangle is rotated with one of the sides being axis.   So now the volume should be, by above mentioned logic, the area of repeated shape times number of shapes. And there are 2pi x r triangles because, well, it is rotated that much number of times. Visualize it in your mind, it'll become clear. Hope you get the idea.    Now, Volume of cone should be    area of the triangle times the circumference of the base  => $1/2 \times b \times h \times 2\pi r$  Now the base of triangle is same as the radius of the base and the 2s cancel each other out we are left with  $\pi r^2 h$  But the volume of cone if one third of that value. My question is Why is that?


Let $M$ a cyclic $R$-module of order $\alpha$. If $\beta\mid\alpha$ then there is a unique submodule of order $\beta$

Let $R$ a principal ideal domain and $M$ a cyclic $R$-module of order $\alpha$. Show that for each divisor $\beta$ of $\alpha$ there is a unique submodule of order $\beta$.   Note: below $\langle\cdot\rangle$ stay for ideal generator and $\langle\!\langle\cdot\rangle\!\rangle$ stay for (sub)module generator.  My work so far:  By the uniqueness of the cyclic decomposition on primary submodules of a torsion module it is enough to see the case when $\alpha=p^n$ for some prime $p$.  I already know that $\tau: \langle\!\langle v\rangle\!\rangle\to R/\langle p^n\rangle,\, rv\mapsto r+\langle p^n\rangle$ is a $R$-module isomorphism and so it is enough to check that the submodules $\langle\!\langle p^{n-j}+\langle p^n\rangle\rangle\!\rangle$ are the unique submodules of order $p^j$ in $R/\langle p^n\rangle$.  If $x\in R$ induces a submodule of order $p^j$ in $R/\langle p^n\rangle$ then it is clear that $x=r p^{n-j}$ for some $r\in R$, and so $x\le p^{n-j}$ as induced submodules with equality when $r$ is a unit.  However I get stuck trying to show that $r$ must be necessarily an unit. Some help will be appreciated, thank you.


Using Blender with wider gamut than 709 primaries (like ACES)

There is a similar old unanswered question on this site with some vague comments (), so I'll ask it differently:  Is it possible to work in blender 2.8 with color spaces that use a wider gamut than Rec709?  Is blender's cycles still limited to Rec709 primaries only, or can it render images with wider gamuts?  Is the information on this link:  accurate?, meaning that all it takes is to have a different config.ocio and the corresponding LUTS and set a system variable for OCIO, as stated also in ?  Additionally, I've found this article on .  Is that the only color wide gamut space that is usable today?  I hope someone (like @troy_s) can shed some light on this. Thanks.


Here is a riddle someone has been asked in a job interview: How many zero digits are there in $100!$?  Well, I found the first $24$ quite fast by counting how many times five divides $100!$ ($5$ divides $20$ times and $25$ divides it $4$ times).   However, there are more zero digits in the middle of the number (these can be found by hand, by typing factorial(100) in sage).  My question is whether there is a smart way to determine the number of zero digits in $100!$, and more generally in $n!$.  By the way, this will not affect the job interview as it was finished some time ago.


What is the drawback of using a non-parametric test when parametric alternative could have been used?

I want to analyze the difference between two paired samples. My initial plan was to compare them using the Wilcoxon test because I didn't want to bother checking whether the data is properly distributed for (e.g) paired t-test, and selecting a non-parametric test sounds like a safer mode of action. What is the drawback of my laziness? What am I risking?


How do I increase the space in Filesystem Root partition?

Ubuntu is my only OS. I recently downloaded many utilities for a lecture along with Visual Studio Code, and since then I have noticed unusual lag in my PC.   I cleared a lot of things using various tools like Bleach Bit and via terminal, yet, the lag still exists and opening applications is noticeably slower.      I have space in my /home partition, I do not know if it is possible to reallocate sizes; is it practical?  I cannot use the swap partition as then I will have to unmount other partitions which includes home and root.   Edit: after applying the following commands, here is the screenshot of


"Self-Learner" badge can be earned multiple times?

The description of this badge is: "Answered your own question with score of 3 or more".  It seems that this badge can be earned multiple times, but when I examined many users who have earned it, I found no one had earned it multiple times.  Why doesn't Stack Overflow describe it as "First answered your own question with score of 3 or more"?


I need to check the current version of VLC I have running, however I don't know where it is installed (can't see it in /etc or /bin).   If I do vlc in a terminal then the application starts, but is there a way to do like a pwd vlc command where it shows me the actual path of where the vlc app is being called from?   I want to see if the actual file name contains the software version since I can't find the version within the software itself.  I have a statement asking me to explain why this is different from another post. It is different because this is a 2 part question, where I am trying to understand the install package location (which is the same as the other link), however I also wanted to know how to check the VLC version, hence the title (and why this question is different).


What if errors (residuals) follow other distribution rather than linear regression?

Recently, I'm studying linear regression. I've heard that errors always follow normal distribution because they are supposed to do (in the point of they are noises). But suddenly I just wonders what if residuals of a linear regression follow other distribution rather than a normal distribution. I think I can interpret that there's a potential to approving the performance of the model because it implies that there are some data that I've didn't collect. It means irreducible errors can be reduced actually. But I'm not good at math, so I don't know it is right or not.  Once again, how can we interpret residuals of a linear regression doesn't follow other distribution and how can we utilize if they do?


In 20.04 "sudo -s" no longer utilizes user's ".config/*" files?

I have an  config in /etc/skel/.config/htop/htoprc copied to all new user  home directories. When I run  as a regular user I see the expected settings. However under 18.04 if I ran sudo -s then  Ubuntu would still use my regular user's htoprc from .config and work fine.   On 20.04 I notice when I sudo -s then htop it is no longer reads the user's config from their shell, it creates a new file in /root/.config/htop/htoprc with default htop settings. Is this something new about ? I thought the -s would keep utilizing the calling users shell as opposed to -i which switches to the root user's shell?


Centripetal and Centrifugal acceleration/force

Centripetal force acts towards the centre and necessary to keep an object in circular motion. But centrifugal force is equal to the magnitude of centripetal force and acts in outwards direction and hence counteracts the centripetal force. Then why is centripetal force required for circular motion?


Looking for the title of a book about being stark raving mad to navigate a ship

I once read a story about the future!  Brain cybernetics were common. If you were "average" you got average brain implants. If you were wealthy you got the latest-and-greatest tech. It was illegal to replace implants (or add new tech) at a later age. One of the characters did so anyway (ended up being hired as a hacker for one of the major leaders in the book). He had a phrase like, "doc, you might as well just close my skull with a zipper 'cause I'll be back" or some such.  Kids coming out of hypersleep/cryogenics would turn on their implants, which turned everyone walking around them into NPC characters in their games, and start running around playing games.  The book had a strong theme about sanity, mental disorders, and how they were embraced productively rather than shunned socially. I remember an old guy who painstakingly re-drew his tattoos rather than having them permanently inked because it would drive him nuts seeing them go blurry with time (he also overfocused on his work and had to be told to eat, he drank something frothy).  The protagonist was a multiple-personality. One of them was, well... randy. (Sorry, I'm a guy, we remember stuff like that.) Getting the multiple personalities to work one-with-another to get the protagonist out of trouble was a key theme in the story. One of the personalities was stark raving mad (considered socially to be a bad thing), but ended up being useful because the madness allowed her to see the dangers lurking in "hyperspace" (I'm not sure that was the word used) so navigators could avoid them. The madness of one of her personalities was critical in saving the ship near the end of the story.   At a guess, I read this back in the mid to late 90s.


Smallest and largest values of a vector length

|u| = 2 and |v| = 3, what are the largest and smallest values for |u−v| Give a geometric explanation of your results.   So I used the triangle inequality definition to find the smallest and largest values for |u-v| however I'm unsure (and don't fully understand the concept) how to explain what these values mean geometrically..  so I adapted the triangle inequality for |u-v| to:  |u| - |-v| <= |u - v| <= |u| + |-v|  And by this I got the values:  smallest: 2-3 = -1  largest: 2+3 = 5  But how do I explain this geometrically?


Windows Server 180 days evaluation period for individuals

Can i as individual get access to 180 evaluation period for windows server. Problem is it says it requires name of a company and company phone number


How to achieve this smudge effect in photoshop?

I came across this photo by Jacob Sutton and wanted to know if someone knew how to get this effect in photoshop?    (source: )


Would time still exist after Heat Death of the Unverse?

From my (honestly limited) knowledge of what the Heat Death of the Universe is, I understand that HDotU is the point when energy levels across the entire Universe reach equillibrium, thus energy doesn't flow anymore absolutely anywhere, and thus nothing will ever happen anymore.  If that's the case, would time still be? Even when there's not a single event happening inside it and nobody's there to observe the ticking, does time (or space, come to think of it) exist? Or would HDotU cause something that ends the entire spacetime?


Do you pluralize the singular possessions of / items or people associated with individual members of a plural group?

In a situation where say a group (or at least a plurality) of men is being addressed — for example on a sign passed by many married men — which is correct?  "Remind your wife."  or  "Remind your wives."


To reduce the loop area and noisepick up, the GND lead of the scope probe is very next to the tip in the below probe:    I don’t have such probes and my scope probe GND leads are much longer alligator clips.  Does the type of probe in the photo have a name or is it homemade? And when is it used?


I just showed that $D_4$ is solvable since it is isomorphic to $\mathbb{Z}_2 x \mathbb{Z}_2$ so since $\mathbb{Z}_2$ is solvable so is $D_4$.  Does something similar extend to $D_5$ or is there a better way of showing both?


How to validate a Email Using JavaScript?

I already have a code, but it's not successfully working. No popup happens when I press submit. Thanks for the assistance in advance  <!DOCTYPE html> <html>   <head>     <meta charset="UTF-8">     <title>Email Validation</title>   </head>   <body>   <script>   function ValidateEmail(mail)  {  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailAddr.value))   {     return (true)   }     alert("You have entered an invalid email address!")     return (false) } </script> <table> <tr> <td> Email </td> <td> <input type = 'text' name = 'email' size = '30'  /> </td> </tr>   </table>     <input type="submit" value="Submit" onclick = "ValidateEmail()">   </body> </html>


What were the names of the medals given out in Star Wars and what was written on them?

At the end of the 1977 film "Star Wars: A New Hope" Luke, Han, and Chewie are presented with  medals in front of a large crowd by Princess Leia.  What were the names of the medals?  (Medal of Valor, etc.?)  Did they have anything written in them?


Why do some questions have a favorite count of 0 while others have none?

I was  when I noticed some questions have a favourite count of 0, while the majority have a favourite count of NULL. What's the reason behind this? For the questions with a count of 0, did somebody add it as a favourite in the past and removed it later (possibly even when their account was removed)? Looking at , it might very well be the case.    This behaviour seems to happen on all sites in the network, not just Meta. I've already checked migrations as a possible cause, but nope. Here are two queries to view more examples:       A related issue is . While this behaviour makes writing some niche queries slightly more complex than needed, it's far from being a bug and this question is also to satisfy my curiosity.


How does focal length relate to macro magnification?

I'm new to photography and would like to know a little more about zoom lens, The main thing I wonder about is this, I have a Fujifilm S4000 camera that claims to have 30x magnification.  The new camera I now own is a Nikon D60 with it's kit lenses (18-55) I was willing to get better lens to get a larger zoom range, and eventually reached 70-300mm lens made by Tamron ( Tamron AF70-300mm F/4-5.6 Di LD )  Now those lenses have a quite large range compared to what I have on my D60 right now, but when calculating the magnification ( 4.2x ) it's not even close to what the Fujifilm is offering.  So obviously I am missing something, or am I? Will I get more magnification with my D60 together with the 70-300 lens than the Fujifilm? Does the sensor size play a role here when it comes to that? and what else should I take into consideration when trying to compare the magnification between my cameras?  About the focus, what I was wondering about is the fact that some lens with big ranges like the 70-300 I stated above, claim to be "Macro" lenses, does that mean that they somehow have more focus range so that even if I zoom quite far I will be able to focus? I guess the question could be what would make zoom lens "Macro" lens?  Any info that would help me learn more would be much appreciated.


Distance between compact sets in a metric space.

Let $K_1$ and $K_2$ be two disjoint compact sets in a metric space $(X,d).$ Show that $$a = \inf_{x_1 \in K_1, x_2 \in K_2} d(x_1, x_2) > 0.$$   Moreover, show that there are $x \in K_1$ and $y \in K_2$ such that $a = d(x,y)$.   For the first part, suppose to the contrary that $\inf d(x_1, x_2) = 0$. Then $\epsilon$ is not a lower bound, so $d(x_1, x_2) < \epsilon$ for all $\epsilon > 0$. Since $K_1$ and $K_2$ are compact subsets of a metric space, they are closed and bounded. So, then $B(x_1, \epsilon) \cap K_2 \neq \emptyset$. Thus, $x_1$ is an adherent point to $K_2$. Since $K_2$ is closed, this means $x_1 \in K_2$, a contradiction.  I'm stuck on the moreover part. I tried supposing to the contrary that $d(x,y) > a$, but I did not get far.


How to deal with graduate school rejection and overall academic failure?

There has been a lot of buzz about how difficult it is to achieve tenure, however, even getting into graduate school seems harder every day. My case (and the case of a lot of people too): I graduated early from school in a developing country and decided to study Biology with more passion than reason (low salaries compared to a Doctor or an Engineering). I completed in four years a five years Bachelor's in a top institution of my country, with some national awards, grants and scholarships. My GPA was among the best %5. I did research since my second year and established good relations with my Professors (their letters of recommendation are fine without bluff).   I applied to some MSc in Europe and US and got rejected the first time. I got the only available (bad paying) job until the next admission period. I lowered the stakes for my second round of applications and got rejected again. With two consecutive rejections, I am starting to think that I am ineligible for any graduate position. Especially considering that I have been off academia for two consecutive years. Why? A MSc in my country, even at a top school, has no international worth. Furthermore, it doesn't have worth in my own country as few positions are available.  I know I have weaknesses:   My college is top in my country, but almost unrecognized internationally. The awards I got have no international value. Although I was in that 5%, I had a harsh beginning. The first page of my transcripts has some bad scores (~2.8, lowest) along good ones (~4). That first page causes a bad impression. The extra course load is irrelevant for the admission committees. I specialized myself too much. While some students attest experience in three or more projects, I focused on one big project since the beginning. Few publications and conferences. In my country, there have been almost no conferences in my field in years and I cannot travel abroad for a presentation.   My future is staring to seem bleak: no job in my country, no graduate school abroad. Overall, I feel a complete failure in what I loved. What should a person in my position do? Should I try again or set new professional goals?


Create a lot of spheres with xyz coordinates and radius

How can I create a lot of spheres? I have a csv file with x,y,z,r (radius) coordinates. I saw some topics but nothing worked to me. I tried ask a question, but this was classified as "Your post has been associated with a similar question. If this question doesn’t resolve your question, ask a new one." I read some topics but nothing worked to me, so that I opened a new topic. I have this code: import bpy  text_file = open("C:\\Users\\nabuc\\Desktop\\1700txt - copia.txt", "r") lines = []  #Read in contents to a list for line in text_file:     lines.append(line.strip())  #create spheres for e in lines: temp=e.split(',') bpy.ops.mesh.primitive_uv_sphere_add(segments = 64, ring_count = 32, location=(float(temp[0]),float(temp[1]),float(temp[2])),size = float(temp[3])) bpy.ops.object.shade_smooth() text_file.close()  but: Python:   File "C:\Users\nabuc\Documents\untitled.blend\Text", line 12 temp=e.split(',') ^ IndentationError: expected an indented block location: :-1 thanks for your help EDIT 2 (I can't edit code on answer) To avoid this indentation error, I edit as: import bpy  text_file = open("C:\\Users\\nabuc\\Desktop\\1700txt - copia.txt", "r") lines = []  #Read in contents to a list for line in text_file:     lines.append(line.strip())  #create spheres for e in lines:     temp=e.split(',')     bpy.ops.mesh.primitive_uv_sphere_add(segments = 64, ring_count = 32, location=(float(temp[0]),float(temp[1]),float(temp[2])),size =         float(temp[3]))     bpy.ops.object.shade_smooth()     text_file.close()  but this return: Python script failed, check the message in the system console


I am trying to understand the shift operators and couldn't get much. When I tried to execute the below code  System.out.println(Integer.toBinaryString(2 << 11)); System.out.println(Integer.toBinaryString(2 << 22)); System.out.println(Integer.toBinaryString(2 << 33)); System.out.println(Integer.toBinaryString(2 << 44)); System.out.println(Integer.toBinaryString(2 << 55));   I get the below  1000000000000     100000000000000000000000     100     10000000000000     1000000000000000000000000       Could somebody please explain?


Clocks in satellites have to be adjusted due to the effects of relativity; but does time for satellites (GPS) flow slower, due to the relative motion, or faster, due to the weaker amount of gravitation received due to the increased distance to earth?


Inertia forms the basis of Newtonian physics,but nothing really explains it.I know that it is generally accepted in classical physics,but can it's origin  be explained?Maybe be relativity or quantum mechanics?


Commutativity of ring of order $p^2$ with unity $e$ and characteristic $p$

Let $R$ be a finite ring of order $p^2$ with unity $e$ and characteristic $p$. This ring is commutative but I cannot get why it is.   I know that this ring looks as $\mathbb Z /p\mathbb Z \times Z /p\mathbb Z$. Could anyone help me to show the commutativity of this ring?


Is denying "Paradoxical Partitioning" equivalent to accepting the Axiom of Choice?

In  (to ) it has been noted:     One more point to make about the paradoxical decomposition to more parts than elements [...]   currently we do not know of any model of +$\lnot$ where such decomposition does not exist.    Namely, as far as we know, in all models where choice fails there is some set which can be partitioned into more parts than elements.   (Just for clarification: From the context of the above references the comparison "more parts than" is obviously meant in terms of the  of the suitable  being strictly larger than the cardinality of the suitable initial set itself.)  Now, I find the negation or denial of such "paradoxial partitioning" interesting; i.e. the statement (proposition, "$\lnot$PP"):  "Each partition of each given set has cardinality less than, or at most equal to, the cardinality of the given set."  And I like to further explore how this suggested "proposition $\lnot$PP" (being considered along with ZF, of course) relates to "the standard set theory including Axiom of Choice", . Therefore  My questions:      Are there any models of ZFC known (or could there be any such models, in principle) in which there is some set which can be partitioned into more parts than elements ?  And:  Are there any models of ZF known (or could there be any such models, in principle) in which there is no set which can be partitioned into more parts than elements, and which is not also a model of ZFC ?  (And just for reference: Is there a conventional or concise way of expressing the suggested "proposition $\lnot$PP" in terms of standard notation, such as used in the sources linked above? Has it perhaps been discussed already, by some other name? ...)


How to do multiple insert after select in MYSQL

I want to do something like   insert into table  (  A,      B,     C  )  (select '1', one.A, one.B from table_1 one) UNION  (select '2', one.A, one.B from table_1 one)  Will this call select query twice ?  Are there any better way of doing this  ?


Do PCs understand the leveling system and its experience requirements?

Do PCs understand the nature of the leveling system and its experience requirements? For example, suppose a PC is just below the XP requirement for a level and is planning to undertake a major quest. Would it occur to the PC to consider undertaking a side quest to finish their next level attainment before taking on the major quest or do PCs perceive experience in a more real world, linear, continuous fashion?  As an analogy, one could consider "leveling up" in DnD to be analogous to real world standardized test score cutoff points, pay grades, military ranks, certification levels, athletic awards, martial arts belts, or academic degrees - practice math and reading long enough and one can get another 100 points on the SAT and qualify for admission to a slightly more prestigious college (or one could decide that it would be better to finish up their Second Degree Black Belt before entering that real world fighting contest), or one could consider XP to be an OOC abstraction of a fundamentally ineffable concept that PCs can barely understand, let alone quantify.  This question is not the same as  because that question is asking specifically about PC's recognizing that specific event when they have leveled up. This question is about whether PC's are aware of the concept of leveling up. It could be compared to the difference between a person recognizing that they have received an academic degree versus them understanding the concept of academic degrees and what one must generally accomplish to obtain them.


How to change back to classic Google Maps?   (The old question is obsolete, and the topic is protected so I can't answer it with updated answer!!!)


If we assume that  $p=2^{24036583}-1$ is the greatest prime number until now .How to find the number of the positive integer numbers $k$ that makes for the two quadratic equations $ \pm x^2   \pm px \pm k$ rational roots.


First of all, sorry for opening a new question about it, but I'm curious to understand:   John Hughes claims that $\langle p,q \rangle =0$ (in the end of his answer)  Why is it true?


Show that $f(x)=x^2$ is continuous at $a=2$ using the $\delta-\epsilon$ definition of continuity.

So we want to find a $\delta>0$   such that for all $2-\delta<x<2+\delta$  , we will have $4-\epsilon<x^{2}<4+\epsilon$ for all $\epsilon>0$  . If we can find a way to express $\delta$  as a function $\delta (\epsilon)$,  $\delta:\mathbb{R}_+ \to \mathbb{R}_+ $ then we will have solved the problem. But I can't see how to relate $\epsilon$ to $\delta$ in this case.  My initial reaction is write $(2-\delta)^2<x^2<(2+\delta)^2$, this makes the two inequalities look related, but I am not sure where to go from here.


Integration by parts $\cos(3\pi t)e^{-jwt}$

Can someone show me how do I continue from here? Or did I do wrong?  \begin{align} \int \cos(3 \pi t) e^{-jwt} dt &= e^{-jwt} \left(\frac{\sin (3 \pi t)}{3 \pi} \right)-\frac{jw}{(3 \pi)^2}e^{-jwt}\cos(3 \pi t) + \frac{jw}{3 \pi} \int \cos(3 \pi t) e^{-jwt} dt \end{align}  Let $L = ∫ \cos(3πt) e^{-jwt} dt $, then  \begin{align} L &= e^{-jwt} \left(\frac{\sin (3 \pi t)}{3 \pi} \right)-\frac{jw}{(3 \pi)^2}e^{-jwt}\cos(3 \pi t) + \frac{jw}{3 \pi} L \\ \implies L - \frac{jw}{3 \pi} L &= e^{-jwt} \left(\frac{\sin (3 \pi t)}{3 \pi} \right)-\frac{jw}{(3 \pi)^2}e^{-jwt}\cos(3 \pi t) \\ \implies L \left(1 - \frac{jw}{3 \pi} \right) &= \frac{jw}{(3 \pi)^2}\left[\frac{jw}{3 \pi} e^{-jwt}\sin (3 \pi t)- e^{-jwt}\cos(3 \pi t) \right] \\ \implies L  &= \frac{1}{\left(1 - \frac{jw}{3 \pi} \right)} \cdot\frac{jw}{(3 \pi)^2} \left[\frac{jw}{3 \pi} e^{-jwt}\sin (3 \pi t)- e^{-jwt}\cos(3 \pi t) \right] \end{align}


STI shifter sometimes doesn't catch in cooler weather

I've got a road bike with brake lever shifters, and it's developed a small problem with age: sometimes, the shifter doesn't catch the first time or two I push it. It'll move easily, with no resistance, since it's not actually pulling on the cable, then after a few tries, catch and work normally. The colder the temperature, the more often this happens.  I don't know how the mechanism works internally, so I'm curious what would cause this, and also whether it's (as I suspect) gradual wear of some part of the mechanism, and if it's likely to fail catastrophically, or gradually worsen.


What is the use of the "this" keyword after a constructor?

The following code is from the AvalonEdit project:  // Creates a new TextEditor instance.  public TextEditor() : this(new TextArea()) { }   I have no idea what the : this(new ... part does. Could you please help explain the C# syntax?


Clicking "flag" on a question that you already flagged as off-topic shows that you also flagged it as a duplicate

I flagged a question as off-topic because it was a "how to get started" question. After flagging the question, I then clicked flag again, and noticed that it had shown that I had not only flagged it as off-topic, but it also had shown that I flagged it as duplicate:    I am wondering if this is a bug, or if it is intentionally marked so because this type of question is frequently asked and likely has an answer already. If you look at my remaining flags, you will notice that it didn't consume an extra flag for the second reason, so this isn't a major issue.


Action principles and covariant equations

Can every physically sound differential equation, that is covariant, deterministic etc. be derived by extremising a suitable action using a suitable lagrangian, that may be arbitary. Is this a mathematical theorem?


How can I make use of the labels subdivision in a Deep Learning Image classification?

I want to solve an image classification problem. I want to recognize cats and dogs. However my labels are more detailed than this - they contain information about the dog/cat breed.  In other words I want to classify images into A and B, but for each photo I know labels such as A.1, A.2, B.1, B.2.  If I simply cast the labels into A and B I lose some of the expertise I have.  I can try to classify into detailed labels first and then cast the results.  However I don't want my neural network to focus on distinguishing between particular sublabels.  Are there any rules of a thumb on it? Any name for such a problem I don't know?


I am trying to install Ubuntu 18 on a new laptop (Asus, windows 10) with VMware.   I get the following error while installing:    Any way to fix this ?


print() without newline does not work when reading from stdin

I started writing a primitive ssh-like program for practice's sake. I was starting to check if the commands would be delivered properly before implementing any further functionality, so i just wrote a server which receives messages from the client and prints them in it's own console window, but before it receives a message, it sends a prefix to the client, which the client prints so it's right before ( to the left of) the user input. For the prefix to be to the left of the input i tried to use print( ... , end=''), but that seems to break the whole thing, and the prefix then does not print at all, as opposed to the solution where the prefix is printed the line before, where the program works perfectly fine besides that little problem.  TL;DR :  this (where s is the socket)  for n, line in enumerate(sys.stdin):     prefix = s.recv(16)     print(prefix.decode('utf-8'), end='')     s.send(line.encode('utf-8'))   code does not print the received prefix at all, only after closing the program with CTRL + D or CTRL + C as shown below:  czyngis@czyngis-mint:[directory censored]$ python3 cmd_client.py -t fc70:6872:4c6:10ae:71c::1 -p 9999 target: fc70:6872:4c6:10ae:71c::1 | port: 9999 connection established with: fc70:6872:4c6:10ae:71c::1 on port: 9999  first code sample  //< user input does not work :(   //< user input ^C<#CMD:><#CMD:><#CMD:>Traceback (most recent call last):   File "cmd_client.py", line 26, in <module>     for n, line in enumerate(sys.stdin): KeyboardInterrupt   and this ( where s is also the socket )  for n, line in enumerate(sys.stdin):     prefix = s.recv(16)     print(prefix.decode('utf-8'))     s.send(line.encode('utf-8'))   code does print the prefix, but in the previous line, as shown below:  czyngis@czyngis-mint:[directory censored]$ python3 cmd_client.py -t fc70:6872:4c6:10ae:71c::1 -p 9999 target: fc70:6872:4c6:10ae:71c::1 | port: 9999 connection established with: fc70:6872:4c6:10ae:71c::1 on port: 9999  <#CMD:> second code sample <#CMD:> works, but not quite :(^CTraceback (most recent call last):   File "cmd_client.py", line 26, in <module>     for n, line in enumerate(sys.stdin): KeyboardInterrupt   Thank You for any help in advance.


How do I take a screenshot of the dash, hud, and the application menu?

I'm trying to take a screenshot of the the dash, HUD and application menu (separately). But I am having difficulty getting a screenshot: the dash or HUD disappears before I can take it. I would appreciate advice.


When will I not see questions tagged as ignored anymore?

I really like the "Ignored Tags" function on Stack Overflow, and the fact that questions marked as ignored seem invisible to me (It really reduces the noise level a lot).  However on ServerFault the ignored questions are only dimmed/light gray and still visible.  How much rep do I need for this to work?    Thanks devinb, that "Hide Ignored Tags" solved it.


Show I use "lay," "laid," or "lain" in the following passage?

The ground was ice-cold, no hint of anyone having lay/laid/lain there   at all.   Which one is the correct option?


Can I delete the /Developer-3.2.6 or /Developer-3.2.5 folders?

I did a quick, pseudo-system audit this morning and found an unexpected directory hogging up ~10GB of space on my drive. I assume that it's a remnant from a reasonably recent upgrade to XCode 4, but that's more of a guess than anything else.  I'm not an Objective-C/Cocoa developer. XCode is really installed just to support Homebrew. Off the top of my head, I can't think of anything else that I do with it.   Are these older 3.2.x directories safe to delete if I can reinstall Xcode 4 or will doing so make kittens cry?


Get top coordinate of self --> calc(100vh - y)

I have an element and I want it to occupy all the space below it up to the bottom of the browser window.  can I somehow get the y offset of the element for this? I don't know how to define y:  .occupy-space-below {     max-height: calc(100vh - y); }


Convert Benjamini-Hochberg FDR Threshold to Adjusted Pvalues

Based on what I have learned (and also this article:  as well as the original 1995 paper), BH procedure requires specifies a FDR-value threshold. However, I have seen reported raw "adjusted pvalues" that simply adjust pvalues using BH, without specifying the procedure a FDR threshld. How precisely is this done without specifying the FDR threshold? (Previously asked here:  but with no answer)


For some time I've seen LaTeX-produced documents that had slight differences in fonts. When you looked at them, they had the same Computer-Modern or Latin-Modern, however, they looked more stylized (more lightweight).  By chance, and looking at another question here, I came across this document:  in which I've seen clearly the difference, and has to do with optical size for a font at a given (output) point size. Here is a capture:    Look how the last line (even when they're all typeset at 12pt) looks with a more light font. I also noticed that in some Beamer documents using the sans-serif family (some had a more lightweight version of the font).  So the question is, without using XeTeX or LuaTeX (just plain LaTeX/pdfTeX), how can I get that lightweight (optical at 17pt) font for the size I want?  PD. I also noticed that there were some differences if one used tex->dvi->dvips->ps and pdflatex->pdf. In some .ps documents I've seen through the web, the fonts looked more lightweight by default. Maybe some TeX installations select those bigger optical sizes by default to obtain a more pleasing font rendering.


i am interested in knowing about Full Screen Modal Window

Please specify about where to use full window modal over Modal popup. Refer attached images


car::Anova with random factor or lmer with random factor

I have 36 rats, some are highly impulsive (HI), some are low-impulsive (LI) and some are MIDs. I ran them on two separate days on an attention task with a variable ITI paradigm whereby a cue is presented pseudo-randomly after 3s, 5s, 7s and 9s. I'm looking at the probability of making a correct response (DV) as a function of the impulsivity phenotype (3 levels); Day (2 levels) and the ITI (4 levels), my random effect is rat_ID. I'm not sure whether I should use lmer or car::Anova with a random factor, below are codes for both: model = lme(prob_correct ~ Day*ITI*impulsivity, random=~1|rat_ID,              data=mydat2,             method="REML")  Anova(model)  OR lmecoeff<- lmer(prob_correct~Day*ITI*impulsivity+(1|rat_ID), data= mydat2) anova(lmecoeff)


How to determine if a restart is needed on my Ubuntu server?

I am running Ubuntu Server 16.04. Whenever I login it will tell me if I have updates which is great, I will run those updates and go about my business. The next time I login, it tells me that the server needs a restart.  My question is, besides logging out and logging back in, is there a way to tell if the machine needs a reboot?


I created a live USB using Unetbootin (distribution: ubuntu 12.04 ) from the alternate installation ISO, but while booting "try ubuntu" option is not displayed in Unetbootin menu. Is there any way to try this ubuntu distribution without installing ?


How can set these iptables rules to run at startup

I usually run my iptables rules whenever I login. From the terminal I type ;  sudo sh firewall.sh   Setting up my sister's computer, I want to give her some basic firewall protection. She wont be logging in as admin, just a standard account. How can I make a firewall script run everytime she logs in without her having to type in any password?  The script I wrote for my sister's computer contains ;   #!/bin/sh  modprobe ip_conntrack iptables -F iptables -X iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP  iptables -I OUTPUT -p tcp --dport 80 --sport 32768:61000 -j ACCEPT iptables -I OUTPUT -p udp --dport 53 --sport 32768:61000 -j ACCEPT iptables -I OUTPUT -p tcp --dport 443 --sport 32768:61000 -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT iptables -I OUTPUT -p icmp -j DROP  iptables -I INPUT -p icmp -j DROP iptables -I INPUT -p udp -j DROP iptables -I INPUT -p tcp -m tcp --syn -j DROP iptables -I INPUT -i lo -j ACCEPT iptables -I INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT   I've placed it in her home folder as firewall.sh and set it to be executable (right click on the file, and checking the "allow executing file as program" option in the permissions tab).  Running this script from the terminal as root works fine.    After typing ;  sudo sh firewall.sh   I typed into the terminal  sudo iptables -L -v   and I get  Chain INPUT (policy DROP 0 packets, 0 bytes)  pkts bytes target     prot opt in     out     source               destination              0     0 ACCEPT     all  --  any    any     anywhere             anywhere             ctstate RELATED,ESTABLISHED     0     0 ACCEPT     all  --  lo     any     anywhere             anywhere                 0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/SYN     0     0 DROP       udp  --  any    any     anywhere             anywhere                 0     0 DROP       icmp --  any    any     anywhere             anywhere              Chain FORWARD (policy DROP 0 packets, 0 bytes)  pkts bytes target     prot opt in     out     source               destination           Chain OUTPUT (policy DROP 0 packets, 0 bytes)  pkts bytes target     prot opt in     out     source               destination              0     0 DROP       icmp --  any    any     anywhere             anywhere                 0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spts:32768:61000 dpt:https     0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spts:32768:61000 dpt:domain     0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spts:32768:61000 dpt:http     0     0 ACCEPT     all  --  any    lo      anywhere             anywhere   How can I have this this script run automatically at login, or possibly save these rules permanently for my sisters computer? Could you please provide some detailed code, as my first attempts at rc.local method and iptables-save have not been very successful. On every reboot, all INPUT, OUTPUT and FORWARD chains are reset to ACCEPT, with no policies listed when I type sudo iptables -L -v


How do I remove items from, or add items to, a select box? I'm running jQuery, should that make the task easier. Below is an example select box.  <select name="selectBox" id="selectBox">     <option value="option1">option1</option>     <option value="option2">option2</option>     <option value="option3">option3</option>     <option value="option4">option4</option>     </select>


Switching field of study from computer science to GIS in the post graduate level

I have a B.Sc. in CS, but I want to further in the GIS (geographical information system) line. I am thinking I'd have to do some sort of post-graduate diploma in GIS, before I can go for a M.Sc., which is necessary to hit my mark, seemingly...  I need your guidance about this case.  Thank you very much


Limit calculation using Lagrange mean value

Here the problem is from the book, Problems in real analysis.     Prove that for real number $p \geq 0$ we hanve   $$\lim_{n \rightarrow \infty} \frac{(1^{1^p}2^{2^p}\cdots n^{n^p})^{1/n^{p+1}}}{n^{1/(p+1)}} = e^{-1/(p+1)^2}$$   Hint. Use the mean value theorem. For instance, in the particular case $p=2$, apply the Lagrange mean value theorem to the function $f(x) = (x^3 \ln x)/3 - x^3/9$ on the interval $[k,k+1], 1 \leq k \leq n$ .   I tried to calculate it by the way the hint indicates, but I failed. There must be a number $c_k$ such that $k \leq c_k \leq k+1$ by the mean value theorem. I don't know how to calculate it by using this. Help me.


Reputation is not showing in question page

Why reputation of author is not showing on question page, but same is showing in tag page.    Reputation of author is shown in tag page     Reputation of author is not shown in question page


Tricky probability questions re Tenis match

A tennis match is played as a series of POINTS, contained within GAMES, which in turn are contained within SETS.  If a player reaches 4 or more points won in a game, and also has won 2 points more than their opponent, then they win that game.  If a player reaches 6 or more games won in a set, and also has won 2 games more than their opponent, then they win that set. If both players reach 6 games, then a TIE-BREAK is played to determine the winner of the set.  Suppose Djokovic plays a set of tennis against Murray under these rules, and his probablity of winning a point is 0.48. Assuming the probability of winning a point remains constant throughout, what would be the probability of Djokovic winning the set 7-5?  I do understand the questions but my problem is at a fundamental level of posing the problem so some guideance would be appreciated and yes, I am a total noob


Order of a group and subsequent subgroups

I want to prove that if the order of a group G is greater than 1 and non-prime, then G has a subgroup other than the trivial subgroups {e} and G itself.   I am confused because I am only being able to prove the case for prime order by using Lagrange’s theorem i.e. if I have a group of order p, where p is a prime number, then the order of subgroups must divide p, hence the order can be either 1 or p.   How do I go about proving the case for non prime order let’s say x > 1?


What's an intuitive way of looking at quotient spaces?

I understand the concept of $\mathbb{Z}/n\mathbb{Z}$, but I am having a really hard time understanding how this concept of quotients applies to vector spaces. Suppose $V = \mathbb{F}[x]$ is a vector space and $U \le V$. What exactly does $V/U$ represent?


Trying to rename .xml files in unix directory

I have around 5000 .xml files in my unix directory. I want to add extension Hist to all the file names before .xml extension. For example if the file is ABCD.xml, I want to rename it to ABCDHist.xml. And I want to do this for all the 5000 files in my directory. Is there a one line command to do that?  Edit  I am doing this on a unix (aix) box and tool that I am using is attachmate reflection ssh client. Does not look like perl commands are executable there.


How do I block domains using the hosts file on Windows?

I used to block domains on Windows using the hosts file like the following:  127.0.0.1 www.cnn.com   However, now it is not working and the domains are resolving.   $ nslookup www.cnn.com Non-authoritative answer: Server:  cdns01.comcast.net Address:  2001:558:feed::1  Name:    turner-tls.map.fastly.net Addresses:  2a04:4e42:1c::323           151.101.117.67 Aliases:  www.cnn.com  >ping www.cnn.com  Pinging turner-tls.map.fastly.net [2a04:4e42:1c::323] with 32 bytes of data: Reply from 2a04:4e42:1c::323: time=16ms   I don't know what changed. How can I continue to block domains using the hosts file on Windows? Why did Windows suddenly stop using the hosts file?  >icacls \Windows\system32\drivers\etc\hosts \Windows\system32\drivers\etc\hosts NT AUTHORITY\SYSTEM:(I)(F)                                     BUILTIN\Administrators:(I)(F)                                     BUILTIN\Users:(I)(RX)                                     APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)  Successfully processed 1 files; Failed processing 0 files  C:\Users\Chloe>ipconfig /flushdns  Windows IP Configuration  Successfully flushed the DNS Resolver Cache.  C:\Users\Chloe>nslookup www.cnn.com Server:  cdns01.comcast.net Address:  2001:558:feed::1  Non-authoritative answer: Name:    turner-tls.map.fastly.net Addresses:  2a04:4e42:1c::323           151.101.117.67 Aliases:  www.cnn.com   Windows 8.1


My program never ends even after the"break;" statement is fulfilled

import java.util.ArrayList; import java.util.Scanner;  public class ThirdElement {      public static void main(String[] args) {         Scanner name = new Scanner(System.in);         ArrayList list = new ArrayList < > ();          while (true) {             list.add(name.nextLine());              if (name.nextLine() == "") {                 break;             }         }         System.out.println(list.get(2));     } }   I can't figure out how to get the while loop to break as well as print the desired "get" statement correctly.


NOR Gate is Working Correctly with Vcc Pin Disconnected

I modified my Sega Master System to have a pause button on the actual controller. To process the signal, I soldered a quad NOR gate to the I/O and CPU circuits in the console. The idea is that the controller pause button sends a combined UP/DOWN signal, and the gate processes it and sends an NMI to the CPU, which is what the Pause button on the actual console does. This is the procedure recommended at the SMSPower forum, and I followed their diagrams.  Here's the thing: I installed the gate upside down, so that the packaging is resting on the circuit board, and the pins are sticking up in the air. I did this so it would be easier to solder the pins to the console, reasoning that the package is non-conductive anyway. When I tested it out, it didn't work correctly. As I was troubleshooting with my logic probe, I accidentally dislodged the Vcc connection, which I had soldered to a +5 Vcc solder point on the board. All of a sudden, it works correctly! I've checked the pin assignments over and over, and I'm positive that the Vcc pin isn't connected to anything; yet, the chip has power, and works as it is supposed to.  So, what is going on here? Was it a bad idea to install the chip package so that it touches the board? And why is the chip working when the Vcc pin is disconnected?  (edited to add requested information)  The gate is a CD4001AE Quad NOR; the datasheet is here:    The schematic is here, at the bottom of the page:


NullPointerException when loading list in fragment by customCursorAdapter

package com.example.shubhraj.notesp;  import android.content.Context; import android.database.Cursor; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CursorAdapter; import android.widget.SimpleCursorAdapter; import android.widget.TextView;  import com.example.shubhraj.notesp.data.NoteContract.NoteEntry;  /**  * {@link NoteCursorAdapter} is an adapter for a list or grid view  * that uses a {@link Cursor} of pet data as its data source. This adapter knows  * how to create list items for each row of pet data in the {@link Cursor}.  */ public class NoteCursorAdapter extends CursorAdapter {      /**      * Constructs a new {@link NoteCursorAdapter}.      *      * @param context The context      * @param c       The cursor from which to get the data.      */     public NoteCursorAdapter(Context context, Cursor c) {         super(context, c,0);     }     /**      * Makes a new blank list item view. No data is set (or bound) to the views yet.      *      * @param context app context      * @param cursor  The cursor from which to get the data. The cursor is already      *                moved to the correct position.      * @param parent  The parent to which the new view is attached to      * @return the newly created list item view.      */     @Override     public View newView(Context context, Cursor cursor, ViewGroup parent) {         // Inflate a list item view using the layout specified in list_item.xml         LayoutInflater inflater = LayoutInflater.from(context);         return inflater.inflate(R.layout.fragment_note_list, parent, false);         //return LayoutInflater.from(context).inflate(R.layout.fragment_note_list, parent, false);     }      /**      * This method binds the pet data (in the current row pointed to by cursor) to the given      * list item layout. For example, the name for the current pet can be set on the name TextView      * in the list item layout.      *      * @param view    Existing view, returned earlier by newView() method      * @param context app context      * @param cursor  The cursor from which to get the data. The cursor is already moved to the      *                correct row.      */     @Override     public void bindView(View view, Context context, Cursor cursor)     {         // Find individual views that we want to modify in the list item layout         TextView nameTextView = (TextView) view.findViewById(R.id.note);          // Find the columns of pet attributes that we're interested in         int nameColumnIndex = cursor.getColumnIndex(NoteEntry.COLUMN_NOTE_CONTENT);          // Read the pet attributes from the Cursor for the current pet         String noteContent = cursor.getString(nameColumnIndex);          // Update the TextViews with the attributes for the current pet         nameTextView.setText(noteContent);     } }   EXCEPTION:-FATAL EXCEPTION: main                                                                                Process: com.example.shubhraj.notesp, PID: 22020                                                                           java.lang.NullPointerException at com.example.shubhraj.notesp.NoteCursorAdapter.bindView(NoteCursorAdapter.java:70) The error is showing at nameTextView.setText(noteContent);


Gmail permanently delete a message via a filter

When choosing to delete an email via a filter, the message is sent to the trash. Is there any way to permanently delete it instead?  I tried deleting it twice with two different filters (the logic is that if you delete a message in the trash, it should be permanently deleted), and, although , it doesn't permanently delete the message.


I want to develop a JavaFX application that can store data in a database. But I'm getting a null pointer exception

This is a piece of my Database Class, what I want it to do is to get the String from the name Textfield in my Main Class and insert into the Database with the method insertIntoTable(). But all I get when I run the Application is Error in JavaFX Thread Null Pointer Exception.    Database Class:      Connection connect() {         Connection conn = null;          try {             Class.forName("org.postresql.Driver");             conn = DriverManager.getConnection(url, user, password);           //System.out.println("Connected to the PostgreSQL server successfully.");          } catch (Exception e) {              e.getMessage();          }          return conn;     }       public void insertIntoTable(String naam) {         try {             conn = this.connect();             Statement st;             st = conn.createStatement();             ResultSet rs = st.executeQuery("INSERT INTO eigenschappen (naam)  VALUES (" + naam + ")");             while (rs.next()) {                 System.out.println(rs.getString(1));             }         } catch (SQLException e) {              e.getMessage();          }     } }   The Textfield in Main Class(JavaFx)  Main Class      TextField contactNaamField = new TextField();     Button opslaan = new Button("Opslaan");     Database db = new Database();       public static void main(String[] args) {         launch(args);      }      public void start(Stage primaryStage) throws Exception {          opslaan.setOnMouseClicked(e -> {             String naam = contactNaamField.getText();              db.insertIntoTable(naam);         });     } }


Is there any big changes if I use different VPS with better RAM?

Currently, my Rails app is working on a server with 1GB RAM. I feel it's so slow so that I'm planning to shift to better Server.  There are 3 choices such as 2GB, 4GB, and 6GB. or 2GB with SSD. Is there any big changes if I just move all the files of Rails app to there, and prepare exactly the same deployment?  Is 1GB RAM is too low for Rails? Anyone has any idea about this?


How to get line strings with special word start and end?

Here is the file strings.xml which includeing 3 sentences:  1.string name="schedulelist_nofiles">Não existe agenda de registro! Por favor,   here is missing line tecla “Add” (Adicionar) para adicionar uma. string  2.You should skip this line!  3.string name="Programme_name">GUIA DE PROGRAMA string  I use cat command 'cat strings.xml | grep "string name=" but it only get below lines:  string name="schedulelist_nofiles">Não existe agenda de registro! Por favor,  string name="Programme_name">GUIA DE PROGRAMA string  I want to get the complete line like this , just like sentence 3, start with 'string name' and end with "string". What can I do for this?


sudo echo "something" >> /etc/privilegedFile doesn't work

This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux.  There are a lot of times when I just want to append something to /etc/hosts or a similar file but end up not being able to because both > and >> are not allowed, even with root.  Is there someway to make this work without having to su or sudo su into root?