Mimicing constants using static readonly vs static getter

I am working with a third party control that is using "strange values" to distinguish between a list of choices.  They use two different properties to uniquely identify each choice.    Example: "Field" + "RW" = "CheckedOutBy" "System" + "N" = "Name" "Field + "N" = "Notifier"   There are a total of 37 different choices in all (each with a different combination of the two values to make up the 37 unique choices).  I have created a struct that stores the two values, with the idea that I will create a new instance of the struct for each choice.  public struct ColumnCode : IEquatable<ColumnCode> {     public static readonly ColumnCode Empty = new ColumnCode();      private readonly ColumnType _columnType;     private readonly string _code;      internal ColumnCode(ColumnType columnType, string code)     {         _columnType = columnType;         _code = code;     }      public override string ToString() { ... }     public bool Equals(ColumnCode other) { ... }     public override int GetHashCode() { ... } }   Ideally I would like to create a "constant" for each of the choices, but since constants are not an option I want to try and mimic a constant.  The two approaches I have come up with are to either use a static readonly field or a static property with only a getter.  public static class FieldOption  {     public static ColumnCode CheckedOutBy { get; } = new ColumnCode(ColumnType.Field, "XW");     public static ColumnCode Name { get; } = new ColumnCode(ColumnType.System, "N");     public static ColumnCode Notifier { get; } = new ColumnCode(ColumnType.Field, "N"); }   or   public static class FieldOption  {     public static readonly ColumnCode CheckedOutBy = new ColumnCode(ColumnType.Field, "XW");     public static readonly ColumnCode Name= new ColumnCode(ColumnType.System, "N");     public static readonly ColumnCode Notifier = new ColumnCode(ColumnType.Field, "N"); }   In either case I can now refer to the choices in my C# code using FieldOption.CheckedOutBy, FieldOption.Name or FieldOption.Notifier, etc but I am not sure if one approach is better than the other.    Is one of these choices better than the other to mimic a const, or is there a better approach that I am not considering.  I have read a large amount of information on the internet and am still not coming up with a good answer.  Some of it seems to be conflicting.  Much of the information states to favor properties over fields but then in this article () Microsoft says "DO use public static readonly fields for predefined object instances" so I feel static readonly fields is the correct choice.  I am also not sure how reflection falls into play here.  I want to make sure that the values for the FieldOptions cannot be changed, even through reflection.  Any help on this would be greatly appreciated.


I just downloaded Ubuntu-14.04.3-desktop-amd64. Can you guide me through the installation process.  I have no idea how to go forward with this. Also, I'm using Windows 8 and would like to dual boot with Ubuntu desktop.  Thanks in advance..!


Do I need a transit visa in amsterdam on the way to India?

I am an Indian Citizen currently on H4 visa in USA. I will be travelling from Columbus to New Delhi (India) via amsterdam. Please help me out with information if I will need a transit visa to go via amsterdam or not. I have a 3hr stopover in amsterdam. I have a valid Indian Passport but my currently stamped H4 visa is expired. I have a visa approval document which I will use to get a H4 visa stamping in India. Please let me know if I need a Transit Visa in amsterdam based on my situation.


What effect would the One Ring have on other people?

We know that for hobbits, the One Ring makes them invisible. But, at least according to the movie, Sauron was not invisible when he was wearing the ring. What effects would the ring have on other types of people: Dwarves, Elves, magic users, or any other interesting category one might have.


Can I board if my flight arrives 1.5 hours before my UK visa becomes valid?

My visa to UK is valid starting from June 25 but my flight to LGW is June 24 10:30 PM (edit: this is landing time not departure based on VCE-LGW flight times presented by easyjet.com). I still have 1.5 hours until my visa becomes valid. I prefer not to change my flight because I don't want to pay extra charges.   Will the EasyJet airlines going to allow me on board? I will be coming from Venice. How long does it take from landing to Immigration in London Gatwick? Can I stay longer in the airport before I pass through Immigration? Can I still see my luggage in the conveyor belt after 1.5 hours? How much time before they take away my luggage from the belt?


NullPointerException error while running my program in IDE

I have a weird problem. My IDE says everthing about my code is alright but when I try to run it, it says an error has occured and the program doesn't run. I've read through the code again but I simply don't know what to do to get it working. I'm hoping you could help me out with this issue. Thanks in advance.    package twobuttons;  import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane;  public class TwoButtons extends JFrame implements ActionListener {      JButton button1;     JButton button2;     JLabel label;      public static void main(String[] args){      new TwoButtons();       }     public TwoButtons(){         this.setTitle("Dos botones");         this.setSize(400,400);         this.setDefaultCloseOperation(EXIT_ON_CLOSE);         this.setLayout(new FlowLayout());          button1.setText("hola");         button1.addActionListener(this);         button1.setActionCommand("hola");          button2.setText("Te odio.");         button2.addActionListener(this);         button2.setActionCommand("Te odio.");          button1.add(this);         button2.add(this);         this.setVisible(true);       }        @Override     public void actionPerformed(ActionEvent e) {         String command= e.getActionCommand();          if (e.getActionCommand().equals("hola")){            JOptionPane.showMessageDialog(this.getComponent(0), "Espero que tengas un buen día");           } else {             JOptionPane.showMessageDialog(this.getComponent(0), "Odio mi vida");         }     }}   And the error I get is:   Exception in thread "main" java.lang.NullPointerException     at twobuttons.TwoButtons.<init>(TwoButtons.java:28)     at twobuttons.TwoButtons.main(TwoButtons.java:18) C:\Users\Juan\Desktop\Informatik 12\TwoButtons\nbproject\build-impl.xml:1040: The following error occurred while executing this line: C:\Users\Juan\Desktop\Informatik 12\TwoButtons\nbproject\build-impl.xml:805: Java returned: 1 BUILD FAILED (total time: 1 second)


Statistics about where user got reputation exactly from

Idea  As the reputation plays a major part in Stack Exchange, at least I would be interested to see where did particular user got the reputation from: accepted answers, good questions, upvoted answers or from something else. There is also currently quite extensive information about the user available and I suppose you can see all reputation changes already in the list. Even though all the data is available, it would be great to get it in more handy way as aggregated.   Why  Why this would be interesting is the fact that users differ really much from one to other on how they behave here. For example I tend to answer questions tens of times more than to ask them. On the other hand, I rarely get upvotes for my answers even though they usually are accepted since I generally answer on questions that aren't about the major topics because there it is more of a race and I like to take my time and craft quality answers.   Enough of me and to why I even thought of this in the first place. I often just follow one quite minor tag on Stack Overflow and answer to major part of questions there. There often exist users having trouble with even the basics of programming. Still, these users have multiple times more reputation than me and I'd be interested to see where has that all reputation come from.   Also as Stack Exchange can be seen (at least on Stack Overflow side) as a good reference for future employers, it would be good to be able to easily point out what you actually are doing here. These differences on where the reputation have came from might be essential to prioritize the applicants.   Implementation  I haven't thought that much about the implementation part but there should be a plenty of places to put that on profile view. Here's few possible placements:   Under reputation tab as a new box next to post, time and graph. Could be called statistics or overall. On the summary tab, under the part reputation.    Any ideas, comments, improvements, problems or notices to mention?


getting NPE when accessing list in my recyclerView adapter

i m getting strange behavior. when i m accessing my list in QuestionMenuAdapter. I have four classes.  1.TestActivity 2.TestActivityDrawerFragment 3.QuestionMenuAdapter 4.QuestionFetch  what i m doing is that... i m creating the object of QuestionFetch class in my TestActivity class. then i m passing the list of Question (that i m getting from QuestionFetch class) to TestActivityDrawerFragment via setUp method, and here list obtain form TestActivity is passing to QuestionMenuAdapter.  now in QuestionMenuAdapter ,in the onBindViewHolder() i m getting my question one by one .... but i got NPE  below is my Code QuestionFetch Class  public class QuestionFetch { List<Question> questionList=new ArrayList<>();  public List<Question> getQuestionList() {     return questionList; }   public QuestionFetch() {      for(int i=0;i<15;++i)     {          String option[]=new String[4];         Question item=new Question();         item.setQuestion("What is my name"+i);         item.setCorrectOptionIndex(i%4);         item.setNegativeMarks("1/2");         item.setSolution("deepak is name set by mom"+i);         item.setTypeOfQuestion("four");         for(int j=0;j<4;++j)             option[j]="deepak"+(i+j);         item.setOptions(option);         questionList.add(item);      } }   }  now in TestActivity i m creating the object of QuestionFetch Class  questionFetch=new QuestionFetch();     drawerFragment=(TestActivityDrawerFragment) getSupportFragmentManager()             .findFragmentById(R.id.test_navigation_drawer_fragment);      // here passing the list of Questions to setUp method of TestActivityDrawerFragment     drawerFragment.setUp((DrawerLayout) findViewById(R.id.test_drawer_layout),questionFetch.getQuestionList());   now in TestActivityDrawerFragment class  public void setUp( DrawerLayout drawerLayout,List<Question> data) {      this.data=data;}   and in onCreateView passing this list to QuestionMenuAdapter  @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {     // Inflate the layout for this fragment      data=new QuestionFetch().getQuestionList();     // here is list is in data     adapter=new QuestionMenuAdapter(getActivity(),data);     adapter.setOnClickListener(this);     return inflater.inflate(R.layout.fragment_navigation_drawer, container, false); }   and finally i m accessing my list in onBindViewHolder() in QuestionMenuAdapter class  public class QuestionMenuAdapter extends RecyclerView.Adapter<QuestionMenuAdapter.PageViewHolder>{    Context context; boolean addOrRemoveItemClicked=false; private LayoutInflater inflater; ClickListener clickListener; List<Question> data= Collections.emptyList();  public QuestionMenuAdapter(Context context, List<Question> data) {     inflater = LayoutInflater.from(context);      this.context=context;     this.data=data;     //here i have checked that my question is getting but not in onBindVievHolder    Toast.makeTosat(context,""+this.data.get(0).getQuestion,Toast.LENGTH_SHORT).show();   }  @Override public void onBindViewHolder(QuestionMenuAdapter.PageViewHolder holder, int position) {      holder.customTextView.setText(""+(position+1));    // here i m getting NPE     holder.questionText.setText(data.get(position).getQuestion()); }


What effect does a bright light have on a DSLR?

What effect do bright lights have on DSLRs? For example, would shining a flashlight into the lens have any effect?  The flashlight I am currently using is 300 lumens.


