How to make sure data retrieved from MySQL is UTF8 for json_encode in PHP?

I am converting SQL table rows into JSON, with the help of PHP, MySQLi and json_encode.  My present code approach is -  <?php error_reporting(0); $servername = "localhost"; $username = "root"; $password = ""; $dbname = "my_db";  $conn = new mysqli($servername, $username, $password, $dbname);  if ($conn->connect_error) {     die("Connection failed: " . $conn->connect_error); }  if(isset($_GET['from'])) {   $from = $_GET['from'] - 1; } else {   $from = 0; }  if(isset($_GET['count'])) {   $count = $_GET['count']; } else {   $count = 10000; }  $sql = "SELECT * FROM `my_table` Limit $from, $count"; $result = $conn->query($sql);  if ($result->num_rows > 0) {   $resultArray = array();   $tempArray = array();    while ($row = $result->fetch_assoc()) {       $tempArray = $row;       array_push($resultArray, $tempArray);   }   //var_dump($resultArray);   $json = json_encode($resultArray); } else {     $json = '{"Json_Result":"Record NOT found!"}'; } print($json); $conn->close();   This works fine, if the data retrieved from table is in correct format. But, unfortunately some of my rows contain some special characters, which were not converted into proper format at the inserting. This code fails if it encounters any of such rows. On using var_dump, I found that those special characters are seen as �. On searching about issue, I found out that, for json_encode to be working, all characters must be in utf8 format. But, I am unable to figure out, how should I implement it here, before using json_encode?


How to fix gap between rigid body objects?

I've having some trouble animating my donut. When it reaches the surface there's a gap between the objects, and sometimes the object jitters and bounces when it reaches the surface and I don't understand why that happens.


Make \cite{my reference} show name and year

I am trying to figure out how to make author's name and year show up every time I make a reference.  For example:  my_bibtex.bib has this entry:  @article{Franklin1999,  author = {Franklin Allen and Risto Karjalainen}, title = {Using genetic algorithms to find technical trading rules}, year = {1999}, volume = {51}, pages = {245-271}, journal = {Journal of Financial Economics}  }   If in my_paper.tex I use this line:  Important result has been found by \cite{Franklin1999}   My output looks like:  Important result has been found by [1]   But I want it too look like:  Important result has been found by Franklin 1999   I there a way to do it?  My bibliographystyle is set to plain  \bibliographystyle{plain}  \bibliography{my_bibtex}


Buttons dynamically added to table are not working Jquery

I have a table that I've created dynamically and in each row there is a button that will clear that row. The button works fine in the first row, but doesn't do anything in the following rows. To troubleshoot this, I set the button to give me an alert on click, but only the first button is registering.  I've changed the button to be an ID and a Class, but that doesn't seem to do anything either.  Here is the code:     //dynamically create 4 rows  $(document).ready(function(){  var rowsAdd = $('#addTable tbody >tr');  var rA = rowsAdd.length;  while (rA<5) {   $('#addTable tbody>tr:last').clone().insertAfter('#addTable tbody>tr:last');   rA++;  } })   //alert on button click  $('.clear').each(function(index){   $(this).on("click",function(){   alert("Button " +index+ " is clicked");  });  });

             Class #	             Course Title	             Catalog Number

    	        <input list="courses" name="courseInput" placeholder="Course" class="courseClass" oninput="UpdateCatNumbers()">       <datalist id="courses" name="courseDatalist">                  </datalist>    	                <input list="catalogs" name="catalogInput" placeholder="Catalog Number" id="catalogID" class="catClass" oninput="UpdateCourseNames()">       <datalist id="catalogs" name="catalogDatalist">             </datalist>       	    <button class="clear">−</button>


How to avoid type safety warnings with Hibernate HQL results?

For example I have such query:  Query q = sess.createQuery("from Cat cat"); List cats = q.list();   If I try to make something like this it shows the following warning   Type safety: The expression of type List needs unchecked conversion to conform to List<Cat>   List<Cat> cats = q.list();   Is there a way to avoid it?


I have the below class structure. Class A is called from constructor of Class B and C.  Class A {     A() }  Class B {     B()     {         A();     } }  Class C {     C()     {         A();     } }   Is there a way where I can get to know if the call to A() comes from B() or C()? I do not want to pass any object in the constructor.


What is the 41GB of "System" on my MacBook?

I have a 2012 MacBook Pro, and it's running out of storage:. What I cannot understand is, what is the 41GB of "System" (grey). I installed an app called Disk Inventory X which scanned my drive and said that the largest folder on my device was Applications, which is only 26GB. Here is a screenshot of the results:  What is causing this? Is it all the non-application/photos/documents/iTunes stuff combined? Or is it something else? Here are my System Specs if that helps:


$T_n(x)$ is a polynomial of degree $n$ such that $T_n(x)=\cos(n\cos^{-1}(x))$  (i) Show that $T_2(x)=2x^2-1$ and $T_3(x)=4x^3-3x$  (ii) Show that $T_{n+1}(x)=2xT_n(x)-T_{n-1}(x)$  $U_n(x)$ is an $n$ degree polynomial defined by $$U_n(x)=\frac{\sin((n+1)\theta)}{\sin\theta}$$ where $x=\cos\theta$.  (iii) Show that $$\frac{d}{dx}T_n(x)=nU_{n-1}(x)$$  (iv) Show that $$\frac{d}{dx}U_{n-1}(x)=\frac{xU_{n-1}(x)-nT_n(x)}{1-x^2}$$  I'm having a lot of problems with part (iii). I typed out part (ii) because I thought perhaps the result from part (ii) maybe be cleverly used to solve part (iii). Differentiating $T_n(x)$ would yield an algebraic expression in $x$. On the other hand, $nU_{n-1}(x)$ is in $\theta$ unless we explicitly express $U_n(x)$ in $x$ which would be very troublesome because there is no simple way of expressing $\sin n\theta$ in terms of $\cos\theta$ and therefore $x$. Some help would be of great help thank you!  [I don't need help with part (i) and (ii)]


How to select 'like' query in php model?

I would like to search wildcard query in my php.model file.  I tried to apply these code but always get empty result.  public function get_web_search($data) {        $sql = "select p.name,c.name AS category_name,p.product_id AS item_id ,'Product' AS category_group from  product p left join category c on p.category_id = c.category_id  WHERE p.name LIKE '%?%' UNION select m.merchant_name,c.name AS category_name,m.merchant_id AS id,'Merchant'  AS category_group  from  merchant m left join category c on m.category_id = c.category_id WHERE m.merchant_name LIKE '%?%'";        $result = $this->db->query($sql, array($data['id'],$data['id']));        $records = $result->result_array();        return $records;    }   May I know how to set proper select statement in  p.name LIKE '%?%' ?  Please help. Thank you.


Can I SSH into my Amazon EC2 server instance if I don't have .pem file from when instance was created?

I am working with some Amazon EC2 servers that are up and running, and I need to SSH into the servers. I don't have any keys that were generated when the servers were first set up (someone else did it long before I got here). Can I still get into the servers without the key files?  FWIW I've tried a lot of things to SSH into the box so far, including generating new key pairs in the EC2 dashboard, and nothing seems to be working.  and  seem to indicate that I'm out of luck unless I want to make an AMI of my current server and then use it to instantiate a whole new EC2 server instance (just to get the .pem file generated at that time). Is that really the only way I can get into the box at this point?!


Javascript: how to validate dates in format MM-DD-YYYY?

I saw a potential answer here but that was for YYYY-MM-DD:   I modified the code code above for MM-DD-YYYY like so but I still can't get it to work:  String.prototype.isValidDate = function()  {      var IsoDateRe = new RegExp("^([0-9]{2})-([0-9]{2})-([0-9]{4})$");      var matches = IsoDateRe.exec(this);      if (!matches) return false;      var composedDate = new Date(matches[3], (matches[1] - 1), matches[2]);      return ((composedDate.getMonth() == (matches[1] - 1)) &&       (composedDate.getDate() == matches[2]) &&       (composedDate.getFullYear() == matches[3])); }   How can I get the above code to work for MM-DD-YYYY and better yet MM/DD/YYYY?  Thanks.


Find and move directory to a new directory based on name

I would like to move all the folders contained in the folder "/example" named e.g. "*_jony" to a new directory call "/jony". I have try several way without success! It would be great to have some helps. Thanks!


How to estimate the confidence interval using sample average and sample size ONLY?

Suppose there is a population, with goods and bads. The bad rate of the population(=bads/(bads+goods)) is of course unknown.   Now, I have a sample of $N$ from the population and I know the bad rate of this sample as $b$. The question is can I calculate the confidence interval based on $N$ and $b$ ONLY? In other words, can I calculate the confidence interval $x$ such that with, say, 95% confidence the population bad rate falls in $[\text{range}_1,\text{range}_2]$, where $\text{range}_1$ will be $b-x$ and $\text{range}_2$ will be $b+x$.


Hiding and redirecting extensions on my webpage

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.


How can I make one clipping mask for many type-layers? I have many type-layers and I want one background(clipping mask) for all of them.  Have tried a couple of things. First, tried to make all my type-layers a sublayer for the clipping mask, that did not work. Second, tried to merge all of the type-layers to one, did not work either..  Been searching the web for a solution without luck.  Any help will be greatly appreciated.  Örvar


Deriving formula for surface area of an ellipsoid

I am doing some research on ellipsoids. I am not sure where the formula for the surface area of a prolate ellipsoid comes from. Can anyone please help me with how to derive the formula. I have the formula below


Is there an infinite ring having finitely many zero divisors?

I am looking for an example of an infinite ring having finitely many zero divisors. Is that possible?  If there is such ring please give a hint.


Deriving the bivariate Poisson distribution

I've recently encountered the bivariate Poisson distribution, but I'm a little confused as to how it can be derived.  The distribution is given by:  $P(X = x, Y = y) = e^{-(\theta_{1}+\theta_{2}+\theta_{0})} \displaystyle\frac{\theta_{1}^{x}}{x!}\frac{\theta_{2}^{y}}{y!} \sum_{i=0}^{min(x,y)}\binom{x}{i}\binom{y}{i}i!\left(\frac{\theta_{0}}{\theta_{1}\theta_{2}}\right)^{i}$  From what I can gather, the $\theta_{0}$ term is a measure of correlation between $X$ and $Y$; hence, when $X$ and $Y$ are independent, $\theta_{0} = 0$ and the distribution simply becomes the product of two univariate Poisson distributions.  Bearing this in mind, my confusion is predicated on the summation term - I'm assuming this term explains the the correlation between $X$ and $Y$.  It seems to me that the summand constitutes some sort of product of binomial cumulative distribution functions where the probability of "success" is given by $\left(\frac{\theta_{0}}{\theta_{1}\theta_{2}}\right)$ and the probability of "failure"  is given by $i!^{\frac{1}{min(x,y)-i}}$, because $\left(i!^{\frac{1}{min(x,y)-i!}}\right)^{(min(x,y)-i)} = i!$, but I could be way off with this.  Could somebody provide some assistance on how this distribution can be derived? Also, if it could be included in any answer how this model might be extended to a multivariate scenario (say three or more random variables), that would be great!  (Finally, I have noted that there was a similar question posted before (), but the derivation wasn't actually explored.)


