I don't know if this question has already been resolved but considering that $i\hbar\partial_t$ is the energy operator, and $\partial^2_t$ is the waves operator (or helmholtz), I can't accept that $t$ itself isn't an operator  What is the argument here that says $t$ is not an operator?

In non-relativistic QM, on one hand we have the following relations:  $$\langle x | P | \psi \rangle ~=~ -i \hbar \frac{\partial}{\partial x} \psi(x),$$  $$\langle p | X | \psi \rangle ~=~ i \hbar \frac{\partial}{\partial p} \psi(p).$$  On the other hand, despite the similarities, the relations cannot be directly applied to energy and time:  $$\langle t | H | \psi \rangle ~=~ i \hbar \frac{\partial}{\partial t} \psi(t),$$  $$\langle E | T | \psi \rangle ~=~ -i \hbar \frac{\partial}{\partial E} \psi(E).$$  Just wondering, how can one mathematically prove that the "classical time" (which means no QFT or relativity involved), unlike its close relative "position", is not a Hermitian operator?  I ask your pardon if you feel the question clumsy or scattered. But to be honest, if I can clearly point out where the core issue of the problem is, I may have already answered it by myself :/


Hi I am having the following code. when i am using instance variables i am getting the output as follows(Default Values)  int value: 0 float value: 0.0 String value: null Static int value: 0   But if i try declare the local variable and print the default value it is giving an error that the variable should be initialized. Can any one explain me the reason please?  public class DefaultValues {   int a;   float b;   String c;   static int d;   public static void main(String[] args) {           int e;                                     // <----     DefaultValues dv = new DefaultValues();     System.out.println("int value: "+dv.a);     System.out.println("float value: "+dv.b);     System.out.println("String value: "+dv.c);     System.out.println("Static int value: "+d);     System.out.println("local int value: "+e); // <----   } }

Was there any reason why the designers of Java felt that local variables should not be given a default value? Seriously, if instance variables can be given a default value, then why can't we do the same for local variables?  And it also leads to problems as explained in :     Well this rule is most frustrating when trying to close a resource in a finally block. If I instantiate the resource inside a try, but try to close it within the finally, I get this error. If I move the instantiation outside the try, I get another error stating that a it must be within a try.      Very frustrating.


I want to utilize the below circuit to power a 12volt fan with the components listed. I'm concerned though because when I tried to do this with a resistor, the resistor got -very- hot. I understand why but if I utilize the transistor will it cause it to heat up? Does utilizing the transistor result in a more efficient use of power with less heat loss?   Thank you  Circuit diagram and tutorial from here:

I am in hold of an Arduino board and 12V DC motor.  I need to be able to control the motor speed gradually, my intention is to output a PWM current in range of between 0 and the maximum 5V of the board to the motor.  My question is what do I need to have in order to multiply the output from the range of 0 - 5V to 0 - 12V to fit the motor?


In implementing the comparable interface for a class, are we overriding the compareTo method?  If yes, who originally has defined the compareTo method that we are overriding it?  My guess is that we are not overriding in the sense that there was no other implementation before that we are overriding it but only add @override because we are implementing an interface. Anyway today I was asked about this specifically, and wasn't sure.

Should a method that implements an interface method be annotated with @Override?  The  says:      Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type but does not override a superclass method, compilers are required to generate an error message.   I don't think that an interface is technically a superclass. Or is it?


when I create a quote (using a button on opportunity object), I want to throw an error when Status Category = 'in effect' and there already exists a primary quote i.e   Primary Quote Is Checked. Status Category is a picklist field in Agreement Object and Primary Quote is a checkbox in Quote object.  I am doing it using a trigger(Cannot be done using a VR) I have attached an image which shows the relationship b/w quote, agreement and opportunity object. I have written the below code, but it is not working  trigger trigger1 on SBQQ__Quote__c (before insert){     Set<id> parentIds = new Set<id>();      for(SBQQ__Quote__c q: Trigger.new){          parentIds.add(q.SBQQ__Opportunity2__c);        }       system.debug('>>>>>>'+parentIds);     Map<Id,Apttus__APTS_Agreement__c> parentMap = new Map<Id,Apttus__APTS_Agreement__c>();      parentMap.putAll([select id,Apttus__Status_Category__c  from Apttus__APTS_Agreement__c where Apttus__Status_Category__c = 'In Effect' and  Apttus__Related_Opportunity__c in :parentIds ]);     system.debug('gargi parentMap'+parentMap);     for (SBQQ__Quote__c q : Trigger.new){     system.debug('>>>>>>>q'+q);          if((q.SBQQ__Primary__c==true) && parentMap.containsKey(q.SBQQ__Opportunity2__c)!= null) {          system.debug('gargi inside if');          system.debug('>>>>>>>>>>q.SBQQ__Opportunity2__c' +q.SBQQ__Opportunity2__c);            q.addError('Primary quote cannot be changed when quote/agreement has an active eSignature');          }      } }

I am populating a junction object on from Events and want to capture info from the Event but getting the Account from Account field pulls null. Same who the name via the Who. But if I query the Event record, the AccountId field is populated. And of course, the code compiles properly. Can someone explain how to grab this related info?  trigger TripMeetingFromMeeting on Event (after insert, after update) {      Set<id>EventId = new Set <ID>();     List <Trip_Meeting__c> TMS = new List <trip_meeting__c>();      for (Event E:trigger.new){         if (e.Business_Trip__c!=null){             TMS.add(new Trip_Meeting__c(Meeting__c =e.id, Business_trip__c=e.Business_Trip__c,                                         Meeting_Date__c=e.ActivityDate, Meeting_subject__c=e.Subject,                                        TripNameDELETE__c=e.Business_Trip__r.name,                                         mWhatID__c=e.Whatid,                                        Meeting_Company__c=e.Account.name,                                        Meeting_Name__c=e.Who.name)                                         );          }     }     system.debug('TMS!!!============================'+TMS);      Database.insert(tms, false);  }


I don't want to pay Apple any more to upgrade my iCloud storage, so I want to clean-up the photos that are stored with iCloud Photo Library. I cannot find any way to download and backup my photos easily so that I can delete them from my cloud storage.  From Apples website:     If you enabled iCloud Photo Library, your photos and videos are   automatically uploaded to iCloud at full resolution. To make copies of   these photos and videos:     In iOS 8 or later, select Download and Keep Originals, then import the photos to your computer.   In OS X Yosemite v10.10.3 or later, open the Photos app, then select Download and Keep Originals.  Use iCloud.com to download the most recent version of photos and videos to your computer.   So, obviously I've tried the last option, but if one selects multiple photos and then click Download, it downloads all the files at the same time with garbage file names and without file extensions! You have to manually rename every file and guess the extension (usually .jpg for photos and .mp4 or .mov for videos).  Is there a better way to get a copy of my photos? The first option won't work because I have 20 GB of photos and my iPhone doesn't have room. The second option won't work for me because I don't have a Mac.

I'am an iPhone + PC (Windows/Ubuntu) user. Nowadays, I'm used to download photos from iPhone to local folder, sort them and then backup them by myself (by syncing to remote disk and burning onto bluray discs also).  I like an idea of iCloud Photo Library + optimizing a storage on iPhone. For me, this also means that original photos are moved from iPhone storage into cloud, so I won't be able to download them via USB.  So, will it be possible (and easy and comfortable) to download all new photos (100+ at once) from iCloud Photo Library to local disk on PC? I mean a) download and keep on iCloud (copy), b) download and delete from iCloud (move)?


This is really just for fun. Why is this grammatically correct? "There are no books".  "No books" means a zero quantity of books which is singular per definition of plural (2 or more). So isn't it incorrect and we should instead use:  "There is no book."  As per the comment below saying that I invent the definition.  (Of a word or form) denoting more than one, or (in languages with dual number) more than two:   a word or form that expresses more than one   relating to a form of a word that refers to more than one person or thing

Which is correct?     There are no comments.  There is no comment.   Which would you use for a web application, i.e. what to display when a blog post or an article has no comment attached?    Actually, I am trying to fix an application that says: "There is no comments"! Would that ever be right?  More generally speaking, it feels wrong to have a plural after the negative no/none or with the preposition without (see my previous question ).  Those words imply zero, i.e. less than one, while plural is two or more. Yet, I know that phrases like "There are no comments" or "He is without friends" are common. It seems illogical to me.   Are the majority of people making a grammar mistake when using such expressions, or else can you explain why this is correct?


So I need to replace my inner tube as it got destroyed beyond any repair I can make (a hole right under the valve) but unfortunately I dont know what size the inner tube should be and I cannot figure out the different types of measurements of tubes. The metal part of the wheel has the markings 700x22 A/C, while the inner tube is too worn out to make out anything on it (Ive had it for like 2 years and I patched it 3 times :D )  The wheel is on the front and its a mountain bike, If that matters.

My tyre says 700x38 on the side of it. what size inner tube would I need for the wheel? I've ordered a 700x35 inner tube but it seems a little too big for it?


I have two files namely file1 and file2. I need to replace 16th line of file2 with 10th line of file1

Let M=3 and N=4. I want to replace line M in file1 with line N in file2. I can replace with a string using sed:  sed -i '3s/.*/stringToReplace/' file1   And I can use awk to get line N from file2  awk 'NR==4' "file2"   How can I combine these two? If I try  sed -i '3s/.*/{awk 'NR==4' "file2"}/' file1   then I replace line M with literally {awk 'NR==4' "file2"}.


I am a long time baseball fan and now I am learning about soccer/football. When I am watching soccer on TV and there is a soccer player that has the ball running away from a  defender. If the player is moving forward and is the only player. Sometimes the referee would raise a flag a offside. I don't understand how this works.

The offside rule on the pitch is often unclear and called suddenly. How do I know if a player is offside?


var a = 1; (function a(){     console.log('0:', b)     console.log('1:', a)     a = 100     var b = 2     console.log('2:', a)     console.log('3:', b) })(); console.log('4:', a)    How to understand the change process of 'a' in the function 'a'. Where is the value 100. For normal, pre-analysis and execution should like this: var any = 1 function any(){} pre-analysis process:  GLOBAL { any: undefined } GLOBAL { any: function any(){} }  execution process:  GLOBAL { any: 1 }  But you can't understand the 'a' above in this way. Could you please help me?

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


I have tried to log into Netflix today, I logged in without any problem and the 'watch instantly' page was displayed. When I click on a film I get transferred to a 'System compatibility' screen. I tried contacting their support and was told that they didn't support Linux. Can anybody help on this?

Is there a way to stream Netflix content to my Ubuntu machine?


I pre-apologize for any stupid questions here. I'm still very beginner in LaTeX and trying to learn how to use it efficiently.  I have certain commands and basic setup that I use for all the documents I write. It includes ams symbol, tikz-cd setting, font setting and many personal commands that I use (like \Q for rational number). However, I change them sometimes and I wish that change goes into all of my documents uniformly.  So here is what I think, if I write these setup in one document and modify it whenever necessary, can I bring this to other documents using something like \bring{mysetup}? Or do you just copy & paste your format all the time whenever you write a new one?  Thanks in advance.

I tend to use the \mathbb{...} command a lot, so I have made some commands to ease the amount of typing I have to do when I use LaTeX:  \newcommand{\R}{\ensuremath{\mathbb{R}}} \newcommand{\C}{\ensuremath{\mathbb{C}}} \newcommand{\Z}{\ensuremath{\mathbb{Z}}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\N}{\mathbb{N}} \newcommand{\F}{\mathbb{F}} \newcommand{\W}{\mathbb{W}}   Up until this point, I have been simply copying and pasting these lines each time I begin working with a new file. What is the recommended way of importing these lines from say, a custom-made package? Is this generally recommended (i.e. making shortcuts like this)?  I'm currently using TexLive on Mac OS X.


So the idea behind this is quite simple, and I have also not seen any similar solution suggested in meta(after a quick search). Succinctly, I have seen both on my answers and questions(as has anyone) that even on topics for which I consider myself an expert and follow guidelines in producing an objectively correct answer(where applicable), there still can be random downvoting with no explanation.  Clearly, reputation is a SE heuristic for expertise or competency in some area of understanding. So in my mind, a simple fix to many downvote issues would be to just force comments if user meets some lower rep bound.  Thoughts? Potential downfalls? Look forward to seeing what the rest of the users think.  Edit: Obviously different than a universal requirement.

Note: If you're looking for a simple explanation as to why comments aren't required on downvotes, see .   I used to get "upset" (though that is too strong a term) when I got downvoted without comment. If my answer isn't good enough then I'd like to know why. Not only does it improve the answer for the OP but it improves my knowledge too.  Where the down-vote has been explained I've found it useful & it has improved my answer, or forced me to delete the answer if it was totally wrong.  So is there any way we can encourage people to leave a comment? Perhaps they don't lose rep if they explain their down-vote?  I must admit though that I haven't always explained my down-vote either so you could call me a hypocrite. I've also grown a thicker skin over the months of using SO (it seems to have come with the higher rep score ;-)), so I'm less bothered about this now.


(I thought  was going to be along these lines on first read of the title, but this question is different.)  Is there any on-record statement about whether the first six Star Wars movies will be affected by the new films? Might there be some retconning, insertions, new effects etc. added to the original six (and especially the original three) films to tie into or make the new films work?

I have read  a couple of times.     In order to give maximum creative freedom to the filmmakers and also preserve an element of surprise and discovery for the audience, Star Wars Episodes VII-IX will not tell the same story told in the post-Return of the Jedi Expanded Universe.   Does this describe material set after Jedi, or published after?  Is it also saying that only things published as "Legends" are now non-continuity?  I have read that it is only films + Clone Wars + Rebels that are now in the main continuity but can't see this sourced by Lucas Film Story Group. Does anyone have a reference for this?


I am trying to register my account on careers.stackexchange.com, but when I fill in all fields on the "Fill out your profile" and I click "Get Started", it fails with no error message (it stays on the same screen). Tried with IE and Chrome: same thing.   Is it a test I have to pass to get hired? ;)

