I can barely understand the Exception in my code.  package botclean;  import java.util.Scanner; import java.lang.Math;  public class BotClean {      private static int nodeX[], nodeY[];     private static char[][] matrix;     private static int dirt[], botX, botY;     private static int number_of_dirt=0;     private static int number_of_paths=0;     private static Path firstpath;     private static Path paths[];     private static int path_counter = 0;       public static void main(String ab[])     {     String s;     matrix = new char[5][5];     Scanner sc = new Scanner(System.in);     botX = sc.nextInt();     botY = sc.nextInt();       s = sc.nextLine();     for(int i=0; i<5; i++)     {     s = sc.nextLine();     for(int j=0; j<5; j++)     {         matrix[i][j] = s.charAt(j);     }     }      searchDirt();       make_Paths(firstpath);       final_Path();     }      private static void searchDirt()     {          firstpath = new Path();         firstpath.dirtX = new int[25];         firstpath.dirtY = new int[25];          for(int i=0; i<5; i++)         {         for(int j=0; j<5; j++)         {         if(matrix[i][j]=='d')             {             firstpath.dirtX[number_of_dirt] = i;             firstpath.dirtY[number_of_dirt] = j;             ++number_of_dirt;             }         }     }       number_of_paths = 1;      for(int i=2; i<number_of_dirt; i++)     number_of_paths *= i;      System.out.println("number_of_paths = " + number_of_paths);     System.out.println("number_of_dirt = " + number_of_dirt);       paths = new Path[number_of_paths];      for(int i=0; i<number_of_paths; i++)     {          paths[i].dirtX = new int[number_of_dirt];         paths[i].dirtY = new int[number_of_dirt];      }      }      private static void make_Paths(Path pth)     {     int counter=0;      for(int i=1; i<=number_of_dirt; i++)     {     for(int j=1; j<=number_of_dirt; j++)     {     if(i==j)     counter = (i/j)-1;      else if(i<j)     counter = (i/j)+(j-1);      else     counter = (j/i)+j;       paths[i-1].dirtX[counter] = pth.dirtX[j-1];     paths[i-1].dirtY[counter] = pth.dirtY[j-1];     }      } }  private static void final_Path() {     int steps1=0,steps2=0;      for(int i=0; i<number_of_dirt; i++)     {         firstpath.dirtX[i] = paths[0].dirtX[i];         firstpath.dirtY[i] = paths[0].dirtY[i];     }      for(int i=1; i<number_of_paths; i++)     {     for(int j=0; j<number_of_dirt; j++)         {          steps1 += Math.abs(botX-firstpath.dirtX[j]);         steps1 += Math.abs(botY-firstpath.dirtY[j]);          steps2 += Math.abs(botX-paths[i].dirtX[j]);         steps2 += Math.abs(botY-paths[i].dirtY[j]);          }     if(steps1>steps2)         {          for(int j=0; j<number_of_dirt; j++)             {             firstpath.dirtX[j] = paths[i].dirtX[j];             firstpath.dirtY[j] = paths[i].dirtY[j];             }         }      steps1=0; steps2=0;     } }    private static class Path{     int dirtX[];     int dirtY[]; }  }   If you copy-paste the code, you will encounter NullPointerException at line:93. The statement - >     paths[i].dirtX = new int[number_of_dirt];

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?


In my current application while I have been able to implement the required logic that I need I am really stuck when trying to take off the content from the main method and using it from a different method .  My code is as below,  class Program     {         const string path = @"filePath";         static void Main(string[] args)         {             setUpValues();         }         private static void setUpValues()         {                 var Content = JsonConvert.DeserializeObject<deploy>(File.ReadAllText(path));                 List<Variable> variables = Content.Variables.ToList();                 Scopes Scope = Content.ScopeValues;                  string Version = null;                  List<string> ListOfSelectedItems= new List<string>();                 List<string> TempListOfSelectedItems = new List<string>();                 List<string> Channels = new List<string>();              foreach (var item in variables)             {                 if (item.Name.Equals("version"))                 {                     Version = item.Value;                 }                 if (item.Name.Equals("Selected"))                 {                     TempListOfSelectedItems.Add(item.Value);                 }             }              Console.WriteLine("Version  " + Version);             Console.WriteLine();              string SelectedItems= TempListOfSelectedItems[0];             ListOfSelectedItems = SelectedItems.Split(',').ToList();              Console.WriteLine();             Console.WriteLine("Selected Modules");             Console.WriteLine();              foreach (var item in ListOfSelectedItems)             {                 Console.WriteLine(item);             }              foreach (var item in Scope.Channels)             {                 Channels.Add(item.Name);             }         }     }   I want to be able to access the variable string Version ,  the List of ListOfSelectedItems and the List of channels from outside this method .. I want to use these in another as well . So how can I make these globally accessible ? Would really appreciate your help on this as I have been stuck here

