GSON throwing null pointer exception when a field is missing in json  ReviewClass:  public class ReviewClass { private String name;  private List<Review> reviews;  public String getName() {     return name; }  public void setName(String name) {     this.name = name; }  public List<Review> getReviews() {     return reviews; }  public void setReviews(List<Review> reviews) {     this.reviews = reviews; } }  class Review { private String name;  public String getName() {     return name; }  public void setName(String name) {     this.name = name; }  }   Main code:  ReviewClass reviewResults = gson.fromJson(reader, ReviewClass.class); System.out.println(reviewResults.getReviews().get(0).getName());   JSON(no review field):   {"itemId":978998,"name":"Palet","salePrice":15.88,"upc":"708431191570","categoryPath":"Toys}   So, the GSON throwing null pointer exception when there is no "reviews" field in json. PLEASE HELP ME.

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?


So i know how to calculate the avg but i dont know how to calculate the min and max value. I'm pretty sure you need to use a for loop but i don't know how to.   public Int32 Average {     get     {         clsSimpleDataConnection Datalayer = new clsSimpleDataConnection();         List<Int32> saleslist = new List<Int32>();         saleslist = Datalayer.LoadIntegerList();         Int32 AnItem;         Int32 Total = 0;         Int32 average;         Int32 itemcount;         itemcount = saleslist.Count;         Int32 index = 0;          while (index < itemcount)         {             AnItem = saleslist[index];             Total = Total + AnItem;             index++;          }             average = Total / itemcount;         return average;       } }   How would i edit this so that it would calculate the min and max?

I'd like something like  int minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);});   Is there a builtin way to do this in .NET?


I've got a problem.   $log = error_log("/r/n $date, $username, $error", 3, "logs/login.txt");   I want a linebreak whenever a new error is send to the log.  but the log outputs:  2013-08-17 13:10:34, asdf, Logingegevens onjuist! /r/n2013-08-17 13:10:41, fffffff, Logingegevens onjuist!    what am i doing wrong??

What's the difference between \n and \r (I know it has something to do with OS), and what's the best way to echo a line break that will work cross platform?  EDIT: In response to Jarod, I'll be using ths to echo a line break in a .txt log file, though I'm sure I'll be using it in the future for things such as echoing HTML makup onto a page.


I have taken text input then converted to a sequence of values and fed it to LSTM model where my loss is not reducing and accuracy is abnormal.  The above image is about training and validation accuracy. Here I have taken 10 epochs but even for 100 epochs or 1000 epochs the graph is similar.  The above image is about training and validation loss, there is no change in it. No reduction in loss. How can I make my model learn. The considered learning rate is 0.05 Model Architecture is model = tf.keras.Sequential([tf.keras.layers.Embedding(vocab_size, embedding_dim),tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(embedding_dim,dropout=0.3)),tf.keras.layers.Dense(embedding_dim, activation='relu'), tf.keras.layers.Dense(2, activation='softmax')])

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


I am learning web scraping using a  created for that purpose and everything is working fine, for example given this HTML: Albert Einstein  I issue the following command and get True: PS C:\Users\user> $HTML -match '.*' True  And I also get True when trying to match text within  tags from this HTML: Quotes to Scrape  Here's the command I used: PS C:\Users\user> $HTML -match '.*' True  However, when trying to match inner text between certain tags from another website and using seemingly similar logic, I get False. The HTML looks like this:                   CertainClientName             And the command I issued: PS C:\Users\user> $HTML -match '.*' False  Given the above mentioned tests which returned True, why my attempt to extract text from "LdapSubMenu" class fails? Does it have something to do with how the elements are nested? Thank you.

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


I'm very new to Postgres so my math could be off here ...  This is my table:  CREATE TABLE audit (     id BIGSERIAL PRIMARY KEY,     content_id VARCHAR (50) NULL,      type VARCHAR (100) NOT NULL,      size bigint NOT NULL,      timestamp1 timestamp NOT NULL DEFAULT NOW(),      timestamp2 timestamp NOT NULL DEFAULT NOW() );   I want to make some estimations on how much space 1 row would occupy. After some reading I've come up with this, is it correct?  1 row = 23 (heaptupleheader) + 1 (padding) + 8 (id) + 50 (content_id) + 6 (padding) + 100 (type) + 4 (padding) + 8 (size) + 8 (timestamp) + 8 (timestamp) = 216 bytes   I also created this same table in my local Postgres DB but the numbers don't seem to match:  INSERT INTO public.audit(content_id, type, size)     VALUES ('aaa', 'bbb', 100);  SELECT pg_size_pretty( pg_total_relation_size('audit') );  -- returns 24 kb  INSERT INTO public.audit(content_id, type, size)     VALUES ('aaaaaaaaaaaaa', 'bbbbbbbbbbbbbb', 100000000000);  SELECT pg_size_pretty( pg_total_relation_size('audit') ); -- still returns 24 kb   Which brings me to think that Postgres reserves a space of 24 kb to start with and as I put in more data it will get incremented by 132 bytes once I go beyond 24 kb? But something inside me says that can't be right.  I want to see how much space 1 row would occupy in Postgres db so I can analyze how much data I can potentially store in it. Maybe I'm missing something very obvious.

I have a PostgreSQL table. select * is very slow whereas select id is nice and quick. I think it may be that the size of the row is very large and it's taking a while to transport, or it may be some other factor. I need all of the fields (or nearly all of them), so selecting just a subset isn't a quick fix. Selecting the fields that I want is still slow. Here's my table schema minus the names: integer                  | not null default nextval('core_page_id_seq'::regclass) character varying(255)   | not null character varying(64)    | not null text                     | default '{}'::text character varying(255)   |  integer                  | not null default 0 text                     | default '{}'::text text                     |  timestamp with time zone |  integer                  |  timestamp with time zone |  integer                  |   The size of the text field may be any size. But still, no more than a few kilobytes in the worst case. Questions  Is there anything about this that screams 'crazy inefficient'? Is there a way to measure page size at the Postgres command-line to help me debug this?


I recently joined a company where nobody knows what's going on with the email server. I'm trying to fix and tidy things but I need to know which version of Exchange we are running. I have access to the Outlook Web App but it doesn't list the version anywhere. It looks like this:    Any idas what version it is?

A server I've recently taken charge of has a copy of Exchange installed.  Add or Remove Programs just shows "Microsoft Exchange".  By clicking on Change/Remove I can see that the version number is 6.5, which  Exchange 2003.  How do I find out if I'm running Standard, Enterprise or something else, though?  Additional facts:   The server is running Windows Server 2003. The version hasn't been documented anywhere and there's nobody I can ask   Thanks!


Sometimes I'm really confused with articles. I'd say 'everything has a meaning' but it seems that for some reason most people tend to say 'everything has meaning' instead. However, I've come across phrases like 'it has a meaning' as well. Hence, I'm not sure which one is more correct. Is it even correct to 'it has a meaning' in any context? And if both versions are correct, what is the difference?

In English, there are lots of expressions built using articles like:   at the station to the cinema play the piano have breakfast (no article) take a bath take a shower   Are there specific rules or tips to help determine whether or not to use an article before the noun? Or do we always need to depend on a dictionary?


Update: To be clear, I've got 3 commands, and I want 1 of the 3 to execute, effectively on loop.  I've got a couple command blocks, each with some commands, and I want them to execute at random intervals.  My strategy so far is to use chickens that wonder in a pen stepping on pressure plates, but they don't move often enough and I'd rather not just resort to duplicting commands:    I've tried a lot of ideas with the chickens, (speed effects, spawning an entity holding seeds), but I think I'll need something better.  Any ideas?

I want to make a mini game in Minecraft were I need a random command generator for 9 commands. I need a random command to give the player a random item. I can't do the command block in the dispenser any more because it will just drop out instead of being placed. What different ways are there for generating randomness in commands, and which one would be best for my use? This question is similar to the one about , but I am specifically attempting to get randomness when using commands - the redstone solutions do not apply here.


I am trying to display and append a string HTML with "<" character on it. But it somehow breaks the line by treating it as HTML tag.  $(this).html.append(' < Click here  with');   How Can I fix this?

I'm trying to write a blog post which includes a code segment inside a <pre> tag. The code segment includes a generic type and uses <> to define that type. This is what the segment looks like:  <pre>     PrimeCalc calc = new PrimeCalc();     Func<int, int> del = calc.GetNextPrime; </pre>   The resulting HTML removes the <> and ends up like this:  PrimeCalc calc = new PrimeCalc(); Func del = calc.GetNextPrime;   How do I escape the <> so they show up in the HTML?


