E/AndroidRuntime: FATAL EXCEPTION: main                   Process: dev.game.adventure, PID: 21482                   java.util.ConcurrentModificationException                       at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)                       at java.util.LinkedList$ListItr.next(LinkedList.java:888)                       at dev.game.adventure.Troll.wakeup(Troll.java:32)                       at dev.game.adventure.Simulation$1.run(Simulation.java:29)                       at android.os.Handler.handleCallback(Handler.java:789)                       at android.os.Handler.dispatchMessage(Handler.java:98)                       at android.os.Looper.loop(Looper.java:164)                       at android.app.ActivityThread.main(ActivityThread.java:6541)                       at java.lang.reflect.Method.invoke(Native Method)                       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)   I got the above trace after running in the emulator for some time. What does it mean? How can I resolve it? I can't even reproduce it because it only happens after some time. This is the offending code:  thing = i.next(); (Troll.java:32)  Class Troll.java  package dev.game.adventure;  import android.os.Handler; import android.widget.Toast;  import java.util.*;  public class Troll extends WalkingPerson {      private boolean hasCoke = false;     private AdventureActivity target;      Troll(Simulation s, World world, String name, AdventureActivity app) {         super(s, world, name, R.mipmap.lobgoblin, app);         this.target = app;         goTo("Kulverten", target);     }      public void wakeup() {          Person victim = (Person) (place.persons.toArray()[((int) (Math.random() * place.persons                 .size()))]);           if (victim instanceof Troll) { // Don't commit suicide         } else {             say("Victim is " + victim.getName() + ".", target);             Thing thing;              for (Iterator<Thing> i = victim.things.iterator(); i.hasNext(); ) {                  thing = i.next();                  if (thing instanceof CocaCola) {                     hasCoke = true;                     victim.things.remove(thing);                     world.update(place, target);                     say("Now I take your Coca Cola!", target);                     //TODO: Actually take the drink                 } else {                     drop(thing.name, target); // drop all items so that the key doesn't end up in heaven                 }             }              if (!hasCoke) {                 say("Now I kill you!", target); // TODO: Take all the items of the victim                 //  this.getWorld().playAtPlace(place, "effects/gong");                 final Person victim2 = victim;                 Handler handler = new Handler();                 handler.postDelayed(new Runnable() {                     @Override                     public void run() {                         victim2.goTo("Heaven", target);                         world.update(victim2.place, target);                         world.sayAtPlace(victim2.place, "-- Game Over --", target);                         if (victim2.getName().equals("You")) {                             target.ag.setBackground(world.getPlace("Heaven").getImage());                             final Toast toast = Toast.makeText(target.ag.getContext(), "GAME OVER!\n", Toast.LENGTH_LONG);// duration);                             toast.show();                         }                      }                 }, 1500);             }         }         Handler handler = new Handler();         handler.postDelayed(new Runnable() {             @Override             public void run() {                 if(Math.random() > 0.3)                     go(place.randomDoor(), target);             }         }, 2500);         s.wakeMeAfter(this, (80 + Math.random() * 1000));     } }

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I have a bunch of extremely similar matrix classes with only difference in their size.  For example:  class clrMatrix8x8 { public:     clrMatrix8x8();     clrMatrix8x8(const clrMatrix8x8&);     ~clrMatrix8x8();      void fill(int);      static clrMatrix8x8 elemAdd(const clrMatrix8x8&, const clrMatrix8x8&);     static clrMatrix8x8 elemSubstr(const clrMatrix8x8&, const clrMatrix8x8&);     static clrMatrix8x8 elemMult(const clrMatrix8x8&, const clrMatrix8x8&);     static clrMatrix8x8 scalMult(const clrMatrix8x8&, int);     static clrMatrix8x8 elemDiv(const clrMatrix8x8&, const clrMatrix8x8&);     static clrMatrix8x8 scalDiv(const clrMatrix8x8&, int);      int& operator()(size_t, size_t);     clrMatrix8x8& operator=(const clrMatrix8x8&); private:     std::array<std::array<int, 8>, 8> content; };   There are classes for 16x16, 32x32 and so on. All of them work the same as well as their functions. For clrMatrix8x8, elemAdd function is:   clrMatrix8x8 clrMatrix8x8::elemAdd(const clrMatrix8x8& first_, const clrMatrix8x8& second_) {     clrMatrix8x8 temp(first_);      for (size_t i = 0; i < temp.content.size(); i++)     {         std::transform(temp.content[i].begin(), temp.content[i].end(), second_.content[i].begin(),             temp.content[i].begin(), std::plus<int>());     }     return temp; }   The only difference between this function and the same function for other matrix is class names.  Since it doesn't feel good to have 5 similar implementations of each function for each class I thought it was possible to make a template function which is friend to all the matrix classes. So, I put template<class T> friend T elemAdd_text(const T&, const T&); in Matrix.h as well as inside 16x16 and 8x8 matrix classes declarations and   template<class T> T elemAdd_test(const T& ad, const T& af) {     T temp(ad);      for (size_t i = 0; i < temp.size(); i++)     {         std::transform(temp.content[i].begin(), temp.content[i].end(), af.content[i].begin(),             temp.content[i].begin(), std::plus<int>());     }     return temp; }   in Matrix.cpp to test this out, but when I call this function in main() like this: some8x8matrixVariable = elemAdd_test(other8x8matrix_1, other8x8matrix_2); it gets LNK2001 "unresolved external symbol" error. What am I doing wrong?  I know it would be much easier to just use a vector of vectors, I tested that and array-based matrix worked ~6 times faster, and I need as much performance as possible.

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


I'm trying to access all of the repositories but i am unable to change the settings in the software center, command line, or right from the source list. I have a hypothysis that it may be due to unistalled updates but when i run "sudo apt-get install update" it says that it is unable to locate package update. help?

When I log into my web server via SSH I see the information:  88 packages can be updated. 80 updates are security updates   I tried apt-get update then apt-get upgrade but each time I log in I still see the message about updates. How do I install them?


Sometimes the update process of our application fails to rename a directory on the user's machine. Is it possible to easily find out with a standard Windows command line tool (no GUI application) which process has "open" a certain directory or file below the very directory, so we can tell the user to close that process?

How can I find out which process is locking a file or folder in Windows?  For instance, when trying to delete a folder, Windows reports this:     The action can't be completed because the folder is open in another program   Happens the same with a file, but how do I find out what program or application is currently using it and preventing me from deleting the file or folder?


Cov(x,y) if e(x) = 2.60 and e(y) = 2.35 and e(xy) = 7.06   i'm confused because all i know is $$cov(x,y) = \text{correlation of xy}*sqrt(x)*sqrt(y) $$

The covariance of two random variables $(X_i,X_j)$ is given by $$Cov(X_i,X_j) = E[X_iX_j] - E[X_i]E[X_j],$$ where $E[X_i]$ is the expected value of $X_i$, or its mean.  The covariance matrix $\Sigma$, in turn, is defined as the covariances between all $\textbf{X} = (X_1,...,X_n)$ random variables, such that $\Sigma_{ij} = Cov(X_i,X_j)$.  In my studies, however, I've come in contact with  (such as using maximum likelihood) but I couldn't find any real world problems requiring the use of such techniques. Moreover, as stated above, it is possible to calculate every element of $\Sigma$ using the covariance formula stated above.  My question is when is it necessary to estimate a covariance matrix instead of calculating it by directly using the covariance formula?


Very often you will find a section which looks like the following in a post:     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.      Edit:      Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.   Find an example of such an edit  (edit #2).  I have mainly found two areas where this is used:   To provide a better answer/question, basically rendering the "old" part obsolete To add information    Highlighting which part of the post was added in an edit seems to serve one purpose, which is to help people who have already read the post quickly find what has changed.  But isn't the idea of Stack Exchange posts that they answer questions for everyone who might find them in the future? Why should they care about which part has been added as an edit? Shouldn't we strive to change our post to incorporate the new information in a natural way and deleting obsolete parts of the post?  I found myself removing these blocks often with edits since I don't see a reason how they could be useful. But they are so frequent that I started questioning myself as to whether I am right by doing so.   So my question is: Is there ever a situation in which it is better (not just OK) to simply append new information in an "Edit" block?

I often see questions edited into this form:     Lorem ipsum dolor sit amet blah blah blah paragraph paragraph original question.            UPDATE: The Lorem disappeared and left this message: "new information".   I find this format unaesthetic (since Stack Exchange posts are supposed to be useful in the long term and update boundaries are artifacts of the creation rather than the content) and feel that new information should, whenever possible, be incorporated into the original text “as if it had always been that way” if practical, and pointing out an update should be done mostly in comments.  Is this an appropriate writing style, and if so under what circumstances? If not, should it be removed or discouraged?


For LaTeX symbols we have . Do we similarly have the same for TikZ pictures?  This idea came because I wanted to draw a slab:    But couldn't find such website.  As I am not very familiar with the TikZ, if this is offside consider it to be my ignorance, go ahead to make any amendments.  Minimal working example for cube(may be very poor example):  \documentclass{article} \usepackage{tikz}   \begin{document}      \begin{tikzpicture}[outside/.style={thick},                         every node/.style={font=\tiny}]           \draw[outside](-2,-2,-2)--(-2,2,-2)--(-2,2,2)--(-2,-2,2)--(-2,-2,-2);         \draw[outside](-2,-2,-2)--(2,-2,-2)--(2,-2,2)--(-2,-2,2)--(-2,-2,-2);         \draw[outside](-2,-2,-2)--(2,-2,-2)--(2,2,-2)--(-2,2,-2)--(-2,-2,-2);         \draw[outside](2,2,2)--(2,-2,2)--(2,-2,-2)--(2,2,-2)--(2,2,2);         \draw[outside](2,2,2)--(-2,2,2)--(-2,2,-2)--(2,2,-2)--(2,2,2);         \draw[outside](2,2,2)--(-2,2,2)--(-2,-2,2)--(2,-2,2)--(2,2,2);      \end{tikzpicture}  \end{document}

I know only the very basics of TikZ, having only used it to produce a pretty flow chart for one of my documents. I recently learned that you can use Inkscape and export to TikZ.  What are the limitations of the Inkscape->TikZ workflow? Is there some compelling reason to take the time to learn TikZ (which I'm told has a fairly steep learning curve) rather than simply exporting to TikZ from Inkscape?


My teacher told me to prove this using the proof by contradiction. So, I am going to assume that there's an infinite group with finitely many subgroups. Then this will lead to finding at least one element with an infinite order, from which I can derive a contradiction.   But I am lost how I can prove this...   I am thinking if the group has its subgroups, then every element in those subgroups must also have infinite order as they are in their original group, aren't they? So, my conclusion is that every element in infinite group's subgroups must have infinite order except identity element.  But how does this contradict the group is infinite?

I'm trying to prove that any group $G$ of infinite order has an infinite number of subgroups.  I think that if the group has an element of infinite order, then it's easy because I can take the groups generated by the powers of this element.  What if it doesn't? Every element generates a cyclic subgroup. Every element belongs to at least one cyclic subgroup (that generated by itself). So the group is the union of its cyclic subgroups. If all these are finite, we would have to have an infinite collection of subgroups anyway.  Is that correct?


I don't know how to explain this, but I think the example is clear:  if($text == "libelle")     $obj->libelle = $valeur; else if($text == "numero")     $obj->numero = $valeur; else if($text == "commentaire")     $obj->commentaire = $valeur; else if($text == "date")     $obj->date = $valeur;   Well, what I'm looking for is replace the if-statement with something like this $obj->(the value of $text) = $valeur;

How do i dynamically assign a name to a php object?  for example how would i assign a object to a var that is the id of the db row that i am using to create objects.  for example   $<idnum>= new object();   where idnum is the id from my database.


I am travelling to India via Dublin and need to change flight, airline and terminal at Dublin Airport. It is one ticket though. Flights are American Airlines and Etihad. Do I need short stay visa or transit visa? I know Indians don’t need transit visas but I am more concerned about other factors like airlime boarding or terminal change.  I would like to know personal experience as this question has been asked but did not proceed with same travel itinerary.

My wife was not allowed to board her flight from Bangalore to the UK via Frankfurt and Dusseldorf as the Lufthansa staff claimed she needed a Shengen visa to take the flight from Frankfurt to Dusseldorf. She has an Indian passport with a valid UK spouse visa for 2 years.   I'm currently trying to book her on another flight and I've seen one going from Bangalore to Manchester,UK via Abu Dhabi and Dublin. I'm worried that the same issue may come up again in Dublin. Would she require a transit visa in this scenario to enter Dublin?  Also were the Lufthansa staff correct in not letting her board the original flight. I'm sure I've read that spouses of British Citizens are amongst those exempt from airport transit visa requirements in Germany?


Google seems to use the Title tag as the primary source for determining sitelink titles.  However, I noticed that for some sites, the page title is not the same as the sitelink title.  For example, Airbnb has a sitelink titled 'Business Travel':    But when you enter the page the title is actually 'Corporate & Business Travel on Airbnb':    Does anyone know how to determine the title of a sitelink, and make it different than the target page's title?  Thanks!  *Note: The precise process of determining the sitelink title is automated, and Google is not transparent about it at the moment.

This is a hypothetical example of an actual problem. I hope it's clear.  When I search Google for dogs I can see my website homepage http://dogs123.com.au with the title "Dogs a mans best friend!".  If I search for dogs australia I see my website homepage http://dogs123.com.au with an old page title "Dogs blah blah". Clicking through on this result gives the up to date, current page with the proper title.  i.e. for two different searches, returning the same result, one returns the correct page title, and one returns an old page title.  Why is this happening? Is it something on my side or Google's?


How fast does a Photon travel through space?  And is gravity able to influence a Photon's path?

Light is clearly affected by gravity, just think about a black hole, but light supposedly has no mass and gravity only affects objects with mass.  On the other hand, if light does have mass then doesn't mass become infinitely larger the closer to the speed of light an object travels. So this would result in light have an infinite mass which is impossible.  Any explanations?


So I want to append a world but I have an issue. Every time I try to append, it has an error(I already changed the addon init file) My code is: class Sky_PT_main_panel(Panel):     bl_label = "Sky"     bl_idname = "Sky_PT_main_panel"     bl_space_type = 'VIEW_3D'     bl_region_type = 'UI'     bl_category = "Lazy Felina"     bl_parent_id = 'Lazy_PT_felina'     bl_options = {'DEFAULT_CLOSED'}                         def draw_header(self, context):         layout = self.layout         layout.label(text="", icon='LIGHT_SUN')           def draw(self, context):         layout = self.layout                  layout.operator("sky.myop_operator", icon= 'LIGHT_SUN')    class Sky_OT_my_op(Operator):     bl_label = "Sky"     bl_idname = "sky.myop_operator"          def execute(self, context):                  bpy.ops.wm.append(filename="Sky", directory=bpy.path.relpath("//sky.blend\\World\\"))                              return {'FINISHED'}

I'm searching a way to append a group in Python.  It should behave exactly like the Append function (ShiftF1) works, all objects should be local and editable. The idea is to append a character (with rig etc.) via Python and not Link it (to be able to modify it without making everything local one by one).  Thanks


I had a Windows 8.1 installed on C partition of my laptop. I had 2 partitions, C and D. Recently I installed Ubuntu Mate 14.04. but I don't know how to find my files on D partition. Should I mount or something?  Any help would be appreciated...  I think the following information would help :   sudo fdisk -l:  Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00087858     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048      499711      248832   83  Linux /dev/sda2          501758  1465147391   732322817    5  Extended Partition 2 does not start on physical sector boundary. /dev/sda5      501760  1465147391   732322816   8e  Linux LVM  Disk /dev/mapper/ubuntu--vg-root: 745.8 GB, 745789194240 bytes 255 heads, 63 sectors/track, 90670 cylinders, total 1456619520 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000  Disk /dev/mapper/ubuntu--vg-root doesn't contain a valid partition table  Disk /dev/mapper/ubuntu--vg-swap_1: 4106 MB, 4106223616 bytes 255 heads, 63 sectors/track, 499 cylinders, total 8019968 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000  Disk /dev/mapper/ubuntu--vg-swap_1 doesn't contain a valid partition table  df -h:  Filesystem                   Size  Used Avail Use% Mounted on /dev/mapper/ubuntu--vg-root  684G  3.3G  646G   1% / none                         4.0K     0  4.0K   0% /sys/fs/cgroup udev                         1.9G  4.0K  1.9G   1% /dev tmpfs                        388M  1.2M  386M   1% /run none                         5.0M     0  5.0M   0% /run/lock none                         1.9G  292K  1.9G   1% /run/shm none                         100M   48K  100M   1% /run/user /dev/sda1                    236M   36M  188M  17% /boot  sudo blkid:  /dev/sda1: UUID="56fa0875-40d6-4bbd-ae2a-f3e85341c44a" TYPE="ext2"  /dev/sda5: UUID="tQJELc-qT2m-xBFV-RfHJ-f7Vj-LIIn-KpAQ0Q" TYPE="LVM2_member"  /dev/mapper/ubuntu--vg-root: UUID="8f775671-a8d4-42b1-9ea4-90a7b7899c36" TYPE="ext4"  /dev/mapper/ubuntu--vg-swap_1: UUID="61daad35-5ff4-4417-b3b6-cbd0943e6a0f" TYPE="swap"  fdisk -l | grep NTFS:  Disk /dev/mapper/ubuntu--vg-root doesn't contain a valid partition         table Disk /dev/mapper/ubuntu--vg-swap_1 doesn't contain a valid partition table

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


So if I add a rect to a variable like so box = pygame.Rect(x, y, w, h)  How do I check if the variable rect holds a pygame.Rect? Ideally it would return something similar to this int = 9  #int is not a rect #box is a rect

How do I see the type of a variable whether it is unsigned 32 bit, signed 16 bit, etc.?  How do I view it?


I have two questions that bothers me, and for which I couldn't find an adequate answers here.  This is my laptop's configuration: HP Probook 455 G1 (Windows 7 Ultimate x64)   AMD A8-4500M - 1.96Ghz  4096Mb RAM  Chipset AMD A70M Fusion  Chiptype    (dxdiag) AMD Radeon HD 7640G...   Graphics: AMD Radeon HD 8750 2Gb   First, I have a memory problem. In myComputer it displays that only 3.2Gb out of 4Gb is in use. I tried suggestions to change the BIOS but couldn't find where? And in msconfig the maximum memory isn't checked.  Second, because I have 4Gb RAM, and I expect nice performance. Should I buy another RAM module, also 4Gb, so I would have 8Gb in total. When I do that, would it be better for playing games (B4, MW, FC3, etc) and what amount of memory should be usable then? 6.4 or...?  Here's the screenshot:   What to do? Should I change anything now, or leave the 3.2GB? If yes, where and how... Should I upgrade RAM?

Possible Duplicate:        My Windows 7 is 64-bit, and I thought that means it can use the full 4GB of RAM installed on the computer.  But I just saw this on my computer's properties: (So only 3.25GB is usable??)


I know the title's wording is a bit confusing, so here's an example scenario: I have  in play and I cast  for 0 mana. My understanding ( and my understanding of the rules) is that Chimeric Mass will have one charge counter on it as opposed to zero. Is this correct?

If I play a spell with {X} in the mana cost, and I have a card out that reduces the casting cost by 2 generic mana, what happens to the X? Does it start at -2?  For example: I have  in play. If I play  for just 1 blue mana, do we draw 2 cards?


I wrote my thesis with LaTeX on Overleaf, but my supervisor wants a Word-file of it. The thesis consists of multiple .tex-documents which are are linked to a central main.tex document. I found some tips for doing this, but they only work at Microsoft-computers. How could I convert from LaTeX to Word on a Macbook?

I often have to write up reports based on the analysis of some data. I use R to analyse the data and export tables, figures, and text. This is then included into a LaTeX document either using input or Sweave ().  However, when I collaborate with others, I sometimes need to provide a document in Open Office / MS Word format.  Question:  Thus, assume the simplest scenario   I have a LaTeX document with text, tables, and figures I need to export this reliably into Open Office or MS Word format: this includes mathematical formulas, table formatting, and quality figures) I don't need to go back from MS Word to LaTeX   What is a reliable, efficient, and preferably free process?  Initial Thoughts:   Export to HTML,  LaTeX - LyX - ODF Use odfWeave  that deals with some specific issues associated with LaTeX to Open Office conversion    I was hoping that there is an expert out there who has worked out a good system already.


I've tried searching for an answer to this with no luck.  I had a go at the method detailed  but as soon as I log out the new wallpaper is there for a brief second before it changes back to my desktop wallpaper.  I feel silly asking a question like this as it must be simple but I can't figure it out. Any help would be appreciated!

I installed Ubuntu Studio 15.10 and upon that:  sudo apt-get install ubuntu-desktop   Now on the login screen, I have the default brownish Ubuntu default background.   I tried this as root:  sudo xhost +SI:localuser:lightdm sudo su lightdm -s /bin/bash gsettings set com.canonical.unity-greeter background /usr/share/backgrounds/Tranquil_by_Pat_David.jpg   But this didn't change anything. Also starting the unity-control-center as user lightdm and changing the background there had no effect. I also checked the rights of /usr/share/backgrounds/Tranquil_by_Pat_David.jpg which are globally readable.


I had a  that told me:     Our system has identified this edit as possible spam; please review carefully   The system told me this before rejecting the edit, so I don't think that this should displayed for audits, because if this is displayed, robo-reviewers will pay more attention for audits and pass them, but don't really pay attention on other bad edits. So why does the system tell me that the edit is possibly spam?

Not entirely sure what's happening here but it definitely looks wrong:    The message popped up at the same time as the Congratulations message.     Our system has identified this edit as possible spam; please review carefully   It doesn't show up if you load up  now so possibly this is no-repro or possibly it only happens when you initially pass a review, or perhaps most likely it's always done it and I'm missing the point entirely. In any case if it is a bug it is certainly minor.  Using Safari 7.0.1 Mac OS X.


I have this Generic XML file, I want to parse it so I can create a SQL server table according to the XML data : <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Student">   <xs:complexType>     <xs:sequence>     <xs:element name="Id" type="xs:integer"/>     <xs:element name="Name" type="xs:string"/>     <xs:element name="City" type="xs:string"/>     </xs:sequence>   </xs:complexType> </xs:element> </xs:schema>  I want to recover the following data: Student,   Id / integer  Name / String  City / String  Student will be the name of the table, and Id, Name and City are the columns. All I need is how to parse the XML file and recover the data.

How do I read and parse an XML file in C#?


The function need to be realized is: when the Tkinter button is clicked, an entry's text is changed. Here's  the code snippet:  import Tkinter as tk  def create_heatmap_button_callback():     path_entry.delete(0, tk.END)     path_entry.insert(0, "clicked!")      def main():     root = tk.Tk()     path_entry = tk.Entry(master = root, text = "not clicked")     path_entry.grid(row=1, column=0, sticky = tk.W)      create_heatmap_button = tk.Button(master = root, text = "create map", command = create_heatmap_button_callback)     create_heatmap_button.grid(row=2,column=0,sticky = tk.W)      tk.mainloop()     if __name__ == "__main__":     global path_entry     main()    and when clicked the button, here's the output:  NameError: global name 'path_entry' is not defined  What is the correct way to do this?

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I am a beginner in java. I was trying this code where I created the instance of class in the class itself.    It was giving me stack overflow error.  Then, I make the reference variable 'static' in the class and now it is working fine.     My question is what does static keyword do here? I know static variable are class variable which is loaded only once. But, should the constructor call also get into recursive call to itself? I am not able to get any answer from my knowledge about static keyword.

What is a StackOverflowError, what causes it, and how should I deal with them?


I'm trying to learn c ++, doing some tests, I have the following questions, which, in a way shows one thing and the other works as expected, I will try to explain as best I can, "sorry for my English," I have a base class that is more or less so I think this is the important part;  class Basefptr { public:     Basefptr();     virtual ~Basefptr();     virtual void funcPtr1(); };  inline void Basefptr::funcPtr1(){     std::cout << "funcPtr1" << std::endl; } #endif /* BASEFPTR_H_ */   and in the derived class that other;  #include "Basefptr.h"  class Derivada : public Basefptr { public:     Derivada();     virtual ~Derivada();     virtual void funcPtr1(); };  inline void Derivada::funcPtr1(){     std::cout << "funcPtr1_de_Derivada" << std::endl; } #endif /* DERIVADA_H_ */   that this is the main;  #include "Basefptr.h" #include "Derivada.h" #include <vector> #include <algorithm>  int main(int argc, char* argv[]){  Basefptr* base     = new Basefptr; Derivada* derivada = new Derivada;  std::vector<Basefptr*> poli;  poli.push_back(base); poli.push_back(derivada);   std::for_each(poli.begin(), poli.end(),[](Basefptr* b){      b->funcPtr1(); });   Basefptr base1; Derivada derivada1;  std::vector<Basefptr> poli1;  poli1.push_back(base1); poli1.push_back(derivada1);   std::for_each(poli1.begin(), poli1.end(),[](Basefptr b){      b.funcPtr1(); });  return 0; }   this the shell out;   funcPtr1   funcPtr1_de_Derivada   funcPtr1   funcPtr1   The first two lines are as expected, but the second is not what I expected, because he believed that would be like the first, can someone explain me, the reason this is so, if you please. or am I doing something wrong greetings and thanks for reading.

Someone mentioned it in the IRC as the slicing problem.


I've been taking GR, and all of a sudden I am not sure that I know the necessary and sufficient requirements of the tensor coefficients. This is because the lecturer asked me to prove that that "there exist no tensor constructed from the metric and its derivatives, other than the metric". This leads me to have exactly two questions:  (1) Suppose $g_{\mu \nu}$ is the metric tensor, $c$ is a real number and $\nabla_\rho$ the covariant derivative. Why are the following not tensors?   $c g_{\mu \nu}$ $\nabla_\rho g_{\mu \nu}$   (2) Is it wrong that the sufficient and necessary condition for the tensor coefficient is that they have well defined transformation rules, such that they takes the same form in all coordinates? Is this not the same as saying that the tensor transforms as a tensor?

Suppose $A^{\mu_1 \cdots \mu_n}_{\nu_{n+1}\cdots \nu_m}$ is a tensor. That means it transforms a tensor. How do I show that it transforms as a tensor? How do I see that $\cos (A^{\mu_1 \cdots \mu_n}_{\nu_{n+1}\cdots \nu_m})$ or some other non-tensor does not transform like a tensor?


Google is crawling and indexing my site without any issues. Each post I create I'm fetching in webmaster tools.  I have looked in the crawl errors and for every post I submit for indexing Google is also attempting to crawl the URL with /example.com at the end so:  http://example.com/new-posy/example.com   This is throwing an obvious 404.  My site is built on Wordpress and I'm using the Yoast SEO plugin.

I have a Wordpress site that I have set up with Google Fetch and I have been getting a bunch of crawl errors and it has started significantly hurting my Google ranking and site traffic even though it clearly says it shouldn't. The thing that doesn't make sense to me is that the 404 pages are not actually pages that exist. They are Tags and categories on my blog mixed with a site address from one of my other websites that is not actually associated with this blog at all. They are different domains/databases and everything so they shouldn't be connected.   The site was actually giving me the same problem a few weeks ago and I actually switched to a new theme because I noticed the one I had was out of date and thought maybe it was throwing a random error. But now, I have no idea why this would even happen or where Google would come up with this URL.   Here are a few examples:   www.whenlovegrows.com/tag/lactose-free-food/www.deannemroz.com www.whenlovegrows.com/tag/crescent-dogs/www.deannemroz.com www.whenlovegrows.com/tag/turkey-dogs/www.deannemroz.com   Basically any time I add a new tag it seems that Google is crawling it and then adding my other site's web address to the end and claiming it is a 404 page. Has anyone ever experienced anything like this? Is there some way I can help it?  Any insight would be much appreciated. I am at a loss as to how to fix this and it is becoming extremely frustrating since it is affecting my ranking.


$f(z)=\frac{1}{z-\sin z}$  Now $z-\sin z=z-(z-\frac {z^3}{3!}+\frac{z^5}{5!}\cdots)$  After solving $z=0$ is a pole of order $3$ for $f(z)$ and $$f(z)=\frac1{z^3(\frac1{3!}-\frac{z^2}{5!}+ \cdots  )}$$ What is next?

$$\frac{1}{z-\sin z}$$ $$\frac{1}{z(1-\frac{\sin z}{z})}$$  the laurent's transform is also used to simplify the function.  the residue is found a $\frac{2*36*2}{5}$ but the actual answer is given as $\frac{3}{10}$ the residue is given as The solution is incorrect and also the pole is of the order 3.


Is it ok to revive old questions (e.g. last answer/comment older than 6 months) with new comments and/or answers?

I always wonder if I read questions and nobody ever focused on one special point - I constantly think if it is worth the time to answer them.   They usually do not get any upvotes no matter how good the answer is and so remain in the mostly unread lower part of the page.   So should we consider a question as a knowledge base for a topic, or just a way to answer one single person?


I'm on Ubuntu 12.04, I have updated openssl with the latest update :  $ openssl version -a OpenSSL 1.0.1 14 Mar 2012 built on: Mon Apr  7 20:33:29 UTC 2014   And also updated libssl   $ sudo apt-get install libssl1.0.0 Reading package lists... Done Building dependency tree        Reading state information... Done libssl1.0.0 is already the newest version.   Then I rebooted the server but still show vulnerability using . Any ideas? Thanks.

I have an Ubuntu 12.04 server. I have updated the OpenSSL package in order to fix the heartbleed vulnerability. But I am still vulnerable even, even though I have restarted the web server, and even the whole server.  To check my vulnerability I used:       dpkg gives:  dpkg -l |grep openssl ii  openssl  1.0.1-4ubuntu5.12   Secure Socket Layer (SSL) binary and related cryptographic tools   (launchpad.net/ubuntu/+source/openssl/1.0.1-4ubuntu5.12)


I am relatively new to Blender and am looking for help with my animation. I know all about keyframing but my question is how to make the speed of an object constant when it moves between 2 keyframes, instead of it starting slow, going quickest in the middle, and slowing at the end.

When I make an animation, it always starts out slow, then speeds up, then slows down at the end.  I cannot figure out how to fix this.


I'm trying to understand the appeal to scripting in large games.  Is it ease of development by avoiding lower level coding like C++? Thus avoiding the long compile times?  It seems scripting doesn't often have the benefits of rich tools like IDE and debugger and requires an adaptation layer to expose the low level code to the scripting interface.  Is it to keep options for changing story line and game play until later in the process? If so, at some point the scripts must be compiled or encrypted to prevent tampering.

In my current project, Lua scripts are called by the C++ functions on the server side. After that, the scripts again call the C++ functions still in that solution. Why should we do such things and not call the C++ function directly? What are the situations in which scripts are needed?


I've seen other questions like this but didn't really see any answers.  When a person climbs stairs, the object is the person. Yet we say the person did work...how so? Doesn't work mean an external force had to be applied over a distance to make an object have a change in KE or PE?  Isn't the work more less from the muscles of the person. The stairs didn't do work. Then really isn't the work internal work done, where the work done is causing and changing their chemical energy to kinetic?  I get work done on a box or more complex systems. But who or what does the work in climbing stairs if it is the person themselves in the system. Why don't physics books explain these type of examples. Thanks in advance

My teacher gave us a worksheet with word problems and their solutions. It is in German, so I have tried my best to translate it to English:     A 26 year old man climbs Mount Everest (8848 m) in only 8 hours 10 mins from the base camp at 5300 m. Estimate the "lifting work" (Hubarbeit) that the man exerted in the climb.    I thought to use the formula: $W = F \cdot \Delta S$, but I don't know what $F$ would be. I think the $\Delta S$ is $8848 - 5300 = 3548$. But then I looked at the solutions and my teacher used this formula: $W = m g h$. He guessed the man's weight and also used $g = 10\ \mathrm{N}/\mathrm{kg}$. I don't understand this.  Could someone maybe help me? Anyone have an idea?


I'm having a problem booting Ubuntu 16.04 after using windows 10 (I have fast boot enabled). But, as i understand, it should work. This is my disk setup:   Windows Partition (OS and programs) <- not mounted in ubuntu Shared Ntfs Partition (Stuff) <- auto-mounted in ubuntu as nfts-3g Ubuntu Partition   As I get, Windows Fast Boot make some sort of "shutdown/hibernate" which leaves the disk in an unsafe state after shutting down. But should this affect my "SHARED PARTITION" too? Because, after I remove the auto mount in the /etc/fstab file, ubuntu boots normally. Once I enter, if i try to mount the disk, this pops up:  Error mounting /dev/sda8 at /media/pablo/7A02A0B456DA5406: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sda8" "/media/pablo/7A02A0B456DA5406"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda8': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.   Hope you can give me some ideas.  Thanks.

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


for(String objectName : jsonMap.keySet()){             // List<map<String,String>> listObjects=jsonMap.get(objectName);             List<Map <String, String>> jsonFieldMapToUpper= new List<Map<String, String>>();             for(map<String,String> JsonFieldMap: jsonMap.get(objectName)){                 Map<String, String> keyVal=new Map<String, String>();                 for(String key : JsonFieldMap.keySet()){                     keyVal.put(key.toUpperCase(), JsonFieldMap.get(key));                                      }                 jsonFieldMapToUpper.add(keyVal);                 jsonMap.put(objectName, jsonFieldMapToUpper);             }         }         System.debug('TRANSFORMED '+jsonMap);

I am trying to tidy up some really bad legacy code from an old developer and I'm trying to get rid of these nested for loops. The code below shows what I'm currently working with. I've fixed this before with nested SOQL queries but nothing like this. How would this need to look to remove these for loops (except Trigger.New)? Would I use Maps? How would I do that?  map<Id,SObject> mapProperyIdBudDetail = util.GetObjFields(setPropertyId, 'Property'); map<Id,SObject> mapSpaceIdBudDetail = util.GetObjFields( PropertyMap.keyset(), 'Space');  for ( Lease__c l: Trigger.New ) {      if(mapProperyIdBudDetail.get(PropertyMap.get(l.space__c))!=null) {          lProperties = new List<SObject>{mapProperyIdBudDetail.get(PropertyMap.get(l.space__c))};              for ( SObject p: lProperties ) {                  for ( String fm: FieldMap.keyset() ) {                      if ( p.get(FieldMap.get(fm)) != Null) {                         l.put(fm,p.get(FieldMap.get(fm)));                     }                  }             }     } }


I came across a very basic absolute value question  $|x+2| + |x-3| =5.$  Initially, I thought the answer was $x=-2$ and $x=3$ because I let each absolute values be either positive and negative and that's what you get.  But the correct answer was an inequality;   $-2\le x \le 3.$  Now, If you try subbing values in or solve it graphically, this inequality is correct.  But how am I supposed to know if the solution is to be an inequality or equality? Is there anyway to tell by looking at the expression?  Thanks,

Possible Duplicate:          How should I solve:  $|x-2| + |x-5|=3$  Please suggest a  way that I could use in other problems of this genre too  Any help to solve this problem would be greatly appreciated. Thank you,


Let $f$ be an entire function such that $\lvert f\rvert$ approaches infinity as $\lvert z\rvert$ tends to infinity. Then   $f(1/z)$ has an essential singularity at $0$. $f$ cannot be a polynomial. $f$ has finitely many zeros. $f(1/z)$ has a pole at $0$.   Option 2 is false, what about 1, 3, 4?

Let $\displaystyle f$ be an entire function such that $$\lim_{|z|\rightarrow \infty} |f(z)| = \infty .$$ Then,    $f(\frac {1}{z})$ has an essential singularity at 0. $f$ cannot be a polynomial. $f$ has finitely many zeros. $f(\frac {1}{z})$ has a pole at 0.   Please suggest which of the options seem correct.   I am thinking that $f$ can be a polynomial and so option (2) does not hold.  Further, if $f(z) = \sin z $ then it has infinitely many zeros... which rules out (3) while for $f(z) = z$ indicates that it has a simple pole at $0$ and option (4) seems correct.


Suppose that $│f(x) - f(y)│≤│x-y│^2$ for all $x,y \in \mathbb{R}$  Proof that $f$ is constant by computing the derivative $f$

The problem:  Assume $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfies $|f(t) - f(x)| \leq |t - x|^2$ for all $t, x$. Prove $f$ is constant.  I believe I have some intuition about why this is the case; i.e. if $t$ and $x$ are very close, ($|t - x| = \epsilon$), then $\sqrt{\epsilon}$ will converge to 0, so $|f(t) - f(x)|$ will also converge to zero if you keep taking $t$ and $x$ closer and closer to each other. However, how do I formalize this argument? Thanks.


SessioManager.kt class SessionManager(context : Context) {      private var PRIVATE_MODE = 0     val PREF_NAME = "LoginLogout"      val KEY_IS_LOGGEDIN = "isLoggedIn"     var pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE)   //---------error     var pref_editor: SharedPreferences.Editor = pref.edit()      fun  setLogin(isLoggedIn: Boolean) {                            //use to login or logout         pref_editor.putBoolean(KEY_IS_LOGGEDIN, isLoggedIn)         pref_editor.apply()          if(!isLoggedIn) {             pref_editor.clear().apply()         }     }      fun isLoggedIn() : Boolean {                                             return pref.getBoolean(KEY_IS_LOGGEDIN, false)     } }  HomeActivity.java public class HomeActivity extends AppCompatActivity {  private SessionManager sessionManager = new SessionManager(HomeActivity.this);  //-------error private SharedPreferences sharedPreferences = sessionManager.getPref();   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference

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


I was fiddling around with id recently and realized that (c?)Python does something quite sensible: it ensures that small ints always have the same id.   >>> a, b, c, d, e = 1, 2, 3, 4, 5 >>> f, g, h, i, j = 1, 2, 3, 4, 5 >>> [id(x) == id(y) for x, y in zip([a, b, c, d, e], [f, g, h, i, j])] [True, True, True, True, True]   But then it occurred to me to wonder whether the same is true for the results of mathematical operations. Turns out it is:  >>> nines = [(x + y, 9) for x, y in enumerate(reversed(range(10)))] >>> [id(x) == id(y) for x, y in nines] [True, True, True, True, True, True, True, True, True, True]   Seems like it starts failing at n=257...  >>> a, b = 200 + 56, 256 >>> id(a) == id(b) True >>> a, b = 200 + 57, 257 >>> id(a) == id(b) False   But sometimes it still works even with larger numbers:  >>> [id(2 * x + y) == id(300 + x) for x, y in enumerate(reversed(range(301)))][:10] [True, True, True, True, True, True, True, True, True, True]   What's going on here? How does python do this?

Why does the following behave unexpectedly in Python?  >>> a = 256 >>> b = 256 >>> a is b True           # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False          # What happened here? Why is this False? >>> 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?


I don't understand the necessity of square the result of  $x_1 - \bar{x}$ in  $$\sqrt{\frac{\sum_{i=1}^{N} (x_i - \bar{x})^2}{N-1}}$$. In fact I don't understand even why is $N - 1$ on the denominator instead of just $N$. Someone could explain it or recommend a good text about it? All books about Errors Theory or even Statistics that I found are either too much abstract or too much simplist. Thanks in advance.

Steps of getting standard deviation. :        Work out the average (mean value) of your set of numbers   Work out the difference between each number and the mean   Square the differences   Add up the square of all the differences   Divide this by one less than the number of numbers in your set -   this is called the variance   Take the square root of the variance and you've got the standard   deviation      Am I missing out something, or why do we need to square the differences in step 3?  Why not simply do a Abs (multiply all negative numbers by -1) in step 3?  Also, my second question is why do we need to divide by one less than the number of numbers in the set in step 5? why not simply divide by the number of numbers?


I was trying to add a repository in synaptic package manager and I end up with an error.  This is what it shows when I open synaptic package manager.  E: Malformed line 1 in source list /etc/apt/sources.list (type) E: The list of sources could not be read. Go to the repository dialog to correct the problem. E: _cache->open() failed, please report.  W: Ignoring file 'Macaulay2.list.save.3' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension W: Ignoring file 'Macaulay2.list.save.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension W: Ignoring file 'Macaulay2.list.save.4' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension W: Ignoring file 'Macaulay2.list.save.2' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension   Actually,  I was trying to install a software called Macaulay 2 following online instruction.

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


I named my system "Foob" on my 2012 MacBook Pro. Yosemite has renamed it "Foob (4)".  I wasn't sure where that "(4)" came from so I renamed it back to "Foob" in the Sharing Preferences. But, I looked today and it's now at "Foob (2)"  Why is it doing this? How can I stop it?

Since I upgraded to Yosemite 10.10 (14A389) my computer name keeps changing adding a (2) and (3) and so forth.  Any ideas how to fix this?


my daughter has recently changed her name via marriage. But, she still has her valid visa on her old passport which is expired. So, my question is, can she travel United States bringing 2 passports and the proofs of name changes?  And what proof does she have to bring ?

I had my US visa about 7 month age, and I had to renew my passport for certain circumstances, so there was a mismatch in the name between both the visa and the new passport, you see they had to put my grand grandfather's name which was not on the old passport nor the visa, the name on old passport and visa is: Abdelrahman Samy Ali Mohammed and the new passport is: Abdelrahman Samy Ali Ibrahim Mohammed. My grand grandfather's name is Ibrahim, so the question is that gonna cause me any troubles concerning my entry to the US? is there any document should I consider taking it while i'm traveling?  Thanks,,


I have many files in a SRC folder. I would like to move all the files that follow a particular pattern from this SRC folder to another DST folder along with rename the file with a required extension.  Sample Parameters  SRC directory /Vinodh  Files in /Vinodh folder are TEST01, TEST02, TEST03, TEST04  TEST02 & TEST03 contain the word WORLD  DST directory /TEST  I want to move the TEST02 & TEST03 files to /TEST folder as TEST02.txt and TEST03.txt  I will be typing the command as   cd /Vinodh grep -l 'WORLD' *TEST* mv TEST02 /TEST mv TEST03 /TEST cd /TEST mv TEST02 TEST02.txt mv TEST03 TEST03.txt   I'd like to combine all this to a single line statement or have batch file that copies all the files in a single shot.

I am able to locate files in a folder containing a specific text string using this command:  grep -lir 'string' ~/directory/*   How do I move the files that appear in the above result to another location?


Question Given a string, return a new string made of 3 copies of the last 2 chars of the original string. The string length will be at least 2.  This is what I did, but it didn't return true on every case.   def extra_end(str):     return str[2:]*3   So I checked the solution and found this answer:  def extra_end(str):     return str[-2:]*3   My question is what's the difference between [-2:] and [2:] ?

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


While formatting a float number, I get an unexpected result. For example writing any of this   float argument = 40.432; char buff[100]; snprintf(buff, sizeof(buff), "%f", argument); std::string result = buff;   or  std::string result = boost::str(boost::format("%"  + "f")%argument);   the value of result is 40.431999, while if I set the value of argument 40.111 instead of 40.432 , the result will be 40.111000, as it is accepted. And if I set the value of argument 40.4, the result will be 40.400002.  Now I understand why it is so, and my question is  how can I get 40.432000 as a result?

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


I am rather illiterate when it comes to mathematics, I am afraid. In an effort to change that, I grabbed a copy of 'What is mathematics? : An elementary approach to ideas and methods' and have already encountered some difficulty. It seems silly to waste so much time trying to solve it myself, so I decided to ask for some help in solving and illuminating the taken steps, so that I can solve some more on my own. I shall review some of the basics while awaiting answers, and hope that my session tomorrow shall be more productive...  The problem is as follows:  Prove by induction that $1^3 + 2^3 +3^3 ... n^3 = [ (n(n+1))/2 ]^2 $.  As is, at the point I decided to seek help and look up material for review, I have taken the following steps:  solved for the base case: n=1, $1^3 = [2/2]^2 $  $$ 1 = 1^2, 1=1 $$  Then after proving the basis, I stated the assumption that:  $1^3 + 2^3 ... k^3 = [ (k(k+1)) / 2 ]^2$ is true.  Then I tried to solve for the next case, $(k+1)^3$:    $$ 1^3 + 2^3 + 3^3 ... k^3 + (k+1)^3 = [ ( (k(k+1)) / 2 ) + (k+1) ]^2 $$  $$ [ (k(k+1)) / 2 ]^2  + (k+1)^3   =  [ (k(k+1) + 1(k+1) ) / 2 ]^2 $$  at this point after failing for a while and having spent quite some time looking up material, I sought help. I hope I'm going down the right path here, but I suspect I shall soon find out...   Help is greatly appreciated.

How can I prove that     $$1^3+ 2^3 + \cdots + n^3 = \left(\frac{n(n+1)}{2}\right)^2$$    for all $n \in \mathbb{N}$? I am looking for a proof using mathematical induction.  Thanks


I have an array of questions with an array of corresponding answers. I get the user to answer the question, then compare the answer to the real answer using an if statement. Even if the answer is the correct thing, it still displays the output as incorrect. Please help.  Scanner input = new Scanner(System.in);      int inputOne;     int inputTwo;      String answer1, answer2, answer3, answer4, answer5, answer6, answer7, answer8, answer9, answer10, answer11, answer12;       String[] questions = {"How many continents are there?", "What is the capital of Canada?", "What is the largest country in the world?", "What is the largest ocean in the world?", "How many oceans are there in the world?", "How many countries make up Africa?", "How many countries in the world begin with the word United?", "Where is Milan?", "What is the least populated US state?", "What is the capital of Australia?", "How many countries begin with the letter J?", "Which country has the most lakes in the world?"};                                                                                //      String[] answers = {"7", "Ottawa", "Russia", "Pacific", "5", "54", "3", "Italy", "Wyoming", "Canberra", "3", "Finland"};                                                                                System.out.println("Enter the row and column: ");      inputOne=input.nextInt();     inputTwo=input.nextInt();        if (inputOne < 0 || inputTwo < 0 || inputOne > 2 || inputTwo > 3) {         System.err.println("Invalid input. Input a number between 0 - 2 for the row, and a number between 0 - 3 for the column.");     }         if (inputOne == 0 && inputTwo == 0) {         System.out.println("You chose 500.");         System.out.println(questions[11]);         answer1=input.next();         if (answer1 == answers[11]) {             System.out.println("Correct!");         }         else {             System.err.println("Wrong.");         }     }

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


I am having a problem downloading the application on the play store, clicking the link just gets me to an "Item Not Found" page. I have a Samsung Galaxy S3 in case it matters.  Steps to reproduce   Open the community page with Google+ app on my Android device Click the link Click the "Join Testing" (or whatever that button says) Click the download link Select to open in Google Play "Item not found" error

I was invited to join the Stack Exchange Android App Alpha Testing group and accepted the invitation. I appear in the group members if I search but the link to the beta app in the Play store only gives me a 404.    Is there another step I'm missing?


I am traveling to Canada from India via Tokyo(Narita Airport) with a Layover of 10H30Minutes and I will be arriving at Terminal 1 and my connecting flight will be from Terminal 2.  I contacted the Japan Embassy in Japan to confirm whether I need Transit Visa or not, they said yes because there is a change in the terminal and my ticket provider says that I do not need a transit visa.     Can someone please tell me whether I need a Transit visa or not?   Carriers are Air India till Tokyo and then Air Canada.

i will be traveling from India to Canada. i have to change flight at Narita airport. my onward flight is from different terminal. do i need visa for changing terminals at Narita from T2 to T1 Thanks


How to Find $$\zeta(4)=\sum_ {k=1}^{\infty}{\frac{1}{k^4}}$$ the most basic way possible?   I know it's $\pi^4/90$ but to arrive at this figure? Curious, because I need it to solve the integral $\int_{0}^{\infty}x^3\cdot(e^x-1)^{-1}\;dx$.

I know some nice ways to prove that $\zeta(2) = \sum_{n=1}^{\infty} \frac{1}{n^2} = \pi^2/6$.  For example, see  or the answers to the question "?"  Are there any nice ways to prove that $$\zeta(4) = \sum_{n=1}^{\infty} \frac{1}{n^4} = \frac{\pi^4}{90}?$$  I already know some proofs that give all values of $\zeta(n)$ for positive even integers $n$ (like #7 on Robin Chapman's list or Qiaochu Yuan's answer in the linked question).  I'm not so much interested in those kinds of proofs as I am those that are specifically for $\zeta(4)$.  I would be particularly interested in a proof that isn't an adaption of one that $\zeta(2) = \pi^2/6$.


I'm using the logistf package in R to perform Firth logistic regression on an unbalanced dataset. I have a logistf object:  fit = logistf(a~b)   Is there a predict() function like on that's used in the lm class to predict probabilities for future data points? Or do I have to manually input the estimated parameters from the Firth regression.


I've got a function in Python  def wordPrint():     print "word"   I want to use it to print 3 times on the same line using a for loop.  I would expect this code  for x in range(0,3):     wordPrint(),   to output this  word word word  But I get them on new lines

I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h>  int main() {     int i;     for (i=0; i<10; i++) printf(".");     return 0; }  Output: ..........  In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout.


First, I've been looking for the answer all over, but didn't find anything that can explain how to resolve my case.  I want to declare a few final fields in my Android FragmentActivity and initialize them later (I need onCreate to be executed first to get the needed data) I know that I can initialize final fields only in the constructor, however, it is called before onCreate when nothing else is yet initialized, therefore the application crashes with java.lang.NullPointerException.  My code:  public class MyActivity extends FragmentActivity {     private final File mPhotosDir;     private final ConstraintLayout mConstraintLayout;     ...     // This is the constructor of MyActivity activity     public MyActivity() {         this.mPhotosDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);         this.mConstraintLayout = findViewById(R.id.myActivityConstraintLayout);     }     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         ...     }   Is it even possible to declare final fields in an activity and initialize them later? Shall I give up the final declaration?

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


I'm trying to write a macro that converts a sequence to a table.  The following code works fine:  \documentclass{article} \usepackage{expl3} \begin{document} \noindent \ExplSyntaxOn \seq_new:N \l_my_a_seq \seq_set_split:Nnn \l_my_a_seq { ; } { (a, b); (b, c); (c, a) } \tl_new:N \l_my_b_tl \cs_new:Npn \printsequence:N #1 {   \seq_pop_left:NNTF #1 \l_my_b_tl {     \tl_use:N \l_my_b_tl \\     \printsequence:N #1   } {   } } \printsequence:N \l_my_a_seq \ExplSyntaxOff \end{document}   and outputs this:    But when I try to place it inside a table, it stops working. The following code results in "TeX capacity exceeded":  \documentclass{article} \usepackage{expl3} \usepackage{tabularx} \begin{document} \noindent \ExplSyntaxOn \seq_new:N \l_my_a_seq \seq_set_split:Nnn \l_my_a_seq { ; } { (a, b); (b, c); (c, a) } \tl_new:N \l_my_b_tl \cs_new:Npn \printsequence:N #1 {   \seq_pop_left:NNTF #1 \l_my_b_tl {     \tl_use:N \l_my_b_tl \\     \printsequence:N #1   } {   } } \begin{tabular}{|c|} \printsequence:N \l_my_a_seq \end{tabular} \ExplSyntaxOff \end{document}   What is the problem here? I haven't used macros before, so I don't know a lot about them.

I'm having trouble using (the amazing)  package with a tabular environment.  Specifically, I'm getting a full extra row in my tabulars when creating rows using \seq_map_inline. I can avoid this behavior by not including the \cr in the last row (in the MWE below, this would involve a few more lines of code, but was not a huge deal in the original usage), and then including the \cr verbatim.  In the MWE I purposely delete a lot of space “just in case” but it does not change anything (except make it harder to read, sorry). Another fix might be inserting negative spacing as in , but I'm confused why the kernel is inserting something into my table (it takes up no horizontal space at least, seen by add a Hi before the \end{tabular}).  Broken but should be right  \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \DeclareDocumentCommand \myTable {m} {   \seq_set_split:Nnn \l_tmpa_seq {,} {#1}   \begin{tabular}{|c|c|}\seq_map_inline:Nn \l_tmpa_seq {Entry&##1\cr}\end{tabular} } \ExplSyntaxOff \begin{document} \myTable{A,B,C,D} \end{document}     Works but more complicated  \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \DeclareDocumentCommand \myTable {m} {   \seq_set_split:Nnn \l_tmpa_seq {,} {#1}   \int_zero:N \l_tmpa_int   \begin{tabular}{|c|c|}     \seq_map_inline:Nn \l_tmpa_seq {Entry&##1       \int_gincr:N \l_tmpa_int       \int_compare:nNnTF{\l_tmpa_int}={\seq_count:N\l_tmpa_seq}{}{\cr}      }      \cr   \end{tabular} } \ExplSyntaxOff \begin{document} \myTable{A,B,C,D} \end{document}


I am looking for an example where you have $P(n)$ implying $P(n+1)$. However there is no base case. For which there is therefore no solution at all for the induction problem even though the inductive step itself works.

Learning about proof by induction, I take it that the first step is always something like "test if the proposition holds for $n = \textrm{[the minimum value]}$"  Like this:       Prove that $1+2+3+...+n = \frac{n(n + 1)}{2}$ for all $n \ge 1$.   Test it for $n = 1$:  $$n = \frac{n(n + 1)}{2} \implies 1 = \frac{2}{2}\textrm{, which holds.}$$  * The rest of the proof goes here *    So, I do it all the time (like a standard). But I never really thought about why. Why do I do such test? I can see that if the test does not hold, it cannot be proven by induction, I guess. But is there another reason we do this?


In a world I am creating, I would like to summon a named Wither Skeleton. However, I don't know the commands to use.  Can someone please assist?

The annoying thing about wither skeletons is: There is no way I know of to spawn them in the overworld!  I have determined that there is no way to spawn wither skeletons in the overworld without commands. So that is what I am looking into.   I want to know if there is a command that summons wither skeletons so then I can play around with it a bit and possibly even convert it so I get a wither skeleton spawner.  Also, I already know that if you spawn a skeleton in the nether it has an 80% chance to spawn as a wither skeleton.


I'm trying to write a command that's a one-line for loop containing a command that uses the & operator to put the command in the background:   for dir in $(ls); do command $dir &; done   Where & tells BASH to run command in the background. Yet BASH returns   bash: syntax error near unexpected token `;'   What's going on here? How can I use & in conjunction with ;? I tried enclosing things in quotes, like do "command $dir &" or do command $dir "&" but those have unexpected results.

How can one run multiple programs in the background with single command?  I have tried the commands below, but they do not work.  nohup ./script1.sh & && nohup ./script2.sh & -bash: syntax error near unexpected token '&&'  nohup ./script1.sh & ; nohup ./script2.sh & -bash: syntax error near unexpected token ';'


Let R be a commutative Ring with $1$ and $S\subset R$  multiplicatively completed ($s_1,s_2\in S\implies s_1 s_2 \in S$) and $I\subset R$ an ideal, such that $I\cap S=\emptyset$. Consider now $M:=\{J\subset R\ : J \ \text{is an ideal with} \ J\cap S = \emptyset \ \text{and} \ I\subseteq J \} $. Prove now, that $M$ has maximal Elements (with the partial order $\subseteq$).  The lemma of Zorn states, if every chain of elements is upper bounded, then there is a maximal element, but I'm struggeling to prove, that an upper bound must exist.

I'm mainly trying to prove that      If $0\not \in S\subseteq R$ is a multiplicative subset of a   commutative ring $R$ with identity. Then $R-S$ contains a prime ideal.   Now, by using Zorn's lemma, one can show that $R-S$ contains a maximal ideal I. In fact, I is a prime ideal as well, so we need to show this.To do that, I assumed the opposite, i.e $\exists a,b \in R$ s.t $ab\in I$, but $a,b \not \in I$. Then looked each case. However, I stuck when $a,b \in R-[S\cup I]$. The following is what I've done for this case;  Proof:  In this case, our assumptions are $a,b\in R-[S\cup I]$ and $I + (a) = J$, where $J$ is an ideal in $R$ and $J \cap S \not = \emptyset$.   These imply that; $S^{-1}(I + (a)) = S^{-1} J$, but since $J \cap S \not = \emptyset$, by a theorem that we proved in the class, $S^{-1} J = S^{-1}R$.Therefore, it must be true that $\exists (i\in I, r\in R, s_1,s \in S)$ s.t  $$\frac{i+ra}{s_1} =\frac{1}{s}$$ but this implies $\exists s_2 \in S$ s.t  $$ s_2(is + sra -1 s_1) = 0 \quad \Rightarrow \quad (s_1 s )i + (s_1 s r) a = (s_1 s )1,$$ ,so $$(b s_1 s )i + (s_1 s r) ab = (s_1 s )b.$$ Observe that by our assumption $ab\in I$, so $(s_1 s)b \in I$.  Now, at the point, I don't know how to proceed, so I would appreciate any help or hint because I stuck at this point for over a week now.  Edit  Thanks for the great answers; however, but I'm specifically interested in how to continue from the point where I stuck.


I have, recently, noticed permission errors when installing updates to Adobe Flash. Are these serious? Is my Flash installation fully up to date? How can I check?

I get it after updating in Synaptic Manager  I recently did a clean install of Ubuntu 17.04 from 16.10.  error message:-  W: Download is performed unsandboxed as root as file '/var/cache/apt/archives/partial/samba-libs_2%3a4.5.8+dfsg-0ubuntu0.17.04.1_i386.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)


Exmple: $e=3, n=33$ and $d =7$ and Message is $64$.

If I understand correctly in (unpadded) RSA the length of message M must be shorter than modulus n.  Encryption gives ciphertext that is also shorter than n.  Let's say I want to send a message of 2.5x length of n.  Is the split of message into chunks inferred somehow, or is that encoded somehow within ASN.1 keys? What are the different options/standards for this?  EDIT: Probably RSA is not used for messages longer than n but symmetric keys are generated with RSA and then they are used for longer messages?


I am using the latest version 2.79 for windows, and I made a short video. Now I tried to render it as MPEG and it doesn't show up in the options and after a lot of research I can't find a solution to this problem.

Even when I start a brand new file in Blender, I only get four video output file options: AVI raw, AVI JPEG, Frame Server, FFMpeg Video.  I am running version 2.78.5 (I'm using the beta so that I can use denoising.  How can I get access to all the other video outputs other people have? Like this:


dealt with the error:  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 23: invalid continuation byte   Now there is a different problem. The code is:  import bpy import csv import sys  file = open('test.csv', 'rU', 'ignore') reader = csv.reader(file)   The error message is:  TypeError: an integer is required (got type str) Error: File format is not supported in file '/PI-SAT/proj001/test.csv'   I have verified that test.csv is a valid .csv file by running a different script:  import csv  path = "test.csv" file = open(path,'rU') reader = csv.reader(file)  header = next(reader) # 1st line is header #data = [row for row in reader] # Read remaining data print(header)  data = [] for row in reader: name0 = row[0] name1 = row[0] vid_file = 'test-videos/' + row[5] + '.m4v' cli_line = name0 + '", "' + name1 + '", "' + vid_file print(cli_line)   This runs exactly as expected as a stand alone Python script.  What is causing the error when I attempt to run the code as a Python script in Blender?

Here is the code:  import bpy import csv import sys csv_path = sys.argv[1]  file = open(csv_path) reader = csv.reader(file)  header = next(reader) # 1st line is header  data = [ ] for row in reader:     name0 = row[0]     name1 = row[0]     pathout = 'test-videos/' + row[5] + '.m4v'     s = bpy.context.scene     f = s.objects['FirstName']     f.data.body = name0     f1 = s.objects['FirstName01']     f1.data.body = name1+'?'     bpy.context.scene.render.filepath = pathout     bpy.ops.render.render(animation=True)  bpy.ops.wm.quit_blender()   And here is the error message:  Read blend: /PI-SAT/proj001/proj001-master.blend Traceback (most recent call last): File "/PI-SAT/proj001/proj001master.py", line 9, in <module> header = next(reader) # 1st line is header File"/Applications/Blender/blender.app/Contents/Resources/2.79/python/ lib/python3.5/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 23: invalid continuation byte Error: File format is not supported in file '/PI-SAT/proj001/test.csv' ... opened default scene instead; saving will write to /PISAT/proj001/test.csv   I have read the file with a different script using the exact same code as in lines 2 - 15 and then printing the names and pathout. Running the script from the command line, not from within Blender, it works perfectly.  I have also run the part of the script within the for loop outside of the loop as a script from the command line and it works perfectly.  What am I missing about the CSV file? I created it in Excel on my Mac; is that a problem?


I've been making an adventure map and I want to make an Orc with armor and a custom player head. I did it kind of like you do with /give (/give @p skull 1 3 {SkullOwner:player you want} I am just using my player's head as a placeholder for now. Instead of giving me a mob with player head it doesn't even summon the mob. I am using minecraft 1.12. The command:  /summon minecraft:zombie ~ ~1 ~ {LeftHanded:0,Health:20,Fire:0,HandItems:[{id:"minecraft:iron_sword",tag:{display:{Name:"Orc Sword",Lore:["Bloody and rusted..."]},ench:[{id:16,lvl:3},{id:22,lvl:3}]},Count:1},{}],HandDropChances:[2F,0F],ArmorItems:[{id:"minecraft:iron_boots",Count:1},{id:"minecraft:iron_leggings",Count:1},{id:"minecraft:iron_chestplate",Count:1},{id:"minecraft:skull",{SkullOwner:CandyCaneFeeder},Damage:3,tag:{display:{Name:"Orc Head",Lore:["A trophy of your success against an Orc!"]}},Count:1}],ArmorDropChances:[0F,0F,0F,0.94F]}   The mob head I'm hoping to use instead of placeholder:  /give @p skull 1 3 {display:{Name:"Orc"},SkullOwner:{Id:"aa9cfe76-e245-4e2b-9ee1-dc78e3b02137",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWIzMWEzYjBlMjFlMjY1MDQ2NjljM2VlYmM4M2ViMjY2YWVmZGQ0NTZlN2UxZTQ3ZTM0MmQ5N2YwYmZhZjkifX19"}]}}}   How can I do it?

What is wrong with this command? It says it has a problem with value separators, but i can't find it  /summon ArmorStand ~ ~ ~10 {ShowArms:1,NoBasePlate:1,Pose:{LeftArm:[0f,0f0f],RightArm:[0f,0f,0f],Body:[0f,0f,0f],LeftLeg:[0f,0f,0f],RightLeg:[0f,0f,0f],Head:[0f,0f,0f]},ArmorItems:{id:diamond_boots,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000},{id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]},{id:diamond_leggings,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000}, {id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]}, {id:diamond_chestplate,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000},{id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]},{id:diamond_helmet,ench:[{id:protection,lvl:1000},{id:blast_protection,lvl:1000},{id:thorns,lvl:1000},{id:unbreaking,lvl:1000}]}}


I was reading a textbook which says: in synchronous transmission, the bit stream is combined into longer “frames,” which may contain multiple bytes. Each byte, however, is introduced onto the transmission link without a gap between it and the next one.  as the picture below shows:   and I was also told in Synchronous Transmission, the sender and receiver should have synchronized clocks before data transmission.  so how does clock get synchronized before data transmission? all I can see i the picture is, the sender sends many bits in frame, how could it synchronize the clock?

I'm having a hard time understanding the exact distinction between synchronous and asynchronous serial because different sources have confusing description.   For example, some source say a separate clock wire is required in synchronous, some do not mention a separate clock but a SYN character instead. Some source say asynchronous requires start and stop bits, some say not necessarily as long as there is only a pair of wire.   So my question:   1) Is clock wire always needed in synchronous serial? If not, how do we synchronize?  2) When we say asynchronous, does it always mean we use start and stop bits? If not, how do we synchronize?


I was trying to override the Order Object 'New' button with the Lightning Component (aura). I have created an aura component called 'CC_OrderCreateOverrideComponent' and inside that, I was calling the LWC component called cc_orderCreateWizard. <div id="createWizardDivId" class="slds-modal__container" >      <c:cc_orderCreateWizard id="abcId" parentId="{!v.recordId}" onrecordChange="!c.refreshView}"/> </div>  In the LWC Component, there is a cancel button which allows user to cancel the current process and close the current process. When the user clicks on the cancel button, I have redirected the current popup into the previous URL, and from the aura component, I have called the refreshView function. At that instance, the popup window is getting close and it will redirect to the previous URL. Here is the cancel operation in my LWC component, cancelOperation() {          window.history.back();     this.dispatchEvent(new CustomEvent('recordChange'));     return false; }  here is the refreshView function inside the aura component,  refreshView: function(component, event) {      console.log('LC ----------------- refreshView');      // refresh the view      $A.get('e.force:refreshView').fire(); }  The problem was when the user clicks on again the Order 'new' button, the previous details weren't removed. I tried out the destroy function inside the aura component. I think it has completely removed and I couldn't load the new order creation popup again. (It won't call the connectedCallBack method inside the LWC component.) Can someone help me to resolve this problem? Thank You.

I have a couple custom lightning pages and apps, both overriding default record views and standalone pages (just straight nav to from the sidebar). It seems that every time we go from 'tab' to 'tab' it just hides the content rather than destroying it. When you navigate back to the tab, it does recreate the components, so you end up with 2 of everything sitting out there.  I noticed this b/c we have a component that registers to an app event. And every time you navigate away from and back to the page, the handler is registered +1. So going back and forth a few times you pretty quickly have 10s of the same handlers firing for each app event.  Anyone seen this? Thoughts?  If you create a Lightning App, add this component, and assign it to lightning menu you can see what I mean. Just go the app click home and then click back:  Comp:  <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">     <aura:handler event="c:BoringAppEvent" action="{!c.test}"/>     hi     <ui:button press="{!c.onClick}" >App Event</ui:button> </aura:component>   controller:  ({     test : function(component, event, helper) {         console.log('Clicked');     },     onClick : function(cmp, evt){          var notEvt = $A.get('e.c:BoringAppEvent');          notEvt.fire();     } })   Renderer  ({     unrender: function(){         this.superUnrender();         console.log('unrender');         debugger;     } })   BoringAppEvent.evt  <aura:event type="APPLICATION" description="Event template" />


From the datasheet the open loop phase shift is given as 90 degrees for a range of frequency. But why doesn't a a normal open loop inverting amplifier does not show this characteristics of the phase shift of 90 degree.Instead it just inverts the output(Or say 180 degree phase shift).    What happened to the phase shift given by a Op amp?

When comparing the input and output of the Op Amp alone (Vid1-Vid2 and Vo and not Vsupply and Vo) in a closed loop configuration the phase shift is only 90 degrees? Why it is so? And the Simulation shows its is 90 degrees!!The white wave form is the input of Op Amp (V-diff) and the Red Waveform is output.  Does it implies that the closed loop Op amp individually by themselves gives only 90 degree phase difference? If so which part of the external circuitry give the remaining 90 degrees to satisfy the known experimental fact that the overall phase shift in closed loop- inverting configuration is 180.   And the circuit diagram of implimentation:


As mentioned in , Stack Exchange owns the copyright to all WB hats and WB-related content. However, I am wondering if I can upload images of hats onto a public-facing personal site to make some sort of a gallery of past WB hats and maybe include some past and present WB site styling or even the knitting tool there for indefinite fun. (Just to be clear, such a site will distinctly state its status as a fan site and attribute its content to SE.) Also, I recognise that SE logos , but can WB logos be used for such a fan site? In the past, an SE employee allowed the usage of WB hats as  so I just want to check if that is still the case for non-commercial fan projects. (I haven't started work on such a site or anything like that; just thought I'd check first.)  Note regarding the (previously marked) : The marked duplicate is narrower as it specifically relates to hats, I am trying to ask about the usage of other WB content, such as the  and also the knitting editor on the WB2017&18 site. But, I reiterate that all WB-related content (hats, styling, knitting editor, etc.) used will be clearly attributed to SE, on such a fan site if I decide to create one.

Can I download  and use them as my profile picture?  I actually like some of them, and want to keep them for future use.


I am using Ubuntu 16.04 64-bit. I was trying to uninstall VirtualBox, but I got a lot of errors which ended with a warning telling me that my Software Centre has failed. I restarted the system and was going to try again. I ran: apt-get update and apt-get upgrade before trying anything else.   When I ran the upgrade command, the VirtualBox automatically got installed along with it, but after throwing a lot of warnings at me (I don't remember exactly what those were).   I think I should uninstall this and start fresh but when I try to uninstall using apt-get remove virtualbox* --purge, I got these results:  ananthan@ananthan-X556UQK~$ sudo apt-get remove virtualbox* --purge  Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'virtualbox-source' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-utils' for glob 'virtualbox*'  Note, selecting 'virtualbox-ose' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-modules' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-additions-iso' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-dkms' for glob 'virtualbox*'  Note, selecting 'virtualbox-dkms' for glob 'virtualbox*' Note, selecting 'virtualbox-ext-pack' for glob 'virtualbox*'  Note, selecting 'virtualbox' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-source' for glob 'virtualbox*'  Note, selecting 'virtualbox-ose-fuse' for glob 'virtualbox*'  Note, selecting 'virtualbox-qt' for glob 'virtualbox*'  Note, selecting 'virtualbox-2.0' for glob 'virtualbox*'  Note, selecting 'virtualbox-2.1' for glob 'virtualbox*'  Note, selecting 'virtualbox-2.2' for glob 'virtualbox*'  Note, selecting 'virtualbox-modules' for glob 'virtualbox*'  Note, selecting 'virtualbox-3.0' for glob 'virtualbox*'  Note, selecting 'virtualbox-3.1' for glob 'virtualbox*'  Note, selecting 'virtualbox-3.2' for glob 'virtualbox*'  Note, selecting 'virtualbox-4.0' for glob 'virtualbox*'  Note, selecting 'virtualbox-4.1' for glob 'virtualbox*'  Note, selecting 'virtualbox-4.2' for glob 'virtualbox*'  Note, selecting 'virtualbox-4.3' for glob 'virtualbox*'  Note, selecting 'virtualbox-5.0' for glob 'virtualbox*'  Note, selecting 'virtualbox-5.1' for glob 'virtualbox*'  Note, selecting 'virtualbox-dbg' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-X11' for glob 'virtualbox*'  Note, selecting 'virtualbox-guest-additions' for glob 'virtualbox*'  Package 'virtualbox-ose' is not installed, so not removed  Package 'virtualbox-ose-fuse' is not installed, so not removed  Note, selecting 'virtualbox-dkms' instead of 'virtualbox-modules'  Package 'virtualbox-2.0' is not installed, so not removed  Package 'virtualbox-2.1' is not installed, so not removed  Package 'virtualbox-2.2' is not installed, so not removed  Package 'virtualbox-3.0' is not installed, so not removed  Package 'virtualbox-3.1' is not installed, so not removed  Package 'virtualbox-3.2' is not installed, so not removed  Package 'virtualbox-4.0' is not installed, so not removed  Package 'virtualbox-4.1' is not installed, so not removed  Package 'virtualbox-4.2' is not installed, so not removed  Package 'virtualbox-4.3' is not installed, so not removed  Package 'virtualbox-5.0' is not installed, so not removed  Package 'virtualbox-guest-additions' is not installed, so not removed  Package 'virtualbox-5.1' is not installed, so not removed. Did you mean 'virtualbox-5.1:i386'?    Package 'virtualbox' is not installed, so not removed  Package 'virtualbox-dbg' is not installed, so not removed  Package 'virtualbox-dkms' is not installed, so not removed  Package 'virtualbox-ext-pack' is not installed, so not removed   It is telling me that it is unable to install anything because nothing has been installed, however I am able to open VirtualBox so it must be installed. I am apprehensive about trying it out in this form.  How do I uninstall this? Or should I try to use this as it is?

I had installed VirtualBox but it started giving me problems. So I uninstalled it using:-  sudo apt-get remove virtualbox-\* sudo apt-get purge virtualbox-\*   But when I reinstalled VirtualBox it again resumed to previous settings and started giving same problems. How can i completely remove VirtualBox from my laptop and then reinstall it such that it wont give same problem again?


I want nanoTime() of last 24 hours. long currentDate=System.nanoTime(); how to find nanoTime by subtracting 24 hours? Is it possible to get nanoTime from Date date = new Date()?

Accuracy Vs. Precision  What I would like to know is whether I should use System.currentTimeMillis() or System.nanoTime() when updating my object's positions in my game?  Their change in movement is directly proportional to the elapsed time since the last call and I want to be as precise as possible.  I've read that there are some serious time-resolution issues between different operating systems (namely that Mac / Linux have an almost 1 ms resolution while Windows has a  50ms resolution??).  I'm primarly running my apps on windows and 50ms resolution seems pretty inaccurate.  Are there better options than the two I listed?  Any suggestions / comments?


I'm working on a project to remotely create a repository in my GitLab CE instance (that part is working!) and then to create a directory using the name of the project (working!) and cd into that directory (here's where I have the issue...) and then to initialize locally and add the remote repository (working!!!) The issue I'm having is solely changing into the new directory. Whether I use the code shown below, or simply try to cd "$1" or cd "$*" I can't seem to get it to work at all! #!/bin/bash  dir="$*" wd=$(pwd) fulldir="$(pwd)/${dir// /\\ }/" echo "Creating directory $dir" mkdir -v "$dir" cd "$dir" echo "Changing current directory to $dir" echo $dir echo $fulldir  The output of this code is: root@cana:~# ls glnewproj  test root@cana:~# bash test Hello World Creating directory Hello World mkdir: created directory 'Hello World' Changing current directory to Hello World Hello World /root/Hello\ World/ root@cana:~# ls Hello World  glnewproj  test root@cana:~# pwd /root  How can I cd into my newly created directory? I'm totally stumped. Edit: Typed up the function per ghoti and tested it within .bashrc and within my test script. When running the function directly from bash: root@cana:~# ls glnewproj  test  test2 root@cana:~# mkcd "Hello World" root@cana:~/Hello World#   When running the function from within a new test script: root@cana:~# ls glnewproj  test  test2 root@cana:~# cat test2 #!/bin/bash  mkcd() {   mkdir -p "$1" && cd "$1" }  mkcd "$1"  root@cana:~# bash test2 "Hello World" root@cana:~# ls Hello World  glnewproj  test  test2  So the script is still running as a child and thus not updating the parent shell's current directory. Is my only option to spawn a new shell at the end of the script?

I'm trying to write a small script to change the current directory to my project directory:  #!/bin/bash cd /home/tree/projects/java   I saved this file as proj, added execute permission with chmod, and copied it to /usr/bin. When I call it by: proj, it does nothing. What am I doing wrong?


He killed him (by) using a meat cleaver.    the gene editing methods (by) using a tool derived from a bacterial immune system called CRISPR.    he hit his wife (by) using his ring      These sentences are taken from a different books  The preposition I inserted into sentences are not really existed. My question is why do people not use the preposition ‘by’ in these situations?

Sometimes both "using" and "by using" seem to have the same meaning. Am I wrong? For example, compare the sentences below:   "On-screen keyboards allow people with mobility impairments to type data using a joystick or a pointing device." "On-screen keyboards allow people with mobility impairments to type data by using a joystick or a pointing device."   Both sentences use "using" for the same purpose, don't  they? And their meanings are the same, aren't they?


Let $V$ be the set of real numbers. Regard V as a vector space over the field of rational numbers $F$ with the usual operations. Prove that this vector space is not finite dimensional. My attempt: Let $\beta$ be the basis of $V$ such that $\beta =\{\alpha_1, \alpha_2, ..., \alpha_n\}$. $\quad\therefore\;\forall\;\alpha\in span(\beta),\;\alpha = c_1\alpha_1 + c_2\alpha_2 + ..... c_n\alpha_n$ where $c_1, c_2, ...., c_n \in F$. Now I have to show there exists $\alpha \in V$ such that $\alpha \notin span(\beta)$ but I cant figure out which $\alpha$ will not belong in $span(\beta)$.

It would seem that one way of proving this would be to show the existence of non-algebraic numbers. Is there a simpler way to show this?


With an index named foo, we make an index entry using:  \index[foo]{\uplanop{#1}}   although typically I use something like:  \newcommand{\Foo}[1]{{#1}\index[foo]{#1}}   and with hyperref used as well, I get nice links back from my index. However, the terms' appearances in the text do not link to their index entries, so I can't quickly find out which other entries refer to Foo. Is there a way to change Foo so as to create such a link?

I am trying to create links from \index commands to corresponding index entries. When hyperref package is loaded, page numbers in index are, by default, linked to the page on which \index command for that entry appears. But it does not work another way around (forward-linking).  When checking correctness of index, it would be useful if I could click on indexed word in PDF (#2 in ati macro in MWE below) and it would take me to the place in the index in which corresponding entry appears. Actual index has many pages, so it is not sufficient to just determine page number where index starts, because given entry can actually appear few pages later.  My first idea was to add label to index entry and then create hyperlink from indexed word. Attempt in doing so is reflected in commented atiwl macro below. Unfortunately, this didn't compile. (Even if it did, there would be a problem with adding unique labels to each entry). Second idea to test if using label could work was to add one label directly to .ind file, like this:  \item Index entry 1, \hyperpage{1}\label{linkedentry}   Altought it compiled, resulting link did not work in PDF.  MWE:  \documentclass{book} \usepackage{blindtext} \usepackage{makeidx} \makeindex \def \ati#1#2{#2\index{#1}} % "Add to index" macro % \def \atiwl#1#2{\hyperlink{linkedentry}{#2}\index{#1\label{linkedentry}}} % "Add to index with label" macro \usepackage{hyperref} \begin{document} \blindtext  Some text and \ati{Index entry 1}{indexed term}.  \blindtext  Some text and \ati{Index entry 2}{another indexed term}.  % \blindtext  % Some text and \atiwl{Entry with label}{some indexed text}.  \printindex  \end{document}   I am not sure if this is relevant to the solution, but I use texindy as index processor. And actually, I use splitidx package and accompanying splitindex command line tool, because I need many indexes. In MWE, though, I used makeidx to make it more universal for other people with the same problem.  Is there any way to create link from #2 in ati macro to corresponding index entry?


I want to get all Tasks from this Java code. I get      com.podio.APIApplicationException: null   How I skip the code with NPE and continue the execution of the code?  import com.podio.APIFactory; import com.podio.ResourceFactory; import com.podio.api.Podio; import com.podio.oauth.OAuthClientCredentials; import com.podio.oauth.OAuthUsernameCredentials; import com.podio.task.TaskAPI;  public class PodioImpl implements Podio {     @Override     public void connect(String client_id, String secret, String user_name, String password)     {         ResourceFactory resourceFactory = new ResourceFactory(             new OAuthClientCredentials(client_id, secret),             new OAuthUsernameCredentials(user_name, password));         APIFactory apiFactory = new APIFactory(resourceFactory);          TaskAPI api1 = apiFactory.getAPI(TaskAPI.class);          if(api1.getActiveTasks() != null){             System.out.println("ActiveTasks ");         }         if(api1.getAssignedActiveTasks() != null){             System.out.println("AssignedActiveTasks ");         }         if(api1.getCompletedTasks() != null){             System.out.println("CompletedTasks ");         }     } }

I use object != null a lot to avoid . What is an alternative to: if (someobject != null) {     someobject.doCalc(); }


I found this proof on   There I dont understand this part: "Because $1 < 2^{r+1} < 2^{k+1}$  it follows that  $2^{k+1}$  is not prime." How? Please explain

A little bird told me that if $2^n+1$ is prime, then $n$ is a power of $2$. I tend not to trust talking birds, so I'm trying to verify that statement independently.  Suppose $n$ is not a power of $2$. Then $n = a \cdot 2^m$ for some $a$ not a power of $2$ and some integer $m$. This gives $2^n+1 = 2^{a \cdot 2^m}+1$. Now I suspect there's a way to factor that, but I don't see how. Can someone give me a hint?


I'm looking for a command to lock user session (kinda like Super+L). I saw it for screen lock but I need something to work while I'm connected through SSH (e. g. with PuTTY).

I am using Ubuntu 12.04. Is there any way to lock the screen or session from a terminal command or script?


I wanted to know if I could delete my own user in my mac, I have administrator permissions. Can I only delete other users or can I delete my own account too? (EDIT : i don't use the Mac anymore so I want to delete my own account, there is an other admin account (the Mac owner). It would save a lot of place in my Mac)

I created a new Admin account in Sierra High and needed to delete the previous admin account which is marked now as the standard user. However, after unlocking as admin and selecting the respective user that I would like to delete, I see the - sign is marked as Grey.     This is all accounts and I would like to delete the mac user account,   $ dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]' name: mac password: ******** uid: 501 gid: 20 dir: /Users/mac shell: /bin/bash -- -- name: chaklader password: ******** uid: 502 gid: 20 dir: /Users/chaklader shell: /bin/bash   How do I delete the respective account? I find a code snippet to run on the terminal, i.e, sudo /usr/bin/dscl . -delete "/Users/mac". Should I try that and will work out?  Update:  As an answer suggested, I'm not logged in to the the fast user switching menu.    As it was asked, I run who in the terminal and get the result,   $ who  chaklader console  Dec 28 06:01  chaklader ttys000  Dec 28 14:51   So, in brief the other user, mac was not in the terminal.