I'm working on this Java project that calculates the average of numbers. Everything seems to be working fine after I populated it with some dummy input.  However, I realized that when I change the positions of same numbers, I get different results.  For instance average of {3.1, 4.7, 5.2, 14.4, 1.1} is 5.7 And average of {3.1, 4.7, 14.4, 1.1, 5.2} is 5.700000000000001.  This makes the comparator return false when comparing some of these numbers (even the ones I have prior knowledge of the result)  Is there something I'm missing?

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


Is i = i + 1 faster than ++i for C++11?  that ++i is faster than i++ for classes, but not for simple types. Is there a similar comparison between i = i + 1 and these other two? Thanks!  EDIT 1: I use g++, but I'd be happy to know how this works on other compilers as well. EDIT 2: This question is different from  because it specifically asks about i = i + 1, as opposed to just talking about the difference between ++i and i++.  EDIT 3: (TonyD - grammatically edited by QuantumFool) The i = i + 1 aspect of the question is a duplicate of

We have the question   What's the answer for C++?


Let $r$ be a rational no. with $0<r<1$. Then $r$ can be expressed as a sum of reciprocals of finitely many distinct positive integers . Show that this is true even for $r>1$.  If there is a particular theorem or an article on this please share..

Let $x\in\mathbb{Q}$ with $x>0$.  Prove that we can find $n\in\mathbb{N}^*$ and distinct $a_1,...,a_n \in \mathbb{N}^*$ such that $$x=\sum_{k=1}^n{\frac{1}{a_k}}$$


I'm specifically looking for a word that means "leads into more research or further examination". I was thinking that the word heuristic could mean this, but I'm not sure. Does anyone know a word a phrase for this?  Here's the way we might use such a word in a sentence:     He read a biography about Thomas Edison and he learned about how   inventors think which became a [heuristic] which motivated him to do more research about   creativity.   Or, in such a way that it would replace the following kind of an idea:     When you learn to develop video games you have to learn how to draw on   the screen which leads you to learn how geometric shapes are   mathematical entities which will lead you to learn the math of   geometry.

There are a few words which I blank on quite frequently. Perhaps my "advanced" age has something to do with it. I don't know. One such word for me is euphemism.    There is another word I am blanking on right now. In my answer to  I also blanked on the same word.   It is a word which describes the power of a quotation, or memorable words, or a theory to stimulate further thought and perhaps research. The word is similar in meaning to prolific, which can denote having the power to generate many further thoughts and ramifications of the original quotation, words, or theory.  If you would be so kind as to supply this word for me and perhaps give me a mnemonic device to make it accessible to me, I'd be very grateful.


I have a simple doubt. I have a string "hi hi", split that based on spaces and then store them in a string array. final String testString = "hi hi";     final String[] arrayOfStrings = testString.split(" ");     if (arrayOfStrings[0] == arrayOfStrings[1]) {         return true;     } else {         return false;     }  This returns false. If intern is used on arrayOfStrings[0] & arrayOfStrings[1] then it returns true. I wanted to understand why is false returned?

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


Since the most recent big Windows anniversary update, the previous option to disable automated reboots on Windows Updates has stopped working. The system gives you the option to set "active hours", but only 12 hours may be set. I'm not against rebooting, but I want it fully on my terms, manually. Is there a way since the anniversary update to disable automated reboot?

I have a Windows 10 Home PC that is often unattended but doing important work. The work follows no particular schedule, and may take place at any time of day or night.  As things stand, Windows 10 (anniversary update) is configured to automatically restart and install updates during inactive times. The user can configure the inactive times, but the OS forces the user to have no more than 12 active hours a day. This means that the machine may well choose to restart at a time that is highly disruptive to our work and when there is no user around to prevent the restart.  For this reason, I would like to ensure that Windows never automatically restarts. How can I achieve this?


Although i have been using forward declaration for a considerable amount of time but never gave a thought to it seriously (my mistake)  Would be helpful if someone could give me pointers or any link regarding following queries :   How do we determine if we require a forward declaration or include is required ? How does compiler actually works in such cases ? any overhead ? Suppose i have two interdependent classes A and B. Both of them uses objects of each other, do i need to forward declare in both the classes.

I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file:  Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ?


As you can see I accidentally closed my properties bar on the right hand side and I can't figure out how to open it again. Please help!    I mean the part I have boxed in red in this one I can't get that one reopened in my current project.

I can't find a way to close a view panel, in particular the horizontal at the bottom, is pretty useless to me at this moment.


Read some time in the early 2000s as a teen, so details may be a little hazy.  Points I'm more confident about:   Sci-fi novel following a male lead Starts with lead living daily life in a slum on some kind of mining planet, focus around manual labour for those in the slums, with heavy guard presence Male lead receives an exosuit, either taken from a guard or as part of mining duty, either the forearm of the suit has a recess for a knife, or the lead has a recess in his arm he can hide one in.   Hazy / Questionable things I can remember:   Explosion in the slums leads to an uprising amongst the miners, lead either joins up with a resistance, or escapes the planet Later in the book he's part of a military / resistance unit, fighting in urban environments along with a female sniper I think there was a section on their training and how they came to form a unit, possible virtual reality training involvement A few sexual encounters throughout the book, can't remember who / which points of it.   I think maybe 150-300 pages total, not sure if a standalone or part of a series.

I'm searching for a book I read 10 years ago, from which I remember only a few details:     In the distant future, the central planets of the galaxy are ruled by a king. The main protagonist is an acquaintance of or becomes friends by the end of the book with the ruling prince.   At some point the main protagonist gets imprisoned/enslaved on an amusement park planet. He has a blade/knife which can cut through anything that wasmade from a strange meteor. In order to hide the blade he has a sheath inside his body's skin (he can get the blade out by contracting muscles in a special way).    By using the concealed blade he escapes from the amusement park planet (together with a woman he had met there) and, later, meets the prince, who travels in disguise.    The book had a short name, similar to "Orion", "Andromeda" or some other celestial body.


We are holding Indian passports. We are planning to book flights from London to Newark (EWR), USA via Reykjavík (KEF), Iceland. We will have layover in Reykjavík for two hours. We have valid USA visas and UK Standard Visitor visas.  Do we need any visa (like a transit visa) to stay in Reykjavík airport during the layover?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


For the users who can see deleted questions on Drupal Answers, I am referring to an answer for . In short:  A user answered the question, deleted his answer, and then undeleted it The question was closed by me 2 days ago, the question was automatically deleted     Now, that answer shows a cast vote to undeleted it, and that the answer has been only deleted by the owner.    What the  say is that the owner deleted the answer, undeleted it, and edited it.     Notice also that deleted by the owner 2 days ago is false, since the answer was automatically deleted from the system 2 days ago.

I have deleted a  (the link is for 10k users on Drupal Answers), and one of the answer is shown as deleted by the owner, which is not what happened, as I deleted the question, and (indirectly) all the answers.    There was also a pending undelete vote it was not present before I deleted the question; when I voted to undelete it the answer was effectively undeleted. (The answer is now shown as deleted, for those who can see the question I am referring.) Still, I don't understand how there could be an undelete vote, when the answer was not deleted, before I deleted the question.  When I deleted the question, Dave Reid was reported to be seen 18 hours before I deleted it. He could have not deleted his own answer in the same moment I was deleting the question.  Update  Looking at  (the link is for 10k users on Drupal Answers), I notice the following.    What happened is that effectively the author of the answer deleted the answer, but then undeleted it. When I deleted the question, the system remembered the undelete vote casted from the author, but it didn't remember that vote already had effect; in fact, when I undeleted the answer, the answer is said to be undeleted from the author, and from me (third entry in the screenshot), when it was just me to undelete it because the user logged in 18 hours before I deleted the question.


I just started programming with Python and I have a question concerning 2D arrays. I need to create a matrix (numpy forbidden) of a certain size from av[1] and save it so that I can multiply it with another one later on. The logical thing for me was: 1- Get the length of av[1]; 2- Transform the av[1][] to it's ASCII equivalent with ord and finally 3- Insert that value into a list called key_matrix.  The matrix needs to be the smallest size possible and in a "square form", so I calculate the smallest square containing the len of av[1] ( called matrix_size ) and then I initialize my array like this:  key_matrix = [[0] * matrix_size] * matrix_size;    Like that I get my square matrix filled with 0. If matrix_size = 3 for example I get:  [[0, 0, 0], [0, 0, 0], [0, 0, 0]]   Now the strange part is (and also the part that I'm stuck on) the following, I use  index1 = 0; index2 = 0; key_matrix[index1][index2] = ord(sys.argv[1][0]); print(key_matrix);   to fill only the 1st element of the 1st line.  While the result should be:  [[97, 0, 0], [0, 0, 0], [0, 0, 0]]   I get:  [[97, 0, 0], [97, 0, 0], [97, 0, 0]]   Me and my friends really cant seem to figure out the reason why it does this, any help is welcome!  Thank you all for reading :)

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I am running PCA on time series data that has returns for a particular stock. Usually, when I run PCA for non-financial data I always scale the data with some R command like prcomp(data,scale=TRUE). However, I believe that returns data is scaled to a certain level. So when using returns data should my command be prcomp(returns,scale=False)?

What are the main differences between performing principal component analysis (PCA) on the correlation matrix and on the covariance matrix? Do they give the same results?


I remember reading a novel about a city that moved across the landscape by continually being disassembled at the rear and those materials used to build at the front. The inhabitants had to walk from the back to the front when they were displaced. In the story the city has stopped, and eventually it's discovered by a displaced citizen that the front of the structure has collapsed as it was built in the water.  I can't remember the name of the book, and whenever I try to search for it all that comes up is Mortal Engines!