I want to show that the Gaussian function, defined by:  $$f(x) = \frac{1}{\sqrt{2π}} e^{-\frac{1}{2} x^2}$$  is a fixed point of the Fourier transformation $\hat{f}$ (meaning that $\hat{f} = f$), where, for any (integrable) function $f$, $\hat{f}$ is given by:  $$\hat{f}(x) = \frac{1}{\sqrt{2π}} \int_\mathbb{R} f(y) e^{-i x y} d y$$  I'm allowed to use (without proof) that $\int_{-\infty}^\infty f(x)dx = 1$.  Now I want to do this using the means and tools of Complex Analysis. I know that one can solve this by differentiating $f$, which gives a ODE of first order with respect to $f$, and that one can show that $\hat{f}$ also solves this ODE. I'm aware of this solution (and I know that there are other threads where this has been discussed), but I want to do it specifically without using ODE's. (And I haven't found any threads on solving this with Complex Analysis so far.)  I think, one way of doing this is to integrate over a large enough semicircle or rectangle in $\mathbb{C}$ (that has the real line as one of it's edges), for which we could maybe utilize the Residue theorem. (For which we first needed to find an isolated singularity, and then choose the semicircle/rectangle accordingly for it to contain one (but ideally only one) isolated singularity.) Given the integral over the edges of the rectangle, I think we then would need to decompose the path parameterizing the edges of the rectangle in order to get the a formula for the section of the edge that goes through the real numer line.  This is how I would theoretically solve it; but I honestly don't really know how to concretely do all of that. I'm having difficulties deciding if my approach is even the right one, considering $f(y) e^{- i x y} = \frac{1}{e^{-1/2 y^2 + i x y}}$ doesn't seem to have any singularities at all, or am I forgetting something?

I am calculating the Fourier transform of $\exp(-t^2)$ using contour integration.  I am left with the integral $\int_{-\infty}^\infty \exp(i\omega t)\exp(-t^2)$.  Usually I would now use the residue theorem, but I cannot find the singularities. Can someone help me?


Actually i want to create an array of dates and compare it to the today date if it match with the current date then execute test.sh file otherwise exit the loop in bash script. I did like this...  **#!/bin/bash**  cd /home/user1  current_date=$(date +%Y-%m-%d)  array=['2016-03-02','2016-03-010','2016-05-10']  for i in "${array[@]}" do      if [ $now -eq $i ]; then          echo "executing your bash script file"          ./myscript.sh      fi  done   when i execute above script then it gives error like ./sample.sh: line 6: [: 2016-03-02: integer expression expected

I want to create an array of dates and compare it to today's date if it matches then execute test.sh file otherwise exit the loop in bash script. I have this so far:  #!/bin/bash now=$(date +%Y-%m-%d) array=['2016-03-02','2015-01-02'] for i in "${array[@]}" do     if [ $now -eq $i ]; then         bash test.sh     else         echo "error"     fi done   please write the correct way to do this..


I have a file and I modified it then commited and pushed. How can I retrieve its org version in GIT? What should I do cause I want its original version back.

I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version.   I have done a git log along with a git diff to find the revision I need, but just have no idea how to get the file back to its former state in the past.


What is the NBA's average team score from season to season; 2014 season vs 2015 season?

Where can I find the points per game (of both teams) throughout many NBA seasons?  To illustrate my point, what I mean is something like:   2000/01 average points per NBA game: 200; 2001/02 average points per NBA game: 210; 2002/03 average points per NBA game: 205;   so on...


I have recently installed Kubuntu on my MacBook Air, using a USB. This is the first time I am using Kubuntu/Ubuntu/Linux.   After installation, I noticed that the Network Manager was entirely blank and only showed the option for Airplane Mode. I tried to go through some documentation and checked what network card I have installed, and what driver I need. The info I got was:  Chip ID: BCM4360  PCI-ID: 14e4:43a0  Kernel driver in use: bcma-pci-bridge  This meant that I would have to install the Broadcom STA Wireless Driver. However, I also found out that I do not have dkms installed on my Kubuntu. How should I proceed to install the drivers I need? (Can somebody tell me what to do step by step?)

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


in my thesis i had a significant interaction effect between two variables and their main effect is insignificant. A variable had a p-value of 0.636 B variable had a p-value of 0.219 A*B had a p-value of 0.022 A is employee training practices, B is Autonomy, and the response is explicit knowledge creation. my thesis is about evaluation of the impact of quality management practices on knowledge creation in a public corporation in Jordan.  how can i explain this result ???

Let's say there's one DV (Y) and three IVs (X1, X2, X3), and among IVs, X1 is a dummy variable. In the regression model without interaction terms, the results can be represented like this:  Y ~ X1 + X2 + X3  X1 : non-significant X2 : significant X3 : significant   In this case, is it meaningful to check some interaction terms (e.g. X1 $\cdot$ X2 or X1 $\cdot$ X3)? At first I thought I don't have to because the main effect of X1 indicates non-significance. But I'm afraid I'm missing something important.


I found the above link which helped with my question but the above solution does not work in my situation.  is there a way to restart a pc if i am not able to ping an ip address and i recieve a message "destination host unreachable?"   when i run the batch file  ping 192.168.1.1 IF ERRORLEVEL 1 SHUTDOWN -R -T 00   everything works correctly if there is no internet activity. but when i disconnect my network and run the batch file i receive a message of "reply from x.x.x.x: desnation host unreachable. and the batch file does not work.  is there a way to make the batchfile command work with i recieve a message of "destination host unreachable"?

I have a media server (Windows 8) located in a very inconvenient part of my house. Occasionally I will have to reset my router or it will reset itself. The issue is the PC loses connectivity for some reason, and I am forced to walk outside, around the house, into the basement, over a bunch of toys and weights and boxes, to push a button to reboot it.  I would love to have it check itself every 5-10 minutes and auto reboot if it is unable to ping a given address/IP.  Any ideas how to accomplish this?


A week ago, on July the 16th,2019,  I have sent my initial PhD proposal to a prospective supervisor in New Zealand who I have previously made direct contact with, after 4 days I sent another email to make sure he received my documents, but there was no response. I just want to make sure that he can open my file without difficulty. What am I supposed to do now?

I have applied to a professor from another university - and from another country, in case that is relevant - about doing my undergraduate thesis under him.  He said he liked my profile and asked me for some documents (transcripts, recommendation letters, etc). After I sent him these documents, he stopped responding.  Before this I used to keep him updated about the process (when I will get my transcripts, when my recommenders will send him the letters, etc) and during this time he would always acknowledge the receipt of my mails. After my recommenders sent him their letters, he stopped responding. I know how this might look, but I have no reason to suspect that my recommenders might have anything bad to say about me. I have used their recommendations to get a scholarship previously.  This hiatus in communication took place in December last year, so this might very well be because he was on leave during this period. I verified that his university began its semester last week and mailed him, again to no response.  How do I interpret his silence? There is of course no certain answer to this. So the more important question is, should I keep politely following up - say, dropping him a mail every week or so asking if he's made a decision yet?  Note:  on Academia.SE has a comment which says that "treat a non-response as the (reasonably expected) negative response" about emailing a professor at a foreign university. However, I don't think that applies in my case as the professor had initially expressed his interest in hiring me, so I thought he would let me know if he had later changed his mind.


In my application are 10 free levels, everyone can play them without doing in-app purchases. But if you want more levels, then you need to buy once a non-consumable product in the application. After you purchased it, you will have access to all levels that are currently available and to all levels that will be released during the next weeks.  But how can I know if someone bought the non-consumable product? Is it necessary to send at every reboot of the application a request to the Apple App Store to check if the current Apple ID has bought the product?

I'm making a game using unity. In the game I've a purchasable product "remove ads". Where should I store user purchase data? If I use player prefs data will restore after a reset or uninstall.


I want to rename my file with its substring.Because unfortunately renamed all the files in my server.  Now I want to remove suffix( .gz) of all the files including files in subdirectories also.  Below is avaliable files with extra .gz.  # pwd /usr/apache-tomcat-6.0.36/webapps/rdnqa/WEB-INF/classes # ls META-INF                           jbpm.hibernate.cfg.xml.gz          jbpm.jpdl.cfg.xml.gz               jpdl-4.0.xsd.gz config                             jbpm.hibernate.cfg.xml.mirror.gz   jbpm.mail.templates.xml.gz         jpdl-4.2.xsd.gz ecnet                              jbpm.hibernate.cfg.xml.staging.gz  jbpm.repository.hbm.xml.gz         jpdl-4.3.xsd.gz hibernate.queries.hbm.xml.gz       jbpm.history.hbm.xml.gz            jbpm.task.hbm.xml.gz               jpdl-4.4.xsd.gz jbpm.businesscalendar.cfg.xml.gz   jbpm.identity.cfg.xml.gz           jbpm.task.lifecycle.xml.gz         labels jbpm.cfg.xml.gz                    jbpm.identity.hbm.xml.gz           jbpm.tx.hibernate.cfg.xml.gz       log4j.properties.gz jbpm.console.cfg.xml.gz            jbpm.jboss.idm.cfg.xml.gz          jbpm.tx.jta.cfg.xml.gz             nohup.out.gz jbpm.default.cfg.xml.gz            jbpm.jbossremote.cfg.xml.gz        jbpm.tx.spring.cfg.xml.gz jbpm.default.scriptmanager.xml.gz  jbpm.jobexecutor.cfg.xml.gz        jbpm.variable.types.xml.gz jbpm.execution.hbm.xml.gz          jbpm.jpdl.bindings.xml.gz          jbpm.wire.bindings.xml.gz # cd ecnet # ls core  jms   rd    util # cd core # ls util # cd util # pwd /usr/apache-tomcat-6.0.36/webapps/rdnqa/WEB-INF/classes/ecnet/core/util # ls GridService.class.gz               MDPDFXMLParser.class.gz            PDFColumn.class.gz                 PDFXMLParser.class.gz GridService.java.gz                MDPDFXMLParser.java.gz             PDFColumn.java.gz                  PDFXMLParser.java.gz MDExcelXmlParser.class.gz          MasterDetailsPrintWriter.class.gz  PDFRow.class.gz                    RGBColor.class.gz MDExcelXmlParser.java.gz           MasterDetailsPrintWriter.java.gz   PDFRow.java.gz                     RGBColor.java.gz MDExcleWriter.class.gz             PDFCell.class.gz                   PDFWriter.class.gz                 xml2excel MDExcleWriter.java.gz              PDFCell.java.gz                    PDFWriter.java.gz #

I'm trying to find certain files with the name "stringx" and replace the name (but not the extension) with "stringy". So basically for stringx.txt and stingx.cs, I'd want stringy.txt and stringy.cs. I've attempted to test my rename command regex using following, but it returns no results:  rename -n 'stringx./s/\*$stringy./\/' stringx.*   I'm running csh under Centos. I can see that my regex is probably not correct, but I can't see any results to verify this. I can see that there are files that are named stringx. with the following:  find ./ -name 'stringx.*'


Yesterday, I update the software in Ubuntu 14.04 LTS. After that, the desktop freezes after 10 minutes.  I am not using any Proprietary Graphics drivers. For me to analyze this issue, I would like to know where I have to start and what log files I need to look for pin pointing the problem.

All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when...   just one program stops responding? nothing at all responds to mouse clicks or key presses? the mouse stops moving entirely? I have an    In what order should I try various solutions before deciding to pull the power plug?  What should I do when starting up Ubuntu fails?  Is there a diagnostic procedure I can follow?


When the displayAll() button is pressed I receive a NullPointer at both the append method in the first and when the first method is called in the second. the code should cycle through the array and print each name and mark to the text field. when done it should show the average mark. Because of the error the  average is not outputted and so I need some help to understand why an error is occurring.  private void printStudentNameAndMark() {      displayTextArea.append(String.format("%-29s%-17s%9s\n",markArray[currentStudent].getStudentName(), markArray[currentStudent].getStudentMark(), markArray[currentStudent].getGrade(markArray[currentStudent].getStudentMark())));  }   private void displayAll() {     displayHeading();      for(currentStudent = 0; currentStudent < MAX_STUDENTS; currentStudent ++) {         printStudentNameAndMark();         average += markArray[currentStudent].getStudentMark();     }     appendLine();     displayTextArea.append(String.format("%-29s%2d\n", "Average mark: ", average));      // TODO -- complete error message code }   Here's the error I receive  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException     at Assignment2.MarksGUI.printStudentNameAndMark(MarksGUI.java:149)     at Assignment2.MarksGUI.displayAll(MarksGUI.java:167)     at Assignment2.MarksGUI.actionPerformed(MarksGUI.java:106)     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)     at java.awt.Component.processMouseEvent(Unknown Source)     at javax.swing.JComponent.processMouseEvent(Unknown Source)     at java.awt.Component.processEvent(Unknown Source)     at java.awt.Container.processEvent(Unknown Source)     at java.awt.Component.dispatchEventImpl(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Window.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)     at java.awt.EventQueue.access$500(Unknown Source)     at java.awt.EventQueue$3.run(Unknown Source)     at java.awt.EventQueue$3.run(Unknown Source)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.awt.EventQueue$4.run(Unknown Source)     at java.awt.EventQueue$4.run(Unknown Source)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.awt.EventQueue.dispatchEvent(Unknown Source)     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.run(Unknown Source)

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 an HP EliteBook 840 G2 It looks like this:  Here are the specs: CPU: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz. Its maximum is 3.10GHz GPU: Intel(R) HD Graphics 5500 RAM: 8.0 GB DDR3 I want to run Minecraft shaders because I like the look of it. But I am not sure if it will run on my PC because it is getting old and fragile. Also, I am not sure if this hardware would run Minecraft shaders whether new or not. Can someone please let me know if this laptop can run Minecraft shaders

Is there a service that I can use to check if my machine will be able to run a certain game?


Like most new Firefox features, the only thing I want to do with them is turn them off.  Firefox 42 or 43 implemented this new search/preview/magnifying glass thing, and trying to search The Internets for a way to turn it off has not been fruitful thus far.  , and it's from 2010.  The feature I'm referring to is very new.  Is there a way to turn this off?  Usually there's a setting in about:config that disable the new features that they roll out.

With the new update, the first suggested link is just domain. In older versions, the first suggested link was the page I visited the most and I got used to this great feature.  Is it possible to remove the new domain suggestion, for example "Visit ebay.co.uk"?  See image attached


Is there a way to do this? I was thinking it could be done with streams but I'm not super experienced with them and would like some help regarding that. For example: If the hashmap is currently like: "A" : 5 "B" : 2 "C" : 4 You then return ["A", "C", "B"].

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way?


Is it possible to do a variation of a root data transformation that is below x^(1/2)? Are there rules against this - for example: do they need to be whole numbers? Can anyone provide literature on this?  Context of transformation: Transforming to exhibit a normal distribution before applying a specific statistical test.  Example: x^(1/1.5)

The Box-Cox transformation transforms our data into a normal distribution.  How is that even a proper technique? What if our data didn't come from a normal distribution? How could someone just blindly apply the Box-Cox transformation?  To re-phrase: why apply the Box-Cox transformation if our data isn't normally distributed?  Is the Box-Cox transformation used when our data SHOULD be normally distributed, but isn't?


I'm using a Map object in my class that I've synchronized with Collections.synchronizedMap() for a LinkedHashMap like so:  private GameObjectManager(){         gameObjects = Collections.synchronizedMap(new LinkedHashMap<String, GameObject>()); }   I'm getting a concurrent modification exception on the third line of this function:  public static void frameElapsed(float msElapsed){     if(!INSTANCE.gameObjects.isEmpty()){         synchronized(INSTANCE.gameObjects){             for(GameObject object : INSTANCE.gameObjects.values()){...}         }     } }   All other locations where I am iterating through the Map, I am synchronizing on the map per the docs.  There are other functions in my class that use this Map (the synchronized one!) and they put() and remove() objects, but this shouldn't matter though. What am I doing wrong? Please ask for more code, not sure what else to put.  Oh, and the log message:  08-20 15:55:30.109: E/AndroidRuntime(14482): FATAL EXCEPTION: GLThread 1748 08-20 15:55:30.109: E/AndroidRuntime(14482): java.util.ConcurrentModificationException 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:350) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     java.util.LinkedHashMap$ValueIterator.next(LinkedHashMap.java:374) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     package.GameObjectManager.frameElapsed(GameObjectManager.java:247) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     package.GamekitInterface.render(Native Method) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     package.GamekitInterface.renderFrame(GamekitInterface.java:332) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     com.qualcomm.QCARSamples.ImageTargets.GameEngineInterface.onDrawFrame(GameEngineInterface.java:107) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516) 08-20 15:55:30.109: E/AndroidRuntime(14482):    at     android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

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