I'm stuck on this page even after linking stackoverflow and github accounts.


I was wondering if there is an easy way to indent the code in Stack Overflow. Whenever I paste in code, all the code loses its indentation; what I have been doing is manually indenting every line with the space button. Is there a quicker way to do all of this?

How do I post text so that it is formatted as code?  What do I need to do so that my code shows up properly — not escaped or removed — when posted? And how to get the correct syntax highlighting?     For more information, see "" in the .


Currently, like in Stack Overflow when an answer in meta gets a lot of downvotes it gets greyed out. This makes answers harder to read.     While the motivation for this is clear in Stack Overflow I'm not sure what purpose of it in Meta is, since upvotes and downvotes do no represent effort and usefulness but agreement or disagreement with the opinion stated.  Why is this visual cue in place in meta. Is it useful? and should we drop it?  (I'm providing my own opinion but obviously - this being meta and all - I'm very interested in ideas)

Since  from other SE sites and is not thought to point out a lack of quality or helpfulness, but only to express agreement or disagreement, I'm wondering why downvoted answers here on meta are shown semi-transparent.  Shouldn't they be non-transparent then (like upvoted answers)?  Or am I missing something?


Solving $9x \equiv 21 \bmod 30$  My approach: Finding $gcd(9,30)$: \begin{align} 30 &= 9 \cdot 3 + 3 \\ 9 &= 3 \cdot 3 + 0  \end{align} So $gcd(9,30)=3$ and since $3 \mid 21$ so the congruence has $3$ incongruent solutions. Express $3$ as a linear combination of $9$ and $30$, we get: $$3 = 30-9 \cdot 3 \ \ \ \ \ \ (1)$$ We have to solve this equation to find $x_0$: $$9x-30y=21 \ \ \ \ \ \ (2)$$ Multiplying $(1)$ by $7$ we get: $$21=30 \cdot7-9 \cdot 21$$ Rewritten in form of $(2)$: $$-9 \cdot (21) + 30 \cdot (7) = 21 $$ So $x_0=21$, the incongruent solutions are: $$21 + 10n, \ \ \ \ \ n = 0,1,2$$ Then $x=21,31,41$. But my answer is wrong, the answer is: $x=9,19,29$. Can you tell me which step is wrong. Thanks for your help!

I know how to compute modular multiplicative inverses for co-prime variables $a$ and $b$, but is there an efficient method for computing variable $x$ where $x < b$ and $a$ and $b$ are not co-prime, given variables $a$, $b$ and $c$, as described by the equation below?   $ a x \equiv c \mod b $   For example, given  $ 154x \equiv 14 \mod 182 $, is there an efficient method for computing all the possibilities of $x$, without pure bruteforce?  Please note that I'm not necessarily asking for a direct solution, just a more optimized one.    I do not believe that the Extended Euclidean Algorithm will work here, because $a$ and $b$ are not co-prime.   Edit:  Follow up question, since the first one had a shortcut:  Could the be computed efficiently as well?  $12260x \equiv 24560 \mod 24755$.  $107$ needs to be one of the computed answers.