I bought this book from a library sale in the 90's but the cover art that I can remember would be 80's/70's.  I've lost the book but have been thinking about the story for years.  It featured a protagonist who lived in the rear portion of a massive linear city structure that was hundreds of stories high, miles wide and hundreds of mile long.  The city 'crawled' across its environs by being deconstructed at the back and the materials and people 'pilgrimmaged' to the front.  The story follows the protagonist and his family's final days in the rear portion before they are to undertake the very long move to the front.  The cover was yellow, and I think had a 'Conan'-style depiction of the protagonists in a sewer/tunnel?  Any info would be appreciated, Thanks!  Edit:  Further details;   The protagonist is a teenage boy who lives in one of the top 'stories' of this structure.  There is a massive greenspace/park which takes the form of an atrium that his floor and several others are adjacent to, with a description of massive lights at the ceiling of the atrium.  The pilgrimmage or relocation journey to the front of the city-snake is done using a train-like vehicle at ground-level but the city itself is immobile -- it cannot move on its own except by being built in one direction and un-built in the opposite.  The protag's family, over generations, has changed in class designation based on their position within the city, first at the front as immigrants and some other level by the time the city's back end has caught up to them - it's falling apart and disheveled.   At some point the engineers come to deconstruct his home and there's descriptions of looking out of the disassembled walls over the plains at other cities (?) moving 'like worms on the plain' (definitely not verbatim)


Subsets of $\Bbb N$ are well ordered. So two subsets of $\Bbb N$,  A and B could be compared by comparing the least elements in A\B and B\A; whichever has the lesser is the lower.  This relation appears also transitive.   It looks to me that this "ordering" will find a "least" in any set of subsets of $\Bbb N$.  But this would produce an effective well ordering of the continuum, which is impossible.  So the proposed "order" is either non-transitive or it will fail to find the "least" in some set of subsets of $\Bbb N$.   Is there immediately obvious where the mistake (if any)?  PS The proposed relation is not even an ordering, as detailed below. Although the counter example from the other post will work here as well.

So, to explain the title, I'm referring to the necessity of the axiom of choice in the existence of a well ordering on reals, or any uncountable set.  Now, while tweaking some sets, I came across this :  We start with the natural numbers, $N$. We take the power set of the naturals, $P(N)$.  Then we remove all the finite subsets of $N$ from $P(N)$. Let us call this new set $S$. This set is the set of all infinite subsets of $N$.  It is easy to show that $S$ has uncountable cardinality, same as that of real numbers. This is because the removal of finite subsets only removes a countable number of elements. (Haven't posted this deduction, for it is very easy, but I may post it if it is not so evident)  Now, we seek to find an ordering on the set $S$. Every set in this set is an infinite subset of natural numbers, so each of these sets are well ordered by the natural ordering of $N$.  Taking any two sets in $S$, say $A$, and $B$, we seek to order them by checking their elements lexicographically. We compare the first two elements in $A$, and $B$. Let them be $a_1$, and $b_1$ respectively. If $a_1 = b_1$, then we move on to the second elements in the sets, $a_2$, and $b_2$, and so on. If, at any point, $a_n < b_n$, then $A < B$, or if $b_n < a_n$, then $B < A$.  This order seems to be a well ordering of the uncountable infinity of reals. I don't seem to have invoked the axiom of choice anywhere in the construction of this set $S$.  So, why isn't this a well ordering on the uncountable of reals?


I have a string that is a date, like this @"dd/mm/yyyy" and I want to split this string in 3 small strings with day, month and year. I've succeeded on doing it with the day using this code:  self.dayLabel.text = [string substringToIndex:2];   but how do I get the middle values, like the month?

What is the best way to tokenize/split a NSString in Objective-C?


I need to install Microsoft Word & Excel in Ubuntu 14.04. Please assist step by step as I am new to Ubuntu.  Thanks!

I am trying to install Microsoft Office Pro 2010 on Ubuntu 13.04 using Wine. I have read several threads and everybody seems to be able to do this but me. So I am giving a shoutout for help. I tried the process taking screenshots of each step. I would post them but evidently I'm not popular enough to be allowed the luxuary of sharing my woes with my fellow Ubuntu-ers. Any suggestions on how to get Office up and running would be greatly appreciated. Thanks!  Here are the steps that I took (without screenshots):   Downloaded the installer.  Right click and click run with Wine Windows Program Loader Unpacking the files Entered the product key, it was validated, and clicked Continue Accept the licensing agreement,and click Continue Click Install Now Waiting... And boom, the error. It just says that the installer has encountered an error. It gives the same result every time.   Again, ANY help is greatly appreciated. THANKS!


Imagine I have 300 gold in Hearthstone. I have two choices on how to spend it:   2 Arena entries 3 boosters   If we ignore the time spent in the arena (both from a time spent and fun perspective) and focus only on the rewards, how many wins do I need to be able to get before arena becomes more profitable than buying boosters?

When accumulating gold through dailies, what is the best way spend this gold? I understand you're able to get card packs through chance when unlocking the chest after finishing the arena. So should I directly buy card packs or take my chance and go for the arena?  (I understand this is skill dependent)  Sub questions:   What can be won in the arena? What is the minimum prize received when losing 3 times?


I had a post locked in psychology and neuroscience and I was wondering how to get it unlocked? I made some edits and it was also migrated from medical to psychology/neuroscience, so it probably has something to do with that. Is it a wait time thing and will automatically unlock? Or do I need to make a request to unlock it?

I posted a question which was closed as off-topic and it seems like it could fit on another site in the network. How can I go about moving it there?   What is migration? When can a question be migrated, and who can migrate it? When should I consider migration, and when is it inappropriate? What causes a migration to be blocked and what happens after? What causes a migration to be rejected and what happens after? Anything else I should know about migration?


I am using Ubuntu 17.04 and I cannot connect to archive.canonical.com. Is it normal?   $ sudo apt-get update Hit:1 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty InRelease Hit:2 http://packages.microsoft.com/repos/vscode stable InRelease                                                             Ign:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease                                                     Hit:4 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release                                                       Hit:5 http://pt.archive.ubuntu.com/ubuntu zesty InRelease                                                                     Hit:6 https://apt.dockerproject.org/repo ubuntu-xenial InRelease                                                              Hit:7 http://pt.archive.ubuntu.com/ubuntu zesty-updates InRelease                                                             Hit:9 https://deb.nodesource.com/node_8.x zesty InRelease                                                                     Hit:10 https://download.sublimetext.com apt/stable/ InRelease                                                                 0% [Connecting to archive.canonical.com (2001:67c:1360:8c01::16)] [Connecting to security.ubuntu.com (2001:67c:1562::16)] [Connecting to dl.google.com (2a00:1450:400e:802::200e)]

Both apt-get update and upgrade hang:  sudo apt-get update [sudo] password for xxx:  0% [Connecting to archive.ubuntu.com (2001:67c:1360:8001::17)]   I'm able to ping archive.ubuntu.com:  ping archive.ubuntu.com PING archive.ubuntu.com (91.189.88.162) 56(84) bytes of data. 64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=1 ttl=50 time=42.2 ms 64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=2 ttl=50 time=42.1 ms 64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=3 ttl=50 time=42.1 ms ^C --- archive.ubuntu.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 42.169/42.206/42.265/0.240 ms   I checked , and I don't think its the same issue.  Any tips for investigating this further?


I was just testing this code by compiling it with GCC (g++);  #include <stdio.h>  main(int argc, char **argv){      printf("something");  }   It seems to build and run fine with just a warning saying;  ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]   Though I defined main() with no return type and not returning any value to it. I then decided to test the same code by compiling it with Visual C++ compiler but it efficiently threw the error:  missing type specifier - int assumed. Note: C++ does not support default-int   and the build was not successful.   I was expecting GCC to throw an error and stop compiling instead of a warning and letting it build successfully.   Why does GCC give main() such privilege of not letting it know its return type?

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?  There are numerous duplicates of this question, including:       — For C++, with a very good answer indeed.     Related:


I'm trying to build a strong deck with minions such as Flame Imp, Arcane Golem, Leeroy etc. that have good stats for their cost, but have downsides. Write down/send links to as many as you know, from any class.

I'm trying to build a low cost deck, so what cards are there like Flame Imp, Arcane Golem, Leeroy etc.? I couldn't find any related info on the internet.


It was quite simple to delete many accounts by clicking on 'help', but I cannot find such a   possibility at Area51.  Can someone tell me how to delete that account?

I have an account in Area51, which I want to delete.  I want to delete only that account, not other accounts I have in Stack Exchange.   How can I do that? I tried to contact administrator of the network (area51@stackoverflow.com) but have not gotten any response yet.


I wonder is there any possibility to show two different listings in one table side by side? Here is my code that only show one listening but how can I embed it in a table and another one?  EDIT: Even I have tried the mentioned links on below, I get a few errors while compiling the file. I also post my edited LaTeX code.      \documentclass[english,a4paper,12pt]{report} \usepackage{mathpazo} \usepackage{graphicx} \renewcommand{\sfdefault}{lmss} \usepackage{courier} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{listings}  \begin{document} \begin{tabular}{|l|l|}  \begin{minipage}{.48\textwidth} \begin{lstlisting}[ basicstyle={\scriptsize\ttfamily}, identifierstyle={\color{black}}, tabsize=2, language={[AspectJ]Java}, numbersep=8pt, numbers=left, xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt, morekeywords ={class,run} ] class PrintHelloThread ext Thread {     void run(Dummy x) {         out.println("Hello world")     } }  class X ext ProxifiedObject {     PrintHelloThread thread      void main(X x) {         x.thread := new PrintHelloThread;         x.thread.start(0);         x.thread.join(0);     } } \end{lstlisting} \end{minipage}  &  \begin{minipage}{.48\textwidth} \begin{lstlisting}[ basicstyle={\scriptsize\ttfamily}, identifierstyle={\color{black}}, tabsize=2, language={[AspectJ]Java}, numbersep=8pt, numbers=left, xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt, morekeywords ={class,run} ] class PrintHelloThread ext Thread {     void run(Dummy x) {         out.println("Hello world")     } }  class X ext ProxifiedObject {     PrintHelloThread thread      void main(X x) {         x.thread := new PrintHelloThread;         x.thread.start(0);         x.thread.join(0);     } } \end{lstlisting} \end{minipage} \\  \end{tabular} \end{document}   What I would like to show is :

