Consider the following situation. The PCs are going along a road when they meet some NPC bandits. At first there is just tense negotiations, but no actual combat, until at one point in the negotiations Bob, the party's ranger, says he wants to shoot his bow at one of the bandits. What happens?   Do you have everyone roll initiative, and Bob doesn't get to resolve his attack until his turn comes up in the initiative order? If so, and the bandits roll highest on initiative, then what do the bandits know on their first turn? Do they know that Bob is about to shoot, or that some PC is about to do something? Or as far as they're concerned, nothing unusual has happened yet, so they will probably just keep talking? Or do you resolve Bob's shot first, pre-initiative, and then roll initiative and go in order? (So Bob could potentially get two shots in a row if he also rolls highest on initiative - both his "pre-initiative" shot and his regular shot? If Bob can act "pre-initiative" in this way, does he get a whole round's worth of actions "pre-initiative", or just one action?   The surprise rules in the PHB don't seem to cover this type of situation. The surprise rules seem to cover e.g. ambush situations where one side doesn't see the other; in this case, both sides clearly see each other and are aware that a fight could potentially break out. (Would the result be different if both sides saw each other but one of them wasn't aware that a fight could be imminent? For instance, rather than tense negotiations with bandits, let's say that the PC and NPC were sitting next to each other in a tavern, and all of a sudden the PC just decides to take a swing at the NPC.)

Just before confrontations with the "boss" of a dungeon or adventure, I often like to ham it up a bit and let the BBEG-of-the-week gloat a bit about how brilliant their plan is, or what a thorn in the side the PCs have been, or about how the PCs will never win, etc. Usually this is pretty brief, but it sets the tone of the encounter, and generally allows the players a window to say anything they wanted to say before we start the final combat. It also gives the players a chance to ask questions in case they missed something about the plot and they'd like it cleared up in-game.  Usually this goes just fine, and the players seem to generally like it, but sometimes a player who doesn't quite fit the narrative-focused mindset of the rest of the party gets a little restless and throws the first punch. Again, usually this doesn't happen, but occasionally it does.  If a player decides to do this in a given speech, how should I respond? I've defaulted to making everyone roll initiative when a player says they attack in a situation like this. After all, I don't really want to reward the players for attacking in the middle of dialogue, since I (and most of the players) find the dialogue to be really fun, and it mostly exists for the players' benefit, anyway. Besides, when the villain finally attacks, they don't get a surprise round -- their attack just means everyone has to roll initiative.  On the other hand, I feel like the player who threw the first punch might feel a little cheated in not getting a free shot off. They might be trying to have a cool moment of emulating Han Solo, blasting the enemy when they're caught off-guard gloating. Since I make them roll initiative, though, I rob them of this moment and Greedo might get the first shot off, anyway.  So, in this situation, should the player who fires first get a surprise round, or am I handling it correctly in making everyone roll initiative?  5e is the relevant edition, here. Quoting the rules is nice, but I'll take a well-reasoned argument for one way of playing or the other over a strictly RAW answer.


I have this problem here, I want to check if the value of the input is going to be a number or not on keyup. Any help would be appreciated.    $('input').keyup(function () {  var check_nm = $('input').val();  if(check_nm != "123"){    console.log('not number');  }else{    console.log('is number');  } });

What's the cleanest, most effective way to validate decimal numbers in JavaScript?  Bonus points for:   Clarity. Solution should be clean and simple. Cross-platform.   Test cases:  01. IsNumeric('-1')      => true 02. IsNumeric('-1.5')    => true 03. IsNumeric('0')       => true 04. IsNumeric('0.42')    => true 05. IsNumeric('.42')     => true 06. IsNumeric('99,999')  => false 07. IsNumeric('0x89f')   => false 08. IsNumeric('#abcdef') => false 09. IsNumeric('1.2.3')   => false 10. IsNumeric('')        => false 11. IsNumeric('blah')    => false


Is there a way to update a column in mysql if value is number only?  ie. UPDATE myTable SET ColumnA =NewValue WHERE ColumnA isnumeric  Column A is varchar(25) and Column A value may be text or 1 or 2 or 23...  thank u

I see that within MySQL there are Cast() and Convert() functions to create integers from values, but is there any way to check to see if a value is an integer?  Something like is_int() in PHP is what I am looking for.


I took my CS-1 course in C++ and I'm now at a new university and they use Java here. I've been learning the new syntax and doing my old C++ labs and I've hit a wall with a pass-by-reference one.  My understanding so far is Java is pass-by-value but how can I achieve the goal of this problem?     Write a program that tells what coins to give out for any amount of change from 1 cent to 497 cents. Since we wouldn’t use pennies, we need to round any cents to near 5 or 10’s. For example, if the amount is 368 cents, the rounded number is 370 cents and if the amount is 367 cents, the rounded number is 365 cents. The change would be 1 toonie (two dollar coin), 1 loonie,  2 quarters, 2 dimes for 370 cents. Use coin denominations of 2 dollars (toonie), 1 dollar (loonie), 25 cents (quarters), 10 cents (dimes), and 5 cents (nickels). Your program will use the following function:  Void computeCoin(int coinValue, int &number, int &amountLeft);       Note that this function needs to return two values so you must use reference variables.      For example, suppose the value of the variable amountLeft is 370 cents. Then, after the following call, the value of number will be 1 and the value of amountLeft will be 170 (because if you take 1 toonie from 370 cents, that leaves 170 cents):  computeCoin(200, number, amountLeft);       Print the value of number with the coin name before you make the following call:  computeCoin(100, number, amountLeft);       and so on. Include a loop that lets the user repeat this computation for new input values until the user enter the sentinel value to stop the program.    In C++ I could just use reference variables and the value of the coin could be changed. So far what I've learned is that objects is a way to use references, I don't know how to really go about this or if there is a better way. I've included the C++ code here:  #include <iostream> using namespace std;   void computeCoin(int coinValue, int & number, int & amountLeft);  int main() {     int number, change, amountLeft, remainder;     do    {        cout << "Enter the change (-1 to end): ";        cin >> change;    while (change>497)   {       cout << "The change should be less than 497. Try again.\n\n";       cout << "Enter the change (-1 to end): ";       cin >> change;   }    if (change != -1)   {      // round to near 5 or 10's      remainder = change % 5;      if (remainder <= 2)         amountLeft = change - remainder;       else         amountLeft = change + 5 - remainder;       if (amountLeft == 0)         cout << "No change.";      else      {          cout << amountLeft << " cents can be given as\n";           // compute the number of toonies          computeCoin(200, number, amountLeft);          if (number>0)             cout << number << " toonie(s)  ";           // compute the number of loonies          computeCoin(100, number, amountLeft);          if (number>0)             cout << number << " loonie(s)  ";           // compute the number of quarters          computeCoin(25, number, amountLeft);          if (number>0)             cout << number << " quarter(s)  ";           // compute the number of dimes          computeCoin(10, number, amountLeft);          if (number>0)             cout << number << " dime(s)  ";           // compute the number of nickels          computeCoin(5, number, amountLeft);          if (number>0)             cout << number << " nickel(s)  ";       }          cout << endl << endl;       }    } while (change != -1);     cout << "\nGoodbye\n";    return 0;  }  void computeCoin(int coinValue, int &number, int &amountLeft) {    number = amountLeft / coinValue;    amountLeft %= coinValue; }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


im a bit stuck in my understanding of this  I have 2 tables ...'games' and 'teams'  **teams**  teamID,teamName 1, Bears 2, Steelers 3, Giants 4, Bengals ...   **Games**  gameID,awayTeamID,homeTeamID 10, 1,2 20, 3,4   Im trying to write a query where I will return the games, but bring back the teamNames of both the home and away team also (or even 'instead', as I dont actually need the IDs in the final query)  I tried an INNER JOIN, and if I link .. 'games.homeTeamID=teams.teamID' then it will successfully bring back teamID into my query ...However, i need to do the same with 'awayTeamID'  so i tried 2 INNER JOINS  SELECT * FROM games INNER JOIN teams on games.awayTeamID=teams.teamID  INNER JOIN teams on games.homeTeamID=teams.teamID    But naturally I get an SQL error as im trying to join to same item twice  #1066 - Not unique table/alias: 'teams  .. I want my query result to look like this  gameID,awayTeamID,homeTeamID,awayTeamNAME,homeTeamNAME, 10, 1,2,Bears, Steelers 20, 3,4,Giants,Bengals   or   gameID,awayTeamNAME,homeTeamNAME, 10,Bears, Steelers 20,Giants,Bengals   ...of course awayTeamNAME and homeTeamNAME dont exist yet though so this is a problem :-)  Apologies if this is a really simple issue, but does anyone know how I can reference the same item in the teams table for 2 different result objects?  Any help would be greatly appreciated

I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).  the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.  Simple.  Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.  But how would I make it echo out the 2nd domain name, in the dom_rev_from column?


I'm less familiar with Enterprise and Voyager, but in TOS, TNG, and DS9 I have repeatedly seen Star Fleet officers engaged in melee combat perform this awkward and slow-looking attack where they clasp both hands together and swing at their opponent. At times it looks like they are trying to chop wood with no axe, hitting the opponent from the side. Other times, it looks like they are playing volleyball extra vigorously, uppercutting their enemy with both hands.  If this were just in TOS, I would assume it was just the choreography of the day. However, it is still present in the more modern incarnations of the show. Is this part of a fictional martial art that is used by Star Fleet (and possibly others? I can't recall if, for example, I have ever seen klingons use this technique), or is it part of a real martial art? If there is no canon explanation (i.e. this move is not part of either a real or a fictional martial art), then why did they continue to use such awkward choreography in the more modern series?

The hand to hand combat prowess of STNG Starfleet's security personnel is lauded by Tasha Yar in the accepted answer to .      Tasha: I think you should know that there is no physical training   anywhere that matches Starfleet, especially its security people.   It is likely combat training evolved during the time elapsed between TOS and STNG, but Kirk definitely had specific moves which he seemed to be trained in and repeatedly used during his 5 year mission.     While some of the moves are identifiable, I find it difficult to pin a label on the double handed, flying hip check, style William Shatner utilized in his portrayal of James Kirk. According to canon, is Kirk practicing , and if so, what is it?


