While browsing the , I've noticed that not all logos have the same size. Is there a direct correlation between the number of users and the logo size? If so, is this based on actual data?  I'm simply wondering about the logic behind the logo sizes and if there's any  reason for it, like the number of users or questions.

I noticed that  has been changed, and by default sites are shown by balloons.  What is not clear to me is why some sites are shown with a bigger balloon than other sites. For example, WordPress Answers has less questions, answers and users than Programmers, but its balloon is bigger. What are the criteria used to show the sites on that page?


I know this has been posted alot around here. But this is about the new google update after I tried to install google chrome on a new laptop. Google Chrome Version 29.0.1547.76 m has ruined the speed dial look I once had. It now shows a search input box and a smaller set of speed dials below it. (see image please)    Is there a way to get back the nice clean speed dial page we all love?

I don’t like the behavior of the new tab page in Google Chrome 29+. How can I restore the old behavior?  The new tab page (if you have Google set as the default search engine) now shows the Google logo (or, apparently, the doodle of the day if there is one), a search box, and a few recently visited websites. It also added an Apps button to my favorites bar, seemingly the only way to access my apps page, which has easy access to things I use regularly (Calendar, Gmail, Docs, G+, Facebook, Feedly, Google News, Netflix, Play Music, Pandora, Drive, Keep, etc.) I don’t like this behavior. I actually don’t mind having the logo of the day and search box, but I want my apps linked to on my new tab page.  Is there any way to get the old behavior back? I checked the settings and it doesn’t seem like it’s possible to set chrome://apps to be the new tab page (which would restore the old behavior) or to configure the new new tab page to display apps instead of recently visited sites.


I would like to have some clarification on the physical meaning of $dx$. I already know the following in the context of the area under the curve:  $\lim_{\Delta x \rightarrow 0} \sum f(x) \Delta x \approx \int f(x) dx $  $dx$ is still an interval on x axis. Makes perfect sense.  Let's say I have the following curve $(x,f(x))$ like this:    and I have some function $g(x,y)$ that I want to measure its total sum along my curve. Can I formulate it is as?  $\int_{a}^b g(x,f(x)) dx$  If so, what is the physical meaning of $dx$ here? Aren't we multiplying some extra values ($dx$) into $g(x,f(x))$ and getting a wrong result?

When I was at school and learning integration in maths class at A Level my teacher wrote things like this on the board.  $$\int f(x)\, dx$$  When he came to explain the meaning of the $dx$, he told us "think of it as a full stop".  For whatever reason I did not raise my hand and question him about it.  But I have always shaken my head at such a poor explanation for putting a $dx$ at the end of integration equations such as these.  To this day I do not know the purpose of the $dx$.  Can someone explain this to me without resorting to grammatical metaphors?


Is there a way to cherry pick packages from a ppa repository you add? That is, to exclude some from updating while including others?  For example, I want just the chromium-browser package from  but not the others. So I don't want my sudo apt-get upgrade to have that ppa's other (besides chromium-browser) packages install over my existing ones, just that one.   I realize this is a license to shoot myself in the foot if I misread dependencies and exclude ones that are needed to ones that I included, but I know for a fact in this case that the other packages are not dependencies for that one.  Is this at all possible? Maybe there is some whitelist/blacklist file or something?

Let us say I have added a PPA that has X package that I want but it also has Y package that I do not want to use or receive updates from. How can I, from the same PPA, receive updates for a specific package but deny updates from the same PPA for other packages.  A step by step example would be good since this has happened to me in several PPAs that have a particular package I want but also add a whole bunch of others that I do not yet want to update.


I am trying to get most downloaded items in 1 day so i did a table for downloads And it's structure:  upload_id -> 26  download_date -> 2019-01-10 23:19:13  and used that code to do that most downloaded ids in 1 day  $stmt = $db->prepare( "SELECT  download_id,COUNT(upload_id),download_date,upload_id FROM downloads WHERE DATE(download_date) > DATE(CAST(now() - INTERVAL 1 DAY AS DATE)) GROUP BY upload_id ORDER BY count(upload_id) DESC LIMIT 4" );  $stmt->execute(); $fetchData = $stmt->fetchAll(); $ids = ''; foreach ($fetchData as $data) { if( $ids =='' ): $ids = $data['upload_id']; else: $ids .= ','.$data['upload_id']; endif;   And i get $ids like that   $ids= 21,6,25,21;   Then i used another code to get the rows from items tables with these ids   $stmt = $db->prepare("SELECT * FROM uploads  WHERE id IN($ids)" ); $stmt->execute(); $data_rows = $stmt->fetchAll(); foreach( $data_rows as $row ):   echo $row['id']; endforeach;   the problem is that i get the record with the order of ids in items table not the order of $ids then i don't get the right result how can i get the records with $ids order?

I am wondering if there is away (possibly a better way) to order by the order of the values in an IN() clause.  The problem is that I have 2 queries, one that gets all of the IDs and the second that retrieves all the information. The first creates the order of the IDs which I want the second to order by. The IDs are put in an IN() clause in the correct order.  So it'd be something like (extremely simplified):  SELECT id FROM table1 WHERE ... ORDER BY display_order, name  SELECT name, description, ... WHERE id IN ([id's from first])   The issue is that the second query does not return the results in the same order that the IDs are put into the IN() clause.  One solution I have found is to put all of the IDs into a temp table with an auto incrementing field which is then joined into the second query.  Is there a better option?  Note: As the first query is run "by the user" and the second is run in a background process, there is no way to combine the 2 into 1 query using sub queries.  I am using MySQL, but I'm thinking it might be useful to have it noted what options there are for other DBs as well.


How can I get the total percentage or volume of memory usage and CPU consumption from within C++11 code on ubuntu (or any other linux-based system)?  The usage I want to get is for the whole system, not just for current thread or process.

I once had the task of determining the following performance parameters from inside a running application:   Total virtual memory available Virtual memory currently used Virtual memory currently used by my process Total RAM available RAM currently used RAM currently used by my process % CPU currently used % CPU currently used by my process   The code had to run on Windows and Linux. Even though this seems to be a standard task, finding the necessary information in the manuals (WIN32 API, GNU docs) as well as on the Internet took me several days, because there's so much incomplete/incorrect/outdated information on this topic to be found out there.  In order to save others from going through the same trouble, I thought it would be a good idea to collect all the scattered information plus what I found by trial and error here in one place.


I want to visually find the overfull hboxes in my document. Is there a way to highlight them in the document?

Is it possible to make LaTeX mark overfull boxes in the output, for example by drawing red rectangles in the PDF where the boxes overflow? The purpose -- to more easily "see" where the problems are in the output.


Prove that the matrix   $$A = \begin{bmatrix}         0      & 1 & \\        \ddots &   & \ddots \\               & \ddots & & \ddots \\               &        & \ddots & & \ddots\\               &        &        & 0 & & 1\\        -a_{0} & -a_{1} & \dots  & \dots & \dots & -a_{n-1}\end{bmatrix}$$  is non-derogatory. I am not sure how would I do this. Non-derogatory matrix means that the minimal polynomial equals the characteristic polynomial but I am not sure how to this one.

of a monic polynomial $f \in \mathbb F\left[x\right]$ in $1$ variable $x$ over a field $\mathbb F$ plays an important role in understanding the structure of finite dimensional $\mathbb F[x]$-modules.  It is an important fact that the characteristic polynomial and the minimal polynomial of $C(f)$ are both equal to $f$. This can be seen quite easily by induction on the degree of $f$.  Does anyone know a different proof of this fact? I would love to see a graph theoretic proof or a non inductive algebraic proof, but I would be happy with anything that makes it seem like more than a coincidence!


