Replacing the unknown quote marks with underscores, let’s say we’re trying to write this:  He responds, “Joe said ‘Mark said _I’m not coming._’”  One option is to alternate: He responds, “Joe said ‘Mark said “I’m not coming.”’”  Would it be crazy to use single or double angle quote marks? Like: He responds, “Joe said ‘Mark said ‹I’m not coming.›’”  I’m getting nowhere googling it.  Is there a better option?  I realize that, generally, the text will read better if it’s rephrased to nest less deeply. But I ask not as an author, but somebody formatting others’ work.  Edit: , and the question it’s marked a duplicate of, are not duplicates of this question because they discuss two-deep embedded quotes, whereas this question assumes the solution to two-deep quotes (use single quotes) and asks about quotes three or more levels deep.

Possible Duplicate:          I'm having some trouble with this.  Usually, I would quote with doubles, and then singles within.  But this is becoming a bit confusing and ugly too, when working with some translated literature in which it is very, very common for someone to quote someone, who then quotes another, and the chain goes on.  Would I retain the principle of using double quotes initially when I quote the passage, and then keep using singles in the embeds/nests?  Edit:  Thought I'd add, it looks fine and dandy until the initial quoter ends his discourse on the clause of the one he is quoting!  I end up with ' ' " and all sorts at the end!


In AES algorithm why there are 10 rounds for 128 bits whats the reason behind it like we have in raid storage technology or something else

The number of AES rounds increases with the key length. Why increase the number of rounds at all, and how were these round counts chosen?


Has been on my mind for some time now, how can the xenomorph see, hear, and smell? When looking at this xenomorph you cannot see any indication of eyes, ears, or nostrils, yet it can still find its prey even when a decent distance away. If it did have such orifices to indicate sight, sound, and smell. Then wherever would it be located on the creature? If it does not have traditional organs such as those then what does it use to find it's prey? Would it be some type of organ that would cause it to sense any nearby life forms that were not of its own kind? or maybe does it have something to do with the telepathy between xenomorphs that let it distinct a human for example apart from its own kind? Or could it be that it's skin is special in which it can sense the body temperatures of other creatures like how the eggs do when they sense a life form near it that is not one of their own? Perhaps the xenomorph has a specific body temperature that no other life form could possibly have and maybe they have the genetic ability to sense body temperatures and if it isn't the specific body temperature of its own kind then it is concluded that it is a different life form that they must attack. Maybe perhaps that is why they react so violently to rapid change in temperature around them like fire from a flamethrower or liquid nitrogen? Any insight would be much appreciated from all of you. So please let me know if there is any official documentation of how the xenomorph has such ability to locate prey items and or hosts for the Young.

If you just look at a picture of one there are no eyes readily apparent but they clearly know where they are going. Could their screeching be some form of echo-location?


How can i prove that Q(a,b) is a Galois extension and that its Galois group is of order 6, if a is a root of the cubic that is not 1 and b is the cubic root of 2?  Can you give me a little hint for the proof only that a finite extension (the Galois extension),  i have the rest of the problem.

I know the Galois group is $S_3$. And obviously we can swap the imaginary cube roots. I just can't figure out a convincing, "constructive" argument to show that I can swap the "real" cube root with one of the imaginary cube roots.   I know that if you have a 3-cycle and a 2-cycle operating on three elements, you get $S_3$. I have a general idea that based on the order of the group there's supposed to be at least a 3-cycle. But this doesn't feel very "constructive" to me.   I wonder if I've made myself understood in terms of what kind of argument I'd like to see?


I am a student and trying to design an aperture from which a light will pass will project on a sensor. I tried to find some software simulation tool for this purpose where i can draw the aperture (entrance side) and put diffuser or lens and then see the response of the light for some specific wavelength. I found one tool "Synopsys Code V" but it is very paid solution. So can anyone tell me some substitute for this. I am looking for Free simulation tools.

I'm having an extremely difficult time finding an optics program that is easy to use and offers accurate physics simulations. I'm not asking for much, I just want to be able to simulate a laser going through a beam splitter and then be able to drag and drop mirrors and angle them to be able to see where the laser beams end up. I want to intersect two laser beams that underwent beam splitting and redirect the beams...   Does anyone know of any free software that can do this?


I see this a lot on the internet, twitter etc. As an example say some random democrat is in a debate with a republican. Whatever the topic was, the democrat might say something along the lines of 'anyway you're probably just a racist so I don't care what you say...'. It's where the opposing party 'picks' one or more of the worst possible cases about 'you', factual or not, and just uses them to paint you as being 'worthless' or at least not worth debating with, ergo they win the argument. Another example might be someone trying to describe their belief in a 9/11 conspiracy. The opposing side might say 'yeah and you believe the moon landings were fake and JFK etc etc'. The conspiracy theorist may or may not hold those beliefs, but the opponent in this case just paints the picture that they do so they can be safely dismissed. Does that make sense? is there a word for when people do that?

I'm looking for either a single word or phrase that would describe either someone or the action of dismissing someone's opinions as something "socially unpopular", without giving any reasoning why, either just to spite them, because they have a poor counter-argument, have been backed into a corner, or something similar.  For example, someone who supports something politically incorrect (like, say, stronger gun control or help for male domestic abuse) might have their views dismissed as racist or sexist or liberal without actually acknowledging and debating against them, thus labeling the former as something they might not be.  I was talking to a friend earlier about politics, and she complained about Germany's immigration problem. She said one issue was that many politicians that try to support stronger immigration laws would immediately be shot down as racist or a nazi and forced to resign, instead of being presented with counter-arguments. Regardless of whether you agree with them or not, what would describe that?  EDIT: Forgot to specify -- the word or phrase I'm looking for would be used in an informal context. And to address further questions, to be used when the person's opinion has legitimate worth and isn't just "being racist" etc, i.e. the dismisser is incorrect, and is only making these accusations because they can't argue further. (Added emphasis to the last sentence of the first paragraph)


I'm working on a short with a CGI robot. I found this:   I'm trying to achieve a similar look with the scratches. The node setup he has in the video, looks quiet complex and I'm not sure how to go about doing this.  Is the best approach to add metal scratches is to create a UV map, that I can add to the metal, sort of like what I did on the face? Is there a different approach?

Is there a way to add scratches (like on worn metal) to a shader in Cycles?


Suppose $Y$ is an affine variety in $\mathbb{A}^n$ of $\dim r$. Then height of the prime ideal $\mathcal{I}(Y)$ is $n-r$. We have a result:     "Let $A$ be a Noetherian ring, $x_1,\dots ,x_r\in A$. Then every minimal prime ideal $\mathfrak{p}$ belonging to $(x_1,\dots ,x_r)$ has height $\leq r$." (Atiyah-Macdonald, Corollary $11.16$, page $121$).   Now suppose $\mathcal{I}(Y)$ is generated by $m$ elements. Then, using the result, $n-r\leq m$. So $\mathcal{I}(Y)$ is minimally generated by $n-r$ elements.  $\underline{\text{My question}}$: Is it always possible to find $n-r$ elements which will generate $\mathcal{I}(Y)$ or there are some examples for which it is not possible to find that minimal number of elements ? Also, in particular, if $Y$ is a linear variety then as @Georges pointed out we can always find $n-r$ elements which will generate the ideal $\mathcal{I}(Y)$. I need an explanation for this last part.   Thank you.

How can I determine the height and the least number of generators of the ideal $ I=(xz-y^2,x^3-yz,z^2-x^2y) \subset K[x,y,z] $?      I tried to calculate the dimension of the vector space $I/I\mathfrak m$ with $\mathfrak m=(x,y,z)$, but I'm not able to find it.  I think the height is $2$, because the affine variety should be a curve, and also I know that the ideal is prime, so I need a chain $0\subset \mathfrak p \subset I$. Maybe $(xz-y^2)?$ Is it prime?


I need help with my Java code. For some reason it skips the System.out.println("Username does not exist");. I'm almost sure i messed up with the {} somewhere. Help would be appreciated.  Updated:  import java.util.Scanner;  class Bot { public static void main(String[] args) {     Scanner input = new Scanner(System.in);     System.out.println("Do you want to start the bot?");     String startup = input.next();     if (startup.equalsIgnoreCase("yes") || startup.equalsIgnoreCase("y")) {         System.out.println("Okay, starting...");         System.out.println("Please type your username");         String user = input.next();         if (user.equalsIgnoreCase("admin")) {             System.out.println("Valid username. Please type your password.");             String pass = input.next();             if (pass.equalsIgnoreCase("admin") || pass.equalsIgnoreCase("root")) {                 System.out.println("Logging in...");             } else if (!(pass.equalsIgnoreCase("admin") || pass.equalsIgnoreCase("root"))) {                 System.out.println("Wrong password.");             } else {                 System.out.println("Username does not exist");             }             ;         }     } else if (startup.equalsIgnoreCase("no") || startup.equalsIgnoreCase("n")) {         System.out.println("Okay, shutting down...");     } else {         System.out.println("Please answer with 'yes', 'y', 'no' or 'n', not '" + startup + "'.");     } } };   Original:  class Bot {     public static void main(String[] args) {         Scanner input = new Scanner(System.in);         System.out.println("Do you want to start the bot?");         String startup = input.next();         if (startup.equalsIgnoreCase("yes") || startup.equalsIgnoreCase("y")) {             System.out.println("Okay, starting...");             System.out.println("Please type your username");             String user = input.next();             if (user.equalsIgnoreCase("admin")) {                 System.out.println("Valid username. Please type your password.");                 String pass = input.next();                 if (pass.equalsIgnoreCase("admin") || pass.equalsIgnoreCase("root")) {                     System.out.println("Logging in...");                 } else if (!(pass == "admin")) {                     System.out.println("Wrong password.");                 } else if (!(user == "admin")) {                     System.out.println("Username does not exist");                 }                 ;             }         } else if (startup.equalsIgnoreCase("no") || startup.equalsIgnoreCase("n")) {             System.out.println("Okay, shutting down...");         } else {             System.out.println("Please answer with 'yes', 'y', 'no' or 'n', not '" + startup + "'.");         }     }     };

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?