I have a Windows 10 Home PC that is often unattended but doing important work. The work follows no particular schedule, and may take place at any time of day or night.  As things stand, Windows 10 (anniversary update) is configured to automatically restart and install updates during inactive times. The user can configure the inactive times, but the OS forces the user to have no more than 12 active hours a day. This means that the machine may well choose to restart at a time that is highly disruptive to our work and when there is no user around to prevent the restart.  For this reason, I would like to ensure that Windows never automatically restarts. How can I achieve this?

This questions has been answered previously, e.g. , but all the answers I've seen require using a dropdown in Settings> Update & Security> Advanced Options.  On my version of Windows 10 Pro, there is no such dropdown:    How can I prevent automatic restarts?


I can reproduce this 100% reliably. We have two Dell XPS 13 laptops, both running Ubuntu. If one is placed on top of the other (the bottom one is closed, the top one is open), the one on top will shut down. If we restart it, it will shut down again within a minute or two. The two computers are the same model. All it takes to make the shutdown happen is for one computer to be on top of the other—no other action needed. There must be some communication going on between them, but what? And why is the top one shutting down? Any ideas?

My Toshiba laptop turns it's display off when I put my smartphone or my soundbar next to it. If I remove them, the display turns back on. How can I fix this?


I have been having difficulty configuring applications in 18.04 to access file systems and mounts. I am not a frequent Ubuntu user although I know Linux in general well.  In this case the application 'vuze-vs' installed from snap will not show any folders or file systems I have created after installation. I have given the folders permission to access using my user, vuze runs as this user as well. The standard chmod 777. I can access the folders and mounts from my user via cli. Create and remove files no problem.  When browing in vuze to configure the file destination though these locations are not in the select lists....  Any pointers on what is going on here? If I was using CentOS I would think it is a selinux context type of issue. Or I may be of the mark completely.

I have Ubuntu 18.04 LTS installed. I inserted USB-flash to my laptop. It was automounted to /media/username/DISKLABEL and opened in Nautilus. I can read and write objects to it. How can I access it from the application, which is installed as Snap? I tried snaps of the following applications such as gedit, arduino-mhall119, organize-my-files. All them show me errors if I navigate to /media folder:    Could not read the contents of Media Error opening the directory of '/media': permission denied  Output of active Snap  is below: $ snap interfaces  | grep -v ".*-$" Slot                             Plug :browser-support                 organize-my-files :core-support                    core:core-support-plug :cups-control                    gedit :desktop                         gedit,organize-my-files :desktop-legacy                  gedit,organize-my-files :gsettings                       gedit,organize-my-files :home                            arduino-mhall119,gedit,organize-my-files :network                         arduino-mhall119,gedit,organize-my-files,pulsemixer :opengl                          organize-my-files :pulseaudio                      organize-my-files,pulsemixer :unity7                          arduino-mhall119,gedit,organize-my-files :wayland                         gedit :x11                             arduino-mhall119,organize-my-files,pulsemixer gnome-3-26-1604:gnome-3-26-1604  gedit gtk-common-themes:gtk3-themes    gedit gtk-common-themes:icon-themes    gedit gtk-common-themes:sound-themes   gedit -                                arduino-mhall119:serial-port -                                gedit:avahi-observe -                                gedit:mount-observe  Updates:  connecting mount-observe to Gedit with snap connect gedit:mount-observe does not help. it seems that we need special Snap with support of  interface.


When using compound words, their mean can still be retained when "de-compounding" them in one of two ways.      The first way: bookstore = store of books   For this compound word, one just adds an "of" in between the two parts of the word which were compounded and the words still retain the original meaning, however, this doesn't apply to all words. And for that there is the second kind of "de-compounding" word.     The second way: racehorse = Horse for racing    For this second way, it wouldn't make sense to say horse of racing because the horse itself isn't made of racing.  What is the name of this kind of distinction and why is there this difference within language?

Please note: This may be a complex question, references would be great, search engines do not help with "of the".  Looks like we can remove the use of "of the" with a noun adjunct switching the order of a couple of names, at least sometimes. Examples:   The name of the hotel → The hotel name The handle of the teapot → The teapot handle The use of the "of the" digram → The "of the" digram use The use of the digram "of the" → The digram "of the" use (?) The dog of the house → The house dog (?)   Looks like sometimes (when?) we need the use of the Saxon genitive. Examples:   The dog of John → John's dog. The bag of the child → child's bag The beginning of the day → the day's beginning (?) The mistakes of the people → people's mistakes (?)   The questions are:   First and foremost: is this correct? (or "what is incorrect here?") Which use is preferred? Using "of the" or the noun adjunct. What rules apply in this context? There may be some cases when the only correct option is using "of the", are there such cases?


I want to prove the following equality where $A(k,m)$ is the Eulerian number :   $$\forall k\ge0,\sum_{k=0}^{\infty}n^k x^k = \frac{\sum_{m=0}^{k-1}A(k,m)x^{m+1}}{(1-x)^{k+1}}$$  I previously proved that the two following identities are equivalent.  \begin{align*} \sum_{n\ge0}a_nt^n &= \frac{\sum_{j=0}^{k}\beta_jt^j}{(1-t)^{k+1}} \\ \forall n\ge0 , a_n &= \sum_{j=0}^{k}\beta_j\binom{n+k-j}{k} \end{align*}  It is advised to use this previous result to prove the equality. Since I only had a combinatorial definition of the Eulerian numbers, I managed to prove the closed-form expression : $A(n,m)=\sum_{k=0}^{m+1}(-1)^k \binom{n+1}{k} (m+1-k)^n.$ So by using the closed-form expression for Eulerian numbers and the previous equivalence I need to prove that :  $$\forall n\ge1 , n^k = \sum_{j=1}^{k} \sum_{i=0}^{j} (-1)^i\binom{k+1}{i}(j-i)^k\binom{n+k-j}{k}$$  But I have no idea how to go further, I don't see how it is an improvement to prove the original equality.

The  of order $s$ are defined by $$\mathrm{Li}_s (z) = \sum_{k \geqslant 1} \frac{z^k}{k^s},  \quad |z| < 1.$$ From the above definition, derivatives for the polylogarithms immediately follow. Here we have $$\frac{d}{dz} \mathrm{Li}_s (z) = \frac{\mathrm{Li_{s - 1}}(z)}{z}.$$ When $s = 0$ the following series which is geometric results $$\mathrm{Li}_0(z) = \sum_{k \geqslant 1} z^k = \frac{z}{1 - z}.$$ Starting with the expression for $\mathrm{Li}_0(z)$, repeated application of the derivative rule allows explicit expressions for the polylogarithms to all negative integer orders to be found. The first few are: \begin{align*} \mathrm{Li}_{-1} (z) &= \frac{z}{(1 - z)^2}\\ \mathrm{Li}_{-2}(z) &= \frac{z(1 + z)}{(1 - z)^3}\\ \mathrm{Li}_{-3}(z) &= \frac{z(1 + 4z +z^2)}{(1 - z)^4}\\ & \vdots \end{align*} All are rational functions in $z$. A closed form expression for $\mathrm{Li}_{-n}(z)$ where $n \in \mathbb{N}$ in terms of either  or  can be found. In terms of Eulerian numbers $\left\langle n \atop k\right\rangle$ the result is $$\mathrm{Li}_{-n} (z) = \frac{1}{(1 - z)^{n + 1}} \sum^n_{k = 0} \left\langle n \atop k\right\rangle z^{n - k}, \quad n \geqslant 1.$$ What I wish to know is how can such a result be proved. Of course once one knows what one is looking for, the result can be readily guessed, and I suppose induction used to prove the claim is true for all $n$, but is there a way to prove the result directly?


I have answered I believe around 12 questions on Chess Stack Exchange with > 1 for all of them. How come I only have credit for 3 in terms of non-community answers? What is the difference between a community and non-community question?

Some questions and answers are marked Community Wiki and are owned by a community wiki user:  (In fact, this very question is one of them)  Why have Community Wiki posts? How do Community Wiki posts work? How does a post become a Community Wiki post? How can the Community Wiki status be removed from a post? How can I find Community Wiki posts?


I'm trying to create a class Places that creates and menaged the autocomplete fragment. If I create the PlaceSelectionListener in the MainActivity it works, but if I create it in the class the app crash. Where am I doing wrong?  Here the code:  activity_main.xml  <fragment         android:id="@+id/autocomplete_fragment"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"     />   MainActivity.java (create the Places object)  Places places = new Places(this);   Places.java  public class Places extends AppCompatActivity{      public Places( Context context ) {      // Retrieve the PlaceAutocompleteFragment.     PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)             getFragmentManager().findFragmentById(R.id.autocomplete_fragment);      // Register a listener to receive callbacks when a place has been selected or an error has     // occurred.     autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {         @Override         public void onPlaceSelected( Place place ) {             Log.e("-----", place.toString());         }          @Override         public void onError( Status status ) {             Log.e("-----", status.toString());         }     }); }}   Error:  06-06 10:05:58.360 20562-20562/com.example.aleclock.streetcamera E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.aleclock.streetcamera, PID: 20562 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.aleclock.streetcamera/com.example.aleclock.streetcamera.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.location.places.ui.PlaceAutocompleteFragment.setOnPlaceSelectedListener(com.google.android.gms.location.places.ui.PlaceSelectionListener)' on a null object reference     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)     at android.app.ActivityThread.-wrap12(ActivityThread.java)     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)     at android.os.Handler.dispatchMessage(Handler.java:102)     at android.os.Looper.loop(Looper.java:154)     at android.app.ActivityThread.main(ActivityThread.java:6077)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.location.places.ui.PlaceAutocompleteFragment.setOnPlaceSelectedListener(com.google.android.gms.location.places.ui.PlaceSelectionListener)' on a null object reference     at com.example.aleclock.streetcamera.classes.Places.<init>(Places.java:35)     at com.example.aleclock.streetcamera.MainActivity.onCreate(MainActivity.java:53)     at android.app.Activity.performCreate(Activity.java:6662)     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)      at android.app.ActivityThread.-wrap12(ActivityThread.java)      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)      at android.os.Handler.dispatchMessage(Handler.java:102)      at android.os.Looper.loop(Looper.java:154)      at android.app.ActivityThread.main(ActivityThread.java:6077)      at java.lang.reflect.Method.invoke(Native Method)      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

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


