I need to reorder a list in a random way but I want to have the same result on a short period of time ... So I have:  var list = new String[] { "Angie", "David", "Emily", "James" }    var shuffled = list.OrderBy(v => "4a78926c")).ToList();   But I always get the same order ... I could use Guid.NewGuid() but then I would have a different result in a short period of time.  How can I do this?

What is the best way to randomize the order of a generic list in C#? I've got a finite set of 75 numbers in a list I would like to assign a random order to, in order to draw them for a lottery type application.


I'm think of buying  , HP Omen 600 wired mouse for use on Ubuntu 20.04. I've seen reports about mixed compatibility. I'm not bothered about programming buttons on the mouse but if I just plug it in to the USB port should it work fine for the standard functions? I'm wondering if anyone else has tried an HP gaming wired mouse on modern Ubuntu distros and if they've had success. Thanks

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


When you make a USB bootable with Ubuntu, it usually offers to either "Try Ubuntu" or "Install" into the hard drive. "Try Ubuntu" doesn't really save changes or treat the USB like a hard drive of its own. But that's what I want: a portable hard drive with Ubuntu OS installed into it so I can boot from it on any computer, and have all my changes saved. And yes, I have enough room in the flash drive (if 32 GIGS is enough).  I've read on Ask Ubuntu that this is actually possible by choosing your flash drive from the custom install menu (where it shows all the computer's drives, including sdb, the flash drive).  However, the answer i read suggested that I use an Ubuntu DVD to make this work. Can I install Ubuntu onto a flash drive from that VERY flash drive itself? I've noticed that the "Try Ubuntu" interface still works even if I decide to unplug the flash drive, so perhaps the flash drive can install Ubuntu onto itself?  It's hard for me to word my question clearly, but I hope I did it well enough so that someone understands.  Thanks a ton :)

If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about.   I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install.  To do this, I need to install the nVidia drivers first (sigh).  To do this, I need changes to persist a reboot.  To do this, I need to really install Ubuntu on a USB key.  How do you do that?    What I tried   I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu:  sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso   ...but the installer didn't detect the disk properly.


Could shield of faith cast by multiple casters stack on one creature?

Recently played with a group, where 3 of their clerics would cast spirit guardians, claiming monsters in the area had to make 3 wisdom saves for 3d8 damage each, potentially adding up to 9d8 damage per round.  Is this any different then trying to have two casters cast insect plague or cloudkill on the same area, or bless on the same individual?


