I am performing an analysis in which the unit of analysis is a geographical area (more precisely, an ). This is a case when the sample analysed can represent the entire population (all 32000+ LSOAs in England). How do we interpret, in this case, the point and interval estimates of a, say, regression analysis?

Imagine you have to do reporting on the numbers of candidates who yearly take a given test. It seems rather difficult to infer the observed % of success, for instance, on a wider population due to the specifity of the target population. So you may consider that these data represent the whole population.   Are results of tests indicating that the proportions of males and females are different really correct? Does a test comparing observed and theoretical proportions appear to be a correct one, since you consider a whole population (and not a sample)?


I want some input on what you guys think is the most secure way to connect to a MySQL database using PHP. Currently the way I'm doing it is a utility PHP file that I include in the top of all my other PHP files. The utility PHP file is this:  <?php     if(!defined('IN_PHP')){         die("hackerssss");     }     $mysql_host = "localhost";     $mysql_user = "root";     $mysql_pass = "root";     $mysql_db = cokertrading; ?>   Any suggestions?

When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that password? It seems like just writing it in the PHP code isn't a good idea.


I'm trying to send email with attachment using SMTP protocol. Also I added activation.jar (v. 1.1.1) as Maven dependency and javax.mail dependency (v. 1.4.7). And I have got configs in xml that works for messages without attachments. Here is my code   public boolean sendEmail(Form form) {     try {         Properties props = getProperties();         Session session = Session.getInstance(props);         MimeMessage mimeMessage = new MimeMessage(session);         MimeMultipart multiPart = new MimeMultipart("mixed");          MimeBodyPart contentPart = new MimeBodyPart();          contentPart.setText("Email Body", "UTF-8");          multiPart.addBodyPart(contentPart);          MimeBodyPart attachmentPart = new MimeBodyPart();          attachmentPart.setContent(form.getCvFile(), "application/pdf");           attachmentPart.setDisposition(Part.ATTACHMENT);          attachmentPart.setFileName(form.getFile().getName());          multiPart.addBodyPart(attachmentPart);         mimeMessage.setContent(multiPart);         javaMailSender.send(mimeMessage);      } catch (MessagingException e) {         log.error(e.getMessage(), e);     }     return false; }   It gives me NullPointer  java.lang.NullPointerException     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:557)     at com.my.sender.EmailSender.sendEmail(EmailSender.java:59)     at com.my.controller.SpringController.update(SpringController.java:133)     at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:71)     at com.liferay.portlet.CheckboxParametersPortletFilter.doFilter(CheckboxParametersPortletFilter.java:57)     at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:68)     at com.liferay.portlet.CheckboxParametersPortletFilter.doFilter(CheckboxParametersPortletFilter.java:57)     at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:68)     at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)     at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:105)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)     at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletExceptionAdapter.service(ServletExceptionAdapter.java:68)     at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)     at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)     at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)     at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)     at com.liferay.portal.osgi.web.wab.extender.internal.adapter.FilterExceptionAdapter.doFilter(FilterExceptionAdapter.java:46)     at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)     at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)     at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)

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?


I just enrolled in a class called "Elementary Number Theory" and I am left confused in every class due to the different notations and proofs shown.   Is there a really basic book on Number Theory out there that I can read to nail down the basics of this course?  Thanks.

I went through this thread on  asking about a text on number theory, but my question is slightly different.   I was looking for a short and sweet book on elementary number theory. I don't need it to be a definitive treatise on number theory. I just need to have book which covers enough material to advance to algebraic number theory. I have looked at the books by Niven-Zuckerman-Montgomery and the Jones' and the one by Burton. All of them were very readable and I would like to read at least one of them at some point. For now, I would just like a book (say 100 pages long) which can get me acquainted with most of the material needed for algebraic number theory. Basically there is a course on algebraic number theory that I wish to take which begins in a month's time and I have not done enough elementary number theory.


I have just read in Emma by Jane Austen a phrase which surprised me:  I can think of but one thing - Who is in love with her? Who makes you their confidant? (Jane Austen: Emma, Chapter VIII, Obreey PocketBook)  Here the lattest who is clearly in singular (followed by makes), the gender of the person under question is unknown, so I understand it as a gender neutral their:  Who makes you his/her confidant? Who has confided you the information about her lover?  I wouldn't expect such an old usage of their functioning as a singular gender neutral word. I've always considered this "grammar trick" as a much more modern invention. Is it really a usage of the gender neutral their? Is it so old that Jane Austen could have used it? Or was it just some recent editor who didn't consider the good old Austen "correct enough" and "fixed" it?

Is there a pronoun I can use as a gender-neutral pronoun when referring back to a singular noun phrase?  Each student should save his questions until the end. Each student should save her questions until the end.


I need to know EXACTLY how lighting affects combat, and if it does at all. It's listed in the DMG as just an explanation of an environmental thing, but how does it work specifically?  Does Dim Light or Darkness affect attack rolls and how? I've heard that Dim Light causes a -2 penalty, and Darkness inflicts a -5 penalty, on anyone with normal sight. WOTC refute this as incorrect.  How does Dim light or Darkness affect concealment? Do they add to the roll? Do they allow concealment to occur? Do they automatically grant concealment?  Two fighters and standing side by side taking swings at each other. One is standing in Bright Light, the other in Dim Light, or Bright Light/Darkness, or Dim Light/Darkness. Does one have an advantage over the other?  I need to know what exact mechanics occur in these circumstances, if any.

I understand that there are different types of lighting (dim, bright, complete darkness), but I haven't been able to find anywhere in the DMH or PHB that specifically describes how these different types of light sources affect combat.   What impact does complete darkness have on players being able to see the locations of the monsters in the room? What impact does complete darkness have on combat rolls against monsters? Could anyone point me to a book/page that contains some more detailed information on this?   Thanks!


The version of my Ubuntu is 16.04 LTS. After Ctrl+Alt+F1, I enter the tty1. The first thing to do is to login. But when I input my username and press the enter, I cannot input the password. And it repeatedly print login incorrect.

I upgraded from 16.04 to 18.04. When I press Ctrl+Alt+F3 I get the terminal which prompts for the username. When I type my username and press Enter, it doesn't wait for my password (its as if I pressed Enter without entering anything). Even if I enter something, the text shown in plaintext and then it keeps on saying my password is wrong. After few times, the screen is cleared and it prompts for my username again and the same loop goes on.


My question is: is there flexibility in how one can punctuate the phrase "Why not?"  The answer may seem obvious at first...it is a question after all. However, it's also a common idiom, and I am wondering if that offers a choice in how it's punctuated. I became curious about this after seeing dictionaries, including  and , using the phrase in example sentences sans the question mark:     "Do you want Italian food tonight?" "Sure, why not."   .     I said we were, too, so he said why not let him take us to dinner somewhere and then all come together.   The second example sounds especially wrong, and as if it's missing quotation marks. Of course, most dictionary examples of the phrase in a sentence included question marks. So are the provided examples above errors?  Edit: The first comment suggesting this is a possible duplicate links to a statement, not a question.

Which makes more sense as end punctuation for the following rhetorical sentence—a period or a question mark?     Maybe you could be a security guard there and enforce whatever the WalMart policy is at that location


I have a directory with huge number of files with different extensions. What I want to do is to move each extension to a folder with name the extension itself, and those files without extension move to a folder named unkown.  For example I have the files a.txt, b.txt ,a.pdf, b.pdf , a.mp4 , file, newfile ....  The result would be 4 dirs named txt, pdf, mp4 , unkonw  the txt dir contains the files a.txt, b.txt  the pdf dir contains the files a.pdf, b.pdf  the mp4 dir contains the files a.mp4  the unkonw dir contains the files file, newfile

I have some files with different extensions such as *.pdf, *.mp3, *.jpg and a few others. All of them are stored in a parent directory.  How can I get a list of all extensions, create some folders based on these  extensions and then move all files into their relevant folders?


