I've read a variety of answers on this topic and as far as I can see, the consensus is that multivariate regression is different from multiple, individual linear regressions. I also understand that in multivariate regression, the results are estimated simultaneously, which in principle could result in different outcomes.  However, I believe I am missing something in my understanding because I can't reproduce an example where they produce different results.  For example, using R syntax, 3 regressions with correlated errors  error <- rnorm(100,0,1)  x <- rnorm(100,0,1)  y <- rnorm(100,0,1)  z1 <- 1*x + 2*y + error  z2 <- 1.5*x + 0.5*y + error  z3 <- 0.8*x + 1*y + error  Result:  lm(cbind(z1, z2, z3) ~ x + y)  gives the exact same results as:  lm(z1 ~ x + y) lm(z2 ~ x + y) lm(z3 ~ x + y)  The results here are the same for both methods and I cant think of an example where the results wouldn't be the same.  Simply, could you give an example where multivariate regression produces different results to multiple, individual regressions?

I just browsed through this wonderful book: . The irony is, I am still not able to understand the motivation for using multivariate (regression) models instead of separate univariate (regression) models. I went through stats.statexchange posts  and  that explain (a) difference between multiple and multivariate regression and (b) interpretation of multivariate regression results, but I am not able to tweak out the use of multivariate statistical models from all the information I get online about them.   My questions are:   Why do we need multivariate regression? What is the advantage of considering outcomes simultaneously rather than individually, in order to draw inferences. When to use multivariate models and when to use multiple univariate models (for multiple outcomes).  Take an example given in the  with three outcomes: locus of control, self-concept, and motivation. With respect to 1. and 2., can we compare the analysis when we do three univariate multiple regression versus one multivariate multiple regression? How to justify one over another? I haven't come across many scholarly papers that utilize multivariate statistical models. Is this because of the multivariate normality assumption, the complexity of model fitting/interpretation or any other specific reason?


How can I open a folder in a GFM (in a files window) from the terminal?  Thank you for your kind help.

I want to place a link/shortcut/launcher in my unity panel (ubuntu 12.10).   I followed  on handytutorial.com to create a custom launcher and drag it to the panel.  I just need to know which command do I have to input. Is this possible?


It is possible for the actions bar to span 2 lines.  It is particularly disorienting when the (1) and the action that it corresponds to are on different lines.  (in this case close)

If you go to  and are a 4k+ user on Anime.SE, you will see the following:        There is one reopen vote on this question, but the reopen vote count is displayed on a different line than the word "reopen". This is slightly silly, and would perhaps benefit from converting reopen (1) to reopen&nbsp;(1), and likewise for close and delete votes. (Or any other way of preventing a line break between the vote type and the vote count.)  A repro (the close link) from here on Meta:


I see this a lot, but end up ignoring it and letting him do his own thing in toplane. I'm just wondering though, if he proxy farms, won't he die a lot?  Isn't this going to benefit the enemy team?

yesterday I was playing and a Singed said that he would proxy farm. Didn't know what that means but I saw how he died a lot and feed top hard. He had a lot of minions, but..   What is proxy farming?   Proxy farm worth?   How can help this at our team?


This code works completely fine:   try {         sql = "SELECT * from profiles";          ResultSet res = stmt.executeQuery(sql);           while(res.next()) {             Profiles pProfile = new Profiles();              pProfile.setPersonalnummer(res.getInt(1));             pProfile.setAnwesenheit(res.getBoolean(2));             pProfile.setGrundDerAbwesenheit(res.getString(3));             pProfile.setRolle(res.getString(4));             pProfile.setWerk(res.getString(5));              pProfile.setMandant(res.getString(6));               pProfile.setFileName(res.getString(7));             allProfiles.add(pProfile);           }      } catch (SQLException e) {         e.printStackTrace();     }      return allProfiles;    Somehow this doesn't work:   public List<Projects> getAllProjects() {     try {         sql = "SELECT * from projects";          ResultSet res = stmt.executeQuery(sql);           while(res.next()) {             Projects pProject = new Projects();              pProject.setProjektname(res.getString(1));             pProject.setProjektid(res.getInt(2));             allProjects.add(pProject);         }      } catch (SQLException e) {         e.printStackTrace();     }      return allProjects;   }   I just copy-pasted it, changed the values, but somehow i get a "500 - Internal Server Error" when using the "getAllProjects()" method. The error message says that there is a Null Pointer Exception when executing "allProjects.add(pProject)".  Maybe somebody can help me? Thanks in advance!

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


In my project there is a section: favorite. On posts there is a button to add to favorites when you click on this button,the post ID put on the current user metadata. This is the button code: <span data-post-id="<?php the_ID(); ?>" data-user-id="<?php echo $current_user->ID; ?>" class="receipt_favorites">  Here is the Jquery for ajax: jQuery('.receipt_favorites').on('click',function(e){     var postID = jQuery(this).attr("data-post-id");     var userID = jQuery(this).attr("data-user-id");      data = {             'action': 'dicaprio_add_fav_recipe',             'postID': postID,             'userID': userID         }         jQuery.ajax({             type:'post',             url: object_url.url,             data: data,             cache: false,             success: function(data) {             }         });     e.preventDefault();  });  And here is php: add_action( 'wp_ajax_nopriv_dicaprio_add_fav_recipe', 'dicaprio_add_fav_recipe' ); add_action( 'wp_ajax_dicaprio_add_fav_recipe', 'dicaprio_add_fav_recipe' );  function dicaprio_add_fav_recipe() {  $postID = $_POST['postID']; $userID = $_POST['userID'];  $current_fav_list = get_user_meta( $userID, 'favorite_list_recept', true );  if ( is_array( $current_fav_list ) ) {     if ( in_array( $postID, $current_fav_list ) ) {      } else {         $current_fav_list[] = $postID;     } } else {     $current_fav_list   = array();     $current_fav_list[] = $postID; } update_usermeta( $userID, 'favorite_list_recept', $current_fav_list ); }  And this trinity does an excellent job, the post is added to favorites. But how can I remove it from favorites? It is my problem. I understand that for this I need to create a button like: <span data-post-id="<?php the_ID(); ?>" data-user-id="<?php echo $current_user->ID; ?>" class="remove__favore">  And use identical Jquery for ajax, only with activation by this class: remove__favore. But how about php function part? I thought it would be easier, but I couldn't write a function to delete favorite post. Can you tell me how to re-arrange the removal? I understand that for the pros this is a noob question, but I spent a lot of time and could not solve it.

Is there an easy way to delete an element from an array using PHP, such that foreach ($array) no longer includes that element?  I thought that setting it to null would do it, but apparently it does not work.


<meta charset="UTF-8">     <title>Indus</title>     <link rel="stylesheet" href="style.css">

What is the reason browsers do not correctly recognize:  <script src="foobar.js" /> <!-- self-closing script element -->   Only this is recognized:  <script src="foobar.js"></script>   Does this break the concept of XHTML support?  Note: This statement is correct at least for all IE (6-8 beta 2).


Is it "a nurse is someone who always helps sick people." or " a nurse is someone which always helps sick people."?

I'd like to know what option to use, specifically when referring to a species by its scientific name.


I am running a fully stock Android 4.4.4 Nexus 5, with Nova (Premium) Launcher. Since I first bought this device, I have heard, read, and been told that adding widgets to the lock screen is possible, as long as it is enabled in settings. Well, it is, but I can't figure out for the life of me how to actually add them.  Sorry if this is a Super Newb question, I've Googled, Binged, etc...  With no luck whatsoever. The only thing I seem to ever come across are instructions on how to enable them, which as I stated, I have done.

Just got a Nexus 5 running KitKat (what else?), but I cannot figure out how to add widgets to the lockscreen! On JB, swiping right from the left edge while showing lockscreen would display a "+" widget option. This is no longer the case. Are lockscreen widgets gone?!


I am trying to add a class to a variable inside one of my if else statements in a jquery function. I am getting an error x.addclass is not a function. I have tried placing the variable in () and without. It makes no difference. var ideal = document.getElementById( 'ideal_' + id ) var Search = document.getElementById('Search_' + id)  var parent = document.getElementById(+id) if(ideal){     parent.addClass('myclass') }  else if (Search){    parent.style.background='yellow' }  else {    parent.style.background='none' }

I have an element that already has a class: <div class="someclass">     <img ... id="image1" name="image1" /> </div>  Now, I want to create a JavaScript function that will add a class to the div (not replace, but add). How can I do that?


Michael was driving around flat-broke when he passed his first armored truck, so he shot out the tires and the driver, then jacked the truck and took off with rims ablaze.  After a near never-ending two star chase the truck is his, but he only has small arms and can't afford any grenades (stronger munitions are still level-locked).  So how could one break open an armored truck without adequate explosives?      There's the truck.  Michael is actually in the driver's seat, the shootout in the back is completely unrelated.

It's early days yet but in the spirit of open world one of the first things I've done in GTA V is hijack a security van. For the life of me I can't work out how to get the cash out of it.  I've tried a shotgun on the doors (the free bullshot one from the Special Edition), kicking, punching and machine gunning. I've also tried pretty much every button on the controller just in case it's something simple but so far my truck is impenetrable.  I'm currently left wondering if I'm just too early in the game to be able to open the security trucks although it was highlighted by the game as a "world event" (?) which would suggest not.  I would just save it for later but you can't store these vehicles in garages and I'd hate to just leave a truck full of money on the side of the road.  Can anyone shed light on how to get into these things?  Edit: Other things I've now tried:   Reversing into buildings at high(ish) speed. Driving off the big hill behind the Vinewood sign. Killed me but didn't appear to open the truck. Driving into the shallow lake at the north end of the storm drain. The truck was fully submerged and again didn't open.   For reference my most recent story mission is no.3 "Repossession".


Let $T:E \to E'$, be a linear operator where E is Banach. If $$(\forall x \in E):\;\langle T (x),x \rangle \geq 0$$  then show that T is bounded.

These two questions were in one question of a list of exercises.  Let $E$ be a Banach space and $T : E \longrightarrow E^*$ be linear.   If $\langle T(x),x \rangle \geq 0$ holds for all $x \in E$, then $T$ is continuous.  If $\langle T(x),y \rangle = \langle x ,T(y) \rangle$ holds for all $x, y \in E$, then $T$ is continuous.   I tried to expand it, as in the proof of the Cauchy-Schwarz inequality, to get a polynomial of degree $2$. Any solution or hint?


I noticed that the score of answers and questions, together with the "favorite question" star, that used to be on the left margin, is now shown on the top of each post. May I say that I can't see the advantage of this change? On the other hand, occupying the space between posts makes it more difficult to read more of them on the same screen. And requires more paper, in case one needs to print them. So why changing?