So, as far as I understand, I can use the tabularx package to make auto-width tables with text wrap.  Also, there is supertabular which allows me to make tables span across pages.  How do I make a table that:   Occupies the whole page horizontally. Spans across multiple pages preserving its header. Automatically selects certain column widths. tabularx's X-style. Wraps text in the columns.   ?

Is it possible to use tabularx inside a longtable environment?  If not, is there any way I can get the "X" funcionality of tabularx with the option of long tables ---In order for me to be able to break them in two pages?  Using longtabu is not an option, as stated by @jon :      I would recommend staying away from tabu as the package author is   still fiddling with things and explicitly promised that there would   not be backwards compatibility. See  for the discussion.   UPDATE:  Using the package ltxtable suggested by @Alan Munn (Writeen by @David Carlisle) I have the current Minimal Non-Working Example  Main File:  \documentclass{article}  \usepackage{array} \usepackage{tabularx} \usepackage{longtable} \usepackage{ltxtable}  \begin{document} Hello.  \LTXtable{\textwidth}{VersionOne}  \end{document}     Where the file VersionOne goes:  \begin{longtable}{XX} \caption{A very long table}\\ WHO                 & \hspace{5mm} World Health Organization\\[1mm] GDP                 & \hspace{5mm} Gross Domestic Product\\[1mm] PPP                 & \hspace{5mm} Purchasing Power Parities\\[1mm] \label{tab:LongtableOne} \end{longtable}   When I try to run this code, I get a Emergency Stop and a fatal error.  Am I writing this correctly?


I am a software developer and have started my career recently. I want to decide how to steer my career and to get some advice from experience people in this field.  I looked through the list of all websites under Stack Exchange and could only think of Programmers.SE as my best option. But I am not so sure after reading about it in the 'about' page.  Where I can ask my question without being down voted by other members? If there isn't any such group, I suggest that it be included in Stack Exchange.

The  specifically says not to ask  for career advice but people do it anyway.  Should I consider the Help Center outdated or only loosely enforced?    And what about a career advice site on the network?  There are 70+ sites, and most of them are for relatively narrow interests (which is not a criticism, I enjoy looking through the many sections).  A career section seems like it would be very popular.  Also, a careers section would help keep career questions off the other sites.


Can you give an example of a topological space which is path connected but not locally path connected, besides the graph of $\sin(1/x)$?

I am looking for a set in the plane (with respect to the natural Euclidean topology) that is connected, locally connected, path-connected but not locally path-connected. I did not find one in , but maybe I overlooked?


Ive added an image texture to this object and the texture shows all over, which is fine however I wanted to create another texture image (of rust) on the INSIDE this time... how would I go about doing that in the nodes as the outside faces are the same as the inside ones so I cant select them and just create a new material  Thanks for any help

I'm trying to replace the content of a box in a video, I have used the tracking system to match the movement of the video box with the interior of the one rendered in Blender, but I am running trough what seems a simple thing but I can't manage to get done.   I want the outside faces of the box to be invisible while hiding the inside of the box where the front wall of the box hides it, and the inside of the box to be rendered where visible. To do that I thought it would be as simple as making the face normals point to the inside of the box and giving a color only to the faces where normals are pointing to. But I can't manage to get that, am I going the wrong road? How can I achieve my goal?


Looking for a phrase/metaphor describing a situation where a proposed solution, though valid, is targeted for one of many problems in an entity plagued by so many problems as to render the individual solution unimportant. An example would be discussing improving the energy efficiency in the kitchen of a building that is condemned or on the verge of falling apart; though the methods for improving the kitchen might be totally valid, they're of little practical concern as they'd make no contribution to the long term viability of the building.  Something like "a drop in the bucket" but which emphasizes that the "drop" is well-conceived or -intentioned.    EDIT:  The answers here have been fantastic (and hilarious), though I think the phrase that best fits my request was actually listed by @user9383 in  (not in the answer but in the question itself):     Fixing a leaky faucet in a burning building.   This phrase perfectly captures both aspects of my request:   The intentions/method have merit: in general, leaky faucets need to be fixed. Despite this, the effort is wasted due much bigger problems: despite the inherent merit of the faucet-fixing, the ensuing destruction prevents the realization of any substantial benefit.

I'm looking for a turn of phrase to describe a situation where the powers that be wish to continue making small improvements to a process which, due to deep-rooted flaws, will never be close to accurate.  I'm working on a process for estimating the states of business objects, and there's interest in fixing some edge cases which have been noticed.  This could be worthwhile, but because of missing data we're already making heroic guesses.  So if implemented, we might get from 80.0 to 80.1% accuracy.  If we were at 99.5%, I'd be happy to get it to 99.6%, but in the current situation it doesn't seem productive.  We have some CS people on E.SE; what would you call it when someone wants to optimize a two-second process to load data, though once loaded it will be chewed on by an inefficient algorithm for hours?  Something like "bailing the ocean" or "fixing a leaky faucet in a burning building" is close to what I have in mind.  There's also "rearranging deck chairs on the Titanic," but that carries an implication that the changes are wholly useless, and that events are coming to a head.


I try to install spotify on my ubuntu 16.04 just very can't remember what I do and get the message.     An error occurred, please run Package Manager from the right-click   window or apt-get in a terminal to see what is   wrong.    The error message was:     Error: opening the cache(E:Type 'sudo' is not know on line 1 in source list/etc/apt/sources/.list,E: the list of source could not be read.)'This usually means that you have >installed packages with unmet dependencies   I did not sure it this a problem too. I got something like this when I used code: sudo -H gedit /etc/apt/sources.list  sudo apt-get update #deb-src http://repository.spotify.com stable non-free #deb http://repository.spotify.com stable non-free

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


Is there any branch of Stack Exchange where I can ask questions related to my education and career?


Are there any R functions that allow you to easily compare quasi-Poisson and negative binomial models to determine which error distribution is more appropriate for your data? Or - does this require writing a simulation from scratch?

Is there any way to compare the fit of quasi-Poission and negative binomial models? If so, can it be done in R?


When adding the second solution to , I initially tried to compile with XeLaTeX so that I could use fontspec. However, that didn't work, although compiling with LuaLaTeX did.  I've now managed to create an MnWE: there is a problem, it seems with my use of inner color and outer color with the XeTeX engine. The following example gives the expected output when compiled with pdfLaTeX or LuaLaTeX, but not XeLaTeX.  \documentclass[tikz, border=10pt, multi]{standalone}  \begin{document} \begin{tikzpicture}   \node [inner color=yellow, outer color=red] {Node}; \end{tikzpicture} \end{document}   Output with LuaLaTeX and pdfLaTeX:    Output with XeLaTeX:    Is it possible to use this kind of fill with XeLaTeX? If so, how? If not, is any engine-agnostic alternative available?