I have a question about showing C++ code in LateX  When I do the following, the C++ goes past the page. Is there a way to fix this?  \documentclass{article}   \newcommand{\dd}[1]{\mathrm{d}#1} \usepackage[parfill]{parskip} \usepackage{listings} \usepackage{xcolor} % for setting colors \usepackage{breqn}  % set the default code style \lstset{     frame=tb, % draw a frame at the top and bottom of the code block     tabsize=4, % tab space width     showstringspaces=false, % don't mark spaces in strings     numbers=left, % display line numbers on the left     commentstyle=\color{green}, % comment color     keywordstyle=\color{blue}, % keyword color     stringstyle=\color{red} % string color }  \begin{document}  \section{$\Delta A_2$ Derivation: Comparison with CRIS2}   First, let us start by showing the C++ code: \begin{lstlisting}[language=C++, caption={C++ code using listings}] {   else if (evaltype == 5)    {     for (std::size_t i=startp;i<p.size();++i)      {       double & x = p[i].first; //input       double & y = p[i].second; //result       double q1 = rtx[8]-(cafdf(rtx[0],rtx[4]*x*x*x)-rtx[3])/rtx[1];       double xi = crsxib(q1);        double p1i = 23.0/(1.0-xi)+ab[5]+xi*(11.0*ab[2]+xi*(2.0*ab[3]+xi*33.0*ab[4]));       p1i *= 4.3723240245*ab[0];       double si = (1.0+ci*(ab[99]+xi*(ab[44]+xi*ab[33])))/(3.0*(1.0-xi));       y = p1i*xi*xy/abc[2]/dde[2]*(x/(1.0+dd*(x-1.0)))*(q/(1.0+si*(x-1.0)))*(x/(1.0+ci*(x-1.0)));     }   } } \end{lstlisting}

How is it possible to let lstlisting wrap lines?  I've troubles with following block:  \begin{lstlisting}[language=java]  public class MeasureStationControllerV0Test {    MeasureStationControllerV0 controller;   MeasureStation ms = new MeasureStation();    MeasureStationConfiguration config = new MeasureStationConfiguration();      DataServer dataserver = new DataServer();   In the PDF output there is an overflow:    Other code-snippets look horrible too.    So have I to manually wrap them or is listings able to handle that? Why isn't syntax highlighting working?


I am creating a web application which needs to access the local audio and video files in the client's system.  The basic idea is, when the site is opened in the browser it must have access to the files of the client system and must display all the media files in a requested directory.  Can this be implemented using any concepts of JavaScript, Java, Perl, Ajax or any other client-side languages?  Some questions have solution to this but now it has become obsolete  so is there any new way

Is there local file manipulation that's been done with JavaScript? I'm looking for a solution that can be accomplished with no install footprint like requiring .  Specifically, I'd like to read the contents from a file and write those contents to another file. At this point I'm not worried about gaining permissions and am just assuming I already have full permissions to these files.


I ran minecraft.exe on my floppy with wine and a black window popped up. I saw log-in but it all was black you could only see the borders of login. how can i fix this error?

How to correctly install Minecraft, including setting any needed packages or apps to install it and to troubleshoot the most common problems that Ubuntu users face when trying to use Minecraft.  I am trying to install and run Minecraft without first having to install the Oracle version of Java. I want to use the OpenJDK version that comes with Ubuntu and as a last resort, use the Oracle one.  I also want to know a list of problems related to Minecraft in Ubuntu and the possible solutions to them.  A step by step guide on how to install Minecraft would also help.


I was wondering about $\lim_{n \to \infty}(1+n)^{\frac 1n}$. It is may not be as famous as Euler's limit but worth discussing. I searched the net but didn't get relevant proofs. I might miss though.  I thought one way, using LHopital, yeah kind of using a big result and don't know whether the proof is correct or not. I believe that there are plenty of easier proofs but I am not getting one.  Thinking $\lim_{x \to \infty}\log((1+x)^{\frac 1x})=\lim_{x \to \infty}\frac{\log(1+x)}{x}=\lim_{x \to \infty}\frac{1}{1+x}=0$ by raising it to the exponent we get the limit to be $1$.  Let me know your thoughts I think I still have to prove that the sequence is convergent first.

Find the following limit:  $$\lim_{n\to \infty} (1+n)^{\frac1n}$$  I know that  $\lim_{n\to 0} (1+n)^{\frac1n}= e$.


How exactly does air neutralize charged objects?  For example, at what rate does air neutralize a copper sphere of radius R and net charge Q? I assume that the rate may vary depending on the surface area and amount of charge but what physical process takes place? Consider the upper limit of the net charge to be below what would cause a spark in the air. I would really appreciate a full physical explanation along with a quantitative analysis.

What are the ways electrostatic charged objects leak charge in humid conditions?  Can airborne particles pick up charge by contact, then be repelled hence removing charge? If so would it be a significant factor?


I was looking at source code of JDK8's HashMap Implementation. I noticed Hashmap is uses a array of Nodes.   transient Node<K,V>[] table;   There is a Node Class defined inside the HashMap Class.  Node Class is declared as a static class. Below is the code for Node Class   static class Node<K,V> implements Map.Entry<K,V> {         final int hash;         final K key;         V value;         Node<K,V> next;          Node(int hash, K key, V value, Node<K,V> next) {             this.hash = hash;             this.key = key;             this.value = value;             this.next = next;         }          /*         Some other methods         .         .         .         .         .         */       }   I would like to know if the class has static keyword, how are we able to create object of this static class ?  What is the significance of creating a static class if we are creating objects for this class.( Static is something that is not associated with instances )  Why has this class been created as Static Nested Class as compared to inner class(non-static nested class) if we wanted to create objects of this class.

What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?


According to the :     Now, whenever you want to work on a project, you only have to activate   the corresponding environment. On OS X and Linux, do the following:  $ . venv/bin/activate    This works. However, when I try running ./venv/bin/activate and venv/bin/activate, both gave me -bash: venv/bin/activate: Permission denied.  My question is: What does the . do?

What's the difference between executing a script like this:  ./test.sh  and executing a script like this:  . test.sh?  I tried a simple, two-line script to see if I could find if there was a difference:  #!/bin/bash ls   But both . test.sh and ./test.sh returned the same information.


I have class Product:  public class Product {      private String name;      public Product(String name) {          this.name = name;      }      public String getName() {          return name;      }  }   Then in MainActivity:  ArrayList<Product> products; .... protected void onCreate(Bundle savedInstanceState) {     .....      for (int i = 1; i < 15; i++){         products.add(new Product(Integer.toString(i)));     } }   After compiling and building App crashes and give such error code:     java.lang.RuntimeException: Unable to start activity   ComponentInfo{panchenko.ivan.canteen_application/panchenko.ivan.canteen_application.MainActivity}:   java.lang.NullPointerException: Attempt to invoke virtual method   'boolean java.util.ArrayList.add(java.lang.Object)' on a null object   reference   I don't have any ideas what goes wrong.

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?


Any idea on how to return a second value in this code?  private void uploadImage_10() {     final ProgressDialog pd = new ProgressDialog(this);     pd.setMessage("Posting");     pd.show();     if (mImageUri != null&&mImageUri2 != null){         final StorageReference fileReference = storageRef.child(System.currentTimeMillis()                 + "." + getFileExtension(mImageUri));         final StorageReference fileReference2 = storageRef.child(System.currentTimeMillis()                 + "." + getFileExtension(mImageUri2));          uploadTask2 = fileReference2.putFile(mImageUri2);         uploadTask = fileReference.putFile(mImageUri);         uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {             @Override             public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {                 if (!task.isSuccessful()) {                     throw task.getException();                 }                 return fileReference.getDownloadUrl();             }         }).addOnCompleteListener(new OnCompleteListener<Uri>() {             @Override             public void onComplete(@NonNull Task<Uri> task) {                 if (task.isSuccessful()) {                     Uri downloadUri = task.getResult();                     miUrlOk = downloadUri.toString();                     Uri downloadUri2 = task.getResult();                     miUrlOk2 = downloadUri2.toString();                      DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Posts");                      String postid = reference.push().getKey();                          HashMap<String, Object> hashMap = new HashMap<>();                         hashMap.put("postid", postid);                         hashMap.put("postimage", miUrlOk);                         hashMap.put("postimage2", miUrlOk2);                         hashMap.put("description", description.getText().toString());                         hashMap.put("publisher", FirebaseAuth.getInstance().getCurrentUser().getUid());   I want to return fileReference.getDownloadUrl(); and fileReference2.getDownloadUrl(); but have no idea how.

I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so.


I need to set up a MySQL database with a maximum number of tables which can be created in it.  For example, if I have my maximum at 5 tables for a single database, and someone attempts to create a 6th table, an error will be raised.  Also note that this restriction can not affect other databases. For example, database 1 can have a max of 5 tables, and database 2 can have 10 tables, and database 3 can have unlimited tables.  Any help would be greatly appreciated. Thanks!

Are there any options for running DDL triggers in a MySQL database. I would like to create a view every time someone create a table.  If the "Users" table is created, I want the DDL trigger to create a view called "v_Users".


I have a csv file like:  column1,column2 string1,value1 string2,value2 …   Values are integers, strings are alphanumeric.  I tried to plot it, with strings on x axis and values on y axis. After some tries leading to errors like Could not parse input "string1" as a floating point number, sorry. The unreadable part was near…, based on some questions (like , , ,  or ), i finally found this only way to get the things works, (see also , page 363):  \begin{tikzpicture} \begin{axis}[     symbolic x coords={string1,string2,string3,…},     minor tick num=1, ] \addplot table [x=column1,y=column2] {csvfile.csv} \end{axis} \end{tikzpicture}   Obviously, the non-numerical data needs to be write directly in the graph definition.  How can i have the same in a DRY way, i.e. have for only source of data the CSV file given as \addplot parameter ?

I am using LaTeX, TikZ and PGFplot in order to automatically generate several series of diagrams, one of which is comprised of bar charts. Each bar in each bar chart may have a unique label and height -- I have used PGFplot before and I know that I can read in coordinates from files, but would it be possible for me to create labels for each bar using textual data stored in a tab-separated file? If so, how would I do this? A simplified example of a file I might use is shown below.  # foo.dat # Label | X-Position | Height  A    1    15 B    2    20 C    3    12 D    4    24   Thanks for your help!


If an abbreviation occurs at the end of sentence, is there one period or two? For example,     Caesar was assassinated in 44 B.C.. Brutus killed him.   Should there be one period or two?  This has nothing to do with etc.

Example:     It's all about apples, oranges, bananas, etc.   VS.     It's all about apples, oranges, bananas, etc..   Update  What happens if the abbreviation is inside parentheses, do you place a dot after and before the closing parenthesis?     It's all about fruit (apples, bananas, etc.).


constructs an equilateral triangle given a segment $AB$ via two circles using the segment as radiuses, using $C$ as one of the intersection points of the circles. I understand that there assumptions made which are not part of the original set of axioms. E.g. that the circles intersect (i.e. such a $C$ exists). Additional axioms would be required e.g. involving some continuity axiom for intersection issue. But when it turn out that the circles intersect twice, by what criteria is one of the two points chosen? Does this require something similar/equivalent to the axiom of choice or not?

Suppose I have a non-empty set $A$.     How do I choose an element $x\in A$?   More precisely, I believe I would like to find a formula $P(x,y)$ of ZF such that for every non-empty set $y$ there is exactly one $x\in y$ such that $P(x,y)$ is true.  I have thought about this for a while without success and I am beginning to doubt such a formula is even possible. But in mathematical proofs it is quite common to "choose a fixed element" from a non-empty set. So how exactly do we achieve such a thing? Am I missing something?  Thank you in advance.


Essentially I'm answering my own question here, but want to provide this info to anyone else who might need it. I need all the valid IP address ranges for Google Apps mail servers.   I'm configuring a firewall to only allow incoming SMTP from our Google Apps hosted (POSTINI) email and want to allow only the expected servers to connect to our internal server for delivery. In trying to setup the rules in our firewall, it does not accept CIDR notation for the allowed IP address ranges. Thus I have had to convert them from the CIDR addresses provided by the article:   NOTE: This is not a duplicate question. The article linked to as a duplicate reference is "". This is not what this question/answer asks or answers. This article is to save others the time to do each of those conversions manually from Google's published list of addresses if they have network equipment that doesn't accept CIDR notation.

This is a  about IPv4 Subnets.      Related:               How does Subnetting Work, and How do you do it by hand or in your head?  Can someone explain both conceptually and with several examples? Server Fault gets lots of subnetting homework questions, so we could use an answer to point them to on Server Fault itself.   If I have a network, how do I figure out how to split it up? If I am given a netmask, how do I know what the network Range is for it? Sometimes there is a slash followed by a number, what is that number? Sometimes there is a subnet mask, but also a wildcard mask, they seem like the same thing but they are different? Someone mentioned something about knowing binary for this?


I'm new here and the sentence "Seeing someone slowly lose interest in you is one of the worst things." Same with "Watching someone die.." Why are the verbs "lose" and "die" in their base form? Also are "seeing" and "watching" gerund or progressive?

In the sentence:     I'd like to watch the sun go down    why there is no "to"?  Why not:      I'd like to watch the sun to go down


A month ago I updated the website with a new Title and Description (basically the whole website had been changed) but the Google crawler doesn't index these new data and continues to show the old one.   I checked it in the Google Search Console and found a very strange behavior. In the URL inspection tab I saw that the last indexing was a few days ago (21 Jan 2021) by a mobile crawler and in the Crawled page report old data is showing. So the bot found the old data somehow. When I used the TEST LIVE URL tab I found that the crawler picked up the new data. How it's possible and how to make the standard indexing tool to see the relevant data?  I manually requested the re-indexing process, however, I'm not sure it helps because the last index was a few days ago and the site  had been changed a month ago P.S. I don't have the robots.txt file. Bing shows the same old data. Maybe I should remove the URL indexing at all and request the new re-indexing? Thanks for any help

I changed the title and meta description of a web page.  It got re-indexed but still it shows in search results with the old title.  Why would this happen and how would we resolve it?


I get NullPointerException when I run this code -   File src = new File("C:\\myxl.xlsx"); FileInputStream fis = new FileInputStream(src); XSSFWorkbook wb = new XSSFWorkbook(fis); XSSFSheet sh1 = wb.getSheetAt(0);  String mystr=sh1.getRow(1).getCell(4).getStringCellValue(); WebElement mwe = driver.findElement(By.xpath("//div[@title='" + mystr + "']"));  if (mystr.contains(null)) { System.out.println("there is Nothing"); } else  { act.doubleClick(mwe).perform();   What do I change in the code so that if the value in that column and row is empty it will print "there is Nothing" instead of giving me a NullPointerException or else it will take some action with the element.  P.S. This is part a of a Selenium webdriver script

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?


I have a small python script that opens a url built up from a string input byt the users and a pre-defined variable, which looks like this;  sn = str(input("Input here")) url = 'http://URLPART1' + sn + '.URLPART2'  if sys.platform == 'win32':     webbrowser.open_new_tab(url)  elif sys.platform == 'darwin': # OSX     subprocess.Popen(['open', url])   Now, I'm trying to write the Windows part in C++ and I've tried a few different approaches but I'm not quite sure how to concatenate the strings in C++ as I did in python using '+'.  This is one of my attemps;   int main ()  {     int sn;     string sn2, url;     cout << "UserInputHere: ";     cin >> sn;     sn2 += std::to_string(sn);     std::string A = ("http://myurl1");     std::string B = (".myurl2");      url = A + sn2 +B; // or url << A + sn2 << B?      ShellExecute(NULL, "open", 'url', NULL, NULL, SW_SHOWNORMAL);      return 0;  }   Can someone show me how to re-write the line; std::string url = A + sn + B; into something C++ will understand or maybe the whole approach is wrong?  Many thanks,  Editted.

int i = 4; string text = "Player "; cout << (text + i);   I'd like it to print Player 4.  The above is obviously wrong but it shows what I'm trying to do here. Is there an easy way to do this or do I have to start adding new includes?


These are my all partitions.    This is my /etc/fstab    I would like to auto mount sda3 (NTFS), sda6 (ext4), sda7 (ext4) on startup, please help me edit the /etc/fstab file.  I've searched for GUI way of doing this but I cannot find pysdm on the software center.  Thanks.  Edited!!!    I've edited fstab as shown in the picture, I got error during booting, please help me find out what went wrong. P.S. I've created /mnt/extdisk1, I copied and pasted the UUID so it was not misspelling.

Sometimes when I restart my computer, my drives will mount but sometimes they won't (like right now when I'm typing this question out).   Is there an easy way, like a program that can mount them for me? Going in the console, making folders, etc, is NOT what I want. I like how Windows does it where they always mount the drives no matter what.   If there isn't a program how else can I easily mount all drives?


I have a SharePoint list having more than 2,00000+ records. Its an email enabled list. I got a requirement to move items which are of DateModified > 60 to another list having the same template in another site collection.All the items are having attachments, so i couldn't find a way to batch insert items to the target list keeping attachments using ProcessBatchData method. I am currently iterating through the source items and inserting it in the target and it takes enough time to complete operation for some 5000 items. Could you please help if you know any better way to handle this situation.

I'm in the process of upgrading/cleaning up a large Web Application with a lot of Site Collections. On a SharePoint Foundation 2013 env.  I have found some questions about moving document libraries and lists but nothing really covers it good. At least not what from what I have found.  Is there a way to move Libraries and/or Lists from one site collection to another on the same web application without effecting any metadata on the files and keeping all versions of document/ListItems.  I would preferably like to do this using PowerShell.  Have any tips/links?    that this question might be a duplicate of, but i don't believe the answer covers if there is a way to to this with PowerShell.  UPDATE  I have now investigated this more and tested some different ways to move Lists and Libraries.   Granular Backup and Restore ()   This worked but some metadata was lost. I found that user fields like custom user fields, Created By, Modified by and Create Date and so on, was not kept. Sadly, other ways this was easy to do.  How to: In Central Admin go to Back Up and Restore -> Granular Back up -> Export a site or list. Use PowerShell to Import it. (Import-SPWeb http://site -Path export.cmp -UpdateVersions Overwrite)  Save List as Template, Include Content.   Sometimes Include Content is "greyed-out".  Using code.   Looses Metadata if I move SPFolder. (Time consuming if I recreate the list on a different site collection and move all items and tag the metadata per document.)


I have a lenovo z500 with dual boot Windows 8 and Ubuntu 13.04. Recently I deleted the Linux partition (from windows disk manager) but did not remove the boot loader.Now the next time I booted it gave the following error.   No such partition found  Grub rescue   I tried to make a super grub disk but when I insert it in the machine nothing happened it still gave the same response.  Please help.

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


I restored a Windows 7 Clonezilla image of a Dell laptop I had to a virtualbox hard drive. During the boot process, I get a BSOD,  I've tried repairs using both the internal system repair and using a Windows installation CD. I've run chkdsk and bootrec as well with no success. Booting in safe-mode hangs at classpnp.sys. Any ideas how to fix this?

I'm in a situation where I could do with very quickly migrating a Windows 7 (RTM x64) installation from one machine to another.  What options are open to me in terms of getting W7 to boot after the drive is picked up and moved from one box to another? I thought it was supposed to be a little less sensitive to this kind of move than XP, but it doesn't work - it is stuck in a reboot loop and never reaches a GUI.  Tried a few things so far, none of which have worked:   Changed SATA mode in the BIOS of the target machine between ATA and AHCI run Windows 7 Startup Repair tried safe mode, no change   (I will keep this list up to date as suggestions come in)  UPDATE: I can confirm this reboot loop is due to STOP error 0x0000007B, and these codes follow:  0xFFFFF880009A98E8 0xFFFFFFFFC0000034 0x0000000000000000 0x0000000000000000    UPDATE: I didn't get anywhere on this and I ended up just rebuilding the machine. I think it should be theoretically possible, so I'm going to leave the question open in case someone comes along in future with an answer.


I'm trying to insert values into a table but failing during prepared statement. I get a fatal error: Cannot pass parameter 2 by reference. Can someone help me find where the problem is coming from.  $sql=$conn->prepare("INSERT into tbl_user(firstname, lastname,            phonenumber, designation,             gender, email, password "); $sql->bind_param("ssissss",'$firstname','$lastname','$phonenumber',           '$designation', '$gender', $email, '$password'); $sql->execute(); echo "registration successful";

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


during installation of Ubuntu 14.04, I deleted all my data of my laptop including windows operating system! Is it possible to recover the deleted data and windows 10 operating system? If possible then how can i get them back?

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


I would like to detect anomalies in a time series data using a moving average approach. Basically, the system will rise an alarm when a data point is far away (3*std for example) from the current mean.   The problem is that the data contains periodic deviations and I do not want to rise alarms for these periodic deviations (even if they are far away from the mean). In other words I would like to rise alarms only at non-periodic deviations. What basic approaches I can try to achieve this?  Thank you. Mario

I am working with a large amount of time series. These time series are basically network measurements coming every 10 minutes, and some of them are periodic (i.e. the bandwidth), while some other aren't (i.e. the amount of routing traffic).  I would like a simple algorithm for doing an online "outlier detection". Basically, I want to keep in memory (or on disk) the whole historical data for each time series, and I want to detect any outlier in a live scenario (each time a new sample is captured). What is the best way to achieve these results?  I'm currently using a moving average in order to remove some noise, but then what next? Simple things like standard deviation, mad, ... against the whole data set doesn't work well (I can't assume the time series are stationary), and I would like something more "accurate", ideally a black box like:  double outlier_detection(double* vector, double value);  where vector is the array of double containing the historical data, and the return value is the anomaly score for the new sample "value" .


I read this in 2003. It was either a quite short book, or perhaps a short story, although it was published in a paperback.  The main character was male, and I believe in his early teens. The characters were mostly human, although there were alien races represented as well.  The central focus was the idea that it had been decided to fight all wars virtually. Armies would be laid out on the battlefield, each person roughly a few inches tall, and commanders would physically nudge them around the field using their hands. The results of these battles would determine how resources were distributed.  The main character at one point spends hours, possibly days, leading these virtual soldiers to their deaths in battle. Afterwards, he is greeted with enthusiastic congratulations, but is emotionally scarred by the events, and describes the soldiers as "real people dying." He also describes the painful blisters he experienced while commanding.  I can't remember much more, other than I found the book in a middle-school book fair in the US. Also I believe the friend who congratulated the protagonist after the battle was some sort of strange monster, possibly a giant floating eyeball, or something along those lines.  edit: My persistent googling has yielded zero results, but I really wanna find this book. I've been wracking my brain for more details, but the only thing I can remember is that while the battles are taking place, the commanders (the teen boy) are in some sort of space station. I remember it being described quite like a cliche horse-race betting parlor (gotta be a better way to phrase that), with excited people waving tickets around and betting on the results of the battles. I think one of the friends of the main character had bet big on his victory, and the trivialization of what he experienced as a traumatic event was a source of contention.

Some sort of battle school (no, not Ender's Game), where teens are being trained as military commanders.   The control system for their army hinges around some sort of system that requires extremely fine motor control -- being able to "push" around digital representations of military units using a special interface that interprets minute finger movements.  The boy protagonist eventually meets a girl in the battle school, and is astonished to learn that most people do not live as well as he does -- for instance, he gets a fresh jumpsuit outfit every day and disposes of the old one; this is a luxury.  One scene I recall is them kissing for a moment in some sort of underground passageway; the boy protagonist notes the exact length of the kiss, as he has been trained to have heightened time perception.  I don't recall much about other commander characters; I think they have different special abilities, and one other major character might have physical deformities, possibly because of postwar-radiation-related birth defects.  They have been training for an upcoming, prearranged final battle between all the existing national governments; the military units are very possibly robotic or entirely digital in nature, so as to avoid wasting materiel / human life.    They ultimately win the battle, just barely; I think the girl protagonist gives them an edge in the competition by hacking the timing / control system in favor of their team, causing a discrepancy which only the boy protagonist notices due to his heightened perceptions.  It was agreed that the winning government gets dominion over one of the few islands of land left that was not irradiated in some previous war; the protagonists get to live there as a reward for their victory.  I believe the boy protagonist later realizes he's gradually losing his ability to exactly quantify the passage of time.  Published no later than 2004, likely somewhere between 1980-2000, probably sometime in the '90s.


I opened up a shapefile ZIP in QGIS. Now, I cannot "toggle editing mode" to on, nor access any of the editing features, anymore! What could I be doing wrong?    Please, and also the one, here-for, this:

I am using QGIS 2.16 / Windows 10.  I have a point shapefile which I have been using for a little while that has always been editable.  Today I was editing the layer, saved my edits and left my computer for a few hours. When I came back I was not able to toggle the editing button on the toolbar and when I right click on the layer it longer has toggle editing as an option.  I have googled the problem every way I can think of and have not been able to find an answer to why the layer is suddenly un-editable or how to fix this.


I hold an Indian passport.  I am planning to apply for a Schengen visa for a short Europe trip in September 2018 for 7 days. This is my first trip in Europe, i.e. my first attempt at getting Schengen visa.  Also, I am planning to visit Europe and the UK again in June 2019 during the Cricket World cup in the UK (England and Wales). I will apply for a UK visa in 2019, but can I use my Schengen visa, which I will be getting now, to enter any Schengen country again in June 2019? What is the validity of this visa?  Which embassy should I apply for a Schengen visa: the Netherlands, as my longest stay for current trip is in Netherlands?  How can I get a Schengen visa that is valid until June 2019, so that I don't need to apply again?

I hold an Indian passport. I am applying for a Schengen visa for a short trip in Eurpe in September 2018.  My itinerary is Bangalore, India -> Dubai on September 22. Dubai -> Sofia, Bulgaria on September 25. Sofia -> Brussels on September 27. Brussels -> Amsterdam on September 28. Amsterdam -> Brussels on October 1. Brussels -> Sofia -> Dubai on October 2. And Dubai -> Bangalore on October 3.  While applying for the visa there is this question: "Is your final destination inside the Schengen Area?"  As per my itinerary, I will be going to Sofia the second time on October 2 using my Schengen visa. What should be the answer to this question?


I am using the for command and when I do for(i < 4) { i++ } it pops out: Unexpected token ) at line *line of the command*  I have tried moving some variables and moving where the for command is, even checking StackOverflow, but I can not find an answer. This is strange since it has not happened in the past.  function learnEng() {     while(generationNum <= generations) {         for(i <= 4) {             i++;         }     document.write("
sentence "+generationNum+": "+output+"
");         generationNum++;         } } learnEng();   I didn't expect to get the error because this is the first time I have gotten it, and it spat out an error, and Its sometimes on the line that the for(){} command is on and sometimes it is not, but I know the for(){} command is causing it because it doesn't happen when its not there.


One of my players have recently reached the age were they would start feeling the downsides of being old, and I haven’t found any rules about the effects. Is there any written rule that describes the effects of old age?

I am new to D&D.  I did not find any official ruling concerning the effects of aging in the PHB. I know that in some systems aging can have adverse and/or beneficial effects on stats.  I ask because I am currently playing Monk and at 15th he will receive Timeless Body which prevents "the frailty of old age". What is the mechanic, if any, that this applies to?


I'm searching for books on the basic k-means and divisive clustering algorithms. I'm interested in the pros and cons of both. It's a part of my bachelors thesis, I have implemented both and need books to create my used literature list for the theoretical part. Also, is there a book on "the curse of dimensionality"?  Thanks!

I'm working on a small (200M) corpus of text, which I want to explore with some cluster analysis. What books or articles on that subject would you recommend?


I will be staying in the 11th arrondissement of Paris, and I will need to get to CDG for an 11:30 flight. I have two questions:   Does it make more sense to take public transport, or to take a taxi? In each case, how much time should I allow to get there?

Paris has 3 airports (Orly, Roissy, Beauvais), what are the options to go to or to come from there?  (There is also Vatry (XCR) but there is very few flights and i see the shuttle system is currently off.)


I am making an AJAX call every 20th second of every minute and updating some data. Now sometimes when i make a call, by the time the next call happening, it still hasn't received the data from the last call thereby stacking both the calls. This keeps happening and the server is getting choked in some cases.  What i want is to cancel the AJAX call for that minute in case the response to the previous call hasn't been received yet.  This is my code:   setInterval(function(){ let now = new Date(); if(now.getSeconds() === 20){     $.ajax({         url: url,         headers: { 'x-cyclops-ajax': 'yes' },         method: 'POST',         dataType: 'json',         success: function(data) {             var chart = $('#container').highcharts();             var keys = Object.keys(data["histData"]);             $( "#main-div" ).empty();             for( var i=0; i< keys.length; i++) {                 chart.series[i].setData(data["histData"][keys[i]]["histFailure"], true);                 $('#main-div').append( '

 ' + keys[i] + ': ' + data["availData"][keys[i]] + '

');             }             chart.xAxis[0].setCategories(data["histKeys"]);             console.log("Data:" + JSON.stringify(data["availData"]));         },         error: function(jqXHR, textStatus, errorThrown) {             console.log("Did not hit the AJAX call");         }     }); } }, 1000);   Any help is appreciated.

Is it possible that using jQuery, I cancel/abort an Ajax request that I have not yet received the response from?


I read a lot here about resetting ESTA by going outside of US and then returning, but I still want to make sure I get it right. My 90 days will be over in October. I am planning to travel to Dominican Republic in September and then in October enter the US again.    Will it reset my ESTA for another 90 days?   One of my friends did so and he says it works, but I keep reading about an "adjacent islands zone" and am a bit worried.

I've read a few questions/responses on this but seem to be reading conflicting information  I've tried to find a number for immigration at Fort Lauderdale but don't appear to be able to call  My status is this I am a British citizen here on an esta which expires 1st April   I have a friend arriving for 2weeks 31 March and I would like to stay and spend time with her for 2 weeks   My intention was to fly to the abaco islands of the Bahamas for 3/4 nights then return to Florida and fly back to England with them on the 12th April   Hoping that my visit to the Bahamas would reset my 90 days even though il only be staying another week in the states before returning to my place of residence in the UK   Is this false hope/information tahrs going to get me in bother ? Would really appreciate some advice ?  Melanie


I have a string contained in an array as follows:  array(1) { [0]=> string(11) "€5,000.00" }   When displaying the string, it is malformed:    Page charset is set to:    <meta charset="utf-8">   EDIT  To add more detail to this questions, this is how the string is being created:      $numberFormatter = new \NumberFormatter('en_US', \NumberFormatter::CURRENCY);     $moneyFormatter = new IntlMoneyFormatter($numberFormatter, $currencies);     $moneyFormatter->format(new Money($balance['amount'], $currency));   where new Money is the moneyphp class...

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


Or just city in some formats? I mean, I could maybe guess why it was marginally helpful a century ago, but why now? What use is it for my reader to know that a book I'm citing was published in Berlin, Boston, and Fresno, or more to the point, that the nearest city to me where a certain book was printed years ago happens to be Fresno? If the point is to look up the book, wouldn't the ISBN be far more useful?

Most bibliography formats require the city of publication for books. Why? In this digital era, ISBN would be way more important. But even before the digitalization of everything, why was the city of publication important?  I can imagine some purposes:    to distinguish potential same names of different publishers, and to help book-seekers find the publisher and the book by actually visiting the city or contacting libraries in the city.    I want to know better stories about the 'city of publication'.


I want to prove the following statement.  Let $V$ and $W$ be $n$-dimensional vector space and $T \in \mathcal{L}(V,W)$. Prove that $S \in \mathcal{L}(W,V)$ is a left inverse if and only if it is a right inverse.  My first thought was that I can use the following facts: (1) A function $f: A \to B$ is injective if and only if it possesses a left inverse and is surjective if and only if it possesses a right inverse. (2) A linear map $T \in \mathcal{L}(V)$ is injective if and only if it surjective if and only if it is invertible. The first statement seems valid, but the 'link' between surjectivity and injectivity breaks down, I believe, because $V$ and $W$ only have the same dimension, but are not necessarily the same vector space. Finite-dimensional doesn't imply finite, so I cannot use the usual fact for functions that if $f: A \to B$ where $|A| = |B| = n$ is injective, then it is surjective (and vice-versa). I also can't use the fact that a function is bijective if and only if it is invertible because having a left or a right inverse says nothing about invertibility (with the key word being 'or'). Any help would be appreciated. I'd like to think I'm on the right track.

If $A$ and $B$ are square matrices such that $AB = I$, where $I$ is the identity matrix, show that $BA = I$.    I do not understand anything more than the following.   Elementary row operations. Linear dependence. Row reduced forms and their relations with the original matrix.   If the entries of the matrix are not from a mathematical structure which supports commutativity, what can we say about this problem?  P.S.: Please avoid using the transpose and/or inverse of a matrix.


Is there any anti-virus that is free for Mac OSX that is like AVG or Avast for PCs?   Is there a malwarebytes version for Mac OSX?   Is there mobile anti-virus available for iOS like Avast etc. I am looking for anti-virus that is compatabile on both iOS and Mac OS X. I am not just looking for anti-virus for Mac OS X.

Is it worth to buy an anti-virus software for Mac OS X?  I heard both opinions like "it's not possible to get a virus on Mac OS X" and "Mac OS X is also vulnerable against virus... "  Which is true? What is the accepted practice, if any? Under what circumstances would anti-virus be advisable?


How many squares are in the above figure?

This is one of those popular pictures on sites like Facebook. I always see a huge variation of answers such as $8, 9, 16, 17, 24, 28, 30, 40, 41, 52,$ etc., yet I've never seen a definitive answer on any website.    I counted $16$ whole squares ($4$ going down on left side, $4$ going down on right side, $8$ small squares in the centre). With this method the answer could also be $17$ if you want to count the entire shape as one big square.  I can also see the answer being $24$ if you count the smaller squares separately, as if they were floating above the main grid instead of intersecting with it.  Is there a right answer, or is it possible that there is no 'right' answer and it just depends on your counting method?


Don’t ask me how, but I forgot my Picasa username and password. I don’t have the details on my Gmail either. I have searched high and low to check if there is any way of recovering my username of Picasa.  Any one here know of a way, ANY WAY, to recover a Picasa account?

I have forgotten the password or username for my Google account, or I'm unable to access my account for other reasons.  How can I recover my account?  (This Q&A is meant as a general description for all Google and Gmail username/password questions. See: )


I want to remove certain element of breadcrumb on certain condition. I tried theme_preprocess_breadcrumb($variables). The condition and logic works fine here but doesn't reflect on viewing page. I tried this module_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb) – same issue. Code here doesn't reflect on viewing page, though printing variables in both methods gives me expected result but not on viewing page. I need help.  function theme_preprocess_breadcrumb($variables) { // Removing last element of breadcrumb if ( $variables['breadcrumb'] ) {   $currentUrl = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];  $key = 'find this';   $countElements = count($variables['breadcrumb']); if (strpos($currentUrl, $key) == true) {   unset($variables['links'][$countElements-1]);   unset($variables['breadcrumb'][$countElements-1]);   kint($variables['breadcrumb']);kint($variables);die;  } } return $variables; }

I'm currently using the preprocess_breadcrumb hook in my .theme file to customize the output of my breadcrumbs like so:  function mytheme_preprocess_breadcrumb(&$variables){     $node = \Drupal::routeMatch()->getParameter('node');     $current_path = \Drupal::service('path.current')->getPath();     $result = \Drupal::service('path.alias_manager')->getAliasByPath($current_path);     $crumbs = explode("/", $result);     if($node){         $variables['current_title'] = $node->getTitle();         $variables['crumbs'] = $crumbs;     } }   I then use breadcrumb.html.twig to use these new variables like so
{{ 'You are here'|t }}

         {% for crumb in crumbs %}              {% if loop.first %}
Home
         {% elseif loop.last %}
{{ current_title }}
          {% elseif crumb == 'node' %}         {% else %}
 {{ crumb }}
         {% endif %}         {% endfor %}
  {% endif %}   However I'd like it more if all this was encapsulated in a module. In mymodule.module file I have  function mymodule_preprocess_breadcrumb(&$variables){ $node = \Drupal::routeMatch()->getParameter('node'); $current_path = \Drupal::service('path.current')->getPath(); $result = \Drupal::service('path.alias_manager')->getAliasByPath($current_path); $crumbs = explode("/", $result); if($node){     $variables['current_title'] = $node->getTitle();     $variables['crumbs'] = $crumbs; }   }  But this function never fires. Is there a way to use the preprocess_breadcrumb hook from a module?


Max Planck, arguably the leading theoretical Physicist of his day, apparently used of experimental data to formulate his equation for , which was a major step in the birth of quantum mechanics. For this seminal event of the 20th century, I would expect a detailed explanation of how Planck arrived at his conclusion that energy MUST be quantized. I've even read his Nobel lecture but was non the wiser.  Can some kind person please explain it, or give me even just a hint?

Some time ago I asked my quantum physics lecturer the question:     How did Planck derive his formula, the    $$E=hf$$    with constant of proportionality $h$, the .   I was motivated by the fact that every lecturer talks about the history of this formula (black body, birth of quantum mechanics etc) but I've never encountered an explanation of how Planck derived it.   My lecturer told me that he had researched it and found only old articles in German. Moreover he said that he couldn't find a derivation in professional physics books. This is something that every author assumes needs no derivation.  So how did Planck derive this formula?


Let $X_i$ be i.i.d. uniform random variables in $[0,\theta]$, for some $\theta>0$ and $M_n = max(X_i)$  I am trying to find the bias of $M_n$ as an estimator of $\theta:$  $$E[M_n] - \theta = $$  Computing $E[M_n] = \frac{n}{n+1}$ I guessed the answer would be $\frac{n}{n+1} - \theta$  But this doesn't seem to be the final answer. What would be the next step? Is there another way?

Let $ x_i $ be iid observations in a sample from a uniform distribution over $ \left[ 0, \theta \right] $.  Now I need to estimate $ \theta $ based on $N$ observations and I want the estimator to be unbiased.  I thought about simple estimator $ \hat{\theta} = \max \left( x_i \right) $.  Based on simulation it is not biased, yet I couldn't show it analytically.  Could anyone, please, show it is unbiased?  BTW, I could easily find another, easy to prove, unbiased estimator, $ \hat{\theta} = 2 \mathrm{mean} \left( {x}_{i} \right) $


I am working on cloning an Ubuntu 18.04.2 physical server, I use clonezilla for cloning, however, when I apply that image to any other servers (and of course I change the hostname and static IPs), I find that the MAC addresses stay the same, which causes a mess in my network.  It seems the MAC addresses are hardcoded somewhere, do you have any idea where I can reset these MAC addresses to use the real ones of the other servers?

I have a situation in which I have many identical servers to setup Ubuntu 18.04 on. I set one server up, took an image with Clonezilla and then restored on all others.  Normally, I go to each of these servers, then I apply the necessary changes to /etc/hostname, /etc/hosts and the netplan YAML file to reflect the correct settings.  The problem is that the bond I have configured in the netplan file always comes up with an identical MAC address to the server I took an image from, so the network fails completely.  Any idea how can I fix that?


I'm going on a road trip and will be sleeping in the bed of the truck at night.   I want to be able to have a fan running during this time.  I have a couple old car batteries sitting around, and I was thinking I could charge them up before I leave home, and then use them to power the fan at night.  The engine will not be running when I am using the fan, and I don't want to drain the battery that's used for starting the engine.  The thought is that I get a power inverter so that I get 120 VAC out to power typical AC desk fans (the smaller the better).  I want to calculate how long a battery can power such a fan.  Let's say the fan is a 120 V, and on the "Low" setting consumes 30 W. Let's say the battery is a 600 CCA, 12 V, lead-acid car battery, with a 50 Ah capacity (20 Ah Rate).  How can I calculate the time that the battery will last?  I know that the power rating of the fan can give the current used (P=IV), and the capacity of the battery can tell me how long at whatever current (Capacity = Amps*hours).  But I don't know which voltage to use (12 or 120), or how to incorporate the inverter or the part about the 20 Ah Rate.  I'm also open to other ideas for running a fan with the engine off.   Another additional thought is to connect the battery in parallel to the truck's battery and that way it would be charging when I drive during the day, but the batteries are different capacities, and I don't know if there would need to be other hardware to prevent my truck battery from being drained.  If this can't be done then I will just drain the battery and when it's dead, I'll just have to wait to get back home to charge it.  Thanks!

I've got 15 devices each with a current of 20mA and I am interested in running them all for 10 seconds. How would I go about working out the amount of mAh a battery would need to provide for this?   I understand that to find the mAh to run something for an hour you take the current and multiply it by 1000 and so my understanding of his problem was that you could get minutes by multiplying by 100 and then seconds by 10. So What I thought I needed to do was something like this:  15 x 20mA = 300mA/0.3A   0.3 x 10 = 3  3 x 10(seconds of runtime) = 30mAh   However I am not sure if this is right, so I would be grateful if someone could look it over and point out my mistakes.


I am trying to run a program on eclipse. I am getting the following error:  Exception in thread "main" java.lang.UnsupportedClassVersionError: Perlinit : Unsupported major.minor version 51.0     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:634)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)     at java.net.URLClassLoader.access$000(URLClassLoader.java:73)     at java.net.URLClassLoader$1.run(URLClassLoader.java:212)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:205)     at java.lang.ClassLoader.loadClass(ClassLoader.java:321)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)     at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: Perlinit. Program will exit.   Output of java -version is  java version "1.6.0_27" OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1~12.04.1) OpenJDK Server VM (build 20.0-b12, mixed mode)   Output of javac -version     javac 1.6.0_27  Where can I be going wrong?

I have installed JDK 6, but I can't execute a Java program.   For example, I have made test.java.  I compile it with javac tes.java and there's no error when I compile it, but when I want to execute that program it always displays an error.  I execute the Java program with java tes.  Exception in thread "main" java.lang.UnsupportedClassVersionError: tes : Unsupported major.minor version 51.0     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:634)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)     at java.net.URLClassLoader.access$000(URLClassLoader.java:73)     at java.net.URLClassLoader$1.run(URLClassLoader.java:212)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:205)     at java.lang.ClassLoader.loadClass(ClassLoader.java:321)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)     at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: tes. Program will exit.   My javac version is 1.7.0, my java version is 1.6.0.  Here is my tes.java code:  class tes{      public static void main(String[]args){         System.out.println("hello");         }     }


The problem I am using an application that is computationally intensive and requires X11 to run. I want to run it on a remote server (that is obviously running X11). I don't need to forward X11, I just need it to run on the server. More details If I run the application from the server (i.e. I use the keyboard that is physically connected to the machine), then everything works fine. My problem is that I want to start this application remotely (from an SSH connection) because I cannot always access the server physically. I am not completely sure how it works, but when I run the following command from the machine (i.e. using its keyboard): $ xhost +  then I can run my app ($ DISPLAY=:0 ./run-my-app) without problem from SSH. Now, I cannot run xhost + from SSH, and anyway it sounds like a bad idea in terms of security. If I don't run xhost +, I get the following output:  No protocol specified xauth: (argv):1:  unable to open display ":0".  In conclusion, it looks like there is some security feature (access control) that prevents me from running the app on X11 remotely. But the point is that I don't want to have more than what happens when I start the app from the server (with the keyboard connected to the physical machine); I just want to start/stop it remotely, without any forwarding. Is there a way to do that? Similar questions It looks similar to  and , but in these situations they can use a virtual server like Xvfb, which does not work in my case. Moreover, I do have an X server running on the server, and I do need it.

Once upon a time,  DISPLAY=:0.0 totem /path/to/movie.avi   after ssh 'ing into my desktop from my laptop would cause totem to play movie.avi on my desktop.  Now it gives the error:   No protocol specified Cannot open display:    I reinstalled Debian squeeze when it went stable on both computers, and I guess I broke the config.   I've googled on this, and cannot for the life of me figure out what I'm supposed to be doing.   (VLC has an HTTP interface that works, but it isn't as convenient as ssh.)  The same problem arises when I try to run this from a cron job.


Let T be sqaure matrix and regarded as a linear operator on a finite dimensional vector space V such that $T^2 = 0$.     $\dim(\ker T \cap \ker T^t) =\dim \ker T+\dim\ker\ T^t−\dim(\ker T\dot+\ker T^t) $    ($\dot+ $ denotes direct sum)  Is the abvoe equation true? If so, why is it so?

$\dim(U_1+U_2) = \dim U_1 +\dim U_2 - \dim(U_1\cap U_2).$  I want to make sure that my intuition is correct. Suppose we have two planes $U_1,U_2$ though the origin in $\mathbb{R^3}$. Since the planes meet at the origin, they also intersect, which in this case is a one-dimensional line in $\mathbb{R^3}$. To obtain the dimension of $U_1$ and $U_2$, we add the dimensions of the planes (4), and the subtract the dimensions of the line (1), which results in (3).   *additional question(s):   Can we generalize this notion to $\mathbb{F^{n}}$?  Suppose we have an additional case where $U_1$ and $U_2$ are planes in $\mathbb{R^3}$, but $U_1 \subseteq U_2$. In this instance, $dim(U_1 + U_2) < 3$, because the first two-dimensional plane is contained in the second and as a result, the dimensions of the subspaces when summed cannot exceed two. Since both subspaces $U_1,U_2$ are two dimensional and $U_1 \subseteq U_2$, then their intersection is also two-dimensional, concluding $dim(U_1+U_2)=2+2-2 = 2$.  Is this proper intuition?


How do I turn off the workspace menu when doing SHIFT+RIGHT CLICK? I am trying to learn blender and SHIFT+RIGHT CLICK is used in blender for selecting multiple objects. This is also a problem with certain games.

Using Oneiric 11.10 and Unity. I want to disable the context menu that appears with Alt+RightClick. Alt+RightClick is a much used shortcut in Blender. It's possible to remap keys in Blender, but I was hoping to be able to turn it off in Ubuntu so that Blender get scontrol. I update my Blender installation often, so it's more convenient not to have to change settings every time.


I had an Ubuntu 18.04 with mysql 5.7. I upgraded it to Ubuntu 20.04 with mysql 8.x. But this 8.x not was compatible with my Drupal 7 and I tried to downgrade. After this I tried with a 5.7 docker image and this show the database but not the tables inside. In the /var/lib/mydatabes directory I see a lot of .idb files, but nothing else. Is it possible to recover the database tables? And how? Thanks.

I have previously saved a copy of /var/lib/mysql/ddms directory ("ddms" is the schema name). Now I installed a new MySQL on a freshly installed Ubuntu 10.04.3 LTS by running apt-get install mysql-server, I believe version 5.1 was installed. After I copy the ddms directory under /var/lib/mysql, some of its tables work fine, these are the tables with an associated set of three files: a .frm file, a .MYD file and a .MYI file.  However, there are two tables with a different set of files: a .frm file and a .ibd file. These two tables didn't show up in the table list in phpMyAdmin. When I look at the error log, it says:  [ERROR] Cannot find or open table ddms/dictionary_item from the internal data dictionary of InnoDB though the .frm file for the table exists. Maybe you have deleted and recreated InnoDB data files but have forgotten to delete the corresponding .frm files of InnoDB tables, or you have moved .frm files to another database? or, the table contains indexes that this version of the engine doesn't support.   Please help with restoring these two tables. Thanks.


I have a plugin that I've downloaded that dynamically adds an element to the page upon clicking an image. I'm trying to add some JavaScript (slideUp()) to one of the newly added elements, but it's not working:  <script type="text/javascript">     $('.image').imageClick({ 'fadeSpeed': 1000, 'targetHeight': 210 });     $(".container").mouseover(function() {         $(".overlay").hide().slideUp();     }); </script>   How can I make this work?

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'm a newbie to Minecraft, and not a computer whiz, so I fully expect I'm going something wrong here.   I've been trying to use the keepInventory cheat in Minecraft but it always says "Unknown Command" and no options come up when I put in /gamerules (all that comes up is /gamemode). I've been having a streak of getting killed with some awesome stuff in my inventory and I desperately want to keep this from happening again!   I have cheats enabled. Is there something I'm missing? How so I solve this?

I once played a vanilla Minecraft adventure map (called "Herobrine's Mansion") that prevented the player from losing their items on death. Which commands can be used to prevent the player from losing their items on death (in vanilla Minecraft)?


I wrote 3 functions CellAbove takes a cell and returns the cell above CellAboveValueV1 takes a cell and returns the string value of the above cell using .offset(-1,0) CellAboveValueV2 uses CellAbove to return the string value of the above cell Here's what my code looks like: Function CellAbove(r As Range) As Range     CellAbove = r.Offset(-1, 0) End Function  Function CellAboveValueV1(r As Range) As String     CellAboveValueV1 = r.Offset(-1, 0).Value End Function  Function CellAboveValueV2(r As Range) As String     CellAboveValueV2 = CellAbove(r).Value End Function  But when I test this functions with the excel data below, v1 function works, but the v2 function doesn't. What am I missing? data  | V1(data) | v2(data) ---------------------------- row 1 | data     | #VALUE! row 2 | row 1    | #VALUE! row 3 | row 2    | #VALUE!

I seem to be getting a type mismatch error when trying to do something like this:  In new workbook:  A1 B1 5  4  Function Test1() As Integer     Dim rg As Range     Set rg = Test2()     Test1 = rg.Cells(1, 1).Value End Function Function Test2() As Range     Dim rg As Range     Set rg = Range("A1:B1")     Test2 = rg End Function   Adding =Test1() should return 5 but the code seems to terminate when returning a range from test2(). Is it possible to return a range?


While reading , I came across . It describes various uses of the "last seen" field that can help people to abuse the system.   If you can't be bothered to read it, it's basically a mini stalkers' manifesto for SE. Very creepy (some of the creepy bits have now been edited out, presumably as a response to this post)  As this field isn't particularly useful anyway, can it please be augmented in some way to reduce the potential for abuse? At least on smaller sites where it's much easier to use that data to infer information that's supposed to be anonymous?  I'm not sure exactly what form that augmentation should take, it could be as simple as "seen in the last hour" or "seen today/yesterday" rather than the more precise version we see now.  I know, I know, I mean who's going to sit there waiting and watching for these events to transpire just to make sure they can stalk a downvoter, right?  Trust me, it happens. On a site I moderate, we've lost good contributors because every time they downvoted a particular person's posts, they almost immediately got one in kind. Others who've downvoted have received comments on random posts from this person demanding an explanation for your recent downvote at xx:xx:xx on foo question:...  The perpetrator even bragged to me in public comments that he could identify anyone who downvoted his posts; the "last seen" data can help him to do it.  N.B. Something vaguely similar has been , but that was ~8 years ago and for different reasons.

When I go to any profiles it shows me the last online status for that profile under visits > seen.     seen X mins ago   However, I sometimes don't want to let everyone knows that I've visited the site a while ago.Can we just turn this setting off so that no one will be able to know if I'm online or not?


Today PHP claims that 30.26 - 30.26 = -3.5527136788005E-15  My calculator (and common sense) says that it should equal 0. Both numbers being used in the calculation were taken from a MySQL database, data type is varchar(255). Taking this into account with floatval() doesn't seem to do the trick. Anybody know what's going on here?  /*  this is what the table looks like... __________________________________________ |uid    |AccountNumber|    Total|    Paid| __________________________________________ |51     |3255         |    30.26|   30.26| __________________________________________ */  $q = "SELECT Total, Paid FROM Account WHERE AccountNumber='3255';"; $r = mysqli_query($db, $q); $vars = mysqli_fetch_array($r);  $balance = floatval($vars['Total']) - floatval($vars['Paid']); echo $balance;   OUTPUT  -3.552713678805E-15

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


I am running below command in windows command prompt and it's giving output like below,  C:\>logman.exe FabricTraces | findstr Root Root Path: C:\ProgramData\Windows Fabric\Fabric\log\Traces\   Now, I am trying to mimic the same in C# program and would like to capture the output (C:\ProgramData\Windows Fabric\Fabric\log\Traces\) into a variable.  How to do this, here's the code I tried,  Process P = Process.Start("logman.exe", "FabricTraces | findstr Root");             P.WaitForExit();             var result = P.ExitCode;

How do I execute a command-line program from C# and get back the STD OUT results? Specifically, I want to execute DIFF on two files that are programmatically selected and write the results to a text box.


I am new to script. I want a loop to check if file is exist in directory then sleep for 3 seconds and this loop will repeat foe 10 attempts I should see 10 sleep messages and message failure after 10th attempt. Could anyone help?

I'm looking for the basic loop like:  for(int i = 0; i < MAX; i++) {   doSomething(i); }   but for bash.


I wrote $b_n:=\sqrt{a_na_{n+1}}$ and tried to apply a few tests on the series. Here are the tests that didn't work:  $$b_n<=a_n$$  $$\lim_{n\to\infty} \frac{b_n}{a_n}$$  $$\lim_{n\to\infty} {b_{n+1}}{b_n}$$  $$\frac{b_{n+1}}{b_n}<=\frac{a_{n+1}}{a_n}$$

suppose that $\sum_{n=1}^{\infty}a_n$ is a convergent series of positive terms. Prove that $\sum_{n=1}^{\infty} \sqrt{a_n \cdot a_{n+1}}$ is also convergent. Demonstrate that the converse is false.


If an instruction next to a button says ‘do not push’, some people end up pushing it. Their desire to do the opposite overpowers the fear, if any, of repercussions. Is there any word for such a trait in a person?

I'm looking ideally for a word to describe someone who does something even when they're told not to. Like, if they're told not to do something like a dare, or just to not go and do such-and-such, they will do it. In fact, it will only make them more determined that they can do it.   Examples:     She was described as ___ because she was told to not go to the party, but did it anyways.         She was called ___ since her father told her to not do any stupid dares but she didn't listen to him.          He has a tendency to be ___ - he likes to prove he can do it, despite others telling him he can't.   Thanks for your answers!


I have checked Google Flights and many other online OTAs, displaying flight fares for future dates (extending upto 1 year). How are these rates decided and from where these data come? Are these rates predicted by respective OTA, or they come from any GDS (Global Distribution System) by airlines themselves?  Also whether these rates change with time? I mean if I book a flight ticket today (18th April, 2019) for the departure at (11th August, 2019) in $100, then will this price of 11th August, 2019 departure, for same flight, remain same for all the days there after till 11th August, 2019?  Example of Google Flight calendar with flight fares:

Has anyone ever booked a flight with ?  I am just wondering where they get their prices and data from, and if I might find a cheaper flight by using something like Expedia or Travelocity.


Exception : Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "java.net.URL.toExternalForm()" because "location" is null I tried many way to resolved my problem. Project :

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?


I have trouble seeing that $C/c \cong (c/(C^{op}))^{op}$. This is what I have managed so far:    What am I doing wrong here? It seems to me that to get to $(c/(C^{op}))^{op}$, would have to reverse the $h$, and then it no longer looks like $C/c$    (Edit)  This is just to sum up what my mistake was, in case others fall in the same trap: What I missed was the fact, that (see diagram) in $c/C^{op}$, not only $f$ and $g$ get reversed (ie. $f \rightarrow f^{op}$ etc), but $h$ too becomes $h^{op}$. Why did I not see that? Well, my thinking was along the lines "$C = \cdot \xrightarrow{f} \cdot$", so "$C^{op} = \cdot \xrightarrow{f^{op}} \cdot$", and to contruct the slice category, you create morphisms, let's call them $h$ ..., - but of course, those morphisms are between objects in the categories that are getting sliced (if that's the right term), so the same relationship applies here: $h \rightarrow h^{op}$.  Thanks for kindly helping me see this!

I'm self studying from Category Theory in Context by Emily Riehl and have encountered the following question regarding slice categories:     Let $\text{C}$ be a category and $c$ be an object in $\text{C}$. Show that $\text{C}/c \cong (c/(\text{C}^{\text{op}}))^{\text{op}}$    The exercise appears in an chapter that introduces the notion of opposite categories and duality proofs.     My intuition of why the statement is true comes from the following observation:  Let $x,y$ be objects in $\mathbf{C}$ (or equivalently $\mathbf{C}^{\text{op}}$). Let $g^{\text{op}} : c \to y$ and $f^{\text{op}} : c \to x$ be objects in $c/(\mathbf{C}^{\text{op}})$. By the definition of slice category, there exists a morphism $h^{\text{op}} : y \to x$ in $\mathbf{C}^{\text{op}}$ such that the diagram below commutes:  $\hskip2in$   Now the 'corresponding diagram' in the opposite category $(c/(\mathbf{C}^{\text{op}}))^{\text{op}}$ would be:  $\hskip2in$    which, as I understand it, would also be commutative. Now, to me, this indicates:   that the objects in $(c/(\mathbf{C}^{\text{op}}))^{\text{op}}$ are the same as the objects in $\mathbf{C}/c$, namely, a morphism in $\mathbf{C}$ from an object $z \in \mathbf{C}$ to $c$. the commutativity of the seconds diagram describes morphisms $h$ in both $\mathbf{C}/c$ and $(c/(\mathbf{C}^{\text{op}}))^{\text{op}}$ if you reverse the arrows again you return to the same diagram. This makes me think you could construct a map between morphisms by first making a map from $ \mathbf{C}/c \to (\mathbf{C}/c)^{\text{op}} ( \cong c/(\mathbf{C}^{\text{op}}) )$ by $h \mapsto h^{op}$     Now, what I am really looking for is a way to structure a proof. I feel like I have some intuition but am very unsure of how to write it down in a concise way. I am new to category theory so I'm still very much learning how to construct these types of proofs using duality; I feel like what I have written is maybe overkill but I'm trying to be as explicit as possible to make sure I understand everything.  In particular, I don't know how I would get a concrete correspondence between morphisms in the two categories that respects associativity of composition etc.  Any help or pointers would be appreciated!


I was surprised today to find out that the following appears to be valid code in Python:  def foo(n):   foo = n * 10   return foo  foo(5)   What in Python allows for a variable name to match the name of the function it is in? Is it just some kind of scoping rule that helps to keep these 2 things separate? so Python simply considers a program's function namespace to be a completely separate animal from the program's variable name space?  (Note: I would hate to do this in my own programs as it's a tad confusing but c'est la vie as they say in France.)

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


I have a problem when using ACLs  I have one file  -rw-r----- 1 syslog adm 0 Sep  5 17:53 postfix_exporter_input.log   The permissions 0640 are correct and they need to stay like this. Now I want to apply an ACL, that allows a single user to read and write to that file. So I write:  setfacl -m u::rw,g::r,o::-,u:postfixexporter:rw postfix_exporter_input.log   getfacl now outputs the following, which is actually correct:  # file: postfix_exporter_input.log # owner: syslog # group: adm user::rw- user:postfixexporter:rw- group::r-- mask::rw- other::---   However, when I do a normal ls on that file, I get the following:  -rw-rw----+ 1 syslog adm 0 Sep  5 18:01 postfix_exporter_input.log   Why did the permissions change to group:rw ?

It might be the time of night, but this is puzzling me. Picture the following.  [root@node1 acltest]# getfacl foo/ # file: foo # owner: root # group: testuser user::rwx group::r-x other::---  [root@node1 acltest]# ls -la . total 24 drwxr-xr-x  3 root root     4096 Feb  9 21:53 . drwxr-xr-x 25 root root     4096 Feb  9 21:54 .. drwxr-x---  2 root testuser 4096 Feb  9 21:53 foo [root@node1 acltest]# setfacl -m m::rwx foo [root@node1 acltest]# getfacl foo/ # file: foo # owner: root # group: testuser user::rwx group::r-x mask::rwx other::---  [root@node1 acltest]# ls -la . total 24 drwxr-xr-x   3 root root     4096 Feb  9 21:53 . drwxr-xr-x  25 root root     4096 Feb  9 21:54 .. drwxrwx---+  2 root testuser 4096 Feb  9 21:53 foo [root@node1 acltest]# su - testuser [testuser@node1 ~]$ cd /acltest/foo/ [testuser@node1 foo]$ ls -la . total 16 drwxrwx---+ 2 root testuser 4096 Feb  9 21:53 . drwxr-xr-x  3 root root     4096 Feb  9 21:53 .. [testuser@node1 foo]$ touch bar touch: cannot touch `bar': Permission denied   In words: I create a directory foo, with mode 0750, root as owner and testuser as the group. (testuser is the private group of testuser, but that doesn't matter.)  The getfacl command correctly shows no ACL's on this directory and there is not mask yet. The mask will be set accordingly to the group permissions if I would add a named group or user now.  If I explicitly set the mask to rwx now, the group permissions as shown by ls change too. I know it happens the other way around (the mask changes when the group permissions change), but this seems puzzling.  The more puzzling because the getfacl output does not show the group permissions as rwx but - as said - ls does.  Which one is right? Apparently, the output of getfacl is right, because testuser cannot write to foo. As expected, by the way, because I did not grant the testuser group any permissions to do so.  It goes on. I cannot allow the testuser group write permissions on foo by just using chmod. I have to explicitly set an ACL using setfacl -m g:testuser:rwx foo to allow testuser to finally touch foo/bar.   Can someone explain the rationale behind the difference in the outputs of getfacl and ls? I know it can be tricky to have normal permissions go together with ACL's, but this seems plain wrong. (Though I expect to be missing something glaringly obvious ;))  I have already seen


I'm connecting a  (master) to a  (slave) using I2C. The wire between the devices is ~30cm. I'm using 400kHz without slew rate control. Later on, I'll add another 18F4620 on ~5cm from the master (~35cm from the other slave).  How do I calculate the pull-up resistance needed on both the SCL as the SDA line?   Does it matter where I place the pull-up (near the master, near the slave, both, in the middle, ...)?

I am trying to drive  with an  microcontroller.  Both devices are listed to work with I2C clock frequencies up to 400 kHz. The two devices are the only devices on the I2C bus.  However, working out the calculations for the pull-up resistor bounds gives some rather odd values.  Calculating the I2C minimum pullup resistor value:  \begin{equation} R_{min} = \frac{Vcc - 0.4}{3mA} = 966.7 \Omega \end{equation}  Looking at the uC datasheets, on page 92 lists the max pin input capacitance of 10pF.  However for the LCD, it has on page 8 something called the Capacitive load represent by each bus line labeled as Cb, and is listed at a max value of 400pF. I'm assuming I should just add this value to the 10pF uC input capacitance, but this seems really high and the calculations are wonky.  For example, when I try computing the maximum pullup resistor value for a 400kHz clock:  \begin{equation} R_{max} = \frac{300ns}{10pF + 400pF} = 731.7 \Omega \end{equation}  Am I misinterpreting the LCD datasheet? Obviously the max allowable pullup resistor value cannot be smaller than the min allowable value.  likewise, if I assume a maximum net bus capacitance of 400pF, I get:  \begin{equation} R_{max} = \frac{300ns}{400pF} = 750 \Omega \end{equation}  still under the maximum allowable value.


Hi guys could you please help me on this question I'm confused.  question: when does the equality hold in the triangle inequality:  my attempt :  $|x + y| \leq |x| + |y|$ this implies   $(|x+y|)^2 = (|x| + |y|)^2 \Rightarrow (x+y)^2 = (|x| + |y|)^2 \Rightarrow x^2 + 2xy + y^2 = |x|^2 + 2|x||y| + |y| ^2 $   since $x^2 = |x|^2$  $\Rightarrow 2xy = 2|x||y| \Rightarrow xy = |x||y| $  and $|x \cdot y| = |x| \cdot |y| \text{ iff } x = y$  therefore $xy = |xy| \Rightarrow xx = |xx| \Rightarrow x^2 = |x|^2 \Rightarrow x=x $  that is what I did so far, I wanted to know if I did this write or if there is a better way in showing this inequality and also what conditions does it hold? I am really confused on that one. This question was on our past quizzes we have a quiz coming up so I wanted to do all the questions and be prepared.  Thank you in advance

How do we show that equality holds in the triangle inequality $|a+b|=|a|+|b|$ iff both numbers are positive, both are negative or one is zero? I already showed that equality holds when one of the three conditions happens.


I have increased my Ubuntu's hard disk size to 40GB. But still I don't see it's increased!   I increased it through VM → Settings → Hard Disk(SCSI) → Utilities → Expand. When I power on and and see in terminal, it shows only 7.7GB Free. I want to install some more size DB servers. Due to this, I am unable to do anything on it.

I've got Ubuntu 10.10 installed to use my whole hard-disk, but would like to use the 130GB of free space I've got to create a new partition and do some development on Unity and Natty.  Can I use gparted to do this?  If so how?


I'm learning C++ right now, but I can't seem to find out how to make an input be accepted whether or not there are any capitals anywhere. For example, if someone input "sAndwiCh" in a case in a switch statement desiring "sandwich," how could I perform the following action by making the program allow the input to be any case of every letter? Thank you.

What is the best way of doing case-insensitive string comparison in C++ without transforming a string to all uppercase or all lowercase?  Please indicate whether the methods are Unicode-friendly and how portable they are.


This short story was in a collection by one author.  It concerns one human in bad condition - hungry, and ill - finding a farm where all the work is being done by machines of varying intelligence. The machines are designed for one task each only and speak in a logical fashion to each other. He is passed up the chain of machines to decide what is to be done with this intruder into their ordered system. It becomes clear that the machines have not seen a human for a long time and they probably have all died.  The last sentence is that the most intelligent machine calls the man "Master" and asks for orders.

Several types of robot work on an automated farm. One by one they realize there have been no communications from the City for some time, and the humans may be gone. They stop working, decide after a quite comical conversation that they will rule the world together (or similar), and head off down the road toward the City full of plans. One small robot falls off a big one and is left to die. At a river they meet a dirty creature drinking the water and they all bow down and cry “Master!”


I need to prove the following statement and I really need some help. I can’t even visualize the image.      ”The external bisectors of the three angles of a scalene triangle met their respective opposite sides at three collinear points.”

Let $ABC$ be a triangle and AD the exterior bisector of $\angle A$, $BE$ the exterior bisector of $\angle B$, $CF$ the exterior bisector of $\angle C$ where $D\in BC$, $E\in AC$, $F\in AB$.  Show that $D,E,F$ collinear.


I had two UK standard visit visa refusals in this month of June (I am a researcher with one year renewable contract visiting a university in London as part of an assignment from my university). The first refusal was due to some miss interpretations of the invitation letter by the Entry clearance officer (the letter was generic and issued to all the visiting researchers of that university). The second refusal was due to a big misinterpretation of my banking statement (I had some reversal entries (refunds on my debit card) and some small cash deposits in the previous 6 months) The officer didn't check the transaction and cash withdrawals prior to these incoming funds in question (the reversal entries and the small cash deposits) and judged that these funds are most-likely not reflecting my financial situation.  The other reason is that I requested a Business visit visa, and I had no business travel history in my passport (fresh passport).  If I can get a Schengen visa, would that help me with my future UK visa applications ?  Another question: In my second UK visa application, the officer sad that I requested 45 days, but I only requested 4 days, Is there any channel or a way to get clarifications ?  How long is the recommended cooling off period in this type of situation. I need to go to the UK in the next year for two weeks to take part of a scientific training in this university ?.   The second refusal letter

Many of the UK visa refusals we see here share a common pattern and the prevailing reasons refer to V 4.2 (a) and (c).    I do understand that, while the applicants may describe very different individual circumstances, there's a consistent pattern and, broadly, fall into specific categories:    Credibility (lifestyle, lack of ties, visit history, lies & omissions) Funding (insufficient funds, provenance of funds, funds parking) Sponsorship (family, friends, employer)   Question: What most commonly triggers a UK visa refusal where V 4.2 (a) and (c) are given as the grounds?  Secondarily: Given that there is a clear pattern, to what extent are these refusals predictable? Does sponsorship make a difference? Is there a set of personal circumstances, however abstract, where a refusal is all but guaranteed? For example, why do those we see here on TSE who sought entry for the PLAB or British Army appear to be refused with a common theme? Is there a uniform shortcoming or is it just discrimination?   PLAB: What is about applications for a visa, for the purpose of sitting the Professional and Linguistic Assessments Board (PLAB) exam, that seem to invite refusals. After all, the test is given so that international medical graduates can show that they qualify to practise medicine in the UK. The first part, PLAB 1, can be taken in centres outside of the UK. However, PLAB 2 can be taken only in the UK. Why can't you can't get a visa just to sit the exam, promising that you'll leave immediately after?    British Army: Since Commonwealth citizens are eligible to apply online to join, even those who don't reside in the UK, why is it so difficult to get a visa just to attend an interview to see whether you are suitable? Even with an invitation from the Army, such visa applications seem to be unsuccessful. Isn't a career in the British Army a valid reason?     Lastly:  After such a refusal, what approaches would increase the chance of a successful application?