I am trying to get the page number to display in the header of a tabularx on each page the table spans.   The problem I am having is that the headers are created at the same time the table is, they all display the same page number.   Is there a way to have the page number displayed as a part of the header of a tabularx?  MWE:  \documentclass{article}  \usepackage{hyperref} \usepackage{booktabs} \usepackage{ltxtable}  \usepackage{ltablex} \usepackage{multirow} \usepackage{array} \usepackage{boldline}  \begin{document}  \newcounter{TableStartTableCounter} \newcounter{TableEndTableCounter} \setcounter{TableStartTableCounter}{\getpagerefnumber{TableStartTable}} \setcounter{TableEndTableCounter}{\getpagerefnumber{TableEndTable}}  \begin{tabularx}{40pc}{X|X}     \caption{Table 1 - Page \the\numexpr\value{page}} \\ \hline     \nopagebreak \textbf{Header 1} & \textbf{Header 2} \\ \hline \endfirsthead     \caption{Table 1 - Page \the\numexpr\value{page}} \\ \hline     \nopagebreak \textbf{Header 1} & \textbf{Header 2} \\ \hline \endhead     \label{TableStartTable} Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \\ \hline     Content & Content \label{TableEndTable} \\ \hline \end{tabularx}  \end{document}   And this gives these two pages:     For the second image, I want it to say "Table 1 - Page 2".

The table header gets generated once and only prints:     Page 1 of 2    ... on each and every page. Is there any way update the page number in the longtable header to reflect the actual current page, i.e., in this case:     Page 2 of 2   Speaking of this minimal example:  \documentclass{scrreprt} \usepackage{longtable} \usepackage{lastpage}  \begin{document} \begin{longtable}{| c | c |} \hline   \textbf{Foo, bar.} & \textbf{Page~\thepage~of~\pageref{LastPage}} \\   \hline \endhead   \hline \endfoot   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\   Lorem Ipsum & John Doe \\ \end{longtable} \end{document}


I have a very simple program package t; public class T {      public static void main(String[] args) {         for (int i =0; i<10; i++) {             java.util.List<Character> l = java.util.Arrays.asList('1', '2', 'a', 'b', '3', '4', 'p');             java.time.Instant then = java.time.Instant.now();             java.util.List<Character> numbers1 = l.stream().filter(Character::isDigit).collect(java.util.stream.Collectors.toList());             long streamTime = java.time.Duration.between(then, java.time.Instant.now()).toNanos();             then = java.time.Instant.now();             java.util.List<Character> numbers = new java.util.ArrayList<>();             for (Character c : l) {                 if (Character.isDigit(c)) {                     numbers.add(c);                 }             }             long forLoopTime = java.time.Duration.between(then, java.time.Instant.now()).toNanos();             System.out.println(numbers + " For Time taken " + forLoopTime + " Stream Time " + streamTime);         }     } }  When executed in Java 8 following is the o/p java t/T [1, 2, 3, 4] For Time taken 0 Stream Time 54000000 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 1000000 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0 [1, 2, 3, 4] For Time taken 0 Stream Time 0  Same executed in java 16 java t/T.java [1, 2, 3, 4] For Time taken 37000 Stream Time 701000 [1, 2, 3, 4] For Time taken 6000 Stream Time 31000 [1, 2, 3, 4] For Time taken 6000 Stream Time 12000 [1, 2, 3, 4] For Time taken 5000 Stream Time 11000 [1, 2, 3, 4] For Time taken 5000 Stream Time 12000 [1, 2, 3, 4] For Time taken 7000 Stream Time 19000 [1, 2, 3, 4] For Time taken 6000 Stream Time 18000 [1, 2, 3, 4] For Time taken 7000 Stream Time 18000 [1, 2, 3, 4] For Time taken 7000 Stream Time 14000 [1, 2, 3, 4] For Time taken 6000 Stream Time 20000  When executed in java 11 java t/T.java [1, 2, 3, 4] For Time taken 40000 Stream Time 461000 [1, 2, 3, 4] For Time taken 7000 Stream Time 39000 [1, 2, 3, 4] For Time taken 5000 Stream Time 17000 [1, 2, 3, 4] For Time taken 10000 Stream Time 20000 [1, 2, 3, 4] For Time taken 9000 Stream Time 33000 [1, 2, 3, 4] For Time taken 8000 Stream Time 22000 [1, 2, 3, 4] For Time taken 8000 Stream Time 36000 [1, 2, 3, 4] For Time taken 6000 Stream Time 17000 [1, 2, 3, 4] For Time taken 6000 Stream Time 14000 [1, 2, 3, 4] For Time taken 5000 Stream Time 22000  This indicates that no matter which version of JDK we use streams are slower than basic for loop. Is my understanding correct? I was under the impression that JDK 8 it may have been slower but not in higher versions of JDK.

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


There is no Review option on mobile view of websites. Below is the screenshot of the page as I see from mobile view of Physics Stack Exchange.    As you can see, there is no Review tab, while there is one in the desktop version:    It's difficult to always change to the desktop version for editing, and hence, I feel a Review tab must be incorporated in the mobile view to allow quick access.

The other day I was looking at Stack Overflow on my Android phone. All is made very nice and all, but I could not find the Review button/link. Is it being implemented, did I miss it, or it is not available?


I used Sparky as a name for Eevee so that it would evolve into a Jolteon, but it turned into a Flareon, instead. Why did this happen?

I know the trick that lets you force the eevolution by giving a nickname to the Eevee, but I named my eevee 'Rainer' and it was my first time ever doing so, yet it turned into a Jolteon.   I don't know why this happened, so can someone please tell me why?


When we look at stars, we see light that is years old. This would mean that if aliens were to look at earth, they would see how the earth looked in the past.  My question is, if you were to move closer to an object so that you receive more photons in your eyes, would it look like the time sped up on the object? And the same if you were to move away from an object, would the time move slower?  Just a question that popped up in my head, thanks in advance!

The light we detect today in our telescopes from distant stars is really old.  If we could travel fast (lets say, 90% the speed of light) towards a star a million lightyears away, all the time looking straight at it, would we see that star's entire history unfolds in fast-forward ▶▶ until we reach it? (if it's still there, of course).   It seems reasonable that "newer" photons emitted from that star would hit our eyes at a faster rate while we approach it.  Thanks.


FYI this is a duplicate of a message that i sent about a month ago, but i had no response and im desperate for an answer, so instead of people shutting down my question, please, i just need some help here.  I have this question that relates to Blenders Quick Smoke tool. Recently I have been rendering CGI explosions and smoke assets to be keyed in later on a short film, but I have this small problem that I think would make the explosion look a ton better, but I just cant quite figure out how to do it. Now as we may also know using composting, you can have a glare node on specific light sources to make the scene a lot more realistic, but Im trying to figure out how to do it with explosions. As seen below I rendered out this fairly simple explosion but I would really like it to have a glare to the flame parts of it.    Thanks if anyone has any ideas, also a quick side question as well, is there a way to hide the emitter (The sphere in the middle) [Cycles]. Thanks


Attempting to view a deleted question in the mobile view (as a mere mortal unable to view deleted questions) results in a 404 - in desktop view. This is probably not intended behaviour.

I often use Stack Exchange sites on my smartphone. The mobile version works great, but when I end up on a page which is not found (like a deleted question), it redirects me to the full version of site.  Can you please re-design that page to adjust on a small screen?


I am new to Stack  Exchange and I think it's very impressive.  One thing bothers me is that because it is so far down the line, I don't think beginners stand a chance of growing.  As time goes on, more and more questions are being answered and therefore if someone asks something with a really basic answer you can just comment. However, beginners can't comment until they have a reputation of 50. The only way they can build up is by answering questions. But if they answer a basic question long winded, they will be voted down because not so much effort was needed or because its already a duplicate and will lose the bit of reputation they have earned.  Can you tell me the future for beginners?

I'm not sure if this is a stupid question, but here goes anyway... I have only recently started learning PHP and Javascript and I'm reasonably proficient. One of the reasons I'm so proficient is because I LOVE Stack Overflow and find most of the solutions to my dilemmas here.   But I've found that I never get the chance to ask a question because it has normally been asked many times before and when I go through the unanswered questions to try and help someone else, they are generally WAY over my head.  So I'm not sure how to get more privileges. I can't even vote up answers that I like or that helped me. I can't comment to thank someone for their solution. It is most tragic and demoralising... How do I change the situation?


I went to upvote , which is on a , and I received this error message: "This comment is not eligible for voting or flagging"    I then went to flag it, and it let me flag it. I also tested another comment with a different flag reason other than "other:needs mod attention" and that worked as well.    I don't think you're suppose to be able to flag comments on locked posts. So it's probably a bug that I was able to.  If for some reason this is by design now, then the error message should be updated by just removing the "or flagging" part.

When trying to upvote a comment made on a locked post (ordinary lock, not historical lock which remove the vote arrows and flag altoghether) we are greeted with such error message:        Or in words:     This comment is not eligible for voting or flagging   Being the curious type, I went straight away and tried to flag, fully expecting the same message... just to see the flag dialog open up just fine:        I was able to flag as well.  Can the error message please be changed to just "This comment is not eligible for voting"? Or of course, if it's not the intended behavior really disable the option to flag?  The original post on which I experimented is now deleted, but  you can play with.


Is there a reason that a proton has a positive charge while an electron has a negative charge?  Are these just names that were given to the charges or was there a reason for making a proton have a positive charge?

I recently came to know about the Conventional Current vs. Electron Flow issue. Doing some search I found that the reason for this is that Benjamin Franklin made a mistake when naming positive and negative charges. There is even this little comic about that   My question is, how can a naming convention be wrong? Perhaps I don't understand what is the actual mistake here, I don't know. But I don't see how a naming convention could be wrong or right. There is no right and wrong about that. It could've been any other name, like charge A and charge B.  I'll appreciate anyone can help me understand what is wrong in all this.


