When I try to update my JavaFX app when the server adds a client, I receive a nullpointer for my FXML listview when I use my update function. Any clue why it will work in my intitialise and my events but not in my update method  FXMLController  public class FXMLController implements Initializable, Remote, ClientObserver {       @FXML private ListView listview;          List<RMIClient> clients;     RMIServer server;      public FXMLController(RMIServer server) throws RemoteException     {         this.server = server;     }      @Override     public void initialize(URL url, ResourceBundle rb) {         if(server != null) {             try {             ObservableList<RMIClient> clients = FXCollections.observableArrayList();             clients.addAll(server.getClients());             if(listview.getItems() == null)                 this.listview.setItems(clients);             else                 this.listview.getItems().setAll(clients);             } catch (RemoteException ex) { }         }     }          @Override     public void update() {        System.out.println(listview);     }  }   My Mainapp  public class MainApp extends Application {      public static RMIServer server;     private FXMLController controller;     @Override     public void start(Stage stage) throws Exception {         FXMLLoader loader = new FXMLLoader();         loader.setLocation(getClass().getResource("/fxml/Scene.fxml"));         controller = new FXMLController(server);         loader.setController(controller);         server.setObserver(controller);         Parent root = loader.load();          Scene scene = new Scene(root);         scene.getStylesheets().add("/styles/Styles.css");          stage.setTitle("RMINetwork Centre");         stage.setScene(scene);         stage.show();     }      /**      * The main() method is ignored in correctly deployed JavaFX application.      * main() serves only as fallback in case the application can not be      * launched through deployment artifacts, e.g., in IDEs with limited FX      * support. NetBeans ignores main().      *      * @param args the command line arguments      */     public static void main(String[] args) {           try           {             server = (RMIServer) Naming.lookup("rmi://localhost:1099/" + RMIServer.class.getTypeName());           }           catch(Exception e) { }           launch(args);     }  }   Scene.fxml  <BorderPane prefHeight="350" prefWidth="500" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" >    <left>     <ListView fx:id="listview" prefHeight="398.0" prefWidth="152.0" onMouseClicked="#ChangeContext" /> </left> </BorderPane>   Server class :  public class Server extends UnicastRemoteObject implements RMIServer {      private List<RMIClient> clients;     private ClientObserver observer;       public Server() throws RemoteException      {         this.clients = new ArrayList<>();     }      @Override     public void registerClient(RMIClient client) throws RemoteException      {         this.clients.add(client);         if(observer != null)          {               this.observer.update();          }     }      @Override     public void removeClient(RMIClient client) throws RemoteException      {         this.clients.remove(client);         if(observer != null)          {              this.observer.update();          }     }          @Override public String notifyClient(int index, RMICommand cmd) throws RemoteException  {     return this.clients.get(index).executeCommand(cmd); }  @Override public List<RMIClient> getClients() throws RemoteException {     return this.clients; }  @Override public void setObserver(ClientObserver observer) throws RemoteException {     this.observer = observer; }   So has anyone a clue to solve my problem?  Kind Regards


How can I determine the number of unique hands of size H for a given deck of cards?

I'm working on a card game, which uses a non-standard deck of cards. Since I'm still tweaking the layout of the deck, I've been using variables as follows:  Hand size: $H$ Number of suits: $S$ Number of ranks: $R$ Number of copies of each card: $C$    Thus, the total number of unique cards in the deck is $S*R$, and the absolute total number of cards in the deck is $S*R*C$.  Since there are duplicates for each card, I'm trying to find the number of unique hands of size $H$ that are possible for given $S$, $R$, $C$, and $H$. If I'm remembering correctly, ${S*R*C\choose H}$ would over count the number of unique hands in this case.  How would I handle this calculation with duplicate cards?  EDIT: As an aside, how would calculations of unique number of winning hands be different with duplicate cards? I'm thinking of having general types of winning hands, such as $N$-flushes, $N$-straights, $N$-of-a-kinds, etc (restricted to $1 \le N \le H$, naturally).


I would like to bring my girlfriend from the Phillipines to visit me in Trinidad. The easiest route seems to be manila intransit through Qatar and connect in Gatwick airport to Port of Spain Trinidad. From.my research it seems that no visa is required to transit Doha as the luggage will be checked all the way through to Gatwick. But as she will have to reclaim and recheck luggage she will require a visitor in transit visa. She will also require a visa on arrival into my country. She is currently unemployed in phillipines. I would really like to know if anyone has had experience in getting this transit visa. It seems as if you have to apply for it online but still also visit a visa application center in the Phillipines to have your biometric information collected. It all seems overwhelming. Grateful for any advice.


Git merge conflicts,unable to push or pull code from master

I’m stuck at this point where me and my teammate working on the master branch and we both pushed the code but I didn’t pull the changes and again pushed the code so here i’m now I can’t pull or push the code.. what should i do?


I'm currently trying to prove the following:    And this is what I've come up with so far:    And now I'm stuck. Perhaps the next step might be to eliminate for all x?  I'm sorry for using links, but it seems like I'm not allowed to do it otherwise due to needed reputation point.  Help would be appreciated.


How to obtain the functional derivative in variational inference?

Referring to , I wonder how to get the derivative of $q(z_k)$, the distribution of $z_k$, in eq. 23 from eq. 22.   Namely, eq. 22 is $L_k = \int q(z_k) \mathbb{E}_{-k}[\log p(z_k | z_{-k},x)]dz_k - \int q(z_k)\log q(z_k) dz_k$ and,  eq. 23 is $\frac{dL_k}{dq(z_k)} = \mathbb{E}_{-k}[\log p(z_k | z_{-k},x)] - \log q(z_k) - 1$  I suppose the derivation uses functional derivatives, which I know little about. I'd very appreciate a detailed derivation.


java: how do i print all of the values in an int array

I would like to print the entire array sPack[]. I take in up to 500 values into sPack then I sort in ascending order. My median value is off so I would like to print what my sort method is doing so I can see if it is an issue with my median method or my sort method.  int [] sPack = new int [500]; int i = 0; String input = br.readLine(); while(input!=null && i<500 && input.length()!=0)//(!input.isEmpty()&& i<500)// {   sPack [i] = Integer.parseInt (input);   i++;   input = br.readLine(); } sort(sPack, i); double Var = calcVariance(sPack,i); System.out.println (sPack); //this is where i need help***************<==


Ralink 3290 not working again after upgrade to 13.10

When I installed ubuntu 13.04, and 12.10 on my current computer I lost the ability to use the RALINK 3290 wifi.  I was able, in the past, to get it working by following the advice posted .  But after upgrading to 13.10 I am once again stuck without wifi and the normal solution is not working.    Here is the problem in more detail. I obtain the Ralink 3290 driver from either the vendor or the dropbox folder as described, no problem.  I extract the folder and make changes as described if needed. I run the 'make' command, as the command is running I get several warnings and then when I try and 'make install'  I end up with error:2  Here is the output when I run "make" and "make install" -   Clarification: My wifi is not totally non-fucntional, it can see the various wi-fi networks around me, and it tries to connect to my favorite ones, but it never fully connects.  It then just cycles through the various wifi networks, never connecting.


I received a Sandisk 32GB microSD from my dad who asked me to format it. Plug it into a USB-based adapter (no write protection switch) and tried to access it on my computer.   Problems :    right clicking into properties on the volume shows 0gb used / 0gb available , unable to access disk at it requires formatting. File system is RAW Unable to format it using :(windows default formatter , HP USB Disk Format tool , SD Formatter) Tried viewing it in Disk Management , it only shows 30Mb of Healthy Primary Partition , There is NO unallocated space at all. tried to use HDD : LLF but receive error message "device cannot be accessed because it is smaller than 65535 sectors" Unable to perform CHKDSK due to fs being RAW tried to clean and partition using list disk in cmd but no luck. the prompt says it has been clean but unable to create new partition and previously mentioned error persists. Tried to "unlock" the write protected using "attributes disk clear readonly". Went to registry to set StorageDevicePolicies/WriteProtected to 0 When trying to reformat using SD formatter (previously mentioned on #3) , it says disk is write protected despite going through 7 and 8. Running out of ideas and patience.   Please , I only want to know whether the mentioned microSD is still "save-able"/"re-usable", if yes , please do enlighten me. Thank you for reading. Any answer is very much appreciated.


Showing that the integral with respect to an abstract measure is infinite

Suppose $\mu$ is a measure on $(\mathbb{R}, \mathcal{B}(\mathbb{R}))$. Then show that, for $\mu$-almost every $x$ $$  \int_\mathbb{R} \frac{1}{(x-t)^2}\,\mathrm{d}\mu(t) = \infty $$  I am not sure where to start. Any hints are welcome.


How are mass and density treated in general relativity?

Background:  I am confused by how mass relates to the equations in general relativity. For example, given a certain mass density distribution, I am unsure how to express a system in terms of GR.  Example  Einstein field equation:  $G_{\mu \nu} = 8\pi T_{\mu \nu}$  $T_{\mu \nu}$ encodes both mass and energy, but I am unsure how. For example, even if I know the whole phase space density of the system $f(x^\mu,p^\mu)$, I do not know how to express $T_{\mu \nu}$, except in some special cases such as when dealing with a perfect fluid.  Question(s)   Is there any general way to express mass / density in GR? Additional/Bonus question: How would one express e.g. mass flow near a black hole, when most of the gravity contribution is from the black hole metric?   Any sources / additional reading is appreciated :)


Trouble understanding Landau & Lifshitz writing about Lagrangians and Galilean Relativity