I have two XML outputs from a program that I would like to include in a LaTeX document. I would like them to appear side-by-side each in its own box. So that a reader can compare the two outputs while reading the document. Can't seem to find a way to do this, without making images for each output and adding both as images/graphics. Could there be a better option?


I am putting together information regarding common suburban vehicles. I have a list of vehicle categories with several vehicle examples in each category. For example:  SUV   Ford Explorer Jeep Wrangler   Sports Car   Mazda MX-5 Toyota 86   Super Car   Chevrolet Corvette Nissan GTR   Truck   RAM 2500 Chevrolet Colorado   I would also like to add a combined category for non-powered vehicles such as skateboards, bicycles, scooters etc commonly used by children. I'm not sure what exactly to call this category though. I don't really like "non-powered vehicles" because it tends to have a negative connotation which the kids using them won't appreciate. I'm open to slang if it is relevant, but it does not necessarily have to be slang. Any suggestions?

So that's bicycle, skateboard, scooter etc. Problem is that these also have motor powered versions, but if you just say vehicle, people will think that you mean cars or something. Also, you can't search for those powered versions collectively because what would you put in the search bar, "motor powered, human powered vehicles"? If you just use "powered vehicles" all results are cars.


Convert your days alive to use dialog command and a calendar for date of birth select and current date   Hint:  dialog --stdout --title "Today" --calendar "today" 0 0 0 0 0 | awk -F/ '{ print $2"/"$1"/"$3 }'   Also add You have been alive X years(s) Y days(s) Z hour(s) A minute(s) B second(s) thats what I have but I keep getting errors from reading the date from dialog  (Date entered: . ^[[M#<6)  #!/bin/bash #daysalive #using hard coded date calc days between two days date  : ${DIALOG=dialog}  USERDATE=`$DIALOG --stdout --title "CALENDAR" --calendar "Please choose a date..." 0 0` | awk -F/ '{ print $2"/"$1"/"$3 }'  case $? in   0)     echo "Date entered: $USERDATE.";;   1)     echo "Cancel pressed.";;   255)     echo "Box closed.";; esac   DOBDATE=$($USERDATE \+%S) NOWDATE=$(date +%s) echo -n "daysalive" DAYSALIVE="$(($NOWDATE- $DOBDATE)" / 86400 ) echo $DAYSALIVE

I often want to make some quick date calculations, such as:   What is the difference between these two dates? What is the date n weeks after this other date?   I usually open a calendar and count the days, but I think there should be a program/script that I can use to do these kinds of calculations. Any suggestions?


I would like to know why the command to start apache2 server actually starts three processes   Indeed, typing this command:  sudo apache2ctl -k start   then, typing this command:  ps aux | grep apache2   gives three processes corresponding to apache2. Is that normal?

This is the command ps -A |grep -i apache2 output:  xxxx@debian:~$ ps -A |grep -i apache2  2362 ?        00:00:01 apache2  2365 ?        00:00:00 apache2  2367 ?        00:00:00 apache2  2369 ?        00:00:00 apache2   Which is the correct pid when i use killcommand ?


I create an animation GIF image and added to my project as Splash screen.  When I run my application the splash screen appeared BUT the animation does not work !  Any suggestion?

What control type should I use - Image, MediaElement, etc.?


While graphing the sine function, it is always assumed that x is in radians.Similarly while differentiating the sinx function x is always in radians and we have to multiply by a constant if x is given to us in degrees, before differentiating. Is radian just a convention for trigonometric functions or is there some other reason?Why are we able to differentiate a function directly when x is in radians and not when it is in degrees?

I'm still struggling to understand why the derivative of sine only works for radians. I had always thought that radians and degrees were both arbitrary units of measurement, and just now I'm discovering that I've been wrong all along! I'm guessing that when you differentiate sine, the step that only works for radians is when you replace $\sin(dx)$ with just $dx$, because as $dx$ approaches $0$ then $\sin(dx)$ equals $dx$ because $\sin(\theta)$ equals $\theta$. But isn't the same true for degrees? As $dx$ approaches $\theta$ degrees then $\sin(dx \,\text{degrees})$ still approaches $0$. But I've come to the understanding that $\sin(dx \,\text{degrees})$ approaches $0$ almost $60$ times slower, so if $\sin(dx \,\text{radians})$ can be replaced with $dx$ then $\sin(dx \,\text{degrees})$ would have to be replaced with $(\pi/180)$ times $dx$ degrees.  But the question remains of why it works perfectly for radians. How do we know that we can replace $\sin(dx)$ with just $dx$ without any kind of conversion applied like we need for degrees? It's not good enough to just say that we can see that $\sin(dx)$ approaches $dx$ as $dx$ gets very small.  Mathematically we can see that $\sin(.00001)$ is pretty darn close to $0.00001$ when we're using radians. But let's say we had a unit of measurement "sixths" where there are $6$ of them in a full circle, pretty close to radians. It would also look like $\sin(dx \,\text{sixths})$ approaches $dx$ when it gets very small, but we know we'd have to replace $\sin(dx \,\text{sixths})$  with $(\pi/3) \,dx$ sixths when differentiating. So how do we know that radians work out so magically, and why do they?  I've read the answers to  and followed the links, and no, they don't answer my question.


I use markdown to take school notes. They are later converted, via Pandoc to HTML and PDF (through LaTeX templates). I am trying to typeset a Symbol (floated left) to multiple lines of text. In the browser it looks like this:   or   This works in HTML by inserting the raw HTML and CSS (using floats and padding or tables). Is there a way to accomplish the same thing in the LaTeX?   Thank you for your help!

I am writing an Article in LaTeX.  Please suggest me how to create a highlight boxes like the ones shown below in LaTeX:


The question is to prove:$$\sum\limits_{r=0}^n{n\choose r}^2={2n\choose n}$$   using the binomial expansion of $(1+x)^n$ and $(1+x^{-1})^n$.   So firstly: $$(1+x)^n=\sum_{i=0}^n\frac{n!.x^n}{i!.(n-i)!}$$ $$(1+x^{-1})^n=\sum_{i=0}^n\frac{n!.x^{-n}}{i!.(n-i)!}$$ and we can work out that: $$\sum_{r=0}^n\left[\begin{pmatrix}n\\r\end{pmatrix}\right]^2=\sum_{r=0}^n\left(\frac{n!}{r!(n-r)!}\right)^2$$ but I am unsure of where to go from here

I've seen the identity $\displaystyle \sum_{i \mathop = 0}^n \binom n i^2 = \binom {2 n} n$ used here recently.  I checked for proofs here   I couldn't have figured out the combinatorial proof by myself, and the inductive proof assumes you already know the answer...  So my question is : do you know how to prove directly through computation that $\displaystyle \sum_{i \mathop = 0}^n \binom n i^2 = \binom {2 n} n$ ?


What is the difference in collect a command output in Shell script using `command` and $(command)? For example:  # IP1=$(ifconfig eth0 | grep -e "inet " | cut -d: -f2 | awk '{print $1}') # IP2=`ifconfig eth0 | grep -e "inet " | cut -d: -f2 | awk '{print $1}'` # echo $IP1 $IP2 > 192.241.145.112 192.241.145.112

There are two syntaxes for command substitution: with dollar-parentheses and with backticks. Running top -p $(pidof init) and top -p `pidof init` gives the same output. Are these two ways of doing the same thing, or are there differences?


Suppose that the sequence $(a_n)_{n \ge 1}$ of real numbers is such that $a_{n+1}− a_n \to 0$. Prove that the set of limits of its convergent subsequences is the interval with endpoints $\liminf_{n \to \infty} a_n$ and $\limsup_{n \to \infty}a_n$.   Can this be done this way that since the elements of the sequence are dense hence if you take a point then there are infinitely many elements around its neighbourhood and hence it acts as a subsequential limit now between lim sup and lim inf every point is a subsequential limit hence the proof follows Please help whether the above method is right or wrong

I'm fixing an arbitrary $x$ in $a<x<b$ and I must prove that $x$ is the limit of a subsequence of $(x_n)$. I have a theorem that says that $x$ is a subsequential limit of a sequence $(x_n)$ iff every interval $(x-\epsilon, x+\epsilon)$ containts infinitely many terms of $(x_n)$. I also know that $a$ and $b$ are the smallest and largest subsequential limits of $(x_n)$.  I don't know where to go from here.


I use my laptop for overnight downloads and there has just been a problem with our society/apartment generator due to which a new generator is being used which I think causes fluctuations.  Does a laptop charger/adapter really protect it?  I am really concerned. I also want to know if it can cause serious damage such as requiring new parts.

I recently bought a laptop. While connecting it to the AC mains for charging it up for the first time, I wondered what would happen if a power surge occurred while my laptop was connected to the AC mains.  I asked a few of my friends who told me not to worry.. the adapter I use would protect my laptop. Still the doubt lingers in my brain..  So here's my question: should I use some form of stabilizer for my laptop? My question might be simple and downright stupid, but I thought I'd ask it anyway, as my electronics knowledge is literally zero.  Note: I live in India, in case you need that knowledge.


has an insane whopping 323K views - more than many of the top-voted questions of the site.    I doubt that it's the highest-viewed question on the site itself, but I'd like to see how it stacks up against the other questions.   Is there any way to see a site's questions ranked by number of views?   I would like to see how many questions are higher-ranked in view count than mine, and by how many views they outrank my own question.

The question is in the title, how do I sort the questions by the number of view?   If not that, I'd settle for any suggestion on how to view the "Most Viewed" questions.


I have two rich picklists whose selected item section or destination values must be mutually exclusive. I did this piece of code:-       LinkedHashMap<String,Boolean> includeRatePlans = getCampaign().getDataPackages();     LinkedHashMap<String, Boolean> excludeRatePlans = getCampaign().getSmsPackage();     for (String excludeRatePlan : excludeRatePlans.keySet()){         if(excludeRatePlans.get(excludeRatePlan)){             for (String includeRatePlan : includeRatePlans.keySet()){                 if (includeRatePlans.get(includeRatePlan))                     if (includeRatePlan.equals(excludeRatePlan)){                         getCampaign().getSmsPackage().remove(excludeRatePlan);                 }             }         }     }   But I am getting java.util.ConcurrentModificationException

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


I'm gonna fly from Barcelona to Charlotte with a stop in Miami. I wanted to know if I'll need to get through the US Customs and Border Protection in Miami, because I have a flight to take from Miami to Charlotte, and the waiting between my flights it's 1:36 hours. Or if I'll pass through it once I get to Charlotte, where I need to take my luggage and take a domestic flight.  It's the second time I'm flying to the States (first in 2008), and I have an ESTA.

I'm a British citizen travelling from London Heathrow (LHR) to the Hartford, Connecticut airport, and have a two hour stopover in Newark, New Jersey (EWR) on my itinerary. At what stage would I clear immigration and customs on arriving in the USA?


I'm planning to enter the United States for vacation. My nationality is Indian but I'm a graduate student in Europe and I'm planning to travel to Boston, NYC and NJ for a total of 7 days. I've already pre-booked my flights and my airbnb but I came to know that you have to inform the CBP officer at the port of entry about the amount of money you're carrying with you.   I'm taking around 550 in cash with me and I will also carry my bank card which will give me access to another 200-300 dollars for my stay. Since I do not plan to do any shopping, I was wondering if this will be enough to convince the CBP officer that I do not wish to abuse or violate my visa terms? Or should I carry even more money?   I am really not sure if there is a specific amount that they're looking for.

My friend, a Chilean citizen, is entering the US via waiver program to spend 3 weeks in USA in a couple of weeks. She already got her ESTA approval, the plane ticket, all hotels are already booked (but paid by me, not her).  How much money would she need to bring with her when entering US? Do they still check this? She would of course have credit cards with her.


When I was studying thermodynamics potentials for the first time, I learned that keeping the pressure and the temperature constant, the Gibbs Free Energy is a minimum, also, if we maintain the temperature and the volume of a given system constant, the Helmholtz energy will be a minimum. However, when I was studying Landau theory, I was confused if one should minimize the gibbs free energy or the helmholtz free energy. For example, in the Ising Model, one expands the Free Energy and the applies landau theory. However, we need to expand the Gibbs Free Energy in the liquid-gas transition.

In the Landau theory of phase transitions, one typically considers a "free energy" $F$ as a function of the temperature $T$ and the "order parameter" $\psi$: $F(T, \psi)$.  For the sake of clarity, let's consider the liquid-gas transition, in which the order parameter is usually taken to be the difference of densities between the ordered phase and the disordered phase.  In this case, it looks that the order parameter $\psi$ is closely related to the the volume $V$, a global variable of state.  What is the correct interpretation of $\psi$ as a thermodynamic variable?   I consider several logical possibilities, but all interpretations look troublesome to me:    $\psi$ is a variable of state replacing the volume. In this case I have a few related concerns:   Is the "free energy" $F$ the Helmholtz or the Gibbs free energy?    If $F$ is the Gibbs free energy, $F$ should depend on the temperature $T$ and the pressure $p$ (the conjugate variable of the volume), so it shouldn't depend on $\psi$.  If it is the Helmholtz free energy, it's ok that it depends on $\psi$, but the experiments are usually carried out at constant pressure, not constant volume.  Usually, state variables are something one can select at will [for instance, think of the phase diagram $(p, T)$]. However, the order parameter $\psi$ is not selected at will, but it is selected by the system as a result of the minimization process according to the Landau theory.  $\psi$ is yet another variable of state in addition to volume and temperature.    Why the pressure is not usually taken into account as a variable of state, and only the temperature is considered? What is the conjugate variable to $\psi$? Can really $\psi$ and $V$ be taken as independent?  $\psi$ is not a variable of state, is something else.   What else can $\psi$ be from the thermodynamic point of view? Same question as above, why is pressure not usually taken into account in Landau theory?


I would like to make reference of a table that I have introduced before. However, after I try to typeset the first time, I have double question marks like this table ??.     I know that I need to typeset twice to get a correct reference. But the thing is that sometimes I get double question marks for the first typesetting but often times I get a blank, like this: table in the first typesetting.  No matter what I get in the first time, I will always get a blank after the second typesetting. My pdf looks like this: table and figure 1 show that...  What also confuses me is that I reference a figure right after my reference to the table but everything works fine as it is shown above. I have searched similar questions but I do not have similar preamble as the other guy did. Also I put my label before the caption for my table, which should not be a trouble here. So could any body helps me with this issue?  My code:  \begin{figure}[H] \centering \includegraphics[height=4in]{/Users/Desktop/Differentpandn.png} \caption[]{Distributions of different sample sizes and proportions}  \label{fig:different n and p} \end{figure}  \begin{table}[H] \centering \begin{tabular}{c c c c c} \multicolumn{5}{c}{\textbf{The Normal Distribution of Different p and n}}\\ \hline %The table is omitted for convenience \end{tabular}    \label{tab:Table of different proportions and sizes} \caption{Center, Shape and Center of different distributions} \end{table}  From the table \ref{tab:Table of different proportions and sizes}  and figure \ref{fig:different n and p}    My preamble:  \usepackage[margin = 1 in, includefoot]{geometry} \usepackage{graphicx} \usepackage{float} \usepackage[hidelinks]{hyperref} \usepackage[shortlabels]{enumitem} \usepackage{amsmath}

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


This question comes from the 2007 IMO shortlist:     Find all integers $a,b,c$ such that $ab-c$, $bc-a$ and $ca-b$ are powers of two (of the form $2^k$ where $k \geq0$).   What are some methods of finding solutions?

This is a 2015 IMO problem.  It seems difficult to solve.     Find all triples of positive integers $(a, b, c)$ such that each of the numbers $ab-c$, $bc-a$, and $ca-b$ is a power of $2$.   Four such triples are $(a,b,c)=(2,2,2),(2,3,2),(3,5,7),(2,6,11)$.


Let $x_n \colon= \sqrt[n]{n!} $ for all $n \in \mathbb{N}$.   Then how to determine rigorously whether the sequence $\left( x_n \right)_{n \in \mathbb{N} }$ converges or diverges?   And, how to find $\lim_{n \to \infty} x_n$, rigorously?  By rigorously I mean using the same machinery as has been developed by Rudin until Chap. 3, where he discusses sequences.   My Attempt:      We note that, for all $n \in \mathbb{N}$ such that $n > 1$, we have   $$ 1 \leq \left( x_n \right)^n \leq n^{n-1}, $$   and so    $$ 1 \leq x_n \leq n^{ (n-1)/n } = \frac{ n }{\sqrt[n]{n} }. $$   However, although    $$ \lim_{n \to \infty} \sqrt[n]{n} = 1, $$   we also have    $$ \lim_{n \to \infty} n = +\infty. $$   Thus the squeeze theorem is not applicable.    Or, can we find some majorizing sequence converging to $1$?  Is this sequence monotonic?

How do I prove that $ \displaystyle\lim_{n \to{+}\infty}{\sqrt[n]{n!}}$ is infinite?


I want to prove the following question but I have no idea to start!  let $A$ be a $3\times2$ matrix and $B$ be a $2\times3$ one. if $AB=\begin{bmatrix}8 & 2 &-2 \\2 & 5 & 4 \\-2 & 4 & 5 \end{bmatrix}$ then prove that $BA=\begin{bmatrix}9 & 0\\ 0 & 9\end{bmatrix}$. [ hint:if $AB=I$ then we have $BA=I$]

Let $A∈\mathscr{M}_{3×2}(\mathbb{R})$ and $B∈\mathscr{M}_{2\times3}(\mathbb{R})$ be matrices satisfying   $AB =\begin{bmatrix} 8 &2 &−2\\ 2 &5 &4\\ −2 &4& 5 \end{bmatrix}$. Calculate $BA$. (Golan, The Linear Algebra a Beginning Graduate Student Ought to Know, Exercise 426.)   Maybe it can be solved by solving a system of equations, but I think there is a shorter way since this problem was in my exam.  Thanks.


I assume that my case is weird but I've the following information:   IV: 0x263e or 0x3e26 Auth tag: 0x25 AES256-GCM encrypted payload: 0x4eec96df534ade4c013a AES256-GCM decrypted payload: 0x0041e36baf2648090174   Regarding the length of the IV and Auth tag, I'm wondering if it is possible to guess the key used to encrypt the payload ?

I have a file, which was encrypted with AES-128 in ECB mode. I know the format of the original file and know that all files in this format have the same headers. So, I have an encrypted block and the original block.  Can I get the encryption key, using this information?


Most 2D animation software can render the animation 'frame-by-frame'. There are no smooth transitions between each frame, and each frame after is usually blank, and the artist re-draws the scene, a bit different. The last can also sometimes be altered for a new frame. It will be like an animated lego stop-motion like film:    My goal is to be able to have my scene all set in frame one and then duplicate that scene to the next frame to be altered and to not 'smooth' the animation frames.   Question:  Is something like a stop-motion (no actual footage) possible with CGI in Blender? If so, how do I go about creating this environment to animate with?

So we all know its there, and we all know how to fix it, but adding the extra steps to have to change the interpolation on every new animation just plain sucks. To be honest I don't find this feature useful as a default at all because more times than not we have to correct for it.  Is there an option somewhere to turn auto ease in off? (I personally think this should be the default and should require user to turn it on if they want it).


I know this has been asked a few times, but my scenario is a little different... The objective I need to accomplish is to convert a string of digits '20150425' (which happens to be a date), into a date format such as, '2015-04-25'.  I need this because I am trying to compare date objects in my code, but have one variable type represented as a string.  Example below:     date = '20150425' ## want to convert this string to date type format     # conversion here     conv_date = '2015-04-25' ## format i want it converted into   Hope this is clear.  Should not be difficult, just do not know how to do it.

I've got a huge list of date-times like this as strings:  Jun 1 2005  1:33PM Aug 28 1999 12:00AM   I'm going to be shoving these back into proper datetime fields in a database so I need to magic them into real datetime objects.   This is going through Django's ORM so I can't use SQL to do the conversion on insert.


How to write a query to fetch third highest salary from table? cid  salary --- ------ 1    15000 2    20000 3    7000 4    35000 5    60000

What is the simplest SQL query to find the second largest integer value in a specific column?   There are maybe duplicate values in the column.


I made a RegExp that functions correctly in my code, but it is only compatible with ES2018 because it uses negative lookbehinds. A library is consuming the RegExp function, so I can't change how the RegExp is used.  I've tried placing a non-capturing groups at the start to find "not" the characters, but it does not work the same when I test it.  /((?<![\^+-])[0-9]+)/g   When running my test suite regexes like /(?:[^^+-])([0-9]+)/g fail the tests because they include the preceding character.

I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.


In my country (India), there are several implicit norms that need to be followed by almost every one. Among all, an important norm is that juniors does not address their seniors by name. It happens in both students' circles and faculty circles -- thus, even junior professors would not address senior professors by name. Recently (in the US), a female assistant professor addressed a male associate professor by his name. It is the first time ever I saw an incident like this personally. I personally considered it as an offense to the male associate professor. So, I am wondering whether it is a norm in the US to address seniors as "sir" or any other respectable salutation instead of addressing by name. Note: The question is broader than only addressing a professor.

At US universities, how should one address a professor while talking to him or her? In my home country, we usually address the professors as either "sir" or "madam" while talking about our queries in person.   What's the norm at US universities?


I am running the latest version of iOS Minecraft. Education mode and cheats are enabled. I've got command block and trying to apply the following command there - give @p minecraft:written_book{pages:["[\"\",{\"text\":\"The art of rituals is of vital importance to the player.\"}]","{\"text\":\" It is a matter of life and death,\\na road either to safety or to ruin.\"}]","{\"text\":\"Hence it is a subject of inquiry which can on no account be neglected.\"}"title:"Magick Moste Evile",author:Herobrine,display:{Lore:["Of the Horcrux, wickedest of magical inventions, we shall not speak nor give direction —"]}}  But it doesn't work. I get the following error -  Syntax error. Unexpected "minecraft:written_book" at "/give @p >>minecraft:written_book<<{pages:[''["  (some other commands like teleport work well) What could be wrong here? Are there some limitations applied to iOS version?

This question was recently split into different questions for each workaround. See   meta posts for more information.   Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s}


I'm trying to achieve something relatively simple using an RNN:  1) My input is any value between 0 and 1.  2) My output must be a simple Gaussian Curve, whose parameters depend on the input amplitude. (I am modeling this by using return_sequences=True in Keras and Time Distributed layers)  Currently, my model does not seem to be working well and I fear my approach to the problem is wrong. The reason I have not disclosed my model is because I am looking for completely fresh ideas. I would be very grateful if someone could point me to any references that would help me achieve this task.  I am required to use only a simple RNN model and not an LSTM.

I'm training a neural network but the training loss doesn't decrease. How can I fix this?  I'm not asking about overfitting or regularization. I'm asking about how to solve the problem where my network's performance doesn't improve on the training set.    This question is intentionally general so that other questions about how to train a neural network can be closed as a duplicate of this one, with the attitude that "if you give a man a fish you feed him for a day, but if you teach a man to fish, you can feed him for the rest of his life." See this Meta thread for a discussion:   If your neural network does not generalize well, see:


I am looking through the Deities & Demigods book for D&D 3.5 and it lists all the different powers and feats/salient abilities, but it does not touch on progressing your Divine Rank. Is this strictly up to the DM? Is there an XP chart for Divine Rank, or something? How does advancement as a god work? I am unable to locate any explanation.  In particular, I'm interested in how one attains Divine Rank 1 from Divine Rank 0.

How does one become a deity? I read Deities and Demigods, but some things are either not explained or not mentioned at all.   Do you have to get a blessing from a god with 20+ divinity? Can you achieve ascendancy with a lot of worshipers? (Let's say a million.) Can you ascend if you kill a god? Is there a ritual to become a god? Any other means of becoming a god?


I have a problem when equations appear in the text without a linebreak. It seems like an additional spacing before an equation is inserted, when the line before the equation is just full until the end...  The problem only appears with documentclass scrbook (at least not with article) and with the packages amsmath with the option fleqn and hyperref! Removing one of these options/packages/... also removes the additional spacing.  MWE:  \documentclass[parskip]{scrbook}  \usepackage[fleqn]{amsmath}    \usepackage{hyperref}   \begin{document}  test test test test test test test test test test test test test test test test test test test \begin{equation} test \end{equation} test test test test test test test test test test test test test test test test test test test test \begin{equation} test \end{equation} test test test test test test test test test test test test test test test test test test test test% \begin{equation} test \end{equation} \end{document}   The parskip option is only for the first line not to be intended. As one can see before the second equation (0.2), there's an additional vertical spacing inserted compared to the spacing of equation (0.1).  The effect does not appear, if an % comments out the newline character, or if the \begin{equation} is written directly in the text line, without a newline in the .tex-file, which can be seen before equation (0.3).   A similar problem was already mentioned in , but without solution.  Edit:  A solution (for the package hyperref) is given in .

When the fleqn option is used, the vertical spacing before an equation placed right after a "long" text line (exactly \linewidth I would say) is improperly set up. See below:    From the mathmode user guide, this could probably be fixed through the \topsep length. Is it the right way to proceed? The problem is reproduced by the code below:  \documentclass[12pt,fleqn]{book} \usepackage{amsmath} \usepackage{hyperref} \begin{document} \chapter{plo} \section{plo} eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùaeoiuaem oeiu eoiu eoiu oeee. eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùaeoiuaemm \begin{equation} \cos\pi=-1 \end{equation} eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùaeoiuaem oeiu eoiu eoiu oeee. eoiu oieu oeiuoe ueoi ueoi ueoiu eoiu oeu oe iupaêio umùae \begin{equation} \cos\pi=-1 \end{equation} \end{document}   There is something wrong involving hyperref, amsmath, and fleqn. Removing one of those removes the problem.


Let $f(z)$ be an entire function s.t $\forall z  ; f(z+i)=f(z), f(z+1)=f(z)$ Prove: $f$ is constant  So we need will show that $f(z)$ is bounded. How should I approach this?

Let $f: \Bbb C \to \Bbb C$ be an entire (analytic on the whole plane) function such that exists $\omega_1,\omega_2 \in \mathbb{S}^1$, linearly independent over $\Bbb R$ such that: $$f(z+\omega_1)=f(z)=f(z+\omega_2), \quad \forall\,z\in \Bbb C.$$Prove that $f$ is constant.   The intuition seems clear to me, we have the three vertices of a triangle given by $0$, $\omega_1$ and $\omega_2$. All points in the plane are one of the vertices of that triangle under a suitable parallel translation. The constant value will be $f(0)$, fine. Throwing values for $z$ there, I have found that $$f(n\omega_1) = f(\omega_1) = f(0)=f(\omega_2) = f(n\omega_2), \quad \forall\, n \in \Bbb Z.$$  I don't know how to improve the above for, say, rationals (at least). Some another ideas would be:   Checking that $f' \equiv 0$. I don't have a clue of how to do that. Write $w = a\omega_1+b\omega_2$, with $a,b \in \Bbb R$, do stuff and conclude that $f(w) = f(0)$. This approach doesn't seem good, because I only have a weak result with integers above. Finding that $f$ coincides with $f(0)$ on a set with an accumulation point. This seems also bad: the set on with $f$ coincides with $f(0)$ by which I found above is discrete.    Nothing works and this is getting annoying... And I don't see how analyticity comes in there. I'll be very thankful if someone can give me an idea.  (On a side note.. I know that this title is not informative at all. Feel free to edit if you come up with something better.)


I am trying to write a simple program to listen to clipboard copys and save them. I wrote the following code:  package CopyPaste;  import javax.swing.JFrame;  public class Main {      public static void main(String[] args){         JFrame frame = new JFrame("Copy Paste");         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         frame.setSize(600,600);         frame.setLocationRelativeTo(null);          MyPanel pane = new MyPanel();         frame.add(pane);          frame.setVisible(true);     } }     package CopyPaste;  import java.awt.BorderLayout; import java.awt.Font; import java.awt.TextArea; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.ClipboardOwner; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.FlavorEvent; import java.awt.datatransfer.FlavorListener; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.IOException; import java.lang.Object;  import javax.swing.JButton; import javax.swing.JPanel;  public class MyPanel extends JPanel implements ClipboardOwner{      private final static Font f = new Font("david", Font.BOLD,22);     private static TextArea text;     private JButton btnGet;     private Clipboard c;      public MyPanel(){         this.setLayout(new BorderLayout());          text = new TextArea();         text.setFont(f);         add(BorderLayout.CENTER,text);         add(BorderLayout.SOUTH,this.getSouthButton());          c.addFlavorListener(new FlavorListener() {              @Override             public void flavorsChanged(FlavorEvent e) {                 proccessClipboard(c);              }         });     }      private static void proccessClipboard(Clipboard c){         String s = null;         c = Toolkit.getDefaultToolkit().getSystemClipboard();         try {             s = (String) c.getContents(null).getTransferData(DataFlavor.stringFlavor);         } catch (UnsupportedFlavorException | IOException e1) {             // TODO Auto-generated catch block             e1.printStackTrace();         }          text.setText(s);     }      //return the south panel button     private JPanel getSouthButton(){         JPanel south = new JPanel();         btnGet = new JButton("Get");         ButtonLis lis = new ButtonLis();         btnGet.addActionListener(lis);         south.add(btnGet);         return south;     }      private class ButtonLis implements ActionListener{          public void actionPerformed(ActionEvent e) {             String s = null;             if (e.getSource()==btnGet){                 c = Toolkit.getDefaultToolkit().getSystemClipboard();                 try {                     s = (String) c.getContents(null).getTransferData(DataFlavor.stringFlavor);                 } catch (UnsupportedFlavorException | IOException e1) {                     // TODO Auto-generated catch block                     e1.printStackTrace();                 }                  text.setText(s);             }           }      }      @Override     public void lostOwnership(Clipboard clipboard, Transferable contents) {         // TODO Auto-generated method stub      } }     error: Exception in thread "main" java.lang.NullPointerException     at CopyPaste.MyPanel.<init>(MyPanel.java:39)     at CopyPaste.Main.main(Main.java:13)   for some reason the eclipse don't show any errors but when i hit the "run" button i get some compile error. someone know what can cause this?

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


Folks,  I have a Lenovo Legion Y7000 with dual boot system (Win10 and Ubuntu 18.04). The internal wireless card is Realtek 8822be and I have also attached a Panda wireless USB drive (as I was unable to get the internal wireless card working). When I go to Wi-Fi Settings in Ubuntu, I see "No Wi-Fi Adapter Found" for both internal and USB Wi-Fi drives. But the following commands actually show that Ubuntu has detected my Wi-Fi chips:  o-vh@o-vh:~$ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 04ca:7070 Lite-On Technology Corp.  Bus 001 Device 003: ID 046d:c52f Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 0bda:b023 Realtek Semiconductor Corp.  Bus 001 Device 002: ID 148f:5372 Ralink Technology, Corp. RT5372 Wireless Adapter Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   Also,  o-vh@o-vh:~$ iwconfig wlp7s0    IEEE 802.11  ESSID:off/any             Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm              Retry short limit:7   RTS thr=2347 B   Fragment thr:off           Power Management:on  enp8s0    no wireless extensions.  wlx7cdd90764d5b  IEEE 802.11  ESSID:off/any             Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm              Retry short  long limit:2   RTS thr:off   Fragment thr:off           Power Management:off  lo        no wireless extensions.   which is not clear to me, as it seems that two wireless cards are detected, but I still see two no wireless extensions. messages. Finally, when I run lshw -C network, I see:    *-network                         description: Wireless interface        product: RTL8822BE 802.11a/b/g/n/ac WiFi adapter        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:07:00.0        logical name: wlp7s0        version: 00        serial: 48:5f:99:b2:fd:e7        width: 64 bits        clock: 33MHz        capabilities: bus_master cap_list ethernet physical wireless        configuration: broadcast=yes driver=r8822be driverversion=4.15.0-50-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11        resources: irq:143 ioport:4000(size=256) memory:a4300000-a430ffff   *-network        description: Ethernet interface        product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:08:00.0        logical name: enp8s0        version: 15        serial: e8:6a:64:c1:75:66        size: 100Mbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 33MHz        capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.88.187 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:17 ioport:3000(size=256) memory:a4204000-a4204fff memory:a4200000-a4203fff   *-network DISABLED        description: Wireless interface        physical id: 1        bus info: usb@1:1        logical name: wlx7cdd90764d5b        serial: 7c:dd:90:76:4d:5b        capabilities: ethernet physical wireless        configuration: broadcast=yes driver=rt2800usb driverversion=4.15.0-50-generic firmware=N/A link=no multicast=yes wireless=IEEE 802.11    Note that for the USB Wi-Fi I see *-network DISABLED while I don't see this for the Realtek Wi-Fi.   Can anyone give me some hints on what the problem is and how I can fixed the "No Wi-Fi Adapter Found" issue? I appreciate your help very much!  I have tried many of the approaches suggested for similar (but not identical) problems without any success.

First of all im sorry if this thread is duplicated with another one, but i didnt find a solution for the problem.  So i bought new laptop (Lenovo Y520) and setup dual boot Win10 with Ubuntu 16.04 and wireless doesnt work for the ubuntu (LAN works).  ifconfig  enp4s0    Link encap:Ethernet  HWaddr c8:5b:76:da:32:ba         inet addr:192.168.0.102  Bcast:192.168.0.255  Mask:255.255.255.0       inet6 addr: fe80::62bc:4b27:ec0f:1d9c/64 Scope:Link       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1       RX packets:18584 errors:0 dropped:0 overruns:0 frame:0       TX packets:12706 errors:0 dropped:0 overruns:0 carrier:0       collisions:0 txqueuelen:1000        RX bytes:20071392 (20.0 MB)  TX bytes:1500456 (1.5 MB)  lo        Link encap:Local Loopback         inet addr:127.0.0.1  Mask:255.0.0.0       inet6 addr: ::1/128 Scope:Host       UP LOOPBACK RUNNING  MTU:65536  Metric:1       RX packets:1849 errors:0 dropped:0 overruns:0 frame:0       TX packets:1849 errors:0 dropped:0 overruns:0 carrier:0       collisions:0 txqueuelen:1        RX bytes:200236 (200.2 KB)  TX bytes:200236 (200.2 KB)   .  iwconfig  wlp3s0    IEEE 802.11  ESSID:off/any         Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm          Retry short limit:7   RTS thr:off   Fragment thr:off       Power Management:on  enp4s0    no wireless extensions.  lo        no wireless extensions.   I ran some commands which found in another threads.  sudo lshw -class network   *-network                   description: Wireless interface    product: Intel Corporation    vendor: Intel Corporation    physical id: 0    bus info: pci@0000:03:00.0    logical name: wlp3s0    version: 78    serial: 00:28:f8:69:15:13    width: 64 bits    clock: 33MHz    capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless    configuration: broadcast=yes driver=iwlwifi driverversion=4.8.14-040814-generic firmware=22.361476.0 latency=0 link=no multicast=yes wireless=IEEE 802.11    resources: irq:332 memory:a4200000-a4201fff *-network    description: Ethernet interface    product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller    vendor: Realtek Semiconductor Co., Ltd.    physical id: 0    bus info: pci@0000:04:00.0    logical name: enp4s0    version: 10    serial: c8:5b:76:da:32:ba    size: 100Mbit/s    capacity: 1Gbit/s    width: 64 bits    clock: 33MHz    capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation    configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168g-3_0.0.1 04/23/13 ip=192.168.0.102 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s    resources: irq:322 ioport:4000(size=256) memory:a4104000-a4104fff memory:a4100000-a4103fff   .  rfkill list  0: ideapad_wlan: Wireless LAN Soft blocked: no Hard blocked: yes 1: ideapad_bluetooth: Bluetooth Soft blocked: yes Hard blocked: yes 2: hci0: Bluetooth Soft blocked: yes Hard blocked: no 3: phy0: Wireless LAN Soft blocked: no Hard blocked: no   .  lspci -nnk | grep 0280 -A2  03:00.0 Network controller [0280]: Intel Corporation Device [8086:24fd] (rev 78) Subsystem: Intel Corporation Device [8086:1010] Kernel driver in use: iwlwifi   Things that i've tested and didnt worked.  * sudo rfkill unblock wifi * Additional Drivers -> Not showing wifi driver * restart network-manager service * http://askubuntu.com/a/859263


I've got a setup-notebook-keyboard.sh script that I run everytime after logging in because I like my keyboard with the    CapsLock -> Esc,  CapsLock+Key -> Ctrl+Key    setting.  I've tried to set this up before, but wasn't able to. I think I've tried setting it up in init.d and also with ubuntu "run on startup". I guess both cases didn't work because they are not run on a shell environment or something...   But anyway, I got stuck with running the script every time after startup and after closing the lid of the Notebook. Can somebody help?  Edit: I don't think this is a duplicate of 'how to persistently remap keys in Ubuntu', I have a script which does two things and I'm happy with it since I've been using it since last year, I just wasn't able to get it to run automatically and I have researched and tried it in different ways.  Edit 2: Please remove the duplicate tag. I've tried the suggestion on the question and none of them worked. I've now tried just adding a simple echo "(profanity) (location)" >> ~/file in:   ~/.profile ~/.xinitrc ~/.xsession ~/.gnomerc   The machine is just not doing nothing on the files, or I've done something very wrong.  I've tried adding a (profanity).desktop entry in ~/.config/autostart, tried using the full paths, tried /etc/X11/Xsession.d/00_xx file, tried 00 and 100, closing the lid and opening, rebooting, etc.  I test it by checking if the CapsLock key lights up or not when I press it, because after I execute setup-notebook-keyboard.sh it doesn't light up anymore.  Aditional info that may be important: I'm using gnome shell and it's a graphic user interface.  Version: 10:37:34 ~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 16.04.4 LTS Release:    16.04 Codename:   xenial   Ps.: Now I tried adding echo "(profanity)" >> file on ~/.bashrc, it runs when I open a terminal(and sorry in advance if you thought I was running ubuntu on a terminal in the first place). So... Why is it so hard to just have a script execute after I log in? No wonder I gave up on it 1 year ago x(

This is working for the current session:  costales@dev:~/Desktop$ xmodmap -e "keycode 166 = less" costales@dev:~/Desktop$ xmodmap -e "keycode 167 = greater"   Then I created this config file:  costales@dev:~/Desktop$ cat ~/.Xmodmap  keycode 166 = less keycode 167 = greater costales@dev:~/Desktop$    But it's not working after a reboot. How could I force the remap to survive reboot?


The feature to contact other users has been requested many times before. There is even a ! Valid reasons against such a feature include not wanting SO to morph into a social media site, complete with abuse and echo chambers. I agree with this!  This request is for the feature under tightly defined conditions, specifically when another user has performed a public action (such as leaving a comment) and time-limited (eg. 7 days since last public action). If abusive or non-constructive, recipient can flag for moderators. If moderators agree, user can be banned from messaging for X days or require additional reputation.  EDIT  To be clear, automated bump messages would be fine. Something of the form "User XYZ has edited question ABC that you [DELETE-AS-APPRORIATE] [voted to close] [put on hold] [gave an answer to] [commented on]. Ignore / visit question."  A lot of comments assert this feature is somehow intended as a back-door abuse mechanism. Nothing could have further from the truth! This was intended as an entirely positive contribution.  UPDATE  I've since been directed to  which more or less is exactly what this feature is about. Only comment is the feature request should  also cover "on hold" questions, and other public actions as well. If its automated, maybe even up/down votes as well.  Curious how this has -12 and that one +42 votes (at 2017-06-21T10:33, that is)!

As mentioned in , a question closed because it was not well-phrased is currently very unlikely to be reopened after an edit clarifying the issues. Those who voted to close should at least be asked to reconsider and reopen the question after such an edit.


Consider the following code:  \documentclass[oneside, 10pt]{book} \usepackage[     paperwidth=6in,     paperheight=9in,     tmargin=0.75in,     bmargin=0.75in,     lmargin=0.75in,     rmargin=0.75in ]{geometry} \usepackage{calc} \usepackage{tikz} \usepackage{etoolbox} \usepackage{transparent} \usepackage[explicit]{titlesec} \usepackage{tikzpagenodes} \usepackage[table]{xcolor} \usetikzlibrary{calc} \usetikzlibrary{fadings} \usetikzlibrary{shadows.blur} \usetikzlibrary{matrix} \pagestyle{empty}  \titleformat{\part}[display]{\normalfont\filcenter}{ \thispagestyle{empty} \tikz[remember picture, overlay] {     \matrix [column sep = 5mm] at (current page text area.center) {         \node[             inner sep = 0pt,             outer sep = 0pt,             font = \sffamily\fontsize{24}{24}\selectfont         ] {Part}; &         \node [             circle,             fill = black,             font = \sffamily\fontsize{24}{24}\bf\selectfont\color{white},             outer sep = 0pt,             minimum size = 1.5cm         ] {\thepart}; \\}; } }{6em}{ }[]  \begin{document}  \tikz[remember picture, overlay]{   \matrix [column sep=5mm] at (current page text area.center) {     \node[         inner sep = 0pt,         outer sep = 0pt,         font = \sffamily\fontsize{24}{24}\selectfont     ] {Part};  &     \node[         circle,         fill = black,         font = \sffamily\fontsize{24}{24}\bf\selectfont\color{white},         outer sep = 0pt,         minimum size = 1.5cm     ]  (numb) {I}; \\ }; }  \part{}  \end{document}   The result is the following:    Why is the first page different than the second, and how to make the titleformat work the same way as the normal tikz command? In other words, how to center "Part I" in the page on a single line as it is done on the first page? And why does it currently fail?

For  I wanted to define a shortcut for creating a matrix inside a tikzpicture. As a minimal example, consider  \newcommand\mymatrix[1]{     \begin{tikzpicture}         \matrix[matrix of math nodes] {#1};     \end{tikzpicture}% }   which would then be used as  \mymatrix{     a & b \\     e & f \\ }   But LaTeX complains about Package pgfbasematrix Error: Single ampersand used with wrong catcode at the line with the closing brace of \amatrix{}. Why does it do that and how can I avoid it?


What is the difference between discrete data and continuous data?


I'm trying to replace a string with empty space("") after a specific character(colon) ":"  example:2017 - Alpha Romeo United kingdom : New vehicle (by abc)  I want out put as "2017 - Alpha Romeo United kingdom"   it would be much appreciated if anyone can help me to write regex in smarty  Many Thanks

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


How do I vary the amount of a bump mapping effect on an object in cycles? I wanted to make a planet with a volcano using the both displacement method, but the effect displaced my volcano more than I wanted, as you can see.

The experimental feature set in Blender 2.75 includes an option to allow the displacement socket of the material output node actually displace the mesh instead of acting as bump-mapping.    However I can not figure out how to control the actual displacement amount.  Simply adding a math multiply node does absolutely nothing.    So how can I change the actual displacement amount?


I have a work written in English, and almost all refs are in English too.  I used "plain" as style, and, of course, by Murphys Law a few stinkers  needed capitalization in the title field since those were German or  proper name. Next I tried German (dinat plus natbib), with an epic fail  since et al. came as u.a. And of course everything is due next Monday.        What would you suggest?

Titles of articles I'm about to cite contain upper case letters and when using BibTeX it converts them to lower case ones. This happens only in the title and only the first letter conserves its case. For example, when I cite an article about HF, the reader won't know if it is about Hafnium (Hf) or fluorine acid (HF).  I know that I can fix it manually in the .bbl file but I would like to avoid it, or fix it automatically.


I've submitted several job applications, how can I see a list of all these applications? Does this functionality exists on Stack Overflow Careers? If not present this could be a nice and (I think) simple feature to implement.

I am not able to find on my Careers profile the positions I applied to in the past. Is there a way to see positions I have previously applied to?  I've sent in applications to around 8-10 positions in the last month or so and would like to be able to check or track which companies and/or positions I've already applied for.


I'd like to have the headers of my table on two lines. For example, I would like Reaction Buffer to be ABOVE (150mM sodium acetate), and etc. for each column, but I don't know how to do this.  Also, the table is far too wide for my document, does anyone know how to compress (shrink) the whole thing?  \footnotesize \begin{table}[h] \centering \small \footnotesize \tabcolsep=0.11cm \begin{tabular}{@{}ll@{}@{}ll@{}@{}ll@{}ll@{}} \toprule Tube & MilliQ Water $(\mu L)$ \, &  100 mM MgCl\_2 $(\mu L)$, & Reaction Buffer (150 mM sodium acetate) $(\mu L)$  \,  & 500 mM NaOH $(\mu L)$, & 4 mM pNPP $(\mu L)$\\  \midrule     1 & 60 & 15 & 30. (pH 4.0)& {} & 600. & 30. \\     2 & 60 & 15 & 30. (pH 5.0) & {} & 600. & 30.\\     3 & 60 & 15 & 30. (pH 6.0) & {} & 600. & 30.\\     4 & 60 & 15 & {} & 30. (pH 7.0) & 600. & 30. \\     5 & 60 & 15 & {} & 30. (pH 8.0) & 600. & 30. \\     6 & 60 & 15 & {} & 30. (pH 9.0) & 600. & 30. \\  \bottomrule \end{tabular} \end{table}  \end{homeworkProblem}

I have some text in a table and I want to add a forced line break. I want to insert a forced line break without having to specify the column width, i.e. something like the following: \begin{tabular}{|c|c|c|} \hline Foo bar & Foo <forced line break here> bar & Foo bar \\ \hline \end{tabular}  I know that \\ inserts a line break in most cases, but here it starts a new table row instead.  A similar question was asked before:


Given a string personName, I'm trying to create a boolean condition2 equal to the condition  the first or last letter in personName is 'A' (case-insensitive). e.g., 'aha' or 'A'   Here's what I've tried so far:  boolean condition2; if (personName.charAt(0) = "a" || personName.charAt(personName.length()-1) = "a") {     condition2 = true; } else {     condition2 = false; }

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


Basically doing a project for school work and it needs to have a login system and it can be as basic as i like so i am just storing the usernames/passwords in a text file. i have written code to read the file line by line and store each line in a variable, this all works but when i am testing to see if i can compare it to string even though they are the same it does not seem to think so, i have ran other tests to make sure my if/else statements are correct and have ran into no other issues, my current theory is that it has something to do with the fact that the usernames and passwords are stored with "\n" after to make them appear on different lines of the text file. public static void main(String[] args) throws IOException {          File file = new File("C:/Users/Will/Desktop/UnPs.txt");     Scanner scan = new Scanner(file);     while(scan.hasNextLine()) {                  String passCheck = scan.nextLine();              if(passCheck == "test2,Test2") {             System.out.println("Test1");         }         else if(passCheck != "test2,Test2") {             System.out.println(passCheck);             System.out.println("not found");                         }                }        }     the output of running the code is: test1,Test1 not found test2,Test2 not found test3,Test3 not found but in my head after it reaches the second line of the file it should have the value of passCheck as "test2,Test2". if you want to see how the usernames and passwords are written to the file just ask but as i said my theory is that the "\n" is related


Suppose that $-1<a<1$ and consider $$g(a)=\int_0^{π/2}\ln\left(\frac{1+a\cos x}{1-a\cos x}\right)\frac{\mathrm dx}{\cos x}.$$  How can I find the value of $g(a)$?   I believe the denominator, $\cos x$, may be problematic when it equals $0$.  How would I deal with it?

How can I evaluate the following integral?     $$ \int_0^{\pi/2} \log\left(\frac{1 + a\cos\left(x\right)}{1 - a\cos\left(x\right)}\right)\, \frac{1}{\cos\left(x\right)}\,{\rm d}x\,, \qquad\left\vert\,a\,\right\vert \le 1$$   I tried differentiating under the integral with respect to the parameter $a$, and I also tried expanding the log term in a Taylor series and then switching the order of integration and summation. I ran into difficulties with both approaches.


I know a good number of methods to solve this  integral like Feynman Trick, Laplace transform etc.  $$\int_0^{\infty} \dfrac{\sin x}{x} \mathrm{d}x = \dfrac{π}{2}  $$  Do y'all know some creative and not-so-common/(exotic?) methods to solve this? I have so much to learn :)

A famous exercise which one encounters while doing Complex Analysis (Residue theory) is to prove that the given integral: $$\int\limits_0^\infty \frac{\sin x} x \,\mathrm  dx = \frac \pi 2$$ Well, can anyone prove this without using Residue theory?  I actually thought of using the series representation of $\sin x$: $$\int\limits_0^\infty \frac{\sin x} x \, dx = \lim\limits_{n \to \infty} \int\limits_0^n \frac{1}{t} \left( t - \frac{t^3}{3!} + \frac{t^5}{5!} + \cdots \right) \,\mathrm  dt$$ but I don't see how $\pi$ comes here, since we need the answer to be equal to $\dfrac{\pi}{2}$.


I have an application that has sent me two of the exact same exception stacktraces from two different users using Galaxy S8+ on Android 7.0  The stacktrace in it's entirety makes no references to any specific part of my own code, so I really have no idea where it's coming from within the app.  Does anyone recognize this stacktrace and what could possibly be causing it?  edit: I know what a NPE is and I know how to fix it, but this stacktrace does not show me what part of the app is causing the NPE.  the stacktrace is sent to me via email when a user has a crash of any kind, 99% of the time the stacktrace contains a clear 'caused by' line that i can see where in the app caused the exception, but these stacktrace below do not.  Stacktrace: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:275)  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)  at android.view.View.layout(View.java:18874)  at android.view.ViewGroup.layout(ViewGroup.java:5954)  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)  at android.view.View.layout(View.java:18874)  at android.view.ViewGroup.layout(ViewGroup.java:5954)  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)  at android.view.View.layout(View.java:18874)  at android.view.ViewGroup.layout(ViewGroup.java:5954)  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)  at android.view.View.layout(View.java:18874)  at android.view.ViewGroup.layout(ViewGroup.java:5954)  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)  at com.android.internal.policy.DecorView.onLayout(DecorView.java:935)  at android.view.View.layout(View.java:18874)  at android.view.ViewGroup.layout(ViewGroup.java:5954)  at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2697)  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2413)  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1550)  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7189)  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:959)  at android.view.Choreographer.doCallbacks(Choreographer.java:734)  at android.view.Choreographer.doFrame(Choreographer.java:670)  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:945)  at android.os.Handler.handleCallback(Handler.java:751)  at android.os.Handler.dispatchMessage(Handler.java:95)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6776)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

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