I would like to use shadings in my TikZ graphics together with the standalone package and XeLaTeX, but for some reason it is broken if I try with the new 3.0.0 release (). Any other combination I tried works for me (use for example article class/pdflatex/lualatex/TikZ 2.10). (I'm using a fully updated TeX Live 2013.) MWE \documentclass{standalone} %\documentclass{article} % would work  \usepackage{tikz} \usetikzlibrary{shadings}  \begin{document} \tikz \draw[top color=red] (0,0) rectangle (2,1); \end{document}  Output  Expected Output  Question How can I avoid the problem and which package/class is causing it?


I have a form in which i use to insert data using ajax and php  I have gotten it to work the way i want but i wanted to make some adjustments to it, below is what i am trying to say  Initially      <form id="<?php echo $row_trx['jobid']; ?>" name="<?php echo $row_trx['jobid']; ?>" id="form<?php echo $row_trx['jobid']; ?>" action="" method="post">      <button  type="submit" id ="<?php echo $row_trx['jobid']; ?>">Add as favourite</button> </form>   which works when the button is loaded on the page by default,  Adjustments i wanted to make was to display using ajax for some reason using below in the div with id='ajaxDiv'   <form style="font-size: 1px;" name='myForm<?php echo $row_trx['jobid']; ?>'> <input type='hidden' value="<?php echo $row_user['Username'];?>" id='age<?php echo $row_trx['jobid']; ?>' />
 <input type='hidden' value="<?php echo $row_trx['jobid']; ?>" id='wpm<?php echo $row_trx['jobid']; ?>' />
   </form>  <div id='ajaxDiv<?php echo $row_trx['jobid']; ?>'>
   the button submit my data wen i try to display in the div via ajax, please i need help on this

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


Let  $$ a_1,a_2,\dots,a_n $$ be positive real numbers such that $$ \prod_{i=1}^n a_i =1 $$ Prove that  $$ \prod_{i=1}^n (1+a_i) \geq 2^n $$

Let $a_1,a_2,\dots,a_n$ $\in$ $\mathbb{R}^+$ and $a_1\cdot a_2\cdots a_n=1$, , prove that $(1+a_1) \cdot (1+a_2) \cdot \dots \cdot (1+a_n) \geq 2^n$ I have tried factorising but it just lead me to extremily complicated equation that were extremily difficult to understand... Could someone help me?


Given two sensors of different sizes, but with an equal number of pixels, and the situation below; are there any differences in the images captured in the bottom two drawings? Since both sensors have the same number of pixels in both directions, the resulting images will be of the same size.   The first two drawings depict the difference between the sensors using the same lens. The last one has a different lens in order to capture the eqivalent of scene 2.  A couple of questions:   Will there be any differences between the images captured by the second and third drawing? If so, are there circumstances where the crop sensor is able to capture an image that the full frame sensor is unable to do? Will the zoom of a zoom lens be of a different quality than the zooming contributed to the crop sensor?    Thanks!

I'm reading that a 50mm lens is recommended as a first prime lens for DSLR owners as it's supposed to give a 'natural' perspective, but when used on (most) DSLRs, the view is cropped, as if you were zoomed in by 1.5-1.6x, so it's more of a telephoto lens when used on a DSLR. I've also read however that the 50mm lens gives the same perspective on a DSLR and a 35mm, and shouldn't really be considered to be 'equivalent' to an 80mm lens as the crop factor isn't really a magic focal length changer.  Can someone explain how the image is different from (for example) a 50mm lens on a DSLR and an 80mm lens (assuming 1.6x crop factor) on a 35mm camera?


How can I add left space to a block of text? (see the attempts and pictures below)  I can think of two ways:  minipage  \documentclass{article}  \usepackage{lipsum}  \begin{document}  \lipsum[1]  \noindent \hspace{2em}% \begin{minipage}{0.95\textwidth} \lipsum[2-3] \end{minipage}  \end{document}     Three problems:   I cannot use another minipage within that minipage (which I need in my usecase) Indentation and paragraph spacing seem to change What to pass as the width optional argument?   enumitem  Using itemize with the enumitem options:  \documentclass{article}  \usepackage{lipsum} \usepackage{enumitem}  % needed!  \begin{document}  \lipsum[1]  \begin{itemize}[label={},leftmargin=2em] \item \lipsum[2-3] \end{itemize}  \end{document}   It loses indentation and the paragraph spacing is a little different than the rest, but looks like much better:    Anyhow, any other suggestion?  (Duplicate of: )

Sometimes the margins need to be changed for a particular page, paragraph, or other section of text.  For example, if I'm writing a letter and want the left margin to be almost at the right side of the page for the four lines of my address, or if I am combining prose with poetry and want the poems to be indented relative to the rest of the work.  What is the best way to change both left and right margins on the fly?


I want to make this table automaticly. That is mean, I receive the value of $\sin$, $\cos$, $\tan$ and $\cot$ of the angle $\alpha$ without typesetting by hand. But I don't know.   How can I make it?  Note. The words "Không xác định" means undefined.

Consider the following screenshot.    The features I want to have are:   I can shrink the page size and the table is allowed to break across pages.  The background of odd rows must be different from that of the even rows to ease reading. The values must be calculated automatically rather than by hand-made data entry.    MWE  \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage[nomessages]{fp} \usepackage[table]{xcolor} \usepackage{longtable} \usepackage{pgffor} \begin{document} \topskip=0pt \begin{longtable}{*2{|>{$\displaystyle}c<{$}}|}\hline \theta & \sin \theta\\ \foreach \x in {0,10,...,360}{\x & \FPeval\temp{round(\x:3)}\temp\\} \end{longtable} \end{document}


When I attempt to login to Area 51 with my normal credentials (a Stack Exchange openID) I get this error:

I recently tried many times to log into Area 51 with my Stack Exchange OpenID. Each time, I got this:    Then, I went to my OpenID account, and I saw this:    ...what is going on??  I have chrome, and extensions that block 3rd party cookies... is that the problem?


I just had updates run automatically in my 16.04 test and 16.04 live environments and they killed the desktops after I rebooted them! No launcher, no status bar at top. I know they are running, I can left click on desktop to get to settings, but there is no way to closes that once it is open! Provide restore please!

This  forced removal of unity and ubuntu-desktop on my 16.04 Ubuntu system.   The offending package that is missing, but unity needs, seems to be compiz-core-abiversion-20151010. It seems to be a , and I can't find it to download.    As it happens, I mostly use LXDE on this system, but I'd be very unhappy if I used Unity...  Since I do occasionally use the Unity desktop, is there a fix for this?  Edit: related questions are rolling in. Looks like a major quality escape          Edit 2:


I have question about checking if file exists or not. Which option is better?  source=fopen("text.txt","r"); if(source != NULL) {     printf("File Exists!\n");     exit(0); }   or to use  if (source) {     printf("File Exists!\n");     exit(0); }

Is there a better way than simply trying to open the file?  int exists(const char *fname) {     FILE *file;     if ((file = fopen(fname, "r")))     {         fclose(file);         return 1;     }     return 0; }


I am trying to make an article (elsarticle) uses English as main language and some Arabic words embedded using arabtex but this error is generated:  Missing } inserted. \end{abstract}   I wish some one know about it, and has a solution.  \documentclass[preprint,12pt]{elsarticle}  \usepackage{arabtex}  \usepackage{amssymb}  \usepackage{lineno}  \journal{Journal Name}  \begin{document}  \begin{frontmatter}  \title{Unncessarily Complicated Research Title}  \author{John Smith} \address{California, United States}  \begin{abstract} here some text \end{abstract}  \begin{keyword} Science \sep Publication \sep Complicated \end{keyword} \end{frontmatter}  \bibliographystyle{model1-num-names}  \bibliography{Biblio}  \end{document}

I am using elsarticle  Everything was find before I used \usepackage{arabtext}.   When I compiled to PDF, I got the following error message.    And if I type "s", everything became fine again but I don't want to type an "s" every time I compile PDF preview.   Please anyone advise.  Thank you very much in advance for your help.  Here is the code  \documentclass[12pt, authoryear]{elsarticle}    % use "amsart" instead of "article" for AMSLaTeX format \usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref} \usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots. \geometry{a4paper}                          % ... or a4paper or a5paper or ...  %\geometry{landscape}                       % Activate for rotated page geometry %\usepackage[parfill]{parskip}          % Activate to begin paragraphs with an empty line rather than an indent \usepackage{graphicx}               % Use pdf, png, jpg, or epsÂ§ with pdflatex; use eps in DVI mode                             % TeX will automatically convert eps --> pdf in pdflatex         \usepackage{amssymb}  \usepackage{amsmath} \usepackage{tipa} \usepackage{arabtex} %SetFonts  %SetFonts   \title{Translating from English to Bahasa Indonesia: Which procedures should be taught to EFL students preparing to be a translator?} \author[mkl]{Mohammad Kholid}  \author[fai]{Faisal Mustafa\corref{cor1}} \ead{faisal.mustafa@unsyiah.ac.id}  \cortext[cor1]{Corresponding author}  \address[mkl]{Syiah Kuala University, Banda Aceh, Indonesia} \address[fai]{Syiah Kuala University, Banda Aceh, Indonesia} \date{}                         % Activate to display a given date or no date  \begin{document} %\section{} %\subsection{}  \begin{frontmatter}  \begin{abstract}   Abstract content is here.  \end{abstract}  \begin{keyword}  translation procedures \sep English to Bahasa Indonesia \sep teaching translation \end{keyword} \end{frontmatter}


Whenever I attempt to connect to another world, I get the error message; "Outdated server" but the app has the newest update.  Can someone explain what's happening?

Trying to connect my from son's iPod 4 to my iPod 4s. Both are using iOS6, both playing Minecraft version 8.1. My iPhone joins to my iPad no problem but not to the iPhone 4. If I try to connect from the iPhone4 it says 'outdated server' if I try to connect from my iPhone 4S the wifi world from the iPhone4 doesn't even show up as an option to connect to.  Same version same wifi network, what am I missing?


