I have a double and I want to round down to values 0.00000/0.00005 using C89/ANSI C. So:  1.10984 becomes 1.10980 1.10985 becomes 1.10985 1.10986 becomes 1.10985 1.10988 becomes 1.10985 1.10989 becomes 1.10985 1.10990 becomes 1.10990 1.10991 becomes 1.10990   I have tried:  roundedDouble = doubleToRound - (doubleToRound % 0.00005);   But % operator only works with integers.  Solution shall work also with the following rounding down cases:  0.000000 / 0.000025 / 0.000050 / 0.000075    and  0.00001 / 0.00002 / 0.00003 / 0.00004 / ... / 0.00008 / 0.00009

Is there a function to round a float in C or do I need to write my own?       float conver = 45.592346543;   I would like to round the actual value to one decimal place, conver = 45.6.


How do I show that $\gcd(a^2, b^2) = 1$ when $\gcd(a,b)=1$?  I can show that $\gcd(a,b)=1$ implies $\gcd(a^2,b)=1$ and $\gcd(a,b^2)=1$.  But what do I do here?

Using Bezout's identity I have shown  $$(a,b^2)=(b,a^2)=1$$  but what should be the next step? Thanks.


What is the best way to store simple syrup, made from equal parts of sugar and water? Do I store it on the counter, or in the refrigerator?

I'm curious about plain simple syrup and simple syrup with other ingredients. For instance, cardamon simply syrup. Do other ingredients make a difference?


This might seem like a very simple question, but what is the easiest way to turn a normal vertical list into a horizontal one?


I'm trying to recall a short story based around a spaceship pilot who's never flown in space - at least not consciously.  As soon as he enters the ship's flight deck, John's second personality takes over, flies the ship to its destination, lands, and "John 1" re-emerges and goes on his merry way.   Of course, in the course of the story, this tidy arrangement goes awry and John's third personality is called upon to save the day.

Possibly from the 1970s or 1980s. Humans can't pilot a spaceship without going insane, so spaceship pilots have a secondary personality that kicks in as they walk through the cockpit door. The pilot can't remember anything that happens after that, until they go back through the door and their own personality comes back. The pilot later finds out that he has a third personality which takes over in an emergency.


I have a existing DVD (happens to be Windows 7), and I would like to copy it to another DVD.  Before doing so, I would like to slightly modify the content by deleting a single file.  I can either use Linux or Windows.  How can I do this?  Reference  for why I wish to do this.  Thank you

I want to open a ISO file, add files and then burn it to a disc.  By example, I get the . That ISO have 2.6mb, and if I burn the iso, I will lost the remainder 697mb of the disk!   To burn the ISO, I use CD Burner XP or ImgBurn, but I don't know which free tool I can use to add/remove files before burn.  Thank you very much!


Our daughter is 2 years and 5 months old and for some time already she knows all the letters (i.e. both reciting and recognising letter by letter in written words), numbers to 10, common shapes, and colours. However she's not talking in full sentences yet. Considering when children usually getting interested in written letters, this seems to be pretty good.  If she has an ability in this and likes it, what else can I teach her? Of course I was thinking about reading, but teaching reading in English is quite different to our native language, so I'm not sure about phonics reading vs sight word reading and all that stuff. I'd like to read some scientific materials on how children learn to read (you know not usual recommendations like blah blah don't worry, all children are different). Or maybe not reading at all? What are activities we can try to help encourage her memory and pattern recognition skills?  This is not a question about such skills vs social skills, physical skills and so on. So please don't recommend that it is better to learn to play with other kids - that's just a separate question.

My two year old daughter has never been to a daycare, so everything she knows is something that me, my husband, or her grandparents have taught her. She sees very little interaction with other kids her age, well, except for her 8 month old sister.   I am wondering what people, or even day care centers, teach two year olds. What do they do all day long? Presently, our daughter draws a lot - she has bathtub crayons, wax crayons for paper, and chalk for the driveway/sidewalk. She attempts to draw circles and lines. We try to teach her shapes and colors, and she has a rough idea of what they are. She plays with sand in the sandbox a lot, dumping sand all over her and her sister's head. She goes to her playhouse and uses the slide and the swing.   We sing songs together - the alphabet song or the numbers song. She is able to say the correct word when I say the phonic (i.e. if I say B, she'll say ball; if I say H, she'll say hat). She tries counting, but is still learning (she goes 1, 2, 6, 7, 8...). She enjoys building and destroying towers. We read books and I sing some nursery rhymes. She plays a toy piano and dances around to it. She plays with playdough, but most of the time it just ends up in crumbs everywhere.  She also watches TV - something I know most parents object to. She enjoys watching Dora, Finding Nemo, and Cinderella. She will sometimes watch LeapFrog phonics videos for alphabet and numbers.   I am not trying to give a resume for my daughter, but merely wondering is there something more that kids her age do? Is there something else that I should be teaching her? What do kids her age do at a daycare?   Thanks


i am looking for a method or maybe a conversion table that knows how to convert Umlauts and special characters to their most likely representation in ascii.  Example:  Ärger = aerger Bôhme = bohme Søren = soeren pjérà = pjera   Anyone any idea?  Update: Apart from the good accepted Answer, i also found PECLs  to be quite interesting, though i can not use it due to the server not having it and not being changed for me.  Also do check out  if the Answers here do not help you enough.

What I want to do is to remove all accents and umlauts from a string, turning "lärm" into "larm" or "andré" into "andre". What I tried to do was to utf8_decode the string and then use strtr on it, but since my source file is saved as UTF-8 file, I can't enter the ISO-8859-15 characters for all umlauts - the editor inserts the UTF-8 characters.  Obviously a solution for this would be to have an include that's an ISO-8859-15 file, but there must be a better way than to have another required include?  echo strtr(utf8_decode($input),             'ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ',            'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy');   UPDATE: Maybe I was a bit inaccurate with what I try to do: I do not actually want to remove the umlauts, but to replace them with their closest "one character ASCII" equivalent.


Problem on  Riemann Integration: $f$ is defined on $[0,1]$ by $\,f(x)=1/n$ for $1/n>x\geq 1/(n+1)$ and $f(x)=0$ for $x=0$, where $n=1,2,3,....$ Find $\int_{0}^1f(x)dx$.  First I tried to find out $\int_{1/(n+1)}^1f(x)dx$. But I got a series sum:$$\sum_{k=1}^{n}\cfrac{1}{k^2(k+1)}$$ How to proceed?

Is the function Riemann integrable? If yes, obtain the value of $\int_0^1f(x) \ dx$      $f(x) = \begin{cases} \frac {1}{n},  & \frac{1}{n+1}<x\le\frac{1}{n}\\ 0, & x=0 \end{cases}$   My attempt  $f$ is bounded and monotonically increasing on $[0,1]$. Also, $f$ has infinite discontinuities but only one limit point. Therefore $f$ is Riemann integrable. Now, to calculate the integration  $\int_0^1f(x) \ dx=\int_{1/2}^{1}1 \ dx + \int_{1/3}^{1/2}\frac{1}{2} \ dx + \int_{1/4}^{1/3}\frac{1}{3} \ dx+...$  $=\sum_{n=1}^\infty \frac{1}{n^2}-\frac{1}{n}+\frac{1}{n+1}$  How do I proceed from here? How do I calculate these summations? I know $\sum \frac{1}{n}$ is $\log 2$, but not the other two summations.


When writing switch statements in C++, it seems necessary to include a break after every case. Otherwise, the code will continue to run into the next case.  For example:  int x = 1; switch (x) {     case 0:         std::cout << "x is 0." << std::endl;     case 1:         std::cout << "x is 1." << std::endl;     case 2:         std::cout << "x is 2." << std::endl;     default:         std::cout << "x is neither 0, 1 nor 2." << std::endl; }   Will return:  >> x is 1. >> x is 2.   However:  int x = 1; switch (x) {     case 0:         std::cout << "x is 0." << std::endl;         break;     case 1:         std::cout << "x is 1." << std::endl;         break;     case 2:         std::cout << "x is 2." << std::endl;         break;     default:         std::cout << "x is neither 0, 1 nor 2." << std::endl;         break; }   Will return:  >> x is 1.   My question is: If it is necessary to include the break for every case, then why does C++ require it to be explicitly written at all? Why not just break the switch statement after every case by default in C++? Are there any examples when this behaviour may not in fact be desired?