Starting from yesterday, the up-/downvote buttons seem to have moved from the left of a post towards above (in the middle) of the bodies of all questions and answers. Here is a screenprint of a sample (containing such buttons for both a question and an answer to it):    This happens on an iOS device (running 9.3.5), using various browsers and this in any SE site. No idea so far how it looks like in the most recent iOS version. Same for the (green) checkbox below those voting buttons (to mark an answer as accepted). Is this intended to be like this (IMO it looks ugly ... and a huge waste of available space), or is it rather some sort of CSS related issue that needs to be fixed? PS: Looking at the same page around the same time on a Win PC (using any of the common browsers) seems to work fine.


What is the benefit of getting a certain number of upvotes on comments? The tooltip says it means that the comment is "useful", but how is someone rewarded for posting useful comments?

Comments can now be upvoted and flagged. How do those features work? Do users get rep for their upvoted comments? Do upvoted comments have any effect on comment sorting? And can users see their own comment upvote number somewhere?  Related:  The  about comments


While Cortana is not available in my region, I can see the integrated web searchs in Windows 10's start search being super useful if they weren't Bing results.  I'd really like to be able to change the search engine used to DuckDuckGo, is there a way I can do that?

I want to use Google Chrome and Google search instead of Bing when I search in Windows 10.   Google Chrome is launched when I click on web, but it's Bing search. (My default search engine on Google and Edge is )    I haven't found how to configure that.  Someone can help me ?


import java.util.Scanner; public class guessGame {     public static void main(String[] args){         String ansOne;         String ansTwo;         String result="";          Scanner sc = new Scanner(System.in);         System.out.println("TWO QUESTIONS!");         System.out.println("Think of an object and I'll try to guess it");         System.out.println("Qusetion 1) Is it a animal,vegetable or mineral?  ");         ansOne = sc.next();         System.out.println("Qusetion 2) Is it bigger than a bread box");         ansTwo = sc.next();          if(ansOne == "animal" && ansTwo == "yes"){             result = "Squirrel";         }         else if( ansOne == "animal" && ansTwo == "no"){             result = "moose";         }             else if( ansOne == "Vegetable" && ansTwo == "Yes"){             result = "carrot";         }             else if( ansOne == "Vegetable" && ansTwo == "no"){             result = "Watermelon";         }             else if( ansOne == "mineral" && ansTwo == "Yes"){             result = "Paper clip";         }             else if( ansOne == "mineral" && ansTwo == "no"){             result = "Camero";         }         System.out.println("My guess is that You are thinking of a " +result);         System.out.println("I would ask you if I'm right,but I don't actually care...");       }   }   In the above code,I want to display the result. But its not been displayed, I am getting the following output:     TWO QUESTIONS!    Think of an object and I'll try to guess it    Qusetion 1) Is it a animal,vegetable or mineral?   vegetable    Qusetion 2) Is it bigger than a bread box    yes    My guess is that You are thinking of a   I would ask you if I'm right,but I don't actually care...

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


Does any one know the name of the novel, written before 1995, from one of the Dungeons and Dragons series, where a girl accidentally wishes to become strong at the start of the novel? I remember that the protagonist is surprised and dismayed to have become strong. I can't remember which realm this was in.

Long, long ago(ca mid-90's), back when I first got into reading books in digital form, I came across one that started quite promisingly. Unfortunately I was easily distracted back then, and have no recollection of name or author. But I think the opening is curious enough to have a chance at recognition.  It features a female protagonist that serves as a mage's assistant, the position of apprentice reserved for males. this annoys her. finding upon reporting to work one day that she has been reduced to transport mule for something the mage need transported, she is none too pleased when, upon mishandling a scroll or similar, she finds herself rather better built for swordplay than spellcasting. I also believe the case in this particular instance was that she somehow learned that her master was dead, leaving her with nothing to do but make the delivery. If anyone can tell me the name of the book, I'd be ridiculously grateful.


I'd like to use one computer for two people preferably on windows 7, without having to use another computer to connect to a virtual machine.

It's easy to have multiple user accounts on one computer and even switch between accounts without logging off. It is also possible to have more than one display connected to a single computer.  Is it possible to have one multi-core computer be used simultaneously by two users in their own accounts? Is there specific hardware required (to allow keyboard and mouse distinction for each user) and software configuration?  I know you can setup remote connections on windows that allow you to open and use a second user account without bothering the first user, but how about working locally on the same machine, essentially removing the network delay of remote desktops?  What OS supports this? Linux Ubuntu? Windows 7?


Say a train is moving in the positive $x$-direction at 100 meters per second with respect to the ground frame. Now let's say someone is pushing a large box in one of the cars of that train in the negative $x$-direction and is applying sufficient force to keep the box moving at a constant 5 meters per second in reference frame of the train car.    My intuition keeps telling me that this is like any other problem where the ground frame observer would witness the force being applied over a longer distance compared to the pusher/observer in the train frame, so work done is greater in ground frame,  but isn't the energy dissipated as heat independent of reference frame?   Furthermore, the ground observer would see the box moving forward at 95 meters per second as the train moves forward at 100 meters per second. Correct? The person pushing is doing work and the friction is doing equal work in the opposite direction. From the ground frame we'd see much more work done but how do we account for the dissipated energy such as heat and vibration? I feel like from the ground frame you'd see enough heat to start a fire.  I hope I have articulated my confusion clearly enough.

(This is not homework; a friend shared with me this puzzler and neither of us can figure it out.) Suppose you are in a plane traveling at velocity $v_1$ relative to the ground. The flight attendent pushes a cart of mass, say, $m$, accelerating it from rest to $v_2$, relative to the plane (so relative to the ground, its velocity goes from $v_1$ to $v_1+v_2$). From your perspective, the work done is then $$W = \Delta E = \dfrac{1}{2}mv_2^2$$ but from the perspective of the ground, the work done is $$W = \Delta E = \dfrac{1}{2}m(v_1+v_2)^2 - \dfrac{1}{2}mv_1^2 = \dfrac{1}{2}mv_2^2 + mv_1v_2.$$ Why are these quantities unequal?  I've seen some similar problems, like a body colliding with a wall in different reference frames, but I don't have the physics experience to tell if that question is analogous to this one. So, my apologies if this is a duplicate. :)


I have $X_1, X_2, .., X_n$ i.i.d. standard normal random variables. If $\overline{X}_n$: $$\overline{X}_n = \frac{X_1 + X_2 + .. + X_n}{n}$$ What is $Var(\overline{X}_n)$ in terms of n? The solution steps is: (1) As $X_1 + X_2 + .. + X_n \sim N(0,n)$ (2) We multiply by $1/n$ we get $N(0,1/n)$ (3) as scaling a random variable with a constant $a$ scales its variance by $a^2$. Therefore $\overline{X}_n$ is a gaussian random variable with mean $0$ and variance $1/n$ My problems:  Can you just multiply or add to a distribution? For example, is it right to do: $$N(0,1) * k = N(0,k)$$  $$or$$ $$N(0,1) + r = N(r,1+r)$$ Or it depends on the distribution? When can you and when you can't do this kind of computation with a distribution?  I understand that $Var(X*a) = a^2*Var(X)$. But I don't understand how this apply to (3).  I tried to do the next integral with wolframalpha, but it tells me "standard computation time exceeded" so I guess it's a fairly complex integral: $$ Var(\overline{X}_n)$$ $$= E[\overline{X}_n^2] - (E[\overline{X}_n])^2$$ $$= \displaystyle \int_{-\infty}^{\infty} x^2*\frac{1}{\sigma\sqrt{2\pi}}    \exp\left( -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{\!2}\,\right) dx - \left( \int_{-\infty}^{\infty} x*\frac{1}{\sigma\sqrt{2\pi}}    \exp\left( -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{\!2}\,\right)dx \right)^2$$

When you add two independent normal distributions the resulting distributions' variance is the sum of the variances i.e. it gets larger.  However, the Central Limit Theorem states that  when independent random variables are added, their properly normalized sum tends toward a normal distribution (informally a bell curve) even if the original variables themselves are not normally distributed.   and also says that as you add more variables the variance gets smaller. Why does the variance increase in one case but decrease in the other? Is it because in the CLT case the random variables come from the same underlying distribution?


Below is a code snippet of what I am trying to achieve in python. I am trying to spawn a new thread on a target function from some other function. This new thread waits on the subprocess and exits. Now I want to kill this thread whenever a request comes in. This should also kill the corresponding subprocess that it was executing.  class ABC(object):      def process_thread(self):         #call a child process using subprocess.call()      def main(self):        t = threading.Thread(target=self.process_thread)        t.start()  obj = ABC() obj.main()

Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?


Original post over here:   Basically, it seems that ever since I accidentally overloaded my filesystem (it's not currently and there don't seem to be any errors on disk), I've been seeing single-quotes, only when using ls in filenames that have spaces in them. I'm not sure why exactly this is happening. How would I go about changing it back to the way it was?

I just noticed that on one of my machines (running Debian Sid) whenever I type ls any file name with spaces has single quotes surrounding it. I immediately checked my aliases, only to find them intact. wyatt@debian630:~/testdir$ ls 'test 1.txt'  test1.txt wyatt@debian630:~/testdir$ alias alias ls='ls --color=auto' alias wget='wget --content-disposition' wyatt@debian630:~/testdir$   Another test, with files containing single quotes in their names (also answering a request by jimmij): wyatt@debian630:~/testdir$ ls 'test 1.txt'  test1.txt  'thishasasinglequotehere'\''.txt' wyatt@debian630:~/testdir$ touch "'test 1.txt'" wyatt@debian630:~/testdir$ ls ''\''test 1.txt'\'''  test1.txt 'test 1.txt'          'thishasasinglequotehere'\''.txt'   update with new coreutils-8.26 output (which is admittedly much less confusing, but still irritating to have by default). Thanks to Pádraig Brady for this printout: $ ls "'test 1.txt'"   test1.txt 'test 1.txt'    "thishasasinglequotehere'.txt"  $ ls -N 'test 1.txt'  test1.txt test 1.txt    thishasasinglequotehere'.txt  Why is this happening? How do I stop it properly? To be clear, I myself set ls to automatically color output. It just never put quotes around things before. I'm running bash and coreutils 8.25. Any way to fix this without a recompile? EDIT: Appears the coreutils developers  to break with the convention and make this the global default.  UPDATE - October 2017 - Debian Sid has re-enabled the shell escape quoting by default.  And at the bottom of the reply chain to the previous bug report, "the change was intentional and will remain."  I thought this had already been settled, but apparently it was just reverted so that the "stable" Debian branch could keep its "feature freeze" while getting the other fixes, etc. from the newer version. So that's a shame (in my opinion). UPDATE: April 2019: Just found a  that was caused by this change to ls. When you're confusing developers and generating false bug reports, I think it might be time to re-evaluate your changes. Update: Android toybox ls is now doing something similar to this but with backslashes instead of quotes. Using the -q option makes spaces render as 'question mark characters' (I have not checked what they are, since they're obviously not spaces), so the only fix I have found so far without rooting the device in question is to add this to a script and source it when launching a shell. This function makes ls use columns if in a terminal and otherwise print one-per-line, while tricking ls into printing spaces verbatim because it's running through a pipe. ls() {     # only way I can stop ls from escaping with backslashes     if [ -t 1 ]; then         /system/bin/ls -C $@ |cat     else         /system/bin/ls $@ |cat     fi }