The website works and displayed correctly.  But in the database, there is a lot of symbols like 'Â', â€‹ and so. Any new entry in SQL is created with such symbols - but displayed properly on the Website.  The database is in UTF encoding. The majority of the files too. But there are some files in ANSI (Windows-1252). I changed files that I found, it didn't help, there are hundreds of files...  By default, the browser shows website at UTF encoding. If I manually change to Windows-1252 in the browser, the characters starting to appear.  If I exporting SQL DB as UTF - characters are present in the damp. If I exporting SQL DB as Windows-1252 the characters are not there.  Why the website display content properly, but in the DB there is some problem? How to solve this?

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


With article class :  \documentclass{aricle} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \usepackage{amsmath,amsfonts,amssymb,mathrsfs} \usepackage{fourier} \usepackage{helvet}   \begin{document}  $a^2+b^2=c^2$  \end{document}   Gives :    With beamer class  \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amsfonts,amssymb,mathrsfs}  \usefonttheme{serif}            % Nécessaire pour Fourier \usepackage{fourier} \usepackage{helvet}   \begin{document}  $a^2+b^2=c^2$  \end{document}   Gives :    How to correct beamer disposition to have the same as in article ?

I want to typeset math in different font called Antykwa Torunska, which supports maths. Unfortunately, when using it in beamer the math font is switched to the standard math font of beamer. How can I change this behaviour?  Here is a minimal example:  \documentclass{beamer} % Mathekram: \usepackage{amssymb, amstext, amsmath} % Font: \usepackage[math]{anttor} \usepackage[T1]{fontenc}   \begin{document}  \begin{frame}{Testframe}    This is fine: 1234567890, \textit{x}, \textit{p}, \textit{t}\\    This is not fine: $1234567890$, $x$, $p$, $t$ \end{frame}  \end{document}   When I change beamer to article it works fine.


If $H$ and $K$ are ideals of a ring $R$, what are the elements of $\langle H\cup K\rangle$? What I am trying to ask is that how does its element look?

Let $I$ and $J$ be ideals of a ring $R$. Prove that $I+J$ is an ideal of $R$ and that $I+J=\langle I\cup J\rangle$, the ideal of $R$ generated by $I\cup J$.


I'm trying to parse out some data from an MRSS feed using SimpleXML then create JSON with that data.  Here's what I'm trying, it does output JSON but the formatting looks bad and given all the [{"0":" before every element, I'm sure I'm doing something wrong:   <?php session_start(); $html = ""; $url = "http://feeds.nascar.com/feeds/video?command=search_videos&media_delivery=http&custom_fields=adtitle%2cfranchise&page_size=100&sort_by=PUBLISH_DATE:DESC&token=217e0d96-bd4a-4451-88ec-404debfaf425&any=franchise:%20Preview%20Show&any=franchise:%20Weekend%20Top%205&any=franchise:Up%20to%20Speed&any=franchise:Press%20Pass&any=franchise:Sprint%20Cup%20Practice%20Clips&any=franchise:Sprint%20Cup%20Highlights&any=franchise:Sprint%20Cup%20Final%20Laps&any=franchise:Sprint%20Cup%20Victory%20Lane&any=franchise:Sprint%20Cup%20Post%20Race%20Reactions&any=franchise:All%20Access&any=franchise:Nationwide%20Series%20Qualifying%20Clips&any=franchise:Nationwide%20Series%20Highlights&any=franchise:Nationwide%20Series%20Final%20Laps&any=franchise:Nationwide%20Series%20Victory%20Lane&any=franchise:Nationwide%20Series%20Post%20Race%20Reactions&any=franchise:Truck%20Series%20Qualifying%20Clips&any=franchise:Truck%20Series%20Highlights&any=franchise:Truck%20Series%20Final%20Laps&any=franchise:Truck%20Series%20Victory%20Lane&any=franchise:Truck%20Series%20Post%20Race%20Reactions&output=mrss"; $xml = simplexml_load_file($url); $namespaces = $xml->getNamespaces(true); // get namespaces  for($i = 0; $i < 50; $i++){ // will return the 50 most recent videos    $title = $xml->channel->item[$i]->video;   $link = $xml->channel->item[$i]->link;   $title = $xml->channel->item[$i]->title;   $pubDate = $xml->channel->item[$i]->pubDate;   $description = $xml->channel->item[$i]->description;   $titleid = $xml->channel->item[$i]->children($namespaces['bc'])->titleid;   $m_attrs = $xml->channel->item[$i]->children($namespaces['media'])->content[0]->attributes(); $VideoFileURL = $m_attrs["url"];  $arr = array($title, $description, $VideoFileURL);  $json_string = json_encode($arr, 128);  echo json_encode($arr, 128); }  ?>   I've tried to both   $json_string = json_encode($arr, 128)   and   $json_string = json_encode($arr, JSON_PRETTY_PRINT)   "128" seems to print out better than "JSON_PRETTY_PRINT"  Any ideas? I'm sure it's obvious, but I'm a newbie with PHP. Thanks!

Let's say I have some XML like this  <channel>   <item>     <title>This is title 1</title>   </item> </channel>   The code below does what I want in that it outputs the title as a string  $xml = simplexml_load_string($xmlstring); echo $xml->channel->item->title;   Here's my problem.  The code below doesn't treat the title as a string in that context so I end up with a SimpleXML object in the array instead of a string.  $foo = array( $xml->channel->item->title );   I've been working around it like this  $foo = array( sprintf("%s",$xml->channel->item->title) );   but that seems ugly.  What's the best way to force a SimpleXML object to a string, regardless of context?


For example, are both of the following sentences correct:  If it is cold out, you both will need a coat. If it is cold out, you will both need a coat.  And do they mean the same thing?

The situation is that someone asks me how my family are; I then want to answer that they all are fine.   I want to know whether the sentences "They all are fine." and "They are all fine." have the same meaning.  Is there any difference? To me as a non-native English speaker, "They all are fine." seems better — it should mean that each of my family members is fine whereas "They are all fine." should mean that each of my family members is completely fine. Please correct my understanding if there is anything wrong.


I'm doing a project using the GLUT library. Whenever I attempt to include Windows.h and compile/link, I get the following errors:  Error   1   error C2381: 'exit' : redefinition; __declspec(noreturn) differs    c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdlib.h    Warning 2   warning C4985: 'exit': attributes not present on previous declaration.  c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdlib.h    The conflict seems to relate to the "exit" function. I'm assuming that GLUT already defines an exit function, because I can call exit without including anything other than glut.h  I know other people have found a way around this, though. I've seen countless examples of GLUT programs that display a message box (which is why I am trying to include Windows.h). Does anyone else know what might resolve this?  Thanks

In my simple OpenGL program I get the following error about exit redefinition:  1>c:\program files\microsoft visual studio 8\vc\include\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs 1>        c:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\glut.h(146) : see declaration of 'exit'   I'm using Nate Robins'  and get this error with Visual Studio 2005 or Visual C++ 2005 (Express Edition). What is the cause of this error and how do I fix it?


English has a "intricate" relationship between graphemes and phonemes,i.e. there is no sure way of knowing how to pronounce something by just looking at its written form.  Generally any language has this property, but English is much more complicated in comparison to - say - Italian (which happens to be my native language).  This fact is known, and I remember stumbling upon a very nice sentence by an English Author, who leverage on this fact and wrote a sentence whose words did not make any sense together, but if you read them, then the "sounds" formed a perfectly meaningful phrase.  I seem to remember something concerning "god" and a "fish"?  Not sure though.  Anybody remember that?

I have been wondering recently if there are any Pronunciation "Easter Eggs" in the English language (not unlike how "Ghoti" is pronounced like "Fish"). Are there any others? Please provide phonetic proof if you claim so.


How do I unfold a model in a way that its print ready for paper crafting? Ive tried 123D Make for crafts and its not working out the way I want it too, also I dont have windows for Pepakura (?)

Is there a way to take a mesh, cut it with seams or sharp edges and flatten it, so that the faces stay the same shape and size?  Making paper models is one aspect, where you could use that technique.  No, I'm afraid SZ0Return is not going to do it properly.  And misusing the UV-unwrap is only a last option.    Note, while it's an option to revert to Blender 2.49 which had a script to do this, I'd like a solution that I can use inside the current workspace.


I have some sushi rice, In the packet the expiry date is given as Jan 2016, But the rice seems fine. Is it alright for me to use it to make sushi with it ?

I only prepare sushi rice a few times a year, so it takes me a while to go through even the smallest of bags.  How long can I keep the bag for before it "goes bad"?


I have a new website on Nette Framework, the problem is that the old website had URLs in the form: https://example.com/Questions/ https://example.com/Tags  So all over the internet there are backlinks to the above URL formats. The problem is that the new site displays 404 on those pages because the correct addresses are: https://example.com/questions/ https://example.com/tags  So I need to somehow overwrite .htaccess to rewrite the URL from the wrong form of addresses to the correct form, so automatically rewrite the following in the URL: A -> a B -> b ... Z -> z  Is it going through .htaccess somehow please? Note that the 404 is generated by the Nette Framework itself, so something like: CheckSpelling On CheckCaseOnly On  It will not work.

I would like to redirect a URL with uppercase characters http://localhost/A/B to a lowercase version http://localhost/a/b using the .htaccess file. Using regex I can capture A and B but is it possible to convert them to lowercase?


Generally, machine learning methods make little to no statistical assumptions. However, a key assumption they do make is that the data are IID.  What are the implications of a violation of the independence of the labels assumption for sequential gradient boosting? To be concrete, a Gradient Boosted Decision Tree.  In ensembles that exclusively use bagging (e.g., random forest), it is very easy to see what happens: the variance reduction from bagging results from the fact that the errors of the base learners are uncorrelated (say a white noise); the expected value of noise is zero and the noise diversifies away. If the independence assumption is violated in random forest, then you will see that the out-of-bag (OOB) error is unreasonably low (because the samples are correlated) and inconsistent with the validation error.  Is there a similar thought experiment one can do to make conclusions about what happens in GBDTs when the data have non-independent labels?

