How to save commerce price field programatically in Drupal 8?

I want to update a node field's value when a node is updated.   Tried using the code mentioned here   use Drupal\node\Entity\Node;      function hello_world_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {        $check = \Drupal::routeMatch()->getParameter('node');        if ($check) {       $node = Node::load($check->nid->value);       $node->title->value = 'testing';     //set value for field       $node->save();       }     }   but it did not work. I get a 500 error after saving the node. I also tried taking out the if statement and specifying a node id $node = Node::load(1);  I also tried using   use Drupal\node\Entity\Node;   function hello_world_node_update(Drupal\node\NodeInterface $node) {  $node = Node::load(1); $node->set("title", 'New value'); // also tried $node->setTitle('The new Title'); $node->save();  }   but no luck either.   In addition, I tried using different hooks entity_presave, entity_update, node_update, but did not make any difference.


Find the following limit: \begin{equation*} \lim_{x \rightarrow 4} \frac{\sqrt{1 + 2x} -3}{\sqrt{x} - 2} \end{equation*}   I have tried to divide the numerator and denominator by $\sqrt{x}$, but it did not work.  I have tried to multiply by the conjugates of the numerator and denominator simultaneously but it did not work.   I have tried to multiply by the conjugates of the numerator only but it did not work.  So what shall I do?

After I just learned there are ways to cancel out $0$s in the divisor of fractions onto limits I looked back at a task where I gave up when I got the result $\lim\limits_{x\to4} \frac {\sqrt {1+2x}-3} {\sqrt x -2}$ so I tried to find a way to get the $0$ out here, as well. Am I just not seeing the solution or is there no way to do it?


I am trying to add a row dynamically by clicking the add button and later i am trying to move up and down by clicking the respected buttons... In the code i amhaving 3 static rows, the data typed in the textbox goes up and down perfectly. But regarding the ROW  which i have dynamically created, there is no action.   I came to know that javascript wont get action for dynamically created elements.. If so, what i have to do solve this issue...Thanks...    var html = '
row 4	<input type="text" name="uname">	<input type="button" value="move up" class="move up" />	<input type="button" value="move down" class="move down" />
';  $(function() {   $('#addRow').click(function() {     $('tbody').append(html);   });     $('#mytable input.move').click(function() {     var row = $(this).closest('tr');     if ($(this).hasClass('up'))       row.prev().before(row);     else       row.next().after(row);   }); });

         row 1	         <input type="text" name="uname">	         <input type="button" value="move up" class="move up" />	         <input type="button" value="move down" class="move down" />

         row 2	         <input type="text" name="uname">	         <input type="button" value="move up" class="move up" />	         <input type="button" value="move down" class="move down" />

         row 3	         <input type="text" name="uname">	         <input type="button" value="move up" class="move up" />	         <input type="button" value="move down" class="move down" />

   <button id="addRow">Add</button>        I would like to add new tr with controls dynamically and later i would like to reorder the same by clicking the up and down button and then to get its values in the reordered form..

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


My iPhone 4S is very slow. Is there anyway to downgrade to iOS 7 (legal or jailbreak)?

I'm trying to downgrade my iPhone from the current iOS to an older one, as per .  But every time I try, I always receive this error:     The iPhone could not be restored. This device isn't eligible for the requested build.     I have tried many times with and without DFU mode. Any ideas regarding this?


I installed the Preempt RT patch, how can I know if it was installed correctly, and if it was activated?  If it was right, what configuration shall be done, and how to do it?

How to know whether a particular patch is applied to the kernel? Especially RT-Preempt Patch.


Essentially just the title. This is supposed to be the introductory Upper Division Linear Algebra class so we haven't covered the determinant yet. I'm mentioning this because I am aware of the theorem that states that the conclusion would follow if the determinant was either 1 or -1. We haven't proven that in class yet so we can't use it. Anyway, if any of you have any ideas or hints, I would greatly appreciate it.   Thank you!   EDIT: Actually, that theorem does not apply in the way I stated. Either way, it cannot be used to solve this problem as it wasn't covered in class.   EDIT 2: This question is different than the other question asking why the elements of the inverse of the Hilbert Matrix are integers because my solution cannot include much outside of row reduction (elementary matrices), the definition of matrix multiplication, and the basic properties of matrix inverses.

Let $A$ be the $n\times n$ matrix given by $$A_{ij}=\frac{1}{i + j - 1}$$ Show that $A$ is invertible and that the inverse has integer entries.  I was able to show that $A$ is invertible. How do I show that $A^{-1}$ has integer entries? This matrix is called the Hilbert matrix. The problem appears as exercise 12 in section 1.6 of Hoffman and Kunze's Linear Algebra (2nd edition).