I am reading "The C++ Programming Language 4th edition", and at the top of page 958 there is the following code snippet: template<typename Iter> typename Iter::value_type read(Iter p, int n) {     // ... do some checking ...     return p[n]; }   What does "typename" on the second line do in this case?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


I just saw a bizarre situation on Stackoverflow.  question was closed at 14:36:35 but   at 14:36:39  How is this possible? Closing a question take a few seconds?

Question:   Answer:   The question was closed at 11:57:57 (according to the hover-over-"x-mins-ago" bar) and the answer was posted at 12:16:35. It's a fairly lengthy answer, so it's possible that it was started to be written before it was closed but I swear I've started to answer a question then I got a banner along the top saying "this question has been closed" and the answer was no longer post-able.


I'm getting two error variance values from two third-party sensors, and need to multiply these variances with the position state estimates of the target they're tracking. Once that's done, the combined variance has to be sent back to the sensors.    The problem here is, how to get a combined variance? Obviously (variance1 + variance2)/2 won't work. Is there no practical way to calculate the combined variance if the mean and sample values aren't known?

Say there are $m+n$ elements split into two groups ($m$ and $n$). The variance of the first group is $\sigma_m^2$ and the variance of the second group is $\sigma^2_n$. The elements themselves are assumed to be unknown but I know the means $\mu_m$ and $\mu_n$.  Is there a way to calculate the combined variance $\sigma^2_{(m+n)}$?   The variance doesn't have to be unbiased so denominator is $(m+n)$ and not $(m+n-1)$.


I'd like to pass a measure of length in form of a string, i.e.  \setlength{string}   or   \setlength{'string'}   instead of  \setlength{2.5cm}   I seem to remember seeing something like that somewhere in LaTeX, but can't find it. Appreciate your input!

Is there a TeX command that returns the width of a given text as length value, so that I can use the result directly as a length argument of another command?  I mean, I would like to have a command \getWidth{my text} and want to use the result directly as the first argument of \parbox:  \parbox{\getWidth{my text}}{my foo\\bar text}


What's a word for conflicting emotions all felt at once such as loneliness, sadness, happiness, being content but also feeling as if something isn't right?

What's a word for conflicting emotions that are felt at the same time? For example, loneliness, sadness, happiness, being content but also feeling as if something isn't right?  To sum up: What's a word for something that is sad and funny at the same time?


Given that $\pi$ is the irrational number that occurs with a perfect circle, and perfection is very difficult to achieve through chance or nature, I think that most circles are really ovals, and imperfect.     Are there any proven naturally occurring objects, behaviors, movements, that have been so highly correlated with the irrational number $\pi$, that it can be assumed the underlying property is also a perfect circle?

Often in physics, Objects are approximated as spherical. However do any perfectly spherical objects actually exist in nature?


I guess this is a question to group leaders and those who have some influence on what PhD students join their group. Essentially - I want to know your thoughts if someone like me applied to your PhD project.  At 20 I graduated with a 2:1 BSc in Human Biology from a top 50 Uni, then achieved a Merit MRes in Functional Genomics from a top 10 Uni. I pretty much went straight into industry working on lentiviral vectors for gene therapy treatments; however, after three months I was running low on money, having a pretty hard time at home and this all affected my work so left the company after 3 months.  In the economic downturn I had more trouble getting jobs and money so went did waitering and sports coaching to get by. For the last 3 years I've been in international IT sales and have picked up lots of skills - sales, communicating, negotiating, presenting, strategy, training, motivating and leading teams. I've also earned a fair amount of money and I'm in a pretty safe position financially to the point where I could not earn anything for 1-2 years before I hit zero.  At this stage in my life (27) I'm looking back at research and really want to give it a go, but have no idea whether I'd get accepted onto a PhD course. At my old University there is a project based on baculovirus vectors that's right up my street.   I'm definitely applying for it but wanted to understand how an application from a 27 year old with this history might be received. Essentially - what positives and negatives can you see from a mature application?  I feel like I have a good chance. I've got (old) experience in a related field; I'm more mature than a freshly graduated student; I have a lot of skill useful for promoting the groups work and teaching classes; and I'm used to working long hours in a results driven environment, dealing with rejection but making things happen - especially racking through large amounts of work based on personal plans and goals. This is all in a legitimate way rather than a lip-service way.  I'm hoping I can address any negatives people come up with and enhance the positives!  Cheers!

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


Many tutorials show how to make mist and have light go through a window and it's pretty straightforward, however, what puzzles me is how do you do that when you emit beams of light between clouds?   If it's in the distant background I'd just use a HDRI or similar but I want the camera to fly into them.   In cycles, what technique should I use to approach this shot?   ADDITIONAL  In the "possible duplicates" the rays don't pass through the clouds they emit off screen or through an object but never clouds. So how to make the emission of clouds have variable opacity in a specific pattern?

While trying to use the new cycles volumetric rending features to create  (with the intention of updating ), I have found this to be a little trickier than I anticipated.    When I create a basic setup with a spot lamp (sun lamps don't seem to work, not sure if that is a result of their one directional nature or what..) and a world material like this:    Which gives me this (500 samples):    The problems with this that make me think that I'm missing something (aside from the rendertime and noise, which I understand to be a part of using bleeding edge new features) are:   The background shader/sky texture isn't visible at all (volume is too dense?) The lamp needed to be set to 50000 strength (this is of course dependent on the distance from the camera, but the kinds of strengths required to get some nice defined rays will blow everything out if volumes are disabled)   I can't seem to get a straight render (no compositing tricks) to look anything remotely like the pretty image in the release notes:        (source: )     Is this just how it works? Or is there some trick I have missed (not counting compositing/renderlayer tricks)?


The plane scene leading up to the inception of Fischer proceeds as follows:  Eames swipes Fischer's passport Cobb returns the passport to Fischer and chats him up about his father The flight attendant brings Cobb and Fischer drinks Cobb slips a sedative into Fischer's drink and hands it to him  It seems that they have taken a few unnecessary risks in pick-pocketing Fischer, and then spiking his drink where he could potentially see it. At face value, the passport is stolen to give Cobb an opportunity to drug Fischer. (In my mind, a stupid, risky mechanism). An alternate explanation is that returning the "dropped" passport builds trust between Fischer and Cobb, so that Fischer will go along with the Mr. Charles character in the dream. Plausible, and more importantly, necessary. However, the flight attendant is already working with them, and she could easily administer the sedative completely unnoticed. Plus, any conversation that happened, should it be necessary for the inception, could still occur without Cobb touching Fischer's drink. So why have Cobb do it? Is it simply that spiking the drink needs to be shown on screen, and it makes more sense to have use that time with a lead character rather than a minor one, or is there a more important, plot-based reason?

In Inception, why does Cobb slip the sedative into Robert's glass of water himself, taking considerable amount of risk at getting caught? Why didn't the Air hostess get the pre-drugged water for Fischer? Is there any reason for this?


If I write   \[\left||x|-|y|\right|\]   I would expect it to look like the second of the following two expressions:    which I got by writing  \[\Big||x|-|y|\Big|\]   Shouldn't \left and \right adjust the size automatically? Or do I have to write \Big whenever I have two vertical bars, one after the other?

For mathematics, is it ever disadvantageous to use \left(  and \right)  in equations?  I can't see any way that doing this would hinder the typesetting, so why isn't () just converted into \left( \right) automatically? This would save a lot of typing.  Cheers!


I am uploading multiple images. I am selecting image one by one and displaying image for preview. But it is displaying in vertical format. I am trying to display it in Grid format. Kindly have a look.    var abc=0; $('#add_more').click(function() {   $(this).before($("
", {     id: 'filediv'   }).fadeIn('slow').append(     $("<input/>", {       name: 'file[]',       type: 'file',       id: 'file'     }),     $("

")   )); });  function imageIsLoaded(e) {   $('#previewimg' + abc).attr('src', e.target.result); };  $('body').on('change', '#file', function() {   if (this.files && this.files[0]) {     abc += 1; //increementing global variable by 1      var z = abc - 1;     var x = $(this).parent().find('#previewimg' + z).remove();     $(this).before("

");      var reader = new FileReader();     reader.onload = imageIsLoaded;     reader.readAsDataURL(this.files[0]);     src = '<?=ASSET_BASE_URL?>scripts/script.js'     $(this).hide();     $("#abcd" + abc).append($("", {       id: 'img',       src: '/assets/x.png',       alt: 'delete'     }).click(function() {       $(this).parent().parent().remove();     }));   } });  <form enctype="multipart/form-data" action="" method="post">   Please upload your menu.

     <input name="file[]" type="file" id="file" />

    <input type="button" id="add_more" class="btn" value="Add More Menu" /> </form>

I want to put two <div>s next to each other. The right <div> is about 200px; and the left <div> must fill up the rest of the screen width? How can I do this?


Let $f(x)\in\mathbf Q[x]$ and let $K$ be the splitting field of $f(x)$. How is the discriminant of $K$ (as a number field) related to the discriminant of $f(x)$? Are they divisible by the same primes? Does one divide the other?

Let $f\in\mathbb{Z}[x]$ be monic and irreducible, let $K=$ splitting field of $f$ over $\mathbb{Q}$. What can we say about the relationship between $disc(f)$ and $\Delta_K$? I seem to remember that one differs from the other by a multiple of a square, but I don't know which is which. On a more philosophical note: why are these quantities related at all? Is there an explanation for why they can be different, i.e. some information that one keeps track of that the other doesn't?


Let $n$ be a positive natural number, $n\ge 2$. Then $\displaystyle\sum_{k=1}^n \frac{1}{k^2} \lt 2 - \frac{1}{n}.$   The basis step was easy but could someone give me a hint in the right direction as to how to do the induction step?  I tried this:  $\displaystyle\sum_{k=1}^k \frac{1}{k^2} + \frac{1}{(k + 1)^2} \lt 2 - \frac{1}{k + 1}$  But it's getting me nowhere or I am doing something wrong. I am no expert so a clear explanation would be appreciated. Thanks.

Prove that for $n\geq 2, \: \sum_{k = 1}^{n} \frac{1}{k^{2}} < 2 - \frac{1}{n} $  I used induction and I compared the LHS and the RHS but I'm getting an incorrect inequality


We know that speed of physical object cant exceed speed of light, a body cant be cooler than 0k, thus does there exist a limit to hotness of an object?

If temperature makes particles vibrate faster, and movement is limited by the speed of light, then I would assume that temperature must be limited as well. Why is there no limit?


Consider .  I've left a comment, but I have misspelled a word: complement. I'm always doing that. But I'm a proud cat who likes to regard themselves as a linchpin for literacy.  Ideally I'd like to edit my comment and make the correction, but I can't do that due to the editing rule of 5 minutes for a comment. I understand that's a good rule most of the time.  So ideally I'd ask a moderator to edit it. The only problem being that I can't flag my own comment.  Besides my attending a spelling lesson, does anyone have any thoughts on how we could support this? I think my comment is valuable, so I don't want to remove it. Of course, I could delete and reinsert the comment with the correct spelling, but sometimes that can compromise the comment flow.

This might sound strange, but at a few occasions I've felt the need to be able to flag my own comments. I give you :  Do you mention anything I didn't mention in my answer? Perhaps V2C? I have no idea what that means, and meta search doesn't show up anything. – Steven Jeuris Oct 1 '11 at 14:42 You're feeling very negative today, it seems. – Donal Fellows Oct 1 '11 at 19:36  Clearly I was in a bad mood when I wrote that, and I should have expressed myself better. I'm human, that can happen. I now feel it would be better for both those comments to be deleted. My current options  Delete my own comment and flag the other: deleting my own context would remove the context for the moderator. I imagine it makes moderating the flag more difficult. Delete my own comment and apologize in a new one (no flags): the comment thread gets broken. Leave it as is: I don't see how leaving those comments around is helpful at all. Add a new comment: This would lengthen an unnecessary comment thread.  What I want to do  Flag my own comment. Optionally after the comments were removed, and I see merit in the argument I was raising, mentioning it in a more polite way.


I'm developing a Java application using Apache HttpComponents. I downloaded the "5.0.zip" from  today and then added it as user library to my classpath in Eclipse. Everything is working fine.  However, when I compile the Application and try to use it outside of Eclipse, I get the following error message:  Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hc/core5/http/ParseException         at java.lang.Class.getDeclaredMethods0(Native Method)         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)         at java.lang.Class.privateGetMethodRecursive(Unknown Source)         at java.lang.Class.getMethod0(Unknown Source)         at java.lang.Class.getMethod(Unknown Source)         at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)         at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.hc.core5.http.ParseException         at java.net.URLClassLoader.findClass(Unknown Source)         at java.lang.ClassLoader.loadClass(Unknown Source)         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)         at java.lang.ClassLoader.loadClass(Unknown Source)         ... 7 more   I really don't know what causes this or how I can fix it...help is greatly appreciated!

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


I am doing  problem in Leetcode.  The original code is:  /**  * // This is the interface that allows for creating nested lists.  * // You should not implement it, or speculate about its implementation  * public interface NestedInteger {  *  *     // @return true if this NestedInteger holds a single integer, rather than a nested list.  *     public boolean isInteger();  *  *     // @return the single integer that this NestedInteger holds, if it holds a single integer  *     // Return null if this NestedInteger holds a nested list  *     public Integer getInteger();  *  *     // @return the nested list that this NestedInteger holds, if it holds a nested list  *     // Return null if this NestedInteger holds a single integer  *     public List<NestedInteger> getList();  * }  */ public class NestedIterator implements Iterator<Integer> {      public NestedIterator(List<NestedInteger> nestedList) {      }      @Override     public Integer next() {      }      @Override     public boolean hasNext() {      } }  /**  * Your NestedIterator object will be instantiated and called as such:  * NestedIterator i = new NestedIterator(nestedList);  * while (i.hasNext()) v[f()] = i.next();  */   I realize that NestedIterator constructor use a list of interface as parameter. I feel confused why it doesn't implement the interface somewhere, but use it directly in list. I thought we shouldn't use interface directly. Thanks!

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


I have started working on differential geometry very recently. I am little bit familiar with mathematical concepts such as manifolds, differential forms and associated concepts. As I was speeding through I caught interest in Lie groups and whose invaluable connection with the symmetries. I would be happy if anybody answers to these few questions.   I want to know what is a symmetry from the mathematical point of view?  How are $su2$, $su3$, and other symmetries first formulated?  What was the motivation?  How do we identify internal symmetries and corresponding conserved physical quantities?

How are  precisely defined?  In basic physics courses it is usual to see arguments on symmetry to derive some equations. This, however, is done in a kind of sloppy way: "we are calculating the electric field on a semicircle wire on the top half plane on the origin. Since it is symmetric, the horizontal components of the field cancel and we are left with the vertical component only".  Arguments like that are seem a lot. Now I'm seeing Susskinds Theoretical Minimum courses and he defines a symmetry like that: "a symmetry is a change of coordinates that lefts the Lagrangian unchanged". So if the lagrangian of a system is invariant under a change of coordinates, that change is a symmetry.  I've also heard talking about groups to talk about symmetries in physics. I've studied some group theory until now, but I can't see how groups can relate to this notion of symmetry Susskind talks about, nor the sloppy version of the basic courses.  So, how all those ideas fit together? How symmetry is precisely defined for a physicist?


I really love the "Hot Network Questions" (HNQ) as I love to look at what other communities do; in german I would say "Ich liebe es, über den Tellerrand zu schauen" (Love looking beyond my own's backyard?)   However: Most of the time, I discover hot questions while loading another site (i.e. when I am forced to look around), and this imposes problems and makes the feature almost unusable for me. This is my typical workflow for HNQ-usage:   Grasp topic "How to foo the bar" Done or Clicking some link leading me to further details about Frob This is the moment I have a quick glance on the HNQ   I see some interesting "What's a John?" from a foreign field Doe D'Oh Whoosh, the page load completes and I think "Oh noes, but I was interested in "What's a John?" go-back-one-page "Oh no, it's gone." "Ah I know, search for the topic using the search-box" Argh, this ain't work. I don't find it. Let's hope it pops up again    My proposal now is (sorry if I miss the proper terminology):  Make the HNQ permament w.r.t. the history, i.e. when you click go-back/forward, it should show the same questions from when you initially loaded this entry in the history    edit: A dupe was proposed. However, it talks about page-reload. I think randomization is okay upon reload and loading a new instance; changing contents is what we reload for. I really look for staticness w.r.t. to a single "page-instance", when navigating forward and backward again.

Whenever I refresh Stack Exchange sites or go to a question, the Hot Network Question list items are re-listed or re-ordered, quite dramatically it seems.  This seems like a .  It's actually a bit maddening to me to see the list change so frequently (or clearly I am refreshing too often or looking at it too much :-).  I understand the need to keep the list updated, but can the items in the list hold their positions a little more consistently?  The hot items can't be changing that fast.


I want to add a diagonal separating line in a title box of a tabular, but the line doesn't appear (I draw it in red on the picture)  \begin{center}   \begin{tabular}{|l|*{2}{c|}}       \hline       \backslashbox{Mounth}{Year}&2015&2016 \\       \hline       Mai&2560&3610 \\       \hline       June&1465&2985 \\       \hline   \end{tabular} \end{center}

I need this table:    (each row and column should have the same height and length, last cell should be divided by diagonal line). I tried the following code:  \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage{array} \usepackage{makecell} \newcolumntype{x}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} \begin{document} \setlength{\extrarowheight}{0.1cm} \begin{tabular}{|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|x{0.5cm}|}\hline &&&&20\\ \hline &&&&30\\ \hline &&&&45\\ \hline 15&12&18&50&\diaghead(-3,2){\hskip \hsize}{$a_i$}{$b_j$}\\ \hline \end{tabular} \end{document}   but text in the last cell is displayed incorrectly and cells are not the same.     How can I change that?


As shown in the picture, I have a plane, and would like to set it transparent, while remaining the shadow for the cube. I want to do this for video motion tracking. How can I do this?  Thanks!!

I have a picture of a room including the floor and I want it to look like there is, for example, a cube going through the floor. Is there a way to do this, maybe by making it go through a plane that is transparent to the photograph but not to the cube?  If anyone knows how to do this, as I'm not very good at doing things from text, would you be able to explain with pictures or something? Is there is a tutorial for this sort of thing?


If $a\in  \mathbb{C}$ with $\vert a \vert <1$ , then the value of  $$ \frac{1-\vert a \vert^2}{\pi} \int_{\gamma} \frac{\vert dz \vert}{\vert z+a \vert^2} $$  where $\gamma$ is the simple closed curve with $\vert z \vert=1$, taken with the positive orientation.  I tried but I cant manipulate the denominator, I used $z \bar z =\vert z \vert^2$, Please help.

How to solve complex integration $\frac{1-|a|^{2}}{\pi}\int_{L}\frac{|dz|}{{|z+a|}^{2}}$, where $L$ is the simple closed curve $|z|=1$ and $a\in\mathbb{C}$ with $|a|<1.$ $z=e^{it}$ is the parametrization of the circle $|z|=1.$If we put values it becomes as $\frac{1-|a|^{2}}{\pi}\int_{0}^{\pi}\frac{|dt|}{{|e^{it}+a|}^{2}}$. Now i don't know to proceed further. Please help. Thanks a lot.


I very well understand the Diffie-Hellman key exchange method, at least I think I do. And I was trying to implement it to try it out.  I went and calculated a very large prime number $p$ about 400 digits long. And i set $g$ to 5.  I generated a random secret number $a$, for example: 42523434.  The problem I'm facing is when I calculate $g^a \bmod p$, $g^a$ in particular, it seems to take my computer forever to calculate it, so it seems to be impractical to give $a$ such a number so I went for a smaller number (a five digit number) which takes about a second or two to calculate.  So now we have $A \equiv g^a \pmod p$, with the eavesdropper knowing $g$, $p$, and $A$.  But wouldn't it be possible to brute force $a$ by trying all 100000 combinations until what he calculates matches $A$ which would take him that long if he is good at computing powers? A solution to this would be increasing $a$ but increasing $a$ would make the exchange take so long that it wouldn't be a good method to exchange the keys.


I couldn't seem to find anyone asking a question like this anywhere, so I figured I'd start here. The sentence in question is      "A dolphin sleeps with half its brain awake so it can remain aware of   its underwater environment."   My question is would it be more grammatically correct to say "half of its" or is "half its" just as valid a way to write this sentence as "half of its"? Whatever the answer, is there anyone that may have a rule or some form of logical explanation as to why that answer is correct?   I appreciate any help that can be offered.

If I wanted to say that someone finished in 30 minutes when they had one hour to complete a given task, should I say "he did it in half the time" or "he did it in half of the time"?


I would like to upgrade from 20.10 to 21.04. But do-release-upgrade returns "no new release found". /etc/update-manager/release-upgrades: Prompt=normal $cat /etc/lsb-release  DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.10 DISTRIB_CODENAME=groovy DISTRIB_DESCRIPTION="Ubuntu 20.10"  I executed following steps:  sudo apt update sudo apt upgrade sudo apt dist-upgrade sudo apt autoremove sudo do-release-upgrade  but last steps returns "no new release found". Do you have any hints what to check next?

Today is the release of Ubuntu 21.04 (Hirsute Hippo). And I can't update to this version. And also I selected ‘Notify me of a new Ubuntu version’ and changed it to ‘For any new version' on the Updates tab on Software & Update, but it's still not working. In addition, in the terminal, I've written: sudo do-release-upgrade -c  And output was: Checking for a new Ubuntu release No new release found.  What should I do?


Let's say there is a room that has the shape of a cube with all the walls, roof and ground made of mirrors, it is all mirrors and theoretically we managed to have light in there without a source. (Because if there isn't light, nothing is gonna be visible, and if there is a source it would just be repeated in the mirrors.)  And somehow we manage to look inside the box. What would we see inside the room?

I have very little background in physics, so I apologize if this question is painfully naive.  Consider the following thought experiment: an observer is in a closed room whose walls, floor, and ceiling are made entirely of mirrors, with a single light source in the middle of the room. When the light is on, the observer can see many copies of his reflection all over the place.  Suddenly, the light source turns itself off. Intuitively, I would expect the observer to "instantly" see darkness. However, I can't figure out why that is the case under the "particle" interpretation of light. There are obviously lots of photons already in the room from before. Furthermore, we know that they don't get "consumed" when they hit a wall, because otherwise the observer wouldn't see so many reflections of himself. Basically, when the light goes off, what happens to the photons already in the room?  I suspect the answer goes something like this: the photons in the room lose a little bit of energy every time they bounce off a mirror, but it's so minuscule that we can still see more reflections than our eye can resolve anyway. When the light goes off, however, it takes them a very small fraction of a second to bounce around the room enough times to diffuse completely, which our eye cannot detect.  Is that about right? If we had a theoretical "perfect reflector", would the light remain trapped in the room forever? If we had instruments that could measure such things very finely, would it take (slightly) longer for the light to go out in a room made of mirrors as opposed to a room made of, say, black cloth?


I was working on an analysis problem when this question arose in one my proofs. I think it may be either $-1$ or $1$, but it seems like there can only be an arbitrary way to assign this.  So is there an agreed upon method for determining $(-1)^x$ for irrational values of $x$?

The way that I was taught it in 8th grade algebra, a number raised to a fractional exponent, i.e. $a^\frac x y$ is equivalent to the denominatorth root of the number raised to the numerator, i.e. $\sqrt[y]{a^x}$. So what happens when you raise a number to an irrational number? Obviously it is not so simple to break it down like above. Does an irrational exponent still have a well formed meaning?  The only example that comes to mind is Euler's identity, but that seems likes a pretty exceptional case. What about in general?


I am new to Java and am learning class keywords. I have been given limited examples, but I am trying to understand the reasons why you would use an instance object over extending an object. In the tutorials I have seen there is a book class and a magazine is an instance of book. But if the class is abstract then you cannot have an instance only an extension. Why would I use extension over an instance and vice versa? Can anyone provide an example of when it would be better to use one over the other?

Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?


I have to take a list (loads) of IP addresses in this format:   134.27.128.0  111.245.48.0  109.21.244.0   and turn them into this format with a pipe in-between (IPs made up)  134.27.128.0 | 111.245.48.0 | 109.21.244.0 | 103.22.200.0/22   I think it is a find and replace command like sed but I can't get it to work.


So, you'd think that the "First Four" teams would be considered the worst teams in the NCAA Tournament. They have to play themselves into the bracket a couple days before the real tourney starts.  But the teams aren't all vying for a 16 seed, as you might imagine. Why not? Did the NCAA committee decide beforehand that it would make the play-in games for two 16 seeds, a 12 seed, and an 11 seed? Or did it decide the seeding after picking the teams?  Either way, it seems unfair. What gives?

In the "field of 65" style tournament bracket, there were two 16-seeds (presumably the weakest teams) that had a play-in game in order to play the overall #1 seed.  When they expanded to 68, it's now 4 play-in games between 16-16 seeds, 13-13 seeds, 11-11 seeds and 16-16 seeds.  Why didn't they just do it between all 16 seeds?  Was there specific reasoning?  Is it the same seeds in each region every year or is there a mechanism for selecting which teams will play in Round 1.    (I know it can  be debated that playing in such a game can be a good warm-up for lower seeds, but I don't think that was the official reason.)


Is it possible to find a place where the default package in Ubuntu releases are? By default, I mean all the packages installed when you install Ubuntu.

I am developing an offline installer for all versions of Ubuntu, and I need Ubuntu's default installed packages list. Is there a way to get this information from any server (web server)? Any script to fetch any Ubuntu version's default installed packages list.  I will give the Ubuntu version, and the script will fetch the packages list.  Note: I need at least a server address. I can write a script for this.


I am running the macros using VB scripts from Excel file using below code Set xl = CreateObject("Excel.Application") 'Set xl.Visible = False   'Set xl.DisplayAlerts = False   Set wb = xl.Workbooks.Open("E:\Excel\TempDir\NewFile1.xls",,TRUE)  xl.Application.   xl.Application.Run "'E:\Excel\TempDir\NewFile1.xls'!GetId"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!GetType"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!GetArea"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!GetInt"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!GetSubArea"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!PickParent"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!GenerateIds"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!Load"  xl.Application.Run "'E:\Excel\TempDir\NewFile.xls'!RefToLibrary"   xl.DisplayAlerts = False   xl.Application.Quit   Set xl=Nothing  Using vb script I am able to run multiple macros, but how to skip particular macro if it is not present in Excel file dynamically. Thank You in advance.

I want to use VBScript to catch errors and log them (ie on error "log something") then resume the next line of the script.  For example,   On Error Resume Next 'Do Step 1 'Do Step 2 'Do Step 3   When an error occurs on step 1, I want it to log that error (or perform other custom functions with it) then resume at step 2. Is this possible? and how can I implement it?  EDIT: Can I do something like this?   On Error Resume myErrCatch 'Do step 1 'Do step 2 'Do step 3  myErrCatch: 'log error Resume Next


I am trying to store form data into database using mysqli but it is generating query error my code is given below.... When ever I try to submit the database connection is generating.. the $_POST is working perfectly.. the error only generating by mysqli_query..  <?php  $name = $_POST["firstname"] . " " . $_POST["lastname"]; $email = $_POST["email"]; $happen = $_POST["whendidhappen"]; $howlong = $_POST["howlong"]; $howmany = $_POST["howmany"]; $describe = $_POST["describe"]; $whattheydid= $_POST["whattheydid"]; $seenmycat = $_POST["seenmycat"]; $anythingelse = $_POST["anythingelse"];   $dbc = mysqli_connect('localhost','root','','abductionreport')  or die('Database connection error');   $query = "INSERT INTO abductionform (firstname, lastname, email,whendidhappen, howlong, describe, whattheydid, seenmycat,anythingelse)VALUES('$name','$name','$email','$happen','$howlong', '$howmany','$describe','$whattheydid', '$seenmycat','$anythingelse')";    $result = mysqli_query($dbc,$query) or die ("Query Error");  mysqli_close($dbc);     ?>
Aliens Abducted Me - Report an Abduction

Thanks for Submiting the form.
 <?php  echo "$name it happend to you on $happen it take $howlong
"; echo "Number of aliens: $howmany
"; echo "Describe: $describe
"; echo "What they did to you: $whattheydid
"; echo "Have you seen my cat: $seenmycat
"; echo "Anything else : $anythingelse
"; echo "Your Email Address is : $email
";  ?>

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


The  $\nu$ is always less than $0.5$.  A traction force ($\Delta L >0$) can cause an increase in volume, while a compression force ($\Delta L <0$) can only decrease the volume.  $$\Delta V \approx V \frac{\Delta L}{L}(1-2\nu)$$  I'm totally ok with these facts but I don't understand which one follows the other.  Is $\nu<0.5$ a consequence of an empirical observation that $\Delta V<0$ with traction, or viceversa?

For an isotropic solid, Poisson's ratio can be expressed in terms of stiffness constants as:  $$\sigma = \frac{c_{11} - 2c_{44}}{2c_{11} - 2c_{44}}$$  Alternatively we may express Poisson's ratio in terms of the Lamé constants $\lambda$, $\mu$ where $\lambda = c_{12}$ and $\mu = c_{44}$.  For an isotropic solid, we have $c_{12} = c_{11} - 2c_{44}$.  When we solve this algebraically we get:  $$\sigma = \frac{\lambda}{2(\lambda + \mu)}$$   I am supposed to show that $\sigma$ must lie between $-1$ and $+\frac{1}{2}$.  I figure that by setting $\mu=0$, it follows from the last expression of $\sigma$ that we get the value $\frac{1}{2}$.  However, I can't see how to show that the lower bound must be $-1$.  I've tried fidgeting around with the expressions and letting them go towards $0$ or $\infty$, but I still don't get the $-1$ value.  If anyone can help me out here, I would greatly appreciate it!


$$ \begin{array} { l } { \text { In how many ways can one pick } n \text { marbles from } 3 n \text { marbles consisting of } n \text { indistinguishable } } \\ { \text { white marbles, } n \text { indistinguishable black marbles and } n \text { distinguishable coloured marbles. } } \\ { \text { Your solution should contain a precise explanation of your reasoning. } } \end{array} $$  I have tried to attempt this from working from the number of ways if they were all distinguishable and then minus-ing any repeats, but I am quite stuck.

The question I am stuck on is 'how many ways can I choose $n$ balls from $3n$ balls, with $n$ indistinguishable black balls, $n$ indistinguishable white balls, and $n$ distinguishable coloured balls.'   I have been thinking about this problem for some time but can't get very far, I am used to questions about just distinguishable or indistinguishable objects, but I am not familiar with a problem involving both.  I think that there are $n+2$ 'colours' where within the colours all the balls are indistinguishable, but I don't really know where to go from there so any hints would be much appreciated.


I have an Indian passport and a Canadian PR card. I am travelling back to Canada from India with stopovers in Frankfurt and London. Do I need a transit visa for this?  Thanks.

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


When you post a link from Stack Exchange into the chatbox using HTTPS, the link does not onebox. However, if you change the link to HTTP, it works. See the screenshot below:    HTTPS URLs should onebox, too.

When I paste a link like  on chat, it promptly oneboxes the comic. However if I post the HTTPS version of that  it doesn't. This is true for all other oneboxable links from sites that let you access through HTTPS like YouTube.  Can we get HTTPS links oneboxed as well?


I am trying to access the getrownum() from the main method, however NullPointerException is thrown.  Main class:  public class MainDriveScenario {      public static void main(String args[]) throws Exception {         ExcelUtils.setExcelFile(Constant.Path_TestData + Constant.File_TestCaseExecSheet, Constant.Sheet1_TestCaseExecSheet);          int rownum = ExcelUtils.getrownum(Constant.Sheet1_TestCaseExecSheet);          for (int i = 1; i < rownum + 1; i++) {             String exec = ExcelUtils.getCellData(i, 2);             System.out.println(exec);             String testcaseID = ExcelUtils.getCellData(i, 0);             System.out.println(testcaseID);          }     }  }   ExcelUtil class:   public class ExcelUtils {      public static void setExcelFile(String Path,String SheetName) throws Exception {              try {                  // Open the Excel file              FileInputStream ExcelFile = new FileInputStream(Path);              // Access the required test data sheet              ExcelWBook = new XSSFWorkbook(ExcelFile);              ExcelWSheet = ExcelWBook.getSheet(SheetName);              } catch (Exception e){                  throw (e);              }      }  public static int getrownum(String Sheetname) {             int rownum = ExcelWSheet.getLastRowNum();             return rownum;         }     }

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


i've been looking at switches and have noticed a few of them only note their voltage / current ratings for AC but dont mention DC ratings at all. Is there a reason to this and if so is there a equation/ general rule to get an idea of its DC limitations ? Example a (dc rating)  Example b (ac and dc)

I'm trying to purchase several switches for a DC system with moderately low current (a few amps at 12V). When browsing for switches in parts catalogs (e.g.  and ) there are always separate voltage ratings for AC and DC applications. I understand that AC switches are less expensive because the switching time does not need to be as fast and arcing is less of a concern. There is only one current rating listed and I am not sure if it applies to AC switching, DC switching, or both.  Does this current rating apply to both the rated AC and DC voltages? Is there a good rule-of-thumb for converting between AC and DC voltage/current ratings? What is the highest current I could reasonably expect from a DC switch before moving to a relay?


This is for French Schengen visa appointment in San Francisco.  I read one relevant  but it states you can't change  travel dates online in your application, which is what I am aware of; there's no option to do that online. The only way to do it is cancel current application and rebook appointment. But is it OK to mention it during the interview/ Give them new application form with correct dates? Will they deny visa because now our plans are no longer fixed?

I filled out a form early November to get a Swiss visa (applying in Singapore but not Singaporean) with my travel dates as 19.12.2017 to 02.01.2018. The first available appointment was on the 1st of December and I took it. During the time in between, my travel dates changed to one week later (both arrival and departure). Now, my travel itinerary and supporting documents all have different dates from the dates on the form. What do I do?  I can fill out a new form with the right dates without paying any fees but the online ID on that form will be different.   As mentioned in the comments, I haven't got my visa yet - the interview is tomorrow.


I know that it is possible to purchase domain from one company and web-hosting from other, but I have never done that yet. Its first time I am doing it so I want to do it in correct way.   I have domain registered within company A. And I have now purchased web-hosting from company B. From my understanding all I have to set are domain name servers for my domain in company A pointing to DNS servers of company B.  But how the company B knows that I am real owner of this domain. What If someone already purchased web-hosting for this domain in company B. It means that I would not be able then to purchase webhosting from this company for my domain? Or how does it work?

What will happen if more than one account on the same server is using the same domain? For instance in shared hosting, I have two user using the same domain name (Add-ons). Since this two accounts are on the same server, the domain is pointed to the same nameserver, will there be a conflict? and how to resolve this?


I have a DLINK DIR-651 and I'm wondering if it's possible to configure it so that one particular computer gets priority. In other words it gets more bandwidth. What would be the steps to take? I tried adding the computer to DMZ but speeds went way down. I don't care about security (through the router), the computer has it's own security software.

I have a "D-Link DIR-655 Extreme N" wireless router and an XBox 360 with the old-style wireless connection thing (usb attachment). I want to configure my router/network to give my XBox as much bandwidth as it wants, whenever it wants.   I have tried giving the XBox a unique IP (within my network) and then tweaking the router to treat that IP as a top priority application (using the router's QOS stuff). Problem is whenever I turn off the XBox, I can't connect to the network the next time I start it up. It seems the only reliable setting in the XBox is to use "Automatic" for the IP settings within the Network Configuration area.  Supposedly the D-Link ships with default settings that attempt to recognize a game console and give it top priority, but I've not seen good results (lots of stuttering/lag when someone else jumps online, etc).


The exceptions such as"foreign" and "weird" seem abnormal to me because most of the rest of the ie or ei words follow the i before e rule.  They don't have a "c". Why does that happen?

I almost hesitate to ask this, because it is hard to believe no one else asked it; but it isn't showing up in the "similar titles" list.  What is special about 'C' that switches the 'IE' immediately following it?


I am trying to parse text and determine if it contains only letters and numbers, not special keyboard symbols like ! and #. I tried using .isalpha, but it says ! and # are valid. Is there away I can have something return false if it encounters one of these symbols?

I know how to do this if I iterate through all of the characters in the string but I am looking for a more elegant method.


I need to programmatically find out exactly how much memory a given Java Object is occupying including the memory occupied by the objects that it is referencing.  I can generate a memory heap dump and analyse the results using a tool.  However it takes a considerable amount of time to generate a heap dump and for such a tool to read the dump to generate reports.  Given the fact that I will probably need to do this several times, my work would be a lot more agile if I could throw in some code in my project that would give me this value "runtime".  How could I best achieve this?  ps: Specifically I have a collection of objects of type javax.xml.transform.Templates

I have an application that reads a CSV file with piles of data rows.  I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemoryErrors.  Each row translates into an object.  Is there an easy way to find out the size of that object programmatically?  Is there a reference that defines how large primitive types and object references are for a VM?  Right now, I have code that says read up to 32,000 rows, but I'd also like to have code that says read as many rows as possible until I've used 32MB of memory.  Maybe that is a different question, but I'd still like to know.


We are given a circle with N randomly allocated points on it. Task is to find a chance that all N points lie on the one half of circle.  I have drafted some solution: 1. Since there are no way to put two points on circle, so that they were not on the same half-circle, $P_1$ and $P_2$ picked randomly and didn't affect the chance. So, required probability is: $P(P_3) \cdot P(P_4)\: \cdot ... \cdot P(P_n)$, where $P(P_i)$ is the chance that i-th point lays on the proper half of circle. 2. Let's visualize what's $P(P_3)$, $P(P_4)$ look like: Grey sector highlights forbidden part of circle. It's obvious from pictures, that $P(P_i)$ approaching 0.5 as point amount increases   For this specific example, we could write: $P(P_3) = 1 - \frac {\Delta(\theta_2,\theta_1)} {2\pi}$ $P(P_4) = 1 - \frac {\Delta(\theta_3,\theta_1)} {2\pi}$. 3. Then if we generalize, $P(P_i) = 1 - \frac {\Delta_i} {2\pi}$, where $\Delta_i$ is a difference of angles of the most distant points. And I'm understand that here I should introduce some generalized formula but I don't see it and don't want to make guesses. So I would appreciate any help.

Choose n points randomly from a circle, how to calculate the probability that all the points are in one semicircle? Any hint is appreciated.


Show that the product of any $m$ consecutive positive integers is divisible by $m!$.   Note that we have that $\frac{n!}{m!(n-m)!} \in \mathbb{Z}$ for $0 \leq m \leq n$.  $\require{cancel} \frac{n!}{m!(n-m)!} = \frac{n\cdot(n-1)\cdot\cdot\cdot(n-m+1)(n-m)!}{m!(n-m)!} = \frac{n\cdot(n-1)\cdot\cdot\cdot(n-m+1)\cancel{(n-m)!}}{m!\cancel{(n-m)!}} = \frac{n\cdot(n-1)\cdot\cdot\cdot(n-m+1)}{m!}$ where $n\cdot(n-1)\cdot\cdot\cdot(n-m+1)$ are $m$ consecutive integers divisible by $m!$  Of course, I'm using the fact that I know the combinations formula is an integer but given that, is the proof this simple? Or did I make an error here. Appreciate help!

How can we prove that the product of $n$ consecutive integers is divisible by $n$ factorial?     Note: In this  and the comments here the OP has clarified that he seeks a proof that "does not use the properties of binomial coefficients". Please post answers in said newer thread so that this incorrectly-posed question may be closed as a duplicate.


I've tried Ubuntu, Xubuntu, & Lubuntu. The latter two did not even make it to the install screen, however the former managed to install without a hitch. All were the latest versions. As stated in the title, I have a Gateway GT5228 with all the stock hardware, except for an extra hdd & disc drive. That's a dual core AMD Athlon X2 4200+ & a Nvidia GeForce 6100. Ubuntu makes it to the desktop and then freezes. I can't bring up the command window or anything, all I can do at that point is hold down the power button and try something else.   I'm curious if this is a common problem or if it's something with my computer. I can run windows 7 Ultimate 64 bit just fine & Win 8 & Win xp. Any info would be appreciated, I haven't found much on my specific model having problems with Ubuntu.  thanks!

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I had that some days ago (I removed the tags then), now I see that from someone else:  4th comment to the question.

I would like to use the <kbd> tag in a comment to refer to a keyboard shortcut. Is there a reason why this doesn't seem to be possible? I've tried it at the webapps stackexchange.


I have a shell script that loads all the variables, and then reads a file and I would like the nested input line expanded. I've tried various way with eval, etc and I can't seem to get any of them to work. In my example I've hard coded the variables.   #!/bin/bash #source job.properties file="workflow.xml" user="svc" edge_node_host="google.com" while IFS=: read -r line do     echo ${!line} done < $file   The input file workflow.xml contains the following:  <host>${user}@${edge_node_host}</host>   I would like the echo to output:  <host>svc@google.com</host>

I want to pipe the output of a "template" file into MySQL, the file having variables like ${dbName} interspersed. What is the command line utility to replace these instances and dump the output to standard output?


I have Ubuntu 10.04. I have converted image through terminal using the following command:  convert myfigure.png myfigure.jpg   But I want to resize the height and width of the converted image. Is there any way to do this?

I would like to know how to resize images in Ubuntu. What is the easiest tool to do so?


Does there exist an infinite sequence of positive integers $a_1, a_2, a_3, . . .$ such that $a_m$ and $a_n$ are coprime if and only if $|m - n| = 1$? My Progress:This is a very beautiful problem ! I think I have got a construction , but I am not able to  have/define the explicit formula for the nth term. Here is the construction, Let $a_1=2\cdot 3$, $a_2=5\cdot 7$, $a_3=2\cdot 11$, $a_4=3\cdot 5 \cdot 13$, $a_5=2\cdot 7\cdot 17$ , $a_6=3\cdot 5 \cdot 11 \cdot 19$ , $a_7=2\cdot7\cdot13\cdot23$,  $a_8=3\cdot5\cdot11\cdot17\cdot29$ , $a_9=2\cdot7\cdot13\cdot 19 \cdot 31$ and so on . I am trying to find some patterns, but I am not able to observe anything. So what I am doing is, for the construction of $a_n$ term, I look at $a_{n-1}$ ,then I start from $a_1$ and then try to put a factor $p$  of $a_1$ in $a_n$ such that gcd ($a_{n-1},p$)=$1$ . Similarly for $a_2$, $a_3$, and so on. At the end I add another prime which was not used in any of the $a_i$'s. Also we have to make sure that no ${a_i} \mid a_j$ for $i<j$ Also note that I am only using primes . Sorry, if something is not clear. Hope one can provide me some hints and guide. Thanks in advance.

$\textbf{Question:}$Does there exist an infinite sequence of integers $a_1, a_2, . . . $ such that $gcd(a_m, a_n) = 1 $ if and only if $|m - n| = 1$? $\textbf{My solution:}$Suppose we have a $n$ element sequence that satisfies the condition.say $a_1,\cdots,a_n$. Now take $n-1$ distinct primes that divides none of the elements of this sequence.call the primes $p_1,\cdots,p_{n-1}$ Then the sequence $a_1p_1,\cdots,a_{n-1}p_{n-1},a_n$ also satisfies the condition. Now,simply take $a_{n+1}=p_1....p_{n-1}$. Then $a_1p_1,\cdots,a_{n-1}p_{n-1},a_n,a_{n+1}$ satisfies the condition.Hence,we can always increase the size of the sequence. In addition $a,b$ with $(a,b)=1$ is a two element sequence that satisfies the condition.Hence we can form an infinite sequence that satisfies the given conditions. If there is any flaw in my argument do tell me.


I can't cut files on Mac OSX 10.9 Mavericks after upgrade. I can only copy and delete them. Why? How can I fix this?

I'm a newbie on the Mac world and I'd like to know if it's possible to cut a file using a shortcut (like Ctrl+X on Windows).


How would I go about dual booting Windows 10 and Ubuntu, the windows drive is on an ssd as my c drive and my s drive is a hdd that I want to use for Linux. I have no idea what I need to download it or anything.

I'd like to see the full How-To on how to use manual partitioning during Ubuntu installation. The existing guides (at least those I found here) cover only automatic part and leave untouched the manual part (or extremely short and contain no pictures).  I'd like to cover such situations:     If your disk contains other systems:


I am attempting to use custom bokeh for an effect in which words appear in out of focus lights. After many experimentations i still can't manage to get it to work, i believe this is largely because of my aperture?  I would be so grateful for some advice as this would look great in a film I'm making.

Custom bokeh shapes need a large aperture. The max aperture my lens can reach is f3.5. Is it big enough for a custom bokeh? I tried but it doesn't work.


I've been playing Magic 2015 and I noticed an interaction I didn't expect.  I had a  out and cast , sacrificing the Pyromancer. The game triggered Young Pyromancer's effect and put a token onto the battlefield.  I don't understand this. Since the sacrifice is part of the cost of Fling, shouldn't the Pyromancer already be in the graveyard before Fling reaches the state of "having been cast", meaning that the token shouldn't exist?  Is there something I'm missing, or is it a bug in the game?

Will "When/Whenever Foo" trigger if the source is sacrificed to pay a cost for Foo?  Examples  If I activate 's ability and sacrifice , will Kurkesh trigger, allowing me to copy Birthing Pod's ability?  If I cast  and sacrifice  to pay for the cost, will Basilica Screecher trigger, allowing me to extort?


I have two dictionaries that I want the union of so that each value from the first dictionary is kept and all the key:value pairs from the second dictionary is added to the new dictionary, without overriding the old entries.  dict1 = {'1': 1, '2': 1, '3': 1, '4': 1} dict2 = {'1': 3, '5': 0, '6': 0, '7': 0}   where the function dictUnion(dict1, dict2) returns  {'1': 1, '2': 1, '3': 1, '4': 1, '5': 0, '6': 0, '7': 0}   I can, and have done it by using simple loops, this is pretty slow though when operating on large dictionaries.  A faster more "pythonic" way would be appreciated

I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged (i.e. taking the union).  The update() method would be what I need, if it returned its result instead of modifying a dictionary in-place. >>> x = {'a': 1, 'b': 2} >>> y = {'b': 10, 'c': 11} >>> z = x.update(y) >>> print(z) None >>> x {'a': 1, 'b': 10, 'c': 11}  How can I get that final merged dictionary in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.)


New to HTML. I have this code in css  h1 {text-align: center; background: white; }   I wanted to make a white background only on my text, but the color is from the one end of the page to the other. I want the background to be same width as my text. Any advices ?

I have a layout similar to:  <div>     <table>     </table> </div>   I would like for the div to only expand to as wide as my table becomes.


I have a question which is pretty basic about basis and verctor spaces.  Generally, if I have a basis K of vector space V, Why it is not a basis of a subspace W of V (real subspace)?  The vectors in basis K are linearily independent and for every vector of W I can find a linear combination of the vectors in the basis K that equals to the vector in W.  The only problem I can see is that when i make some linear combinations of the vectors in basis K , I get vectors that belong to V but does not belong to the space W, is this the problem here? When I get vectors beyond my space that means it is not the proper basis , because it is spanning more vectors than my space? does it have to span exactly the group and not beyond? Thank you very much.  Sorry for my english and I don't know how to edit the question to be pleasant to read.

I don't understand why this statement is wrong:     $V$ is a vector space, and $W$ is a subspace of $V$. $K$ is a basis of $V$. We can manage to find a subset of $K$ that will be a basis of $W$.   Sorry if my English is bad... and if you can show me an example of something that contradicts it, it'd be great.


My question is very general, so I would like to narrow down what my confusion is about: I understand that the forces in a N3 pair act on opposite bodies, which means they cannot be added. I also understand how to solve the horse and cart problem when considering the horse and the cart to be one system, and thus ‘ignoring’ the internal forces, as they are not relevant in the overall acceleration of the system.  However, when I presented this knowledge to my Physics teacher, he said that although it was true, it didn’t answer the horse’s question. This is because in the story he told us about the horse and the cart problem, the horse doesn’t refer to any type of system that encapsulates both it and the cart. Instead, it asks “How can I pull this cart”.   I have thought extensively about this problem, and I keep coming up with the same problem. I will try to describe my reasoning below, so it is easy to pick up the mistakes I have made:  A horse exerts a ‘backwards’ force on the ground (H-G), and thus the ground exerts a ‘forwards’ force on the horse (G-H). The same thing (Although opposite) happens at the cart’s wheels: The carts wheels exert a ‘forwards’ force on the ground (W-G), and thus the ground exerts a ‘backwards’ force on the wheels of the cart (G-W). Now, if the horse and the cart were seen as a closed system, one could simply say that: “if (G-H) is greater in magnitude than (G-W) then the system will accelerate.  But, I would like to examine the horse, which is where my confusion lies. The forces at play here are: (H-C), the ‘forwards’ force on the cart, exerted by the horse. And, (C-H) the ‘backwards’ force on the horse, exerted by the cart.  This is my thought process: The force (G-H) moves (or, tries to move,) the horse forward. It is my understanding that this is the ‘source’ of force in the whole problem, because without it, none of the other forces would exist. Then, due to the fact that the horse is trying to move forward, the horse exerts a force (H-C), which tries to move the cart forward. I understand that these two forces are not a N3 pair, by I can’t help but think that they are directly linked. If the force (G-H) becomes greater, then it is my understanding that the force (H-C), will increase equally. Then, because (H-C) and (C-H) are a N3 pair, the force (C-H) will be equal in magnitude to (H-C), and thus also equal in magnitude to the force (G-H). Then, if I examine the forces acting on the horse, I see (C-H) acting ‘backwards’ and (G-H) acting ‘forwards’. I understand, by my previous logic, that these two forces are equal, and thus balance to give a resultant force of 0 on the horse, which thus can’t accelerate. I understand that I have some flaw in my reasoning, but I cannot seem to figure out what it is.

Given Newton's third law, why is there motion at all? Should not all forces even themselves out, so nothing moves at all? When I push a table using my finger, the table applies the same force onto my finger like my finger does on the table just with an opposing direction, nothing happens except that I feel the opposing force. But why can I push a box on a table by applying force ($F=ma$) on one side, obviously outbalancing the force the box has on my finger and at the same time outbalancing the friction the box has on the table? I obviously have the greater mass and acceleration as for example the matchbox on the table and thusly I can move it, but shouldn't the third law prevent that from even happening? Shouldn't the matchbox just accommodate to said force and applying the same force to me in opposing direction?


I have read a couple of answers on this topic, but they didn't helped me. I have light and camera, but the result of rendering is always black. Rendered 3D-view is OK, but in Material view my model is black. What shall I do?

I have a model which you can see here (camera perspective).    In the second image, you can see how the render turned out.    I'm at my wit's end trying to figure our why it's not showing up in the render. If anyone needs more information, just ask and I'll get it to you. I've already checked the normals and they're not the cause.


I'm 20 year old and I would like to start investing but honestly internet it's full of fake/misleading platform/resources.  My budget it's not very big, I would like to start with around 100 euros but I could raise my budget to less than 1000 euros and mine it's a long term goal. I have seen a lot of platform and way of investment, from the 'classic' stocks to real estate and other type of investment.   I would like to know which one is the best and if it's worth to start with this amount of money or you need at least 5000 euros or close to that, and what advice you would give me to start investing.

I am young, just started my career, and looking to begin investing so I can make my money work for me. I'm still living like I did in college (occasional purchase on myself, but most of it goes into savings) and I would like to take the extra money and invest it.   What would you suggest are the best options for me to begin? I was considering getting a personal investor [a financial advisor] for perhaps a year or so, but I've heard that they really are not worth the money. I wanted to get the input of the great minds here.


I first used a 3.5-inch hard disk drive (HDD) 20+ years ago.  And I took it for granted that 3.5" HDD should be 3.5" wide. Until today I realized that 3.5" HDD are in fact 4" wide.  What is the reason of naming those 4" HDD as 3.5" HDD?

I have some older IDE (parallel ATA) hard drives I want to check for files before tossing them out. I have found SATA/IDE to USB Adapters to use, but they specify 2.5" and 3.5" hard drive connections. My drives are all 4" X 5 3/4".   My question is, are they considered to be 3.5" and is this based on the internal disk size? I don’t want to buy something I can’t use.


I'm totally new at Ubuntu/Linux.  I've installed the server on an old Pentium 4 with 1gb of RAM. The problem is that the monitor (Samsung LED 3d TV through HDMI) gives the message this resolution isn't supported. So I can't see if everything is working. It should work at 800*600 at 32 bit 75 Hz. Can anyone help me to change the resolution at bootup.   For your information, U don't know how to get to a save mode, edit cfg files and so on. I've read a lot of the posts on this site, but I can't do anything with them.

I just updated from Ubuntu 10.10 to 11.04 and have an issue regarding the screen resolution. I have Intel integrated gfx chip and my monitor supports resolutions larger than 1024x768. (in 10.10 I've been using 1280x1024) But as soon as I upgraded, I'm stuck with 1024x768 resolution and seems I can't change it.  running xrandr In terminal yields the following results,   Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096 LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm    1280x800       58.1 +    1024x768       60.0*     800x600        60.3     56.2      640x480        59.9   VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm    1366x768       59.9 +    1360x768       60.0      1024x768       75.1     72.0     70.1     60.0*     832x624        74.6      800x600        72.2     75.0     60.3     56.2      640x480        72.8     75.0     66.7     60.0      720x400        70.1     1280x1024_60.00 (0xce)  109.0MHz         h: width  1280 start 1368 end 1496 total 1712 skew    0 clock   63.7KHz         v: height 1024 start 1027 end 1034 total 1063           clock   59.9Hz   What maybe the problem? Is it a bug? What kind of steps I should take in order to get a higher resolution? (changing xorg.conf maybe?) Any insight is highly appreciated. Thanks in advance.   UPDATE    Screenshot after running xrandr --addmode VGA1 1360x768  As you can see, side bar is not completely visible and Ubuntu logo at the task bar is missing. Also when you open an application, the Task bar of the application (where it should go to the top panel) is missing as well..


I have a laptop which performs a task scheduled by Windows task scheduler every 30 min. It is running in the background in the "hidden" mode. It takes about 2-3 min for task to finish. If I then prompt to shutdown or hibernate while the task is running, is it possible to make it so that Windows waits before the task's full completion?

I have an indefinitely running scheduled task that repeats every now and then and runs for few minutes. What happens when this task is running and I click restart or shutdown computer? Will Windows let it finish first before shutdown or will Windows kill the task and then shutdown? Is there a way to change the behavior?  I need to ensure that Windows lets the task to finish before shutting down and I couldn't find information about this. If Windows lets it finish the tasks I'm happy with that but if the Windows kills or aborts my task, I would like to know if there is an automatic Windows way to make Windows wait or is the only way to first stop the tasks manually and then shutdown.


A class from a subpackage needs to access a class from a package one level up. So, I need to keep the target class as public. But I don't want that class to be accessed by any other class. What can I do?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


When I type  aptitude dist-upgrade   I get for example:  Reading package lists... Done Building dependency tree        Reading state information... Done Reading extended state information       Initializing package states... Done The following NEW packages will be installed:   bc{a} linux-image-2.6.32-24-virtual linux-image-2.6.32-308-ec2  The following packages will be upgraded:   apt apt-transport-https apt-utils base-files bijk-node binutils cloud-init grub-common grub-pc icedtea-6-jre-cacao ifupdown landscape-client landscape-common    libfreetype6 libfreetype6-dev libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libldap-2.4-2 libmysqlclient16 libpcsclite1 libsmbclient libudev0    libusb-0.1-4 libwbclient0 libwww-perl lintian linux-ec2 linux-image-ec2 linux-image-virtual linux-libc-dev linux-virtual mountall mysql-client-5.1    mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib python-apt    python-lazr.restfulclient sudo tzdata tzdata-java udev update-manager-core upstart ureadahead w3m wget  54 packages upgraded, 3 newly installed, 0 to remove and 2 not upgraded. Need to get 103MB of archives. After unpacking 89.4MB will be used. Do you want to continue? [Y/n/?]   What I would like to know is what changed in each upgrade candidate. Is there a way I can see a list of all the changes in those packages?  I know I can do  aptitude changelog mysql-server   And I could probably grep & awk the candidates and pipe them to the changelog command, but executing that takes a long time.  Is there a better way to get a full changelog of a dist-upgrade?

describes how to get the changelog for a given package. However, it's the whole changelog.  What I'd like is a way to see what will be changed in whatever I'm about to upgrade. For example, I was imagining something like:  $ sudo apt-get upgrade --show-changelogs Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done The following packages will be upgraded:   foo     -- adds the bar feature for better snazziness     -- removes the deprecated baz feature  1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 8,864 kB of archives. After this operation, 285 kB disk space will be freed. Do you want to continue [Y/n]?    Unfortunately, I don't see anything like that in the man pages for apt-get. Does this or something similar exist?  UPDATE: I've written a  talking about apt-listchanges and Debian changelogs in a little more depth that incorporates some of the feedback in this question.


We have the students logging in under their own accounts. however, they are not set up as administrators. However, this one application requires admin to run.  Is there a way to run only this application as admin without having to type in the password?

How can I enable non-admin users to run a certain application (in my case, a script) with admin permissions on Windows XP?  This would be similar to the setuid bit on *nix.


So I have a bit of an issue. I accidentally chown'd everything to my user, recursively.   sudo chown -R me:me /*   I meant to only do this to one directory which I thought I was in.  I cancelled it very quickly (3 seconds?) and I'm not sure how much damage I caused, but what I do know is that I can't use the system properly anymore.  Here's an image of who owns what at this time: (yellow = stuff I accidentally chown'd)    (CentOS)  I assume I'm going to have to move all of my files and stuff off the machine and reinstall, but I'd rather not, obviously.  Right now I can't use sudo or su:  /etc/sudo.conf is owned by uid 1000, should be 0 /etc/sudoers is owned by uid 1000, should be 0 no valid sudoers sources found, quitting unable to initialize policy plugin   It's an OVH machine (i7 4970k) and I don't think the IPMI is working (or I just don't know how to use it... I think that's the case)  Is there any hope in fixing this?

I was trying to run chmod -R 777 ./ but ended up typing chmod -R 777 / and set 777 on my entire machine. What can go wrong? How can I fix it?


The reason that answers on the linked post do not answer this question:  NONE of them address the use of the user's prefers-color-scheme setting which is the root and CLEAR difference between this question and why it is worth asking.  Original question:  Now that a majority of users in the world (currently over 75%, per: ) have the ability to have the browser identify if the user prefers light or dark color scheme, how about having the Stack Exchange network respect that? It's actually an accessibility issue for many users as well as power saving for mobile devices to respect the user's preference for a dark theme.

Each Stack Exchange site should provide users the option of using a dark mode design/theme.  Why is this feature missing?  The major IDEs are already a letdown regarding dark color schemes.


I tried to add some photos to give the light grey bar on the top some texture but it wont show up. I'm new to blender so any advice or solutions would be great

I am creating a model of a glass and I would like to put a drawing on it (a png picture).  I know how to do it using Blender Render, but not with Cycles Render. Help :)


So I start with five batteries. The flashlight is assumed to require two batteries to shine. Each battery lifetime in use are independent random variables that are $\sim Exp(\lambda = 1)$. (Reserve batteries do not deteriorate). The question asks me to find the expectation of the flashlight lifetime.   My attempt: I call $T$ to be the lifetime of flashlight. Denote $B_{i}$ for $i = 1,2,3,4,5$ to be the lifetime of battery in use each $B_{i} \sim Exp(\lambda = 1)$.   I was thinking: If I choose the first two batteries, 1st battery runs out then we will have the 3rd with the 2nd. 2nd runs out, there are 3rd and 4th. Then third runs out we have 4th and the 5th. If 4th runs out, then we cannot use the flashlight. So, it has to be amount of time the 4th battery runs.   But I do not know how to express these in probability!! I would appreciate any help.

You have a flashlight that uses two batteries and you have a package of three new batteries. Suppose that each battery has an independent lifetime (in hours) with exponential(1/50) distribution. Find the distribution of the number of hours T that you can use the  flashlight.  Attempt for solution: denote by T the number of hours you can use the flash light let B1, B2 and B3 be the batteries respectively (B1\B2\B3) ~ exp(1/50)  I have the thought that if we use the first two batteries and the first one runs out first, then we have the second and third one once the second one runs out we can't use the flash light so the maximum life of the flashlight would be the amount of time the second battery runs  But i don't exactly know how to put this in terms of probability  I would really appreciate if there is someone out there willing to share ideas  Thanks alot!!


This is intended to be used in Java. Imagine following sample input:  WRA1007 1085808 1092650S 3901823CV   I want to match all alphabetic characters after at least one digit.  Desired output:  S CV   Actual output:  0S 3CV   My current approach looks like this:  \d[a-zA-Z]+   The problem with this pattern is that it includes the digit beforehand too. My current solution is to remove the first character of the resulting string afterwards. And this seems quite unsatisfactory to me.

I have several strings in the rough form:  [some text] [some number] [some more text]   I want to extract the text in [some number] using the Java Regex classes.  I know roughly what regular expression I want to use (though all suggestions are welcome). What I'm really interested in are the Java calls to take the regex string and use it on the source data to produce the value of [some number].  EDIT: I should add that I'm only interested in a single [some number] (basically, the first instance). The source strings are short and I'm not going to be looking for multiple occurrences of [some number].


I have a simple template function,  A.h  #include <iostream> #include <vector>  using namespace std;  template<class T> pair<T, T> GetMatchedBin(T, vector<pair<T, T> >);   A.cpp  #include "A.h"  template<class T> pair<T, T> GetMatchedBin(T val, vector<pair<T, T> > &bins) {     for(unsigned int i=0; i<bins.size(); i++){         if(val >= bins[i].first && val < bins[i].second)             return bins[i];     }     return pair<T, T>(); }   which I call via,  main.cpp  #include <iostream> #include <vector> #include "A.h"  using namespace std;  int main() {     vector<pair<int, int> > bins;     bins.push_back(pair<int, int>(0, 1));     bins.push_back(pair<int, int>(1, 2));     bins.push_back(pair<int, int>(2, 3));     bins.push_back(pair<int, int>(3, 4));      pair<int, int> matched_bin = GetMatchedBin(3, bins);      cout << matched_bin.first << ", " << matched_bin.second << endl;      return 0; }   However when I try to compile this I get the error,  make g++ -o temp temp.cpp A.o /tmp/dvoong/ccoSJ4eF.o: In function `main': temp.cpp:(.text+0x12a): undefined reference to `std::pair<int, int> GetMatchedBin<int>(int, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >)' collect2: ld returned 1 exit status make: *** [temp] Error 1   The odd thing is that if I do this all in one file rather than dividing into header and .cpp files then it works...  Any idea what is causing this?  Thanks

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


I'm using this MS SQL Script:       select NumberId, ART_No, InkColor       from INK_STOCK   and I have an output like this:       NumberId         ART_No          InkColor      ------------------------------------------      0010             23003             BLUE      0010             23003             RED      0010             23003             GREEN      0013             23004             ORANGE      0013             23004             PINK      0013             23004             WHITE      0015             23007             GREEN      0015             23007             PINK   How can I make the output should be like this:       NumberId         ART_No          InkColor      ------------------------------------------      0010             23003             BLUE, RED, GREEN      0013             23004             ORANGE, PINK, WHITE      0015             23007             GREEN, PINK   Thanks

How do I get:  id       Name       Value 1          A          4 1          B          8 2          C          9   to  id          Column 1          A:4, B:8 2          C:9


Hi I am a beginner to python and I have an exam tomorrow. I do not know how to do this question. I know that I have to use a nested for loop but, I cannot make it work syntactically. Here is the question, I apologize for any formatting errors.  (list of int, int) -> list of (list of int)   Return a list of lists of elements from 1st, where each sublist is the next num elements from 1st.  If the length of 1st is not a multiple of num, the final sublist will have fewer than num elements.   »> make_rows([2. 4, 6, 8, 10, 12],3) #Function call  [[2, 4, 6], [8, 10, 12]] # expected output

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


When it comes to cities and boats named after saints, it seems that "Santa" is always female and "San" is always male.  e.g. Male Saints: San Diego, San Francisco, San Antonio Female Saints: Santa Barbara, Santa Maria  So why isn't "Santa Claus" a woman like all the other "Santa"s?

Santa Claus is a man, right? In this case, he may not be fine with the fact that people call him Santa, which is the  and  word for female saint names.  For example, Santa Barbara and Santa Monica (Barbara and Monica are both female names). Saint Nicholas is by the way translated as San Nicolas and São Nicolas, respectively, in these languages, as San and São are the words for male saint names.  Where does Santa in Santa Claus come from?


I was flying to Bogota from Manchester with stop over in Paris. I've left my passport by Security in Manchester airport and nobody checked it by the gate and entering plane, guy on the gate also let me to the plane with 20 kg bag as I was running late. I've spent about £700 extra to get new flight to Colombia. I went through big embarrassment and lost two days of my holidays.    What recompense should get from Flybe?    Already put complaint but waiting from results.  I didn't show my passport to anyone at the airport, anyone...that means anyone using my boarding pass could enter the plane. I had a big 20 kg bag with me as hand luggage too as I was running late and was expected to pay but they didn't realize with this too. I was denied boarding in Paris to they deport me back to Manchester and I've been told I shouldn't be on this flight and airline will be charged 5000 euros for everything. I know it was my fault leaving my passport by Security but airline is responsible to check my ID to make sure it's me. My passport should be checked by the gate and entering the plane as far I know. I've paid another £500 pounds to get another new flight to Colombia plus internal flights there is airline responsibility to check my ID.

I was offered a job in Brazil and wanted to make sure it was a good place for my kids so booked a flight the morning of the offer for a flight later that morning.  I arrived at airport for my direct flight to Brazil, was issued boarding passes, took the flight but was refused entry upon arrival.  The airline flew me back, but I think they shouldn't have even let me board since I now know Americans are not allowed to enter Brazil w/o tourist visa?  I don't mind paying the cancellation fees but I feel the rest of the cost of the flight should be refunded?  Am I correct?


I have an introduction to my thesis. It includes a lot of constructions like in Section \ref{sec1} is shown or the formula is given in \eqref{eq1} whereas the corresponding Section and equation are in the separate files. Everything works fine and I have a correct pdf with explicit numbers, say, "in Section 3.2" or "is given in (5.3)" instead of \ref and \eqref.  For some reasons, I nead to have this introduction as a separate document. However, I still need to have the explicit numbers in proper places. Hence, my question is the following: is it possible to obtain from the existing thesis a new tex-document which will have instead of \ref{Sec1} its value "3.2" and so on?

I want to cross-reference between different .tex files, just because I want to put every chapters separately.  Let's say in file chapterI.tex I have \label{a} and I want to access this in file chapterII.tex using something like \ref{a}. How to do this exactly in LaTeX, moreover if LEd have an easy feature to cover this, it will be better (I have put those both files in the same project).  I found another question with similar title, but I just didn't really understand. It's here: .


According to  I understood that calculations are possible in a keyval list when the macro is expandable. The macro \numexpr being expandable, calculations are possible.   Hence the interest in knowing which macros are and which are not expandable from TeX, LaTeX, ε-TeX, etc.  I am not asking if there is a test, but if there is a list already made.

Question  Is there a way to check whether a macro is fully expandable (or rather "safe in an expansion-only context" )?    Consider this code:  \def\a{Just a string} \def\b{\a} \def\c{\def\unsafe} \def\d{\c}   How could I check which of the macros (a-d) are safe in an expansion-only context? By looking at them I know that a and b are whereas c and d are not but if I wanted to know the same for a macro I haven't written myself this could get quite useful.      Background  I am working on a way to detect whether some input is a valid number in PGF. For this I developed  which makes use of passing the input into \pgfmathfloatparsenumber. The problem I have run into is that said macro appears to somehow manages to expand the input until there is an error (if the input is in fact not safe in an expansion-only-context). I tried using protected, noexpand and similar but somehow PGF manages to circumvent those.    So the idea is to check whether the input is safe before actually passing it to PGF. The problem is: I don't know how I'd go about that...


I understand how to mathematically show that the sample variance (that involves dividing by n-1) is an unbiased estimator of the population variance (which divides by n), and the mathematics has been shown many times here on Math.SE.  I am wondering however if there is an intuitive way to understand this result that I can use to easily explain why this is done to layman.  So far I have seen many derivations but I haven't seen an elegant intuitve explanation for the result.

When calculating a sample variance a factor of $N-1$ appears instead of $N$ (see this  ).  Does anybody have an intuitive way of explaining this to students who need to use this fact but maybe haven't taken a statistics course?


I am a beginner in 2D animation . Would be grateful if somebody guide me how to animate change of shapes, eg from square to circle. Thanks !

So I'm making a 2d animation in blender, using the z space as layers, and the camera is in orthographic view. I'm trying to morph a square plane to be a flat circle, but I have no idea how to even approach it.


This is similar to a palindrome but, instead of a word/sentence that reads the same forwards and backward, is there a word for words/sentences that read the same right side up and upside-down?  See picture below where the word "yeah" is written in cursive:

I know palindrome is the term for a word that works backwards and forwards, but is there a similar term for a word that can be flipped/reversed and remain the same?  For example, the word SWIMS or the number 6009.


I change can you help me to see where is wrong because it's the same error log   enter code here   public class MainActivity extends Activity {      WebView mWebView; public ImageButton button01; public ImageButton button02; public class MainActivity extends Activity  {  WebView mWebView; public ImageButton button01;           `` public ImageButton button02;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(mylayout);     button01 = (ImageButton) findViewById(R.id.Button01);     button02 = (ImageButton) findViewById(R.id.Button02);`enter code here`     button01.setOnClickListener(new ImageButton.OnClickListener(){     public void onClick(View v){  jumpToLayout03();    Intent intent = new Intent();        intent.setClass(MainActivity.this, web.class);        startActivity(intent); }}      public void jumpToLayout03() {        setContentView(activity_main01);    }     });}} enter code here   I change can you help me to see where is wrong because it's the same error log

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?


"Firefox automatically checks the spelling of words that you enter in text boxes", but is there a way to have it check other texted based fields, such as <input type="text" />?

As you know, we can enable the spell checker on single line text boxes in the following way:    We have to enable it every time for checking words.  How can we enable it forever, so it doesn't need to be enabled each time?


I played the game . The game has "Let's do halves" as .   One usage example in the game:      Both main characters have a do(ugh)nut. They share it, and say "let's do halves".   I have done some research, I found . The question asks about "go" instead" of "do". According to answer, "Let's go halves" mean 50% contributions each (work, money, investment ...). However, from the usage of "Let's do halves" in the game, I feel like it means share thing equally (you and me, each have half of the donut).   I would like to know:    How the sentence can be used in real world, in writing, speaking, both formal and casual.  Is it an idiom (I have not found any evidence so far)? What is it mean ? ( please explain as detail as possible)  Is the sentence similar to "Let's go halves" ?. (Can we interchange "go" and "do" without changing its meaning?). If "Let's do halves" is different from "Let's go halves", what is the difference.

If two people want to buy a car together, would they go half on the car or halves. Example: Let's go half on this car or Let's go halves on this car?


I understand the limitations of the Schengen visitor's visa - I can stay no more than 90 days with the past 180. My question is, can I leave the area and return on a different passport and begin a new 90 day visa? The passports I have are US, Canadian and British. Like other's, I'm bummed that my British passport no longer affords me the right to visit the Schengen area for as long as I wish. Thank you for your responses.

If I have two passports with different numbers can I stay 90 days in a country, leave for a few days and return for another 90 days with my second passport? Is my information stored in some database or do they just check your passport stamps? I am asking about visiting Ukraine specifically


What's a name for a meaningless choice? A choice that has no effect on outcome. Something similar to a phrase like "pyrrhic victory".

What would be a nice short expression to describe a choice which isn't really one, in that all of its possible outcomes are ultimately equivalent despite being presented as different?  My first thought was "false choice", but this turns out to have a different meaning, and my next idea was "empty choice" which doesn't seem to exist. Does anyone know of such an expression?


Title says it all, a humanoid gets the Vargouille curse, but dies before they turn.  What happens, does the curse break, or just pause like in daylight, or do they still turn in the same rate, or do they turn immediately?  (So basically, can a Revivify spell be used as a pseudo Remove Curse?)

In a , I mentioned the possibility of killing a character and restoring them to life as a possible method of removing conditions from them. On reflection, I have no idea whether this works or not, and I can't find anything in my books to prove or disprove it.  Are some or all conditions removed when a character dies? If the answer is some, which ones?


I remember an exercise from Roman's Linear Algebra, but now I can't locate it in the book. Anyway, I think it asked to give examples of $A,B, C, D$ vector spaces such that $A \oplus B \cong C \oplus D$, and $A\cong C$, but $B\not\cong D$.   I feel like I must be forgetting some additional part of the problem, because the above is impossible, right?

I've tried to solve the following question (Exercise 10, page 107 from Roman's book: Advanced Linear Algebra), but I wasn't able to solve it.  Find a vector space V and decompositions $V=A\oplus B = C\oplus D$ with $A$ isomorphic to $C$ but $B$ is not isomorphic to $D$.


Below example will draw a tree with tikz. but if the tree has only left or right branch, it will be drawed vertically so we don't know if it's left or right branch.  \documentclass{article} \usepackage{tikz}   \usetikzlibrary{shapes.geometric,arrows,fit,matrix,positioning} \pagestyle{empty}             % do not remove % The settings below are copied from fullpage.sty \setlength{\textwidth}{\paperwidth} \addtolength{\textwidth}{-3cm} \setlength{\oddsidemargin}{1.5cm} \addtolength{\oddsidemargin}{-2.54cm} \setlength{\evensidemargin}{\oddsidemargin} \setlength{\textheight}{\paperheight} \addtolength{\textheight}{-\headheight} \addtolength{\textheight}{-\headsep} \addtolength{\textheight}{-\footskip} \addtolength{\textheight}{-3cm} \setlength{\topmargin}{1.5cm} \addtolength{\topmargin}{-2.54cm} \usepackage[active, tightpage]{preview}  \begin{document} \begin{preview} \tikzset{   treenode/.style = {circle, draw=black, align=center,      minimum size=1cm, anchor=center}, } \begin{tikzpicture}[->,>=stealth',level/.style={sibling distance = 5cm/#1,       level distance = 1.5cm},scale=0.6, transform shape]   \node [treenode] {1}   child {     node [treenode] {2}      child {       node [treenode] {3}        child {         node [treenode] {4}        }       child {         node [treenode] {5}        }     }     child [child anchor=north] {       node [treenode] {6}      }   }   child [child anchor=north] {     node [treenode] {7}     child [child anchor=north] {          node [treenode] {8}     }    }; \end{tikzpicture} \end{preview} \end{document   The output:    In this example, how can we make node "8" as a left branch?

How do I draw just a tree with one child using tikzpicture?  As shown in the picture, I want to have a tree like (1).    But I have only been succesful in getting a picture like (2) and (3) using:  \begin{tikzpicture} \node[circle,draw](z){$30$} % comment the below for (3): child{} child{ node[circle,draw]{40}} ; \end{tikzpicture}   So, is there a modifier that I don't know of? I've tried to find it in the manual of 7xx pages, but I failed on finding something useful.


Actually I was counting total accepted answers to earn Unsung Hero badge. So for that I want to fetch below columns by query, Total Answer - Accepted Answer - Zero Score Accepted Answer -  Percentage Accepted  Zero score accepted answers: more than 10 and 25% of total.  Can anyone please help me to check my total accepted answers by composing a new query ?

When I ran  query, it is giving me this result: Accepted Answers     Scored Answers    Unscored Answers     Percentage Unscored 35                   26                9                    25.7  But when I count from answers tab, I have 42 accepted answers, out of which 27 are scored and 15 unscored. Of course 2 are self-accepted answers. Even then why this much difference? How far am I from the unsung hero badge?