How do I find the maximum value of $\int_0^1 (f(x))^3 dx$ given that  $\int_0^1 f(x) dx = 0$ $ -1 \leq f(x) \leq 1$ Domain of $f = \mathbb R$ $f$ is a real-valued function  For some values of $ x \space\epsilon \space (0,1)$, f(x) has to alternate between being positive and negative in a way that results in $(1)$. But given that $|f(x)| \leq 1$, for positive $f(x)$, $(f(x))^3$ has to be lesser than $f(x)$ and vice-versa. So even though positive values of $f(x)$ are diminished when cubed, the negative values, on the other hand, increase in value. How do I use all of these ideas to move towards a solution? The answers given in  seem out of reach to me. I am a stranger to Lebesgue integrals considering my calculus syllabus is restricted to high school calculus. I found this question in a practice question bank for a college entrance exam.

Find maximum possible value of $\int_{0}^{1}\left(f(x)\right)^3dx$ given that $-1\leq f(x)\leq 1$ and that $\int_{0}^{1}f(x)dx=0$.  My attempt:  I tried to guess such functions which could satisfy all the above conditions but could not arrive at any conclusion.


It is quite embarrassing, but I completely forgot the generally accepted short notation of writing $1$ if predicate $P$ is true, $0$ if predicate $P$ is false.  I'm pretty sure something like that exists because I saw a notation expressing this in a few presentations and it was mostly coherent.  The operator looked somewhat like this $\|P\|$, but it definitely did not share the symbol with norm.  I am asking because I plan to write something like $\sum_{i=1}^{n}\|P_i\|$ and I think that writing it with if-else notation would be ugly.

I'm looking for the correct way to define a sum of all elements in a set that fullfill a certain condition.  Example: $$ n(A) = \frac{\sum_{F \in A}{ \begin{cases} A_F\text{ is }\mathrm{NULL} & w_F\\ \text{else} & 0 \end{cases}}}{\sum_{F \in A}{w_F}} $$  A is to supposed to be a record with a number of fields $F$. $A_F$ is the value of field F in the record A. $w_F$ is a weight associated with the Field $F$. I want to calculate how much percent of the record is NULL weighted according to $w_F$.  What I want to know is if this below is a valid way to formulate this or if there is a better way.  If someone has some pointers on a more formal / mathematical notation for database/records I would also be very grateful.  Thanks!


I'm trying to calculate the shortest distance between a line (described as a pair of [lat, long]s) and a point (lat, long) accurately. I've read many Wikipedia pages, but I'm new to the topic. I've read  question, but I'm still confused, because they say that      Literally, a "straight line" will pass beneath the earth's surface.   while my line lies on the surface of the Earth. How can I calculate this?

How would I go about resolving this in C#?  I have a line segment (great circle distance) defined by two Lon-Lat pairs (call them points A and B). A third point somewhere on the Earth sphere.  The line segment closes the shortest distance between A and B. Third Lon-Lat pair is the point C.  How do I calculate the distance between the point C, and the closest point on the AB segment?  EDIT: In fact, I am looking for an algorithm to find the spherical distance between an arbitrary point C and a geodesic segment AB.  What i have for now:  public static float DistanceInKilometres(PointF A, PointF B, PointF C) {     var d13 = Haversine_KM_F(A, C);     var R = 3961.3;     var brng12 = Bearing(A, B);     var brng13 = Bearing(A, C);     var dXt = Math.Asin(Math.Sin(d13 / R) * Math.Sin(brng13 - brng12)) * R;     return (float)dXt; }  public static Double Bearing(PointF coordinate1, PointF coordinate2) {     var latitude1 = coordinate1.Y.ToRadian();     var latitude2 = coordinate2.Y.ToRadian();     var longitudeDifference = (coordinate2.X - coordinate1.X).ToRadian();     var y = Math.Sin(longitudeDifference) * Math.Cos(latitude2);     var x = Math.Cos(latitude1) * Math.Sin(latitude2) -     Math.Sin(latitude1) * Math.Cos(latitude2) * Math.Cos(longitudeDifference);     return (Math.Atan2(y, x).ToDegree() + 360) % 360; }  private static float ToRadian(this float angle) {     return (float)(Math.PI * angle / 180.0); }  private static float ToDegree(this float angle) {   return (float)(Math.PI * angle / 180.0); }


(10k, sorry), which is being discussed , has a bounty that ended "at 2011-12-14 17:06:44Z", but as of now (2011-12-15 16:30:00Z, near enough) "the grace period has ended".  Isn't the grace period 24 hours, so there's another 36 minutes to go before it's ended?

is a bit of an odd case.  The user placed a bounty on it, then engaged in a rollback war culminating with a lock. He then requested his account to be deleted. It was. The question, which was at -1 at the time, was automatically deleted along with the account. This should not happen since bounty questions ordinarily can be neither closed nor deleted.  Now the bounty languishes in a limbo state, its clock ticking away in futility, hoping against desperate hope that someone somewhere will rescue it. But no one hears its cries.    Cheer? No, I'm afraid not.


i have two SSDs 1 running on windows 10 and other Ubuntu 18.04 LTS. I would like to remove Ubuntu completely and use back as window storage.  How do i go about this?

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


I want to hide extensions on my webpage using the .htaccess file.  I have managed to do it by using this code;  RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]   So when I visit mysite.com/index it shows my index.php. That's fine but I want to block visitors from visiting mysite.com/index.php so it should be redirected to mysite.com/index  I think I have found a way to do that. However, I will be using querystrings on my webpage. There will be some pages which I will need to carry the variables via GET method.  Normally a link with an id variable is like this; index.php?id=xx  However, if I redirect /index.php to /index my variables will be gone. So I want the urls to seem like this when carrying a variable mysite.com/index?id=xx  The extension will be PHP always. But I want this system work in all pages with all variables. I am not sure how many pages and variables there will be so do I have to write a rule in htacces for each of them or can I define a general rule? So it will be like this  Examples: index.php?id=xx will be index?id=xx index.php?page=xx will be index?page=xx users.php?uid=xx will be users?uid=xx news.php?nid=xx will be news?nid=xx   This could probably be achieved using .htaccess file but I don't know, how can I do that.  P.S. Although I am pretty good at PHP, I don't know anything about creating a rule for htaccess file I just use the codes I find on the internet.


I've been writing some simple machine learning algorithms and looking at time-series data. In doing so, I have come across the use of feature scaling: rescaling and standardizing as they are referred to on .   For something like k-Nearest Neighbors, I imagine rescaling to be the best scaling to use so there's a completely level playing field between variables' influence. Is that true?   When would you apply standardizing to data instead? What are the advantage of standardizing and rescaling?

In some literature, I have read that a regression with multiple explanatory variables, if in different units, needed to be standardized.  (Standardizing consists in subtracting the mean and dividing by the standard deviation.)  In which other cases do I need to standardize my data?  Are there cases in which I should only center my data (i.e., without dividing by standard deviation)?


Find the value of $$\sum_{n=2}^{\infty}\log\left(1-\frac{1}{n^2}\right)$$   I tried expressing the sum like $\sum a_r-a_{r-1}$. $$\sum_{n=2}^{\infty}\log\left(1-\frac{1}{n^2}\right)=\sum_{n=2}^{\infty}\log\left[\left(1-\frac{1}{n}\right)\left(1+\frac{1}{n}\right)\right]=\sum_{n=2}^{\infty}\log\left(\frac{n-1}{n}\right)-\log\left(\frac{n}{n+1}\right)$$  I got stuck here. Is there any other simpler method?

So I have this problem for midterm reviews:  $$\sum_{n=2}^\infty \ln\left(1-\frac{1}{n^2}\right)=\text{ ?}$$  I know that you can find the series form of a natural log, as shown here:  $$\ln\left(1-\frac{1}{n^2}\right)=-\sum_{k=2}^\infty \left(\frac{1}{n^{4k}}\right)\left(\frac{1}{2k}\right) $$  But the above doesn't seem to help very much since it results in two summation notations mushed together. Is there a somewhat nontedious way to go about this? Thanks! All help appreciated.


i'm trying to install the package postgresql-server-dev-all but i'm getting this output from apt install:     Some packages could not be installed. This may mean that you have   requested an impossible situation or if you are using the unstable   distribution that some required packages have not yet been created or   been moved out of Incoming. The following information may help to   resolve the situation:      The following packages have unmet dependencies:    postgresql-server-dev-all : Depends: postgresql-server-dev-11 but it   is not going to be installed E: Unable to correct problems, you have   held broken packages.   by apt install postgresql-server-dev-11 I get the following:     The following packages have unmet dependencies:    postgresql-server-dev-11 : Depends: clang-7 but it is not going to be   installed                               Depends: libpq-dev (>= 11~~) but it is not going to be installed E: Unable to correct problems, you have held   broken packages.   And by apt install libpq-dev the following:     The following packages have unmet dependencies:  libpq-dev : Depends:   libpq5 (= 11.2-1) but 11.5-0ubuntu0.19.04.1 is to be installed E:   Unable to correct problems, you have held broken packages.   Of course I did already apt update and apt upgrade before that, and my Ubuntu version is the latest 19.04.  Are there inconsistencies in the repository that are responsibility of the Ubuntu team or can I still fix this manually?

How do you use terminal to enable Universe source? Or any those 4 from Software Sources: Main, Universe, Restricted, Multiverse Main is on by default and Restricted is on if durring Ubuntu installation i tick Enable Restricted Formats. Answer with line where version checked so it auto detects it. Like command I know for partner but that goes to Other Software tab sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"


In Java, I've noticed that 1.1+(2.2*(3.3+4.4)) results in 18.040000000000003, rather than 18.04. Is there a way to prevent this from happening?

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


