How to intent to different activities for different types of users

I am developing an android app on android studio & Firebase.  There are 4 different types of users (student, tutor, parent, admin). I want to do it with if statements something like this:   if (user.profile.userstatus == "Student")      intent studentactivity  if (user.profile.userstatus == "Tutor")      intent tutoractivity   So, my main question is that how can I bring the data from firebase?  And, this is my code for distinguishing:  if (isRegistering) {     mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {         @Override         public void onComplete(@NonNull Task<AuthResult> task) {         showProgress(false);              if (!task.isSuccessful()) {                 Toast.makeText(LoginActivity.this, "Could Not Register", Toast.LENGTH_SHORT).show();             } else {                 // show username diaglog                 UsernameDialogFragment dialog = new UsernameDialogFragment();                 dialog.show(getFragmentManager(),null);             }         }     }); } else {     Task<AuthResult> authResultTask = mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {         @Override         public void onComplete(@NonNull Task<AuthResult> task) {             showProgress(false);             if (task.isSuccessful()) {                 // Sign in success, update UI with the signed-in user's information                 FirebaseUser user = mAuth.getCurrentUser();                   //student login                 if (get idstatus == "Student")                 Intent studentintent = new Intent(getBaseContext(), studentActivity.class);                 startActivity(studentintent);                  //admin login                 else if (get idstatus == "Admin")                 Intent adminintent = new Intent(getBaseContext(), AdminActivity.class);                 startActivity(adminintent);                  //parent login                 else if (get idstatus == "Parent")                 Intent parentintent = new Intent(getBaseContext(), ParentActivity.class);                 startActivity(parentintent);                  //tutor login                 else {                 Intent tutorintent = new Intent(getBaseContext(), TutorActivity.class);                 startActivity(tutorintent);                 }             } else {                 // If sign in fails, display a message to the user.                  Toast.makeText(LoginActivity.this, "Authentication failed.",                         Toast.LENGTH_SHORT).show();              }   And this is code for storing data(now working):  public void onClick(DialogInterface dialog, int id) {     // sign in the user ...      //https://myapplication4-124da.firebaseio.com/ https://console.firebase.google.com/project/myapplication4-124da/database/myapplication4-124da/data/      EditText usernameField = ((AlertDialog) dialog).findViewById(R.id.username);     EditText firstnameField = ((AlertDialog) dialog).findViewById(R.id.firstname);     EditText lastnameField = ((AlertDialog) dialog).findViewById(R.id.lastname);     String username = usernameField.getText().toString();     String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();     String firstname = firstnameField.getText().toString();     String lastname = lastnameField.getText().toString();      User aUser = new User(username, firstname, lastname, choice, 0.0);      FirebaseDatabase.getInstance().getReference("users").child(userId).child("profile").setValue(aUser);      Intent intent = new Intent(getActivity().getBaseContext(), studentActivity.class);     startActivity(intent);


“It can be very cold…” vs “It may be very cold…”

It can be very cold in winters.   It may be very cold in winters.   What is the difference between these two sentences?  People say when may is used then it means that it may be cold in winters or it may not be cold in winters. In other words, may means 'not sure'.  So does that mean if can is used then it is 100% sure that it will be cold in winters?


How does Kant respond to Hume's problem of induction?

It's generally well-known that Kant was responding, amongst other influences, to Hume's critique of the empirical method on purely logical grounds. One could consider him as a modern-day .  The  is sourced from a brief argument in Hume's Treatise, but the SEP shows a discussion in thoroughly analytic terms - Popper and Carnap are mentioned, for example.  What was Kant's response to the same question, if he in fact did respond to it? It seems likely that a response could be fashioned out of his philosophy on the basis of his categories as pure concepts of his understanding.  Question: How does Kant, or Kantians or neo-Kantians solve or understand the problem of induction?


A verb phrase that describes someone that doesn't pay their debt

ie. Knowing that they have an unpaid debt, yet doesn't care.  I suppose "he is renouncing his debt" would be fine, but it doesn't seem to flow well.  "he is abandoning his debt" doesn't sound too good either, so are there any better alternatives?


Does lcm of multiple numbers also divide any common multiple of these numbers?

I know that this is true for two numbers, but does this also hold for more than two? I.e. if $m$ is a common multiple of several numbers $n_1, \ldots , n_k$, does it hold that lcm$(n_1,\ldots,n_k)$ divides $m$? If so, how would one go about proving that? Maybe considering pairs of numbers of the set?


Click event / bind event not working in jQuery when generating buttons in Mustache JS

I have a button which is generated in a function via a mustache JS template.  {{#attributes}}     {{title}} {{/attributes}}   and a sample output of that is  More News   However, I am trying to execute another jquery function when this button is clicked but regardless of whether I use .click(function() { }); or .bind it doesn't seem to work? Even a console.log doesn't print so I'm not getting into the right conditions.  Here is the script:  function lazyload(selector) {     $("a[data-selector^='"+selector+"']").bind("click", function(e) {             e.preventDefault();             loadNews(selector);     }); }  $(document).ready(function(){    lazyload(".news"); // CALL FUNCTION READY FOR USAGE });


update-grub: Windows 7 (Legacy mode) + Ubuntu 16.04 (UEFI)

My BIOS has a problem that when legacy mode is enabled, the BIOS is working, but isn't graphically visible. In other words, I have to enable/disable it blindly.  I've installed Ubuntu with UEFI enabled. I've installed Windows 7 in Legacy mode.  /sda1 /boot/efi (FAT) /sda2 /boot /sda3 / /sdb1 "System Reserved" (NTFS) /sdb2 C: (NTFS)   I've tried manually adding Windows to the grub config, but it gives me an error   insmod: could not load module ntfs: No such file   I'm not sure how to proceed.  UPDATE: Duplicate


Can I add a link to "Publish"-button so when it's clicked it publishes new post and direct to another page in same click?


What is the difference between lm(log(y) ~ x) and glm(y ~ x, family = gaussian(link = "log"))?

Is all in the title. I would like to know if there is any difference in terms of coefficients, residuals, p-values, but also conceptually.


What is the main advantage of using prototype in javascript?

function Candy(name) {  this.name = name; } Candy.prototype.printName = function () {  console.log(this.name); } var chocolate = new Candy("chocolate"); chocolate.printName(); var gummyBears = new Candy("gummy bears"); gummyBears.printName();  This does exactly the same thing as not using the prototype: function Candy(name) {   this.name = name;   this.printName = function () {     console.log(this.name);   } } var chocolate = new Candy("chocolate"); chocolate.printName(); var gummyBears = new Candy("gummy bears"); gummyBears.printName();  So I’m not sure what the advantage of using a prototype instead is either!


Workflow for converting LaTeX into Open Office / MS Word Format

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.


how to ask xml question in stackoverflow

xml is omitted from the question text. the reference has nothing about this ultra rare language..  -thanks


How do I deal with "unauthenticated sources" errors in the Software Center?

Any install that I'm trying through the Software Center is telling me:  Requires installation of untrusted packages: The action would require the installation of packages from not authenticated sources.  I did an apt-get update from the command line, then removed the software sources that the keys were bad from (PPAs I added myself), and unchecked them in the software sources for software center, but to no avail.  I can't install anything from software center anymore - only> from the command line with apt-get. Is uninstalling/installing the only option?  I don't want to break other PPAs that I have. Additional information: Here's a paste from apt-get update: Reading package lists... Done W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B725097B3ACC3965 W: GPG error: http://us.archive.ubuntu.com oneiric Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>  I've tried apt-key update, and there was no effect (two keys unchanged). The output of apt-get update and apt-get upgrade, and the contents of /etc/apt/sources.list, can be found in .


Forgotten user password for Ubuntu 12.04

I recently found my old Lenovo which has Ubuntu 12.04 LTS and I've forgotten my user login. My dad is the registered admin but he's no longer here and I've tried holding the shift key when I restart like so many people have said but nothing notable really happens?  I'd really appreciate it if someone could help me and explain it as if they're talking to a toddler because computer talk really confuses me. Thank you :)


How to measure performance test on java method?

I have a method in java  Public Object someMethod (String param) ( //some calculations Return Object )   I want to test the performance of this method ( how much time would it take to reach to db and return an object )  How can I do this?  I don't have a main method because its a library. I use unit tests to check if it works.  Help.


First post review created for a user with 10.5k reputation

S.O. presented my this review for a first-post answer:    but when I open the question    I saw that the user has a reputation of 10.5k!  How could be possible? Had I misunderstood first-post review mean?


How to prove a recursive series converges?

How do I prove that series given by $x_{n+1} = \frac{x_n}{2} + \frac{1}{x_n}$ converges to $ \sqrt{2}$?  $x_0 = 2$  We got the hint that the series is a non linear difference equation. My idea would be to prove that the series is decreasing and has the lower bound $\sqrt{2}$ but I've no luck doing that. How do I proceed?


How to mount read-only NTFS-Partition (without installed Ubuntu ?!)

my LapTop, that runs on Windows 10, now doesn't start anymore. So I wanted to save all my files by USB-Booting Ubuntu 16.04.1 LTS before sending it in for repair.  But when I try to access my drive in Nautilus it gives a lengthy dialogue:  Unable to access “255 GB Volume”  Error mounting /dev/sda2 at /media/ubuntu/CAEED374EED356F3: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999" "/dev/sda2" "/media/ubuntu/CAEED374EED356F3"' 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/sda2': 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.   How do I mount that drive as Read-Only? Due to lack of disk space I can't install Ubuntu without erasing the stuff, that I actually want to save.  A graphical solution in nautilus or something would be much appreciated. Else could you please tell me exactly what I need to type in the Terminal.  Kind regards!  Markus


I am 60 US citizen, live in Costa Rica, receive a pension, and have a high deductible ($2500) US expat health insurance. I was wondering if I can open and use an HSA to pay my healthcare costs in CR and reduce my taxes?


Concatenate Values based on ID match SQL

I have an SQL (Oracle Solution) output  which looks like below:    ID        Value 1         31  1         44 2         31 3         22   4         57   4         69     ID and value are brought in from different tables using an inner join.   When I select ID and Value, I am wanting to concatenate the value (separated by a comma) when the ID is a match, so that it looks like below:  ID        Value 1         31,44  2         31 3         22   4         57,69    How can I make this happen?


If the arc length and chord length between two points in a circle are known , find radius of the circle?

If the arc length and chord length between two points (two points on a circle that constitute a  minor arc ) in a circle are known , find radius of the circle?


Compairing class sotred in a list to a normal String

I am working on a Java project and I am making a simple Comparison, I Imagine the issue is staring me in the face but its been a few days and could use a new set of eyes.  public class Reservation {     String tripID;     String tripDate;     String customerNum;      Reservation() {      }      public void setID(String s) {         this.tripID = s;     }      public String getID() {         return this.tripID;     }      public void setDate(String s) {         this.tripDate = s;     }      public String getDate() {         return this.tripDate;     }      public void setNum(String s) {         this.customerNum = s;     }      public String getNum() {         return this.customerNum;     }  }   I have a list of Reservations stored as   List<Reservation> listReservation = new ArrayList<>();   While running the comparison for a customerNum that the user enters stored as userInput   for(Reservation rs : listReservation) {     if(rs.getNum().toString() == userInput) {         System.out.println(rs.getDate());     } }   The list will never make a match, for the sake of ease the list of use numbers is as fallows 101 101, 101, 103, 104, 105, 106, 107, 108, 109, 102, 102, 115, 116, 119, 120, 121, 122, 126, 124, 124, 112, 119, 121, 125, 126, 120, 104.  Thank you in advance.


How was the invisibility cloak actually made?

Following the thought process in this , it mentions that typical  (which lose their properties over time) are created with a Disillusionment charm.  How then, could  be made?


Require a Regular Expression to valid FileName?

I require a regular Expression to validate FileName in C# that ignores everything except all upper/lower alpha chars, numbers, backslash, underscore, period, dash, etc.  "*" and "?" for wildcards. I want to use that in RegEx.IsMatch(fileName,expression)


Sometimes in the chat rooms, I see a warning icon instead of the normal green lock in Firefox.    Looking through the "More Information" area, I see that the site is trying to load http://cdn.sstatic.net/Sites/stackexchange/img/apple-touch-icon.png    I've tried clearing my cache, but that didn't change anything. So I've been popping in and out of chat rooms on various sites, and it seems that the issue only appears in chat rooms that were automatically created and imported from comments.    Now, I've been told in the comments that HTTPS on chat isn't really supported yet.  This is fine.  What is strange to me is that the only thing loaded that is not HTTPS is this single apple-touch-icon.png (with the main SE logo).  Firefox states that the associated text for this icon is "Feeds".  If the page were to use the site-specific apple-touch-icon (which is already loaded, as shown by the next line in my screenshot), there would be no plain HTTP connections.  Why do we need to load both the site-specific and general SE icons?  Why do we need to load the general SE icon over plain HTTP?


$nD$ rotation around a general $(n-2)$-dimensional subspace

According the  $3D$  $\in$ $SO(3)$ corresponding to a rotation by an angle $\theta$ about a fixed axis specified by the unit vector $\hat{\omega}=(\omega_x,\omega_y,\omega_z) \in R^3$ defined as follows  \begin{bmatrix} \cos \theta +\omega_x^2 \left(1-\cos \theta\right) & \omega_x \omega_y \left(1-\cos \theta\right) - \omega_z \sin \theta & \omega_x \omega_z \left(1-\cos \theta\right) + \omega_y \sin \theta \\ \omega_y \omega_x \left(1-\cos \theta\right) + \omega_z \sin \theta & \cos \theta + \omega_y^2\left(1-\cos \theta\right) & \omega_y \omega_z \left(1-\cos \theta\right) - \omega_x \sin \theta \\ \omega_z \omega_x \left(1-\cos \theta\right) - \omega_y \sin \theta & \omega_z \omega_y \left(1-\cos \theta\right) + \omega_x \sin \theta & \cos \theta + \omega_z^2\left(1-\cos \theta\right)  \end{bmatrix}  does there exist $n$-dimensional analogue of this formula?  How to find $n$ dimensional rotation matrix which corresponds rotation of an angle $\theta$ around the $(n-2)$-dimensional subspace?


Simple equation for $x$ but getting no proof.

Show that there is at least one real value of $x$ for which      $$x^{1/3} + x^{1/2} = 1$$   I did draw the graphs of $x^{1/3}$ and $1-x^{1/2}$ and showed that they met at a point, but I don't think it's a good algebraic proof.  How should I proceed after substituting $x$ for $z^{1/6}$ and getting a polynomial in terms of $z$


Cover letter for a dependent family for a UK Visa?

I've applied for a successful UK visit visa before through a travel agent. I had my wife and 2 sons as my dependents. Hence, my travel agent wrote a comprehensive letter under the title "Section 9" on about 3 pages, providing the details of the complete trip, purpose of the visit and my detailed assets/bank details. He, then added a government issued "Stamp Paper" signed by me as an undertaking to support the dependent family for entire duration of the trip.  That was my first ever VISA for UK. I'm now planing to re-apply. Would a simple and precise cover letter be sufficient or should I follow the same practice?


Is there a way to make rigid body interact with softbody physics?

I'm trying to have a surface with soft body hold obects that are falling on it with rigid body physics, but for some reason, no what matter what mass I give it, the objects just fall trough the softbody enabled surface.  Is there a toggle or a value I need to change to make them stay there?


How to Take Print Screen in Samsung Galaxy ace Duos? Can please some body help me.


I have a this function---  public static T parseEntity<T>(Object source, Object target)   this function parse the Entity in source to Model in target. My intention is call him self like this:   EntityFactory.parseEntity<T>(prop.GetValue(source, null), objectAux);   my problem is the parameter <T>. I have a name of type as string.


Let $f$ be an injective and continous function. Prove that $f$ is monotone.

Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be an injective and continous function. Prove that $f$ is monotone.  My proof-trying Since $f$ is injective for all $x_{1},x_{2}\in\mathbb{R}$ there is a $y$ in $\mathbb{R}$ such that $f\left( x_{1}\right) =f\left( x_{2}\right)$. Since $f$ is continous for any $\varepsilon >0$ there is $\delta >0$ such that if $\left| x-a\right| < \delta$ then we have $\left| f\left( x\right) -f\left( a\right) \right| < \varepsilon$.  So how can I show $f$ is monotone?


How to change preview windows on Ubuntu dock

I have updated my Ubuntu to 18.04 and facing an UX issue. The new UX has a preview option for grouped windows. For example, when I click Firefox, with multiple open windows, I am getting a preview and I have to select one from this. Given the size of the preview, it is hardly useful, especially when I am coding using the terminal.  I believe the preview on earlier Ubuntu versions is that both windows are shown open bigger side-by-side if I recall properly. Either this or there was no preview and the most recently opened window will open automatically on clicking the Firefox icon and then I can Alt+~ to the other Firefox window. Can someone suggest how to achieve the previous UX as in earlier Ubuntu versions?


I've never learned Java, but I need to understand what the following piece of code means, the main question is the curly braces:  /**  *   This Universe uses the full HashLife algorithm.  *   Since this algorithm takes large steps, we have to  *   change how we increment the generation counter, as  *   well as how we construct the root object.  */ public class HashLifeTreeUniverse extends TreeUniverse {    public void runStep() {       while (root.level < 3 ||              root.nw.population != root.nw.se.se.population ||              root.ne.population != root.ne.sw.sw.population ||              root.sw.population != root.sw.ne.ne.population ||              root.se.population != root.se.nw.nw.population)          root = root.expandUniverse() ;       double stepSize = Math.pow(2.0, root.level-2) ;       System.out.println("Taking a step of " + nf.format(stepSize)) ;       root = root.nextGeneration() ;       generationCount += stepSize ;    }    {       root = HashLifeTreeNode.create() ;    } }   Specifically this statement in the bottom of the listing:     {       root = HashLifeTreeNode.create() ;    }   It looks like a method without a signature, what does it mean?  Thank you in advance!


How can I improve my question that was closed as "not real"?

was closed as not real. However, I am unsure as to why.  I understand how my question could be perceived as a bit ambiguous:      Is there any way I could do this with just HTML/JS?   However, having already researched the question, I was looking for how other people would do it. Also, I was not asking to code because I can't be bothered to do a bit of problem solving, I was looking for a way to code.  I received comments such as:     Any implementation will probably depend on what browser(s) your users prefer to use.   I understand that I should have made this clear, but all of these comments that asked a question were quickly answered either in comments or in an edit to the post.  And other comments such as:     You said you know how to use localStorage... so what seems to be the problem?   I am still unsure as to how I would use localStorage to create a database as localStorage, to my knowledge only takes key and value pairs. This comment was not constructive so i am unsure as to how I should have responded.  Therefore, I believe that this question should not have been closed as I researched and stated my knowledge, providing a question that was easy to answer for those who knew a solution to my problem.  Please advise me as to why it was closed and how I can get it reopened if it is possible.


What software allows non-parametric repeated-measures multi-way Anova?

A previous user asked  specifically for R.  I'd like to know what, if any, other software can do this.


Use of comma following prepositional phrase

Is a comma required after the date (year only or day of week only) that is in a prepositional phrase before the subject of the sentence?  For example:      In 1966 I began college.


Can auto-hide for the application menu be turned off in Unity?

Will there be a way to disable auto-hide behavior of global application menu in Unity. While I would prefer to have this behavior disabled by default (as it is bad UX), it looks like it's here to stay, so I'm wondering if, as a user, I will be able to turn it off.


Labeling features and converting them to annotations with ArcPy?

how could I do the following steps with arcpy:   right-click on the layer with the features Label Features Convert Labels to Annotations ...   The annotions should be saved in a new shapefile.  How could I do this in python?


What do the White Walkers do with the baby boy gifts from Craster?

When Craster gives away the baby boys to the White Walkers, what happens? Do the baby boys become snacks at a White Walker party? Made into something else with magic?


Extended Rigid Bodies in Special Relativity

I was reading Landau & Lifshitz's Classical Theory of Fields and I noticed that they mention that an extended rigid body isn't "relativistically correct".   For example, if you consider a rigid rod and apply a torque at one end, by definition of being rigid, the whole body must start rotating at the same instant. But the information about the force being applied cannot travel faster than the speed of light.   The book hasn't mentioned how to resolve this paradox, and after thinking about it for a while, I'm wondering if one can even define a rigid body in a relativistically correct manner.  To summarize: How does one define a rigid body in special relativity?


Although there are a lot of questions on subscripts none of them are the same as this one (as far as I can find).  I want to write \min_ and directly under that I want to write p \in R^n, that's obviously the easy part. Then I want to write \| p \| \leq \Delta_k directly under p \in R^n (like a double subscript). I can get p \in R^n to go directly under \min but I do not know how to get \| p \| \leq \Delta_k directly under p \in R^n.  This is what I have just now  \begin{document}  \begin{align} &\min_{p \in \mathbb{R^n}_{\| p \| \leq \Delta_k}} \\ \end{align}  \end{document}   This makes \| p \| \leq \Delta_k a subscript of {p \in \mathbb{R^n} but it does not lie directly under it as I would like. Any ideas would be much appreciated.


Why does latest ubtunu base installs some unwanted packages by default?

I am trying to install latest ubuntu 20.04 base with openbox and lightdm. I did 14.04 which worked perfectly. But on 20.04 everytime apt automatically installs ubuntu desktop environment and both gdm3 and lightdm. Why is that happending and is there any way to turn this off? These are what i did:  prep base rootfs and chroot cp resolv.conf  apt install linux-headers-generic linux-image-generic lightdm openbox obconf  xterm backport-iwlwifi-dkms git nano


When Luke rescues Leia from her cell on the Death Star:  Leia: Aren't you a little short to be a stormtrooper? Luke: Huh? Oh, the uniform. I'm Luke Skywalker. I'm here to rescue you. Leia: You're who? Luke: I'm here to rescue you. I've got your R2 unit, I'm here with Ben Kenobi! Leia: Ben Kenobi, where is he?! Luke: Come on!  How does Princess Leia know Obi-Wan Kenobi is "Ben" Kenobi? Shouldn't her response have been: "Ben Kenobi? You mean the General??"


How does an expanding universe and a constant-density vacuum energy not violate energy conservation?

As per the title. I'm probably thinking too naively in a classical way, but intuitively it seems to me that:   the presence of vacuum energy at fixed density throughout all space and, an expanding universe   would imply that more and more energy is constantly added to the universe.  I am assuming we have not given up on energy conservation quite yet, so where is the catch?


python numerical error: big number add small number

This a exercise from Udacity's Deep learning course.   Can anyone explain why the final answer is not 1.0?  v1 = 1e9 v2 = 1e-6 for i in range(int(1e6)):     v1 = v1 + v2 print 'answer is', v1 - 1e9 # answer is 0.953674316406


How can I make a looping animation when dealing with random particles?

I have created some sparks by following .  However, I would now like to create a smooth looping animation.  I have already altered the start frame for the particle emitter to a decent sized -ve (approx. 80 from memory) so that I'm not starting on frame 1 with zero/minimal particles.  I suspect that some way of seeding the random number will be involved, but I am at a loss how to do that and whatever else would be needed.


Is there one word for people who always keep others above themselves?

For people who go an extra mile to make others comfortable, be it friends, family, etc. I need an adjective or a noun, most probably one word, that can describe people who always keep others above or ahead of themselves.


Gracefully starting/stopping Java apps on Linux

I am trying to design a graceful startup/shutdown script (Bash) for a Java app (JAR) that I will be deploying to my Ubuntu 14.04 server. I'm looking for a clean, Linux- and Ubuntu-friendly way of starting the server like so:  java -jar myapp.jar <lots off subsequent arguments>   And then, in the shutdown script, finding the JAR's PID, issuing a SIGSTOP to allow the app to do a graceful shutdown on its own, and then finally killing the PID when its good and ready.  I looked at how Tomcat handles this with its own catalina.sh and was surprised to find it wasn't doing too much other magic under the hood then simply killing a PID.  I was wondering if  may be a good candidate for such a use case, and if so, how? Otherwise, what are some other approaches that I might be able to take? Any other Linux/Ubuntu facilities/tools/programs out there that I should consider?


How would I know possible combinations of parameters an exe file ran via cmd can take?

You can run some exe files from cmd.exe providing arguments.  example  P:\foo\boo “” user pass P:\system\ company foo –P boo   Is there any way to actually find out what parameters an exe can take?   Obviously I don't have access to the source code of a specific exe. All I am trying to find out is if it is possible without the owner's manual/docs to actually know what parameters can be passed. I am open to a solution involving reflection in C# etc  Any insights on this will be very helpful


I am wondering what the difference is if I put   Both refer to string foo = "world";   Console.WriteLine("Hello" + foo); //Concatenation    and    Console.WriteLine("Hello {0}", foo); //Whatever this is called (still a beginner guys)


Why is "if not someobj:" better than "if someobj == None:" in Python?

I've seen several examples of code like this:  if not someobj:     #do something   But I'm wondering why not doing:  if someobj == None:     #do something   Is there any difference? Does one have an advantage over the other?


How do amortization schedules work and when are they used?

Specifically, I notice that on a mortgage statement, my payment is "amortized" so that at the beginning of the loan, I am paying almost entirely interest and very little principal.  However, on a credit card balance, it seems interest is only charged on the balance.  Why do amortization schedules work the way they do, and are they typically used for most loans, and why?


Is it safe to dual boot ubuntu in c drive running windows 7?

I have instlled windows 7 in my pc. I need a linux os, hence i chose Ubuntu. Can i install Ubuntu in my c drive ?


How do I remove a file named "NUL" on Windows?

I have a Windows XP box (NTFS filesystem) on which I found a file named NUL. I have not been able to remove this file in any usual way. The file appears to be owned by Administrator in the SYSTEM group, unlike any other file in the same directory (the other files are owned by my user id).  How do I get rid of this file? Where did it come from?


I remember my English teacher saying that there are only two valid ways to make a one-word sentence:   A question:      Why? Where?  A command:     Go! Stop!    Is this correct?


How to check if my eSATAp port provides 12V power?

I have a Lenovo ThinkPad Edge 13" model 0217-2QG with eSATAp port.  How do i check if my port provides 12V power (enough to power a 3.5" HDD)?


Filling specified area by random dots in TikZ

I want to reproduce the following diagram in Tikz.    LaTeX code of my MWE is below:  \documentclass[tikz]{standalone} \usepackage{pgfplots}  \begin{document}  \begin{tikzpicture}  \draw [-latex, thick] (0, 0) -- (0, 6) node  [above] {\Large{$e$}}; \draw [-latex, thick] (0, 3) -- (6, 3) node  [right] {\Large{$\widehat{Y}$}};  \draw [thick] (0, 0.5) -- (5, 4); \draw [thick] (0, 1.75) -- (5, 5.25);  \end{tikzpicture}  \end{document}     I wonder how to fill specified area by dotted points. Any help will be highly appreciated. Thanks  Edited  How about this one?


I wish to uninstall Software Center and keep the native GNOME app instead. However, I can't find it neither through Terminal nor Software. Currently it doesn't replay properly the apps on the Explore tab.


Is it possible to change the Home page so it's not a blog, but a page? And also is it possible to change the name of the homepage?  If yes, how is this done?  Thanks, Richard


I have a rigged and animated mesh that I want to apply the pose of - for each frame. The desired result is an array-like row of slightly different meshes:    The left-most snake is the original rigged mesh. It deforms with each keyframe. The three others are duplicates whose Armature modifiers were applied while the frame was on the one that was to correspond with their pose. I then deleted their armatures and redistributed them along the X axis.  For just three duplicates this is not too tedious. But I have 90 frames of animation, so I think this is going to require scripting in order to be practical.   I found , but I'm not sure what to do next. I don't know much about Python scripting.  Any help appreciated.  Edit: Never mind! While we're on the topic of duplicates... it turns out this is a duplicate question.  I'm going to close this.


Photon pair production at relativistic speeds?

This is probably an obvious question, but I don't see it answered anywhere.  Imagine we have an object in the Universe that is traveling, relative to the Milkyway at about .99999999999999999999999999c and I realize that's not possible, but imagine.  Speed is relative, so to the object, the Milkyway is flying past it and to us, the object is flying past us.  That's all good and relative.  But the photons that our superfast object encounters are gonzo blue-shifted, and relativity says that's OK too.   But lets say the object is traveling so fast, the photons it encounters are energetic enough to spontaneously undergo pair production.  That seems difficult to explain.  A relatively low energy visible light photon to our perception won't split into an Electron and a Positron, but a very energetic photon can, but it's the same photon just observed by 2 different reference frames?    I understand that observers won't agree on when things happen or on energy but the two observers should agree on events that take place and pair production for one but not the other seems impossible.     Is there a simple layman's way that this can be explained?


I gave a formula like    IF(N3=0,"N/A",IF(Q3=0,IF(M3<=N3,"FAIL","PASS")),IF(M3>=O3,”PASS”,”FAIL”),0)    and its  showing error message as "To many arguments for this function".


Before upgrade When I was running git clone git@... (using ssh) once per computer restart a window dialog appeared containing a textbox for inserting my SSH passphrase and confirmed with OK. Then the passphrase was no longer required until the next start of my system. After upgrading to 13.10 After upgrading to Ubuntu 13.10 that window doesn't appear anymore but a message in terminal appears: Enter passphrase for key '/home/username/.ssh/id_rsa':   ...every time when cloning a git repository this appears. How can I fix this? I want to enter my passphrase only once.


Could Black Hole be formed with the center of some stars?

If the LHC might make black holes, why would tiny or not so tiny black holes be potentially created with the very hot and dense core of a really big star?


Export Command History into a Shell Script

Often I have complicated installation procedures to follow, like having to build dependencies for buildtools, to build dependencies for the application I wish to install from source.  Once I have done this once, I don't really want to do have to try and remember all the steps I have done.  The command-history in zsh (and other shells) already records what I have done. Is it possible to export the last 100 (for example) commands executed in to a .sh script?    I could then edit this script, remove commands that are from before I started installing, and remove commands that were me making mistake, and be left with a install script I can give to someone else in a similar environment. (Or use myself on another machine.).  I suspect, that my command history is already stored in one of the dot-files in my home directory.


The expansion of electromagnetic waves due to diffraction can be easily explained with Huygens' principle (and in introductory courses this is usually how it is explained). But Huygens' principle is physically wrong.   What is it in the electric and magnetic field that makes light diffract? In other words why will a perfectly collimated beam of light spread out?


What happened to the other people? My Impact (people reached) just dropped

I posted this  a few weeks ago. The photo I posted shows that I had impacted 25k people. Now it says this:   I only impacted 1k people, 24k less than what my impact was a few weeks ago! I am sure that 24k people didn't delete their accounts within a few weeks and this is probably a bug. What happened to my impact score?


Implementaiton of rel="prev" and rel="next" inside a site code?

I searched a lot regarding my question, but I never found the exact piece of information explaning how to implement rel="prev" and rel="next" inside the code of a certain site?  I'll be very greatful if some could give me good imformation on this matter.


Check if list contains an Id/String in Visualforce

Is there a way I can put a condition in rendered attribute to check if a List contains an Id/String or not in Visualforce page?  I tried this but its not working or somehow I am doing something wrong:   rendered="{!IF( CONTAINS( '{!employees}', '{!Id/String}' ), true, false ) }"   Thanks


How do I add recaptcha to a custom form programatically?

I'm using the following contrib module:   How do I add a recaptcha to my form programatically, since the form I'm using isn't listed under forms on the config page of the module?  The following doesn't seem to work:  $form['recaptcha'] = array(   '#type' => 'recaptcha' );


One of the meanings of umbrella is a term for other things.  So, is it possible (yet) to use umbrella as a verb? To umbrella something? Perhaps an umbrella'd issue? I saw someone used "umbrellered" and aside from disagreeing with the spelling, I was curious about the acceptance of a verb form.


Stuck at "Checking for updates". Windows 7

The problem I cannot run updates on a window 7 computer, because it gets stuck at "Checking for updates". That I have tried:   Disabling the antivirus Deleting all contents from the update folder Updating the update client from microsoft. Running chkdsk /f Waiting for a whole day to find the updates.   Nothing seems to work.  Edit: Found a workaround. No suggestions helped here. So I used this app to get all the updates manually :


Why the variable 'COUNT' is not initialized?

I want to change the variable 'COUNT' to 0 at specific time. But after the work of function 'init()', 'COUNT' is still not initialized. What's wrong? import schedule import time import datetime  COUNT = 0  def init():     COUNT = 0     print(COUNT)     print("init")     return COUNT  schedule.every().day.at("13:05:50").do(init)  try :       while True :          now = datetime.datetime.now()         schedule.run_pending()          COUNT = COUNT +1          print(now)         print(COUNT)          time.sleep(5)  except KeyboardInterrupt :     print("EXIT")


Please help me identify the icon encircled in my attached photo..thank you.


Flat Earth Horizon vs Spherical Earth Horizon

EDIT: OK, I have been asked to clarify my question(s).   At what altitude do we start to see the curvature of the Earth? Distance to the horizon at this altitude. The angle between line of sight of the observer and vertical.   My reasons for these questions are:  1) I have read pilots' comments saying they cannot discern a curve at 40,000 feet. I was surprised because I have been on open sea and believed I could see the curve at the periphery of my vision. I thought about it and realised if every point on the horizon is equidistant to me, then I would probably have to get really high to see the curve. So maybe my brain created the curve, as peripheral vision is largely deduced rather than 'seen'?  2) Flat Earthers are bugging me.


Ubuntu 12.04.04 LTS installation doesn't work

I have been using ubuntu on my laptop for a while now.  I tried to install ubuntu on my desktop (64bit) with a CD, my ubuntu install cd starts and i can use it.  When i arrive at the screen "Installation type The computer currently has Windows 7 on it. What do you like to do?", it says.   Install ubuntu INSIDE windows 7 ( what is strange because it was alongside in the versions before. ) Replace windows 7 with Ubuntu Something else   So i want to install ubuntu next windows 7, when i click Install ubuntu INSIDE  windows 7 it closes ubuntu and comes to the screen "please remove the disk, close the tray (if any). My computer restarts and opens windows 7. The disk auto starts WUBI on the computer. I come on a window that display's some text like this:     I click on Demo and full installation. After this window it says that i need to restart my computer. I restarted and i come in the beginning of the process again (so back to step 1) It keeps doing this in a loop.  This is a repost of a closed-off post you can find it


I am trying to fully understand how ETFs work. For the sake of simplicity, let us restrict ourselves to physical replica ETFs. Let us suppose that an ETF follows an index which tracks three stocks: Alice Enterprises (A), Bob Industries (B) and Charlie's (C). We want to invest 1000$. The prices of each individual stock are 100$ (A), 10$ (B) and 1$ (C). The index weights at this moment are 60% (A), 30% (B), 10% (C). If I am not mistaken, when we buy a fund tracking this same index, the fund manager will automatically buy 600$ of A, 300$ of B and 100$ of C. Now, if we buy an ETF the underlying process is unclear to me. I understand the concepts of authorised participant and NAV spread. If A increases its value to 110$, authorised shareholders will first withdraw shares of A from the ETF and sell those shares, and then they will buy the ETF, pushing the ETF price upwards. This way the ETF price is automatically regulated and the authorised shareholders earn a profit. Everybody is happy. In contrast to a fund, when we buy an ETF we are not generally buying ETF shares from the ETF manager. Instead, we are buying ETF shares from another investor. Therefore... as I understand it, no new shares are really bought. And thus, following the process above, if we buy the ETF we push its price upwards. This again creates a "gap", this time the price of the ETF is momentarily higher than its underlying assets and, therefore, authorised shareholders will sell ETF shares and buy shares of A, B and C. So... an ETF manager only buys a fixed amount of shares when the ETF is created? I want to know if I am correct in this reasoning about how the basics of physical ETFs work. I have tried to keep things as simple as possible. I understand that there will be lots of quirks and quincks, and it is great if these are elaborated in the answers.


How can I get a wife or daughter in skyrim?

I want to settle down, and my friend says i can get a daughter and stuff, how do I?  PS.Is there jobs? Like, not quests, but actual jobs?  PPS.I dont have acces to any of the DLCs.


Let $f:\mathbb R \rightarrow \mathbb R$  continuous function such that $f(x+y)=f(x)+f(y)$. Then there exist a real $r$ such that $f(x) = r x$.  My try:  with $f(\frac1q x)$:  $$f(x) = f(q\cdot\frac1q x) = f(\frac1q x+...+\frac1q x) = f(\frac1q x)+...+f(\frac1q x) = qf(\frac1q x)$$ Now $f(\frac pqx)$: Fix $y=\frac xq$ to get $$f(\frac pqx) = f(p\frac xq) = f(py) = p\,f(y) = p\,f(\frac1q x) = p\cdot\frac1qf(x)$$  and i know too that $\lim_{h \rightarrow 0} \frac{f(x + h) - f(x)}{h} = \lim_{h \rightarrow 0} \frac{f(x) + f(h) - f(x)}{h} = \lim_{h \rightarrow 0} \frac{f(h)}{h}$  here i stuck how can i conclude and find this $r$, some help please.


Concatenate values from column in related table into a string

I have 2 tables (1-n) in SQL Server 2008.  Example: 1 person - 'n' addresses  I want to select persons data and bring related addresses districts into a column (concatenated)  ID  Name ------------------------------------------ 1   John Smith 2   Daniel  PersonID  DistrictName ------------------------------------------ 1         Brooklin 1         SoHo 2         Upper West Side 2         Harlem  SELECT desired ------------------------------------------ John Smith   Brooklin, SoHo Daniel       Upper West Side, Harlem   How could I do this in tsql?


I've been trying many options for my citations and references. I used natbib package and plainnat style, but I discovered biblatex and it seems better for customizing citations and bibligraphy styles. My problem is that I can't make it works.  My code:  \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry} \usepackage[citestyle=authoryear,bibstyle=authortitle]{biblatex} \usepackage[none]{hyphenat}  \addbibresource{C:/Users/usuario/Documents/6_Latex_Files/References} \usepackage[brazil]{babel}  \begin{document} Hi \parencite[i.e.][page 2]{Alamri2010}\\  Another citation \parencite{Bouvy1999,Ho2008,Ho2012c}\\  In line citation \parencite{Bar-Yosef2010}   \printbibliography \end{document}   The result:    Why the citations are not correct?  Why the pre and postnotes is not appearing?  Why the bibliography is naor appearing?  Observation (if helps): When I compile appears the following messages:  This is BibTeX, Version 0.99d (MiKTeX 2.9.6200 64-bit) The top-level auxiliary file: document.aux I found no \citation commands---while reading file document.aux I found no \bibdata command---while reading file document.aux I found no \bibstyle command---while reading file document.aux (There were 3 error messages)


Compatibility issue between `forest` and `etextools`

I have the following versions of the forest and etextools packages:  Package: forest 2015/07/15 v1.0.10 Drawing (linguistic) trees Package: etextools 2010/12/07 v3.1415926 e-TeX more useful tools for LaTeX pack age writers   When I try to compile the following MWE:  \documentclass{standalone}  \usepackage{forest} \usepackage{etextools}  \begin{document}   \begin{forest}     [a [b] [c]]    \end{forest} \end{document}   I get the following error:  ! Argument of \ettl@forloop has an extra }. <inserted text>                  \par  l.9   \end{forest}   The MWE works fine if I remove the etextools include. How can I use both at the same time?


Anonymizing the xml: how to remove data while leaving the tags in Java?

Given an xml structure in a String type, I'm looking for a way to replace data with four asterisks, while leaving the tags in their place. That is, starting from this <one> <two> abc </two> <two> def </two> </one>  I want it to become <one> <two> **** </two> <two> **** </two> </one>  I've tried requestBody.replaceAll(">[^<]+?<","> **** <")  but I'm also capturing any blank spaces between two adjacent tags, having therefore <one> **** <two> **** </two> **** <two> **** </two> **** </one>  How could I achieve my goal? Any suggestions?  for some tests. Edit Following Michael Kay suggestions I've found this solution /**  * Anonimyzes an xml structure replacing all data between tags with 4 asterisks.   * Tags won't be replaced.  *   * @param xmlInput the string representing the xml to be anonymized  * @return the anonymized xml structure.  */ private String anonymizeXml(String xmlInput){     String anonimizedXml=null;     try {         TransformerFactory factory = TransformerFactory.newInstance();         Source xslt = new StreamSource(new StringReader("<xsl:transform version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:template match=\"*\">  <xsl:copy>   <xsl:apply-templates/>  </xsl:copy></xsl:template><xsl:template match=\"text()[normalize-space()]\"> **** </xsl:template></xsl:transform>"));         Transformer transformer;         transformer = factory.newTransformer(xslt);         Source text = new StreamSource(new StringReader(xmlInput));                  StringWriter writer = new StringWriter();         transformer.transform(text, new StreamResult(writer));         anonimizedXml = writer.toString();              } catch (TransformerConfigurationException e) {         e.printStackTrace();     } catch (TransformerException e) {         e.printStackTrace();     }     return anonimizedXml; }


Cannot insert .eps figure into LuaLaTeX compilation

I'm trying to insert a .eps figure into my document. I'm using LuaLaTeX. I have already tried to remove the ".eps" extension from the \includegraphics{} command, but it didn't work. Makes no difference (do not compile) It always says the error:     Unknown graphics extension: .eps   I also tried the package epstopdf, but that didn't work either. It shows the error:     Package pdftex.def error: File 'fig/VocSOCGeneric-eps-converted-to-.pdf not f [I think it is "not found"].   In the path "fig/" no pdf is created (and no pdf is created in the project directory also). I also tried to insert the -shell-escape and --enable-write18 commands, but unsuccessfully.  It seems that all alternatives from converting eps to pdf are only suitable for pdfLaTeX, and not for LuaLaTex. Also, there is almost no documentation about eps figures AND LuaLaTeX, leading me to think that LuaLaTeX should deal naturally with eps graphics. But I don't know how!  Code example below.  \documentclass[addressstd,a4paper,10pt]{report}  \NeedsTeXFormat{LaTeX2e} \RequirePackage[2015/01/01]{latexrelease}  \RequirePackage{fix-cm}  \RequirePackage{tabularx} \RequirePackage{url}  \RequirePackage{amsmath} \RequirePackage{unicode-math}  \RequirePackage{luatextra} \RequirePackage{fontspec} \RequirePackage{lmodern}  \RequirePackage{graphicx} \RequirePackage{caption} \RequirePackage{chngcntr}  %\RequirePackage{epstopdf}  \counterwithout{figure}{chapter} \renewcommand{\thefigure}{\arabic{figure}} \renewcommand{\figurename}{Figura}  \captionsetup[figure]{labelsep=endash,         justification=justified,singlelinecheck=false,format=hang}  \begin{document}      Text before      \begin{figure}[h!]     \centering     \caption{Curva Característica Voc SOC de uma bateria Li-ion NCA.}     \includegraphics[scale=1]{fig/VocSOCGeneric.eps}     \label{fig:cap1VocSOC}     \end{figure}      Text after  \end{document}


Check condition of SimpleDate converted string in Android

I'm trying to do a simple IF check of a String that I know has been formatted correctly with:  Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy"); String formattedDate = df.format(c.getTime());   At this point formattedDate is "09/24/2015". I can confirm that this is true:  remoteViews.setTextViewText( R.id.widget_date, formattedDate);   It's showing me the correct date.  So I know it's good. So I test it:  if (formattedDate=="09/24/2015"){ //do some stuff }   For whatever reason, that condition is not true, and nothing happens. I have tried everything from removing the slashes, to just changing the format around, but formattedDate never equals what that string clearly is.  Is there something I'm missing here?


In the NEW CANON why don't the Rebels abandon Yavin 4 before the Death Star Arrives?

I know there are similar questions out there, but from what I know the new Princess Leia comic deals IMMEDIATELY after the award ceremony and the ensuing evacuation.  My question:   Why not before?  (I know the real-world answer) they knew the planet was going to get destroyed.  Could it have been an act of loyalty to rebel high command?  Were they worried the Death Star would feint using it's super laser and try a ground assault (so they needed the troops)?  Or is there room for us simply to assume they did a partial evacuation, and then either just had the ceremony with the , or the evacuees returned to help break down the equipment?


Using Cycles renderer the reflections look good in viewport but not in in the render, why is this happening?

Im using Cycles renderer and there is no reflection when I render the image I ve been searching for solutions but I couldnt find any, Im using Blender 2.83 This is how it looks in the viewport  This is how it looks when I render it  This is the material  And these are the render settings


What will occur if apt is interrupted during package install?

What will happen if, for example, power goes down during package install(I mean unpacking, not dowloading).  Should I avoid such kind of situations or them make no harm, because package database is in consistent state and package could be installed again? Thanks.


Removal of parenthesis around years from the citations in text

I have an Elsevier article to submit and I've been given a Latex file. It has the following code  \documentclass[preprint,12pt]{elsarticle}  \usepackage{lineno} \usepackage{amsmath} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \graphicspath{{./Figures/}} \usepackage{floatrow} \usepackage{dsfont} \usepackage{float} \usepackage[margin=1in]{geometry}  \usepackage{fancyhdr} \usepackage{titlesec} \usepackage{algorithmic} \usepackage{algorithm}                  \usepackage{subcaption} \usepackage[format=hang]{caption} \usepackage[dvipsnames]{xcolor}  \begin{document}  The manuscript is here.   \bibliography{referenceFile}  \bibliographystyle{apa}\biboptions{authoryear}   \end{document}   The references in the manuscript appear as (AuthorName (Year)) as in the picture below but I want to change it to (AuthorName, Year).    Why does this happen and how can I change it? I added all packages I'm using, in case any package clashes somehow with references.   I can't see any reference packages like biblatex or natbib. What am I missing? Or do I change the structure of any other file than the .tex?


what to do if I accidently changed .bin file?

I changed .bin opening file to other and I dont know how to make it back (to the normal image) I tried to use "open with" and this why it dont work


In total how many blood types are there?  And why do people normally know only 8 of them? (A+, B+ , AB+ and O+ and Rh- counterparts)


How to use chrono::system_clock from a text file?

I have following situation: I'm writing two programs, the first one starts with windows and writes the current system time in a text document. The code for this looks like this: auto start = std::chrono::system_clock::now(); std::time_t start_time = std::chrono::system_clock::to_time_t(start);  ofstream Write ("Time.txt"); Write << std::ctime(&start_time);  The date format looks like this: Thu Jul 16 14:19:53 2020. My second program autostarts with the shutdown. It should build the difference between the current system time and the starting time and write the difference in a different text document. #include <iostream> #include <ctime> #include <string> #include <cmath> #include <fstream> #include <chrono> #include <windows.h>  using namespace std;  double k; //Get leftover time from txt doc// int s;    //Seconds// int m;    //Minutes//    int h;    //Hours// int d;    //Days// long int z;    //Var containing new leftover time//   int main() {      ifstream Time ("Time.txt");         Time >> start;         //Get starting time//       ifstream Check ("Test.txt");         Check >> d; //Reading days from txt doc to d//         Check >> h; //Reading hours from txt doc to h//         Check >> m; //Reading minutes from txt doc to m//         Check >> s; //Reading seconds from txt doc to s//      k = (s + 60*m + 3600*h + 24*3600*d);      auto end = std::chrono::system_clock::now();     //Get current time ending the program//      std::chrono::duration<double> elapsed_seconds = end-start;      //Calculate difference between start and end//      z = (k-round(elapsed_seconds.count()));      //Calculate time difference in seconds//       //Converting seconds into days, hours, minutes, seconds//     d = z / (24*3600);     h = (z / 3600) % 24;     m = (z / 60) % 60;     s = z % 60;     //End of converting//      ofstream Write ("Test.txt");         Write << d << "\n" << h << "\n" << m << "\n" << s;           //Write all values back to txt doc//      }  The problem I have is that I don't have an idea on how to get the starting time from the Time.txt in a format I can use in this chrono operation std::chrono::duration<double> elapsed_seconds = end-start. I've tried to set it up like in the startup program std::time_t start_time = std::chrono::system_clock::to_time_t(start); ifstream Time ("Time.txt"); Time >> start;  The result: a ridiculous negative number in the Test.txt which is obviously wrong considering I didn't mess with the system time. A string variable didn't help me much either. It gets the job done copying the txt line to the string variable but afterwards I didn't manage to transform it into the right chrono variable. I hope someone has an idea on how to do this. I'm thanking you already for your answers.


How can I concatenate two arrays in Java?

I need to concatenate two String arrays in Java.  void f(String[] first, String[] second) {     String[] both = ??? }   What is the easiest way to do this?


how to use css button to post method in a form?

I love this article    But the comment list is already closed so I need your help guys!  How to make this code to a form using submit method?    Add to cart   This is the sample of my form where I want the css button to be inserted:  <form action="http://ww6.aitsafe.com/cf/addmulti.cfm" name="mal" method="post"> <input type="hidden" name="userid" value=""> <input type="hidden" name="return" value="">     <input type="hidden" name="nocart"> <input type="hidden" name="qty1" value="1"> <input type="hidden" name="product1" value=""> <input type="hidden" name="price1" value="150.00">  <input type=submit value="Add to Cart" onclick="alert('Added to cart\n\nThis page will refresh');">   update... yehey! :)  Thank You to PCALCAO for the link   There I found the answer of CHRIS to be very helfpful & now it's working...  Correct answer:    Add to cart   :)


Back-propagation through max pooling layers

I have a small sub-question to .   I understand that when back-propagating through a max pooling layer the gradient is routed back in a way that the neuron in the previous layer which was selected as max gets all the gradient. What I'm not a 100% sure of is how the gradient in the next layer gets routed back to the pooling layer.  So the first question is if I have a pooling layer connected to a fully connected layer - like the image below.    When computing the gradient for the cyan "neuron" of the pooling layer do I sum all the gradients from the FC layer neurons? If this is correct then every "neuron" of the pooling layer has the same gradient?  For example if the first neuron of FC layer has a gradient of 2, second has a gradient of 3, and third a gradient of 6. What are the gradients of the blue and purple "neurons" in the pooling layer and why?  And the second question is when the pooling layer is connected to another convolution layer. How do I compute the gradient then? See the example below.    For the topmost rightmost "neuron" of the pooling layer (the outlined green one) I just take the gradient of the purple neuron in the next conv layer and route it back, right?  How about the filled green one? I need to multiply together the first column of neurons in the next layer because of the chain rule? Or do I need to add them?  Please do not post a bunch of equations and tell me that my answer is right in there because I've been trying to wrap my head around equations and I still don't understand it perfectly that's why I'm asking this question in a simple way.


My characters skin looks Caustic in Cycles and the Shirt Texture is missing. Cycles Render  EEVEE render


Fundamental group of the connected sum of manifolds

Let $M$ and $N$ be two connected manifolds of the same dimension $n$.  What is the fundamental  group of their connected sum $M \# N$ in terms of $\pi_1(M)$ and $\pi_1(N)$ ?


VirtualBox not seeing USB devices even though I am in vboxusers group

My host OS is Ubuntu 15.04 and my guest OS is Windows 10. I'm running VirtualBox 5.0.2 r102096.  When the guest OS is running in the VM, right-clicking on the little USB icon displays a context menu with a single disabled menu item that says No USB devices connected.  When the machine is powered off and I go into its settings, on the USB tab, the Enable USB controller option is checked and USB 3.0 (xHCI) Controller is selected. In the USB device filters list some of my previously created (from when it still worked) filters are present and when I right-click there and select Add filter from device, I am greeted with a similar context menu with a single disabled menu item that says No devices available.  My USB flash drive is inserted into the host computer, but other devices should be visible as well, namely the integrated webcam, the touchscreen and stuff. They were previously, before either upgrading Ubuntu or upgrading VirtualBox, I cannot pin point precisely when it stopped working as I run the guest OS sporadically.  When I run sudo adduser tomashubelbauer vboxusers, I get The user tomashubelbauer' is already a member ofvboxusers'. When I log out and log in again, the same thing happens.  Are there any other knows issues with VirtualBox being unable to enumerate USB devices? Are there other options for me to troubleshoot the issue further?


hi i need to write a short shell script that lists all the existing files ignored by your GiT repository. Example:

%> bash git_ignore.sh | cat -e  .DS_Store$  mywork.c~$  %>


I have some math structured like the following in a display math environment:  \left( \frac{ \left( \frac{a}{b} \right)^{e} }{L} \right)     Apparently, the outer fraction is centered vertically in the surrounding parentheses even though its numerator requires more space than the denominator L.  To me this looks unbalanced with too much space below the L.  Is there a way of shifting the entire content of the outer parentheses down?   MWE:  \documentclass[]{standalone} \usepackage[utf8]{inputenc} \usepackage{amsmath} \begin{document}     $\displaystyle         \left( \frac{ \left( \frac{a}{b} \right)^{e} }{L} \right)     $ \end{document}


Difference between (string == "") and (string.length() ==0)

public static String[] myfunc(String s){     if (s == null) return null;     if (s == "") return new String[0];     //code..      //this code will not run if s == ""  }   I intended s == "" to cover all the empty strings. But there seems to be cases where s != "" but s.length() == 0 What is the difference between s == "" and s.length() == 0?


My ubuntu doesnt accept my login password!

I made a mistake by running some commands like:  sudo chown $USER:$USER ./ rm -r ./   because I was trying to own the directory and delete some stuff. So, once I run these command lines and rebooted, I couldn't login back to my ubuntu. It feels that it wants to but then kicks me back to provide my password again! Any solution for this problem please, any around solutions?


Why can’t the birthday problem be thought of like this

There is this problem in my text book. Now, they answer it   $$\frac{(365)!}{(365^n)(365-n)!}$$   That is, they used ordered sampling with replacement to obtain the sample space and ordered sampling without replacement to obtain the event that no two people share the same birthday.  But I thought about it in another way: I used unordered sampling with replacement $ {365+n-1 \choose n} $to obtain the sample space, and unordered sampling without replacement $ {365 \choose n} $ to obtain the particular event at hand.   Briefly, my line of thought was like this: let $x_1, x_2, ...x_{365}$ be the days people could be born on. We want the sum of these x’s (that is, the number of people born on day x) to be n, this is the sample space. For the event, let n of the x’s be 1 and the rest zero; thus we only want to compute the number of different arrangements of ones.  My answer and the one in the textbook are clearly different. I don’t understand why order matters in this question. Besides, shouldn’t it not matter whether I use ordered or unordered sampling because, put informally, the factors cancel out? Thanks in advance.


Use that $a^5\equiv a\pmod 5$ and if $(a,5) = 1$ then prove $a^4\equiv 1\pmod 5$  I´ve been trying to solve this but I don’t get any where


Completely Remove LXDE/Lubuntu Desktop Environment

I've install LXDE on my laptop due to Unity's disappointing performance. But now, I want to completely remove LXDE including it's entire list of programs that came installed with it. How do I go about doing so?


$|x-f(x)|<5777$, Show that $f$ is surjective

Let $f:\mathbb{R}^2\to\mathbb{R}^2$ be a continuous map such that $\forall \ x : |x-f(x)|<5777$.   Show that $f$ is surjective.


Let $A,B\in \mathbb{R}^{n\times n}$. $\exists a_{i,j},b_{k,l} \not = 0$.$$A \times B = O$$ ($O$-zero matrix). Prove $$rgA + rgB \le n$$ My attempt: as rows of matrix $AB$ are linear combinations of rows $B$, so we have $$a_{i1}B_{1}+ \ldots +a_{in}B_{n}= \theta, i=\overline{1,n},$$ $B_1, \ldots ,B_n$ - rows of matrix $B$. As $A$ is non-zero matrix there is $B_s$, which is linear combination of other rows of $B$, hence system $B_1, \ldots ,B_n$ is linearly dependent, so $rgB < n$. And I got stuck. Is there a way to imrove that estimate?


I have added alias ll='ls -la' in /etc/bash.bashrc but sudo ll is not working. Is there a way to "source" bash.bashrc? In a related post, another user suggesting creating an alias for sudo with a space after it. Eg. alias sudo='sudo ' but there wasn't any context to this answer. Should I add this to my bashrc? Seems hackish.  What is the correct method for adding an alias for my sudo one-off commands?


Young adult series, cryosleep, crashed spaceship. People were turned to "swiss cheese" by worms

When I was in 6th grade I remember reading 2 or 3 books in a sci fi series.  From what I can remember a ship full of people (mostly teens) had crashed and awoken the main character and several survivors.   Some of the sleepers are eaten by space worms. It's set in the future where the rich could slightly alter their genes, like having "cat eyes" for instance.  I remember the survivors having to chop someone's leg off to stop the worms from spreading.


Standard Error vs. Standard Deviation of Sample Mean

I'm having difficulty figuring out the difference between (typically referred to as S.E):  A. The Standard Error  And  B. The Standard Deviation of the Sample Mean (typically referred to as s)  Are they the same thing?  OR   S.E is the standard deviation of the the mean of the sampling distribution similar formula as the standard deviation except you use n-1 instead of n in the denominator s is the standard deviation of a single random sample -- same formula as the standard deviation


Using tput in $PS1 is breaking line wrapping

Good Morning-  I'm trying to use tput outputs in my $PS1 to set the background color to red in the event I'm on a production server:  if [[ `hostname -s` = prod-db ]]; then   export PS1="${TITLEBAR}`tput setab 1`[\u@\h \W \$ORACLE_SID]\$`tput setab 0` " else   export PS1="${TITLEBAR}[\u@\h \W \$ORACLE_SID]\$ " fi  However, I'm finding that when I'm on prod-db, the line wrapping is quite messed up; it seems fixed to a certain number of characters and does that fun thing where modifying a command that goes too long goes up a line without redrawing the screen as though the terminal is entirely messed up.  When the background color is not set, none of those issues occur... I'm happy.  PS1 is being set to [\e]0;\u@\h echo $ORACLE_SID\a]^[[41m[\u@\h \W $ORACLE_SID]$^[[40m with colors and to [\e]0;\u@\h echo $ORACLE_SID\a][\u@\h \W $ORACLE_SID]$ without colors.  The only difference being the escape characters being set to set the colors, I don't see what would be breaking the line wrapping.  I'm running GNU bash 4.1.2.  Why does the introduction of the color escape codes cause line wrapping to break, and what is the proper way to resolve the issue?


GNOME shows activities overview when mouse hover dash

I got this weird bug recently: When mouse-hovering the dash panel, the activities overview shows up. Why is that? (I'm using "dash to panel" extension).  I'm using Ubuntu 17.10


How to derive the conjugate prior of an exponential family distribution

I am trying to derive the conjugate prior of the univariate Gaussian distribution over both the mean and the precision. I know that the prior I'm looking for is the normal-gamma distribution, but the idea is to derive this result.  It seems that you can write down the conjugate prior of an exponential family distribution immediately if you represent it in the canonical exponential family form.  suggests a way to do just that. So far I have written the Gaussian probability function in this form and equated the following, but I don't see how the form of the conjugate prior is immediately obvious.  $$p(\mu, \lambda | D) \propto p(\mu,\lambda)p(D | \mu, \lambda)$$


Can I use a variable in a Bash brace expansion?

Below is some sort of pseudo-code for what I'm trying to accomplish:  #!/bin/bash  # I already have the variable below figured out (positive integer): numlines=$([returns number of lines containing specific characters in a file])  # This is basically what I want to do with it: for i in {1..$numlines}; do     # the part below is already figured out as well:             do some other stuff done   I can execute it fine from the command line by inserting the actual number in the `{1..n}' sequence.  I just need to know if it's possible to include a variable here and how to go about doing it.   I have tried exporting it I have tried putting the variable itself in curly braces inside the sequence: {1..${numlines}} I have tried putting it in double-quotes hoping it would expand: {1.."$numlines"} I have tried escaping the $: {1..\$numlines}   Do I need to use a set -[something] command in order for this variable to get expanded?  I have even tried some forms of using eval...all to no avail.  I just need to know if there is something simple or obscure that I am missing or if this is even possible before I waste anymore time on it.  I could throw together a really, really hackish way of doing it to make it work as needed, but I'd like to avoid that if at all possible and learn the right way to go about doing it.


Is there any way to schedule dashboard refresh at schedule time

I am trying to implement a process which can help me in refreshing the dashboard after one hour.   I have tried using salesforce process builder but that too depends on having an activity.Please do suggest if there is any way within salesforce through which we can implement the same.


Where can I download the latest release of Ubuntu?

A new version of Ubuntu has been released. I still can't find it on ubuntu.com. Where can it be downloaded from, or is it the only way to install it using update-manager to upgrade an existing installation?


Can I say OS X inherits the architecture of Linux Kernel since I notice similarities between linux and OS X in many aspects such as terminal commands and system view.


Db_Query Fatal error: Unsupported operand types

I am simply trying to return the rows from a table in my db but i keep getting this error thrown back at me no matter what I do "Fatal error: Unsupported operand types in C:\xampp\htdocs\d7\includes\form.inc on line 1009". Am I missing a argument or something?  This is my function  Hook menu  function auto_form_menu() { $items = array(); $items['admin/config/auto_form'] = array(     'title' => 'My Module',     'description' => 'description',     'page callback' => 'drupal_get_form',     'page arguments' => array('auto_form_records'),     'access arguments' => array('administer site configuration'),     'file' => 'auto_form.admin.inc' );  $items['admin/config/auto_form/manage'] = array(     'title' => 'My Module',     'type' => MENU_DEFAULT_LOCAL_TASK,     'description' => 'description',     'weight' => -10, ); return $items; }   'auto_form.admin.inc'  function auto_form_records() {   $header = array('First Name', 'Last Name');    $dbresult = db_query("SELECT first, last FROM {auto}");      $rows = array();     foreach ($dbresult as $dbrow) {         $rows[] = array(         $dbrow->first,         $dbrow->last       );     }     return $output = theme('table', array('header' => $header, 'rows' => $rows)); }   Updated Code:  Any help is appreciated seeing how I am completely lost on figuring this out.


If $c|a$ and $c|b$ then $c|(ax+by)$ where $c,a,b$ are integers  Proof:  Suppose $c|a$ and $c|b$ then we can represent as the following:  $a=cx$ where $x$ is an integer  $b=cy$ where $y$ is an integer  Then adding both:  $a+b=cx+cy=c(x+y)$  therefore $c|a+b$  but how can i show $c|(ax+by)$ ?


Elementary Symmetric Polynomials, Roots of cubic polynomials

I'm given $a_1, a_2, a_3$ as roots of the equation $x^3 + 7x^2 - 8x + 3$ and need to find the cubic polynomials with roots $a_1^2, a_2^2, a_3^3$ and $\frac{1}{a_1}, \frac{1}{a_2}, \frac{1}{a_3}$.  It's in a chapter about Galois Theory and is preceded by a problem about elementary symmetric polynomials.  I'm guessing I need to use elementary symmetric polynomials to solve for the two desired functions, but I really don't know where to start.  Hints would be much appreciated.


Many of them, including me, have similar thoughts about that.   Many Koreans including myself weren't concerned about them at all.      I'm studying English and wondering how different they are. Could you guys let me know?


Java Uppercase is working but I can´t use it in an if statement

I can't find the problem. I'm programming an chess game and I want to display the moves made by the player. For example: E4 to E5. The code below compares an old String before something moved with a new one. The problem is I´m using lower case letter for the black figures and upper case letter for the white figures, now I want to tell the player what figure he took. It is not relevant what kind of color the figure had. Because of that I´m making the letter upper case and compare it in an if statement if it is a "P" or a "K" or so on. But it doesn't work. .toUpperCase is working but it always fail at the if statement. It isn't a big problem I can use an or for asking the upper and lower case but I really want to know what the reason is. I hope someone can help me and sorry for my bad english skills.  package projekt;  public class MoveList {     private String startPosition;     private String endPosition;     private String[][] position =     {             { "A8", "B8", "C8", "D8", "E8", "F8", "G8", "H8" },             { "A7", "B7", "C7", "D7", "E7", "F7", "G7", "H7" },             { "A6", "B6", "C6", "D6", "E6", "F6", "G6", "H6" },             { "A5", "B5", "C5", "D5", "E5", "F5", "G5", "H5" },             { "A4", "B4", "C4", "D4", "E4", "F4", "G4", "H4" },             { "A3", "B3", "C3", "D3", "E3", "F3", "G3", "H3" },             { "A2", "B2", "C2", "D2", "E2", "F2", "G2", "H2" },             { "A1", "B1", "C1", "D1", "E1", "F1", "G1", "H1" } };      private String[][] chessBoard;     private String[][] oldChessBoard;      public MoveList(String[][] chessBoard, String[][] oldChessBoard)     {         this.chessBoard = chessBoard;         this.oldChessBoard = oldChessBoard;          move();     }      public void move()     {         for (int i = 0; i < oldChessBoard.length; i++)         {             for (int j = 0; j < oldChessBoard.length; j++)             {                 if (oldChessBoard[i][j] != chessBoard[i][j])                 {                     if (oldChessBoard[i][j] != " " && chessBoard[i][j] == " ")                     {                         startPosition = position[i][j];                     }                     else if (oldChessBoard[i][j] == " " && chessBoard[i][j] != " ")                     {                         endPosition = " to " + position[i][j];                     }                     else if (oldChessBoard[i][j] != " " && chessBoard[i][j] != " ")                     {                         endPosition = " take " + position[i][j] + " " + takenFigure(oldChessBoard[i][j].toUpperCase());                     }                 }             }         }         if (startPosition != null)         {             System.out.println(startPosition + endPosition);         }      }      private String takenFigure(String figure)     {         System.out.println(figure);          if (figure == "P")         {             return "Pawn";         }         else if (figure == "K")         {             return "Knight";         }         else if (figure == "B")         {             return "Bishop";         }         if (figure == "R")         {             return "Rook";         }         else if (figure == "Q")         {             return "Queen";         }         else if (figure == "A")         {             return "King";         }         return "Nothing";     } }


Given a specific 2 by 2 matrix that is a subset of all 2 by 2 real matrices find an isomorphisim between the matrix and complex number system

More clearly the question is:  Prove that R is a field by showing that $\mathbb{R}$ forms an isomorphisim to $\mathbb{C}$ as rings (explicitly find an isomorphism between them and prove it is an isomorphism).  Let $$R=\left\{\begin{bmatrix}a&b\\-b&a\end{bmatrix}:a,b\in\mathbb{R}\right\}\subseteq M_2(\mathbb{R}).$$  So I need to show that this is a bijective homomorphisim. The definition that is given is:  Definition 4.1.7: A homomorphism $\mathbb{\phi}$:𝐺 → 𝐺′ is injective if $\mathbb{\phi}$(𝑔1) = $\mathbb{\phi}$(𝑔2) implies 𝑔1 = 𝑔2 for any 𝑔1,𝑔2 ∈ 𝐺. It is surjective if for every 𝑔′ ∈ 𝐺′, there is a 𝑔 ∈ 𝐺 such that $\mathbb{\phi}$(𝑔) = 𝑔′. It is bijective if it is both surjective and injective.   Any hints would be greatly appreciated. To be honest I am not even sure what the question is asking. If someone could break this down it would be great. How do I show all the properties of a homomorphisism from the matrix of reals to the matrix of the complex (if that is even what is being asked)? I am even more confused on showing it is injective. This is my first time encountering material like this before. It is very rough.


How can I break a wood block in Adventure mode?


Let $a, b, c \in \mathbb{N}$. Show that if $a^2+b^2=c^2$ then $gcd(a,b)=gcd(a,c)=gcd(b,c)$.  Using basic divisibility criteria I couldn't advance anything.


I run an OLS multiple regression model estimating expected chance of getting a job at a company $X$ for different subgroups.  ${gets~job}_i = \hat{\alpha} + \hat{\beta_1}\cdot talent_i + \hat{\beta_2}\cdot woman_i + \hat{\beta}3 \cdot talent_i \cdot woman_i + \hat{\epsilon}_i$.  $E[gets~job|woman = 0, talent = 0] = \alpha $  $E[gets~job|woman = 0, talent = 1] = \alpha + \beta_1 $  $E[gets~job|woman = 1, talent = 0] = \alpha + \beta_2 $  $E[gets~job|woman = 1, talent = 1] = \alpha + \beta_1 + \beta_2 + \beta_3  $  My question: How do I, by hand and (quickly) in R, test the hypothesis $\beta_1 + \beta_3 = 0$ in words something like "does talent matter for women?".  Dummy data for R:  n = 1e4 set.seed(6) df <- data.frame(gets.job = sample(0:1, size = n, replace = TRUE),                  talent   = sample(0:1, size = n, replace = TRUE),                  woman    = sample(0:1, size = n, replace = TRUE))  ols.m <- lm(gets.job ~ talent*woman, data = df)


Are there non-trivial solutions $f:\Bbb R\to\Bbb R$ of the following "differential equation"?   $$f'(x)=f(x+1).$$  I consider $f(x)=0$ as trivial solution. I tried to express $f$ as a power series, i.e. $f(x)=\sum_n a_n/n!\cdot x^n$. This brought me to the following identity for the coefficients:  $$a_{n+1}=\sum_{k=0}^\infty \frac {a_{k+n}}{k!}.$$  This does not really help, as the right side contains infinitely many coefficients itself. And infinitely many must be non-zero. I expect that a possible solution looks something like this:


Can iMac 2017 5K 27' support 3 external monitors?

Does anyone know if the 2017 5K 27' iMac can support 3 external monitors? Mine is with Radeon Pro 580 8GB graphics, and can't make it work with 3 external monitors. Spec:  Retina 5K, 27-inch, 2017 3.8 GHz Quad-Core Intel Core i5 64 GB 2400 MHz DDR4 Radeon Pro 580 8 GB  My setup:  2 x 1080p 24' HP monitors connected with hdmi cables to a thunderbolt 3 hub which is connected to 1 of the 2 thunderbolt port in my iMac 1x LG ultrawide 29 connected with a USB C to HDMI cable to the other thunderbolt 3 port  The hub, cables and monitors are all working fine. However the 3 external monitors can't be used simultaneously, only 2 can be supported each time. Tried to disconnect and reconnect all the monitors with different orders, the last one (LG or HP) will always show "No Signal". Is it because the iMac 2017 can only support up to 2 external monitors due to hardware / graphic limitation? Is there any configuration I can do to make it work? Regards.


I have two input type time. 1. time of entry 2. time of exit  Example 1:  Start: 00:00 end: 01:30 result: 1.5  Example 2 :  Start: 14:00 end: 00:00 result: 10  How to create an algorithm that calculates how many employees were at work? This number will be multiplied by the rate he earns. e.g. hours * rate (1.5 * 15)


How to discover the $F = m\cdot a$ equation from scratch?

Is there a paper or a book that conceptually 'discover' the Newton's famous formula?  I've been thinking about this equation, and I really don't know it for sure.  Did Newton empirically noticed that when we apply an acceleration to a body, then the accelerationon the body that has contact with it, will be proportional either to the mass or to the acceleration? Then, he simply called it 'force'?  OMG i'm so confused :c I can understand differential equations, integrals, and so, but I can't understand, from scratch, how to build up Newton's laws in my mind. I need good papers or books.


How to set Outlook 2010 to use signatures outside of the default signature folder?

With Outlook before the 2010 version, it was possible to specify any path for the signatures. With Outlook 2010, the only way is to use those stored into C:\Documents and Setting\UserName\Local Settings\Application Datas\Microsoft\Signature\    I'd like to point the signatures to a network share. Allowing us to modify the signatures into the share, instead of login on every computers each time we are asked to modify them (and this is quite often because the signatures contain logos about current events).  We currently use a script to copy the signatures from the share to the local disk when users login.


Will I be able to unlock Panna City Medicines now that the decoration special is finished?

I experienced the reset bug several times and my decorated levels were stripped (including when I had about 29 levels done ..so close!!!) so I was unable to unlock panna city meds.   Does anyone know if it will be possible to unlock this level some other way? I have special boba fett, but no level to match him with :,(


What effect does a light ray cause on an electron to make it excited. How a electron absorb energy?


Just loaded Ubuntu on an older PC and it seems to be running very slow and “choppy”.   I am running ubuntu 14.04 LTS on my 2003 Compaq Presario S4000NX.    RAM = 993MB Processor = Intel Celeron 2.40GHz Graphics = on board Intel 845Gx86/MMX/SSE2 OS = 32bit Hard Disk = 156GB   Am I under powered for this version? Would I be better off trying to install a graphics card or using a different version of Linix? I appreciate any suggestions.


Performing multiple operations on same record in same transaction

I am trying to do three operation using same record.  First Operation: Set ContentDocument isArchived field to false.  Second Operation: Grab contentdocument by calling  REST API Endpoint.  Third Operation: Set ContentDocument isArchived field to true.  When I ran the logic by clicking on a button, isArchive was set to false but then got message, "you have uncommitted work pending. please commit or rollback before calling out". Also isArchive being false was also persisted in database. So, I had to manually set isArchived to true again. I tried to use savepoint and rollback but it gave me the same error.  Map<Id, ContentDocument> docMap = new Map<Id, ContentDocument>(); Savepoint sp; List<ContentDocument> contDocs = new List<ContentDocument>(); public void doOperations() {     operation1();     operation3(); //operation2() called from operation3() }   void operation1(){ //sp = Database.setSavepoint(); ContentDocument doc= [select id,IsArchived from ContentDocument where id = docMap.get(Id);     if(doc.isArchived == true) {         doc.isArchived = false;             update doc;         contDocs.add(doc);     } }  void operation2(Id contentId) {     //call restendpoint and retrieve contentDocument }  void operation3(){     operation2();   // Database.rollback(sp);      for(integer i=0; i<contDocs.size(); i++){         contDocs[0].isArchived = true;         contDocs[1].isArchived = true;     }      update contDocs; }   The doOperations is action method called from visualforce page. Is it possible to run all operations when a user clicks on a button.  I used rollbacks as well but could not solve the problem. Rollback and savepoint in above code is commented but even without commenting, could not resolve issue.  Edit: I know there are other question like this but i want to perform every operation synchronously. I cannot use future methods here.  Any idea/help on this.


Do I have the possibility to visit all the Schengen countries with the Visa Type D?

Currently I'm in Italy for an exchange semester.  I have received a study visa for 6 months.  My passport is from Senegal.  The visa is type D, and on the visa it says that it is valid for Italy.  So, after my exams I would like to go to several Schengen countries for a small vacation.  Therefore I wonder if it's possible with the type of visa I have. Original text in French:  Ai-je la possibilité de visiter tous les pays de l'espace schengen avec le visa type D Au fait actuellement je me trouve en Italie pour un echange de semestre. J'ai reçu un visa d'étude de 6 mois depuis le Senegal. Le visa il est de type D, et sur le visa on a preci qu'il est valable pour Italie. Alors apres les examens je voudrais aller dans quelques pays de l'espace schengen pour passer de petites vacances. Ainsi je demandes si c'est possible avec le type de visa que j'ai.


Who was in operational command of Thanos's ship?

In Avengers: Endgame      Thanos and his spaceship jump into the future and fight the Avengers.   Towards the end of the battle the ship's cannons rotate upwards and begin firing at the approaching       Captain Marvel.   This was a direct contradiction of the order Thanos himself gave when he commanded the ship to fire at the ground, regardless of whether he was hitting his own troops or not.  Clearly someone on board the ship had the authority to ignore the order and decide to fire somewhere else instead.  Who was it?  Presumably some information exists in the MCU about who is in charge of the ship when Thanos isn't on board.


I have looked on the internet and no one can tell me why  needs eleven dimensions?


Are any of these collective nouns hoaxes?

While some of these are unquestionably used (a clowder of cats, a pack of dogs), many just surprise me. For example “a cackle of hyenas”, “a memory of elephants”... For the latter I found a confirming article, namely  one.  Edit: I realise the impracticality of going through each word in the list. That’s why I reworded to “any” almost immediately. I expected that native speakers would quickly recognise at least one construction, for instance “a cackle of hyenas”, as a hoax. Although I have been an avid reader of English prose for decades, I had no idea about the origins of venery and that it was actually meant to be funny!


Applications I download stay in Downloads, unlike software installed via APT. How do I correctly install downloaded applications?

I'm having some troubles installing applications, e.g. jdk, anaconda, IDE and everything else in my Ubuntu.  After I download these programs from the website in tar.gz format, when I extract these files, they are still in the Downloads directory.  Some of the files downloaded from Ubuntu Software or apt-get are automatically installed and well distributed in directories owned by root, not my user, e.g. npm downloaded from apt-get is in /usr/bin/.  But if I download just like in Windows, directly through the official site (like Oracle, JetBrains, Anaconda) they remain in the Downloads directory even after I extract and install.  How can I download applications on system-level (or root-level, not user) and make them properly-distributed?


How build and run a java project with maven en .jar

I wouldlike execute my javaproject with "java crypter-v1.jar" but i have "Error: Could not find or load main class Crypter-V1.jar"


"At the metro station" or "in the metro station"

Which preposition should I use for metro station at or in?      "I was today at the metro station"      "I was today in the metro station"   As far as I know normally metro stations are mostly deep underground and I'm not sure if I'm in or at.


I'm currently about to embark on redeveloping my home office.  We have a room with a small alcove and want to mount a desk top inside it. The approx size is 220cm x 80cm   We can source the wood we want no problem and are considering a hard wood with a nice finish that is around  8cm thick (2inches)  I want the desk to be as free floating as possible with the obvious exception of mounting at the rear and sides into the wall.  The left side wall is plaster into brick, the rear and right side wall are plasterboard with cavity behind .  My question is what is the best way to mount the desk without having to put in a strengthening leg in the centre?  Thanks for your help :)


How can I downgrade Safari 6 to 5 in Mountain Lion?

Is it possible to downgrade Safari 6 to 5 in Mountain Lion?  I tried to install 5.1.7 but it says it only works with OS X 10.7.  Is there any workaround I can try?


Evaluate $\int \frac{\sqrt{\sin^4x+\cos^4x}}{\sin^3x\cos x}dx$

$$\int \dfrac{\sqrt{\sin^4x+\cos^4x}}{\sin^3x\cos x}$$  My multiple attempts are as follows:-  Attempt $1$: $$\int \dfrac{\sqrt{1-2\sin^2x\cos^2x}\cdot\sin x}{\sin^4x\cos x}dx$$  $$\cos x=t$$ $$-\sin x=\dfrac{dt}{dx}$$  $$\int -\dfrac{\sqrt{1-2t^2(1-t^2)}}{t(1-t^2)^2}dt$$ $$\int -\dfrac{\sqrt{2t^4+1-2t^2}}{t(1+t^4-2t^2)}dt$$  $$\int -\dfrac{\sqrt{2t^2+\dfrac{1}{t^2}-2}}{1+t^4-2t^2}dt$$ $$\int -\dfrac{\sqrt{2t^2+\dfrac{1}{t^2}-2}}{\left(\dfrac{1}{t^2}+t^2-2\right)t^2}dt$$ $$\int -\dfrac{\sqrt{\dfrac{2}{t^2}+\dfrac{1}{t^6}-\dfrac{2}{t^4}}}{\left(\dfrac{1}{t^2}+t^2-2\right)}dt$$  Not finding the way to proceed from here.  Attempt $2$:  $$\int \dfrac{\sqrt{\tan^4x+1}\cos x}{\sin^3 x}dx$$ $$\int \dfrac{\sqrt{\tan^4x+1}}{\tan^3 x\cos^2x}dx$$ $$\tan x=t$$ $$\int \dfrac{\sqrt{t^4+1}}{t^3}dt$$  $$t=\sqrt{\tan\theta}$$  $$\dfrac{dt}{d\theta}=\dfrac{1}{2\sqrt{\tan\theta}}\sec^2\theta$$  $$\int \dfrac{\sec\theta\sec^2\theta}{2\tan^2\theta}d\theta$$ $$\int \dfrac{\sec\theta}{2\sin^2\theta}d\theta$$ $$\int \dfrac{\cos\theta}{2\sin^2\theta\cos^2\theta}d\theta$$ $$y=\sin\theta$$ $$\int \dfrac{dy}{2y^2(1-y^2)}$$ $$-\dfrac{1}{2}\cdot\int\dfrac{y^2-(y^2-1)}{y^2(y^2-1)}dy$$  $$-\dfrac{1}{2}\cdot\left(\dfrac{1}{2}\cdot\ln\left|\dfrac{y-1}{y+1}\right|+\dfrac{1}{y}\right)+C$$  $$-\dfrac{1}{4}\cdot\ln\left|\dfrac{\sin\theta-1}{\sin\theta+1}\right|-\dfrac{1}{2\sin\theta}+C$$  $$-\dfrac{1}{4}\cdot\ln\left|\dfrac{t^2-\sqrt{1+t^4}}{t^2+\sqrt{1+t^4}}\right|-\dfrac{\sqrt{1+t^4}}{2t^2}+C$$  $$-\dfrac{1}{4}\cdot\ln\left|\dfrac{\tan^2x-\sqrt{1+\tan^4x}}{\tan^2x+\sqrt{1+\tan^4x}}\right|-\dfrac{\sqrt{1+\tan^4x}}{2\tan^2x}+C$$  $$-\dfrac{1}{4}\cdot\ln\left|\dfrac{1-\sqrt{\cot^4x+1}}{1+\sqrt{\cot^4x+1}}\right|-\dfrac{\sqrt{1+\cot^4x}}{2}+C$$  But real answer is $-\dfrac{\mathrm{cosec}x}{2}-\dfrac{1}{4}\cdot\ln\left|\dfrac{\mathrm{cosec}x-1}{\mathrm{cosec}x+1}\right|+C$  What am I missing here?


How to deal with my fear of large audiences?

I am having problems facing audiences. During my primary and secondary school period I had inferiority complexes due to my size. Therefore I always skipped and ran from debates, but now I graduated with a good grade from university. I am a teacher now and still have this phobia of facing crowds. No matter how I prepare, whenever I stand in front of the crowd, my voice will be shaking. I really need your advice because I tried every method, but they are not working and it's depressing.


Would a compass with unmagnetized needle work?

We know that the needle that is used in a compass is a permanently magnetized ferromagnetic material and commonly steel is used.  If we used an unmagnetized iron needle instead, would it still align with Earth's magnetic field lines? If yes, how?


If we take a square and identify opposite sides, we get a torus. If we change the direction of one pair of sides we get the Klein bottle. If we change the direction of both sides, we get first a Möbius strip, then when I tried to glue the opposite sides I got a sphere with a singularity (ie the band is twisted into a point), is this process allowed, ie is it a topological sphere, is it possible to glue this together without a singularity if I had some extra spatial dimensions?  And given an $2n$-gon of sides $a_1$ to $a_{2n}$, which identifications of sides (pairwise and with $4$ possible directions), result in a smooth compact manifold, is there some rule to determine which manifold, and are all identifications allowed? How many diemsnions are needed for a smooth gluing process?


Conditional `if` with command that doesn't respond in else

I have the following command line, which should return the value 1 in case of, by means of nc, check communication with the IP and Port in question: /bin/nc -z 10.102.10.22 10003 > /dev/null && if [ $? -eq 0 ]; then echo 1; else echo 0; fi  The result is satisfactory and I get the value 1. But when there is no communication with the Port or IP, the command is left "waiting", without getting value of any kind. What would be the correct way to return the value 0 (the else statement) after a specific time has passed (e.g. 10 seconds). The results of this command are monitored every short time to draw a communications graph, so it is interesting to know when it is 0.


How to number items of foreach loop in php?

I am using this to create a mp3 list.  $mp3 = glob($directory . '*.mp3'); //print each file name foreach($mp3 as $mp3) {    echo '
                 	                 '. str_replace('(BDalbum.com).mp3','',basename($mp3)) .'	                 '. $_GET['s'] .'	                 '. $_GET['a'] .'	                 '. $_GET['a'] .'
 '; }   I want to add number with every item of the list like, first one: 1, second one:2 etc. how can I do it?


Once it is compiled, is there a difference between:  delegate { x = 0; }   and  () => { x = 0 }   ?


Required Inputs on @RestResource(URLMapping) httpgetResponse

can someone provide any Idea on below requriement: my requirment is : We received  JSON data ( complex have Tree structured more than 300 values) , Based on JSON data , need to generate Response . For example : workbench --> RestExplorer - >  / services/apex/apexRest/Id = 000000000 Then i need to generate Response as Below : caseInfo -- PartyId : 00000 -- ProductType : ABc --Product : abc Arrangement --arrangemetn Number :9999 --isseleccted :Yes --totalnumberrecords : 20 How can i achive this functionality ...Pls provide any sample data or any references Thanks


Obtaining travel insurance without permanent residency

I am looking to get full comprehensive travel (+ medical) insurance for my upcoming trip to Kenya. I have been looking around and comparing the various insurance companies   but I keep running into the same problem; each provider requires a permanent residency.  I have been a full-time traveler for almost two years and I do not have any permanent residency or address.  I am a Dutch citizen but I gave up my residency there last year. After Kenya I'm moving to Austria but I am not yet a resident there. I have also lived in Ireland for over a decade so I'm entitled to Irish citizenship (my mother is also Irish) but again, I don't have an address there and so do not have residency there either.   How do I go about obtaining travel insurance without a permanent residency?   Perhaps there is an insurance company specifically aimed at people like me?


Transfering already installed steam games onto another drive

Ok so I've seen the other questions about installing games onto another drive(SSD) and I've already done that properly for any new game that I have been getting.  However I want to know if there is a proper way to transfer games from my old drive over to the new drive without having to uninstall and then re-download them.  I already tried copying the folders over but all that does is make steam not know where the games are anymore and I'm not sure how to change the location that it looks for a particular game once it is already installed on my C drive.  Thank you!


Could Ubuntu touch work on any android tablet? or just Galaxy and Nexus?

Is it expected a fail, attempting to install Ubuntu Touch on an Android Tablet other than Galaxy or Nexus?  Thanks


"We just need to rename" or "We need just to rename"

I want to say that just in case we want to rename something (in programming) we should do something. Which of the sentences is correct?        In case we need just to rename the message...   In case we just need to rename the message...   In case we need to just rename the message...      I asked some colleagues but we couldn't agree which is the correct answer for this scenario where I want to emphasize that just in case of renaming we should do something.