The i.i.d. assumption states:  We are given a data set, $\{(x_i,y_i)\}_{i = 1, \ldots, n}$, each data $(x_i,y_i)$ is generated in an independent and identically distributed fashion.   To me, physically this means that we can imagine that the generation of $(x_i,y_i)$ has no affect on $(x_j,y_j)$, $j \neq i$ and vice versa.  But does this hold true in practice?  For example, the most basic machine learning task is prediction on MNIST dataset. Is there a way to know whether MNIST was generated in an i.i.d. fashion? Similarly for thousands of other data sets. How do we "any practitioner" know how the data set is generated?  Sometimes I also see people mentioning shuffling your data to make the distribution more independent or random. Does shuffling tangibly create benefit as compared to a non-shuffled data set?   For example, suppose we create a "sequential" MNIST dataset contained digits arranged in an increasing sequence 1,2,3,4,5,6,..obviously, the data set was not generated in an independent fashion. If you generate 1, the next one must be 2. But does training a classifier on this data set has any difference as compared to a shuffled dataset?  Just some basic questions.


% expr 60.9-59.7 1.1999999999999957   It seems that in the above example expr outputs the result of the floating point operation in higher precision that it computes.   For something that simple I would expect a more reasonable output, such as output by this C++ code:  #include <iostream> int main()  {     double a = 60.9;     a -= 59.7;     std::cout << "double a = " << a << std::endl;     float b = 60.9;     b -= 59.7;     std::cout << "float b = " << b << std::endl;   }   Output:  double a = 1.2 float b = 1.2   Thus the questions:  Why does TCL output the expr results in higher precision than it computes them, thus causing lsb artifacts?  Is it possible to prevent that travesty, perhaps by setting something like a global precision variable or global output resolution variable or something like that?

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


Basically, I have a kindle fire that uses a form of the android OS and was wondering if there was a way I could run similar apps on my Ubuntu system. Specifically I'd like the news reader program "Pulse".  Anybody know if such an emulator or workaround exists?

Is it possible to run Android apps on Ubuntu? And I don't mean inside an emulator, but natively, as you would with any other application installed using the Ubuntu Software Center.


Data file is fixed length file, and I want to read file line by line and take a string from the current line, and then append that string to the subsequent line and write into another file.  For example1, given the file:  AAABBBB11115678xxxx BBBCCCC22221234YYYY MTD0001abcdARN12345 abcdedfg AA 0002bcde BB 0003defg CCCDDDD33331234zzzz MTD0003qwerTRN56789 defghigk AA 9876bvcn BB 8765zxcv XXXBBBB11115678aaaa YYYCCCC22221234bbbb   The output should be:  AAABBBB11115678xxxx BBBCCCC22221234YYYY MTD0001abcdARN12345 abcdedfg AA 0002bcdeARN12345 BB 0003defgARN12345 CCCDDDD33331234zzzz MTD0003qwerARN56789 defghigk AA 9876bvcnARN56789 BB 8765zxcvARN56789 XXXBBBB11115678aaaa YYYCCCC22221234bbbb   For example2, given the file:  AAABBBB11115678xxxxbedfgd BBBCCCC22221234YYYYabcd MTD0001abcdARN12345 abcdedfg 12345abcd AA 0002bcde BB 0003defg CCCDDDD33331234zzzzqwerty MTD0003qwerTRN56789 defghigk 45677defg AA 9876bvcn BB 8765zxcv XXXBBBB11115678aaaazeftfy YYYCCCC22221234bbbbefgydy   The output should be:  AAABBBB11115678xxxxbedfgd BBBCCCC22221234YYYYabcd MTD0001abcdARN12345 abcdedfg 12345abcd AA 0002bcdeARN12345 BB 0003defgARN12345 CCCDDDD33331234zzzzqwerty MTD0003qwerARN56789 defghigk 45677defg AA 9876bvcnARN56789 BB 8765zxcvARN56789 XXXBBBB11115678aaaazeftfy YYYCCCC22221234bbbbefgydy   I need to implement the above example 2 this with Perl?

Data file is fixed length file, and I want to read the file record by record and do transformations to the subsequent records based on the prior records (and write the results into another file).  Example:  CTD1234abcdTRN0001 AA 5678defg BB 8910erty CTD5678qwerTRN5678 AA 9876bvcn BB 8765zxcv   Now I want TRN0001 from the CTD record to be written to the subsequent AA and BB records, similarly for the following CTD records. My output should look like:  CTD1234abcdTRN0001 AA 5678defgTRN0001 BB 8910ertyTRN0001 CTD5678qwerTRN5678 AA 9876bvcnTRN5678 BB 8765zxcvTRN5678   Example 2:  AAABBBB11115678xxxx BBBCCCC22221234YYYY MTD0001abcdTRN12345 abcdedfg AA 0002bcde BB 0003defg CCCDDDD33331234zzzz MTD0003qwerTRN56789 defghigk AA 9876bvcn BB 8765zxcv XXXBBBB11115678aaaa YYYCCCC22221234bbbb    should become  AAABBBB11115678xxxx BBBCCCC22221234YYYY MTD0001abcdTRN12345 abcdedfg AA 0002bcdeTRN12345 BB 0003defgTRN12345 CCCDDDD33331234zzzz MTD0003qwerTRN56789 defghigk AA 9876bvcnTRN56789 BB 8765zxcvTRN56789 XXXBBBB11115678aaaa YYYCCCC22221234bbbb    Can you please help me on this, how can you achieve this using UNIX shell scripting?


How can I determine the point of X on the map, or the distance between X and either end point.  The dashed line from X to point is perpendicular. The distance between each point is on the map, and the points would be approx:  var a = {latitude:48, longitude:-90}; var b = {latitude:49, longitude:-92} var c = {latitude:48.25, longitude:-91.8};   Map image:

Given line AB made from two Latitude/Longitude co-ordinates, and point C, how can I calculate the position of D, which is C projected onto D.  Diagram:


Why do the planets orbit the Sun? If it's because the gravity of Sun then why don't they just fall in and burn up?

The force of gravity is constantly being applied to an orbiting object.  And therefore the object is constantly accelerating.  Why doesn't gravity eventually "win" over the object's momentum, like a force such as friction eventually slows down a car that runs out of gas?  I understand (I think) how relativity explains it, but how does Newtonian mechanics explain it?


I want to validate US phone number, US state code and US zip code using PHP for it I wrote following functions but they are not working properly.  /** check phone number validation**/   function phone_no($str) {      return (bool)eregi( "^([-\(\)\+, 0-9])+$", $str );   } /** check zip code validation**/ function integer($str) {     return (bool) preg_match('/^[\-+]?[0-9]+$/', $str);   } /** check state code validation **/      function alpha_num_symbol($str) {         return ( ! preg_match("/^([a-z0-9\+_\.*-\/'& ])+$/i", $str)) ? FALSE : TRUE;     }   I'm passing the value from input field of form using variable $str. Can someone please help me in correcting my code so that I can properly validate US phone number, US zip code and US state code. If anyone have any idea to make this thing workable please help me. Thanks in advance.

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


hi i need help to creating spiral vortex something like this it would be great if you help me

I have been struggling to create a bump that goes spiraling around a tube, sort of like a toilet paper tube.  Basically, it is a line that wraps around the tube several times, continuously.  I cannot figure out the math to make it happen.


I installed one package in my Linux machine and I want to install the same package on another Linux machine. Can I directly copy the installed directory from one computer to another computer? I mean cloning the installation directory.

I am going to change my machine: from a laptop with Ubuntu to another laptop where I am going to install Ubuntu...  I am quite happy with the current system, what I am afraid of is having to rebuild everything from 0.  So what do people often do to clone an Ubuntu system? That may include the data, packages, shortcut settings, etc...


In a well known Easter Egg in Star Wars Episode 1 (The Phantom Menace), there is a species shown seated in the Senate of the Republic which at least partially resembles... E.T. (of Spielberg's "E.T." movie).  I am referring to these aliens:    In addition, there is a lot of evidence that when combined with out out of universe knowledge, hints at the fact that E.T.'s race does in fact live in Star Wars Universe, as discussed in the answer to "  " - including the fact that there is a planet with the same name as E.T.'s homeworld (known as Brodo Asogi) that exists.  My question is, however:  Is there any canon confirmation (as opposed to "well, what else could they be" inference) that the aliens with E.T.-like looks shown in TPM movie are indeed the same  beings who live on the world called "Brodo Asogi" in the Extended Universe?  In other words:   We know SW EU contains aliens who are E.T. look-alikes. We know that SW EU contains aliens living on a planet whose name is identical to E.T.'s home planet (Brodo Asogi). But, do we have direct canon proof (as opposed to inference) that those 2 are the same race?   Possible confirmations could be, but not limited to, explicit statements from Lucalfilm officials, an illustration in the EU comic, book or a game; or the name mentioned in TPM script.

An answer , uses the appearance of E.T.-like creatures in the Star Wars universe as a frame of reference for dating the sagas relative to our present day.  I remember noticing, and discussing the E.T.-like creatures when I saw the film, too, but is there an in-universe explanation for this, or an in-universe tying of the two stories?    Or is it just a cute Hollywood nod on the part of Star Wars to the E.T. franchise?


On a kitpvp server I manage, players can duel. When they duel each other, they get teleported to a room. I'm having trouble teleporting the player back to spawn after they win. I can do it manually, but I'd rather it be automatic.

I managed a KitPvP server in Minecraft and everything works fine except when players wants to duel each other. They get sent to a room where they will be dueling. The main problem is when the winner wins, I have no idea how to teleport them back to spawn.


I need some help to solve the following problem:  *Show that if $\sum \limits_{n=1}^{\infty}{a_n^2}$ converges, then $\sum \limits_{n=1}^{\infty}{\dfrac{a_n}{n}}$ converges.  I tried to solve it by using the Ratio Test, but got anything. Regards and thanks a lot.

Let $a_1,a_2,a_3,\ldots$ be reals. Prove that if $\sum_{n=1}^{\infty} a_n^{2}$ converges, then so does $\sum_{n=1}^{\infty} \frac {a_n}{n}$.   For this I have shown the case for when $ a_n^{2} \le\frac {|a_n|}{n}$ $\Rightarrow$ $ |a_n|\le\frac {1}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le \frac{1}{n^{2}}$ and we know that $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges and hence $\sum_{n=1}^{\infty}\frac {a_n}{n}$ converges by the comparison test. Now considering $ a_n^{2} \ge\frac {|a_n|}{n}$ $\Rightarrow$ $\frac {|a_n|}{n} \le a_n^{2}$ $\rightarrow$ combining the two cases for any n we have: $\frac {|a_n|}{n}\le\frac{1}{n^{2}}+a_n^{2}$ Hence using the comparion test again we know that $\sum_{n=1}^{\infty} a_n^{2}$ converges and $\sum_{n=1}^{\infty} \frac {1}{n^{2}}$ converges hence the sum converges so we can conclude that $\sum_{n=1}^{\infty} \frac {a_n}{n}$ is absoluetly convergent $\Rightarrow$ convergent.  Not to sure if this is correct, any help would be much appreciated, many thanks.


Random r = new Random(); int i1 = r.nextInt(max - min + 1) + min;   I've tried it and it is working but still confuse about the logic used, I want to know that why we add min value to random number in end?

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


In an error log file on my server are some errors of this kind :   PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 86 bytes) in ....(a php file, on line..)  PHP Fatal    error:  Allowed memory size of 268435456 bytes exhausted (tried to    allocate 2 bytes) in ....(a php file, on line..)   For every error the recommended allocate bytes amount is lower than 100 bytes.  Does it mean that an increase of memory of only 100 bytes would solve every problem ?  How could I know what script is responsible for so much memory usage ?  My shop is built with Prestashop 1.5.6.2.  The full error message that I get is the following :  Allowed memory size of 268435456 bytes exhausted (tried to allocate 92 bytes) in ../classes/db/DbPDO.php on line 101   The line 101 is as follows :  return $result->fetch(PDO::FETCH_ASSOC);   This line is part of the following code :      public function nextRow($result = false) {     if (!$result)         $result = $this->result;     return $result->fetch(PDO::FETCH_ASSOC); }   I am not a developer and I thank you in advance for any help in this matter.  Patrick  I thank you in advance for any reply.  Patrick