I have some issue with the fonts in my document. When I insert some of my pdf figure, the font of the page where they are inserted is modified. I use pdflatex to compile and all my figures are in pdf format.  Do you have any idea how to avoid that my inserted pictures compromise the font of the page ?

When I run my LaTeX document through pdflatex, some of the pages (the ones where figures appear) have all the text bolded.  Why, and what can I do to make it stop?


I was just reading the responses to a question as to why RAW images look different in lightable and darkroom in Darktable (due to the in camera post processing taking place for JPG files) and I would like to know a little more about this conversion process. I thought the camera only compresses the image when it converts the RAW file to a JPG? But the process also involves manipulating the tones of the image using some algorithm whether I like it or not. Why does it do this? It looks better than the RAW file, why doesn't the RAW file look as good?  Thanks, TheCube

I've found that when you load a RAW image into an editing program such as Lightroom/Aperture, the image is usually worse than if you just took the image as JPEG. Now I understand that the camera does some magic during the JPEG conversion. But I'm trying to understand what that "magic" is.   If I'm looking to implement that "magic" myself on the desktop, what kind of settings should I be trying? I find that the RAW files have more extreme contrast. The dark areas for example are way darker than JPEG. Why is this? And what is the best way to fix this?


I have written a C program where I declared a function reverse(int i). When I compile and run the program, it runs fine despite passing two arguments like this reverse((i++, i)). Why doesn't this cause a syntax error? reverse expects one argument.    #include <stdio.h>     void reverse(int i);     int main()     {              reverse(1);       }     void reverse(int i)     {             if (i > 5)                     return ;             printf("%d ", i);              return reverse((i++, i));     }


Tell me please, how calculate this expression:  $$ \sqrt[3]{2 + \sqrt{5}} + \sqrt[3]{2 - \sqrt{5}} $$  The result should be a number.  I try this:  $$ \frac{\left(\sqrt[3]{2 + \sqrt{5}} + \sqrt[3]{2 - \sqrt{5}}\right)\left(\sqrt[3]{\left(2 + \sqrt{5}\right)^2} - \sqrt[3]{\left(2 + \sqrt{5}\right)\left(2 - \sqrt{5}\right)} + \sqrt[3]{\left(2 - \sqrt{5}\right)^2}\right)}{\left(\sqrt[3]{\left(2 + \sqrt{5}\right)^2} - \sqrt[3]{\left(2 + \sqrt{5}\right)\left(2 - \sqrt{5}\right)} + \sqrt[3]{\left(2 - \sqrt{5}\right)^2}\right)} = $$  $$ = \frac{2 + \sqrt{5} + 2 - \sqrt{5}}{\sqrt[3]{\left(2 + \sqrt{5}\right)^2} + 1 + \sqrt[3]{\left(2 - \sqrt{5}\right)^2}} $$  what next?

Why $\sqrt[3]{{2 + \sqrt 5 }} + \sqrt[3]{{2 - \sqrt 5 }}$ is a rational number?