I often see color combinations on webpages, images, posters, products etc. that harmonize really well. Am I allowed to use those colors in my own design?   This is solely about the colors. I will not use images, logos or shapes from that source, and my content is not related to the original color source. I am also far from any commercial aspect here.


Sanitizing input from Text Box in tkinter

Sorry if this is an easy one, but I'm learning and I'm new to python. I have a textbox where you can input some text but I need to remove special characters as it seems to be gumming up some other operations. I've tried different ways of using .replace('"', '') but I'm just getting errors.  here's my code that grabs the textbox input  def setter(self):         self.url = self.url.get()         self.artist = self.artist.get()         self.album = self.album.get()         self.album_artist = self.album_artist.get()         self.genre = self.genre.get()         self.year = self.year.get()         self.textBox = self.textBox.get("1.0", END)         if self.artist or self.album or self.year:             self.folder_name = self.artist + " - " + self.album + " (" + self.year + ")"   The error  "Michael P. Shipley's" ETERNAL Mistake is processing. Exception in Tkinter callback Traceback (most recent call last):   File "tkinter\__init__.py", line 1883, in __call__   File "AlbumWindow.py", line 64, in <lambda>   File "AlbumWindow.py", line 93, in setEntries   File "AlbumWindow.py", line 203, in instructions   File "AlbumWindow.py", line 182, in trackSplitter   File "site-packages\pydub\audio_segment.py", line 780, in export   File "site-packages\pydub\utils.py", line 57, in _fd_or_path_or_tempfile OSError: [Errno 22] Invalid argument: 'mick gordon - doom ost (2020)/"Michael P. Shipley\'s" ETERNAL Mistake.mp3'   Anything with quotes and some japanese characters are making it fail, I need to basically remove all special characters from self.textBox except for :  If I manually remove the " out of the textBox before I submit everything works fine.  Thanks!


check a string variable for string and Integer in Javascript

As following example  var m="hello"   or var m="50"  check the string whether the string got Numeric Value or Alphabet's  i am using this but it is not working  var check=parseInt(m);  if(Number(check)==NaN)  {     alert("this is Not a Number ");   }  else{     alert("This is Number ");  }


Best way to remove an event handler in jQuery?

I have an input type="image". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the input-image. Then when the user clicks the image, they get a little popup to add some notes to the data.  My problem is that when a user enters a zero into the text box, I need to disable the input-image's event handler. I have tried the following, but to no avail.  $('#myimage').click(function { return false; });


What is the fastest car in Saints Row 4, and where can I find it?

I found an Attrazione in Salander, which has traditionally been fastest in previous games, but I don't like sinking upgrades money into a car unless it's for keeps. What car is fastest in Saints Row IV (before and after upgrades), and how can I get it? Is there any way to get stats on the car in-game?


Can you please let me know whether I can claim anything as my flight got delayed by 5 hours in New Delhi by Air India. My transit supposed to be 5 hours and top of this they announced that my flight from New Delhi to London delayed by 5 hours. So, I have to wait 10 hours in total. Is there anything that I can do to claim for that delay 5 hours by Air India?


I used to do a full factory wipe then flashed a stock firmware with Odin, that helped me get back to having access to my mobile network then I flashed to Resurrection Remix 5.5.3 and lost access to my mobile network (Emergency Calls Only) I checked my IMEI and it appears to be valid. I didn't backup my /efs I didn't do anything to it. What seems to be the solution? I have a Samsung Galaxy S3 (I-9300)


My Skype beta version 5.3.0.1 Not working, when I open this in Ubuntu 14.04LTS its showing below message:  Sorry, this version of Skype is not supported anymore.  Any help would be great appreciated.


The full sentence is this : But most doctors are beaten hands down by countless alternative practitioners who might not know a lymphocyte from a lump of cheese.  Thank you.


Why is the area under a curve the integral?

I understand how derivatives work based on the definition, and the fact that my professor explained it step by step until the point where I can derive it myself.  However when it comes to the area under a curve for some reason when you break it up into an infinite amount of rectangles, magically it turns into the anti-derivative. Can someone explain why that is the definition of the integral and how Newton figured this out?


Why do Elves have certain ages if they're immortal?