I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big database for report generation.  The client POS is based on PHPPOS, and I have implemented a module that uses the standard XML-RPC library to send sales data to the service. The server system is built on CodeIgniter, and uses the XML-RPC and XML-RPCS libraries for the webservice component. Whenever I send a lot of sales data (as little as 50 rows from the sales table, and individual rows from sales_items pertaining to each item within the sale) I get the following error:  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)   128M is the default value in php.ini, but I assume that is a huge number to break. In fact, I have even tried setting this value to 1024M, and all it does is take a longer time to error out.  As for steps I've taken, I've tried disabling all processing on the server-side, and have rigged it to return a canned response regardless of the input. However, I believe the problem lies in the actual sending of the data. I've even tried disabling the maximum script execution time for PHP, and it still errors out.


I have this function where if the textbox has a value of 0 the checkbox will be set to true. But I have this weird scenario where if the textbox is blank or greater than 0 I need the checkbox to be false When I debug true this seems to be "" and 0 are the same thing Does anyone know how I would go about making this work? $(document).on('blur change keyup', '.CostInput', function () {   if ($(this).val() == 0) {     $('input#Enquiry_Cost_InputFree_0').prop('checked', true);   }    if ($(this).val() > 0 || "") {     $('input#Enquiry_Cost_InputFree_0').prop('checked', false);   } });  And I have created a JS fiddle =

I'm using  to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.  Is there a performance benefit to replacing == with ===?   Any performance improvement would be welcomed as many comparison operators exist.  If no type conversion takes place, would there be a performance gain over ==?


Let $I$ be an ideal of ring $R$ . If $K$ is ideal in $R/I$. Show that $K=J/I$ for some ideal $J$ which $I\subset J$ .  I was thinking $J=a+(-I)$ which $a\in K$ but I stuck to prove that $J/I\subset K$

I'm confusing the ideal correspondence theorem. Is the following  right?  Ideal correspondence: Let $f:A \to B$ be a ring homomorphism. Then there is a one-to-one order-preserving correspondence between ideals of $f(A)$ and ideals of $A$ which contain $\ker(f)$ by $\alpha \mapsto f(\alpha)$ (conversely $\beta \mapsto f^{-1}(\beta)$), and prime ideals correspond to prime ideals, and maximal ideals correspond to maximal ideals.


I consider a finite field $\mathbb{F}_q$, where $q=2p+1$, and $p$ , $q$ are prime numbers.  Let $z$ be a fixed element of the field. Also let $r$ be a value picked uniformly random from the field where $r>\frac{q}{2}$    Question: How to prove that $v=r\cdot z\ $ is distributed uniformly random in subset of the field where the  subset's size is $p$?

We consider a finite field $\mathbb{F}_q$ where $q=2p+1$ and $q$ and $p$ are prime numbers.  Let $r_i$ be a value picked uniformly at random from the field such that $r_i>\frac{q}{2}$. Let $z$ be a fixed field element.   Question: Is $v=(\ (r_i)^{-1}\cdot z) \bmod q$, a uniformly random value of the field?


Is it possible to add a third display using a USB 3 video adapter?  Will MacOS 10.14.6 recognize it?

How do I find out the number, type, resolution & refresh rate of additional monitors I can attach to my MacBook or MacBook Pro?  This is an attempt at a canonical QA, as per the Meta QA -   to try prevent the myriad "same but different" questions we get on every possible combination of computers, cable & monitors There are perfectly good resources out there that Ask Different should not have to duplicate the efforts of.


I'm trying to customize the Abstract of a memoir document using the following command:   \renewcommand{\abstractname}{Executive Summary}   The problem is that it actually has no effect. How can I achieve this?

I'd like to modify the names used to typeset some of my document elements. For example, the caption of figure floats should change from "Figure" to "Fig.", and my \tableofcontents sectioning heading shouldn't read "Contents", but "Table of Contents". How can I do that?  \documentclass{article} % \usepackage[english]{babel} \begin{document} \tableofcontents \section{foo} \begin{figure}[h] \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure} \end{document}


In 2017 the network decided to implement the HTTPS protocol, as was announced in . Although that post isn't completely marked as  I think most, if not all, of that came through. During that process there was a script that converted all links in posts from HTTP:// to HTTPS://, as you can see in the screenshot below (freehand circle mine).  Was this intended behaviour? EDIT: I wrote a  to have the community user change these links as an answer to the original announcement.

About a year ago, several migration scripts were run to change old HTTP network-internal links across the network to HTTPS links. However, it appears that the script didn't modify links that lack the ending /. For example:         But...    (most of which are posts after the migration script ran; the other two were edited back after Community edited them)  (4 were posted after the script ran, one seems to have been overlooked by the script)   (only one was posted after the script ran)   So, excluding cases where the posts were made after the script ran, were edited back after the script modified them, or were somehow overlooked by the script (probably a separate bug), all of the HTTP links in posts which were added before the script ran have been converted into HTTPS links, if they contained the ending /. Links that didn't contain the ending / were not converted.


I am facing a issue to rectify a jQuery file.   It's integration code is like this below.  <script type="text/javascript" src="js/global.footc75d.js?m=1497883755"></script>   my question is what is the ".js?m=1497883755" in this? what is the use of this..? why it was used this way not normally..?  and this one is looking like this below in the chrome browser > Developer tool > Network tab.    Requested to share the full detail about it. Why this was used this way..? not just by file name only..? should I use the same way in the future if yes then which condition..?? and how to edit the code in this condition.. how do I find and remove the code which is loading loader_light.gif here..?  Thanks to all in anticipate..

I have noticed that some browsers (in particular, Firefox and ) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser keeps on using the cached copy. What is the most elegant way of forcing the user's browser to reload the file when it has changed? Ideally, the solution would not force the browser to reload the file on every visit to the page.  I have found  and  suggestion to be useful. It turns out there is a term for this: auto-versioning. I have posted a new answer below which is a combination of my original solution and John's suggestion. Another idea that was suggested by SCdF would be to append a bogus query string to the file. (Some Python code, to automatically use the timestamp as a bogus query string, was .) However, there is some discussion as to whether or not the browser would cache a file with a query string. (Remember, we want the browser to cache the file and use it on future visits. We only want it to fetch the file again when it has changed.)


In the very beginning, I'm going to refer to an answer by @BillDubuque: ,  that motivated me to generalize my problem.  Instead of proving $\left(3+\sqrt{5}\right)^n+\left(3-\sqrt{5}\right)^n=2k,k\in\mathbb N$  I wanted to prove:     $\left(a+\sqrt{b}\right)^n+\left(a-\sqrt{b}\right)^n=2k,a,b,k\in\mathbb  N, a>b$.   I haven't learned about groups yet. We have only mentioned them once or twice, so I wanted to stick to the given strong induction problem in a more abstract degree.  $(1)$ base case: $\tau(1)$ $$2a\in 2\mathbb N$$ $(2)$ assumption:  Let the statement  $$\left(a+\sqrt{b}\right)^n+\left(a-\sqrt{b}\right)^n=2k,k\in\mathbb N$$  hold for some $\{1,\ldots,n\}$.  $(3)$ step: $\tau(n+1)$  \begin{equation}\left(a+\sqrt{b}\right)^{n+1}+\left(a-\sqrt{b}\right)^{n+1}=\left(a+\sqrt{b}\right)^n(a+\sqrt{b})+\left(a-\sqrt{b}\right)^n(a-\sqrt{b})\\a\underbrace{\left(\left(a+\sqrt{b}\right)^n+\left(a-\sqrt{b}\right)^n\right)}_{\in 2\mathbb N}+\sqrt{b}\left(\left(a+\sqrt{b}\right)^n-\left(a-\sqrt{b}\right)^n\right)\end{equation}  \begin{equation}\sqrt{b}\left(\left(a+\sqrt{b}\right)^n-\left(a-\sqrt{b}\right)^n\right)=2b\sum_{i=0}^{n-1}\left(a+\sqrt{b}\right)^{n-1-i}\left(a-\sqrt{b}\right)^i\\=2b\sum_{i=0}^{\left\lceil\frac{n}{2}\right\rceil\\}\underbrace{\left(\left(a+\sqrt{n}\right)^{n-1-2i}+\left(a-\sqrt{n}\right)^{n-1-2i}\right)}_{\in 2\mathbb N}(a^2-b)^i\end{equation}  Therefore, $\left(a+\sqrt{b}\right)^{n+1}\left(a-\sqrt{b}\right)^{n+1}\in 2\mathbb N$ and so is $\left(a+\sqrt{b}\right)^n+\left(a-\sqrt{b}\right)^n$.  Is this correct?