how to move file from on folder to another folder as a different user.  I am general user I don't have write access, hence I cant write or modify or paste any file in specific folder (C:\test).  If I login as admin user I can write or modify or paste the files in (C:\test)  I wanted to write python code which can do this activity.  I tried, shutil but not help following is my code:  shutil.move(source+f, dest1)   Could someone help to paste file from one folder to another folder as a different user?

I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run cmd.exe "as administator" and then run my script, it works fine.  This makes sense since User Account Control (UAC) normally prevents many file system actions.  Is there a way I can, from within a Python script, invoke a UAC elevation request (those dialogs that say something like "such and such app needs admin access, is this OK?")  If that's not possible, is there a way my script can at least detect that it is not elevated so it can fail gracefully?


In a particular cell of a column, I would like to have a timestamp of the last date any cell of that column was modified. Specifically: G31 would show a date of last modification on any cell of the G column.  My question is quite similar to this one, but I can't seem to apply it to my situation :   I have tried this :    function onEdit()  { var DEVIS_COMPLET_2018 = "MySheet";  var s = SpreadsheetApp.getActiveSheet();  if (s.getName() !== DEVIS_COMPLET_2018) return;  var r = s.getActiveCell();  if( r.getColumn() != G ) { //checks the column  var row = r.getRow();  var time = new Date();  time = Utilities.formatDate(time, "GMT-08:00", "MM/DD/yy"); SpreadsheetApp.getActiveSheet().getRange('G31').setValue(time); }; };    I don't get any error message but nothing happens.   I have tried enclosing G, still no luck :  function onEdit() { var DEVIS_COMPLET_2018 = "MySheet"; var s = SpreadsheetApp.getActiveSheet(); if (s.getName() !== DEVIS_COMPLET_2018) return; var r = s.getActiveCell(); if( r.getColumn() != "G" ) { //checks the column var row = r.getRow(); var time = new Date(); time = Utilities.formatDate(time, "GMT-08:00", "MM/DD/YY"); SpreadsheetApp.getActiveSheet().getRange("G31").setValue(time); }; };

Trying to figure out a way to have column two auto-update to show a timestamp of the last update. I realize the doc shows a timestamp of the last modification, but we have a lot of clients accessing and adjusting the doc at the same time. So this request was put in. I'll admit I have not done coding, so this is beyond me.  Myanda had posted something that seemed along the right path, but we are not sure how to implement it for our needs:


It seems that both 49.9Ω and 50Ω resistors are a thing:     Given that they're typically 1% tolerance, why have both? In particular, why even bother with 49.9Ω?

We often see component values of 4.7K Ohm, 470uF, or 0.47uH.  For example, digikey has millions of 4.7uF ceramic capacitors, and not a single 4.8uF or 4.6uF and only 1 listed for 4.5uF (specialty product).  What's so special about the value 4.7 that sets so far apart from say 4.6 or 4.8 or even 4.4 since in the 3.. series we usually 3.3,33, etc.  How did these numbers come to be so entrenched?  Perhaps a historical reason?


I heard that bigger pixel size of sensor will get better quality, especilly noise in low light condition. if I set image size to a smaller resolution, will it affect the pixel size and improve image quality? (My camera is Sony A6000, APS-C sensor)

Does taking a picture with 8 megapixel resolution with my Canon IXUS with a 1/2.3" sensor and 12M max resolution provides the same or worse image quality (particular, noise) as if the picture was taken by another camera of the same sensor size and but with 8 megapixels maximum resolution?


How can I wrote this unseen (for me) arrows in LaTeX?

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


When light originating from a medium of lower refractive index reflects off a surface of higher refractive index, why does the phase shift by 180 degrees? Stokes relations show that the reflection coefficients at the surface are equal but of opposite signs depending on direction (i.e. from lower to higher refractive index versus higher to lower); but this relation does not say exactly which one is shifted by 180 degrees. Can someone please provide an explanation for this. I have researched the internet with no success.

Can anyone please provide an intuitive explanation of why phase shift of 180 degrees occurs in the Electric Field of a EM wave, when reflected from an optically denser medium?  I tried searching for it but everywhere the result is just used.The reason behind it is never specified.


One thing that I have been doing that may hurt me is that when an answer gets down votes I delete the answer and rewrite it.   I don't just rewrite it because I have found that the down votes prejudice subsequent reviewers against my answer. I usually end up with a good answer that gets upvotes or at least remains at zero.   Although the official position is to rewrite the question or answer I have found that almost never works. This seems to me that my idea of bias against down voted questions is justified. How can this best be resolved?

Let's say I'm trying to answer a lot of questions just to up my reputation (even if I generally don't know what I'm talking about).  Then, whenever I get downvoted, I just delete my answer so that nobody sees that I've posted stupid answers, and so I don't lose reputation points.   Is this frowned upon? Do I lose reputation points on downvoted answers if I delete them?


After reading that  I realise I need to install supervisor.  sudo apt-get install supervisor tells me:   E: Unable to locate package supervisor   sudo apt-cache search supervisor gives nothing.  Also when I look at other  it seems that it is installed by default in Ubuntu 16.04.  I am using Ubuntu 16.04 LTS.  Why can't I find this package? How can I install it?  I also looked at  but I would prefer to use the distribution package solution.

When I try to install any package through the command line, I get an error.   $ sudo apt-get install <package> Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package <package>   Can anyone help me on this?


$myAry = array();  // I want to return the array's name.  // something like echo $myAry.name;  // Should print "$myAry".   Thanks,

Say i have this PHP code:  $FooBar = "a string";   i then need a function like this:  print_var_name($FooBar);   which prints:  FooBar   Any Ideas how to achieve this? Is this even possible in PHP?


Should the following sentences be hyphenated? I mock cried into his shoulder. vs. I mock-cried into his shoulder.  He smiled at me with his old man charm. vs. He smiled at me with his old man-charm.

For example, "file system" and "related". Is it "file system-related"? It will appear as if it is a compound of "file" and "system-related", won't it?


I have an data object in a state, like so:  this.state = {         data: {             newsData: [],             eventData: [],         },     }   How can I get the number of properties defined in the state data? data.length doesn't work since it's not an array.

What's the fastest way to count the number of keys/properties of an object?  It it possible to do this without iterating over the object?  i.e. without doing  var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++;   (Firefox did provide a magic __count__ property, but this was removed somewhere around version 4.)


I have been booting in to Ubuntu 16.04 from the bios successfully that is until the windows 10 fall creator updates now prevents me doing so. My BIOS mode is UEFI and my Boot options are as follows:  Boot Option Menu  OS boot Manager  Ubuntu <TOSHIBA MQ01ABF050>  ubuntu <TOSHIBA MQ01ABF050>  Boot From EFI File   Selecting the first Ubuntu in the BIOS shows the following error msg and opens Windows which is not what I want. Selecting the second ubuntu just opens Windows. Please note this error message was only viewable for a second at least and disappeared so I took a video and copied details down.  Malformed binary after Attribute Certificate Table datasize: ? SumOfBytesHashed ? SecDir->Size: hashsize: ? SecDir->VirtualAddress : 0x00000068 Failed to loadimage : Invalid Parameter start_image() returned invalid Parameter   Windows works fine in normal startup.   I have read many posts/answers such as this one  but am really not sure what I should do for my particular system.  This is my system partition after windows updates.   This my UEFI Boot order in BIOS system configuration.  UEFI Boot Order OS boot Manager Internal CD/DVD ROM Drive USB Diskette on Key/USB Hard Disk USB CD/DVD ROM Drive ! Network Adapter   I tried re-ordering with Secure Boot Disabled but no luck.  I do understand I may have to either reinstall Grub and Ubuntu but some professional advice would be greatly appreciated. Thank you.

I've just upgraded to Windows 10 from Windows 8.1 on my partitioned laptop that has Ubuntu 14.04 installed. Grub no longer appeared on boot so I ran boot-repair from an Ubuntu liveUSB. This didn't seem to have any effect. I've checked and secure boot is still disabled. Log from boot-repair:  So what's next?  Update: I've attempted to use chroot to update grub from my Ubuntu partition. update-grub runs successfully finding both linux and windows boot manager but the process still doesn't have any effect. grub-install complains that it cannot find EFI directory (but I have mounted everything correctly).  Update2: Just discovered that running efibootmgr after chroot into ubuntu shows ubuntu as not being in the boot order at all. I manually changed the order and rebooted to discover that the bootorder was reset. I run in windows: bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi But this has no effect either even after reporting 'Operation Successful'.


Is there any way with dconf to export a file with only the customizations I've made?

The dconf Editor indicate the keys whose values have been altered by the user by changing the key's font to bold as shown in the snapshot.    So I wonder if there is a way to dump all the keys (including their schema) which have been modified manually by user or changed to something other than the default? ..that would prove very helpful to solve many desktop environment issues, or at least for me :)


Which one is the grammatically correct sentence? 1) watch the television. 2) watch television.