I am facing some difficulties proving the reverse operation on N elements.   Let Σ be an alphabet, given a word x ∈ Σ∗ and rev(x) the reverse of x. I want to prove that   for n >= 1 and for  X1,X2,...,Xn ∈ Σ∗   rev (X1,X2,...,Xn) = rev(Xn),...,rev(X1)   I would appriciate your assistance.

I'm practicing proofs and given the following statement:  Let $\Sigma$ be an alphabet, $\epsilon$ the empty word and $\sigma:\Sigma^{*}\rightarrow\Sigma^{*}$ an operation which for $a\in\Sigma$ and $w\in\Sigma^{*}$ is defined as $$\sigma(\epsilon)=\epsilon,\\\sigma(wa)=a\sigma(w).$$  I would like to prove through induction that $\sigma$ is equal to the word reversal operation $rev$ meaning that $\sigma(w)=rev(w)=w_{n}...w_{1}$ for every $w=w_{1}...w_{n}\in\Sigma^{*}$.  My suggestion is as follows:  For $w=\epsilon$ we have $$\sigma(w)=\sigma(\epsilon)=\epsilon=rev(\epsilon)=rev(w).$$  Let $w=xa$ with $x\in\Sigma^{*}$ and $a\in\Sigma$, then $$\sigma(x)=x_{n}...x_{1}=rev(x).$$  Thus we also have $$\sigma(w)=\sigma(xa)=\sigma(x_{1}...x_{n}a)=a\sigma(x_{1}...x_{n})=ax_{n}\sigma(x_{1}...x_{n-1})=...=ax_n...x_{1}=rev(x_{1}...x_{n}a)=rev(xa)=rev(w).$$  Does that constitute a correct and sufficient proof? If not, I would very much appreciate your feedback.


Let's say I have 4 creatures on the battlefield, and the  enchantment out as well.  If I use  and replace all 4 of my creatures, how does this interact with dragon tempest?  1) 4 damage dealt to target controller or target creature (enchantment interprets all 4 dragons being placed as one event).  2) 10 damage dealt to target controller or target creature (enchantment triggers for each time dragon enters battlefield (1 dmg, 2 dmg, 3 dmg, 4 dmg)).  3) Something else entirely!  Thanks

There are many cards that can put multiple permanents onto the battlefield simultaneously, such as , , or .  How do these interact with the following types of abilities?  As [this permanent] enters the battlefield... You may have [this permanent] enter the battlefield as... [This permanent] enters the battlefield with... When [a permanent with certain characteristics] enters the battlefield...   Justification There have been many questions already about particular instances of this situation.  This question is intended to be a canonical question and answer to all questions such as:      Note to moderators: three of these five questions have already been marked as duplicates pointing to this one.  Can we do the same for the remaining two?


Take electric field lines as example. In EM textbooks it is stated that   The tangent of a field line gives the direction of the electric field  The density of field lines is proportional to the field strength at that point    My understanding is that field lines are not rigorous mathematically. So I doubt whether the above can always be true. For instance, if we draw field lines according to rules 1 and 2, will it happen sometimes that you need to create new field lines or annihilate field lines artificially so that rule 2 is satisfied?

When we're dealing with problems in electrostatics (especially when we use Gauss' law) we often refer to the density of electric , which is inversely proportional to the radius in the case of a single point charge (all field lines are directed radially).   My question may sound dumb, despite the fact that this concept is quite intuitive, but if you think about it there is actually an infinite amount of field lines which we can draw everywhere (one through every point), so speaking of an area where field lines are more "dense" or "sparse" doesn't make much sense to me.  With this in mind, why can we still use such a concept? Why does it really work?


It is well known that fibre product of noetherian schemes may not be noetherian. The inverse image of a coherent sheaf is coherent provided the domain is locally noetherian and codomain is noetherian. So my question has to do with the inverse image of coherent sheaves. Is it true that fibre product of noetherian schemes over a noetherian base is locally noetherian?

In Hartshorne's proof of Proposition 6.6 in Chapter 2, he says that if $X$ being Noetherian implies $X\times\mathbf A^1$ is "clearly" Noetherian.  I assume this is because $X$ can be covered by affine open sets $U_i=\text{Spec}\ A_i$ with Noetherian $A_i$ and then $X\times\mathbf A^1$ is covered by the affine open sets $U_i\times_{\mathbb Z}\mathbf A^1$, which are $\text{Spec}\ \big(A_i\otimes_{\mathbb Z}\mathbb Z[x]\big)=\text{Spec}\ A_i[x]$, and $A_i[x]$ is Noetherian from Hilbert's basis theorem. Is there a simpler way to see this?  More generally if $X,Y$ are schemes over $\mathbb Z$, is $X\times_{\text{Spec}\ \mathbb Z}Y$ always Noetherian? With a similar argument as above this is the same as asking whether $A\otimes_{\mathbb Z}B$ is a Noetherian ring if $A$ and $B$ are, correct? I guess my confusion arises from "Noetherianness" as modules vs. "Noetherianess" as a ring.  Over what schemes $S$ (instead of $\text{Spec}\ \mathbb Z$) is it true that products of two Noetherian schemes over $S$ is a Noetherian scheme?


Show that the equation $x+e^x=2$ has only one solution in $\mathbb{R}$. Which solution is this?    I don't know how to show this formally but if we take $e^x=2-x$, than the left part ist increasing and the right part decreasing. This implies that we have only one solution in $\mathbb{R}$. Right? How to show this formally and how to find this solution?

I am extremely new to mathematics, and I don't have much training except for the basics so please excuse my rather basic question.  The question itself:  If I have the relationship $e^x + x - 2 = 0$;  and $k$ is the number of solutions in $[0,1]$ and $n$ is the number of solutions not in $[0,1]$  what is $k$? what is $n$?  My Questions (sorry if they are many)  (1) What is the proper name for this type of equation. It doesn't seem to be a function, just a relationship of one variable to some constants.  (2) How do you tell how many solutions an equation like this has just from looking at it? It seems like if you have an equation like $x^2 + 2x + 5 = 0$; you have at least two solutions. But what about the $e^x$? How do you predict how many solutions there will be then?  (3) Once I re-arrange the equation to $e^x + x = 2$; what algebraic steps could I follow if I wanted to find the exact solution?


Is it possible to run APK's on 17.10? I saw the other posts but they were no where near helpful! I don't know what that Twerk application was but the link did not work. Is there anyway to use an android application on ubuntu 17.10? things like bluestacks and whatnot do not work on wine, and all the android emulators like ANbox don't work in 17.10 gnome, wayland or Xorg.

Is it possible to run Android apps on Ubuntu? And I don't mean inside an emulator, but natively, as you would with any other application installed using the Ubuntu Software Center.


These are the circles $\Vert x \Vert = a, a > 0$ for various norms of the form $ \Vert x \Vert = \left(\sum_i |x_i|^p \right)^{1/p}  $  And the $p = 1/2$ norm is not a norm, because it does not satisfy the triangle inequality : $$ \Vert x + y \Vert \leq \Vert x \Vert + \Vert y \Vert $$ And the set, with the fixed norm is not convex, whereas for other cases it is. Does it hold for any norm, that the level set with the fixed norm is convex in order to satisfy the triangle inequality?

Let $X$ be a normed linear space, $x\in X$ and $r>0$. Define the open and closed ball centered at $x$ as  $$ B(x, r) = \{y \in X : \Vert x − y\Vert < r\} $$  $$ \overline{B}(x, r) = \{y \in X : \Vert x − y\Vert \leq r\}. $$ Then $B(x, r)$ and $\overline{B}(x, r)$ are convex.  I tried to prove this, but either my calculation is incorrect, or I am on the wrong path:  I aim to show for the closed ball $\overline{B}(x,r)$ (for open ball I assume the proof is similar). Suppose $y,z \in \overline{B}(x, r)$. Then $\Vert x − y\Vert \leq r$ and $\Vert x − z\Vert \leq r$. We must show that $t \in [0,1]$ implies $ty + (1-t)z \in \overline{B}(x,r)$. But $t \in [0,1]$ implies $$ \Vert ty + (1-t)z - x\Vert = \Vert t(y-z) + z - x\Vert \leq |t| \Vert y-z\Vert + \Vert z-x\Vert \leq |t|(\Vert y-x\Vert + \Vert x-z\Vert) + \Vert z-x\Vert < |t|(2r) + r = r(2|t| + 1), $$ which is not necessarily $\leq r$. We probably wanted to end up with $< |t|r$ or $\leq |t|r$ as our final inequality.  Thanks in advance.


From my understanding, temperature is proportional to the average kinetic energy of particles.  If I move an object with my hand, then it will gain kinetic energy. Therefore, its' particles average kinetic energy will increase. Therefore, it's temperature will increase too?

In ideal gas model,  is the measure of average kinetic energy of the gas molecules. If by some means the gas particles are accelerated to a very high speed in one direction, KE certainly increased, can we say the gas becomes hotter? Do we need to distinguish the random vibration KE and KE in one direction?  Furthermore, if we accelerate a block of metal with ultrasonic vibrator so that the metal is vibrating in very high speed with cyclic motion, can we say the metal is hot when it is moving but suddenly become much cooler when the vibration stop?


I'm new to QGIS and I need to know the easiest way to calculate the greatest length of a polygon. I already know the "rule" tool but I want to do it automatically because I have a huge amount of polygons to process. I only know the basics for the moment. My polygons are watersheds and they look like this:  or even that:

I want to calculate the "diameter" of polygons in QGIS.  The "diameter" defined as the distance between the two most distant points of the polygon.  I couldn't find a fitting solution in the field calculator. Maybe you have some ideas?