Prove by induction that this number is an integer: $$u_n=(3+\sqrt{5})^n+(3-\sqrt{5})^n$$ Progress I assumed that it holds for $n$ and I tried to do it for $n+1$ but the algebra gets quite messy and I'm unable to prove that the following term is an integer: $\sqrt{5}((3+\sqrt{5})^n-(3-\sqrt{5})^n)$


In a weak answer to this , the answerer referred to "molesting" cards.  In an English language context, I would find that offensive. But I get the sense that the answerer may be a native Spanish, rather than English speaker. I also know that in Spanish, "molestar" means to disturb, which really isn't a "bad word" in that language.  What should we do about posts that may "sound bad" in English, but perhaps wasn't meant in a bad way by a non-native English speaker?  In this case, I flagged a moderator for possible deletion of the post because of its overall weakness. But if had been a strong post, I might have tried fixing it, instead. Should we give people the benefit of the doubt in these language situations?

It's obvious to me that there's a trend now on Stack Overflow of relatively low-quality questions from new users who are non-native speakers with low or intermediate fluency in English, or at least claim to be.  It doesn't take a genius to work out that this may be because some of them struggle to read and fully comprehend the various English-language notices and admonitions that Stack Overflow has put in place to try to deter low-quality questions over the years - from welcome pages, to automated content filters displaying terse rejection messages.  I am not saying that such non-native speakers always ask bad questions, of course - far from it! - I am saying that a noticeable number of the low-quality questions, are from such non-native speakers.  What could we do about this particular problem?


A person holds a bundle of grass over his head for 30 minutes and gets tired. Has he done some work or not please explain me?

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


I need to to sort an array based on how I sorted a different array, here are 2 example arrays that I have that are linked based on their indexes (so $array1[0] and $array2[0] are relevant to eachother): $array1 = Array (     '2',     '1',     '3' );  $array2 = Array (     'linked_to_2',     'linked_to_1',     'linked_to_3', );  As you can see $array1[0] is related to $array2[0], $array1[1] to $array2[1] and $array1[2] to $array2[2]. Now I create a new that uses the same values $array1 has but ordered like this: $sorted_array1 = Array (     '1',     '2',     '3' );  But I can't sort $array2 using the same method so how do I use $array1 and/or $sorted_array1 to create a sorted array using the values of $array2 like this: $sorted_array2 = Array (     'linked_to_1',     'linked_to_2',     'linked_to_3', );  For a bit of context in my actual use case I have a couple of ID's in the 1st array that I query against a database and in that database table with these ID's I order them by date of creation (which is another row in that db table). The values of array2 are not in this database table and can therefore not be sorted the same way.

Is it possible in PHP to do something like this? How would you go about writing a function? Here is an example. The order is the most important thing.  $customer['address'] = '123 fake st'; $customer['name'] = 'Tim'; $customer['dob'] = '12/08/1986'; $customer['dontSortMe'] = 'this value doesnt need to be sorted';   And I'd like to do something like   $properOrderedArray = sortArrayByArray($customer, array('name', 'dob', 'address'));   Because at the end I use a foreach() and they're not in the right order (because I append the values to a string which needs to be in the correct order and I don't know in advance all of the array keys/values).  I've looked through PHP's internal array functions but it seems you can only sort alphabetically or numerically.


Let $p$ be a prime integer, and let $m,k \in \mathbb{N}$. If $m \equiv k$ (mod $(p-1)$), show that:  $u^k \equiv u^m$ (mod $p$), $\forall u \in \mathbb{Z}$  If $u \equiv v$ (mod $p$), then $u^k \equiv v^m$ (mod $p$), $\forall u,v \in \mathbb{Z}$   Couldn't find anything related with this. The only thing related with $(p-1)$ I found was Wilson's Theorem, but I can't see any relation with that question. Can anyone show how can I start to solve that? Thanks.

I have tried to search similar posts to this, but unfortunately I may not have enough keywords for it. I'm looking for some help so check the following: Given a prime number $p$, let $k, m \in\mathbb N \backslash\{0\}$ such that $k \equiv m(\bmod (p-1))$. Now given $ u, v \in\mathbb Z$ such that $u \equiv v\pmod p$, check that $u^k \equiv v^m\pmod p$. Any tips to show this or where should I start? Thank you!


In a game with a client-server database management system, would it be more efficient to have this data stored with something like MySQL or would a file system with everything being saved and stored in the server files, considering that this will be intended for thousands of accounts to be created.

When dealing with small projects, what do you feel is the break even point for storing data in simple text files, hash tables, etc., versus using a real database?  For small projects with simple data management requirements, a real database is unnecessary complexity and violates YAGNI.  However, at some point the complexity of a database is obviously worth it.  What are some signs that your problem is too complex for simple ad-hoc techniques and needs a real database?  Note:  To people used to enterprise environments, this will probably sound like a weird question.  However, my problem domain is bioinformatics.  Most of my programming is prototypes, not production code.  I'm primarily a domain expert and secondarily a programmer.  Most of my code is algorithm-centric, not data management-centric.  The purpose of this question is largely for me to figure out how much work I might save in the long run if I learn to use proper databases in my code instead of the more ad-hoc techniques I typically use.


I want to make a registration form How can I align this box like right under the head title?   h1 {   text-align: center; }  .registrerBoks {   width: 300px;   height: 300px;   background-color: lightblue; }
registrer

How can I horizontally center a
 within another
 using CSS?

Foo foo


I have a Nikon D3100 with 18-55mm and 55-200mm lenses. I am planning to buy 50mm f1.8G lens for which I've checked reviews and they were pretty great. I came in here and browsed through other similar questions which eventually converted me to get 35mm f1.8G lens.  One thing that bothered me was, some of the comments here said that auto-focus doesn't work on D3100. Is it true?  I still need a final suggestion as to which one I should go for. The price difference is 20$ so overall I don't care. My primary aim is better photos in low light conditions, portraits and obviously taking a next step in learning to take better photographs.

I'm new to photography. I got a Nikon D3100 with the 18-55 kit lens.  I was looking to buy a f/1.8 prime lens, and I found two options:   AF-S DX NIKKOR 35mm f/1.8G   AF-S DX NIKKOR 50mm f/1.8G   How should I go for choosing one or the other?


Is complement of an algebraic set also algebraic in $\mathbb{A}^n(k)$, where $k$ is arbitrary field? My Solution: Let $V$ be an algebraic set i.e. $V = V(F)$ for some $F =\{f_{\alpha}: \alpha \in \Lambda \}$. Assume that $U := \mathbb{A}^n(k) -V$  is also an algebraic set. Then, $U$ and $V$ are both Zariski open and closed set in $\mathbb{A}^n(k)$. Thus, $\mathbb{A}^n(k)$ will be disconnected. Doubt: I am not sure how to conclude after this. Is it true that $\mathbb{A}^n(k)$ is connected in Zariski topology? If yes, why?

As the title suggests, could anyone either provide me with or direct me to a proof that affine n-space $\mathbb{A}^n$ is irreducible, without using the Nullstellensatz?   This is an exercise in a second course on representation theory, so if there is a reasonably palatable representation-theoretic proof then that's probably what's expected but on the other hand it may just be totally unrelated but presented for the reader's enjoyment. (I'm under no obligation to do it so I wouldn't class it as 'homework'.)  I have spent some time banging my head against the exercise but to no avail, I keep just coming back to the Nullstellensatz proof I already know. As well as a representation-theoretic proof if one exists, any alternative, particularly beautiful proofs would be welcomed for their own sake. Many thanks for the help!


I'm working with Spring Boot + Rest + Jpa .So if a user edits any of the  employee entity (empId, salary, age, location, role, experience) columns mapped to the employee table, I should track the old and new changes and enter into a audit table, with the column changed.  public EmployeeEntity update(int empId, EmployeeEntity employeeEntity ) {      em = emf.createEntityManager();     EmployeeEntity beforeObj = em.find(EmployeeEntity .class,empId );      try {         em.getTransaction().begin();         em.merge(employeeEntity);         em.getTransaction().commit();     }     finally {         em.close();     }      return employeeEntity; }   So now I have entities with beforeObj (the employee entity with old values) and employeeEntity (the updated values), so for eg is only salary and location is being updated, I have to track those and update in a audit table . Need to do plain simple than using Envers or any other JPA tools ,since only minimal transaction can happen.   This is my entity class:  @Entity @Table(name = "TEMPLOYEE") public class EmployeeEntity implements Serializable {  private static final long serialVersionUID = 1L;  @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "EMP_NO") private int EMP_NO;  @Column(name = "SALARY_VAL") private int SALARY_VA;  @Column(name = "ROLE_NAME") private String ROLE_NAME;  @Column(name = "EXPERIENCE") private int EXPERIENCE;  @Column(name = "LOCATION") private String LOCATION;  // Getters and Setters   Insights needed for the same.

I want to compare the current value of an in-memory Hibernate entity with the value in the database:  HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id); // CODEBLOCK#1 evaluate differences between newEntity and oldEntity sess.update(newEntity);       In CODEBLOCK#1 I get that newEntity.getProperty()="new value" AND oldEntity.getProperty()="new value" (while I expected oldEntity.getProperty()="old value", of course). In fact the two objects are exactly the same in memory.  I messed around with HibernateSessionFactory.getSession().evict(newEntity) and attempted to set oldEntity=null to get rid of it (I need it only for the comparison):  HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); HibernateSessionFactory.getSession().evict(newEntity); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id); // CODEBLOCK#1 evaluate differences between newEntity and oldEntity oldEntity = null; sess.update(newEntity);   and now the two entities are distinct, but of course I get the dreaded org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session.  Any idea?  EDIT: I tried the double session strategy; I modified my HibernateSessionFactory to implement a map of session and then...  Session session1 = HibernateSessionFactory.getSession(SessionKeys.DEFAULT); Session session2 = HibernateSessionFactory.getSession(SessionKeys.ALTERNATE); Entity newEntity = (Entity)entity; newEntity.setNote("edited note"); Entity oldEntity = (Entity)session1.load(Entity.class, id);  System.out.println("NEW:" + newEntity.getNote()); System.out.println("OLD: " + oldEntity.getNote()); // HANGS HERE!!!  HibernateSessionFactory.closeSession(SessionKeys.ALTERNATE);   My unit test hangs while attempting to print the oldEntity note... :-(