Hello dear users of ubuntu. I have bought a new laptop after my old one broke and this one has ubuntu installed already. I heard it is a very nice OS and good for working. I find myself run into many issues as I only have worked with windows so far. I tried to install libre office for example from the software center but it does not work, telling me it is unable to perform the task. I also want to set up windows in a second partition for gaming, but I wasnt able to find out which of the three partition holds Ubuntu ans what the other two even have. Is there any must do`s for setting up a fresh PC with Ubuntu or should I just go at it.

I've just started using Lubuntu 13.10. It's the first time I've ever used Linux.  Can any of you send me a tutorial-video for new users or explain the basics to me?


I have added 32bit support and installed additional stuff through terminal.. and it still won't run.. I have AMD X4 620 and Radeon 6950 2gb.   The output of running it from the command line:  Running Steam on ubuntu 15.04 64-bit STEAM_RUNTIME is enabled automatically  Installing breakpad exception handler for appid(steam)/version(1428965940)  libGL error: unable to load driver: r600_dri.so  libGL error: driver pointer missing  libGL error: failed to load driver: r600  libGL error: unable to load driver: swrast_dri.so  libGL error: failed to load driver: swrast

Actually I have installed the new Ubuntu 15.04 64bit, and when I'm trying to install Steam on it, there is a problem. In fact I have downloaded the deb package from steam website, installed it and when I start it nothing happens. I tried to start it from terminal and what I've got  $ steam Running Steam on ubuntu 15.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(0_client) libGL error: unable to load driver: r600_dri.so libGL error: driver pointer missing libGL error: failed to load driver: r600 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast


could somebody explain this longer way? I don't really understand that part of code, how it works. Could somebody write it out long way like:     if thing = "x"    if thing = ...  thing = "x" if thing.lower() == "o" else "o"

If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?


I downloaded wubi and "ubuntu-13.04-desktop-i386.iso" and kep in same folder.When i initiated install wubi starts to download 12.X. version of ubuntu and never considered downloaded ubuntu-13.04-desktop-i386.iso.Help me how can i install U13.04 using  wubi [offline].

I want to install 13.04 (or higher) using wubi, is that possible?


I asked a question here:  and two people provided equally valid, functional answers. One provided the Fiddle for it and another provided the much needed line by line analysis and mod to make it work. Either one of these would have been a great answer that would have resolved my issue.  How do I pick which one to mark as the answer? We can't mark both can we? I have upvoted both as the least I can do but how do I resolve this dilemma? Please advise.

I asked  that turned out to have multiple correct answers. How do I pick between them to determine which to accept?  All of the answers were different. They were not the same answer given multiple times.


I recently had to reinstall ubuntu (albeit an old version, 20.04) since my Ubuntu installation suddenly stopped booting for some reason (nothing's wrong with the pc) But now when I try to install my GPU's drivers, it's just stuck at about 33%. It starts at this 33% and, even after an hour, it's still at 33%. How do I do this? I'm downloading from Software and Updates. I've stared at a motionless progress bar for an hour and I'm starting to lose my sanity, so I hope that I can get this installed. Edit: 5 minutes since I posted this, the progress bar still hasn't moved

Is there a package of Ubuntu drivers as driver pack solution? I tried to search for it, but I did not find it. If there is, how can I easily get it?


Please imagine someone is going to ask someone else to prepare or find something which its buying and selling is considered as illegal; (i.e. a sort of drug/narcotics - medicine - a type of alcoholic liquor in some religious countries.) Which word would work better in informall language in the self-made sentence bellow:     1) Can you handle a bottle of wine for me tonight?    2) Can you hook me up with a bottle of wine tonight?    3) Can you fix me up with a bottle of wine tonight?    4) Can you line me up with a bottle of wine tonight?    For me, numbers 2-3-4 work, but I have heard once someone used "handle" in this sense in a friendly and informal manner.

Please tell me which choice below (or rather a better choice that I need to know) works better in my sentences in informal English:     I got myself out on a limb. I need to clear my check by tomorrow. No matter how, I must ............ 2 million bucks by tomorrow.   a) line up [to prepare, organize, or arrange something]  b) hook up [hook somebody up with something to help someone get something that they need or want]  c) fix up [to arrange for someone to have something that they need]  For me, all three options work in this sense with the same meaning and informality degree.


I want to be able to take in a string and call GetType() and find the type. Which I do here and it works perfectly fine.   Type TypeToUse = typeof(someclass).Assembly.GetType("MyProj.Data.Stuff.MyClass");   But when I use the type I found TypeToUse to create my observable collection it says the namespace can't be found.   ObservableCollection<TypeToUse> MyList = new ObservableCollection<TypeToUse>();   How do I fix this?  I'm actually trying to do this with a generic repository I'm assuming I have to add public virtual Type MakeGenericType(params Type[] typeArguments); to the Repository class?  Type elementType = typeof(ColorFilter).Assembly.      GetType("Photometrics.Data.Model.Entity.PhantomModels.Chamber"); Type CoreRepoType = typeof(CoreRepository<>).Assembly.      GetType("Photometrics.Data.Sql.Repository.CoreRepository"); Type combinedType = CoreRepoType.MakeGenericType(elementType);

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


Let $a,b,c$ be non-zero integers . Let $(x,y)$ denote the gcd and $[x,y]$ denote the lcm of two non-zero integers . Then is it true that $ (a,[b,c])=[(a,b),(a,c)]$ ?

I am trying to show that $\gcd(a,\operatorname{lcm}(b,c))=\operatorname{lcm}(\gcd(a,b),\gcd(a,c))$.  If $d=\gcd(a,\operatorname{lcm}(b,c))$, then $d=ax-my$, where $m=\operatorname{lcm}(b,c)$. So $d=ax-b(ky)$ and $d=ax-c(ly)$, which means that $\gcd(a,b)|d$ and $\gcd(a,c)|d$, or $d$ is a common multiple.  But I wasn't able to show that it is the smallest common multiple.


This is my build:   Level 1 – Warlock 1 -  otherworldy patron, pact magic  Level 2 – Warlock 2 -  eldritch invocations Level 3 – Warlock 3 -  pact boon  Level 4 – Paladin 1 -  divine sense, lay on hands Level 5 – Paladin 2 -  fighting style, spell casting, smite   If I understand correctly I am character level 5 but class level 3 Warlock and class level 2 Paladin.   This means that Eldritch Blast will make 2 ranged attacks as I am character level 5, but I do not get an ability score improvement at level 4 because I get that at class level 4.   Is this correct?   EDIT: my players have started multi classing and this is an example character I made to try to understand the rules better.   The comment that Profecincy bonus used character level and not class level is the kind of information I was looking for.   I guess my question would be close to: using the build above what do I count as level 5 for?

Cantrips seem to be the only type of spell that cares only about your class level. However, in the multiclassing section they are not mentioned, does this mean that cantrips use your character level, instead of your class level?  Does this mean a Warlock 2 / Fighter 15 can cast an Eldritch Blast with 4 beams just like a level 17 Warlock?


For instance, I want an ampersand in D&D, but it gets filtered out.

What symbols/characters are not allowed in tags?


How do I trace back to the exact command run by the unity launcher for a given launcher icon? In 14.04 at least, hovering (or right-clicking) an icon on the launch bar provides no option to arrive at that information.

I want to use some applications shown on the Unity Launcher in a terminal, but I need to know the appropriate command to run them. How can I achieve that?


I needed to find cardinality of irrationals. I have provedthat R\Q is uncountable. Now I need to build a bijection h : R\Q → R . How to do this?

Is there a simple, constructive, 1-1 mapping between the reals and the irrationals?  I know that the Cantor–Bernstein–Schroeder theorem implies the existence of a 1-1 mapping between the reals and the irrationals, but the proofs of this theorem are nonconstructive.  I wondered if a simple (not involving an infinite set of mappings) constructive (so the mapping is straightforwardly specified) mapping existed.  I have considered things like mapping the rationals to the rationals plus a fixed irrational, but then I could not figure out how to prevent an infinite (possible uncountably infinite) regression.


So I have TABLE_ONE with two columns...ID and EXPIRE_DATE  and TABLE_TWO with the same two columns except the EXPIRE_DATE has a dummy value and needs to be populated from the first table.  I need to grab the most recent EXPIRE_DATE (latest date not last added) for a given ID from TABLE_ONE and populate all occurences of that ID in TABLE_TWO with that EXPIRE_DATE.  I guess it's clear that ID is not the PK in either table. It recurs.  How would I write this UPDATE of TABLE_TWO?     Thanks!

I have a database with account numbers and card numbers. I match these to a file to update any card numbers to the account number, so that I am only working with account numbers.   I created a view linking the table to the account/card database to return the Table ID and the related account number, and now I need to update those records where the ID matches with the Account Number.  This is the Sales_Import table, where the account number field needs to be updated:  LeadID  AccountNumber 147         5807811235 150         5807811326 185         7006100100007267039   And this is the RetrieveAccountNumber table, where I need to update from:  LeadID  AccountNumber 147         7006100100007266957 150         7006100100007267039   I tried the below, but no luck so far:  UPDATE [Sales_Lead].[dbo].[Sales_Import]  SET    [AccountNumber] = (SELECT RetrieveAccountNumber.AccountNumber                            FROM   RetrieveAccountNumber                            WHERE  [Sales_Lead].[dbo].[Sales_Import]. LeadID =                                                  RetrieveAccountNumber.LeadID)    It updates the card numbers to account numbers, but the account numbers gets replaced by NULL


So everything out of the camera's sight is invisible and it's there's this grey/gray (I don't know how it's spelled) thing highlighting what can be seen. What's going on and how do I fix this? I need to use assets that are out of my view. :(

When looking at my objects in 3d view I'm seeing a gray cone that seems to be hiding other objects.   Can anyone help me turn this off and explain what it is please.  Screenshots attached.


I face a problem with installing kernel 4.6 on Ubuntu 16.04 . Someone said because it was unstable. So What is the latest stable version of kernel and how to install it.

Currently I'm running opensuse 13.2 and I want to update it to a (ubuntu)linux with the newest kernel the 4.9.xy release as mentioned at .   Is the latest kernel 4.9.xy version available for Ubuntu?  or - Can I update this - after having installed Ubuntu without any risk of crashes? I'm updating my kernel regularly as provided by the Update Manager..  Is  there a way to install Ubuntu - and afterwards easily upgrade to the newest kernel?


I am writing a batch job to send an email to a lead owner's manager. I have List<String> mgremails in which I have extracted only the email addresses of the manager.   List<User> mgr = [select Manager.email FROM User where Id in :leadOwnerId];  list<string> mgremails = new list<string>(); for(User u : mgr){     mgremails.add(u.manager.email); }   I now need String[] as parameter for the setToAddresses method of the Messaging class. How do I do this conversion?

In the  book on pg 130, they mention that an Array's length is fixed when you initialize it and that multidimensional arrays are not supported. I just tried using the .add function on an array and it worked so I'm sure what they are talking about, but I couldn't make an array of arrays (which could have just been because I didn't have the right syntax). Ignoring syntax errors, there seems to be some sort of difference and thus maybe an (even if just slight) advantage to using one over the other?


I recently bought a new gaming laptop that comes with a single Ripjaws 16Gb stick. I've heard that having dual channel memory can actually boost your performance by about 7% or higher.   I'm thinking of adding a 4Gb stick of the same brand and specs for about $30. Would this be worth it? I've heard that mismatching RAM capacities can have negative effects.  (By the way, keep in mind that this gaming laptop has an i7-6700HQ which will only support RAM speeds of 2133MHz since that is all it will recognize. Although the 16Gb stick is 2400MHz, it's running @ 2133MHz.)  Current 16 Gb Stick:  4 Gb Stick for dual-channel upgrade:   | Hypothetically, if CPU-Z where to say the 4Gb stick is running in dual-channel mode with the 16Gb, would this mean only 4Gb would be used as dual-channel? I personally owned a separate laptop that had a 4Gb/2Gb RAM setup using dual channel. I've been told Asymmetric Dual-channel isn't as good as symmetric, but for 30 bucks is it worth?

describes the RAM specifications for many of the MacBook laptops. In the section for my laptop (13" Pro Late 2011), it says:     Additional Notes: For best performance, fill both memory slots, installing an equal memory module in each slot.   This isn't the first time I've heard of this phenomenon, and it's definitely not specific to Apple.   Why is this the case? Other than the obvious decrease in available memory, why would it be worse to run with 6GB (1x4GB + 1x2GB) than with 8GB (2x4GB)?


I bought a used Canon 28-135mm USM lens for cheap as a YOLO moment.  The lens is lovely in all respects except for a few slight scuffs on the front element I have indeed seen the lens rentals blog post with the smashed lens; mine isn't nearly as bad, but I'd like to use it for hiking in sunlight. The lens has a soft/flared spot outside in direct sunlight. I got a lens hood for it to minimize this; what else can I do that doesn't involve replacing the front element? See the soft/bright spot in the brown foliage of the palm tree:  It's still a decent lens; I'm going to keep it in my bag as a backup.

How can I clean a lens (fisheye) scratches? I heard about    peanut butter rubbing alcohol car paint scratch removal solution any other? like an abrasive tool etc


First, a bit of notation. Let $x(t) = \cos(t)$ and $y(t) = \sin(t)$ . Let $x$ and $y$ be abbreviations for $x(t)$ and $y(t)$ .  Using de Moivre's formula, proving that $ \sin(3t) = 3\sin(t) - 4\sin^3(t) $  is straightforward. I'm curious whether this formula has a geometric proof or one that doesn't use complex numbers and preferably not calculus.  For comparison, the double angle formula has a wonderful geometric proof .  Here's the straightforward proof:  $$\sin(3t)$$  $$\Im(\exp(i\times 3t))$$  $$\Im(\exp(it)^3) $$ $$\Im((x+iy)^3) $$ $$\Im(x^3 + 3x^2yi + 3xy^2i^2 + y^3i^3) $$ $$\Im(x^3 + 3x^2yi - 3xy^2 - y^3i) $$ $$3x^2y - y^3 $$ $$3 {\times} (1-y^2) {\times} y - y^3 $$ $$3y - 3y^3 - y^3 $$ $$3y - 4y^3 $$  And thus  $$ \sin(3t) = 3\sin(t) - 4\sin^3(t) $$

Is there a nice geometric, intuitive or picture proof as to why the  identity $\cos(3 \theta) = 4 \cos^3(\theta)-3\cos(\theta)$ is true?  Note I'm not looking for a computational proof like the one linked to, more a proof without words or intuitive style proof, thanks.


I have to solve the following problem:  Two particles of masses $m_a=m$ and $m_b=2m$ interact by gravitational forces   $$\vec{F}_{ab}=-G\frac{m_am_b\vec{r}}{r^3} \; ,\qquad \vec{F}_{ba}=-\vec{F}_{ab}$$  where $\vec{r}$ is the relative position of $a$ on $b$. ¿When will they collide?  That's the problem. Then, the author gives a clue: Use the third Kepler's law for an elliptic orbit in the limit $L \rightarrow 0$ (angular momentum)?  Well, I tried to write the third Kepler's law in terms of $L$ to calculate the limit, but I can't. Is there another way to do it?   The solution is  $$t_c=\sqrt{\frac{\pi^2 d^3}{24Gm}}.$$

My friend and I have been wracking our heads with this one for the past 3 hours... We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r.  Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as:  $$F_g ~=~ G\frac{Mm}{r^2}$$  How do we find out at what time they will collide?  What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$.  I've tried taking a number of integrals, which haven't really yielded anything useful.  Any guidance?  No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :)


I just discovered how to use flalign* to left justify my multi-line equation, but I would like it to start immediately after the a) lim... in my enumerate without going to the next line.  \begin{enumerate}   \item \begin{flalign*}           L&=\lim\limits_{n\to\infty}\frac{n}{n^2-1}&\\            &=\lim\limits_{n\to\infty}\frac{n}{n^2-1}\frac{(\frac{1}{n^2})}{(\frac{1}{n^2})}\\            &=\lim\limits_{n\to\infty}\frac{\frac{n}{n^2}}{\frac{n^2}{n^2}-\frac{1}{n^2}}\\             &=\lim\limits_{n\to\infty}\frac{\frac{1}{n}}{1-\frac{1}{n^2}}\\            &=\frac{0}{1-0}\\            &=0          \end{flalign*}    \item   It always goes to the next line. How do I move it up?

Related (but not the same):         Earlier today I asked a question about aligning equations in an enumerate environment and got an answer that seemed to work for the example I gave, but it turns out I wasn't really specific enough for my problem.  I'm using align* environments, often as the only part of a list item. (If you're wondering why I'm not using more words to introduce the align*, these are mostly homework solutions where most of the work is algebra, etc.)  Here's my code and what it makes (above the middle line):  \begin{enumerate}   \item \begin{align*}     x^2 + y^2 &= x^2 + (iy)^2 \\               &= (x + iy) (x - iy)   \end{align*}   \item \begin{align*}     \frac{1}{n^2-4} &= \frac14 \frac{4}{(n-2)(n+2)} \\                     &= \frac14 \left( \frac{1}{n-2}-\frac{1}{n+2} \right)   \end{align*} \end{enumerate}     I'm trying to make the baseline of the first line of the align* environment the same as the number's baseline—I want the first line of the align* to have the same vertical position (centered horizontally in the same way) relative to its number as in the second half of my picture. (Side question: why is there so much space before the align* starts?)


Might be a dupplicate, but I don't think it is...  Looking here :   I've seen that the Canon 1200D has a mount type called "Canon EF-S".  I know that you cannot mount EF-S lens on a full frame, but I never quite realized that camera had their mount specification as well (which is logical but still...)  Anyway, does it mean that you cannot mount an EF lens on this kind of entry level DSLR ?

This is specific to Canon, but what is the difference between EF and EF-S lenses?


My server provider shutdown one of our servers and it says that is sending a tons of email. When I made a tcpdump I see the following:  04:52:49.743068 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1631:1662, ack 906, win 123, length 31: SMTP: RCPT TO:<fahriozlu@gmail.com> 04:52:49.959999 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [.], ack 920, win 123, length 0 04:52:50.039830 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1662:1695, ack 920, win 123, length 33: SMTP: RCPT TO:<fahriozlu@hotmail.com> 04:52:50.253412 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [.], ack 934, win 123, length 0 04:52:50.333509 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1695:1730, ack 934, win 123, length 35: SMTP: RCPT TO:<fahriozparlak@gmail.com> 04:52:50.556870 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [.], ack 948, win 123, length 0 04:52:50.637048 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1730:1767, ack 948, win 123, length 37: SMTP: RCPT TO:<fahriozparlak@hotmail.com> 04:52:50.854218 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [.], ack 962, win 123, length 0 04:52:50.934357 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1767:1809, ack 962, win 123, length 42: SMTP: RCPT TO:<fahriozparlak@yenikonya.com.tr> 04:52:51.152141 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [.], ack 976, win 123, length 0 04:52:51.232339 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1809:1844, ack 976, win 123, length 35: SMTP: RCPT TO:<fahriozsoydan@gmail.com> 04:52:51.446160 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [.], ack 990, win 123, length 0 04:52:51.526295 IP <Our IP>.51796 > mail.dsityre.lk.smtp: Flags [P.], seq 1844:1881, ack 990, win 123, length 37: SMTP: RCPT TO:<fahriozsoydan@hotmail.com>   It sending tons of emails. Those email addresses is not even familiar to us. As you can see it is just changing the domain name of those email address.  Is there anything I can check or do? We already blocked the outgoing domain name in the firewall, but it is still there. We are using debian based linux. Whizzy I think.

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


How to show that $\cos(\sin^{-1}(x))$ is $\sqrt{1-x^2}$?   I remember having to draw a triangle, but I'm not sure anymore.

How does that bit work?  How is  $$\cos(\arcsin(x)) = \sin(\arccos(x)) = \sqrt{1 - x^2}$$


Not able to install Android studio IDE in Ubuntu 18.04.1 from ubuntu app store. After installation it take some time then aborted.

Please tell me the full process of installing Android Studio and its necessary dependencies.


I read that this is the difference between present perfect and present perfect continuous.     A1: It has been raining for two hours [and I don't expect it to stop soon].    A2: It has rained for two hours [and will likely continue to do so in the future].    Source:   Is it right? I knew it another way. Could you please tell me what is right?

The sentences are:   Mary has worked as a teacher for over 25 years. It has rained heavily for 2 hours.   Does it mean "Mary" is still working as a teacher or she is no longer working now? Does it mean it is still raining or it stopped?  Since it cannot mean both, so how to suggest either one of the meanings?


I have installed Ubuntu 11.10 in a Dell Inspiron N5110 laptop and it works fine. But I can hear a continuous noise from the cooling system. What should I do to solve this problem?

I've installed Ubuntu 11.10 on a Dell Inspiron N5010. It gets too hot and is automatically shutdown. Can anybody suggest why this is happening and how to fix it?  The application is use the most often are:   Eclipse with android plugin Banshee player GIMP Wine   The output of lsmod is:  Module                 Size   Used by bnep                   17923  2  rfcomm                 38408  8  pci_stub               12550  1  vboxpci                22882  0  vboxnetadp             13328  0  vboxnetflt             27211  0  vboxdrv               251814  3 vboxpci,vboxnetadp,vboxnetflt parport_pc             32114  0  ppdev                  12849  0  binfmt_misc            17292  1  joydev                 17393  0  btusb                  18160  2  bluetooth             148839  23 bnep,rfcomm,btusb snd_hda_codec_hdmi     31426  1  snd_hda_codec_idt      60049  1  arc4                   12473  2  dell_wmi               12601  0  sparse_keymap          13658  1 dell_wmi uvcvideo               67271  0  dell_laptop            13519  0  dcdbas                 14098  1 dell_laptop videodev               85626  1 uvcvideo snd_hda_intel          28358  2  snd_hda_codec          91754  3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel snd_hwdep              13276  1 snd_hda_codec snd_pcm                80468  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec snd_seq_midi           13132  0  snd_rawmidi            25241  1 snd_seq_midi snd_seq_midi_event     14475  1 snd_seq_midi snd_seq                51567  2 snd_seq_midi,snd_seq_midi_event snd_timer              28932  2 snd_pcm,snd_seq intel_ips              17753  0  snd_seq_device         14172  3 snd_seq_midi,snd_rawmidi,snd_seq psmouse                63474  0  serio_raw              12990  0  iwlagn                273937  0  mac80211              393459  1 iwlagn snd                    55902  14 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device cfg80211              172392  2 iwlagn,mac80211 i915                  505143  8  soundcore              12600  1 snd snd_page_alloc         14108  2 snd_hda_intel,snd_pcm wmi                    18744  1 dell_wmi mei                    36466  0  drm_kms_helper         32889  1 i915 drm                   196322  4 i915,drm_kms_helper i2c_algo_bit           13199  1 i915 video                  18908  1 i915 lp                     17455  0  parport                40930  3 parport_pc,ppdev,lp usbhid                 41905  0  hid                    77367  1 usbhid ums_realtek            13096  0  usb_storage            44173  1 ums_realtek uas                    17699  0  ahci                   21634  4  libahci                25761  1 ahci r8169                  47200  0


Can anyone explain how ceiling fan works; why the capacitor; how the fan rotates. Theory and practical.  Single phase induction motor are very easy to understand. In this ceiling fan, the windings are not like induction motor windings. There are two sets of windings. One is clockwise and another is anticlockwise. There rotating part is a magnet ring that is outside of the armature. Can anyone explain how this type of motor works?

I have an old ceiling fan motor that runs with a 1.5µF run capacitor, at what I believe is, its full intended speed.  With the help of some folks here at StackExchange I've wired everything up as in the image below, also refer to the schematic further down this question. The motor seems to be running well.    The next step is to add a 4 way rotary switch that selects between off and 3 different speed settings. I need to figure out the capacitor values I can use in C3 and C4 in the schematic below to achieve the slightly slower speeds for speed settings 1 and 2, with 3 running at full speed.      I do believe that the capacitors need to be in parallel for the capacitance to add up, and slow the motor down, please do correct me if I'm wrong. As far as I can understand the capacitance shifts the phases apart further in the two coils.  The simplest approach might be to go and buy some 1µF to 1.5µF caps and play around with different configurations. I already know I need a 1.5µF to get and keep the motor running.  Is it safe to say I can just add another +/-1µF/1.5µF in parallel for my 1st speed setting, and another 1µF for the 2nd setting to slow the motor down? Thus, I have the following configurations:  Speed = 1 : 1.5µF  Speed = 2 : 1.5µF + (C2)1µF = 2.5µF  Speed = 3 : 1.5µF + (C3)2µF = 3.5µF  If this bit of information helps, our supply is 220V at 50Hz, and the motor has, what appears to be 14 coils, according to my counting through the holes in the motor casing.


I'm trying to read in a binary file of size 114,808 bytes.  I allocate memory for the file, and then try to read in the file using fopen and fread.  The first time fread is called, it always reads in 274 bytes, and the subsequent call to feof always returns 1, even though clearly the end of the file has not been reached.  Why is this?  According to the  for feof, "The feof function returns a nonzero value if a read operation has attempted to read past the end of the file; it returns 0 otherwise."  So I don't understand what is causing feof to consistently return 1.  Here's the code that I have so far.  Any help would be much appreciated.  Thanks!  // Open source file with read-only access if ( iError == ERROR_SUCCESS ) {     #ifdef _MSC_VER     #pragma warning(disable : 4996)     #endif     pFile = fopen( pSrcPath, "r" );      if ( pFile == NULL )     {         iError = ERROR_FILE_NOT_FOUND;     } }  // Read in source file to memory if ( iError == ERROR_SUCCESS ) {     do     {         // Buffer pointer passed to fread will be the file buffer, plus the         //  number of bytes actually read thus far.         iSize = fread( pFileBuf + iActReadSz, 1, iReqReadSz, pFile );         iError = ferror( pFile );   // check for error         iEndOfFile = feof( pFile ); // check for end of file          if ( iError != 0 )         {             iError = ERROR_READ_FAULT;         }         else if ( iEndOfFile != 0 )         {             // Read operation attempted to read past the end of the file.             fprintf( stderr,                 "Read operation attempted to read past the end of the file. %s: %s\n",                 pSrcPath, strerror(errno) );         }         else         {             iError = ERROR_SUCCESS; // reset error flag             iActReadSz += iSize;    // increment actual size read             iReqReadSz -= iSize;    // decrement requested read size         }     }     while ((iEndOfFile == 0) && (iError == ERROR_SUCCESS)); }  // Close source file if ( pFile != NULL ) {     fclose( pFile ); }   FYI, I'm trying to write this, so that the source is more-or-less compatible with C, even though MSVS basically forces you into a C++ environment.

I am writing a C library that reads a file into memory. It skips the first 54 bytes of the file (header) and then reads the remainder as data. I use fseek to determine the length of the file, and then use fread to read in the file.  The loop runs once and then ends because the EOF is reached (no errors). At the end, bytesRead = 10624, ftell(stream) = 28726, and the buffer contains 28726 values. I expect fread to read 30,000 bytes and the file position to be 30054 when EOF is reached.  C is not my native language so I suspect I've got a dumb beginner mistake somewhere.  Code is as follows:  const size_t headerLen = 54;  FILE * stream; errno_t ferrno = fopen_s( &stream, filename.c_str(), "r" ); if(ferrno!=0) {   return -1; }  fseek( stream, 0L, SEEK_END ); size_t bytesTotal = (size_t)(ftell( stream )) - headerLen; //number of data bytes to read size_t bytesRead = 0; BYTE* localBuffer = new BYTE[bytesTotal]; fseek(stream,headerLen,SEEK_SET); while(!feof(stream) && !ferror(stream)) {     size_t result = fread(localBuffer+bytesRead,sizeof(BYTE),bytesTotal-bytesRead,stream);     bytesRead+=result; }     Depending on the reference you use, it's quite apparent that adding a "b" to the mode flag is the answer. Seeking nominations for the bonehead-badge. :-)   talks about it in the second paragraph, second sentence (though not in their table).   doesn't discuss the binary flag until halfway down the page.   mentions the existance of the "b" tag, but states that it "shall have no effect".


I'm using the command line to combine hundreds of CSV files (with identical columns) in the manner described in  . The problem is that some of my CSVs have an NA value in cell A1. In these cases, the values from the first row of the file are added to the last row of the previous file. Here is a simple example. csv1 col1,col2  csv2 ,16 17,18  cat *.csv >merged.csv yields this output col1,col2,16 17,18  my desired output col1,col2 ,16 17,18  One option is to modify the source files so that the first column never contains missing values. Due to the quantity of data involved, I'd like to avoid that if possible. Is it possible to fix this behavior within the cat command?

I have a bunch of .text files, most of which end with the standard nl.  A couple don't have any terminator at end.  The last physical byte is (generally) an alphameric character.  I was using cat *.text >| /tmp/joined.text, but then noticed a couple of places in joined.text where the first line of a file appeared at the end of the last line of a previous file.  Inspecting the previous file, I saw there wasn't a line terminator -- concatenation explained.  That raised the question, what's the easiest way to concatenate, sticking in the missing newline? What about these options?   A solution that might effectively add a blank line to some input files.  For me, that's not a problem as the processing of joined.text can handle it. A solution that adds the cr/fl only to files that do not already end that way.


I was solving the integral $$\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\frac{1}{\tan^6(x)+1}dx$$ and here's my solution:  Let $I = \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\frac{1}{\tan^6(x)+1}dx$, then $$I=2\int_{0}^{\frac{\pi}{2}}\frac{1}{\tan^6(x)+1}dx.$$ Subs. $u=\tan x,dx=\frac{1}{1+u^2}du$.  $$I = 2\int_{0}^{\infty}\frac{1}{(1+u^6)(1+u^2)}du$$ $$I=2\left(\int_{0}^{1}\frac{1}{(1+u^6)(1+u^2)}du +  \int_{1}^{\infty}\frac{1}{(1+u^6)(1+u^2)}du\right).$$  On the first integral, $u \mapsto u^{-1}$, ending with $$I=2\int_{1}^{\infty}\frac{du}{1+u^2}=\frac{\pi}{2}.$$  Using the same approach, I was able to prove that the equality holds for all $n\in \mathbb{Z}$. Going beyond, and using Wolfram Alpha, the equality seems to hold for all reals $n$, but only for the real part. So, here's my question:      Claim. Let $$\mathcal{I}=\Re{\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\frac{1}{\tan^{2n}(x)+1}dx}.$$ Then, $\mathcal{I}=\frac{\pi}{2}, \forall n \in \mathbb{R}.$   First of all: Is the Claim true?  If positive, can I prove it using the same methods?

Evaluate the integral $$\int_0^{\pi/2} \frac{1}{1+\tan^\alpha{x}}\,\mathrm{d}x$$


The infamous Bruce Lee scene with Cliff Booth is framed as a thought sequence as Cliff is fixing a roof antenna. Although presumably the scene was a flashback, the framing actually makes it indiscernible from an imagined scene i.e. a daydream.  The way I interpreted the scene was not "this is what I remember happening," but rather "this is what would probably would happen if I went back to working on movie sets, and it's why I'm fixing roof antennae instead of being on sets."   This certainly fits better with the hyper-unrealistic portrayal of Bruce Lee, since it's a hypothetical sequence.   My question is what, from the movie only (not Tarantino interviews or anything off-screen), indicates that this sequence was actually a flashback and not a dream sequence?  n.b. The scene directly preceding explains that Cliff would have trouble landing a job with this particular movie director for some reason. There are two interpretations of this with the Bruce Lee scene in context. One interpretation is "it's unlikely I would get that job because I dented the car sparring with Bruce Lee" while another is "it's unlikely I would get that job because if I did, I would probably do something like dent his car sparring with Bruce Lee." I don't feel that the movie definitively states which is the right interpretation.

In Once Upon a Time in Hollywood, there is a segment where Cliff goes to the set, gets the job and eventually fights Bruce Lee, which makes him get fired.    After that, he is shown fixing the antenna, and says something like "Yeah, I deserved that". Did he actually went to the set, or was it simply a daydream?


I've proved that any quotient of a PID by a prime ideal is again a PID as an exercise, and got into thinking about quotients by non-prime ideals. Are they ever a PID? More concretely, say $R$ is a PID and $I$ is an ideal of $R$ which is not prime. Is $R/I$ ever a PID? Testing with $R=\mathbb{Z}$ and $I=4\mathbb{Z}$ this isn't the case, since $\mathbb{Z}/4\mathbb{Z}$ isn't even an integral domain (and by definition cannot be a proper PID). In rough terms the proof of the earlier statement follows: Let $R$ be a PID and let $P$ be a prime ideal. If $P$ is the zero ideal, then $R/P$ is isomorphic to $R$ and thus a PID. If $P$ is a nonzero prime ideal of $R$ it must be maximal. Thus $R/P$ is a field, which is trivially a PID. I have a hard time imagining this proof is "reversible", since there should be more cases of $R/P$ being a PID but no field. Instead I got about as far as this: Suppose $I$ is an non-prime ideal of the PID $R$. Thus there must exists some $(ab)\in I$ such that $a\notin I$ and $b\notin I$. Since $R$ contains no zero divisors, we must have that $a$ and $b$ are nonzero. Thus $R/I$ contains elements $a+I$ and $b+I$. However $$(a+I)(b+I)=(ab)+I=I$$ since $(ab)\in I$. Thus $R/I$ contains zero divisors, and can't be a PID. Is this correct? How could one think otherwise? Thanks in advance!

I'm supposed to show in a part of an exercise that if we have a ring $R$ that is a principal ideal domain, then for any ideal $I$ in $R$, $R/I$ will also be a PID.  So $I=(i)$ for some $i \in R$, and $R/I$ is $\{rI |r\in R\}$, and we know:   An ideal $J$ in $R/I$ will be an ideal $J$ in $R$ containing $I$.  So if $I \subset J$ and $I=(i)$, then $J$ should be $(j)$, where $j|i$. but wherefrom do I get the necessity that $J=(j)$, so that $J$ is also principal? and there will be several $j$ that divide $i$, but should it not be only one?  And then I shall use this to show a 1-1 correspondence between ideals of $\mathbb{Z}$ and $\mathbb{N}$.  Can someone support with with the proofs?


I am aware that some books in the 5th edition of d&d needs board to be played on, but the cashier of the shop I was buying the adventure book (Hoard of the Dragon Queen) said that the adventure didn't need a board. And now, I'm a little bit confused over how that works. Because how is the combat going to work without a board to play the battles on?

Our target play style for combat encounters would be to use battle boards roughly half the time (when there is enough of interest in play that the tactics are fun to play out), and to skip that with faster "cinematic" combat otherwise.  We have not been 100% successful. The problem is the numbers-driven descriptions in the rules. Needing to be "adjacent" (within 5 feet) for abilities such as Protection style fighting, ranged weapon ranges, spell effects and movement speeds are all much easier to resolve on a grid. Running those rules without a board rapidly devolves into sketches with numbers written on them and/or "mother, may I?" style of play because the DM needs to rule who is next to who, and which monsters are in the spell radius. These rulings also quickly get out of sync with player expectations when there is no map and we want to run combats quickly.  It doesn't help that the numbers involved come in pretty much all multiples of the base 5 feet. There is no obvious close/short/medium for effects and ranges. If there were such then I think it would be much easier for the DM to categorise and hand-wave things.  I was hoping that both board-based and no-board style of play would feel equally viable. But the focus on numbers seems to push toward board playing, at least for my group.  We would still like to pay heed to the differences in movement, range, area-of-effect etc of the rules in play. At least in the general sense of creature X is faster than creature Y, or weapon/spell A has better range than weapon/spell B.  Going beyond "just don't sweat the details", how can a group like mine play with the D&D 5e rules as written, without a map, but without leaning on the DM to resolve all our questions of "So, am I next to the Paladin?", or "Is it in range?"      Clarifying: "just don't sweat the details" is a welcome approach to solving the problem, but please give some examples of how this works in practice; i.e. which details can be removed and how?


I have this grid where (usually) you can select one of the tiles. A selected tile is supposed to have a transparent blue overlay. How can you make an image overlay in a grid that remains the width of its container when resizing the grid width?  As such:    I made .tile__overlay position: absolute;, which looks good at first glance. But it means that I lose the responsiveness, meaning that the overlay does not adjust to its parent size when the tiles are smaller than their maximum size.    .grid {   display: grid;   grid-gap: 6px;   max-width: 306px;   grid-template-columns: minmax(min-content, 150px) minmax(min-content, 150px); }  .tile {   padding: 0;   border: 0;   max-height: 150px;   max-width: 150px; }  .tile__image {   height: 100%;   width: 100%;   max-height: 150px;   max-width: 150px;   display: block;   object-fit: contain; }  .tile__overlay {   width: 100%;   height: 100%;   background-color: rgba(29, 151, 255, 0.9); }
   <button class="tile" type="button">        </button>   <button class="tile" type="button">        </button>   <button class="tile" type="button">
   </button>   <button class="tile" type="button">        </button>

I want to overlay one image with another using CSS. An example of this is the first image (the background if you like) will be a thumbnail link of a product, with the link opening a lightbox / popup showing a larger version of the image.   On top of this linked image I would like an image of a magnifying glass, to show people that the image can be clicked to enlarge it (apparently this isn't obvious without the magnifying glass).


New Ubuntu User - trying to download and install a file... in this case a .jar file... and having difficulty knowing where to install it.  I have used Software Center to install .exe files, and it is so easy and nice. But the .jar is not handled the same way for some reason... maybe because it requires Java?  What is the easiest/most direct way to download and install a file in Ubuntu when Software Center is not handling it for you?

I know that to execute a file, I use the . command, then the file name with a space between them. But I'm trying to execute a .jar file using the . and it does not work. I went into the properties and marked it as executable and made it run with Java.   Is there a way to execute a file with Java in the Bash Terminal?    I am trying to execute the Minecraft.jar file.


Let $a$ and $b$ be positive integers. Prove that: If $a^2$ divides $b^2$, then $a$ divides $b$.   Context: the lecturer wrote this up in my notes without proving it, but I can't seem to figure out why it's true. Would appreciate a solution.

I would like to show that $a^n \mid b^n$ implies $a \mid b$  I thought I could convert it to congruences and work backwards, but as far as I remember, $a \equiv b \pmod{m}$ implies $a^n \equiv b^n \pmod{m}$, not the opposite, unless $m$ is prime. Is that right?  So I am not sure how to approach this one. Any ideas?  Thanks!


How I can remove duplicates of ArrayList?  If collection type is Car,  public class Car{  String Name; String Color; String Door; ... }   ArrayList carList = new ArrayList;  Remove duplicate of carList, but it removes if which elements same Name, Color, Door.  I want remove duplicate of arraylist by specific component. like Name.  If you know about this, Please help me.

I have an ArrayList<String>, and I want to remove repeated strings from it. How can I do this?


I'm working in ArcMap 10 and have been tossed an electrical system map drawn in CAD to recreate in ArcMap. In several sections, different line numbers share the same structures for long stretches. Many times these have the same voltage (which is what they are symbolized on). Is there a way for me to continue symbolizing these lines by voltage while showing 3 separate lines that are not stacked for one section, 2 separate for another, etc?

Some common problems with displaying routes created from street data, such as bus routes, include:   Routes may overlap themselves, such as when a route takes the same road in opposite directions Routes may overlap other routes that take the same street. Routes are often overly detailed, or "noisy", owing to their derivation from street data. Indicating a route's direction unambiguously without overloading it with arrows can be a challenge.   What are some techniques for dealing with these issues in order to create a practical and usable route map, such as this ? Do you know of any such public transport maps that were produced by automatic techniques rather than manual illustration/digitization?  Specifically I am using ArcGIS 10, but solutions involving other software are welcome as well.  One technique I have had some success with for dealing with 1) is using ArcMap's  with a negative offset -- assuming the lines are oriented in the direction of travel, this will offset the lines such that the right and left-hand sides are distinct and oriented as you would expect (at least for  countries, for left-hand traffic countries one would use a positive offset). However the result tends to be a bit wonky around turns, interchanges and and U-turns, and is inflexible when dealing with multiple routes.  Another possibility that I am not very familiar with but which seems promising is  -- however, I have not had much luck in finding examples of using representations for transportation maps and whether it might fit the bill.


If two photons were to collide directly, head on, and are of the same energy, what happens? Are new particles created, is energy released? Or do they just pass through one another?

Could someone explain to me what the collision of two photons would look like? Will they behave like,   Electromagnetic waves: they will interfere with each other and keep their wave nature Particles: they will bounce like classical balls   I assume that energy of that system is too small to make creation of pairs possible.


I'm planning to fresh install ubuntu with windows 7 running beside it. Could anyone give me tips on how to do this and which to do first? Also how exactly to partition.

I currently have Windows 7 on my computer and I want to install Ubuntu alongside Windows safely.  Could someone please provide clear instructions?


I want to create an instance just by defining the type for a generic class  public abstract class Base<T> {     private final T genericTypeObject;      protected Base(){           //Create instance of T here without any argument      } }   So that I just can call the default constructor:  public class Child extends Base<SomeClass>{     public Child () {         super();     } }   and the Base-class implementation will create me an instance of the GenericType.

Is it possible to create an instance of a generic type in Java? I'm thinking based on what I've seen that the answer is no (due to type erasure), but I'd be interested if anyone can see something I'm missing:  class SomeContainer<E> {     E createContents()     {         return what???     } }   EDIT: It turns out that  could be used to resolve my issue, but it requires a lot of reflection-based code, as some of the answers below have indicated.  I'll leave this open for a little while to see if anyone comes up with anything dramatically different than Ian Robertson's .


I've always wondered if it has something to do with the idea that the probability that an integer is divisible by a prime $p$ is $1/p$.

(surprisingly, it appears that this question has not been asked before)  Let $\pi(n)$ denote the number of primes $\leq n$. The prime number theorem states that   $$\pi(n) \sim \frac{n}{\log n} \  \text{as}  \ n \to +\infty$$  After painstakingly reading through Erdos's elementary proof of this theorem, I think I understand the mechanics of it from a formal perspective. However, I still don't seem to understand intuitively why this theorem is true. I would like some intuitive insight as to why this theorem holds.   I understand that for a result as deep as this one, even the intuition is going to contain some nitty-gritty details.  It's probably not the sort of thing that you could explain to a child, for example. Nevertheless, I will ask this question regardless. There has to be some convincing argument for this theorem beyond the technical details of the proofs.


Let's say you're going to apply for a mortgage and two of your options are getting a 10 year, fixed rate mortgage or a 30 year, fixed rate mortgage. As is standard, you'll have a lower interest rate and lower payments (say 4.50% and $1500/month) for the 30 year than you will for the 10 year (say 5.00% and $2000/month). In both cases, you do not receive a penalty for early payments.  My question is, is there a reason you might choose the 10 year over the 30 year? It seems to me that you can choose the 30 year and pay it off as early as you can, while taking advantage of the lower interest rate and the lower monthly bill in the event you can't overpay that month. All things being equal, it seems to me the 30-year is always a better choice to me.

I've found similar questions, but they all seem to focus on a preexisting 30 year mortgage and whether or not it makes sense to refinance to a 15.  My question is a bit different.  I have not yet bought a house but I am trying to decide which mortgage to go with.  As a result, I don't have to consider refinance fees and a change in interest rate.   The situation is that I can afford the payment on a 15 year mortgage and would prefer not to pay off a house for the next 30 years.  So I was going to go with a 15.  However, in looking at some mortgage calculators (which it is possible I am looking at incorrectly) it seems that there is no difference in getting a 30 year mortgage and just paying it off in 15 years.  The calculators seem to say that--assuming the same interest rate--you will pay the exact same interest over 15 years.  As a result, my thinking is, I can get the 30 and pay it like a 15.  If there really is no drawback then this gives me the ability to pay the normal 30 year payment if needed due to financial hardship (loss of employment etc.)  So my question is, am I missing something?  If not, why would anyone ever get a 15 year instead of just paying off a 30 year in 15 years?  In summary: Does it really cost the same amount of money overall to pay off a 15 year mortgage vs paying off a 30 year mortgage in 15 years?  PS: Please don't suggest taking the 30 year and investing the extra money.  I know this is an option and the one many would suggest.  However, for the purposes of this question please only consider 15 year vs 30 year paid off in 15.


I need to evaluate the integral $$\int \frac{\sqrt x}{\sqrt {a^2-x^2}}dx$$  I substituted $x=a\sin\theta$  Hence, the required integral is reduced to   $$\sqrt a \int \sqrt {\sin\theta}d\theta$$  However the integration of this function yields an elliptic function. Is there any way to integrate it so that it gives a more elementary function?

$$\int \sqrt{\sin x}\ \text dx$$   I asked my teachers and they said that this integration is pretty next level and will be taught in college. Can anyone help?


I know bounties on questions help in getting answers. But it is also possible that some people award bounties to get perfect answers but after getting the answer they do not accept it. Has this happened before? Can we do this? Legal or not?

It's possible to offer and award bounties of reputation on questions.   What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have?      See also:  in the Help Center


which one is correct?      1.I have bought three nails.    2.I have bought three pieces of nail.   is nail a material or common noun?  arm a proper noun or common noun?

I get stuck to differentiate between some common and material noun.  Can material noun be countable?   Are  egg, earth, nail, sun and moon material nouns?  when can I use article in front of a material noun?   I am not a native speaker.   Thanks in advance.


I have one fragment and ,when i click fragment button one base activity will open,base activity contain three fragments in tab format.according to activity tab button click fragment will change . Now I am calling an api in base activity and store response values in a temporary class  public class ListTempStorage {     private static final ListTempStorage myInstance = new ListTempStorage();     private List<MyListOne> listOne = new ArrayList<>();     private List<MyListOne> listTwo = new ArrayList<>();      private ListTempStorage() {     }      public static ListTempStorage getInstance() {         return myInstance;     }      public List<MyListOne> getListOne() {         return listOne;     }      public void setList(List<MyListOne> list) {         this.listOne = listOne;     }          public void setListTwo(List<MyListOne> listTwo) {         this.listTwo = listTwo;     }      public List<MyListOne> getListTwo() {         return listTwo;     } }   and in my fragments I am calling this list and populating these list values.  if (clicked == "butOne") {     List<MyListOne> listOne = ListTempStorage.getInstance().getListOne();     if (listOne != null && listOne.size() > 0) {         populateLayout(listOne);     } } if (clicked == "butTwo") {     List<MyListOne> listTwo = ListTempStorage.getInstance().getListTwo();     if (listTwo != null && listTwo.size() > 0) {          populateLayout(listTwo);     } }   The problem is first time its populating list, but if I change fragments according to my filter conditions some time I am getting old list values, its not updating. I think some memory leak happen there.

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


I want to define a function that takes a list as an argument and removes all duplicates from the list except the last one. For example: remove_duplicates([3,4,4,3,6,3]) should be [4,6,3]. The  answers do not solve this one. The function is removing each element if it exists later in the list. This is my code: def remove(y):     for x in y:         if y.count(x) > 1:             y.remove(x)                  return y  and for this list: [1,2,1,2,1,2,3] I am getting this output: [2,1,2,3]. The real output should be [1,2,3]. Where am I going wrong and how do I fix it?

Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:


I know theres probably a few different threads on this, but i feel this maybe a specific case...  I have somehow corrupted my copy of windows, as it now won't boot, and when i try to restore it, the restore file is corrupted. On top of this i cannot reset windows, as it constantly tells me there is a problem. When i was trying to find a way to boot my laptop, i was going through all the options, and realised that ubuntu was still on my laptop, although it does not ask my to boot into ubuntu when turning on. To get to ubuntu i have to press F11 when turning on my laptop, and after that click to boot from a USB or HDD etc... In that option menu is ubuntu, which when selected loads up. I now want to reset/remove my copy of windows but i'm not sure how i can do that from ubuntu.   Sorry if this is a little confusing, i'm struggling to describe it.  Thanks in advance.

I want to keep Ubuntu but remove Windows.


So I have done the impossible and managed to catch 101 magikarp which gets me a little over 400 candies. I can now evolve him into a gyarados (which I'm super excited about!) but my question is about evolution CP points. Is there a calculator or equation to use to determine what CP the gyarados will be? I have worked really hard to gain 400+ candies and want to evolve my magikarp at the best possible time. Does anyone know the CP cap for a magikarp? I am a level 16 and my magikarp is 124CP points.

I was just wondering if there is a set amount of CP gained by evolving a Pokémon or is it based on their level? Your level? Or random?  I just wanted to know if for example it made sense to evolve a Pidgey (CP 150) to a Pidgeotto then a Pidgeot.  To maximize my CP or should I just evolve my Pidgeotto  (CP162) to a Pidgeot.  Just looking for other insight on it.


I am trying to install the DNA-Analyzer  but I am running into a few issues. After following the advice in  I got the Promethease executable to run but it looks like the GUI is corrupted. Instead of characters I only see squares.  This is the corresponding output when running Promethease from a terminal:  nuc@nuc:~/Downloads$ sudo ./promethease python version 2.7.3 (default, Sep 26 2013, 20:13:52)  [GCC 4.6.3] using 64bit using frozen  /tmp/_MEIgwdF7c temp is /tmp/tmpAFAjuq I am: 0 terminal_interface loaded can't use mwparserfromhell argv ['/home/nuc/Downloads/promethease'] ui is starting wizard Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number UI logging to /home/nuc/Downloads/promethease.log CWD:  /home/nuc/Downloads Redirecting logging to /home/nuc/Downloads/promethease.log  (promethease:14629): Pango-CRITICAL **: No modules found: No builtin or dynamically loaded modules were found. PangoFc will not work correctly. This probably means there was an error in the creation of:   '/etc/pango/pango.modules' You should create this file by running:   pango-querymodules > '/etc/pango/pango.modules'  (promethease:14629): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'  (promethease:14629): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common' CWD:  /home/nuc/Downloads logged to /home/nuc/Downloads/promethease.log user interface completed with status=0   How can I fix these issues and get Promethease to work properly?

I want to update Acrobat Reader for Firefox, but the download has the .bin extension. How can I install it?


I would like to test if two means are significantly different from each other. I am using R and I do this:  t.test(SampleA,SampleB)   and I get output that looks like:  Welch Two Sample t-test  data:  SampleA and SampleB t = -4.4195, df = 84.117, p-value = .0197 alternative hypothesis: true difference in means is not equal to 0  95 percent confidence interval:  -16.214653  -6.160959   sample estimates: mean of x mean of y   6.44 18.25   My conclusion is that the means are significantly different because the p-value is < .025. I am using .025 as comparison because this is a two tailed test at the 95% confidence level. Is my conclusion correct?  Also - can you explain when to use a paired t-test. The test above is not a paired t test.

After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests.  It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results.  Many computerized tools report test results in terms of "p values" or "t values".  How would you explain the following points to college students taking their first course in statistics:   What does a "p-value" mean in relation to the hypothesis being tested?  Are there cases when one should be looking for a high p-value or a low p-value? What is the relationship between a p-value and a t-value?


I've been using the Boolean Modifier to union multiple meshes, but it often makes overlapping faces, that are criss-crossing each other, as shown in the image below:  Is there any way that I can remove the unnecessary faces?

Is there an easy way to remove overlapping faces? In the example remove doubles doesn't work  You might be able to do the following: A to select all faces. X > Only Faces. F to create faces, but after deleting the faces I'm left with something like this.  If I press A to select all and then press F to create faces then there are still overlapping. Blend file


I was a Windows 8.1 user. Recently I installed Ubuntu 14.04 and now I have both windows and Ubuntu. Both are running well without any issues. The problem is, while booting I can see two options for booting to Windows 8.1  1. Boot to Windows 8.1 on sda1  2. Boot to windows 8.1 on sda2  And both options are working as well. I don't know why there should be two options. How can I remove one? I tried Boot Repair, but no change. Need you guys to help me solve this.

I have Ubuntu installed alongside of Windows and in bootloader (grub) these operating systems as all of yours are with long names! How can I change the names in grub? for example I want to change the 4th one to "my fathers OS" and when I choose it in the grub it will go to the Windows.


When I am writing slides, I usually use one master file and several dependent files; as a macro package I use beamer. I would like to access the environments defined by the beamer package also in the dependent files (which I include through \input) through C-c C-e. I can access them in the master file. By the same token, I would like to access the macros in my macro packages, which I also include through \input. My .emacs file contains the lines  (setq-default TeX-master nil) (setq TeX-parse-self t) (setq TeX-auto-save t)   Any suggestions?

I would like AUCTeX (that is, Emacs with auctex loaded) to suggest more LaTeX macros when using completion (M-Tab or C-Ret) than it does by default. I would like to have macros from packages I have downloaded on CTAN and macros I have written. I would also like it if it would complete \section or other macros that can be accessed via C-c C-s, C-c C-e etc.  Solution: I could not make the code quoted by  work. i get an error on loading emacs but did not looked much further in because I ca bear the nuisance of appending a few lines to my files.  The link given by Ben ( contains a working solution, thus I accept his answer. I had come across this page in my researchs but somehow messed up things. What eventually worked for me was using TeX-auto-generate TEX AUTO to create a bunch of .el files in the ~/.emacs.d/auctex/auto direcoty. Note that this directory must be created beforhand. For some reasons TeX-macro-private did not achieve the wanted result.


I really like  systems management system but I have no IT  budget to purchase M/Monit interface which is used to manage multiple hosts for our small university lab. I have checked out Ruby based   and I see that Django people are cooking something. Can  anybody give me some advice to a simple wrapper which can help me  pull info from  multiple servers?    Edit: How is this question duplicate? I am not asking about monitoring  tools. I have evaluated probably half dozen of those in the past two  weeks. I am asking a very specific question about a very specific  monitoring tool. I concede that as unpleasant as it might be the  comment I received from  ewwhite was a valid observation.

For a more comprehensive list of monitoring tools and their features, check out .   As the question states, what are the most commonly used tools used for this task and what are their strengths and weaknesses?


It's not uncommon to have multiple profiles on bitbucket and/or belong to multiple teams. For example to be part of the company team as well as having a separate blog profile (for demo projects) and a personal profile.   careers.stackoverflow.com should allow to either import multiple profiles from bitbucket or should also add all projects of all teams the person is part of. Actually I think both should be added.  This problem is made worse by bitbucket's decision to disallow team logins. So I cannot even switch to a team for granting careers.stackoverflow.com access. I'm limited to a profile without any interesting projects.

I am involved in a project on  that is not mine. Nevertheless, my team added me to the project as author.  On  2.0, I am only able to add project I created (so within my "namespace"), or project of other I forked.  I don't know how far you track users and their project, but I think it could be fair to be able to link on a team project where the user is the author but not the owner.


If I run  export TEST=script.py echo $TEST   It outputs script.py  script.py code:  return 5   can TEST be set to 5? Obviously script will do something in future not just return a number

I have an operation using cut that I would like to assign result to a variable  var4=echo ztemp.xml |cut -f1 -d '.'   I get the error:     ztemp.xml is not a command   The value of var4 never gets assigned; I'm trying to assign it the output of:  echo ztemp.xml | cut -f1 -d '.'   How can I do that?


Hoping someone can help me here with this issue I'm having. Wine isn't working on my Ubuntu 14.04LTS so I want to completely remove it and install from the software manager  Code I'm using is as follows  sudo apt-get purge wine   Which shows  wine            wine1.6         wine1.6-amd64   wine1.6-i386    wine-gecko2.21  wine-gecko2.34  wine-mono0.0.8  wine-mono4.5.4  winetricks   So When I go to unistall using  sudo apt-get remove wine1.6 --purge --no-install-recommends   It uninstalls wine1.6 all fine but also then installs another version  The following NEW packages will be installed   wine1.8 wine1.8-amd64 wine1.8-i386:i386   My question is how can I prevent wine1.8 from being installed as I want wine removed completely. Sorry if this is really simple I'm new to ubuntu and learning slowly  Thanks, Youlethal

How can I remove the wine folder and all the applications in that folder?  I've tried via synaptic but it keeps showing up in the application menu.


I tried to research for this, but nothing was clear to me. I'm a true newbie when talking about coding, as it has been a while I don't work with it. All I've found was VB, and some weird hex registry entries fiddling on Windows' .lnk shortcuts.  What I'm trying to figure out: If it is possible to create global shortcut .lnk files (using wildcards or Regex), so that way I could make a portable app, place a shortcut on the upper directory, and zip it, hence the software which is within the folder among a bunch of files don't become a mess to find/run.  I found a few system variables which can be used to open on specific Windows directories (like %ProgramFiles%, %WinDir%, %HomeDrive%, %HomePath%, and etc), but nothing so reasonable. Also found some cmd commands in order to create them, but not so sure about symbolic and hard links (how to use them in syntax).  I've made a few autorun.inf and .bat files that opened sub-directories, but I couldn't figure out how to do it with .lnk files.  Then, in terms of dummies, is there an easy way to do that?  Thanks.  EDIT: Went a little further on my research and figured out that it's related directly to symbolic links and directory junctions. Found this thread, which gave me a few more informations:      Here are some useful links from my research:

I have a folder scheme like (highly simplified version):  New Files  >Tools  >Scripts Tested Files  >Tools  >Scripts   ... and I'd like to have a shortcut in each folder from the "New Files" child folders, to the "Tested Files" child folder. But this folder may be moved around from time to time, which would break said shortcuts.  Is there a way to make a relative shortcut to each folder? I remember doing this in HTML where you could set a path, something along the lines of .../Files to go back to a parent and then into a new folder, but I'm unsure if this is something support under Windows shortcuts?  PS: The case of similarly relative shortcuts, when the target is a file, is dealt with in . In the present case the target is a Folder.


I'm a newbie to Ubuntu. When I was trying to install Ubuntu 12.04 on my laptop, I chose one of major partitions (60G) which contains lots of important files as a swap space. After completing the system installation, I found I had no access to all my files in that partition. That really makes me frustrated. Can someone tell how to copy or recover my files from that partition. Thank you very much!

This is what happened:  I was running 12.04.1 and wanted to install 12.10. upgrade, but a fresh install.  When setting up my computer I anticipated for this by dividing my 640GB HD in following partitions: 1. 60 GB for Ubuntu, boot 2. 576 GB for data, mountpoint /home 3. swap, 4GB  The idea was to manually select the correct partition in the installer but I got distracted for a moment and selected the wrong option.  Result: The installer started repartitioning the entire HD.  When I noticed this I interrupted the installer, but upon reboot it was clear that I was too late, no OS to boot to.  I booted from a Gparted Live CD to see if I could recover the data on my previous /home-partition, but it's gone.  Is there any way to recover the lost data? I searched around and read alot about Testdisk, but in all the tutorials I've seen, the set-up has been much easier than what I'm facing.  I've not only lost my partition table, it's been replaced.  Thanks in advance for any ideas that might help!  If extra info is needed, please specify and I will do my best to provide.


I have an e-Visa for Canada in a passport that was damaged. I applied for and received a new passport. Can I still use the approved visa for Canada, or do I have to apply for a new one?

I recently renewed my passport. I also have an expired passport which has my Canada visa (visitor's) valid for another three years. I have already used my Canadian visa which is multiple entry. I am planning to visit Canada this summer.  Since my valid Canadian visa is in my old/expired passport, do I need to renew/transfer my Canada visa or can I simply travel with valid visa in old passport?


Regarding the wonderful 2016 news about gravitational waves.  Travel time in one arm of the LIGO is ~ 30μs.  A gravitational wave affects the arm for some few hundred of these laps.  Then for example as  "the arm changes length ... subsequent wavecrests will have had successively further to travel and so there is a phase lag that builds up ..."  But we always use the language that gravitational waves are affecting the spacetime metric.  I just don't see how the phase ("speed") can change if the spacetime metric is changing.  Let me put it this way:  Say I said (A) "gravitational waves stretch and squash objects - amazing!".  Say a physicist says (B) "gravitational waves stretch and squash the spacetime metric - amazing!"  What really is the difference between saying "A" versus "B", and, what is it in the experiment that shows us "B" happened, not "A"?  In other words, say we deliberately merely did "A" - using say a really precise bulldozer chained to one end of the tube - what specifically would we look at in the signal and conclude "oh, that was merely 'A' - not actually 'B'".  Or indeed are "A" and "B" indistinguishable?

Imagine yourself and anything you're able to perceive to be drawn onto a rubber band. Any means of determining distances would be affected by the stretching/contracting of the rubber band. The relation between any two lengths would remain exactly the same because every length is increased/decreased by the same factor as the band stretches/contracts. According to my understanding, that is what the dilation/compression of space is like for us and why it should not lead to any change in distance.  This also applies to relational measurements of length as they are performed, for example, by devices like LIGO. Although the deformation (e.g. gravitational waves) propagates only in one of two directions of measurement, the relation between both lengths should not be affected because none of the individual lengths should be affected.  Accordingly, anything that travels the four kilometers in LIGO should take the exact same amount of time, no matter whether space is currently stretched or compressed. The speed of light being constant should be irrelevant in this this case.  If gravitational waves stretch space itself, how can they have an effect on the interference of two laser beams? According to my understanding, compression or dilation of space itself (as opposed to something in space) should not affect the distance between two points.  Disclaimer: Obviously, the above is not true. It's just how I thought is was. Hopefully, it helps to see where my understanding went awry.  ————  In this question (  ), the problem I had has actually been solved. It comes down to the fact that atoms (because of the non-gravitational forces holding them together) are in fact not affected by spacetime deformations. This makes these deformations detectable.


I keep mixing them up, because they are very similar.  Some contrapositives resemble some contradictions.

What is the difference between a "proof by contradiction" and "proving the contrapositive"? Intuitive, it feels like doing the exact same thing. And when I compare an exercise, one person proves by contradiction, and the other proves the contrapositive, the proofs look almost exactly the same.  For example, say I want to prove: $P \implies Q$ When I want to prove by contradiction, I would say assume this is not true. Assume $Q$ is not true, and $P$ is true. Blabla, but this implies $P$ is not true, which is a contradiction.  When I want to prove the contrapositive, I say. Assume $Q$ is not true. Blabla, this implies $P$ is not true.  The only difference in the proof is that I assume $P$ is true in the beginning, when I want to prove by contradiction. But this feels almost redundant, as in the end I always get that this is not true. The only other way that I could get a contradiction is by proving that $Q$ is true. But this would be the exact same things as a direct proof.   Can somebody enlighten me a little bit here ? For example: Are there proofs that can be proven by contradiction but not proven by proving the contrapositve?


The inequality $\binom{n}{k} \leq \left(\frac{en}{k}\right)^k$ is very useful in the analysis of algorithms. There are a number of proofs online but is there a particularly elegant and/or simple proof which can be taught to students? Ideally it would require the minimum of mathematical prerequisites.

This is from page 3 of  ().  Copying the relevant segment:     Stirling’s approximation tells us $\sqrt{2\pi n} (n/e)^n \leq n! \leq e^{1/12n} \sqrt{2\pi n} (n/e)^n$. In particular we can use this to say that   $$ {n \choose k} \leq \left(\frac{en}{ k}\right)^k$$   I tried the tactic of combining bounds from $n!$, $k!$ and $(n-k)!$ and it didn't work. How does this bound follow from stirling's approximation?


Is there any way to auto-generate Python code in QGIS meanwhile I do clicks, so at the end I can copy/edit it the way I want?

I would like to use python console in QGIS to automate tasks. Is there something like a macro recorder in MS Office to get the python commands?


I need to move the highlighted uv's down. This i can do fine but they will no longer be apart of that uv island, joining the new island at the bottom and creating new seams. Is there anyway to move them without creating new seams and keep them apart of the original island?  I tried spltting with Y but it creates new seams. This will be exported to srouce filmmaker and the new seam creates creases becuase of the way source light works with uv. This is before i split, then after i split and joined with the lower island. Blender creates new seams and thats what im trying to avoid, if its possible  Thanks in advance

How do I break the selected UV map from its surrounding vertices?


My aunt Diana is married to a man named Evens, he’s legally my uncle. They have two daughters named Daili and Diane whom are my cousins. Daili and Diane have a cousin named Daniela who is Evers niece. Is there a relation between me and Daniela? I’m assuming we’re not related but I’m just curious if there is a term.

I was wondering what the official term for the relationship described below is.   So My Grandparents D & F had two sons: T & E. T is my father. E married L and had three kids: P, E, & A which are my cousins.    Now L has a sister S (P,E, & A's Aunt) who has two kids C & B (P, E. & A's Cousin).   Now what is the official term for C & B in relation to me?


I have a question about joint distributions and i'm really struggling to find a solution: $X$ and $Y$ are two independent random variables with $X \sim Exp(\lambda)$ and $Y \sim Exp(\mu)$. Suppose that we don't know the value of $X$ and $Y$, instead we observe the random variables $Z$ and $W$, where $Z = \min(X, Y)$ and  W=\begin{cases} 1,  & \text{if  $Z=X$} \\ 0, & \text{if $Z=Y$} \end{cases} I find the joint distribution for $\mathbb P$($Y>X>z$) = ${\frac{\lambda}{\lambda+\mu}}\cdot{\mathrm e^{-(\lambda+\mu)z}}$ and for $\mathbb P$$(X\gt Y\gt z)={\frac{\mu}{\lambda+\mu}}\cdot{\mathrm e^{-(\lambda+\mu)z}}.$ Now i have to find the marginal distribution of $Z$ and $W$ but i don't know how to build the integral for it, especially for $Z$. I appreciate any help. Thank you in advance

Assume that $X$ and $Y$ are independent random variables with $X \sim \exp(\lambda)$ and $Y \sim \exp(\mu)$. It is impossible to obtain direct observations of $X$ and $Y$. Instead, we observe the random variables $Z$ and $W$, where $Z = \min\{X,Y\}$ and $W =1$ if $Z=X$ and $W=0$ if $Z=Y$.  How to find the joint distribution of $Z$ and $W$?


I put a 500 point bounty on this question and think I was dumb about it:    In almost a week, no answers, and no comments.  I don't even think there was a boost in visibility than if I did a much smaller bounty.  Perhaps the best thing I should have done is to boost it for several weeks with a 50 point bounty  My understanding is that the outcome will either be   I lose the 500 points.  No benefit to the community, a huge rep loss for me. Someone posts a low quality answer that gets naively upvoted or via a puppet account...  The bounty is awarded to a poor answer that doesn't really help   My question is; what are my options if this were to occur?    Can I extend the duration of the bounty artificially?  Can I get a mod-level reissue of the rep, or an extension to this question?  I do think an answer to this question would benefit many C# developers interested in cryptography or Bitcoin, and think that whatever outcome results in a complete answer would be greatly beneficial for the community.

It's possible to offer and award bounties of reputation on questions.   What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have?      See also:  in the Help Center


says that the (enemy) bugbear is part of the combat when he knows about it.   says you can only be surprised at the beginning of combat.  Could the unnoticed bugbear wait until every enemy the party knows about is dead, and then attack to surprise them? Basically, when does an encounter end, and when does another start?

In most circumstances, it is easy to determine when turn based combat ends:   One side is completely killed, unconscious or has fled All parties declared truce   But when in a hostile area, like a Dungeon, do you end turn based action after each chamber with an encounter or do you stay in it for the whole crawl?  This is relevant because there are various effects in the game where you gain a bonus each time you roll initiative or depending on whether an enemy already acted.  As an example:  When you are in a dungeon or building completely filled with enemies and the PCs just cleared a room from enemies, but they don't know whether there are enemies in the next room and if there are whether they have noticed the sounds of battle.  Do you keep them in round based action, because maybe the door opens and enemies enter? Or do you leave it and possible give away that there is no nearby danger or have to reroll initiative when enemies enter the room (and give them the corresponding bonuses).


I am unsure as to where to start with this problem. The way I read it is that $f^{-1}(f(A)) ⊃ A$ means that $A$ is a subset of the preimage of the image of $A$. But I am unsure.

More homework help.  Given the function $f:A \to B$.  Let $C$ be a subset of $A$ and let $D$ be a subset of $B$.  Prove that:  $C$ is a subset of $f^{-1}[f(C)]$  So I have to show that every element of $C$ is in the set $f^{-1}[f(C)]$  I know that $f(C)$ is the image of $C$ in $B$ and that $f^{-1}[f(C)]$ is the pre-image of $f(C)$ into $A$.  Where I'm stuck is how to use all of this information to show/prove that $C$ is indeed a subset.    Do I start with an arbitrary element (hey, let's call it $x$) of $C$? and then show that $f^{-1}[f(x)]$ is $x$?  I could use a little direction here...  Thanks.


Whenever we talk about different realities/universes in the Marvel multiverse, they are always referred to by a designation of "Earth" followed by some number.  The standard Marvel comics universe is Earth-616.  The Marvel ultimate universe is Earth-1610.  The Marvel Cinematic Universe is Earth-199999.  But all of these "Earths" involve planets other than Earth, and species other than humans.  We have the "gods" of Asgard, we have the Kree, Thanos, Skrulls, Chitauri, etc.  So why does Marvel refer to "Earth-616", rather than "Universe-616"?    I'm asking about the real-world reason, here.  For example, did the first alternate-universe storyline in Marvel history take place before any alien planets or species were introduced into Marvel's comics?  That would make sense, but I doubt it's true, so what's the real reason?

I've found conflicting sources over who initiated the idea of Marvel's Multiverse having numbered universes.  Some say Alan Moore's Captain Britain was the first to use Earth-616, whereas others indicate it was fan-created from Fanzines: with Mark Gruenwald's Omniverse being the frontrunner.  Who is responsible for creating the universe designations? Is there any credible information on their development?


I want to get the row count of a ResultSet.  ResultSet rs; Statement s; rs=s.executeQuery("SELECT * FROM mytable");  //rs.getRowCount; ???

I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance?  I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers.


I actually like and use Firebug for web development every single day; sure it is slow on boot for Firefox but I love Firebug once the browser is up. (Update this has been resolved in later editions)  Firefox 10 has a new Inspect and developer mode - it is pretty much like Google Chrome - I don't like it, you cannot edit on page CSS, you can't edit text and tags simply like Firebug - I would be on Chrome now if it fully had Firebug.  How can I disable firefox inspect? How can I disable the inspect mode in chrome? (I would rather use the light firebug)

This is driving me crazy! When FF 12 came out, Firefox's own 'Inspect Element' button on the right-click menu took the place of there the Firebug 'Inspect Element' button used to be.  As I've been doing web development in Firefox forever, my muscle memory still clicks there when I want to use Firebug.    Is there any way to remove the Firefox internal 'Inspect Element' and replace the button on the menu with Firebug's, returning it to its original position (marked NO in the screenshot)?


I have a variable like this: var currency = "4,990.17" currency.replace(/[$,]+/g,""); var currency2 = parseDouble(currency)-0.1;  How can I set currency2 to be hexadecimal with 0x in front of it? I would like my string hexadecimal value of 4999.17 to become:  0x137E.2B851EB851EB851EB852

How do you convert decimal values to their hexadecimal equivalent in JavaScript?


What is the meaning of the underscore in template prototyping? That is the example of template:  template<typename _Tp> _Tp* Mat::ptr(int i=0)   Why people add underscore before Tp?

It's common in C++ to name member variables with some kind of prefix to denote the fact that they're member variables, rather than local variables or parameters. If you've come from an MFC background, you'll probably use m_foo. I've also seen myFoo occasionally.  C# (or possibly just .NET) seems to recommend using just an underscore, as in _foo. Is this allowed by the C++ standard?


I seem to be excessively over analyzing the superior manner in which the sentence ought to begin. The proceeding phrases are what I need advice with, so as to decide the proper wording, to initiate the sentence opening. I'm simply asking what would be most applicable or appropriate sounding version of the two...

Which is grammatically correct?  I can only do so much in this time.  or  I can do only so much in this time.