I am trying to save data to a database on a button push, but the variables seem to be private by the nature of where they are defined. I have tried to move where they are defined, but this seems to produce other errors.  Given a fix, why was it fixed that way?  The code follows.  namespace enable {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();             OleDbConnection favouriteConnection = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\\\192.168.123.5\\Share\\Matt\\BugTypes.mdb");             string strSQL = "SELECT CategoryName, Show " + "FROM [Categories] WHERE Show = 'Yes' " + "ORDER BY CategoryName";             OleDbDataAdapter adapter = new OleDbDataAdapter(strSQL, favouriteConnection);             OleDbCommandBuilder cBuilder = new OleDbCommandBuilder(adapter);             DataTable dTable = new DataTable();             adapter.Fill(dTable);             BindingSource bSource = new BindingSource();             bSource.DataSource = dTable;             dataGridView1.DataSource = bSource;             adapter.Update(dTable);         }         private void button1_Click(object sender, EventArgs e)         {             adapter.Update(dTable);//this is the button that needs to do the save, but can't see the variables.         }     } }


I was writing a function to return a 2D array full of random numbers, and after looking at the doc for random, I came up with this:  def get2D(arr, mu, sigma, randfunc): x = 0 for i in arr:     get1D(arr[x], mu, sigma, randfunc)     x += 1 return arr  def get1D(arr, mu, sigma, randfunc):     x = 0     for i in arr:         arr[x] = randfunc(mu, sigma)         x += 1   And after a bit of looking around to see if I can initialize an array of a specific shape without numpy (nothing against numpy, just to see if I can reduce the number of dependencies) I found this:  [[0]*2]*2   But when I run the function using the above, I end up with unique numbers in the inner most dimensions but everything after that are repetitions. e.g. [[1,2],[1,2]]  Since I don't have much of a theoretical understanding in python, I was just shooting in the dark. That was a reason why I used for loops instead of list comprehensions; I was trying to prevent bugs caused by my limited understanding of python.  To check if I messed something up with the function pointers or something, I tried using  as input, and the function worked fine.  From that I'm guessing I created some sort of internal linking when I initialized the zero array. Just to check, I tried with 3D arrays, and got the sme results. e.g. [[[1,2],[1,2]],[[1,2],[1,2]]]  But I can't figure out why [0]*2 returns a zero array of items that are not linked to each other, but [0,0]*2 returns a whole bunch of linked items.

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


I have two base classes Vehicle and WorkerUnit and they have derived classes Bus and Maintenance respectively.  The Maintenance class has to be initialized with a variable of class Vehicle (or the derived classes of Vehicle), and the function print() inside class Bus is to be called. How do I achieve this?  #include <iostream> using namespace std;  // Vehicle Class class Vehicle { public:     virtual void print() {         cout << "Vehicle print() called" << endl;     } };  class Bus : public Vehicle { public:     void print() {         Vehicle::print();         cout << "   Bus print() called" << endl;     } };  // Worker Unit Class class WorkerUnit { protected:     Vehicle vehicle; public:     WorkerUnit(Vehicle vehicle) : vehicle(vehicle) {}     virtual void print() {} };  class Maintenance : public WorkerUnit { public:     Maintenance(Vehicle vehicle) : WorkerUnit(vehicle) {}     void print() {         // Problem here where function calls base class Vehicle's print()         // How do I actually call the derived class's print()?         vehicle.print();     } };  int main(void) {     Bus *bus = new Bus();     Maintenance *m = new Maintenance(*bus);     m->print();      return 0; }

Someone mentioned it in the IRC as the slicing problem.


I'm trying to use Blender v2.78 on my new notebook which has the following config:  CPU - i7-6700HQ (4 cores)  Mem - 16G  GPU - GeForce GTX 1070 (driver is updated to the latest 376.09)   OS  - Win10 64bit family version  Immediately opening the software, I'm experiencing lag everywhere interacting with the software UI, almost lag for every basic operation with mouse/keyboard.  I did some search on the web and tried several things:  a. changing user preferences -> system -> window draw method (as well as some other parms that look possible to help for me)  b. setting up 3D parameter via my Nvidia control program, turning on whatever possible for blender.exe  c. running a previous blender version, say v2.77/v2.76b  But the problem still there, not smooth not at, very frustrating.  What's interesting (and somewhat ironic) is my old laptop which is a ThinkPad x1 carbon (win7) with just integrated graphic card can run the software smoothly, no lag at all when operating or editing in the UI though its performance is too low to render the scene quickly and beautifully.  I'm not sure what to do to make it work well for my new notebook. Appreciate if anyone could suggest and help on this.  Thanks very much!

Update  This has been confirmed resolved in a later version 376.33 and possibly the update prior.     Okay, I recently did a computer update. I used to run Blender 2.77 on a Dell desktop (5 GB RAM, 2.7 GHZ, Windows 8, build in graphics card). Since that computer wasn't fast enough for my preference, I saved up and got a new gaming laptop - the Asus ROG GL552 (Windows 10, 16 GB DDR4 RAM, Nvidia GeForce GTX 960M with 4 GB DDR5 RAM, 2.6-3.5 Ghz, and quad-core intel processor). That laptop has been known to have outdated drivers, so when I got it, I updated it to up to date Windows 10 drivers.  As soon as I started Blender, I immediately noticed its speed. Even doing simple things, like clicking buttons, or rotating the view with the middle mouse button, took too long to register in the program. I tried changing some User Preference System settings, but that didn't really help much. And the hardware seems to be fine - the render is lightning fast (renders the startup scene in under .1 second; it's just laggy when loading the uv screen), so I don't know why it's like this, or what to do. Also, I ran Blender 2.77 on this computer, and it was also slow (although it was fine on my previous computer).  It could be an issue with drivers perhaps (or maybe OpenGL?), but I ran Unreal Engine 4, and had none of the same issues - the speed was pretty decent on that; so I'm not sure why Blender would be so slow. Any help is appreciated - thanks guys!


Take the following 2 cases:  >>> a, b = [[None, None]]*2 >>> print(a, b)  [None, None] [None, None]   >>> a[0] = 1 >>> print(a, b)  [1, None] [1, None]   &  >>> a, b = [[None, None], [None, None]] >>> print(a, b)  [None, None] [None, None]   >>> a[0] = 1 >>> print(a, b)  [1, None] [None, None]    I don't understand why the first case does not exhibit the same behavior as the second case since [[None, None]]*2 == [[None, None],[None, None]] returns True.   I suspect it's because when the list is multiplied, the new components will point to the values from the first components. How sane is this?   How can I make the first case behave just like the second one?


I have an array,  `Array ( [0] => 2019-08-02 [1] => 2019-08-02 [2] => 2019-08-03 )`   I need to remove duplicates from this array.I tried converting strtotime and compared But not getting result.  Please help  Regards, Rekha

How can I remove duplicate values from an array in PHP?


When someone suggests an edit I get a notification so I can approve. But it looks like if someone with enough reputation points edits my question, it doesn't send anything.  Shouldn't I get a notification? In case I don't agree with the changes, have a chance to rollback to original version.

Your summary page shows "N Edits to your posts" for the selected time period but you really have to be looking for it.  Could we add edits to the notification feed? You could put the reason for the edit (entered--or not--when the editor changes it) and just a link to the post.


How to blur HDRI image in cycles. What nodes i have to setup in the world tab to make it blur and control the blur effect.

For a Cycles material I need to blur a texture. If the texture where a Texture Image node, I can blur the image before adding it but in my case I need to blur a Voronoi Texture and so I can't do it.  I have searched but I didn't find a blur node. Can this be achieved?


Also what do I do when promoting them with experience ? Do they get more efficient ?

In recent updates, there have been big changes in the Census menu. Ex:  Kittens now have titles, often related to their job (Scholars can become Scientists, for example) and can be promoted in those titles at a cost of experience; kittens can also be made Leaders or Senators.  What do these options do?


Are there any theories out there that discuss the idea that space itself could be made out of particles?

Does String theory say that spacetime is not fundamental but should be considered an emergent phenomenon?  If so, can quantum mechanics describe the universe at high energies where there is no spacetime?  Schrodinger equation assumes the presence of time dimension. So how can such equations be valid at extremely high energy?  And is it meaningful to do physics if there is no time dimension?  Would the concepts of Hilbert space, wavefunction collapse etc be useful in that case?


Hi I would like to run a script from the terminal, is there anyway to do that? For example : if I have a python script I would normally run it with this command :    python script.py   How can I run this script just by typing in the filename of the script in the terminal (even if i'm in another directory) ?  Another answer I found pretty helpful :    You can just create symlink. Create it in /usr/local/bin. All you need is to run command:  sudo ln -s /full/path/to/your/file /usr/local/bin/name_of_new_command   After that you should make your file executable:  chmod +x /full/path/to/your/file   Now you should be able to run name_of_new_command at any time in your terminal.  Note that this is good solution only for home usage of Linux.

I'd like to know if there is a way to run  program/shell script without typing full path:  /opt/idea/bin/idea.sh


There is no way for this  $\SI{-0,8}{\meter\per\square\second}$   to produce a , instead of a . and for there to be a \cdot between the units?  (I have no idea how to show rendered LaTeX text here.)  Thank you!

I'm using siunitx to input some big numbers and units in my document.  Is there a way to make the output of \num{3.14} be "3,13" instead of "3.13"? In Spanish, we use the first one.


So I have to write my own method.  I did  the following:   vector<float> remove(vector<float>& sortedVector, float input) {      for (vector<float>::iterator it = sortedVector.begin() ; it != sortedVector.end(); ++it)     {         if(input == *it)         {             sortedVector.erase(it);         }     }      return sortedVector; }   However compiler breaks at for loop. Where did I go wrong? I need to return the modified vector after the given value of the user is removed from the vector.

I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this:  void erase(std::vector<int>& myNumbers_in, int number_in) {     std::vector<int>::iterator iter = myNumbers_in.begin();     std::vector<int>::iterator endIter = myNumbers_in.end();     for(; iter != endIter; ++iter)     {         if(*iter == number_in)         {             myNumbers_in.erase(iter);         }     } }  int main(int argc, char* argv[]) {     std::vector<int> myNmbers;     for(int i = 0; i < 2; ++i)     {         myNmbers.push_back(i);         myNmbers.push_back(i);     }      erase(myNmbers, 1);      return 0; }   This code obviously crashes because I am changing the end of the vector while iterating through it. What is the best way to achieve this? I.e. is there any way to do this without iterating through the vector multiple times or creating one more copy of the vector?


Suppose you have two cards: one is painted yellow on both sides and the other is painted yellow on one side and red on the other You select a card at random and view one side.  You notice it is yellow. What is the probability the other side is yellow?

Can someone explain to me how there can be different kinds of infinities?  I was reading "" by  and came across the concept of countable and uncountable infinities, but they're only words to me.  Any help would be appreciated.


More and more in TV interviews -- and only on TV, by the way, never in "real" life -- I hear people using what I call, for lack of any other name, "Self-Questioning.". Example: "Do I regret saying what I did that morning?  Yes, I do.  Do I wish I had said something else instead?  Of course.  But we cannot go backwards, so what's done is done.". Sometimes there are three self-questions in the series, but usually there are only two.  I don't know the official name for this, if there even is one.  All I know is that I loathe it.  Has anyone else noticed this confessional-like speech pattern?  I am positive I never encountered it until recently, and unfortunately seems to be gaining in popularity.

Donald Rumsfeldt had a way of speaking in public, where to make his point more forcibly he would pose questions and answer them. Has Saddam Hussain bombed his own people? Yes. Has he begun the manufacture of weapons of mass destruction? Yes Are we prepared to see him terrorise his neighbours? No (This is not necessarily an accurate quotation, but just an example of the sorts of things he said).  But what interests me is this form of rhetoric which involves posing loaded questions and providing answers that make your point. Another exponent of this was Josef Stalin. In his case it has been seen by some historians as a technique he learned during his childhood education in a religious seminary. It was a form of catechism.  So what is the rhetoric called? Is it catechismic?  The word does not exist (at least not in the OED) as an adjective.   Edit. I have briefly looked at .It is not entirely a parallel example - the OP complains that his wife does it in the course of everyday conversation. I am primarily interested in the development of an argument through this process. But the former question did bring out some interesting words - e.g. sermocinatio,- @Sven Yargs - which unfortunately does not have an OED entry. But I am also fascinated by the link to catechism, which I believe may be the provenance of this in some politicians. Someone has now come up with a suitable adjective - below.    Answer. I think the closest answer has been supplied by @Old English Lapdog. It seems to be the case that there are two distinct elements to this. One is that it follows the religious practice of teaching by question and supplied answer.  In that sense it relates to catechism. But in building an argument it is rhetorical. The word catechetical in its OED (sense 3) includes a reference to Socrates. 1711   J. Addison Spectator No. 239. ¶3   Socrates introduced a Catechetical Method of Arguing. He would ask his Adversary Question upon Question, till he had convinced him out of his own Mouth that his Opinions were wrong. So I am prepared to accept catechetical as the answer.


The above one is done by Word, the below equation is done by LaTeX. How can I get the compact form like Word "globally"?  Here's my code: Please take a look at and give me some advice ....   thank you  \documentclass[a5paper, 10pt, twoside]{book} \usepackage{geometry} \geometry{voffset=10pt, tmargin=1.2cm, bmargin=1.5cm, lmargin=2cm, rmargin=1.5cm }  \begin{document}  The equation is given as:  \begin{equation} \frac{1}{2} \left[ \frac{h_{\underline j}}{h_{\underline i}}  \left\{ \frac{\partial}{\partial q^i} \left( \frac{\hat{u}^{\underline j}}{h_{\underline j}} \right) + \left( \frac{\hat{u}^{\underline m}}{h_{\underline m}} \right) \Gamma^j_{mi} \right\}   + \frac{h_{\underline j}}{h_{\underline i}}  \left\{ \frac{\partial}{\partial q^i} \left( \frac{\hat{u}^{\underline j}}{h_{\underline j}} \right) + \left( \frac{\hat{u}^{\underline m}}{h_{\underline m}} \right) \Gamma^j_{mi} \right\} \right] \end{equation}  \end{document}

LaTeX commands like this:  Here again, four different simulations are run on networks of size  $C^{G} = 25 \times\ 25 = 625$, $C^{G} = 50 \times\ 50 = 2500$, $C^{G} = 250 \times\ 250 = 62500$, and $C^{G} = 500 \times\ 500 = 250000$...   When compiled generate the following:    The spacing in math mode really irritates me. There's too much white space around the equal sign, and the multiplication sign has more right padding than left padding. Is there any way to reduce this spacing?


$4^{2020} - 2020$ mod $48$  My Approach: I basically tried to separate $4^{2020}$ into multiple entities and tried to break them down but at one point it just wasn't computational.

I stumbled across this problem  Find $\,10^{\large 5^{102}}$ modulo $35$, i.e. the remainder left after it is divided by $35$  Beginning, we try to find a simplification for $10$ to get: $$10 \equiv 3 \text{ mod } 7\\ 10^2 \equiv 2 \text{ mod } 7 \\ 10^3 \equiv 6 \text{ mod } 7$$ As these problems are meant to be done without a calculator, calculating this further is cumbersome. The solution, however, states that since $35 = 5 \cdot 7$, then we only need to find $10^{5^{102}} \text{ mod } 7$. I can see (not immediately) the logic behind this. Basically, since $10^k$ is always divisible by $5$ for any sensical $k$, then: $$10^k - r = 5(7)k$$ But then it's not immediately obvious how/why the fact that $5$ divides $10^k$ helps in this case. My question is, is in general, if we have some mod system with $a^k \equiv r \text{ mod } m$ where $m$ can be decomposed into a product of numbers $a \times b \times c \ \times ...$, we only need to find the mod of those numbers where $a, b, c.....$ doesn't divides $a$? (And if this is the case why?) If this is not the case, then why/how is the solution justified in this specific instance?


I have done some research on this topic but have been unable to progress any further.  Technical answers would be best but everything will help.  Why does tomcat use more memory than Jetty? Why is jetty more scalable and better at serving static content?  What are the differences in API's and underlying tools between these containers?  I am doing a report on how these tools differ but have only come up with similarities, any underlying differences would be greatly helpful as I do not know where to look.  I am not very familiar with these topics but I can research the answers you give.

I'm wondering about the downsides of each servers in respect to a production environment. Did anyone have big problems with one of the features? Performance, etc. I also quickly took a look at the new Glassfish, does it match up the simple servlet containers (it seems to have a good management interface at least)?


If I edit my own deleted answer to some question, the question shouldn't be bumped on the "active" tab.

I just answered , then deleted the answer because I realized what I said had already been covered. After deleting, I editing in a note saying why I deleted it, but that edit bumped the question on the home page.  I assume that the question will get bumped if I undelete the answer (which is proper behaviour), but I think in the case where someone edits a deleted answer, there's no point bumping the question for content that most people aren't going to see (and since the answer is deleted, shouldn't be seen anyway).  EDIT: A nifty way to abuse the system (10k+ only!).


Is was wondering if there is no easier and robuster way to convert a static Method of a static class into a MethodInfo than writing  typeof(MyStaticClass).GetMethod("MyStaticMethod")   My aim is to write a Dictionary<Type, MethodInfo> where i can map a Type to a Method.  MethodDictionary[typeof(bool)].Invoke(null, new object[] {});   I know that in C# 6 there is the possibility to write  typeof(MyStaticClass).GetMethod(nameof(MyStaticMethod))   But i'd like to stick to C# 5

There has been a lot of sentiment to include a nameof operator in C#. As an example of how this operator would work, nameof(Customer.Name) would return the string "Name".  I have a domain object. And I have to bind it. And I need names of properties as strings then. And I want them to be type-safe.  I remember coming across a workaround in .NET 3.5 which provided the functionality of nameof and involved lambda expressions. However, I have not been able to locate this workaround. Can anyone provide that workaround to me?  I am also interested in a way to implement the functionality of nameof in .NET 2.0 if that is possible.


We have our own app in Salesforce.When a customer service agent (non-privileged user) initiates/completes a task, we need to let our other systems know (via message bus) to do other things.  Now, the easy part is storing the key in a secure encrypted config field. The confusing part is having these customer agent's workflows be able to use the field and post out to our external service. The obvious solution is to enable the agent's profile to read encrypted data, but I feel like that defeats the purpose of obscuring/hiding API keys from everyone else, other than admin devops like myself.  How have other people worked around this?

I recently submitted an application to the AppExchange, only to have it not pass the security check due to "Insecure Storage of Sensitive Data Vulnerability." The problem is that my app accesses an external API, for which it has its own API Secret and API Key. These are static, and specific to the Salesforce App- they will be the same for all users, all installations, etc.  Perhaps stupidly, I stored them as private properties of the class that uses them.  private static String apiSecret = 'superS3|<R37'; private static String apiKey = 'sameHerebutdifferent';   It is a Managed app, so users cannot see them. As such, I am puzzled as to 1. why this is insecure and 2. how better to store these values, given that we are apparently operating under the assumption that having them in the text of the class itself is insecure.


I installed Windows Server 2012 R2 Standard Evaluation Version on an IBM x3650 M4 server.  Also I connected a domain controller configured as a secondary server. Now I've purchased a Volume License Key, but when I am activating with the key I am getting an error: "That key can't be used to activate this edition of Windows."

This is a  about Licensing.    Questions on licensing are off-topic on Server Fault.  If your question has been closed as a duplicate of this question, then this is because we want to help you understand why licence questions are off topic rather than just telling you "it just is". In all likelihood, this question will not address your question directly, it was not meant to.    I have a question regarding software licensing. Can the Server Fault community please help with the following:   How many licenses do I need? Is this licensing configuration valid? What CALs do I need to be properly licensed? Can I run this product in a virtual environment? Can I downgrade this product to an earlier version? Am I entitled to feature X with license Y?


I require a data structure that has a capacity, but also that allows adding an item from either the front or the back. Each time an item is added, one item must be removed from the opposite end. My first thought was that this sound very similar to a Deque.   Is there an existing data structure that provides this functionality, or do I have to create it myself? If it does exist, does the .Net library have an implementation?  Thanks

I have a Queue<T> object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items.  Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class?


Let $a,b\in G$ (a group) such that $ab=ba$, $|a| = m$ and $|b| = n$. If $(m, n) = 1$, then $|ab|= mn$. Here I understand that $G$ is abelian and that this computes to $a^{mn} = b^{mn} = 1,$ and $m,n$ are relatively prime. But I really don't know about a step-by-step process of proving this.

I want to show that if $g,h\in G$ are group elements with finite coprime orders $m$ and $n$ and $gh=hg$ then the order of $gh$ is $mn$.    We have that  $$ (gh)^{mn}=g^{mn}h^{mn}=1 $$  using $gh=hg$, so $|gh|\leq mn$. On the other hand, $mn=\operatorname{gcd}(m,n)\operatorname{lcm}(m,n)=\operatorname{lcm}(m,n)$, since $m$ and $n$ are coprime. I am not sure how to proceed, I tried assuming that $|gh|<mn$ and arriving at a contradiction, but it did not take me anywhere.


Anytime I got to update my system or install a new theme into unity-tweak tool the error message: "cannot find repositories" appears.  I have heard about solutions through making changes in the .list files, and solutions saying to create a new etc file. I do not know how to go about these procedures. Can anyone help?

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


From :     the GET method adds the data to the URL; and the length of a URL is   limited (maximum URL length is 2048 characters)   And from the :     The HTTP protocol does not place any a priori limit on the length of   a URI. Servers MUST be able to handle the URI of any resource they   serve, and SHOULD be able to handle URIs of unbounded length if they   provide GET-based forms that could generate such URIs. A server   SHOULD return 414 (Request-URI Too Long) status if a URI is longer   than the server can handle (see section 10.4.15).    Note: Servers ought to be cautious about depending on URI lengths   above 255 bytes, because some older client or proxy   implementations might not properly support these lengths.    Is this a mistake from w3schools?

What is the maximum length of a URL in different browsers? Does it differ among browsers? Is a maximum URL length part of the HTTP specification?


i dont know that whether i am using unity launcher or any other launcher but it is clear that i have never made any changes in my ubuntu but now i want to get genome 3 in my desktop can any one give me a sequence of commands to get it installed currently my launcher looks like this and i am not getting any minimise button for the window  is there any solution for this answer will reinstalling ubuntu fix the problem

I followed the instructions for compiling GNOME Shell and it did compile with a few errors here and there but it didn't run. I installed GNOME Shell using sudo apt-get install gnome-shell but I got version 2.31.x, while the latest is 2.91.5 or something. So is there a way for me to install the latest build?   Is there some repository available for the latest build?


Given a function $f:\mathbb{R}\rightarrow \mathbb{R}$ which is smooth and $f(0)=0,f(1)=1$.  Proof that $\exists  x_1,x_2 \in [0;1] \mspace{7mu} (x_1\neq x_2 )$ such that  $\frac{1}{f'(x_1)}+\frac{1}{f'(x_2)}=2$ .  By the Lagrange Mean value theorem $\exists x_0 \in [0;1]$ such tat $f'(x_0)=1$. If $x_1=x_2=x_0$, it's OK, but $x_1 \neq x_2$.

Suppose that $f$ is continous on $[0,1]$ , differentiable on $(0,1)$ , and $f(0)=0$ and  $f(1)=1$.For every integer $n$ show  that there must exist $n$ distinct points $\alpha_1,\alpha_2\cdots,\alpha_n$ in that interval so that    $\sum \limits_{k=1}^n \frac{1}{f'(\alpha_k)} = n $   Is it theorem or i can show it with basic differentiation knowledge .Please give me hint .


i want to use a big bracket (\left( , \right)) in an align-enviroment over two lines, so that  \begin{align} 0=\left(a+b+c \\   +d+e\right) \end{align}   which is not possible, because Latex want me to close the bracket in the same line. Anyone an idea?  Greetings Michael

I have a multi-line equation that I want to have matching sized parentheses. The advice I read online was to use \left( equation \right. \\ left. rest-of-equation \right) . However, this syntax leaves first half of the equation unaware of what is in the second half. For example, if you include a square root term after the break, the second parenthesis will be larger than the opening parenthesis. When you are using the aligned environment to split a long equation this can look somewhat offputting.    Compare the top equation to the bottom one. The parentheses match in size for the bottom equation, but the left hand parentheses for the top one is  noticeably smaller.  Top Code:   \begin{aligned}[t]   \gamma_{\text{u}} + \frac{1}{108}   \left(57\gamma_{\text{er}} \right. &+  38\gamma_{\text{se}}\\ & {}\pm  \left.\sqrt{2601 \gamma_{\text{er}}^2 + 3648  \gamma_{\text{er}}\gamma_{\text{se}} + 1444 \gamma_{\text{se}}^2}  \right)   \end{aligned}   Bottom Code:  \begin{aligned}[t] \gamma_{\text{u}} + \frac{1}{16} \left(9\gamma_{\text{er}}  +  6\gamma_{\text{se}} \pm  \sqrt{49 \gamma_{\text{er}}^2 + 76 \gamma_{\text{er}}\gamma_{\text{se}} + 36 \gamma_{\text{se}}^2} \right) \end{aligned}


I’m having 1d time series and I would like to measure it’s smoothness or roughness

Is there a good way to measure smoothness of a time series in R? For example,  -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1.0   is much smoother than  -1, 0.8, -0.6, 0.4, -0.2, 0, 0.2, -0.4, 0.6, -0.8, 1.0   although they have same mean and standard deviation. It would be cool if there is a function to give me a smooth score over a time series.


Suppose someone has commented or answered my question. Is it possible to check the edit history of comments and answers to find out what was changed?

It is possible for users to edit an existing post.   How do edits work? Who may edit a question or answer? How can you tell what has been changed between edits?      For more information, see "" in the .     Related:


I want to translate "average monthly salary" into English, in relation to a specific period which is "from September to April" (non-inclusive).  Will it be correct to just concatenate these two phrases? Or do I have to use a different preposition? Or maybe even change April to March and make it inclusive? (I think I could use "through" in that case, but I doubt I need to go that far, and I'm still not sure if that's the right way to do it.)  Update: if there's a difference between American English and British English in this instance, I need British English.

16-bit unsigned short integers that range from 0 through 0xFFFF      16-bit unsigned short integers that range from 0 to 0xFFFF   Which expression is better above?


I've come across something which appears strange to me, but at the same time makes some sense for reasons I don't know.  I have this enum:  [Flags] public enum Flags { RemoveQuoteMarks = 1, t1 = 2, t2 = 4, t3 = 8, t4 = 16, t5 = 32, t6 = 64, t7 = 128 }   Before, I didn't manually set the enum values, they index from 0 and standardly increase by 1 right?  Well I noticed odd behavior when I tried to load this string:  string value = "t1, t3, t4, t7";   and parse it using:  Flags flags = (Flags)Enum.Parse(typeof(Flags), value);   and the result was just 't7', so I did some research, and noticed a lot of others used manual indexing where each enum value was doubled by its previous (e.g. 't3 = 8', 't4 = 16'), so I applied this rule to mine, and it worked, my parsed enum had now shown as:  t1, t3, t4, t7   as desired, why do I have to manually configure my enum values like that?

From time to time I see an enum like the following:  [Flags] public enum Options  {     None    = 0,     Option1 = 1,     Option2 = 2,     Option3 = 4,     Option4 = 8 }   I don't understand what exactly the [Flags] attribute does.  Anyone have a good explanation or example they could post?


I'm making a billboard design - 400 cm wide + 300 cm high + 50 mm bleed. Cause the file is too big to make it in original size, I'm gonna make it in 1:10 ratio. So that means 40 cm x 30 cm + 5 mm bleed. I want to put a picture on the billboard - is it enought if I put a picture with 300 dpi? And the font - do I have to create outlines? I'm afraid of how it will look, when they will stretch everything to 300 x 400 cm. And I didn't get much information from the print shop, so I'm on my own..   Thanks for the info :)      The billboard is 10 meters away from the road, so people mostly only drive by. The picture I want to use is W=16,93 cm and H=11,12 cm and 2000 x 1324 px. But the picture is only for the background, so the billboard doesn't look so plain. And the picture is blurred. But there a still some details of the bearings and I don't want to loose them on the print.    Webster you are talking about dpi, and mnxd you are talking about ppi. When I open my photo in Photoshop - the image size shows me the photo resolution is 300 Pixels/Inch, but when I have the same photo in Illustrator it shows me - PPI: 124 .. Now I'm a bit confused..

For wall-sized graphics and large banners (e.g. 3m × 5m), what is an acceptable PPI for print? As I understand it 300 ppi is the typical for 'small' artworks (esp. for clean text resolution). However, for small artworks, the audience usually engages at a much closer distance. Therefore, in the interests of keeping a bitmap file down to a reasonable size, can you get away with a much-reduced PPI for a large format/banner print?


I've following VirtualHost configured:  <VirtualHost *:80>     ServerAdmin     mymail@mymail.com     DocumentRoot    /var/www/mysite.com/public_html/     ServerName      www.mysite.com     ServerAlias     mysite.com      <Directory "/var/www/mysite.com/public_html">         #Options FollowSymLinks         #AllowOverride All         #Order allow,deny         #Allow from all       Options Indexes FollowSymLinks       AllowOverride All       Order allow,deny       Allow from all       Require all granted     </Directory>     I'd like:   to enforce a https-only connection  and allow a connection when the user uses mysite.com without www   How to do that?   Thanks

This is a  about redirecting from http to https in Apache Related:     I have an Appache web server which serves both http://example.com/ and https://example.com/. I want to redirect all http requests to https. Currently I'm using this .htaccess rule to redirect http requests to https. RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}   It's working as expected for example.com but the same rule is not working for sub links, when I access existing links, like example.com/about it will still load in http, no redirection happens for existing links. How can I make Apache redirect all http requests to https?


I am using this code to create itemize within a tabular environment. \documentclass[12pt]{extarticle}  \usepackage{geometry} \usepackage{array}  \begin{document}  \begin{table}     \centering     \setlength{\leftmargini}{0.4cm}     \begin{tabular}{| m{2cm} | m{4cm} | m{4cm} | m{4cm} |}         \hline         Verticals & Drivers & Enablers & 5G requirement \\         \hline         Education &          \begin{itemize}              \item Remote delivery              \item Immersive experiences          \end{itemize} &          \begin{itemize}              \item Video streaming              \item Augmented reality              \item Virtual reality          \end{itemize} &          \begin{itemize}              \item Large bandwidth              \item Low latency          \end{itemize} \\         \hline     \end{tabular} \end{table}  \end{document}  Which results in this  As you can see, it has a large amount of vertical space just before the list starts and after it ends. How can I get a tighter vertical layout?

I'm using itemize and tables like the following  \begin{tabularx}{\textwidth}{>{\ttfamily}llX}  \toprule  \textbf{\rmfamily Operator} & \textbf{Typen} & \textbf{Regel} \\  \midrule  = & Alle Typen &   \begin{itemize}    \item This is how we roll    \item Maybe we can talk?   \end{itemize} \\  \bottomrule \end{tabularx}   But it keeps inserting a vertical space before the itemized list. How can I prevent it from doing so?


When I use the -class with a german -package loaded, the title of the abstract automatically gets translated to Zusammenfassung. However I'd like it to be Kurzfassung.  The solution one can find all over the web, is just to use:  \def\abstractname{Kurzfassung}   Why is that approach not working in my case?  I use lualatex, here is my minimal example:  \documentclass{IEEEtran}  \usepackage[T1]{fontenc} \usepackage[utf8]{luainputenc} \usepackage[ngerman]{babel}  \def\abstractname{Kurzfassung} \def\IEEEkeywordsname{Stichwörter}  \usepackage{blindtext}  \begin{document}  \begin{abstract} \blindtext \end{abstract}  \begin{IEEEkeywords}      myKeyword \end{IEEEkeywords}  \section{Einleitung} \blindtext  \end{document}     But the appearance of the abstract remains unchanged in the german default Zusammenfassung:

I'd like to modify the names used to typeset some of my document elements. For example, the caption of figure floats should change from "Figure" to "Fig.", and my \tableofcontents sectioning heading shouldn't read "Contents", but "Table of Contents". How can I do that?  \documentclass{article} % \usepackage[english]{babel} \begin{document} \tableofcontents \section{foo} \begin{figure}[h] \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure} \end{document}


I have $k_1$ red balls and $k_2$ blue balls in a box. Let $p_r$ be probability that randomly select $r$ balls in the box without replacement, $\sum_{r=1}^{m} p_r=1$; where $m$ is maximum number of drawn ball, and given. We can compute the probability that in $r$ drawn balls that  exactly have $i$ red ball and $r-i$ blue balls as follows (): $$P=p(r) \times \frac{\binom{k_1}{i}\binom{k_2}{r-i}}{\binom{k_1+k_2}{r}}$$ Because $i$ from $0$ to $k_1$ and $r$ is from $1$ to $m$, the probability will be $$P= \sum_{r=1}^{m} p(r) \sum_{i=0}^{r} \frac{\binom{k_1}{i}\binom{k_2}{r-i}}{\binom{k_1+k_2}{r}}$$ However, what is happen if $r \ge k_1$, How can I modify the range of summation term to make the equation valid? This question is totally different with  because the question aims to modify the range of probability term, instead of expected value.

I have $k_1$ red balls and $k_2$ blue balls in a box. Let $p_r$ be probability that randomly select $r$ balls in the box without replacement, $\sum_{r=1}^{m} p_r=1$. A trial is succeeds if the trial can draw at least one red ball in the trial. Find expected number of successful trail in $N$ times.   This is my solution  Let $X$ be event that draw $r$ ball in the box which has at least one red ball.  $$P(X)=p(r) \times\sum_{i=0}^{k_1}\frac{\binom{k_1}{i}\binom{k_2}{r-i}}{\binom{k_1+k_2}{n}}$$  Finally, we got the expected value as $$E(X)= N \times \sum_{r=1}^{m} p(r) \sum_{i=0}^{k_1}\frac{\binom{k_1}{i}\binom{k_2}{r-i}}{\binom{k_1+k_2}{n}}$$  Is it right?


Let $k\in \mathbb Z$; is there a name for the function $f(k)$ below? $$ f(k) = \text{max}(k, 0) $$

Is there a name for the function $ \max(x, 0) $?  For comparison, the function $ \max(x, -x) $ is known as the absolute value (or modulus) of x, and has its own notation $ |x| $


I'm trying to randomly select 6 numbers for a lottery application. Then add the numbers to an array. When I try to display the information contained within the array, it returns [I@63376afa. If I display randomInt outside of an array it displays correctly, but that isn't added to an array. If I try to add randomInt to an array after the for loop has been processed I get an error Type mismatch can't convert int to int[] which makes sense.  import java.util.Random; public class PracRandom1  {     public static void main(String[] args)      {         int randomInt=0;         int[] numArray = new int[randomInt];         int[] array = new int[5];         Random randomNum = new Random();{             for (int i = 0; i <= array.length; ++i){             randomInt = 1+randomNum.nextInt(6);                          System.out.println("Array Random numbers: " + numArray);             } }}}

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


I recently received an award. It's relatively prestigious (even internationally), but it's not well-known outside of my discipline, and its name is not very explicit (nor is it in English). Should I explain it on my CV? I was thinking of copying the one-sentence blurb on the award's website, something like "rewards people who have achieved this and this in this discipline". I don't see how it can hurt, but I have not seen anyone else do it...  (For context, I'm not applying for jobs as I have one, but I do apply for grants... All the time...)

I would like to have a section titled 'Awards/Honors' in my CV and I am confused about how much detail to include for the items in this section. Here are some formats and levels of detail I am considering:    Harry Potter scholarship. Hogwarts school of Witchcraft and Wizardry, Harry Potter scholarship. Hogwarts school of Witchcraft and Wizardry, Harry Potter scholarship: awarded to one student every year for demonstrated excellence in horcrux-gathering.   For certain things, I feel like the first does not include enough context, beyond some very well-known things (such as a Fulbright or Goldwater, neither of which I have received). For some particular names I have in mind the second looks pretty clunky and does not always fit on a single line. The third option is even clunkier, and might be perceived as an attempt to add fluff to inflate the CV. I am personally leaning towards the second option, but I don't know that it adds much value beyond the first option.   Is there an accepted way to list awards/scholarships? Should I even be listing them at all?  Some context. I am a PhD student in Mathematics and I will be on the academic job market this coming year. I am currently based in the US and intend to apply to jobs here as well as internationally if I find any that are interesting. I am wondering both about the CV I keep that lives on my professional website and the one I hope to send as part of my job applications.    Edited to add: The first couple of answers suggest that one might choose the format/level of detail based on the type/prestige of award. If I were reading a CV and came across inconsistent formatting within a section, I would find it quite jarring. Is this something that only worries someone mildly-OCD such as myself (I notice things like en-dashes and em-dashes) and therefore perhaps to not be worried about, or should I be careful about such things (e.g. consistency of formatting) when creating a CV?


My question is regarding preventing php scripts from sending mail. It has been marked a duplicate of another more general question about server security but that's not what this question is about.  After a long and bitter fight against hackerspammers who are somehow injecting rogue base64 encoded php files into various web directories on my Debian / Apache / PHP server, (the bitter fight involving first patching existing scripts and changing ftp passwords, web service passwords, and mysql passwords, then rebuilding sites from scratch, installing maldet - which has curbed the problem but not completely eliminated it - then finally turning off postfix altogether by stopping the service (but not uninstalling), then blocking port 25 traffic from the server at the firewall) I am still having problems.  My problems went away for many months, and the server was automatically removed from blacklists according to mxtoolbox. But today I received an mxtoolbox email saying my server is again blacklisted by many services. I don't fully understand how this is possible given I've disabled outgoing port 25 traffic.  When there's a problem, my postfix mailq fills up with hundreds of thousands of emails from a given webuser on my server.  My questions are this:   Given I've disabled port 25 traffic using iptables -A OUTPUT -p tcp --dport 25 -j REJECT, how is it possible that mxtoolbox is reporting my server is still sending out spam? When I check the mailq, the mails are backed-up. When I start postfix, items in the mailq don't send as indeed I expect, and I see (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused) next to each entry. Having identified the location of the RAT by looking at the X-PHP-Originating-Script line in a spammy mail in the mailq, I can find and destroy the file in question, which resolves the problem for anywhere between 5 days and many months. How do I completely prevent any php script from sending a mail? If I enter disable_functions = mail into my php.ini file, I understand this prevents the use of internal functions but not custom functions, which a spammer could take advantage of. What else am I doing wrong?   Caveat: I know #2 doesn't solve my problem at its root, but having taken advice and hardening the security of my server in as many ways as I understand over a couple of years now, I'm working on "deal with the mail reputation issue" rather than "solve all security issues period".  This is a follow-up from my  here on ServerFault.

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


Im new to software testing, i keep getting java.lang.NullPointerException for some reason and i don't know what it is   This is what i am testing on  public int getNumberOfStudents()     {         int validStudents = 0;         int i = 0;         boolean done = false;          do {             if (students[i] != null && students[i].exists())                 validStudents++;             else                 done = true;             i++;         } while(i < students.length && !done);          return validStudents;     } // end of getNumberOfStudents    This is the test case    class Testing {      RegistrationSystem GNS = new RegistrationSystem();      @Test     //@SpiraTestCase(testCaseId=5487)     public void test() {         assertEquals("validStudents", GNS.getNumberOfStudents());     }     }

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?


$\sqrt{-1}$ was completely undefined in the world before complex numbers. So we came up with $i$.   $1\over0$ is completely undefined in today's world; is there a reason we haven't come up with a new unit to define it? Is it even possible, or would it create logical inconsistencies?  What would be the effect on modern math if we did so?

Before, the concept of imaginary numbers, the number $i = \sqrt{-1}$ was shown to have no solution among the numbers that we had. So we declared $i$ to be a new type of number. How come we don't do the same for other "impossible" equations, such as $x = x + 1$, or $x = 1/0$?  Edit: OK, a lot of people have said that a number $x$ such that $x = x + 1$ would break the rule that $0 \neq 1$. However, let's look at the extension from whole numbers to include negative numbers (yes, I said that I wasn't going to include this) by defining $-1$ to be the number such that $-1 + 1 = 0$. Note that this breaks the "rule" that "if $x \leq y$, then $ax \leq ay$", which was true for all $a, x, y$ before the introduction of negative numbers. So I'm not convinced that "That would break some obvious truth about all numbers" is necessarily an argument against this sort of thing.


I'm new to Ubuntu and really enjoy it. Usually I can find help just by googling cause stuff is so well documented. But I can't figure this problem out when I try to install gparted I get this error. Any ideas?! Any help is appreciated.   The following packages have unmet dependencies:  gparted : Depends: libglibmm-2.4-1c2a (>= 2.42.0) but 2.39.93-0ubuntu1 is to be installed            Depends: libparted-fs-resize0 (>= 3.1) but it is not installable            Depends: libparted2 (>= 3.1) but it is not installable            Depends: libstdc++6 (>= 4.9) but 4.8.2-19ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages.

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'm confident that there are already quite a lot of answers to this topic. However, it is always important how the particular setup is configured. I'm new to Linux and would not like to execute commands which I do not understand and which are not tailored for my case. So I would be grateful if somebody would post instructions. My setup:  sda: contains Ubuntu 20.04 partitions and an ntfs partition which I intend to use for data exchange  for Windows and Linux sdb: Windows 10  I installed Ubuntu manually, so Grub loader should be (hopefully) installed on the sda only.  My aim is to extend the space on root as originally I didn't know that programs are installed there. I have backup of my disks by Acronis True Image 2020 (run from Windows). As you see I already could free up some space taken from home (boot from live USB). Resizing of / dind't work straight forward. As I read so far I should move some partitions and (most likely) do something with Grub loader. That's are the two things where I am not sure what to do in my case.

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 had to write a program to convert RGB to CMYK. When I tried running the program I received a java.lang.NullPointerException error. After using a debugger it showed me it had to do with when I called the PrintRGB(RGB) method in the main. I am new to coding and am unsure how to fix this. I googled it and across a few answers but didn't make sense to me since this is my first time coding. Please help me understand this error so I can fix my code. Thank you.      //Reads the data from the file , populates RGB and converts the colors to CMYK.     public static void main(String[] args) throws Exception {         Scanner sc = new Scanner(new File("colors.txt"));         PrintStream ps = new PrintStream("ArrayResults.txt");         int[] RGB = new int[3];         double[] CMYK = new double[4];                while (sc.hasNextInt()) {                 RGB[0] = sc.nextInt();                 RGB[1] = sc.nextInt();                 RGB[2] = sc.nextInt();                  if (validateRGB(RGB)) {                     RGBtoCMYK(RGB,CMYK);                     printRGB(RGB);                     printCMYK(CMYK);                 }                  else{                     ps.println("invalid numbers");                 }              }      }      //Receives the array RGB and determines whether the values are valid.     public static boolean validateRGB(int[] RGB) throws Exception {         Scanner sc = new Scanner(new File("colors.txt"));          for (int i = 0; i < 3; i++) {             if (RGB[i] >= 0 && RGB[i] <= 255) {                 return true;             }         }         return false;      }      //Returns the maximum value in array x which is used to determine white.     public static int maximum(int x[]) {         int maximum, i;          maximum = x[0];         for (i = 1; i < 3; i++) {             if (x[i] > maximum) {                 maximum = x[i];             }         }         return maximum;     }      //Receives array RGB and places the converted values into array CMYK.     public static void RGBtoCMYK(int RGB[], double CMYK[]) throws Exception {         double w;          w = Math.abs(maximum(RGB) / 255.0);         CMYK[0] = (w - (RGB[0] / 255.0)) / w;         CMYK[1] = (w - (RGB[1] / 255.0)) / w;         CMYK[2] = (w - (RGB[2] / 255.0)) / w;         CMYK[3] = 1.0 - w;      }      //Receives array RGB and prints the values in the array.     public static void printRGB(int RGB[]) throws Exception {          for (int i = 0; i < 3; i++) {             ps.println(RGB[i]);         }     }      //Receives array CMYK and prints the values in the array.     public static void printCMYK(double CMYK[]) throws Exception {          for (int i = 0; i < 4; i++) {             ps.println(CMYK[i]);         }      }  }


Edward Witten has stated that QFT is not mathematically rigorous, and that string theory helps us in unifying the forces much better. Can you give me a suitable example in which QFT lacks mathematical rigour?

Quantum field theory is a broad subject and has the reputation of using methods which are mathematically desiring. For example working with and subtracting infinities or the use of path integrals, which in general have no mathematical meaning (at least not yet) ect. My question is a little vague, but i am interested in hearing what is the status of rigor in QFT. What is known to be mathematically rigorous and consistent, what is known to be not rigorous? Any examples and references are welcome.   Added: Just to clarify by rigorous I meant anything that a mathematician would find satisfactory. Also my question wasn't for books with rigorous (in some sense) approach, although that was welcomed. It was about specific examples of what is considered mathematically satisfactory and what not. For example the quantization of free fields satisfying the Klein-Gordon equation can be done rigorously. There is no mathematical definition in general of the Feynman path integral and so on.


This  was closed as not constructive, with a comment "SO is not your research assistant".   As a long-time lurker starting to get more active on SO, I'm curious, in order to better learn the community standards, why this question was closed. Unless I'm completely remembering wrong, I've seen many questions asking for help finding or picking an appropriate library.  (Note this was NOT my question and I'm NOT arguing it should not have been closed.)

My question was closed for being a "shopping list question", even though it was very much related to the topic of the site. Why?


Is it possible to move an object in the 3D View on a plane of two axis like XY, XZ, YZ?

I want to be able to lock my translation/scale operations to two axes at a time, say xy, xz or yz. It currently takes two operations (one for each axis).  Example, say for a cylinder, I would like to reduce the radius. I currently have to scale on the x axis first, then on the y axis, or I have to manually input the scale values in the object properties panel.  This option is easily accessible in 3dsmax via the axis constraints command bar. Or I can click the intersecting area between the 3d manipulator of the axes in question and move in that plane.


Let $n$ be a positive integer. Find a function $f$ over $\mathbb{R}$ that is $n$ times differentiable but $f^{(n)}$ is not continuous.   We know that all the derivatives $f',f'',...,f^{(n-1)}$ are all continuous, but how do we find a function where the last derivative is not continuous? The function we make up can't have absolute values obviously, so I was thinking it is going to have to be piecewise.

I am looking for a real valued function of real variable that is $n$-differentiable, but whose $n$th derivative is not continuous.  This is my function:  $f_n(x) = x^{n+1} \cdot \sin{\frac{1}{x}}$, if $x \neq 0$ and 0, if $x=0$. $n\in \{0,1,2,\ldots\}$ For example, if $n=0$, $f_0$ it's continuous and non diferentiable in $0$.


Show that for all complex number $z \not= -1$, with $|z| = 1$, can be written as $z=\frac{1+it}{1-it}$, with $t \in \mathbb{R}$.  I think this structure seems to be a stereographic projection from the unit circle in the complex plane. This observation is clear when we regard this equation : $\frac{1+it}{1-it}= \frac{1-t ^2}{1+t^2} + i \frac{2t}{1+t^2}$.  Instead of this solution, could we use the fact that $\frac{1+i \tan \alpha}{1-i \tan \alpha} = (1-\tan \alpha) + i 2 \tan \alpha$ for $\alpha \in (\frac{-\pi}{2}, \frac{\pi}{2})$?  BTW, this  has the same initial problem, but not the same final question

I'm currently self-studying "Theory of Functions of a Complex Variable" by A. I. Markushevich and now I've encountered several difficult problems in the book from the start. This is just one of them. Prove that every complex number $z$ where $|z|=1$ but $z\not=-1$ can be represented as $$z=\frac {1+it}{1-it}$$ where $t \in \mathbb{R}$. I've tried writing $$z=e^{i(t+\frac{\pi}{2}-\frac{\pi}{2})}$$ $$=\cos(t+\frac{\pi}{2}-\frac{\pi}{2})+i\sin(t+\frac{\pi}{2}-\frac{\pi}{2})$$ and then reducing by the addition formula but it doesn't seem to go anywhere. If someone would give me a hint to start, not the full answer, I would appreciate it very much.


I found many information online on "might" and "may" and it sounds like most of the time we can use both of them, interchangeably.  However in this quiz, it seems like if only one of the two is correct and I cannot figure out why:    Here are three of the questions:  I was just wondering whether you ____ be able to help me.  may might CORRECT  Q2 - ____ God have mercy on your soul.  May CORRECT Might  Q3 - You ____ well be right.  may CORRECT might   Can someone tell me why the ones that are considered correct are correct?

I may not be coming in tomorrow...    I might not be coming in tomorrow...       When should I use "may" and "might"?


In ArcMap there is the possibility to have a symbol, the symbol description or layer name and an additional description in your legend  Layer Properties --> Symbology --> Fetaures: Single symbol --> Description (Additional description appearing next to the symbol in your map’s legend)  Is there any way to do this in QGIS?

I have a polygon layer which has a number attribute and a text attribute. When I make a legend in the composer, it automatically chooses the number to display while I would like to have both the number and the text.  How do I display two attributes in a legend? If not possible, how do I select which attribute is displayed in the legend?    I am not looking to have a multi-attribute label in the main window, I wish to have a multi-attribute label in the legend of the composer, or choose which attribute is displayed in the legend.   QGIS 2.8 Win8 64 bit.


I have eleven ciphertexts that were encrypted with the same key (which I don't know). I want to decrypt the last ciphertext. I read similar question like  but I can't solve my problem with their answer.  I'm new in Crypto can anyone tell what can I do?  I know when XOR two ciphertext (Let's assume that the plaintexts consist only of spaces and ASCII letters) if both of them were space the result is null. If one of them was space and another was ASCII we have a new ciphertext. If both of them were ciphertext we have new word that is XOR of orginal message but how can I reveal the plain-text?

My question might appear the same as the question , but actually I did read all the answers and none of them helped me with the details I need.  I am new to cryptography and my problem is with two time pad attacks on OTP. The problem I had in my course was that I have 10 ciphertexts encrypted with the same key $K$. I am then given another ciphertext that I should decrypt.  I know that XOR-ing two ciphers gives me the XOR of their original messages.  My question is what is the correct thing to do after that?  I tried to take 3 ciphertexts $C_1, C_2$ and $C_3$.  Then get $S_1 = C_1 \oplus C_2  \oplus $' ', also get $S_2 = C_1 \oplus C_3 \oplus$ ' '.  After that I compared all corresponding characters in $S_1$ and $S_2$,  and if $S_1[i] = S_2[i]$ then I calculate $S_1[i] \oplus C_2[i]$ to get $K[i]$.  I tried this on paper before coding and it worked, but I might be missing something.  Is this the right approach? Why does it work?


I want to find the sum function of the series  $$ \sum_{n=0}^{\infty}\frac{n}{n+1}x^{n} $$  and I would like to get your assessment of my work cause I'm really not sure about its validity?  I define the sum $$s(x) = \sum_{n=0}^{\infty}\frac{n}{n+1}x^{n}$$ and multipy with x  $$ s(x)\cdot x = \sum_{n=0}^{\infty}\frac{n}{n+1}x^{n+1}  $$  then differentiate  $$ (s(x)\cdot x)' = \sum_{n=0}^{\infty}nx^{n}  $$  divide by x  $$ \frac{(s(x)\cdot x)'}{x} = \sum_{n=0}^{\infty}nx^{n-1}  $$  then integrate and find the sum of a regular geometric series  $$ \int\frac{(s(x)\cdot x)'}{x} = \sum_{n=0}^{\infty}x^{n} = \frac{1}{1-x}  $$  differentiate again  $$ (\int\frac{(s(x)\cdot x)'}{x})' = (\frac{1}{1-x})' \Rightarrow \frac{(s(x)\cdot x)'}{x} = \frac{1}{(1-x)^{2}} $$  multiply by x and take the integral  $$ s(x)\cdot x = \int_{0}^{x}\frac{t}{(1-t)^{2}}dt = \ln(|x-1|) - \frac{1}{x-1} + C $$  To find the constant C let $x=0$ and find that $C=-1$. Lastly divide by x to get the final result  $$ s(x) = \frac{\ln(|x-1|)}{x} - \frac{1}{x(x-1)} - \frac{1}{x} $$  Can anyone verify that this is correct? Or is there another way to get the sum?  Thanks!

I need to find a function $f(x)$ which is equal to the sum $$ \sum_{n=0}^\infty \frac{n}{n+1}x^n, $$ for every $x\in \mathbb{R}$ for which the series converge.  Now, using WolframAlpha, I've found the answer  $$f(x)=\frac{-x+x\ \text{log}(1-x)-\text{log}(1-x)}{(x-1)x},\ \ \ \text{when}\ |x|<1$$ However I'm trying to figure out how to find this function $f(x)$ on my own. I've tried to combine the Maclaurin series of $\ln(1+x)$, $\sin(x),$ and several other functions but I don't seem to succeed. Any suggestions how to work out this problem from scratch?


[xxx]$ mkdir dir{1..10} [xxx]$ ls dir1  dir10  dir2  dir3  dir4  dir5  dir6  dir7  dir8  dir9    When I make 10 directories like this, why does dir10 appear right after dir1? Shouldn't it be the last directory?  Also, if I try the following command:  [xxx]$ mkdir -v dir{1..10} mkdir: created directory 'dir1' mkdir: created directory 'dir2' mkdir: created directory 'dir3' mkdir: created directory 'dir4' mkdir: created directory 'dir5' mkdir: created directory 'dir6' mkdir: created directory 'dir7' mkdir: created directory 'dir8' mkdir: created directory 'dir9' mkdir: created directory 'dir10' [xxx]$ ls dir1  dir10  dir2  dir3  dir4  dir5  dir6  dir7  dir8  dir9   It seems like now directories are created in correct order, but still when I list them, directory 10 appears to be second again.  How can I make directory 10 to appear after directory 9? Is there some way to sort these directories?

I have a bunch of files from log1 to log164.  I'm trying to LIST the directory (sorted) in a UNIX terminal but the sort functions are only providing the format like this:  home:logs Home$ ls -1 | sort log1.gz log10.gz log100.gz log101.gz log102.gz log103.gz log104.gz log105.gz log106.gz ...etc   What I want is  home:logs Home$ ls -1 | sort log1.gz log2.gz log3.gz log4.gz log5.gz log6.gz log7.gz ...{more here} log99.gz log100.gz log101.gz log102.gz ...etc   Any suggestions in what I could use to do this?


My page has a button and when it is clicked it is to create another button on that page which will trigger an alert box when clicked. Although, it seems as if the DOM is ignoring the on click event. Can someone shed some light? Thanks.

    Click Me!  $("#btnSub").on("click", function(){ $('
This will append to myDiv

<button id="btnAfter">After button</button>').appendTo(".myDiv"); $('#btnSub').remove();   });  $("#btnAfter").on('click', function(){     alert("test"); });   JSFiddle :

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.


So I want to make an illustration of two sheets of paper and a smartphone with a restaurant menu. It's gonna be featured on a webpage next to a paragraph of text.  My question is: should I use real or fake letters in the illustration? And how to make fake typography look good? On the one hand, scribbly pseudo-letters might seem confusing but on the other, I don't want to suggest any stuff or prices + I'm afraid that real words might distract from the text next to the illustration.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum?   I tend to think that the classic "Lorem ipsum" text needs explaining to clients who haven't seen it before. But text along the lines of the following seem inelegant:     Copy goes here. Copy goes here. Copy goes here.   Xxxxxx xx x xxx. Xxxxxxxx xx xxx x xx   Are there any alternatives I should consider?


I need to load lot of libraries on the html pages in my project.But I came across through many sources that placing the script tag before the closing the body tag improves the loading performance.If it is true,I would like to the concept behind this.  Thanks in advance, Krish

When embedding JavaScript in an HTML document, where is the proper place to put the <script> tags and included JavaScript? I seem to recall that you are not supposed to place these in the <head> section, but placing at the beginning of the <body> section is bad, too, since the JavaScript will have to be parsed before the page is rendered completely (or something like that). This seems to leave the end of the <body> section as a logical place for <script> tags.  So, where is the right place to put the <script> tags?  (This question references , in which it was suggested that JavaScript function calls should be moved from <a> tags to <script> tags. I'm specifically using jQuery, but more general answers are also appropriate.)


I need to create a Windows installation USB drive from an ISO file. I used UNetbootin which seems to be the only tool that can write non-Linux images.  The USB disk boots (sort of), but it gets stuck at the very first stage. A UNetbootin splash screen appears that keeps counting down from 10 to 0, and then restarts.   The screen looks like this:    Is there a way to make Windows boot from a USB image created on Linux?

I am unable to install WinUSB in Ubuntu 14.04 using command:  sudo apt-get install winusb  What is the correct way to install WinUSB in Ubuntu 14.04? Or is there any other application available to create Windows bootable USB in Ubuntu 14.04?


I am aware this question has been asked before, but I am looking for a more technical answer than those given to the other questions.  I am aware the question in the title is a problem in classical mechanics that quantum mechanics solves. But it doesn't seem immediately obvious at first blush how QM accomplishes this. For the simple hydrogen atom case, you model the electron as experiencing a static potential and also coupled to the surrounding radiation field.  From this $H$ there will be certain stationary states (for the joint electron-field system), but it doesn't seem obvious that these stationary states will involve nice atomic orbitals. You could imagine that the vast majority of the stationary states involve almost all the energy being stored in the field, and so any initial state with the electron orbiting the atom will not be an eigenstate and so tend to dissipate its energy to the field over time.  Is there a "deep" reason why this isn't the case, or is it just something that comes out of the mathematics?-

I'm having trouble understanding the simple "planetary" model of the atom that I'm being taught in my basic chemistry course.   In particular,    I can't see how a negatively charged electron can stay in "orbit" around a positively charged nucleus. Even if the electron actually orbits the nucleus, wouldn't that orbit eventually decay?  I can't reconcile the rapidly moving electrons required by the planetary model with the way atoms are described as forming bonds. If electrons are zooming around in orbits, how do they suddenly "stop" to form bonds.     I understand that certain aspects of quantum mechanics  to address these problems, and that there are  of atoms. My question here is whether the planetary model itself addresses these concerns in some way (that I'm missing) and whether I'm right to be uncomfortable with it.


I think I discovered a .   Tags like  are not completely hidden when used in spoilers. It seems not to be browser-related; I checked Safari and Chrome on Mac, and IE on Windows.  For future reference, this is how it looked like at the moment of posting:

Tags in spoilers are always visible, even if you don't put your mouse on the spoiler (on  for example). See the screenshot:      Looks a bit strange on this site too:        that needs !


In my code I am dealing with a situation whereby I have some html code that contains a list of actors are saved into a string. Some of the actor's names such as  José Ferrer are appearing in the string as José Ferrer. With &#xE9 being the hexa-decimal representation of é. Does anyone have any idea of how to convert the Hex code to the character code symbol representation in C#.    Update:  I have a function that checks the names, in some cases; character such as é and presented in the string like this: "José Ferrer".  I have a function called RemovedUnicode Characters. Which aims to convert the hed code into it respective character equivalent, however I can't seem to get the function to work, this is what I have so far. The Variable Neartest just returns "&#xE9"; it does not return é.  In the code below, I isolated the unicode character reprsentation into the string called entity. By using the for loop o filter through all of the chars in the string input.      public static string RemoveUnicodeCharacterAndProduceLetter(string input)            {           StringBuilder output = new StringBuilder(input.Length);         int endIndex;         int startIndex;         int length;         string entity;          for (int i = 0; i < input.Length; i++)         {             if ( input[i] == '&')             {                  string startElement = "&";                 string endElement = ";";                  startIndex = input.IndexOf(startElement);                 endIndex = input.IndexOf(endElement, startIndex);                  length = endIndex - startIndex;                  entity = input.Substring(startIndex, length);                 //  int tempResult = Convert.ToInt16(entity);                 //  char chesse = (char)Int16.Parse(entity, NumberStyles.AllowHexSpecifier);                 string nearTest = HttpUtility.HtmlDecode(entity).ToString();                //   string str = char.ConvertFromUtf32(Convert.ToInt32(entity));                    //

I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings?


How can we see that Dirichlet's function   $$D(x):=\lim_{m\to\infty} \lim_{n\to\infty} \cos^{2n}(m!\pi x)= \begin{cases}         1 & x\in\mathbb Q\\         0 & x\notin\mathbb Q\\         \end{cases}$$

Possible Duplicate:          Please help me prove, that $$\underset{n\rightarrow\infty}{\lim}\left(\underset{k\rightarrow\infty}{\lim}(\cos(|n!\pi x|)^{2k})\right)=\begin{cases} 1 & \iff x\in\mathbb{Q}\\ 0 & \iff x\notin\mathbb{Q} \end{cases}$$  Seems very complicated, but it's on calc I. I've tried use series expansions of cos, but it don't lead to answer. Thanks in advance!  Edit  Please don't use too much advanced techniques.


I have this curved surface:  With subdiv modifier it looks exactly as I want:   So is this the only way to get such a geometry? If I add a connection between vertices, it changes the shape of subdivided mesh.

Support for N-Gons (polygons consisting of more than 4 vertices) has been in Blender for a while now, but many of us still may not know when to use them, and how to do so effectively.  In what situations do N-Gons really come in handy? When should they be just plain left out? Do they have any place in finished models?


The word for a story or article that is keeping the reader's attention.  Example sentence:     I would like to rewrite this story to make it more ...

What's a (big) word or phrase to describe a book that is so good that I cannot put down when I start to read it?


When I move the right bone on my character the left toe's mesh moves along with the right foot.

I follow this  which uses rigify and I have run into some issues.    Not every vertex moves along the rig. Any idea what could cause this? I applied the location and rotation for every object.  The entire head is weight painted with blue.


taken from   I don't understand the line  return $.trim(this.value) === "";   I'm guessing it's returning all the input fields whose val are empty...but can someone explain how .trim and === work together?

I'm using  to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.  Is there a performance benefit to replacing == with ===?   Any performance improvement would be welcomed as many comparison operators exist.  If no type conversion takes place, would there be a performance gain over ==?


I am trying to compile a program but I got some problems. The programming environment is WSL2. I can't find where the error occurs. I want to write a Log class and the code below is a part of them. If you have any advice of the code, please write it. Thank you very much. I got the error:  /usr/bin/ld: /tmp/ccGEMoVp.o: in function `main':  main.cpp:(.text+0x2b): undefined reference to `LogBuffer<12u>::LogBuffer()'  /usr/bin/ld: main.cpp:(.text+0xbc): undefined reference to `LogBuffer<12u>::~LogBuffer()'  /usr/bin/ld: main.cpp:(.text+0xe2): undefined reference to `LogBuffer<12u>::~LogBuffer()'  collect2: error: ld returned 1 exit status  make: *** [Makefile:4: test] Error 1  main.cpp #include <iostream> #include "LogBuffer.h" using namespace std;  int main() {     const unsigned int SIZE = 12;     LogBuffer<SIZE> log;     cout << log.Buffer << endl;     cout << log.BufferSize << endl;     cout << log.Cur << endl;     return 0; }  LogBuffer.h #ifndef LOGBUGGER_H #define LOGBUGGER_H #include <memory> #include <algorithm> #include <stdio.h>  template <unsigned int SIZE> class LogBuffer { public:     size_t BufferSize;                    std::shared_ptr<char> Buffer;         std::shared_ptr<char> Cur;              public:     LogBuffer();     ~LogBuffer(); }; #endif  LogBuffer.cpp #include "LogBuffer.h"  template <unsigned int SIZE> LogBuffer<SIZE>::LogBuffer():BufferSize(SIZE) {     this->Buffer = new char[SIZE];     *Buffer = {'0'};     this->Cur = Buffer;     printf("constructor success\n"); }  template <unsigned int SIZE> LogBuffer<SIZE>::~LogBuffer() {     delete this->Buffer;     printf("deconstructor success\n"); }  Makefile test: main.o LogBuffer.o     g++ main.cpp LogBuffer.cpp -o test    main.o: main.cpp     g++ -o main.o -c main.cpp  LogBuffer.o: LogBuffer.cpp     g++ -o LogBuffer.o -c LogBuffer.cpp  Any ideas? I will appreciate it a lot if you give any advice.

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


I have an initial value problem:  $$ u_t - u^2u_x = 0 \quad \text{with} \quad u(x,0) = g(x) = \begin{cases}           -\frac{1}{2}, & x\leq 0 \\          1, & 0 < x <1 \\          \frac{1}{2}, & x \geq 1           \end{cases} $$  The characteristic system is  \begin{align*}    \frac{\partial t}{\partial\tau} = 1, \hspace{30pt} \frac{\partial x}{\partial\tau} = -u^2, \hspace{30pt} \frac{\partial u}{\partial\tau} = 0 \end{align*}    with the initial curve given by \begin{align*} t(0) = 0, \hspace{30pt} x(0)=\xi, \hspace{30pt} u(0)=g(\xi) \end{align*} Note here that $u_{\tau}=0$ implies that the solution will be constant along the characteristics, and the characteristics will be straight lines. We have, \begin{align*} t = \tau, \hspace{30pt} u = \xi, \hspace{30pt} x = \xi-g(\xi)^2\tau \end{align*} Now, \begin{align*} x = \begin{cases}  \xi - \frac{\tau}{4}, & \xi\leq 0 \\ \xi - \tau, & 0 < \xi <1 \\ \xi - \frac{\tau}{4}, & \xi \geq 1  \end{cases} \end{align*} Therefore the base characteristics are, \begin{align*} x &= \xi_0-\frac{\tau}{4} \hspace{10pt} \text{for } \xi_0 \leq 0 \\ x &= \xi_0-\tau \hspace{10pt} \text{for } 0\leq\xi_0 \geq 1 \\ x &= \xi_0-\frac{\tau}{4} \hspace{10pt} \text{for } \xi_0 \geq 1  \end{align*}  I can plot the base characteristics no problem, and I know that there are missing characteristics. My problem is finding them. I get, $$ u(x,t) = g(\xi) = \begin{cases}           -\frac{1}{2}, & x\leq -\frac{t}{4} \\          1, & -t < x <1-t \\          \frac{1}{2}, & x \geq 1-\frac{t}{4}           \end{cases} $$  First of all, I can get my missing characteristics for $1-t<x<1-\frac{t}{4}$. Also my cases overlap, so I know $u(x,t)$ will be multivalued, but finding these missing characteristics is proving trouble some. Any ideas would be appreciated.

Solving the quaslinear PDE by the method of characteristics is a bit tricky for me.  I was trying to obtain the solution $u$ for the PDE   $$u_{t} - u^2 u_{x} = 0$$  The initial condition is given by:  $$u(x,0) = g(x) = \begin{cases} -0.5, & x \leq 0 \\ 1, & 0<x<1 \\ 0.5, & x \geq 1 \end{cases}$$  Using the method of characteristics I have tried to write the characteristic equation as  $$\frac{dt}{1} = \frac{dx}{-u^2}$$  Trying to obtain an expression for $u$ from the above equation seems tricky as there is no $u$ term.


I am using log4net for creating execution logs of test cases which are created and being executed using Selenium Webdriver in C#. I was able to implement the logging functionality but I am facing an issue with the same or you can say I have a query related to this logging feature. I have seen that every web link which provides information about this logging has shown it in a way like:  driver = new ChromeDriver(); logger.Info("Browser is launched"); driver.Navigate().GoToUrl(BaseURL+""); logger.Info("Navigate to the URL provided by the user"); driver.Manage().Window.Maximize(); logger.Info("Maximize the window");   i.e. I have to use this line 'logger.Info' at all such places where logging is required.  Is there any way in which I can avoid using it repetitively? i.e. I use 'logger.Info' only at one places and it creates logs for the whole test case execution automatically, means I want to avoid repeating this line again and again.  Reference links (these links shows that I have repeat this code of line):-

I'm creating my first full framework using Selenium and TestNG and recently implemented the ability to have logging enabled which will track every action (before and after).  public class CustomLogs {     //Set Logging_Level to "Debug" to enable logging     public String Logging_Level = "OFF";      public void Log(String message) {         if (Logging_Level == "Debug")         {System.out.println(message);         } else {         }     } }   Then, in my page objects, EVERY action method has a log statement before and after EVERY action.  public class LoginPage extends BrowserConfig {      final WebDriver driver;     private static CustomLogs customlogs = new CustomLogs();      //Elements on Page     @FindBy(id = "userId")     private WebElement userNameField;      //Constructor     public LoginPage(WebDriver driver) {         this.driver = driver;     }      //Fill Username     public void FillUsername(String userNameEntry) {         userNameField.clear();         customlogs.Log("Entering Username: "+userNameEntry+"...");         userNameField.sendKeys(userNameEntry);         customlogs.Log("Username entered.");   It seems like this is very beneficial, not only for debugging, but also because you can now print out every single action step, so keeping records or showing others what steps were completed is very straightforward.  But I can also see how this is cluttering the page object code.  Is this a good idea?  And/or is there a better way to do this?


I'm trying to run through a for loop, but looking at the indices, rather than the values of the list. My list looks like this:  ubermin_values = [8350.1416, 13167.329, 29200.063, 19283.514, 23596.0309...]   and it has a total of 100 values (but this changes with each run of the program). I'm trying to keep track of which value in minimum_pixels each value in ubermin_values came from, for plotting. If I use this loop in my code,  ubermin_vals_x = [] for i in ubermin_values:     value = ubermin_pixels[i]     ubermin_vals_x.append(minimum_pixels[i])   it tries to iterate over the values (8350.1416, 13167.329...) but of course this can't be done. I think my scheme should work if I can iterate over the indices of ubermin_values, rather than the values, but I can't see how to do that.  If it helps, here's how the first values should be mapped:   so that I can plot the points (4, 8350.1416), (10, 13167.329), (7, 29200.063), etc.  The numpy docs list  for iterating over arrays. Am I on the right track with this, or is there a better way to do it?

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


I need to substitute backupconn1 with maniconn from connection text file, how can I make it specially from another script.  Below is connection.txt:  mainconn: 10.10.10.10 backupconn1:20.20.20.20 backupconn2:30.30.30.30

What's the simplest way to do a find and replace for a given input string, say abc, and replace with another string, say XYZ in file /tmp/file.txt?  I am writting an app and using IronPython to execute commands through SSH — but I don't know Unix that well and don't know what to look for.  I have heard that Bash, apart from being a command line interface, can be a very powerful scripting language. So, if this is true, I assume you can perform actions like these.  Can I do it with bash, and what's the simplest (one line) script to achieve my goal?


I have some code which is generating exceptions, apparently before the code itself starts.  I have no idea how to deal with this. Here's the output:  Exception in_ sendUnsentNaggregation java.lang.NullPointerException unsent: 0  unsent: unsent:1     // -------------------------------------------------------------------- private void sendUnsentNaggregation() {     System.err.println("unsent: 0\n");     try {         log("unsent:");         DateTime today=new DateTime();         String nagID=String.format("Naggregation for %4d/%02d/%02d",today.getYear(),today.getMonthOfYear(),today.getDayOfMonth());         log("unsent:1");         Database.UniqueString uniqueNagID=db.new UniqueString(nagID,MAX_URL_SIZE);         boolean alreadyThere=db.scannedURLs.indexOf(uniqueNagID)>=0;         log("nagID "+nagID+" unique "+uniqueNagID+" today "+today);         // wait until the naps site has stabilised         boolean okayToSend=(today.getHourOfDay()>=5) && (today.getMinuteOfHour()>=55);  // send at 5:55         if(nagNeedsSending.isSelected() || (!alreadyThere && okayToSend)){               String status=String.format("\nSending %s %s at %02d:%02d\n",(sendTestOnly.isSelected() ? "test " : "actual "),nagID,today.getHourOfDay(),today.getMinuteOfHour());             browserPanel.append(status);             scanner.updateNapsters(napsterROIThreshold.getText(),napsterSampleSize.getText(),napsterType.getSelectedIndex());             if(sentNaggregation(sendTestOnly.isSelected())){                 if(!alreadyThere) db.scannedURLs.add(uniqueNagID);             } else {                 browserPanel.append("Naggregation not sent\n");              }         }     } catch (IllegalSearch ex) {         log("Illegal search in sendUnsentNaggregation");     } catch (FileException ex) {         log("FileException in sendUnsentNaggregation");     } catch(Exception e) {         log("Exception in_ sendUnsentNaggregation "+e);                 } } // --------------------------------------------------------------------

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?


In the British show Call The Midwife, which is a show about midwifery, a lot of the dialogue is about babies. Whenever someone refers to a specific baby, they never use the definite article. So "That's not good for baby" rather than "That's not good for the baby". "I'll ask the doctor to listen to baby's heartbeat" rather than "I'll ask the doctor to listen to the baby's heartbeat". I notice they use the definitive article for everything else ("the doctor", "the children", "the hospital", "the midwife") but never for "baby".   What is the reasoning for this? Is this an archaic thing (the show is set in the 50's-60's), a British thing, a medical thing?

A lot of baby books and products use the word baby as you would a proper noun.  For example "when lying baby down in the cot" instead of "when lying your baby down in the cot". Another example from a shampoo bottle "proven to help baby sleep better". Books about child raising don't say "when teaching child good manners".  Where did this practice arise and is it valid?


I am trying to use  sudo apt-get update   But I am getting error as:  W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release   Unable to find expected entry 'restricted/source/Sources' in Release file (Wrong sources.list entry or malformed file)     E: Some index files failed to download. They have been ignored, or old  ones used instead.   I used sudo rm -vf /var/lib/apt/lists/* but still failed. Please suggest me something

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.