What's the best book to study analysis after finishing Spivak's Calculus? I thought about Rudin's Principles of Mathematical Analysis(Which I guess would be much boring for me, but I don't have it so I can't tell if my supposition is right or not), Stein and Shakarchi's Real Analysis, Terence Tao's Analysis(if you recommend it, tell me which edition is the 'right', please) or Pugh's Real Mathematical Analysis?   Additional info about my purpose:  - I tend to seek elegance in proofs.  - I want to grasp concepts the most deeply possible. - I don't like books that just jump steps without clear explanation, but I don't like books that are boring(books that focus too much in rigor, in the steps, in the "you can prove it this way". I like rigor and it's what - - - I'm seeking, but sometimes authors make it boring. I don't know if I made me intelligible).  - However, I want books that make me try to 'rediscover the subject';  mean, books that make me think hard on the subject even before he explains the matter.  - Books with super hard exercises are welcome.

I am a sophomore in US with double majors in mathematics and microbiology. I am interested in self-studying the real analysis starting now since it will help me on my current research on computational microbiology, prepare for upcoming math research (starting on this Fall) on the analytic number theory, and prepare for the real analysis course I will take on Fall and Putnam competition. I just finished "Calculus with Analytic Geometry" by G. Simmons, "How to Prove It" by Daniel Velleman, and "How to Solve It" by G. Polya. I also read some portions of Apostol's Calculu Vol.I to get a deeper view on the calculus theories. I was originally planned to read Apostol's Calculus Vol.I and Spivak's Calculus first, but I think it would be a better idea to start with real analysis since it covers all ideas in those "advanced calculus" textbooks and much more. My current plan is to start with one "dumbed-down" real analysis textbook and one "comprehensive, detailed, and intermediate" textbook, and advance into Rudin's PMA (required textbook for my real analysis course) starting on Summer and use it in accordance with other real analysis textbooks. Could you help me on selecting one book from each category?   Elementary Real Analysis textbooks:  **Elementary Analysis: The Theory of Calculus (Kenneth Ross)  **Understanding Analysis (Steven Abbott)  **The Way of Analysis (Robert Strichartz)  **Real Mathematical Analysis (Charles Pugh)   Intermediate, detailed Real Analysis textbooks:  **Mathematical Analysis (Tom Apostol)  **Undergraduate Analysis (Serge Lang)  **Introduction to Real Analysis (Bartle, Sherbert) **Elements of Real Analysis (Bartle, Sherbert)  **Mathematical Analysis I (Vladimir Zorich)   Thank you very much for your time, and I look forward to your advice!   Sincerely, PK


I don't know it's just my experience or not, but every time I type a wrong password in terminal, it takes 2 or 3 seconds to respond. And I think It's a very long time for a computer. Does anybody know the reason?

I notice a weird (well, according to me) thing about passwords. For example, if I type an incorrect password during login, there will be a few seconds' delay before the system tells me so. When I try to sudo with a wrong password I would also have to wait before the shell says "Sorry, try again".  I wonder why it takes so long to "recognize" an incorrect password? This has been seen on several distributions I use (and even OSX), so I think it's not a distribution specific thing.


I am learning Controller area network. The arbitration for bus access is done with a message identifier(as given in CAN specifications). So if two nodes tries to transmit data on the bus with same message Identifier, then who will win the arbitration or what condition will arise under this situation? Maybe this is a silly question to ask at initial stage of my learning but if this condition arises how will the CAN bus behave.

I'm aware that messages on the CAN network are assigned priorities. I'm  working on a 2oo3 voting system, and if each of the messages by the three masters are given three unique id's, I'll be making masters among the three masters for the messages i.e. I'll be prioritising among the masters.   I have considered the approach where the slaves keep transmitting the data (either periodically or when they detect a change in the inputs), so that by this way all the three masters can receive the data at the same time and act on the same data. Or, another approach wherein the three masters decide among themselves who will request the slave and when the slave replies, all three masters will process the data at the same time.  I want to know if there is a way, by using a CAN network, I can ensure that the three masters are given the same priority without going with the slave sending approach as mentioned above, and making sure that the masters initiate all actions and not the slaves.   Note: I'm aware of how useful ID's are in arbitration. I just want to know if there a way by which this method is possible.


I'm running into a LNK2019 Error whenever I try to move the function definition outside of the header file. When I have the overloaded operator and push_back() function in the header file, it works fine but it doesn't when I move it to the implementation file. This is my header file: #ifndef VECTOR_H #define VECTOR_H  #include <iostream> using namespace std;  template <typename T> class Vector {     int capacity;     int size;     T* arr; public:     Vector();     Vector(int initial_capacity) {         arr = new T[initial_capacity];         capacity = initial_capacity;         int size = 0;     }     Vector(const Vector& source) {         arr = new T[source.capacity];         capacity = source.capacity;         size = source.size;         copy(source.arr, source.arr + size, arr);     }     ~Vector() {         delete[] arr;     }     void push_back(T);     template<typename T> friend ostream& operator<< (ostream&, Vector<T>&);      };  #endif   This is my implementation file: #include "Vector.h" #include <iostream>   template<typename T> ostream& operator <<(ostream& outs, Vector<T>& source) {     for (int i = 0; i < source.size; ++i) {         outs << source.arr[i] << " ";     }     return outs; }  template<typename T> void Vector<T>::push_back(T val) {     arr[size] = val;     size += 1; }  And this is my main file: #include "Vector.h" #include <iostream> using namespace std;  int main() {     Vector<int> sample(10);     sample.push_back(10);     sample.push_back(20);     cout << sample;     return 1; }

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I want to set up a whitelist in a router and I need to know what Internet addresses are consulted by a specific app on iPhone or iPad.  Are there tools for this?

Just the same way you can open the web inspector or activity window in Safari on your laptop and see all the HTTP requests any website has made, how do you do that on the iphone for an iPhone app, if the iPhone app is using HTML5 (or even if it's a native app)?


I have some troubles with my latex document. I'm using minted to put on my file some VHDL code. However, when i compile it, all < are replaced by ¡. Does anyone have an idea ?   Here is an example :   \documentclass{report}  \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{minted} \begin{document} \begin{minted}[fontsize=\footnotesize, linenos, autogobble, breaklines]{VHDL} library IEEE; use IEEE.STD_LOGIC_1164.ALL;  entity sept_segment2 is Port (     switch_seg : in STD_LOGIC_VECTOR (3 downto 0);     switch_an : in STD_LOGIC_VECTOR (3 downto 0);     an : out STD_LOGIC_VECTOR (3 downto 0);     seg : out STD_LOGIC_VECTOR (6 downto 0)  ); end sept_segment2;  architecture Behavioral of sept_segment2 is  begin  seg <= "1000000" when switch_seg = "0000" else     "1111001" when switch_seg = "0001" else     "0100100" when switch_seg = "0010" else     "0110000" when switch_seg = "0011" else     "0011001" when switch_seg = "0100" else     "0010010" when switch_seg = "0101" else     "0000010" when switch_seg = "0110" else     "1111000" when switch_seg = "0111" else     "0000000" when switch_seg = "1000" else     "0010000" when switch_seg = "1001" else     "0001000" when switch_seg = "1010" else     "0000011" when switch_seg = "1011" else     "1000110" when switch_seg = "1100" else     "0100001" when switch_seg = "1101" else     "0000110" when switch_seg = "1110" else     "0001110";  an(0) <= not switch_an(0); an(1) <= not switch_an(1); an(2) <= not switch_an(2); an(3) <= not switch_an(3);  end Behavioral; \end{minted} \end{document}   I have tried in several environments (and on overleaf). It always shows ¡ instead of <. Any ideas ? Thanks !

When typing < or > in LaTeX and compiling with pdflatex, the less than and greater than symbols appear at upside down exclamation points. I'm not in math mode.


I have installed PHP, MySQL, and Apache in my machine by following  tutorial. I created one file info.php to test if php is working on my apache server, but I go message file not found. Then, I tried to place info.php file inside html directory, it worked fine. Is it possible to change it to /var/www not in /var/www/html?  Please help. I am new to linux.

I recently installed Ubuntu 14.04, then I installed lamp-server and placed my webpages in /var/www directory, but when I opened localhost in the browser there was nothing. I think that happened because Zend updated Apache.  Whatever the reason may be, I want to know where to keep my php files so that I can access them from my browser.


I have a Excel Sheet that I am trying to translate over to web page. The issue I am running into is that if I have a lot of columns that causes horizontal scrolling.   I could also have 100+ rows that display information  For example (not the actual data, thanks to ):   Any Recommendation on how to make UI/UX experience for users easier so it shows them all the information and they can update the data in one page?

We're building a web-based platform where the main dashboard shows a table of data for users to view and analyze. As we're growing this tool, we seem to be adding more and more columns and are running out of horizontal space on smaller screen resolutions (we're seeing some data wrap). It is important to the user to view all columns at once, so column hiding is somewhat out of the question, as is horizontal scrolling (per the boss's request and because horizontal scrolling sucks anyways). I was wondering if anyone knew of a clever UI for tables with many columns.  EDIT  Below is a screen capture of the layout of the table. Unfortunately for security purposes I had to blur out the column titles. This example has rows with practically no data in them, but in use they will have lots of data that will expand wider than their respective column titles. In response to some of the answers, it is imperative that the user see all the columns, as they are all necessary to analyze the data to make certain decisions. All the data is numeric aside from the first three columns. Thanks again for any feedback.    Ok so I see that uploading this image doesn't really do it justice... it takes up the full width of the screen at 1680x1050 resolution (22") and as data fills in the columns, the left column w/the text shrinks down a bit.  EDIT 2 I just wanted to say thank you to everyone's awesome ideas. I can only select one answer, but a lot of your ideas have proven very useful and may end up in the final product. Thanks again!


I make this answered question because it took me a while to find the right solution so I hope it helps somebody (I am a quite new to Linux so I was trying to use the "secure" way to do it):   Dropbox has some kind of update/compatibility issues with ubuntu (or the other way around). Solutions that I see on forums from months and years ago do not work after some months (after reading the comments). This worked for me on Ubuntu 14.04 on october 2015 Dropbox installed from the ubuntu software center won't work/start Downloaded .deb file from the dropbox website requires a daemon to be installed. After installing it, dropbox still does not work and gives a lot of error messages (about the daemon)   Solution: Just use the command line (terminal)  sudo apt-get install nautilus-dropbox   I found the command here:   I found a detailed explanation on this issue on the answer of this question (hard to find if you don't know about the problematic update):

For some reason installing Dropbox via software center does not work.  I get a message that sends me to Dropbox website where I follow the instructions. But at the end it says it says:     Next, run the Dropbox daemon from the newly created .dropbox-dist folder.   I am not able to do this. Running the command ~/.dropbox-dist/dropboxd fails for me.  Running Ubuntu on Windows 7 Home Edition.


Similar to the question "," I'm curious if there are any editors or add-ons that directly support the LaTeX documented source (.dtx) format.  I imagine such an editor would support syntax highlighting for both the implementation as well as the documentation, perhaps with different backgrounds to increase contrast between sections. Just as most editors will preserve indentation on newlines, it would also be helpful to preserve the leading % in documentation mode. Extra bonuses to support for Doc-specific macros.  Does such a thing exist? Do enough people actually edit .dtx files for there to be sufficient demand?

DTX files are based on LaTeX comments, which means that any editor that can highlight LaTeX code will print most of the DTX files - all the documentation - as a comment and thus not highlight the code.  I found that Emacs can handle that problem, however I rather do not want to learn how to use Emacs just because of that. WinEdt should be able to handle the problem as well, but that is not Open Source. TeXworks does not handle it (I am using Window). I read that gedit should be able to do it, but it also only highlights standard LaTeX Code.  In  a script for highlighting in TeXworks was introduced, but I have not idea how to tell TeXworks to use that. The settings dialog does not allow to do it.


Is it correct to say  I miss doing this I miss traveling a lot  OR  I miss to do this I miss to travel?

I read  article and here it is mentioned that "I miss to swim" is grammatically incorrect. However, I do not see any issue with it.  Could some language expert please clarify.


If an object is in orbit around a star, the object has gravitational potential energy that could possibly be extracted. For example, when we perform gravitational slingshots around Jupiter, our spacecraft speeds up and Jupiter drops to a slightly lower orbit -- we convert some of its gravitational potential energy into kinetic energy which we use for our purposes. There is only so much energy that can be extracted before Jupiter would drop so low that it would get too close to the Sun for this to work (e.g. hitting the Sun's surface).  Imagine if the planet were orbiting a black hole instead of a star. In this case the process could be continued for longer. How much energy could be recovered? Can this be expressed as some fixed fraction of the lowered object's rest-mass? Is this the same as what you would get by slowly lowering the object directly into the black hole on an idealised rope connected to a turbine?  ...  lemon gave an excellent explanation of how the gravitational potential energy difference from lowering a mass, $m$, from far away down to the event horizon is equal to half its mass-energy. This would seem to provide an upper bound for a more realistic answer. Here are a couple of additional things I'd like to see taken into account:  (1) The freed energy would get redshifted as it was brought back away from near the black hole. How does this change things?  (2) Below 1.5 times the Schwarzchild radius, there are no circular orbits (circular travel requires outward thrust). This presumably causes a lot of trouble for my method beyond that stage since I had a mass in orbit that I was slingshotting things around.  (3) Below 1.5 times the Schwarzchild radius, ballistic objects cannot escape the black hole unless they are angled away from it (e.g. light starting travelling perpendicular to the centre of the black hole just spirals in). Presumably this causes trouble for my approach since as far as I understand the slingshotting mainly involves ballistic motion roughly perpendicular to the centre of the black hole.  (4) Lower orbits are also faster, so it would seem that some gravitational potential energy goes into speeding up the lowered object, increasing its kinetic energy. This could be a very large amount if it is lowered close to the event horizon, as the orbital speed there is $c$. Thus assuming you can get all the gravitational potential energy out could be a serious over-estimate. Does anyone know how to adjust for that?  This is not a duplicate of  as that question is not concerned at all with lowering via orbits, so for instance, my questions (1), (2), (3), and (4) don't apply there. In addition, the brief answer given there appears to be incorrect, as it contradicts the best answer here so far.

An object of mass m is slowly lowered into a black hole of mass 1000 m. Is the amount of braking energy larger than $0.6 mc^2$?   Now what if, after lowering the mass close to the event horizon, we wait the black hole to shrink to mass 100 m, by emitting Hawking radiation, and then we lower the mass some more? Is the braking energy of the second lowering process larger than $0.5 mc^2$?   I wonder can we extract more than $E=mc^2$ energy from mass m?  (In this thought experiment we use a wire and a winch, or anything that works)


I've read  regarding using ratios in regression, specifically using the ratio as an IV. The case he makes is that the ratio is an interaction term and thus should include it's components, and further suggest including the components, and the ratio itself as an interaction.I want to make sure I understand correctly.  As an illustrative example, suppose I think bmi is predictive of head circumference in children.  library(mice) # for the data data(boys) boys$hgt <- boys$hgt/100 # convert to cm mo <- lm(hc~bmi,data=boys) # (1) mo <- lm(hc~ I(1/(hgt^2)) + wgt + bmi, data=boys) # (2) bmi without considering it's an interaction mo <- lm(hc~ I(1/(hgt^2)) + wgt + wgt*I(1/(hgt^2)), data=boys) # (3) bmi set as an interaction term, very similar to above mo <- lm(hc~ hgt + wgt + bmi, data=boys) # (4) simpler and performs marginally less   From the data it seems all models are superior to (1) (better $R^2$, lower residuals etc), and while bmi as ratio is significant, it actually provides very little as a measure over using height (which is the main influence factor) and weight.  To sum: 1) which is the best modelling form? should I always make these examination and infer based on data, or is form (3) always preferred? 2) Am I correct in the last paragraph?  Thanks

Recently, randomly browsing questions triggered a memory of on off-hand comment from one of my professors a few years back warning about the usage of ratios in regression models. So I started reading up on this, leading eventually to Kronmal 1993.  I want to make sure that I'm correctly interpreting his suggestions on how to model these.   For a model with a ratio with the same denominator on both the dependent and independent side: $ Z^{-1}Y = Z^{-1}1_n\beta_0 + Z^{-1}X\beta_X + \beta_Z + Z^{-1}\epsilon $   Regress dependent ratio on the (inverse) denominator variable in addition to the other ratios Weight by the (inverse) denominator variable  For a model with dependent variable as a ratio: $ Y = \beta_0 + \beta_XX + Z1_n\alpha_0 + ZX\alpha_X + Z^{-1}\epsilon $   Regress numerator by original variables, denominator, and denominator times original variables [what about categorical variables?] Weight by (inverse) denominator  For model with only independent variable ratios: $ Y = \beta_0 + X\beta_X + Z^{-1}1_n\beta_{Z^{-1}} + W\beta_W  + Z^{-1}W\beta_{Z^{-1}W} + \epsilon $   Include numerator and (inverse) denominator as main effects, ratio as interaction term.    Are my interpretations here correct?


We have $f,g: \mathbb{R}  \rightarrow \mathbb{R}$ and $g(f(x))=f'(x)$. $f$ is differentiable in all points. Prove that $f$ is monotonic.  It is easy to prove that $f$ is monotonic when $f'$ is continuous, because otherwise we could easily find $a,b$ such that $f(a)=f(b)$ with differing derivatives (because in one point $f$ is increasing and in the other one it is decreasing).  I suspect similar reasoning works when we do not assume that $f'$ is continuous, because there should be a way to guarantee that there are continuous intervals of $f'$, and we could use this to work out solution. However, I couldn't do this in any strict way.

Problem. Let $I,J$ be open intervals, $\,f:I\to \mathbb R$, continuous, $\,\varphi :J\to \mathbb R$,  continuously differentiable, with $\varphi[J]\subset I$, and $\varphi$ satisfying $$ \varphi'(t)=f\big(\varphi(t)\big),  \quad \text{for all $t\in J$}. $$ Show that $\varphi$ is monotonic.  This becomes rather straight-forward if we further assume the $f$ is continuously differentiable, or even locally Lipschitz continuous, as this implies that IVP for $x'=f(x)$ enjoy uniqueness, and hence if $f\big(\varphi(t_0)\big)=0$, for some $t_0\in J$, then $\varphi$ is constant. In fact something stronger holds in such case: $\varphi$ is either strictly monotonic or constant.  This problem is also straight-forward if $f(x)\ne 0$, for all $x\in I$, in which case uniqueness kicks in anew.  The hard part is to show monotonicity of $\varphi$ when $f$ is just continuous, and its values include zero.


Here's a visual representation of the scenario  Here you can see we have a black hole on the left. The event horizon is the edge of the black hole. You are far away from the event horizon, and a chain is passing you by fast heading toward the black hole. Due to the size of the black hole and the makeup of the chain, the chain will not break before reaching the event horizon. After a while, the following scene happens:  As the end of the chain approaches the event horizon, the chain slows down due to the immense gravity as it approaches a frozen state. As I show in the diagram, you can observe this phenomenon as well as observe the chain moving fast by you toward the black hole. As for my question..  How can the part of the chain near you appear to be moving quickly toward the black hole, while the end near the black hole is frozen (or close to it)? Where does all that chain go? Let me ask the same question in another way..  If the distance between you and the black hole is 1000 units, and the chain appears to be almost frozen 1000 units away from you, how could you reconcile watching 10000 units of chain speed past you? How does that 10000 units appear to fit within a distance of 1000 units from your perspective?

No long explanation is needed,  What would happen if I were to allow one end of a rope to fall past the event horizon of a black hole while I held the other end?  Would I be able to pull it out? Would the rope feel extremely (infinitely?) heavy?


I have a list containing 10000 images. I want to show the 1st 10 images. How do I write the for loop in python ?  from PIL import Image import glob image_list = [] for filename in glob.glob('<my_directory>*.pgm'):     im=Image.open(filename)     image_list.append(im)   import matplotlib.pyplot as plt  for i in range(10):     plt.figure()     plt.imshow(image_list[i])   Thats my code. I have tried image_list(3), image_list(1:3) but it all doesnt work. Help thanks

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


The code below result to list of lists: [[1, 2, 3], [4, 5, 6]] How to modify it so the result is a simple list:`[1,2,3,4,5,6]?  def functA():     return [1,2,3] def functB():     return [4,5,6] def functC():     return None  functs=[functA, functB, functC]  result=[a for a in [funct() for funct in functs] if a]  print result

Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  >>> reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  >>> [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  >>> from itertools import chain >>> list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  >>> chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) >>> print(list(chain)) >>> [1, 2, 3, 5, 89, 6]


Everybody's seen a fly  like Mr Burns. And almost everybody's heard the standard explanation - that it's cleaning itself. Now, this is certainly a very plausible explanation, but has it been demonstrated? I can't find any references to experiments seeking to prove this hypothesis. I'm asking because, not being very familiar with these matters, I'd love to know what methods were used to demonstrate something like this.

I've noted that every time a house fly is resting on a surface, it appears to "rub" or "scrub" its front legs in a repetitive movement. And they do it continuously. Why?


I have a dataset with 174 females and 28 males. I am interested in the gender differences, as well as the interactions between gender and other factors, in a continuous dependent variable. Is GLM appropriate for this very unbalanced dataset? What would be a better alternative?

Take the case of book ratings on a website. Book A is rated by 10,000 people with an average rating of 4.25 and the variance $\sigma = 0.5$. Similarly Book B is rated by 100 people and has a rating of 4.5 with $\sigma = 0.25$.   Now because of the large sample size of Book A the 'mean stabilized' to 4.25. Now for 100 people, it may be that if more people read Book B the mean rating may fall to 4 or 4.25.   how should one interpret the comparison of means from different samples and what are the best conclusions one can/should draw?    For example - can we really say Book B is better than Book A.


I'm still confused as to why there is yet another rendering engine packed into blender. I thought cycles was pretty good, what does eevee do better?

We all know what Cycles is, at least to a first approximation: Cycles is  a path tracing engine [...] Specifically, cycles is a "backwards" path tracer, which means that it traces light rays by sending them from the camera instead of sending them from light source(s)  —from   Understanding its implementation clearly requires some more technicalities, like the BVH, the specificity of volumetric shaders etc, but even without all those details it's pretty clear what's the "idea" behind it. In short (Cycles): rays are traced back from the camera until they reach a source of light or the sky. Every time they "hit" something they have different possible routes -- each with its own probability, as described by the material settings: they can reflect at specular angle (specularity), bounce at random angle (rough diffuse), transmit through the surface (refraction), etc -- and during this route they accrue color, intensity etc. Since there are probabilistic choices along the route, multiple rays with different random seeds are cast and then averaged (samples) (1). As for , we know what it's for: it is a «modern, high-quality viewport that will perform better than the current Blender viewport» (); we know what it is not for: it «uses approximations on the behavior of light and will not be as accurate» as Cycles (). But I think it hasn't been written yet "what it does". How would you shortly explain the workings of EEVEE to a friend (or to a class of non experts)? What are the main steps that go into the rendering process? Lit/shaded areas, occlusion, interaction with the materials, (possibly even subsurface scattering and volumetrics, that I guess must be somewhat tricky), etc... My description of Cycles above (1) is the type of understanding I'd like to get about Eevee. Thanks!


So I'm watching through the old Twilight Zone and was watching an episode called "Third From The Sun". Towards the end, there's a scene where they use the Star Trek bridge sounds. I was under the impression that the sound effects were original to Star Trek and some research I've done has linked them to when the series was created and not before.   Is it possible the sound effects were apart of a sound library networks used? If so, who created the sound effects and how did they end up in that library?

I was watching an episode of , specifically  made in 1957 and there was a short scene with background sounds that were very close to the sound loop used for the bridge background sounds in .  ()  Anyone who was watching TV in the 1960s and 1970s heard this sound loop re-used in shows like .  (And I think I remember hearing it used in , but I'm not sure.)  Was this sound loop created for Star Trek originally?  Or had it been used previously?  Is there any documentation on where it came from and how it was made?  If it was used before Star Trek, where was it used and when was it made?    I'll add that I just saw the episode Elegy in The Twilight Zone, which aired in 1960, and the same sounds are used in the first scene while the astronauts are still on their ship.


I have an option to buy a road bike that has the height of the frame 54 cm :  . I am 182 cm tall. When I went to a shop and asked the "expert" about the bike, he suggested me to buy the bike with a frame of 56 cm.   Is there a big difference between the two sizes? Should I buy the bike, or it doesn't fit to my height?

I am going to buy a road bike. I am considering a .    I used the  to find the size of bike that fits me.    Inseam:             80.5   Trunk:              59.5   Forearm:            36   Arm:                67.2   Thigh:              57.4   Lower Leg:          53.7   Sternal Notch:     138.1   Total Body Height: 171       All the measurements are in cm.   The ranges that are given in the results are these:    Seat tube range c-c:   52.1 - 52.6 for competitive fit.   Seat tube range c-c:   53.3 - 53.8 for eddy fit.    The purpose of my bike is going to be able to do long distance mainly. I cannot afford another bike for racing but I will most probably be doing Ironman from next year using the same bike. But I personally think that riding 180 km in 8 hr is endurance and not year.  Now which size should I go for?  52 or 54? Should I just check the standover height of the bike? Or I should I look into something more than that?  I am asking this because in India not many shops deal with Trek road bikes. The Trek 1.2 is only available at one shop. That fellow says he won't allow me to test ride the bike. So I am in a bad situation. I want to buy this bike but the right size. The whole geometry is available in the site I have given. Ask for more information, if needed.


I'm following Miguel Grinberg's Flask Megatutorial. He defines the configuration class of the app as:  class Config(object):     SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'   What is te meaning of object? why is it passed to the classs? to my understanding, passing an argument when defining a class means inheritance so, why is Config inheriting form object and in what other cases should I do the same?

What is the difference between old style and new style classes in Python?  When should I use one or the other?


It seems like a stupid question: does it "just" mean that 90% of the population won't be infected?  But if only 10% of the population would have been infected without the vaccine, then it's not effective. Thus, does "90% effective" mean that only 1% (10% of 10%) will now get infected?

Pfizer's paper () published recently states the following in the Efficacy subsection of the Results section:  Between the first dose and the second dose, 39 cases in the BNT162b2 group and 82 cases in the placebo group were observed, resulting in a vaccine efficacy of 52% (95% CI, 29.5 to 68.4) during this interval and indicating early protection by the vaccine, starting as soon as 12 days after the first dose.  Can anyone explain in simple terms the calculation of 52%? I am guessing that this number was obtained from:  But why is that the calculation? Does it depend on the fact that the vaccine and placebo groups were in equal numbers, such that by observing 82 COVID-19 cases in the placebo group, we match 82 subjects in the vaccine group, and since only 39 confirmed cases were observed in the vaccine group, the authors conclude that the "complementary (to 82)" 43 subjects did not become sick, and thus the vaccine is efficient in 52% of the subjects?


I often touch up files so they show up at the top of the file manager.  Is there a way to touch a list of files instead of touching each one individually?  touch test1 test2 is not what I am looking for.  Piping ... So the output of a list of files would be sent to the touch command.  Text list of files piped or whatever to touch = files with updated time stamps. A pipe is a form of redirection (transfer of standard output to some other destination) that is used in Linux and other Unix-like operating systems to send the output of one command/program/process to another command/program/process for further processing. So the output of a list of file would be sent to the touch command.

Let's say I have a text file like:  john george james stewert   with every name on a separate line.  I want to read the lines of this text file and create a text file for each name, like: john.txt, george.txt etc.  How can I do this in Bash?


There are two VLCs:   VLC (The ultimate media player) - version- 3.0.0 VLC media player (Read, capture, broadcast your multimedia streams) - version - 2.2.6-6   I am worried that one of them may be fake. Which one is safe?

I want to install VLC using a GUI but I don't know which one I should choose.


I have Terraria on Steam and on mobile, but I want to know if I can connect with PC users.  I believe my friend has accomplished this, but I do not know how. Is this possible? How do you do it if so?

I have a Mac only, so I am not able to get Terraria through Steam. I was wondering if I can play Terraria on my iPad Mini with a friend who has it on his PC. I was wondering this, because I saw that Deepworld on iOS is compatible with the Mac version.


I've done the MergeSort algorithm, but I don't know how to count the swaps.  My code is:  def mergesortInv(list):     if len(list) < 2:         return list     else:         middle = len(list) // 2         left = mergesortInv(list[:middle])   #definim les dues meitats         right = mergesortInv(list[middle:])         swaps=???            return mergeInv(left, right,swaps)  def mergeInv(left, right,swaps):     if len(left) < 1:         return right     if len(right) < 1:         return left     if left[0] <= right[0]:         return [left[0]] + mergeInv(left[1:],right,swaps)     else:         return [right[0]] + mergeInv(left,right[1:],swaps)   The output of this algorithm would be the sorted list(the algorithm works in this part) and the  number of swaps: mergesortInv(list) == ([1, 2, 3, 4, 5, 7, 8], 6) 6 is the number of swaps.

I'm designing an algorithm to do the following: Given array A[1... n], for every i < j, find all inversion pairs such that A[i] > A[j]. I'm using merge sort and copying array A to array B and then comparing the two arrays, but I'm having a difficult time seeing how I can use this to find the number of inversions. Any hints or help would be greatly appreciated.


Is there a standard/preferred/approved way to format the indentation/placement of curly braces ("{}") in code on SE sites (SO, SU, ...) ?  More precisely, I'm talking about the placement of the opening bracket/brace in, for example, function definitions, and if statements.  Like this:  function somefunction() {     // Code here }   or like this:    function somefunction(){     // Code here }   I was looking at this answer: ,   and something in the comments prompted me to look at the revision history for the answer.  While unrelated to what I wanted to see, I noticed that the most recent edit to the answer was only to change the answer's example code, in a few places, from something like this:    function changeClass() {     // Code examples from above }   to this:    function changeClass(){     // Code examples from above }   Is this an appropriate edit?  I mean, the code was fine before the edit, and, it was just fine after the edit, basically nothing different. The editor just replaced one standard code formatting method that is preferred (well, at least chosen) by the original author, with another standard code formatting method that the editor happen to prefer.  I don't think this is an appropriate edit. Since the edit was approved, and the original author, if they were aware of the edit, didn't roll it back (possibly they didn't want to participate in an edit war), so I left the edit in place, even though I thought it shouldn't have been approved.  Perhaps, if there were other significant changes that the editor could have made, and they made those changes at the same time, it would be more justified (well, I'm still not convinced the braces edit would be okay, even then).   My reasoning, is that first, it's just too trivial. The only thing added was 3 newlines, and some spaces (of course that is the nature  of an edit that modifies formatting). Second, I view it as just a personal preference, neither way is particularly more right, or wrong than the other.  And, perhaps more importantly, it could lead to a user editing hundreds and hundreds of questions and answers, making only these type of changes. And worse yet, another user might edit the Q/A's again to return the posts to their preference.  Unless, of course, if there is some SE convention that one way is correct/preferred?  I understand that except for the potential for an edit war, this is not an extremely important issue. Am I on the right track, or am I making too much of this?  Note: I realize that this is mostly a computer code related question and is perhaps better suited to relevant sites, but there are many SE sites related to computer code, and I thought it was best to not potentially duplicate this on multiple other SE meta sites.

Some people like to put the open { bracket on a separated line, e.g:  if(...) {     //... }   Is editing this code by merging the first two lines into single one rude?


Suddenly, the only folder that I can see in /root is snap. Notwithstanding, the blog that I have installed on the website keeps working.  Output of ls -al /:

I have created 100 GB for /. When I opened Nautilus I have found the root folder. So what is difference between / and /root?  My username is enigma, and I have a folder named enigma in the /home folder and another folder with the same name in /media. What is the difference between these two folders and when do I have to use the second folder?


As a Linux user I know that I can use command-line in Linux to eject/insert CD/DVD. Namely, the command to eject CD/DVD drive is eject /dev/sr0 (or simply eject) and the command to insert CD/DVD drive is eject -t /dev/sr0 (or simply eject -t).  Now, is it possible to do the same in Windows from CMD or PowerShell? Using Cygwin or WSL would be cheating so they don't count. I know I can use Windows' GUI to eject CD/DVD drive but not to insert it.  My question has been proposed as a duplicate of . But I think that is only partially true. I will now explain why I think so.  It is easy to see that  only asks for the command that ejects CD/DVD drive. My question asks for the commands that eject and insert CD/DVD drive. Therefore, answers to  only answer one part of my question.

I have been trying to eject the cd drive with the use of the cmd. However, I am stumped. Searching on the internet, I only found this answer:  eject D:    and a similiar answer  eject D: /I   Both of them do not work.   EDIT Now people have found this answer on superuser,   Set oWMP = CreateObject("WMPlayer.OCX.7") Set colCDROMs = oWMP.cdromCollection colCDROMs.Item(0).Eject   However, I get an error:  colCDROMS.Item is not recognized as an internal or external command, operable program or batch file.


If the velocity is a relative quantity, will it make inconsistent equations when applying it to the conservation of energy equations?  For example:  In the train moving at $V$ relative to ground, there is an object moving at $v$ relative to the frame in the same direction the frame moves. Observer on the ground calculates the object kinetic energy as $\frac{1}{2}m(v+V)^2$. However, another observer on the frame calculates the energy as $\frac{1}{2}mv^2$. When each of these equations is plugged into the conservation of energy, they will result in 2 distinct results (I think).

Consider a rocket in deep space with no external forces. Using the formula for linear kinetic energy $$\text{KE} = mv^2/2$$ we find that adding $100\ \text{m/s}$ while initially travelling at $1000\ \text{m/s}$ will add a great deal more energy to the ship than adding $100 \ \text{m/s}$ while initially at rest: $$(1100^2 - 1000^2) \frac{m}{2} \gg (100^2) \frac{m}{2}.$$ In both cases, the $\Delta v$ is the same, and is dependent on the mass of fuel used, hence the same mass and number of molecules is used in the combustion process to obtain this $\Delta v$. So I'd wager the same quantity of chemical energy is converted to kinetic energy, yet I'm left with this seemingly unexplained $200,000\ \text{J/kg}$ more energy, and I'm clueless as to where it could have come from.


How to prove that the $\{$ fractional part of $n\alpha\mid n \in \mathbb{N}$ $\}$ is dense in $[0,1]$ for an irrational number $\alpha$.   NOTICE that $n$ is in $\mathbb{N}$ Also notice that this is not a duplicate of the mentioned question as it does not carry a correct answer and the partially correct answer in the said question is given for integer multiple case, NOT for $n \in \mathbb{N}$

I'm not sure how to solve this one. Thank you!  $2.$ For any $\alpha\in \mathbb R$ we define $$\lfloor \alpha \rfloor = \max_{n\in\mathbb Z}\{\,n\mid n\leq \alpha\,\}$$ and $$\alpha\bmod 1 = \alpha - \lfloor \alpha \rfloor$$ Let $\alpha$ be irrational. (a) Given $n\in\mathbb N$ show that $\{\,k\alpha\bmod1\mid k\in\mathbb N\,\}\cap\left[0,\frac{1}{n}\right]\neq\emptyset$ (b) Prove that $\{\,n\alpha\bmod 1\mid n\in\mathbb N\,\}$ is dense in $[0,1]$.


Prove using induction that the binomial coefficient $\binom nr$ is always a natural number for all $n$ and for $0≤ r ≤ n$   I tried proving it but i failed .what should i do?

From its definition a combination $\binom{n}{k}$, is the number of distinct subsets of size $k$ from a set of $n$ elements.  This is clearly an integer, however I was curious as to why the expression  $$\frac{n!}{k!(n-k)!}$$ always evaluates to an integer.  So far I figured:  $n!$, is clearly divisible by $k!$, and $(n-k)!$, individually, but I could not seem to make the jump to proof that that $n!$ is divisible by their product.


I have a C++ using a class specified on separate .hpp/.cpp files. This class has the particularity of having a templated member function that takes a const std::vector as argument, and here is the root of the problem.  myclass.hpp:  class myclass {      //...     public:          myclass();         template <typename _t> int myfunction(const std::vector<_t> *values);      //... }   myclass.cpp:  #include "myclass.hpp"  //... template <typename _t> int myclass::myfunction(const std::vector<_t> *values){     // do stuff     return 0; }   and my main.cpp:  #include "myclass.hpp"  int main(int argc, char const *argv[]){      myclass foo;     std::vector<int> bar(5,100);     foo.myfunction(bar);      return 0;  }   However, when I try to compile all this with g++ main.cpp myclass.cpp -o main -I /usr/include I get the error:  undefined reference to `int myclass::myfunction<int>(std::vector<int, std::allocator<int> > const*)'    which is strange since the syntax seems to be correct (and it passes g++ check). The problem is not with how I am building the code or the file setup, since I am able to compile the code if I comment out the templated function.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


Could someone tell me a simple proof to If a|b and b|a iff a=+-b.

Form the assumption, we can say $b=ak$ ,$k$ integer, $a=bm$, $m$ integer.  Intuitively, this conjecture makes sense. But I can't make further step.


How to prove that for every real number $x\geq0$ and every integer $n\geq0$ $$1+(n+1)x \le (1+x)^{n+1}.$$ I'm  trying with the geometric mean and arithmetic mean inequality, but I don't know what $x_1, x_2, ... $ to get to this.

The question reads     $$U_n = (1+x)^n - 1 - nx$$   Show that $U_2 \geq 0$   Hence or otherwise show that $(1+x)^n \geq 1 + nx$ for all $x \gt -1$.   Obviously the $U_2 \geq 0$ is very easy, I can do that without any trouble but I cannot see how it links to the 2nd part of the question.


While using ubuntu some packages are available as standalone application available in .tar.gz packages. These application can be ran by executing executable file within the folder. Now I want to manage a particular file format using this application but application isn't visible in open with menu. What can I do.

I have this run.sh file, and I've create a symbolic link into my desktop.   When I double-click on it the file the following dialog appearsr    And I have to click on "run" each time. How can I create a link that runs by default?


I am trying to write a test class for a simple Apex Class which sets the status of the Case to be Closed like below   public class updateCaseRecord {          @AuraEnabled     public static void updateCheck(String caseId){         List<Case> records = [select id,Status from Case WHERE Id = :caseId];         for (Case record : records)         {             record.Status = 'Closed';         }         update records;          } }   The test class I have written so far is like below I have created a test account,contact and a case.  @IsTest public class updateCaseRecordTest { @IsTest(SeeAllData=true) static void testIsUpdateCheck() {     ID parentRecType = '012U0000000PqA9IAK';     ID csRecType     = '012U0000000QGv4IAG';       Account pa = new Account(Name='Test Parent Account', recordTypeId=parentRecType);     insert pa;      Account testAccount = new Account(Name='test', Industry='Biotech',Territory__c='EUR',BillingCity='Test',BillingCountry='Germany',ParentId=pa.id);     insert testAccount;       Contact c = new Contact(LastName='Test',LeadSource='Customer Service',AccountId=testAccount.Id);     insert c;      Case newCase = new Case();     newCase.Subject = 'testStatusClosed';     newCase.Status = 'New';     newCase.Category__c = 'Inquiry';     newCase.Sub_Category__c = 'Other';     newCase.AccountId = testAccount.Id;     newCase.ContactId = c.id;     newCase.recordTypeId=csRecType;     insert newCase;       ApexPages.standardController std = New ApexPages.standardController(newCase);   updateCaseRecord uC = new updateCaseRecord(); uC.updateCheck(std); }}   I get the error like Method does not exist or incorrect signature: void updateCheck(ApexPages.StandardController) from the type updateCaseRecord. How  can I test the apex class and can have the assertion statement. I am writing first time test scripts and I am kind of lost. Any help is greatly appreciated

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 do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


which of the  following  function are reimann integrable on the interval $[0,1].$?  $1)$ $f(x) =\begin{cases}   1,  &\text{if x is  rational }\\ 0, &\text{if  x is irrational }         \end{cases}$  $2)$ $f(x) =\begin{cases}   1,  &\text{if x } \in \{\alpha_1,\alpha_2,.......,\alpha_n\}\\ 0, &\text{otherwise }         \end{cases}$   i know  that  option $1) $ will not reimann integrable  because  it is not bounded.  im confused  about option $2)$  Any hints/solution