When I increase the point light radius, it ends up creating artifacts on the textures for seemingly no reason.  Even though I I have High Quality Shadows (High bit-depth and cube map resolution).  I want to create a smooth texture just like the corner of the photo, but for some reason it ends up creating these squares with what looks like many "vertices".

I've been modeling a hermit crab and I don't know why but some areas of the mesh are really dark on some spots, like the legs and the claws.   I hope you can help me fix it.


Just migrated from Ubuntu-Gnome 16.10 to 17.04 to Ubuntu 17.10 (mistake by me, I know the step was not necessary).  Now I have clearly the new GNOME Desktop with its ubuntu-modifications, but It is everything running on X11, according to echo $XDG_SESSION_TYPE which displays x11.  How can I switch to wayland now? I have weston and wayland packages installed. I use the nouveau driver on my thinkpad, so no proprietary drivers.  Any hints welcome.

Some of my applications don't work on Ubuntu 17.10 Wayland. How can I switch back to Xorg?


I have two newly set up Minecraft 1.8.9 servers.  With both servers when I point my Pocket Edition clients to them I receive an "Unable to connect to world." message.  1) Debian 8 2) CentOS 7  [root@minecraft Downloads]# java -version openjdk version "1.8.0_65" OpenJDK Runtime Environment (build 1.8.0_65-b17) OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)   Both servers behaving the same way, I did a packet capture on each and can see UDP traffic reaches each them.  And both servers respond with ICMP Port Unreachable.  No surprise since the UDP port is not open I found.  Minecraft server is only opening the TCP port...  [root@minecraft Downloads]# netstat -anp |grep 25565 tcp       0      0 0.0.0.0:25565           :::*                    LISTEN      21202/java   I looked through Minecraft's server.properties documentation and see nothing pertaining to the protocol being configurable, only the port.