I installed a dual operating system (Ubuntu 9 and Windows 7). Unknowingly I deleted Ubuntu partition. Then there comes the grub rescue error.  After that I again installed Ubuntu from live cd and during installation erased the Windows 7 partition from my hard disk.   Now I am trying to install Windows 7 but it doesn't boot.   This time I have only Ubuntu installed on my laptop. I want to remove all this Ubuntu etc and I want to install Windows 7 only.

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


When installing a game from Google Play I am asked to login to Google play services to update. Unfortunately the email account linked to this is one I had at school which no longer exists. How do I access Google Play services to update it without this email. I have tried uninstalling but this is not possible.

My email address I use for the Play Store will be invalid soon, so I need to change it. However I don't want to make a new account because I want to keep all my apps. How can I do that?


I simply can't get my head around how the Community user works.  Is it a daemon process running in the background, responsible for approving / rejecting edits, poking old questions, etc., or how else does it work?  Thanks.

I see the  on the user page.  It seems to edit posts sometimes.  What is it? And why has it downvoted over 1800 times? See also:


Similar questions have been asked but I can't seem to find a proper answer.  Basically, I am installing several application manually e.g eclipse, android-sdk, android-adt, arduino etc. and have decided that /opt will be a good place to keep them  By default /opt is root:root with 755  I don't want to run my application as root.Currently I have a single user but I would like the installed applications to be accessible to any user (with necessary permissions). Also if there is any installation/write done in the application limited to /opt it should be allowed.  To achieve this I plan to,   Add user to group root and make the directory /opt 775 ?   Is it safe to add a user to group root?  What is the option otherwise which will enable users rwx in the directory?  I am open for any other better solution as well.

I want to stop having to use sudo everytime I work in /var/www. How can I do that? I simply want to put all of my sites into this directory and work with them without too much pain.


I have a list of links which i am getting from BeuitfulSoup object, after links2=links1then i edited links1 ,but links2 got changed as well so i test in IDLE.  Example of a list which i want to modify but keep the original one intact, how can i do it?  a=[1,2,3] b=a a.append(4) print b   Output  [1, 2, 3, 4]   i want b to stay [1,2,3]

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


Imagine a sql table with a very high number of rows (for example 300 million of rows).  Each row have an text field and I'd like to retrieve 10 rows randomly.  The problem is that using  select key from the_table where enabled=1 order by rand() limit 10   Calculate the rand value and order all the rows by that value is a very high load.  Is there some way for avoiding that?

What is a fast way to select a random row from a large mysql table?  I'm working in php, but I'm interested in any solution even if it's in another language.


I'm looking for an app for my mac that automatically rearranges apps when I plug in to an external monitor.  An app that let's me arrange windows in certain positions and save them as configurations that I can select later to reposition them.  Something a lot like  (I've tried in the past) but with multiple named configurations that I could apply. Stay also doesn't work with Adobe's Create Suite of tools.

When I attach a second monitor to my MacBook, I drag many windows onto it.  When I detach the monitor, all the windows move back onto my MacBook's display.  How can I make it so that when I re-attach the monitor, all the windows automatically move back to their position on the second monitor again?  I use my personal MacBook at work where I have the extra monitor.  But this means I need to detach and re-attach the monitor every day.  I have many windows I leave open from the previous day's work, so this is a real pain.  I know about an app called , which is almost exactly what I want.  But I need something that works on OS X 10.5.


I'm having some trouble with Biblatex.  This is a compileable version of my document:  \documentclass[ngerman]{article}  \usepackage[utf8]{inputenc} \usepackage{lscape} \usepackage{xspace} \usepackage[ngerman]{babel} \RequirePackage[ngerman=ngerman-x-latest]{hyphsubst} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{array} \usepackage{makecell} \usepackage{tabulary} \newcolumntype{?}{!{\vrule width 1pt}} \newcolumntype{~}{!{\hrule width 1pt}} \newcommand\textlcsc[1]{\textsc{\MakeLowercase{#1}}} \title{Übung} \author{Phil} %in the preamble for Bibliography %--------------------------------  \usepackage[   backend=biber, style=authoryear, ]{biblatex}  \addbibresource{IEEEexample.bib} %--------------------------------   \begin{document} \maketitle  Some text is to apper here. Yesterday... \cite{underwood_Test} now the usual  text continues.  But what does this actually mean?  Bring me one of these big bags... not the individual wrapped ones, the whole  big bag. That's the one I want. Business as usual... Disguting.   \newpage   \printbibliography  \end{document}   I'm getting this error and cannot find its cause by myself. Process started  This is BibTeX, Version 0.99d (MiKTeX 2.9.6630 64-bit) The top-level auxiliary file: mydocument.aux I found no \citation commands---while reading file mydocument.aux I found no \bibdata command---while reading file mydocument.aux I found no \bibstyle command---while reading file mydocument.aux (There were 3 error messages) Process exited with error(s)

Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools


I need some help with the following sentence in order to know whether it should be WAS or WERE:     a recent study revealed that the ninety percent of people who had   decided to change their first job WAS/WERE more satisfied now than in   the past, since their job conditions had improved significantly.

Does a percentage require a singular or plural verb, for example, do we say ten percent "go" or "goes"?


For example, "Not going? Be sure to cancel at least 24 hours in advance." has an implied "Are you…" in front. Is there a term for this concept?  Is it proper grammar (or at least accepted in business communication)? I feel I've seen this structure use a lot.  Update  Is this just an example of ? I'm guessing "conversational" means it would be generally okay for marketing and user interfaces but not for a memo to the CEO (or other more formal documents).

"Thought you'd never ask" is "I thought you'd never ask" with "I" omitted. "Hope this helps" is "I hope this helps" with "I" omitted.   In English grammar, normally every sentence should have a subject, right?   My first thought is that these two examples are so often used that they are like set phrases. But these are not really set phrases. You can alter the words after "thought" and "hope".  Another possible explanation is the tendency to drop the subject if it is the first person pronoun. It seems that in many languages, such as Spanish, Italian and Japanese, the first person subject is usually omitted. Maybe English is going the same way? (Not exactly the same, since in Italian, verb forms change according to the person, so the subject is not necessary to understand who one's referring to.)  And, apparently, such omission is more common in spoken English than in written English.  Are there more examples of such first person subject omission? How frequent is it?


I know it will work, but what problems will I encounter? What drivers should I download? And how do I install this from an external optical drive?

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


I wish to know if is it possible to place a non-floating figure using x,y page coordinates? Also above other figure or text   For example. The yellow rectangle is the area where I wish to place my figure

I have read , but I don't think it addresses the same problem.  I am looking for a way to have a command in LaTeX with an interface as follows:  \placetextbox{x_in_page_percentage, y_in_page_percentage}{This is my text}   The command would place the text This is my text centered within a box that may overlap with anything else on the page, and that would be placed at the coordinates specified by the variables x_in_page_percentage and y_in_page_percentage. These variables control the location of the x in the diagram below. E.g.  -------------x---------------       This is my text -----------------------------   This way, something like \placetextbox{0.5, 0.5}{This is my text} would place the text roughly on the center of the page, regardless of anything else that may be on that location.  Any thoughts how to do this?


Here's a list like this.  mylist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]   I want to split this list every 4 intervals.  In other words, I want to make it like this.       [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]   I want to divide the list and save it.  Is there a function that provides this partitioning capability?

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


Let $X$ be a vector space. Two norms $\|\cdot\|,\|\cdot\|':X\to\mathbb{R}$ are equivalent, if there are constants $\alpha,\beta >0$, such that for all $x\in X$ holds:  $\alpha\|x\|\leq \|x\|'\leq \beta\|x\|$     Show that all norms on $\mathbb{R}$ are equivalent.   A detailed hint is given:  It is enough to show, that an arbitrary norm $\|\cdot\|'$ is equivalent to the Euclidean norm $\|\cdot\|$. [Why is that the case?]  Consider the set $M:=\{x\in\mathbb{R}:\|x\|'\leq 1\}$ and show, that it exists an $r\in (0,\infty)$, such that $M=[-r,r]$. It is possible to show, that $r\|x\|'=\|x\|$ for all $x\in\mathbb{R}$.  My first question is, why it is enough to show, that an arbitrary norm is equivalent to the Euclidean norm?  Then I want to follow the hint and find $r$ with $M=[-r,r]$, but I am stuck and do not know how to start here...  I would appreciate a hint to get me started.  Thanks in advance.

The following is a well-known result in functional analysis:     If the vector space $X$ is finite dimensional, all norms are equivalent.     Here is the standard proof in one textbook. First, pick a norm for $X$, say  $$\|x\|_1=\sum_{i=1}^n|\alpha_i|$$ where $x=\sum_{i=1}^n\alpha_ix_i$, and $(x_i)_{i=1}^n$ is a basis for $X$. Then show that every norm for $X$ is equivalent to $\|\cdot\|_1$, i.e.,  $$c\|x\|\leq\|x\|_1\leq C\|x\|.$$ For the first inequality, one can easily get $c$ by triangle inequality for the norm. For the second inequality, instead of constructing $C$, the  is applied to construct a contradiction.   The strategies for proving these two inequalities are so different. Here is my question,      Can one prove this theorem without Bolzano-Weierstrass theorem?   UPDATE:     Is the converse of the theorem true? In other words, if all norms for a vector space $X$ are equivalent, then can one conclude that $X$ is of finite dimension?


What's wrong with that following ?  \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=left, grid=major, xmin=8, xmax=22, ymin=40, ymax=80, xlabel={heure}, ylabel={Concentration d'ozone en $\mu g/m^3$}, xtick={8,9,...,21}, ytick={40,50,...,70}, tick style={very thick}, legend style={at={(rel axis cs:0.5,1)},anchor=north west,draw=none,inner sep=0pt,fill=gray!10}] \addplot[blue,thick,samples=100]{-0.7*x^2+21*x-86}; \addlegendentry{$y=-0,7x^2+21x-86$} \end{axis} \end{tikzpicture}   Thanks for help