Consider the following function on $[0,1]$:   $$f(x)=\begin{cases}1&x\in\{a_1,a_2,\dots,a_n\}\\0 &\text{otherwise}\end{cases}$$   The $a_i$ are fixed and all in $[0,1]$. Determine whether $f$ is Riemintegrable or not.   By the Riemann–Lebesgue criterion $f$ is Riemann integrable. How to prove directly?


I am getting an error: java.lang.NullPointerException on Graphics g. this is my code:  package main; import java.awt.Canvas; import java.awt.Dimension; import java.awt.Graphics; import java.awt.image.BufferStrategy; import javax.swing.JFrame; public class main implements Runnable { public static final int WIDTH = 1024; public static final int HEIGHT = 1024; public static final String TITLE = "platformer"; public boolean running = false; static main home = new main(); public Graphics g; public static Canvas canvas = new Canvas(); public static void main(String[] args) {     home.display();     home.start(); } public void display(){     JFrame frame = new JFrame(TITLE);     frame.setSize(WIDTH, HEIGHT);     frame.setResizable(false);     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     frame.setVisible(true);     canvas.setPreferredSize(new Dimension(WIDTH, HEIGHT));     frame.add(canvas); } BufferStrategy bs; public void render(){     bs = main.getCanvas().getBufferStrategy();     if(bs == null){         main.getCanvas().createBufferStrategy(3);     }     g = bs.getDrawGraphics();     g.fillRect(0, 0, WIDTH, HEIGHT);     g.dispose();     bs.show(); } public void tick(){  } public void run(){     long lastTime = System.nanoTime();     final double amountofticks = 60;     double ns = 1000000000/amountofticks;     double delta = 0;     double time = 0;     int frames = 0;     while(running){         long now = System.nanoTime();         delta += (now-lastTime)/ns;         time += (now-lastTime);         lastTime = now;         if(delta>=1){             home.tick();             home.render();             delta--;             frames++;         }         if(time>1000000000){             System.out.println(frames);             time = 0;             frames = 0;         }     }     stop(); } private Thread thread; public void start(){     running = true;     thread = new Thread(this);     thread.start(); } public static Canvas getCanvas(){     return canvas; } public void stop(){     try {         thread.join();     } catch (InterruptedException e) {         e.printStackTrace();     } } }   i am getting the error message:     Exception in thread "Thread-2" java.lang.NullPointerException     at main.main.render(main.java:37)     at main.main.run(main.java:59)     at java.lang.Thread.run(Unknown Source) line 37 is g = bs.getDrawGraphics(); I think that the graphics is null for some reason. i have tried to make this code for a long time

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


