I come from a country where the way we write decimal numbers differs from the other place by whether I use ',' or '.' for decimal separator. Now this is why I by accident wrote somewhere in my c++ program:  while(true){     long double x=0;     //some code that increases the value of x      //by very small amount but it doesn't leave it at 0     if(x>0,000001)break; }   And this made the program run indefinitely. After wasting quite some time thinking my code was wrong I tried this:  while(true){     long double x=0;     //some code that increases the value of x      //by very small amount but it doesn't leave it at 0     if(x>0.000001)break; }   Which worked just fine. Later I understood my mistake (I used ',' instead of '.'), but now I am confused as to why doesn't the next code result with compilation error, and how come it's outcome is "greater"  long double g=0.001; if(g>0,01)cout<<"greater"; else cout<<"smaller";   Edit: When I posted this question I didn't know that the comma is an operator. So the question was marked as duplicate and lead here  . But there I couldn't actually find a comparison between '.' and ',' .

How does the comma operator work in C++?  For instance, if I do:  a = b, c;     Does a end up equaling b or c?   (Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)  Update:  This question has exposed a nuance when using the comma operator.  Just to document this:  a = b, c;    // a is set to the value of b!  a = (b, c);  // a is set to the value of c!   This question was actually inspired by a typo in code.  What was intended to be  a = b; c = d;   Turned into  a = b,    //  <-  Note comma typo! c = d;


I just installed ubuntu studio on my desktop computer. While installing I chose one drive and format everything. Now I want to divide my partition in to three partitions.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I have been trying to add my Google account under Online Account section, but, for some reason, the authentication windows go blank during the final step after I enter email address and password.  Here is the screenshot ->   I was able to add the same account through my laptop; this issue exists only on my PC.  I tried restarting the PC, switching to a different Internet connection, upgrading available packages, checked logs for any clues but could not find anything.  I hope that someone here will point me in the right direction.  Update: I am using Google Suite if this is relevant to the issue.  I downloaded the fresh copy of iso and did new install twice but I keep having the same issue. (07/05/2017)

I thought it was awesome that Ubuntu 16.04 shipped with gnome-calendar, but I noticed that holidays were not included.  I also noticed that there is an option to sync the calendar with an online one, how do I do this?  I don't know of any online calendars I could use.


I am opening a Login JavaFX page from UserController.java and it has its control in LoginController.java.After processing it in LoginController.java and I am executing a close method to close the stage declared in UserController(which contains the stage for Login) but it throws NullPointerException  public class UserMenuController {     @FXML     private MenuItem Login;     Stage loginStage;      public void LoginPage(ActionEvent actionEvent) throws IOException {         loginStage=new Stage();         Parent loginFXML=FXMLLoader.load(getClass().getResource("/login.fxml"));         loginStage.setTitle("Login");         Scene loginScene=new Scene(loginFXML);         loginStage.setScene(loginScene);         loginStage.show();      }     public void shutLoginStage(){         loginStage.close();     } }  public class LoginController implements Initializable {     @FXML     private WebView view;     UserMenuController u=new UserMenuController();      public void initialize(URL location, ResourceBundle resources) {         view.getEngine().load("https://kite.trade/connect/login?v=3&api_key=kpnnt4xthv187j8p");         view.getEngine().getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) -> {[enter image description here][1]             //Gets the URL  Request Token             if (newValue.equals(Worker.State.FAILED)) {                 //System.out.println(view.getEngine().getLocation());                 System.out.println(view.getEngine().getLocation());                 u.shutLoginStage();              }          });

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?


If $ x_1, x_2 , x_3........x_n $ are n positive reals prove that  $$ \frac{x_1}{1+x_1^2} + \frac{x_2}{1+x_1^2+x_2^2} +...+\frac{x_n}{1+x_1^2+x_2^2+...x_n^2} \le \sqrt{n}$$ So this is an IMO 2001 proposed question.It was in the section of Cauchy Schwartz inequalities in my book. It seems that there is a Cauchy hidden because of the root n but then we need to find two series whose terms are those of the LHS and the product of sum of whose squares gives n . I'm at a loss in finding that Thanks for any help

How to prove that $$ \frac{x_1}{1+x_1^2}+\frac{x_2}{1+x_1^2+x_2^2}+\cdots+\frac{x_n}{1+x_1^2+\cdots+x_n^2}<\sqrt{n} $$ knowing that $(x_n)$ is a positive sequence ? I looked up all kinds of inequalities such AM-GM, Chebyshev, Cauchy-Schwarz, but I couldn't manage to obtain anything useful.. Can anyone help ?


I have a friend who works on my team for a game project, but he's experiencing an issue I haven't seen before. He is unable to select the selection modes for vertex, edge and face selection, which can be toggled using the three buttons at the bottom panel of the 3D view.  This image shows his issue. The red circle shows where the buttons are supposed to be positioned.  These are the three buttons he's missing (Screenshot taken from my Blender)    I've already suggested CTRL+TAB while in Edit Mode, but this does not work for him.   As far as I know, he's using a default Blender setup (He have received instructions to not mess with the settings in Blender, part from the settings I have written down, such as unit size, export defaults, etc.)

where are the buttons to select faces or edges view gone? loaded factory settings, still not there.


I write up a simple function below to illustrate what I try to achieve.  public class MyTempClass {     private boolean myVariable = false;      private void setupMyVariable() {         // Some callback etc from a web service that will determine the myVariable value         myVariable = true;     }      public void doSomethingIfVaraibleIsTrue() {         if (myVariable) {             // Do something.         }     } }   I would want to unit test MyTempClass doSomethingIfVaraibleIsTrue function is doing something when myVariable is true, and not doing something when myVariable is false. However myVariable is a private boolean, and not easily set (e.g. it is set from a callback of a service).  I also don't want to make a setter for myVariable as it is really private to the class. Is there any way to Mock/Stud or make myVariable true so that I could unit test my doSomethingIfVaraibleIsTrue?

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


What if you have a creature 1/5 and it attacks a 2/2 death creature does the 1/5 die or is deathtouch activated upon death

If I attack with a  (2/3 deathtouch and lifelink) and my opponent blocks with a creature that's a 3/3 (no abilities), does my Gifted Aetherborn die?   Without deathtouch it would, but since the Gifted Aetherborn only needs to deal 1 damage to kill the other creature, he should live, correct?


The integral is,  $$I=\int_{-\infty}^{\infty}\frac{\sin x}{x}\, dx$$ I know the answer would be $\pi$ and I know how to solve this using Feynman's method and Fourier transform. However I was trying something, rather naively, since by understanding of the subject is constrained to undergraduate mathematical physics. I did the following, taking the imaginary part of $e^{ix}$,  $$\int_{-\infty}^{\infty}\frac{\sin x}{x}\, dx=\Im\left\{\int_{-\infty}^{\infty}\frac{e^{ix}}{x}\, dx\right\}$$ Then I introduced a variable $\alpha$ where taking $\alpha=1$ would result in the required integral. So we have here, $$I(\alpha)=\Im\left\{\int_{-\infty}^{\infty}\frac{e^{i\alpha x}}{x}\, dx\right\}$$ Taking the derivative of $I$ with $\alpha$ we will get,  $$\frac{dI(\alpha)}{d\alpha}=\Im\left\{\int_{-\infty}^{\infty}ie^{i\alpha x}\, dx\right\}$$ We know that this is the definition of Dirac delta, $\delta(\alpha)$. Therefore, $$\frac{dI(\alpha)}{d\alpha}=\Im\left\{i2\pi\delta(\alpha)\right\}=2\pi\delta(\alpha)$$ Integrating with $\alpha$,  $$I(\alpha)=2\pi\theta(\alpha)+c$$ Where, $\theta$ is the Heaviside step function and $c$ is the constant of integration. Using $\alpha=-\infty$ from the initial equation we shall get $I(-\infty)=0$, which gives $c=0$. Therefore,  $$I(\alpha)=2\pi\theta(\alpha)$$ And putting $\alpha=1$ here, we have,  $$I=2\pi$$ Which isn't the required answer. I want to know where I am going wrong, which step, or if it's the entire method. I am also not aware of all the properties of the functions I used and this is just me fiddling with things, so I will be really obliged if anyone can help.  Edit for duplication claim: My question isn't exactly about how to solve the sinc integral using the known methods. I want to know what is wrong with the approach I am using, which I know is wrong, but I don't know what exactly is going wrong.  Edit after suggestion in comments: Okay assuming $\alpha=-\infty$ to calculate the integration constant's value, is kind of a blunder, since that's not gonna work. However, if I take $\alpha=-1$ this might work, and will give me,  $$I(-1)=-\int_{-\infty}^{\infty}\frac{\sin x}{x}\, dx=-I(1)$$ This means,  $$c=I(-1)=-I(1)$$ And that would give me,  $$I(\alpha)=2\pi\theta(\alpha)-I(1)$$ And now taking $\alpha=1$, $$I=\pi$$ And that matches the answer, however I am kinda skeptical if this approach is right.

It is said that the integral of the cardinal sine is $1$. How do I integrate the cardinal sine? $$ \int_{-\infty}^{\infty} \frac{\sin(a)}{a} \, {\rm d} a $$


I have unallocated space before the partition I'd like to extend? Gparted wont allow me to resize or move that partition (ext4)  my drive looks like this:  /dev/sdb1 (locked) fat32  unallocated unallocated  /dev/sdb2 (locked) ext4 mount point /  /dev/sdb3 linux-swap  Thanks

I have Ubuntu installed on a drive. The problem is it is running low on disk space. This is installed on vmware. I expanded the virtual drive and booted into ubuntu. But when I opened gparted(sudo gparted), the move/resize option is unavailable. This is the partition Ubuntu is installed on, but I need to resize it. Any ideas? I am comfortable using command line


There are many questions on many Stack Exchange sites that have paragraphs thanking people in advance which may cover a large fraction of the question area and I think it's NOT necessary to express the thanking since the website is for questions and answers and also people who answer the question will receive reputation.  So can I edit posts that have 'thank you' paragraphs?

I edit a lot of posts every day. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like:     --User   Should these items be removed during the editing of the post by an editor?


I am trying to use following code to replace the whole string:  Code:  String a = "Hello"; String b = a.replaceAll("(?s).*", "US");  Output:  USUS   Question: Why is the string "US" repeated twice? How can I replace the whole string using replaceAll function, making use of regular expression?  Why I need to do this: I need to pick up replace patterns specified in a json file with the values given there. In this model, I wanted to give independence to the user(json configurer) to define a pattern such that entire string may be replaced, without me having to code special handling of string replacement.

This could be the dumbest question ever asked but I think it is quite confusing for a Java newbie.    Can somebody clarify what is meant by immutable?  Why is a String immutable? What are the advantages/disadvantages of the immutable objects? Why should a mutable object such as StringBuilder be preferred over String and vice-verse?   A nice example (in Java) will be really appreciated.


I posted a comment to a low effort question here:   I typed too fast and it came out like     "What you tried?"   I tried to edit it to     "What have you tried?"   and got "Comments can't contain that content."

Statistics  () In Q1 of 2012 - 0.0134 such comments per question (~1.33%) In Q2 of 2012 - 0.0167 such comments per question (~1.66%) In Q3 of 2012 - 0.0169 such comments per question (~1.68%) In Q4 of 2012 - 0.0193 such comments per question (~1.92%) In Q1 of 2013 - 0.0223 such comments per question (~2.22%)  The vast majority of these questions need serious help.  Unfortunately, there is a growing trend towards abuse Along with the good, comes some bad -- as usual in life. These comments are bad when  Posting "what have you tried" multiple times per question is severely obnoxious Posting "what have you tried" when the user has clearly shown that they have tried to solve it on their own  It is becoming increasingly common to see "what have you tried?" comments in these scenarios. Some examples     Workarounds Flagging Comments - It is considered a good thing to be liberal with comment flagging -- that helps us clean up after the fact. "Too Chatty" is a no-brainer here. Unfortunately, that only cleans up after the damage has been done. All signs point toward the continued increase of the trend of using "what have you tried" comments. I spend a lot of time editing and cleaning up bad questions. This trend came up on my radar toward the end of last year and it is getting worse. So, I thought at the very least that I'd raise some awareness.


How can I reinstall Ubuntu 13.04 safely, without losing anything except settings? Is it possible? Or at least keep only programs and the home directory?  I want to reinstall as I have recently experienced various issues like the scrolling being very jumpy and lightdm rendering weirdly. Can someone more experienced explain how to reinstall Ubuntu as I have been searching in vain for days. Thanks in advance.

Recently I installed Ubuntu 12.10 x64 Server Edition on my PC. Unfortunately, I attempted to install a lightweight desktop but due to the fact that I have an old graphics card, the PC does not perform so well. I am thinking of re-installing an Ubuntu version but I do not want to lose the contents in my home folder. Is there any way to do that with a Live CD?


First post; please be gentle.  I grew up in an environment with no exposure to role playing games (only child, frequent relocation, no base of friends).    Now I have three children of my own.  I want to give them a broad experience of games and game playing beyond the computer or board game variety.  They are 4, 6 and 8; all three are creative and imaginative.     Which role playing games are suitable for families, or should I wait a few more years?

I'm looking for a fun, easy to get into RPG for my kids. It could be simple and card-based, or more "normal" tabletop style. I'm looking for something less bloody and dark, and more fun and easy to get into.  What games have you played with pre-teen children that they could easily uptake and enjoyed playing?


I sometimes hear native speakers saying things like, "He pretended as though as if he didn't hear anything." Is it grammatically correct? If so, how do you use "as though as if"? Is that a common usage? Thank you.

This is something that confuses me from time to time. When making an analogy in literature, is it better to use the phrase "as if" or "as though", or is it completely a style thing?  E.g.      She looked frazzled, as if she had just gotten off of a roller coaster.   or     She looked frazzled, as though she had just gotten off of a roller coaster.


Our 8 year old son saw my wife and I having sex the other day. Now I don't see anything wrong with it, yet my wife is unsure. What should happen here?

I ask this Question on behalf of my neighbor.   Their 12 year old son saw his parents having sex.  As there is only one room in their home we can't say its the parents' mistake... but now the question is how do they handle the situation?


As the topic says. How can I counter the knife attack? I've read about it somewhere and saw a video, but I still can't figure out how to counter the knife.  Like to the video:

When you press down the right stick to counter the attack, do you just press it, repeatedly press it, or press and hold? I've been knifed a few times from the front and each time I try to counter I fail. Also, if you believe you are about to be knifed and hold down the right stick until you are knifed, will that counter an attack, or do you have to press it down just at the right time?


I struggle to pick up rep points even when answering questions and giving good demo's of code via a pastebin - sometimes spending 15 mins+. Then along comes a noob question, for instance  and before you know it the simple answer has got 26 upvotes, never mind the 11 for asking.  Can we do anything about this? Maybe give the question a complexity rating which goes towards the possible amount of points that can be earned? Probably contentious I know but its just an idea.

Recently I answered two questions on SO: The  is a completely trivial answer to a really basic question (kind of "read the manual and follow the one liner example there"). On the other hand, my  is a much more complicated answer that requires much more specialized knowledge of a very specific domain (happens to be related to my PhD research).  Clearly, the first answer could have been given by many SO users - I just happened to be the first to pick up the glove on this question. However, this is not the case for the second answer.  In contrast, when it comes to reputation - the first answer instantly got upvoted (everyone can relate to a simple question/answer), while the second one - I don't believe it will get much upvotes...  So, life isn't fair: for the one answer that really very few people could provide (the second answer) and is much harder to find and get -- is not rewarded, while the trivial answer is rewarded fast and strong...  How can we amend this? How can we encourage rare and specialized answers for difficult and deep questions?  Do we want SO to turn into a pool of trivial and superficial questions?    Update: Thanks to many meta-users who took the time to read through this question and ponder its implication, both answers I used as examples got exposed far beyond their fair-share. So, despite the fact that my original claim that the specialized answer get less reps is no longer valid, this does not change fact that in general my claim is stil valid: specialized answers requiring expert knowledge will recieve less attention at first.    Bottom line: (following my wish to have some sort of ). Indeed it sometimes seems like life isn't fair, but this is only in the short term. In the long run high quality answers do get their proper credit and exposure and their fair share of reputation. The reputation system of SO works quite well balancing and accounting for many factors and parameters. It would require a really strong argument backed up with serious research to change this mechanism.   Thank you all for the lively discussion and for showing me that life is fair after all.


How can I enumerate a list using lowercase letters instead of arabic numerals?

I've seen documentation whereby an \alph command is put around the \begin{enumerate} somewhere, but I'm not entirely sure how that operates...


The rules on "", specifically the "Moving a Grappled Target" section of the PHB (page 195) reads:     When you move, you can drag or carry the grappled creature with you, but your speed is halved, unless the creature is two or more sizes smaller than you   I wondered if monsters like the death kiss (VGM page 124), that can grapple creatures within a large reach (in this case, 15 feet) can move a grappled creature from a space in its reach to another space in its reach, without dragging it. Is this possible?

This is a follow up from .  A creature with a 15' reach is grappling a creature with a 5' reach. My question in this situation is: how much can the grappled creature be moved if it remains within the grappling creature's 15' reach? ie. can it be moved 30' and what type of action is required for this movement?


I have below code      String s1=new String("hello");        String s2="hello";        System.out.println(s1.hashCode());      System.out.println(s2.hashCode());      System.out.println(s1==s2); //returns false   Why do we get last statement as false ,the hashcode of s1 and s2 is same can someone please explain?  and after i do String s3=s1.intern();, System.out.println(s2==s3); returns true.

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


Let's say I wanted to make a rain/snow gif. Or bubbles under water. Can I make it so the last frame goes back to the first frame seamlessly? So that it's an animation cycle? Like a walk cycle but with emitter particles.

I've made a simple snowfall particle simulation (using gandalf3's solution: ). Is there a way to loop the animation, so the transition between last frame and first frame is not visible? Is there a setting to do it?


In February 2016 the LIGO team announced that they had detected gravitational waves on 14 September 2015. As far as I know, we already knew that gravity propagates at the speed of light. So two black holes orbiting each other and about to merge would produce the results observed. I don't see how that tells us anything new about the nature of gravity, or maybe I'm missing the point of the experiment. What did we actually learn from this experiment?

LIGO has announced the detection of gravitational waves on 11 Feb, 2016. I was wondering why the detection of gravitational waves was so significant?   I know it is another confirmation of general relativity (GR), but I thought we had already confirmed GR beyond much doubt. What extra stuff would finding gravitational waves teach us? Is the detection of gravitational waves significant in and of itself, or is there data which can be extracted from the waves which will be more useful?


Should I ask questions – which I can already answer – just because I think the answer might be relevant and should be archived for future generations to be found?  Example: I was looking for a programming algorithm to solve a common statistics problem. I didn't find the solution (thus implementation) on Stack Exchange or on any other websites. So I came up with my own solution. Since the problem is quite common, I'm wondering if I should ask the question just to see if someone comes up with the same (or better) solution. If not I would answer the question myself.  I acknowledge that I could have asked the question on Stack Exchange (Stack Overflow), when I didn't know the answer. But solving the problem was urgent.  Any ideas?

Possible Duplicate:          If I solve a tricky problem, should I ask a question about it on Stack Overflow and answer it myself?


EDIT: While there are similarities with  (and please note that there are no answers to that question btw), I'm suggesting a different design and user journey.    I'm not a UX expert but this doesn't look right to me:    The red dot usually is convention for "new items since your last visit". However when you click, the message is rather confusing; it's not immediately clear that you have been banned from reviewing.  Initially I thought it was a bug but eventually I worked out (via the meta site) that I've been user-review banned. (I've been told why and I agree with the decision.)  I think the UI could be something like this instead:    When the user hovers the icon, a tooltip could say:     You have been banned from reviews until 31st of March. Click to understand why   And the click would redirect the user to  (or the appropriate review page for the network)

When I am review-banned, the direct effect is that when I click the review icon in the top-bar, I get this:        This doesn’t tell me anything about what's going on, just that all review queues have miraculously become unavailable to me. It doesn't show that it's because I've been banned, or why I've been banned, whether it's for failing audits or whether there is a custom message supplied by a moderator. Only when I new-tab-click that button, it takes me to /review, or when I manually navigate there, I get :        This is confusing for review-banned users who use the dropdown in their standard workflow (). I only performed the above test to reproduce the experience of a confused review-banned user on a site I moderate.  Please replace the dropdown message with something more informative in case of a review ban.


When writing the derivative of a vector-valued function, I naively wrote:  \vec{r}'(t)   But when typeset, the prime collides slightly with the vector arrow.  What are the best practices here?

I write a vector with an arrow above the letter using \vec{p} and sometimes the vector needs to be primed using ' (or ^{\prime}, equivalently).  However, neither  \vec{p}'     nor  \vec{p'}     looks satisfactory (first option: prime dash overlaps with vector arrow, second option: arrow looks misplaced).  How would one write a primed vector?


I accidentally formatted my windows partition into ext4 system while trying to install ubuntu and then immediately deleted it. then tried to restore files. testdisk showed only new+deleted ubuntu partition.  EaseUs detected deleted NTFS partition but unable to find any deleted files.  I haven't done anything more harmful such as overwriting with new files or formatting again.   i badly need this partition recovered, anyone help me please..  My harddisk is SSD

About two weeks ago I had a problem with my PC that my brother wrote a question about at .  I still haven't solved the problem, so my PC is unusable now.  Now I think that it would be simpler to re-install both Win7 & Ubuntu than repair them, but there're some data on their partitions. I want to recover this data.  These partitions are not mountable for some reason. I don't know why.  sudo fdisk -l about the problematic partitions:     Device    Boot      Start         End      Blocks   Id  System /dev/sda1            2048     147912703    73955328   83 Linux /dev/sdb2            206848   174079999    86936576    7  HPFS/NTFS/exFAT   And in GParted:      And the error of the mount command:  Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   And the exact same message for /dev/sda1  How can I recover my data from those HDDs?  EDIT     I have tried to specify the type of the drive:  $ sudo mount -t ext4 /dev/sda1 /olddisk mount: wrong fs type, bad option, bad superblock on /dev/sda1,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so $ sudo mount -t ntfs /dev/sdb2 /olddisk NTFS signature is missing. Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   EDIT     sudo ntfsfix /dev/sdb2 returns:  Mounting volume... NTFS signature is missing. FAILED Attempting to correct errors... NTFS signature is missing. FAILED Failed to startup volume: Invalid argument NTFS signature is missing. Trying the alternate boot sector Unrecoverable error Volume is corrupt. You should run chkdsk.


I was watching a numberphile video, and it stated that the limit of  $1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\cdots$ was $\frac \pi 4.$  I was just wondering if anybody could prove this using some terms and math I am likely to understand. I am a high school student taking Algebra II.

Following reading this great post : , Vadim's answer reminded me of something an analysis professor had told me when I was an undergrad - that no one had ever given him a satisfactory intuitive explaination for why this series definition should be true (the implied assumption being that it is so simple, there should be some way to look at this to make it intuitive).  Now it follows simply from putting $x=1$ in the series expansion $$ \tan^{-1}(x) = x - \frac{x^3}{3} + \frac{x^5}{5} - \cdots $$  but I don't see anything geometrically intuitive about this formula either!


Determine all set of integers $n\gt 1$ such that  $$\frac{2^n+1}{n^2}\;\;\text{  is a integer. }$$  I found that $n$ is an odd.   Please help by providing me with a hint.

Find all $n>1$ such that $\dfrac{2^n+1}{n^2}$ is an integer.   I know that $n$ must be odd, then I don't know how to carry on. Please help. Thank you.


I want to read a text file containing a sequence of number as below:  1.000000  1:-0.362772 2:-0.314085 3:-0.177185 4:0.898650 5:-0.154588   Currently, I'm reading the line and I use split() method to split the number and store the numbers into an array. There are 3 variables will be used to store array elements, output,number, and value.  1.000000 will be the output as an integer, [1, 2, 3, 4, 5] will be an array of numbers, and [-0.362772,-0.314085,-0.177185,0.898650,-0.154588] will be the array of values.  Here is my code:  while (line != null) {         double output = 0;         inputs = new double[6];         String[] inputPairs = line.split(" ");         output = Double.parseDouble(inputPairs[0]);         for (int i = 1; i < inputPairs.length; i++) {             int components = Integer.parseInt(inputPairs[i].split(":")[0]);             double data = Double.parseDouble(inputPairs[i].split(":")[1]);             inputs[components] = data;         }         outputs[counter] = (int) output;         input[counter] = inputs;         counter++;         line = br.readLine();     }   However, when I execute the code I got this exception:  Exception in thread "main" java.lang.NumberFormatException: For input string: ""     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)     at java.lang.Integer.parseInt(Integer.java:592)     at java.lang.Integer.parseInt(Integer.java:615)     at testReadFile.main(testReadFile.java:32).   I noticed that there is an extra space after the first index: 1.000000  1:-0.362772 being stored in the 2nd element of the array.  How do I remove the space? I have used trim() but it doesn't work. Or is there a way to remove the array[2] which contains the space?

What regex pattern would need I to pass to  java.lang.String.split()  to split a String into an Array of substrings using all whitespace characters (' ', '\t', '\n', etc.) as delimiters?


I have 9 point connection on my computer and am trying to do a double monitor. The 9 point says 10101 A. Is there a connector for this to an HP2009m Monitor?

I have a (old) computer that I am trying to use, just for giggles. It has a 9-pin (RS-232) output for the monitor (marked 10101). Can I connect it to my VGA monitor using an adapter?  EDIT   Thanks for you input guys. But the serial port has both, the 10101 and rectangular symbols next to it!     What does this mean?


In my English class - 7 years ago - we had Isaac Asimov as topic, but this little story was not one of his.  It was about a single guy on a outpost. He tells about how normal his live is and how nice his lifestyle seems, and the end of story was that he was an alien with more than two arms.  He finds a human and says something like "and this creature has only two arms" or similar.  Can someone help me? I searched this story for my scout in a lesson of "point of view" but haven't found it on the internet so far.

I've been searching most of the morning, trying to identify a short story I read in an elementary school English textbook.    The story is the first-person account of a soldier fighting off an alien invasion.  The soldier describes how the aliens showed up, and everyone was excited, but then without warning, the aliens attacked; now the soldier and his comrades are fighting back.  At the end of the story, the soldier says he can see one of the aliens coming toward him, so he shoots the thing, cracking open its spacesuit and revealing the hideous creature within: a creature with soft pink flesh and no scales (or something similar).    This story began my lifelong love affair with sci fi, and I'd love to find it.  I've googled about every term I can think of and looked extensively through the archives here, but just can't find it.  Any assistance would be greatly appreciated!


Is there a direct bus connection betwee Gatwick Airport to London Heathrow?

I arrive into Gatwick from Nice at 12:30 pm on 9 May, 2016 and depart from Heathrow at 15:15 for Shannon. What is the most efficient transportation between the two London airports? Will the airline transfer my luggage to my final destination on Shannon?  NCE | LGW | SNN


I am trying to insert simplified chinese into my mysql table using UTF8_unicode_ci. Everything including the connection is configured to use UTF8.   When I try an insert these characters into the database table using a traditional HTML form post using PHP, I get the MySQL invalid string value error message. The strange thing is that if I use Jquery to post the information to another PHP page to store in the database, I get no error and the data goes in fine.   I am wondering what the differences are. Can anyone shed some light on this issue?  It happens for all data as far as i know. I connect to mysql using: $this->link = mysql_connect(cj_config::CJ_DB_HOST, cj_config::CJ_DB_USERNAME, cj_config::CJ_DB_PASSWORD); and then select the appropriate database using mysql_select_db.   The table collation is utf8_unicode_ci, and the column is also set to utf8_unicode_ci. The database collation and connection are all set to Utf8 also.   The error i am getting when sending the html form post is :   Error: Incorrect string value: '\x9A' for column 'company_name' at row 1.   I don't get this error when posting the same chinese character via jquery post and mysql does not complain.   The source of this jquery post is below and looks properly utf8 encoded:  customer=7&task_title=%E5%95%8A&task_notes=%E5%95%8A&datetime=&method=addtaskg&smallview=true

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


Primitive roots: If $p$ is a prime such that $p\equiv 1 \pmod 4$, and $a$ is a primitive root, then $-a$ is also a primitive root.  In this particular question I did show that in fact $(-a)^{p-1} \equiv 1 \pmod 4$, what is trivial. But, how can I assure that $p-1$ is its order?  Thanks a lot.

question is as follows:  Let $p$ be a prime with $p \equiv  1 \mod 4$, and $r$ be a primitive root of $p$.  Prove that $-r$ is also a primitive root of $p$.  I have shown that $-r^{\phi(p)} \equiv 1 \mod p$.  What I am having trouble showing, however, is that the order of $-r$ modulo $p$ is not some number (dividing $\phi(p)$ that is LESS than ($\phi(p)$).  By way of contradiction, I've shown that the order of $-r$ cannot be an EVEN number less than $\phi(p)$.  But my methodology does not work for the hypothetical possibility of an ODD order that is less than $\phi(p)$.  Any and all help appreciated.  Happy to show methodology for any of the parts I have managed to do, if requested.


I want to install the Ubuntu sybsystem on windows 10. But, I found that the os build version required is 14393.0 while I have the build 10586 here what I get when I go settings > system > about    for that,the Linux subsytem is not available for installation on my system.     I have installed the updates before. As a result the version was updated to 1511 but the OS Build remained as it is   the question:  Is their any way to upgrade the OS Build to a higher version that support installing Linux subsystem without reinstalling windows ?

I have a laptop with Windows 10 Enterprise edition installed (64bit).  I haven't got the Windows 10 Anniversary Update from the normal Windows Update (I have clicked Check for updates). So I want to install it manually.  I have downloaded the the update from . However when I run it, the Update Assistant says     But I'm my own system administrator. I've installed Enterprise Edition from MSDN Subscriber downloads.  How do I update to the Anniversary Edition?


SO and SU just told me I've been logged in. I'm guessing because I'm already logged into my Google account... but how does SO know that?

Update: Universal login is in place and considered "done". If you see anything weird, please submit new bug reports.   As y'all know, our current flavor of "global authentication" leaves a few things to be desired. It's flaky, requires a page refresh, etc. etc. Wouldn't it be nice if you could just sign in once and be automatically logged in across the network?  We are ready to roll out Stage 1 of Project "Make Authentication Suck Less". It is live as of a few minutes ago. What this means right now:  When you log into any Q&A site on the stackexchange.com domain, you will be automatically logged into all other Q&A sites on the stackexchange.com domain + stackexchange.com itself.   is excluded from this.   , , and other Q&A sites with their own domains will still use the old flow.  We are going to recognize you in some ways on sites where you don't have a profile. This is still a work in progress, but most notably you will see "join this community" in the top bar instead of "sign up" and "log in".   But I use multiple accounts! What do? We aren't intending to break the ability to run multiple accounts. The same guidelines as before still apply — we don't officially support that, you might end up with an accidental automatic merge if you're not careful with your credentials, any interaction between the accounts is right out, and so on. If you're already using different browsers or different browser profiles for your accounts, nothing will change for you. If you are somehow logged into multiple accounts in the same browser... I'm sorry to say, but that's a bug even for our current global auth setup. You will now only be able to log into one at a time, and you'll need to log out when you want to switch. (Or start using different browsers.) What's next:  Remember  we tested a few months ago? It's coming back. Stage 2: bring other domains into the fold (this is also live now) Stage 3: make cross-domain experience smoother and support browsers that reject third-party cookies in all conditions (looking at you, Safari) - this is not currently feasible. Safari users and users who reject third-party cookies will need to sign in separately to every second-level domain (e.g. stackexchange.com, stackoverflow.com, etc).  If you see any issues… Good luck, because you probably can't log in to report them here. =) But seriously, let us know via the contact form linked at the bottom of any page. If you are able to log in, report issues here on meta as normal. So, in conclusion…


I have to prove that the function $f:\Bbb{R}\times\Bbb{R}\to\Bbb{R}$ defined as follows: $$f(x, y)=\frac{xy}{x^2+y^2}\text{for } (x, y)\neq (0,0)$$ $$f(x, y)=0\text{ for }(x, y)=(0,0)$$when taken as a function of $x$, is continuous.   My method:  Take any $\epsilon>0$. I have to prove that there exists a $\delta$ such that $\left|\frac{(x+\delta)y}{(x+\delta)^2+y^2}-\frac{xy}{x^2+y^2}\right|<\epsilon$. I'm getting a quadratic inequality in $\delta$.   My question is, what if the situation was more complicated? I got easily get a very messy expression for $\delta$. What should we do then? How should we prove continuity?  Thanks in advance!

Consider the function $ f:\mathbb{R^2} \rightarrow \mathbb{R}$ given by   $ f(x,y) = \left\{   \begin{array}{l l}     \frac{xy}{x^2 + y^2} & \quad \text{if (x,y) $\neq$ (0,0)}\\     0 & \quad \text{if (x,y) = (0,0)}   \end{array} \right.$  Show that f is continuous along every horizontal and every vertical line (i.e. for every $x_0, y_0 \epsilon \mathbb{R}$, the functions $g,h:\mathbb{R}\rightarrow \mathbb{R}$ given by $g(t) = f(x_0,t)$ and $h(t)=f(t,y_0)$ are continuous).  I know that this function is not continuous at $(0,0)$, but the horizontal/vertical line issue is proving difficult to work with. Any help/hints appreciated!


If we do away with the analytic-synthetic distinction as per Quine, does that mean that mathematics is no more certain than empirical science?  And how does mathematical proof proceed if we don't use analyticity?  What does Quine think about the certainty/fallibility of mathematical proof?

I was surprised to learn that Quine is a mathematical realist (). I always assumed that his "Two Dogmas of Empiricism" and specifically his dissolution of the Analytic/Synthetic distinction was a strong challenge to mathematical realism. My reasoning was the following:    (a) Quine shows that what seemed like a perfect example of analytic proposition "all Bachelors are unmarried" is actually based on empirical data inferred from the way the word Bachelor is used. There are possible worlds where "Married bachelor" is a valid statement.  (b) Based on the same reasoning "Odd numbers aren't divisible by 2" can also be considered an empirical statement, and there are possible worlds where "There are Odd numbers divisible by 2" is a valid statement.    Quine later in the paper argues that even the laws of logic are themselves subject to potential change based on empirical data. The way I understand it, this, along with the reasoning in (b), would seem to indicate that math is arbitrary. Based on different empirical data and suitably chosen axioms of logic, just about any mathematical system can be constructed, where statements like "prime that has an integer square root" or  "1+1=3" are completely valid.   Towards the end of the paper, he famously states:      "Physical objects are conceptually imported into the situation as convenient intermediaries not by definition in terms of experience, but simply as irreducible posits comparable, epistemologically, to the gods of Homer . . ."    My questions:    If even the law of excluded middle is subject to revision based on empirical data, then isn't "2+2=4" subject to revision as well?  Is my analogy between (a) and (b) correct? Or even if (a), (b) is still incorrect?  Isn't his stance as a mathematical realist contradicted by the conclusion of the paper?  If even physical objects are posits epistemically on par with Homeric gods, then don't mathematical objects have the same epistemic challenge as well? How can they be real?


Since upgrading from Ubuntu 16.04 to 18.04 my Epson Workforce 2760 printer will not scan documents. I have tried everything I can find related to this problem with zero success. I have tried installing backends and setting permissions. There are others who are having this problem but perhaps not enough to get to a level that attracts the attention of someone who can help. There may be a bug in the 18.04 version that causes this and hopefully either a workaround or a fix can be discovered soon.   One thing I tried was this:   sudo ln -sfr /usr/lib/sane/libsane-epkowa* /usr/lib/x86_64-linux-gnu/sane   Still no success. Possibly the upgrade to Ubuntu 18.04 broke something within the Sane setup. I don't know how to "provide some more details, like the output for lsusb to prove the scanner is actually attached and recognized."  Found this:   Here is output of "sudo sane-find-scanner" :  # sane-find-scanner will now attempt to detect your scanner. If the   # result is different from what you expected, first make sure your   # scanner is powered up and properly connected to your computer.  # No SCSI scanners found. If you expected something different, make sure that   # you have loaded a kernel SCSI driver for your SCSI adapter.  could not fetch string descriptor: Pipe error could not fetch string descriptor: Pipe error found USB scanner (vendor=0x04b8 [EPSON], product=0x111c [EPSON WF-2760 Series]) at libusb:005:002   # Your USB scanner was (probably) detected. It may or may not be supported by   # SANE. Try scanimage -L and read the backend's manpage.  # Not checking for parallel port scanners.  # Most Scanners connected to the parallel port or other proprietary ports   # can't be detected by this program.

I am trying to get an Epson WF-2760 scanner that is network-connected working. I'm using Ubuntu 16.04.2 64-bit and the printer works a treat. I have installed the Epson drivers from their site, including the plugins. I have edited /etc/sane.d/dll.conf to enable epson, epson2, and epsonds. I have edited each of the respective .conf files to include the network address of the device (IPV4: 192.168.128.11).   The scanner is not detected in any software that I have tried (including Image Scan and Simple Scan).  Any help is appreciated!


Given $f(n) = n + \left \lfloor{\sqrt n}\right \rfloor$  Prove that for any natural number $n$, the sequence $n, f(n), f(f(n)),.......$ must always contain at least one perfect square.  Now obviously if we take $n$ to be a perfect square, we are done since the sequence contains $n$. So I started by looking at the behaviour of the function at $n = 2$, and within $2$ iterations we reach $4$. Then I looked at $n = 5$, and that reaches $9$ in $2$ iterations. However, $6$ is missed in the sequence as $f(5) = 7$ and this function is strictly increasing. So I looked at the sequence when $n = 6$, which reaches $16$ in $4$ iterations.   Trying to generalise this is a bit difficult, however, as I tried to let $k^2 < a < (k+1)^2$ for some natural number $a$.   Clearly, $f(a) = a + k$, however I am stuck here. Is this approach worth taking or is there something completely different required?

Let $m$ be a natural number. Define $f(m) = m + \lfloor\sqrt{m}\rfloor$. Prove that at least one of the number among $m, f(m), f^2(m), \ldots$ is a perfect square. Here $f^k(m)$ denotes the composition of $f$ over itself $k$ times.  I tried the question, but the greatest integer along with square root is creating trouble.


i am running this query where in rel_branding there are more than 1 rows and i want to insert brandingid of every record in rel_branding_permission.  This is for PostgresSQL.   insert into rel_branding_permission (brandingid,permissionid)  values((select brandingid from rel_branding), 404);   I want to insert this query in my DB as for all branding ids

I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the SQL engine of the day (, , , , and ).  Is there a silver-bullet syntax coming from an SQL standard (for example, ) that would allow me to insert the values without worrying about the underlying database?


I'm confused how  $$\dot{\mathbf{r}}_{j}=\sum_{k}\frac{\partial\mathbf{r}_{j}}{\partial q_{k}}\dot{q}_k+\frac{\partial\mathbf{r}_{j}}{\partial t}$$  leads to the relation,  $$\frac{\partial\dot{\mathbf{r}}_{i}}{\partial\dot{q}_{j}}=\frac{\partial\mathbf{r}_{i}}{\partial q_{j}}$$   that while differentiating the first equation the generalized velocity and generalized positions are considered as independent of each other, i.e., $(\dot{q_1},\dot{q_2},...,\dot{q_n})$ is independent of $(q_1,q_2,...,q_n)$. I don't understand how they are independent.

Why is the following equation true? $$\frac{\partial \mathbf{v}_i}{\partial \dot{q}_j} = \frac{\partial \mathbf{r}_i}{\partial q_j}$$ where $\mathbf{v}_i$ is velocity, $\mathbf{r}_i$ is the displacement, and $q_j$ is the generalized coordinate into which $\mathbf{r}_i$ is transformed. In reading further, I find that it's related to $$ \mathbf{v}_i \equiv \frac{\mathrm{d}\mathbf{r}_i}{\mathrm{d}t} = \sum_k \frac{\partial \mathbf{r}_i}{\partial q_k}\dot{q}_k + \frac{\partial \mathbf{r}_i}{\partial t} $$ I know that in transforming the virtual displacement $\delta\mathbf{r}_i$ into generalized coordinates, I can use $$ \delta\mathbf{r}_i = \sum_k \frac{\partial\mathbf{r}_i}{\partial q_k}\dot{q}_k $$ The first equation above is of course equivalent to $$\frac{\partial \dot{\mathbf{r}}_i}{\partial \dot{q}_j} = \frac{\partial \mathbf{r}_i}{\partial q_j}$$ I'm not sure why the dots vanish just like that. How do these all connect? In a non-mathematical explanation, I can understand that as $q_j$ changes, $\mathbf{r}_i$ changes as well. In the same way, as $\dot{q}_j$ changes, $\mathbf{v}_i$ changes, too. I'd like to know, mathematically, how these changes (for $\mathbf{r}_i$ and $\mathbf{v}_i$) turn out to be equal.


I have a PS4, bought a 10$ PlayStation card, entered the code in PlayStation wallet, it showed I have a balance of 10$, then I purchased 1000 v-bucks from Fortnite application for 7.99$, I paid from the PS wallet, the wallet balance became 2$ but I cant see any v-bucks in Fortnite. My Epic Games account shows no transaction happened but my PlayStation account shows I bought a 10$ game card and used 8$ to buy v-bucks. Please let me know how I can solve this issue. Thanks

So I'm thinking of buying some V-Bucks on Fortnite, Battle Royale mobile. Do the purchases save cross platform?


I know this isn't a difficult issue but I have come to a complete stand still, I want to print a two dimension array with values already assigned for example:      int array1[][] = new int[1][1];           array1[0][0] = 10;           array1[0][1] = 20;           array1[1][0] = 30;           array1[1][1] = 40;    I just want to simply print the values and I really can't remember how to do it, I keep on doing this  System.out.println(Arrays.toString(array1))`;   but I know this is wrong, can you help?

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


we come across the ornamental fonts, in most of the cases, especially  in designing the title pages and chapter titles, parts, sections etc.,      How to identify the fontfamily name(or how to use the font) locally in our document.   Here is the one way..   \DeclareFixedFont{\titlefont}{T1}{ppl}{b}{it}{0.5in}  To use this, we are going with the very usual way,  {\titlefont{The text which we want}}  which satisfy our needs.  Most of our users are poor in searching the font family and how to use that(including me).  In this post, if we can give a MWE which provides ornamental fonts, it may motivate others to use the others fonts also and will give a motivation to create their title pages using latex itself.  Thanks in advance.  I am using Texlive 2013 as backend and texstudio as a front end, and pdflatex.

The standard font packages make global changes to the fonts in my document. What if I want to use a particular font for just a portion of my text?   How do I find the right name of the font? How do I select the font? How do I restrict the scope of the font change?     There are separate answers for different flavors of TeX (quick links):


How can I skew or shear text on a circular path in either photoshop or illustrator? I need the text running along the bottom outside of the circle to skew the opposite direction of italics (slanting to the left). Apparently, this is something that has never been done before because I can't find anything on it anywhere.      If that makes sense, I want the text slanted as if it was showing motion by following the rotation of the gear.

I'm using adobe illustrator, and I'm trying to get the text to orient from left to right(counterclockwise) and not upside down but I cannot get it to do that on the path I've created. Im pretty beginner with illustrator, any help would be greatly appreciated. thank you


Vertices only move when I hold down the ctrl key, otherwise they move a great distance.

My cursor is moving by every selection by large increments!  Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.  How do I reset it to normal?


Was Air New Zealand flight NZ6 on April 16, 2020 from AKL to LAX cancelled, or did it depart? I need to determine this information in the hope of obtaining a full refund, rather than a credit. Thanks.

Where can I find historical data on flights, specifically Delta international flights?  I need to find out about cancellations, diversions and any other flight data pertaining on particular route at a given time.  This source has to be official and stand up to legal scrutiny.


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.


Can I install Ubuntu desktop OS on an android tablet? Is it possible to replace android and have Ubuntu as the only OS. If yes, then how do I install it onto my tablet? Do I need to backup my Android? What are the hardware requirement for that?

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


I encountered an inequality that I have no idea how to prove.     $ |\mathrm{Tr}(A^*B)| \leq ||A|| \cdot ||B||_1 $, where $A^*$ is the adjoint of $A$, and $||A||$ denotes the spectral (or operator) norm of $A$, and $||B||_1$ denotes the trace norm of $B$.   Maybe the first step we can do is to assume w.l.o.g. B is diagonal. But what to do then?

I'm looking for a reference for a matrix-norm inequality that I used in , which has a few equivalent forms.  I will use notation that applies to complex vector spaces with a sesquilinear inner product, but of course the same applies over real matrices.  The statement is as follows:     Take $A,B \in \Bbb F^{n \times n}$.  Then    $$\vert\operatorname{tr}(A^*B)\vert \leq \sigma_1(A)\sum_{i=1}^n \sigma_i(B) = \|A\| \operatorname{tr}|B|$$   where $\sigma_i$ denotes the $i$th singular value, $|B| = (B^*B)^{1/2}$, and $\|\cdot\|$ denotes the spectral norm (induced Euclidean norm).   I did manage to find some references, but they're overkill, and the texts themselves are not readily accessible to the faint of heart (Bhatia's text is dense and Pedersen's is not about matrices in particular).    A suitable reference would be greatly appreciated.


In earlier years, i had find that:  # Python code  x = [[0]*5]*5 # IMO, it will be a 5*5 2D-Array-Like x[2][2] = 2  # I considered x will be # [ # [0,0,0,0,0], # [0,0,0,0,0], # [0,0,2,0,0], # [0,0,0,0,0], # [0,0,0,0,0]]  # But x will be # [ # [0,0,2,0,0], # [0,0,2,0,0], # [0,0,2,0,0], # [0,0,2,0,0], # [0,0,2,0,0]]   So, why? Of course, later i had known this is because references of inner list. I do not thinks it is a good idea.  But again:  x[:][4] = 4   IMO again:  x[:] must be x's self. x[:][4] must be the last member of x. So x will be:  #[ # [0,0,2,0,0], # [0,0,2,0,0], # [0,0,2,0,0], # [0,0,2,0,0], # 4]   But it is not, there is no change!  So, why?  And, are there any other wired cases in Python? Please show below.  I just wanna collect things looks a bit strange in Python, not just a quizzer about this question.

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


Minimal example:  \documentclass{article} \begin{document} Helloworld this is a very long sentence Helloworld this is a very long sentence Helloworld this is a very long sentence Helloworld this is a very long sentence Helloworld this is a very long sentence `|Liver|CNS|Lungs`.  \end{document}   I have this in my body |Liver|CNS|Lungs which goes over the margin:    How can you type pipes in your body?

How to insert pipe symbol | in TeX (LaTeX)?  I have tried this sample with pdflatex tmp.tex  \documentclass{extarticle} \begin{document} \textpipe \end{document}   And it give undefined control sequence error  This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) restricted \write18 enabled. entering extended mode (./tmp.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded. (/usr/share/texmf-texlive/tex/latex/extsizes/extarticle.cls Document Class: extarticle 1996/10/08 v1.0 Non Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size10.clo) (/usr/share/texmf-texlive/tex/latex/base/exscale.sty)) No file tmp.aux. ! Undefined control sequence. l.3 \textpipe


My husband has a beard on his photo passport photo but he wants to shave it before we go on our cruise, will this be a problem for him when boarding the ship?

I just recently renewed my passport with a picture taken just after I shaved. I haven't shaved since (>3 weeks) and I kind of like it. I am even looking into how to maintain a beard, but that is a question for another platform.  Regarding traveling I am a bit worried that I look a bit different now then when I renewed my passport. On all my other photo IDs I don't have a beard either.   Long story short, should I shave before boarding my next flight, or are Immigrations/Customs/Airline staff trained to look through the beard?


I'm wondering if there's a way to tell (Xe)LaTeX to handle \chapter as \section, \section as \subsection and so on when inputting a document via \input into another document.  The setting is: I have a text with minimal LaTeX Markup. I need to use this text in two different environments / two different root files.  One produces my "standalone" Version of this text where I need big headings and the other one is a thesis referring to this text where I need to level-down the headings, because it's part of a \chapter. Any ideas?    text file "text.tex"  \chapter*{Introduction} Bla Bla \section*{Point 1} ...     root file #1:  \begin{document} \input{text} \end{document}     root file #2:  \begin{document} \chapter{First ideas to my text} ... \chapter{My way to my text} ... \chapter{The final text} \input{text} \end{document}

Consider following structure:  . |_s |_s  |_ss  |_ss+   |_sss  |_ss |_s |_s   How can I demote a subsection to subsubsection without changing markups ?  . |_s |_s  |_ss   |_sss+    |_p  |_ss |_s |_s   How can I promote a subsection to section without changing markups ?  . |_s |_s  |_ss |_s+  |_ss  |_ss |_s |_s   A wrapper command would be excellent  \begin[+1]{level} \section{} \end{level}


We always come across questions that are duplicate. If a question already has comment that it is possible duplicate. Then, I always check if that is the correct duplicate and if yes, I flag it as duplicate. But I also see people posting same answers as earlier.  Those answers get upvotes and reputation, even though same answers are already posted in the other questions.  I suggest that after the question is marked duplicate (e.g. after second or third vote while question is still open) answers posted on that question will give less reputation to their author when voted up, e.g. 5 points instead of 10.

At present if you see a question that may be a duplicate and has an easy answer you can post the answers or post a link to the duplicate question.  (Or the few hi-rep users can vote to close it as duplicate, think of normal users here, not the people that read Meta) It is better for Stack Overflow if a link to the duplicate is posted as a comment, or the user votes to close the question as a duplicate.  However, the user gets more rep if he/she posts the easy answer quickly. I'm thinking of something along the lines of:  First person to post a comment that points to possible duplicate gets some rep if the question is closed as a duplicate and at least 2 of the other closers chose that same dupe question.  Whenever someone votes to close as a duplicate, a “possible duplicate” comment should be posted with a link to the other question, if there is not already a link to it in a comments.  (The system now does this)    As Ether said,  The removal of reputation earned from answering a question that is later closed as a duplicate would at least remove the negative incentive, but is that enough to correct this behaviour? Is a “duplicate finder” badge part of the solution?  A bronze badge for being the first person to vote to close a question as a duplicate with the same “duplicate of” question chosen as most closers choose. A silver badge for doing the same 25 times.  See also  , would also help.  Now that the duplicate can be marked by the OP as helpful, we have another trigger to consider for awarding badges and/or rep.


If I have an indefinite amount of lists and I want to write a method for them to concatenate item-wise, what would be the best way to do this? Meaning, I don't have just 2 lists, like list A and list B and can write something like  X = [x+y for x, y in zip(A, B)]   but I will have various lists generated, which must be sequentially concatenated, so I don't know how to iterate over a n number of lists and concatenate them.  The first list will always have 1 or more elements (its length can be different), and the ones after it will always have only 1 element:  ['a','b','c'],['foo'], ['bar']....   The result I need is   ['afoobar','bfoobar','cfoobar']

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I have written a trigger to remove the duplicate insertions but it allows duplications   please check it once where sholu i mistaken  this is my trigger   trigger DuplicateCateCase on Case(before insert,before update) {       Set<string> accountname= new Set<string>();      Set<string> integrationtoo= new Set<string>();        for(Case cas: Trigger.new)      {        accountname.add(cas.Account.Name);        integrationtoo.add(cas.IntegrationTo__c);       }     List<Case> duplicatecaseList = [Select id,Case.Account.Name,IntegrationTo__c,SFType__c From Case where Case.Account.Name= :accountname AND IntegrationTo__c =:integrationtoo];     Set<string > duplicatecaseIds = new Set<string >();     for(Case dup: duplicatecaseList )    {      duplicatecaseIds .add(dup.Account.Name);       duplicatecaseIds .add(dup.IntegrationTo__c);       }     for(Case s : Trigger.new)    {         if(s.Account.Name!=null && s.IntegrationTo__c!=null)         {            if(duplicatecaseIds.contains(s.Account.Name) && duplicatecaseIds.contains(s.IntegrationTo__c))            {              s.addError('Record already exist with same Name');            }           }    }   }  ThAnks

I have taken three fields from case object called AccountName, IntegrationTo__c and SfType__c (checkbox).  I have created one case record with a specific combination of three fields.  For the second time I create a record with that combination, then  display error message only if SfType__c is true in first record otherwise allow  for record creation.  trigger AvoidDuplicate on Case(before insert)  {          set<string> newNameSet = new set<string>();     newNameSet = new set<string>();      set<string> newEmailSet = new set<string>();      set<string> dbNameSet = new set<string>();      set<string> dbEmailSet = new set<string>();      for(Case newLead : trigger.new){          newNameSet.add(newLead.Account.Name);          newEmailSet.add(newLead.IntegrationTo__c);      }      for(Case dbLead : [select id, Case.Account.Name, IntegrationTo__c from Case where IntegrationTo__c IN: newEmailSet OR Case.Account.Name IN: newNameSet]){          dbNameSet.add(dbLead.Account.Name);          dbEmailSet.add(dbLead.IntegrationTo__c);      }      for(Case newLead : trigger.new){          if(dbNameSet.contains(newLead.Account.Name) && dbEmailSet.Contains(newLead.IntegrationTo__c))              newLead.addError('You are inserting Duplicate Case');      }  }   i wrote this this not checking the account field name and integration__c values only with combination of account and integration__c shows error


As far as I know, the roots of role playing games and dungeons and dragons lie in wargaming and conflict simulations?  Is there a reason known (perhaps from an interview) why dungeons were a successful playing ground for the genre now known as "roleplaying" and the topos of "dungeon crawl"?  Why were it dungeons?  Is it the limitation of the field?

Why does ‘dungeon’, in the context of roleplaying games and D&D in particular, mean the places adventurers go to kill stuff?  I’m asking because ‘dungeon’ usually means a kind of prison, and I can’t see how it evolved into “hunting ground”, or however it’s used in D&D.


I am trying to show that there exists a bijective function $f:\mathbb{N}\rightarrow \mathbb{N} \times \mathbb{N}$ without using prime factorization. I have pieces here and there, but unable to put togther a complete proof. It would be great someone could help me out.  This is what I roughly got. I choose a sequence of postive integer $a_n=\frac{n(n+1)}{2}$ and I know they will be "captured once" by the interval $I_n=(a_{n-1},a_n]$ for all $n\geq 2$. I will let $I_1=\{1\}$. Then once show that there is indeed a bijective function between the set of intervals and the set of number defined by the sequence. I will invoke the property that any infintie subset of a countable set is countable to complete the proof.

I want to publish an article and one of its results is a simple closed-form expression for a natural bijection between $\mathbb{N}^k$ and $\mathbb{N}$. I wish to know whether it is already known.


For example, if I forget to tag/mention a user in my comment under a Stack Overflow question or answer and I edit the comment to add the tag, will the tagged user then also be notified?

I always wondered if users get notified about comments were their name was edited in afterwards.  Example:  I write a comment     See this link here   then I edit it to     @someuser: See this link here   Does the user get notified now?


I was wondering if anyone around here could give me some explanation on this type of attacks. Pretty much the only thing that I could find is   What I really need is basic explanation of the attack itself with a small example if possible such as any basic block cipher that you could come up with, with 3-4 rounds. This is for my personal understanding so any input is more than welcome

I was wondering if anyone around here could give me some explanation on this type of attacks. Pretty much the only thing that I could find is .  What I really need is basic explanation of the attack itself with a small example if possible such as any basic block cipher that you could come up with with 3-4 rounds. This is for my personal understanding so any input is more than welcome.


In one dimensional induction we show something holds for $n=0$ or $n=1$ and assume it is true at $n=n$ and prove for $n=n+1$.  In two dimensional induction is it something along show it is true for $(n,k)=(0,k)$ or $(n,k)=(1,k)$ at any $k$ and assume it is true at $(n,k)=(n,k)$ and prove for $(n,k)=(n+1,k)$?  In my case $n\leq k$ always.

I am going through some good old Fibonacci proof by induction problems that require two counters $m, n$ instead of one.  In order to prove $P(m, n)$ for all $m,n \in \mathbb{N}$, I am thinking of first proving $P(0, 0)$ and then proving that    $P(m,n) \implies P(m + 1, n)$ $P(m, n) \implies P(m, n + 1)$ $P(m, n) \implies P(m + 1, n + 1)$ (EDIT: As noted by Arthur, this is unnecessary).   but am unsure if this is a correct axiom.    Isomorphically speaking, consider an integer grid. If we can show that the bottom left most tile is black, and that if any black tile implies that the tile to the top, the top-right diagonally and the right is also black, then we can show that the entire grid is black.  This is in contrast with traditional double induction which first shows using induction that the bottom row is black, and then using induction again to show that all rows are black.


Suppose created an environment variable in your Python script (which is a process). Is the lifetime of the environment variable the same as the lifetime of the script while it runs? I've set my environment variable and ran my Python code until completion and if I tried to do      echo $MY_CREATED_ENV_VAR   it returns empty. I know that my script creates this environment variable because I could use it within the script itself.  Here is part of the script  import os  os.environ['MY_CREATED_ENV_VAR'] = "1"  # Returns-> MY_CREATED_ENV_VAR = 1 (and usable by other processes in the script) print("MY_CREATED_ENV_VAR = " + os.environ["MY_CREATED_ENV_VAR"])  # Script ends   does MY_CREATED_ENV_VAR automatically become unset? If not, how would I manually unset this environment variable in the script so as to clean up my code?  Thanks in advance!  Edit: I see that you can unset the variable, but then my question still stands, does python automatically unset the environmental variables? I cannot echo the env variable back in my terminal after the script has finished executing.

In Linux When I invoke python from the shell it replicates its environment, and starts the python process. Therefore if I do something like the following:  import os os.environ["FOO"] = "A_Value"   When the python process returns, FOO, assuming it was undefined originally, will still be undefined. Is there a way for the python process (or any child process) to modify the environment of its parent process?  I know you typically solve this problem using something like  source script_name.sh   But this conflicts with other requirements I have.


I want the windows to have a bloom effect around them, like this:     I've looked around online, and people have said using the following node setup created the effect, but it doesn't work for me.

I am wanting to animate a row of LED lights. I have separated the LED lights from the rest of my object with the pass index/ID mask functions; currently all of my LED lights are on pass index #1.  What I want is to have a minor halo effect around the lights, but only when they are active. Currently, when I add a halo effect to my pass index #1, all of the LED lights have a halo effect regardless if the LEDs are emitting light. All LEDs are diffuse and emission shaders, so I can animate by controlling the mix amount between diffuse and emission.   Is there any simple way to have the halo effect created through recognizing light emission values, or will I have to just animate each LED as its own layer of compositing?


I am looking for an example of << redirection because i don't understand it well. I know < is for sending the contents of specified file to be use as standard input like :  cat < file.txt   but i don't understand what << does. i saw a description about it that says "accept text of the following line as standard input" but still confused.

I often see tutorials online that connect various commands with different symbols. For example:  command1 |  command2 command1 &  command2 command1 || command2     command1 && command2   Others seem to be connecting commands to files:  command1  > file1 command1  >> file1   What are these things? What are they called? What do they do? Are there more of them?    .


I have several PDFs that are quite large (one is 80+ MB). Is there a free way to compress that PDF to a smaller size?

I have an 8 MB pdf file that definitely doesn't need to be that big. How can I reduce the size of this pdf file in Windows?


Consider the experiment of keeping flipping a fair coin until two heads are flipped consecutively. The outcome is the sequence of the flipped result. Possible examples of the outcome include HTHTHH and TTTHTHTTHH. The random variable X is defined to be the number of flips of an outcome. For example,  and X(HTHTHH)=6 and X(TTTHTHTTHH)=10. Find E(X).

I was working on problems on expectation and found this one as a question from a well-known exam  Assume that you are flipping a fair coin, i.e. probability of heads or tails is equal. Then the expected number of coin flips required to obtain two consecutive heads for the first time is.  (A)4  (B)3  (C)6  (D)10  (E)5  I worked up like Let N be the number of tosses required untill 2 consecutive heads are obtained for the first time.  Let the probability of obtaining heads be p and tails be q and for a coin p=q=1-p=1-q.  For N=2, the probability will be $p^2$  For N=3, the probability will be $p^2.q$  For N=4, the probability will be $q^2.p^2$  For N=5, the probability will be $q^3.p^2$  and so on...  Now, $E[N]=2(p^2)+3(p^2.q)+4(q^2.p^2)+5(q^3.p^2)+......$  and this comes out to be $\frac{3}{2}$ but it matches with none of the options.  Please tell me where I am wrong and what should I do to reach the correct solution?


I had a perfectly working CentOS 7. Then, while installing some programs (and unfortunately I am unable to backtrace it) it seems the xorg and xorgxrdp conflicted with some RHEL repository and I couldn't update xrdp/xorgxrdp.  Then, on this site, I luckily found a way to go around it and performed the following steps to get the xrdp working again.   sudo yum -y install https://archive.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/x/xorgxrdp-0.2.9-1.el7.x86_64.rpm  sudo yum install xrdp  sudo systemctl daemon-reload sudo systemctl enable xrdp sudo systemctl start xrdp   Now, even though my RDP session from Win to Linux works, the bigger problem remains which is that I am unable to update. How do I go around fixing this?  Pls see the error below:  sudo yum update Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: ftpmirror.your.org  * centosplus: ftpmirror.your.org  * elrepo: ord.mirror.rackspace.com  * epel: ord.mirror.rackspace.com  * extras: ftpmirror.your.org  * rpmfusion-free-updates: muug.ca  * updates: ftpmirror.your.org Resolving Dependencies --> Running transaction check ---> Package xorgxrdp.x86_64 0:0.2.9-1.el7 will be updated ---> Package xorgxrdp.x86_64 0:0.2.10-4.el7 will be an update --> Processing Dependency: xorg-x11-server-Xorg(x86-64) = 1.20.4 for package: xorgxrdp-0.2.10-4.el7.x86_64 --> Finished Dependency Resolution Error: Package: xorgxrdp-0.2.10-4.el7.x86_64 (epel)            Requires: xorg-x11-server-Xorg(x86-64) = 1.20.4            Installed: xorg-x11-server-Xorg-1.20.1-5.6.el7_6.x86_64 (@updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.6.el7_6            Available: xorg-x11-server-Xorg-1.20.1-3.el7.x86_64 (base)                xorg-x11-server-Xorg(x86-64) = 1.20.1-3.el7            Available: xorg-x11-server-Xorg-1.20.1-5.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.el7            Available: xorg-x11-server-Xorg-1.20.1-5.1.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.1.el7            Available: xorg-x11-server-Xorg-1.20.1-5.2.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.2.el7_6            Available: xorg-x11-server-Xorg-1.20.1-5.3.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.3.el7_6  You could try using --skip-broken to work around the problem  You could try running: rpm -Va --nofiles --nodigest   Can someone please help me in fixing this? from what I am reading, it seems the RHEL 7.6 is conflicting with another version? However, I do have EPEL enabled.  sudo yum repolist all | grep enabled base/7/x86_64                                   CentOS-7 - Bas enabled: 10,017+2 centosplus/7/x86_64                             CentOS-7 - Plu enabled:      103 cr/7/x86_64                                     CentOS-7 - cr  enabled:        0 docker-ce-stable/x86_64                         Docker CE Stab enabled:       52 elrepo                                          ELRepo.org Com enabled:      124 epel/x86_64                                     Extra Packages enabled:   13,367 extras/7/x86_64                                 CentOS-7 - Ext enabled:      435 rpmfusion-free-updates/x86_64                   RPM Fusion for enabled:      247 updates/7/x86_64                                CentOS-7 - Upd enabled: 2,484+16 virtualbox/7/x86_64                             Oracle Linux / enabled:       70

I'm trying to install XRDP and I'm hitting the following:  [root@box ~]# yum -y install xrdp Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: centos.serverspace.co.uk  * epel: mirrors.coreix.net  * extras: mirror.sov.uk.goscomb.net  * updates: mirror.sov.uk.goscomb.net Resolving Dependencies --> Running transaction check ---> Package xrdp.x86_64 1:0.9.10-1.el7 will be installed --> Processing Dependency: xrdp-selinux = 1:0.9.10-1.el7 for package: 1:xrdp-0.9.10-1.el7.x86_64 --> Processing Dependency: xorgxrdp for package: 1:xrdp-0.9.10-1.el7.x86_64 --> Running transaction check ---> Package xorgxrdp.x86_64 0:0.2.10-4.el7 will be installed --> Processing Dependency: xorg-x11-server-Xorg(x86-64) = 1.20.4 for package: xorgxrdp-0.2.10-4.el7.x86_64 ---> Package xrdp-selinux.x86_64 1:0.9.10-1.el7 will be installed --> Finished Dependency Resolution Error: Package: xorgxrdp-0.2.10-4.el7.x86_64 (epel)            Requires: xorg-x11-server-Xorg(x86-64) = 1.20.4            Installed: xorg-x11-server-Xorg-1.20.1-5.6.el7_6.x86_64 (@updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.6.el7_6            Available: xorg-x11-server-Xorg-1.20.1-3.el7.x86_64 (base)                xorg-x11-server-Xorg(x86-64) = 1.20.1-3.el7            Available: xorg-x11-server-Xorg-1.20.1-5.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.el7            Available: xorg-x11-server-Xorg-1.20.1-5.1.el7.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.1.el7            Available: xorg-x11-server-Xorg-1.20.1-5.2.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.2.el7_6            Available: xorg-x11-server-Xorg-1.20.1-5.3.el7_6.x86_64 (updates)                xorg-x11-server-Xorg(x86-64) = 1.20.1-5.3.el7_6  You could try using --skip-broken to work around the problem  You could try running: rpm -Va --nofiles --nodigest   Now, I get that it's missing a dependency, however, it appears to be saying it requires xorg-x11-server-Xorg version 1.20.4.   It then continues to say version 1.20.1-5.6.el7_6 is installed.  From where I'm sitting, 4 is in the range 1-5 so I'm unclear what the issue is. They all seem to be for the right architecture.  Is 1-5 a version string in and of itself as opposed to a range, or -if not- what am I missing?  Solution: Thanks to , here's a workaround:     Having the same issue, I installed manually archived xorgxrdp   yum -y install https://archive.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/x/xorgxrdp-0.2.9-1.el7.x86_64.rpm   then   yum -y install xrdp and it works


Water heater when you areA snowbird for six months

We're definitely not DIY-types in our household, so would love an answer from those who know the answer: We have a gas water heater in the basement, and will be traveling for over a month this summer. No worries about freezing at this time of year, but the water heater is aging and we'd rather not have a flood if it should fail while we're gone. Our thoughts are to turn off the water at the main, & drain the pipes to avoid any possible leakage problems. What do we do with the water heater? Normally we don't shut the water off, so we usually just turn the water heater to "pilot". Suggestions?


How would one find the vector equation of the line that contains the point (x0, y0, z0) and is perpendicular to the plane Ax + By + Cz = D?

Question: Find the vector equation $r(t)$ for the line through the point $P = (-1, -5, 2)$ that is perpendicular to the plane $1 x  - 5 y + 1 z = 1$. Use $t$ as your variable, $t = 0$ should correspond to $P$, and the velocity vector of the line should be the same as the standard normal vector of the plane.  This one is really giving me a hard time.  I know that to find the plane perpendicular to the line I can use the vector n between two points on the line and and the plane.  I cannot wrap my mind around how to reverse this process, particularly because the plane is equal to 1 and not zero.  Any help would be greatly appreciated.


I have an application which read API return string from a website and compare it to a value to see if it is greater or equal to particular float, the API return two float String which is "2366.5876" and "4067.4076" which when we add up equal to 6433.9952 But what I tried on Javascript provide different result: cumulative = 0; cumulative += parseFloat("2366.5876") cumulative += parseFloat("4067.4076") //here it return 6433.995199999999 instead of 6433.9952 . Why??  which when I compare to 6433.9952 , produce false which is not intended cumulative >= 6433.9952 //False ???  Can I know how can I solve this??

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


A nullable variable such as:  int? kitten;  has a type of kitten.Nullable`1  What does the 1 represent?  For context only, the reason for asking this question was my musings over:  If I have this value in a string (no access to the actual object/type/reference), and I want to determine if it is nullable or not, would checking .endsWith(".Nullable`1") be consistently OK or would the number change depending on some unforseen factor?

How do I check if a given object is nullable in other words how to implement the following method... bool IsNullableValueType(object o) {     ... }  I am looking for nullable value types. I didn't have reference types in mind. //Note: This is just a sample. The code has been simplified  //to fit in a post.  public class BoolContainer {     bool? myBool = true; }  var bc = new BoolContainer();  const BindingFlags bindingFlags = BindingFlags.Public                         | BindingFlags.NonPublic                         | BindingFlags.Instance                         ;   object obj; object o = (object)bc;  foreach (var fieldInfo in o.GetType().GetFields(bindingFlags)) {     obj = (object)fieldInfo.GetValue(o); }  obj now refers to an object of type bool (System.Boolean) with value equal to true. What I really wanted was an object of type Nullable<bool> So now as a work around I decided to check if o is nullable and create a nullable wrapper around obj.


Can somebody give a clear explanation why this is incorrect? thank you     Theorem 1:   All positive integers are equal.   Proof: We show that any two positive integers are equal, from which the result follows. We do this by induction on the maximum of the two numbers. Let $P(n)$ be the statement “if $r$ and $s$ are positive integers and $\max \{ r, s \} = n$ then $r = s$.”  Clearly $P(1)$ is true. Suppose that $P(n)$ is true and let $r$ and $s$ be positive integers whose maximum is $n + 1$. Then $\max \{ r − 1, s − 1 \} = n$. By the inductive hypothesis, $r − 1 = s − 1$ and hence $r = s$. Thus $P(n + 1)$ is true.  The result is now proved by mathematical induction.

Suppose that we are trying to prove that for every positive integer n, if x and y are positive integers with max(x, y) = n, then x = y. For the base case, we suppose n = 1. If max(x, y) = 1 and x and y are positive integers, we have x = y = 1. Now we let k be a positive integer, and assume that whenever max(x, y) = k and x and y are positive integers, then x = y. Let max(x, y) = k + 1, where x and y are positive integers. Then max(x - 1, y - 1) = k, so by the inductive hypothesis, x - 1 = y - 1, so x = y. What is wrong with this ``proof''?


While proving some results on series I encountered that, one of those result  implies that $$\sum_{n=1}^{\infty}\frac{1}{(2n-1)(2n)}$$ is convergent and it has sum equal to sum of alternating harmonic series.  (And we know that alternating harmonic series converges to $\ln2$.) However I am not able to find the sum of series $\sum_{n=1}^{\infty}\frac{1}{(2n-1)(2n)}$ directly (without that result). Is there is any way to show that sum equals to $\ln2$?

Can anyone tell me about the sum of the series $$\sum_{n=1}^\infty \frac{1}{(2n)(2n+1)}?$$ This is not a usual telescoping sum in which all the terms cancel out.


The Soldier Background allows one to:      your rank to exert influence over other soldiers and requisition simple equipment or horses for temporary use.   No value is placed as a limit to this requirement.  Would it be too unbalancing if I allowed a player to requisition Plate Armor for a task in the first few levels?  Plate armor costs 1,500 gp and provides an AC of 18, while a horse costs 75 gp and a warhorse costs 400gp.

In the military rank feature it says the soldier can "requisition simple equipment or a horse for temporary use". What qualifies as simple equipment, any simple weapon or something less complex than a catapult?  Additionally, which part of the sentence is the "for temporary use referring to, the simple equipment and the horse or just the simple equipment?


When I try to use a command like \begin{theorem}[Something $x[y]$ something], I get an "extra } or forgotten $ error message". It seems like the ] in the equation is closing the optional argument even though the equation hasn't been ended!  What can I do about this?

I accidentally discovered () that a closing square bracket within an optional argument delimited by [ ] can cause problems.  Here is example code illustrating the issue:  \documentclass{article}   \begin{document}  \tableofcontents  \section[Square brackets ([ and ])]{Square brackets: [ and ]} % bad: the TOC now has "Square brackets ([ and", and the actual title is a mere ")".  Some text.  \section[{Square brackets ([ and ])}]{Square brackets: [ and ]} % good (works as originally intended)  Some text.  \end{document}   The text to be used as the optional (as well as the non-optional) argument contains a ], and this character is not supposed to function as the optional argument terminator but as a matching square bracket/parenthesis. Perhaps this is as it should be, but the question is how to best circumvent any potential problems. Enclosing this in a group works, but I don't know whether doing this has other side effects (perhaps not here in the case of \section but hopefully someone else has a better example of where grouping could lead to a problem). There is no (obvious) way other than writing [{ }] because [ and ] are not normally escaped. That [ and ] are normal characters and bear syntactic function (as optional argument delimiters) creates this potentially problematic situation.  Is simply enclosing the entire optional argument in a group ({ }) a good solution? Are there other/better ways?


Euphemism would mean putting across something that is possibly very hurtful in a very polite /mild manner. Is there any specific word for its antonym? The closest to this that I can think of is venomous

The comments in  on E.S.E leave an issue unresolved: What does one call the situation in which a taboo concept is referred to as being a specific case of a more general nonvulgar concept?  The specific example that I would like to address is the Hebrew verb לדעת. This verb has several meanings. One meaning is to have knowledge of. Another meaning is to have sexual relations with. One could argue that the latter is a what for the former?


Presently the date is showing as mmm dd hh:mm:ss. Is there any way that I can change it to as per my liking. For example : dd mmm, hh:mm:ss.

Recently I upgraded to Ubuntu 11.04. The clock indicator on the panel is not following my regional settings format.   I edited locales and in all applications I have the right format of date and time except clock indicator on the panel. Tried dconfig editor but keys for clock applet cannot be changed. Tried to purge indicator and reinstall it - still the same. Is there any way that   I could change formatting of datetime indicator?   Here is format I'm using system wide: %A, %d %B %Y, %I:%M:%S Here is format of datetime-indicator that pops up: %a%B%d %H:%M:%S


how long must I cook small white navy beans in my soup to get soft?  Seems like it is taking too long. So far I have cooked 4 hours!

I decided I would make baked beans for a BBQ at my MIL's this past weekend. I've never made baked beans but decided that it was time since I love them so much! I found a recipe for Southern Baked Beans (using Navy beans). It was from a food blog.   During the description/commentary of the dish the blogger said they could be made with dried beans but she uses canned to save time. The recipe only mentioned canned beans. I couldn't find anything to tell me the ratio canned:dried beans so I decide a 1:1 ratio would be good. After putting a 24oz bag of beans in a cake pan (the recipe called for 32oz canned beans), I decided that was A LOT of beans so didn't add the remaining 8oz. I rinsed them first then soaked them for 15-18 hours. I rinsed them again and put them in a pot with the rest of the ingredients.   The recipe said to bake them at 350 for about 40 minutes and they should be done. After an hour and a temperature increase to 400, the beans weren't anywhere close to being done. At this point I decided they were probably very old beans. :( I moved them to the stove after another 30 minutes. They boiled on the stove for another 1 1/2 hours and were still rock hard (I kept adding water so they wouldn't boil dry - and this was on medium to medium-low heat).   We left the beans at my MIL's and she cooked them "off and on" (her words) the next day and declared they were done. They are not done. :(  Now that they've been cooked then refrigerated then cooked then refrigerated again, can I attempt to salvage them? I've read that adding 1/8 tsp baking soda per cup of beans will soften them. Is it too late to try this - add the beans, more water, and a small amount of baking soda and cook them a little more? I've put so much effort into these stupid beans I can't just give up! LOL


My question is the same as this one but for c#:   Please see the code below:  [HttpGet("{id}")] public ActionResult<byte[]> Get(Guid id) {     return System.IO.File.ReadAllBytes("Pictures\\" + id ); }   The filetype e.g. jpeg, gif etc is unknown.  How do I find the file without a file type?  Do I have to insist that all images are submitted in a particular file format?  What is the most elegant way of doing this?

I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to  only in .Net.


My /var/www is this (permissions 755)  drwxr-x---  3 www-data www-data 4096 gen 11 16:27 www   My /var/www/html is this (permissions 755)  drwxr-xr-x  2 www-data www-data 4096 gen 11 16:27 html      NOTE: if it's important, I installed php 7.2 and nginx on a Ubuntu 16.04.5; that for say that I manually created /var/www and /var/www/html because not created from nginx's installation   My user is named mirko  And using command group mirko I can see I am member of www-data  mirko : www-data adm cdrom sudo dip plugdev lxd lpadmin sambashare   But I cannot write files in /var/www/html. Of course, it because of 755 permissions.   question: the 755 is the suggested permission for /var/www/html in a lot of tutorials; but in this way, how is supposed I manage file into this folder?  My user must be able to run a composer create-project for example, and also git pull and so on.  What's the right settings for shell user and folder?     I know I can simply add +w recusively. My question was: if suggested permissions for html folder is 755  (or even 750) and suggested ownership is www-data:www-data...  how can a shell user access html subofolders?   Thanks in advance

I'm trying to not give 777 permission in my /var/www/html folder, but I want to edit my files without sudo. So I though in create a symlink of a folder in my home directory within /var/www/html. I created it using sudo ln -sT /home/andre/www/moodle/ moodle , and the ls -la output is this:  andre@andre-270E5G:/var/www/html$ ls -la total 8 drwxr-xr-x 2 root root 4096 Mai  4 10:20 . drwxr-xr-x 4 root root 4096 Abr 29 14:29 .. lrwxrwxrwx 1 root root   23 Mai  4 10:20 moodle -> /home/andre/www/moodle/   So, my moodle folder has read, write and execute permissions for everyone, and thats not what I want. I used the command sudo chmod -R 775 moodle/ trying to change it, but it stayed with read, write and execute permissions to all. I tried the same with the moodle folder in /home/andre/www/moodle, but it stayed the same. The output of ls -la in /home/andre/www/ is:  andre@andre-270E5G:~/www$ ls -la total 28 drwxrwxr-x  3 andre andre  4096 Mai  4 10:02 . drwx------ 49 andre andre 20480 Mai  4 10:01 .. drwxrwxr-x 41 andre andre  4096 Mai  4 10:02 moodle   So the folder moodle in /home/andre/www/ has the permissions I want.  As an additional problem, when I access localhost/moodle I get 403 Forbidden error.  What am I doing wrong here?


Is "cant" a spelling or grammar mistake?   I know using "where" instead of "were" and similar mistakes are grammatical errors. But is using "cant" instead of "can't"? Why is it one rather than the other?  Many thanks.  EDIT: I was not aware when writing this that "cant" was a word on it's own. My question is that if it weren't would the mistake be spelling or grammar. For example if you write down "werent" instead of "weren't".

The word wont - for example: 'I wont do it!'.  Should it be spelled wont or won't, is there an American/English difference?


I work at home and have a vpn and lan connection  Vpn is ok for work related bits but for some reason browsing the internet is very slow. If i disconnect the vpn then the problem goes away. Can I set my laptop to browse via the lan connection whilst still also using the vpn connection to remain on the work network?

I VPN to my work, and then I terminal server into my computer.  Everything works fine in relation to the VPN access, but locally I can't access the internet.  How can I fix this?


How do I disable lightdm(display manager) during bootup of my machine? I want to bootup to command prompt and not into GUI desktop. I am using ubuntu 16.0.4LTS

Is it possible to disable X at boot time? I'm setting up a server so it would be nice if it wouldn't load the graphical interface every time I boot.


I'm trying to use cleveref to reference some figures, but it is incorrectly labelling them as sections. (i.e. It will say something like Section 5.12 instead of Figure 5.1 in the text)  I'm also using hyperref to make the links, which might be confusing cleveref?  My code looks something like this:  \usepackage[pdftex,letterpaper=true,pagebackref=false]{hyperref} \usepackage{cleveref} % A bunch of hopefully unrelated stuff in between  Some text here \Cref{fig:first,fig:second,fig:third}.  \begin{figure}\label{fig:first} \centering \includegraphics[width=0.45\textwidth]{./figures/first.png} \caption{First Caption} \end{figure}  \begin{figure}\label{fig:second} \centering \includegraphics[width=0.45\textwidth]{./figures/second.png} \caption{Second Caption} \end{figure}  \begin{figure}\label{fig:third} \centering \includegraphics[width=0.45\textwidth]{./figures/third.png} \caption{Third Caption} \end{figure}   Any idea what could be causing the problem? Alternatively, is there to use just hyperref to reference multiple figures at once? What I want to be able to do is have a reference that looks like: Figures 5.1-5.4 but I couldn't find a way to do that with just hyperref, so I tried using cleveref, and instead it is giving me Sections 5.12 to 5.12 for the same set of labels.

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.