Example with :     That, I think, is the most likely circumstance for Putin's departure. It's not that he'll lose an election—it's that a bunch of men in gray suits are going to file into his office and say, "Vladimir Vladimirovich, it's time for you to do your last service to the state, and that's to retire."   Or he may be off at his dacha and see on the television that he's just stepped down for reasons of ill health. And he'll pick up his red phone, and find that the people answering it will no longer take orders from him.   What do you think the difference would be if we got rid of the article? Why not say on television instead? What's the nuance?


In Star Wars, like in star trek, planets tend to have only one climate zone and only one location, where you can find all people you are looking for, just by knowing they are on this planet. And all spacefaring people of the whole galaxy (at least all smugglers and other criminals) seem to know each other by name and by ship.  Some of this could be explained if indeed the spacefaring folk are low in numbers, and most planets actually have have only one location (at least only one space port, where space folk will meet) where most of all people are, and if most planets have only a low population. It would also explain why the space battles on screen have only a low number of ships involved (30 X-Wing in A New Hope).  But in other questions I read that the galaxy far far away consists of millions of inhabited planets with billions of people and the empire has millions of ships. This seems to contradict everything I saw in the movies.  So what in canon tells us how many planets, places and people are in the galaxy far far away and how are the "the galaxy is a small place" observations (I know it's a trope) explained in universe?  (And yes, I know this would not explain the "Go to Dabobah and meet Yoda". Where on Dagobah exactly? Oh, I crash landed on Dagobah in a random location. I will look for Yoda. Let us walk in this direction and see if we can find him.)  EDIT:  Ok. So let us try to approximate an answer by dividing into subquestions:   What in canon tells us that there are indeed more than a few 100 planets (preferable on screen) and a few hundred races? (The only thing I can come up with is C3PO knowing 6.000.000 languages, but I think this is more to make him look elaborate than to establish millions of planets and races). If there are millions of planets, races and billions or trillions of ships, how can the "small world" impressions be rectified? What in Canon tells us on the opposite that there are only a few hundred planets and races?   To 3. I have a few Points:  The smuggler, princess and farm boy seem to know most of the planets, races, technology, ship and vehicle types, weapons, etc. When a planet is mentioned, it is done in a way that the speaker assumes that the listeners know it. When Han talks about "Lando" Leia seems to ask in a surprised and wondering tone "Where is the Lando System?" so she seems surprised that there is a System she does not know. Han "wonders" that Owi Wan and Luke have never heard about the falcon. Of course it is exagerated a lot, but it implies, that it is possible that there is a ship the whole galaxy has heard about. Hints that there are not millions of different technologies, models and types are: Leia able to do repairs an the falcon, Leia and Luke able to ride the speeders on endor, Luke able to use the weapons of the falcon and many more (I think).

I have been searching around the web for approximate numbers of sentients in the Galaxy. I found the following pages: ,  but the problem is that they do not even give estimates of the number of sentient individuals in the Galaxy.  I am unaware of any canon where the numbers are estimated except in the trillions. I am looking for a more exact number (e.g. 900 trillion). I'm especially curious because of the mention of hundreds of trillions of dead sentients in the Yuuzhan Vong war and similar discreet statements.  How many sentients are there in the Star Wars Universe?


I have to change my computer but I want to preserve my OS as it is now. Which is the best solution to migrate my entire OS to the new computer? I can use TimeShift, but which compatibility problems or driver problems could I encounter?

I use ubuntu to deal with daily job. Now I buy a new laptop, and I want to migrate my whole system(programs, packages, data, settings, etc) to the new machine.  I know I can copy my home folder to new machine and I will get (almost) all data and settings. But is there a safe way to copy the whole system? Or it's a bad idea?


I have the following table, In the present table we have data inserted manually like shown below but now I want to insert latest cola values into table. create table tbTest (     cola bigserial not null primary key,     colb varchar(10) );  insert into tbTest(cola,colb) values(1,'A'); insert into tbTest(cola,colb) values(2,'B'); insert into tbTest(cola,colb) values(3,'C'); insert into tbTest(cola,colb) values(4,'D'); insert into tbTest(cola,colb) values(5,'E'); insert into tbTest(cola,colb) values(6,'F');  Now I want insert only column colb values and let serial column calculate next value by self: Try 1: insert into tbTest(colb) values('G')  Error: SQL Error [23505]: ERROR: duplicate key value violates unique constraint "tbtest_pkey" Detail: Key (cola)=(1) already exists. Try 2: insert into tbTest(cola,colb) values(nextval('tbtest_cola_seq'),'G')  Error: SQL Error [23505]: ERROR: duplicate key value violates unique constraint "tbtest_pkey" Detail: Key (cola)=(2) already exists. Try 3: insert into tbTest(cola,colb) values(currval('tbtest_cola_seq')+1,'G');  Error: SQL Error [23505]: ERROR: duplicate key value violates unique constraint "tbtest_pkey" Detail: Key (cola)=(3) already exists.

I ran into the problem that my primary key sequence is not in sync with my table rows.   That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.  It seems to be caused by import/restores not maintaining the sequence properly.


I have a development db that's running on sql 2014 in 2012 compatibility that I'm having an issue with trying to shrink the log file.    The mdf is 60+gb and the log is 80+gb but since it's dev like to shrink this down.    I've tried shrinking the log after backing up the db from both the gui and command line but doesn't work.  I switched the db to simple recovery model, backing up and trying to shrink multiple times but still nothing. I've also tried dbcc shrinkfile to either truncate the file or set it to a specific size but nothing..  when I run dbcc loginfo I do see entries with the status '2' but backing up the db/log in various attempts doesn't seem clear this out like normal.    Since its dev I even tried deattaching and reattaching without the log and it throws an error, if I try to create the db (that's still unattached) using 'for attach' or 'for attach_rebuild_log' it will either fail or create the log file with the same size and issues as before.   I checked the log_reuse_wiat_desc and it shows 'XTP_CHECKPOINT' which I believe is an in memory setting so wondering if the developer was testing any in memory objects if it could have caused this issue?  Sure appreciate any thoughts on this!  again since it's a dev db, that's backed up, its not a show stopping issue but like to figure this out in case it happens in prod.  Thanks, Jeff