Correct me if I'm wrong but AFAIK:   There is a time required to pass between an answer being posted and the questioner being able to accept it; This time is much longer (2 days!) if the answer is a self-answer; this is correct at least on Math SX, where I just self-answered this and upon trying to accept I found myself confronted with:      You can accept your own answer in 2 days.      However, I have the impression this time lapse significantly varies between sites; for example, if I remember well, I tried to self-accept my self-answer to  though convinced it would complain about this time lapse, and it got accepted, much to my surprise.   So I am asking:   How much time must there pass between when an answer is posted and when it is accepted? Is this site-specific or system-wide? Why is the time lapse for self-answers so much longer than for other answers? And above all, why exactly does this time lapse even exist? Couldn't it just be eliminated? Is there a reason for forcing an accepter to wait, potentially causing him to load other questions and forget about the answer he was going to accept? And this "potentially" part is not just a guess at a possibility, but my memory of stumbling on an old question of mine and being surprised I had not yet accepted an answer when I surely had decided to accept it ages before…

I noticed that I can only perform certain actions such as commenting a finite number of times in a given period of time. Obviously, rate limiting is in place to prevent accidental misuse or intentional abuse of certain features.  Where else is rate limiting applied on Stack Exchange sites, and what are the limits?


I would like to generate some pdf files with a 'for' cycle. The documents have to be very similar, but some variables are different. It is possible to do it with only LaTeX language without external scripting?

I'd like to be able to create a TeX file that will output multiple PDF files with one compilation.  I'm not even sure if this is possible.  Here is the setup:  I am writing dozens of cover letters for job applications, and wish for them to all look "personalized".  So I defined a function which calls multiple variables, such as the address, name of the institution, open position, etc., and outputs a "personalized" cover letter for each function call.  The problem is that compilation of the TeX file outputs just one file.  Since I will be submitting all of these files online eventually, I would like each letter to be in its own file.  Is there a way to do this at the TeX level?


I have to kill aptd everytime I use GNOME Software in order to get sudo apt update or sudo apt upgrade to work. If I dont kill aptd then I get this:  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?   Is there something I can do to make aptd stop automatically when I quit GNOME Software?

I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this?


In bash, when I'd like to have a glimpse at what an already defined shell function does, I can: $ type myFunctionName  For a variable myFunctionName, it provides me with the type of the variable (a function), but also print the source of this shell function on the terminal. Very handy. When I do the same in zsh, it only gives me the its type, not its shell code. Is there a way to ask zsh to print to source of a shell function given its name ?

I am using zsh and I have defined few utility shell function in some shell scripts, few of them called from ~/.zshrc, so let's assume that we don't know the location of these functions. One function is:  function k.pstree.n {     if [ "$1" != "" ]     then         pstree -p | grep -C3 "$1"     else         printf "  Please specify the name of the process you want to show!\n"     fi }   How can I print the code of that shell function?  I can think of a search & grep like:  find $(pwd) -name "*sh*" -type f -printf "\"%p\"\n" | xargs grep -C5 "k.pstree.n"   but this assumes that I roughly know the location which is not true here.


The following code inserts my new_layer just above the active layer in the QGIS ToC.  new_layer = iface.addRasterLayer(...)    Instead, I'd like my new_layer to be inserted at the top of the QGIS ToC.   Do you know how can I do it?

When I load a bunch of layers into QGIS from PostGIS, they seem to load in reverse alphabetical order.  Is there any tools or plugins that allow you to quickly sort the QGIS TOC in a different order?  For example I can think of a couple of options one might want:   Sort layers by geometry, where points are on top, then lines, polys, & rasters. Sort Layers by name (alphabetical, reverse alphabetical). Sort first by geometry, then by name.  This would be a combination of #1 & #2.  Points layers are sorted to the top (same as #1), but then points layers are sorted alphabetically (point-a, point-b, point-c, etc).   When loading a large number of layers, this would help to rapidly build up the right ordering for map production.


I flagged a post as a duplicate over a moth ago, and it is still active:        Why is that?  Before you say this is a duplicate of , let me explain how the answers there are not satisfactory to answer this question.  One answer there says:     it generally takes 24 hours to get a review.   It has not been 24 hours, or even 24 days. It has been over 40 days.  My only guess, based on both answers of that question, is that the "duplicate" section of the Flag Queue is full, like the Close Votes review.

Why does it take so long to review a flag suggested by a user?  When I flag a question or comment, some get a response quickly whereas some of them get a response after few or more hours.  Is there any flag review condition which cause so much time to be taken for different flags?  Or are there different moderators for different flag posted?


How come equation a) $P=VI$ says if you double voltage, power is doubled while according to equation b) $P=V^2/R$ says power quadruples? Which one is correct?

If we look at $P=VI$, we see that if the current doubles then the potential difference is halved but this doesn't seem to make sense according to $V=IR$. If we look at that equation, since the resistance remains constant, doubling the current should increase the potential difference. Can someone explain what I'm misunderstanding in simple terminology?


Yesterday I installed katoolin3 on Ubuntu 20.04. It didn't work. After that I uninstalled katoolin3, but it will change my Ubuntu OS to Kali GNU/linux Rolling!  Can anyone help me to get back to Ubuntu 20.04? Also my GRUB is showing:   error found when loading etc/profile   Please help me to get out from that. Because of this, I cannot use Ubuntu properly, and my apt-get update shows the error:  404 error found   The command cat /etc/os-release shows:  PRETTY_NAME="Kali GNU/Linux Rolling" NAME="Kali GNU/Linux" ID=kali VERSION="2020.2" VERSION_ID="2020.2" VERSION_CODENAME="kali-rolling" ID_LIKE=debian ANSI_COLOR="1;31" HOME_URL="https://www.kali.org/" SUPPORT_URL="https://forums.kali.org/" BUG_REPORT_URL="https://bugs.kali.org/"

Updated Ubuntu 16.04 today using the software updater. Now my PC is running Kali? There were something like 2Gb of updates, which I thought at first was because I haven't updated in a while. Now I'm thinking that it was downloading Kali. Here's a  of the new boot-up process.  The screen will continue to flicker for another 30 seconds or so, then stop flickering leaving the text on the screen. I tried switching the display manager from gdm to lightdm, which will boot me straight to the console and without flickering, but still no desktop.  I'm not altogether sure how I managed to accomplish this. It must have been when I was trying to get Katoolin running.  Any tips as to how I can either get the desktop or revert the updates?  Contents of cat /etc/lsb-rolling:  DISTRIB_ID=Kali DISTRIB_RELEASE=kali-rolling DISTRIB_CODENAME=kali-rolling DISTRIB_DESCRIPTION="Kali GNU/Linux Rolling"


Prove that $p(x)=(x-1)(x-2) \cdots (x-n) + 1$ is irreducible over $\mathbb{Z}$ for all $n \geq 1$, $n \neq 4$.  I do not clearly see how to solve this problem and what is so special about the integer $4$ here?  Thanks for your help in advance

I try to solve this problem. I seems to come close to the end but I can't get the conclusion. Can someone help me complete my proof. Thanks          Show that the polynomial $h(x) = (x-1)(x-2)\cdots(x-n) + 1$ is irreducible over $\mathbb Z$ for all $n\ge1$ and $ n\ne4$.      Suppose $h(x) = f(x) g(x)$, then we must have $f(i)g(i) = 1$ for all $i = 1,2,...n$. So both $f(i)$ and $g(i)$ are $1$ or $-1$. In either case, $m(x) = f(x) - g(x)$ has degree smaller than $n$ and have $n$ different roots ($1,2,...,n$). So we must have $m(x) = 0$. Then $h(x) = f(x)^{2}$. So $n$ must be even. Let $n = 2k$. Because $f(x)$ has degree $k$, there are $k$ values from $\{1,2,...,2k\}$ at which $f(x)$ is $1$ and $k$ values at which $f(x)$ is $-1$.  This is where I got stuck. Hope some one can help me solve this. Thanks.


If $f\in \mathcal{C}^1(\mathbb{R}^2)$. Prove that there exists a continuous one-one function $g:[0,1]\to \mathbb{R}^2$ such that $f\circ g:[0,1]\to \mathbb{R}^2 $ is constant.   Would anybody give me some hint to do this problem?

Let $h\in C^1(\mathbb{R}^2,\mathbb{R})$. Show:   There exists $g:(0,1)\to\mathbb{R}^2$ such that $h\circ g$ constant, $g$ continuously differentiable and $g$ injective.   Dini's theorem:  Let $\Omega \subseteq \mathbb{R}^2$ open, $f \in C^1(\Omega, \mathbb{R})$ and $p \in \Omega$ with $f(p) = 0$.  If $\frac{\partial f}{\partial y}(p) \neq 0$, then there exist open intervals $V_1, V_2$ with $p \in V_1 \times V_2 \in \Omega$ and $g \in C^1(V, \mathbb{R})$ with $$\{(x,y) \in V_1 \times V_2 \mid f(x,y) = 0 \} = \{(x,g(x) \mid x \in V_1\}$$ and $g$ furthermore satisfies $$g' = -\left(\frac{\partial f}{\partial y}(x, g(x))\right)^{-1}\frac{\partial f}{\partial x}(x, g(x)).$$  Proof of existance of $g$:  Let without loss of generality $\frac{\partial f}{\partial y}(p) \gt 0$.  Then there exists $\epsilon \gt 0$ with $\overline{B_\epsilon(p)} \subseteq \Omega$ and $\frac{\partial f}{\partial y} \gt 0$ on $\overline{B_\epsilon(p)}$.  Let $y^- = p - \frac{\epsilon}{2}$ and $y^+ = p + \frac{\epsilon}{2}$. Then there exists $\delta \in (0, \epsilon)$ with $f(x, y^-) \lt 0 \lt f(x, y^+)$ for $x \in (p - \frac{\delta}{2}, p + \frac{\delta}{2}) =: V_1$ and $(y^-, y^+) =: V_2$.  For $x \in V_1$ there exists exactly one $y \in V_2$ with $f(x,y) = 0$ (mean value theorem). Set $y(x) := g$ and the claim follows.