I have set a new matcode environment in order to have some matlab code in my .tex file, using the matlab-prettifier package (combined with the listings package). However, I have a problem with the tilde symbol.     \documentclass{article}  \usepackage[english,greek]{babel} \usepackage[utf8]{inputenc} \usepackage{kerkis}  \usepackage{xcolor} \usepackage{listings} \makeatletter % Avoid the spurious error \AtBeginDocument{%     \expandafter\def\expandafter\originalTeX\expandafter{%         \expandafter\@tempcnta\number253\expandafter\relax\originalTeX}% } % apply the fix \addto\extrasgreek{%     \@tempcnta=128     \@whilenum\@tempcnta<253\do{%         \expandafter\babel@savevariable\expandafter{\expandafter\lccode\the\@tempcnta}%         \lccode\@tempcnta=\@tempcnta         \advance\@tempcnta\@ne     }% }  \usepackage{matlab-prettifier}   \lstnewenvironment{matcode}     {     \selectlanguage{english}      \fontfamily{cmr} \fontsize{8}{10}\selectfont     \lstset{      language=matlab-pretty,                 style=Matlab-editor,                 basicstyle = \ttfamily,                 keepspaces=true,                 escapechar=\#}     }     {     \normalsize     \selectlanguage{greek}     }      \begin{document}     \begin{matcode}     % This is a comment.     [~, a ]      \end{matcode}      \end{document}   If I use the kerkis.sty package, then the result is going to be this one, where I miss the tilde symbol (apparently the tilde symbol is not supported by kerkis):   Ignoring (by commenting) the kerkis.sty package, the result is going to be this one:   Although the tilde symbol is somewhat displaced, at least it is visible. As you can see, I tried to load the cmr font inside the matcode environment, but I had no luck with that. So my question is:     How can I load the cmr font inside my matcode environment, without commenting the command \usepackage{kerkis}?   Edit: In order to override this problem and make the tilde symbol appear, I used the escapechar # and I replaced the tilde symbol in my .tex file, with the command #\texttildelow#, but this is not a neat solution for sure.

How do I set the tilde (~) character correctly in LaTeX?  There’s a  on Stack Overflow, with a lot of answers. But dare I say it? They all suck:   \textasciitilde is too high, \texttildelow is too low. $\sim$ can be tweaked to look more or less acceptable: {\raise.17ex\hbox{$\scriptstyle\sim$}} – but even that is a hack and uses the wrong symbol.   The point is – the tilde character is definitely an existing glyph in any font I am tempted to use. How can I just access and typeset that character, please? Without resorting to some other, similar-looking glyph that first needs to be nudged into place using a cunning combination of font size and raised boxes?  There must be a possibility to access that glyph directly from the font definition.  To demonstrate, look at this screenshot which attempts simply to display a C++ destructor of a type T (~T):    Compare this with the symbol we get in the browser: ~ – that’s what I want.


This is similar but hopefully not repetitive with other questions answered here... I want to use a straight line decoration above a formula to denote the mean value over observations. My main problems with \overline is that it is too light. I've tried the \bm option but it only seems to work with \bar, not \overline.  It would also be great to slightly trim the \overline decoration as is done with the \overbar command,

How to get a \bar more thicker (0.8pt for example) than usual and fit all character?


So after reinstalling Miktex I can't use subfiles anymore. Anytime \subfile{insert file} is referenced, this error pops up  ! LaTeX Error: File `main.toc' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: toc) Enter file name: ! Emergency stop   This appears in both texmaker and texstudio, and I can compile my files fine on Overleaf, so I believe it's a Miktex issue. Reinstalled, same problem appears. If a table of content is not signified, the error turns into main.out not found, or .out or .aux for the most barebone of subfile usage example. The document compiles fine if \subfile{insert file} is removed. No idea what happened.

Everything worked fine before using TexLive for updating my packages three days ago. Now it is not possible anymore to use the package subfiles   Here are the MWE  The minimum Preamble.tex file  \documentclass{amsart} \usepackage{subfiles}   The MWE.tex file  \documentclass[MWE.tex]{subfiles} \begin{document} MWE \end{document}   When I compile the MWE file I get on the console  This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded >format=pdflatex)  restricted \write18 enabled. entering extended mode  (./MWE.tex  LaTeX2e <2020-02-02> patch level 5  L3 programming layer <2020-02-25> (/usr/local/texlive/2019/texmf-dist/tex/latex/subfiles/subfiles.cls  Document Class: subfiles 2020/02/14 v16 Multi-file projects (class)  Preamble taken from file `MWE.tex'  (/usr/local/texlive/2019/texmf-dist/tex/latex/tools/verbatim.sty)  (/usr/local/texlive/2019/texmf-dist/tex/latex/import/import.sty)  ! LaTeX Error: File `import.sty' not found.  Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty)  Enter file name:   I checked and the import.sty file is in the right directory, and everything worked fine before. Do you have any idea about what happened (apart from the fact that I should not upgrade stuff before the official releases of TexLive I suppose  ...)?


If we have an infinite set $|X|$, does $2^{|X|}=|X|^{|X|}$ hold in ZF? In the other words, is there a bijection between $\mathcal P(X)$ and $X^X$?  I understand that if we have well-order on $X$ then I can get $$2^{|X|} \le |X|^{|X|} \le 2^{|X\times X|} = 2^{|X|},$$ but this argument uses $|X\times X|=|X|$. (Which is true if I assume existence of a well-order on $X$, but this is not necessarily true in ZF.)  Am I correct in assuming that in ZF the above equality may fail? What would be a simple argument to show this?     I got interested in this after reading this in Noah Schweber's answer to:      And this can be simplified further: it turns out $\kappa^\kappa=2^\kappa$, always. Clearly we have $2^\kappa\le\kappa^\kappa$, and in the other direction $$\kappa^\kappa\le (2^\kappa)^\kappa=2^{\kappa\cdot\kappa}=2^\kappa.$$      By the way, the equality $\kappa^\kappa=2^\kappa$ can be proved in ZF alone, the key point being that Cantor-Bernstein doesn't need choice.   I was able to find similar argument in: ,  (In both cases the argument uses $\kappa\cdot\kappa=\kappa$ or $|A\times A|=|A|$.)  I had also look at Andreas Blass' answer to the related question . If I understood that answer correctly, $|\mathcal P(X)|=|X^X|$ can indeed fail in ZF. But maybe there is an easier argument if we are working with all functions (not just bijections).

Usually, the equality $\mathfrak{m}^\mathfrak{m} = 2^\mathfrak{m}$ for infinite cardinal $\mathfrak{m}$ is proved like that: $$ 2^\mathfrak{m} \leqslant \mathfrak{m}^\mathfrak{m} \leqslant (2^\mathfrak{m})^\mathfrak{m} = 2^{\mathfrak{m} \cdot \mathfrak{m}} = 2^\mathfrak{m} $$ The last step relies much on the axiom of choice, because the fact $\mathfrak{m}\cdot\mathfrak{m} = \mathfrak{m}$ does. Moreover,  states that in $\sf{ZF}$ this fact is equivalent to $\sf{AC}$.  Note, by a cardinal I mean an equipollence class of an arbitrary set, not necessarily admitting a well-ordering.  That has motivated my question: what can we say about relationship of the initial equality and the axiom of choice in pure $\sf{ZF}$?    To avoid question about definition of cardinals without $\sf{AC}$, we may consider the following statement instead:     For any infinite set $X$ exists a bijection $\; F \, \colon X^X \rightarrow 2^X$   where $X^X$ is the set of all functions from $X$ to $X$, $\; 2^X = \mathcal P(X)$ is the power set, and an infinite set is such that cannot be bijectively mapped onto a finite ordinal.


function foo(a) {   function a() {     return 8;   }   return a();   y = 9; } console.log(foo() + " " + y);   This gives an undefined error for variable y.  function foo(a) {   y = 9;    function a() {     return 8;   }   return a(); } console.log(foo() + " " + y);   This prints 8 9 in the browser console.  If we declare a variable without the var keyword than it becomes global variable.  Why first function does not follow the idea?

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I want to change the default comment form title_reply, label_submit ... just on my CPT without affecting the default comment form but I can't get it to work without affecting the default ones.  First I don't want to output the comment form if CPT and user isn't logged in, I'm doing this with this code:   // Don't output the comment form if CPT and user isn't logged in if ( 'myCPT' != get_post_type() || is_user_logged_in() ) {  comment_form(array('title_reply'=>'Got Something To Say:'));  }   Which is working fine, but I want also to check if CPT exists and  alter the default comment form if I'm inside that CPT.  Now the question will be how can I put this together ?  Thank you!

This is the code which is registering the function for rewrite_endpoints():   function wpa121567_rewrite_endpoints(){  add_rewrite_endpoint( 'comments', EP_PERMALINK );  add_rewrite_endpoint( 'stats', EP_PERMALINK );  }  add_action( 'init', 'wpa121567_rewrite_endpoints' );   NOTE  I don't know if this matters but I will write it.   I have single-CPT.php which is calling  /inc/post-format/single-CPT.php like this:      <?php while ( have_posts() ) : the_post(); ?>  <?php   get_template_part( 'inc/post-format/single-debate');      ...   This is the code which is checking if array key exists, which is  inside my /inc/post-format/single-cpt.php:   ?php if( array_key_exists( 'comments', $wp_query->query_vars ) ){  the_field('comments_section');   } elseif( array_key_exists( 'stats', $wp_query->query_vars ) ) {   the_field('stats_section');   } else { // the request is for the main post  }   ?>   This is my comments.php :
 <?php // If CPT and not logged in, display a message: if ( 'debate' == get_post_type() && ! is_user_logged_in() ) { echo '
You must be logged in to post a comment.' . '
';  echo do_shortcode("[upme_login]");   } ?>     <?php if ( have_comments() ) : ?>
              <?php                 printf( _n('%d comment', '%d comments', get_comments_number(), 'outbox' ),                     number_format_i18n( get_comments_number() ) );             ?>

              <?php                 wp_list_comments( array( 'callback' => 'outbox_comment' ) );             ?>
          <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through? If so, show navigation ?>
&nbsp;<?php echo get_previous_comments_link( __( 'Older Comments', 'outbox' ) ); ?>

<?php echo get_next_comments_link( __( 'Newer Comments', 'outbox' ) ); ?>&nbsp;
                  <?php endif; ?>      <?php endif; // have_comments() ?>      <?php         // If comments are closed and there are comments, let's leave a little note, shall we?         if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :     ?>
<?php _e( 'Comments are closed.', 'outbox' ); ?>
     <?php endif; ?>     <?php  // Don't output the comment form if CPT and user isn't logged in if ( 'debate' != get_post_type() || is_user_logged_in() ) {  comment_form(); }  ?>
 <?php } ?>    This is how the comments template is included  inside my single-CPT.php :  if ( comments_open()  )  comments_template( '', true );   I want to disable comments if if( array_key_exists( 'comments', $wp_query->query_vars ) ){  How can I do this?


<?php         $receiving_email_address = 'info@info.com';       $name = strip_tags(htmlspecialchars($_POST['name']));       $email_address = strip_tags(htmlspecialchars($_POST['email']));        // if( file_exists($php_email_form = '../assets/vendor/php-email-form/php-email-form.php' )) {       //   include( $php_email_form );       // } else {       //   die( 'Unable to load the "PHP Email Form" Library!');       // }        // $contact = new PHP_Email_Form;       // $contact->ajax = true;        // $contact->to = $receiving_email_address;       // $contact->from_name = $_POST['name'];       // $contact->from_email = $_POST['email'];       // $contact->subject = $_POST['subject'];      $to      = $receiving_email_address;     $subject = $_POST['subject'];     $message = $_POST['message'];      //$headers = 'From: {$_POST["name"]}' . "\r\n" .      //   'Reply-To: {$_POST["email"]}' . "\r\n" .        // 'X-Mailer: PHP/' . phpversion();     $headers = "Content-Type: text/plain; charset=utf-8" . "\r\n";     $headers .= "MIME-Version: 1.0" . "\r\n";     $headers .= "Content-Transfer-Encoding: base64" . "\r\n";     $headers .= "Date: ".date("r (T)") . "\r\n";     $headers .= "From: info.com <info@info.com>" . "\r\n";     $headers .= "Reply-To: $name <$email_address>";       $result=mail($to, $subject, $message, $headers);       if($result==1)       echo "OK";       else         echo "Meddelandet har inte skickats.  <br>Kontrollera din internetanslutning och skicka igen.";       // Uncomment below code if you want to use SMTP to send emails. You need to enter your correct SMTP credentials       /*       $contact->smtp = array(         'host' => 'example.com',         'username' => 'example',         'password' => 'pass',         'port' => '587'       );       */        // $contact->add_message( $_POST['name'], 'From');       // $contact->add_message( $_POST['email'], 'Email');       // $contact->add_message( $_POST['message'], 'Message', 10);        // echo $contact->send();     ?>     This is the email I get and it should be formated like:  Name-Subject-email-message  I tried some methods but wasnt successful hopefully we can  fix this soons. Thank you all in advance!  I tried some methods but wasnt successful hopefully we can  fix this soons. Thank you all in advance!  I tried some methods but wasnt successful hopefully we can  fix this soons. Thank you all in advance!

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I am having trouble initializing an array of objects. I keep getting an error(NullPointerException), I have tried a few different approaches to initialization. I am fairly new to java ( started from c++). I was thinking maybe I need to create a constructor for the class Customer, but that didn't work when I tried it. Any ideas? Thanks in advance. (these are only snippets of my code)  Update: Ok so I replaced the declaration and I am still getting nullpointerexception errors on a few lines, here is the updated code. Am I initializing the privates of the Customer class wrong? Thanks again for the help people, much appreciated.   Update 2: So after some tinkering, I created a for loop that individually initializes each index of the class object array. Thanks a bunch!  public static class ATM{     private double funds = 100;     private int serial;     private String location = "UNKNOWN", bank_name;     private int succ_with = 0, fail_with =0;     private Customer[] customers = new Customer[10];///////updated here     public void custSet(String u, String b, int p, double bal, Customer[] customer, int index)     {         customer[index].user_name = u;         customer[index].bank_name = b;//second exception          customer[index].balance = bal;         customer[index].pin = p;     }     public void populateCust()     {          custSet("Alice","OtterUnion",1234,5000.0,customers,0);//3rd exception         custSet("Tom","OtterUnion",2000,200.0,customers,1);         custSet("Monica","OtterUnion",3000,50.0,customers,2);         custSet("Michael", "OtterUnion",7777,0.00,customers,3);         custSet("John","OtterUnion",8000,500.00,customers,4);         custSet("Jane","OtterUnion",2222,500.00,customers,5);         custSet("Robert","BOA",2323,200.00,customers,6);         custSet("Owen","BOA",4455,50.00,customers,7);         custSet("Chris","BOA",8787,10.00,customers,8);         custSet("Rebecca","BOA",8080,555.55, customers,9);     }      } public static class Customer{     private String user_name, bank_name;     private int pin;//(first exception complaining about this, but when i      // change it to public the error goes away, so Ill just need to make a setter     private double balance; }

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


txt = "The rain in Spain '69'" x = re.split(r'\W*', txt) print(x)   ['', 'T', 'h', 'e', '', 'r', 'a', 'i', 'n', '', 'i', 'n', '', 'S', 'p', 'a', 'i', 'n', '', '6', '9', '', '']  txt = "The rain in Spain '69'" x = re.split(r'\W+', txt) print(x)   ['The', 'rain', 'in', 'Spain', '69', '']  The documentation (python.org):     Another repeating metacharacter is +, which matches one or more times. Pay careful attention to the difference between * and +; * matches zero or more times, so whatever’s being repeated may not be present at all, while + requires at least one occurrence. To use a similar example, ca+t will match 'cat' (1 'a'), 'caaat' (3 'a's), but won’t match 'ct'.   Please explain this difference.

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


I need to do a factory reset of my phone. I have the Alcatel one touch fierce 2 How and where do I back up my apps and data.

I know I'm asking for the close-to-impossible -- as a real full-backup certainly requires root permissions. But still there are many folks around not wanting to root their devices -- afraid of voiding their warranties or bricking their devices, or just not having their devices supported by any rooting method.  I also know there were a lot of questions asked already on this topic, and I checked all of them having the backup tag -- none covers the entire topic, all just have pieces, and especially people new to Android (but other non-power-users as well) would have a hard time figuring out the best way.  So I want a detailed canonical answer to the question:  Not involving root-solutions, how to achieve a backup as close as possible to a full backup?  Please do not give simple one-liner answers like "Use app xyz [full-stop]." If mentioning an app (and I doubt a single app would be the answer here), include what parts are covered by it -- as well as ideas on how to fill the gaps it leaves. (And to make it absolutely clear: I know the first thing coming to mind is Titanium Backup -- I use it myself, but this does not apply here: This question is strictly about methods for non-rooted devices!) Moreover, the answer should be as generic as possible in terms of applying to a wide range of devices (i.e. it should not be restricted to one device or manufacturer).  I already mentioned having investigated all questions here tagged backup. These will certainly be helpful providing details for answers here, so I will list up the topmost ones concerning my question:            All these provide some details for my question (so feel free to get inspired by them) -- but I feel there are still details missing. Also it would be helpful to have a summary -- say, an answer including the full description of "the maximum possible".  A last criterium: While I'd consider cloud-based solutions legit, I'd favour local solutions. If you can provide both: all the better. But some people value privacy quite high (I'm one of them), and thus would not trust their data to some cloud service.    Thanks to Ryan, we now have a solution for a really complete backup of all apps and their data -- which I didn't dare to hope for! The only disadvantage: His solution only works for less than 10% of all Android users; namely those whose devices are running at least with Android 4.x.  So again, I ask the close-to-impossible: Any solutions applicable at least on Gingerbread (2.3.x) or, better, even Froyo (2.2.x) -- so they cover the majority of current devices? These solutions may involve multiple tools (try to keep it as simple as possible though; think of your mother to follow your instructions ;)  And keep in mind: NO ROOT!    To further motivate high-quality answers (and hopefully avoid low-quality ones), I will be a harsh one here: As I rarely do, I will down-vote answers not fitting the mentioned criteria on one end -- but on the other end, I will setup a bounty for the best answer (which cannot be done immediately, but earliest after 2 days).


I need to write vertical text. I just want the text to look like one below other.  Required Output:     A      P      P      L      E   I cannot use rotate property. And I dont want to modify my html. What could be the best way? Please help!  Thanks!

Does anyone know how to make text align top-to-bottom in a div.  SO won't even let me demonstrate it . . . I just want the letters to stack on top of each other in a vertical line down the page like the stories of a building. Was hoping I didn't need to do it with an image.


I want to execute an exe file in script which requires command like this in commandline C:\pathtotool.exe -2 c:\data .  how can  i do this in python in windows. Os.system does not work

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?


First timer here and a Ubuntu noob, hope I can break down my question clearly. So currently have 2 setups:   PC with Ubuntu 18.04, with 2 NTFS drives mounted back when I was using Windows Raspberry pi 4. Installed Ubuntu Mate through Ubuntu server 19.10   To mount the NTFS folder on my PC, I used the following:   edit /etc/fstab UUID=XXXXXX /media/windows/drive ntfs-3g fmask=000,dmask=000,uid=1000,gid=1000 0 0   I then proceeded to go to the mounted folder, right click, and use the 'Local Network Share' and enable Guest Access for simplicity.  Next, I went to my rpi4 and tried to access the folder via file manager. It opened just fine. When I dragged the directory to terminal, the path is something like this: smb://drelocallinux/._media  Now, I'm at lost in how I can auto-mount this onto my local folder in Rpi4. My goal is to eventually map this folder to a docker container, but that's later down the road.   Please advise, thanks!

right now   I have setup /etc/fstab like this:  //192.168.5.167/H /mnt/ssd cifs credentials=/root/.smbreds,noauto,x- systemd.automount 0 0   I want to set it up like first network should be connected and then fstab mount should get mounted.


Some SE Philosophy users are using numbers for their user name. It is difficult to identify them. Now the number has become a 7 digit number [e.g. user1234567]. So, isn't it good if they use some names instead of a 7 digit number?  We can't distinguish user1234567 from user1235467 and remember them quickly.  Is there any logical alternative for selecting username by default to solve this issue?

When a user signs up , their username is something along the lines of "user########"  Granted, in the welcome email it does say something along the lines of "Head over to your user account page to chose a display name!", however only a few people actually read that email.  I'm not saying we should restrict people from changing their display name again in the future - Everyone would still be able to do so. It's just that when you sign up you choose an initial display name that will be what your first display name is instead of "user########".


I've tried plotting the graph of the function in Desmos and WolframAlpha, and true to the limit, the function tends to 1.  I would assume by the product rule of limits, that  $\lim_{x \to 0} x = 0$, and hence the whole lot should be zero, too, but apparently not, as the behaviour of the floor function somehow makes the function tend to 1.   Or does it behave like $\lim_{x \to 0} \frac{x}{x} = 1 \mid x \in \mathbb{R}\backslash \{0\}$—which is much more straightforward to deduce? If so, why? I'm a little confused.

Evaluate $\lim_{x \to 0} (x\lfloor\frac{1}{x}\rfloor)$  I'm trying to solve it by using the squeeze theorem but I'm stuck.  I'm looking for a function $g(x)$ such that $g(x) \leq x\lfloor\frac{1}{x}\rfloor \leq x(\frac{1}{x}) = 1$  Can anybody give me a hint?


I have a vague recollection of seeing before 1985 a sci-fi animated movie, with a boy and a robot girl; I saw it in a theater, this is not a series.  I remember that in the end they were on a beach or an open space and she turns human. As a robot she was wearing some sort of headset with a metal band on her forehead and round things at her temples.

What is the name of an anime from 80s-90s movie/series in which there is a scene, maybe the end, where a girl (who has an armor) exchanges age with a dying man in a beach, so the man transforms into a baby and the girl grows to a woman?


I have installed cleanly 14.04 AMD64 onto my laptop which has two (SSD) disks. I used the default install with full disk encryption option on the first disk. However I'd now like to add a second disk to the machine, and I'd like that also to be encrypted in the same way.  I'd like the second disk to either be added to the space the first disk as, so it's all just seen as one volume. If that's not possible then having the second disk as /home (and also fully encrypted) is fine too.  Note: I'm not using ecryptfs.  How can I easily add the second disk to the full disk encryption setup?

I just bought a 2 TB hard disk because the home partition on the old one is almost full.  What I want to do is to extend the home partition on hard disk 1 (sda2) to also include all the space on the new hard disk (sdb1). This seemed rather straight forward at first, however there's one issue. My home-partition is LUKS-encrypted.  How do I extend sda2 to also span over sdb1 and act as one single partition? My initial thought was to create a logical volume (merging sda2 and sdb1), however I wasn't able to find a guide with a scenario like my own. Any ideas?  fdisk -l output:  Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0c000236     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048   204802047   102400000    7  HPFS/NTFS/exFAT /dev/sda2       204802048  1953525167   874361560   83  Linux   Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes 81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x12e102fd     Device Boot      Start         End      Blocks   Id  System /dev/sdb1            2048  3907029167  1953513560   83  Linux  Disk /dev/mapper/sda2_crypt: 895.3 GB, 895345184768 bytes 255 heads, 63 sectors/track, 108852 cylinders, total 1748721064 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000  Disk /dev/mapper/sda2_crypt doesn't contain a valid partition table


here is my implemented try, on my question  Now the only problme am getting is when i check browser log am seeing this Uncaught TypeError: document.getElementById(...) is null and the error sends me on this line document.getElementById("myBtn").addEventListener("click", function(e) { so i dont know whats the problem <!DOCTYPE html>            <form> <input type="text" id="fname" name="fname" placeholder="fullname"> <input type="text" id="country" name="country" placeholder="country">   <button id="myBtn" type="submit">Send</button> </form>

When embedding JavaScript in an HTML document, where is the proper place to put the <script> tags and included JavaScript? I seem to recall that you are not supposed to place these in the <head> section, but placing at the beginning of the <body> section is bad, too, since the JavaScript will have to be parsed before the page is rendered completely (or something like that). This seems to leave the end of the <body> section as a logical place for <script> tags.  So, where is the right place to put the <script> tags?  (This question references , in which it was suggested that JavaScript function calls should be moved from <a> tags to <script> tags. I'm specifically using jQuery, but more general answers are also appropriate.)


I have Mac Mini with an external hard drive. The external drive is indexed with Spotlight. Whenever I use Spotlight to start an app on the local machine, the external drive spins up, because obviously Spotlight wants to check the spotlight files on the external drive for search hits. The drive makes an audible noise, and stays running for some five minutes until it idles to a stop.  Is there any way around this, apart from disabling Spotlight or disconnecting the drive? Obviously, I understand that Spotlight must access the spotlight files to check for search hits, and can't tell the difference if I want to launch an app or find a file, when I just type "Sa" for Safari.  The only cure I could think of was if the entire spotlight database was cached in memory, or was placed on the local hard drive, or if I used a different hotkey for finding files and launching apps.

I noticed that when I plug in an external NTFS HDD something is reading it and it doesn't stop for a long time... I checked with fs_usage and saw this:  23:26:54.189404  read              F=5    B=0x28                                                                                0.000048 W tuxera_ntfs.242048 23:26:54.189465  writev            F=5    B=0x80                                                                                0.000007   tuxera_ntfs.242048 23:26:54.189476  getattrlist                            /Volumes/REDSTAR/Kindle/Kindle books/Dean R. Koontz/Shadowfires (880)                                                                         0.000093 W mds.242039 23:26:54.189490  getattrlist                                 /Volumes/REDSTAR/Kindle/Kindle books/Dean R. Koontz/Shadowfires (880)                                                                       0.000008   mds.242039 23:26:54.189511  read              F=5    B=0x28                                                                                0.000046 W tuxera_ntfs.242048 23:26:54.189540  writev            F=5    B=0x80                                                                                0.000006   tuxera_ntfs.242048 23:26:54.189549  getattrlist                            /Volumes/REDSTAR/Kindle                                                                                0.000054 W mds.242039 23:26:54.189579  read              F=5    B=0x28                                                                                0.000038 W tuxera_ntfs.242048 23:26:54.189616  writev            F=5    B=0x80                                                                                0.000006   tuxera_ntfs.242048 23:26:54.189626  getattrlist                            /Volumes/REDSTAR/Kindle/Kindle books                                                                                0.000066 W mds.242039 23:26:54.189656  read              F=5    B=0x28         etc.  So the Tuxera driver is scanning the drive each time. Why? Is this normal?  UPDATE: it's not Tuxera's fault... it's Spotlight indexing the drive via a Tuxera NTFS driver


INSERT IGNORE INTO `criticaldates`(`ID`, `LeaseID`, `CriticalDate`, `Note`, `AddedToOutlook`)  VALUES(39, 61, '2018-09-01 00:00:00', 'No Notes', 1)  WHERE `ID`=39; Error in query (1064): Syntax error near 'WHERE `ID`=39' at line 3   Also tried:  INSERT INTO `criticaldates`(`ID`, `LeaseID`, `CriticalDate`, `Note`, `AddedToOutlook`)  VALUES(39, 61, '2018-09-01 00:00:00', 'No Notes', 1)  WHERE `ID`=39  ON DUPLICATE KEY UPDATE `ID` = `ID`+0, `LeaseID`=`LeaseID`+0; Error in query (1064): Syntax error near 'WHERE `ID`=39 ON DUPLICATE KEY UPDATE `ID` = `ID`+0, `LeaseID`=`LeaseID`+0' at line 3   Ive been trying to solve this now for monrths without luck. Im using PHP PDO and MySQL - but having tried without look to do this using named placeholders  i thought i might isolate the problem and 'hardcode' the query directly into phpMyAdmin SQL Command screen and run it directly against the DB tables in question. I thought this might help but it still gives the same error. What on earth am i doing wrong?   ID is Primary-Key and Auto Increment  LeaseID is Indexed   There are NO Foreign-key constraints - the problem constantly point to the 'WHERE' line but i cant see why??  I deliberately split up the query to a avoid the 'at line 1' issue when you use a single line. This has helped since it pin-points the problem with the' WHERE' clause. I dont want or need to update either ID nor LeaseID i just one; preferably both in the 'where' clause so i can target the correct records in the table. Ive checked to make sure im not using Mysql reserve words  (i think ive got that right) Which seems to be a common cause of 1064 error.  If i remove ID and LeaseID from the bindings so they're not in the column list it says wrong number of parameters, i suppose cos im referencing ID in the WHERE clause.  Any ideas whats going on here - im stumped and its driving me up the wall!!

What's wrong with this query: INSERT INTO Users( weight, desiredWeight ) VALUES ( 160, 145 ) WHERE id = 1;  It works without the WHERE clause. I've seemed to have forgot my SQL.


I want to save a copy of the bash file each time I run it. It should be saved to the output dictionary. I am doing it like this in the mytrainrtest.sh file: mkdir -p "${EXP_DIR}/train" cp "${WORK_DIR}"/mytrainrtest.sh "${EXP_DIR}"/.  Now I have much more bash files with name my****** as copies of the upper one, each with different names. How can I write the line, so the bash file will recognize its name to copy itself?

How can I determine the name of the Bash script file inside the script itself?  Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that?


The following code does not align the contents of the two columns do not align properly; in particular, the content of the left column is a bit lower on the page than the content of the right column.   \documentclass [11pt]{article} \usepackage{amsmath} \usepackage{multicol}  \begin{document} \noindent So why do the two colums not align vertically? \begin{multicols}{2} \begin{align*} & \text{\underline{function} } f_a(x): \\ & \quad \text{\underline{begin}} \\ & \quad \quad i \leftarrow 1; \\ & \quad \quad \text{\underline{while}} (g(i) \neq x) \text{ \underline{do} }         i \leftarrow i +1; \\ & \quad \quad f_a \leftarrow 0; \\ & \quad \text{\underline{end}} \end{align*} \begin{align*} & \text{\underline{function} } f_a(x): \\ & \quad \text{\underline{begin}} \\ & \quad \quad i \leftarrow 1; \\ & \quad \quad \text{\underline{while}} (g(i) \neq x) \text{ \underline{do} }     i \leftarrow i +1; \\ & \quad \quad f_a \leftarrow 0; \\ & \quad \text{\underline{end}} \end{align*} \end{multicols} \end{document}   Why? And how can I fix this?  Note: I tried using \Columnbreak, to no avail. Curiously, if I add a blank line between the two align* environments, the content of the right column is a bit lower than the one on the left...


So today I wanted to dual boot Ubuntu 20.04 in this system. I know already how to select the "Broadcom Wireless Drivers" on Ubuntu so I tried it in a live iso and it worked! But... Something went wrong. When I tried to go to additional hardware in the gnome application it just pops up the Nvidia drivers. Can anyone help me? Edit: Broadcom BCM43142 802.11 bgn Wi-FI Adapter Edit 2: Sorry it is like 23 hours since I posted this but, I just discovered that I need to install bcmwl-kernel-source. However, I don't have ethernet and just have wifi and i'm all doing it offline, since I dual booted it where can I find the link to the latest packages? Edit 3: So it’s the next day now, I tried to install bcmwl-kernel-source and it says E: Unable to locate package bcmwl-kernel-source now what am I supposed to do?

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


I understand that inertial mass, at least in part, comes from the inertia of energy in the zero momentum frame or rest frame of some physical system. So for a static charge the corresponding field energy is positive giving rise to a positive electromagnetic inertial mass. Is it also possible to define an inertial mass for the gravitational field like the above and if so, is it positive or negative?

Since Newtonian gravity is analogous to electrostatics shouldn't there be something called negative mass? Also, a moving charge generates electric field, but why doesn't a moving mass generate some other field?


While Chrome is happy to show me certificates when they are invalid, with a nice warning message, I've just tried to view a certificate for a valid site and found there's no obvious way to do so.  If you click the 'Secure' button in the url bar it shows you the current options for all the various access a site can request, and tells you the communications is secured with https and a link to a google page explaining what this is, but doesn't actually show you any details about the site!  How do you view the cert manually, within Chrome?

Before somewhere around Chrome 55, I could look at the details of a certificate a website is using by clicking on the Green lock icon. Now that functionality seems to be gone; see picture below.  How can I bring this back? I know I can go into Developer Console -> Security but it's tad bit inconvenient.


Is there a commutative ring $R$ with zero Krull dimension such that its Jacobson radical is nil but not nilpotent?  Of course, in Noetherian case (which leads to Artinian case) for $R$ each nil ideal is nilpotent, so the ring, if it exists, should not be Noetherian.  Does any body have an answer to the raised question? Thanks!

Example of a ring such that the nilradical of it is not nilpotent. Please help me.


You use a runat="server" attribute everytime you want to access a html control (div,span,H1) from the server, you then also have to set it everytime you use an asp.net web control (<asp:Button/>).  My question is, for the asp.net web controls (all those beginning with <asp:) why haven't the asp.net team just removed it and set the property up in the background?  It makes no sense to have to set it every time, as there is no other option than server.  Is there is a point behind all of this, or an exception to the rule am I not aware of?

Why do I have to specify runat="server" on all my ASP.NET controls when it is a mandatory attribute and server is the only option available in my limited knowledge of ASP.NET, and I get an error if I don't use it?  I do understand that I can optionally use it on my HTML tags, and I do understand the client/server paradigm and what it is actually specifying.  Is it a redundant tag that could just be implied by the control being an ASP.NET control, or is there an underlying reason?


I need to find the transfer function of two RC circuits connected together.  This is the schematic:   Here is how I tried solving it, using maple, the two equations for nodal tensions are found at (1) as the solve({eq1, eq2}) parameters:   eq1 is the sum of currents at node A, eq2 is the sum of currents at node B.  Well my problem is that I get a result at (3) that is not the answer from the solutions booklet (which is at (4)).  I am quite rusty into solving circuits, could anyone take the time to explain me how to get to the correct answer? I must find the transfer function \$ G(s) = Y_{2}(s)/U_{1}(s) \$. \$ u_{1}(t) \$ is a voltage excitation, and \$ u_{2}(t) \$ is the same voltage as \$ V_{C_{1}}(t) \$.  Thanks!  P.S. If anyone could tell me what I did wrong in nodal analysis it would be great.

I'm working on a 2nd order passive low pass filter, consisting of two passive low pass filters chained together.         – Schematic created using   Let \$ H(s) = H_1(s)H_2(s) \$ where \$ H_1(s) \$ and \$ H_2(s) \$ are the transfer functions for each separate filter stage.  Then \$ |H(s)| = |H_1(s)||H_2(s)| \$  Knowing the magnitude of a passive low pass filter,   $$|H(s)| = \dfrac1{\sqrt{ (\omega R_1C_1)^2 + 1} } \times \dfrac1{\sqrt{ (\omega R_2C_2)^2 + 1} } = \dfrac1{\sqrt{((\omega R_1C_1)^2 + 1)((\omega R_2C_2)^2 + 1)}} $$  Then trying to find the cutoff frequency:  $$ \left(\dfrac1{\sqrt{2}}\right)^2  = \dfrac1{\sqrt{((\omega R_1C_1)^2 + 1)((\omega R_2C_2)^2 + 1)}} $$ $$ 2  = \sqrt{((\omega R_1C_1)^2 + 1)((\omega R_2C_2)^2 + 1)} $$ $$ 4  = ((\omega R_1C_1)^2 + 1)((\omega R_2C_2)^2 + 1) $$ $$ 4  = (\omega R_1C_1)^2(\omega R_2C_2)^2 + (\omega R_1C_1)^2 + (\omega R_2C_2)^2 + 1 $$  And I'm stuck. Research on the web tells me \$ \omega_c = \dfrac1{\sqrt{R_1C_1R_2C_2}} \$, but I can't find why? Can anybody show my the derivation to find this?


**edit: Thanks to the help of a colleague of mine, I found the solution. Thanks to all the helpers. here is the link:   I'm using TeXstudio and wish to submit a paper, but having a problem with compiling my Tex code. Before using \affil[1], \affil[2] etc. I had no problem, but I need it to be in this form (when I use the \and, \thanks form it works).  I fought this problem for hours now without a solution. I'll be happy for some help. Thank you so much.  I get the following errors:  'Illegal parameter number in definition of \toc@uthor. \maketitle' 'Illegal parameter number in definition of \toc@uthor. \maketitle' 'Illegal parameter number in definition of \reserved@a. \maketitle' 'Illegal parameter number in definition of \reserved@a. \maketitle'   when I run the following code:  \documentclass[english]{llncs}  \pagenumbering{plain}   \usepackage{amssymb} %add a personalized operator \usepackage{multirow} \usepackage{float} \usepackage{graphics} \usepackage{float} \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} \usepackage{array} \usepackage{booktabs} \usepackage{cite} \usepackage{color} \usepackage{hyperref}  \usepackage{cleveref} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}  \usepackage{authblk} \title{Paper's title} \author[1,2]{A} \author[1,2]{B} \author[2,3,4]{C} \author[1,2]{D} \affil[1]{institute A} \affil[2]{institute B} \affil[3]{institute C} \affil[4]{institute D} \institute{} \renewcommand\Authands{ and } \begin{document} \maketitle  \end{document}   Any help would be highly appreciated.

How to display multiple authors in a journal style e.g. \documentclass{llncs} document?  The solution suggested in  does not work for me, as \and is not working in my document.


When people get bit they turn into zombies however when they kill a zombie in close quarters, their face, mouth, eyes, nose and any cuts they have exposed get covered in zombie blood but they don't get infected. Is infection in their teeth or blood....?

In  it is pointed out that everyone appears to be infected with the virus.  As we saw in the CDC center, death triggers the virus to reactivate portions of the brain.  Yet even a single bite from a Walker results in fever, eventual death (within days), and then reanimation.  If the Walkers are infected with the same virus that is already latent in the survivors, why do bites seems 100% fatal?


Anybody pls Convert My below php + mysql search script to php + mysqli or php + Pdo Statement... I don't Know How to do this... Pls help Me... Tnx In Advance...  my form script is    <title>search engine</title>   <form action = 'ss.php' method ='GET'> <input type = "text"  name = "q"> <input type = "submit" name = "submit" value = "search"     And My Search Engine Script is   <?php  $k = $_GET["q"]; $con = mysql_connect("localhost", "root", ""); mysql_select_db("x"); $terms=explode(" ",$k); $i=0; $set_limit = ("9"); $subi = ""; foreach ($terms as $each)   {     $i++;      if ($i == 1 )         $subi.= " title LIKE '%$each%' ";     else         $subi.= " AND title LIKE '%$each%' ";      }  $query = "select SQL_CALC_FOUND_ROWS * from table WHERE $subi order by   rand() limit $set_limit";  $qry = mysql_query("$query");  $row_object = mysql_query("Select Found_Rows() as rowcount"); $row_object = mysql_fetch_object($row_object); $actual_row_count = $row_object->rowcount; $result = $actual_row_count; ?>   Diplaying Results  <?php if ($result>0) {     while ($row = mysql_fetch_array($qry)){ $title=$row['title'];  $href=$row['href']; $img=$row['img']; echo "

$title
<a href=\"$href\" target=_blank

\n"; }   } else {     echo "Sorry No Items Found For " .$k; }    ?>

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


A  (MM, p. 23) has the Wail action:  Wail (1/Day). The banshee releases a mournful wail, provided that she isn’t in sunlight. This wail has no effect on constructs and undead. All other creatures within 30 feet of her that can hear her must make a DC 13 Constitution saving throw. On a failure, a creature drops to 0 hit points. On a success, a creature takes 10 (3d6) psychic damage.  If someone was already at 0 hit points (for example, having failed their saving throw against a different Banshee's Wail), what would happen if they fail their saving throw against this Banshee's Wail (assuming they still need to make a saving throw)?  The unconscious creature takes one step towards death, as though they took damage (thus making the saving throw meaningless, since they'd take a step towards death either way); The unconscious creature just dies (unlikely, but in case there's something written that would imply this hidden in the rules somewhere); Nothing, since this isn't damage, its just an effect (meaning the unconscious creature would be better off failing this save than passing in this case!) Something else...

Some spells and abilities specify that the target must be able to hear you. Is an unconscious PC (0 HP) considered a valid target?  Unconscious ... An unconscious creature is incapacitated (see the condition), can't move or speak, and is unaware of its surroundings...  For example, the Oath of the Crown Paladin has the following ability:  Turn the Tide As a bonus action, you can bolster injured creatures with your Channel Divinity. Each creature of your choice that can hear you within 30 feet of you regains hit points equal to 1d6 + your Charisma modifier (minimum of 1) if it has no more than half of its hit points.  Can the Paladin grant hp to unconscious party members using this ability?


Why was there a kid running with a Uchiha crest on his jacket in Naruto Shippuden after the uchiha ending?  Did another Uchiha survive that no know one knows about? Or did he find the missing jacket and is wearing it? Or did he survive then later dies?

There's a kid wearing a shirt with Uchiha symbol, but I have no idea who s/he is.    Who is this kid?


The mathabx package provides a square version of \subset (namely \sqsubset). However I don't think there is a square version of \in. Does anyone know of one? If not, what is the best way to create it?

I was reading a book the other day and they distinguished between the usual element symbol (\in) and an element symbol to show that a set is a member of a collection of sets. For the latter they used a square element symbol that looked similar to a wide E. Does anyone know what the code for this might be? The book,says it was prepared with regular LaTeX. Thanks.  The Symbol is


I'd really like it if someone might be able to help me. I need an answer so that I can make a picture for another post.

I can't get the coordinates on my computer because it keeps changing the brightness.  I have a windows 8 Samsung, and I'm playing Minecraft version 1.6.4.


How do I find How to find  $\partial\chi^2/\partial b$ when $\chi^2=\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2} $?  My attempt:         \begin{align*}     \dfrac{\partial}{\partial b}\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2} &= \dfrac{\partial}{\partial b}\Bigg[\sum_{i=1}^N\dfrac{D(x_i)-a}{\sigma_i^2}-\sum_{i=1}^N\dfrac{b(x_i)^2}{\sigma_i^2}\Bigg]\\     &=  \dfrac{\partial}{\partial b}\Bigg[\sum_{i=1}^N\dfrac{D(x_i)-a}{\sigma_i^2}\Bigg]-\dfrac{\partial}{\partial b}\Bigg[\sum_{i=1}^N\dfrac{b(x_i)^2}{\sigma_i^2}\Bigg]\\     &= 0-\dfrac{\partial}{\partial b}\Bigg[\sum_{i=1}^N\dfrac{b(x_i)^2}{\sigma_i^2}\Bigg]\\     &= -\dfrac{\partial}{\partial b}\Bigg[\dfrac{b(x_1)^2}{\sigma_1^2}+\dfrac{b(x_2)^2}{\sigma_2^2}+\cdots+\dfrac{b(x_N)^2}{\sigma_N^2}\Bigg]\\     &= -\dfrac{\partial}{\partial b}\Bigg[\dfrac{b(x_1)^2}{\sigma_1^2}\Bigg]+\dfrac{\partial}{\partial b}\Bigg[\dfrac{b(x_2)^2}{\sigma_2^2}\Bigg]+\cdots+\dfrac{\partial}{\partial b}\Bigg[\dfrac{b(x_N)^2}{\sigma_N^2}\Bigg]\\     &= -\dfrac{1}{\sigma_1^2}\dfrac{\partial}{\partial b}\Bigg[b(x_1)^2\Bigg]-\dfrac{1}{\sigma_2^2}\dfrac{\partial}{\partial b}\Bigg[b(x_2)^2\Bigg]-\cdots-\dfrac{1}{\sigma_N^2}\dfrac{\partial}{\partial b}\Bigg[b(x_N)^2\Bigg]\\     &= -\dfrac{1}{\sigma_1^2}\cdot2\cdot b(x_1)-\dfrac{1}{\sigma_2^2}\cdot2\cdot b(x_2)-\cdots-\dfrac{1}{\sigma_N^2}\cdot2\cdot b(x_N)\\     &= -\Bigg[\dfrac{2}{\sigma_1^2}\cdot b(x_1)+\dfrac{2}{\sigma_2^2}\cdot b(x_2)+\cdots+\dfrac{2}{\sigma_N^2}\cdot b(x_N)\Bigg]\\     &= -\sum_{i=1}^N\dfrac{2b(x_i)}{\sigma_1^2} \end{align*}  Is this correct?  EDIT: I previously asked  question. But the fact that $b$ is a function and changes with each different $x_i$ confuses me.

How to find $\partial\chi^2/\partial a$ where $\chi^2=\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2}$?  My attempt: \begin{align} \dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2} &= \dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\\ &=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\\ &=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{1}{\sigma_i^2}\cdot\dfrac{\partial}{\partial a}\sum_{i=1}^N-a\\ &=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{1}{\sigma_i^2}\cdot\dfrac{\partial}{\partial a}a^N\\ &=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{1}{\sigma_i^2}\cdot N\cdot a^{N-1}\\ \end{align}  Is this correct?  EDIT: As per the accepted answer, this is how I got my final partial derivative. \begin{align}             \dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2} &= \dfrac{\partial}{\partial a}\Bigg[\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\Bigg]\\             &=\dfrac{\partial}{\partial a}\Bigg[\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}\Bigg]-\dfrac{\partial}{\partial a}\Bigg[\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\Bigg]\\             &= 0-\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_1^2}+\dfrac{-a}{\sigma_2^2}+\cdots+\dfrac{-a}{\sigma_N^2}\Bigg]\\             &= -\Bigg[\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_1^2}\Bigg]+\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_2^2}\Bigg]+\cdots+\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_N^2}\Bigg]\Bigg]\\             &= -\Bigg[\dfrac{-1}{\sigma_1^2}\cdot\dfrac{\partial}{\partial a}[a]+\dfrac{-1}{\sigma_1^2}\cdot\dfrac{\partial}{\partial a}[a]+\cdots+\dfrac{-1}{\sigma_N^2}\cdot\dfrac{\partial}{\partial a}[a]\Bigg]\\             &= -\Bigg[\dfrac{-1}{\sigma_1^2}+\dfrac{-1}{\sigma_2^2}+\cdots+\dfrac{-1}{\sigma_N^2}\Bigg]\\             &= \sum_{i=1}^{N}\dfrac{1}{\sigma_i^2}\\         \end{align}