My kids are playing Minecraft on 2 PCs, creative mode.  They are connected by the way of one of them starts a single player game on the other one than joins that game over the LAN.  Can I, using Minecraft PE on my iPad, join their game as well?


I am in a bad situation with a professor. He shared my grades and my classmates grades with the class. He had our names and everything put up on a projector!!!!  He even scrolled through it slowly so we could find our name and see what we are getting in the class... It was like everything...I was horrified. Basically he took all of his classes and put them into one file and then put that on a overhead projector to show us our grades. I think he did this for each of his classes... All of our names, etc... are in there too... so we can see who got what for all of his classes.  there have been lots of problems... he is very forgetful and makes a lot of mistakes in grading. Students catch him all the time... and he fixes the stuff but we have to catch him. I don't want to go on about this, but mostly sharing our grades with the class...  I'm sorry if this is confusing. I'm very flustered!!! English is also not my best language.  I don't know what I am supposed to do. Is this okay? I felt very uncomfortable and upset when this happened. I thought my grades were private?  Thnx for help!!  edit  The proposed duplicate is a different situation with a favorable outcome. Additionally it was something he could stop. This has already happened and IDK what to do.

In the United States, federal law prohibits professors from releasing any student's grades to any party other than the student and any party whom the student authorizes to receive the grades.  One of my professors appears to be violating this law by uploading each student's lab grades in one file, which is accessible to anyone who is enrolled in the class.  Here is my proposed plan of action:   Ask the professor - in private - to post the grades using the online management system the professor already uses for other things.  If the professor doesn't fix this privacy violation, inform the professor that the method by which he/she post grades is a violation of federal law. As a last resort, contact the department dean.