I'd like to create a custom design for my beamer presentations. How could I achieve this? I have neither found any resources for that nor does the official beamer documentation talk about it. Are there any good resources to start with?

No matter how hard I search, I cannot find any information on creating a Beamer theme from scratch, as opposed to LEGOing it together from the built-in inner, outer and color themes, maybe modifying one or two beamer templates by using cryptic commands without explanation.  The reason I want to do this is that none of the built-in inner, outer and color themes suit my taste. All of them are instantly recognisable as Beamer, and there is very small visual change between them.  What I would like to implement is something along the lines of certain PowerPoint templates:    and I would also like to port the beautiful  themes (see ), such as the KlopeSpring theme to Beamer, as Powerdot is very inconvenient for having to convert all images to EPS.  So how do I go about all those geometric decorations and placing text above/below/on them? Oh, and I almost forgot to mention that I know about the easy solution of "include an empty slide PDF as background image", but that is no fun.


When comparing two elements, should we use "more" or "most"? Example: "There are two locations, you can choose the more/the most convenient one."

Which of the following two sentences is more correct?   "A picture says a thousand words, more importantly in a fraction of a second"    OR   "A picture says a thousand words, most importantly in a fraction of a second"   Nothing important, just my own quotes! Do also suggest, if I can put it in a better way to express what I want to.


just want to share an interesting or rather accidentally discovered bug for Unix 'rm' command. I have accidentally created the file named '--help'. However, when I try to delete using rm command, it does not work and it shows up the help menu for rm instead. Same to mv command, I want to rename it to a valid filename, it shows the help menu of mv.    [Answer] To delete the file named '--help', try to use 'find' command.  Thanks for your reading and I hope it somewhat helps.

I have a directory named:  -2   I want to cd into it but the cd complains:  bash: cd: -2: invalid option   With no success, I've tried:  cd "-2" cd '-2' cd \-2   Any solution?  Edit: no file browsers like mc, etc. available on the server.


For a manuscript I need to include theorem proofs as supplementary material. So I mention the theorem in the main file and I need to re-print the theorem in the supplementary material with the same theorem number and then provide the proof.  For this purpose I define the theorem in the main.tex file as follows:  \begin{restatable}{thm}{firsttheorem} \label{thm:first}   Sample theorem.  \end{restatable}  \begin{proof}   Refer to supplementary material. \end{proof}   Then in my supplementary material file supp.tex I use the xr package and refer to my main document as  \usepackage{xr} \externaldocument{../main}   But I am not able to refer to the theorem as such  \firsttheorem*   It gives the following error message  Undefined control sequence. \myfirsttheorem

I state a theorem in the main body of a document and prove it in the appendix. I use thmtools's restatable environment to restate the theorem there. However, I now need to have my appendix in a separate pdf file (hence a separate tex document). I'm using xr and xcite to get the cross-references and bibliographical references to play nicely.  But the commands created by restatable are not carried. Is there any way to to the restating of the theorem in the appendix in a separate document?  Here's a MWE:  main document: main.tex  \documentclass{article} \usepackage{thmtools} \newtheorem{theorem}{Theorem}  \begin{document}  \begin{restatable}{theorem}{thmcmd}\label{thmlabel} Here is the statement of the theorem. \end{restatable}  The above is Theorem~\ref{thmlabel}.  In this way I can restate it: \thmcmd*  \end{document}   appendix: appendix.tex  \documentclass{article} \usepackage{xr} \externaldocument{main} \usepackage{thmtools} \newtheorem{theorem}{Theorem}  \begin{document}  I can refer to Theorem~\ref{thmlabel}.  But I cannot restate it like this: % \thmcmd*  \end{document}


Let $f:\Bbb{R}\to \Bbb{R}$ be defined by  $$f(x)=\begin{cases}1& \text{if x is rational},\\0 &\text{if x is irrational.}\end{cases}$$  Prove that $f$ is discontinuous at every real number. I realize that if $x_0\in\Bbb{R} $, then every neighborhood of $x_0$ contains rational points (at which $f(x)=1$) and contains irrational points (at which $f(x)=0$). I see that the existence of $\lim\limits_{x\to x_0}f(x)$ is also in question. From here, I don't know how to proceed. Can anyone help me out?

I think I don't understand how it works.. I found some proofs.. okay, let's see:  Well I'd like to show that the function,  $$f(x) = \begin{cases} 0 & x \not\in \mathbb{Q}\\ 1 & x \in \mathbb{Q} \end{cases}$$  is discontinuous.   Now with epsilon-delta-definition:  Let's choose an $\varepsilon < 1$, for example $\varepsilon := 1/2$. And: $\delta > 0$ .  I have to show that $|f(x) - f(x_0)| > \varepsilon$  So if $x_0 \not\in \mathbb{Q}$ let $x$ be rational in $(x_0- \delta, x_0+ \delta)$  if $x_0 \in \mathbb{Q}$ let $x$ be irrational in $(x_0- \delta, x_0 + \delta)$  In the end it is $|f(x) - f(x_0)| = 1 > 1/2$.  Why is $|f(x) - f(x_0)| = 1 $ ?


I'm looking for an old tall tale - perhaps a Paul Bunyan story? - in which our hero has dirt so fertile that it will grow anything.  One of our hero's unscrupulous neighbors comes over to visit wearing spiky high-heeled shoes and leaning heavily on a cane, which annoys our hero because it puts holes in his lawn, and if he doesn't stamp the holes out quickly they'll grow larger - everything grows in this dirt.  The neighbor is later seen to be stealing the dirt - he scrapes the dirt off his shoes into a bucket, and his cane is hollow.

There was a series of illustrated children's books that I was introduced to as a child in the late 1980's early 1990's.  The main character was a farmer - I can't remember the name, but I think it was Mc or Mac something. He bought his farm from a sleazy character who was trying to cheat him. The farmland was originally some kind of swampy land, but this industrious character (and his family) discovered that the land would grow plants to a massive size - radishes the size of basketballs, etc.  There were some pretty fantastic stories and adventure that the character would get into, such as one winter the weather got so cold that the wind (not the air) outside froze. They went out and cut it up and stored it in the icebox and would thaw out some of the cold breeze later in the hot summer.  The sleazy character made a constant appearance, trying to swindle this family out of the farm.  My Google-Fu seems to fail me at every turn. Do you know what this series is?


Is umount $mountpoint always enough to safely remove a single-partition USB drive on a modern GNU/Linux system? Or should I use sync && umount $mountpoint && sync, or perhaps umount $mountpoint && udisks --detach $device? I'd like to use the safest way possible, but on the other hand I don't want to introduce superfluous dependencies or delays into my program.  EDIT:  indeed answers a part of this question (whether sync && umount $mountpoint && sync provides any benefit over umount $mountpoint), but not the whole question (whether udisks --detach $device or some other command provides improved safety), so it's not an exact duplicate.

We have BBB based custom board with kernel 3.12 running on it.  I have doubt regarding umount and & sync.  Lets say a script is umounting a partition, Does it require to run sync command before umount to complete pending writes. ?


As I was testing this form data entry I had no issues.  When I tried adding more complex text, in the textarea that is picked up by the $post_content = $_POST['post_content'];  with numeric and non-alphabetic characters I'm met with this error.       QUERY FAILED: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near   My code is as follows:  <?php      if (isset($_POST['create_post'])){          $post_title = $_POST['title'];         $post_author = $_POST['author'];         $post_category_id = $_POST['post_category_id'];         $post_status = $_POST['post_status'];         $post_image = $_FILES['image']['name'];         $post_image_temp = $_FILES['image']['tmp_name'];         $post_tag = $_POST['post_tag'];         $post_content = $_POST['post_content'];         $post_date = date('d-m-y');         $post_comment_count = 4;          move_uploaded_file($post_image_temp, "../images/$post_image");          $query = "INSERT INTO posts (post_category_id, post_title, post_author, post_date, post_image, post_content, post_tag, post_comment_count, post_status) ";          $query .= "VALUES ({$post_category_id},'{$post_title}','{$post_author}',now(),'{$post_image}','{$post_content}','{$post_tag}','{$post_comment_count}','{$post_status}' ) ";          $create_post_query = mysqli_query($connection, $query);         checkQuery($create_post_query);     } ?> <form action="" method="post" enctype="multipart/form-data">
         Post Title         <input type="text" class="form-control" name="title">

         Post Category Id         <input type="text" class="form-control" name="post_category_id" placeholder="Please enter a number">

         Post Author         <input type="text" class="form-control" name="author">

         Post Status         <input type="text" class="form-control" name="post_status">

         Post Image         <input type="file" name="image">

         Post Tags         <input type="text" class="form-control" name="post_tag">

         Post Content         <textarea class="form-control" name="post_content" id="" cols="30" rows="10"></textarea>

         <input class="btn btn-primary" type="submit" name="create_post" value="Publish Post">
 </form>   I attempted using mysqli_real_escape_string in combination with my $post_content = $_POST['post_content']; and had no success, which leads me to think my query syntax is off.  Any help will be greatly appreciated.

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


In C#, when should you use interfaces and when should you use abstract classes?  What can be the deciding factor?

When should I use an interface and when should I use a base class?   Should it always be an interface if I don't want to actually define a base implementation of the methods?  If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces for ISheds or IBarks (IMakesNoise?), because those can be placed on a pet by pet basis, but I don't understand which to use for a generic Pet.