I have a question about XTP_CHECKPOINT.  I'm using SQL Server 2014. I have a database that is in SIMPLE recovery model mode. It is also being replicated.  There are no open transactions. I've run DBCC OPENTRAN and it returns:     "No active open transactions."   But I keep getting this message whenever I try to create or drop a table or delete data: (I've replaced my actual database name with the word database_name)     "The transaction log for database 'database_name' is full due to 'XTP_CHECKPOINT'"     Does anyone know why this might be happening, and, more importantly, how can I make it stop?  And yes, the database really is in SIMPLE recovery model mode. i.e. The transaction log should truncate automatically.  Incidentally, another database that I have in full recovery mode did the same thing, started returning the same error:     The transaction log for database 'database_name' is full due to 'XTP_CHECKPOINT'   I tried to change the log growth settings to unlimited growth, but it wouldn't let me, returning the same error.  I can reproduce the problem without any XTP stuff at all, except for just the filegroup. Here's how:


When I hit 2000+ reputation, I can no longer suggest edits.  It seems to be the general view that forced edits are strictly better (for the editor) than suggested edits, and as such once you can do it, you no longer need to suggest.  I disagree. I've had times where I've wanted to make a significant change to a question, but would rather run the edit by the asker first in case I was actually out to lunch on what the asker wanted.  What would be the downside of adding a "Make this edit a suggestion" button when making an edit? I don't care about the 2 rep either, just the ability to suggest.

I have now enough reputation points on Stack Overflow to edit every post directly. But sometimes (especially if this is about a field where I'm not savvy, or when I try to edit a question title without having understood the question itself) I might be not totally sure about whether my edit really is an improvement.  For now, I have these options:   Do the edit anyway, hope that someone else will catch it if it is wrong Don't do the edit, and hope that someone else will see this post and edit it in the right way Let a comment and hope that someone will see it (either after editing or instead of it). Flag the post for moderator attention (but will the moderators know it better?) Search the right chat room to find someone who knows more about the topic.   All these are not really optimal, I think.  I would like to have a check box     [_] Submit this edit for approval   which, when checked, would submit the edit into the usual edit approval queue. Then I would get at least one or two other pairs of eyes looking over my edit, and maybe even improving it.  (I don't really care about the +2 reputation for the edit - I think it should be without any reputation difference here.)  There's an  for nearly giving everyone the ability to suggest edits that the post owner can approve, but I'm simply interested in being able to insert them into the general edit queue where anyone can approve them.  Actually, I could do this right now by having a low-reputation sock puppet (or a totally anonymous edit), but I think this is not the intended use for sock puppets, is it? Also, I would like to be able to get feedback for my edit.


I sometimes see the protected questions not well answered by 20 rep user. So I thought it may be better to increase required rep to answer protected question. By this, we can:   increase the answers level decrease the number of answers posted for a question encourage OP users to earn rep for answering some questions

I have noticed that questions are sometimes protected to prevent "thanks!", "me too!", or spam answers by new users. In order to answer those questions, you must have earned more than 10 reputation on the site.  But what if a new user has managed to gain more than 10 reputation in a single day, and then tried to post this kind of answer?  Shouldn't we make the rep requirement for answering protected questions even higher? Say 50 rep?


I've seen the question in , and I found that they used final in the constructor parameter, I think it's unnecessary, anyone can tell me why? thanks..

I can't understand where the final keyword is really handy when it is used on method parameters.    If we exclude the usage of anonymous classes, readability and intent declaration then it seems almost worthless to me.   Enforcing that some data remains constant is not as strong as it seems.    If the parameter is a primitive then it will have no effect since the parameter is passed to the method as a value and changing it will have no effect outside the scope.  If we are passing a parameter by reference, then the reference itself is a local variable and if the reference is changed from within the method, that would not have any effect from outside of the method scope.    Consider the simple test example below. This test passes although the method changed the value of the reference given to it, it has no effect.  public void testNullify() {     Collection<Integer> c  = new ArrayList<Integer>();           nullify(c);     assertNotNull(c);            final Collection<Integer> c1 = c;     assertTrue(c1.equals(c));     change(c);     assertTrue(c1.equals(c)); }  private void change(Collection<Integer> c) {     c = new ArrayList<Integer>(); }  public void nullify(Collection<?> t) {     t = null; }


I have to prove the following statement. Let$ f: X\to Y$  be a function and A and B subsets of X. Show:   1) $f(A\cap  B) \subset f(A) \cap f(B)$  2) If f is injective, then $f(A\cap B) = f(A) \cap f(B)$  To begin with 1, I started as follows:  y $\in$ f(A$\cap$B) $\iff$ $\exists$x $\in$ A$\cap$B: y = f(x) $\iff$ $\exists$x $\in$ X: x $\in$ A$\cap$B $\land$ y = f(x)  My problem then is, if I write this out like this, I have f(A$\cap$B) = f(A) $\cap$ f(B), which is not correct. Is it maybe possible that my starting point is not good for this statement? Thank you for your help.

Suppose $A$ and $B$ are subsets of a topological space and $f$ is any function from $X$ to another topological space $Y$. Do we have always $f(A \cap B) = f(A) \cap f(B)$?  Thanks in advance


Only after reading it carefully several times did I begin to make sense of the poem. Only after reading it carefully several times I began making sense of the poem.   I know that the first one is correct but I do not understand why.  Other than sounding strange, why is the second one incorrect?  Thank you very much!

I have seen this construction quite often:      Online ads have been around since the dawn of the Web, but only in   recent years have they become the rapturous life dream of Silicon   Valley.   What is the rule there?. When your sentence doesn't start with pronoun + verb, invert them as verb + pronoun?. I know it sounds awkward but is it possible (grammatically correct) to use something similar to:      Online ads have been around since the dawn of the Web, but only in   recent years they have become...   And in any case, does this only work with have (or has)? Maybe it works fine with 'had' but I can't think of an example right now.


android@android:~/Downloads$ sudo dpkg -i wps-office_10.1.0.5707_a21_amd64.deb    [sudo] password for android:  Selecting previously unselected package wps-office. (Reading database ... 134330 files and directories currently installed.) Preparing to unpack wps-office_10.1.0.5707_a21_amd64.deb ... Unpacking wps-office (10.1.0.5707~a21) ... dpkg: dependency problems prevent configuration of wps-office:  wps-office depends on libpng12-0; however:   Package libpng12-0 is not installed.  dpkg: error processing package wps-office (--install):  dependency problems - leaving unconfigured Processing triggers for gnome-menus (3.13.3-6ubuntu5) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for shared-mime-info (1.8-1) ... Processing triggers for hicolor-icon-theme (0.17-1) ... Errors were encountered while processing:  wps-office android@android:~/Downloads$ sudo apt install libpng16-16 Reading package lists... Done Building dependency tree        Reading state information... Done libpng16-16 is already the newest version (1.6.34-1). You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies:  wps-office : Depends: libpng12-0 but it is not installable               Recommends: ttf-mscorefonts-installer but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).    android@android:~/Downloads$ sudo apt install -f    Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED:   wps-office 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 386 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 136822 files and directories currently installed.) Removing wps-office (10.1.0.5707~a21) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3) ... Processing triggers for shared-mime-info (1.8-1) ... Processing triggers for gnome-menus (3.13.3-6ubuntu5) ... Processing triggers for hicolor-icon-theme (0.17-1) ...    android@android:~/Downloads$ sudo apt install libpng16-16    Reading package lists... Done Building dependency tree        Reading state information... Done libpng16-16 is already the newest version (1.6.34-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.    android@android:~/Downloads$ apt search libpng12-0    Sorting... Done Full Text Search... Done    android@android:~/Downloads$

I tried to install WPS Office on my laptop (ubuntu 16.10 Gnome, 64 bit) with  Gdebi installer but it said   Dependency is not satisfiable: libpng12-0   Then I tried to open this library as follows  sudo apt-get install libpng12-0   But I encountered an error:  Reading package lists... Done Building dependency tree        Reading state information... Done Package libpng12-0 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'libpng12-0' has no installation candidate   Can anyone help? Thanks a lot


I just want to import multiple obj files into blender:  The addon by poor from  on blenderartists does not seem to work for 2.9 anymore. Any help?

Is it possible to batch import Wavefront .obj to blender? I'm working on 2.69. If I select multiple .obj files, only one gets imported. Also if I hit A on file selection window to select all files (.obj and .mtl) I get an error, nothing gets imported. I have to import several hundreds of .obj into the blender file, is this possible?


If someone is about to finish his or her lunch, and we want to know, can we ask him or her:      Are you done?

I was just wondering, how can we differentiate "are you done?" and "have you done?", and what is the appropriate way to use each?


What is the correct way to apply the prefix "non-" to negate a (maybe dashed) compound adjective?  Suppose that we want to negate a generic compound adjective "adjective1 adjective2". In this case:   "non-adjective1 adjective2" looks a bit ambiguous since the scope of the prefix "non-" is at least unclear (in fact seems to affect only adjective1). "non-adjective1-adjective2" also looks unclear to me since the dashes seem to act at the same level, which is not true (yes, you can claim a precedence order from right to left, but I am not sure that this is canonical). So, the less ambiguous option should be something like "non-(adjective1 adjective2)" or "non-(adjective1-adjective2)", which may seem a  bit too verbose.   Which of the previous options is more correct/convenient? Is there any general consensus (or better alternative) on how to negate compound adjectives?  Edit.- My question is not on whether or not to use double hyphens, the question is on how to make clear the scope of the negation of the prefix "non-". Normally my doubts arise in a mathematical context. An example could be "finitely generated" which, by the way, is an absolutely standard adjective in mathematics.  Edit2.- I just realized about a missing possibility which may be the best option:   "non adjective1-adjective2"   In this case the scope of "non" is clearly the next word (which is what I want to negate) and is neat enough. Is this form (using the particle "non" as a separate word without hyphen) admissible?  Just to summarize for the given example "finitely generated" the options are:   non-finitely generated non-finitely-generated non-(finitely generated) or non-(finitely-generated) non finitely-generated   I prefer the last one but I am not sure whether it is formally admissible.

Does "non-" prefixed to a two word phrase permit another hyphen before the second word?  If I want to refer to an entity which is defined as the negation of another entity by attaching "non-" it seems strange to attach the "non-" only to the first word when the second one is really the word naming the entity. For example,     non-control freak   looks like a person obsessed with not being in control rather than one who is simply not obsessed with control.     non-control-freak   actually looks better because the "freak" is attached to the "non-" as much as it is to "control-", without the space implying the presence of a phrase break.    and its answers make it sound like totally detaching the "non" could be an option, but if I were following the convention of hyphenating "non-" could I add a hyphen after the next word to resolve this problem?


This can be really trivial,but it helps in ways of making it more comfortable while coding and sending commands to terminal.  My terminal source/bash/root name(my apologies, I dunno which is the right word), reads as follows :  itachi@itachi-HP-Pavilion-g6-Notebook-PC:~$    Can you please tell me how Can I shorten this or change it? The second part after '@' is too long. Is there anyway to change this.? Thanks in advance..

Currently it is:   michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$   Outside of renaming my machine and directory structure...  How could I make it be something more like:  michael:controllers$


Actually, the command I'm running is sudo openvpn nl-free-01.protonvpn.com.udp.ovpn   So this asks for username and password every time I run the command Enter Auth Username: Enter Auth Password:  I want to automate this using bash script... Is it possible?

I have a working script, which allows me to do a vpn connection. It looks like this:  openvpn --config VPNBook.com-OpenVPN-Euro1/vpnbook-euro1-tcp443.ovpn   All is good, but I have to input the publicly available vpn and password every time I run this script. (Don't worry, I'm not going to do banking or anything serious over a free VPN, this is more for learning).  This is the username and the password available publicly on their website:  Username: vpnbook  Password: he2qv5h   After firing up, the script prompts me for username and password which now I need to copy and paste.   Tue Aug 15 11:54:51 2017 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.08 Enter Auth Username: vpnbook Enter Auth Password:    Is there a way of doing it so the script inputs the values on its own?  I tried echoing it, but it isn't that easy.  Or do I have to edit the command itself, somewhere in the files? If yes, can someone point me in the right direction for doing it?


I am working on creating a sunset and am having trouble getting the volume scatter node to not turn the entire world black. I have already tried numerous suggestions from other posts including checking that my light source is not a sun-light, checking that the light's power was high enough, and that I have plugged the volume shader into the volume, not the surface input. Despite this, the volume scatter turns the world black. Interestingly, it does this if the density is anything but 0 (e.g. 1.0 ^ 10^-7 still gives a black world).   I have attempted to use a cube encompassing the scene as well, however I have been unable to make that work. Nevertheless, on a matter of principle, I'd like to get this to work because I can do it in a normal scene without the rest of my objects in it, it is something in this specific file preventing it from working.

I'm working on lighting a scene in which I need to have both an Environment texture for the background and Volume Scatter for light cones, but when I check the volume section in World setting and choose the Volume Scatter, the environment becomes black background (but the lighting works as I want).  I'm using Blender 2.72  How can this be fixed?


Often when I start looking at history of commands some of the characters from a command displayed aren't erased, for example:  What's happening:  prompt$ some_command prompt$ some_commanother_command   What should have happened:  prompt$ some_command prompt$ another_command   I can't erase those characters and bash ignores them when executing the command. They also disappear when a new prompt is being displayed (after pressing Enter for example).  I asked other people who work on Linux at my workplace and they said that they have that problem sometimes too, but they didn't have an idea on how solve that issue.  I have Ubuntu 11.10 and I'm using guake. Here is my PS1:  \e[0;31m\u \A ${PWD##*/}\e[0;32m$(parse_git_branch)\e[0;31m$\e[m   where parse_git_branch is  parse_git_branch () {     git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (\1)#' }   As far as I know my colleagues have that problem even with less "fancy" PS1.