(I'm only on The Fellowship of the Ring).  After seeing The Hobbit trilogy (and reading the book) I noticed that some elves are older than others.  How do they age? Why are some older and younger than others if they're immortal?


After deleting Ubuntu partition I get grub rescue> and can't boot Windows

I was using two operating systems at my computer. Window 7 in partition (C:) and Ubuntu in partition (D:). I didn't need Ubuntu any more so I formated partition (D:) from Windows 7. Then I restarted the computer and it started showing this error:  Error: unknown filesystem. Grub rescue >


I am writing a novel and fairly new to using LaTeX.  Please bare with me if this is a silly question.  I am working off of the novel demo LaTeX file using the TexWorks software.  I have inserted my words into the file.  When I run the LaTeX code, I get the error message saying "! LaTeX Error: File `novel.cls' not found."  Do I need to download this file from somewhere?  If so, where can I get it?


I am using a regular expression to validate email addresses in an online form. A lot of emails are entered as such: www.test@example.com  How can I disallow the use of www. using regex? My current expression:  ^[\+_a-z0-9-'&=]+(\.[\+_a-z0-9-']+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$   I know this expression checks for a gTLD - we require an email address to have one.   EDIT: This question is slightly different to others I have found as I wasn't sure how to add the www exclusion in - that's all I needed.  Also, the target market we reach doesn't have the same experience using technology as most people do, so the amount of email addresses that we receive with www in them is massive. www.john@gmail.com is perfectly valid yes but it is 99% of the time not what the persons email address is. Our CRM system can't send emails to the correct people then.


Prove that if $\alpha, \beta, \gamma$ are angles in triangle, then $(tan(\frac{\alpha}{2}))^2+(tan(\frac{\beta}{2}))^2+(tan(\frac{\gamma}{2}))^2\geq1$

We have an acute triangle with angles $\alpha, \beta, \gamma$ and we need to tell whether the following inequality is true for all such triangles:  $$(\tan(\frac{\alpha}{2}))^2+(\tan(\frac{\beta}{2}))^2+(\tan(\frac{\gamma}{2}))^2\geq1$$  We are also asked if $1%$ is the greatest number, for which it is true.  I'm having huge problems when trying to solve such optimization calculus problems. I think we must somehow find triangle for which we can prove, that the upper sum is minimum, than evaluate it and prove that it is equal to $1$. As with most optimization problems, it turns out that if $\alpha=\beta=\gamma=\frac{\pi}{3}$, then the sum evaluates to $1$. But how to prove that this is infimum of this sum?


How can I start an interactive console for Perl?

How can I start an interactive console for Perl, similar to the irb command for Ruby or python for Python?


How to upgrade Python to the latest version

I have the following version of Python, in my Ubuntu 18.04 LTS.  python --version Python 2.7.17 python3 --version Python 3.6.9   How to upgrade it to the latest version 3.8.2  I have already run the commands:  sudo apt-get update && sudo apt-get upgrade sudo apt-get install python3.8.2   However, that did not make any changes.


Are SSDs better than HDDs for long term idle storage?

I want to back up some files on an external disk. I won't be accessing the files as often, but I want them to be secure and private. It goes without saying that I don't want to upload them on the cloud, I want them offline.  So my question is, are HDDs suitable for long term storage, or are SSDs better in this regard? What are the variables that I need to consider?


How to compare string from Telephony to saved/stored Telephony information?

I have this code.  TelephonyManager  tm=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String showimei=tm.getDeviceId(); String viewimei = String.valueOf(imei);  if (showimei==viewimei) { ACTION 1 } else { ACTION 2 {   Assuming showimei is same as viewimei meaning the user is using the same smartphone with the application, Action 1 is supposed to happen. But it always goes to Action 2. How should I make this work?


I'm working with Swish++ in Ubuntu 12.04. Due to my thesis I must install Swish++ from the source code. During the installation I faced with several problems, but finally I solved them and Swish++ package was successfully installed. Although I found a discrepancy with Swish++ names (I asked  but got no answers there). Anyway, despite this, everything went ok. I could use index and search with all the functions of index++ and search++. But now I have another problem. I changed config files of Swish++ and need to recompile it. The first time I did it I used command make. How can I delete Swish++ and install it again? The command sudo apt-get remove --auto-remove swish++ says that package hasn't been istalled and can't be removed. How can I remove programms having been installed from the source code?


How to change my MAC adress? enp3s0. Other methods don't work

I tried all methods, macchanger, GUI and it just don't work.


Test if string is a guid without throwing exceptions?

I want to try to convert a string to a Guid, but I don't want to rely on catching exceptions (   for performance reasons - exceptions are expensive for usability reasons - the debugger pops up  for design reasons - the expected is not exceptional   In other words the code:  public static Boolean TryStrToGuid(String s, out Guid value) {     try     {         value = new Guid(s);         return true;     }     catch (FormatException)     {         value = Guid.Empty;         return false;     } }   is not suitable.  I would try using RegEx, but since the guid can be parenthesis wrapped, brace wrapped, none wrapped, makes it hard.   Additionally, I thought certain Guid values are invalid(?)    Update 1   had a good idea to catch only FormatException, rather than all. Changed the question's code sample to include suggestion.    Update 2  Why worry about thrown exceptions? Am I really expecting invalid GUIDs all that often?   The answer is yes. That is why I am using TryStrToGuid - I am expecting bad data.  Example 1 . I might be parsing folder names, checking to see if the text after the final . is a GUID.  c:\Program Files c:\Program Files.old c:\Users c:\Users.old c:\UserManager.{CE7F5AA5-6832-43FE-BAE1-80D14CD8F666} c:\Windows c:\Windows.old   Example 2 I might be running a heavily used web-server wants to check the validity of some posted back data. I don't want invalid data tying up resources 2-3 orders of magnitude higher than it needs to be.  Example 3 I might be parsing a search expression entered by a user.     If they enter GUID's I want to process them specially (such as specifically searching for that object, or highlight and format that specific search term in the response text.)    Update 3 - Performance benchmarks  Test converting 10,000 good Guids, and 10,000 bad Guids.  Catch FormatException:    10,000 good:     63,668 ticks    10,000 bad:   6,435,609 ticks  Regex Pre-Screen with try-catch:    10,000 good:    637,633 ticks    10,000 bad:     717,894 ticks  COM Interop CLSIDFromString    10,000 good:    126,120 ticks    10,000 bad:      23,134 ticks   p.s. I shouldn't have to justify a question.


Google Maps API not picking up destination point

Her is my logcat: 07-02 19:56:01.273 4083-4083/com.example.sharide E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.sharide, PID: 4083     java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toString()' on a null object reference         at com.example.sharide.MapsActivity$4.onResponse(MapsActivity.java:257)         at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)         at android.os.Handler.handleCallback(Handler.java:739)         at android.os.Handler.dispatchMessage(Handler.java:95)         at android.os.Looper.loop(Looper.java:148)         at android.app.ActivityThread.main(ActivityThread.java:7325)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  If you want me to share my code I would happy to share it with you. But please resolve my problem


Many photos of Milky-way show it in nice colors instead of just the black of sky and white of the stars. Is the key to having those colors in the capturing of the image or in the post processing, or both? Or am I just doing it in a wrong time of year when the visible part of Milky-way is simply not showing color?  Here is a sample photo of how Milky-way looks like in Finland in September:    APS-C sensor camera, 18 mm, 30 sec, f/3.5, ISO 3200 - captured in pitch-black darkness of Finnish countryside, far far away from any citylights, at time when moon was still below visible horizon.  What I'd like to achieve is something like the photo in Vivek's answer to   I've just bought a wireless shutter release for longer bulb exposures, and have plans to build a barn-door tracking mount. But is longer exposure the needed trick, or what is?


Consider two infinite circular cylinders of equal radius whose axes meet in a right angle.  (a) What is the volume of their intersection?  (b) What is the area cut out of one by the other?  How to start this question?


Infinite chessboard and the arithmetic mean

Every square of an infinite chessboard contains a positive number. Given that the number in each square is equal to the arithmetic mean of the numbers in the four neighboring squares, is it true that all numbers are equal to each other?  I would expect that this is a well-known problem, but I was unable to find it on the Web.  Notice that the question has an immediate solution if we drop the positivity assumption, and also if we insist on all numbers to be integers.  The problem can also be stated in terms of the adjacency operator of the infinite grid graph: we want to show that it does not have eigenvectors with all components positive.  (Please, feel free to re-tag this question.)


What does "not the least of which" mean?

I think "not the least of which" means "one of the biggest" or "one of the  important". Is it right?


Can a symmetry of a subset of the plane always be extended to the entire plane?

Given some compact subset of the plane and a symmetry of that subset, i.e. a bijective isometry from that set to itself, it seems that in any example I come up with the symmetry can be written as some combination of translations, rotations, and reflections - in other words it may be extended as a symmetry of the plane. This leads me to conjecture that this is always the case. Indeed,  MathOverflow question seems to cite a stronger result, but I cannot see what the referenced material has to do with this fact.


How can I specify only NBT in the /clear command, not an item?

Story A unique quirk about the /clear command is that it can clear items from the player's cursor, i.e. the one that is picked up and moving from slot to slot. Using this and conditional command blocks, I can detect when someone clicks on an item slot to pick it up. This is useful when I want to prevent a user from removing items from the chest. A method that I used to detect this is shown . Problem method doesn't work if the chest's contents are constantly changing. So I had this idea, to give each item a custom NBT tag like LockedInChest:1b and use my earlier method to detect if items with this tag were removed. Now I've run into a roadblock. It was all smooth sailing until I realized that you can't specify NBT in the /clear command without specifying an item. For example, I can match "stone with my NBT tag", or "stone with any NBT tag", but I can't mention "any item with my NBT tag". Core question How can I specify NBT only in the /clear command, and have it work for any item? Past trials (all failures) What if I could just remove the item name and keep the NBT? /clear @s minecraft:stone{NBT}  ↓ /clear @s {NBT}   Can I just specify the namespace? minecraft: /clear @s minecraft:stone{NBT}  ↓ /clear @s minecraft:{NBT}  and /clear @s minecraft{NBT}   Is there a keyword for any item? /clear @s minecraft:stone{NBT}  ↓ /clear @s minecraft:any{NBT}  and /clear @s minecraft:all{NBT}


Weird floating point calculations in JavaScript

I just noticed that sometimes JS does something unexpected when simply adding 2 floating point numbers, e.g.  console.log(0.01 + 0.05);   will output 0.060000000000000005, when on the other hand something like  console.log(0.02 + 0.05);   will output 0.07.  I'm like WTF? Can anyone explain this kind of strange JS behaviour?


What is the simplest way of sharing my world with a friend?

I want to share my single player world with my friend, Can someone tell me how but in a simple way (I'm on a mac)  I'm really having trouble and I want to share my world with my friend.


How to pipe all bash terminal output through command

I would like to be able to pipe all bash terminal commands through a certain command (for no good reason other than to play a prank on someone). I just want to pipe the stdout of any executed command into a predetermined program without doing anything special.  For example: If that predetermined program was cowsay  echo "Hello World"   should output   _____________ < Hello World >  -------------         \   ^__^          \  (oo)\_______             (__)\       )\/\                 ||----w |                 ||     ||   How can I achieve this? (Some of the fun programs I'd like to use to play pranks on others include rev, cowsay, and lolcat)


I'm stuck on the following practice problem.   Any hints would be appreciated.  Suppose $N$ is a normal subgroup of  $G$ such that every subgroup of $N$ is normal in $G$ and $C_{G}(N) \subset N$. Prove that $G/N$ is abelian.  I'm not sure how to use the fact that $C_{G}(N) \subset N$.  Thanks


I have a dual boot setup with Ubuntu and Windows 7. I need to shrink my root Ubuntu volume in order to get some free space to create a new partition. Are there any Windows based tools that will do this for me? I tried booting up in gparted to do this but I cannot tell which partition is which since I cannot find the size (it displays everything in blocks).


Should we say:     I am a great fan of Shakespear's and Enid Byton's writing   or      I am a great fan of Shakespeare and Enid Blyton's writing


How to set document font to times new roman by command

I wanted to know how to set font of a document to Times New Roman and size to 12 for text and for Chapter Heading 14 only, for the whole document. I don't want to use the fontspec package for this. Please help me out on this.


Determining if siblings are half siblings or full siblings?

I recently found 6 siblings 4 who are half and 2 who may be full.  My sister was born in 1949, I was born in 1950 and my brother in 1952. The other siblings all know who both their parents are. The three of us were adopted by different families. We all have the same birth mother but we can only guess as to who our birth father might be.   As far as I can tell on Ancestry his line no longer exists, unless there are a few more children out there not yet discovered.  The three of us are very interested to know if we are full siblings or half. I am confused by all the companies offering tests, and the 3 types of tests. What test would give us the most accurate result.


If f is entire and f(z) is real if and only if z is real then f can have at most one zero

I am only able to that zero occured only on real line. I tried prove using contradiction. But not succeed. Any hint will be very helpful for me.


How does k-fold cross validation overcome overfitting in deep neural networks?

Consider that I use k-fold cross validation and select the best model based on the smallest mean error or using some heuristic to choose the best model. After I chose the best model, if I use the full training data to train this model, would it be guaranteed to overcome overfitting (or less overfitting) in deep neural networks?   Is it a good idea to train with the full training dataset after k-fold cross-validation, or again do another set of cross validation (split training dataset to training and validation) and then train the best model on the part of training data?  I read other questions regarding k-fold cross validation but none of them fully convinced me that when selected deep network model trained on whole training dataset will not overfit. As deep neural network, I mean the number of parameters to train P are far more than number of full training samples N (P>>N).


Can I Protect Scripts in Google Spreadsheets

I have a Google spreadsheet that I need some people to edit certain parts, so they need edit permission. I have locks on virtually everything else (except things like adding a sheet, but that won't break anything). The problem is that I use quite a few scripts, and I don't know how to block these users from editing them. Is there any way to protect these scripts from being edited from everyone except me?


problem with call command on local terminal

When I make a ssh connection with root account to my desktop using putty and installed some programs. when I list that program type and press doubletab, will complete/list all associated commands.  Ex. Putty - SSH - 192.168.1.5  root@192.168.1.5:~# apt-get install aircrack-ng  root@192.168.1.5:~# ai<TAB><TAB>  airbase-ng aireplay-ng aircrack-ng airmon-ng airdecap-ng airodump-ng airdecloak-ng airtun-ng airdecloak-ng...   Xrdp - session Xorg - 192.168.1.5  root@192.168.1.5:~# air<tab><tab> aircrack-ng airdecloak-ng   Both are root@192.168.1.5:~#. I need understand this. Other thing its on xfc4-terminal run ssh root@localhost and ssh root@192.168.1.5 do the same thing above respectively.  How can I push command in xfce4-terminal after installed this packages on ssh connection?  Same happens for the history commands. Example:   SSH Connection: Only shows history of this user in ssh. Local connection: Only shows the xfce4-terminal history. Dont show packages installed with ssh session.   I think its a 'session' association?


How to create a rectangle with a transparent hole

I have an issue involving filling a rectangle, although, this is probably quite a simple problem, this has compeletly stumped me...   I know how to draw a rectangle for a given colour and a circle over the centre of said rectangle, however, I don't know how to ignore the colouring of the rectangle where I place the circle over the top of the rectangle!       \begin{tikzpicture}       \draw[black, fill = white, fill opacity = 0.5, semithick] (0,0) rectangle (5,);       \draw[black, semithick] (2.5,2.5) circle (0.5);     \end{tikzpicture}   Is there a way to fill in a rectangle with a particular colour but make an exemption for a circle in the centre? So that that part has no colour and is transparent?   Thanks!


Are there infinitely many primes and non primes of the form $10^n+1$?

Prove that there are infinitely many primes and non-primes in the numbers $10^n+1$, where $n$ is a natural number. So numbers are 101, 1001, 10001 etc.


Specify default pull branch for a given remote

When I git pull, I pull from the default branch on my default remote. If I would like to pull from the remote "upstream", I have to specify the upstream branch that I would like to pull from:   git pull upstream name_of_branch.  I would like to specify a default branch for a given remote, so that I can achieve the above just by  git pull upstream  The reason is one of laziness - name_of_branch is in this case a bit of an long awkward name, and I have to do this relatively often.  I have not found a way to do this. Do you have any suggestions?


Need word for a pathway or trail formed by frequent use by people, not through landscape or town planning

The paved pathway across the grassy knoll became unused in favor of a .... [NEED WORD FOR TRAIL FORMED BY FREQUENT USE AS A SHORTCUT].


Converting list of raster to a data frame using R?

I could read many rasters as one list of ratsers but when I want to convert them to data frames I get an error.   Is there any way to convert them?  library(raster) Pro <- function(s) {   df <- stack(s) }  files <- dir("path", recursive=TRUE, full.names=TRUE, pattern=".tif$")  agg <- sapply(files, Pro)  df <- as.data.frame(agg)


How to create a shadow like this one?    Can anybody help me creating a shadow like shown under menu of the image? I'm using Photoshop and is aware of tools but don't know the technique to make it? Thanks


A doubt about real analysis concerning countable sets

I sometimes get confused when dealing with the notion of countable sets. MY book says that $A$ I countable if there is bijection $f: A \to \mathbb{N }$. but then I frequently see people refer to countable sets only if $f$ is injective.  So, my question is: if there is an injection between $A$ to $\mathbb{N}$ does it imply that $A$ must be countable ?


Reusing pipe data for different commands

I would like to use the same pipe for different applications, like in:  cat my_file | {   cmd1   cmd2   cmd3 }   Cmd1 should consume part of the input. Cmd2 should consume another part and so on.  However, each cmd eats more of the input then it read really needs due buffering.  For example:  yes | nl | {    head -n 10 > /dev/null   cat  } | head -n 10   Outputs from line 912 instead of line 11.  Tee is not a good option, because each command is supposed to consume part of the stdin.   Is there a simple way to get this working?


Why can not upgrade texlive2016 to texlive2017 on windows

I have texlive 2016 installed on my windows OS, to use texlive 2017 you need to download it (over then 2.5GO), I think this is a tedious operation every time you  want to pass from an old texlive to a recent one.  My question is is there a posibility just to upgrade texlive 2016 to texlive 2017without removing, downloading, and installinig  the entire texlive?


Any ideas what's causing those chunks of geometric artifacts?  Argh.


Is being a right triangle both necessary and sufficient for the Pythagorean Theorem to hold?

I recently encountered a Stack Overflow question (since closed) in which the OP was testing for whether a triangle was right by whether or not it "met" the criteria of the Pythagorean Theorem (i.e. whether or not the square of the hypotenuse is equal to the square of the two sides). The code was to this effect:  public void Test(int a, int b, int c) {    if ((c * c) == ((a * a) + (b * b)) {      System.out.println("This is a right triangle");    }    else {      System.out.println("This is not a right triangle");    } }   (There are obviously some other problems with this code, like the fact that it doesn't validate the input to make sure that the inputs are positive and the fact that it only accepts integers).  The question was asking about something completely different in the code and never directly addressed the test, but I got to thinking: is this a valid test for whether a triangle is a right triangle?  Obviously, the Pythagorean Theorem states that, for all right triangles, $a^2 + b^2 = c^2$ (where $a$ and $b$ are sides and $c$ is the hypotenuse). This will hold for all right triangles, so being a right triangle is a sufficient condition for the Pythagorean Theorem to hold.  Is it also a necessary condition? I.e. if $c^2 = a^2 + b^2$ for some arbitrary triangle, is the triangle necessarily a right triangle? Or are there counterexamples?


How do I resolve a string to the corresponding enum entry in C#?

I have the following code in C#   class Program     {         static void Main(string[] args)         {              string text;              Console.WriteLine(fooClass.RunInfoRequestType.text2);              Console.Out.WriteLine("\nPress [Enter] key to close ...");             Console.ReadLine();          }          public static class fooClass         {             public enum RunInfoRequestType             {                  text1 = 1,                 text2 = 2,                 text3 = 3,                 text4 = 4,                 text5 = 5,                 text6 = 6,                 text7 = 7,                 text8 = 8             }          }       }   I would like to know how could I pass dynamically the string text value to the fooClass.RunInfoRequestType.text2.  For instance, set "text3" to the string text and pass the string to the fooClass.RunInfoRequestType.[text]. I don't want to change the enum at runtime. Just, pass the text string as a parameter to get the enum value.


Been trying to code a linear search algorithm in Java following some pseudocode that we've been given. (Sorry if this is a stupid question)  I'm fairly new to Java, there's probably an easier way of doing this, but I'm just unsure as the pseudocode doesn't seem to be working correctly. I tried fiddling around with the numbers - is there a quick fix?  I've used the following code, but keep getting a 'java.lang.ArrayIndexOutOfBoundsException'  // Linear Search Standard Algorithm private static void linearSearch() {      // Declare a new scanner object     Scanner in = new Scanner(System.in);      // Declare variables used in the program     String[] arr = new String[] {"Mick", "Jerry", "Bob", "Chris"};     String name = "";     boolean found = false;     int position = -1;     int counter = -1;      // Prompt User to enter a value to be searched for     System.out.print("Search For: ");     name = in.nextLine();      // Search for the requested item     while (found == false || counter < arr.length) {          counter += 1;          if (name == arr[counter]) {              found = true;             position = counter;          }      }      // Output whether the variable was found or not     if (found == true) {          System.out.println(name + " was found at position " + position + " of the array.");      } else {          System.out.println(name + " could not be found in the array.");      }  }


How to script file for a Mac with several Terminal commands

I have few Terminal commands which i'm using so frequently,So i though to automate it to reduce the effort of copy-pasting the commands one by one in terminal and time.  I created a .command file for this but the issue with it is, it is only executing the first statement.  The first statement is connecting to a remote server and it needs a password , for that i usually copy-paste the password. When i changed it to a .command file after executing the first command it is requesting a password in a new window and further commands are not getting executed in the new window.  Does can anyone help/suggest to find a way to do this?  Below is the commands,  #!/usr/bin/expect set timeout 60 set host 111.111.111.11 set name root  set password **************  spawn ssh $host -l $name   expect {     "(yes/no)?" {         send "yes\n"         expect "password:"         send "$password\n"     }     "password:" {         send "$password\n"     } }  expect "#" # test whether login to host send "ssh-agent bash\n" send "ssh-add etlbi-master\n" send_user "Now you can do some operation on this terminal\n" send “ssh-add etlbi-master”   Getting the below error,Also not able to enter any commands on the terminal window.  Last login: Thu Jun 20 17:39:57 2019 from 111.111.111.11 root@Ubuntu-1689-xenial-64-minimal ~ # Now you can do some operation on this terminal usage: send [args] string     while executing "send “ssh-add etlbi-master”"     (file "/Users/sand/Documents/google/newtest.command" line 25) logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed.   [Process completed]   Note: i'm the admin.  Thanks in advance!


Remove locked questions from hot questions

There's a question over on AskUbuntu... you know the one.  Its a hot question. It also happens to be mod locked (not closed).  This means no new answers, no new comments, and no new votes.  Because of the excessive immaturity of users commenting on the question over there (and given the comments I saw that are likely deleted - from over here rather than there) and the... lets just say "provocatively phrased title" (which isn't at issue here - I have opinions about it though if you want to read about that elsewhere) it is locked.  And that is the issue - it is locked.  There is no interaction that anyone can have with the post from HNQ.  So remove it from the HNQ pool.  There is no reason for a locked post to ever be in HNQ because of the lack of interaction that people can have with it. Protection says "no newbies".  A locked post says "everyone, just go away."  Please let that message apply to the HNQ pool.  And please, it is the very last thing I want showing up in a other community advertised post in a big box for my manager to see on the side of my browser.


Can the foobar2000 app be started using the play/pause key?


Why does a resistor need to be on the anode of an LED?

Please be kind, I am an electronics nub.  This is in reference to getting an LED to emit photons.  From what I read (Getting Started in Electronics - Forrest Mims III and Make: Electronics) electrons flow from the more negative side to the more positive side.  In an example experiment (involving a primary dry cell, a SPDT switch, a resistor and an LED) it states that the resistor MUST be connected to the anode of the LED.  In my mind, if the electrons flow from negative to positive, wouldn't the electron flow run through the LED before the resistor; thereby making the resistor pointless?


Why is multiplication commutative - intuitive explanation

While I know that both addition and multiplication are commutative operations, I can easily visualize that, e.g. 3 + 4 = 4 + 3 = 7 by thinking of seven objects in a row and separating them into two heaps of three and four objects, respectively. Now it's trivial to conclude that commutativity of addition amounts to labeling which one of the heaps is first and whics one is the second. This is arbitrary, therefore addition is commutative.  However, I cannot find a similar visualization to help me see why 3 x 4 = 4 x 3 = 12. I'm sure there must be a way.


Why is the derivative of $e^x$ equal to $e^x$?

I know that for the exponential function $e^x$ that the derivative will equal $e^x$ itself. But why? And also what is the significance of that?  Is that what gives $e$ its power? The rate of change of $e$ as it grows to the power of $x$, is $e^x$ itself. I get that the function doesn't produce $e^x$, that merely the rate at which its changes between $e^x$ and $h$ as $h \to 0$. But the intuition as to why and what is the significance to math eludes me. Mind you, I understand the math behind it, just not the intuition. For example, I understand this entire post  but why  I understand the math behind this post . But I'm looking for an analogy.


"She tells me" versus "She is telling me"

I have just watched a movie and in particular moment in a movie (one person is standing outside the door, and there are three characters inside room: A, B and C. A is saying something in foreign language and B is translating it to the C) B is saying: "She tells me old man is standing outside the door". My question is: Shouldn't there be Present Continuous tense, like "She is telling me old man is standing outside the door"? Why there was Simple tense used in that sentence since that all happened in ona particular moment?   Thank you in advance


Periods of decimal representations of reciprocals of prime numbers? How to compute them for very large primes?

I wanted to know if there exists a formula or a script that generates the period length for the reciprocal of prime numbers. So for example $\frac17 = 0.142857142857142857$ so a period length of $6$. I know there is a 10^k mod p but this takes too long for large numbers. I have seen in this question:  @Ross Millikan mentioned that "The period is always a factor of the quotient of the denominator" but I don't know of any literature behind this. If you know anything about literature on this idea or a formula that can quickly calculate the period length for very large primes, I would be grateful if you can let me know Update: What I want to know more about is Ross's observation and why couldn't that be used to calculate the repeat digit period for very large numbers? So that's why I asked for literature on this. Thank you.


Prove: $\lim\limits_{n\to\infty}\frac{1}{n}\sum\limits_{k=1}^{n}\sqrt{1+\frac{k}{n}}=\frac{2}{3}(2\sqrt{2}-1)$  What method to use in order to find the closed form of summation $\sum\limits_{k=1}^{n}\sqrt{1+\frac{k}{n}}$?


Why does Python add a whitespace after printing int then string?

This is my code: num = input('Amount of numbers:') num = int(num) for x in range(1, num + 1):     if x == 1:         print('1st')     elif x == 2:         print('2nd')     elif x == 3:         print('3rd')     elif x >= 4:         print(x, 'th')  This is the output(sample): Amount of numbers:8 1st 2nd 3rd 4 th 5 th 6 th 7 th 8 th  As you can see, all numbers after 4 have a whitespace between it and 'th'. How do I fix this?


I'm trying to prove that an ellipsoid defined by $$E:=\{(x,y,z) \mid \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} \le 1 \}$$ with $a,b,c \gt 0$   is convex, but I'm having trouble with it. I tried with the definition of convexity, but I reach a point of $$ \lambda \left( \frac{x_1^2}{a^2} + \frac{x_2^2}{b^2} + \frac{x_3^2}{c^2} \right) + 2 \lambda ( 1 - \lambda) \left( \frac{x_1y_1}{a^2} + \frac{x_2y_2}{b^2} + \frac{x_3y_3}{c^2} \right) + (1 - \lambda)^2 \left( \frac{y_1^2}{a^2} + \frac{y_2^2}{b^2} + \frac{y_3^2}{c^2} \right) \le 1 $$  and I don't know how to proceed from there (or even if it's right). I think that there might be another (easier) way to do this, but i can't come up with it, so if someone could help me with this proof I'll be really grateful $:)$


how to use the IDataContractSurrogate for sending System.Net.Mail.MailMessage in WCF?

Can someone guide me towards implementing the IDataContractSurrogate for the MailMessage class in .Net Framework?  I'm currently trying to pass the MailMessage class as an object and it doesn't work...it throws the following exception...     Type 'System.Net.Mail.MailAddress'   cannot be serialized. Consider marking   it with the DataContractAttribute   attribute, and marking all of its   members you want serialized with the   DataMemberAttribute attribute. See the   Microsoft .NET Framework documentation   for other supported types.   I would appreciate any help...  Thanks so much!!


Can I wear two hat simultaneously like this?


The following link recommends against using loops in shells.    Why is this? Here is an example loop I just happened to be looking at when I came across that answer:  find /etc/postinstall -name '*.sh' | while read script do   echo Running $script ...   $script   mv $script $script.done done


Is it possible to make a sequence of renders and give the user the option to cancel the process through the UI at any given time?

I'm trying to make a script where I have to render several images of the same scene at the same frame, and write to disk with appropriate names. The problem is that although this works fine with a non-responsive UI, it doesn't work well when the render progress appears in the Blender UI.  I mean,  bpy.ops.render.render()   uses "EXEC_DEFAULT" when called from a script. This leaves a blocked User Interface until the render finishes, meaning that you can't cancel the process, except by killing Blender. The problem is that the render may be too big in resolution, and the user could want to stop the process when realizing that the render could take hours, so the idea is to cancel this process without losing the currently opened project.  If I call,  bpy.ops.render.render("INVOKE_DEFAULT")   I get a nice preview bar in the Info Window with a clickable "X" button. I want the user to be able to press that button to cancel the operation if needed, but for a series of renders (not animation).  The problem here seems to be when trying to loop this command with the INVOKE_DEFAULT context to write several renders. I made a lot of testing, and this way of calling the render operator seems to continue with whatever is next in the script, so it loops very fast and ends before the rendering actually finishes.  I think that I need some way to stop the script and make it wait until render finishes to continue looping with the next ones. I tried the "render_complete" and "render_cancel" handlers, but I can't use them to start a new render or even make the rest of the script wait until the loop of renders is complete. I tried threading and events without success either. Maybe I'm doing something wrong.  import bpy  render = bpy.context.scene.render path = render.filepath = "/tmp/" shots = ["one", "two", "three"]  for x in shots:     render.filepath = path + x     bpy.ops.render.render("INVOKE_DEFAULT", write_still=True) # this doesn't work      # but if I use:     # bpy.ops.render.render(write_still=True)     # without the INVOKE thing, images are written as expected,     # but losing the possibility to see the progress and cancel rendering


How do I assign a string as a keyboard shortcut?

I'd like to assign a frequently used string to a shortcut key, so when I press it, it types it in whatever application I'm in. So for example, when I type Shift-F12, it types "This is wonderful!" in whatever Gnome app I'm in at that time.


Given $f:A\to B$, and $g:f(A)\to A$, show that if $g \circ f = I_A$ and $f \circ g = I_{f(A)}$, then $f$ is $1-1$ and $g=f^{-1}$

Given $f:A\to B$, and $g:f(A)\to A$, show that if $g \circ f = I_A$ and $f \circ g = I_{f(A)}$, then $f$ is one-to-one and $g=f^{-1}$  $I_A$ denotes the identity element in $A$ and $I_{f(A)}$ denotes the identity element of $f(A)$  I want to somehow get from $g \circ f = I_A$ to $\forall a_1, a_2 \in A, f(a_1)=f(a_2)\implies a_1=a_2$  I'm pretty lost...


How do I filter value with prepared statements to keep security?

I use Prepared Statements mostly to prevent SQL injections. Now I also need to filter a ENUM type. But how should I use it in my prepared statements to maintain security? I have a table of addresses and need to filter on the user's invoice addresses. How do I do that and keep the security? Or does it not matter? Two options I can think of. "Invoice" in the array as a string. public function getCustomerInvoiceAddresses($customerNumber) {     $query = 'SELECT contactPerson, company, street, zipCode, city, deliveryMethod                  FROM address                  where FK_customerNumber = ?                  AND addressType = ?';     $paramType = 'is';     $paramValue = array(         $customerNumber,         "Invoice"     );     $invoiceAddressArray = $this->ds->select($query, $paramType, $paramValue);     return $invoiceAddressArray; }  Invoice in the SELECT public function getCustomerInvoiceAddresses($customerNumber) {     $query = 'SELECT contactPerson, company, street, zipCode, city, deliveryMethod                  FROM address                  where FK_customerNumber = ?                  AND addressType = "Invoice"';     $paramType = 'is';     $paramValue = array(         $customerNumber     );     $invoiceAddressArray = $this->ds->select($query, $paramType, $paramValue);     return $invoiceAddressArray; }  Or should I pass the string "Invoice" when I call the function? $invoiceAddresses = $customer->getCustomerInvoiceAddresses($customerNumber, "Invoice");


My question is about $CFT_1$. Page 18 of  says that $$L={\frac{\overset{.}{Q}^2}{2} - \frac{g}{2Q^2}}\tag{1.11}$$ is the most general Lagrangian that preserves time translation and scale invariance in $CFT_1$. How does one prove that?


For $p,q$ primes such that $q|p-1$, show there is only one non-abelian group of order $pq$, up to isomorphism

This question has been answered a lot of times on this site, but I'm looking for an approach that does not use Sylow theory, since this is not covered in my syllabus. All answers I read this far used material that I did not yet learn. My level this far is up to automorphisms, group actions, and the isomorphism theorems.  My syllabus uses the following construction of a non-abelian group of order $pq$ where $q|p-1$. Let $N=C_p$ such that $\operatorname{Aut}(N)$ has order $p-1$. From Cauchy's theorem we deduce that there exists a subgroup $H\subset \mathrm{Aut}(N)$ of order $q$. Let $\tau:H\to \operatorname{Aut}(N)$ be the identity map. Then $N\rtimes_{\tau}H$ has order $pq$ and is non-abelian.   This far I can follow, but now I have to show that this group is the only non-abelian group of order $pq$. A hint for this exercise is to use that $(\mathbb{Z}/p\mathbb{Z})^*$ is cyclic if $p$ is prime.   My attempt (it is not really an attempt, I just looked what I could deduce, but it led me nowhere): Let $G$ be a finite non-abelian group of order $pq$. There exists, by Cauchy's theorem, an element $g$ of order $p$, so $\langle g\rangle$ is a subgroup of $G$ of order $p$ and index $q$, and since $q$ is the smallest prime dividing $pq$, this subgroup is normal.   Furthermore, it is easy to deduce that the center is trivial, since if it is not, $G$ is abelian because then $G/Z(G)$ is cyclic.   I have the idea that in some way I have to say that we know $G$ can be written as a semi-direct product (but how do I know that this is always the case?). Then this semi-direct product should be between $C_p$ and $C_q$, which are both abelian, so the used automorphism cannot be the identity map. From there I think I have to show there is only one map possible, thus only one possible semi-direct product. Because we already found one way to write $G$ as a semi-direct product, then the result would follow. But how exactly does this work? I think they want me prove the theorem this way, but I don't see how and why this would work.  Any help is much appreciated!


"How do I instruct my daughter to drink water from a bottle from 'up'!", I suddenly struck a question.  If that girl has drunk water by touching her lips and then if any other person comes to drink that water, what should I say?     Don't drink, it is 'used' water?   Please note that I'm not talking about germs or contamination. Here, I just want to know that someone else has already drunk from the bottle.  In Hindi, we have a word/noun for that. And, it works not only for bottle but also for food.  For instance, if I have a . I licked it just once (the thing is intact, unbroken, I did not bite it) and kept it in my plate and went somewhere for a moment. My wife comes and sees the chocolate-coated wafer in the plate. She takes and is about to put it in her mouth. You, being in front of her, stops her... Whoa, that's Ruchir's. She may then reply... "Oh, okay" and keeps it back.  Kit-kat is just an international example I came up with! That's because others here may not be aware of Indian dishes that we eat with our hands. For instance, . You never know whether someone has already eaten from the plate. So, you may 'replace' khichdi with kit-kat above!   I am eager to know the native speakers' answer about this. Is there any word that describes someone has already drunk/eaten from that bottle/dishes.  J.R.'s comment about someone having mouth on it is perfect for drink/bottle. But ...food?  Thank You.


Finding Disk Usage in Python 2.7 on Windows

I'm using Python 2.7 on Windows and I need a way to calculate how much free space is left on the disk, as well as total disk space if possible. I know in Python 3 there's shutil.disk_usage, and I've tried replicating that code in 2.7, but to no avail. Unfortunately, os.statvfs doesn't work on Windows (not in 2.7 anyway). Using another version of Python isn't an option, I'm afraid. Any way to make this work?


Four cards are face down on a table. You are told that two are red and two are black, and you need to guess which two are red and which two are black. You do this by pointing to the two cards you’re guessing are red (and then implicitly you’re guessing that the other two are black). Assume that all configurations are equally likely, and that you do not have psychic powers. Find the probability that exactly j of your guesses are correct, for j = 0, 1, 2, 3, 4. Hint: Some probabilities are 0. My professor worked out this example in class and I know the answers for j = 1 and j = 3 are zero, j = 0 is 1/6, j = 2 is 2/3, and j = 4 is 1/6 but I do not understand the process or concept behind the question. I do not understand where the numbers are coming from and why only the even js have a probability but not the odd js. The j guesses and pointing is confusing me. Can someone please help explain the question, I would appreciate it.


The word "answers" can't fit in the div under questions tab


Multidimensional array passed as argument to a function

My code below is trying to pass a multidimensional array to another function to perform certain tasks on it however it always produces the following error which I can't understand why. Everywhere I have look online states it was people using the '&' to pass the array parameter but I don't do that.  pong.c:48:17: warning: passing argument 1 of 'render' from incompatible pointer type [enabled by default]    case PAINT:                   render(new_frame, argv[1], test_screen_size_x,test_screen_size_y);   My code:  void render(char *new_frame, char *out_frame, int screen_size_x, int screen_size_y);  int main(int argc, char **argv) {     int state  = START;     // Holds the current state of the state machine      if(argc > 1){         int test_screen_size_x;         int test_screen_size_y;          test_screen_size_x = *argv[2];  // int screen_size_x         test_screen_size_y = *argv[3];  // int screen_size_y         char new_frame[test_screen_size_x][test_screen_size_y];             while(1){             switch(state){                  /*  START state -                  */                 case START:     player_config(&player1, test_screen_size_y);                             player_config(&player2, test_screen_size_y);                              state = CALC;       // Move to the CALC state                             break;              /*  CALCULATION state - Performs all the game calculations             */             case CALC:      paddle(&player1, test_screen_size_y); // Calc paddle position of player 1                             paddle(&player2, test_screen_size_y); // Calc paddle position of player 1                              state = PAINT;       // Move to the PAINT state                             break;              /*  PAINT state -              */                                      case PAINT:     render(new_frame, argv[1], test_screen_size_x, test_screen_size_y);                              state = CALC;       // Move to the CALC state                             break;             }     }     return (0);        }   void render(char *new_frame, char *out_frame, int screen_size_x, int screen_size_y) /*  Function creates the new frame  */ {         memset(new_frame, 0, sizeof(new_frame[0][0]) * screen_size_x * screen_size_y);  // Fill multi-dimensional array full of zeros      draw_dyn_object(&player1, new_frame);     draw_dyn_object(&player2, new_frame);      out_frame = new_frame; }  ...


Why alias inside function does not work?

See the code below:  a()(alias x=echo\ hi;type x;alias;x);a   I have an alias inside a function, I do not want to change the external environment (that is why I am using () instead of {}), even the code saying the alias was successfully setted, it does not work, check the output out:  x is aliased to `echo hi' ... alias x='echo hi' x: command not found   I heard about doing shopt -s expand_aliases would solve, but not only it has not had any effect as well as I could not depend on bash because I am working with dd-wrt's busybox's ash.  Someone know this issue?


How to prove that $2 \arctan\sqrt{x} = \arcsin \frac{x-1}{x+1} + \frac{\pi}{2}$

I want to prove that$$2 \arctan\sqrt{x} = \arcsin \frac{x-1}{x+1} + \frac{\pi}{2}, x\geq 0$$  I have started from the arcsin part and I tried to end to the arctan one but I failed.   Can anyone help me solve it?


Is there in anyway possible to prove that 0.999 recurring does not equal to 1

I know that the reason why 0.999 recurring equals to one because it's goes on forever, and the difference between 0.999 recurring and 1 is 0 since it's infinite. But is it possibly to prove otherwise? I read online articles about surreal numbers and hyper real numbers, but does it help in proving 0.99 recurring bit equal to 1?


How do I retain all attribute data when clipping two polygons in R?

I would first like to say that my question is very much similar to , but the proposed solutions don't seem to be working for me. I think that my question is slightly different, as I'm performing a clip/intersection rather than a difference. Onto it!  My input can be found , and an example country outline can be downloaded . I've been using the Ethiopia ESRI shapefile.  What I'm trying to do is quite simple. I first clip the country shapefile to the FEWSNET shapefile. Once the clip is performed, I need to symbolize the ML1 variables from the latter shapefile. In QGIS, I perform the vector clip, then with the newly clipped shapefile, I go to Properties > Style, change it from single to categorized, then choose my symbology for the ML1 category.   The code that I have so far has also been quite simple:  library(rgdal) library(rgeos)  #read in ML and Ethiopia shapefiles ea.ml1 <- readOGR(dsn = "D:/Mapping-R/Ethiopia", layer = "EA201507_ML1") eth <- readOGR(dsn = "D:/Mapping-R/Ethiopia", layer = "ETH_adm0")  #perform clip eth.clip <- gIntersection(ea.ml1, eth, byid = TRUE)   The problem is that the data that I need to symbolize (ML1) exists under ea.ml1@data$ML1. When I perform the clip, it appears that ea.ml1@data is lost altogether. How do I retain that data with my clip so that I can properly symbolize it?


boss asked me to draft them a letter of rec?

A while ago I asked my boss to write me a letter for a specific school, and he responded asking me if I could draft it, and he showed me the edits and final draft before sending it out. Now I asked him to send me letters for some other schools too and he agreed, I'm assuming he'll just use the same letter. But I just now realized that one of the schools explicitly states that I am to not be involved in the letter in any way. What should I do? Is this a common thing? Should I just let it slide? How seriously do schools take this situation anyways? and from what I've seen from the letter I drafted it doesn't look like any sentences overlap with anything in my personal statement. I would also feel bad asking him to rewrite a letter thats already perfectly well written. At the same time I just feel, well, kinda bad. Idk, not saying anything to my boss about the school letter guidelines doesn't sit right with me.


different spacing aroung equal sign for display/text mode

as I wanted to increase the space surrounding the = sign in my equations, I changed the thickmuskip length in the preamble  \setlength{\thickmuskip}{14mu}   It works fine, and I like the result in display-style equations. The problem is that it also affects equations written in text-style (ie those with $$) and there it does not look good. How can I get a different spacing around = in display and text mode?  Thanks


(The linux equivalent of TimeThis.exe)  Something like:  timethis wget foo.com Receiving foo.com   ...  wget foo.com took 3 seconds.


Change e-mail address of Stack Exchange OpenID account

How can I change the e-mail address of my Stack Exchange OpenID account?  Unfortunately I can't find such an option anywhere.


What is the ideal $\sum_{i \in I} \mathfrak{a}_i$?

I encountered the ideal $\sum_{i \in I} \mathfrak{a}_i$, where the $\mathfrak{a}_i$'s are ideals of an entire ring. However, no explanation was given about this ideal. Is it the ideal $\lbrace \sum_{i \in I} a_i \mid a_i \in \mathfrak{a}_i \rbrace$? Is it possible to express this ideal as the ideal generated by some set, i.e. the intersection of all ideals containing some set?


What software do you use to accurately draw geometry diagrams?


2D/3D Area parameter differences in Surface Volume calculation dialog box?

In dialog box of volume surface calculation and also in ASCII file there are 2 out come with names 2D Area and 3D Area. What is difference between these two numbers? What is included in 3D that is not in 2D? For example :   Plane_Height, Reference, Z_Factor, Area_2D, Area_3D, Volume  45,00, ABOVE, 1,000000, 644929,78213426, 716708,47208592, 17433798,859008   Note: Decimal point is  a comma.


I'm looking for a BibTeX style that formats the reference list at the end in the way shown below. The key points are:   The references are sorted by the (list of) authors, and then each author has a list of references keyed by year.  Each author has a full line for the name, and then the references for that author are listed below with no name, not even "—"   I'm not too worried about the exact punctuation; if I had any class that sorted by authors, I could hack the punctuation if I had to.   I have seen this style in various books. One modern example is Jech's Set Theory, 3rd edition. But I have never found a BibTeX style that generates this kind of output.     Example of desired output:    Jones, Sam  [2001] "Paper", Journal, etc [2002] "Other paper", Journal, etc  Lewis, Jo [1999a] Some book, Publisher, etc [1999b] "Another paper", Big Journal, etc


Why won't objects appear in motion tracking?

I set up a motion track, then said set up tracking scene. I added a monkey, a subsurf modifier, and just a red material that I clicked shadeless on. When I render it shows up ghostlike and you can't see it good. In the 3d view it shows the image and the monkey.


Minkowski Dimension of Special Cantor Set

As can be seen  (exercise 1), Terry Tao gives an exercise to find the Minkowski Dimension of the Quadnary Cantor Set, and of a special Quadnary Cantor Set.  The two sets are: $$C := \left\{\sum_{i=1}^{\infty} a_i4^{-i} : a_i \in \{0,3\} \right\}$$  and   $$C' : = \left\{\sum_{i=1}^{\infty} a_i4^{-i} : a_i \in \{0,3\} \, \, \text{if} \, \, (2k)! \leq i \leq (2k+1)! \,\, \text{and arbitrary otherwise} \right\}.$$  I managed to find the Minkowksi Dimension of the first one by noting that $C_\delta$, the $\delta$-fattening of $C$, has $\text{vol}(C_\delta)$ equal to the $n^{th}$ iteration of the Quadnary Cantor set.    For the second one, I've found a closed form expression for the volume if $\delta_n = 4^{-(2n)!}$, since I suspect this should be a lim sup, but I'm not sure.   The closed form I found is:  $$\text{vol}(C_{\delta_n}) = \sum_{k=1}^{n-1} \sum_{j=0}^{2k(2k)!} 2^{-(2k-1)!+2j)},$$  but I'm not sure how to even begin manipulating the expression  $$ \frac{\log(\text{vol}(C_{\delta_n}))}{-(2n)! \log(4)}. $$  In particular, we are to show that the upper MD of $C'$ is $1$, while the lower MD is $\frac{1}{2}$, but it seems to me that the worst sequence we can use is $4^{-(2n+1)!}$, since this would give a volume of  $$\text{vol}(C_{\delta_n}) = \sum_{k=1}^{n} \sum_{j=0}^{2k(2k)!} 2^{-(2k-1)!+2j)}.$$  To note how I got my closed form expression, at the $i=(2k)!$ iteration, we are removing  $$2^{(2k)! + ((2k)! - (2(k-1)+1)!)}$$ intervals of length $$4^{-(2k)!}$$ note that we must remove $((2k)! - (2(k-1)+1)!)$ more intervals, since we did not remove anything for some time and also that $$(2k+1)! - (2k)! = 2k(2k)!.$$  Also it is clear that the lim inf (lower MD) is at least $\frac{1}{2}$, since $C \subset C'$, but it's unclear why it isn't strictly larger.


If $f$ is a continuous function that satisfies $$f(\frac{x+y}{2})\leq \frac{f(x)+f(y)}{2},$$ then $f$ is a convex function.  I tried to prove it by contradiction but I didn't get the desired result. Any help is welcome


C# Speech Recognition - Is this what the user said?

I have need to write an application which uses a speech recognition engine -- either the built in vista one, or a third party one -- that can display a word or phrase, and recognise when the user reads it (or an approximation of it).  I also need to be able to switch quickly between languages, without changing the language of the operating system.  The users will be using the system for very short periods.  The application needs to work without the requirement of first training the recognition engine to the users' voices.  It would also be fantastic if this could work on Windows XP or lesser versions of Windows Vista.  Optionally, the system needs to be able to read information on the screen back to the user, in the user's selected language.  I can work around this specification using pre-recorded voice-overs, but the preferred method would be to use a text-to-speech engine.  Can anyone recommend something for me?


Let $S$  be the set of$(\alpha , \beta)\in \mathbb{R^2}$ such that $\frac{x^{\alpha}y^{\beta} }{(x^2 + y^2)^{1/2} }\rightarrow 0 $ as $(x,y) \rightarrow (0,0)$   then $S$ is contained in    {$(\alpha,\beta) : \alpha>0, \beta> 0 $} {$(\alpha,\beta) : \alpha>2, \beta> 2 $} {$(\alpha,\beta) : \alpha+\beta> 1 $} {$(\alpha,\beta) : \alpha+4\beta>1 $}   What I have tried is   Putting $ y=mx$   $  $  then we will get in the power of $x$  $ \alpha + \beta-1 $ so for convergence to  $  0 $ we yield option 3


Can media corportation take away my domain name?

Recently i've noticed that there is actually free cool domain name, let's say 'googleinsider.com`. Buy this domain is my dream and for some money (not so small well) i can buy this domain.  And i will use it for website then. Website is about somewhat connected with real Google. But i will not write there anything bad.  However, i understand, that if i use this domain for my project, Google will try to take it away from me, as it is a trademark or brand name. Is that possible? Is it really easy (is there are any examples of domains returned by such companies)?


I'm having some trouble with setting up a SMTP server on a windows server 2003 machine, while trying to send emails using PHP through the internet, but to domain email addresses.  Common info:   I'm a newbie on this, so I don't know many of the concepts Machine has Windows Server 2003 Server Machine on a domain (mydomain.com) Machine is not a domain controller Machine accesses a domain controller through the internet (WAN with a corporate VPN link by the internet provider setup on the machine's gateway - adsl modem/router) Email addresses use the same suffix (mydomain.com) Do not have access to domain controller configuration   First Scenario   TCP/IP DNS: 1st 192.168.200.xxx   2nd 8.8.8.8 Direct access to domain controller is functional PHP mail using localhost to a user@mydomain.com won't work, because the remote mail server rejects emails from internal traffic (apparently!?!)  (internal DNS)   Second Scenario   TCP/IP DNS: 1st  8.8.8.8   2nd 192.168.200.xxx   (switched) Direct access to domain controller is not functional, only local accounts work PHP mail using localhost to a user@mydomain.com does work, because the remote mail server is accessed through its internet/external address (ISP DNS).   So, what I needed is to have both (1) access to the domain controller and (2) PHP mail using localhost to a user@mydomain.com account working.  Any pointers? Thanks in advance  edit: initally posted at stackoverflow but changed it here after recommendation.


It is found in my apartment in Finland. I had to kill it to stop it from getting away before looking for the camera, but it looked pretty much the same alive and intact. It's length is about half a centimeter, and the younger ones look darker. It is often found in dark. Since their appearance, I often notice red and slightly itchy bug bite in the morning. The question is what is this insect?


How to write if there is no file in python

The user types the name of file. If he writes the wrong name of the file and python has an error like "FileNotFoundError: [Errno 2] No such file or directory: '5'". How can I write to user that he has typed the wrong name of the file? This code doesn't want to work:   try:      filename = input ("Your file name") except OSError as e:     print('We have an error: ', str(e))


I remembered bash can do the following:  Suppose there are 3 files: a,b,c in the current directory, when I input:  $> somecommand *   and then press a key or key combinations or a key sequence, the wildcard * online expanded as:  $> somecommand a b c   but I cannot remember and cannot google out the key sequence! help!


Show that a group of order $2^7 5^7$ cannot be simple

I wanted to know how to proceed for this general kind of problem. I know that I should show that for a p-sylow $n_p=1$. But I don't really know how to study the other cases enough to prove it.


How to load dynamic library defined extern integer from python

extern int acc; void Cassie2d::Step(ControllerTorque* action) {   dyn_model_.setState(mj_data_->qpos, mj_data_->qvel);   dyn_state_.UpdateDynamicState(&dyn_model_);   mju_copy(mj_data_->ctrl, action->torques, nU);   mj_step(mj_model_, mj_data_);   acc = mj_data_->qacc[0];   Render(); }   I use extern int here to access the variable from mj_data -> qacc, after I compiled the c++ file, how could I load this library and access the variable in python.


Why doesn't umask change execute permissions on files?

If I change the umask to 0000, I'd expect a text file to be created with rwxrwxrwx permissions (based on my understanding of the umask, ) However, when I try this, I get the following  $ umask 0000 $ touch /tmp/new.txt $ ls -ld /tmp/new.txt  -rw-rw-rw-  1 alanstorm  wheel  0 Jun  2 10:52 /tmp/new.txt   That is, execute permission is omitted, and I end up with rw-rw-rw- for files (directories are rwxrwxrwx).  I tried this on my local OS X machine, an old BSD machine I have at a shared host, and a linux server running on linode.   Why is this?  Its my understanding that umask is the final arbiter of permissions -- is my understanding of this incorrect?  If so, what else influences the default permissions of files on a unix system?


How do I install ndiswrapper support for an unsupported RTL8723DE wireless module?

I have not much experience with ndiswrapper but some vague memory of using it with some broadcom module long back. Now, here is the problem. Realtek RTL8723DE wireless module is used in my new HP 15-BS576TX laptop. I haven't installed Linux yet. But, would like to check if Ndiswrapper can help use the Windows driver to work in Linux. Here is the Windows 10/8/7 driver for this RTL8723DE wlan module:   I extracted the exe and can see a folder /RTWLANE_Driver/Wind7X86/ which has rtwlane.sys and few other files which I presume is related to the wireless driver. Is there any chances of luck with ndiswrapper considering the driver executable actually contains win8/win7 drivers.  Thank you.


Let $A$ and $B$ be $n \times n$ matrix, each with $n$ distinct Eigenvalues. Prove that $A$ and $B$ have same $n$ eigenvalues iff $AB = BA$.


NullPointerException into JUnit 5 test for JTW token validation

I want to create JUnit 5 test for Rest API which uses JWT token validation:      @Test     public void resetTokenTest_OK() throws Exception {         when(userService.findByResetPasswordToken(anyString())).thenReturn(trueOptional);          mockMvc.perform(post("/users/reset_token")                 .contentType(MediaType.APPLICATION_JSON)                 .content(ResetPasswordTokenDTO))                 .andExpect(status().isOk())                 .andExpect(jsonPath("$.resetPasswordToken").value(randomString_254))                 .andExpect(jsonPath("$.login").value("login"))                 .andExpect(jsonPath("$.status").value("200"))                 .andExpect(jsonPath("$.error").value(""))                 .andExpect(jsonPath("$.errorDescription").value(""));     }     I make a Mockup request using this payload:  {   "resetPasswordToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.VFb0qJ1LRg_4ujbZoRMXnVkUgiuKq5KxWqNdbKq_G9Vvz-S1zZa9LPxtHWKa64zDl2ofkT8F6jBt_K4riU-fPg",   "login": "login",   "status": "1",   "error": "",   "errorDescription": "" }   I get NPE for this :   Caused by: java.lang.NullPointerException     at org.engine.utils.GenericUtils.getLoggedInUser(GenericUtils.java:15)     at org.engine.rest.UsersController.lambda$resetToken$0(UsersController.java:159)     at java.base/java.util.Optional.map(Optional.java:258)     at org.engine.rest.UsersController.resetToken(UsersController.java:153)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.base/java.lang.reflect.Method.invoke(Method.java:564)     at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)   Full :   For some reason I get NPE for this code:  return (Users) SecurityContextHolder.getContext().getAuthentication().getPrincipal();     Do you know how I can fix this issue?


App is running even though disabled! Why?

I did:  pm disable com.android.systemui   I get:  pm list packages -d package:com.android.systemui   So it is disabled. Still I get:  ps | grep systemui                                             u0_a71    2053  1183  462960 27552 ffffffff 40089a40 S com.android.systemui   so it is still running, even if I kill it, it restarts! How can it both be running and be disabled at the same time?


I'm using tmux and cueing up a very large copy:  /bin/cp -aRv /mnt/src/folder/. /mnt/dest/folder/ 2>&1 | tee /log/big_copy_log   When I run without tee, I see output on the terminal just fine. With tee, nothing shows in the logfile or screen. What am I missing?   I don't mind stderr and stdout both going to the same log.  I want to do this logging so I can audit later if necessary (multiple TB sized copy) The -a is because I'd like timestamps preserved, -R because there are multiple levels of folders to move, -v to log everything. I wasn't planning to use rsync, since this is designed to be a one-way copy. Using /bin/cp because cp is aliased. Tailing . on the src because I need all subfolders copied to dest folder


Why I'm I getting the no matches found error when there is a match?

centos@ip-10-0-5-4 ~ $ sudo ls -l /var/solr/data/new_core/_default/* zsh: no matches found: /var/solr/data/new_core/_default/* centos@ip-10-0-5-4 ~ $ sudo ls -l /var/solr/data/new_core/_default/  total 4 drwxr-xr-x. 3 root root 4096 Mar 28 07:34 conf


tikzpicture polar plot with negative function values

how to make similar polar plot to  -just using tikzp. (no pgfplots, pstricks etc)- with negative axis value, there  all example just start with axis 0.   So basically I want plot data from csv file with negative value level just using the tikz package.  similar question is , with no package restriction   thanks.


Why doesn't friction accelerate a ball undergoing rolling?

Consider this situation:  A ball is moving forward and undergoing rotation. Assume that it is not slipping. Eventually, the velocity and rate of rotation of the ball decrease, and it comes to a halt. But if you observe the direction of friction (when the ball is rotating clockwise), you will see that the friction should have provided a clockwise torque to the ball and the angular velocity of the body should have increased. But this doesn't happen. Why?


Making backlight brightness persistent across reboots

I have two X200 Thinkpads.  They both have the rather annoying problem that, unless the display backlight is set to its maximal value, it emits an unbearable noise.  The odd thing is that one of them boots with the max. value and the other does not.  It is also impossible to set the second computer's display to the max. brightness value by using the brightness-up button (it will only reach 779942 of 846600).  I have to  cat /sys/class/backlight/intel_backlight/max_brightness >/sys/class/backlight/intel_backlight/brightness   Now the sound goes away but only until the next reboot.  Is there anything I can do to make the brightness value persistent across reboots?  PS.  I understand that I can run a script on startup, but something is making my first comptuer different and I would like to know what.  I have tried this using the exact same OS (the same live USB), and both computers have the same BIOS version (from 2012; 7.22?) and settings. The difference is also there in the BIOS setup, before loading any OS.  (PS II.  I might add that the problem does not exist in Windows, even with the screen dimmed.)


Tag mouseover "unsubscribe" text too big

Found this when subscribing to jQuery tag. "unsubscribe | rss" is not shown correctly.


Can I have unregistered guests at my hotel room?

I'll be staying in Paris for several weeks and I am planning to stay at an Ibis hotel. I want to know if I am able to invite unregistered guests during the day (not to sleep, eat, or take advantage of any other service). Or if I have to pay a fee.


Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()

I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error:     ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() in wp-admin/includes/nav-menu.php line 203   It seems like some sort of PHP compatibility issue. I'm running PHP 5.3.10 on my local dev machine.  What would be the best way to remedy this problem?


While removing atom following error are shown

I tried to uninstall atom from ubuntu 16.04 using    sudo apt remove atom || sudo apt remove --purge atom   command and following are the errors, please help me in resolving the issue.  E: Malformed entry 1 in list file /etc/apt/sources.list.d/sublime-text.list (Suite)     E: The list of sources could not be read.     E: Malformed entry 1 in list file /etc/apt/sources.list.d/sublime-text.list (Suite)     E: The list of sources could not be read.   While running the following command   cat /etc/apt/sources.list.d/sublime-text.list   this was the output: deb


Seeing the history of edits to one's own post

If I make a post and I make edits to it and perhaps others make edits to it as well, then, can I see the list of all edits (is this information made permanent in the SE database), or does subtituting one post with a newer one overwrite the old information completely thus losing it?  So, to summarize   If a post made by me has edited 5 times, can I see post versions 1, 2, 3, and 4 perhaps by clicking on the UI or just post 5. How many points would I need to see this info?   Thanks.


telling if element is scrolled on top of it

var parent = document.getElementById("parent").children; for (var i = 0; i < parent.length; i++) {   var m = Math.floor((Math.random() * 300) + 100);   console.log(m);   parent[i].style.margin = m+'px 0 0 0'; } #parent div {     display: block;     height: 200px;     width: 200px;     text-align: center;     vertical-align: middle;     font-size: 100px;     background-color: black;     color: white; }

1

2

3

4

5

     how can i tell if i scrolled on top of one of the child divs?  i tried using  parent.onscroll = function(){   ... ... ... }   but it does not work at all because it does not tell if scrolled on the children or not


How to add my own images to the views slide show?

I am new to Drupal. I have been trying to make a slide show on the front page but I am facing an issue on how to upload images of my choice in the slide show. I.e. the images that I have in my computers folder.  I have created a view and placed an image field in it, everything is set. I have also added the block to the main page content. All I can see on the front page is the slider title obviously since i have not been able to add any images.   Can any body tell me how to set my own images to the slider?  I don't want to use fixer slider.  I have used views slide show and some other js files for cycle.  Edit: Here is a screenprint of the view I defiined so far:


Example of a set $S$ that is countable, but the set of limit points is uncountable

What would be an example of a set $S$ so that $S$ is countable. However $S'$ is uncountable. In this $S'$ is the set of all the limit points of $S$.


How can I implement rate limiting with Apache? (requests per second)

What techniques and/or modules are available to implement robust rate limiting (requests|bytes/ip/unit time) in apache?


Disk management security and redundancy exam query

I recently passed my CompTIA core 2 exam but there was a specific part of a question i was unsure about. It was simple disk partitioning in disk management but then it went on to say "The new partitions must be formatted to ensure that users files can be secured from other users and that the disk must be configured to account for future redundancy. Does anyone know how i should of done this within disk management?


If $A^n$ = $I$ for some $n>0$, then $A$ can be diagonalized?

Let $A$ be a $n\times n$ matrix over $\mathbb{C}$. If $A^n$ = $I$ for some $n>0$, then how to show that $A$ can be diagonalized? The hint I have is to show that the characteristic polynomial has no repeated root.


Make Chapter Titles link to Table of Contents

I'm using the hyperref package to create hyperlinks in my document. The links from the TOC->chapters/sections work great, but I was wondering if there was a way to automatically insert hyperlinks from section titles BACK to the TOC (section->TOC). For easier two-way navigation (especially when clicking on an incorrect link in the TOC).   In case it matters I'm working in the report class, and this is a (minimized) version of what I have now.   \documentclass[11pt,a4paper]{report} \usepackage{hyperref}  \begin{document} First page  \clearpage \tableofcontents \clearpage  Blank page  \clearpage \chapter{First chapter} \end{document}   Thanks for any help!


how to install 20.04 onto new ssd and keep 18.04 on a second hdd how to config boot options?

desktop I am currently running 18.04 on a hdd, i wish to install a new ssd and clean install of 20.04 onto it and keep the hdd with 18.04  how should i config the ssd and on which drive should grub be installed?  thanks


A question based on analyticity of entire functions

This particular question was asked in quiz yesterday and I was unable to solve it.  Suppose f and g are entire functions and g(z) $\neq$0 for all z $\epsilon \mathbb{C} $ . If |f(z) |$\leq$ |g(z) | , the which one of them is true.  1.f is a constant function. 2.f(0) =0 . 3.for some C $\epsilon \mathbb{C} $ , f(z) = C g(z) . 4.f(z) $\neq$ 0 for all z $\epsilon \mathbb{C} $ . 4 th option can be removed by taking f(z) =0 and g(z) =2 . But I am unable to find any way to remove rest of options.


I am inexperienced in publishing papers in scientific journals. I was going over recently published paper of mine and found that I accidentally reported mean with standard deviation when I meant to report mean with standard error. The correct standard error is shown in a figure in the paper but I am wondering if I should contact the editor to make the correction.


Which Tor to install on Ubuntu 16.04.3 LTS?

I do not understand what option to install on this instruction  "Tor" or "Tor from source" , what's the difference?


Is there any rule about splitting phrasal verbs?

I thought of this question right after I posted a tweet about a service upgrading me to a free student account since I am in college. I said "That really helps a broke college student out." I actually paused for a second while I was writing that to decide if I should say     That really helps out a broke college student.   or     That really helps a broke college student out.   Are there any prescriptive rules about splitting phrasal verbs like this? I know this breaks the "don't put a preposition at the end of a sentence" rule, but that "rule" has an exception for phrasal verbs.  To clarify:   Is there any rule that says phrasal verbs can't be split, even if it is just an imposed, prescriptive rule? Does splitting a phrasal verb to put a preposition at the end of a sentence fall under the phrasal verb exception to the prepositions at the end of a sentence rule?


How to never "allow this device to access photos and videos"?

I have an iPhone at work, and I charge it by connecting it to my work laptop (Windows 7) via USB. Every damn time I do this, the phone asks me to Allow this device to access photos and videos? with the choices Allow and Don't allow.   I want to say never allow because I don't want any data connection at all but Apple has not provided this useful choice. What workaround can I use?  Note: I would just use a wall charger instead but there are no power sockets in my workspace.    added: The phone is listed as an Unspecified device under Devices and printers. When I open the properties, it just says This device is working properly. and I am not allowed to update the drivers. See screenshot:


Adjust hue / saturation such that colour X becomes colour Y

I need to convert some stock icon imagery to a pre-existing colour scheme. The method for conversion is to simply adjust the image hue to the right level.  However all I have to go on is existing imagery that has already undergone the process. As such, I know that the muddy green of 99b963 should become the dull mauve of 7763b9.  My current method is trial and error: I zoom in to an area of green, overlay a layer featuring an adjacent pixel of the target mauve, select the original layer, then adjust saturation until it looks right. At that point I step out of the adjustment dialogue, get the color picker out, and compare. Repeat until just right.  Does Photoshop / Gimp / Paint.NET have a simpler, procedural method for achieving this, in 1 step if possible? If not, is there a less trial-and-error method to achieve the right hue given a target colour difference?


USB Mouse sleeping after 5 seconds when on battery

My usb mouse sleeps after 5 seconds of inactivity when running on battery power. It wakes uo again when i press any button on the mouse. This is really annoying.  I have made lsusb, and I noticed my mouse is   Bus 001 Device 012: ID 04d9:2083 Holtek Semiconductor, Inc.  I have checked my /sys/bus/usb/devices/usb1/power/autosuspend but it is already set to 0, and the directory usb1 has many subdirectories which also have autosuspend files, and i dont know how to edit them.  Also, I would like a permanent solution, which would work for any mouse, on any of my 3 usb ports. Any ideas?  Using: Ubuntu 12.04 64bit


No hair theorem for black holes and the baryon number

The  says that a black hole can be characterized by a small number of parameters that are visible from distance - mass, angular momentum and electric charge.  For me it is puzzling why local quantities are not included, i.e. quantum numbers different from electrical charge. Lack of such parameters means breaking of the conservations laws (for a black hole made of baryons, Hawking radiation then is 50% baryonic and 50% anti-baryonic).  The question is:   If lack of baryonic number as a black hole parameter is a well established relation?   OR   It is (or may be) only an artifact of lack of unification between QFT and GR?