I'm trying to get rid of Ubuntu 16.04 have tried already to download a windows ISO to make bootable USB . Ubuntu messed up the first pendrive already.  I have tried another options like diskmanager, formating usb pendrive, but it cannot be loaded after changing boot order, doesn't recognize the new OS.  I'm Struggling with this for days! Many things doesn't work from Ubuntu (software store, downloading files, executing files or installing other apps.  What can I do?

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


I have the true output as the ratio between 0 and 1. I am trying predict the output using regression. I am supposed to find the area under the ROC curve between the prediction and true values. I am not aware of ROC curve calculations for continuous variables. Any suggestions are welcome.

I am interested in calculating area under the curve (AUC), or the c-statistic, by hand for a binary logistic regression model.  For example, in the validation dataset, I have the true value for the dependent variable, retention (1 = retained; 0 = not retained), as well as a predicted retention status for each observation generated by my regression analysis using a model that was built using the training set (this will range from 0 to 1).  My initial thoughts were to identify the "correct" number of model classifications and simply divide the number of "correct" observations by the number of total observations to calculate the c-statistic. By "correct", if the true retention status of an observation = 1 and the predicted retention status is > 0.5 then that is a "correct" classification. Additionally, if the true retention status of an observation = 0 and the predicted retention status is < 0.5 then that is also a "correct" classification. I assume a "tie" would occur when the predicted value = 0.5, but that phenomenon does not occur in my validation dataset. On the other hand, "incorrect" classifications would be if the true retention status of an observation = 1 and the predicted retention status is < 0.5 or if the true retention status for an outcome = 0 and the predicted retention status is > 0.5. I am aware of TP, FP, FN, TN, but not aware of how to calculate the c-statistic given this information.


I'm trying to express $∃!x : (P(x))$ in a different way. i want to know how to express it with the other quantifiers.  Here is what I have tried:  $∃!x(P(x)) = ∃x : (P(x) \wedge ∀y, y≠x (\neg P(y)))$  What I'm trying to say is that there exists only one $x$ such that $x$ is true and for all $y$ that are not $x$, $y$ is false. $x$ and $y$ share the same universe of discourse. I'm new to representing this mathematically. Any help is appreciated.

During a lecture today the prof. posed the question of how we could write "There is exactly one person whom everybody loves." without using the uniqueness quantifier.  The first part we wrote as a logical expression was "There is one person whom everybody loves.", ignoring the 'exactly one' part of the question initially. From this he wrote  $L(x,y): x$ loves $y$; domain for $x$ and $y$: $\{\text{people}\}$  $\exists x\forall y: L(y,x)$  Which I understand to mean 'There is a person $x$ such that for all $y$, $x$ is loved by $y$' AKA 'There is a person who is loved by everyone'. I get that part.  The part I don't get is how the expression of 'exactly one'.  $\forall z(\forall y(L(y,z))\to x =z)$  which then creates the joint expression  $\exists x\forall y(L(y,x))\land \forall z(\forall y(L(y,z))\to x=z)$  I just can't seem to understand how $\forall z(\forall y(L(y,z))\to x =z)$ means exactly one here.  I suppose you can take $\forall z$ here to mean 'for any given person', which means the $\forall z$ is considering every person in the world.  This would translate the second expression block to something like, "For any given person $z$, if everybody loves $z$ then $z$ is the same person as $x$".  To me though $\forall z$ generally means for every element in the domain which I see as meaning every person in the world simultaneously, as it seems to for $y$.  Is that just plain wrong?  How can I tell when $\forall$ means 'all' and when it means 'for any (one)'?  In the previous English translation the only reason I was able to translate it (if it's even right) is because I already knew what the statement was suppose to mean.  Is it just that $\forall z$ means that this statement could be true for any element, and if so what's the difference between $\forall z$ and $\exists z$?  Someone told me that $\exists z$ would be redundant because the expression says $x=z$ but how do I know that $x$ and $z$ are automatically the same person if $\exists$ is used for both?  Sorry if this is a bit long with too many questions.  I just wanted to try to make the cause of my confusion as clear as possible so you can help me figure this out.


I have a Raspberry Pi overwriting an image on a webserver (not on RPI) using FTP every 1 minute. The problem is that my Refresh button on the webpage don't work as the image is cached. I just see the old image again when my button make the webpage load.  Hitting CRTL+F5 shows the new image but since I want to use this webpage on a smartphone I need a better solution.  I don't want automatic reload page every xx seconds, I want a button that does that manually. But how?  My webpage:
         Click to refresh the page

I know there are many ways to prevent image caching (such as via META tags), as well as a few nice tricks to ensure that the current version of an image is shown with every page load (such as image.jpg?x=timestamp), but is there any way to actually clear or replace an image in the browsers cache so that neither of the methods above are necessary?  As an example, lets say there are 100 images on a page and that these images are named "01.jpg", "02.jpg", "03.jpg", etc. If image "42.jpg" is replaced, is there any way to replace it in the cache so that "42.jpg" will automatically display the new image on successive page loads? I can't use the META tag method, because I need everuthing that ISN"T replaced to remain cached, and I can't use the timestamp method, because I don't want ALL of the images to be reloaded every time the page loads.  I've racked my brain and scoured the Internet for a way to do this (preferrably via javascript), but no luck. Any suggestions?


I have downloaded web2py which is sitting inside: ~/web2py/web2py.py  How can I create a launcher for this?

Will Unity allow making custom launcher icons from .desktop files or via menu editing system? (Right now the launcher doesn't give the option to "keep in launcher" on all programs.  For some programs I use, I have to make custom launchers or .desktop files.  For instance, daily blender builds are generally just folders with an executable.  In basic Gnome or KDE, I can make a new menu entry with the menu editing system. Then, I can also add it to Docky either from the menu or by dragging a .desktop file to it. Unity launcher doesn't support drag and drop, so thats not a bug or anything, but when I open a .desktop file, it has unpredictable results. Most time it will not have "keep in launcher". Sometime it will have a pinnable item without the .desktop's icon, and if I pin the item to the launcher, it will not call upon the program again after closing it. I've also gotten it to just work with a .desktop file for celtx.


I am writing a file to hdfs using java using the following code:      import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.InputStream; import java.io.OutputStream; import java.net.URI;  import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IOUtils;   public class WriteInrix {     public static void main(String[] args) throws Exception {          //Source file in the local file system         String localSrc = args[0];         //Destination file in HDFS         String dst = args[1];          //Input stream for the file in local file system to be written to HDFS         InputStream in = new BufferedInputStream(new FileInputStream(localSrc));          //Get configuration of Hadoop system         Configuration conf = new Configuration();         System.out.println("Connecting to -- "+conf.get("fs.defaultFS"));          //Destination file in HDFS         FileSystem fs = FileSystem.get(URI.create(dst), conf);         OutputStream out = fs.create(new Path(dst));          //Copy file from local to HDFS         IOUtils.copyBytes(in, out, 4096, true);          System.out.println(dst + " copied to HDFS");          } }   But I am getting the following exception     Exception in thread "main" java.lang.NoClassDefFoundError:   org/apache/hadoop/fs/   FSDataOutputStream           at java.lang.Class.getDeclaredMethods0(Native Method)           at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)           at java.lang.Class.getMethod0(Class.java:2866)           at java.lang.Class.getMethod(Class.java:1676)           at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)           at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)   Caused by: java.lang.ClassNotFoundException:   org.apache.hadoop.fs.FSDataOutputSt   ream           at java.net.URLClassLoader$1.run(URLClassLoader.java:366)           at java.net.URLClassLoader$1.run(URLClassLoader.java:355)           at java.security.AccessController.doPrivileged(Native Method)           at java.net.URLClassLoader.findClass(URLClassLoader.java:354)           at java.lang.ClassLoader.loadClass(ClassLoader.java:425)           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)           at java.lang.ClassLoader.loadClass(ClassLoader.java:358)           ... 6 more   Why I am getting the exception? I just copied the source code from the

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


I need to compute $\int_0^\infty e^{-ax}cos(bx) dx $. Integration by parts seems to go nowhere and I can't think of any useful substitutions.

I want to evaluate the following integral via complex analysis $$\int\limits_{x=0}^{x=\infty}e^{-ax}\cos (bx)\operatorname d\!x \ \ ,\ \ a >0$$  Which function/ contour should I consider ?


In windows explorer i don't know how can i sort files and folders by name one after the other. For example i have this list in a folder (order is false, only example):  alfa [folder] anto.rar beta [folder] gamma [folder] gin.zip   and i try to sort by name - explorer gives me back as a result:  alfa [folder] beta [folder] gamma [folder] anto.rar gin.zip   But i want this order  alfa [folder] anto.rar beta [folder] gamma [folder] gin.zip   I want a solution that will give me then the ability to select multiple files as described in this post:   Thanks in advance

When Windows Explorer sorts files, it first sorts files from directories and only then sorts each group using the sort specified (My default is DateCreated). I don't like this as the default behavior.   I would like it to be a simple sort (without separating files from folders). Is it possible to change, and if so how?


In a document where I have, say, 20 business cards front and back, and I have to export them as individual PDFs. That's 40 exports! I know that in acrobat I can extract the pages afterward, but I was wondering if there is a script or something that can do that straight out of InDesign?

I have a one-page InDesign document with 50+ layers. Each layer contains a single logo file, and I need to export the document to a PDF with one layer turned on per page. Ideally, I'd like to export to individual PDF documents, but it would be okay to export to a multi-page PDF as well, and break the PDF into single pages later if needed.


Let say you a professor and there are lots of students, say 100 in your course. After the exam, a student whose final mark is, say 85/100, sends you an email to ask you for a recommendation letter. Assuming that you don't know him, or just remember that he went to your lecture some times (of course you can check his mark). Will you write a recommendation letter for him?

I taught a large class last summer, and one of my students asked me to write a letter of recommendation.  I said yes, and at this point I think it is too late in the application process to change my mind.  The student got an A in the class, but never came to my office hours or talked to me at all before she asked me for a letter of recommendation.  She also hasn't done anything specific to distinguish herself.  At this point I'm really not sure what to write about her, although she did give me a "brag sheet" with information about her interests and previous projects.  How should I go about writing the letter?


Find $a,b,c$ such that $(2\cdot 1-1)+(2\cdot 2-1)+(2\cdot 3-1)+...+(2\cdot n-1)=an^2+bn+c$ Can I get some hints?

Prove that for all integers $n$, $n \geq 1$,   $$1 + 3 + 5 + \cdots + (2n - 1) = n\cdot n$$   How would I go about proving this?