I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following:  username@someserver ~/somepath $ ssh -i /path/to/private/key myusername@something.someserver.com  The command should render on two lines. Instead it will often wrap around and start writing over the top of my prompt, somewhat like this:  myreallylongusername@something.somelongserver.comh -i /path/to/private/key  If I decide to go back and change some argument there's no telling where the cursor will show up, sometimes in the middle of the prompt, but usually on the line above where I'm typing.   Additional fun happens when when I Up to a previous command. I've tried this in both gnome-terminal and terminator and on i3 and Cinnamon. Someone suggested it was my prompt, so here that is:  \[\033[01;32m\]\u:\[\033[01;34m\] \W\033[01;34m \$\[\033[00m\]  Ctrll, reset, and clear all do what they say, but when I type the command back in or Up the same things happens.  I checked and checkwinsize is enabled in bash. This happens on 80x24 and other window sizes.  Is this just something I learn to live with? Is there some piece of magic which I should know? I've settled for just using a really short prompt, but that doesn't fix the issue.


After having updated to Mac OS X El Capitan (10.11), I'm no more able to compile using either TexMaker or TexShop. This is the message I get from TexShop  "/usr/texbin/pdflatex does not exist. TeXShop is  a front end for TeX, but you also need a TeX distribution. Perhaps such a distribution was not installed or was removed during a system upgrade. If so, go to  and follow the instructions to (re)install MacTeX. A less likely possibility is that a tool path is incorrectly configured in TeXShop preferences. This can happen if you are using the macports or fink distributions."  I tried to change the path in Preferences-Engine, as many suggested. Yet, it doesn't work either. Any help?

Texstudio doesn't work for me anymore after updating to Mac OS X 10.11 El Capitan. I have the latest version of TexStudio installed (2.10.2). As pointed out by , this is due to a change in the places OS X allows files to be saved. When I started TexStudio, I received a message "PDFLatex could not be launched". In the settings, I had to change the folder of the compiler from user/texbin/ to /Library/Tex/texbin, as shown in the screenshot below:    Can anybody tell me if I have to make further changes in order to make TexStudio fully working (bibliography and the like), and if yes, which?   I hope TexStudio are very soon going to release an update (there is an issue for this on their issue queue.  Thank you for your help. This is my first post here, so please apologize any imprecisions.


If two Lagrangian (densities) $\mathcal{L}$ give the same equations of motion, are they equivalent?