I am trying to create a filtered list of seat nos starting from G only, from a main pool of seat nos A1,A2....B1,B2...etc. However, when i try to sort the list, its not happening, plz help:  My code:  import java.util.ArrayList; import java.util.List; import java.util.Random;  public class Main {      public static void main(String[] args) {          List<String> Seats = new ArrayList<String>();          Random rand = new Random();          //Creating Alphanumeric seatnumbers e.g A1, A2, A3....B1,B2...etc using ASCII values         for(int i =0;i<100;i++)         {             String seatNum = Character.toString(rand.nextInt(35)+65) + (rand.nextInt(14)+1);              if(!Seats.contains(seatNum))              Seats.add(seatNum);          }          //Create a filtered list of only seat numbers starting with G           List<String> gSeats = new ArrayList<>();               Seats.forEach(seat->{                  if(seat.startsWith("G")   )                 {                     gSeats.add(seat);                 }             });             System.out.println("Original G list");             gSeats.forEach((String g)-> System.out.println(g));              gSeats.sort((String g1,String g2)-> g1.compareTo(g2));              System.out.println("\n\nSorted List\n");             gSeats.forEach((String g)-> System.out.println(g));        }  }   The output :    Please help where am I going wrong ?


Eigenvalues of Matrix with 1s everywhere but diagonal

I'm not sure if this type of matrix has a name, but I feel as if there's a trick to finding the eigenvalues that i'm missing:  $$ a \in R $$ $$ M = \begin{bmatrix}        1 + a & 1 & 1           \\[0.3em]        1 & 1 + a & 1 \\[0.3em]        1 & 1 & 1+ a      \end{bmatrix}$$


MySql workbench app's menu bar shows duplicate options

After I installed some updates, MySQL-workbench app's Menu bar is showing duplicate menu entries.       The same issue was there for GIMP as well. But clean-remove and installing back again solved this problem.     Please let me know if there is any alternative to resolve this issue (If possible permanently), other than remove-and-install.


I recenty got my essay back from my teacher and she said that it was wrong to use upper case "Earth". When I'm writing Earth, I'm referencing to the planet Earth, not soil. This is the sentence which included "errors". She gave me an error in every word that I marked with strong first letter.     This is why the Moon orbits the Earth, and the Earth orbits the Sun, and the Sun orbits the black hole in the middle of the Milky Way.   Who is right, me or her?


Getting marginal distributions from a bivariate probability distribution function

I understand the basic principles of bivariate distributions and their marginal counterparts. I am stuck on a slightly more sophisticated question however.  Given the following bivariate distribution:  $$ f(x,y) =       \begin{cases}        q &\quad 0 \leq x \leq 1, \ 0 \leq y \leq x\\        0 &\quad\text{otherwise} \\      \end{cases} $$  determine the parameter $q$ and the marginal distributions $f_X(x), f_Y(y)$.  I am aware that the marginal distributions in this case would be: \begin{align} f_Y(y) &= \int^{1}_{y} f(x,y)dx  \\[8pt] f_X(x) &= \int^{x}_{0} f(x,y)dy \end{align} But I am not sure how I can go about calculating $q$ to get to that point.


Is it appropriate to remove excessive commenting from code?

I am referring to this question on SO , where there is a massive amount of commenting within the code (the question has since been edited to correct this).  Is it allowed to remove these for the sake for readability (the comments just specify some lesson details, method comments etc)?


How often should one shutdown a MacBook instead of just closing the lid?

I have found contradictory opinions on this. Some say Windows users tend to shut down but that it is not necessary, and I tend to do that too. Others say it is preferable to shut down, as it does not take too much time to boot anyway, and that in this way the battery is protected. While others say that it is in fact better not to shut down to often, including for the battery, etc. An interesting opinion - cannot find the link for that now - was that shutting down / restarting serves no purpose for Macs, except when that is needed after installing or upgrading applications or the system, unlike in Windows, where shutting down was (is?) very important. Also, that Macs do periodical system maintenance work during operation and even sleep, which eliminates the need for restart; possibly restarting would even come against all this, etc., and "not shutting down" is in fact a typical differentiating Mac feature. Is this true? I need a competent opinion on this - not just a description of the most common use - preferably reflecting some advice from the manufacturer. I have a Macbook Air.   Update after answer: Although I got , a crucial point in it (that the system has to be shut down, but only from time to time) is not yet clear: how often should I shut down the system. So, I will bring my question down to this formula. As pointed out by that answer, my question cannot be answered in relation to a tangible benefit for the system, but rather in relation to the battery life. So, I guess this last point can be answered by some information on how how is battery life dependent on how often the system is shut down.


How to enforce that all traffic from iOS app goes through VPN?

I need to make sure that one of the apps I use can only use internet traffic that goes through VPN.  How, as a non-corporate user, can I achieve that? Can per-app VPN settings enabled with a custom profile help with that? Is it the best possible way?  My first thoughts are:   MDM profile-defined per-app VPN. If it is a way to go, what are the key pieces of the setup I need? (I want to be sure that profile-defined per-app VPN will help with my problem; also that a manually-created profile will work just as well as a "enterprise tool-generated" one). Workflow app or a similar tool. Is there any which is able to initiate VPN connection and wait until connection is established? "Connect on demand" always-on VPN: I tried it, but it allows some of the app's traffic to skip VPN when switching from wifi to mobile data or vice versa, for the periods when VPN is reconnecting. Such non-VPN traffic for the app is what I want to avoid completely.   Of course I'm fine to wait for establishing connection every time I switch to the app if any of the methods require that.


In a  question, an answerer says:  an empty bag is a bag with nothing inside it.  Makes sense, but I'm reading a textbook right now that says:  The empty set has only one subset (namely, itself).  Which seems odd to me. If a set is empty, why would it contain a subset? Regardless of whether or not the subset is also an empty set, the "empty set" still contains a subset, so how is it really "empty"? To go back to the empty bag analogy, it just sounds like my text book is saying:  an empty bag is a bag with nothing but an empty bag inside it.  Which doesn't make sense because then the bag isn't empty. I can't wrap my head around this concept.


Connection reset error when reading data from client java

I am developing Client-Server App using Java Socket. My Application Has Server which will listen on Port    Client will connect to that port Receive Data From Client Send Data To Client   Part of My Code  public void run() {     System.out.println("Got a client !");     try {         // Get Data From Client         int red = -1;         byte[] buffer = new byte[5 * 1024]; // a read buffer of 5KiB         byte[] redData;         StringBuilder clientData = new StringBuilder();         String redDataText;         while ((red = clientSocket.getInputStream().read(buffer)) > -1) {  /* Get Data From Client Here Code Hidden */              System.out.println("Data From Client :"                     + clientData.toString());              OutputStream out = clientSocket.getOutputStream();             DataOutputStream dos = new DataOutputStream(out);              String sDataToClient = "TEST DATA TO SEND IN BYTE ARRAY";              byte[] b = sDataToClient.getBytes("UTF-8");              byte[] bClientSend = new byte[b.length + 2];              bClientSend[0] = (byte) 1;             bClientSend[1] = (byte) 79;              System.arraycopy(b, 0, bClientSend, 2, b.length);              dos.write(bClientSend);             System.out.println(Arrays.toString(bClientSend));          }         clientSocket.close();     } catch (IOException e) {         e.printStackTrace();     } }   I Get java.net.SocketException: Connection reset after Data SENT to Client at following line  while ((red = clientSocket.getInputStream().read(buffer)) > -1) {   I am able to see Array Contents of System.out.println(Arrays.toString(bClientSend)); Then error occurs


How can we get rid of misspelled and unused (or "zombie") tags?

During the re-tagging of questions, tags sometimes become orphaned from existing questions.  Are these zombie tags ever removed from the ?  What if a tag is misspelled and needs to be removed? How do we get rid of it?


Heapsize: already exceed the limit but still running?

I am a bit confused on how can I handle heapsize to avoid getting a system exception. Based on the below scenario, if I run following script List<Attachment> attLST = new List<Attachment>(); Integer count = 0; for (Attachment a: [SELECT Id,                     Body,                     BodyLength,                     Name,                     Description,                     ParentId                     FROM Attachment]) {     count++;     Attachment att = a.clone();     att.Name = 'Cloned-' + att.Name;     attLST.add(att);     System.debug('Count: ' + count + ', Body Length: ' + a.BodyLength + ' - ' + a.Name);     System.debug(Limits.getHeapSize());     System.debug(Limits.getLimitHeapSize()); }  the logs looks like this, breaking in 111 from 140 in total.  The first row of the loop shows me:  My question is: if the heapsize is 6000000, why it doesnt break on the first record? considering that at that moment the heapsize at that moment based in my logs is already a little bit over 11 times the limit? why it breaks when it has loop 110 times and the heapsize is already 20 times the limit?


The problem we have is that for custom content types not all managed metadata column are displayed in Document Information Panel (DIP) for the document in MS Office client application.  However, everything works fine if there is only one content type with managed metadatafields in the library.  We have found bad workaround that doesn't suit to us. But anyway... If we remove MM column from list and readd it then everything works fine for existed in the list content types, but if we add new custom CT to the list, for newly added we have an issue again.


Why does this const member function allow a member variable to be modified?

class String {      private:         char* rep;      public:         String (const char*);         void toUpper() const; };   String :: String (const char* s) {     rep = new char [strlen(s)+1];     strcpy (rep, s); }   void String :: toUpper () const {     for (int i = 0; rep [i]; i++)     rep[i] = toupper(rep[i]); }   int main () {     const String lower ("lower");     lower.toUpper();      cout << lower << endl;     return 0; }


Replacing a bike with different tire sizes

I recently bought a bike with different tire sizes (20" rear and 18" front) now I want to replace both with a 16" tire is it possible? Also, the rear suspension mechanism is totally unknown to me even to the fellow whom I bought the bike from. Is it also replaceable because i want to change it Pardon my imbecilic queries guys, this is my very first bike :)


Hide navigation information in sidebar on title page and TOC page (beamer)

Edited for clarity:  I am trying to remove the navigation information in the sidebar that lists a TOC on the title page and the TOC page in a beamer presentation.  I still want the sidebar to appear for presentation background consistency, but I want it to be blank.  I'm using the PaloAlto theme.    I have found a work around for the title page by setting the background of the title page as a rectangle the size and colour of the sidebar on top of the sidebar by using \addtobeamertemplate{title page}, but this approach doesn't work for the TOC page as I can't find a way to link to that page specifically through the template definition.  Is there an easier way to hide the sidebar on only the title page and TOC page? Thanks!


Which Ubuntu version should I install on a Toshiba laptop, Satellite P200 RT1?

I have a Toshiba laptop, Satellite P200 RT1 which is running Windows XP.  Should I install install the Long Term Support Release of Ubuntu 14.04, or the latest Standard Release of Ubuntu 15.04?  Should I install a different flavour of Ubuntu, such as Xubuntu, Lubuntu, Kubuntu, Ubuntu Mate, etc, given my modest hardware specifications?


I'm looking for a word that's like a whimsical fanatic someone who dives in to something for a period of time and then moves on

For example a person might be really into soccer so they do a bunch of soccer until hey get bored, but then they move to carpentry and get pretty good at that and know everything then they move on I, need a good word or phrase to describe this ferocious nomadic interest acquiring.


Concatenate python string from list entries

Lets say that I have a list of strings that I would like to jam together into a single string separated by underscores. I know I can do this using a loop, but python does a lot of things without loops. Is there something in python that already has this functionality? For example I have:  string_list = ['Hello', 'there', 'how', 'are', 'you?']   and I want to make a single string like:  'Hello_there_how_are_you?'   What I have tried:  mystr = ''     mystr.join(string_list+'_')   But this gives a "TypeError: can only concatenate list (not "str") to list". I know its something simple like this, but its not immediately obvious.


I am creating a simple webapp that allows my support colleagues to run Selenium Java Code from my custom created API. When from Eclipse (the app deployed in Tomcat8) I run a script, i can see in my screen that the webbrowser (in this case the chrome webdriver) is opened and I can actually see what is happening in my screen. However, when I just start Tomcat as a windows service (and do not run it from Eclipse), it also run, however it seems to run headless. I would like it to also show me the browser so that I can see what is happening. I can't really find anything on this, so I hope someone can help me out here or give me a pointer.


$$\lim_{n\rightarrow\infty}\left( \frac{1*3*5*...*(2n-1) }{ 2*4*6*...*(2n)}\right)^3=0$$ Having products at fractions I cant figure out how to calculate this limit.


Prove by induction that the equation $\dfrac{1}{x_1} + \dfrac{1}{x_2} + ... + \dfrac{1}{x_n} = 1$ has a solution with $x_1<x_2<...<x_n$.

Using induction, I have to show that $\forall n \in \mathbb{N}, n \ge 3$ the equation:  $$\dfrac{1}{x_1} + \dfrac{1}{x_2} + ... + \dfrac{1}{x_n} = 1$$  has a solution $(x_1, x_2, ..., x_n) \in (\mathbb{N^*}, \mathbb{N^*}, ... \mathbb{N^*})$ (so a solution of all non-zero natural numbers) such that  $$x_1 < x_2 < ... < x_n$$  I don't even see how I could prove the base case. If we have:  $$p(3) : \dfrac{1}{x_1} + \dfrac{1}{x_2} + \dfrac{1}{x_3} = 1$$  I don't see the $3$ natural numbers that satisfy the equation and at the same time satisfy the condition $x_1 < x_2 < x_3$. So I can't even prove the base case, let alone imply $p(k + 1)$ if I assume $p(k)$ true. Even if I get the equation to a common denominator and multiply, I get:  $$x_1 x_2 + x_1x_3 + x_2 x_3 = x_1 x_2 x_3$$  So it didn't really get any more obvious. I thought that these might be the second and third Vieta's formulas for a $3$rd degree polynomial, but I don't see how I could construct a polynomial that has all $3$ of its roots natural and satisfy the condition $x_1 < x_2 < x_3$. Besides, the exercise clearly says that this should be proved using induction.


In Pokemon Go, how exactly are you rewarded Defender Bonus?

It seems that once I occupy a gym, and claim the Defender Bonus, then during the day, if I occupy two more gyms, there is no way to claim more Defender Bonus.  So how exactly do you get Defender Bonus?  So far I have some observations:   As long as you never claim Defender Bonus within the past 21 hours, you can claim it. Once you claim it, you have to wait 21 hours to claim any Defender Bonus again, even if you conquer or go in more gyms. When you claim Defender Bonus, the number of gyms you are in at that time determines how much stardust and Pokecoins you get (which is 500 stardust + 10 Pokecoins) x NumberOfGymAtTheTimeOfClaim) In other words, if you claim it when you are in one gym, and you go into 5 more gyms, but 21 hours later, you are only in two gyms now, then if you claim at that time, you can claim Defender Bonus for two gyms only. So naturally, it is better to claim it at the point in time, when simultaneously, you are in the maximum number of gyms. It doesn't matter whether you bring the Prestige to 0 and kick out every other Pokemon and go in a gym, or whether you just "pass by" and find an empty slot to go in. It count as 1 gym. Once a gym is emptied out, there are 3 slots for Pokemon (of the same team) to go in. If another person can "sneak in" and two other persons of the same team also add themselves immediately, now you have to bring down the Prestige to 0 for a gym with 3 Pokemons in it. So you'd better choose which Pokemon you want to go in ahead of time and do it fast. (and revive it fast if it died in the fight. But maybe you don't have to restore its health to the max -- I am not sure yet). Update: I think I heard the maximum number of gym you can be in or rewarded for, is 10, and Defender Bonus will double every time you are in one more gym... meaning after 9 more gyms, it is multiply by 512... but it must be too good to be true.   Don't know if this is correct?


When I bought my laptop it had Windows on it. I soon installed Linux as a second operating system on my computer, leaving Windows on it. Recently my hard drive crashed, so when I got a new hard drive the first thing I did was re-install linux. Now I in need of re-installing windows (I already have a copy on DVD). So, how do I install windows?


I'm aware of Sidney Coleman's 1975/76 sequence of  on Quantum Field Theory. Are there any other high-quality QFT lecture series available online?


Why isn't the first executable in my $PATH being used?

I have a script called jsl in /usr/local/bin. Running which jsl finds it there.  I want to temporarily use a different version, and when I echo $PATH I see that /usr/bin is earlier in the path. So I added a script called jsl in that folder and I've verified that it is executable and runs correctly when called with the full path.  However, which jsl still finds the first version, and jsl still runs it.  Why isn't my new jsl being found by which or executed by name?


For some reason, I had to add an alias to my bash. I have added the alias in /root/.bashrc which also contains the following piece of code:  # Source global definitions if [ -f /etc/bashrc ]; then         . /etc/bashrc fi   The new alias works like a charm when it is used in the console. However, when I execute a script file myscript.sh with this alias in, I get a command not found error. It seems like I should tell .sh files to use the same environment as bash but I don't know how to do that.


Prove the limit using $\epsilon$ and $\delta$ definition   $$\lim_{(x,y)\to (1,1)} xy = 1$$  Thanks!


I'm a Trainee electrician and pc hardware enthusiast. I was just wondering why a mixture of inductors and capacitors are used on motherboards? Why not just use capacitor? I thought the inductor stores electrical charge but it uses magnetism. What's so special about storing it as magnetism?


How do I keep a prompt running in background?

I am developing a web application in Phoenix and I also just started discovering Unix process management.  I put my app in background, like this:  vagrant@dev:/srv/my_app$ iex -S mix phoenix.server & [1] 8726   Then I'd like to cd to another directory and do some other work in the main prompt. However, as soon as I do that, the background process stops.  vagrant@dev:/srv/my_app$ cd ..  [1]+  Stopped                 iex -S mix phoenix.server  (wd: /srv/my_app)   I noticed this happens only in this particular case, because it's a prompt. It doesn't happen with other non-interactive processes (I'm free to change directory and all of that).  I tried the same with irb, another prompt, and I get exactly the same behavior.   Why is this happening, and is there any workaround for having a prompt in the background and change directory without it being stopped?


What are the 'chrome:' and 'resource:' protocols in Firefox?

From reading the error console, I've noticed that Firefox has several internal protocols, such as chrome: and resource:.  What are they used for, and why are they necessary?  Are they part of the  (which I am not familiar with)?  This question is independent of operating system or Firefox version.


I have a lot of directories that contain some text files and I would copy all files (of all directories) in a new directory. I'm looking for a bash command that do this. How can I do it?


An elementary way to show any bounded subset of $\Bbb{R}^k$ is totally bounded

I'm trying to show that any subset bounded of $\Bbb{R}^k$ is totally bounded.  Here is what I did:   (1)A subset of a totally bounded Set is bounded:  Proof: Let $X$ be a totally bounded subset and $Y\subset X$ then there exists an $\epsilon /2$-net $\{x_1,x_2,..,x_n\}$ and $X\subset \displaystyle\bigcup_{i=1}^n B(x_i,\epsilon/2)$ . Let $\{x_1,x_2,..,x_m\}$ be the points whose balls contain $Y$ $(m\le n)$. Now $\forall i \in \{1,..,m\} \exists q_i \in A \cap B(x_i,\epsilon/2) $ and $B(x_i,\epsilon/2)\subset B(q_i,\epsilon)$. We have for every $x\in B(x_i,\epsilon/2)$ $$ d(x,q_i)\le d(x,x_i)+d(x_i,q_i) < \frac \epsilon 2 + \frac \epsilon 2 =\epsilon$$  Hence $Y \subset \displaystyle\bigcup_{i=1}^m B(x_i,\epsilon/2) \subset \bigcup_{i=1}^m B(q_i,\epsilon)$ and $q_i \in Y$ for all $i$ hence $Y$ is totally bounded  Back to the problem:  Let $A \subset \Bbb{R}^k$ be a bounded set  then $A \subset B(0,R)$ for some $R$ then $A \subset [-R,R] \times [-R,R] \times ...\times [-R,R] $ then $A$ is a subset of a compact set by the Heine-Borel Theorem which is also a totally bounded set, hence by (1) $A$ is totally bounded.  I'm trying to do this problem by only using (1) without invoking the Heine-Borel theorem, can anyone tell me how that can be done? (Is the proof of (1) right for that matter?)


We've recently migrated an old custom cms site to Umbraco at the same domain.   Google Webmaster Tool is reporting 1000s of "Not Found" errors from the old 404 page in the format error/404?aspxerrorpath=/path/to/old/url.  Does this mean that Google has historically indexed all these pages (ie before switching to Umbraco)? Searching for these urls produces no results.  Do we need to take any action (such as 410'ing pages which match this pattern) or will the new site returning a 404 be enough?


Add a transparent image on top of a material [duplicate 2]

I read the answer on the link on how to add transparent images on top of materials ( ). This works beautifully in v2.79b.    This technique does not seem to work in Blender 2.80 anymore (I am using the very latest Mac version from Dec 20). The transparent image is also shown on the part of the mesh, which is not UV unwrapped. Is this a bug in v2.80? Or does v2.80 require a different approach?    What is really odd is the fact, that if I open in v2.80 a file created in v2.79 created, it shows up correctly.    Thanks for any advice! Chris  Edits: screenshots and link to blender files added


Light speed measured by observing Jupiter moons

The famous discovery that the light has speed measures the times of the immersion and emergence of Io, one of Jupiter's moons.  However, I still can't comprehend this. Even when the Earth is further away, the moon will be seen to appear later, sure, but it will also disappear later - so the measured times between disappearance and appearance should be the same, regardless of the distance from the observatory object. How come they are different?


Alert When Windows Task Scheduler Fails to Run

We have a script that is a security script, checking logs. Almost always it can be ignored and, for the most part, is; it sends out an email when it sees an issue in some logs of a particular type, which shouldn't happen too often.  We kick off this script (PowerShell) via Windows Task Scheduler on a Windows Server. The account used is a team service account, and so it's used for other things. Unfortunately if the password on this account is changed and the changer forgets to update the Windows Task Scheduler task, the task fails to run. Since the task is designed to only contact users when something is wrong, it's easy to not know the task has been failing for months at a time.  Is there some way to be notified when a task has a critical failure like this?


'Scale' value in slope percent map in QGIS?

What value should be used for scale while calculating slope percent in QGIS?    Some documents suggest is as 111120 and some as 365130.  I am using ESPG 4326 projection and do I need to convert this value to some other value using lat like given in this link:


What safe files can I remove in order to gain storage space. My emails are not being viewed unless I delete Misc. Files.


Every time I try to login to , if I click the “login” button in the top bar, I am immideately returned to the page I came from without being logged in.  I also have tried to sign up, but the same thing happens - after I click the “Sign up using Google” button, I am returned to the page I was on before.


Looking for Author/Title of dystopian short story on organ trafficking where foreheads are stamped

I'm looking for the Author/Title of a dystopian short story I read in the 1970s, where traffickers claimed dead people's organs by stamping their foreheads. The beginning of the story describes an old lady getting run down by a car prowling the streets looking for victims and an organ trafficker stamping her forehead. The traffickers and the hit-and-run drivers worked together as I recall. I can't be sure but I believe the title had an X in it.  The story was written in English and I was living in Washington state within the USA when I read it. I'm pretty sure it was a short story but it's possible it was a book. Roughly forty years have passed since I read it and I don't recall much more than the opening and the general plot. I remember how creepy the beginning was when it described how unsuspecting pedestrians were stalked by cars and then run down when they tried to cross the street.


MySQL Join two records with matching field and creating more columns

I cannot figure out how to even explain this succinctly, I suspect there is a word or term for what I want to do but I dont know it. I have a table and it has many duplicate records. each record has 5 columns. ID (not key), Thing1, Thing2, Thing3. ID1, ball, ring, jumprope ID1, flower, book, bell ID2, something, something ID3, something, something, something I would like to do this: ID1, ball, ring, jumprope, flower, book, bell ID2, something, something ID3, something, something, something Any pointing me to a tutorial would be useful. I just dont even know what to call this to look for a tutorial.


Is there any difference between these two classes?

I know we can create multiple classes inside another class with the only restriction that only one public class is allowed in one source file.  package xyz; public class TheClass{   class SomeClass{       }  }  class AnotherClass { }   But is there any difference between the SomeClass and AnotherClass here?


How to prevent an exception in a background thread from terminating an application?

I can hookup to AppDomain.CurrentDomain.UnhandledException to log exceptions from background threads, but how do I prevent them terminating the runtime?


If $n, m \in N^*$ and a group homomorphism $f: Z_n \to Z_m$. Show that $f(Z_n) =0$ if and only if $(n, m)=1$.


Cannot change backlight brightness Ubuntu 14.04

This morning I found that I cannot change the brightness of my Dell XPs 13 laptop's display anymore. I tried the following to change the brightness   Use keyboard brightness keys Run the commands shown below Boot with kernel option acpi_backlight=vendor. This resulted in a dell_something folder being present in the /sys/class/backlight folder. Changing the brightness file in that folder does not help. Add 'intel_backlight' to xorg.conf Set "load legacy option ROM" BIOS option to enabled and "secure boot" to disabled Boot with kernel option i915.disable-pch_pwm=0 Boot from a fresh Ubuntu 12.04 USB stick installation. I can still not control the brightness. This is strange as the laptop came preinstalled with 12.04. Maybe this a hardware problem? Install latest intel video driver   Any ideas why this broke suddendly? I've upgraded from 12.04 to 14.04 in April and till yesterday the brightness keys were working fine.  Thanks!  echo 100 > /sys/class/backlight/intel_backlight/brightness echo 100 > /sys/class/backlight/acpi_video0/brightness


Assuming we know that the cardinality of $(0,1)$ is $c$. Can we from this determine the cardinality of $[0,1]$? Is it valid to say that $[0,1]$ also has cardinality c because adding a finite number of elements to $(0,1)$ (i.e. including the boundaries) does not affect the cardinality?


Windows 10 - Controlling Automatic Update

I'm currently running Windows 7 but I'll probably get a new PC with Windows 10 Pro this year.   I've heard horror stories about automatic updates with Windows 10 happening at unpredictible times and causing big problems so I'm trying to understand them.    implies you can "defer" them but was a little unclear about defer them to exactly when, or how long?   Likewise the suggestion about Active Hours was a little unclear about how rigorously Microsoft follows it, i.e., if I say my "active" hours are 8AM to 6AM, does that guarantee that updates will only happen between 6-8AM?  I do professional video production so I'm often in the middle of big projects with tight schedules, and my PC is often running long multi-hour exports or conversions.   Overnight I'm often running batch-jobs, complete backups, malware scans or de-frags.  So an unscheduled reboot or interruption could be disastrous.     How do I exercise precise control over this risk?   I'd be perfectly happy to run an Update every single day as long as I could start it manually to make sure that no backups, exports, de-frags are running at the time.


Rotate end face of Cylinder keeping cylinder diameter

I once saw a tutorial on YouTube that gave me a simple keystroke to rotate the end face of a cylinder without deforming the sides. I used it many times, but then didn't require it for a year, until now, when it would be really useful. Most answers in public forums relate to using the bisect tool instead of rotate, but that was not the solution I came across on YouTube and interrupts workflow. Does anybody know how to do this? It is extremely useful and precise, as you can simply enter [something] then [r] and then the degree, and it forms a perfect turn in the cylinder without crushing the sides.


Why would a bank only apply your payment to principal?

I have had several business loans and understand that this is not by any means typical.  I noticed that for a year my payments were not decreasing the principal on the loan. When I asked the bank why, I found out that at some point my payments were getting applied to  principal only. Now I am paying interest off that was not paid for 6 months or so.  My banker states that he can change all the interest payments to principal payments. I am confused to why this would be. If I make all my principal payments first then would the bank lose a substantial amount of interest?  This has happened on 2 of the 3 loans I have looked at so far.  If they are willing to change all the payments to principal only,  would this be beneficial to paying less interest ultimately? I assume there would be an interest account accruing somewhere that would need to be paid off at the end of the loan.  I understand that typically you have a loan balance that would include interest and principal.  My balance owed did not change when I continued to make same payment? It gets applied to interest. The balance on the statement must not be a true balance. There must be interest owed above the balance showed but why would they do this to start with? They applied full payments to principle only first in order for interest to get to be more than several payments.


Does wishing a spell glyph into existence also require casting the stored spell?

Suppose I want to use  to cast an 8th-level  (for free) and store a spell in it. Do I still need to supply the spell to be stored by casting it using another one of my spell slots? If so, this would limit me to only storing spells I can cast, and would require expending a second spell slot as normal.   Or does the wish spell take care of all of that, allowing me to wish the ward into existence with only a 9th level spell slot and choose any valid spell from any class's spell list?


Howto Create an RSS 2.0 Feed with JAVA.Using Strust2  development.


osgeo4w not installing processing tools in QGIS toobox.

I have uninstalled and reinstalled QGIS several times from the OSGeo4W application.  I have done this with no problem on several other times, but now I cannot get the tools to load.  Most of the help simply say to just use the OSGeo4W application and not to worry about anything else.  What do you do when the OSGeo4W application is not working.   Do I need to change the Windows environment variables manually?  I have never had to do this before.


So I'm doing a URL that expires and here's a some code   //DB query $stmt = $con->prepare("SELECT token_created_at from reset WHERE token = :urltoken"); $stmt->bindValue(':urltoken', $_GET['token']); $stmt->execute(); $stmt->setFetchMode(PDO::FETCH_ASSOC); while($row = $stmt->fetch()) {      $token_created_at = $row['token_created_at']; }  $expires_at = $token_created_at->modify('+1 hour');  //Return current time to match $current_time = date('m-d-Y H:i:s ', time());   The issue is here's the error I get      ( ! ) Fatal error: Call to a member function modify() on a non-object in /Users/matt/Desktop/Likes/forgot/activate.php on line 18   Line 18 is   $expires_at = $token_created_at->modify('+1 hour');   So if I can't do it this way, how would I do it?


The WiFi symbol on the top right is empty and no WiFi networks appear, I try to set one up but the "device" box is greyed out. I have Ubuntu 16.04. When I enter the command lswh -C network I get this:     *-network UNCLAIMED   description: Network controller      product: BCM43142 802.11b/g/n vendor: Broadcom Corporation physical id: 0   bus info: pci@0000:03:00.0  version: 01     width: 64 bits   clock: 33Mhz  capabilities: cap_list   configuration: latency=0 resources: memory:94100000-94107fff  *-network description: Ethernet interface product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller  vendor: Realtek Semiconductor Co., Ltd.   physical id: 0 bus info pci@0000:04:00.0  logical name: eno1  version: 0a   serial: dc:4a:3e:f7:23:64  size: 10Mbit/s capacity: 100Mbiy/s   width: 64 bits   clock: 33Mhz    capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation  configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8107e-2_0.02 02/26/15 latency=0 link=no multicast=yes port=MII speed=10Mbit/s  resources: irq:129 ioport:3000(size=256) memory:94004000-94004fff memory:94000000-94003fff   And a warning about not running this as super-user  I can access the internet if I use an Ethernet cable, or If I startup the laptop in windows 10


Is it possible to provide "if" and "else" syntaxis in Ubuntu terminal?

I was asked to create command which generates one word in terminal, if internet connection is absense, and another one, if it present. For doing that it seems that I need "if" and "else" syntaxis. Is it possible to provide such syntaxis in terminal?


Why does including a Wiki URL with the Chinese name for Yahtzee trigger an accusation that I am posting spam?

See  where I replaced the link with a footnote, referring to how to find the link on a different SE (where I found it).  The name of the page, being a Wiki, is taken from the page’s title. The first character in the name triggered an error accusing me of posting spam.  I don’t appreciate the allegation.  What’s wrong with that character?  I would suggest that you be more intelligent than disallowing all use of a specific letter!


How to expand primary partition when WUBI is used to install?

I have installed Ubunut 12.04 using WUBI. The "Installation size" options I chosen was 18GB i.e the amount of space you want to "give up" for WUBI. That is the space wubi's Ubuntu install is able to use. Wubi creates a disk image (loopmounted device) on your host system in/on which Ubuntu is installed. Now, I am running out of memory in primary partition.   Could anyone help me out to extend/stretch the partition size?


MacOS Mojave: An error occurred while verifying firmware

I have Mid 2014 Macbook pro machine and running OS macOS Sierra 10.12.6. Now I am trying to upgrade my OS then may mac getting hanged after restart until battery drain after that I am getting An error occurred while verifying firmware. Also machine date is being change to 1st Jan, 2015. Kindly provide me solution if someone knows how figure out it.


Every now and then I go out of town with family for a weekend or what-not.  On these trips my brother and I always bring our laptops & such and we are always wanting to play 1v1 against each other or 2v2 with bots on LAN.  There is no internet connection aside from our dinky little mobile hotspot which we pay for data usage.  It's not an option.  How can he and I play Starcraft 2 on an Ad-hoc network we set up?


Can Minecraft be played without being connected to the Internet?

My son would like to play Minecraft. If I download it to his laptop can he play it without an internet connection?


How does Einstein got equivalent mass - energy equation E=mc2?

How does Einstein got  equivalent mass- energy equation E=mc2 ?


I get data from a sensor in int type but the data range from 0 to 999. I need a simple way for the var to always be the same length. Like if I get 123 I don't need to change it but if it's 43 I need it to be 043. Is there a simple way to do that?  Thanks.


Ubuntu Update problem | 16.04 ; cannot complete the update

whenever I run :   sudo apt-get update   I get this message below:   W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs  E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs  E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found  E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.   I used    sudo nano /etc/apt/sources.list   and comment or remove lines that include cdrom. eg:  deb cdrom:[Ubuntu-Server 16.04 LTS Xenial Xerus - Release amd64 (20160420.3)]/ xenial main restricted>   I was be able to remove it. when I ran sudo apt-get update , got the error message below.  W: The repository 'http://ppa.launchpad.net/ubuntu-on-rails/ppa/ubuntu xenial Release' does not have a Release file.  N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.  N: See apt-secure(8) manpage for repository creation and user configuration details.  E: Failed to fetch http://ppa.launchpad.net/ubuntu-on-rails/ppa/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.   could anyone shed some light on this please ? Thanks a million in advance.


apt-get is not using configured proxy automatically

I defined http_proxy and https_proxy both in ~/.bashrc and ~/.profile, but by running apt-get commands these variables are not considered and I have to specify it manually (sudo http_proxy=*** apt-***). This is really annoying! How can I fix this? (I've already restarted the OS)


Sorry, I know there are several threads about RSA encryption and how to calculate $d$. But there is a thing I still don't understand. So you calculate $d$ by using the following expression (): $$   e \cdot d\equiv 1(mod\ \varphi(N))  $$  The the usual way to proove this (based on $e^{\varphi(N)}\equiv1 (mod\ N)$) is:  $$   m \equiv m^{k\cdot\varphi(N)+1} \equiv (m^{\varphi(N)})^k\cdot m \equiv 1^k\cdot m (mod\ N) $$  There are serveral things I don't understand:   The Euler theorem only applies, if $m$ and $\varphi(N)$ are coprime (which is not the case here) $m^{\varphi(N)} (mod\ N)$ is defnitly not $1$ Nonetheless: For a defined $k$ the equation $m^{k\cdot \varphi(N)} \equiv 1 (mod\ N)$ seems to be correct. But why is that? And why can you just write $(m^{\varphi(N)})^k \equiv 1 (mod\ N)$, if $k$ can't be an arbitrary number?


When adding certain floats in JavaScript the output of those particular floats returns long numbers

I was trying to add a few decimal points initialized as variables and the output of the number was extremely long:   var a = .1 ; var b = .2 ; var c = a + b ; document.write(c) ;   The c variable returns a number of 0.30000000000000004, Ive searched high and wide and can't find an explanation why some floats return perfectly rounded answers and some dont.


Difference between 'dir' and 'ls' terminal commands?

I've been trying to find the difference between using the dir and ls commands in terminal. I know ls is the traditional UNIX method of viewing the files in a directory, and that dir is the windows command prompt equivalent, but both commands work in terminal.   If I type in dir, it displays the files and folders in the directory, and if I type ls, it does the same, except with content highlighting. Both commands accept options (i.e. ls -a and dir -a both return all files and folders and hidden files.   So does anyone know what the difference is and why both dir and ls are used?


As I understand, the Axiom of Infinity in ZFC theory gives us an infinite set from which  the natural numbers can be extracted. (See "Axiom of Infinity" at )   Might the following proposed axiom be a weaker version (using everyday functional notation)?  $\exists X,S,x_0( S:X\to X\land \forall a,b\in X(S(a)=S(b)\to a=b) \land x_0\in X \land  \forall a\in X(S(a)\ne x_0 ))$  In words, there exists $X,S$ and $x_0$ such that  $S$ is a an injective function on $X$, and $x_0\in X$, and $x_0$ has no pre-image in $X$ under $S$.  Note: It can be shown that $X$ is Dedekind-infinite, and that it is possible to extract the natural numbers (as defined by Peano's Axioms) from $X$ where $S$ is the usual successor function and $x_0$ is the $0$ (or $1$).


Variable declaration, substitution and automated calculations with luatex in math environment

I am trying to perform automated calculations with latex using lualatex. I need to be able to printout calculations like "M = a+b" while maintaining all functionalities and options wihtin the math environment. However, along multiple parts of the document, I need o:  Declare "a=5" (a = \SI{5}{kilo\newton\metre}) Declare "b=6" (b = \SI{6}{kilo\newton\metre}) type "M = a+b" Get the automated output M = 5+6 = 11 Set the unit assigned to the output of the equation ( for example 11 KN . m)  In addition I need to be able to:  Decide whether a and b are substituted within the equation along with their units or not (for example M = 5 kN . m + 6 kN . m = ...) or just (M = 5 + 6) Decide whether the output of the equation is assigned a unit or not Set the multiplication symbol to (Asterisk: \ast) or (x: \times) since it is more appropriate to use (Asterisk:\ast) as a symbol for multiplication. Maintain the same syntax rules used in the "Math" environment ($......$) when displaying the substituted equation I am using siunitx package, need the units to follow its settings. Need to be able to set how numbers are displayed using the \num command or math environment commands (\frac{}{}...) Using brackets, braces .... and so forth setting the variables so that they can be redeined later in the following parts in case the same equation is used multiple times   \documentclass{article} \usepackage{amsmath}  \usepackage[per-mode=symbol,inter-unit-product = \cdot, exponent-product = \ast, output-product = \ast, group-separator = \text{~}, group-minimum-digits={3}]{ }  \usepackage{luatexbase} \usepackage{luacode} \usepackage{lualatex-math} \usepackage[bidi=basic,layout=lists.tabular]{babel} \babelprovide[import=en,maparabic,main]{english} \babelfont[english]{rm}{Times New Roman} \usepackage{nomencl} \makenomenclature   \begin{document}  \nomenclature{$a$}{.....} \nomenclature{$b$}{.....}  \printnomenclature   \begin{gather} M=a+b \begin{aligned} a &=definition + units.... \end{aligned} \end{gather}  \end{document}   Upon seeing the post  I have noticed that it handles solving mathematical equations, however the process of variable declaration is not handled. In addition to Embedding units in the output as well as in the numbers within the equation itself. I am not familiar with lua, so I do not know if there is an easier manner through which equations can be evaluated since I have noticed that too much coding is required for evaluating simple expressions.


What is the period of $\sin 2\theta  + \sin \frac{\theta}{2}$? The period of the first term is $\pi$ and that of the second is $4\pi$. Does that mean that the period of the whole is $4\pi$?


Why when opening parachute, the man doesn't go upwards?

If an object is moving at terminal velocity and then opens the parachute, the air resistance is higher than the weight so why doesnt he go upwards.


I'd like to delete a chat.   The chat has more then 15 rows and therefore wont be deleted automatically.   Would it be possible to request a delete?  Edit:  Like you probably didn't notice in my above text is that I've read the post you are referring to which mine is a duplicate of.  I'm wondering how I can contact a moderator or similar to delete a chat?


How to Require a Minimum Image Dimension for Uploading?

I need a way to restrict authors from uploading images bellow specific dimensions.   Say I only want to allow uploading images that are at least 400px x 400px. If the image size is smaller, the author should get an error notice that the image is too small.    Is there a plugin or code that can accomplish this?


Solving congruence system with no multiplicative inverse

I am trying to find a way of solving congruence systems of the form:  $$ b*x = a \quad mod \quad  y $$   Where $b$ and $y$ are not prime to each other.  My current way of solving congruence systems where $b$ and $y$ are prime to each other is to find the multiplicative inverse  of $b$ in $y$ and multiply $b$ (which will make it 1) and $a$ with this value.  Example:  $$ 13 \ x = 3 \ mod \ 17$$   I calculate the mul. inverse of 13 and multiply 3 and 13 times that value and thus I have solved this equation.  But I dont know how I can do that where $b$ and $y$ are not prime to each other.  Example:  $$3 x = 3 \ mod \ 9$$  How would I solve this ?


How to prove by induction that $\frac{a^n+b^n}{2}\geq\left(\frac{a+b}{2}\right)^n$?

I'm about to prove that for any $a,b>0$ and $n\in\mathbb{N},$ the inequality: $\frac{a^n+b^n}{2}\geq\left(\frac{a+b}{2}\right)^n$ holds.   By induction I get: $$\left(\frac{a+b}{2}\right)\cdot\frac{a^n+b^n}{2}$$ $$=\frac{1}{2}\cdot\frac{a^{n+1}+b^{n+1}+ab^n+ba^n}{2}$$ $$=\frac{1}{2}\left(\frac{a^{n+1}+b^{n+1}}{2}+\frac{ab^n+ba^n}{2}\right).$$  Now I have to prove that $$\frac{1}{2}\left(\frac{a^{n+1}+b^{n+1}}{2}+\frac{ab^n+ba^n}{2}\right)$$ $$\leq\frac{a^{n+1}+b^{n+1}}{2}$$ $$\Leftrightarrow a^{n+1}+b^{n+1}\geq ab^n +ba^n.$$ But I don't know how to prove that one, is it possible to be proved by induction ? Thank you.


Why do we need to compile twice to see the changes in table of contents?

I'm using Texmaker 4.4.1 as an editor and MiKTeX 2.9 as a compiler. When ever I create table of contents (\tableofcontents), table of figures (\tableoffigures) and table of tables (\tableoftables); I need to compile the codes twice to see the changes in the pdf document.  Why can't I compile only once and see the changes?


I selected a single face in the object (car wheel, see picture) to be given a particular material (rubber, red color). However, when I press "assign" in the material tab, the whole object (wheel) is painted in the material. How can I limit this to the face?


Does cooking reset the expiry date of ingredients?

Assume I have the following ingredient all expiring tomorrow:   Mushrooms  Paneer (Cottage cheese)  Basmati rice   If I make a dish with these 3 ingredients (basically put rice, chopped mushroom,chopped paneer, water and some spices in a pressure cooker and wait for 2 whistles), is the expiry of these items somehow extended? Can I now keep this cooked dish in my fridge for another 1-2 days without going bad?


Convert from MySQL datetime to another format with PHP

I have a datetime column in MySQL.   How can I convert it to the display as mm/dd/yy H:M (AM/PM) using PHP?


Commas that are sentence flow-stoppers ... Can I leave them out?

Is it acceptable in BrE to omit the commas (as I've done below) after 2006, 1946, France, Texas and New York? To me, commas after each serve no purpose: they reduce the flow of the sentence.  • The performance took place on February 2, 2006 at the State Theatre in Ithaca.  • January 23, 1946 is Helen's date of birth.  • Prague, Czechoslovakia  is a great vacation spot.  • Paris, France will host the Olympics.  • Dallas, Texas is the home of this special event.  • Syracuse, NY will play host to this year's Rock of Ages music festival.


The problem occurred on my PC with Ubuntu 20.04 and Nvidia GeForce RTX 2070. I tried to install the newest CUDA SDK and had problems with drivers so following various tutorials so following many tutorials I purged Nvidia drivers being willing to install newer ones, but after reboot choosing Ubuntu in GRUB, I get no signal (a blank screen). To fix it I had run Ubuntu Recovery Mode (with internet connection) with root terminal and tried to install drivers. The problem is that I am unable to install any Nvidia drivers now because the dkms package is missing and I cannot install it, constantly giving this message: E: Package 'dkms' has no installation candidate Does anyone have an idea how could I install dkms and so as the drivers and get my Ubuntu running properly again? Results of sudo apt update, sudo apt upgrade and sudo apt install dkms:


I recently installed ubuntu 14.04 LTS on my new flex 3 1480. I do not see wireless option. I tried the solution mentioned in  post but it doesn't work. Output of the wireless script can be found  .  Any help is appreciated. Thanks


I have tried to download apps from App Store, but they require iOS 7.1.4. Please can you help me to upgrade my iOS 5.1.1 iPad to iOS 7.1.4?


Is there a relatively "simple" (in the sense that it does not require knowledge of algebraic number theory) proof that the ring of integers of the algebraic number field $\mathbf{Q}[i]$ is $\mathbf{Z}[i]$? One can assume a one year course in algebra, covering the usual topics on ring and field theory, e.g. Gauss's lemma etc


Why do neural networks need so many training examples to perform?

A human child at age 2 needs around 5 instances of a car to be able to identify it with reasonable accuracy regardless of color, make, etc. When my son was 2, he was able to identify trams and trains, even though he had seen just a few. Since he was usually confusing one with each other, apparently his neural network was not trained enough, but still.  What is it that artificial neural networks are missing that prevent them from being able to learn way quicker? Is transfer learning an answer?


Adding suspension forks to rigid bicycle

I'm thinking of adding suspension forks to a rigid mtb. I realized that the geometry will change with the front higher and so the chain will be slanted up. Does this affect how hard and tiring is it to pedal and the steering. If I were to do it, how much travel of suspension do I need, or should I just stick to the rigid.


Book featuring a child learning from a crowdsourced AI book

The book features multiple parallel story lines:   a poor child accidentally ends up possessing an AI driven book; the voice for the AI is crowdsourced to a woman, who gradually figures out that she's involved in helping out the child; genetic engineering is pervasive, and various factions of society spread viruses into the air as a way to fight wars, communicate, etc... Membership in a subsection of society buys you protection from the viruses; if you're not protected, you can end up severely damaged or otherwise not autonomous; some of the story line features a mysterious religious sect which subsume their consciousness to a collective, which performs some sort mysterious, of massively parallel computation, possibly using its members' brains; they form their habitats under water for cooling purposes.


What is the difference between a vector and its transpose?

I have seen a definition of orthogonality between two vectors something like this:  $$<\vec{u}, \vec{v}> = u^T \cdot v = 0$$  I am wondering what is the purpose of using a transpose of a vector (in this case and in general). I have also seen this in the formula to find the projection of a vector over another, but I have used just the normal vector instead of its transpose and everything seems to work.


So there is a non profit organization in Greece called "Μπορούμε" which translates to "we can". Me and some friends we volunteered there as a valentine's day event to give back to the community because we want to support it. We would like to write a small article about our event. The title, as of yet, is "To love is to can". I despise the way it sounds!! "To can" sounds odd to my ears. Is there any way we can rephrase it? The meaning we're going for is something along the lines of we love & we can but in a catchy way to grab attention.


What does ⟨ -,- ⟩ mean in the context of category theory?

The above brackets are from  under the equational definition. I have also seen this notation in a few textbooks, particularly Categories For The Working Mathematician on page 13, paragraph 2. I suppose that it just denotes a pair of objects under question (not categorical objects). But I have not found a real explanation.


Automatically select a feature from another layer based on shared attribute in QGIS

I have two shapefiles, A (polygons) and B (points), and I need to select all features from shapefile B that have the same attribute (for example, "Name") as shapefile A, and I need to do this iteratively for a large number of features.  Normally I would browse the table of shapefile A using the Go2NextFeature plugin, select a record, copy its name and make a "select by attribute" selection on layer B.   It would be best if whenever I select a new feature in shapefile A, all features of shapefile B with the same name would automatically be selected.


I'll keep it short:  I have a list of binary strings that, after being multiplied, show strange behaviour.  Here it goes.  binary_strings = [[0, 1, 1, 0], [1, 0, 1, 1]] * 4 for index, string in enumerate(binary_strings):     if index == 0:         string += [0]   expected result:  [[0, 1, 1, 0, 0],  [1, 0, 1, 1],  [0, 1, 1, 0],  [1, 0, 1, 1],  [0, 1, 1, 0],  [1, 0, 1, 1]]   result achieved:  [[0, 1, 1, 0, 0],  [1, 0, 1, 1],  [0, 1, 1, 0, 0],  [1, 0, 1, 1],  [0, 1, 1, 0, 0],  [1, 0, 1, 1]]   If binary_strings is not multiplied, then it works as expected. If insted of += operator I use string = string + [0], result is also 'correct'.  This is a problem that I have a solution to, but would really like to understand what is going on as it migth prevent future problems. It seems to be something related to the way python relates objects in memory. Other than that, I have no further understanting of might be going on.  Thanks!  edit: another issue here is that changing the operator changes the outcome to the corrected one, which is not something I have seen discussed. If it has, please link me that discussion. Thanks!


Recommended maths book for beginner to study in computer science

I am going to study computer science next year. I am afraid I can't handle the mathematics in the university because I only know some basic mathematics, such as set theory, simple probability, simple matrix operation and I don't know calculus.   Which books you will recommended maths book for study in computer science? I have found two books by Gilbert Strang,  and . Are they worth to buy ?


Why does connecting a high-current device to my digital circuit cause weird behavior?

I have a   arduino microcontroller other digital thing   and when I connect a   motor pump heater other high current thing   I experience   weird ADC measurements reboots crashes errors in digital communication other unexpected behavior   My power supply is properly sized to power all these devices. I don't have an oscilloscope so I can't see much what's actually happening in the circuit. What's a likely cause?


Expected number of strings of m or more consecutive successes

Total number of trials = N. The trials are independent. Probability of success = p. Probability of failure = 1-p. What would be probability of getting m or more consecutive successes?  Is there some online/downloadable efficient software where I can input N, m, p and it gives me the answer? Can scientific calculators can do this job?


Prove the following expression with induction

Prove that:   $$ 9+16+\dots+(n+2)^2 = \frac{n^3}{3}+\frac{5n^2}{2}+\frac{37n}{6}  $$with induction.   I managed to prove the base step but got stuck with the induction step.  Could anyone please help me with the induction step?


What movie has a falling capsule that transports its occupants to a parallel reality through time dilation?

I remember watching this sci-fi movie where a huge metallic capsule gets dropped from a few hundred meters. The capsule had a chamber inside where only one person could be seated. During the drop, time dilated and the person would transcend to another world, lasting for days, even meeting dead people. Kind of a parallel reality.  It was an amazing movie, but I cannot recall its name.


Last minute flight bookings - better to book online or at the airport?

We had , which covered ground on what happens to flight prices over the period.  What I'm interested to know is if I had to fly out at short notice, say within 1-2 days, then am I better off booking within that 1-2 day gap online, or am I better off trying my luck directly at the airport (as long as I'm willing to wait at the airport) for a cheaper price? Is there any truth to rumours that airlines sell tickets at cheaper prices at the airport right before flights to fill empty seats or is that a myth?


When do we use i++ and when do we use ++i in C++

When I do exercises, I always use for loops: for(int i = 0; i < n; i++) But sometimes I got wrong with them, I have tried in many ways to fix, but it ran only when I turn the i++ in for loop to ++i. I wonder when can we use i++ and when ++i?


making 3d surface using list of vertices coordinates

i want to animate a changing 3d surface (i.e. an ocean wave). the surface cannot be defined with a single z function and instead I have been defining as a list of coordinates that lie on the surface. when I use matplotlib the software is able to make a smooth surface based on coordinates easily, but on blender I cant figure out how to add faces.  I use a bmesh to plot the coordinates which I give in the form [(x, y, z), ...]. However, I can't figure out how best to add edges and faces to make a complete surface. I would like to make the faces square so each square's corners are marker by the four closest vertices.    here is a surface made up of individually plotted vertices on a mesh. If I use the 'make edge/face' option it adds one big face bounded by every single vertex as far as I can tell.     is there a way to achieve what I want without having to manually add faces to each group of four vertices? preferably in a way that might be efficient enough to animate quickly.


NullPointerException when printing results from array

I am a first year programming student and I am stuck on a question for one of my labs. I have played around with this little program for ages but I can't find the bug. I've used the debugger and looked through this forum for ideas but I've come up empty handed.  public static void main(String[] args) {     Scanner input = new Scanner(System.in);     String pet;     String pets[] = new String[5];     int i=0;       System.out.println("Enter the type of pet you own or type 'quit' to finish:");     pet = input.nextLine();     while(i<pets.length && pet.equalsIgnoreCase("quit") == false){         pets[i] = pet;         i++;         if(i==5)         {             System.out.println("Maximum of five reached:");         }         else         {             System.out.println("Enter the type of pet you own or type 'quit' to finish:");             pet = input.nextLine();         }     }     for(i=0; i<pets.length; i++){         if(pets[i].equals("null")==false){         System.out.println(pets[i]);         }     }     input.close(); }   This is the question that I have been asked. I only include this because it dictates the type of loop that I have to use.  "Write a program that uses a loop to ask the user to enter the type of pet they own.(maximum of 5 pets allowed ) They need to enter “quit” to stop entering data. The pets are stored in an array. Use for loop to display the pets in the array."  I appreciate any help I can get.


Are there rules for creating level 0 characters?

Are there rules for creating level 0 characters in 5e? I've been running a campaign where the players begin sub-standard and 1st Level characters are generated in-game as the story unfolds. I just made them all begin with a couple of hp and 9's across the board for ability scores (since I wanted them at a disadvantage compared to the average human, and to fail at a generic DC10 task more often than succeed).  It was a real grind, with many opportunities for TPK (total party kill) when faced with even a single challenge rating 1/2 adversary (obviously I fudged the dice a little to prevent this). Are there published rules for this?  If there aren’t published rules for this, has anyone tried doing something like this? Any first hand experience on how it has played out would be welcome.


What does "select((select(s),$|=1)[0])" do in Perl?

I've seen some horrific code written in Perl, but I can't make head nor tail of this one:  select((select(s),$|=1)[0])   It's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets $|).  But I can't figure out why there's multiple select calls or the array reference. Can anyone help me out?


Can you prove that if $p$ is a prime greater than $5$, then the sum of the squares of the quadratic nonresidues modulo $p$ is divisible by $p$?  Note that I have just proved that the sum of the quadratic residues modulo $p$ is divisible by $p$ for $p$ greater than $3$.


Windows Backup & Restore: What to Keep from AppData?

A couple years ago, my father made a backup of one of our computers using Windows Backup and Restore. It was either Windows Vista or Windows 7, not sure which. He backed up the entire computer, including Program Files, AppData, My Documents, everything, and now it is on .zip files on a WD Passport with 300GB, I'm not sure exactly what it is called. Now I am trying to decide which files to keep and which to delete. Most of what we would keep are files, as we would need CD's to use the programs, and I'm pretty sure they would install everything all over again. That pretty much leaves out Program Files, however, I'm not sure about AppData. For example, my mother used Greetings Workshop and wants some files from there, and she may want to keep some default settings she used. I am talking generally here, as I'm sure some programs have different ways of saving things in AppData.  What, if anything, should I keep from AppData, and what should I delete?


Is this sentence grammatically correct ? Use of present participle

Looking for a way to choose the proper modules for the system, I reviewed all my notes taken in class.    I know looking is present participle, but I feel it is improper to be used in this meaning. The participial phrase functions as an adjective modifying I (the subject), but the meaning expressed in this sentence is not like an adjective. I think it is clearer if expressed in adverbial clause of purpose.


I know that when number of protons is high, the nucleus of atoms become unstable due to repulsive force and is radioactive. But why is that the nucleus also becomes unstable when there are too many neutrons?


Why are there 7 total horcruxes when Voldemort intended for 7 original horcruxes?

All the horcruxes are as follows:   Tom Riddle's Diary Marvolo Gaunt's Ring Salazar Slytherin's Locket Helga Hufflepuff's Cup Rowena Ravenclaw's Diadem Nagini Harry Potter   My question is though why there aren't more horcruxes? 8 to be exact. When we see Slughorn's memory, we see that Voldemort was planning on not making 1, but 7 horcruxes. However, he only made 6, and Harry was an unintended horcrux making 7.   What happened here? We even know that Voldemort wanted 7 because it was the most magically powerful number, so it would stand to reason he makes 7 horcruxes, then Harry is an unintended 8th.


Solutions locally isometric to Schwarzchild

In Relativity and Singularities, Natário states that     Any vacuum solution admitting $O(n)$ as an isometry group is locally isometric to $M=\mathbb{R}^2\times S^{n-1}$ (with the Schwarzchild metric).   Why is that so? It doesn't seem obvious to me, and I found no precise proof (from the mathematical point of view) around the web.


How to get UTF-8 working in Java webapps?

I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå etc. for regular Finnish text and Cyrillic alphabets like ЦжФ for special cases.  My setup is the following:   Development environment: Windows XP Production environment: Debian   Database used: MySQL 5.x  Users mainly use Firefox2 but also Opera 9.x, FF3, IE7 and Google Chrome are used to access the site.  How to achieve this?


According to the LibreOffice website as of Feb 24 2018, there is a LibreOffice version 6.0.2. The Ubuntu Software Center installs 5.1.6.2 (that is 1 and a half years old) on my machine. How do I get a more recent version installed? (I am not very proficient with unpacking .tar.gz files). When will the software center get newer versions?


$G×G$ and $H×H$ being isomorphic implies $G $ and $H $ are isomorphic

This is an exercise from Hungerford chapter 2 section 3. Here $G $ is said to satisfy the ACC and DCC. Then how should I apply the Krull Schmidt theorem to prove the proposition in the title? I tried to show that $G×G $ itself satisfies the ACC and DCC but to no avail. Could anyone help me?


If an NPN BJT is being used as a switch, why is the load usually connected between +Vcc and collector? How is the performance affected if the load is connected between emitter and ground?


The mystery behind the self-siphoning beads

Recently, I saw  video, showing the phenomenon of the self-siphoning beads.  Dangling one end of a coiled string of beads outside of the container, a single pull is needed to cause all the beads to fall out.  Why is this so?  My main question: It is also observed that the longer and more coiled the string of beads is, the higher the exiting beads will "jump".  Why?  This not only defies the principle of gravity that I learnt, but also the fact that energy cannot be created!


How can I smoothly rotate a joint to an angle?

I would like to set the speed of my Box2D revolute joint on every update such that it rotates to a desired angle and stops. It should ramp down as its angle approaches the desired angle.  My first thought was just to set the speed to +max or -max based on the difference between the current angle and the desired angle. However, I think this might cause a see-saw effect as the joint overshoots its target angle.  What torque should I apply (each tick) to a joint to achieve a rotation to a specific angle and then rest?


How to properly write and execute a shell script and exit correctly?

I have written a shell script named startup.sh which does a lot of things (basically start a lot of things for me after turning on my local machine) - here is an excerpt:  #!/bin/bash gnome-terminal --tab & veracrypt --auto-mount favorites & thunderbird & ~/Application/IDEA/bin/./idea.sh & /usr/bin/slack & echo myuser mypass | skypeforlinux --pipelogin & sh bsync-project-folder.sh & exit   Open a console window and do:  . startup.sh   The shell script is executed and the window is closed afterwards.  Also working:  sh startup.sh   OR  ./startup.sh   The shell script is executed and the terminal window stays open - however it does not return to the console and have to stop script execution with CTRL + C (no matter if I execute with the command line interpreter or with ./).  However I want a clean exit of my script and then return to the same console with a success message. What am I missing?


What is the argument to say that $\aleph_0$ is the smallest infinity? Can it be done whitout AC?

A friend of mine asked me why $\aleph_0$ is the smallest infinity and if we must use axiom of choice to say that it is the smallest infinity.   Do you know if Axiom of Choice is neccesary?


Proving $\text{Var}{(\hat{y}_h)} = \sigma^2 \left(\frac{1}{n} + \frac{(x_h-\bar{x})^2}{S_{xx}}\right)$

I have asked in another question how $\text{Var}{(\hat{y}_h)} = \sigma^2 \left(\frac{1}{n} + \frac{(x_h-\bar{x})^2}{S_{xx}}\right)$.  Note that $\hat{y}_h$ = $b_0 + b_1X_h$ which is a regression line estimate at some given $X_h$.  This question concerns why the term $Cov(b_0,b_1)$ alone yields the RHS.  Substituting $b_0 = Y - b_1X$ we get that $Cov(Y,b_1) - XCov(b_1,b_1)$ = $Cov(\frac{\sum{Y_i}}{n},\sum k_iY_i) - XVar{(b_1)}$. Here X and Y without subscript are arithmetic means.  We can then rearrange to obtain $\sum \frac{k_i Var(Y_i)}{n} - \frac{X\sigma^2}{S_{xx}}$ which quickly yields the desired result.  My question is, why does this work?  This single term does not seem like it should alone yield the RHS.  Have I made an error in algebra?


Why do we use the article 'a' when referring to 100 items? But we don't use it when referring to any other plural count?

Edit Note:  This question has been linked to these questions about using an article before adjectives modifying numbers. This question here has nothing to do with adjectives at all:       The question  Why do we use the article 'a' when referring to 100, but not when referring to any other plural counting?  Here's an example:     I saw a hundred birds today.   But when talking about other count that 100, we don't use 'a' because it's plural:        I saw ninety-nine birds today.   I saw two birds today.   I saw two thousand birds.   I saw seventy-five birds.      Is there a grammatical or historical explanation?


Can't understand why we say that radians are dimensionless. Actually, I understand why this is happening:  theta = arc len / r   Meters/meters are gone and we got this dimensionless. But also we know that angle 57.3 degrees = 1 rad. So, can we use it as dimension?  In such a situation we can say that degrees are also dimensionless, because 1 degree = 1/360 of circle.  How we define the value is dimensionless or not? Why meter is not dimensionless? Where I'm wrong in my conclusions?


I've seen a few stripboards laying around that have no copper tracks. After looking online I can see that you can indeed buy these but I can't seem to find why or how to use them.  How can you use it if there's no tracks to solder too?


[Sorry, but I couldn't come up with a better title...]  I'm trying to prove that $$\prod_{i=1}^n (1+a_i) \leq 1 + 2\sum_{i=1}^n a_i$$ if all $a_i$ are non-negative reals with $\sum_{i=1}^n a_i \leq 1$ and it seems I'm stuck.  (And, no, this is not homework!)


Can you fake a closed question? [closed]

I just had a random thought; what if you append "[closed]" to the end of a question title. Is it filtered out, or in some way disallowed?  If you are seeing this, it isn't. It could potentially be used for some trickery, right? Or maybe not. I don't know, that's why you're here: discuss!  EDIT: Just a recap: Juan Manuel edited and removed "[closed]" from the end of the title and then answered (see below) - but it is technically possible.  Edit 2: Looks like it's still possible, if you play silly tricks with Unicode. (There's a  character in the new title.)


How calculate mean from 50th and 95th percentile?

I am trying to calculate the mean from two values, the 50th and 95th percentiles of a log normal distribution using R. Those values are 0.3 for the 50th percentile and 9.1 for the 95th percentile.   Actually, I am trying to apply the method used in , but I don't understand how the mean can be calculated with that mean = mean(ln((42 \ 666))). I don't understand that sign . I tried with this sign / but the results were different.  How to determinate the mean those two percentiles by using R ?


if I have a JSON object say:  var myObj = {'test' : {'key1' : 'value', 'key2': 'value'}}   can I remove 'key1' so it becomes:  {'test' : {'key2': 'value'}}


What are the characteristics that a champion should have to jungle?

In general, what characteristics should a jungling champion have?


Error "not valid choice" when dropdown populated using ajax

I've searched the other similar answer but still no luck. I have content type Station with field Province and City. Form alter: function mymodule_form_alter(&$form, FormStateInterface $form_state, $form_id) {   if ($form_id === 'node_station_form') { //    kint($form);     $form['field_province']['widget']['#ajax'] = [       'event' => 'change',       'callback' => 'mymodule_callback_example',       'wrapper' => 'edit-field-city-wrapper',       'method' => 'replace',     ];      $form['field_city']['#attributes']['id'] = 'edit-field-city-wrapper';      $options = ['_none' => '- None -'];      $user_input = $form_state->getUserInput();     $province = $user_input["field_province"] ?? NULL;      if ($province) {       if ($province === 'province_a') {         $cities = [           'province-a-city-1' => 'Province A City 1',           'province-a-city-2' => 'Province A City 2',           'province-a-city-3' => 'Province A City 3',         ];       }       else {         $cities = [           'province-b-city-1' => 'Province B City 1',           'province-b-city-2' => 'Province B City 2',           'province-b-city-3' => 'Province B City 3',         ];       }       $options += $cities;     }      $form['field_city']['widget']['#options'] = $options;   } }  function mymodule_callback_example($form, FormStateInterface $form_state) {   return $form['field_city']; }  The dropdown City successfully populate based on Province, but when I click submit form, there are error "The value you selected is not a valid choice"  What did I miss? Update Solved by following this . It add allowed_values_function to the field storage. Added to field storage allowed_values_function: 'mymodule_allowed_values_function'  and default_value_callback: 'mymodule_default_value_callback'  to field field.field.node.station.field_city.yml. The callback function: function mymodule_allowed_values_function(FieldStorageConfig $definition, ContentEntityInterface $entity = NULL, $cacheable) {   $empty = ['_none' => t('- None -')];   $cities = [];   if (!$entity->get('field_province')->isEmpty()) {     $province = $entity->get('field_province')->value;     if ($province === 'province_a') {       $cities = [         'province-a-city-1' => 'Province A City 1',         'province-a-city-2' => 'Province A City 2',         'province-a-city-3' => 'Province A City 3',       ];     }     else {       $cities = [         'province-b-city-1' => 'Province B City 1',         'province-b-city-2' => 'Province B City 2',         'province-b-city-3' => 'Province B City 3',       ];     }   }   return $empty + $cities; }  function mymodule_default_value_callback(ContentEntityInterface $entity, FieldDefinitionInterface $definition) {   return [     ['value' => '_none'],   ]; }


My Automator Workflow fails because it fails to find the git command within the 'Run Shell Script' command? Need help

I have an Automator workflow and one of the actions is to clone a repository. Here's the code for the 'Run Shell Script' action. The command is run within the Bash shell /bin/bash if that matters:  SOURCEDIR="${3/\/Volumes/}"  cd "$2" REPOURL="bob@somedomain.com:$SOURCEDIR" WORKINGDIR="$1"  # Capture any errors with cloning process in log file git clone "$REPOURL" "$WORKINGDIR" &> ./log.txt  // For debugging echo "exit code: $?" echo "PPID: $PPID"  open .   Now the Automator App runs fine on my machine. The path to git on my machine (A Macbook Pro) is: /usr/bin/git (I believe I installed git on my machine through Xcode)  But on my co-worker's machine (Also a Mac Pro) the Automator App fails. In fact, the output of the log.txt file says: bash: git: command not found   Now on my co-worker's machine the path to git is: usr/local/git/bin, which, yes, is different because he installed git through the Google Git Installer for Mac OS X, but I didn't think it should matter because in the script the git command is not absolute path to the command and further more my co-worker can run git normally from a Bash script but when invoked directly from the Terminal.  So what gives? Why does the automator workflow work for me but not for my co-worker?  There must be something fundamental about Bash or Unix that I'm not understanding here but I'm lost.


How to check if a matrix is diagonizable?

So i have this $3\times 3$ matrix  $$     \begin{pmatrix}     -2 & 0 & 0 \\     3 & 1 & -6 \\     0 & 0 & -2 \\     \end{pmatrix} $$  I want to check if the matrix is diagonizable. First thing i do is find the roots : namely $\lambda_1 = −2$ of multiplicity $2,$ and $\lambda_2 = 1$ of multiplicity $1.$  In order to ensure that the matrix is diagonalizable we need to find a basis of $\mathbb{R}^3$ whose elements are eigenvectors for $A.$ In particular, since we have the eigenvalue $\lambda_1=-2$ having multiplicity $2$ we need to check that the dimension of the eigenspace $E(\lambda_1)$ is equal to $2.$ We compute the eigenspaces of $A.$  $\DeclareMathOperator\Nul{Nul}$On the answer sheet is says that we need to find $\Nul(A+2Id)$... but why $2Id?$ Isn't is supposed to be $-2,$ so $\Nul(-2Id-A)$??   I do not understand this $\Nul(A+2Id).$ I always thought that we should compute $\Nul(-2Id-A),$ so what do i need to do ?   $\Nul(-2Id-A)$ gives me a different result from $\Nul(A+2Id).$  Does that mean that since $-2$ has a multiplicity of $2,$ we need to work with $2$ and not $-2$?  Somebody please help with a clear and simple explanation ! Thanks!


Interface options for specifying language prettify

I'm the maintainer for .  Markup authors can specify the language for source code, but not markdown authors. Are the SO admins interested in a way of doing this?  If so, might the following work   If the first line is "#!" followed by one or more word characters, then make the first line invisible (using CSS hidden:visible) and use those word characters as the file extension. Otherwise, use the current scheme.   So  #!css tag.class#id { color: red }   would be recognized as CSS.  In markdown, should any indicator of line numbers survive copy-paste in markdown?  Does any scheme like this need to do work to handle quoting of responses in markdown?  Is it common for inline responders to split code sections?  Do users also want to number lines (  ), so that others can respond with reference to particular lines?


How to avoid the 6 character minimum edit limit?

I recently found a piece of PHP code on Stack Overflow that was missing a semicolon. This would cause a syntax error, which in turn would cause a "500 internal error", and could be very confusing to beginners.  However, when I went to edit the post, I got an error:     Edits must be at least 6 characters; is there something else to improve in this post?   What is the correct way to avoid this limit, when the change to be done is genuinely less than 6 characters? (as in this case, it was a single semicolon; I ended up just commenting about it)


Minecraft Premium: "Sorry, but we couldn't connect to our servers"

When i try to log in to my minecraft premium account it says:     Sorry, but we couldn't connect to our servers. Please make sure that you are online, and that Minecraft is not blocked.   I tried turning off the firewall and updating Java (64-bit) but it still doesn't working. I'm using Wi-Fi. Any ideas?


my program consist of solving equations and asking the user if he want to solve more equation, so even though i enter yes to continue but the loop terminate ,this is my code       public static void main(String[] args) {      String goAgain;      double A, B, C, solution;     Scanner scanner = new Scanner(System.in);     System.out.println("This program will print a solution of an equation");     System.out.println("of the form A*X*X + B*X + C = 0, where A, B, and");     System.out.println("C are values that you enter.");      do {         System.out.println();         System.out.println("Enter values of A, B and C : ");         System.out.print(" A = ");         A = scanner.nextDouble();         System.out.print(" B = ");         B = scanner.nextDouble();         System.out.print(" C = ");         C = scanner.nextDouble();         System.out.println();         try {              solution = root(A, B, C);             System.out.println("your solution is : " + solution);           } catch (IllegalArgumentException e) {             System.out.println("Sorry, I can't find a solution.");             System.out.println(e.getMessage());          }         System.out.println("Do you want to solve another equation ? ");         goAgain = scanner.next();         System.out.println(goAgain);      } while (goAgain == "yes"); }


Very BIZARRE trend for accessing Windows 10 partition in Ubuntu 14.04

I think this might have something to do with the fact that Windows 10 is still new and there has yet to be an update in Ubuntu to accommodate the following issue. Nevertheless, I think everyone should be aware of this so we can hopefully find a solution for it. Here we go!  I had Windows 7 and Ubuntu 14.04 dual boot just fine and was able to access my Windows partition (for music, pictures, etc) without any problems. However, upon doing the free upgrade to Windows 10, I had to re-install Linux on the remaining partition (no big deal). But now, the following happens. I can only access the Windows 10 partition if I first boot up Windows 10 and then "Restart" into Linux. Even if I shut down Ubuntu and go back into it, I'll still have access to the partition because the last function I performed in Windows 10 was "Restart." If I go back into Windows 10 and click "Shut Down" and then power back up into Linux, that's when I get the mounting error stating "Unable to access 'Windows 10'"  If you guys have any insight on how to fix this issue or if you believe that Ubuntu has to release an update to correct the problem, please respond either way! Thanks! :)


iPhone 5s won't turn on after water damage

I just dropped my iPhone in the toilet bowl but took it out after about 3 seconds. It's now totally off and wont turn back on!  Aside from cleaning it and keeping it in rice, is there any other way to fix it? Or is it just gone?  It's out of warranty.


Postgresql split single row into multiple rows based on date

In my case, we have a table ABC with the supposed 1 row.     id name start_date end_date     1 Rahul 01/01/2021 06/01/2021     but while retrieving I would like to get multiple rows where the start date is incrementing by 1 like till it's less than or equal to the end date.     id name start_date end_date     1 Rahul 01/01/2021 06/01/2021   1 Rahul 02/01/2021 06/01/2021   1 Rahul 03/01/2021 06/01/2021   1 Rahul 04/01/2021 06/01/2021   1 Rahul 05/01/2021 06/01/2021   1 Rahul 06/01/2021 06/01/2021     Please let me know how we can do that.


How would you make a comma-separated string from a list of strings?

What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, ['a', 'b', 'c'] to 'a,b,c'? (The cases ['s'] and [] should be mapped to 's' and '', respectively.)  I usually end up using something like ''.join(map(lambda x: x+',',l))[:-1], but also feeling somewhat unsatisfied.