So I have a 12 v 1 amp power supply. I want to convert the current from 1 amp to 0.08 amp and keep the voltage the same. This is for a power a brushless fan; specs 12 v 0.08 amp. I am not sure how to do this. If anyone can help, I would appreciate it a lot. Thank you

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


I want to translate Ubuntu in fon (my language). The Fon is most spoken language of Benin.  Could someone let me know how I can do it ?  Thanks.

My friend and i would like to translate Ubuntu. where should we start? where to find translation tools?


I am looking to study physics as a mathematician. I am interested in books on special and/or general relativity, written in a style of rigor that would be acceptable to a mathematician. I would like a large number of examples of such books.

Can someone suggest a textbook that treats general relativity from a rigorous mathematical perspective? Ideally, such a book would   Prove all theorems used. Use modern "mathematical notation" as opposed to "physics notation", especially with respect to linear algebra and differential geometry. Have examples that illustrate both computational and theoretical aspects. Have a range of exercises with varying degrees of difficulty, with answers.   An ideal text would read a lot more like a math book than a physics book and would demand few prerequisites in physics. Bottom line is that I would like a book that provides an axiomatic development of general relativity clearly and with mathematical precision works out the details of the theory.  Addendum (1): I did not intend to start a war over notation. As I said in one of the comments below, I think indicial notation together with the summation convention is very useful. The coordinate-free approach has its uses as well and I see no reason why the two can't peacefully coexist. What I meant by "mathematics notation" vs. "physics notation" is the following: Consider, as an example, one of the leading texts on smooth manifolds, John Lee's Introduction to Smooth Manifolds. I am very accustomed to this notation and it very similar to the notation used by Tu's Introduction to Manifolds, for instance, and other popular texts on differential geometry. On the other hand, take Frankel's Geometry of Physics. Now, this is a nice book but it is very difficult for me to follow it because 1) Lack of proofs and 2)the notation does not agree with other math texts that I'm accustomed to. Of course, there are commonalities but enough is different that I find it really annoying to try to translate between the two...  Addendum (2):  For the benefit of future readers, In addition to suggestions below, I have found another text that also closely-aligns with the criteria I stated above. It is, Spacetime: Foundations of General Relativity and Differential Geometry by Marcus Kriele. The author begins by discussing affine geometry, analysis on manifolds, multilinear algebra and other underpinnings and leads into general relativity at roughly the midpoint of the text. The notation is also fairly consistent with the books on differential geometry I mentioned above.