So I was reading this:  and while the answers for the first question are good, nobody gave much attention to the second one. In fact, people only said that it can be proved without giving any proof or any.  So, if I have a Lagrangian and ADD an arbitrary function of $\dot{q}$, $q$ and $t$ in such a way that the equations of motion are the same, does this extra function MUST be a total time derivative?   EDIT Ok, I changed my question a little bit:  Question: If I have a function that obeys the Euler-Lagrange equation off-shell, this implies that my function is a time derivative? (This was used in Qmechanic's answer of this other question: , equation 14.)  Also, why people only talk about things that change the Lagrangian only by a total derivative? If this is not always the case that keeps the equation of motion the same, so why is it so important? And why in the two questions I posted about the same statement on Landau&Lifshitz's mechanics book only consider this kind of change in the Lagrangian?


Hello everyone (sorry if my english is not perfect),  First, I just want to say that I did researches for my problem and I didn't find any solution, so thank you if you can help me :-). I use blender 2.79b and 2.80, and the problem is the same with both : when I import an obj file downloaded from the website free3d.com, even if there is the mtl file in the same folder and the name is the same, there is no material in render mode, whatever I'm using Evee render, Blender render or Cycles render. And the materials seems to be there in the hierarchy, but when I select a material, it's just grey....  Thank you for your help]

I used node textures in a mesh I exported to .FBX.  I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine.  Is there something I'm doing wrong or is it Blender?


I have an issue with ln -s on Ubuntu 14.04, while using it in the following scenario:  $ cd ~/programming/tmux/ $ ln -s tmux ~/bin/tmux $ ls -l ~/bin/tmux lrwxrwxrwx 1 USER USER 4 sie 31 11:02 /home/USER/bin/tmux -> tmux   Why is it like so? When I create it giving the absolute path everything works fine:   $ ln -s ~/programming/tmux/tmux ~/bin/tmux $ ls -l ~/bin/tmux lrwxrwxrwx 1 USER USER 4 sie 31 11:02 /home/USER/bin/tmux -> ~/programming/tmux/tmux

I'm trying to create a symbolic link in my home directory that points to a directory on my external HDD.  It works fine when I specify it like this:  cd ~ ln -s /run/media/name/exhdd/Data/ Data   However it creates a faulty link when I try this:  cd /run/media/name/exhdd ln -s Data/ ~/Data   This creates a link that I cannot cd into.  When I try, bash complains:  bash: cd: Data: Too many levels of symbolic links   The Data symbolic link in my home is also colored in red when ls is set to display colored output.  Why is this happening? How can I create a link in that manner? (I want to create a symlink to a directory in my working directory in another directory.)   Edit: according to  StackOverflow answer, if the second argument (in my case that'd be ~/Data) already exists and is a directory, ln will create a symlink to the target inside that directory.  However, I'm experiencing the same issue with:  ln -s Data/ ~/


I had windows 7 on my hard drive, then I installed Ubuntu 14.04 to dual boot (I have several partitions and ubuntu is working fine). But I don't know how to switch between the two in boot time. I read a menu for me to choose should appear at boot time, but it justs boots up to ubuntu without asking me... I know I didn't wipe my hard drive by accident because I can see my windows files from ubuntu.  So how do I switch between the two? Is there a button I should press or a setting I should turn on?

My system is not dual-boot, I run a standard Ubuntu desktop system "on the metal" (I think running it in a VM is the same).  Pressing c while booting does not cause the GRUB menu to appear (which I believe it does for a dual-boot system).  How can I get the GRUB-menu to present itself on a single-boot system?


I am trying to understand how javascript function returns function handle and why following code prints '2' instead of '1'    var num = 01; function processAndIncrement() {   var process = function() {      console.log(num);    }   num++;   return process; } var proCall =  processAndIncrement(); proCall();

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


I just created a script that runs a command using a parameter like so:  (firefox "localhost/?id=""$1" &)   I created the alias like so:  alias gotoid='/myscript.sh   As you can see, my script requires the parameter $1 to run. What I want is to be able to run my script using gotoid 3 for example and have the console automatically close without closing the Firefox window. When I change the alias to alias gotoid='/myscript.sh && exit", it starts firefox at the URL but doesn't take my parameter anymore, replacing the number going into id by (saw).  How can I make an alias for my script that allows the insertion of a parameter and close the console right after?  Thanks in advance.

In my ~/.bashrc, I have an alias called yy as follows  alias yy="youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'"   But I often run it this way  yy <url list> && exit   I would like to make it simpler and convert it to a simple alias called yye.  yye <url list>   Would anyone please advise how to carry out this alias definition?


I ran into a weird issue on my Nexus 7 running 4.4.2. If I uninstall an app from the device, it still shows up in Settings -> Apps -> Downloaded at the bottom, and it says not installed. However, it prevents me from installing an apk via adb, reporting the app was still installed.  I had to do an adb uninstall and that completely removed the app.  What changed? What's the proper procedure to remove an app? The only thing that changed that I'm aware of is that now I'm using user profiles, but the app in question is not used in any other profiles.  Thoughts?

I am having a problem with uninstalling apps on Android 5.0 (Nexus 5). I am developing an Android app, so I debug/run the app directly on my device. For production, I exported the same app with my keystore, uninstalled the debug APK that I ran earlier, tried to install the signed APK, and I got this error:      An existing package by the same name with a conflicting signature is already installed.   Is it because the bytecodes are still in the ART runtime? Anyone has any idea how to solve this?


In my simple app I'm getting this error message:  FATAL EXCEPTION: main               Process: com.example.grudzio.helloworld, PID: 31274               java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.grudzio.helloworld/com.example.grudzio.helloworld.DiaryActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2750)                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2811)                   at android.app.ActivityThread.-wrap12(ActivityThread.java)                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)                   at android.os.Handler.dispatchMessage(Handler.java:102)                   at android.os.Looper.loop(Looper.java:154)                   at android.app.ActivityThread.main(ActivityThread.java:6316)                   at java.lang.reflect.Method.invoke(Native Method)                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)                Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference                   at com.example.grudzio.helloworld.DiaryActivity.onCreate(DiaryActivity.java:28)                   at android.app.Activity.performCreate(Activity.java:6757)                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2703)                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2811)                    at android.app.ActivityThread.-wrap12(ActivityThread.java)                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)                    at android.os.Handler.dispatchMessage(Handler.java:102)                    at android.os.Looper.loop(Looper.java:154)                    at android.app.ActivityThread.main(ActivityThread.java:6316)                    at java.lang.reflect.Method.invoke(Native Method)                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)    I think the problem is in that file, but I can't detect it:  package com.example.grudzio.helloworld;  import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ListView;  import java.util.ArrayList;  public class DiaryActivity extends AppCompatActivity {  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_diary);      ArrayList<wpisDiary> logs = new ArrayList<wpisDiary>();      logs.add(new wpisDiary("date","time","log"));     logs.add(new wpisDiary("date1","time1","log1"));     logs.add(new wpisDiary("date2","time2","log2"));     logs.add(new wpisDiary("date3","time3","log3"));         LogAdapter adapter=new LogAdapter(this,logs);      ListView listView=(ListView) findViewById(R.id.list_log);      listView.setAdapter(adapter);  } }   I'd like to make a list in another activity. But the app crashes when I press a button to go to that activity. If it is needed I can add more code from other files. Thanks for help :)

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'm absolutely fine with the idea, that a certain angle/position of the nacelles is better than others. And hence it's good (for whatever reason - be it energy efficiency or more speed...) to have them in that position. So my question is less: "Why do the nacelles rise when they go to warp?". The answer is simple: "Because in trek-physics it's better to have them there when going to warp." My question is more: "Why are they lowered when dropping to impulse?"  The nacelles are not involve in the propulsion of the ship when on impulse. Why are they not forged in the favourable position for warp? For some reason it must be better to lower the nacelles when you fly on impulse.   Maybe they are less exposed in combat-situations? Are they easier to access for reparations if they are lowered? Can the Bussard-collectors work more efficiently if they don't have the saucer-section blocking their ways?  Why can the warp-nacelles be lowered? Why are they not fixed in the position which is best for flying on warp?

I've seen lots of answers here about the episode "Force of Nature". The episode is about scientists discovering that travelling at speeds greater than warp 5 destroys subspace. It's been stated a few times here on this website that voyager's nacelles are made in a way that negates this effect, and that the rotation of the nacelles has something to do with it. Is this actually canon, and if so, how does rotating the nacelles upwards fix the problem? The Enterprises all had nacelles that were angled up from the hull.


Uninstallation of VMware Workstation Player from Ubuntu 16.04. The commands have been given which are required to answer the question

I want to uninstall VMware Player on my Ubuntu 12.04 LTS system. How should I uninstall it?


How Can I create banners like this in Ubuntu ?

I've seen people using the terminal command: banner. This creates big ascii-art-style text.  When I try to run it, however, the terminal says it doesn't exist. Why?  How do I install it? Are there any alternatives?