For as long as I can remember I have avoided using switch statement fall-through. Actually, I can't remember it ever entering my consciousness as a possible way to do things as it was drilled into my head early on that it was nothing more than a bug in the switch statement. However, today I ran across some code that uses it by design, which got me immediately wondering what everyone in the community thinks about switch statement fall-through. Is it something that a programming language should explicitly not allow (like C# does, though it supplies a workaround) or is it a feature of any language that is powerful enough to leave in the programmer's hands? Edit: I wasn't specific enough to what I meant by fall-through. I use this type a lot:     switch(m_loadAnimSubCt){         case 0:         case 1:             // Do something             break;         case 2:         case 3:         case 4:             // Do something             break;    }  However, I'm concerned about something like this.    switch(m_loadAnimSubCt){         case 0:         case 1:             // Do something, but fall through to the other cases             // after doing it.          case 2:         case 3:         case 4:             // Do something else.             break;    }  This way whenever the case is 0, 1 it will do everything in the switch statement. I've seen this by design and I just don't know if I agree that switch statements should be used this way. I think the first code example is very useful and safe. The second seems kind of dangerous.


The edge of Jupiter .    Even more bothersome, the  looks sharp, aside from kind of a soup of particles floating above it.    The sun's surface has an incredibly low density.  I mean, $10^{-6} g/cm^3$ kind of density ().  The Earth's atmosphere looks very hazy, and rightly so, because it's a gas.    Since Jupiter and the sun are 100% gas, why don't they appear as smudges on our telescopes?  To say "smudge" in a more scientific way, why isn't the transition zone between opacity and transparency a significant fraction of the radii of gaseous bodies?

In photographs of Jupiter, . Being a gas giant, my naive self thinks that the atmosphere should have a more gradual cut off, creating a hazy effect similar to that on Titan. I am aware of Jupiter's immense size, so each pixel in the linked photograph is likely tens or hundreds of kilometers. Even so, wouldn't there be some small smudge? Does perhaps Jupiter's terrific gravity have any effect on the apparent edge of its atmosphere?


I am trying to cover the below class. I am getting 71%. Can you please let me know how to cover .  public class OpportunityRecordTypeSelectionCtr {  @AuraEnabled public static string findRecordTypes(string objName){     string returnString='';     string queryString='Select id, name from RecordType where sobjectType =: objName and IsActive=true ORDER BY Name DESC';     List<sobject> recordList= Database.query(queryString);     List<RecordTypeWrapper> wrapperList=new List<RecordTypeWrapper>();     for(sobject sb : recordList)  {         RecordTypeWrapper rw=new RecordTypeWrapper();         rw.recordTypeLabel=string.valueof(sb.get('name'));         rw.recordTypeId=string.valueof(sb.get('id'));         wrapperList.add(rw);     }      returnString= JSON.serialize(wrapperList);     system.debug('*****'+returnString);     return returnString; } public class RecordTypeWrapper{     public string recordTypeLabel{get;set;}     public string recordTypeId{get;set;} }   }  Test class:  @isTest private class OpportunityRecordTypeSelectionCtr_Test {     static testMethod void testRecordTypes(){     string objName;     OpportunityRecordTypeSelectionCtr.findRecordTypes(objName);       string recordTypeLabel;         string recordTypeId;     OpportunityRecordTypeSelectionCtr.RecordTypeWrapper recordTypeWrap = new OpportunityRecordTypeSelectionCtr.RecordTypeWrapper();      recordTypeWrap.recordTypeLabel = recordTypeLabel;         recordTypeWrap.recordTypeId = recordTypeId;     } }   Unable to cover below lines of code.  RecordTypeWrapper rw=new RecordTypeWrapper();             rw.recordTypeLabel=string.valueof(sb.get('name'));             rw.recordTypeId=string.valueof(sb.get('id'));             wrapperList.add(rw);

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered?


Lets say there is an open interval (a,b) where a,b are real numbers. Is it true that (a,b) has cardinality equal to real numbers?

I want to prove that any open interval $(a,b)$ has the same cardinality of the real numbers: $|(a,b)| = |\Bbb R|$.   Do I have to find an function to prove it? Or is there a theorem to prove it easier? or any idea?


I've looked at diff-lcs (  ) but it's poorly documented, and appears to be unmaintained.  Are there any good, actively maintained ruby gems for diffing text or html files?

How do I do a diff of two strings or arrays in Ruby?


I have a problem with the autocomplete in HTML, I'd like to remove it from a SELECT in a web page, so it doesn't appear over the page:      This is  what I want because I'm printing the result in the bottom.     <form>     <input type="text" id="nameSearch" name="nameSearch" onkeyup="searchInput(this.value)">

 </form>    I tried to add the autocomplete tag, but it works only with the INPUT tag.  <input autocomplete="off">

How do you disable autocomplete in the major browsers for a specific input (or form field)?


I have a question on the following exercise presented in Dummit and Foote, $\S 3.5$. The exercise is stated as follows:   Problem:  Show that if $p$ is prime, $S_p = \langle \sigma, \tau \rangle$ where $\sigma$ is any transposition and $\tau$ is any $p$-cycle.   My question is how can any $p$-cycle be an element of $S_p$? Since $\sigma$ is a generator of $S_p$ we must have that $\sigma \in S_p$. But consider $(4\ 8\ 9\ 10\ 11)$. This is a $5$-cycle but it is not a member of $S_p$. What am I missing here? It would seem this is a counter example showing the theorem to be false, which I am skeptical of!   Thanks

I want to solve the following:     Let $p$ be a prime number and let $a$ be a p-cycle in $S_p$, and let $b$ be a transposition in $S_p$. Show $S_p$ is generated by $a$ and $b$.   My attempt  Write $a=(y_1 \space y_2 \space ...\space y_p)$ and $b=(z_1 \space z_2)$. WLOG, $y_1=z_1=1$. WLOG, we can also assume $a=(1 \space 2 \space ... \space p).$   Let $σ\in S_p$. It should be obvious that $σ$ is a product of transpositions, so to show $σ \in S_p$, it suffices to show every transposition can be written in terms of $(1 \space 2 \space ... \space p)$ and $(1 \space z_2)$. But how do I show this?  Duplicate? I think not.  Although another question (already answered on math.SE) is similar to mine, I do not believe that mine is a duplicate. The other question is equivalent to mine only for the special case when $z_2=2$, but not for general $z_2$.


I am a green card holder of USA, and I am travelling to India. While leaving India for the US, I want to carry dollars. What is the limit that I can carry to US, being a green card holder?

I was wondering if someone knows the legal limit of cash money allowed per adult tourist when entering the US, especially from the UK.  The reason is that I would like to get the best conversion rate and buy some dollars (selling my GBP) at the UK cambios/exchange offices so that my bank fees and other charges can be avoided. Therefore, taking the legal limit of cash will help me to make the most out from the currency conversion mishapps.  Any idea on those numbers?


I have a friend I meet over the internet. She claims the following below. Is she correct? I told her she is only staying a week!   "I can’t get a visa if I can’t prove my financial viability. This is a mandatory rule for all citizens traveling abroad as an independent tourist. I can not do anything. If I don’t have the full amount and until February 3 we can’t find the remaining 3155 $ USD."

On Travel.SE we often see questions about a person (usually a love interest) asking for money to pay for airfare, visas, permits and other expenses. For example        What general advice can be given in such situations to the person asking the question? Is it all a scam or can there be legitimate situations in which an online friend could be asking for money?


I live in an apartment with a public wireless router which requires you to log in via a splash-screen page.  I want to have my own private wireless router which logs into the public wireless router once, obtains an IP address, and then shares that IP address freely for use within my own private LAN. This way my devices can use the private router without having to log into the splash screen of the public router.  I have a TL-WR841N for my private router. How can I pull this off?  Edit:  The TL-WR841N is v9 so I don't think I can use open wrt or dd-wrt.   Edit 2:  I found this program Virtual Router () which seems to do the job just using a laptop with only 1 WiFi adapter. However it appears the bandwidth gets halved, which is expected.   My new plan is to use a USB WiFi adapter, giving the laptop 2 Wifi adapters, and then sharing the internet connection from one on the other via an ad-hoc network. I believe it will be important that both adapters are on non-overlapping frequencies as to prevent collisions. I'm hoping this doesn't halve the bandwidth like the Virtual Router does.

I have an ISP (Beam telecom, if it's relevant) that provides only a LAN cable connection. Using this, whichever site you initially open, you are redirected to its portal page where you are required to log in. After this you can access internet as normal.  The problem that I am facing is when I am trying to setup my ADSL router to use it as a WiFi router so that multiple devices can connect to the internet.  I have connected the ISP's RJ-45 cable into one of my ADSL router's LAN ports and I am able to connect to the internet through the WiFi network using the same process.  The problem is that, when one of the devices has successfully authenticated with the portal (and has been assigned an IP), if I try to use that WiFi from any other device, I am again greeted with the portal page. After authenticating I get access to the Internet in this device, but the previous device loses Internet access and that device is greeted with the portal login page.  So in effect only one device is able to connect to the Internet at a given time.   I have seen few forum posts saying if I use a normal WiFi router which has a WAN port and not the ADSL that I currently have. Would resolve the issue. But I am in doubt if this would really fetch me anything, and I don't want to spend money on another router if it is still in vain.  So any ideas if a non-ADSL router would resolve this issue or if I can change my existing router's settings so that I can connect more than one device?  My ADSL router is a Linksys Wireless-G ADSL Home Gateway, model WAG200G.  Would a flash of DD-WRT custom firmware on my device provide new options that would allow me to make use of my ADSL to work as a normal WiFi router?


I just downloaded  . How do I install it? I am used to Windows programs installs where you open a .exe, simple and clean.  I see these files:  data.tar.gz control.tar.gz debian-binary   Each of these files have more files within them.

I have installed Debian on my pc, but the problem is that at the moment I have no Internet connection to this pc. So, to install a program I have to manually downloaded from a pc with internet and then install it to the linux-debian computer.  The question is this: Is there a standard way to make the installation manually? Note that when I connect a usb flash with the program I want to install(that is:   cdparanoia_3.10.2+debian-10.1_i386.deb) and I try opening it I get the message:     Failed to execute child process “ar” no file or directory.


I am getting the following error in VScode IDE . Kindly help me with the Solutions related to VScode   I created a package named as test in visual studio code . The program written in that package failed to execute  , program is :  package test; public class Example{ public static void main(String args[]) {     System.out.println("HELLO"); } }   It throws an   the same program works completely fine when placed in the default package  kindly help me with the package working or help me if there is any setting in vscode which has to be setup

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


Let's define the polynomial $p(x)$ as one of the following polynomials:  $x^n-1$ or $x^{n-1}+x^{n-2}+...+1$ Does  $Z[x]/(3, p(x))$  mean that we take the modulo of the elements of $Z[x]$ according to $p(x)$ and then take the modulo again according to 3? If so, does that mean  $Z[x]/(3,p(x))=Z_3[x]/(p(x))$? Also does it make any difference if the polynomial differs? I mean is it true for any polynomials?

I am asked to describe the quotient ring $\,\Bbb{Z}[X]/\langle X^2+1,2\rangle$ in two different ways. I would say that $\Bbb{Z}[X]/\langle X^2+1,2\rangle$ is isomorphic to $\Bbb{F}_2[X]/\langle X^2+1\rangle$ and $\Bbb{Z}[i]/\langle 2\rangle$ but I am not sure how can I justify that. Does we have $\langle X^2+1,2\rangle=\langle X^2+1\rangle\langle2\rangle$? I think the answer is no, because $\langle X^2+1,2\rangle=2P(X)+(X^2+1)Q(X)$. How can I justify the two isomorphism ?


How to display all the lines which ends with the word unix in any given file and sorts those lines in ascending order.

I want to find a text file in my hard disk which contains a specific word.  Prior to Ubuntu 12.4 I used to start in the dash an application, I think it was called "Search for file...", whose icon was a magnifying glass.I can't find that simple application any more.


I installed MiKTex 2.9  and want to run a presentation, but always get the Error   "beamer.cls not found" as you can see in picture. The problem is that whenever I search beamer.cls in CTAN website I get nothing !! Where can I found this package ? And where should I send it?  Thanks for your kind helps  following is the picture of all files I have in my MiKTex' file

I set the Install Packages on the Fly setting to Yes and try to compile my document in Texmaker, but I still get the error File [...] not found, where [...] is the package I need. Basically, I need to manually install every package I use.   For example, I want to use the footmisc package. I put \usepackage[bottom]{footmisc}, and I get the error ! LaTeX Error: File 'footmisc.sty' not found.  Is this a known bug, or am I misunderstanding this feature?


I have been trying to figure out the reason for 2 days and have lost all hope.  The problem is that Cycles Render doesn't upgrade. If I make any changes in the 3D view everywhere else the changes are visible and apparent but when I try to render or animate (press buttons Render or Animate info file) under "Camera" tab, then only previous versions will be rendered.   Blender file can be located here:   What I've checked so far:    I've toggled Local/Global view - no effect. All viewpoints are activated in render mode (everywhere camera icon is switched on) All objects have layers attached to them under RenderLayer   There was no difference with either rendering in Cycles Render or Blender Render    Here is an example of the difference of both views before and after "Render" of the same frame.    Is there anywhere an option that keeps only the first rendering result in cache and takes the information from there (that I could possibly need to uncheck).   HELP!

Blender is rendering an older version of my project, not the most recent one. I have made it using the Blender Render but it does not want to render in cycles either. A black and grey screen is rendered as if everything is transparent. Checked general camera, lighting and compute devises in case I messed something up but I can't find anything. All my textures and objects look normal, does anybody know what is wrong or what to check?  Ok added link:


I am from Turkey and I am married to a Spanish woman. We live in Spain and I have Family Resident Card issued by the Spanish authorities. We are going to the  UK for a 4-day trip. I applied for an EEA family permit but was told that it can take more than 4 weeks to be issued. Our trip is in 20 days.  My wife said that, if I don't receive before we leave, we can go to the airport, taking our marriage document with the official translation, and try to travel without the visa. She believes that I have the right to travel with her anywhere in the EU and they can't refuse me entry.    Is this accurate or is it a big risk? She claims that I could be stopped at the border, but they have to let me enter after questioning me.

I am not from EU. I have Spanish partner and we live in Spain and, because of our official relationship, I have a Spanish family resident permit. We are going to travel to the UK together for tourism. I am confused whether I need an EEA family permit or not.  I will not live there and I'm going to travel with my partner. I was told that I don't need a visa, that showing our civil union document will be sufficent. Is this correct, or do I need a visa to enter the UK?    Thank you so much for your answer. Let me give you more detail.  I hold Turkish citizenship.  My resident card exactly says that Residence Card of a Family Member of a Union Citizen " tarjeta de familiar de la union.   my case is like For example, a non-EEA spouse of a German national living in Germany will usually hold a residence permit issued under German domestic law. Therefore, a United Kingdom EEA family permit is required for travel and entry to the UK , therefore I should consider that I need to EEA Family Permit even if for touristic trip with my partner.


Aaagain, I fail to understand the trivial:    Using compactness argument it is straightforward to show:  $$\lambda^{*}([a,b]) \geq b-a$$ And everything is OK.  But, regarding $\lambda^{*}([a,b]) \leq b-a$, Cohn says:      For any closed bounded interval $[a,b] \subset \mathbb{R}$ it is easy to see that $\lambda^{*}([a,b]) \leq b-a$ (cover $[a,b]$   with sequences of open intervals in which the first interval is barely larger than   $[a,b]$, and the sum of the lengths of the other intervals is very small).   From this hint I should be able to arrive at $\lambda^{*}([a,b]) < b-a + \epsilon$, for arbitrary $\epsilon >0$, but I don't understand how..  Help?

We define the Lebesgue Outer Measure of an interval $[a,b]$ by   $$\lambda([a,b])= \inf \left\{\sum_{j=1}^\infty |I_j|: [a,b]\subset \bigcup_{j=1}^{\infty} I_j\right\}$$  where $\{I_j\}$ is a sequence of open intervals that cover $[a,b]$, and we define the length of an open interval $|(a,b)|= b-a$. I want to show $\lambda([a,b])= b-a$  The proof of the book that I am using starts with the following:  Let $\epsilon >0$. Because   $$[a,b] \subset \left(a- \frac{\epsilon}{4}, b+ \frac{\epsilon}{4}\right) \cup \bigcup_{n=2}^\infty \left(- \frac{\epsilon}{2 \cdot 2^n},\frac{\epsilon}{2 \cdot 2^n}\right)$$, we obtain $\lambda([a,b]) < b-a +\epsilon$ which implies $\lambda([a,b])\le b-a$.  I can understand $[a,b] \subset (a- \frac{\epsilon}{4}, b+ \frac{\epsilon}{4})$, but I do not get the part $\cup \bigcup_{n=2}^{\infty} (- \frac{\epsilon}{2 \cdot 2^n},\frac{\epsilon}{2 \cdot 2^n})$ Since $(a- \frac{\epsilon}{4}, b+ \frac{\epsilon}{4})$ already covers $[a,b]$, and I do not think that $\bigcup_{n=2}^{\infty} (- \frac{\epsilon}{2 \cdot 2^n},\frac{\epsilon}{2 \cdot 2^n})$ will necessarily cover an arbitrary closed interval $[a,b]$, so I do not really know why you need that union of arbitrary small intervals. (My guessing is that you add the countable union so that it coincides with the definition of Lebesgue outer measure)  In addition, I do not know how can we arrive at the inequality $\lambda([a,b]) < b-a +\epsilon$. I do know that $b-a + \epsilon$ is essentially the length of $(a- \frac{\epsilon}{4}, b+ \frac{\epsilon}{4}) \cup \bigcup_{n=2}^{\infty} (- \frac{\epsilon}{2 \cdot 2^n},\frac{\epsilon}{2 \cdot 2^n})$ since I already computed it out. Taking the infimum of the length, we get $b-a$ and this is the outer measure (I think this statement should be wrong though)  Sidenote: I have not officially encountered Lebesgue Measure yet. I encountered this outer measure thing when the book is trying to show function continuous a.e is Riemann-integrable.  I really hope someone can shed some light since I have been puzzled by this the entire day.


I was thinking about the possibility of the universe having infinite mass, but then it occurred to me that it would then perhaps violate conservation of mass. Here is my thought process:  Assuming that "infinite" means an amount greater than any number, and  assuming that no mass can be created from nothing or become nothing,  this would mean that even if mass somehow disappeared from the universe, conservation of mass would not be violated due to the fact that $\infty - x$ is still $\infty$. This means that, at least mathematically, there wouldn't be a way to account for or "enforce" conservation of mass (or energy, either). Meaning that, the creation of any any mass from nothing and/or the disappearance of mass into nothing should theoretically not violate any conservation laws assuming infinite mass.  Is this a valid way to prove that the universe has finite mass? Does the universe have finite mass?  Regarding the possible duplicate question: The other answer doesn't quite suffice an answer to my specific question, in the sense that it addresses general relativity more than this specific "proof" or inquiry I had. If I hadn't received the current accepted answer, I don't imagine that I would have had my question answered in full.

In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim – does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this?


I need my footer to remain at the bottom of the page in landscape form. Most entries say that \usepackage{pdflscape} should do that, but it doesn't seem to be working,   \documentclass[12pt]{article} \addtolength{\parskip}{\baselineskip} \usepackage[margin=1in,includefoot]{geometry} \usepackage[fleqn]{amsmath} \usepackage{mathtools} \usepackage{siunitx} \setlength{\parindent}{0.25in}    %Tables preamble \usepackage[none]{hyphenat} \usepackage{float} \usepackage[thinlines]{easytable} \usepackage{longtable} \usepackage{array, booktabs, makecell, multirow} \renewcommand\theadfont{\bfseries\small} \newcommand\mceight[1]{\multicolumn{8}{l}{#1}} \newcommand\mctwelve[1]{\multicolumn{12}{c}{#1}} \usepackage{arydshln} \setlength\dashlinedash{0.2pt} \setlength\dashlinegap{1.5pt} \setlength\arrayrulewidth{0.3pt} \usepackage{pdflscape} \usepackage{afterpage}  \widowpenalty500 \clubpenalty=9996 \exhyphenpenalty=50 %for line-breaking at an explicit hyphen \brokenpenalty=4991 \predisplaypenalty=10000 \postdisplaypenalty=1549 \displaywidowpenalty=1602 \floatingpenalty = 20000  \usepackage[labelfont=bf, textfont=bf]{caption}  % Header and footer \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \fancyfoot{} \fancyfoot[R]{ \thepage\ } \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{1pt} \usepackage{booktabs} \usepackage{dcolumn}   \begin{document}  \afterpage{\clearpage}  \begin{landscape} \begin{longtable}[ht]{ l*{12}{S[table-format=2.3]}} \caption{Quantile regresion results (pooled sample) for 2010-11} \label{tab:quantile}                                                             \\ \toprule \thead[b]{Dependant Variable:\\ log(hourly wages)}     & \mctwelve{\thead{Percentiles}} \\     \cmidrule(lr){1-1}\cmidrule(lr){2-13}       \multirow{2}{*}{\thead{Independent\\ Variables}}     & \multicolumn{2}{c}{10th}         & \multicolumn{2}{c}{30th}             & \multicolumn{2}{c}{50th}                 & \multicolumn{2}{c}{70th}                     & \multicolumn{2}{c}{90th}                         & \multicolumn{2}{c}{OLS}                   \\ \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7} \cmidrule(lr){8-9}\cmidrule(lr){10-11}\cmidrule(lr){12-13}     & {coeff} & {t-stat} & {coeff} & {t-stat} & {coeff} & {t-stat}     & {coeff} & {t-stat} & {coeff} & {t-stat} & {coeff} & {t-stat}  \\ \hdashline                                                               \\ \endfirsthead  %%%% \caption[]{Quantile regression results (contd.)}    \endhead                                    \toprule \thead[b]{Dependant Variable:\\ log(hourly wages)}     & \mctwelve{\thead{Percentiles}} \\     \cmidrule(lr){1-1}\cmidrule(lr){2-13}       \multirow{2}{*}{\thead{Independent\\ Variables}}     & \multicolumn{2}{c}{10th}         & \multicolumn{2}{c}{30th}             & \multicolumn{2}{c}{50th}                 & \multicolumn{2}{c}{70th}                     & \multicolumn{2}{c}{90th}                         & \multicolumn{2}{c}{OLS}                   \\ \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7} \cmidrule(lr){8-9}\cmidrule(lr){10-11}\cmidrule(lr){12-13}     & {coeff} & {t-stat} & {coeff} & {t-stat} & {coeff} & {t-stat}     & {coeff} & {t-stat} & {coeff} & {t-stat} & {coeff} & {t-stat}  \\     \midrule                                                                \\ \endhead \midrule \multicolumn{12}{r}{\footnotesize\textit{Continued on the next page}} \endfoot \endlastfoot %%%%        \textbf{Constant}     & 1.107   & 9.96     & 1.606   & 20.07    & 1.859   & 26.76 & 2.095   & 29.12    & 2.642   & 28.94    & 1.740   & 27.51     \\ \hdashline \textbf{Gender}     & 0.542   & 23.7     & 0.503   & 30.1     & 0.480   & 33.24 & 0.418   & 27.28    & 0.309   & 15.99    & 0.443   & 33.33     \\ \hdashline  \bottomrule     \label{tab:quantilereg}  \end{longtable} \end{landscape} \end{document}

Objective  How to change the heading of landscaped pages from    to    ?  Minimal Code  \documentclass{book} \usepackage[a5paper,hmargin=3cm,vmargin=5cm]{geometry} \usepackage{lscape,lipsum}  \begin{document} \chapter{One} \lipsum[1]  \section{One One} \lipsum[2]  \newgeometry{hmargin=5cm,vmargin=3cm}  \begin{landscape} \lipsum[3-5] \end{landscape}  \restoregeometry \lipsum[6]  \end{document}   Edit 1 (my real scenario layout)  In my real scenario, the left-right margins should not be occupied by headings.


When I start ubuntu up a purple screen pops up and then disapears again then a window comes up that says that I am running in low graphics mode. I click ok and then all I see is a black console. How do I get into the normal ubuntu?

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


I have 4 different values, when looping through an array. Is it possible to add the values together like you would in Java's StringBuilder append? I want something like this when doing a console.log(): 28.0334307,-25.872523799999996, 28.031527552564445,-25.87632233243363  Now I am just getting it one for one like this when doing a console.log(): 28.0334307 -25.872523799999996 28.031527552564445 -25.87632233243363  Here is my code: var coordinates = [28.0334307, -25.872523799999996, 28.031527552564445, -25.87632233243363]  for(var item in coordinates) {    console.log(item); }

I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way.)


I'm trying to render some still images of a scene but switch the image texture using a script with the Blender command line. I made a script to set the image of an image texture node in the scene. When I run it within Blender with Run Script or run it with --python-text when launching Blender from the terminal the image is set correctly, but it has no effect when I run it along as GUI-less background with -b.   I'm still finding my way around the API so this is the extent of the script:  import bpy import os  def set_texture_image(img):     bpy.data.objects["Cube"].select = true     mat_tree = bpy.data.objects["Cube"].material_slots[0].material.node_tree     mat_tree.nodes["Image Texture.001"].image = img   new_image = bpy.data.images.load('//../../Pictures/cubes.png') set_texture_image(new_image)

I am using blender as a python module and want to use this trick to get rendering results without saving on the disk:   The exact code described in the link works when I execute it in the python console of the blender program. However, it does not work, if I simply run it with python or by calling blender -b -P script.py. In those cases, bpy.data.images['Viewer Node'].pixels contains 256*256 zeros instead of the rendered cube.  I would appreciate very much any tips concerning what the origin of this difference in behavior is, and how to eliminate it.  My guess would be, that some configuration of blender is different when starting the program compared to importing bpy in python, but I have no clue where to search for.


I have been trying to make a simple program in eclipse indigo, but kept getting the same problem, so I made this test to see the code in the simplest way. It looks like this:  import java.util.Scanner; public class test {      /**      * @param args      */     public static void main(String[] args) {         // TODO Auto-generated method stub  Scanner input = new Scanner(System.in);  System.out.println("Please enter a letter");  String answer = input.nextLine();  if(answer == "a"){  System.out.println("a equals 1");  }  else if(answer == "b"){  System.out.println("a equals 2");  }  else{  System.out.println("a is not 1 or 2");  }  input.close();     }  }   My problem seems to be in the line  String answer = input.nextLine();   I found this small piece of information after a lot of testing.  If I change the code so it will use integers it will work, but it seems to have some problems with the String.  Does anyone know what's wrong?

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


I use RainMeter (Desktop Customisation Tool) and It comes with a widget that displays real-time RAM and Virtual Memory usage, and ever since I've had it - it always displays at least 10%-30% SWAP usage. Is comes to this % by adding RAM usage with "SWAP"/Virtual Memory usage, which comes in at a difference of +7/10% I have 11.6 GB (from 16Gb) available from application software. Is this healthy or a problem?

Imagine I have tons of RAM. Let's say 64GB. That's a lot for even gaming PCs. Now the default location of a pagefile in Windows is on the main OS drive, be it HDD or SSD, which are faster in general, but still not as fast as RAM.  Something tells me that disabling the pagefile on the hard drive or creating a virtual RAM drive and letting the pagefile be there could make Windows move all its virtual memory to RAM, and so increase the system's performance, but I'm not very knowledgeable in that area, so that might not be true at all.  I tried both, but I couldn't analyze the results to reach a definite conclusion with my knowledge level in memory things.  Would this work? If not, why?


I'm a student of 10th std. Recently our teacher asked a Question that   "Is 4.999...equal to 5 or not?" Everyone said that is isn't equal or it is approximately equal. Teacher too agreed to that. But I did't agree. I opposed the teacher as I think it is precisely equal to 5. I also prove but then too she isn't satisfied. Can you please explain what is right and what is wrong in this case?Please Justify.     Proof that I showed : let x=4.999...  (a)                            therefore, 10x = 49.999...                                       10x -x = 49.999... -4.999...                                       9x     =  45                                       x = 45%9                                       X= 5     (b)                          hence (a) =(b).                                     And therefore, ***4.999... = 5***

I'm told by smart people that $$0.999999999\ldots=1$$ and I believe them, but is there a proof that explains why this is?


i'm  writing a report with Latex i need to use Times New Roman font type but i couldn't find an easy way. I used the \usepackage{times} package but it looks diffrent do  you have any other idea ?

I know that I can put \usepackage{times} in the preamble in order to use the Times font instead of Computer Modern for my document.  But this only affects the text; the math is still typeset using Computer Modern.  How can I make Latex use Times also for the math?


I'm looking for a story I read about twenty-five or thirty years ago, in a book I got in a second-hand store. I don't remember the title of the book, which had a number of short stories in it, but in the specific story, there is a  law that a robot's memory must be wiped every hundred years. This robot doesn't want to lose its memories, so it stows away on the outside of a spaceship. The spaceship's entry to hyperspace has some effect on the robot's mind. The spaceship lands on a planet with a corrosive atmosphere, and as the robot moves about the world, it starts getting flashes of schematics every time it closes its eyes. Eventually it realizes that these schematics are actually the schematics of whatever it's looking at, and that by imagining a change to the schematics that it sees, the thing itself is changed. It uses this ability to temporarily disable another robot of the same model as itself (and steal that robot's scheduled body replacement), and it stows away on another spaceship, which it also repairs, and it also actually heals an injured/ill human who is on that spaceship.

I'm looking for a short story from about 50 years ago about a robot who escapes after being slated to be melted down and discovers while in hiding that it has evolved to have some supernatural powers.


This is an embarrassing basic problem, but I can't find the option to render my scene instead of what I'm working on in the video editor.  Every time I try to render my scene, it just renders what ever key frame I'm on in my video timeline.  Where is the option to switch between the two?  EDIT:  I found a Q/A for this.    In short Properties Panel > Render > Post Processing > Sequencer

I rendered an animation and then placed it into the video sequence editor to test it, and rendered that as a video.  Now I want to render a second animation (in other words, keep working), but when I press render animation, it's still using the sequence render option? (Rendering it as pngs). I was wondering how to switch between sequence render and animation render properly?


In the episode "The Waters of Mars" we're introduced to the character Captain Adelaide Brooke, who is an integral part of human history as her death on Mars in the year 2059 inspires her descendants to be a driving force in humanity's exploration of space.  We learn that a Dalek spared her when she was a child during their invasion of Earth in 2009, as it was aware of her nature as a fixed point at a future date.  However, during the Dalek's invasion their ultimate goal was to detonate the reality bomb, wiping out all realities except for themselves leaving them the only race in all of existence. With this in mind, why did the Dalek spare the young Adelaide Brooke? The Dalek's presumably planned to succeed in detonating their bomb, thereby making her future meaningless, so why spare her?

In The Waters of Mars, it is shown that a Dalek left Adelaide Brooke unharmed when she was young during the events of The Stolen Earth, because she was a "fixed point in time", according to the words of the Doctor.  However, if they had succeeded in stealing the Earth (and they rather planned on it by taking any action at all) the future that is written for her (death on Mars on the first off-planet base) couldn't ever happen because there would be no more Earth in the solar system (nor humans, etc.), so leaving her unharmed is quite senseless.  Similarly, if she has to die on Mars she needs first to get to it, so when the Daleks spot her and realize the fixed point issue, why didn't they just abandon their whole plan as it has to fail to allow events of The Waters of Mars to happen?


Only Ctrl+c not working. I have windows 7? (Ctrl-v, ctrl-x etc work good)  This not work in all programs (Office, Firefox, Chrome etc) Thanks

It seems like the shortcuts I've been using for years in previous versions of Word are not working anymore. For example Ctrl-Z, Ctrl-C, Ctrl-V are not working (there is Alt-Backspace, etc) and I have to learn new shortcuts. This is the thing I really don't want to do.  I'm facing this problem only in Windows 7, I've got Windows XP with the same version of Office 2010 and these shortcuts are working just fine. Is there any way to change Word shortcuts to an old version?


I am using the office customization tool to create an unattended installation file for Microsoft Office 2010 pro plus. I have everything setup as I like, except that I need the excel add-ins activated (Analysis ToolPak, Analysis ToolPak - VBA, Euro Currency Tools, Solver.)   There is a section of the office tool that lets me customize the features, and I have configured the entire excel branch to be "Run from my computer," but the add-ins are still grayed out.  Does anybody know how to activate these excel add-ins via command line or registry entries? Am I missing something with the office customization tool?

I have an addin that I'm installing on the roaming profile of users.  Yet I have to activate it manually for every users.    I thought about activating it automatically with GPO.  I read  but it seems to be big for what it is.  Is there a way to activate it automatically with a GPO, in a simpler way?   Thanks


I wish to present my education for a potential employer. If I had the chance to phrase a whole sentence, I would go for "I received my PhD from University X", as suggested in other answers to related questions. However, the information needs to be put in bullet point style. I am not sure about the correct preposition here. My thoughts:   PhD at University X   or   PhD from University X   Please not that this information is not connected to a date (as in "2012: PhD from University X"), merely the fact that I earned a PhD is listed.  Thanks for your help in advance!

I would like to know what is the preferred way to indicate that I took a degree in some subject while also naming the place where I obtained the degree from:   I got my master's degree from the University of Somewhere; I got my master's degree in the University of Somewhere; I took my master's degree in the University of Somewhere.   I would say that "in" is more suitable to mention the particular subject (a degree in maths, for instance) than to indicate the place, but I still have doubts.  By the way, is it a "master's degree" or a "Master's degree"?


They seem to represent the same idea as far as I can tell - can they be used interchangeably?

From , there are three interpretations of the degrees of freedom of a statistic:     In statistics, the number of degrees of freedom is the number of   values in the final calculation of a statistic that are free to vary.      Estimates of statistical parameters can be based upon different   amounts of information or data. The number of independent pieces of   information that go into the estimate of a parameter is called the   degrees of freedom (df). In general, the degrees of freedom of an   estimate of a parameter is equal to the number of independent scores   that go into the estimate minus the number of parameters used as   intermediate steps in the estimation of the parameter itself (which,   in sample variance, is one, since the sample mean is the only   intermediate step).      Mathematically, degrees of freedom is the dimension of the domain of a   random vector, or essentially the number of 'free' components: how   many components need to be known before the vector is fully   determined.   The bold words are what I don't quite understand. If possible, some mathematical formulations will help clarify the concept.  Also do the three interpretations agree with each other?


I have this sentence on my resume:     Develop the front-end of a platform using HTML, CSS, and Bootstrap to connect people and systems   Is there a comma after Bootstrap? I wanted to elaborate on the reason for building the application rather than simply listing the programming languages I used.

Should I put a comma before the last item in a list?     I would like crackers, cheese and some soda.   I would like crackers, cheese, and some soda.


How can I find the longest simple circuit in $K_n$? Is there a simple formula that exists?

A trail is a sequence of adjacent vertices with no repeated edges.  A circuit is a trail that begins and ends at the same vertex.  The complete graph on 3 vertices has a circuit of length 3.  The complete graph on 4 vertices has a circuit of length 4.  the complete graph on 5 vertices has a circuit of length 10.    How can I find the maximum circuit length for the complete graph on n vertices?


I just want to select the target element which has "name" attribute value = 'syslog'. Anyway, I always get an NullReferenceException. Can anyone help me to figure out what is the problem?   ---------------- My code -------------------------------------------  XmlNode root = _configFile.DocumentElement; // root is not none, and is correct. XmlNode syslogNode = root.SelectSingleNode("descendant::targets/target[@name='syslog']"); // the syslogNode is null   -----------------My XML file --------------------------------------  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">    <extensions>     <add assembly="NLog.Targets.Syslog" />   </extensions>    <targets>     <target name="syslog" xsi:type="Syslog" syslogserver="127.0.0.1" port="514" facility="Local7" />     <target name="file" xsi:type="File" layout="${level} | ${longdate} | ${callsite:className=true:fileName=false:includeSourcePath=false:methodName=true} | ${message} ${exception:format=tostring}"             fileName="${specialfolder:folder=LocalApplicationData}/Televic Conference/CoCon/Log/server_log_${shortdate}.txt"             archiveFileName="${specialfolder:folder=LocalApplicationData}/Televic Conference/CoCon/Log/Archives/server_log.{#}.txt"             archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="20" concurrentWrites="true" keepFileOpen="false"/>     <target name="console" xsi:type="ColoredConsole" layout="${longdate}: ${message}"/>     <target name="debug" xsi:type="OutputDebugString" layout="${longdate}: ${message}"/>   </targets>    <rules>     <logger name="*" minLevel="Trace" appendTo="syslog"/>     <logger name="*" minlevel="Trace" writeTo="file" />   </rules> </nlog>

Its a .vbproj and looks like this  <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">     <PropertyGroup>         <ProjectGuid>15a7ee82-9020-4fda-a7fb-85a61664692d</ProjectGuid>   all i want to get is the ProjectGuid but it does not work when a namespace is there...   Dim xmlDoc As New XmlDocument()  Dim filePath As String = Path.Combine(mDirectory, name + "\" + name + ".vbproj")  xmlDoc.Load(filePath)  Dim value As Object = xmlDoc.SelectNodes("/Project/PropertyGroup/ProjectGuid")   what can i do to fix this?


I plan to drive from Raleigh to Washington, DC. tomorrow (Sunday). My final destination is the Verizon Center. How far into DC should I drive before catching the metro?

I plan to drive to Washington, DC, but my understanding is that the Metro is far better than driving for actually getting around downtown DC.  First of all, is that assumption correct?  Assuming the Metro is indeed the way I should ultimately get to my downtown destination, how close should I drive before finding a Metro station?  Should I stop at the first one on the outskirts in Maryland, or should I keep going into the city a bit?  I'm primarily concerned with avoiding traffic if possible as well as generally shortening my travel time.  The travel will be occurring during a weekend (4th of July weekend) in case that is relevant.  My destination in DC is off the Navy Yard station of the Metro Green Line.  Follow-up: I might have found a last-minute hotel deal downtown.  Can I park overnight at the Metro stations that are being suggested?


I'm trying to select month, year and date from calendar date-picker. I'm writing my script using pom & page factory approach. I'm not able to pass the date I selected to the variable named TodayDate. Can someone please tell me why TodayDate = null.               JSClickWithWaitTime(sf.StartDateEST_SF, 60); // clicked on date field              waitForElementBeVisible(sf.CalendarDateReceived_SF, 100);            //JSClickWithWaitTime(sf.StartDateEST_SF, 60);             Assert.assertTrue(sf.CalendarDateReceived_SF.isDisplayed()); // asserted that the calendar is displayed.                         selectValueFromDD(sf.MonthFromDateReceived_SF, "Mar");               selectValueFromDD(sf.YearFromDateReceived_SF, "2020");             JSClickWithWaitTime(sf.DayFromStartDate_SF, 3000);             click(sf.StartDateEST_SF);             String TodayDate = sf.DayFromStartDate_SF.getAttribute("03/17/2020"); // Save the date into the variable TodayDate             System.out.println("Today's date is = " +TodayDate);                    Assert.assertEquals("03/17/2020", sf.StartDateEST_SF);  The console will display the below result: Element is Clicked by the JS. Mar is selected 2020 is selected Element is Clicked by the JS. Today's date is = null

I have the following element element(by.css("span[aria-label='Picker ID, TESTUSER']")  I want to assure the text on this filed is TESTUSER, so I tried:  expect(element(by.css("span[aria-label='Picker ID, TESTUSER']")).getAttribute('value')).toEqual('TESTUSER');  then I got the error: Expected null to equal 'TESTUSER' So I tried: element(by.css("span[aria-label='Picker ID, TESTUSER']")).getText().then(function (value) {         console.log(value);       })  And I got this error: Expected '' to be 'TESTUSER'.  How to get the value of this field and expect it is TESTUSER?


$\bf{Theorem.}$ Let $R$ be a commutative ring with identity. If $I$ is a proper ideal of $R$, then $I$ is contained in a maximal ideal.   and     $\bf{Zorn's\;Lemma.}$ Suppose a partially ordered set $P$ has the property that every chain in $P$ has an upper bound in $P$. Then the set $P$ contains at least one maximal element.   I have never seen a demonstration of this theorem without the use of the Zorn's Lemma. I know that Zorn's Lemma is a much more general than rings and I don't see a reason for the theorem to imply the Zorn's Lemma, but it makes me wonder if there can be any kind of equivalence between these two things.

Let's consider two statements: Zorn's lemma and theorem about existence of maximal ideals in commutative ring with $1$.  It's easy to prove that Zorn's lemma implies existence of maximal ideals.  I wonder if the converse proposition is true, i. e., does existence of maximal ideals implies Zorn's lemma? My approach was to construct a ring structure on an ordered set which satisfies Zorn's lemma condition such that existence of maximal ideal implies existence of maximal element in the set, but I didn't succeed.


i got a little problem with my code. When i write "exit" still shows statement "Unknown command" and i want to show "Bye". Can you help me?  import java.util.Scanner;  public class Hello{     public static void main(String[] args){         Scanner odczyt = new Scanner(System.in);         String word;          do{             word = odczyt.nextLine();             System.out.println("Unknown command");         }         while(word!="exit");             System.out.println("Bye");     } }

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


In this problem set, you have to ask the user to enter 10 values, then cube the elements in that entered array and in the end print out the original and final array  This question is not about printing an array, my concerns is how to cube all elements in an array. I tried doing this as shown below but I keep on getting random stuff in output?  public class arraysprob4 {     //raahul marreddy     // have user enter 10 numbers     // find and print the cube's      static Scanner console = new Scanner(System.in);      public static void main(String[]args) {         int newcube[] = new int[10];         int cube[] = new int[newcube.length];         System.out.println("Enter 10 numbers:");          for(int i = 0; i < cube.length; i++) {             cube[i] = console.nextInt();             newcube[i] = cube[i] * cube[i] * cube[i];         }          System.out.println("New Array is:" + newcube);         System.out.println("Old Array is :" + cube);    } }

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


I have an old iMac (Mid-2007 Core 2 Duo, A1225) that our workgroup is retiring. My colleague wants to use it for her son. I migrated all data to a new iMac, wiped the drive, and initiated reinstall from the recovery partition. After AppleID verification the iMac states El Capitan is "temporarily unavailable".  Apple help states to use Cmd-R to avoid having my AppleID associated with the computer. I can't progress to installation point without an AppleID sign-in. Apple help states to use Internet Recovery instead. This model apparently doesn't support Internet Recovery. I can't get any further. I am at a total loss. I've tried resetting everything that can be reset, a different AppleID, finding another identical computer running El Capitan to sign into and download El Capitan installer to verify that the macOS version is associated with the purchase history of the AppleID in use... this is utterly ridiculous. I have an identical 2010 model iMac at home that MY son uses as a Minecraft box. I acquired it used, wiped the drive, and did an install from recovery partition. I cannot understand why it worked then, but fails now. What am  I missing - or has Apple made changes such that it is now impossible to actually install this OS even on hardware that supports nothing higher?

Sometimes it's hard to search for older versions of macOS & OS X  on the App Store.  This is an attempt to provide the canonical QA for this issue, as per the Meta QA -  I expect it to be modified over time to hopefully become a complete information resource.  How can I get any older version of a Mac OS to be able to run as a VM, or to reinstall on my Mac?


I need to find a quick way to globalize all the strings of a web system. Is there a library/package or good practice for me to make this change?

I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up the strings.  Are there any other good approaches that I could look into?


I am using rsync rsync $source $destination.  How do I rsync based on modified time?  I see an option for file size --size-only but nothing for modified time?

Is it possible to sync files via rsync and let rsync only compare mtime informations?  Or is there another tool for this job?  That means that such a tool only copies src to destination if the src is newer than the destination. Comparable to GNU cp --update - but also over ssh ...


Hi I need help with proving a group of order 343 is not simple. Since a group of order 343 is a 7-group, I believe the proof will involve the use of G's nontrivial center and class equation. I am just not sure how to start this proof. Thanks.

I am to trying to prove this theorem: A finite $p$-group cannot be simple unless it has order $p$.  I have this:   Let $G = P$ and $|G|=p$; then there exists $N$, a normal subgroup of $G$ by Lagrange's theorem, such that $|N| \mid |G|$ so, $|N|= |e| = 1$ or $|N| =  p$  If $|N|=p$ so $N=G$.  But I don't know how I can prove the part in the case of $|N|=|e| = 1$  Is my start correct?


I'm trying to make length = 001 in Python 3 but whenever I try to print it out it truncates the value without the leading zeros (length = 1). How would I stop this happening without having to cast length to a string before printing it out?

What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?


My laptop originally came with Windows 8, a while back I tried to install Ubuntu, but it didn't work so I just deleted everything. Today I did a factory reset on my laptop because I am going to sell it, but when I boot it boots to a black screen that says "GNU GRUB version 1.99-21ubuntu3.1" followed by a bunch of text. To access Windows 8 I have to hold down f11 on boot where I get the option for windows boot manager. I want to make Windows 8 the default, how to I get rid of this "ghost" ubuntu?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


Is is necessary to use the Subject Pronoun in the sentence below?     I'm a student and I work at Burger King.   or     I'm a student and work at Burger King.   Which one is correct according to the English grammar and what does it demand in cases like this?

I sometimes find myself writing something like this:     XXX is a project I admire and am very interested in.   The "I <verb> and am <something>" feels strange here. It somehow sounds more natural in the third person: "He admires and is very interested in...."  Am I just imagining things – is it OK to use this construction, or should I use something completely different?


I'd like to search the internet for a string containing a few symbols, namely dashes, pipes and angle brackets.  I tried searching for them by typing them into Google but it seems to ignore the symbols.  Any advice?

I want to search for what += means, but Google won't return any documents.  Also when I come across some PHP code I don't understand I can't search for the keywords as written.  How can I search for these special characters or include these special characters in a search.


Operating system: Lubuntu 13.10, 64-bit.  I installed the  from  following the instructions quoted below from      To install SeaMonkey by downloading the tar.bz2 file:      Create a directory named "seamonkey2" (mkdir seamonkey2) and change to that directory (cd seamonkey2).   Click the link on the site you're downloading SeaMonkey from to download the package (seamonkey-2.*.tar.bz2) file into the seamonkey2 directory.   Decompress the file with the following command:        tar jxvf seamonkey-2.*.tar.bz2        This creates a "seamonkey" directory under your seamonkey2 directory.   Change to the seamonkey directory (cd seamonkey).   Run SeaMonkey with the following command:        ./seamonkey   I followed the instructions but here is what I see with the following commands:  [05:28 PM] ~/seamonkey2/seamonkey $ ll seam* -rwxr-xr-x 1 vasa1 vasa1 82816 Oct 29 08:23 seamonkey* -rwxr-xr-x 1 vasa1 vasa1 82820 Oct 29 08:23 seamonkey-bin*     [05:28 PM] ~/seamonkey2/seamonkey $ seamonkey bash: /home/vasa1/seamonkey2/seamonkey/seamonkey: No such file or directory [05:28 PM] ~/seamonkey2/seamonkey $ seamonkey-bin bash: /home/vasa1/seamonkey2/seamonkey/seamonkey-bin: No such file or directory [05:28 PM] ~/seamonkey2/seamonkey $ ./seamonkey bash: ./seamonkey: No such file or directory [05:29 PM] ~/seamonkey2/seamonkey $ ./seamonkey-bin bash: ./seamonkey-bin: No such file or directory [05:29 PM] ~/seamonkey2/seamonkey $    So why is bash saying "No such file or directory" although the directory and files (seamonkey and seamonkey-bin) exist?   Here is the output of cat /etc/environment:  [05:38 PM] ~ $ cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vasa1/seamonkey2/seamonkey" [05:38 PM] ~ $    Here is the output of file seamonkey and ldd seamonkey:  [06:29 PM] ~/seamonkey2/seamonkey $ file seamonkey seamonkey: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped [06:30 PM] ~/seamonkey2/seamonkey $ ldd seamonkey     linux-gate.so.1 =>  (0xf7726000)     libpthread.so.0 => /lib32/libpthread.so.0 (0xf76f6000)     libdl.so.2 => /lib32/libdl.so.2 (0xf76f1000)     libstdc++.so.6 => not found     libm.so.6 => /lib32/libm.so.6 (0xf76ae000)     libgcc_s.so.1 => not found     libc.so.6 => /lib32/libc.so.6 (0xf74fc000)     /lib/ld-linux.so.2 (0xf7727000) [06:31 PM] ~/seamonkey2/seamonkey $

I have currently a strange problem on debian (wheezy/amd64).  I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things easy, I have initialized this chroot with a debootstrap (also wheezy/amd64).  All seemed to work well inside the chroot but when I started the installer script of my server I got : zsh: Not found /some_path/perl (the installer includes a perl binary for some reasons)  Naturally, I checked the /some_path/ location and I found the "perl" binary. file in chroot environment returns :  /some_path/perl ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped   The file exists, seems ok, has correct rights. I can use file, ls, vim on it but as soon as I try to execute it - ./perl for example - I get : zsh: Not found ./perl.  This situation is quite understandable for me. Moreover :   I can execute other basic binaries (/bin/ls,...) in the chroot without getting errors I have the same problems for other binaries that came with the project When I try to execute the binary from the main root (/chr_path/some_path/perl), it works. I have tried to put one of the binaries with a copy of my ls. I checked that the access rights were the same but this didn't change anything (one was working, and the other wasn't)


Having trouble using a regex to validate a phone number.  I want to allow only numbers and hyphens, but so far I've been trying to just get numbers working.  Unfortunately despite different changes after looking around Google and Stack Overflow, the regex continues to evaluate as false.  Ideally, strings such as 8889990000 or 888-999-3333 should both evaluate to true. Any help is appreciated!  Main class code for regex:    boolean correct = PhoneFilter.filterPhone(phone_num);  if (correct == true) {     //create an intent to carry data from main activity to OrderConfirmationActivity     Intent intent = new Intent(MainActivity.this, OrderConfirmationActivity.class);      //pack pizza order data into intent     intent.putExtra("nameSelected", nameEditText.getText().toString());     intent.putExtra("aVariable", type);     intent.putExtra("mtSelected", mt);     intent.putExtra("otSelected", ot);     intent.putExtra("ptSelected", pt);     intent.putExtra("dateSelected", Date);      //start the OrderConfirmationActivity     startActivity(intent);   }         //alert user if phone number entered incorrectly else if (correct == false) {     AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();     alertDialog.setTitle("Alert");     alertDialog.setMessage("Please enter a phone number in either 000-0000-000 format or 0000000000 format");     alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",             new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int which) {                     dialog.dismiss();                 }             });     alertDialog.show(); }   The code for filterPhone is:    public class PhoneFilter {      public static boolean filterPhone(String phone_text) {         boolean correct;          if ((phone_text.length() <= 12) && (phone_text.matches("[0-9]+")))             correct = true;         else             correct = false;          System.out.println("correct =" + correct);         return correct;          //InputFilter lengthFilter = new InputFilter.LengthFilter(12);     } }

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


I just recently wished to get rid of one of my answers but could not find any way to delete it from within the Android app.  The only options I get in the menu are Edit, Flag and Share.

Currently, the only way to vote to delete (and undelete, since you can't see deleted posts) in the Android app is to open the post in a browser, and then vote to delete from there.  Can we get delete vote functionality within the app, as well as the ability to delete our own posts?  Worth to mention: users , so it's possible in the API.  Related:


Hey guys how can I achieve changing this piece of code to use classes instead of a struct. I briefly understand how classes work but im completely confused how to change this piece of code thanks. The code it's self is to scan a .txt file and then search the .txt file to select a word then print the results.  The basic layout would consist of  class Word { public:       string word;       string definition;       int usageFrequency; private:

This question was .  Now I'd like to learn the differences between a struct and a class in C++. Please discuss the technical differences as well as reasons for choosing one or the other in OO design.  I'll start with an obvious difference:   If you don't specify public: or private:, members of a struct are public by default; members of a class are private by default.   I'm sure there are other differences to be found in the obscure corners of the C++ specification.


i try to find a answert about my question, but I can not find a good explanation. The code below shows, that ClassA and ClassB extends from ClassAbsract. But if I try to set the value from input to self._x python creates a new _x field at the UML diagram. In the ClassA and ClassB I just wanna set _valueA or _valueB. But here is the same, the defined variable is listed two times at the UML.  What is the mistake in my demo? I use the InteliJ PyCharm IDE  class ClassAbstract:      _x = None      def setXvalue(self,input):         self._x = input + 1    class ClassA(ClassAbstract):      _valueA = None      def setXvalue(self,input):         self._valueA = input + 2   class ClassB(ClassAbstract):      _valueB = None      def setXvalue(self,input):         self._valueB = input + 3

Is there any meaningful distinction between:  class A(object):     foo = 5   # some default value   vs.  class B(object):     def __init__(self, foo=5):         self.foo = foo   If you're creating a lot of instances, is there any difference in performance or space requirements for the two styles? When you read the code, do you consider the meaning of the two styles to be significantly different?


If I have only the ciphertext but the alphabet and the value of a and b are all unknown ... how would I go about this? I understand decryption with the key and alphabet, that is fairly easy but if we don't have even one of them what would be my first step?   also, my goal is to have the computer return the plaintext and the alphabet &key. Without me choosing what looks like english or not.

I know simple formulas like  $$E(x) = (ax+b)\pmod n$$  where $E(x)$ stands for encryption,  $$D(y)= z(y-b)\pmod n$$  where $D(y)$ stands for decryption,  and   $$ax==1\pmod n$$  Assuming someone gives us an encrypted string, is there a way to find $a$ and $b$ from that string? If not, what informations we should have to find $a$ and $b$ keywords from the encrypted string? Is there a way to find a and b keywords in an affine cipher when only ciphertext but no plaintext is known?    Note that this is not a duplicate of . In that other question, the user knows beginning of both encrypted and decrypted message.


I want my header file to look like  //Header.h --Declare enum  //Cpp.cpp enum class {TEST = 2}   Right now I am just doing enum class {TEST = 2} in the header file. Every file I have now has cpp and header file as pair. I don't want this file to be a header file without pair

I'm trying to do something like the following:  enum E;  void Foo(E e);  enum E {A, B, C};   which the compiler rejects.  I've had a quick look on Google and the consensus seems to be "you can't do it", but I can't understand why.  Can anyone explain?  Clarification 2: I'm doing this as I have private methods in a class that take said enum, and I do not want the enum's values exposed - so, for example, I do not want anyone to know that E is defined as  enum E {     FUNCTIONALITY_NORMAL, FUNCTIONALITY_RESTRICTED, FUNCTIONALITY_FOR_PROJECT_X }   as project X is not something I want my users to know about.  So, I wanted to forward declare the enum so I could put the private methods in the header file, declare the enum internally in the cpp, and distribute the built library file and header to people.  As for the compiler - it's GCC.


This is a ready-baked regex that I got from the internet just to see how regex works in JavaScript (and jQuery). Here is my script:    <script>     $(document).ready(function(){         var regexp = new RegExp(([\w-\.]+)@((?:[\w]+\.)+)([a-zA-Z]{2,4}));         $("#submit").click(function(){             var result = regexp.test( $("#email").val() );             if(result){                 $("form").submit();             }else{                 alert("Invalid Email Address");             }         });     }); </script>      However, the form always submits despite entering a wrong email address.    I have read on how test() works. It know that it returns the right answer and then advances a pointer to the next value. So if it returns true, the pointer points to false. I do not see how that can be a problem here.    what is wrong here? :)    HTML:    <body>     <center>         <form name="subscription" method="post" action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi">             <input type="text" name="email" size="30" id="email"></input>             <button id="submit">Submit</button>         </form>     </center> </body>

Is there a regular expression to validate an email address in JavaScript?


What is the best way to power a dual supply Op-Amp (CMOS) with a 9v Battery or a 12-Volt wall-wart (Inside +).  I can do it with two .5 Watt 200k Ohm Resistors in a voltage divider configuration. However, I want to use three and get a "low" signal above Earth Potential.   I purchased some ICs on eBay for very cheap, ICL7660, that supposedly will do the DC to AC conversion for you.   Any suggestions on how to power dul supply ICs with a single supply PSU?

I have a function generator IC  from EXAR. It's application circuits uses dual power supply +/-9 volts. How can I make such a 9-0-9 dual supply from a single voltage source like a battery or an adapter?


I had a normal wired connection to begin with when I originally installed ubuntu, but now I really want to do a reinstall to another partition (just to start fresh). The problem is that I do not currently have the capability to connect in a wired manner, my parents have a server running off of the SINGLE ethernet port on the router, and right now I absolutely don't want to try unplugging it for at least another month. I have wireless on my original installation, the one I'm sending this from, but I have a broadcom card, which ubuntu is infamous for its lack of compatibility with. Both are 32 bit, I have a 64 bit installation that I use when I need it (not all that often) but I mostly use a 32 bit setup. I want to know how I can install the proper drivers offline, along with why in bloody hell does ubuntu not have ANY usable drivers included for a type of wireless card that has more or less become the standard for wireless on laptops. It is a BCM43227 card on an acer aspire 7560 laptop with 4 gb of ram.

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


As the title says. I have rendered this file before and saved it. But now when I open the blender file, the strips are all in the same locations but when I try to render or play video in VSE it shows with nothing. What is weird is, if I import a new audio or video it will play.

I started using Blender couple of weeks ago to edit some of my video clips. Spent quite a while editing this one, and everything worked fine. Video rendered as it should. The whole project consists of a MP4 file with a whole lot of soft cuts. Came back to it a couple days later and now the preview won't show a thing. When I render the scene, it's just a black screen with no sound.  The original file is still working, as well as my other Blender projects. And the weirdest thing is that if I add a new movie clip to the project, the preview works just fine for that clip.  Can anyone guess what might have caused this? I've googled like crazy and haven't found anything helpful.


I m tired to comment line by line the things I desired to comment, is there a a way of selecting part of the code, and get it inmediatly in comment?

To "comment out" a line, I need to insert a % at the beginning of the line (so that the line will not be compiled). Is there a way to comment out a large section without having to manually place % in front of each line?


How to address second-order SQL injection without using PDO or mysqli binding in PHP application. I did many research but all point to PDO which I do not have. mysql_real_escape_string PHP escape is just for protection against the quotes. Right now we are having legacy PHP which using mysql_connect. We cannot upgrade our system to use PDO or MySQLi since it would require dependencies installation. To over come injection we using escape. But this does not gives protection against second order SQL injection. $name = $_POST['name']; $user = "Select user from user where name = $name" now use $id to fetch user location. Note the current code does not do join as this is only example. $loc = "Select * from location where user = $user" currently we are using escape for $name and $user to prevent injection. But the issue is if query from first one contain SQL query then we have issue. So we need a way to escape the query that way second query will be safe

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


I have two time variables in bash. I am trying to find a way to get the time difference between the two.  Yes, I have read many many many examples on the net, but they do not seem to have a "simple" solution. Rather, it seems as if time arithmetic in Bash was an "afterthought".  Here are some of the links I have read:       It would appear as if there is no "elegant" solution for it (my opinion).  So my variables are like the following:      TIME_START="date +%H:%M:%S //Start of script     // The script     TIME_END="date +%H:%M:%S //End of script   So I am trying to get the elapsed time. The script can take up to 3 hours to execute (interacting with sensors and hardware etc.). The TIME_START variable gets inserted into MySQL and later retrieved by Bash (when the script ends) in order to do the "elapsed time" calculation.  I have read somewhere that the following code would work, but it did not:     diff=$(expr $TIME_END - $TIME_START)    echo $diff   Any ideas?  Thank you  Danny

I often want to make some quick date calculations, such as:   What is the difference between these two dates? What is the date n weeks after this other date?   I usually open a calendar and count the days, but I think there should be a program/script that I can use to do these kinds of calculations. Any suggestions?


My granddaughter wakes up around 1:30 every night screaming and tightening her body up like something is going on. This just started about a week ago. Could she be having a bad dream?

My son is 17 months old with a regular routine in a nuclear family.  0700 awake 0745 in nursery Full day of nursery 1730 pick up from nursery 1800 relaxing time with mum and dad 1830 bath time 1900 story / quiet time 1920 bottle of warm whole milk 1930 bedtime  As a family we have the usual toddler tears you would expect with bedtime and handle them accordingly but the real reason for this question occurs between the hours of 2300 and 0500. Randomly, for 4 to 5 minutes, he will wake up in absolute hysterics screaming for his mother.  His eyes are closed and when picked up to be soothed he will not recognise us and continue the episode.  He is, as far as I can tell, still asleep during these periods but the screams are deafening. I don't know if this qualifies as a night terror? Sometimes the episode will manifest itself with him pushing himself away from us to the floor and running into other rooms (asleep).  Normally he will settle by the stair gate clutching it and shouting as if he has been abandoned and we (parents) are downstairs instead of next to him. The only remedy we have found is to have one or two bottles of milk on hand to give to him which normally soothe his distress until he falls back asleep. Context His mother is a fairly normal sleeper but I am a  sleeper; dreaming/hallucinating as soon as I close my eyes and not waking for any amount of noise or distraction.  Often my dreams are in full colour and my partner can have full, lucid conversations with me whilst I sleep which I cannot remember.  However, in 32 years I have never had a nightmare that I can recall so I don't know how to approach my son to help him deal with this sleeping problem.  I always found Hynagogic sleep a pleasant experience. Do any parents or medical professionals on these forums have experience and/or advice on how to support my son?


Consider this situation :  A short boundary behind the wicket and the pitch is having an extra(or abnormal) bounce. A fast bowler bowls a bouncer which flies over the keeper and lands outside the boundary.  Will this be given as 6 runs ?  Was there any incident like this in the history of cricket?

Imagine a very fast bowler. The ball pitches, is missed by the batsman, is missed by the wicket keeper, and flies over the boundary. How much runs/extras?  Imagine a very fast bowler. The ball doesn't pitch, is missed by all, and flies over the boundary. How much runs/extras?  Bonus: Did either ever happen at some reasonable level? (The first might be physically impossible, but the second seems doable.)


I have a Mid 2012 13" MacBook Pro (MD102B/A). It has 1x Mini Display / Thunderbolt Port and 2x USB 3.1 Gen 1 ports.  At my desk I need a bigger setup, so I connect the MacBook Pro to a 24" monitor using a Mini DisplayPort to HDMI adapter.  I wish to add a second 24" monitor to my setup, so that I have 2x external monitors plus my 13" MacBook Pro screen all in the use at once. I want to use each monitor as a separate extended display, not as mirrored displays.  I have done this in the past about 4 years ago when connecting a Mac mini to 3 screens and I have used the HDMI out, Thunderbolt out, plus a USB to HDMI adapter, but the USB to HDMI adaptor made the 3rd screen quite laggy.  Is there a more up to date way to do this using a Thunderbolt splitter or hub? I have found a few online including a  and a couple made by StarTech but wondered if they where going to work with the MacBook Pro. I don't believe my MacBook Pro has the most up to date Thunderbolt, although it does have 1 GB of dedicated GPU.

I have a MacBook Pro (13-inch, Mid 2012) and would like to set up two 24" Acer monitors so I can have an easier working life. The monitors support CDMI, DVI and VGA, I am new to MacBooks, so I'm not sure where to go or what to do, anything you can advise will be wonderful.  Thanks in advance :)


For an $n \times n$ square matrix $A$, can determinant of its cofactor matrix (matrix consisting of cofactors of the elements of $A$) be expressed in terms of $\det(A)$ and $n$ ?

I have the following proof that I would like to be walked through because I'm not intuitively seeing what to do:  If $A$ is $n\times n$, prove $\det\left(\operatorname{adj}(A)\right) = \det(A)^{n-1}$.  I know the property of $A\operatorname{adj}(A) = \det(A)I$ is important but I don't know how to apply it to get an answer. Any help is much appreciated.  Thanks,


I am trying to run a server that requires Java 7 using terminal.  After installing Java 7, typing java -version in terminal still shows Java 6.  Previously, I would use the Java Preferences application, but Apple has removed it.  Does anyone have any idea how to change the Java version the system uses without the Java Preferences application?  Or if anyone knows a download link for Java Preferences, that would be greatly appreciated as I am able to achieve the same results by just using that.  Thank you so much!  I am using the latest version of Mac OS X

I just installed Oracle's Java version 7u7 on my Mac (running OSX Mountain Lion). However, when I run java -version it still displays the old version (6u29).    How do I fix this? Do I even need to fix this? What version will browsers (Firefox) use in this case? And what version will be used when I run Java applications directly?  I've seen  but this doesn't work in my situation (probably because this question is about the JRE and the other question about the JDK). In my case the Java Preferences app only displays Java 6 versions (32 bit and 64 bit).    Update:   which java points to /usr/bin/java /usr/bin/java is a symlink to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java /System/Library/Frameworks/JavaVM.framework/Versions/ only contains the folder A (awesome version name) - which Current points to.


I'm doing a lab that requires a continuation question, but no matter what I do, the program always stops before accepting an answer. Here is my main method:  import java.util.Scanner; import static java.lang.System.*;  public class Lab03b { public static void main( String args[] ) {     Scanner scan = new Scanner(in);      boolean ans = true;     do{         out.println("Enter the word to display:: ");         String word = scan.nextLine();         out.println("Enter the number of times to display:: ");         int times = scan.nextInt();          out.println("Do you wish to continue? (y/n):: ");         String choice = scan.nextLine();          WordPrinter.printWord(word,times);            if (choice == "y" || choice == "Y")         { ans = true;         }         else         {             ans = false;         }     } while(ans == true);  } }   It references another class that goes through a basic loop to print out a word x amount of times. Any help is appreciated.

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


Let $A$ be a ring, $\mathfrak{q}$ an prime ideal and $\mathfrak{p}$ a maximal ideal such that $\mathfrak{q}\subset \mathfrak{p}$. Consider now the localized ring   $$(A/\mathfrak{q})_{\mathfrak{p}}$$  and denote by $\mathfrak{m}$ its maximal ideal. I saw somewhere that we have   $$\mathfrak{m}=(\mathfrak{p}+\mathfrak{q})/\mathfrak{q}$$   and so   $$\mathfrak{m}/\mathfrak{m}^2= \mathfrak{p}/(\mathfrak{p}^2+\mathfrak{q}).$$  I have two questions:   I dont understand how to get the expression of $\mathfrak{m}$ from the expression of the maximal ideal of a localization. So far I got something like $\mathfrak{m}=\mathfrak{p}(A_{\mathfrak{p}}/\mathfrak{q}_{\mathfrak{p}})$. Assuming the expression of $\mathfrak{m}$, I dont understand the computation of the vector space $\mathfrak{m}/\mathfrak{m}^2$.   For the sake of completeness this is part of the proof of the Jacobian criterion for singularity of varieties.

I find difficulty to understand the proof of this theorem :  Theorem : Let $Y\subseteq\mathbb A^n$ be an affine variety. Let $Ρ\in Y$ be a point. Then $Y$ is nonsingular at $Ρ$ if and only if the local ring $\mathcal O_P$ is a regular local ring.  Let $P$ be the point $(a_1,\dots,a_n)$ in $\mathbb A^n,$ and let $\frak {a}$$=(x_1-a_1,\dots,x_n-a_n)$  be the corresponding maximal ideal in $A = k[x_1,\dots,x_n].$ We define a  $\theta : A\longrightarrow k^n$ by $$\theta(f)=\left(\frac{\partial f}{\partial x_1},\dots,\frac{\partial f}{\partial x_n}\right).$$ So $\theta$ induce an isomorphism $\theta':\frak{a}/\frak{a}^2\longrightarrow$$k.$   Now let $\frak b$ be the ideal of $Y$ in $A,$ and let $f_1,\dots,f_n,$ be a set of generators of $\frak b.$ Then the rank of the Jacobian matrix $\left(\frac{\partial f_i}{\partial x_j}\right)_{i,j}$ is just the dimension of $\theta(\frak b)$ as a subspace of $k^n.$ Using the isomorphism $\theta'$ this is the same as the  dimension of the subspace $\frak a^2+b/a^2$ of $\frak a/a^2,$ if $\frak m$ is the maximal ideal of $\mathcal{O}_Р,$ we have $$\frak m/m^2\cong a/(b+a^2).$$   I don't understand how I can use $\theta'$ to get $\dim_k \theta(\frak b)$$=\dim_k(\frak a^2+b/a^2)$ and why  $$\frak m/m^2\cong a/(b+a^2).$$   Thank you for any help.


I have a html page with 2 buttons with the same form action (When the user presses a button, the form redirects it to a servlet and then in that servlet, I want it to redirect to another html page based on the button pressed in the html page).   Html page  <form action ="ManageEmployeeRedirect" method = "post">  <input type="submit" value="Create New Employee Account" name="ID1">

 <input type="submit" value="Update Existing Employee Account" name="ID2">  </form>
     Servlet  import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*;  public class ManageEmployeeRedirect extends HttpServlet {       protected void processRequest(HttpServletRequest request, HttpServletResponse response)             throws ServletException, IOException {         response.setContentType("text/html;charset=UTF-8");         PrintWriter out = response.getWriter();          String name = request.getParameter("ID1");         String name2 = request.getParameter("ID2");           if("ID1".equals(name)){             RequestDispatcher rs = request.getRequestDispatcher("index.html");             rs.forward(request, response);         }         else if("ID2".equals(name2)){              RequestDispatcher rs = request.getRequestDispatcher("changePassAdmin.html");              rs.forward(request, response);         }     }     @Override     protected void doPost(HttpServletRequest request, HttpServletResponse response)             throws ServletException, IOException {                processRequest(request, response);           }      @Override     protected void doGet(HttpServletRequest request, HttpServletResponse response)             throws ServletException, IOException {                processRequest(request, response);     } }


After reading about Linux namespaces I was under the impression that they are, amongst a lot of other features, an alternative to chroot. For example, in :     Other uses [of namespaces] include [...] chroot()-style isolation of a process to a portion of the single directory hierarchy.   However, when I clone the mount namespace, for example with the following command, I still see the whole original root tree.  unshare --mount -- /bin/bash   I understand that I am now able to perform additional mounts in the new namespace that are not shared with the original namespace and thus this provides isolation, but it is still the same root, e.g. /etc is still the same for both namespaces. Do I still need chroot to change the root or is there an alternative?  I was expecting that  would provide an answer, but the answer only uses chroot, again.  EDIT #1  There was a now deleted comment that mentioned pivot_root. Since this is actually part of , it is in fact part of the namespaces implementation. This suggests that changing the root directory only with unshare and mount is not possible, but namespaces provides an own - more clever - version of chroot. Still I do not get the main idea of this approach that makes it fundamentally different from chroot, even after reading the source code (in the sense of e.g. security or better isolation).  EDIT #2  This is not a duplicate of . After executing all the commands from the answer I have separate /tmp/tmp.vyM9IwnKuY (or similar), but the root directory is still the same!

I was checking unshare command and according to it's man page,     unshare - run program with some namespaces unshared from parent   I also see there is a type of namespace listed as,   mount namespace               mounting and unmounting filesystems will not affect rest of the system.   What exactly is the purpose of this mount namespace? I am trying to understand this concept with the help of some example.