I know there are recent advancements in software that allow for automatic/automated dialogue replacement but in films that predate this technology they still use the same terminology and as far as I know it was a completely manual process.  Where did this terminology originate, and what is so automatic/automated about manually dubbing over voices?

How does ADR (Automated Dialogue Replacement) work?  There's an entry in Wikipedia that says what it is (essentially actors dubbing their lines in post production, sometimes requiring several takes) but I don't see what's "automatic" about it.  It doesn't seem to work all that well because I can almost always tell when it has been used.


I was playing with the "Add polygon Feature" in QGIS. I ended up with some weird ugly polygon. How do I delete the polygon?

I am new to QGIS 3 and I can not figure out the way to remove the selection from empty canvas or with Google Maps layers selected this area can not be removed. I tried to remove it by selecting a layer but still not successful.


As title says, I'm stuck on finding a way to get the first and last date of the current month with JavaScript or jQuery, and format it as:  For example, for November it should be :  var firstdate = '11/01/2012'; var lastdate = '11/30/2012';

If you provide 0 as the dayValue in Date.setFullYear you get the last day of the previous month:  d = new Date(); d.setFullYear(2008, 11, 0); //  Sun Nov 30 2008   There is reference to this behaviour at . Is this a reliable cross-browser feature or should I look at alternative methods?