Some background.  I was asked to find an arithmetic function $f$ such that $f*f=\mathbf 1$ where $\mathbf 1$ is the constant function 1 and $*$ denotes Dirichlet convolution. I was able to prove that there are two solutions $\pm f$ and that $f$ is multiplicative. Next, I would have to evaluate $f$ at prime powers. I constructed a few values and my conjecture is that $$f(p^n)=\frac{2n-1\choose n}{2^{2n-1}}$$ for $p$ prime and $n>0$. To prove this, I only need to show that   $$\sum_{k=1}^n{2k-1\choose k}{2n-2k+1\choose n-k+1}=4^n-{2n+1\choose n+1}\qquad\text{for }\;n\geq0.$$ (This is simply expressing $(f*f)(p^{n+1})=1$ explicitly, plugging in the conjecture.)    For readers who don't really understand what I'm talking about and who are merely interested in the proof of the identity, you can just start reading from here.  Hoping for a combinatorial proof, I interpreted the summation as follows. Given a set of $n+1$ indistinguishable marbles and $n+1$ distinguishable bags (say $b_1,\ldots,b_{n+1}$), the term ${2k-1\choose k}{2n-2k+1\choose n-k+1}$ counts the number of ways to put the marbles in the bags such that there are exactly $k$ marbles in the first $k$ bags $b_1,\ldots,b_k$.  Equivalently, if we identify a configuration of the marbles with a monotonic path in a $n+1\times n+1$ grid such that the path starts in the bottom left corner and ends in the upper right corner, the sum $${2n+1\choose n+1}+\sum_{k=1}^n{2k-1\choose k}{2n-2k+1\choose n-k+1}$$ counts the number of times a path 'crosses' or 'touches' the main diagonal in a point that is not the 'origin', if we summate over all possible paths. (There are ${2n+2\choose n+1}$ such paths in total.) For example, the following path touches the main diagonal $4$ times: At $(2,2)$, $(3,3)$, $(4,4)$ and $(7,7)$.    (We do not count $(0,0)$ because the summation doesn't.) However, interpreting the summation like this I can't get any further. Any other ideas or suggestions on how to approach this problem?    Edit: There are some errors in my reasoning above, let's try again.  Using the identity ${2n-1\choose n}=\frac12{2n\choose n}$ it can be rewritten as $$\sum_{k=0}^n{2k\choose k}{2n-2k\choose n-k}=4^n$$ which looks much better and holds for all $n\geq0$, making it more naturally. This form may give some ideas for combinatorial proofs but I don't really see any.  The term ${2k\choose k}{2n-2k\choose n-k}$ counts the number of $n\times n$ monotonic paths intersecting the diagonal at $(k,k)$. So the summation counts the number of intersection points with the diagonal (all of them this time, including the origin) summing over all paths.  As in Arthur's comment, it would suffice to find a bijection between all $2n$-monotonic paths (no matter their width or height) and the pairs $(p,s)$ where $p$ is a $n\times n$ path and $s$ an intersection point with the diagonal. Perhaps there is a weird bijection which would then solve the question.  For the sake of a proof with induction, I considered all paths that intersect the diagonal for the first time at $(k,k)$ and all possible continuations and their intersection points, summed for $k$ from $1$ to $n$ using the induction hypothesis and a trick with . (Writing out the details would be tedious, I think the reasoning becomes clear when you see the sum.)  It turns out to be sufficient to prove  $$\sum_{k=1}^n2C_{k-1}\left(4^{n-k}+{2n-2k\choose n-k}\right)=4^n$$ where $C_n=\frac1{n+1}{2n\choose n}$ denotes the $n$th Catalan number. However this doesn't seem to be a simplification.

It's not difficult to show that  $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$  On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$.  Squaring the first power series and comparing terms gives us  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$  that is,  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$  My question: is there a more direct, combinatorial proof of this identity?  I've been racking my brains trying to come up with one but I'm not having much success.


I want to guarantee the integrity of a message $m$. My first thought is to append the message to an integrity key $k$ and hash it as $H(k\,||\,m)$. However, I have been told that this is not totally secure, because an attacker can add more data to the end of $m$ while still generating the correct MAC.  How is it possible for an attacker to modify $H(k\,||\,m)$ such that the message is changed but the MAC is the same?  I was advised to use HMAC instead. Why does HMAC solve this problem?

If $H(m)$ is a secure hash function, can't we implement a MAC using $H(k\mathbin\Vert m)$?  However, it seems the more widely used MACs, such as NMAC and  (both originally defined in ) use a much more complicated scheme. Why is this concatenation scheme insecure?


This is going to be a bit tricky to ask correctly, so sorry for making you read long, carefully crafted sentences! Sorry if it seem like excess (and it kinda is, but better safe than sorry, as I don't want closure! If you have an edit that gets the point across but in a shorter length, feel free to suggest it!).  Sometimes, I don't want to use a specific gender, such "he" or "she", when speaking in a manner that speaks of a person in a third-person manner. Thus I use gender-neutral words that do the job of thso third-person reference.  During some of these instances, I wish to use the gender-neutral word to signify ownership. I often use the word "their's."  However, I dislike how the word "their's" can also mean that an object belongs to a group of people instead of a single person. I am looking for a word that does have this double-edged meaning  In short, does there exist a gender-neutral, third-person and ownership signifying word whose sole meaning refers to only a single entity?  Here's an example sentence to fill in:  "The Black player's queen was being attacked by "insert word here" opponent's  rook."  Sorry if this is a lot to ask!

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.


How would I make a .JAR file open up when I make another file as .EXE?  I have tried many things, but they don't work.  I want this for another way to protect my source code. Kind of like what Minecraft does. You open a .EXE, and somehow the .EXE opens up the .JAR file.  Anyone have any ideas?

If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file?  I also need an installer for my program.


My data has a column classification that has about 10 different relevant classes:  ('CO', 'CO01','CR', 'CR01', 'CR06', 'CR07', 'CR08', 'CO01GV', 'CO01LG') and like 'CI%'   How do I create a new column containing all these classes whenever it is applid?  My query looks like this:  select parent_uprn, count(*) address_count, st_centroid(ST_Union(geom)) geom  from pedro_test.mbus_raw where parent_uprn is not null group by parent_uprn   I need the classification column containing all of the classifications in each group, so that I can later query and sort groups accordingly  edit: Okay tried string_agg as suggested and it worked, however the rows are for example CO CO CO CO CO CO01, instead of just being CO CO01

I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table:  ID   COMPANY_ID   EMPLOYEE 1    1            Anna 2    1            Bill 3    2            Carol 4    2            Dave   and I wanted to group by company_id to get something like:  COMPANY_ID   EMPLOYEE 1            Anna, Bill 2            Carol, Dave   There is a built-in function in mySQL to do this


I am booking a round-trip flight to the United States and found that I can save up to 700 euro on a 1200+ euro ticket if I board the same plane one leg earlier. On the flight company's website a ticket from Amsterdam, Netherlands to Boston, United States costs me 1.227,75 euro. However, if I travel to Dusseldorf, Germany and board the exact same plane, the ticket will cost me 568,66 dollar (500+ euro). The latter flight will make a stop in Amsterdam and then continue to Boston.  The price from AMS to BOS is broken down as follows (in euro),  ticket price                                                     880,00 carrier-imposed international surcharge                          259,00 airport passenger service charge                                  13,00 noise surcharge                                                    0,50 security charge                                                   10,53 us customs user fee                                                4,84 us international transportation tax                               31,34 us aphis fee                                                       3,49 us ins user fee                                                    6,16 usa passenger civil aviation security service fee                  4,93 usa passenger facility charge                                      3,96     While the price from DUS to AMS to BOS is broken down as following (in dollar),  Airline Ticket Cost:                                             135.60 Airline Ticket taxes and fees:                                   433.06     This substantial difference gives me a sense of being scammed. I've read several articles on what makes up the price of a ticket but these cannot explain a 700 euro difference for a longer flight on the same plane with the same destination.  How can the same flight cost 700 euro less one leg earlier?

Based on the question , I got curious. Is there a guide or resource that describes how the price of a ticket is determined?  When you search you often see curious effects like cheaper tickets for a flight from A to B with a layover compared to a direct flight. This seems counter-intuitive from an outsider's perspective since you fly twice. Also one way tickets more expensive than 2 ways.  It can be a short set of rules. Something that helps someone to get started with finding good prices. I know these can be very complex and they probably change over time and over airline interests but there is probably a simplified set of rules that can be enunciated.


How would you go about creating a function that maps these sets? I understand that it exists and why it exists but I can't think of a way to accurately represent the function. Any help is appreciated.

I remember my professor in college challenging me with this question, which I failed to answer satisfactorily: I know there exists a bijection between the rational numbers and the natural numbers, but can anyone produce an explicit formula for such a bijection?


I'm running mod_cache with apache 2 on a fairly high traffic'd site.  I've set the htcacheclean to run in demon mode every 10 minutes to keep the cache at 4GB. It's currently at 15GB and doesn't seem to be shrinking.  When I call htcacheclean manually it hangs for (at time of writing) 40 minutes.  Some preliminary research turned up this question     said that I should ensure index_dir is on, which it seems to be  # tune2fs -l /dev/sda3 | grep dir_index Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize   Are there other settings that I can turn on / ensure are turned on to help htcacheclean keep up with the cache generation?

We have an Apache setup with a huge disk_cache (>500.000 entries, >50 GB disk space used). The cache grows by 16 GB every day.  My problem is that the cache seems to be growing nearly as fast as it's possible to remove files and directories from the cache filesystem!  The cache partition is an ext3 filesystem (100GB, "-t news") on an iSCSI storage. The Apache server (which acts as a caching proxy) is a VM. The disk_cache is configured with CacheDirLevels=2 and CacheDirLength=1, and includes variants. A typical file path is "/htcache/B/x/i_iGfmmHhxJRheg8NHcQ.header.vary/A/W/oGX3MAV3q0bWl30YmA_A.header".  When I try to call htcacheclean to tame the cache (non-daemon mode, "htcacheclean-t -p/htcache -l15G"), IOwait is going through the roof for several hours. Without any visible action. Only after hours, htcacheclean starts to delete files from the cache partition, which takes a couple more hours. (A similar problem was brought up in the Apache mailing list in 2009, without a solution: )  The high IOwait leads to problems with the stability of the web server (the bridge to the Tomcat backend server sometimes stalls).  I came up with my own prune script, which removes files and directories from random subdirectories of the cache. Only to find that the deletion rate of the script is just slightly higher than the cache growth rate. The script takes ~10 seconds to read the a subdirectory (e.g. /htcache/B/x) and frees some 5 MB of disk space. In this 10 seconds, the cache has grown by another 2 MB. As with htcacheclean, IOwait goes up to 25% when running the prune script continuously.  Any idea?   Is this a problem specific to the (rather slow) iSCSI storage? Should I choose a different file system for a huge disk_cache? ext2? ext4? Are there any kernel parameter optimizations for this kind of scenario? (I already tried the deadline scheduler and a smaller read_ahead_kb, without effect).