In the sentence "baking is fun," what part of speech is "baking"?

An enlightening experiment   Google Books yields only , and instead asks me if I wanted to say “an enlightening experience”, and eagerly shows an impressive  when I click on their suggestion. But for my purposes, I want the noun experiment   A running experiment    suggests that running in 2.  must be an adjective     adjective           prevalent, as a condition or state:   running prices.   going or carried on continuously; sustained:   a running commentary.   extending or repeated continuously:   a running pattern.      We normally hear the plural form, running experiments, but the singular form is grammatical, and Google Books produces about .  Enlightening in "An enlightening experiment" is an adjective because I can use "very" to modify it:      A very enlightening experiment (YES)   but in sentence No.2, running cannot be modified by "very"      A very running experiment (NO)   It makes no sense, even though "running" appears to be an adjective. The comparative form,  “A more running experiment” is evidently wrong,  but with enlightening, the comparative is acceptable: “A more enlightening experiment”.   Does that mean running in sentence No.2 is a gerund?  How can I prove that running is a participial adjective or a gerund?     This question was inspired by this


I want to unbind CTRL+ALT+L from "screen lock". I removed original binding in "System settings -> keyboard -> shortcuts -> system -> lock screen" but it still locks my screen. I tried to look in dconf and gsettings (based on several search results here in Stack Exchange) but couldn't find relevant shortcut definitions. Are there other places to check?  Running Ubuntu 16.04 LTS.  Edit: This is a duplicate except that the best answer of the original question didn't solve my problem. This did:

I don't want Super + L (that is the windows key pressed with the L key) to lock my screen. I have disabled this in settings, but it still happens. How do I make this not happen?


Problem  I would like to automatically switch between width=\textwidth and scale=1 arguments depending on the actual width of the image I am trying to insert in order to prevent it from being stretched if it is smaller than the text width.  Edit / Solution  The following code is adapted from one of the proposed solution in this .  \documentclass[draft]{article} \usepackage{graphicx} \makeatletter \def\autoscale{   \ifdim\Gin@nat@width<\linewidth     \Gin@nat@width   \else     \linewidth   \fi } \makeatother \let\oldincludegraphics\includegraphics % Resize small figures \renewcommand\includegraphics[2][]{   \oldincludegraphics[width=\autoscale]{#2} } \begin{document} \begin{figure}   \centering   \includegraphics[]{img/test.png} \end{figure} \end{document}

Background  A large number of screen captures have been scaled 300% at 288dpi. They appear correctly when embedded in OpenOffice, but not LyX.  Problem  Images that do not extend beyond the margins (small images) appear perfectly. Images that are too big extend beyond the margins.  Attempt #1  \setkeys{Gin}{width=1.0\textwidth}    However, that code scales the smaller images to also fit the width, which is undesirable. (The smaller images become distorted.)  Attempt #2  Didn't attempt this, but it looks useful.  % Redefine includgraphics for avoiding images larger than the screen size % If the size is not specified. \let\py@Oldincludegraphics\includegraphics  \newbox\image@box% \newdimen\image@width% \renewcommand\includegraphics[2][\@empty]{%   \ifx#1\@empty%     \setbox\image@box=\hbox{\py@Oldincludegraphics{#2}}%     \image@width\wd\image@box%     \ifdim \image@width>\linewidth%       \setbox\image@box=\hbox{\py@Oldincludegraphics[width=\linewidth]{#2}}%       \box\image@box%     \else%       \py@Oldincludegraphics{#2}%     \fi%   \else%     \py@Oldincludegraphics[#1]{#2}%   \fi% }   Source:   Attempt #3  % Resize figures that are too wide for the page \let\oldincludegraphics\includegraphics \renewcommand\includegraphics[2][]{%   \makeatletter%   \def\maxwidth{\ifdim\Ginnatwidth>\linewidth\linewidth%   \else\Ginnatwidth\fi}%   \makeatother%   \oldincludegraphics[width=\maxwidth]{#2}%   Packages  Using graphicx.  Other package suggestions are welcome.  Question  Without adding LaTeX code to every image that exceeds the margins, what can be done to resize just those images that are too big?  Example  The following image is an example of many, many images that must be scaled back to fit the page width:    Related


Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to specify these attributes to be added to the HEAD when wp_enqueue_style() takes care of adding them. It doesn't seem like wp_enqueue_script() takes a parameter for extra attributes. Is there another way?

I couldn't add defer tag in plugin javascripts. Google developer pagespeed test suggests me to add defer tag in contact form 7 javascripts.   This is how contact form 7 includes javascript in header.  add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_scripts' );  function wpcf7_enqueue_scripts() {     // jquery.form.js originally bundled with WordPress is out of date and deprecated     // so we need to deregister it and re-register the latest one     wp_deregister_script( 'jquery-form' );     wp_register_script( 'jquery-form', wpcf7_plugin_url( 'jquery.form.js' ),         array( 'jquery' ), '2.52', true );      $in_footer = true;     if ( 'header' === WPCF7_LOAD_JS )         $in_footer = false;      wp_enqueue_script( 'contact-form-7', wpcf7_plugin_url( 'scripts.js' ),         array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer );      do_action( 'wpcf7_enqueue_scripts' ); }   Now how to add defer="defer" tag in the above code?


What's the word for someone who is ungrateful/ not appreciative of the things he has but wants more lavish things? For example, instead of appreciating the little things he has in his life, someone might go on and on, complaining about things like how the scratch on his brand new shoe ruined his day or who wants a new car while complaining about his old one.

I am looking for an adjective for a person who, no matter what you give him/her (materially or otherwise), is never content and always expects more.