Why does pgfplots plot functions only until x = 5 and y = 5, but not any further?    \documentclass{article}  \usepackage{tikz} \usepackage{pgfplots}  %%%< \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt} %%%>  \begin{document} \begin{tikzpicture} \begin{axis}[samples=100,ymin=0,ymax=10,xmin=0,xmax=20]  \addplot [thick] plot  (\x,  {1/(1 + exp(-0.6*(\x - 12)))}); \addplot plot (\x, {\x});  \end{axis} \end{tikzpicture} \end{document}


Unfortunately I don't know how to reproduce this, but I have been getting incorrect notifications on my stackoverflow account regarding my reputation and access privileges. This has happened three times so far.   Most recently, I received a notification saying that I have gained the "comment everywhere" privilege. However, I do not yet have enough reputation to warrant this.  I've checked my account and reputation history and made sure that I didn't surpass 50 reputation and then get voted down somewhere, or some similar case.

I'm new to Stack Overflow and just received new privileges this morning.  Now I received three new notifications about additional privileges that I received, even though I don't think I've reached the reputation points level for them. At the moment I have 13 reputation points, and I recieved notifications for the following privileges:   Vote up Flag Posts Talk in chat   I tried voting up and it doesn't work (since I don't have the reputation points for it). What's going on?


It is known that, to prove that two sets are equal, we need to show that they are subset of each other. Here we have, intersection of cartesian products on the left side and cartesian product of intersections of sets on the right side, I know the definitions here that is:  Cartesian Product: If $A$ and $B$ are any two sets, then $A\times B=$ {$ (a,b), a \in A, b \in B$ }. Intersection of sets: $A \cap B=${$ x\colon x \in A, x \in B $}.  but don't know how to prove that.

I want to prove this:  $$(A \times B) \cap (C \times D) = (A \cap C ) \times (B \cap D)$$  by every element on LHS(left hand side) is an element of RHS and vice versa.  Does a counter example exist?


I have the following code that I run on my Terminal.  LC_ALL=C && grep -F -f  genename2.txt hg38.hgnc.bed > hg38.hgnc.goi.bed   This doesn't give me the common lines between the two files. What am I missing there?

Diff is a great tool to display the changes between two files. But how to display the similarities of two text files (while ignoring the differences)?  I.e. sample input:  a: Foo Bar X Hello World 42  b: Foo Baz Hello World 23   Pseudo output (something like this):  @@ 2,3 =Hello World   Just sorting both files and using comm is not enough, because in that case the line information is lost.


I'm very familiar with cyclic groups, but I can't seem to understand what a non-cyclic group is like... is there a simple example of one?  (edited... I had no idea that non-cyclic != acyclic)

I just want to make sure that every group $\mathbb{Z}_n$ for any $n$ is cyclic. Further, every group of prime order is cyclic because it is isomorphic to $\mathbb{Z}_p$. I think I have a handle on that, but what other finite groups are there that aren't cyclic? In particular, I'm looking for examples that aren't direct products of groups, just simply groups like $\mathbb{Z}_n$, not $\mathbb{Z}_a \times \mathbb{Z}_b$, etc.


I want to record my daily internet usage. NetWorx alternative for ubuntu software. Networx screenshot take from windows

I can see the data transferred (internet Download/Upload) in the current session from the System Monitor. But I want something that keeps track of all the data transferred and I can see how much data was used in a month or two. Preferably a GUI tool.


i have a problem in the table of content in latex because the sections and subsections have styles.  the problem is the style of the sections and subsections affected on the table of content like the picture below:   how can remove the style of sections in the TOC can anyone help me please?

Forgive the stupid simplicity of this question, and please feel free to refer me to an older answer. I'm not quite familiar enough with LaTeX terminology to have found it.  All I want to do is set a different default format for my section titles. Instead of just being bolded and slightly larger than the main text, I'd like them to be of normal weight, the same size as the main text, and all caps.   I'm using the article class.


zarjazc@PL998794-VPCEL22FX:~$ apt-get install gimp E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? zarjazc@PL998794-VPCEL22FX:~$    That's what I get when I try to install gimp 2.8 from the website using the terminal code. The software center only has the 2.6 version

Whenever trying to install any software and update manger,  I get an error stating    Package operation failed The installation or removal of a software package failed   When I run sudo apt-get update I got this result:   conan51xd@conan51xd-Lenovo-B470:~$ sudo apt-get -f install [sudo] password for conan51xd:  Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. conan51xd@conan51xd-Lenovo-B470:~$ apt-get update E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?


I am trying to install skype on ubuntu 14.04 gnome but it gives me "package skype has no installation candidate"

First of all, I think this question is not duplicated, because I have tried all other solutions I found here, but nothing solved my problem.  I use Ubuntu 14.04 64 bit.  I have tried until now: sudo apt-get install skype -> It didn't work. The error was:   The following packages have unmet dependencies: skype : Depends: skype-bin E: Unable to correct problems, you have held broken packages.   I have tried sudo dpkg add-architecture && sudo dpkg -i skype-ubuntu-precise_4.3.0.37-1_i386.deb but it didn't work either. The error was:  dpkg: dependency problems prevent configuration of skype: skype depends on libqt4-dbus (>= 4:4.5.3); however: Package libqt4-dbus is not installed. skype depends on libqt4-network (>= 4:4.8.0); however: Package libqt4-network:i386 is not installed. skype depends on libqt4-xml (>= 4:4.5.3); however: Package libqt4-xml:i386 is not installed. skype depends on libqtcore4 (>= 4:4.7.0~beta1); however: Package libqtcore4:i386 is not installed. skype depends on libqtgui4 (>= 4:4.8.0); however: Package libqtgui4:i386 is not installed. skype depends on libqtwebkit4 (>= 2.2~2011week36); however: skype depends on libstdc++6 (>= 4.2.1); however: Package libstdc++6:i386 is not installed. skype depends on libx11-6; however: Package libx11-6:i386 is not installed. skype depends on libxext6; however: Package libxext6:i386 is not installed. skype depends on libxss1; however: Package libxss1:i386 is not installed. skype depends on libxv1; however: Package libxv1:i386 is not installed. skype depends on dpkg: error processing package skype (--install): dependency problems - leaving unconfigured Processing triggers for hicolor-icon-theme (0.13-1) ... Processing triggers for gnome-menus (3.10.1-0ubuntu2) ... Processing triggers for desktop-file-utils (0.22-1ubuntu1) ... Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support (3.54ubuntu1) ... Errors were encountered while processing: skype   I have tried to use after sudo apt-get -f install but it didn't solve the issue.  I have tried to install by using Gdebi. The error was:  Cannot install 'libqtwebkit4:i386'   I have tried to install using Ubuntu Software Center. The error was:  Cannot install 'libqtwebkit4:i386'   I have tried changing the server in "Software and Updates". I have tried to use "Main Server" and "Servers for United States". But it couldn't solve my problem.  Anyone has any idea how to solve that?  SOLVED  Well, I formatted my pc and I installed Skype first of all. Probably another installation that I had done before the Skype installation was the problem, i guess.  Thanks people!


Anytime I install a new package i get the following error:  WARNING: The following packages cannot be authenticated!   I can still install the package despite this error, but is there a way to get rid of it?

I'm experimenting with VPNs, so I wanted to install pptpd.  john@desktop:~$ sudo apt-get install pptpd [sudo] password for john:  <snip> The following extra packages will be installed:   bcrelay The following NEW packages will be installed:   bcrelay pptpd 0 upgraded, 2 newly installed, 0 to remove and 11 not upgraded. Need to get 90.5 kB of archives. After this operation, 442 kB of additional disk space will be used. Do you want to continue [Y/n]? y   And everything runs fine until I get down to here:  WARNING: The following packages cannot be authenticated!   bcrelay pptpd Install these packages without verification [y/N]? n E: Some packages could not be authenticated   No authentication?  I'm no security expert, but I'm fairly sure that's a bad thing.  So I .  john@desktop:~$ apt-cache policy pptpd pptpd:   Installed: (none)   Candidate: 1.3.4-3ubuntu1   Version table:      1.3.4-3ubuntu1 0         500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages john@desktop:~$ apt-cache policy bcrelay bcrelay:   Installed: (none)   Candidate: 1.3.4-3ubuntu1   Version table:      1.3.4-3ubuntu1 0         500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages   They're coming from Ubuntu.com and not being properly authenticated?  What's going on here?


I've noticed a problem in my gaming group that I can only dub Character Abandonment Syndrome.  Over the last few years, my group has played several campaigns (D&D 5e mostly, but some other stuff as well) with different GMs, but no matter the GM or the campaign, no one plays a character for more than a few sessions. It's gotten so bad that occasionally the party roster has changed completely every other session.  For various reasons, our group tends toward powergaming, but lately interest has been expressed in doing some more serious role-playing. Because of this and because I'm the current GM, I feel like the first order of business is to help players overcome Character Abandonment Syndrome so that they can have a more enriching role-playing experience.   How can I encourage players to stick with one character throughout an entire campaign?  EDIT  Some of you guys have asked why or how my players are able to do this. Most of the time it's them expressing that they don't want to play that character anymore and the GM explaining away why a character has left. With the case of a lot of players switching, we do a time skip or say that the previous party got themselves killed somehow and now there's a new set of adventurers.

I have been playing in a specific group for some time now. I now am in a position where I am going to be the GM once more. However I have a recurring problem with the players continuously switching characters.  While we do a lot of role-playing, and don't have a high focus on combat, some of the players tend to spend a large amount of time on planning their characters. But, because they already have a plan for every possible mechanical situation their character could ever face, this large amount of planning time leads to them getting quickly bored and wanting to plan and switch to a new character.  What can I do to make the players get more invested in their existing characters, and not just enjoying the role-play with little interest in their character concept?


I have a string in oracle column example emp.id=100&empHelper.userTab=2 I want to use REPLACE function to replace '&empHelper.userTab=2' with empty string.  & symbol is creating problem , I want to use escape char to consider '&empHelper.userTab=2' as text to replace in replace function instead of using set define off .

I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores the ampersand?


I'm writing a script that will automatically sort my albums on my NAS server and encountered the following error. Whenever I have a space in an album name I'm getting an error. Albums can be either called "Artist_-_Album" or "Artist One - Album"    #!/bin/bash   for file in /home/peres/Documents/*   do     name=$(basename "$file")     number=${#name}    #sort if artist and album contains "_-_"      if [[ $name == *"_-_"* ]]     then             echo "Album detected!"             artistname=${name%%_-_*}             albumname=${name##*_-_}             mkdir -p $name/$albumname             mv $name $artistname     fi     #sort if artist and album contains " - "      if [[ $name == *" - "* ]]     then             echo "Album detected!"             artistname=${name%% - *}             albumname=${name##* - }             mkdir -p $name/$albumname             mv $name $artistname     fi   done

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


if i have an excel sheet and i filter by a certain column, how do i then delete all non visible rows?

I have a very large table in Excel (1000's of rows) and I filter it to only show 10 rows.   I wonder if there is a way to delete the rows not shown (i.e. don't meet filter conditions)? This would enable me to reduce the file size before I send it.  There are many thousands of rows down under the table the user has created complex formulas and graphs which wont carry if I copy across to another worksheet if I just copy the rows.


During the movie Sing, Buster Moon constantly tries to shoo away five young, presumably Asian dancers, but finally he attempts to allow them in his show. Finding they can't speak English, he gets out a translation dictionary and says something that seemed to offend them as one slapped Buster.    What was it that Buster said to them?

In the movie Sing, there is a scene where Dapper Koala tries to invite the dancing foxes to join his show. He picks up a dictionary and says something, after reading from the dictionary the foxes are offended and leave  What did he say?


I've come across this a few times, the most recent being this chain:      404   If it was just closed, okay, that would make some sense.  But deleted?  It makes the marked-as-duplicate closing of no use to anyone.  Why is this allowed by SE/is this a bug?

Some questions are getting closed as duplicates - good, the system is working. Unfortunately, some are getting closed as duplicates of other questions which are already deleted. This leaves all 1-9,999 reputation users left scratching their heads when they try to view the duplicate. Even worse, imagine being the author of the question and having your question closed as a duplicate when the original question isn't accessible.  I think something is wrong. Today I undeleted a question (left it closed) since it was referenced in the close-reason for another question. Comments indicated that people were clearly irritated that they could not access the duplicate     [Comment] Ok, who thought it was a good idea to close this as duplicate of a deleted question, which most people cannot even see? For the record, I'm reopening - clearly there's enough interest in this question. – Kobi 14 hours ago   ---   [Comment] The PosibleDuplicate link is broken. Voting to reopen. – Rahul G 7 hours ago   ---   [Flag] Closed as duplicate of a deleted question, fail. Thanks for moderating. – {username removed} 14 hours ago   My undelete-action was short-lived, as a few users returned to delete the post again.  It certainly cannot be desirable to reference posts that the vast majority of users cannot even see, especially when the author of the redundant question cannot see (at the time of writing this, the author has a reputation of 18).  I'm not sure what the solution is to this, but I'd like to hear some ideas.  Questions  Question:  Duplicate of:


it is from apt package  it isnt directly called as a dbus service: egrep "http" /usr/share/dbus-1/services/* -i  "software & upudates" options are like - check? NEVER - security upd? display imediately *1 - other upd? every 2 weeks *2 - new ubu version? NEVER    I think it is *1 and *2 looking for updates, but I want to do that manually and not when I need that little quota (about 8MB) that consumes about 10% of my daily quota!  couldn't find the answer here:   obs.: after login, rarely when I wait a few minutes before connecting, it wont be activated and wont consume some of the daily quota

I have a pretty small embedded system that has Linux on it for a project. Theres normally about 47% disk space used when I run df. However every time I start up the system that number gets bigger until it hits 100%.  I can get it back down by using apt-get clean, but I don't even want to update anything. My system is used in a limited capacity thats already working fine with what is on it, I don't want any upgrades of package updates.  How can I disable whatever apt is doing to check for updates and download stuff every time it starts up?


Let's say I'm running a mill deck. I have some kind of infinite mill combo ready and available (e.g.  imprinting a creature,  and  - this lets me sacrifice Myr Retriever to Grinding Station, retrieve another Myr Retriever, mill opponent for 3 cards, and cast a new Myr Retriever for free). However my opponent has two copies of  in his deck. Since Emrakul shuffles back in to the deck each time it's put into the graveyard, this means I can't actually mill him out.  However, through repeated use of the mill combo I can in principle 1) figure out every card in his deck, and then 2) mill him until the last three cards in his deck are Emrakul, Emrakul, and [irrelevant card] (I assume here the number of cards in opponent's deck before I start the mill combo is divisible by three). This means opponent must hard cast Emrakul to win, and I already know (e.g. via ) that he doesn't have the resources to do this. So I win anyway by milling in three turns.  This kill will take a long time to execute, for obvious reasons, because each time I mill an Emrakul it gets shuffled back into opponent's deck. I'll need the deck to be stacked in exactly such a way that the two Emrakuls + an irrelevant card are at the bottom of the deck. This will happen eventually, just probably not for a very long time.  Question: can I actually execute this kill in paper, or will standoff rules kick in first?

What happens in the following situation?  My opponents got the  and  lock going on but I have a  in my deck that keeps me shuffling my graveyard back into my deck when it gets milled.  DO I just keep on shuffling untill the 45 minutes is up and the games end in a draw? How is this situation resolved?


I've had a few MP3 players that used a single 3.5mm TRRS jack for both connection to earphones and for connection to a USB port (for transferring music files and re-charging the player.) To that end, these players always came with a short adapter like this image.    I've traced the wiring in these adapter, and have found them to be straight through (no apparent internal components I can detect). So I would like to use a similar scheme to provide USB access to some of my MCU based projects that are mounted within small enclosures. A TRRS jack has the advantage of mounting in an easily (and neatly!) cut round hole, that takes up very little space. They also tend to be much cheaper than special purpose panel mount USB ports.   But sadly, I don't seem to be finding ANY consistency in the wiring of similar adapters. If there were, I can see where it would be easy to find both female and male versions, but the few I've found have lead to disappointment. Recently, for example, I thought I had a great find on ali-express, a short cable with a male USB-mini on one side, and a TRRS female on the other. Eureka! I thought! Now I'll have an easy connection to my MCU's female mini, and won't have to resort to hand soldering what I put inside the enclosure. But not only did the wiring NOT correspond to the adapter in my picture here, also didn't even have all 4 connections!  So is there any standard here? Have any been proposed? Since lots of those  MP3 players used 3.5mm TRRS jacks for their USB access, I would have thought  manufacturers would draft some kind of de-facto standard. But GOOGLE is full of diagrams of such adapters, and i don't think I've found any 2 the same. :-(  EDIT: someone kindly pointed me to a similar question, which did at least let me know I wasn't alone in my quest for this, and did point out at least one "pinout' for for a TRRS USB (which was  NOT ideal IMO). But I'll let the question stand only because the one referenced was over 5 years old, and the answers were fairly limited. Maybe some things have changed since then, so any new experiences of others will be valuable to me.   EDIT2: I forgot to mention that what was referred to as the "most commonly used pinout in the  was indeed the same pinout as the one in my picture, namely...   Tip --> D- Ring1 --> D+ Ring2 --> GND Shield --> VUSB   My player wasn't among those mentioned, so maybe some un-officially documented standard has emerged. The pinout is certainly not ideal for a USB situation, providing way too many opportunities for shorts with the 5V being the shield. It probably was designed to make interface to ordinary earphones easier, because on the female side there would be no 5V on the shield (or "sleeve" ) connection. It still would likely be a useful cofiguration in situations where an MCU already has power from another source, so that would become an NC on the female side.  So... but...if that many companies use this pinout, maybe there is my a hope that som other compatible adapters exist!

For a project, I like to use 3.5mm type USB connector. This is for a closed system therefore I am not worried about USB approval but I am worried for signal integrity and insertion/removal problems.   Are there any common 3.5mm 4 contact point USB connectors that I can safely use? What is the usual practice for these connectors?


I have recently gotten into the Zenoscope Grimm Fairy Tales. I have read 1-12 of the trade paper backs, the Dream Eater saga, and Myths and Legends.   However, as I'm reading, I'm noticing the order isn't exactly correct. Can someone please post the proper order to read the series as of the newest issue?

I've just started finally reading this series and have the first two TPBs. I'm thoroughly hooked and I see there is a ton of of various GFT titles that have been done and also currently going. I have no idea how to proceed collecting and reading this series and am worried that I'll buy something I won't understand because I didn't read some previous thing.  I haven't been able to find any kind of reading list for the series. Can I just keep collecting the main series and it will tell me what side stuff to read next? I'm overwhelmed by it all.


Let $f_n : [0,1] \rightarrow \mathbb{R}$ be a sequence of monotone decreasing measurable functions $f_n \geq f_{n+1}$ that converges pointwise to $f: [0,1] \rightarrow \mathbb{R}$. What would be the counterexample which shows that Monotone convergence theorem does not apply for such sequence?  Besides original version of MCT (non-negative monotone increasing sequence) we also stated slightly different version where MCT applies also if ${f_n}$ are measurable, monotone increasing and $f_1$ is integrable.   My intuition is that I should come up with the sequence of functions that are measurable but not integrable (they need to converge though), however I did not manage to come up with something so far. Thanks for your help in advance!

Monotone Convergence Theorem for general measure: Let $(X,\Sigma,\mu)$ be a measure space. Let $f_1, f_2, ...$ be a pointwise non-decreasing sequence of $[0, \infty]$-valued $\Sigma-$measurable functions, i.e. for every $k\ge 1$ and every $x$ in $X$, $$0 \le f_k(x) \le f_{k+1}(x).$$ Next, set the pointwise limit of the sequence ${f_n}$ to be $f$. That is, for every $x$ in $X$, $$f(x) = \lim_{k\to \infty}f_k(x).$$ Then $f$ is $\Sigma-$measurable and $$\lim_{k\to \infty}\int f_k d\mu = \int f d\mu.$$  I've noticed that when it comes to monotone convergence theorem (either Lebesgue or general measure), usually its definition restricts the monotone function sequences to be nonnegative. I'm not sure why the 'nonnegative' is necessary.


Last night i factory reset my mums mums MacBook pro.  I had got to the point where I had to re install mac os x. I selected the hard drive I wanted it on and it prompted me with a apple id sign in. I knew from then that my or my mothers apple Id wasn't going to work because my mum told me she had got it off trade me ( like ebay but in NZ )  I've tried making a bootable usb drive to re install lion os x but it didn't work, or I just didn't do it right. Its a MacBook Pro 2010 mid I think and I am stumped on what to do, now that it has no operating system on it or anything on it now, only thing that works is the utilities mode.  All help is very appreciated.   Thanks

I'm trying to fix a 2010 MacBook Pro. It had Yosemite 10.10. It was running slow, so I performed a factory reset. Unfortunately, when I tried to re-install Yosemite 10.10, it prompted me with an Apple sign in. I used my mum's Apple ID (it's her MacBook), and that didn't work. So I'm trying to find a way to install an earlier version of mac os, but I have to try and do it in a way where I don't have to use an email address (We don't know the original Apple ID used with this laptop).


I hope to show that $$\mathbb{Z}[i]/(a+bi) \cong \mathbb{Z}_{a^2+b^2}$$ for $(a,b)=1$.  I made an effort to find a homomorphism but I failed.  Can you give a hint?

A very basic ring theory question, which I am not able to solve. How does one show that    $\mathbb{Z}[i]/(3-i) \cong \mathbb{Z}/10\mathbb{Z}$. Extending the result: $\mathbb{Z}[i]/(a-ib) \cong \mathbb{Z}/(a^{2}+b^{2})\mathbb{Z}$, if $a,b$ are relatively prime.   My attempt was to define a map, $\varphi:\mathbb{Z}[i] \to \mathbb{Z}/10\mathbb{Z}$ and show that the kernel is the ideal generated by $\langle{3-i\rangle}$. But I couldn't think of such a map. Anyhow, any ideas would be helpful.


Mind Spike is cast with one action but has concentration up to an hour. Unless I'm mistaken, the actual casting process of the spell does not take concentration, due to it not being longer than a single action. Ending concentration is a non-action that can be taken at any time. Would it be possible for a player to cast it but choose to not concentrate on it after the initial damage, thus not breaking concentration on another spell?  The main reason I'm wondering this is because Mind Spike is the only weaponized Divination spell, and actually scales with higher slot levels. I could see this being used to get the most out of a Divination Wizard's Expert Divination class ability.  It makes sense that this would be possible to me, but I'd like to know a more concrete ruling.

The book says:     Concentration. Some spells require you to maintain concentration in order to keep   their magic active. If you lose concentration, such a spell ends.   So what happens if, for example, you are already concentrating on a spell, and cast Witch Bolt without concentrating. Would you get the initial arc of blue energy, or would it not even go off?  I am asking if you can cast a spell that says concentration without concentrating for an immediate effect. This would be useful to avoid interrupting your existing concentration. In essence, if you are concentrating on thing A (doesn't have to be a spell since other things need concentration), can you cast a concentration spell getting an immediate effect without losing concentration on thing A?  Since the definition of concentration is to keep the spell active (meaning it is already active) I would think that you would get the initial effect (if it had one) without the need to concentrate on it.


Suppose $f:(0,\infty)\rightarrow\mathbb{R}$ satisifies $f(x)-f(y)=f(x/y)$ for all $x,y\in (0,\infty)$ and $f(1)=0$.  What I need to do is prove that $f$ is continuous on $(0,\infty)$ if and only if $f$ is continuous at 1. One direction is trivial. What I'm having trouble with showing that if $f$ is continuous at 1 then $f$ is continuous on the entire interval.

exercise: Suppose that $f:(0,∞) → R$  satisfies $f(x) - f(y) = f(x/y)$  for all $x,y$ in $(0, ∞)$ and $f(1) = 0$.   Prove f is continuous on $(0, ∞)$ if and only if f is continuous at $1$.    (proof→:) Suppose that $f:(0,∞) → R$ satisfies $f(x) - f(y) = f(x/y)$ for all $x,y$ in $(0, ∞)$ and $f(1) = 0$. Suppose f is continuous on (0,∞), then by definition f is said to be continuous at a point $a$ if for every $ε > 0$  there is a $δ > 0$ such that $|x-a| < δ$ implies $|f(x) - f(a)| < ε$.   Then suppose f is continuous at $1$, then by our defined function  f(x) - f(y) = f(x/y) , we get $|x-1| < δ$ implies $|f(x) - f(1)| = |f(x) - 0| = |f(x)| =  < ε$.   (proof ←) :Suppose that $f$ is continuous at $1$, then we need to show $f$ is continuous on every point $a$ on $(0, ∞)$. Thus, by definition, f is said to be continuous at a point $a$ if for every $ε > 0$ there is a $δ > 0$ such that $|x-a| < δ$ implies $|f(x) - f(a)| < ε$. Thus, $|x-a| < δ → |f(x) - f(a)| = |f(x/a)| < ε$. Then $f$ is continuous on on $(0, ∞)$.  Please can anyone please help me verify this makes sense. If not, can someone please give any feedback/hints. Thank you in advance.


In Ubuntu Software there are duplicates listed for some applications like: Calendar; GNOME Software; ImageMagick; Online Accounts; Software & Updates; UXTerm/XTerm.  I believe they should not be listed twice as most other applications aren't.  My system is a fresh install of Ubuntu 17.04. Is there a good reason for this issue with Ubuntu and does anyone else encounter it?

If there is no difference between two Chromium options I see while installing, other than their developers, then why do their sizes differ? One is 212Mb and the other 224Kb. There's a similar case with VLC.


How can I know if a Wireless Range Extender device is compatible with that WI-Fi networks that ask for not just a password for connection but also for a username?  Do that kind of devices exists?  Do these networks have a specific name?

To connect to my university WiFi, eduroam, I need to type my user name and password into Windows' network configuration app (system tray, no web GUI). The WiFi signal is however weak from my current indoors location, and only strong enough on the balcony. I'd therefore like to place a repeater (extender) or antenna on the balcony, in order to have the same (unattenuated) signal strength indoors as well.  I have a TP-LINK TL-WA854RE repeater that unfortunately only provides, on its admin webpage, a place for me to type a password for the network I want to extend, but no user name. It's possible to change the network's security protocol (WEP, WPA/PSK etc), but eduroam actually uses EAP, a protocol that probably implies the existence of a user name in addition to a password.  There seems to be no firmware upgrade for this extender model, and TP Link's support suggests their product can not be used to extend public networks, only private ones where access to the router exists.  Is there any other way in which I can use this (or some other) network extender to boost this particular public WiFi network, in other words, to be able to also specify a user name?


I have a corrupted User Profile on my windows 7 machine and want to associate all the libraries and other user specific information to a new account but cannot fine a way.  How do you go about doing this?

I need to amend the default user account during deployment of Windows 7. Having read the following MS article:  I have a few questions.  The article suggests that the amendments must be made under the built in local administrator account. Does this have to be the built in Admin account? or can the changes be made under the context of another local account within the local administrators group. The customer does not wish to enable the the built in admin account.  Is the profile copied from the account that is currently logged in when the specialise path is initiated?   The article also says to remove all existing local accounts. I assume this is because the amendments to the default profile will not apply to these accounts. Basically, the image has some existing local profiles that must remain. The default settings do not need to be applied to these accounts.   I would test this out but I currently do not have access to my test environment unfortunately.   Any guidance is greatly appreciated.   Thanks in advance.


It's probably stupidly simple, but I can't seem to figure out what's wrong. I'm trying to create a demo for showcasing Encapsulation.  Encapsulation.class:  public class Encapsulation { // 'numberOfEggs' is an instance variable // it was made 'private', because we do NOT want it to be directly accessed by other classes // being 'private' also means that only code within the class can read or write its value private int numberOfEggs = 10;  // getter public int getNumberOfEggs() {     return numberOfEggs; }  // setter public void setNumberOfEggs(int numberOfEggs) {     if (numberOfEggs > 0) {         // we used the 'this' keyword to differentiate between the method parameter 'currentNumberOfEggs' and         //  the instance variable 'currentNumberOfEggs'         this.numberOfEggs = numberOfEggs;     } } }   MainActivity.class:  public class MainActivity extends AppCompatActivity {  TextView defaultNumberOfEggs; Encapsulation encapsulation;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);      defaultNumberOfEggs = (TextView) findViewById(R.id.default_number_of_eggs);     defaultNumberOfEggs.setText(encapsulation.getNumberOfEggs()); } }   activity_main.xml:  <RelativeLayout android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.vladp.studyandroid1.MainActivity">  <TextView     android:id="@+id/default_number_of_eggs"     android:layout_width="wrap_content"     android:layout_height="wrap_content" /> </RelativeLayout>   And I get a "null object reference" error, when starting the app and setting the text via defaultNumberOfEggs.setText(encapsulation.getNumberOfEggs());, which should display "10" (without the quotation marks).

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


@LaTeX-class-file  filename        = "harvard-thesis.cls",  version         = "0.4",  date            = "4 April 2012",  codetable       = "ISO/ASCII"  As you can see in this example, my table exced the widht of the text document. My intention is to adjust the table widht to the text column in the whole doc.  \documentclass{harvard-thesis} \captionsetup{labelfont=\rmdefault, textfont=\rmdefault }  \begin{document}  \begin{table} \centering \begin{tabular}{@{}lll@{}}\toprule[1.5pt] \bf Periodista & \bf Medio & \bf Cargo \\\midrule  Sample name surname &  Sample medium & Other text. Responsable de Participación, redes y Comunidad \\  Sample name surname &  Sample medium & Other text. Responsable de Participación, redes y Comunidad \\  Sample name surname &  Sample medium & Other text. Responsable de Participación, redes y Comunidad \\  Sample name surname &  Sample medium & Other text. Responsable de Participación, redes y Comunidad \\   \bottomrule[1.25pt] \end {tabular}\par \captionof{table}{Periodistas participantes} \label{tab:periodistas} \end{table}  \end{document}

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


I have to find time difference between two String values.I used the following code in my app,  public String diff(String first,String last) {     SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss aa");     Date  d1 = null;     Date d2 = null;     try {         d1 = format.parse(first);         d2 = format.parse(last);     } catch (ParseException e) {         e.printStackTrace();     }     long diff = d2.getTime() - d1.getTime();     int diffMinutes = (int)diff / (60 * 1000);     int diffHours = (int)diff / (60 * 60 * 1000);     String res=Integer.toString(diffHours);     String res1=Integer.toString(diffMinutes);     String fin= res+res1;     return fin; }   This is a function which accepts my two Strings and returns a String(Time Diff) which i can use in my class. But my app force closes when i am calling this function on a button click.  Here is the Logs!  Process: mypackage.com.work, PID: 3551     java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String mypackage.com.work.UpdateTracker.diff(java.lang.String, java.lang.String)' on a null object reference             at mypackage.com.work.UpdateTracker.onClick(UpdateTracker.java:138)             at android.view.View.performClick(View.java:4756)             at android.view.View$PerformClick.run(View.java:19749)             at android.os.Handler.handleCallback(Handler.java:739)             at android.os.Handler.dispatchMessage(Handler.java:95)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5221)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)`  Here is the code of calling that function           String in_db=txtTime.getText().toString();             String out_db=txtTime2.getText().toString();             String d=up.diff(in_db,out_db);   If I just comment this and insert just a hard coded String,its working fine!.So I think no problem with DB code  Help me out to figure this!!  Thanks in advance


Prove   \begin{align} & \int_0^{\pi/2}\sin^mx \cos^nx\,dx \\[12pt] = {} & \begin{cases}\dfrac{[(m-1)(m-3)\cdots][(n-1)(n-3)\cdots]}{(m+n)(m+n-2)\cdots}\cdot\dfrac{\pi}{2} & m,n\text{ even integers}\\[10pt] \dfrac{[(m-1)(m-3)\cdots][(n-1)(n-3)\cdots]}{(m+n)(m+n-2)\cdots} & \text{elsewhere} \end{cases} \end{align}   My Attempt $$ I_{m,n}=\int_0^{\pi/2}\sin^mx\cdot\cos^n x\,dx=\int_0^{\pi/2}\sin^{m-1}x \cos^nx \sin x \, dx\\ \int\cos^nx\cdot \sin x\,dx=\dfrac{-\cos^{n+1}x}{n+1}+K\\ I_{m,n}=\bigg[\sin^{m-1}x\cdot \dfrac{-\cos^{n+1}x}{n+1}\bigg]_0^{\pi/2}-(m-1)\int_0^{\pi/2}\sin^{m-2}x\cdot \cos x\cdot \dfrac{-\cos^{n+1}x}{n+1}\,dx\\ =0+\frac{m-1}{n+1}\int_0^{\pi/2}\cos^nx\cdot\sin^{m-2}x(1-\sin^2x)\cdot dx\\ =\frac{m-1}{n+1}\int_0^{\pi/2}\cos^nx\cdot\sin^{m-2}x\,dx-\frac{m-1}{n+1}\int_0^{\pi/2}\cos^nx\cdot\sin^{m}x\,dx\\ I_{m,n}=\frac{m-1}{n+1}\cdot I_{m-2,n}-\frac{m-1}{n+1}\cdot I_{m,n}\implies \color{blue}{\boxed{I_{m,n}=\frac{m-1}{m+n}\cdot I_{m-2,n}}} $$ case 1: $m,n$ even: $$ I_{m,n}=\frac{(m-1)(m-3)\cdots 1}{(m+n)(m+n-2)\cdots 2}\cdot I_{0,n}\\ I_{0,n}=\int_0^{\pi/2}\cos^nx.dx=\frac{(n-1)(n-3)...1}{n(n-2)...2}.\frac{\pi}{2}\quad;\text{ since $n$ is even}\\ I_{m,n}=\frac{(m-1)(m-3)\cdots 1}{(m+n)(m+n-2)\cdots 2} \cdot \frac{(n-1)(n-3)...2}{n(n-2)...2}.\frac{\pi}{2}\\ =\frac{[(m-1)(m-3)\cdots 1][(n-1)(n-3)...2]}{[(m+n)(m+n-2)\cdots 2]\color{red}{[n(n-2)...2]}}.\frac{\pi}{2} $$    Why am I not getting the solution given in my reference, more precisely, why do I get the additional term, marked in red, in the final solution ?  How do I reach the final solution from the recurrence relation ?  Similar question is asked before in , but it does not seem to get the same recurrence relation as in my attempt.  Note: I am having trouble proceeding from the recurrence relation, post mentioned below are attempts to derive the recurrence relation, which does not address the problem, that i have already derived it in my attempt.

$$\displaystyle\int \:\sin^n\left(x\right)\cos^m\left(x\right)\mathrm  dx=\frac{\sin^{n+1}x\cos^{m-1}x}{m+n}+\frac{m-1}{m+n}\int \:\sin^nx\cos^{m-2}x\,\mathrm dx$$  I have been trying to solve for over a week now can someone please help me.


Referring to the first response of this post, I really would like to know how this integral is solved. It's been bugging me for weeks and it is honestly one of the integrals I just couldn't find the trick, or way to solve I guess.  This is her. Prove:  $$\int_0^{\frac{\pi}{2}} \ln(x^2 + \ln^2(\cos(x))) dx = \pi\ln(\ln(2))$$  I feel like it's so beautiful because it's such an awkward arrangement of compositions of functions and it simplifies so nicely. I  would really like to know how this is done.

I encountered a strange integral with a strange result.  $$\int_0^{\frac{\pi}{2}}\log \left( x^2+\log^2(\cos x)\right)dx = \pi \log \left(\log (2) \right)$$  Believe it or not, the result agrees numerically.   How can we prove this result?   Please help me. I feel very curious to know how this can proved.


s = "alphabet" print(s[2:8:2])   this prints 'pae'  i understand that it starts counting from the left and starts from 0 so  0 = a 1 = l 2 = p 3 = h 4 = a 5 = b 6 = e 7 = t   so im not sure how the last :8 and :2] work

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


Here is the code to fetch a bunch of  tags which contains ID's and those ID's are use to fetch more data from the same file.. So to make this short as possible  index.html  var strURL ="co.php";         var req = getXMLHTTP();         if (req) {             req.onreadystatechange = function() {                 if (req.status == 200) {                     document.getElementById('content').innerHTML=req.responseText;                 }             };             req.open("GET", strURL, true);             req.send(null);         }   with that code I get my external file which contains something like this.  co.php
 Link 1 Link 2 Link 3 Link 4
    and thats all that is for the co.php file... I can see the links but the script just doesn't work... and I wonder why... now that script is prefer to be in the index.html and not in the co.php file... but the result is the same.. if the script is in index.html it doesn't work, so how can I make it work? ... like I said I prefer that      be in the index.html and make it work with the file that is from pull with ajax...

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.


I have written some click events on document.ready(). Some of them are working as expected. But few of them are not loading unless i put them inside setTimeout().  It is not working  $('.clsName').click(function(){ //code here   });   But, this one will work  setTimeout(function(){     $('.clsName').click(function(){ //code here}); }.2000);


Today one of the greatest questions coming up is what is dark matter. also what is dark energy. we don't know much about it still! I have tried to bring some light to this question.

I've been looking for questions about dark matter, and I've read some very interesting answers. However, I desire too look into it deeply.   This is not actually a question. I'm asking the community to recommend interesting references to understanding dark matter and dark energy.   I accept all sort of references: notes, books, scientific papers etc.  Let us assume some background on classical physics, thermodynamics and basics about quantum theory.


Let $G$ be a finite group. Let $I(G)$ be the set of elements of $G$ that have order 2. Suppose $|I(G)| \ge \frac 3 4 |G|$. Let $x \in I(G)$. We note $I_x(G)$ the subset $\{xg \in I(G)\}_{g \in I(G)}$. Show that $|I_x(G)| \ge \frac 1 2 |G|$.  I have shown that $I_x(G) \subset C_G(x)$ but I have no idea how to continue from there.. Can somebody please give me a hint (I'm not asking for the answer, I'd like to find that myself).

Suppose that $ G $ is a finite group where at least three-fourths of the elements are involutions, i.e., $$ |I(G)| \geq \frac{3}{4} |G|. $$ (Here, $ I(G) $ denotes the set of all involutions of $ G $, where an involution of $ G $ is defined as a group element of order $ 2 $.)  (1) Suppose that $ A $ and $ B $ are subsets of a finite set $ S $. Show that $ |A \cap B| \geq |A| + |B| - |S| $.  (2) Let $ x \in I(G) $. Show that $ |I(G) \cap x[I(G)]| \geq \dfrac{1}{2} |G| $.  (3) Let $ x \in I(G) $. Show that $ \{ 1_{G} \} \cup \{ g \in I(G) ~|~ xg \in I(G) \} \subseteq {C_{G}}(x) $.  (4) Use your answers to (1)-(3) to conclude that $ G $ is an abelian group.


I have a series of layers of lines (shapefiles) in My Project. The CRS of some are different and to merge them they all must have same CRS.   When I use Processing/Toolbox/Qgis_algorithims/Reproject_layer the reprojection only works if it is allowed to save to temporary file somewhere (it will not change the CRS when I reproject if I try to save and replace it in My Project directory); THEN  I must remove the original from the layer list and reproject the temp file (without changing the CRS) to get it into my project and name it appropriately.  Is this the only, or proper way to go about this?

I have a series of layers of lines (shapefiles) in My Project. The CRS of some are different and to merge them they all must have same CRS.  When I use Processing/Toolbox/Qgis_algorithims/Reproject_layer the reprojection only works if it is allowed to save to temporary file somewhere (it will not change the CRS when I reproject if I try to save and replace it in My Project directory);   I must remove the original from the layer list and reproject the temp file (without changing the CRS) to get it into my project and name it appropriately.  Is there a better way to reproject a layer in Qgis?