We have two inertial coordinate systems, $K'$ and $K$. $K$ is moving with infinitesimal velocity ${\epsilon}$ relative to $K'$. Using Galilean relativity we can transform this into $v'=v+{\epsilon}$. Here Lagrangian is only a function of speed $L=L(|v|^2)$. $L'$ may differ from $L$ only by a total derivative of function of coordinates and time, i.e. $L'=L+\frac{d}{dt}f(q,t)$  $"$We have $L'=L(|v|^2+2{v}·{\epsilon}+{\epsilon}^2)$. [1. ] Expanding this expression in powers of ${\epsilon}$ and neglecting terms above the first order, we obtain $L(|v'|^2)=L(|v|^2)+\frac{\partial{L}}{\partial{|v|^2}}2v·{\epsilon}$ [2.] The second term on the right of this equation is a total time derivative only if it is a linear function of the velocity $v$ $"$  I understand nothing in the quoted part. How do we get [2.]? Why does $\frac{\partial{L}}{\partial{|v|^2}}2v·{\epsilon}$ being a linear function of velocity imply that it's a total time derivative?


Prove that $0 \le xy+yz+xz - 2xyz \le 7/27, \:\:\:x,y,z \ge 0$ with $x+y+z=1$.

Prove that $$0 \le xy+yz+xz - 2xyz \le 7/27, \:\:\:x,y,z \ge 0$$ with $x+y+z=1$.    Attempt:  We must prove $xy + yz + xz \le 2xyz + 7/27$  Assume $x,y,z>0$, since the case when all equal $0$ is clear.  Next, I have that $xy = \sqrt{x^{2}} \sqrt{y^{2}} \le (x^{2} + y^{2})/2$ by AM-GM. Same also for the $yz, xz$. Summing the inequalities we get $$ xy+ yz + xz \le x^{2} +y^{2} +z^{2} $$   Ley $\alpha =xy+yz+xz$, now   $$ x^{2} +y^{2} +z^{2} =(x+y+z)^{2} - 2 \alpha$$ so we also have $$ 3 \alpha \le 1 \implies \alpha \le 1/3= \frac{9}{27}.$$  Also $xyz \le (x+y+z)^{3}/27 = 1/27$ (by AM-GM).  So  $$  \alpha =xy + yz + xz \le 7/27 + 2/27$$  In order to finish the proof we must have  $$ 1/27 \le xyz$$ but instead we have  $ xyz \le 1/27$. This is the tricky part..    This problem is from IMO 1984:there is a solution in this link  that manipulates $xy+yz+xz-2xy$ into something with $(1-2x)(1-2z)(1-2y)$ and then use AM-GM. This only proves for the case $x,y,z < 1/2$.    How to finish the proof?


how to chat between 2 ubuntu machines in network?

I want to know that how we can chat between 2 ubuntu machines in a network.    there are many messengers but we are prohibited from using those who send the files.  any command line chat messenger for 2 ubuntu in network? or GUI will also work.


Adjusting axis label multiplier distance in pgfplots 3D axis

I'm failing at getting an acceptably positioned tick label multiplier in the following MWE of a 3D plot:  % !TeX program = lualatex \RequirePackage{luatex85} \documentclass[border=1pt]{standalone}  \usepackage{fontspec}   \usepackage{mathtools} \usepackage{siunitx}  \usepackage{xcolor}  \usepackage{tikz} \usetikzlibrary{     pgfplots.groupplots,     babel } \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{pgfplotstable}  \usepackage[main=ngerman,english]{babel}  \begin{document}  \centering \begin{tikzpicture}     \begin{axis}[         grid=both,         clip=false,         view={120}{45},         xmin=0,         xmax=0.01,         ymode=log,         ytick={0.01,0.1,1,10},         ymin=0,         ymax=100,         zlabel={C},     ]     \addplot3 [surf,samples=4,domain=0:0.01, y domain=1:100] {x+y};     \node at (rel axis cs:0.5,0,1) [above,sloped like x axis] {A};     \node at (rel axis cs:0,0.5,1) [above,sloped like y axis] {B};     \end{axis} \end{tikzpicture}  \end{document}   Behold how extremely far the tick label multiplier 10^-2 is away from the axis;    I'd like to have it closer or even better, at the other end of the axis.


Possible to install 64-bit Windows on 32-bit UEFI?

I recently purchased an HP Stream 7, which I was led to believe would have Windows 8.1 64-bit installed. However, it has 32-bit Windows, even though it has a 64-bit processor. Installing 64-bit has been problematic, and I found the reason is the 32-bit UEFI. Is there a way to change it or replace it with a 64-bit UEFI? Are there any other options for installing Windows 8.1 64-bit? Or is this impossible presently?  Thank you.


What is the time complexity of standard queue operations such as push_back and pop_front provided by std::queue in C++ STL? It is not mentioned in the documentation.


From Rutherfords alpha scattering, where alpha where fired at a thin peace of metal foil, he concluded that the nuclei were positively charged. He made this conclusion from the fact that alpha particles were scattered at different angles but would a negative charge not scatter the alpha the same way as a positive? As far as i can see it the scattering pattern caused by alpha been deflected of there path by an attractive force would be the same as a replusive. So why did he conclude the nucleus was positively charged??


How to compile a Unity/Vuforia project to iOs on Windows?

I need to compile my project to iOS version, but I don't have a Mac so I can't download Xcode and iOS sdk. Any ideas??


If I am a Celestial Warlock and I take the Magic Initiate - Cleric (Cure Wounds), does that now count as a Warlock spell for me?   Since under The Celestial it says: "The following spells are added to the warlock spell list for you." and Cure Wounds is on the list.   This last part in the SAC would lead me to believe yes: "In short, you must follow your character’s normal spellcasting rules, which determine whether you can expend spell slots on the 1st-level spell you learn from Magic Initiate."  Bonus question, option 2: If i took the feat after having one level in Celestial Warlock, could I take Cure Wounds using Magic Initiate - Warlock.


I'm using the following script to create path curve:   def create_curve(coords_list):     crv = bpy.data.curves.new('crv', 'CURVE')     crv.dimensions = '3D'     spline = crv.splines.new(type='NURBS')     spline.points.add(len(coords_list) - 1)      for p, new_co in zip(spline.points, coords_list):         p.co = (new_co + [1.0])  # (add nurbs      obj = bpy.data.objects.new('object_name', crv)     bpy.data.scenes[0].collection.objects.link(obj)   coords_list generated using another script. here are the first coordinates in coords_list:  coords_list[0] = [0,0,1] coords_list[1] = [1.079576297914498, 0.12957629791449818, 1] coords_list[2] = [1.796242964581165, -0.5870903687521685, 1]   But if you look at the layout tab it looks like the first and second coordinates were not included in the path curve for some reason.    What am I doing wrong?  How can I print all the points ensamble the path curve?


Is it possible to recover Classical Mechanics from Schrödinger's equation?

Let me explain in details. Let $\Psi=\Psi(x,t)$ be the wave function of a particle moving in a unidimensional space. Is there a way of writing $\Psi(x,t)$ so that $|\Psi(x,t)|^2$ represents the probability density of finding a particle in classical mechanics (using a Dirac delta function, perhaps)?


Center DIV vertically and horizontally in page

I am trying to center a DIV vertically and horizontally in a page:   * {   box-sizing: border-box; }  div.wrapper {       border: 1px solid red;   position: relative; }  div.window {   border: 1px solid blue;   max-width: 300px;   position: absolute;   top: 50%;   left: 50%;   transform: translate(-50%, -50%); }

     Sed blandit augue quis diam tristique fringilla. Morbi tortor leo, efficitur sit amet ultrices non, lacinia ut nunc. Donec ut odio a diam semper consequat quis in leo.

    Somehow this is not vertically centered. What am I doing wrong?


I am trying to fetch record in my trigger using SOQL using LIKE.  The value I need to compare is a combination of three fields. I am trying the below code. Not sure what I am doing wrong   string DocName = ''+q.SBQQ__Account__c+' - '+q.SBQQ__Account__c+' - '+q.Name+'%'; Document d = [Select id from Document where Name LIKE ''+DocName+'' order by CreatedDate asc LIMIT 1];


Where can I download windows vista legally?

I have lost my windows vista home premium disk, is there anywhere I can download an iso legally? The reason is because my HDD broke, I replaced it but, I can't find my vista disk to install the OS again.  P.S. preferably in swedish, and yes, i still have the product key.


Is there an easy way to put a box around a theorem in LaTeX? For example to state an important theorem. I tried using page 20 of the ntheorem , but I do not know how to use the package.


Center vertically elements inside table of defined size

I want to center vertically elements in my two columns table just in my left column, which I want it to be 30% of the line width and the second one to be left aligned and 70% of the line width. I have succeeded doing these two things separately but not together in the same table.  My code is the following:  \setlength{\arrayrulewidth}{1mm} \setlength{\tabcolsep}{18pt} \usepackage{array} \usepackage{tabularx}  {\rowcolors{1}{blue!50!white!60}{blue!30!white!70} \begin{tabularx}{\linewidth}{ |>{\arraybackslash}m{0.3\linewidth}|>{\arraybackslash}m{0.7\linewidth}|} \hline ID & GUIDEME-FR-FUNC-001 \\ TITLE & Functions Start Over \\ AUTHOR & IBM CIO\\ CREATION DATE & 25-09-2018 \\ SOURCE & GUIDEME-FR-FUNC-001 \\ SUBSYSTEM & Functions \\ TYPE & Functional \\ PRIORITY & High \\ STATUS & Approved \\ DESCRIPTION & The system shall permit users to start over and look for another room \\ TEST PLAN & Check if it is possible to go back to the main page once instructions have been displayed \\ \hline \end{tabularx} }   And the outcome is the following:


How to introduce an edge where two faces intersect

I'm looking for a way to introduce a cut to a plane where it is intersected by another plane.  The plane is a single face for simplicity.  Here's the setup:   Add a plane Add another plane and rotate it by 90 degrees at X or Y so it is not coplanar      Join the two meshes together using Ctrl + J and enter edit mode Notice that in edit mode face select allows selecting one or the other face Notice that no edge has been introduced where the two planes intersect     The first solution I came up with was to just use two loop cuts, one on each plane. In this setup the plane dimensions were left unchanged as was their location so it just so happens that the intersection edge coincides with what you get if you loop cut both the planes.  The second solution I found was to use a boolean modifier on both planes, selecting the other plane as the object for the boolean operation in both cases. This correctly introduces an edge where the planes intersect. The can be joined after both boolean operations have been applied, giving a single mesh with four faces as desired.  I am wondering about the general case, though. What if one plane was twice the size of the other, or shifted by half the size?  My solutions do not work in those cases. Loop cut needs to share origin in order for the cut offset (half the face size) to coincide with the intersection edge. Boolean doesn't work if the faces are different sizes or shifted against one another so that their edges do not connect anymore.  Is there a general purpose tool in Blender for selecting two faces which may or may not intersect and saying "introduce edges where they do"? Obviously some sort of logic needs to be applied when the faces are shifted so that their edges do not connect with each other, my thinking is in that case both faces should be cut as if the other face was infinite in size and not finite? Or some other logical fallback behavior.  Is there such a tool? This question is primarily for Blender 2.8.


Build local repo for ubuntu 16.04 and above

I want to build a local repo for Ubuntu 16.04 with apt-mirror tool. Can I configure it on Ubuntu 18 or do I need the same version of Ubuntu?  Thanks


How can natural selection occur at species level whilst not occuring at the individual level?

The chapter by Douglas Futuyma in 'Evolution' (Losos et al 2013, Princeton) states that natural selection can occur at the species level. Futuyma states that if natural selection occurs at the species level it does not occur at the individual level:      Neither gene selection nor species selection has molded the advantageous characteristics of individual organisms; rather, they have affected properties at the gene level or at the species level.    But how does natural selection occuring at the species level not affect individuals? Surely any selective advantage of a particular species must occur among particular individuals of that species. For example, if Species A is selected because it is browner than Species B, this will be because individuals of Species A are browner than individuals of Species B.


I have a Windows 8 (64-bit, not Pro) machine, and I want to limit the Internet bandwidth available to Windows Update. I read about BITS and GPMC methods, but I don't know how to open the BITS window, and GPMC seems like a Windows Server feature.  How can I control how much bandwidth is available to Windows Update and BITS?


Mark a comment as the answer to a question

I have a question and have seen others to which the best and most relevant answer (at least the one that solved my particular problem) is placed in the comments to the question as opposed to the answers:   I would like to recognize the commenter as the person who correctly answered the question, but there doesn't seem to be any way to do that. The only thing I could think of was to ask the commenter to repost his comment as an answer, but I cannot figure out a way to contact him. In the meantime the question is sitting unanswered and I am getting other "answers" (leading me to believe that people are not reading the comments and answers already posted before trying to answer it themselves).  How are we supposed to do this?  Note: I don't want to accept the comment as an answer (I agree completely with the answers to this question that comments are comments and answers are answers and they should stay that way). I do wonder if there should be some way to contact people in a reasonable manner (comments on their profile that they must opt in to receiving in email?).


"-4 more vote(s) needed to delete this question"

See . When you hover over the (7) in the delete button, it says: -4 more vote(s) needed to delete this question. It seems that this always assumes that 3 votes are needed to delete the question, which .


How rate of interest affects inflation rate

Suppose i invest 100000 today.and suppose rate of interest is 12% and inflation rate is 6% . so what amount i will get after 2 year at the rate of 12% and inflation of 6%.  In other word you can say,how the rate of interest affects inflation rate.  Please help me to get this.I'm struggling for this for a long while. Any help will be appreciated. Thanks in advance.


I've had two Android phone up til now (HTC Wildfire and SGS2). Sometimes they crashed and the only way to get them restart was to remove the battery. Now I'm thinking about buying a Sony Z1 Compact. Removing the battery is no longer something you can do without tools, and looking at youtube videos I think I will never do this.  Now I'm wondering - in those cases where a phone does not react anymore, how can you reboot the phone if you cannot remove the battery? Waiting until the batter is dead is one option, but that could take a day or longer, and is no option either. Or was I too impatient and is it just a matter of waiting?   In short: Is it always possible to reboot the phone without removing the battery?  There are many phones out there with a fixed battery, so I'm not the first with this problem. What are your experiences?


Please make the feed customizable in the mobile app

I would like to have my Feed customizable, e.g. set priorities, favorite tags, filter (by time, active bounties, unanswered...) Instead, it seems the very basics are missing! I am constantly annoyed by questions from Stack Exchange sites I don't care about.


I was given a spare webcam, but all I've gotten right so far is to load a driver and plug it in. It is an . I assume I need some software to operate it, but that web site offers nothing of the sort.   I once did something that was supposed to activate the external webcam, but it instead used my notebook's built it one, but I can't remember what procedure I followed.


Does the general theory of relativity imply time dilation across the whole universe?

If not, why is my idea below not possible?  The general theory of relativity tells us that time is slowed down by gravitational fields. We bounced radar signals off planets further from the sun, and ones nearer to it, and found that the light bounced off nearer ones was red-shifted, due to passing through stronger gravitational fields.  The universe has a great deal of mass in it. Although far from concentrated sources of mass, space-time is 'flatter', it should still be true that everywhere within the universe is within its deep gravitational 'well'. As a consequence, all light travelling through space should be slowed in time and red-shifted proportional to how far it travels - no?


Add CharMap (or at least - arrows) to EDITOR

In many cases, we have to make a special attention to specific part of code, and Arrows are great way for that. Is it possible, that CharMap (or at least several SpecialSymbols were added into post EDITOR (for Superuser, Stackoverflow and several other coding SO sites)? so, we can quickly insert those symbols/arrows into answer.    (Btw, or there could be a way to mark the part of code which should cause more attention to it... i.e. making the color of the word RED and BOLDED)  p.s. why you thought that i am including them in questions? I said while Answering to questions, it is usable for. So, it's not me who uses these chars, but any of answer-er.


Showing $x^{5}-ax-1\in\mathbb{Z}[x]$ is irreducible

This is an exercise for the book Abstract Algebra by Dummit and Foote (pg. 519): show $x^{5}-ax-1\in\mathbb{Z}[x]$ is irreducible for $a\neq-1,0,2$  I need help with this exercise, I don't have an idea on how to prove there are no quadratic factors for $a\neq-1,0,2$ (for $a=-1$ there is a quadratic factor).


Can I build a transistor through two diodes?  I am studying transistor and, from what I understand, a transistor it is two diodos, right?  I am thinking using two diode, just like this (), to make the place the transistor (e.g. BC548).  Someone already experience this?


How can I create an ADD gate for two quantum states?

I want to create an ADD gate like this:  in qiskit using elementary gates. Can it be done?


How to use same drive to access files from Windows and Ubuntu

Can I use the same internal hard drive to save my files from Ubuntu and Windows? I dual boot Ubuntu and Windows 10, and the data drive I wish to share is D: in Windows.


I have a SQL Server instance that has a linked server to an Oracle server. There is a table on the Oracle server called PersonOptions which contains the following data:  ╔══════════╦══════════╗ ║ PersonID ║ OptionID ║ ╠══════════╬══════════╣ ║        1 ║ A        ║ ║        1 ║ B        ║ ║        2 ║ C        ║ ║        3 ║ B        ║ ║        4 ║ A        ║ ║        4 ║ C        ║ ╚══════════╩══════════╝   I need to pivot that data so the results are:  ╔══════════╦═════════╦══════════╦══════════╗ ║ PersonID ║ OptionA ║ Option B ║ Option C ║ ╠══════════╬═════════╬══════════╬══════════╣ ║        1 ║       1 ║        1 ║          ║ ║        2 ║         ║          ║        1 ║ ║        3 ║         ║        1 ║          ║ ║        4 ║       1 ║          ║        1 ║ ╚══════════╩═════════╩══════════╩══════════╝   Any suggestions?


What could cause exposure problems after my camera got wet?

I had an unfortunate accident where my DSLR camera (and me) briefly ended up in a river. The camera wasn't fully submerged but it did get very wet. It still works, sort of, although the electrics are doing some random things. I'm hoping that's just a bit of dampness doing that, that will fix itself when it dries out fully.  More concerning is that the documents exposure metering seems to be all wrong when using the viewfinder. Pictures are extremely overexposed and nearly white. But if I use live view, then they are fine.  Why could cause this? I assume the light is routed a different way when using the viewfinder and maybe it is going through something with water/condensation on it?


Given $y_n=(1+\frac{1}{n})^{n+1}$ show that $\lbrace y_n \rbrace$ is a decreasing sequence

Given  $$ y_n=\left(1+\frac{1}{n}\right)^{n+1}\hspace{-6mm},\qquad n \in \mathbb{N}, \quad n \geq 1. $$ Show that $\lbrace y_n \rbrace$ is a decreasing sequence. Anyone can help ?  I consider the ratio $\frac{y_{n+1}}{y_n}$ but I got stuck.


Specified key was too long; max key length is 1000 bytes in mysql 5.6

one of the application server is internally creating the database on my mysql  but when ever the following create table command gets executed    CREATE TABLE ofRoster (         rosterID              BIGINT          NOT NULL,        username              VARCHAR(64)     NOT NULL,        jid                   VARCHAR(1024)   NOT NULL,        sub                   TINYINT         NOT NULL,         ask                   TINYINT         NOT NULL,        recv                  TINYINT         NOT NULL,        nick                  VARCHAR(255),        PRIMARY KEY (rosterID),        INDEX ofRoster_unameid_idx (username),        INDEX ofRoster_jid_idx (jid)    )   i am getting following error   ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes   i have set my default engine to MyISAM because i was getting following error in InnoDB  specified key was too long max key length is 767 bytes   my current engines are as follows   +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       | | MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         | | MyISAM             | DEFAULT | MyISAM storage engine                                          | NO           | NO   | NO         | | BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         | | CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         | | MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         | | ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         | | InnoDB             | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        | | PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+   now i really don't know how would i get rid off it as the application server itself is creating database automatically in mysql so i dont have control over it.   i am using Server version: 5.6.10 MySQL Community Server (GPL) version  character set of column   +--------------------------+--------------------------------------------------------+ | Variable_name            | Value                                                  | +--------------------------+--------------------------------------------------------+ | character_set_client     | utf8                                                   | | character_set_connection | utf8                                                   | | character_set_database   | latin1                                                 | | character_set_filesystem | binary                                                 | | character_set_results    | utf8                                                   | | character_set_server     | latin1                                                 | | character_set_system     | utf8                                                   | | character_sets_dir       | /usr/local/mysql-5.6.10-osx10.6-x86_64/share/charsets/ | +--------------------------+--------------------------------------------------------+


Need help accessing data outside of a loop[undefined]

The source is an excel file. I parsed and looped through the columns assigning headers. So far, this works fine. However I can't seem to access this data outside of the for loop as it comes up as "undefined" every time. I am using the xls package and this is in javascript. Changed the variable names to post the code due to sort of sensitive info. Let me know if there's any way I can clarify better. Thanks! let data = [] for (let fname of fileList) {         if (file_count > 1) {             continue         } else {         }         let excelFile =          XLSX.readFile(`FILE.xlsm`,          {             cellDates: true,         });         log('FILENAME', fname)         let sheet_name;         for (let sheet in excelFile.Sheets) {             sheet_name = sheet             log('SHEET NAME', sheet)         }         let array = XLSX.utils.sheet_to_json(excelFile.Sheets[sheet_name],              {                 header:                  ['HEADER_1',                  'HEADER_2',                  'HEADER_3']             } );         log('array', array[0].HEADER_1)               for(let i = 0; i<array.length; i++){             let data = {                 Obj_1: array[i].HEADER_1,                 Obj_2: array[i].HEADER_2,                 Obj_3: [i].HEADER_3             }                      }     }


By posting a selection of previously written text here, are we waiving our copyrights to the excerpt?

Posts on Stack Exchange sites have a Creative Commons license applied. However, on Writers, people will post snippets of their own writing for  purposes. Does that mean that if I post a critique question, it CC's the selection of work I post? Related:


What is the correct name for a "product function" on a monoid?

Let $W$ be a monoid. A function $f\colon W\rightarrow W$ is a "product function" if $f(w)$ is a product of constants in $W$ and positive integer powers of $w$. It could also be called a "non-commutative arithmetic sequence". I'd like to use the correct name to refer to these functions as well as the related monoid of "formal product functions in an unknown variable", isomorphic to $W * \langle x \rangle$, the free product of W and the free monoid in a single generator, $\langle x\rangle = \{1,x,x^2,x^3,\ldots\}$. These have the same relation as polynomial functions in a ring $R$ to formal polynomials with coefficients in $R$.


Ubuntu 14.04 has visual artifacts and freezes

I have recently installed Ubuntu 14.04 LTS on my laptop Sony Vaio VPCEA16FG. I have been getting system freezes (everything including display, mouse, keyboard stops working and I have to do a restart with the power switch) and there are random popups of "System program problem Detected"  On startup my screen is all splashed with black and white pixels and a System program problem detected message.  My video card info:    01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Madison [Mobility Radeon HD 5650/5750 / 6530M/6550M


How can I find the users which a shared folder, shared to programmatically?

How can I get list of users that a folders is shared to programatically?  I need a class or a method to do this, Is there any library or API for this?  I have a shared folder like \\faridb\TestSharedFolder an I want to get list of users (also in domain) that this folder is shared to.  The shared folder is on my own machine.   How can I get this list?


Shortest distance for cuboid by taking a certain path in 3D

I am stuck on part (b) of the question. Please see image above. How would I work out the shortest distance with reducing the amount of cheese the ant has to crawl through?


I am planning on buying a headset for my pc and its either going to be the Razer Kraken Pro or the Razer Kraken 7.1. The thing is that the 7.1 is a usb headset has some software for mic calibrations and sound quality which cannot be run under linux. My question is this, is there similar software in linux to calibrate the 7.1 headset or should I go for the analog Kraken Pro? Thanks in advance!


How to resolve Integrity constraint violation: 1062 Duplicate entry on node_access?

So I am looking all over and have yet to find out how to remedy this table issue.   Rules is the likely culprit because the violation occurs when creating a new node (with Workflow) and trying to have it move forward to a state called publish. It fails with PDO Integrity Constraint Violation 1062.  Now the problem is that NO new nodes can be created without error, by any user. How can I fix this? The error message references a node ID that doesn't exist in any table rows, I guess because the node was never actually saved.   I have adjusted Rules so this doesn't happen again on new nodes, but I need to get that error off without losing data.  The error message is the following one:     PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry "694-7-workflow_access" for key "PRIMARY": INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES ....   This is weird because I have completely truncated the table, deleted and added it back, and tried to build a new copy of the DB all without success. I can't for the life of me find the primary key duplicate in ANY table. These nodes, node revisions, or node access records simply don't exist for nid 694 (or anything above 660 really).  So far I have traced it to Workflow's use of hook_node_access_records(). If I comment out module_invoke('node_' . $op, $node) the nodes will submit, so it is definitely the access table/process causing the problem. Workflow returns a $grants array just fine.


How can I properly format the date on Android?

I am building an IOS and Android version and in my IOS, the date is formatted this way "June 23, 2017 at 8:58 AM".  In Android I am getting the date in numbers and then I assign them like this:   public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {   date_time = dayOfMonth + "-" + (monthOfYear + 1) + "-" + year;  timePicker(); }   and here is the timePicker() method:  private void timePicker(){         // Get Current Time         final Calendar c = Calendar.getInstance();         mHour = c.get(Calendar.HOUR_OF_DAY);         mMinute = c.get(Calendar.MINUTE);          // Launch Time Picker Dialog         TimePickerDialog timePickerDialog = new TimePickerDialog(this,                 new TimePickerDialog.OnTimeSetListener() {                      @Override                     public void onTimeSet(TimePicker view, int hourOfDay, int minute) {                          mHour = hourOfDay;                         mMinute = minute;                          et_show_date_time.setText(date_time+" "+hourOfDay + ":" + minute);                     }                 }, mHour, mMinute, false);         timePickerDialog.show();     }   which result to something like this "27-6-2017 16:55"  How can I formatted similar to the IOS version?


Say I have the following three phase wye configuration:      Let’s also assume that all three loads have the same constant resistance, therefore in this case the system is balanced and the neutral wire is not carrying any current.   The line to neutral voltage is 230v and the line to line voltage is 400v. The loads are purely resistive, they have no reactive components. Let’s say they each have \$1k \Omega\$ of resistance.  In this case we can calculate the power by simply doing \$P = \frac{V^2}{R} = \frac{230^2}{1000} = 53W \$ . Since we have 3 loads on three different phases, we can multiply 53 by 3 to get the total power; \$53 \cdot 3 = 160W \$  Now instead of wiring up three loads with 4 different cables (even though the neutral isn’t needed in this case) why don’t we try to connect one load in between two lines, i.e, connecting a load using the line to line voltage which is 400v. If we do this the total power is: \$P = \frac{V^2}{R} = \frac{400^2}{1000} = 160W \$  We seem to have the same power as our other configuration.  This of course is no coincidence due to the fact that line to line voltage is \$ \sqrt3 \cdot V_{phase} \$.  So the question is, why always use a 4 wire system (L1, L2, L3 and neutral) as opposed to using a two wire system since both systems deliver the same power? Isn’t it cheaper and easier to wire up some power hunger appliance with 2 wires instead of 4?   I’m aware that 3 phase ac motors require 3 phase in order to function and probably other appliances can’t handle 400v but they can 230v on three different sections.   So what is the main reason why this two wire line to line voltage system is practically never used?  Thanks


TCL - Create a regexp which will return the first match in a repeating string

I'm trying to create a regexp that will capture the first occurrence of a repeating string.  The string is a "list" of RSA certificates , in succession. I am only interested in the first.   The string looks like:  -----BEGIN CERTIFICATE----- CERT1.......... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- CERT2............ -----END CERTIFICATE----- ... ... ...   I've tried variations on the following , but it is returning the full list rather than the first item:  set match [regexp {(-----BEGIN CERTIFICATE-----.*-----END CERTIFICATE-----$).*} $certs matchAll firstCert]


Query Feature and Usage based entitlements license

I need to query programmatically the Feature license and usage-based license which is available in UI. Could someone please highlight if we can query the same or is it available in UI only, Thanks.


Why does Rhizome Lurcher see itself in the graveyard as it enters the battlefield? (GRN spoilers)

is a new card in Guilds of Ravnica that says:     Undergrowth — Rhizome Lurcher enters the battlefield with a number of +1/+1 counters on it equal to the number of creature cards in your graveyard.    that completely surprises me:     If you return Rhizome Lurcher from your graveyard to the battlefield, its undergrowth ability counts itself.   OK, I'm willing to believe that. But why does it count itself? I would have thought that as it enters the battlefield it's no longer in the graveyard and would not count itself. What's going on in the rules for this interaction that have it work out this way?


User inputs, clean and sanitize before sending to db

I've searched a lot of the questions here and I found that they either very old or suggesting using prepared statements PDO which I am not using.  So I need your help please.  I have a small discussion/chat box where a user submit a message using a <textarea>  What I need is sanitize and filter the user input so it only accepts plain texts (e.g. no tags, no html tags, no scripts no links, etc).  Also, it is important to allow line breaks.  Based on my reading I am doing the following in the following order:   trim() htmlentities($comment, ENT_NOQUOTES) mysqli_real_escape_string() nl2br()   Is what I am doing is right? or I am missing something?  Also is there anything I have to do when echoing the data from the db?  really, appreciate your help and kindness


Does retarded interaction of magnet and coil violate energy conservation?

Suppose we have a magnet and coil at sufficiently large distances apart such that any movement of magnet can not be known instantaneously at the coil, as change in magnetic field travels at the speed of light. Now, if i give magnet some kinetic energy. After moving to some distance at constant velocity , i will stop magnet by storing its kinetic energy in a flywheel (in form of rotational energy). so magnet will come at rest.  During the motion of magnet, it won't feel any resistance (due to lez's law) because signal, that magnet has been moved is not reached at coil yet. When this change in magnetic field reaches to coil and it will generate current opposing motion of magnet. But, magnet is already at rest so when this opposing magnetic field will reach at the magnet, the magnet will gain kinetic energy in opposite direction and this be will in turn produce current in coil again.  In this whole process, our input energy is not lost because magnet have not felt any resistance during its motion at constant velocity and we stopped magnet by storing its kinetic energy into flywheel . But still we are able to produce current in coil. Isn't this violating energy conservation law ?


How do I move the title to the center of the title bar?

Can I move the window title to the center of the title bar?   When the window is  normal:   And when it's maximized:     I just don't know what to do when I look for example here:   Well, I hope you will understand what am I looking for.  I'm using Ubuntu 16.04 LTS with Unity.


Can I become leader of the Thieves' Guild without finishing the main chain and is there any benefits from being the leader anyway?

I completed the quest where you get the Skeleton Key and I don't really want to continue the chain until I've done a lot of the other stuff in the game, since the key is so useful. Brynjolf said before that I would become leader of the guild after everything was over.  Can I become the leader anyway without finishing the Nightingales quest chain? Are there any bonuses for being the leader?


I have a problem: My school have a network drive, called I:\, which i can connect to from Windows 8, but i cant do it from Ubuntu :( I am a complete Linux noob, so its probably just because i dont know how to, but i write the info i need to connect from windows, so i hope you will help me :)     Share (At least i think so):   \vihcafil11.global.local\elevhome$\ums\htx\*username* Username:   Global\*username* Password: *password*   If you know how to do it, please help me ^^  Jonas Strand


I wish to configure Time Synchronisation on Ubuntu 16.04.4 but timedatectl give Failed to create bus connection: No such file or directory

When I look at  I can see the current time configuration with timedatectl but I always get an error.  $ timedatectl status Failed to create bus connection: No such file or directory $ sudo timedatectl status Failed to create bus connection: No such file or directory  # timedatectl status Failed to create bus connection: No such file or directory   There are no ntp packages installed and the service is running normal.  # systemctl status systemd-timesyncd * systemd-timesyncd.service - Network Time Synchronization    Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)   Drop-In: /lib/systemd/system/systemd-timesyncd.service.d            `-disable-with-time-daemon.conf    Active: active (running) since Thu 2018-03-15 15:37:16 CET; 17h ago      Docs: man:systemd-timesyncd.service(8)  Main PID: 1801 (systemd-timesyn)    Status: "Synchronized to time server 193.190.253.212:123 (1.be.pool.ntp.org)."    CGroup: /system.slice/systemd-timesyncd.service            `-1801 /lib/systemd/systemd-timesyncd  Mar 15 15:37:16 linux-repo systemd[1]: Starting Network Time Synchronization... Mar 15 15:37:16 linux-repo systemd[1]: Started Network Time Synchronization. Mar 15 15:37:21 linux-repo systemd-timesyncd[1801]: Synchronized to time server 193.190.253.212:123 (1.be.pool.ntp.org). Mar 16 08:28:56 linux-repo systemd[1]: Started Network Time Synchronization.


Android: Attempt to invoke virtual method 'void android.database.sqlite.SQLiteDatabase.execSQL(java.lang.String)' on a null object reference

I'm getting this error:      Unable to start activity   ComponentInfo{amsi.dei.estg.ipleiria.pt.ima/amsi.dei.estg.ipleiria.pt.ima.ListaEmpresas}:   java.lang.NullPointerException: Attempt to invoke virtual method 'void   android.database.sqlite.SQLiteDatabase.execSQL(java.lang.String)' on a   null object reference" on this line in my DBHelper:   The error is in this line:  database.execSQL(createEmpresasTable);   My DBHelper:  public class ImaBDHelper extends SQLiteOpenHelper {  private static final String DB_NAME = "IMA"; private static final int DB_VERSION = 1;  private static final String EMPRESAS_TABLE_NAME = "empresas"; private static final String NOME_EMPRESA = "nome"; private static final String DESCRICAO_EMPRESA = "descricao"; private static final String LOCALIDADE_EMPRESA = "localidade"; private static final String AREA_EMPRESA = "area";  private final SQLiteDatabase database;  public ImaBDHelper(Context context) {     super(context, DB_NAME, null, DB_VERSION);      this.database = getWritableDatabase(); }   @Override public void onCreate(SQLiteDatabase db) {     String createEmpresasTable = "CREATE TABLE " + EMPRESAS_TABLE_NAME +             "(id INTENGER PRIMARY KEY AUTOINCREMENT," +             NOME_EMPRESA + " TEXT NOT NULL," +             DESCRICAO_EMPRESA + " TEXT," +             LOCALIDADE_EMPRESA + " TEXT NOT NULL," +             AREA_EMPRESA + " TEXT NOT NULL," + ")"; database.execSQL(createEmpresasTable); }  @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {     String sql = "DROP TABLE IF EXISTS " + EMPRESAS_TABLE_NAME;     database.execSQL(sql);     this.onCreate(database); }   The rest are just methods to create, read, update and delete.  Sorry if this is a duplicate but I haven't found the answer for this exact problem in my searches. Thank you in advance!


A lot of people will probably gloss over this fact, but it looks like C-3PO meets BB-8 for the first time in this scene 0:20:                                But how does C-3PO know BB-8's name? Is there a time where C-3PO meets BB-8 before this and knows his name?


Which of these is preferable in a formal essay?  He thinks that the King will fall ill. He thinks the King will fall ill.  This can be extended to other words, like knows, predicts, or concludes. But what troubles me is that there seems to be no accepted answer for all words. For example, it sounds more natural to write  He predicts that it will rain today.  than without "that". But it also sounds more natural to write  He thinks it will rain today.  than with "that".


I removed Boot Camp the hard way, but then I got a Windows error anyway. Should I be concerned?

The short version:   I was running Boot Camp on my Retina MacBook Pro, but I decided just recently to ditch it because I never use it and I'd like to reclaim the space. The official method of removing it with Boot Camp Assistant failed so I went the harder route involving booting into Internet Recovery mode and deleting the partitions manually, which worked and gave me the space back - except when I rebooted I got a Windows screen telling me booting failed, and when I hold down OPTION on a boot I still see "Windows" as an option.   If I pick OS X when I hold down OPTION it boots like I want it to but on a restart it still gave me the Windows error screen. Booting into Internet Recovery again and setting "Macintosh HD" as the Startup Disk seems to have fixed it and now on subsequent reboots I'm in OS X like I want again, but I can still see "Windows" as an option as I hold down OPTION on reboot.   Is there any way to get rid of this "ghost" of Windows/Boot Camp on my system and if there's not, is this something I should be concerned with?  The long version  So here's the sequence of events:   Got my rMBP in 10/2014 A few months later I added Boot Camp, initially with Windows 8.1 and later upgraded to Windows 10 The other day I decided to ditch Boot Camp as it's taking up space and I never use it.  Did a few different backups Uninstalling Boot Camp via the Boot Camp Assistant didn't work, which is apparently really common Read online that the next best thing is deleting the Boot Camp partitions directly and/or modifying them to appease Boot Camp Assistant Tried removing the Boot Camp partition in Disk Utility. It wouldn't let me. (By the way, Disk Utility is really crappy and unusable in El Capitan - they've removed the old standard partitioning method and replaced them with a PIE CHART that doesn't work half the time) Did lots of reading, a fair amount of panicking, and booted into Internet Recovery mode Using the Disk Utility in Internet Recovery Mode (which is the old one from Mavericks/Yosemite, yay) I was able to do a series of maneuvers that, long story short, allowed me to delete the Boot Camp partition - along with a couple of others that, I'm guessing, are artifacts of Windows/Boot Camp - and got back to one big huge partition. I happily restarted... ...and was presented with a clearly-from-Microsoft screen (fonts, colors, etc.) saying Windows couldn't load. At this point I've got the "No! We killed you!" scene from Robocop going through my head Reboot, hold down OPTION, and I see Macintosh HD and Windows. I pick Macintosh HD OS X boots up, I have all my space back, life is wonderful Reboot the Mac to see what happens and I'm back in Windows error land Back in OS X (after rebooting and holding down OPTION again) I go to Startup Disk in System Preferences and try to set Macintosh HD as the start disk but it won't let me do anything because there's only one hard drive now and as far as it can tell it's already the startup disk I booted the Mac into Internet Recovery mode and set the Startup Disk to Macintosh HD (since, I'm guessing, when you're in Internet Recovery mode you're booting off of the temporary-from-the-Internet disk) and restarted.  Mac restarts in OS X like I want it to Reboot again, Mac still restarts in OS X like I want it to. Did this a few times to be sure. Reboot again, hold down OPTION, I can still see Windows as an option but I don't know where it's coming from   So basically things are where I want them to - except there's this "ghost" of my Boot Camp install lingering. Is there any way to get rid of it? And failing that, can I just ignore it safely?


Getting java.lang.NullpointerException while trying to call SetContentView() in android

I am calling a method of an activity class from another activity class.In the method i am calling setContentView() passing another xml file(Diffrent xml than the one i am displaying in my first class(calling class).So while calling setContentView(),iam getting null pointerException. Please find my code below: Calling class  mainListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) {        DisplayMessageActivity d=new DisplayMessageActivity();     try {         Toast.makeText(CallWebserviceActivity.this, "position"+position, Toast.LENGTH_SHORT).show();          d.showmessage(arrays, position,CallWebserviceActivity.this);     } catch (Exception e) {         e.printStackTrace();     } }   });  New class where setContentView() is called:  public class DisplayMessageActivity extends Activity {  public void showmessage(ArrayList<JSONObject> arrays,int position,Context context) throws Exception {   RelativeLayout relatelayout;      setContentView(R.layout.showdetails);      Toast.makeText(DisplayMessageActivity.this, "DisplayMessageActivity", Toast.LENGTH_SHORT).show();     }


Why have we assigned a negative charge to electrons (and positive for protons)?  I feel it would be easier if electrons were positive (thereby, protons negative)- electrons would flow in the direction of current rather than flowing in the opposite direction. Something that would make more natural sense.  Is there is a historical reason or just something we have overlooked and now it's too late to change it?  Or is there a compelling reason for this choice that I could not find over the web?


I want the ability to restart a xorg server via simple bash script. Something like this: #!/bin/bash exec killall X exec startx  Please, do not ask me why, I am who asks.


Theme Splash Image within the "Appearance -> Themes" control panel

I have created a theme, and its all working fine.   Within the WordPress control panel under "Appearance -> Themes", you can see the available themes (Twenty Fourteen, Twenty Thirteen etc etc) and they all have a splash image demonstrating what your blog could look like.  My theme just shows a blank canvas. Is there a way of adding an image or something to represent my theme?  I bet I have missed something really obvious. :/


Are there any known vulnerabilities in SHA-1 that can be exploited? Certain patterns that it shows? I recently performed a frequency analysis using 20,000 common words, and found nothing exploitable. What others techniques can I use to assert the security of SHA-1?


So this is kind of weird, and I'm not sure what the issue is, but when on some sites (I.e. Stack Overflow), the icons are incorrect.  The screenshot explains it better. Things look fine here on the Stack Exchange Meta, but on the Network Engineering site (for example) the icons for some sites are mixed up. (It does this for me for the drop-down list and HNQ lists.)  I've done a hard-refresh of everything, problem still persists.  Is this related to the new theme launch?


Why is it, when I decide to land a council member in order to boost their opinion, do I end up losing them? If I give, say, my spymaster a minor barony that I own, they are still my direct vassal, but I end up losing them, which defeats the whole point of landing them in the first place. I can appoint, say, a mayor as spymaster, so why can't I make my spymaster a mayor? What exactly are the rules here?


What does dd stand for? I've always referred to it colloquially as "Disk Destroyer", but what are the "official" words that make up the acronym/command?   According to  and  it could be one of the following:   It used to stand for 'copy and convert' and was renamed 'dd' because 'cc' was already in use for the C compiler. It is a remnant of 'Job Control Language' program conversion into the 'Job Entry System'. It means 'data destruction'


biblatex generated bibliography in thebibliography environment

Some journals ask to put the references in thebibliography environment. It is easy to do this using bibtex. One just finds the bbl file and paste everything in there, to the main text.  However, I could not find a similar way to do same when bibliography is generated by biblatex.   Any ideas?


NGINX - Redirecting www to non-www after redirecting http to https

I've checked out quite a few other answers to similar questions as well as tutorials on DigitalOcean, etc., with no success. Sorry for what is probably a very obvious problem - I'm new to this.  Essentially, I need to set up redirects so that http://, ., and . all redirect to https://.  Currently, https:// works fine and http:// redirects to https://. I need to redirect www traffic because the SSL cert is only configured for non-www. However, when I've tried to add another server block to the config to redirect www (http and https) to https://, the server closes the connection on all 4 variants.  Here's my config:  # HTTP - redirect to HTTPS server {     listen 80;     server_name www.example.com example.com;     return 301 https://example.com$request_uri; }  # HTTPS www - redirect to non-www RESETS CONNECTION #server { #    listen 443; #    server_name www.example.com; #    return 301 https://example.com$request_uri; #}   # HTTPS — proxy all requests to the Node app server {     # Enable HTTP/2     listen 443 ssl http2;     server_name example.com;      # Use the Let’s Encrypt certificates     ssl_certificate /etc/not/my/path/live/example.com/fullchain.pem;     ssl_certificate_key /etc/not/my/path/live/example.com/privkey.pem;      # Include the SSL configuration from cipherli.st     include snippets/ssl-params.conf;      location / {         proxy_set_header X-Real-IP $remote_addr;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         proxy_set_header X-NginX-Proxy true;         proxy_pass http://0.0.0.0:2368/;         proxy_ssl_session_reuse off;         proxy_set_header Host $http_host;         proxy_cache_bypass $http_upgrade;         proxy_redirect off;     } }   Can anyone tell me what I'm doing wrong? Again I know it's probably painfully obvious but I just can't get this to work. Should I be doing this with something other than an NGINX redirect?


Finding total after percentage has been used?

Tried my best with the title. Ok, earlier while I was on break from work (I have low level math, and want to be more fond of mathematics)  I work retail, and 20% of taxes are taken out, and I am wanting to find out how much I made before 20% is taken out.  So I did some scribbling, and this is without googling so please be gentle. but lets say I make 2000 dollars per paycheck, so to see how much money I get after taxes I do 2000 * .8 which gives me 1600. I can also do 2000 * .2 which gives me 400 and then do 2000 - 400 (imo I don't like this way since I have a extra unnecessary step)  Anyways, I was pondering how to reverse that to have the answer be 2000, and what I did was 1600 * 1.20 (120%) which gave me 1920, and I thought that is odd so I did 1600 * 1.25 and answer was 2000 exact.  My question is why did I have to add extra 5% (25%) to get my answer? I am sure I did something wrong, and I fairly confident the formula I am using is a big no no.  edit; wow thank you all for your detailed answers. I am starting to like mathematics more and more.


How do i get windows' view like on Fedora, where pressing super key?

When I use Fedora if I press the super key I get the view of all the applications i'm using, and it's very comfortable, is there a way of having this on Ubuntu?  Thanks.


I sometimes run into an edit being rejected on grounds (/ with comments) that make me suspect that the reviewer was not paying attention making a mistake. Is there a way to report the review decision for moderation?  I spend over 30 minutes trying to make a quality edit that would benefit future readers of some answer. In this case it turns out the reviewer rejects 245 out of 682 reviews and reviewed my edit along with 19 others within 7 minutes (average of 21 seconds per edit: reading, weighing, write comment on reasoning).  Waiting hours for a review is not nice, but understandable. When this waiting is for nothing because of hasty reviewing it is a waste of both my time and the other reviewer that already reviewed and accepted the edit.  This is all assuming that the edit was quality and the review was not. I believe so, but how to arbitrage such a case? This is the subject for this question.  I am writing this while having no reviewing experience myself yet, so it seems easy to judge what I might not fully understand. I do assume the best intentions of our reviewers.   Nevertheless mistakes can be made and it is important that reviewers have a way to receive feedback in case of bad calls. I think this is an important subject for (in this case) Stack Overflow because one or more of such encounters can demotivate me (/ users in general) to make honest attempts to improve the content available to this community.  Searching Meta for this subject revealed a lot of hits about review-audits. This post is (as I understand it) not about review audits, but about flagging review decisions. I do understand that nobody likes his/her edit being rejected, which could result in a lot of emotional flags on correct rejects.  I do have ideas on how Stack Exchange can deal with this, but with this topic I would specifically like to gauge if the Stack Exchange community recognizes this as a problem and if Stack Exchange already has concrete plans / features / intentions for dealing with this. Depending on the responses we can start a concrete question weighting solutions.


Is there a FAQ that can be accessed from the Android mobile app?

I was recently referred to  where Jeff refers to creating an FAQ.   Does it exist, and is it accessible from an Android smartphone's Stack Exchange app?


Issue with particles in blender donut tutorial

I have been recently doing the blender donut tutorial and ran into a problem regarding the sprinkle particles. The particles (hair) keep appearing on the underside of the icing. As seen in the image below, most of the hair particles only come out from the bottom of the icing. I tried to readjust the normals but I realised the normals were already correct. (Blue colour donut in image) Someone suggested following through the weight painting part of the tutorial. However, the sprinkles still remain on the underside of the icing. What is the actual problem and how do I solve this?  Particle settings below  Edit: @moonboots Thanks the hair particle problem has been solved. How do I prevent the submersion of the sprinkle particles?


Cumulative distribution functions (cdfs) range uniformly

I am confused .. how does this happen?  "continuous cumulative distribution functions (cdfs) range uniformly over the open interval (0,1).".  How does the cdf range "uniformly" (each value having the same probability of occurance) between [0,1]?


Best way to shrink a DB after nulling data from varbinary(max)?

We have a database with a large amount of data stored in a field of type varbinary(max). At some point we can purge that data for most rows, but not all. Our plan is to make that field nullable, and simply null out the data when it is no longer needed. Once we do that we would like to reduce the size of the DB. What is the best way to accomplish this?   If there isn't a good way to reclaim space with the current setup, one idea I have is to move that data field to a separate table with just two columns: the key to the main table and the data field. Then we could simply delete the rows when they are no longer needed. (And then do some sort of shrink.) However, this would be a much more difficult change to make than simply making the existing field nullable.  Note: I actually don't care so much about making the database file smaller, but I do care about the newly freed up space becoming re-usable.  Over 90% of the DB size is this one field. I'm at 3TB already.


Prove or disprove: Every subgroup of the integers has finite index.

Please check my proof   I claim every subgroup of the integers has finite index  Suppose nZ is subgroup of integer  Then the cosets are   (n)+0,(n)+1,(n)+2,.......(n)+n-1  Since the cosets can't exceed (n-1)  therefore, every subgroup of integers has finite index


I just wanna disable my secure boot policy on win 8 to install ubuntu,how do i do that?

i tried googlinmg my problem,but couldn't quite find a solution for that.I've got HP pavilion e0539TX Pearl white and i won't get a secure boot manager in the UEFI option after restarting.


As I understand it,  is a service that'll let you skip to the front of the line. To get it you have to go to an enrollment center and have your biometrics taken. It's my understanding that this visit to the enrollment center does not need to be scheduled.  I have a few questions about how it works.   Can I just get to the airport early and do it before my flight? Or would I be better of taking a half day of vacation and taking care of it, myself, a few weeks before the flight? Does CLEAR work at all hours? Like let's say I have a flight that departs the airport at 11pm. The airport in my hometown does have a few scant flights that depart at that time but, by and large, all the shops are closed and TSA is basically a skeleton crew at that point. If it wouldn't work then at what times would CLEAR work? Is there a website that'd list the hours for CLEAR? There are a few promo codes for CLEAR floating around the internet.  has two. idk if they're still valid (the post I linked to is over a year old) but let's say they are. Can I use them if I choose to register in-person as opposed to online? What if my trip isn't for six more months. How soon before the trip should I register? Like if I register right now - a full six months before my trip - could I still get my biometrics taken when I'm at the airport about to catch my flight or will I need to get my biometrics taken before?   Thanks!


using .set(index, element) for an arrayList of arrayList sets the wrong elements

for (int outer = 0, index = 0; outer < keySize && blockIndex < keySize; outer++, blockIndex++) { //added a -1                 int i;                 for (i = 0; i < blockSize && index < shifted.size(); i++, index++) {                     //System.out.println("adding: " + shifted.get(index));                     //System.out.println("to: " + i);                      aBlock.set(i, shifted.get(index));                     //blocks.set(outer, aBlock);                                      }                 System.out.println("ablock" + aBlock + " index " + outer);                 blocks.set(outer, aBlock);  so I have a forloop that fills up a regular arrayList called aBlock, once the arrayList is filled i try to set it into a specific index in an arrayList of arrayList. I have already filled the blocks arrayList with other arrayLists that only have the elements 0. So I don't think the issue is that its an empty arrayList. Also printing out aBlock seems to print out the right arrayList but when I use .set inside of the forloop to set all of the arrayLists into the blocks variable it seems to set the last arrayList and copy it into every index. so every element inside of blocks is identical copies of the last aBlock element when it shouldnt be. how do i fix this issue? aBlock.set seems to work fine because I printed the aBlock element after it was filled each time and it contains the right values


A ring homomorphism over rational numbers is the identity

Let $f : \mathbb{Q} → \mathbb{Q}$ be a ring homomorphism. Show that f is the identity.  Im having trouble with this problem. I started considering two elements in $\mathbb{Q}$ and the definition of ring homomorphism:  Let $x, y \in \mathbb{Q}$ such that $x = \frac{m}{n}, y=\frac{m'}{n'}$with $m,m',n,n'\in \mathbb{Z}$ then:  $f(\frac{m}{n}*\frac{m'}{n'}) = f(\frac{m}{n})*f(\frac{m'}{n'})$   and   $f(\frac{m}{n}+\frac{m'}{n'}) = f(\frac{mn'+m'n}{nn'})=f(\frac{m}{n})+f(\frac{m'}{n'})$   Clearly, my goal is to show that:  $f(\frac{m}{n}*\frac{m'}{n'}) =\frac{m}{n}*\frac{m'}{n'}$  or   $f(\frac{m}{n}+\frac{m'}{n'}) =\frac{m}{n}+\frac{m'}{n'}$  I've been thinking for like an hour and still achieve nothing, any ideas/hints?


Can someone show me how to handle java.lang.NullPointerException in my code below

I get the exception whenever I run the program without passing in  the usDollarAmount or cancel the program... I'm using swing components to accept user input. The program works fine otherwise.  Please show me how to handle this... Thanks  THE Currency CALCULATOR Exception in thread "main" java.lang.NullPointerException at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) at sun.misc.FloatingDecimal.parseDouble(Unknown Source) at java.lang.Double.parseDouble(Unknown Source) at Currency.main(Currency.java:28)  import java.text.DecimalFormat;  import javax.swing.JOptionPane;   public class Currency{  public static void main(String[] args) {     // declare and construct variables       double usDollarAmount, poundsAmount,eurosAmount,rublesAmount;      DecimalFormat twoDigits = new DecimalFormat("####.00");      //print prompts and get input     System.out.println("\tTHE Currency CALCULATOR");      //print prompts and get input     usDollarAmount = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter your dollar amount:"));        // calculations      poundsAmount = 0.64 * usDollarAmount;     eurosAmount = 0.91 * usDollarAmount ;     rublesAmount = 61.73 * usDollarAmount ;       // output   JOptionPane.showMessageDialog(null, "YOUR DOLLAR AMOUNT OF  " + twoDigits.format(usDollarAmount) + " is equal to  " + twoDigits.format(eurosAmount)  + " euros"  + " ," + twoDigits.format(poundsAmount)  + " pounds"  + " " + " and " + twoDigits.format(rublesAmount) + " rubles"  );   System.exit(0);  }   }


Titlingpage thanks footnote symbols show last symbol only (memoir class)

I have a question regaring the titlingpage environment of the memoir class. I use \thanks multiple times on the title page, but the footnote symbol marks are all the same (the last symbol, which in my case is the last of the asterisk-dagger-ddagger ... set).  What is causing this and how can I fix it?  You van view both my entire code and compile the document here: [EDIT: removed url, as it doesn't exist anymore]  I tried making a MWE, but couldn't reproduce it. The code is not very extensive yet, so I believe it is an incompatibility of memoir with a package or package setting.


Java equivalent to PHP's preg_replace_callback

I'm in the process of moving an application from PHP to Java and there is heavy use of regular expressions in the code.  I've run across something in PHP that doesn't seem to have a java equivalent:  preg_replace_callback()   For every match in the regex, it calls a function that is passed the match text as a parameter.  As an example usage:  $articleText = preg_replace_callback("/\[thumb(\d+)\]/",'thumbReplace', $articleText); # ... function thumbReplace($matches) {    global $photos;    return "<img src=\"thumbs/" . $photos[$matches[1]] . "\">"; }   What would be the ideal way to do this in Java?


I've googled for it, and there's very little info besides "bamf matches application windows to desktop files".  Unity depends on it so it's difficut to remove, at least would be good to know what it does.


Declaring multiple authors in pdfauthor from hyperref

How do I typeset multiple authors with the pdfauthor option from the  package?  If I try     pdfauthor={A, B, and C}   the names in the author field (when displayed in Adobe Reader) are surrounded by ";        How do I get rit of the "s.


I have been thinking of this sentence:     All these factors culminated in my choosing [some life decision].   Is the usage of my choosing correct?


Get immediate folder of file using find (issue with spaces)

I'm trying to search my Movies folder to find the immediate folder of the .MKV file I'm searching for. The below works (echo 5) to save the immediate folder as a variable, BUT, it does not work if $mkvfile contains spaces. I've been unsuccessful in getting $moviename to work if $mkvfile contains spaces.  searchdir="/mnt/storagepool/storage/downloads" moviedir="/mnt/storagepool/storage/media/Movies"  #MKVs in root folder  for filename in $searchdir/*.mkv; do   #Get .MKV file from root of the downloads/search directory.     mkvfile="$(basename $filename)"     #echo 2 $mkvfile    #Search for the MKV file in the media/Movies directory to find the corresponding movie folder name     #echo 3 "${moviedir}"     #echo 4 $mkvfile     moviename=$(find "${moviedir}" -name '$moviedir' -prune -o -name "$mkvfile" -exec dirname {} \;)     echo 5 "${moviename}" done


How do I find the recurrence equation solution for $T(n) = T(n-1) + n + 2?$

Okay so I am supposed to find the recurrence equation of $T(n) = T(n-1)+n+2$, where $T(1) = 1$. I know the answer should come out to be $\dfrac12(n(n+5)-4)$ but I don't understand how to get that answer.


What damage is doubled when using decisive strike?

Regarding decisive strike from PHBII:     If the attack hits, it deals double damage (as does any other attack you make before the start of your next turn).   Does this follow the rules of critical strikes where additional damage dice are not doubled (e.g. if a wizard cast sonic weapon on a bow, critical strikes won't double sonic weapon damage), or does it double all damage dealt? It seems like decisive strike does not have the exception outlined for critical hits on p.140 in the PHB, so it would appear to double everything. I am unsure, though.


I want to start an Xorg server (which should only feature a minimal xterm terminal emulator from a newly created "pristine" tty). I have thought this to be as simple as issuing a xinit or maybe a startx however both have failed me. Therefore the question: How to manually run/init/start a Xorg server on a different VT/TTY? here the Longer background story to the question at hand: This is the backgroud and what I have tried already: Looking at man openvt I was able to run a shell on a newly created tty (or vt, cannot tell precisly the different vt<>tty) like this:  $> sudo openvt -s /bin/bash  the -s of causes the direct switch to that new tty/vt on that new tty I wanted to manually start a Xorg server which according to man xinit should start with a minimal xterm application. On the new shell on the switched to tty I (created via openvt) I hence issues this command:  $> su -c 'xinit xterm -display :4 -- :4' - mahr &>/tmp/output  and I receive this output $> cat /tmp/output X.Org X Server 1.19.6 Release Date: 2017-12-20 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.4.0-148-generic x86_64 Ubuntu Current Operating System: Linux scitech 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 Kernel command line: BOOT_IMAGE=/vmlinuz-4.15.0-70-generic root=/dev/mapper/ubuntu--vg-root ro Build Date: 03 June 2019  08:10:35AM xorg-server 2:1.19.6-1ubuntu4.3 (For technical support please see http://www.ubuntu.com/support)  Current version of pixman: 0.34.0     Before reporting problems, check http://wiki.x.org     to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting,     (++) from command line, (!!) notice, (II) informational,     (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/home/mahr/.local/share/xorg/Xorg.4.log", Time: Thu Nov 28 10:57:53 2019 (==) Using system config directory "/usr/share/X11/xorg.conf.d" (EE)  Fatal server error: (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied) (EE)  (EE)  Please consult the The X.Org Foundation support       at http://wiki.x.org  for help.  (EE) Please also check the log file at "/home/mahr/.local/share/xorg/Xorg.4.log" for additional information. (EE)  (EE) Server terminated with error (1). Closing log file.  Session terminated, terminating shell...xinit: giving up xinit: unable to connect to X server: Connection refused xinit: unexpected signal 2  ...terminated.


Jars of salsa, do I have to boil the jars if they sealed on their own?

Wondering if I have to boil my homemade jars of salsa to seal them if they sealed on their own. (Yes I sterilized them before hand) The salsa went in hot and once the lid was on, about 5 minutes later there was the telltale pop!   IF this is safe, how long does something like homemade salsa and homemade sauces keep for in sealed jars?  Thanks! ~Andrea


I don't understand why the node command will not work, whereas nodejs works:  $ node --version zsh: command not found: node $ nodejs --version v0.10.15   I tried apt-get install nodejs, but the latest version is already installed.  And furthermore:  $ npm zsh: command not found: npm   I thought npm was included in NodeJS > 0.10?


Can you leave objects behind in the ethereal plane?

After entering the ethereal plane through some means, is it possible to leave objects you brought with you behind, or do they always come back with you?  Does the answer depend on the means you used to enter the ethereal plane, or on the specific object you're trying to leave behind?  Note: You only need to consider content published in official material when answering this question, but if the official material is completely silent on this matter interpretations are also fine.


ubuntu 16.04 LTS how can i resolve this issue it comes when boot and shutdown and also in that case my ubuntu is not downloading it have dependence error sudo apt-get update so and soo are not working properly by this problem please anyone can help me   /dev/sda1: clean, 220240/30269440 file, 2971359/121076736 blocks


Most of my visits are from baidu spiders. I don't think it helps search engines at all so I'm thinking of how to block them. Could this be done via iptables? I'm using nginx as my webserver.


I want to test in a script whether a hostname resolves to something other than 127.0.0.1 as a pre-flight test for an install script. The tools I know (dig, nslookup) specifically query DNS. In my situation a correct entry in /etc/hosts is a valid configuration. So the question is:  Is there a dig-like tool, ideally already on the system, that does the full name-resolution process via nsswitch.conf, like (for example) ping does?  dig my-test-server-that-only-exists-in-etc-hosts    returns NXDOMAIN.


I mount the first one, run the Setup (it's a Windows program), and when it asks for DISC 2, I try to unmount the ISO, but it says it can't be unmounted because it's busy, which is obvious. In Windows, you can unmount the disc while the Setup is still running. My question is if there's any workaround this and mount the second image while the setup is still running?  Thank you.


How to download a video from YouTube in Ubuntu 14.04 (Trusty Tahr)

How can I download a video from the YouTube URL ?


The 10th and last round of negotiations between Iran and the six world powers was held in Vienna in a bid to strike a final deal. However, after the sides failed to agree on a final deal they decided to extend the negotiations until / by July 1, 2015.   In the original text the preposition until has been written. I am, however, wondering if we could use by instead, if so, is there any difference semantically?  Any help would be greatly appreciated


Let $R$ be a ring. An element $r \in R$ is called nilpotent if $r^n=0$ for some integer $n \ge 1$. Show that if $r$ is nilpotent in a ring with identity, then $1-r$ is a unit in $R$.   Proof. Recall that in any ring we have $(−a)(−b) = (ab)$ Thus in any ring with 1 (commutative or not) we have the following identities:  $1 −(−1)^na^n = (1 + a)(1 − a + a^2 − · · · + (−1)^{−1}a^{n−1})$  If $a^n = 0$ then we obtain an inverse $1 − a$  Now, I'm not so familiar with series and am not sure if this suffices. I also assume this can be shown with matrices, integers....as long as it is a ring


Powering a Line Laser 5V 200mA using USB port

I have a IR Line Laser with following Specs  Output Power    : 60mw  Wavelength      : 780nm  Working Voltage : 5.0VDC  Working Current : <200mA  Laser Shape Line  for details please visit the link   i would like to power this device using a USB port via a cable. iknow USB has an output voltage 5V but isnt it 500mA ?? Some say Device draws only required current from USB port  My question is can i directly connect laser to USB port by cutting a USB cable? Or should i convert 500mA to 200mA? If so how can i do it ? Can someone specify a solution?  Thanks in Advance


How can I render an object with an hdr background?

I have an object with an hdr for the background. What do I do in Cycles to render the background with my object?  How is this different from an ordinary render in Cycles?  The hdr is a big one, 350MB.


Will light naturally tend to align itself to magnetic flux lines?


Unable to access parameters inside anonymous inner class on Android

My question deals with the fundamentals of JAVA. I am creating an Android app  and would like to access method parameters inside an anonymous thread that I create inside the method. Somehow, I keep getting null pointer exception. Here's how my code is looking like:  public void myMethod(final float x, final float y){ new Thread(new Runnable(){ float xx = x; float yy = y; @Override public void run(){ //inside run method I create a for loop that uses the "x" and "y" parameters //as "xx"  and "yy", respectively. //keep getting null pointer exception on line where i attempt to do  //calculations with x and y    }    }).start();   }   If anyone could please have a an answer it would be great. Should I make the method static? Perhaps, get rid of the final keyword?  thank you


Null Pointer Exception by using errorPage attribute in JSP page

I have a jsp page which can throw some exceptions. I have another JSP page - catchError.jsp this should be displayed whenever the exception occurs in any of the JSP pages. I have added below code into catchError.jsp <%@ page isErrorPage="true" %>  And my JSP page - displayDetails.jsp has below code, here I have introduced arithmetic exception for demo purpose. <%@ page errorPage="catchError.jsp" %> <% int div = 10/ 0; %> I am getting null pointer exception whenever I am trying to access displayDetails.jsp. It should throw arithmetic exception ideally, which will then get redirected to catchError.jsp. stack trace: org.springframework.web.util.NestedServletException: View rendering failed; nested exception is java.lang.NullPointerException  javax.portlet.PortletException: org.springframework.web.util.NestedServletException: View rendering failed; nested exception is java.lang.NullPointerException  Per my guess, the system is unable to find catchError.jsp in error page attribute itself. Any reason why this is happening and any suggestion on how I can proceed.


I'm trying to import a Sentienl 2 image into RStudio (Version 1.0.136) using rgdal (v. 1.2-5) package. However, it seems something is wrong. My OS is macOS Sierra v. 10.12.1  S2<- readGDAL("S2A_OPER_MSI_L1C_TL_SGS__20160916T153615_A006454_T34VCR_B12.jp2") Error in .local(.Object, ...) :  I have checked gdalDrivers() and this is what I got:  64  JPEG JPEG JFIF  FALSE  TRUE     TRUE    I've checked already this link but didn't work for me   I think I have to instal the jpeg2000 driver but not sure about how to do it.  Any idea about this issue?


How to solve $ 13x \equiv 1 ~ (\text{mod} ~ 17) $?   Please give me some ideas. Thank you.


Big space between longtable/longtabu and the preceeding section header

If I add a longtable or longtabu environment directly after a \section command a very big space is set between the header and the table. In case of the second example where some text is in between these two elements, that's no problem. But in the other cases the big space bothers me. Anyhow, with a regular tabular-environment this problem does not occur.  I already tried to use things like \raggedbottom. A \vspace{-1em} solves the problem, but that seems like a very sloppy solution to me.  Can anyone tell me how to get rid of that space?  EDIT: After another round of extensive search and studying the log file, I was able to figure it out: the space is specified by \LTpre and adding \setlength{\LTpre}{0pt} resulted in the desired output. Afterwards I found a previous question about the same problem:   MWE:    \documentclass[10pt]{scrartcl} \usepackage{longtable} \usepackage{tabu}   \begin{document} \section{First section with longtabu} \begin{longtabu} {rX}     cell1-1 & cell1-2\\\\     cell2-1 & cell2-2\\\\ \end{longtabu}   \section{Second section with longtabu} Some text prior to the table \begin{longtabu} {rX}     cell1-1 & cell1-2\\\\     cell2-1 & cell2-2\\\\ \end{longtabu}   \section{Another section with longtable} \begin{longtable}[l]{rl}     cell1-1 & cell1-2\\\\     cell2-1 & cell2-2\\\\ \end{longtable}   \section{Last section with tabular} \begin{tabular}{rl}     cell1-1 & cell1-2\\\\     cell2-1 & cell2-2\\\\ \end{tabular}   \end{document}


My table is refered in Alphabetical order!

In my text i put my table      \ref{table:3}   AND IN MY TABLE I START BY      \begin{table}[H]\label{table:1} \centering   But imagine my surprise when I see my table being referred as table a in my tex...!!


Please settle an UNO debate with regards to Wild Draw 4.  The face card on top of the pile is a Blue 0.  Player 1 plays WD4 but does not change the color.  Player 2 plays WD4 changes the color to Blue.  Player 3 challenges player 2 on having Blue cards.  Who is being challenge player 1 or 2?


Hide some commands from bash completion?

In bash, suppose I have these commands:  $ pyt[TAB][TAB] pytest python python-config python-dbg   99% of the time, I'd go for python. It's so annoying that pytest pops up and prevents me from typing only pyt[TAB][RETURN] to invoke python. Can I hide pytest from bash completion?  My limitations:   I know that I can remove the pytest binary at /usr/bin/pytest to prevent that suggestion within bash. But what if I have no root access? What if pytest is an important script that must exist in order to let other scripts work properly? Even though I can remove the pytest binary (and I've done it before), some time when I upgrade my software, this script comes back again. I know that I can use an alias to save keystrokes for my favorite applications (maybe just p for python). But I don't like these non-standard abbreviations. It kind of makes me confused when I remote to other machines.   So, is there any way to hide some commands from bash completion? Answers in other shells (zsh, fish, etc) are welcome since bash doesn't speed up my workflow lately.


How one can prove $\prod_{k=1}^{n-1} (\cos\theta-\cos(k\pi/n)) = 2^{1-n}\sin(n\theta)\csc\theta$?

Can somebody help me to prove this identity?     $$\prod_{k=1}^{n-1} \left(\;\cos\theta-\cos\frac{k\pi}{n}\;\right) = 2^{1-n}\sin(n\theta)\csc\theta$$   I was thinking of using the properties of the complex numbers and the binomial theorem, because I found this problem in the Complex Variables book from Schaum's, but it did not solve my problem.  Does anyone have an idea?  Thanks in advance!


Placing however at the start of a sentence vs placing it in the middle of a sentence?

Basically, what's the difference between this:     However, it didn't mean that I didn't have the potential to become a   rock star.   and this?     It didn't mean, however, that I didn't have the potential to become a   rock star.   Or does it mean exactly the same thing?


When are two fermions considered identical?

I am a bit confused about the terminology concerning identical fermions. In quantum mechanics, identical fermions need to obey certain anticommutation relations i.e. have an antisymmetric total wavefunction (product of spatial and spin parts) under the exchange of two particles. But when exactly are two fermions considered to be 'identical'? As far as I understand, two electrons are identical in the sense that they for example have the same electric charge, mass and spin quantum number $s=\frac{1}{2}$. (These are shared by all electrons.) How about the secondary spin (or spin projection) quantum number $m_s=\pm \frac{1}{2}$? If in an atom we have two electrons with the same principal quantum number, orbital quantum number and magnetic quantum number, but different $m_s$, are these two electrons 'identical' or not? The electrons are definitely identical if they additionally have the same $m_s$, but the Pauli exclusion principle forbids that. How does the consideration of the quantum numbers fit with the electrons having the same electric charge, mass, and spin $s$, which are independent of atomic orbitals? Furthermore, are 'identical' and 'indistinguishable' fermions different things or not? If 'identical' particles cannot be told apart by an experiment, how about the Stern-Gerlach experiment? This links back to the above question whether $m_s=\pm \frac{1}{2}$ electrons are identical. My partial answer is that if we have electrons labelled 1 and 2, we cannot say which of the electrons has $m_s=-\frac{1}{2}$ and which has $m_s=\frac{1}{2}$. So in an experiment, you cannot say that 'The electron with $m_s=-\frac{1}{2}$ is electron 1' even if you were able to separate the $m_s=\pm \frac{1}{2}$ states. Or something along those lines. In other words, electrons are identical regardless of the quantum numbers. Further confusion arises when we go beyond electrons. I have learned that atoms with an odd number of neutrons in an 'optical lattice' can be used to mimic electrons in a metal. Then the role of $m_s=\pm \frac{1}{2}$ is played by different hyperfine states of the atom as far as I can tell. If I now have atoms of the same mass (same species) in two different hyperfine states corresponding to spin-up and spin-down electrons, how are these atoms classified? Are they 'identical', 'indistinguishable', 'distinguishable', or what? Do these atoms obey the fermionic anticommutation relations? I thought I understood what's going on i.e. two atoms of the same species are identical but can be in different internal states representing the spin projections and thus the atoms obey the usual fermionic anticommutation relations of spin-$\frac{1}{2}$ electrons. But then I found this paper () which says that atoms in the $| F=\frac{1}{2}, m_F=\pm \frac{1}{2} \rangle$ states of $^6$Li are distinguishable. How can distinguishable atoms play the role of electrons? How can they obey the anticommutation relations of spin-$\frac{1}{2}$ electrons? If I have understood correctly, there are no symmetry requirements for distinguishable particles in quantum mechanics. Or are the authors just possibly using sloppy language by calling two identical atoms in different internal states distinguishable? I would call two atoms of different species, e.g. $^6$Li and $^{40}$K, distinguishable. Sorry for the long text, but hopefully I made my confusion sufficiently clear. Any clarifications are appreciated.


How do I create a .desktop file to launch eclipse?

When I create a .desktop file to launch eclipse (latest build with JDK 1.8 support) I get the following error:  A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: /home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/jre/bin/java java in your current PATH   Why does it try to find the JRE under the directory where the eclipse binary is?  I can launch Eclipse from the command line, and I can pin it to the launcher and it works.  Why is the .desktop file so confused about what it is supposed to do?  Here is my .desktop file:  [Desktop Entry] Version=1.0 Name=Eclipse JDK 1.8 Comment=Eclipse Exec=/home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/eclipse Icon=/home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/icon.xpm Terminal=false Type=Application Categories=Utility;Application;   The problem I'm having is not what was asked in .  My issue is because my PATH to the JDK is set in my .bashrc.


Ubuntu black screen and underscore at the top left corner on VirtualBox

It was working fine last time I used it. I am using Ubuntu 20.04 in vVirtualBox. After the Ubuntu logo has done loading a black screen with an underscore character appears.


How below two update statements are different in SQL?

I have two update statements. Both of them gives the same output. How they are different and which is better to use?  Statement 1:  UPDATE li SET li.Description = im.Description FROM tbSupplierLineItem li JOIN tbIMPACArchieveNew im ON li.ItemId = im.CommomCode  WHERE li.ProcessedDate >= CONVERT(DATE,GETDATE())   Statement 2:  UPDATE li SET li.Description = im.Description FROM tbSupplierLineItem li JOIN tbIMPACArchieveNew im ON li.ItemId = im.CommomCode  AND li.ProcessedDate >= CONVERT(DATE,GETDATE())


Let $f:[0,\infty[ \rightarrow \mathbb{R}$ be differentiable on $(0,\infty)$ such that $f'(x) \to b \; as \; x \to \infty$   (a) Show that for any $h>0$ we have $\lim_{x \to \infty} \frac{f(x+h) - f(x)}{h}=b$   (b) Show that if $f(x) \to a $ as $x \to \infty$ then $b = 0$  (c) Show that $\lim_{x\to \infty} \frac{f(x)}{x}=b$  I have no clue on how to approach this problem... I tried to show $h \to 0$ but I could not.