So the problem that I am having is I am trying to have an account creation area of an app and whilst doing this they have to enter the password for the account twice. If the passwords are the same the account will be created otherwise they are told that they are different and asked to try again.  The problem that I am having is that despite the data in the two JTextFields being the same when they are compared using an == they are apparently different. The code that I have tried is shown below.      JLabel PasswordL = new JLabel ();     PasswordL.setText("Password:");     UserPanel.add(PasswordL,"cell 1 0,width 150,height 25,span 2 1");      final JTextField PasswordT = new JTextField ();     UserPanel.add(PasswordT,"cell 1 1,width 150,height 25");       JLabel ConfirmPasswordL = new JLabel ();     ConfirmPasswordL.setText("Confirm Password:");     UserPanel.add(ConfirmPasswordL,"cell 1 2,width 150,height 25,span 2 1");      final JTextField ConfirmPasswordT = new JTextField ();     UserPanel.add(ConfirmPasswordT,"cell 1 3,width 150,height 25");       JButton AddNewUser = new JButton ();     AddNewUser.setText("Insert");     AddUserButtonPanel.add(AddNewUser,"cell 0 0,width 100,height 25");     AddNewUser.addActionListener(new ActionListener () {          public void actionPerformed(ActionEvent e) {              System.out.println(new String(PasswordT.getText()));             System.out.println(new String(ConfirmPasswordT.getText()));              if (new String(PasswordT.getText()) == new String(ConfirmPasswordT.getText())) {                         AdminConsole AC = new AdminConsole ();                     } catch (SQLException e1) {                         // TODO Auto-generated catch block                         e1.printStackTrace();                     }                 } else {                     new ErrorWindow("This account already exists!");                 }              } else {                 JFrame Error = new JFrame();                 Error.add(new JLabel("The Password do not match!"));                 Error.setSize(200, 50);                 Error.setLocationRelativeTo(null);                 Error.setVisible(true);             }         }     });   I have tried both with and without the use of new String () and now I have run out of ideas. Any advice would be greatly appreciated thanks.

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


Below is just a snippet of my code:  return(

row1

row2

row3

 );   I tried this, but it displays in vertical. Image attached below

My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. Suggestions?  <div style='width:30%; text-align:center; float:left; clear:both;'> Is what I have now.


This seems a bit odd! I did a program which required me removing duplicated from the list and choose the second last number. I did it using set(). however I came up with something unexpected. set([32.0,36.0,39.0,40.0])  gives me an output of [32.0, 40.0, 36.0, 39.0]. I want to know why this happens. I'm using python 3.9.1 Thanks in advance

Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:


So i have an admin page to handle status of items in the inventory. It is running on Node, using ejs template and mongoDb.  I was having a post action, and it is running fine when using a redirect link to reload the whole page.  Now i am changing to use ajax to handle a partial view update instead of reloading.  This is my url post action using res.json() to send the updated result to client side:  router.post("/change-status/:id/:status", (req, res, next) => {   let currentStatus = ParamsHelpers.getParam(req.params, "status", "active");   let id = ParamsHelpers.getParam(req.params, "id", "");    console.log("This is being called");    ArticleModel.changeStatus(id, currentStatus, { task: "update-one" }).then(     result => {       //res.redirect(linkIndex); // this is how it works with redirect which reload the whole page       res.json(result);     }   ); });   The result above is sent to client and handle after an ajax called. It is inside an action click on a tag.  $("a[href*='change-status']").on("click", function(e) {     e.preventDefault();     e.stopPropagation();      console.log("ajax is called");      var thisElement = $(this);     var parent = $(this).parent();         $.ajax({       url: this.href, // current href of a tag       type: "POST",       dataType: "json",       success: function(data) {         $(thisElement).remove();         $(parent).append(           statusHelper("admin123/article/", data.status, data._id)         );       },       error: function(jqXHR, textStatus, err) {         alert("text status " + textStatus + ", err " + err);       }     });   });   On successful, it replaces current a tag with another one, with a different link (the two links are below).  On the first click, the action is posted correctly, the data is sent correctly and the html is replaced / updated correctly by statusHelper method.  I double checked and the link before the first clicked and after the first clicked is similar.  a href 1st click:   http://localhost:6969/admin123/article/change-status/5e7cafc29d6d971b00cb5459/inactive   a href 2nd click:  http://localhost:6969/admin123/article/change-status/5e7cafc29d6d971b00cb5459/active   But when i clicked again to update the status the 2nd time, it routes me to that route instead of doing an ajax post.  May I know where i did thing wrong?  If more codes needed pls let me know.

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


I want to reset passwords temporarily to log in as root at least one time to change passwords. I have access to the hard drive and I can run a live distro to gain root access.  I did think it would be enough to change for each user the x in the second column of /etc/passwd, but this does not work.

We know that users' passwords are saved in /etc/passwd, but in an encrypted way, so even the root can't see them:  jane:x:501:501::/home/jane:/bin/bash fred:x:502:502::/home/fred:/bin/bash   As shown above, :x: represents the password.  Is there a way (possible configuration) to save the password in the /etc/passwd in clear text and such that the root can see them?


I have classes A and B, I want to access a method from class A in class B but it isn't working, I'm getting the following message:     Exception in thread "main" java.lang.NullPointerException   The particular part that is causing this is when accessing ba:  ba.getBalance() >= LIM         ba.debit(LIM);   I'm not sure what I'm doing wrong as I've created the private field and initialised it within main.  Class B:   public class B {          private A ba;         private long balance;          public B(long amount, A ba){         }          public boolean testCase(long amount){            //..         }      public long getBalance(){         return balance;     }   Class A:  public class A {       private long balance;       public A(long amount){     }      public boolean debit(long amount){         //.. simple arithmetic      }      public long getBalance(){         return balance;     }   Main  A aa = new BankAccount(amount1); // where amounts are user input B bb = new GoCardAccount(amount2, aa);

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 list of integers:   x = [0, 1, 3, 5, 6, 7, 33, 39, 49, 51, 11,        32, 55, 61, 31, 44, 43, 4, 45, 30, 50, 41]   And second list that can only contain elements from x, for example: y = [44, 11, 49]  I need to find the index of each element of y in x.

Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?


function generate(count) {     var founded = false,         _sym = 'abcdefghijklmnopqrstuvwxyz1234567890',         str = '';     while(!founded) {         for(var i = 0; i < count; i++) {             str += _sym[parseInt(Math.random() * (_sym.length))];         }         base.getID(string, function(err, res) {             if(!res.length) {                 founded = true; // How to do it?             }         });     }     return str; }   How to set a variable value with database query callback? How I can do it?

I'm trying to create globally-unique identifiers in JavaScript.  I'm not sure what routines are available on all browsers, how "random" and seeded the built-in random number generator is, etc. The GUID / UUID should be at least 32 characters and should stay in the ASCII range to avoid trouble when passing them around.


The following is on a Virtual Private Server online and only one machine. I have tried a number of ideas using UFW on Ubuntu 15.10 to forward an incoming request on port 80 to a simple app I have running on 3000. My current ufw status looks like this.  To                         Action      From --                         ------      ---- 22/tcp (OpenSSH)           ALLOW IN    Anywhere 80 (HTTP)                  ALLOW IN    Anywhere 22/tcp (OpenSSH (v6))      ALLOW IN    Anywhere (v6) 80 (HTTP (v6))             ALLOW IN    Anywhere (v6)  162.243.39.90 3000         ALLOW FWD   162.243.39.90 80   To achieve that last line I used  ufw route allow from 162.243.39.90 port 3000 to 162.243.39.90 port 80   I tried several other combinations including  in on eth0    and  out on xxx   But,unless I open port 3000 directly, I can't access the app. My browser just spins it's wheels for a while before returning "web page not available error."  Any ideas?

Im currently using ufw to enforce some basic firewall rules. Is it possible to also use ufw to do port forwarding?  Specifically im wanting to forward incoming traffic to my server (same machine running ufw) on port 80 to port 8080. (http traffic forwarded to tomcat)  Th


We have two domains .local and .com. Sending connector uses .com fqdn while receiving connector uses .local fdn. I got an error "no reverse dns set". So i called my isp and get it done. After doing it.Gmail and hotmail started tagging my mails as spam. While testing on mxtools i got smtp mismatch error.   I have One send connector Two receive connector- default and client. Not able to change fqdn on default. Server authentication is not letting me do so. We have Microsoft front page security for exchange. We are using firewall in which exchange ip is mapped to public ip.(nat).

This is a  about avoiding outgoing mail being classified as spam.   Also related:                    I'm wondering how to prevent my emails from my site being marked as spam? I'm using sendmail.  I'm trying to send emails through my ruby-on-rails application. The mails are all written in swedish (if that does make a difference?). I don't know why they keep getting marked as spam.  Are there any things that I can do to minimize the risk?


I want to have a simple class that represents an object with unique id. Every new object gets an ID higher than the previously created one. Important thing to notice is that id for every object is constant, so I'm obliged to use initialise list. For some reason I get an error about undefined reference: Undefined reference to Test::ID.  class Test {     const int m_id;     static int ID; public:     Test() : m_id(ID++)     {         cout << "Created object with id: " << m_id << endl;     } };    Why is this? How can I fix this? How can I make sure that ID is pre-initialised with 0, so i don't increment an uninitialised variable?

What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:  class foo {     private:         static int i; };  int foo::i = 0;   I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this?


I hope this question wasn't asked before, I was looking for an answer and didn't find one. I'm trying to understand the Ridge regression problem.  If I understand correctly, Ridge regression is trying to solve the following problem:  Given $A \in \mathbb{R}^{n \times d}$, $b \in \mathbb{R}^n$ and $\lambda \in \mathbb{R}$, find $x \in \mathbb{R}^d$ that minimizes:  $(1)$ $arg\,min_{x \in \mathbb{R}^d}(||Ax-b||_2^2+\lambda^2||x||_2^2)$  I'm trying to understand the meaning of $\lambda$. I thought that the above equation is identical to the following equation:  $(2)$ $arg\,min_{x \in \mathbb{R}^d}||Ax-b||_2^2$ s.t. $||x||_2^2 \leq \lambda^2$  But after solving both problems separately in matlab, I got different solutions for $x$.  I solved problem $(1)$ by this formula: $x={(A^TA + \lambda^2 I)}^{-1}A^Tb$.  I solved problem $(2)$ by using $cvx$ library in matlab that is able to solve convex optimization problems.  As I said, in both cases I got different $x$. Are the two problems supposed to be identical? and if not, what change (if possible) should I do to problem $(2)$ so it can be identical to problem $(1)$.  Thanks  $\textbf{Edit:}$  Whoever put the link  for me. Thank you!  It indeed worked in Matlab and I got the same solution for both cases. But I did not expect to get such a strange solution.  Just to make sure I understand since it really looks strange to me.  By the answer in the link, you can actually convert the second problem to this problem:  $arg\,min_{x \in \mathbb{R}^d}||Ax-b||_2^2$ s.t. $||x||_2^2 \leq ||x'||_2^2$  where $x'={(A^TA + \lambda^2 I)}^{-1}A^Tb$ is the solution to the first problem.  It looks too trivial/strange since it means that the constraint is actually equal constraint and not 'less than or equal' constraint (the first one is a non-convex problem and the second one is a convex problem).  It also means that you need to solve the first problem and actually find $x$ from the first problem in order to find the same $x$ again in the second problem. which makes no point on solving the second problem.  Does it guarantee that it always finds  $arg\,min_{x \in \mathbb{R}^d}||Ax-b||_2^2$ s.t. $||x||_2^2 = ||x'||_2^2$ (non-convex problem)  and not  $arg\,min_{x \in \mathbb{R}^d}||Ax-b||_2^2$ s.t. $||x||_2^2 < ||x'||_2^2$ (convex problem)  Thanks!

The accepted answer in  does a great job of showing that there is a one-to-one correspondence between $c$ and $\lambda$ in the two formulations of the ridge regression: $$ \underset{\beta}{min}(y-X\beta)^T(y-X\beta) + \lambda\beta^T\beta $$ and  $$ \underset{\beta}{min}(y-X\beta)^T(y-X\beta) \text{ s.t. }\beta^T\beta\leq{c} $$  The linked answer shows this in the orthogonal case.    In a general (non-orthogonal case), how can I compute $\lambda$ from $c$?  Update Here is an answer for going from $\lambda$ to $c$:   Assuming that the coefs are constrained by the penalty, $$ \beta^T\beta = c $$ and  $$ \beta = (X^TX + \lambda I)^{-1}X^Ty\\ \beta^T\beta = c = \beta^T(X^TX + \lambda I)^{-1}X^Ty $$  Still working on going the other way


After the recent upgrade to macOS Mojave Safari started redirecting from http://localhost to https://localhost. The problem persists only in Safari, in Chrome everything is the same as before. Now I'm temporary using 127.0.0.1 as a replacement, but it's inconvenient due to some limitations of software I'm using.   I tried searching and found some similar questions, where accepted answers were to kill Safari and remove ~/Library/Cookies/HSTS.plist file, and in my case it didn't work.   I also tried , without luck.

I have a device with a web-based control panel, and accidentally set it to redirect all http pages to https, even though some don't work over https. Although I've since corrected this, Safari seems to have memorised the redirect and is refusing to forget it, instead constantly attempting to redirect me to the invalid https address.  I've already closed Safari, cleared ~/Library/Caches/com.apple.Safari/ and ~/Library/Cookies/HSTS.plist but it still seems to be remembering the redirect when I re-open it.  Where else could Safari be storing this information? I can access the correct page via Firefox or Chrome, so it may not be a system wide service, or if it is it's not one that the other browsers use.  Unfortunately because the web-panel is provided by a device I don't believe I can adjust headers or setup a redirect back to the correct URL, which seem to be options offered in other similar questions, so I really need to find out where this data is being stored so I can destroy it with fire.


I am in my 23rd year of teaching at the public schools.  I love what I do and as some refer... I am a 'lifer.'  I am 45 yrs. old and wanting to start my Ed.D. The program is estimated to be completed in 3yrs as I already have an MA and 18 additional graduate course work hours that some will likely transfer.  I believe I will be 48 or 49 when I finish.  My goal is to take the Ed.D.  and my 26/27 yrs public education and move into a university setting and apply and pour into aspiring students who wish to become teachers as well as be a supervisor of student teachers.  I have thought of other ideas too like working more at a district level within a school district where my Ed.D. in Educational Leadership with the emphasis in curriculum and instruction or special education could be of value.  My greatest concern is I will do all this work for nothing and be considered too old and overlooked.  Anyone have any wisdom to impart as I ponder this decision????

Are there any age limits (formal, informal, or guidelines) that schools use when deciding to accept someone into a PhD program? I'm most curious about the upper age limits. For example, will most schools accept someone in their 40's? How about their 50's?


I am confused by this error:   java.lang.NullPointerException: Attempt to invoke virtual method `void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)` on a null object reference         at       com.example.myapplication.MainActivity.onCreate(MainActivity.kt:20)    It says that this is the problem: Mainactivity.kt:  package com.example.myapplication  class MainActivity : AppCompatActivity() {      override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         setContentView(R.layout.activity_main)         setSupportActionBar(toolbar)          goToAddProduct.setOnClickListener {             startActivity(Intent(this,AddProductActivity::class.java))         }     } }   What is the problem?

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 currently making a bar plot with pgfplots and have numbers in percent on the x axis. I want to show the values directly at the bars for which I use nodes near coords. But because the values are given as numerical, I need to add the % by hand. I could this for the axis labels via xticklabel={\pgfmathprintnumber{\tick}\textsf{\%}}, but this didn't work for the nodes near coords.  I tried the point meta command, but it didn't work as expected. I read through the manual chapter 4.8, but couldn't find any help regarding adding a simple symbol to the nodes label.  Here's my MWE, which yields the (almost) wanted result, without the percent-symbols at the bars values:   \documentclass[border=1pt]{standalone}   \usepackage{pgfplots}  \begin{document}     \begin{tikzpicture}     \begin{axis}[         xbar,         height=5cm,         width=12cm,         axis y line*=left,         axis x line*=bottom,         enlarge y limits=0.3, %%%              xmin=0, xmax=20,         xticklabel={\pgfmathprintnumber{\tick}\textsf{\%}}, %%%         symbolic y coords={one, two, three},         ytick=data,         nodes near coords, %       point meta={x},      ]          \addplot[             draw=black!30,             fill=black!30         ]          coordinates {(10,one) (18,two) (5,three)};          \addplot[             draw=black!70,             fill=black!70         ]          coordinates {(9,one) (8,two) (7,three)};     \end{axis}      \end{tikzpicture}  \end{document}   Using something like point meta={x\%} only yields errors and I couldn't find any working solution.  Best regards

I'm trying to plot a graph population pyramid.   I wrote this MWE.  \documentclass{article}  \usepackage{pgfplots} \usepackage{pgfplotstable}  \begin{document} \pgfplotstableread[col sep=comma]{ age,man,woman +100 years,0,4 95 - 99 years,3,6 90 - 94 years,10,16 85 - 89 years,43,57 80 - 84 years,103,111 75 - 79 years,175,224 70 - 74 years,274,322 65 - 69 years,421,427 60 - 64 years,514,524 55 - 59 years,578,606 50 - 54 years,732,785 45 - 49 years,885,911 40 - 44 years,1044,1120 35 - 39 years,1192,1289 30 - 34 years,1315,1306 25 - 29 years,1214,1362 20 - 24 years,1360,1336 15 - 19 years,1471,1406 10 - 14 years,1495,1446 5 - 9 years,1375,1351 0 - 4 years,1325,1257 }\loadedtable   \begin{tikzpicture} \begin{axis}[     width =\textwidth,     height = 0.6*\textheight,     enlarge x limits=0.6,     xbar = 0pt,     xmin = -5,     xmax = 5,     y dir = reverse,     nodes near coords,     bar width=8pt,     bar shift=0pt,     axis x line= left,     nodes near coords = {\pgfmathprintnumber\pgfplotspointmeta\%},     every node near coord/.append style={font=\scriptsize, color=black},     xticklabel= {\pgfmathprintnumber\tick\%},     symbolic y coords={+100 years,95 - 99 years,90 - 94 years,85 - 89 years,80 - 84 years,75 - 79 years,70 - 74 years,65 - 69 years,60 - 64 years,55 - 59 years,50 - 54 years,45 - 49 years,40 - 44 years,35 - 39 years,30 - 34 years,25 - 29 years,20 - 24 years,15 - 19 years,10 - 14 years,5 - 9 years,0 - 4 years},    ytick={+100 years,95 - 99 years,90 - 94 years,85 - 89 years,80 - 84 years,75 - 79 years,70 - 74 years,65 - 69 years,60 - 64 years,55 - 59 years,50 - 54 years,45 - 49 years,40 - 44 years,35 - 39 years,30 - 34 years,25 - 29 years,20 - 24 years,15 - 19 years,10 - 14 years,5 - 9 years,0 - 4 years}             ]         \addplot [fill = cyan!50]    table[y=age,x expr={-\thisrow{man}/31395*100}] \loadedtable;%31395 is the total population         \addlegendentry{Man}         \addplot [fill = magenta!50] table[y=age,x expr={\thisrow{woman}/31395*100}] \loadedtable;%31395 is the total population         \addlegendentry{Woman}     \end{axis} \end{tikzpicture} \end{document}   But the result is an ugly graph:    How can I improve it to obtain something like this?


If Firefox loads an image completely in the viewport it shouldn't download it again if a user saves that image to a local storage medium.  Maybe because some websites disable user agent cache storage some images have to be downloaded again.  Is there a workaround for this? PD: Firefox version is 26

A big jpeg picture file is opened in Firefox. If I do "Save As" for it it downloads the picture again to save it.  How can I save the currently opened picture without re-downloading it in Firefox?


Suppose that $p$ and $q$ are distinct odd primes and $a$ is an integer such that $\text{gcd}(a,pq)=1$.  Prove that $a^{(p-1)(q-1)+1}\equiv a \pmod{pq}$.

I have come across this question, which reminded me of Fermats little theorem, i dont know if the Fermats theorem is actually in use in the following mathematical statements   an integer a is a coprime with p and a coprime with q (p and q are different prime numbers )then prove that  $$a^{(p-1)(q-1)} \equiv 1(\operatorname{mod} pq) $$  $$p^{q-1}+q^{p-1} \equiv 1(\operatorname{mod} pq)$$  any help would be appreciated, thanks in advance.


This latest version I was offered an upgrade to is AWFUL! Why wasn't any overview provided? I can't find menus for getting to the software I've become used to. Everything is so FUZZY. GET ME OUT OF HERE!!!!!!!!  OK, in plain sober English, how do I uninstall this scary LSD trip and get back to the version I had before?

I just installed a new version of Ubuntu and I want to roll it back to the previous version.  How can I do that? Is that even possible?


Let $p(x)=x^4+x^3+1$ .  Is $p$ irreducible in:  1) $\mathbb{F}_2$ ?  2) $\mathbb{F}_4$ ?  3) $\mathbb{F}_8$ ?  4) $\mathbb{F}_{16}$ ?  5) $\mathbb{F}_{32}$ ?  6) $\mathbb{F}_{64}$ ?  I can prove that $p$ is irreducible in $\mathbb{F}_2$ and $\mathbb{F}_4$ by showing it has no roots and no quadratic factors.  How can I complete questions 3-8?

This question is generalized based on my previous question:   Problem:  Consider an irreducible polynomial $f = x^4 + x^3 + 1$ in $\mathbb{F}_2 [x]$. I am interested in its solvability and reducibility in a "chain" of fields. Namely, does $f$ have root in the following fields? Is $f$ reducible in the following fields?  $$ \color{red}{ \mathbb{F}_2},\mathbb{F}_4,\mathbb{F}_8,\color{red}{\mathbb{F}_{16}},\mathbb{F}_{32},\cdots,\color{red}{\mathbb{F}_{256}}$$  My progress:  $\mathbb{F}_2,\mathbb{F}_{16},\mathbb{F}_{256}$:  It is easy to verify that $f$ has no root in $\mathbb{F}_2$ and it is irreducible as well. As a result, $f$ has a root in $\mathbb{F}_{16} \simeq \mathbb{F}_2/f(x)$ and thus is reducible in $\mathbb{F}_{16}$. Since $\mathbb{F}_{256} = \mathbb{F}_{2^{4\times 2}}$, $\mathbb{F}_{16}$ is a subfield of $\mathbb{F}_{256}$, $f$ has root and is reducible in $\mathbb{F}_{256}$ as well.    $\mathbb{F}_{32},\mathbb{F}_{64},\cdots$:  For the fields "between" $\mathbb{F}_{16}$ and $\mathbb{F}_{256}$, I verified that $f$ cannot have root in them. Take $\mathbb{F}_{64}$ for example. Suppose $f$ actually has root in it, call it $\zeta$. Then apparently $\mathbb{F}_2 (\zeta)$ is a subfield of $\mathbb{F}_{64}$. But since $\mathbb{F}_2 (\zeta) \simeq \mathbb{F}_2 [x]/f(x)$, this would imply that $\mathbb{F}_{16}$ is a subfield of $\mathbb{F}_{64}$, which is impossible. But I haven't figured out how to deal with the reducibility part?    $\mathbb{F}_4,\mathbb{F}_8$:  For the fields "between" $\mathbb{F}_2$ and $\mathbb{F}_{16}$, I am not sure what's the best strategy here. For the existence of root, I am attempted to say that $f$ has no root in both of them since "the smallest" field extension that has a root is $\mathbb{F}_{16}$. I forgot the proof but I think it is correct.   With the operation tables of $\mathbb{F}_4$ from WolframAlpha, I was able to show that $f$ has no root in $\mathbb{F}_4$, and it is irreducible in $\mathbb{F}_4$ as well. But is there a better way?  For $\mathbb{F}_8$, I mimicked the answer in my previous question and managed to show that $f$ is irreducible in $\mathbb{F}_8$. But I don't know how I should deal with the existence of root?  I understand that this is a long post and I appreciate your help. Thanks.


I have an 80 GB hard drive and 8 GB of RAM. Do I need to make a partition to install Ubuntu 14.04 and Windows 7 alongside each other?   I have tried but I could not do it. Please help me out.

I would like to see a full how-to guide on how to install Ubuntu.


I have installed MikTeX 2.9 in Windows. It does not allow to install new package, it fails...Even I tried to update(Admin)...It shows  A connection Attempt failed....... A connection attempt failed because the connected party didnot properly respond after a period of time, or established connection failed because connected host has failed to respond. Detail: connect failed in tcp_connect()".  Please help me.....

Good day all. I am getting this error:     pdflatex.exe: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. pdflatex.exe: Data: connect failed in tcp_connect()   which makes my code take very long to compile, although it seems to compile correctly. I am compiling with pdflatex. Has anyone experienced the same problem?  My script:  \documentclass[paper=a4]{article} % A4 paper and 11pt font size \usepackage[english]{babel} % English language/hyphenation \usepackage{amsmath,amsfonts,amsthm} % Math packages \usepackage{graphicx}  \begin{document} \begin{titlepage} \thispagestyle{empty} \end{titlepage} \setcounter{page}{1} \newpage \section*{Introduction} The purpose of this project is to \subsection*{Problem} The system to be analysed through the duration of this project is a two-car train, interconnected with a spring, as shown in Figure 1:\\ \newline \begin{figure}[h!]  \centering   \includegraphics[scale=0.5]{System1.png}  \caption{two-car train, interconnected with a spring}  \end{figure}  \newline  It was initially proposed to use the absolute displacements of the carts as state variables, but it turns out that this results in the system becoming unobservable. The choice was thus made to choose the state variables:\\  \begin{align} x =  \begin{bmatrix} \Delta \\ v_1 \\ v_2  \end{bmatrix}  \end{align}  where $v_1=\dot{z_1}$ and $v_2=\dot{z_2}$ are the speeds of cars 1 and 2, respectively.\\ Note that we are dealing with a third order system, as we have 3 state variables.  \newline  The state equation of the system is given by:\\  \begin{figure}[h!]   \centering   \includegraphics[width=0.5\textwidth]{state_eqn.png}  \end{figure}  \newpage and the observation equation by:\\  \begin{figure}[h!]   \centering   \includegraphics[scale=0.1]{obs_eqn.png}  \end{figure}  \newline We thus have a single input single output (SISO) system with the voltage going to the motor of the first car as the input and the speed of the first car as the output.\\  We now substitute the following constants into the dynamics matrix A, the input matrix B and the observation matrix C:\\ \begin{center} $M_1=M_2=1kg$\\ $K=40N/m$\\ $k=2Vs$\\ $R=100\Omega$\\ $r=2cm$\\ \end{center} We then get the following matrices:\\  \begin{align} A =  \begin{bmatrix} 0 & -1 & 1 \\ 40 & -0.01 & 0 \\ -40 & 0 & 0  \end{bmatrix}\\  \end{align}   \begin{align} B =  \begin{bmatrix} 0\\ 0.01\\ 0\\  \end{bmatrix}  \end{align}  \begin{align} C =  \begin{bmatrix} 0 & 1 & 0\\ \end{bmatrix}  \end{align}  \subsection*{Controllability and observability} Before we start the analysis, it will be useful to confirm that the system at hand is indeed controllable and observable.\\ \newline To be controllable, the rank of the controllability test matrix, defined by\\  \begin{align} Q =  \begin{bmatrix} B & AB & A^{2}B \end{bmatrix}  \end{align} has to be of the same order as the system. To be observable, the rank of the observability test matrix, defined by\\  \begin{align} N =  \begin{bmatrix} C' & A'C' & A'^{2}C' \end{bmatrix}  \end{align} has to be of the same rank as that of the system. Computing matrices Q and N and using the rank() function in MATLAB shows that the ranks of both matrices are 3, and thus equal to the order of the system. We now know that the system is controllable and observable and can thus use the tools at our disposal to design a controller for this system. \section*{Question A} Assuming all states are measured for feedback purposes, we will now determine the gain matrix   \end{document}


Related to:     [This has actually happened to me on two separate occassions.]   While reviewing, I came across  that looked legitimate. I noticed a comment from , and I wanted to understand the point that he was making. Within my Google Chrome browser, I right-clicked on the link and selected 'Open link in new tab.' I actually agreed with Robert's comment (that the linked post was related) but also felt that the "honeypot" was a legitimate question. But when I returned to the review task, I saw the 'STOP! Look and Listen.' message telling me that I failed the review audit.   A few points:   I'm not a robo-editer. I promise. :) This is the second time that this has happened to me. That is, this is the second time that I wanted to know more about the comments that various people had attached to a honeypot, opened a link in a new tab, and returned to the review audit, only to find out that I had FAILED!!!!   Please help.

So  came up. It was clearly not a crap answer, and I could tell it was probably an audit because no username was being displayed, but I wanted to read the question before deciding whether to "no action" or "skip". The question had slightly fuddled grammar so I decided to look at its comments. The comment expansion text read "show 8 more comments" (all 8 comments were hidden). I clicked it and it failed the audit.  Why should an audit based on a known good answer fail because I was attempting to get more information on the question?  Interestingly enough, several non-audit reviews I've seen replace the "add comment"/"show more comments" link with the text "comments disabled on deleted / locked posts / reviews". At the very least this text should have shown for this audit.


I've run the lm code below, with one DV and three IVs, and I'm not sure how to interpret the output.  What does (Intercept) refer to, and what is that row telling me?  What are the other rows telling me?  I'm mainly interested in understanding the p-values. Thank you! Call: lm(formula = NL_EN_M ~ A_S_S + A_P_S + A_A_S, data = IV)  Residuals:      Min       1Q   Median       3Q      Max  -1.12516 -0.22312  0.00767  0.23596  1.06969   Coefficients:             Estimate Std. Error t value Pr(>|t|)     (Intercept)  2.79551    0.36485   7.662  6.6e-09 *** A_S_S        0.03037    0.10404   0.292    0.772     A_P_S       -0.01776    0.12650  -0.140    0.889     A_A_S       -0.11809    0.10122  -1.167    0.251     --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  Residual standard error: 0.5771 on 34 degrees of freedom

The help pages in R assume I know what those numbers mean, but I don't. I'm trying to really intuitively understand every number here. I will just post the output and comment on what I found out. There might (will) be mistakes, as I'll just write what I assume. Mainly I'd like to know what the t-value in the coefficients mean, and why they print the residual standard error.   Call: lm(formula = iris$Sepal.Width ~ iris$Petal.Width)  Residuals:      Min       1Q   Median       3Q      Max  -1.09907 -0.23626 -0.01064  0.23345  1.17532    This is a 5-point-summary of the residuals (their mean is always 0, right?). The numbers can be used (I'm guessing here) to quickly see if there are any big outliers. Also you can already see it here if the residuals are far from normally distributed (they should be normally distributed).  Coefficients:                  Estimate Std. Error t value Pr(>|t|)     (Intercept)       3.30843    0.06210  53.278  < 2e-16 *** iris$Petal.Width -0.20936    0.04374  -4.786 4.07e-06 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1    Estimates $\hat{\beta_i}$, computed by least squares regression. Also, the standard error is $\sigma_{\beta_i}$. I'd like to know how this is calculated.  I have no idea where the t-value and the corresponding p-value come from. I know $\hat{\beta}$ should be normal distributed, but how is the t-value calculated?  Residual standard error: 0.407 on 148 degrees of freedom   $\sqrt{ \frac{1}{n-p} \epsilon^T\epsilon }$, I guess. But why do we calculate that, and what does it tell us?  Multiple R-squared: 0.134,  Adjusted R-squared: 0.1282    $ R^2 = \frac{s_\hat{y}^2}{s_y^2} $, which is $ \frac{\sum_{i=1}^n (\hat{y_i}-\bar{y})^2}{\sum_{i=1}^n (y_i-\bar{y})^2} $. The ratio is close to 1 if the points lie on a straight line, and 0 if they are random.  What is the adjusted R-squared?  F-statistic: 22.91 on 1 and 148 DF,  p-value: 4.073e-06    F and p for the whole model, not only for single $\beta_i$s as previous. The F value is $ \frac{s^2_{\hat{y}}}{\sum\epsilon_i} $. The bigger it grows, the more unlikely it is that the $\beta$'s do not have any effect at all.


Second day of using Blender, I was trying to make a flower but the rendered object has a black base from the image outline. Here is the before and after image.  Any suggestions?

I must be missing something here.  I'm doing an extremely simple Import Image as Plane using the AddOn and the imported image has an alpha background but it renders (and even previews in the material preview) as black where the alpha background should be.  When I import, I select Emission & Transparent so the material setup is automatic.  I've read similar issues but people are typically missing the transparent node and connecting the Alpha channel from the image into the Mix Node factor.  But this is all here.  I must be missing something really stupid but I've wasted so much time trying to fix this thing.  Any help would be greatly appreciated.  Not sure if it matters but I'm using 2.74 RC2.  Many thanks!  I created this dummy blend file to test outside my project but problem still exists.  Here is the simple .blend file:


Why will an accelerated electron (or a charge) emit a photon?  For example normal matter even if it accelerate or not will emit a photon.

I know how you can emit light with an alternating current, running back and forth, creating an electric field in addition to the magnetic field.  But why does an electron emit light when it gets accelerated, there is no positive end to create an electric field.  Further more, as opposed to talking about currents, talking about acceleration seems to be a different beast entirely.


In fact, our university recommends us to use 2.5cm in the top of pages to redact a thesis. for the text is good but when it comes to chapters they are a little bit in the middle which doesn't respect the requirements. I know latex gives good representation and I like it but the requirement are the requirement. So here is the code:  \documentclass[12pt]{report} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{setspace} \usepackage{mathptmx} \usepackage[a4paper,right=20mm,left=25mm,top=25mm, bottom=25mm]{geometry} \title {title} \begin{document} \doublespacing \maketitle \tableofcontents \chapter*{A} \chapter*{B} \chapter*{C} \chapter*{General Introduction}  Blablabla....  \chapter{I} \chapter{II} \chapter{III} \appendix  \end{document}

I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space.  What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well.   Can anybody help me to remove that space? Is there any mistake in my code or something like that? Is this a default of LaTeX?  the preamble is  \documentclass[12pt,twoside]{report} \pagestyle{plain} \usepackage{a4paper} \usepackage{setspace} \doublespacing  \usepackage{amssymb} \usepackage{amsmath}    I've tried the methods below, but none of them work properly.


Prove that if $ f $ is continuous on $ \left[ 0, \infty\right)$ and uniformly  continuous on $[b, \infty)$ for some $b > 0$ then $f$ is unif. continuous on $[0, \infty)$.  So far I have: Let $A = [b, \infty)$ then $A^c = [0,b)$, my goal is to end up with a compact set from $[0,b]$ so I can use the theorem that "A function is continuous on a compact set $K$ is uniformly continuous on $K$" and then take the fact that of the preservation of connected sets. Am I going about this in the right way?

If I know that $f:(0,\infty)\rightarrow \Bbb R$ is uniformly continuous on the intervals $[a,\infty)$  and $(0,a]$, where $a$ is in $(0,\infty)$, how can I prove that it is uniformly continuous on $(0,\infty)$? I know the general definition of uniform continuity using epsilon-delta, but I am not sure how to apply it to the above.  Thanks   Edit: I meant Uniformly continuous on the first two intervals


We know Elves do procreate and have children. We know they do have sex. Immortal beings with normal reproduction would fill Middle-earth if left unchecked (like rabbits).  We see Elrond with 3 children in 3500 years which would be unlikely for a human.  I can only think of 3 reasons:   Reduced sex. Elves have a reduced sexual drive (similar to Vulcan Pon Farr) so that they have intercourse only every couple hundred of years (sad sad sad life). Reduced fertility. Elves have sex at the normal rate but it’s really difficult for them to get pregnant so you can literally spend 1000 years trying. Contraception. Not so unlikely as some contraception methods are documented going back to B.C. dates.   Is there any canon source as to why there are so few Elves in Middle-earth?

Is there a particular reason the elves die off so fast? After the first war against Sauron, I recall the elves being decimated, to the point that they're almost useless army-wise in the trilogy. But I'm guessing men suffered equal or greater losses as well.  Anyways, other races just seem much more capable of repopulating, while is seems like there are incredibly few (if any?) elven children. Considering the fact that elves are immortal, wouldn't their population be the fastest to grow? Also the seem to be perpetually 40 years old, so aren't they eternally fertile as well? Why don't they have more kids and build bigger societies?


Let $\mathbb{R^{ n×n}}$ be the space of n × n real matrices. Show that if $ A(t) \in \mathbb{R ^{n×n}}$ is a differentiable function of $t$ then $\frac{d(det A(t))}{dt}$ is the sum of the determinants of $n$ matrices, in which the $i$th matrix is $A(t)$ except that the $i$th row is differentiated. Use this result to prove that the directional derivative of the determinant function at the matrix $A \in \mathbb{R ^{n×n}}$ along the direction $B \in \mathbb{R^{ n×n}}$ is given by $$(det)^{'} (A; B) = tr(Adj(A)B) = \langle Adj(A)^{T} , B \rangle $$ where $Adj(A)$ is the adjoint of $A$, and where the inner product on $\mathbb{R^{n×n}}$ is the trace inner product given by $\langle X, Y \rangle = tr(X^{T} Y )$ Conclude that $$D(det)(A) = Adj(A) ^T $$.

I've seen two different results on the derivatives of determinants of matrices:  $$\frac{\partial |X|}{\partial X_{ij}}=X_{ij}.\tag1$$  $$\frac{\partial\det(X)}{\partial X}=|X|(X^{-1})^{T}.\tag2$$  These seem to imply different things. Which is right and why? Can't find it proven anywhere.


How to get every first letter of a word in uppercase and others are in lowercase only. For example, when typing "LATEX FOR DOCUMENT SETTING" or "latex for document setting" or "LateX foR Document SeTTing", LaTeX should produce "Latex For Document Setting" in every case.

I was just reviewing my "capitalization standards" for titles and such and was wondering if there's a macro to do the same thing I'm forced to do by hand nowadays. My personal rules (feel free to disagree/comment on them) are as follows:   the first letter (a number is a letter too for the sake of these rules) always gets capitalized, every word gets capitalized individually, the exception to the rule above (and just the rule above) are  such as prepositions and the like.   In other words: I'd like a capitalization command (like \MakeUppercase) that will capitalize every word not included in a list of words and that will always capitalize the first word of its argument.  Doable?  PS: one such "list" of closed class words (also known as "function words") can be found .


What are the numbers $n$ such that every group of order $n$ is abelian?    For every prime $p$, every group of order $p$ or $p^2$ is abelian. If there is a prime $p$ such that $p^3\mid n$, then I can take a direct product of a nonabelian group of order $p^3$ with a cyclic group of order $\frac{n}{p}$ and get a nonabelian group.   So, we are left with values of $n$ divisible by more than one prime, but not divisible by $p^3$ for any prime $p$.  For some orders of this type (i.e. $35$) all are abelian, but not for all ofcourse.

My question is:     For Which  natural numbers $n$, a finite group $G$ of order $n$ is an abelian group?   Obviouslyو for $n≤4$ and when $n$ is a prime number, we have $G$ is abelian. Can we consider any other restrictions or conditions for $n$ to have the above statement or the group itself should have certain structure as well? Thanks.


I am creating a form in custom module, and I need to show this form in a view. How do I show this form in a color-box popup?  I have created a custom block to render this form, but I don't understand how to show this form in a view page, inside a popup.

I have a form and I am using Drupal 7. I need to show this form in a popup when a user clicks a link. The user should then be able to complete the form whilst in the pop up window. I can use anything like  or modals or anything. I just wanted to know which is the better option and what options do I have for Drupal.


We know that C++ allows :  int a[5] = {0}; // or int a[5] = {};   The same works for std::array  std::array a<int, 5> = {};   However, this won't work:  int a[5] = {33}; // in memory( 33, 0, 0, 0, 0 ) std::array<int, 5> = {33}; // in memory( 33, 0, 0, 0, 0 )   Is there any way to initialize the whole array with a non-zero value without using vector or algorhtm?  Maybe constexpr could help? What would be the best solution?  P.S.:  GCC offers   int a[5] = {[0..4] = 33};   but I am not sure if it is valid for other compilers.

I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?


Is it safe to generate the IV for AES-CBC as the following?   It's like the real IV is all zeros. The first block of data will be a low-entropy but unique data. Once the first block is encrypted, the ciphertext will look like a random sequence of bytes that will automatically serve as IV of the second block   This would allow to save space since we don't have to store a "real" IV in addition to the low-entropy data of the first block that we need to store anyway.  Is it safe to to this thing?

In  to an earlier, related question I noted that encrypting a nonce, such as a sequential counter, using the same block cipher and key as used for the message encryption itself is one of the recommended ways described in , Appendix C, of generating an unpredictable IV for CBC mode encryption.  I further noted that this is, in fact, mathematically equivalent to using an all-zero IV and simply prepending the nonce (padded to a full cipher block) to the plaintext before applying CBC mode encryption.  However, in the comments to , it was noted that this construction is trivially CPA-insecure (as noted e.g. in section 4 of  by Rogaway) if the nonce may be chosen by the attacker.  (Of course, it could be argued that, if your nonces may be controlled by an attacker, you really should be using a fully nonce-misuse resistant mode like  instead of CBC anyway.)  That said, let's take this opportunity to hopefully settle this issue once and for all:   Assuming that the nonce values are unique and generated according to some fixed public counter sequence that is not under the attacker's control, is the encryption scheme described above (i.e. pad the nonce to a full cipher block, prepend it to the plaintext, and encrypt the result using CBC mode with an all-zero IV) actually IND-CPA secure? If so, is there a published proof of this?  If not, is there a known attack under the IND-CPA model that doesn't assume the attacker can choose the nonces? How does the quantitative security (e.g. attacker's advantage as a function of the number of encryption oracle queries) compare to standard CBC mode with random IVs?  AFAICT, both are basically only secure up to the birthday bound, but a more detailed analysis could be useful. As a bonus, what if the nonce is padded to some fixed length that is less than a full cipher block?  Is the resulting scheme still IND-CPA secure (assuming that the nonce doesn't overflow, of course) and if so, how does this affect the number of messages that can be safely encrypted?


My current OS is Ubuntu 16.04 LTS. I, out of curiosity, installed Elementary Desktop. And then I removed it and got back to Unity.   I installed it using following command:   sudo add-apt-repository ppa:elementary-os/stable sudo apt-get update sudo apt-get install elementary-desktop`   and removed it using:  sudo apt-get remove --purge elementary-desktop && sudo apt-get autoremove   Now after reverting back to Unity, when I checked my OS, its still changed to elementary OS.  Following is the text from hardinfo app:  -Version- Kernel         : Linux 4.4.0-45-generic (i686) Compiled        : #66-Ubuntu SMP Wed Oct 19 14:12:05 UTC 2016 C Library       : Unknown Default C Compiler      : GNU C Compiler version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)  Distribution        : elementary OS 0.4 Loki   How can I fix it?

Recently I had installed Pantheon (Elementary OS desktop environment). I didn't like it, so I uninstalled it, but Elementary OS Desktop still appear in the title bar. And in the shutdown button menu, Ubuntu Help is replaced by Elementary OS Help.    I want that it says Ubuntu Desktop and Ubuntu Help. How do I fix it?  The output of lsb_release -a is:  No LSB modules are available. Distributor ID: elementary Description:    elementary OS 0.4 Loki Release:        0.4 Codename:       loki   For installation, I use:  sudo add-apt-repository ppa:elementary-os/daily  sudo add-apt-repository ppa:elementary-os/os-patches sudo add-apt-repository ppa:elementary-os/testing  sudo add-apt-repository ppa:mpstark/elementary-tweaks-daily  sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install elementary-theme elementary-icon-theme elementary-default-settings elementary-desktop   For uninstallation, I remove each repository manually, then sudo apt-get autoremove. And the rest with Synaptic Package Manager.


How can I get an "open file dialogue" box in JavaScript?

Any alternate thing in JavaScript to make a file upload control ?    actually the problem was, i am creating file upload control dynamically using htmlwriter, and when i use request.form[fileuplodctrl].tostring() , i am getting only the file name not path...   can any one suggest me any other ways to get full file path :)


Is it okay to say     Their aim  is to find which element(s) of the input  has(ve) the genuine impact on the output.   My question is concerned with the plural of  element(s) and has(ve).

Consider the following sentence:     We assume that the individual(s) possesses some general knowledge of the rules of football.   Is "possesses" correct there? Should it be "possess"? Is the rule more complex than always using one or the other?


I'm a Java noobie so I'm still not familiar with the tools this language has. What I'm writing is an expression evaluation program, whose only operations are * and +. For input : 2+2*2*2*2*2*2+2*2 I should get an output of 70 but instead, my main throws a java.lang.NullPointerException where I call the function and where I try to push it on the stack. I've tried using Charachter.valueOf() but the outcome is the same. My questions are:   How to convert a primitive type char to a Character? Why is new Character deprecated?   Here is my stack implementation:   public class MainClass {          //ExpressionEvaluator MainClass       public static int evaluateExpression(String expression){          int evaluation = 0, a = 0, b = 0, tmp = 0;          char ch1, ch2, op;          LinkedStack<Character> operand = null;          LinkedStack<Character> operator = null;          for(int k = 0; k<expression.length(); k++){              if(Character.isDigit(expression.charAt(k))){                  op = expression.charAt(k);                  operand.push(new Character(op)); // <----- then error here             }                                           // won't let me push it on the stack             else{                 operator.push(expression.charAt(k));             }         }         if(operator.peek() == '*'){             evaluation = 1;         }         while(!operand.isEmpty() && !operator.isEmpty()){             a = operand.pop();                       ch1 = operator.pop();                    if(ch1 == '*'){                              evaluation *= a*operand.pop();             }             else{                                        tmp = a;                                 a = operand.pop();                       ch2 = operator.pop();                    if (ch2 == '*'){                     evaluation *= a*operand.pop();                 }                 else{                     evaluation += a+tmp;                 }             }         }         return evaluation;     }      public static void main(String[] args) throws IOException {         BufferedReader input=new BufferedReader(new InputStreamReader(System.in));         System.out.println(evaluateExpression(input.readLine()));//  <--------   first error here     }  }

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 am told this may be connected to the properties of numbers modulo 9.   Thank you.

Let $A = 4444^{4444}$;  Then sum of digits of $A = B$; Then sum of digits of $B = C$; Then sum of digits of $C = D$;  Find $D$.  What should be the approach here?


Let $R$ be a commutative ring, and $I$, $J$ be two ideals in $R$.  Show, by giving an explicit example, that the set of products $\{xy\ |\ x\in I, y\in J\}\subset R$ need not be an ideal.  The definition of "ideal" we're using is:     An ideal is a subset $I$ of a commutative ring $R$ that satisfies the following properties:      1) $0\in I$.      2) If $x\in I$ and $y\in I$, then $x+y\in I$.      3) If $x\in I$ and $a\in R$, then $ax\in R$.   The set of products will contain $0$, so property 2 or 3 has to fail. I can't come up with an example. Any suggestions?

Let I and J be ideals of a ring R. Show by example that the set of products {xy | x ∈ I, y ∈ J} need not be an ideal, but that the set of finite sums of products of elements of I and J is an ideal. This ideal is called the product ideal, and is denoted by IJ.   I want to check if my work on the first part makes any sense. I am not sure if I am picking the right example.  If I let R = Z and I = (2) and J = (3) then I has multiples of 2, and J has multiples of 3  6 will divide the product IJ if we add 2 and 3 though we get 5 in IJ, but I am not sure if 5 Divides IJ.


EDIT: Yes, this is a duplicate, my mistake (I am new to CSS).  But can anybody explain the rationale behind aligning the image, as opposed to the link / text?  Is there some larger concept at work here that would help me understand the concepts of CSS better and avoid problems like this in the future?  Original (Duplicate) Part: I have a scenario where I want to have a link next to an image on my page, and the link should be aligned so that it is vertically centered with the image.  Of course I don't know the exact height of the image, so this should be done dynamically.  Given this chunk of HTML, how would I achieve such a thing with CSS?
          My Link!
   I have a , and you will note that I have placed some size information in the image class.  This is just to simulate an image of unknown size, so please consider the question without it.

Why won't vertical-align: middle work?  And yet, vertical-align: top does work.   span{   vertical-align: middle; }
      Doesn't work.


How does a wavefunction collapse into one state? More specifically, what conditions cause a wavefunction for a quantum particle to collapse?    Does this have to do with density matrices?    Please try to give a mathematical explanation that is simple and concise...

As is usually said, measurement of an observable $q$ leads to collapse of wavefunction to an eigenstate of the corresponding operator $\hat q$. That is, now the wavefunction in $q$ representation is $\psi(q)=\delta(q-q_0)$ where $q_0$ is result of measurement.  Now, in reality measurements are never exact, so the wavefunction should not have that sharp peak. Instead it should be broadened depending on precision of measurement. In this case, can we still introduce an operator, an eigenstate of which would the new wavefunction appear? Is it useful in any way? Or does the new wavefunction depend too much on the way it was measured so that each instrument would have its own operator? How would such opeartor look e.g. for a single-slit experiment?


What is this long dark section? I'm not sure what I did to make it appear but it prevents me from seeing other objects in my scene. I tried adjusting the clipping already but it did not seem to help.

When looking at my objects in 3d view I'm seeing a gray cone that seems to be hiding other objects.   Can anyone help me turn this off and explain what it is please.  Screenshots attached.


I need to sort my HashMap according to the values stored in it. The HashMap contains the contacts name stored in phone.  Also I need that the keys get automatically sorted as soon as I sort the values, or you can say the keys and values are bound together thus any changes in values should get reflected in keys.  HashMap<Integer,String> map = new HashMap<Integer,String>(); map.put(1,"froyo"); map.put(2,"abby"); map.put(3,"denver"); map.put(4,"frost"); map.put(5,"daisy");   Required output:  2,abby; 5,daisy; 3,denver; 4,frost; 1,froyo;

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?


From my readings I understand that Monads are mainly used for:  -Function Composition  by matching one Functions Output Type to another Functions Input Type.  I think this is a really good Article:    It explains Monads with the concept of boxes/wrappers. But I don't understand what are these wrappers used for? What's the benefit of the Wrapper other than Composition?  Also IO Monad is a common example.  name <- getLine -- name has the type String and getLine IO String   So what's the benefit of this type difference? Is it Error Handling?

Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is?  I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail.


Why can't the electrons that are attracted to positive terminal of cell flow through the wire ?

Consider this reverse biased diode :     I read that no or very small current flows in reverse biased diode as depletion layers get widened and huge resistance is offered so no electrons can cross it. But, why the electrons or holes need to cross the depletion layer? In the diagram above, the positive charges (holes) are moving towards left and the current due to electrons is also in left, so won't the circuit be completed?


So can I go back to the old Menu Desktop.  I would like the old desktop like in 9.04

I'm used to GNOME Classic and personally don't want to change to anything else, but it seems there is no more GNOME Classic in the Oneiric release. After apt-get installed gnome-session and all, though there comes back the GNOME Classic option in the session listbox, however, after logged in, it seems not the expected one.  There is no System menu in the top bar, and I couldn't customize panels at all. I want to change the appearance(theme), but I can't find Appearance menu at all. And much more differences to my previous experience of GNOME classic shell.    There are multiple valid answers for this question spanning over several versions of Ubuntu. For your convenience an index of each below:    and up      &


I am using ubuntu 12.04. Can I install windows 7 and use it as a dual boot system. When I tried this earlier windows doesn't detect ubuntu.Is there any solution for this.

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I usually start with   \documentclass[12pt,a4paper,landscape]{article}   but, How can I set a document font size to 14, 16 or 18 pt ?  I had used {\fontsize{16}{1}    all document }  and have no desired results.

I'm trying to make a document that has a very small font throughout, I tried this:  \documentclass[0.5mm, a4paper]{article} \documentclass[7pt, a4paper]{article}   But it doesn't seem that they allow me to go anything below 10pt.  This hack make it work, but not for the section headers:  \fontsize{4mm}{5mm}\selectfont   Does anyone know any better ways to do this?


If  an object has an instantaneous velocity of zero, does this mean that its acceleration is zero?

I'm studying for my upcoming physics course and ran across this concept - I'd love an explanation.


I have Stack Overflow, Meta and Super User accounts. I have been trying to remove my email from my profile. So I delete the email and then choose:     "Save and copy profile to all Stack Exchange Accounts"   A couple of days later, somehow the email addres is again showing in my profile. If an admin is seeing this, I'm asking to remove my email from your system before you fix the bug.

It seems that I'm unable to persistently remove my email address from my profile pages.  Initially removing my email address works fine, I simply visit my profile page on any site associated with my account, edit my email and press the Save And Copy Profile To All Stack Exchange Accounts button. So far, so good.  However, if I'm logged out; whether logging out manually or visiting the site from a new device; I then log into any of my sites using the Stack Exchange method and the following happens:   For the profile page on that site, the email field is automatically re-populated.  For the profile page on subsequently visited sites, I'm automatically logged in but the email field remains empty. I have tested logging into each of the sites and it's only ever the first site that I log into where the profile pages get repopulated with my email address.   Is this expected behavior of Stack Exchange sites or a bug?  Other things to note:   I assume that the email address field on the profile pages are not mandatory. The email address that is repopulated is one I use to log in with the Stack Exchange method. My motives in trying isn't out of email privacy but simply bafflement. I'm aware that .


In the game "Don't Fall Off The Cliff," you may move forward any positive number of steps, not move, or move one step backward. Each of these three options takes one turn. How many ways can you finish and come back to the point where you started after 𝑛 turns, while never going behind where you started? It looks like a Catalan Number. But l am only familiar with the two-dimensional one. This problem should be 3-dimensional. X refers to go forward any positive number of steps, y refers to stay there, z refers to move one step backward

In a game, you are standing somewhere and a move consists of either moving forward any number of steps, not moving at all, or moving $1$ step backwards. If you complete $n$ moves, find the number of sequences that end with you in your starting position and which never go behind your starting position. If the "never go behind the starting position" condition weren't there, the answer would just be $\binom{2n-1}{n-1}$. However I'm not on sure how to proceed from here.


What does the keyword 'this' means in TextView textView = new TextView(this);  Below is quote sniplet  public class DisplayMessageActivity extends ActionBarActivity {      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         //setContentView(R.layout.activity_display_message);         Intent intent = getIntent();         String message = intent.getStringExtra(MyActivity.EXTRA_MESSAGE);         TextView textView = new TextView(this);         textView.setTextSize(40);         textView.setText(message);         setContentView(textView);     }     ....   My guess is it initialize the object textView but with what?

If I write the following class:  public class Example {        int j;       int k;        public Example(int j, int k) {            j = j;            k = k;       }        public static void main(String[] args) {            Example exm = new Example(1,2);            System.out.println(exm.j);            System.out.println(exm.k);       }  }   The program compiles, but when I run the program, the main method will print out two 0s. I know that in order to say that I want to initialize the instance variables in the constructor I have to write:  this.j = j; this.k = k;   But if I don't write it, then which variable is evaluated (or considered) in the constructor (on the left and on the write hand side of the expressions)? Is is the argument or the instance variable? Does it make a difference?  Are there other cases where the use of this is obligatory?


child = [] parent = [1, 3, 5, 7, 9] index = 2 child.append(parent[:index])   When I have this code run, instead of returning me a child list of  child = [1, 3]   I get a child list of:  child = [[1, 3]]   Is there a single line method of copying a few objects of a list into another list without making it into a nested list?

What's the difference between the list methods append() and extend()?


I want to install ns2 on my Ubuntu 12.04. As usual am trying to install some essential software before installing it. I tried to install:  sudo apt-get install perl xorg-dev g++ xgraph libxt-dev libx11-dev libxmu-dev   And I get this message:  Reading package lists... Done Building dependency tree        Reading state information... Done Package xgraph 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 'xgraph' has no installation candidate   What should I do?   I ve searched everywhere online for a solution but got none.   How can I solve this?

Occasionally, when I'm installing stuff, I get an error like the following:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages.   How can I resolve this?


I have 2 objects Case & Level agreement ( Don't have any relationship between both objects) I want to compare Task Category value for both objects ...When I write below query on Apex class getting the error:     An Apex error occurred: System.QueryException: List has more than 1   row for assignment to SObject   Queries in Apex class:  Case c = [select id,Task_Category__c,CaseNumber from Case where id IN:CaseId];  Level_Agreement__c sla = [select id,Task_Category__c,Process_Approver_email__c from Level_Agreement__c where Task_Category__c =:c.Task_Category__c];     pls, let me know is there anything missing from my side... Thanks Ram

I am trying to write a VF page to list all the id and name columns from a custom object but found an error "List has more than 1 row" in the VF page.  Can anyone tell me what have I done wrong?  VF Page:  <apex:page Controller="MP_controller" showHeader="false" sidebar="false">   <apex:pageBlock>      <apex:pageBlockTable value="{! mp}" var="item">         <apex:column value="{! item.id}"/>         <apex:column value="{! item.name}"/>       </apex:pageBlockTable>   </apex:pageBlock> </apex:page>   Apex controller  global with sharing class MP_controller {     public Merchant_Profile__c mp{get;set;}     public MP_controller(){         mp = [SELECT                  ID, name, Profile_account_name__c, Merchant_ID__c, Bank_Code__c, Country_Code__c,                 Currency_Code__c, Merchant_Level__c, Merchant_Type__c, MSO__c, Region__c,                 Retail_Products__c, Transaction_Mode__c, Created_Date__c, Date_Disabled__c, Date_Live__c,                 Merchant_Category_Code__c                FROM Merchant_Profile__c               WHERE Profile_Account_Name__c = '001O000000bQFnyIAG'];     } }


final Map map =     new ConcurrentHashMap<>();  Why declare a Map and instantiate a ConcurrentHashMap?

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


Actual Question is to prove that, for a prime p and $a\in F_p$, $a\neq 0$, $f(x)=x^p-x+a$ is irreducible.  This is an exercise Question in Dummit Foote 13.5.5.  Hint : Prove that if $\alpha$ is a root of $f(x)$ then so is $\alpha+1$.  Proof: Suppose $f(\alpha)=0$ i.e., $\alpha^{p}-\alpha+a=0$ Consider $(\alpha+1)^{p}-(\alpha+1)+a=\alpha^p+1-\alpha-1+a=\alpha^{p}-\alpha+a=0$ . So, I proved that if $\alpha$ is a root of $f(x)$ then so is $\alpha+1$.  As further approach I have seen that no element of $F_p$ is a root because if $\alpha\in F_p$ is a root then so is $\alpha+1$ and so is $\alpha+2$ and so would be  $0\in F_p$ which is a contradiction as $f(0)=0-0+a=a\neq 0$. So, No element of $F_p$ is a root.   Just by this he wants to say that $f(x)$ is irreducible i.e., if $f(x)$ has no root in $F_p$ then it is irreducible.   I am unable to proceed further in this line. Any help would be appreciated.  Thank You.  P.S : I have seen just now that this question was already answered. I thought of deleting this Question. But Mr.AymanHourieh gave another nice answer. So, i Request Not to close this as this would just give another answer.   Thank You

Let $p$ be a prime. How do I prove that $x^p-x+a$ is irreducible in a field with $p$ elements when $a\neq 0$?   Right now I'm able to prove that it has no roots and that it is separable, but I have not a clue as to how to prove it is irreducible. Any ideas?


I would like to forecast for next 2 months using 1 year data captured at monthly level.  sample of the data    201702  7 201703  1344 201704  1311 201705  2645 201706  8581 201707  7271 201708  11550 201709  11372 201710  7089 201711 10677 201712 9147 201801 2992   first column indicated month, second column indicates demand of product. I have used time series like arima, ets, ma all of them over fit.  Can you suggest some basic models that may solve the problem?  Thanks

I have a question related to modeling short time-series. It is not a question , but how. What method would you recommend for modeling (very) short time-series (say of length $T \leq 20$)? By "best" I mean here the most robust one, that is the least prone to errors due the fact of limited numbers of observations. With short series single observations could influence the forecast, so the method should provide a cautious estimate of errors and possible variability connected to the forecast. I am generally interested in univariate time-series but it would be also interesting to know about other methods.


I am trying to solve  problem. I wrote  `  public static void main (String[] args) throws java.lang.Exception     {         Scanner sc=new Scanner(System.in);         int t=sc.nextInt();         while(t>0){             String s=sc.next();             if(s=="b" || s=="B"){                 System.out.println("BattleShip");             }             else if(s=="c" || s=="C"){                 System.out.println("Cruiser");             }             else if(s=="d" || s=="D"){                 System.out.println("Destroyer");             }             else if(s=="f" || s=="F"){                 System.out.println("Frigate");             }             t--;         }     }   `  There is no mistake in terms of syntax. Please help me what is mistake

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


Trying to filter command output according pattern -p docker run --help |grep -F '-p'  But grep treats it as -p as command option: grep: invalid option -- 'p' Usage: grep [OPTION]... PATTERNS [FILE]... Try 'grep --help' for more information.  How to make grep search according -p pattern?

sudo find / -name "*" | xargs grep -sn --color=auto "-j"   Above command returns below:  grep: invalid option -- 'j' Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. ...   How do I search for string -j?


Why does the total no. of subsets of $n$ elements equal $2^n$? I was taught that it is because each element has two choices either making a set or not. Thus giving $2×2×2\ldots$ subsets. But I didn't understand how does it work in giving this result.

In my probability book, it says that to count the total number of subsets of n elements is a process of $n$ stages with binary choice of either adding this element to the subset or not to add it. Therefore, the total number is $$2^n$$  But, for instance, we have 3 elements, according to this formula, there are 2 to the power of 3 elements, namely 8, which are $${\emptyset},A,B,C, AB, AC, BC, ABC$$  However, I have a hard time of imagining the process or N stages binary choice that form this many subsets. Can anyone explain/help me to understand it? I mean, ABC, if we are making the choice of A, put it in or do not put it in, exactly which subset are we choosing to put in or not? Thank you.


I am working on a lab and it is asking me to create a method and test it. The method I created uses an object as one of the arguments. When testing the method what would I put in the argument that asks for an object. I apologize if this is confusing I will try to post enough so someone can help. Let me know if you need more information. Here is the method I was told to create. The object I am talking about is the first argument in buildRow(). I am trying to test that method but do not know what to put as the first argument. The HtmlFormat is just another class I made and used but shouldn't really matter for my question.  Here is how I am trying to test it. The WhoDataItem is also another class that I am using to grab other method from.  Here is the WhoDataItem class if you need to look at it. I am just using the getCountry() method.

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?


Here is the situation. I am in an office full of physicists and one physicist is writing his PhD Thesis. Fundamentally, he wants to know whether he should type "an SV" or "a SV" into the computer.  SV is an acronym for "Secondary Vertex", so it is clear to us that "a secondary vertex" is correct.  So the argument is over whether   a or an "sounds better"   and additionally   is SV a new, alternative word which means the same thing as "secondary vertex" (just as one can use "roll", "bap", "barm" interchangeably in the phrase "bacon roll" to mean some bread which is probably also buttered into which one has inserted some grilled, or otherwise cooked using another method, bacon causing the butter to melt into a delicious snack most suited for eating at lunchtime. or is SV an object which is to be expanded by the readed using a previously defined definition (should one read "SV" as "secondary vertex"?)   So, he should type "a secondary vertex", but is it "an SV" or "a SV". My vote is for the former as it "sounds better". (Or at least that is my opinion.)  Finally, we also consider "an STFC" or "an SRVTLVF" to be "better sounding", however "a TRVTLVF" seems to be "better sounding". We have discovered that it doesn't seem to matter what the letters of an acronym following a first "S" letter are, the "better sounding" choice is still "an" rather than "a".  Is there a rule about whether "a" or "an" should be used for acronyms?

99% of the time, I'm clear on when I should use "a" versus "an." There's one case, though, where people & references I respect disagree.  Which of the following would you precede with "a" or "an," and why?   FAQ FUBAR SCUBA   [Note: I've read the questions  and , but the rules given there don't necessarily apply here.]    [Edited to add]  Here's a shorter (and hopefully clearer) version of the question…  In written English, which is correct (and why): "a FAQ" or "an FAQ"?  Some references with differing opinions:   an: the  and  a: the Microsoft Manual of Style for Tech Publications, 3e either: the  and


My question is can we get the Hamiltonain from Dirac Equation? We have the following for Dirac equation:  $$(i\gamma ^\mu \partial_\mu-m)\phi=0.$$   Then separating the time and space components:  $$(i\gamma ^0 \partial_0-i\gamma ^i \partial_i-m)\phi=0.$$  Then I try to write it in form $i\partial_0\phi=H_D\phi$  so if i take time component to one side and take the i components to the other side:  $$i\gamma^0\partial_0\phi=(i\gamma^i\partial_i+m)\phi.$$  now is it right or should I multiply everything by $\gamma^0$? If I try to do that i get nothing like the dirac hamiltonian. any help is appreciated. Thank you.   PS. this question is from chapter 10 of Matthew Schwartz Quantum field theory and the Standard model Problem 10.1.

Let us consider Dirac equation $$(i\gamma^\mu\partial_\mu -m)\psi ~=~0$$ as a classical field equation. Is it possible to introduce Poisson bracket on the space of spinors $\psi$ in such a way that Dirac equation becomes Hamiltonian equation   $$\dot{\psi}~=~\{ \psi,H\}_{PB}~?$$  Of course, such Poisson bracket would be graded (super Poisson bracket), but if it exists this would explain on classical level why $\frac{1}{2}$-spinors correspond to fermions.


I have a List with 2 lists inside , like a matrix, after I populate this list, I excecute some calculations with a Loop, to populate a third List, but this doesnt work correctly. I have an if statemnt to check if the values are the same, but it only works once, after it found a match it doesnt find another match again, sorry for the code im a begginer Here is the code: List<List<String>> dynamic2D = new ArrayList<List<String>>(); dynamic2D.add(new ArrayList<String>()); dynamic2D.add(new ArrayList<String>());  dynamic2D.get(0).add("type2"); //populate first inner list dynamic2D.get(0).add("type3"); dynamic2D.get(0).add("type1"); dynamic2D.get(0).add("type2");  dynamic2D.get(1).add("1"); //populate second inner list dynamic2D.get(1).add("3"); dynamic2D.get(1).add("5"); dynamic2D.get(1).add("6");  ArrayList<String> amountOfTypes = new ArrayList<>(); //After deleting repeated values I get the amount of types existing on my first inner list amountOfTypes.add("type1"); amountOfTypes.add("type2"); amountOfTypes.add("type3");   ArrayList<Integer> amountOfValuesOfTypes =new ArrayList<>(); // I populate this list with 0 values to later make a Sum of each value existing in the second inner list that correspond to the first inner list  for(int i = 0; i<amountOfTypes.size();i++){ // Here I have a list with 3 zero values, {0,0,0}, because there are 3 types of values     amountOfValuesOfTypes.add(0);  }  // Now here is the problem, Im trying to sum the respective values of each type, that correspond with the second inner list. in order to get the raw amount.  for(int i = 0; i<amountOfTypes.size();i++){     for(int j = 0; i<dynamic2D.get(0).size();j++){ // a second inner loop to compare the value of my main list(that has all the values) with the filtered list (that only have values that do not repeat)         if(amountOfTypes.get(i) == dynamic2D.get(0).get(j)){             int secondListIntToString= Integer.valueOf(dynamic2D.get(1).get(j)); // Here I get the corresponding match Integer Value             amountOfTypes.set(i,amountOfValuesOfTypes.get(i)+secondListIntToString); // Here I take the values that match by THE CRITERIA OF HAVING THE SAME VALUE IN THE FIRST INNER LIST, and make a sum to have the full value, but when there is a match it only sum ONCE, and it doesnt happen again          }     }  }  Thanks for any help.


I need to write a shell script that find and print all files in a directory which starts with the string: #include. Now, I know how to check if a string is in the file, by using:  for f in `ls`; do     if grep -q 'MyString' $f; then:         #DO SOMETHING     fi   but how can I apply this to the first line? I thought to maybe create a variable of the first line and check if it starts with #include, but I'm not sure how to do this. I tried the read command but I fail to read into a variable.  I'd like to hear other approaches to this problem; maybe awk? Anyway, remember, I need to check if the first line starts with #include, not if it contains that string. That's why I found those questions:   they are not completely helping.

I am writing a script, I want to check if the first line of the file matches a certain pattern and if it does then print out the file. How can I achieve this?  How do I check for pattern? Is there a way to check for pattern and based on the output do something..  EDIT: Please take a look at this question:   I want something like this, but none of them worked for me. I basically want to check if the first line matches a regex pattern or not and based on that print the lines of file.


Ive been using my ubuntu 14.4 system for awhile now.Its just Ubuntu,i havent installed it along any other os.learning as I go. Ive been doing allot of updating removing and downloading. So much so that I downloaded "Bleachbit" to keep the system clean. I get anywhere from just a few files cleaned to ,at one point, 6000+ files cleaned. Just did it again while typing and got another 4075 cleaned.   I have one SSD 240gig that Ubuntu is on and two 2TB drives for storage.Ive been reading some posts and decided to pull up "system monitor" to see what it had to say. well, i only see one of the 2tb drives,yet i can access them both from the sidebar.My main problem is the SSD, specifically SDA1 (7.7gig),its almost full. SDA6 (212.5gig) is empty.I thought I set up a 8gig partition for the swap but i dont see it.IM guessing sda1 is the root partition? When I installed this I did it from a youtube video and followed the guys steps so i dont even remember what or why i partitioned the way i did. dumb,i know.... My question is how can i see all the partitions and/or monitor them.     What do I need to do about sda1 being 86% full? Is there a way to repartition it? Do i need to move the root files? What do you do in this situation? any help would be greatly appreciated.Its been so difficult just getting this far, i really dont want to do a fresh install..ok, couldnt post a pic so i added it the best i could in a comment...

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I've been studying some lecture notes on abstract algebra, and they claim at one point that a proof that a function $f: A \to B$ is injective if and only if it has a left inverse requires choice. The proof of surjectivity if only if there exists a right inverse, surely does (there may exist $b \in B$ with more than one, in fact infinitely many, preimages in $A$), but I don't believe the left-inverse proof requires it. This is what I have in mind. I'm going to skip the left inverse implies injective proof, as it surely doesn't require choice.  Let $f: A \to B$ be injective. Given $b \in B$, we have iether $b \in f(A)$ or $b \not \in f(A)$. If $b \in f(A)$, there exists a unique, since $f$ is injective, $a \in A$ such that $f(a) = b$. Fix $a_0 \in A$. Then define the map $g: B \to A$ sending $b \to a$ if $b = f(a)$ for some $a$ and $b \to a_0$ otherwise. Then for any $a \in A$, we have $(g \circ f)(a) = g(f(a)) = a$, so $g$ is a left inverse.  I don't believe I used the axiom of choice anywhere in this proof. Is that correct?

In part of the proof of the splitting lemma (a left-split short exact sequence of abelian groups is right-split) it seems necessary to invoke the axiom of choice. That is, if $0\to A\overset{f}{\to} B\overset{g}{\to} C\to 0$ is exact and there is a retraction $B\overset{r}{\to}A$, then we can find a section $C\overset{s}{\to}B$ by choosing any right inverse of $g$ and removing the part in the kernel of $f$, which gives a well-defined morphism independent of the choice.  Is this invocation of the axiom of choice essential? I thought I had an example that showed it was: $0\to\mathbb{Q}\to\mathbb{R}\to\mathbb{R}/\mathbb{Q}\to0$ splits on the right if you can choose a basis for $\mathbb{R}$ as a vector space over $\mathbb{Q}$. But actually now I think it doesn't split on the left without a basis either.  The map $C\to B$ is supposed to be a canonical injection map. Can something be "canonical" if it requires choice?


At least one user is following the  proposal but he is not listed as a follower.  .  Did I miss something? Is it a bug? Is there other users in that situation?

I know of one person who is following my proposal who doesn't show up on the proposal webpage.    My proposal is for quantitative finance: .  It shows 19 people following the proposal (on the side of the page), and the total listed at the top of the page is 19 followers.  Yet one user is not listed: .  This makes me wonder if other followers are also not being counted?


I am reading a book in probability theory, which claims that the $\sigma$-algebra $\mathcal{B} ( \mathbb{R}^{[0, \infty)})$ on  $ \mathbb{R}^{[0, \infty)}$ is so "small" that it does not include even the space $C[0,\infty)$, which is the space of continuous functions from $[0, \infty)$ to $\mathbb{R}$. To be precise, it says that      The only $\mathcal{B} ( \mathbb{R}^{[0, \infty)})$-measurable set contained in $C[0,\infty)$ is the empty set.   By definition, $\mathcal{B} ( \mathbb{R}^{[0, \infty)})$ is the $\sigma$-algebra generated by the collection of cylinder sets of the form $$ \{ \omega \in \mathbb{R}^{[0, \infty)} \, | \, (\omega(t_1), \ldots, \omega(t_n)) \in A \},$$ where $t_i \in [0, \infty)$ and $A \in \mathcal{B} ( \mathbb{R}^n)$.   Intuitively, this definition suggests that $\mathcal{B} ( \mathbb{R}^{[0, \infty)})$-measurable sets are only determined by countably many coordinates, whereas a continuous function is determined by uncountably many values. But I do not know how to prove this rigorously. Any suggestions?

Let $C(\mathbb{R})=\{ f:\mathbb{R}\to \mathbb{R} \colon \ f \text{ continuous}\}\subseteq \mathbb{R}^{\mathbb{R}} $. How to prove formally that $C(\mathbb{R}) \notin \mathcal{B}(\mathbb{R}^{\mathbb{R}})$ (the product sigma algebra)?  The classic proof said that   $A \in \mathcal{B}(\mathbb{R}^{\mathbb{R}})$ iff exists $J\subseteq \mathbb{R}$ with $|J|\leq \aleph_0$ and $B\in \mathcal{B}(\mathbb{R^J})$ such that $A=B \times \mathbb{R}^{\mathbb{R}\setminus J}=\{f \in \mathbb{R}^\mathbb{R} \colon  \ (f(j) \colon \ t \in J) \in B\}$. In simpler terms,  $A$ only can have countable restrictions but the set of continuous functions have uncountable restrictions since every function on $C(\mathbb{R})$ needs to be continuous in every point $x \in \mathbb{R}$.  The last part of this proof always didn't satisfied me at all, and I don't really know how to do this proof formally.   Any help or references will be appreciated.


friends,  i am very new to ubuntu,and is been using this incredible thing from past few days, it's a really very new experience for me,i would like to know about one click install methods as like in windows we found .exe softwares every where, is there any method? and please do suggest me some awesome websites for repository's. Thanks

The title says it all. I'd like to know how I can install software - an example is the Chromium web browser.