I was preparing for the Maclaurin Olympiad and I came across this question:  Show that: $$ \frac{1}{a} + \frac{1}{b} = \frac{5}{11}$$ has no solutions for positive integers $a,b$.  Is there any general method to solve equations like this:  $$11a + 11b = 5ab$$  Thank you

How many integer solutions does $xy+9(x+y)=2006$ have? Here $x$ and $y$ are both integers.  My trying:        I have tried to solve this problem. But I have no idea to solve this. Please help


A group of people is vaccinated twice (with two different vaccines). The probability of the first vaccine not working is 0.08, and the probability that the second vaccine doesn't work for the person for whom the first didn't work is 0.2. The probability of the second vaccine not working for the person for whom the first vaccine worked is 0.05. If we consider two people, find the CDF for the following random variables:  X - number of people for whom the first vaccine doesn't work  Y - number of people for whom the second vaccine doesn't work  Now, I have calculated the probabilities for $X=0$, $X=1$ and $X=2$. I was wondering if it would be correct do calculate the probability for the second vaccine not working like this:  let's say $A$ is the event of the first vaccine not working and $B$ is the event of the second vaccine not working.. so I would calculate $P(B)$ like this: $P(B)=P(B|A)P(A)+P(B|A^c)P(A^c)$.. so than I would use this $P(B)$ as the probability for calculating the probabilities of $Y=0$, $Y=1$ and $Y=2$

A group of people is vaccinated twice (with two different vaccines). The probability of the first vaccine not working is 0.08, and the probability that the second vaccine doesn't work for the person for whom the first didn't work is 0.2. The probability of the second vaccine not working for the person for whom the first vaccine worked is 0.05. If we consider two people, find the CDF for the following random variables:  X - number of people for whom the first vaccine doesn't work  Y - number of people for whom the second vaccine doesn't work  This is seriously confusing, I don't even know where to start, or how to find these CDFs. Any help is appreciated