I'm am very much a rookie when it comes to coding. What I'm trying to accomplish is to load grades from a txt file and put them into an existing array.   I have actually solved this. and In the program the array does retain the values. But when I got to print them I get the object reference aka [I@5c647e05 rather than the array. Below is my code.     public static void main(String[] args)    {         int[] list = new int[15];         Scanner in = null; // create a scanner object         loadGrades(in, list);          System.out.println(list);     }      public static void loadGrades(Scanner in, int[] list) {          int grades; // int variable         try { // try                         in = new Scanner(new FileReader("Proj5Data.txt"));// change filename         } catch (FileNotFoundException ex) { // catch             System.out.println("File not found");             System.exit(1);         }         for (int i = 0; i < list.length; i++) {                          grades = in.nextInt(); // var                 list[i] = grades ;// put the int in the array at the counter value                     }         in.close();      }   Print results as:  [I@5c647e05 BUILD SUCCESSFUL (total time: 0 seconds)

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I first remember hearing hate for presta valve caps in the video where Lance Armstrong changes a bike tire.  He says:     See that little black thing?  Don't put that back on when you're done... ever.   I thought it was just a joke, until someone commented on a thread of mine (on a bike forum) and said that the valve caps are super lame.    Personally, I always leave my valve caps on because it keeps dirt off of the valve, and in turn out of my pumps.  Now, when I made that argument on the forum the other member commented saying     I totally get the keeping dirt out. Coolness [of taking them off] far outweighs the logic of those little bastards. They have gone the way of wheel reflectors and dork discs.   Any bling will be negated by presta valve caps installed.   Can someone please describe to me why there is so much hatred for these little things?  I get that they kind of resemble a guy's genitalia, but I feel like it's not really that big of a deal.

I can see the use of the valve cap on a Presta valve when the tube is still packaged (it obviously stops the valve puncturing the tube), but does it do anything except look pretty (or not) once you've fitted the tube to a rim?  I've kept them on out of habit, because I've had problems with sticking Schrader valves in the past when I've lost the caps and dirt/grime has got in there - but the design of Presta valves suggests to me that they wouldn't suffer this fate.  Given that I really need to , is replacing this cap something I can leave out of my daily chores?


Let $(a_n)$ be a sequence s.t $$a_{1} > 0 \land a_{n+1}=a_{n}+\frac{1}{a_{n}}$$  Prove that $a_{n}$ is unbounded.  Proof:  Consider $a_{n+1}−a_{n}$:  $a_{n+1} - a_{n} = a_{n} + \frac{1}{a_{n}} - a_{n} = \frac{1}{a_{n}}$.  This is greater than $0$. Thus, $a_{n}$ is increasing.  It was proved that $a_{n}$ is increasing. Assume that it is bounded. Then it would follow that $a_{n}$ is convergent to a real number $L>0$. But taking $n\to\infty$ into the recurrence relation gives $$L+\frac{1}{L} =L$$ which is a contradiction. Therefore $a_{n}$ is unbounded  I found this on the site but I don't get why it is unbounded. Could someone plz explain?

Does the recursive sequence $a_1 = 1, a_n = a_{n-1}+\frac{1}{a_{n-1}}$ converge?  Since the function $x+1/x$ is strictly monotonic increasing for all $x>1$, I don't think that the limit converges, but I'm not sure. Can anybody tell me whether the sequence is converging or not?


I am currently running Ubuntu 20.04 after updating from Ubuntu 19.10. After updating and restarting the computer, the screen is blank but I am still able to select the options from the menu so I know it is there. I have tried reinstalling grub2 and changing the grub theme but the problem still persists. Any other possible solution that would make the grub menu visible again?

after upgrading to 19.04 the Grub menu have become hidden. It still works and I can boot to both Windows 10 and Ubuntu by blindly finding the entry and pressing enter. I have tried to edit the /etc/default/grub and running sudo update-grub afterward but no change. Here is how it looks now:  # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: #   info -f grub -n 'Simple configuration'  GRUB_DEFAULT=0 GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" GRUB_TIMEOUT_STYLE=menu GRUB_HIDDEN_TIMEOUT_QUIET=false  # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"  # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console  # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480  # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true  # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true"  # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1"   I can't use either Shift or Esc to make it visible too. After pressing either of these, Grub doesn't work anymore and I need to turn my laptop off and on in order to boot.  Edit: Not sure if it helps or not, but I just realized that if I go to the BIOS when I exit BIOS the grub menu shows up with no problem. The next time I boot, the grub menu is invisible again.


File file = new File((new StringBuilder()).append(s2).append(File.separator).append(s1).toString());  file.renameTo(new File((new StringBuilder()).append(s2).append(File.separator).append("$$tsjoof$$.ppt").toString()));  SocketOpenOfficeConnection socketopenofficeconnection = new SocketOpenOfficeConnection();   I am importing .ppt file but it is giving an exception on SocketOpenOfficeConnection as:  Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/poi/POIDocument Caused by: java.lang.ClassNotFoundException: org.apache.poi.POIDocument  Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory   I have also imported poi-2.5.1.jar,poi-scratchpad-3.1-FINAL.jar,ridl-2.4.1.jar,xbean-1.0.3.jar please give me some solution for that.

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


I didn't understand the rules of multiplying  permutations. I'll be glad if you can explain me...  For example: we have $f=(135)(27),g=(1254)(68)$. How do I calculate $f\cdot g$??  Thank you!

I didn't find any good explanation how to perform multiplication on permutation group written in cyclic notation. For example, if $$   a=(1\,3\,5\,2),\quad b=(2\,5\,6),\quad c=(1\,6\,3\,4), $$  then why does $ab=(1\,3\,5\,6)$ and $ac=(1\,6\,5\,2)(3\,4)$?


I don't know what this error means:  Exception in thread "main" java.lang.NullPointerException     at Untitled.main(Untitled.java:16)  class Untitled {  public static void main(String[] args) {      int x=3;      int y=5;      double d=0;      int[][] route = new int[][]{       { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },       { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 },       { 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },       { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 },       { 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }     };      int[][] distance = new int[10][];      for (int i=0;i<route.length;i++) {         for (int j=0;j<route[0].length;j++) {             distance[i][j]=route[i][j]-x;         }      }   } }

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?


A colleague of mine asked this question:   The answers are all pretty definitive in that you cannot work out the size of an array that is referenced by a pointer.  My initial thought was to first dereference the pointer and then calculate the size of the array itself. Why would this not work? Does dereferencing the pointer not give you the full array?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


I'm having a problem with writing a text file using Java swing. Below is my code, if I try to open the file the text isn't formatted like its supposed to, going into a new line after each input text. I've tried using /n, System.lineSeparator() and %n, but nothing seems to work. Unless I copy the content into another file it looks wrong. Instead of going into a new line it gives me this:  Name: Bob Test Number: 12345678 Email: BobTest@email.com  Address:  Teststreet 123 TestCity Testcountry  Gender: Male Occupation: Student Salary: 500 Manager: Yes  try {                         Object fileName = textField.getText();                         File user = new File("C:\\Users\\Nicol\\Desktop\\"+fileName+".txt");                         if(!user.exists()) {                             user.createNewFile();                         }              PrintWriter pw = new PrintWriter(user);             pw.print("Name: ");             textField.write(pw);             pw.print("\nNumber: ");             textField_1.write(pw);             pw.print("\nEmail: ");             textField_3.write(pw);             pw.print("\n\nAddress: \n");             textArea.write(pw);             if(rdbtnMale.isSelected()) {                 pw.print("\n\nGender: Male");             }else if(rdbtnFemale.isSelected()) {                 pw.print("\n\nGender: Female");             }else {                 pw.print("\n\nGender: none selected");             }             Object professionSelect = comboBox.getSelectedItem();                pw.print("\nOccupation: " + professionSelect);              pw.print("\nSalary: ");             textField_4.write(pw);             if(chckbxIsManager.isSelected()) {             pw.print("\nManager: Yes");             }             else {                 pw.print("\nManager: No");             }             JOptionPane.showMessageDialog(null, "The file has been created on the desktop.");             pw.close();                      }

How do I get a platform-dependent newline in Java? I can’t use "\n" everywhere.


someone explain what does the keyword strictfp mean in the class below?  public strictfp class Demo {         public static void main(String[] args) {                 double d = 8e+307;                 /** affiche 4 * d /2 donc 2 * d */                 System.out.println(4 * d / 2);                 /** affiche 2 * d */                 System.out.println(2 * d);         }  }

I've looked up what this does, but does anyone actually have an example of when you would use the strictfp keyword in Java? Has anyone actually found a use for this?  Would there be any side-effects of just putting it on all my floating point operations?


I am writing a cross platform program. I want this one program to run under both Windows and Linux, so I have two different code segments for the two platforms. If the OS is Windows, I want the first code segment to run; if it's Linux, then I want the second code segment to run.  So I wrote the following code, but it gets an error while building both on Windows and on Linux. What should I do to solve it?  #ifdef __unix__                    /* __unix__ is usually defined by compilers targeting Unix systems */      #define OS_Windows 0     #include <unistd.h>     #include <stdlib.h>     #include <stdio.h>     #include <string.h>  #elif defined(_WIN32) || defined(WIN32)     /* _Win32 is usually defined by compilers targeting 32 or   64 bit Windows systems */      #define OS_Windows 1     #include <windows.h>     #include <stdio.h>     #include <tchar.h>     #define DIV 1048576     #define WIDTH 7  #endif  int main(int argc, char *argv[]) {     if(OS_Windows)     {         MEMORYSTATUSEX statex;         statex.dwLength = sizeof (statex);         GlobalMemoryStatusEx (&statex);          _tprintf (TEXT("There is  %*ld %% of memory in use.\n"),                     WIDTH, statex.dwMemoryLoad);      }      else if(!OS_Windows) // if OS is unix      {         char cmd[30];         int flag = 0;         FILE *fp;         char line[130];         int memTotal, memFree, memUsed;          flag=0;         memcpy (cmd,"\0",30);         sprintf(cmd,"free -t -m|grep Total");         fp = popen(cmd, "r");         while ( fgets( line, sizeof line, fp))         {             flag++;             sscanf(line,"%*s %d %d %d",&TotalMem, &TotalUsed, &TotalFree);         }         pclose(fp);          if(flag)             printf("TotalMem:%d -- TotalUsed:%d -- TotalFree:%d\n",TotalMem,TotalUsed,TotalFree);         else             printf("not found\n");      }      return 0; }

I need my code to do different things based on the operating system on which it gets compiled. I'm looking for something like this:  #ifdef OSisWindows // do Windows-specific stuff #else // do Unix-specific stuff #endif   Is there a way to do this? Is there a better way to do the same thing?


This is a cheap Chinese landvo l200 Android mtk65xx mobile The onlything it keeps Changing is IS0 from 150 to 800 + And exposure time I wondered how can it autofocus and touch Focus when it keeps focal length constant @ 3.5mm. Is that the case with all phones ? Or maybe some high end ones like xperia And HTC have something more in the camera lens

By definition, a  is a fixed lens system with a fixed focal length.  Then, simple physics tells us that it should be able to focus only on one plane (at a fixed distance) in front of it. But in fact you can focus on objects near as well as far.  What am I missing here?


"to find a moment shrouded in a naked silence"  Is it okay to write 'a' naked silence in place of naked silence?

"Mornings came and cast a blinding sunlight over everything, and he felt like nothing worthwhile could be accomplished."  For some reason, I feel like "a blinding light" is ok, but if its sunlight, then I should drop the "a" and write "cast blinding sunlight", but I'm not sure why I feel this way.   Can anyone offer some enlightenment?  edit - alternate phrasing, closer to being a literal translation: "Mornings came without warning, flooding the day with a strong sun, and he felt like nothing worthwhile could be accomplished."   I would still like an answer to the technical question of whether I should drop the "a", but would also appreciate knowing if anyone thinks option #2 is a better choice.


I wonder if you could help me.  I'm using a theme which has portfolio as a custom post type. The portfolio items can be categorised in a similar way to standard posts.  Currently, theme outputs portfolio URLs in the following format:  mysite.com/portfolio/portfolio-post   ...where portfolio-name is simply the post title. the middle section of the URL remains static.  What I would like to achieve is something like this:  mysite.com/portfolio-category/portfolio-post   ...where the portfolio-category proportion of the URL is taken from the portfolio category.  Each portfolio post will only be assigned to a single portfolio category at any one time.  I can send code examples across if this makes it easier for you to understand what i'm trying to achieve.

I'm trying to rewrite my url for a custom_post_type named wr_events with one of its custom_taxonomy terms from event_type  add_action('init', 'wr_events');  function wr_events() {       register_taxonomy(         'event_type',         'wr_event',         array(             'label' => 'Types',             'singular_label' => 'Typ',             'hierarchical' => true,             'query_var' => true,             'rewrite' => array('slug' => 'events'),         )     );      $labels = array(         'name' => _x('Events', 'post type general name'),         'singular_name' => _x('Event', 'post type singular name')     );      $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'query_var' => true,         'capability_type' => 'post',         'hierarchical' => false,         'menu_position' => null,         'supports' => array('title','editor','thumbnail', 'excerpt'),         'rewrite' => array(             //'slug' => 'event',             'slug' => 'events/%event%',             'with_front' => false         ),         'has_archive' => 'events'     );       register_post_type( 'wr_event' , $args );     flush_rewrite_rules(); }  add_action('save_post', 'save_details');  add_filter('post_type_link', 'events_permalink_structure', 10, 4); function events_permalink_structure($post_link, $post, $leavename, $sample) {     if ( false !== strpos( $post_link, '%event%' ) ) {         $event_type_term = get_the_terms( $post->ID, 'event_type' );         $post_link = str_replace( '%event%', array_pop( $event_type_term )->slug, $post_link );     }     return $post_link; }   So in my case my taxonomy terms would be "workshops" or "lectures" etc. url/events/lectures or url/events/workshops lists all my posts related to this "category", url/events shows a custom archive for all my events. -> this is just what I want however the only thing not working is the complete url to the custom-post itself …  url/events/lectures/post-name - throws a 404!  Any idea why this is happening? My events_permalink_structure() function seems to work correctly as it replaces my permalinks exaclty the way I want.   I installed the "Rewrite Analyzer" Plugin and it  "Regex is empty" for wr_event.  I've also tried to flush the Rewrite Rules by visiting the permalink settings. However no effect.


sharepoint workflow (created using SharePoint designer and the workflow is in 2010)  at the movement sent emails using default email address of the sharepoint in our case it is companyname@mydomain.com can you change this?

For SharePoint 2007 there was a third-party addon we could install to allow the from email address to be configured in a SharePoint Designer workflow.  Does anyone know if there is something similar for SharePoint Designer 2010 workflows?  I have not been able to find one.  Thanks.


I need to downgrade my PHP from 5.6 to 5.5  Here is what I've done so far  sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`   Then   sudo apt-get install python-software-properties sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update sudo apt-get install -y php5   Then I tried  sudo apt-get install php5   and  sudo apt-get install php5=5.5.26+dfsg-1+deb.sury.org~vivid+1   This is what I get when I run apt-cache policy php5  php5:   Installé : (aucun)   Candidat : 5.6.4+dfsg-4ubuntu6.2  Table de version :      5.6.4+dfsg-4ubuntu6.2 0         500 http://fr.archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages         500 http://security.ubuntu.com/ubuntu/ vivid-security/main amd64 Packages      5.6.4+dfsg-4ubuntu6 0         500 http://fr.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages      5.5.26+dfsg-1+deb.sury.org~vivid+1 0         500 http://ppa.launchpad.net/ondrej/php5/ubuntu/ vivid/main amd64 Packages   No matter what I do, PHP 5.6 is installed. I even tried with Synaptic, without success.  Any idea ?

I am trying to update to install PHP 5.5, 5.6 or 7.0 in Ubuntu 12.04/14.04/16.04 LTS, and I can only get PHP 5.3.10 for Ubuntu 12.04, PHP 5.5.9 for Ubuntu 14.04 or PHP 7.0.4 for Ubuntu 16.04 using official repositories (using apt-get).  I'm not really sure how to do a manual update – as I need:   to play around with the new(est) PHP features to install older PHP version due support in the software


It has been near three months now since the tipping point of the community. Many of us are still very not happy with SE.  The situation with Monica is at an impasse SE has told us:       "We aren't going to re-litigate the past." -         "We’ll be reaching out to her directly to apologize for the lack of process, privacy, and to discuss next steps." - .    Monica's  was over a month ago... in that post she says:     "I posted it here because I have exhausted all known private communication channels available to me short of legal proceedings. I would have preferred a private conversation, which I have asked for repeatedly. I remain open to that option." -         "we are not able to respond to anything regarding Monica's situation. We will not be answering any questions or comments about that going forward." -    There was a GoFundMe page set up by Monica for the impending legal battle and .  Other actions SE has taken include making a .     "Moving forward, we will release an official process around removing moderators." -    Which they did in the .    They completely rewrote the      "Going forward, we will be working with the community to overhaul how we gather input and feedback from our moderators and members of the community to make sure that your voices are heard and involved in the process, not just informed after decisions have been made." -    In the spirit of better communication SE started a new blog series  explaining how they make decisions and gather user input.  In short SE's actions have been spurned this year, here is a screen shot of the lowest voted question on meta as of this writing.   Don't forget about another  that would be in second on that list.  Meanwhile scores of ; hundreds of users have indicated support for Monica ; many letters to SE have been written; users have started to build  . The community is not happy  So the question is what do we (as the unhappy community) do now? What are our next steps? We don't want to just sit here and hope everything gets better, or do we? Is it better to wait (who knows how long) for some legal decision between Monica and SE? Or do we finally say enough is enough and walk away?  SE has been rather clear about their next steps and actions, what are our next steps and can we take them?    Sorry for the original title, it was never my intention to mislead anyone or impersonate the staff (not that I'd want to), it was simply a play on two famous titles from this saga.  I did not mean to simply rehash old hurt and bring all those feeling back again. My purpose in asking this is because it is a question I'm asking myself. A while after the mods of BSE went on strike, we had a talk in our mod room about when will it end, what do we do now etc. I still do not have a good answer. I know it is silly to think SE will "reinstate Monica" now (why I outlined the history above) so us users who took a stand against SE's firing of Monica - I have to figure out what are my next steps.

I suppose you all have read  unpopular answer. People have responded critically and sarcastically towards SE's declaration that they "will not be answering any questions or comments about that going forward". Assume SE will hold firmly onto their declaration, all current situations (License change, fired mods, CoC mess) will remain permanently under the status quo, and the community's voice will be constantly ignored, possibly with radical ones removed. It's like we're no longer able to change, or even affect whatever SE's heads have decided or are going to decide.  A harsh comparison for SE is against Hong Kong, where so far only 1 out of 5 demands has been fulfilled and the remaining ones seemingly unreachable. While HK citizens can subvert the government, we most likely won't since SE is a commercial company after all. I've seen attempts to replicate the functionality on a new website (I assert I saw that in a user profile but can't find it now), but I'm not positive towards its future of building another community. What are our next steps at the current situation?  If I must say - I would unwillingly say that we proceed as usual - but I guess many won't accept this "solution".


I understand I can say No one saw it coming but wonder if it is okay to say "None saw it coming."?    Also, is the punctuation correct in the end of the last statement?

In my grammar book (English Grammar, HarperCollins Publishers), I read that none is occasionally treated as plural, but it is usually regarded as singular. Can you give me an example of sentence where none is used as plural pronoun?


Started to use addEventListener some weeks ago. It is one case i cant understand so far. We are talking about cases where we printing taggs with templet literals and declaring the class inside thos taggs. After that if we going to use thise classes for other EventListener, somethimes we need to have other EventListener inside the first one(the one who is printing/declaring classes) other times we dont have to have another eventListener inside the first one. Why? Somebody have good explanation or can point me in right direction? I am giving exemples under. Thank you in advance //two different Event Listener were the first one making class and second one using that class  const drink = document.querySelector(".drink"); let drinkTxt = ""; MenyModule.getDrink().forEach(drink =>{   drinkTxt +=`   <div class="boks">     <h4>${drink.name}</h4>     <p class="des">${drink.des}</p>     <p class="price">kr ${drink.price}</p>     <a class="button-buy">BUY</a>   </div>   ` }); drink.innerHTML = drinkTxt;   document.querySelectorAll(".boks").forEach(boks =>{   boks.addEventListener("click", (e)=>{       alert();     })   });   //Second exemple where i need to have other EventListener inside the first one or alert() will not be executed  document.querySelectorAll(".button-buy").forEach(button =>{   button.addEventListener("click", ()=>{         valgteRetterTxt+=`<a class="remove1">REMOVE</a>`       valgteRetter.innerHTML=valgteRetterTxt;          document.querySelectorAll(".remove1").forEach(remove=>{           remove.addEventListener("click", ()=>{             alert();           });         });      });   });

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I have a problem where I want to have two Objects of the same Class. However, all of their variables are in synch somehow and I don't know how to fix this... For example: this is the Class of the objects public class Cat  {     public static int age;     public static String breed;     public static String Name;     public static String fur;          private Cat (String name)     {         age = 5;         breed = "Birman";         fur = "soft";         Name = name;     } }  and this is where I want to create Objects of this Class: public class test  {     static Cat Whisky;     static Cat Ghismo;          public static void main(String[] args)      {         Whisky.age = 10;         Ghismo.breed = "Maine Coon";                  System.out.println(Whisky.age + " " + Whisky.breed);         System.out.println(Ghismo.age + " " + Ghismo.breed);              } }  For some reason the output is this: 10 Maincoon 10 Maincoon  Why does it always give me the same values in the output and how can I fix this?

To be specific, I was trying this code:  package hello;  public class Hello {      Clock clock = new Clock();      public static void main(String args[]) {         clock.sayTime();     } }   But it gave the error      Cannot access non-static field in static method main   So I changed the declaration of clock to this:  static Clock clock = new Clock();   And it worked. What does it mean to put that keyword before the declaration? What exactly will it do and/or restrict in terms of what can be done to that object?


I recently asked a question at Astronomy.SE related to matter-gravitational waves interactions:  From related question   There is also the fact that matter is transparent to gravitational waves of any frequency.  As the question does not seem to provide any references to this, this raises a few questions: What is the reason for this? Is there any specific research paper or theory that describes why this is?

I understand that gravitational waves pass quite freely through massive bodies.  Quoting :   Gravitational waves will change astronomy because the universe is nearly transparent to them: intervening matter and gravitational fields neither absorb nor reflect the gravitational waves to any significant degree.   Now, there must be some interaction between the Earth and gravitational waves, otherwise we wouldn't be able to detect them. I'd like to understand the magnitude of this interaction. If you had two infinitely sensitive detectors on different sides of the Earth, how much weaker would a gravitational wave be after it passed through Earth?


These were a series of novels that I read as a kid in the 80s or early 90s. Humanity was ruled by AI/robot overlords and the plot revolved around a group of humans trying to get two keys to a certain control room at the same time so that they could shut down the robots.  One other character was a being of unknown origin who could steal the form and maybe the memories of its victims. They would fuse their body with their victim and later emerge with their new form. They did not know their true purpose, at least in the earlier books.  I think that I read 2 or 3 books but I lost track and never found out how it ended.

I recall that it might have been the second book of a series. It takes place in the future - not sure if in our universe - and there are robots who kill for the government (I think).  Story of a group of escapees from a prison that go to a massive ship and start a community.  The prisoners have tattooed faces.   I remember more the characters:   A lady that absorbs people and becomes them. A young girl who is a genius but has to be pregnant to be balanced. Two people from the prison they kidnapped and took with them.   Also I remember they terraformed the inside of their ship.


I want to improve my Python and I'm curious if there's an elegant way to increment the index of arr in the loop without using integer x in this code:  def predict_one_instance(xSeriesTestVector, xTrainInstances, yTrainCategories, distanceMetric, k):      distances = calc_distances(xSeriesTestVector, xTrainInstances,distanceMetric)     sorted_distances = np.sort(distances)     arr = np.zeros((k,), dtype=int)     x = 0        for el in sorted_distances[:k]:         arr[x] = yTrainCategories.iloc[np.where(distances == el)]         x+=1     return np.bincount(arr).argmax()

How do I access the index in a for loop like the following?  ints = [8, 23, 45, 12, 78] for i in ints:     print('item #{} = {}'.format(???, i))   I want to get this output:  item #1 = 8 item #2 = 23 item #3 = 45 item #4 = 12 item #5 = 78   When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case?


I'm leaving the country for work for roughly a year, and would like to sublease my home to a friend of mine living in the area. I have no experience as a landlord, and I've had a tough time figuring out if an appropriate monthly rent can be estimated as some percentage of the monthly mortgage payment.  For ease of computation, let's say my mortgage is $1000/month on a 25 year mortgage. Are there any rules of thumb for what would be an appropriate estimate for monthly rent based on this information?

We're considering moving at some point in the future, and right now we have a mortgage on our home. So far we've been here about 3 years, and we're considering renting out our home.  Obviously there will be costs associated with renting the home out: taxable income, maintenance on the property, etc., so if we rent it out we don't want to just charge what we're paying on our mortgage - we'd definitely be losing money if we did that.  Given the assorted costs associated with maintaining a home/rental property, what is the minimum amount of rent that would be reasonable to charge above the cost of the mortgage? Is there some rule of thumb to use? For example, say your mortgage/tax/insurance payment is $1,000 so add 50% and you'll need $1,500 in rent to pay taxes on your rental income, put money away for eventual repairs, etc.?


I'm sure it was a book, but it could have been a film, or even a video-game plot element. Apologize if I've mixed up any facts – I don't think I've come across this again in the last 20 years!  I read this "book" a long time ago, and a small part of the story refers to the Earth being visited by aliens, who (IIRC) told us that they were disappointed in how we had progressed as a species, and gave humanity the chance to repair their culture…  I believe, they left the Earth and came back after a time to be told that humanity had worked hard and had now declared a full and lasting world-peace and equality. However, the aliens wanted the opposite, they wanted us to be even more vicious to be used as soldiers or something along those lines.  I believe that they then promptly destroyed either the planet or the species!

This story may be from Outer Limits or Twilight Zone.   A ship appears and overpowers all of Earth's defenses. The aliens say they have seeded life on Earth, and have come back and are disappointed in our development. If we don't do better in 3 days, the earth will be destroyed.  After incredible effort, world peace is achieved. But then it turns out the aliens seeded life to develop weapons and strategies - they wanted us to be more warlike, not less. The Earth is destroyed.


can any one help me out in this.I have created a custom visual force page on "quote " object in a PDF format where the data gets displayed .Now Can we create a we get the subtotals and grand totals calculation in a table at footer in a visual force page in a PDF format.Any suggestion plz.   SOQL Query using as : GROUP BY CUBE or  GROUP BY ROLLUP

can any one help me out in this.I have created a custom visual force page on "quote " object in a PDF format where the data gets displayed .Now Can we create a summary Report like data with subtotal and grandtotals in a visual force page in a PDF format.Any suggestion plz.   Using an tag as and passing a hard core value in a Visualforce page in a PDF.  <analytics:reportChart ReportId="XXXXXXXXXXXXX" showRefreshButton="true" size="huge" cacheResults="false" />


What is the ls option to list entries by lines instead of by columns?

I am trying to list every .tar.gz file, only using the following command:  ls *.tar.gz -l  ...It shows me the following list:  -rw-rw-r-- 1 osm osm  949 Nov 27 16:17 file1.tar.gz -rw-rw-r-- 1 osm osm  949 Nov 27 16:17 file2.tar.gz   However, I just need to list it this way:   file1.tar.gz  file2.tar.gz   and also not:  file1.tar.gz file2.tar.gz   How is this "properly" done?


I just installed Ubuntu server 16.04.3 and found out that it is command line based. Can a graphical front end be added so it is easier to use like X11? Not much in command lines since Dos 6.0. Thanks for the help, we are new to linux...

Trying to run a Ubuntu server for the first time... But everything is in a terminal. Is there a way to switch to a GUI?


i'm trying to create a chat activity but i'm constantly getting this error, can anyone help please? x  java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference     at com.example.linkit.chatActivity$3.onDataChange(chatActivity.java:189)     at com.google.firebase.database.core.ValueEventRegistration.fireEvent(com.google.firebase:firebase-database@@19.2.1:75)     at com.google.firebase.database.core.view.DataEvent.fire(com.google.firebase:firebase-database@@19.2.1:63)     at com.google.firebase.database.core.view.EventRaiser$1.run(com.google.firebase:firebase-database@@19.2.1:55)     at android.os.Handler.handleCallback(Handler.java:907)     at android.os.Handler.dispatchMessage(Handler.java:99)     at android.os.Looper.loop(Looper.java:223)     at android.app.ActivityThread.main(ActivityThread.java:7478)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)  The code generating the error:   private void seenMessage() {     userRefForSeen = FirebaseDatabase.getInstance().getReference("Chats");     seenListener = userRefForSeen.addValueEventListener(new ValueEventListener() {         @Override         public void onDataChange(@NonNull DataSnapshot dataSnapshot) {             for (DataSnapshot ds : dataSnapshot.getChildren()) {                 ModelChat chat = ds.getValue(ModelChat.class);                  assert chat != null;                 if (chat.getReceiver().equals(myUID) && chat.getSender().equals(userUID)) {                     HashMap<String, Object> hasSeenHashMap = new HashMap<>();                     hasSeenHashMap.put("isSeen", true);                     ds.getRef().updateChildren(hasSeenHashMap);                 }             }         }  Edit: Here's my database and the ModelChat class. My database is set up and works perfectly and the texts i send through the chat does go through so i'm a little confused...      package com.example.linkit;  public class ModelChat {     String message, receiver, sender, timestamp, type;     boolean isSeen;      public ModelChat(String message, String receiver, String sender, String timestamp, String type, boolean isSeen) {     this.message = message;     this.receiver = receiver;     this.sender = sender;     this.timestamp = timestamp;     this.type = type;     this.isSeen = isSeen; }  public ModelChat() {  }  public String getMessage() {     return message; }  public void setMessage(String message) {     this.message = message; }  public String getReceiver() {     return receiver; }  public void setReceiver(String receiver) {     this.receiver = receiver; }  public String getSender() {     return sender; }  public void setSender(String sender) {     this.sender = sender; }  public String getTimestamp() {     return timestamp; }  public void setTimestamp(String timestamp) {     this.timestamp = timestamp; }  public String getType() {     return type; }  public void setType(String type) {     this.type = type; }  public boolean isSeen() {     return isSeen; }  public void setSeen(boolean seen) {     isSeen = seen; }  }

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?


Is there a program for Windows 10 which will give a preview of the output to a monitor in a window?  The use case is for a presentation context, I'd like to mirror the projector onto the stage display monitor (a separate monitor from the primary monitor), whilst also showing additional information on the stage display.

I have an installation with 4 tv's connected to an a HDMI hub and this hub is connected as second display in a windows 10 computer.  All is working nice, but all tv's are far away from the computer, so when we expand the desktop to play some video (VLC, youtube etc...) we have to fish with the mouse to find the opened window to bring it back to main desktop and change what is being played.  Actually we make a workaround turning off desktop expansion and changing video, but I was guessing:  There is some way to preview in the main screen what is being displayed in second one?


I know that in line you can do it in (11!)/(4! * 4! * 2!).  But how many ways there are to do so in a circle?

I have another version of the Mississippi problem. How many ways we can arrange the letters, if we put them in a circle: Mississippi and Ississippim - are the same. I can't find a practical way to solve it. any suggestions?


I have two different list: key = ['key1', 'key2', 'key3'] value = ['value1', 'value2', 'value3']  I want to map it like this : dictionary = {'key1':'value1',               'key2':'value2',               'key3':'value3'}  I tried this: dictionary = {key, value}  But I got this result: TypeError: dict expected at most 1 arguments, got 2

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


In the top bar of the  window day and time are shown, but not date. Is it possible to show the date also by changing the setting?

On previous versions I had the date displayed. Now it just shows the current day but not the day's number or the month.   Is there a way to customize the clock or tray/taskbar more in GNOME shell on Ubuntu 17.10 and later?


I have code like this:  header("Content-Type: text/plain"); exec("/bin/bash -c 'ls --color=always'", $result); echo implode("\n", $result);   and I've got result:  Makefile README Yann Tiersen - Comptine d'un autre ete L'apres midi.mp3 bush-src.js bush.js bush.min.js [0m[01;34mcgi-bin[0m config.json [01;34mcss[0m favicon.ico foo.png index.php [01;34mlib[0m ls.txt test.php test.php~ [01;32mtest.txt[0m   It show ANSI escape codes for directories and executable files, but when I call from command line  php -r "exec('bash -c \"ls --color=always\"', \$result);echo implode(\"\\n\", \$result);"   I've got this:  bush.js bush.min.js bush-src.js ESC[0mESC[01;34mcgi-binESC[0m config.json ESC[01;34mcssESC[0m favicon.ico ESC[01;35mfoo.pngESC[0m index.php ESC[01;34mlibESC[0m ls.txt Makefile README test.php test.php~ ESC[01;32mtest.txtESC[0m ESC[00;36mYann Tiersen - Comptine d'un autre ete L'apres midi.mp3ESC[0m   png and mp3 have ANSI escapes codes, why php exec from webpage don't give that as return?

I have code like this in php:  header("Content-Type: text/plain"); exec("/bin/bash -c 'ls --color=always'", $result); echo implode("\n", $result);   and I've got result (escape is not visible)  Makefile README Yann Tiersen - Comptine d'un autre ete L'apres midi.mp3 bush-src.js bush.js bush.min.js [0m[01;34mcgi-bin[0m config.json [01;34mcss[0m favicon.ico foo.png index.php [01;34mlib[0m ls.txt test.php test.php~ [01;32mtest.txt[0m   It show ANSI escape codes for directories and executable files, but when I call from command line  php -r "exec('bash -c \"ls --color=always\"', \$result);echo implode(\"\\n\", \$result);" | less   I've got this:  bush.js bush.min.js bush-src.js ESC[0mESC[01;34mcgi-binESC[0m config.json ESC[01;34mcssESC[0m favicon.ico ESC[01;35mfoo.pngESC[0m index.php ESC[01;34mlibESC[0m ls.txt Makefile README test.php test.php~ ESC[01;32mtest.txtESC[0m ESC[00;36mYann Tiersen - Comptine d'un autre ete L'apres midi.mp3ESC[0m   png and mp3 have ANSI escapes codes, why php exec from webpage don't give that as return?


I am very wondering why we do not use least squares instead of maximum likelihood?  for example we have 3 choices k= 1, 2 ,3  $minimizing: (e^{\beta_{i} X}/(1+\sum e^{\beta_{i} X})- Y)^{2} $   for i=1,2,3

I am trying to use squared loss to do binary classification on a toy data set. I am using mtcars data set, use mile per gallon and weight to predict transmission type. The plot below shows the two types of transmission type data in different colors, and decision boundary generated by different loss function. The squared loss is $\sum_i (y_i-p_i)^2$ where $y_i$ is the ground truth label (0 or 1) and $p_i$ is the predicted probability $p_i=\text{Logit}^{-1}(\beta^Tx_i)$. In other words, I am replace logistic loss with squared loss in classification setting, other parts are the same. For a toy example with mtcars data, in many cases, I got a model "similar" to logistic regression (see following figure, with random seed 0).  But in somethings (if we do set.seed(1)), squared loss seems not working well.  What is happening here? The optimization does not converge? Logistic loss is easier to optimize comparing to squared loss? Any help would be appreciated.  Code d=mtcars[,c("am","mpg","wt")] plot(d$mpg,d$wt,col=factor(d$am)) lg_fit=glm(am~.,d, family = binomial()) abline(-lg_fit$coefficients[1]/lg_fit$coefficients[3],        -lg_fit$coefficients[2]/lg_fit$coefficients[3]) grid()  # sq loss lossSqOnBinary<-function(x,y,w){   p=plogis(x %*% w)   return(sum((y-p)^2)) }  # this random seed is important for reproducing the problem set.seed(0)  x0=runif(3) x=as.matrix(cbind(1,d[,2:3])) y=d$am opt=optim(x0, lossSqOnBinary, method="BFGS", x=x,y=y)  abline(-opt$par[1]/opt$par[3],        -opt$par[2]/opt$par[3], lty=2) legend(25,5,c("logisitc loss","squared loss"), lty=c(1,2))


I have a list of files:  ➜ ls 1_test.txt  3_test.txt  5_test.txt  7_test.txt  9_test.txt   otherfiles_1  otherfiles_3 2_test.txt  4_test.txt  6_test.txt  8_test.txt  10_test.txt  otherfiles_2    I want to select all the files except {1-5}_test.txt.  I can successfully glob {1-5}_test.txt via: <1-5>_test.txt or even just <1-5>[^0-9]*.  But ^<1-5>_test.txt doesn't work:  ➜ ls ^<1-5>_test.txt zsh: no matches found: ^<1-5>_test.txt   Any ideas what to change?  Edit:  See duplicate/similar question here:   Solution is to setopt extendedglob.

I'm currently trying to loop through a set of directories, but only the ones I care about.   $ ls -d */ cfdpost_statefiles/     p050L0260/  p050L0510/  p060L0390/  p070L0260/  p070L0510/  p092L0390/  p097L0260/  p110L0390/  p131L0325/  p150L0510/  profiles/ ERCOFTAC_TestSettings/  p050L0390/  p060L0260/  p060L0510/  p070L0390/  p084L0510/  p094L0325/  p100L0510/  p125L0510/  p136L0260/  p162L0260/  settings/   I want to match all the p###* directories except for the ones beginning with p125 and p150.  If I just do patterns with a pipe, I get:  $ for dir in ./p(125|150)*(/); echo $dir ./p125L0510 ./p150L0510   However, if I try and use the ^ like it shows :  $ for dir in ./p^(125|150)*(/); echo $dir zsh: no matches found: ./p^(125|150)*(/)   Any ideas how to proceed?


Leading antiviruses / scanners (Kaspersky, Bitdefender, AVG, Avira, SuperAntiSpyware, MalwareBytes, ... etc. from 2k10 USB drive),  AVZ cannot detect a virus in Windows 7 x64 installation that manifests itself in preventing from running Antivirus, msconfig, Office, etc. (File not found - immediately or after a small delay), but many simple programs still can start. Scanning does not give any related results.  Maybe exist some kinds of virus scanners over the world - ones that can be installed to offline Windows installation, or ones that allow to launch infected Windows in an emulator, any other for the purpose?  Are there new tools allowing to catch such an infection in the world of crooked antiviruses justifying its stupidity by rebranding in terms like rootkits / super-rootkits?

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


: Solve the equation $\sqrt{\sin (x) - \sqrt{\sin(x) +\cos(x) }}=\cos(x)$

Solve the following equation:  \begin{array}{l}{\sqrt{\sin x-\sqrt{\cos x+\sin x}}=\cos x} \\ \text{my try as follows:}\\{\sin x-\sqrt{\cos x+\sin x}=\cos ^{2} x} \\ {\sin x-\cos ^{2} x=\sqrt{\cos x+\sin x}} \\ {\sin ^{2} x+\cos ^{4} x-2 \sin x \cos ^{2} x=\cos x+\sin x} \\ {\sin ^{2} x+\cos ^{4} x-2 \sin x \cos ^{2} x-\cos x-\sin x=0} \\ {\sin ^{2} x+\cos ^{4} x-2 \sin x\left(1-\sin ^{2} x\right)-\cos x-\sin x=0} \\{\sin ^2}x + {\left( {1 - {{\sin }^2}x} \right)^2} - 2\sin x\left( {1 - {{\sin }^2}x} \right) - \cos x - \sin x = 0\\ {\sin ^{2} x+\sin ^{4} x-2 \sin ^{2} x+1-2 \sin x+2 \sin ^{3} x-\cos x-\sin x=0} \\ {\sin ^{4} x+2 \sin ^{3} x-\sin ^{2} x-3\sin x-\cos x+1=0}\end{array}  Now i think it gets more complicated , any help would be appreciated


In a cell, I have the choice of YES and NO for values. I would like to know how to change the background color for other cells in the same row depending on the value of the first without changing the values in the other cells.  How can I do this?

I have a column with function values of True or False:  =IF(ISNA(A1), false, true)   from row 1 to 5000+ rows. I would like to mark all the False as red background color or text as red. Is there any function available?


I want to align equations in an align* environment, that are on different \items of an itemize environment. Here is my MWE:  \documentclass{article}  \usepackage{amsmath}  \begin{document}  \begin{itemize} \item First item with equation:    \begin{align*}       a+b+c+d &= e,\\       1+2+3+4 &= 5.    \end{align*} \item Second item without equation. \item Third item with equation, that should be aligned with the equation    of the first item:    \begin{align*}       x &= x, \\       3 &= 3.    \end{align*} \end{itemize}  \end{document}

I have multiple align environments in my document, separated by a small paragraph of text:  \begin{align*}   foo &= something very very long compared to the other align \end{align*} explanation what I shall do now \begin{align*}   foo' &= foo + short \end{align*}   As the text in the second align is considerably shorter, the = signs don't line up, which is to be expected.  Is there some way to make the two equals signs line up with eachother?


Let $V\subseteq\mathbb{C}$ be a simply connected domain such that $V\neq\mathbb{C}$, with $a,b\in V, a\neq b.$ Prove that if $g:V\rightarrow V$ is analytic with fixpoints $a,b$, then $\forall z\in V, g(z) = z$.  Here's my attempt at a solution.  Let $$f(z) = g(z) - z.$$  As $V$ is simply connected, for every cycle $\gamma\in V$, $$0 = \int_{\gamma}{f(z)}dz = \int_{\gamma}{(g(z)-z)}dz =  \int_{\gamma}{g(z)}dz - \int_{\gamma}{z}dz,$$ so for every cycle $\gamma\in V$, $$\int_{\gamma}{g(z)}dz = \int_{\gamma}{z}dz.$$  This can only be the case if $\forall z\in V, g(z) = z$, so we are done.  I'm not sure whether my last line is correct or not, but I have a feeling that it isn't. Could anyone either confirm that this is a correct proof or point me in the right direction if it's incorrect? Thanks!

Let $f:U\rightarrow U$  be analytic, where $U \subsetneqq \mathbb{C}$ is a simply connected domain. Suppose that $f$ has at least two fixed points. Prove that $f$ is the indentity map.  I am able to prove the theorem in the case where $U = \mathbb{D}$ is the unit disc (the proof uses Schwarz lemma, and is discussed ).  The proof however skips the (rigorous) details of how the Riemann Mapping Theorem allows us to reduce from $U$ to $\mathbb{D}$. Any details are appreciated.


Prevent attackers from embedding evil kittens as tag icons! (Well, I faked that one... Really, GitHub doesn't sponsor the tag icon? Sorry for misusing your logo, fitted much too nice here.)    When loading the Stackoverflow page using https, the sponsored tag icons are fetched using http nonetheless, breaking consistent encryption of the site.

Many SE sites (like math.SE) have a problem with mixed content, which causes display bugs in recent browsers. This is particularly evident with math.SE (because of the huge use of MathJax) and with chat sections.  Will this be fixed?  How to reproduce  Visit  or   What happens  Mixed content is blocked, output is missing pieces of code (MathJax):    This picture also includes my main Firefox addons (top right), it relevant. It shows missing styles:    The white on the left is my tab list.


Very often, on my Mac, when I use the pipe (|) character followed by a space character, an invisible character will be inserted in between.  This is especially annoying when using the terminal, as it makes commands invalid.  If I type the following in iterm2, I often get the following:  ls | cat zsh: command not found:  cat   If I hit the up-arrow-key to get my previous command, and then remove and reinsert the space between | and cat, the command will work.  When I copy paste the working and non working commands into a file, like this:  non-working: ls | cat working: ls | cat   and open it in  it shows the following:  non-working: ls |¬†cat working: ls | cat   I've also experienced the same kind of issue in SublimeText2 using the square brackets ([]) followed by a space. So I don't believe its an issue with iTerm2.

How to disable the annoying Option-Space key combination for non-breaking spaces?  This is very very annoying in Eclipse or the terminal as I often type the non-breaking space instead of a regular one.


Does anyone have any idea on that problem?     Let $f : \mathbb{R} \to \mathbb{R}$ be a polynomial function. Show that not exists any $f$ such that $f(x) = \log (1+x)$.   It's easy to show that $a_0 = 0$ and $a_1 = 1$. But after i don't have any idea. Any point? Thanks!

How can I show that? I've tried to reverse the logarithm to it's exponential form in a trial to show that but I got no success. Can you help me?


Since it was reported recently that the supermassive black holes at the centres of galaxies may in fact be as many as 20,000 smaller black holes I wondered if, if these black holes collide with one another, why they wouldn't be producing gravitational waves all the time. But then I also wondered that, if whilst accepting material, supermassive black holes must drastically increase the density of that material before it collides with the SMBH why this wouldn't also cause gravitational waves. Since GW's can (presumably) be caused by anything, since colliding neutron stars also emit these waves, why wouldn't any other source emit them also?  Also, why could they not be caused by seismic activity? Even if there's a minute probability of such events occurring surely it's possible that, given all the potential sources of a matching signal, that it would happen eventually? What are people's thoughts on this matter?

As you probably know gravitational waves seem to have been proven unless you've been living under a rock for the past day. The experiment involves the reflecting off mirrors and waves of light and it is best you look because it is a little bit complicated but not too difficult. The effects are very subtle, and I am wondering if they could be a result of any Earth movements or activity above the Earth's surface. However, it seems most likely that if it is not gravitational waves, it is Earth movements because the experiment took place deep underground. Is there any proof that this is not a result of Earth movements and the only possible explanation is gravitational waves?  I don't want to be the stick in the mud here and spoil the party. However, I do like to know that what we are seeing is the truth as the effects require highly advanced equipment to be observed.     After reading all the great responses, the proof that gravitational waves do exist appears rock solid, and it seems Einstein was right again.


The $f(x)=\sqrt{x}$ has a domain of $[0,\infty)$. As of in our textbook it is written that range is also $[0,\infty)$. How? $\sqrt{x}=-\sqrt x\space or \space \sqrt x.$ According to me range should be $(-\infty, \infty)$ then. for example:  f(1) = -1 or 1 f(4) = -2 or 2 f(9) = -3 or 3 . . . $f(\infty)=-\infty \space or \space \infty$

Last year in Pre-Algebra we learned about square roots. I was taught then that $\sqrt{64}=8$ and $\sqrt{100}=10$, which I understood and accepted. I was also taught that $\pm\sqrt{64} = 8,-8$ because both of those numbers squared is 64, which I also get. But this year, with a new school and teacher in a different state, our teacher is telling us that: $\sqrt{64}=8,-8$ and $\pm\sqrt{64}$ also is $8,-8$. The way to get the positive root of something is: $+\sqrt{64}=8$ And these seem to contradict each other. I was always taught that a regular square root returned a positive number and only a positive number, but now my teacher is saying a regular square root gives two numbers, and considering the square root of a number $n$ is defined as $y^2=n$ I see where he is coming from. Upon researching this Wikipedia says:  For example, $4$ and $−4$ are square roots of $16$ because $4^{2} = (−4)^{2} = 16$  And Wolfram MathWorld says:  Note that any positive real number has two square roots, one positive and one negative. For example, the square roots of $9$ are $-3$ and $+3$  But on the other side, Wolfram Alpha, when given "The square root of 9" gives only 3.  So, which is right? Is $\sqrt{64}$ considered $8$? or is it $8,-8$?


Consider a function $$y=(x^3+\frac{1}{x^3})-6(x^2+\frac{1}{x^2})+3(x+\frac{1}{x})$$ defined for real $x>0$. Letting $t=x+\frac{1}{x}$ gives: $$y=t^3-6t^2+12$$ Here it holds that $$t=x+\frac{1}{x}\geq2$$ My question is: how do  I know that $t=x+\frac{1}{x}\geq2$  ? I want to know how to get to this point without previouly knowing that $t=x+\frac{1}{x}\geq2$

I was asked to prove that:   $$x + \frac{1}{x}\geqslant 2$$  for all values of $ x > 0 $  I tried substituting random numbers into $x$ and I did get the answer greater than $2$. But I have a feeling that this is an unprofessional way of proving this. So how do I prove this inequality?


How to make function to get visitor ip? I try fixed using related post below   but cannot fixed yet..    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Sample Tracking Visitor</title> <script type="text/javascript">  function tracking_vistors(cid,url,curl,camp,type) {     var user_agent = getuseragent();     var ip = myIP(); // how to make this function track visitor ip      var publisher = "2000000001";     var data = "cid="+cid+"&curl="+curl+"&camp="+camp+"&type="+type+"&url="+url+"&ip="+ip+"&user_agent="+user_agent+"&publisher="+publisher;     $.ajax({       type: 'POST',       url: 'widget/clicktracker.php',       data: data     });  }  </script> </head>  <body> </body> </html>

I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI.  However, I'm not against using a free 3rd party script/service.


A lot of good command block pros use coordinates, but my computer is a lenovo 2-in-1. How can I still check my coordinates?  Thanks.

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


Why doesn't this work? I think I've got all the packeges I need, and I've copied it from .   \documentclass[landscape,a0paper,final]{a0poster} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{fullpage} \usepackage[czech]{babel} \usepackage{graphicx} \usepackage{pstricks,pst-grad} \usepackage{amsthm}  \begin{document} \psshadowbox[linewidth=1mm,framearc=0.1,linecolor=red,framesep=1em]{ \begin{minipage}[h]{0.5\linewidth} {\bf Fermat’s last theorem} If an integer $n$ is greater than $2$, then the equation $$ a^n+b^n=c^n $$ has no solutions in non-zero integers $a$, $b$, and $c$. \end{minipage}} \end{document}


How to show the following      $$\displaystyle  \int_{0}^{1}\dfrac{\arcsin{\sqrt{x}}}{x^4-2x^3+2x^2-x+1}dx  \\ =  \pi\sqrt{\frac{1+\sqrt{13}}{78}} \log \left(\frac{1+\sqrt{13}+\sqrt{2  \sqrt{13}-2}}{4} \right)+\pi\sqrt{\frac{\sqrt{13}-1}{78}}\tan  ^{-1}\left(\frac{\sqrt{5+2 \sqrt{13}}}{3} \right)$$   It seems that it can be transformed into an elliptic integral. Maybe we can define   $$I(a) = \int_{0}^{1}\dfrac{\arcsin{a\sqrt{x}}}{x^4-2x^3+2x^2-x+1}dx $$  Then by differentiation   $$I'(a) = \int_{0}^{1}\dfrac{\sqrt{x}}{(\sqrt{1-a^2x})(x^4-2x^3+2x^2-x+1)}dx $$  Another approach might involve series expansion of $\arcsin(x)$  $$\arcsin(x) = \sum_{n\geq 0}\frac{{2n \choose n} }{4^n(2n+1)}x^{2n+1}$$  To be honest it seems helpless.   Reference


I want to setup a CMS on WP, which should contain a page, allowing to upload and download big files. We are expecting to use an Apache-server running on Ubuntu.  Assuming to adjust values, such as upload_max_filesize,   which parameter limit the maximum file size what is the maximum possible file size (GB?) Are there other CMS, which allow to upload bigger files?

In my website there are many authors who can publish posts but some of them are uploading images bigger than 1M , and I want to reduce the max upload size to 500 kb.


I am a beginner in electronics and have this circuit for a dual LED flasher. This was from a project book and I was able to make this quite easily with the provided printed PCB. I now want to make this on a stripboard but don't know how to arrange the components and put breaks.     I would really appreciate your help.  The related question just has software to draw your circuit on a stripboard. It doesn't automatically convert it from the original circuit. I am having trouble with the conversion part.   Thanks  I've tried this so far. Does it make sense?

I'm prototyping a simple layout for a small project on matrix board, but figured there must be a better way than drawing it all out on paper. Are there any aimed at matrix board?  I've found the following software for stripboard, but nothing explicitly for matrix board:     Stripboard Magic (seems to be abandonware, but there's page about it )  Stripboard Editor Limited free version, designed to integrate well with     Any more I've missed? Any recommendations?


Assume $u$ solves the initial-value problem $$\begin{cases}u_{tt}-\Delta u = 0 & \text{in } \mathbb{R}^n \times (0,\infty) \\ u = 0, u_t = h & \text{on }\mathbb{R}^n \times \{t=0\}. \end{cases}$$ Show that $v := u_t$ solves $$\begin{cases}v_{tt}-\Delta v = 0 & \text{in } \mathbb{R}^n \times (0,\infty) \\ v=h,v_t=0 & \text{on }\mathbb{R}^n \times \{t=0\}. \end{cases}$$ This is Stokes' rule.   This is Chapter 2, Exercise 18 of PDE Evans, 2nd edition. Here is the work I did so far:  We have $v_{tt}=(u_t)_{tt}=(u_{tt})_t$ and $\Delta v = \sum_{i=1}^n v_{x_i x_i} = \sum_{i=1}^n (u_t)_{x_i x_i} =\left(\sum_{i=1}^n u_{x_i x_i} \right)_t = (\Delta u)_t.$  Therefore, $$v_{tt}-\Delta v = (u_{tt})_t-(\Delta u)_t=(u_{tt}-\Delta u)_t=0_t=0.$$ Also, $v(x,0)=u_t(x,0)=h$. But how do I show $v_t(x,0)=0$? I can't find anything from $v_t(x,0)=u_{tt}(x,0)$.

The problem is from Evans PDE 2.5 problem 18 How to solve the equations?  Assume u solves the initial-value problem  $u_{tt}-\Delta u=0$ in $R^n \times (0,\infty)$  $u=0$, $u_t=h$ on $R^n\times \{t=0\}$  Show that $v:=u_t$ solves  $v_{tt}-\Delta v=0$ in $R^n \times (0,\infty)$  $v=h$, $\ v_t=0$ on $R^n\times \{t=0\}$  (This is Stokes' rule)


I want a multiline equation that labeled once and support page break. If I choose   \begin{align}\begin{split} balabala\\ balabala \end{split}\end{align}   then the split makes it unable to support page break. I understand that I can use align together with nonumber but I want a smarter way that I don't have to worry. It doesn't matter where the label appears.   A simplified question would be: is there any way that automatically set label on the first line and at the same time the whole equation allows page break?

The report I'm writting features a lot of long, multiple lines equations. To reduce visual polution I've been using an aligned environment nested inside equation. This way (unlike just using an align environment) I get only a single label for all the lines.  The problem is that so many long equations often need to be broken into two pages, otherwise I get lots of blank vertical space in the document. However the aligned environment does not allow the \displaybreak command.  Is there an alternative way to achieve a pagebreak inside an aligned equation?  Here's a sample ofthe equations I'm using  \begin{equation}     \begin{aligned}     ...\\     ...\\  %I need to pagebreak here     ...\\ \end{aligned}\end{equation}


I'm writing code for a kind of minigame in another game (Minecraft) in Java and I stumbled upon a problem.  I have two ints, int point 1 and int point 2. They are x coordinates, from ex: -100000 to 100000. But also -10000 to -5000, and 10000 to 20000. So negative to positive, but also negative to negative and positive to positive.  And that is the problem. I need to find a solution how to get random numbers from ex -100 to -50. But the same code has to be used with -100 to 50, and 10 to 50.  If you guys can help me, that'd be great!  Greetings,  Jesse.  PS: If you need a code snippet or something, just say it.

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


What are all the branches of mathematics? I want to know this so that I can compare between them, so if you can give me with them a brief look of what they are about that would be awesome.

I am interested in understanding how mathematics is divided into many categories, such as what categories are particular cases of what, what categories do not or have little overlap with what. This is meaningful to me, because it helps me get a big picture and not mess up  many categories.   Quoted from :     think if "Algebra", "Geometry",   "Analysis", "topology, "Number   Theory", etc. as 'first-level   subjects'; then you have algebraic   number theory, algebraic topology,   analytic geometry, etc., as   'second-level subjects.' Now we have   algebraic arithmetic geometry, a   'third level subject'   I was wondering what criterion is used to divide mathematics into the first level subjects?  My understanding for these subjects are:  The objects studied in algebra are sets with operators with some properties, and mapping between such sets. So algebra is dealing with general and abstract objects.  Geometry is, quoted from Wikipedia:      a branch of mathematics   concerned with questions of shape,   size, relative position of figures,   and the properties of space.   To make these questions meaningful, is the space a general inner product space? Or must it be a particular one, an Euclidean space $\mathbb{E}^n$? In either case, geometry is dealing with some kind of topological vector space, which seems to be more concrete than algebra.  The subjects studied in analysis are derivatives and integrals of some mapping between some sets( others that I miss?). To make derivative concept meaningful, the domain and codomain of the mapping must be Banach spaces (?); to make integral concept meaningful, the domain and codomain of the mapping must be measure space and Banach space respectively(?).   Topology is about neighborhood of each element in a set, defined as a class of subsets that are closed under arbitrary union and finite intersection. This is also quite general and abstract.  Number theory is about properties of natural, integer, rational, real, complex, algebraic numbers, that are represented in terms of four specific operators $+, -, \times, \div$. This is quite concrete.  In summary, the first-level subjects algebra, geometry, analysis, topology and number theory seem not stand at the same level of abstraction or concreteness. Is there a criterion or reason for dividing mathematical topics into these first-level subjects? There are also other categories of mathematics, such as set theory, category theory, logic and measure theory, which especially the first three seem quite general and each does not very much overlap with other categories of mathematics, including algebra, geometry, analysis, topology and number theory. So what kind of criterion is used to form these other categories? Are there other criteria for forming mathematics categories?   Thanks and regards!


When I connect to a database using ssms, I also have a checkbox labelled "Remember password". However, ssms will not remember the password. The next time I connect to the same server, I have to write it again.  What is the actual functionality of the "remember password" checkbox?

Using SQL Server Management Studio that came with SQL Server 2008 R2, I make connections to the same server using a number of different sets of SQL Server Authentication credentials. On my development machine, I use the Remember password checkbox extensively to avoid having to look up the password each time.  When I choose a Login which I have previously connected with (using Remember password), the Password entry field gets populated with asterisks, and clicking Connect allows me in - most of the time. But sometimes, with no pattern that I can discern, on choosing a previously-used Login, the Password field will prepopulate with asterisks, but clicking Connect tells me the login fails. I enter the password, click Connect, and get in, and then typically the next time I use the same login it will work.  My suspicion is that there is a maximum number of credentials that SSMS is prepared to remember, and only the most-recently-used n credentials are actually remembered, but I can't find any mention of such behaviour in the documentation.  Is there a known limit on how many credentials SSMS will remember?


The thing i'm trying to do is to create every single combination, but only using one of each letter   I did it with 3 sets of letters  inlist = ["Aa", "Bb", "Cc"] outlist = []  for i in inlist[0]:     for j in inlist[1]:         for k in inlist[2]:             outlist.append(str(i + j + k))   Output:  outlist = ['ABC', 'ABc', 'AbC', 'Abc', 'aBC', 'aBc', 'abC', 'abc']  What if i want to do this with 2 or 4 sets of letters? Is there an easier way?

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I have a little question. If I mark an X in the center of a passenger airplane, and try to fly a drone from the X mark in the moving passenger airplane (800-900 km/h), what will happen to the drone?  Is it going to fly up and standstill above the X mark? Or will it fly up above the X mark then gradually heading to the end of the plane? Put aside the FAA rules and something like that.

A couple of weeks ago I was travelling in a car (120 km/h approximately) and I saw a  flying in front of me (inside the car, near my nose, windows closed). I wonder how was that possible.   Does it mean is really flying at 120 km/h or the fly is being affected by some kind of gravity/force?


Randall Monroe, a credible source in my opinion, :     Normal light interacts with the atmosphere through Rayleigh   scattering. You may have heard of Rayleigh scattering as the answer to   "why is the sky blue." This is sort of true, but honestly, a better   answer to this question might be "because air is blue." Sure, it   appears blue for a bunch of physics reasons, but everything appears   the color it is for a bunch of physics reasons.   But is the air really blue? Color is created by matter absorbing some wavelengths, while reflecting or transmitting others (as explained, for example, ). Air transmits the entire spectrum equally, but in different directions, which would make it colorless (white?), not blue.  So, is Randall wrong?  To clarify about possible duplicates - I'm asking whether the air, not the sky, is blue. I don't ask about the physical phenomena that make them so - this one was asked and answered.

Why does the sky change color? Why is the sky blue during the day, red during sunrise/set and black during the night?


I'm pretty good at clicking the link I want to click. Most of the time it magnifies and makes me tap again when the first tap was sufficiently centered. I want it to just assume I got close enough and go to the link closest to the center of the area I tapped. Is it possible?

This feature magnifies links when it seems unsure of which you touched. .  Beyond its annoyance, as I have to click everything twice, this bubble seems to break several dropdowns, as the menus will not expand in the zoomed view because the zoomed view is just a glorified image.


So I have searched high and low and nothing seems to work.  I bought this Lenovo p500 IdeaPad, got rid of Windows8 and threw Ubuntu 12.04 on here.  My Centrino Wireless-N 2230 card seems to be giving me trouble.  It will be at full speed at times (25MB down / 5.5 MB up) then drop to almost nothing (~2MB down / `0.5MB up) for no reason what so ever.  Usually within 5 minutes of rebooting.  I have tried everything out there on the web.  I have disabled Wireless N, I have turned off Power Management, I have disabled ipv6, etc etc.  Most changes seem to work initially and then not at all.  So is there a solution someone may have or help in the matter.  It has been a couple years since I have used Linux, so any help with commands and trouble shooting would be greatly appreciated.  Here are some terminal stuff:  rfkill list   1: ideapad_wlan: Wireless LAN     Soft blocked: no     Hard blocked: no 2: ideapad_bluetooth: Bluetooth     Soft blocked: no     Hard blocked: no 4: hci0: Bluetooth     Soft blocked: no     Hard blocked: no 5: phy1: Wireless LAN     Soft blocked: no     Hard blocked: no   iwconfig   eth0      no wireless extensions.  lo        no wireless extensions.  wlan0     IEEE 802.11bg  ESSID:"Birchcrest"             Mode:Managed  Frequency:2.437 GHz  Access Point: 68:7F:74:D4:0A:FA              Bit Rate=54 Mb/s   Tx-Power=16 dBm              Retry  long limit:7   RTS thr:off   Fragment thr:off           Power Management:off           Link Quality=50/70  Signal level=-60 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:130  Invalid misc:203   Missed beacon:0

I'm on Kubuntu 16.04, all packages up to date.  Yesterday, out of the blue (not after a reboot or anything), my WiFi stopped working. The hardware is still working, I am able to connect over Ethernet, and all the local WiFi networks are listed in the NetworkManager widget. But when I try to connect to my WiFi network, it says "Configuring interface...", asks for a password, stalls for a moment, asks again, and so on, over and over again, never connecting.   I have already rebooted many times, installed all updates, and tried deleting and adding the connection, marking the connection as "Available to all users", and disabling kwallet.  EDIT: Here's the output of lspci -knn | grep Net -A3:  02:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 2230 [8086:0887] (rev c4)     Subsystem: Intel Corporation Centrino Wireless-N 2230 BGN [8086:4062]     Kernel driver in use: iwlwifi     Kernel modules: iwlwifi   The fix from , suggested by user68186, works for me (I'm able to connect to WiFi, thank you!).  So here's my updated question: is there a way for me to make WiFi work without disabling 802.11n speeds?


I am fairly new to C++. I tried to create a library with a few functions and classes.  In the visual studio solution, I created another console project, included the library, it worked for the first few times, but as I created more source files, the linker gives me LNK 2019 errors of unresolved external symbols.  I have implemented all the functions in my header files and classes, what possibly could go wrong? Here is my includes  TS.h  /* I include "TS.h" in the console project */ #pragma once #include "TMiscFunc.h" #include "TFraction.h"   TFraction.h   #pragma once     #include <iostream>     #include "TMiscFunc.h"     namespace TS {     //The class which simulates a fraction     }   TFraction.cpp  #include "TFraction.h"      //Implementation of the functions of TFraction.h   TMiscFunc.h  namespace TS {   template <typename T0> T0 TAbsolute(T0 value); template <typename T0> T0 TCeiling(T0 value); template <typename T0> T0 TFloor(T0 value); template <typename T0> T0 TPower(T0 value, int power);   TMiscFunc.cpp  #include "TMiscFunc.h"   template <typename T0> T0 TAbsolute(T0 value) {     //operations... } template <typename T0> T0 TCeiling(T0 value) {     //operations... }  template <typename T0> T0 TFloor(T0 value) {     //operations... }  template <typename T0> T0 TPower(T0 value, int power) {     //operations... }   The error messages:  Error   LNK2019 unresolved external symbol "int __cdecl  TS::TAbsolute<int>(int)" (??$TAbsolute@H@TS@@YAHH@Z)  referenced in function "public: void __thiscall  TS::TFraction::Simplify(void)" (?  Simplify@TFraction@TS@@QAEXXZ)   All the errors are the same except the function names are changed  Thank you all for reading.  //It is solved

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)