After installing Xubuntu (I have done this several times with several releases: LTS 14.04 and LTS 16.04), all works great: I get GRUB with Xubuntu and Windows options. The problem comes when I boot to Windows. Next time i restart, Windows boots directly.  Grub bootloader is no longer available on UEFI menu and efibootmgr only shows Windows Boot Loader. I have tried plenty of solutions: disabling CSM, disable fast Startup, disabling secureboot, clean installs, installing windows first and then ubuntu, installing ubuntu then windows, using boot-repair, even removing CMOS battery, updating my UEFI, etc, etc, etc.  The only solution i don't want to use is bcdedit. I did this once and worked, but i messed up ubuntu and ended loosing Windows Boot Loader and reinstalling Windows. I prefer sticking with a virtual machine rather than using bcdedit.  My motherboard is an Asrock B75 Pro3, which supports UEFI. I'm installing both systems in an SSD (i have 2 HHD but i'm not using them for installation). I installed both systems from USB (using UEFI boot option).  What I have done last:  Fast startup disable (boot on UEFI and Windows), secureboot enable, CSM disable, UEFI boot from USB (both on Windows and Ubuntu), Ubuntu installed first using FAT32 partition with boot and ESP flags for installing GRUB.  Before boot-repair:  xubuntu@xubuntu:~$ sudo efibootmgr -v BootCurrent: 0005 Timeout: 1 seconds BootOrder: 0002,0005 Boot0002* Windows Boot Manager  HD(1,GPT,beaa7fdc-aa2d-45de-9ca4-97e5e193f466,0x800,0x96000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...h................ Boot0005* UEFI: JetFlashTranscend 8GB 1100  PciRoot(0x0)/Pci(0x1a,0x0)/USB(1,0)/USB(3,0)/HD(1,MBR,0x24,0x38,0xeb3fc8)AMBO   The boot-repair summary .  After boot-repair:  sudo efibootmgr -v BootCurrent: 0005 Timeout: 1 seconds BootOrder: 0000,0002,0005 Boot0002* Windows Boot Manager  HD(1,GPT,beaa7fdc-aa2d-45de-9ca4-97e5e193f466,0x800,0x96000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...h................ Boot0005* UEFI: JetFlashTranscend 8GB 1100  PciRoot(0x0)/Pci(0x1a,0x0)/USB(1,0)/USB(3,0)/HD(1,MBR,0x24,0x38,0xeb3fc8)AMBO   After booting to Xubuntu:  sergio@SERGIOLINUXPC:~$ efibootmgr  BootCurrent: 0000 Timeout: 1 seconds BootOrder: 0000,0005 Boot0000* ubuntu Boot0005* UEFI: JetFlashTranscend 8GB 1100   Result: I still get GRUB.  After booting Windows:  BootCurrent: 0005 Timeout: 1 seconds BootOrder: 0001,0005 Boot0001* Windows Boot Manager Boot0005* UEFI: JetFlashTranscend 8GB 1100   Result: I lose GRUB.  I did a dual boot UEFI in another computer of mine and I had no problems.  One of the many solutions I tried .  I got the same problem than , but removing fast startup doesn't show Grub bootloader again, neither on UEFI, neither on efibootmgr.  Thanks for you time and sorry for my english

I have a Sony VAIO S series with Windows 8 preinstalled, and I installed Ubuntu 12.10 on a new partition. When the PC boots Grub is display, and I can choose between Windows 8 (didn't worked at the beginning, had to change Grub settings) and Ubuntu 12.10. When I select Ubuntu 12.10 everything is OK, but when I use Windows 8, and I restart Grub isn't displayed anymore (Windows 8 boots immediately).  I booted a Ubuntu 12.10 LiveUSB, used efibootmgr, and found out that Windows 8 (each time it boots) changes EFI default bootloader from Grub to Windows Boot Manager.  How do I change this in Windows 8? I read something about bcdedit, but it does not work or I don't know how to use it...


Is there a generic way to do this? What if the executable is only alive for a fraction of a second and I can't even fire ps to catch it? And  the executable is not a script which I can add debug clauses into.  One example case is the following: I was poking around GNOME and watching syslog, for example, sliding the brightness slider and see some executable(/usr/lib/gnome-settings-daemon/gsd-backlight-helper in this case) being called to send brightness values to one monitor. I would like the command to send brightness values to all monitors, hence I am trying to find who calls it, ideally the whole chain of events.

I am trying to find how to log a specific instantiation of rrdtool to see whether the path it is receiving is incorrect.  I know I could wrap the executable in a shell script that would log the parameters, but I was wondering if there was a more kernel-specific way to monitor for that, perhaps a filesystem callback that sees when a particular /proc/pid/exe matches a given binary?


I am moving to France from the USA in the next 1 week. I just read that North American chipless credit cards  in France and that they would most likely .  I will arrive at Paris CDG and the picture of . I may not be able to get foreign currency before I leave, given the remote location of my US town.  In the first few hours or days of my being there, how do I avoid this potential pitfall of credit cards presumably being rejected?  Some of the other questions that I have read on this SE are:

We are US travelers who will be spending 2 weeks in France (Bordeaux through Provence to Nice) in mid-April 2013.  We understand that Europe is well ahead of the US in the use of EMV (chip-and-pin) technology for credit cards, and all of our cards are traditional magnetic stripe only.  We would like to use a credit card for as many expenses as possible.  We will be using public transport as well as renting a car, purchasing gasoline, etc.  What is the current state of EMV vs. magnetic stripe card acceptance in France?  Should we inquire about EMV cards with our card issuers?


Just a simple question but trickier than I expected.  Let us suppose that there is a fly hovering in the moving train. The train moves at a speed much higher than the hovering of the fly. However, the fly moves with the train and does not hit its walls.  Could anyone explain the exact reason for this? Is it because of the air inside the train and the fly is very light? Then if the inside the train is a vacuum, devoid of air, would the fly hit the wall?

A couple of weeks ago I was travelling in a car (120 km/h approximately) and I saw a  flying in front of me (inside the car, near my nose, windows closed). I wonder how was that possible.   Does it mean is really flying at 120 km/h or the fly is being affected by some kind of gravity/force?


I have a List<Long> matchingLongs = new Arraylist(); that I would like to pass to an SQL statement :    WHERE Id IN (matchingLongs);     How can I dynamically populate the Longs into the query?    If I would print to console it should look like :    WHERE Id IN (1223, 9834, 3, 924, 88778, 65652165223, 34, 8723738793287);     Thank you all.

What are the best workarounds for using a SQL IN clause with instances of java.sql.PreparedStatement, which is not supported for multiple values due to SQL injection attack security issues: One ? placeholder represents one value, rather than a list of values.  Consider the following SQL statement:  SELECT my_column FROM my_table where search_column IN (?)   Using preparedStatement.setString( 1, "'A', 'B', 'C'" ); is essentially a non-working attempt at a workaround of the reasons for using ? in the first place.    What workarounds are available?