I have two classes. Class A contains a pointer to an instance of class B. In class A, I would like to call class B's instance method and send class A itself as the argument. I wrote the following code but it doesn't compile:  Source for Class A:  //a.h #ifndef A_H #define A_H  #include "b.h"  class A{   friend class B;   int i;    B *b;  public:   void callB(){b->calledByA(this);} };  #endif   Source for Class B:  #ifndef B_H #define B_H  #include "a.h"  class B{   int j;  public:   void calledByA(A* a){     //j=a.i;   } };  #endif   The error given by VS 2010 is   error C2061: syntax error : identifier 'A' error C2660: 'B::calledByA' : function does not take 1 arguments   Why?

I often find myself in a situation where I am facing multiple compilation/linker errors in a C++ project due to some bad design decisions (made by someone else :) ) which lead to circular dependencies between C++ classes in different header files (can happen also in the same file). But fortunately(?) this doesn't happen often enough for me to remember the solution to this problem for the next time it happens again.  So for the purposes of easy recall in the future I am going to post a representative problem and a solution along with it. Better solutions are of-course welcome.     A.h  class B; class A {     int _val;     B *_b; public:      A(int val)         :_val(val)     {     }      void SetB(B *b)     {         _b = b;         _b->Print(); // COMPILER ERROR: C2027: use of undefined type 'B'     }      void Print()     {         cout<<"Type:A val="<<_val<<endl;     } };       B.h  #include "A.h" class B {     double _val;     A* _a; public:      B(double val)         :_val(val)     {     }      void SetA(A *a)     {         _a = a;         _a->Print();     }      void Print()     {         cout<<"Type:B val="<<_val<<endl;     } };       main.cpp  #include "B.h" #include <iostream>  int main(int argc, char* argv[]) {     A a(10);     B b(3.14);     a.Print();     a.SetB(&b);     b.Print();     b.SetA(&a);     return 0; }


Suppose we have a positive sequence $\{x_i\}$ where $i=1, 2, \dots , n$. And let $m=\mathrm{min}(x_i), \; M = \mathrm{max}(x_i)$. Notice that $m, M>0$. Prove this inequality (discrete version): $$ \frac{\sum_{i=1}^{n} x_i }{n} \cdot \frac{ \sum_{i=1}^{n} \frac{1}{x_i} }{n} \le \frac{m+M}{2} \cdot \frac{ \frac{1}{m} + \frac{1}{M} }{2} \;.$$ Or you can prove this continuous version, where $f(x)$ is positive and continuous on $[0, 1]$ , and $m$ and $M$ are min and max values of $f(x)$ on $[0, 1]$, respectively: $$ \int_0^1 f(x) \,\mathrm{d}x \int_0^1 \frac{1}{f(x)} \,\mathrm{d}x \le \frac{m+M}{2} \cdot \frac{ \frac{1}{m} + \frac{1}{M} }{2} \;.$$ Important: I do have a proof, because the continuous version is actually an excercise of a workbook of mine. But that proof is too tricky, lacking insight as to why the product of two types of "average"s is controlled by their max and min values. So I brought it up here in seeking of an insightful solution. Hopefully finding a proof directly to the discrete version, for it is easier to imagine with my brain. Note: This question already has answers here . But that is more of a general case. I am looking for a more insightful and easy-to-understand proof with regard to this specific situation where the $f(x), g(x)$ in the original answer is taken as $f(x), \frac{1}{f(x)}$.


I am an Indian citizen living in Canada on work permit which expired on 31st May.   I have already applied for Work Permit extension but it is still in process and have not received yet.   I need to travel to India via Frankfurt/Munich.  Will there be any problem? Would a Transit Visa help?   Although my wife and I have valid US B1 visas, my daughter (4 yr old) does not have one.

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


Let $X$ be a space which is first countable and compact. Is $X$ necessarily separable?  Is $X$ necessarily second countable?

Could someone give me some classical examples of first countable, compact spaces which is not separable?   However, other examples are also welcome. Any help will be appreciated.


I've got a shapefile containing multiple polygons, attached to an attribute table. I'm looking at labeling all these polygons using the attribute 'AREA' column. However, these areas have not been rounded off and are in meters squared whereas I need them to be in Hectares. How would I convert these into hectares then present as a label.  Also, how can I create a white background for these labels?  I'm using ArcMap 10.3.1

I've got a polygon featurelayer in ArcMap 10.  The coordinate system of the featurelayer's featureclass is web mercator.  The dataframe of the map uses an equal-area projected coordinate system.  I've got a field on the featureclass called Acreage.   I'd like to calculate Acreage based on the polygon's re-projected area (into that of the dataframe's projection).  I don't want to create a new featureclass to do this.  Is there an easy way to do this in ArcMap 10?


I've stumbled upon this lemma a few times in my textbook: $$\sum_{k=0}^{n}\begin{pmatrix}n\\k\end{pmatrix}^2=\begin{pmatrix}2n\\n\end{pmatrix}$$ I've been trying to prove it, but I simply can't seem to see a connection. I've been trying to use proof by induction, but I can't express the statement for $n+1$ via the statement for $n$.  How do I prove it?

I would like to prove inductively that $${2n\choose n}=\sum_{i=0}^n{n\choose i}^2.$$  I know a couple of non-inductive proofs, but I can't do it this way. The inductive step eludes me. I tried naively things like $${2n+2\choose n+1}={2n+2\over n+1}{2n+1\choose n}=2\cdot {2n+1\over n+1}{2n\choose n},$$  But I don't think it can lead me anywhere. I would like the proof to be as simple as possible.


I have a varable var file = "testfile.txt"; I am using the following script to find its extension and it works well;  var parts = file.split('.'); var flename = parts[0]; var ext = parts[1];   But if i have a filename with more than one dots, the logic sucks.. It will give txt for filename.txt, but not in the case of file.nam.e.txt or something else.  Anybody suggest me the simplest solution to do this using javascript and(or) jQuery??  Thanks in advance..

See code:   var file1 = "50.xsl"; var file2 = "30.doc"; getFileExtension(file1); //returns xsl getFileExtension(file2); //returns doc  function getFileExtension(filename) {     /*TODO*/ }


There is one thing that always troubled me in quantum mechanics, how do you justify the expression of the energy and momentum operators, namely $\hat{E} = i\hbar\frac{\partial}{\partial t}$ and $\mathbf{\hat{p}} = -i \hbar \mathbf{\nabla}$? The only justifications I've seen were always the same: take a plane wave function with a certain frequency / wave vector, inject Planck's / De-Broglie's relation to convert to energy / momentum, time differentiate / take the gradient, and associate what comes out. But a plane wave is only one particular wavefunction (not even physical), how can you infer anything general about wavefunctions starting from properties of particular solutions? Is there any more fundamental justification? EDIT This was closed and tagged duplicate but the  doesn't answer the question. Although it has a very similar title, it is actually asking about some sort of force operator. (Only a link is given in an answer, but it refers to the demonstration I gave.) Please check this before closing ! :( I also checked other related questions but none cover the subject as it has started to be here.

It has been noted $\! { \, }^{\text(1, 2)}$, for instance, that  $$\mathbf{F} = \frac{d}{dt}\!\!\biggl[ \, \mathbf{p} \, \biggr]$$  is true in all contexts.  Likewise,   it is apparently true that  $$\mathbf{F} = - \nabla \Phi := - \frac{d}{d\mathbf{r}}\!\!\biggl[ \, \Phi \, \biggr].$$  Is this, in a nutshell, a sufficient and valid justification for setting (in the corresponding suitable contexts) the  as$\! { \, }^{\text(3)}$  $$\mathbf{\hat p } \propto -i \nabla := -i\frac{d}{d\mathbf{r}}$$  and setting the (potential)  as$\! { \, }^{\text(4)}$  $$\hat \Phi \propto i\frac{d}{dt}$$  and both with the same constant of proportionality, $\hbar$, whereby  $$\mathbf{\hat F} =  \frac{d}{dt}\biggl[-i\hbar\frac{d}{d\mathbf{r}}\biggr] = -\frac{d}{d\mathbf{r}} \biggl[i\hbar\frac{d}{dt}\biggr] \sim \frac{d^2}{dt \, d\mathbf{r}} = \frac{d^2}{d\mathbf{r} \, dt}$$  ?  EDIT (related merely to formalities):  (${ \, }^{\text 1}$: Please note that  had been expressed explicitly in the form     $F = \frac{\mathrm{d} \mathbf{p}}{\mathrm{d} t}$ is true in all contexts.   However, since it appears admissible to take note of an assertion without strictly quoting and clinging to its original literal expression (as had been tacitly presumed already in , and as it seems to be  confirmed) I'd like, as far as unambiguously possible, to express the operation of  consistently by using (a form of) .)  (${ \, }^{\text 2}$: Please note that  whose  to which reference has been made above had been tagged (primarily) as has "".)     ($ { \, }^{\text 3}$: Please note that the indicated expression of the  is explicitly stated there as     ${\bf \hat p } = -i \hbar \nabla$   and     In one spatial dimension this becomes:    $\hat{p}=\hat{p}_x=-i\hbar{\partial \over \partial x}$,   where the nabla symbol ($\nabla$) is related to  .)  (${ \, }^{\text 4}$: Please note that the indicated expression of the  is explicitly stated there as     $\hat{E} = i\hbar\frac{\partial }{\partial t}$.   )


So, as the title states, I am trying to convert a string into a byte array.  So, I have this string: string bytes = "2C 2D 3B 27", and I want to convert it from a string, to a byte array, without actually converting the strings contents to a byte array.  So, turn this: string bytes = "2C 2D 3B 27"  to this: byte[] byteArray = { \x2C, \x2D, \x3B, \x27 }.

How can you convert a byte array to a hexadecimal string, and vice versa?


I want a simple explanation about Lazy loading in Entity Framework with a simple example.   Why do we use Lazy loading? When do we use Lazy loading?

What is Lazy Loading?  [Edit after reading a few answers] Why do people use this term so often?   Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview.  I guess I should have asked why people use the term Lazy Loading, what "other" types are their?


I am having trouble placing my nether-side portals so they connect to the correct overworld-side portals.  Note, when I started I wasn't aware that the Y-coordinate mattered; I figured the proximity thing was only based on x and z coordinates.  Anyways, first I built an overworld portal at -16, 196, 163. It's three wide so the actual portal blocks are -15/-16/-17, 196, 163. I then went into the nether via another portal and built one at -2, 51, 20. When they're both lit, they connect properly and no other portals collide. Praise the miners!  (The overworld portal would take me to the spawn chunks, you see.) Next I set out to build an Iron Foundry (Ethos' design, .) It requires a small nether portal, which wound up needing to be placed at -14, 184, 210/209. I figured, build another portal at -2, 51, and 26 to make them line up nicely.  No digs. Now the nether side of the spawn chunks portal takes me to the over side of the iron foundry portal, and the overworld side of the spawn chunks portal takes me to the nether side of the iron foundry. Both iron foundry portals link to each other.  summary of portal locations:  overworld:   spawn chunks: -16, 196, 163 iron foundry: -14, 184, 210   nether:   spawn chunks: -2, 51, 20 iron foundry: -2, 51, 26   My actual question: where can I move my nether portals so they work properly? I can move the spawn chunks portals if need be, but the iron foundry overworld portal needs to be there (otherwise I might as well scrap the whole project.)  Thanks for any help!

I'm playing on a SMP server and am trying to use the Nether to link up all my disparate bases around the world. Note in the below, A is Overworld, B is Nether.  I started with one portal (A1, thus spawning B1 in the Nether), and then created another portal a ways away in the Nether (B2), hoping it would be near the main area all the other players congregate. It (A2) was pretty close to where I wanted it, but not exactly. I then created another portal a short distance away (A3), which was where I was hoping A2 would land. I then went somewhere in the neighborhood of 400 squares away from where I initially built A1 (in the opposite direction of A2/A3) and created another portal, A4.   One would think A3 and A4 would create B3 and B4 on the Nether side, respectively. However, A4 linked to B1, and A3 linked to B2. The weird part is, A1 is further from A4 than A1 is from A3.   I hope that made any sense. My question is:  How far away do portals on the Overworld map need to be from each other in order to spawn separate portals in the Nether? Or, what are some ways to ensure a new portal won't link to an existing one?


MainActivity.java  public class MainActiviy extends BaseActivity {      @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);     }      @Override     public void onPause() {         super.onPause()         // Can I avoid BaseActivity's onPause()?     } }   I just want to call onPause() in MainActivity skipping BaseActivity.  I cannot edit BaseActivity as it is part of a library that I'm using and removing super.onPause() in MainActivity gives error.  Maybe this is possible or maybe not so workarounds are most welcome.

I read  and thought that would easily be solved (not that it isn't solvable without) if one could write:   @Override public String toString() {     return super.super.toString(); }   I'm not sure if it is useful in many cases, but I wonder why it isn't and if something like this exists in other languages.  What do you guys think?  EDIT: To clarify: yes I know, that's impossible in Java and I don't really miss it. This is nothing I expected to work and was surprised getting a compiler error. I just had the idea and like to discuss it.


Minecraft /give command I want to enchant a weapon via commands.  I tried doing /give @p Diamond_Sword 1 0 {ench:[{id:16,lvl:2}]}  But I get this error  missing '}' or member name on line 1 column 2

This question was recently split into different questions for each workaround. See   meta posts for more information.   Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s}


I have a HashMap as follows:  public class MyHashMapOfEmployees {    public static void main(String a[]){     Map<String,Employee> allEmployees= new HashMap<String,Employee>();     allEmployees.put(new Employee("111",("Ram", "Smith", "developer"));     allEmployees.put(new Employee("222",("John", "Doe", "manager"));     allEmployees.put(new Employee("333",("Lisa", "Hart", "CEO"));     allEmployees.put(new Employee("444",("Mark", "Wayman", "VP"));   } }   Here is my Employee class:  class Employee{      private String firstName; private String lastName; private String position; private String id;  public Employee(String fn, String ln, String p){     this.firstName = fn;     this.lastName = ln;     this.position = p; }      public String getFirstName() {     return firstName; } public String getLastName() {     return lastName; } public String getPosition() {     return position; } public String getId() {     return id; }   }  I need to sort my HashMap by employees first name, and keys (id) can be omitted. Final output should be as follows:  John Doe manager Lisa Hart CEO Mark Wayman VP Ram Smith developer   I tried using the following comparator:  private final Comparator<Employee> employeeComparator = new Comparator<Employee>() {     @Override     public int compare(Employee o1, Employee o2) {         return o1.getFirstName().compareTo(o2.getFirstName());     } };   How can I sort this HashMap not by the value (which in my case is an object - Employee), but by a particular field in my object (firstName)?  Is TreeMap not the right solution?  I've searched through stackOverflow and there is nothing for this particular scenario that I could apply and get to work. THIS ISN'T A DUPLICATE, the link that is being offered in comments is a different task.  Can I do the following without creating a TreeMap in between?  SortedSet<Map.Entry<String, Employee>> employeesSortedByFirstName = new TreeSet<Map.Entry<String, Employee>>(employeeComparator());   employeesSortedByFirstName.addAll(allEmployees.entrySet());   Would this sort my map values by first name?... or by the order of insertion?..  OR - do I need a TreeMap in between as such:  SortedSet<Map.Entry<String, Employee>> employeesSortedByFirstName = new TreeSet<Map.Entry<String, Employee>>(employeeComparator());  SortedMap<String, Employee> sortedMap = new TreeMap<String, Employee>(); sortedMap.putAll(allEmployees); //hashmap into treemap employeesSortedByFirstName.addAll(sortedMap.entrySet()); //add treemap into the sorted set   THE GOAL IS TO SORT BY FIRST NAME, NOT BY THE WHOLE VALUE OF THE MAP.

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


I'm trying to deactivate this trigger but the test class is erroring and it wont let me deploy. Its showing this error:     System.AssertException: Assertion Failed: Expected:   0035E000008yLU5QAM, Actual: null      Class.TestDeduper.testDupes: line 19, column 1   The Trigger is:  // Populate a Contact Lookup field if there's a dupe! trigger DetectDupes on Lead (before insert, before update) {     for (Lead l : Trigger.new) {         if (l.Email != null) {             String leadEmail = l.Email;             List<Contact> dupeContacts = [SELECT Id FROM Contact WHERE Email = :l.Email];             if (dupeContacts.size() > 0) {                 l.Dupe_Contact__c = dupeContacts[0].Id;             } else {                 l.Dupe_Contact__c = null;             }         } else {             l.Dupe_Contact__c = null;         }       } }   The test case is:  static testMethod void testDupes() {     // Principle #1: Create records from scratch!     Contact dupeContact  = new Contact();     dupeContact.LastName = 'Spiderman';     dupeContact.Email    = 'spiderman@gmail.com';     insert dupeContact;                  Lead dupeLead = new Lead();     dupeLead.FirstName = 'Peter';     dupeLead.LastName  = 'Parker';     dupeLead.Company   = 'Daily Bugle';     dupeLead.Email     = 'spiderman@gmail.com';     insert dupeLead;      // Principle #2: Use System.assertEquals()     dupeLead = [SELECT Id, Dupe_Contact__c FROM Lead WHERE Email = :dupeLead.Email LIMIT 1];     System.assertEquals(dupeContact.Id, dupeLead.Dupe_Contact__c);      // Principle #3: Test things that shouldn't work!     Lead uniqueLead = new Lead();     uniqueLead.LastName = 'Xavier';     uniqueLead.Company  = 'X-Men';     uniqueLead.Email    = 'theprofessor@xmen.com';     insert uniqueLead;      uniqueLead = [SELECT Id, Dupe_Contact__c FROM Lead WHERE Email = :uniqueLead.Email LIMIT 1];     System.assertEquals(null, uniqueLead.Dupe_Contact__c); }

I have inherited an org with lots of outdated apex, and multiple changes to VRs, field requirements, field values, profile names, record type names etc. All of this was done without any insight into, or konwledge of, apex that had also been written many years ago.   Production code coverage is now hovering around 40%......   Most of the existing custom apex is now irrelevant (outdated processes that are no longer used) and I need to get coverage up so I can begin to push change sets and update the existing org.   Since my primary goal is to raise code coverage and then delete many of the existing classes, triggers, extensions, etc  my question is: Can I simply replace existing class code with simpler classes and test classes rather than dig through and update the existing code and configuration?  Again, the goal is to get rid of a lot of this code anyway so this seems like a quick and dirty solution to an otherwise overwhelming problem.   Any thoughts?


My question is about how a negated "all", "any", and "every" statements are usually and correctly understood in English. I have just realized an apparent parsing ambiguity in all such statements (i.e., two different possible readings). Consider the following examples, each containing not and then all/any/every:   "The giraffe was not standing on all/any/every one of its legs." "The talk was not understood by all/any/every member(s) of the audience." We do not live far from all/any/every one of the best museums in the city.   The ambiguity is, in each case: (1) is either "The giraffe was standing on none of its legs" or "The giraffe was standing on less than 4 legs"; (2) is either "The talk was was lost on everyone" or "The talk was lost on at least one person"; (3) is either "We live close to every museum" or "We live close to at least one museum."  But the word choice all/any/every seems to give some indication:   Using all seems to imply less than 4 legs. Using any seems to imply 0 legs. Using every one could go either way for me. Using all seems to imply at least one person was lost. Using any seems to apply everyone was lost. Using every could go either way. This one breaks the pattern. Using all, any, or every one all seem to imply being close to every museum.   So my question: What general rules can be used to determine which of the two interpretations is valid? What are the patterns involving all, any, and every? What are the patterns based on the placement of not within the sentence?  Bonus: Is there any data on the usage and interpretation in English of negation before an all/any/every statement?    Postscript  P.S. It may clear things up to consider the logical parsings of the statement. The two interpretations of (1) are (roughly)  (The giraffe) (was not) (standing on all of its legs)   and  (The giraffe) was (not standing) (on all of its legs).   Although it is confusing to wrap one's mind around the two readings, they both seem equally valid to me and the logical form makes it clear they are distinct (I hope I have also communicated that to some degree in the examples above).  Postpostscript  I originally noticed this based on an excerpt from a  defining unattended vehicles:     Motor Vehicle...That is left unattended on or along a highway or other public property for more   than forty-eight (48) hours and does not bear all of the following:      a. Valid registration plate.      b. A current certificate of inspection.      c. An ascertainable vehicle identification number.   So I asked . Amusingly, the answer they gave contains exactly the same not...all ambiguity as in my original excerpt. So I decided to take it here, with more simple and clear examples.

I keep hearing people say everything is not… which frustrating because it is ambiguous. It could mean either     Nothing is… (for the set of all things, no thing is…)   or      Not everything is… (for the set of all things, some things are not…/not all things are…)   I have been hearing it more and more in the past few years. In fact, when you , you get Selena Gomez’s rendition of the Wizards of Waverly Place theme song which only further popularizes it with the youth.  Is this phrase grammatically correct/legitimate (ie, would an English teacher complain?), and if so, which is the correct meaning (if any)?


Could someone please explain to me , with a simple example?  Edit: I realize I might be asking for a lot, instead in the edited question: what are: Completeness, soundness and provability?  I went through the wikipedia page on it, but its a little dense for me right now.Also, are there any assumptions associated with the completeness theorem?

I have to do a number of similar type questions, but I am having trouble grasping the general concepts around soundness and completeness. I have read up on the general definitions and think I understand them, but when asked to show something like the following I come up blank. Thanks for any ideas/help.   Show that the following propositional proof system, PCa, is sound but not complete.  PCa  Connectives (and constants) ∨, ∧, →, ↔, ¬, 0, 1  Axioms All tautologies of the form F→F  Rules of inference Hypothetical Syllogism


I wanted some feedback on Windows 10 upgrades (basically, whether a free upgrade from 7 to 10 is desirable), so I went to superuser.stackexchange.com, which doesn't exist... so I went to what I should have typed in the first place, superuser.com.  For sites that have a URL of /[-\w]+.com/, would it be possible to redirect all foo.stackexchange.com sites to foo.com?

I have a Chrome search engine of the form http://%s.stackexchange.com/ that I use to quickly move between various SE sites (I find this more efficient than bumbling my way through the multicollider).  It would be nice if we could get aliases (like e.g. http://so.stackexchange.com/ or http://stackoverflow.stackexchange.com/ as a redirect to ) for all the sites that have their own domain names. I believe that's just the Trilogy (SO, pt/ja/ru.SO, SU, SF) and Stack Apps (plus corresponding metas where they exist, plus Meta MathOverflow).  Note that Ubuntu already has  redirecting to .  EDIT: Either I forgot to check MathOverflow when I originally posted this, or it's been added since then -  redirects to  now. However,  does not go anywhere.


In The Philosopher's Stone,      Hagrid helped Harry on to the train that would take him back to the   Dursleys, then handed him an envelope.   "Yer ticket fer Hogwarts, " he said. "First o' September -- King's Cross   -- it's all on yer ticket. Any problems with the Dursleys, send me a   letter with yer owl, she'll know where to find me.... See yeh soon,   Harry."      The train pulled out of the station. Harry wanted to watch Hagrid until   he was out of sight; he rose in his seat and pressed his nose against   the window, but he blinked and Hagrid had gone.   Having a wand is necessary to apparate, and, as we later see that Hagrid keeps the fragments of his broken wand in his umbrella, and Hagrid has his umbrella with him throughout this chapter, did Hagrid Disapparate?

In the film Harry Potter and the Sorcerer's Stone, Hagrid mentions he needs to leave in a hurry and hands Harry the train ticket. Harry asks Hagrid about the ticket as he squints at it in confusion, but gets no response. Harry then turns to see that Hagrid is nowhere to be seen, even though he was there just a second ago. He has somehow vanished into thin air.  What actually happened here?    Hagrid was there seconds ago. They were standing in the middle a bridge-like walkway in the train station so there are only 2 ways to go; forward or back the way they came, yet there's no sign of Hagrid walking away in the distance. Hagrid, though strong, doesn't strike me as being a cheetah-like sprinter, and I don't think he's related to The Flash. Did he apparate? Did he fly away on a broom?   The question  seems to indicate that itls illegal for Hagrid to apparate, as his wand was broken upon expulsion. Did he apparate then, using the umbrella-wand thingy? What is the in-universe, movie version explanation for how Hagrid seemingly vanished into thin air?


I would like to search for which package provides an uninstalled command.   apt-cache search keyword   is good, but the search keyword can be all or part of a package name or any words used in its description, not necessary the name of a program/command.  Is there a better way?  For example, I can't tell which package contains the program xlock:  $ apt-cache search xlock away - Terminal locking program devrplay3 - rplay network audio system - basic library librplay-perl - rplay network audio system - perl modules librplay3 - rplay network audio system - shared libraries librplay3-dev - rplay network audio system - development libraries rplay-client - rplay network audio system - basic clients rplay-contrib - rplay network audio system - contributed binaries rplay-server - rplay network audio system - server xautolock - Program launcher for idle X sessions   Thanks.

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?


While doing some calculations, I got this interesting result. Consider the CDF of the log-normal:  $$ y(x) = \dfrac{1}{2}\left[1+erf\left(\dfrac{\ln\left(x\right)-\mu}{\sigma\sqrt{2}}\right)\right] $$  It's inverse is:  $$ x(y) = exp\left[\mu_{} + \sigma_{}\sqrt{2}{erf}^{-1}\left(2y-1\right) \right] $$  If you take the integral of this function over the domain of $y$, $[0,1]$, you get:  $$ \int_0^1 x(y)dy = exp\left(\mu + \frac{\sigma^2}{2}\right) $$  which is the mean of the log-normal!  I have not been able to formalise the proof. Does this property/theorem (if) have a name? Does it hold in general? Or is it a mere coincidence?

I was wondering where there is a general formula to relate the expected value of a continuous random variable as a function of the quantiles of the same r.v. The expected value of r.v. $X$ is defined as: $E(X) = \int x dF_X(x) $ and quantiles are defined as :  $Q^p_X = \{x : F_X(x) = p \} =F_X^{-1}(p) $ for $p\in(0,1)$.  Is there for instance a function function $G$ such that:  $E(X) = \int_{p\in(0,1)} G(Q^p_X) dp $


Sometimes when I log on to a system via SSH (for example to the production server), I have such privileges that there can install some software, but to do that I need to know the system with which I am dealing.  I would be able to check how the system is installed there.  Is there a way from the CLI to determine what distribution of Unix/Linux is running?

I have always found it difficult to find information about the system itself in Unix, whether it be   Which OS I am using (version number and all, to compare it with the latest available builds)? Which Desktop Environment am I using? If I am using KDE, most of the programs begin with a K and I can say I am using KDE, but there should be some way to query this, say from a script. Which kernel version am I using? (For example, I am using Fedora, and I want to know what Linux kernel version I am using)   Basically, what I miss is a single point/utility that can get all this information for me. Most of the times the solutions to the above would themselves be OS specific. Then, you are stuck.


While entering random numbers in an array, my goal is to have a random number in element [x] different from the previous one [x-1] that's the only constraint.  I believe to be achieving this but my problem is that when I run the following code my output does not display all elements.           int[] array = new int[10];         Random number = new Random();          for(int i = 0; i < array.Length; i++)         {             int randomNumber = number.Next(3) + 1;             if (i == 0)             {                 array[0] = randomNumber;                 }             else             {                 array[i] = randomNumber;                  while (array[i] == array[i - 1])                 {                     array[i] = randomNumber;                 }             }              Console.Write(array[i] + " ");         }         Console.ReadLine();

I'd like to generate unique random numbers between 0 and 1000 that never repeat (i.e. 6 doesn't show up twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?


Picard is pursued by the Borg while they take over the Enterprise-E. He starts a chapter of some crime-drama holo-novel on the holodeck. The crime boss and his henchmen carry tommy guns, which Picard steals to shoot at the Borg drones. He also turns off the safety protocols on the holodeck so that the bullets are real.                                  We see that bullets can kill Borg drones.  We know from ST:TNG episodes that physical objects can be removed from the holodeck. (Water in the pilot episode, Encounter at Far Point, and a piece of paper in the episode, Elementary, Dear Data.)  This means Picard should be able to take the tommy guns out of the holodeck to kill the Borg.  Not just that, but he should be able to tell the holodeck to create "guns, lots of guns".                                  Could Picard have brought the tommy guns out of the holodeck?  Edit to add from comment: Even if Picard can't bring a working tommy gun out of the holodeck, he could still ask the replicators to make tommy guns. That's a good point by Rebel-Scum and still fits within the overall question. Why not use projectile weapons against the Borg?  Could the Borg have adapted quickly to projectile weapons to make that tactic useless?

In "First Contact" Picard kills a couple of Borg drones in the Holodeck with a holographic Tommy gun.  It would appear that while the Borg are able to adapt to become impervious to energy weapons, they are vulnerable to bullets.  This looks like a gaping logical hole: why couldn't Star Fleet replicate "primitive" assault rifles to fight the Borg, if they knew that phasers were useless against them?  Has this ever been addressed?


Let's say I store some really important stuff in C:\User\Rahul\Desktop\IMP.  Is it possible to make windows automatically mirror the contents of that folder to C:\Users\Rahul\OneDrive\IMP constantly or at the end of every hour/week/minute?

I want to synchronise two folders in real time under Windows 7.  Basically, I want to monitor a folder and synchronise each change (new files, changed files, deleted files) to another drive. It has to be in real time, so it gets synchronised instantly when a change happens. A one-direction synchronisation is enough.  I tried Microsoft's , but it does only syncing by hand or scheduled (thus not satisfying the "real-time" requirement).  Can this be achieved with Windows 7 itself? If not, are there other methods of doing this?


I have this code in an Android activity;  public static TwoWeeksActivity context; public static DBHelper dbHelper;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_two_weeks);      RadCartesianChartView chartView = new RadCartesianChartView(this);      ViewGroup rootView = (ViewGroup)findViewById(R.id.container);     rootView.addView(chartView);      ArrayList<DateCountChart> vvv=new ArrayList<DateCountChart>();      vvv=dbHelper.getCigCountTwoWeeks();   When I execute the app, when it arrives at tthis last line it returns java null pointer exception.  Why vvv is null? I have instantiated it:  ArrayList<DateCountChart> vvv=new ArrayList<DateCountChart>();   Please note that   dbHelper.getCigCountTwoWeeks();   function in in dbhelper returns       ArrayList of DateCountChart object  Any help appreciated.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I am searching for a good tool for graphs and charts and found . Am I able to include a code written in GLE within a latex document? The aim is not including it as a file in the document but as a script within the latex script, is it possible?  Thank you

I work a lot with MATLAB, and I want to enable the reader of my paper to easily reproduce my computations. I also want the pdf document to be self-contained, i.e., no hyperlinks to a webpage on which the code is available. Is there a good way to accomplish this in LaTeX?  Unfortunately, I find that authors frequently print their computer code in the paper, and the code might be broken over multiple pages, thereby making copy-and-paste a tedious task.  I envision two alternatives:   In the pdf, there is a link that when clicked, prompts the user to save an m file in a directory of his choosing. I do not want the m file to reside in a local network drive (as in ), but rather, I want the m file code to somehow reside under the hood of the pdf (much like how the pdf includes graphics, say). In the pdf, there is a text box with a scroll bar which contains my MATLAB code. If interested, the reader can easily copy and paste as desired.   I would be very happy to learn how to implement either of these (or other alternatives) in LaTeX. Thanks for the help!


I know that $\gcd(a,b)$ divides $a$ and $b$, and must also then divide $(a)(t)$ ($t$ being some integer).  This makes sense to me, but how do I prove it?  It seems that the addition of $(a)(t)$ is a continuation of the linear combination of $\gcd(a,b) = av + bu$ for some $v$, $u$ being elements of $\mathbb{Z}$.    Any help?

Given: $a = qb + r$. Then it holds that $\gcd(a,b)=\gcd(b,r)$. That doesn't sound logical to me. Why is this so?    Addendum by LePressentiment on 11/29/2013: (in the interest of  and averting a duplicate)  What's the intuition behind this result? I only recognise the proof and examples solely due to algebraic properties and formal definitions; I'd like to apprehend the result naturally.


guys, Please, can you clarify something for me?  As i understand (please correct me if i am wrong), when i pass the variables to a method or class i'm passing by value, isn't it?  if it's true, then why does Java has method .clone()?  Why do i ask this question, because i am very confused...here is the code: if i pass variables using the following code and then modify them inside the dialog, the original values (outside) are also changed.  DialogChoosePayment mDialogChoosePayment = new DialogChoosePayment(mContext,  (ArrayList<Payment>) defaultValues.getPayment(), (ArrayList<Payment>) selectedValues);                 mDialogChoosePayment.show();   But, if i use the following one, then the variables values (Original variables from outside) are not changed.  DialogChoosePayment mDialogChoosePayment = new DialogChoosePayment(mContext,  (ArrayList<Payment>) defaultValues.getPayment().clone(), (ArrayList<Payment>) selectedValues.clone());                     mDialogChoosePayment.show();   Please, explain it to a newbie =)

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Can someone explain the process by where a star collapses and bounces back.  I haven't been able to find a good explanation of the bounce. Edit here, I was wondering specifically where the energy of the bounce comes from.  It seems like the mass must decrease in proportion, or the energy must have beens stored some other way. I guess the mechanism is not completely understood, or I would ask that question.

This is really bugging me. When you look up some educational text about stars life, this is what you find out:   Gravity creates the temperature and pressure to start fusion reactions. The fusion proceeds to heavier and heavier cores ending with iron, which remains in the centre of the star. One moment, all light cores are depleted and the gravity wins over the power of the fusion reactions, now absent. The core of the star collapses into high density object, which may vary depending on the star mass. And the top layers of the star explode.   And I just cannot find clear explanation why. According to what I imagine, the top layers of the star should just fall into the collapsing core.  Is that because of the 3rd Newtons rule?  Or do the stars have some need to end with a cool boom?


I would like to encrypt an external USB Hard Drive in manner that allows full access (read+write) from Ubuntu trusty, Windows 8 and optionally Android and older Windows versions. With TrueCrypt development (as suggested by as an answer to this Question:  ) being in an uncertain state (  ), what alternatives are there which are still in deveopment

I would like to encrypt my hard drive so that it requires a password to access it. However features like BitLocker in Windows will only work under Windows, and cannot be accessed from another OS such as  Ubuntu or Mac OS X.  How can I create a cross-platform encrypted file system?


We suppose that I put my signature on a piece of white paper with my first and last name on it. After I execute a scan of this signature in .pdf, or .png or .tiff, etc. (as file image). What are the steps of a specific software to select only the signature, make the background transparent so that I can move it in a word document using only free tools on line without sign in or registration?

I need to upload my signature in a PDF document, but I do not know how to edit the background of this image.   I wish to remove the bluish-tint background, and make it pure white.   Can anyone help me with this, please?


import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; import java.util.Arrays;  public class Main {  private static double getRGB(int i, int j, Mat matrix) { //this method is used to obtain pixel values of an image     double rgbVal;      double[] pixel = matrix.get(i, j);     rgbVal = pixel[0] + pixel[1] + pixel[2]; //error on this line      rgbVal = rgbVal / 3;     return rgbVal; }  public static void main(String[] args) {     System.loadLibrary(Core.NATIVE_LIBRARY_NAME);     Imgcodecs imageCodecs = new Imgcodecs();     Mat matrix = imageCodecs.imread("/Users/brand/Downloads/SPACE.JPG");     System.out.println("Image loaded");     System.out.println("Image size : " + matrix.width() + " x " + matrix.height());     double[][] rgb = new double[matrix.width()][matrix.height()]; //this is where i want to store the values      for (int i = 0 ; i < matrix.width(); i++) {         for (int j = 0; j < matrix.height(); j++) {             rgb[i][j] = getRGB(i, j, matrix); //iterating through my Mat object and storing here         }     }     System.out.println(Arrays.deepToString(rgb)); //checking if it works } }  I am throwing a null pointer exception on line 11 for : Exception in thread "main" java.lang.NullPointerException: Cannot load from double array because "pixel" is null. I have tried adding the code: System.out.println(Arrays.deepToString(pixel)); After doing this I can see that my program is actually working as intended for the first several hungred pixel values, but for some reason it keeps stopping on the same value, and then reading null before throwing the exception. Any advice would be appreciated.


The Android App does not show any deleted answers at all, even on sites where I am a moderator. I just got a notification about a new meta post, the post is about a deleted answer, but when I follow the link to the answer the app pretends that there are no answers at all on that question.

At the left (site), it says 3 Answers (1 Accepted Answer + 2 self-deleted-answer). At the right (app), it says only 1 Answer; self-deleted answers are not visible.


I've been hearing a lot of complaints about this in relation to the Thanks Obamacare campaign in Colorado, but trying to look for information on "Do you got xxx" I don't find too much to actually show that it's right or wrong, no matter how it looks.

Watching , I noticed that Melanie Griffith twice asked    I recognise this as an American construction which sounds strange to me — Brits invariably say either "What have you got?" or "What do you have?". But I'd be interested to know if it's considered "normal" by most/all Americans, or if it's regionally or otherwise restricted.


I use putty to login to the server via ssh. This creates a session locally; meaning if I disconnect from putty, the session is lost.  Is there any way that the session can keep running and be accessible from putty or any other client ? Or is there any other protocol or tool which can help out in this?

I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and later, after dinner, I want to check on the process that I started before leaving work. How can I do that with SSH? My understanding is that if you break your SSH connection you will also break your login session on the server, therefore killing the long running process.


If you take a rectangle and divide it into four equal pieces with two perpendicular lines, you have created quadrants:    But what if you divide the rectangle into nine equal pieces with two sets of two mutually parallel lines like this:    Is there a name for these pieces? An example sentence would be:     The dart has struck the middle ______.   If there are six pieces they can be called sextants, and if there are eight pieces they can be called octants, but the word "nonant" doesn't seem to exist, at least not with this meaning.  edit: I'm specifically looking for a mathematical term to refer to the area that the rectangle is divided into, so a word analogous to "quarter" but referring to nine pieces doesn't answer my question. (See .)

Something is divided in four pieces. One piece is called a fourth or a quarter.  Something is divided in nine pieces. One is piece is called a ninth or a... What is the 'quarter' equivalent for something divided by nine?


Suddenly I have found that usable RAM is showing less ( 3.19 GB ) than installed ( 8GB ) .. I have checked all videos related to this problem on YouTube.. I have checked with  Resetting BIOS ( Soft Brick and Hard Brick ) Check and Uncheck maximum memory in msconfig. Changed Memory Slots(4) Load with live linux on a pendrive and found same  But, still not getting any solution.. This happens in both Ubuntu and Windows. This problem may be happening from when I installed Ubuntu in Virtual Box and after some use I directly uninstalled virtual box.. I am in need of solution.. Please Help Me.. Thanking you in advance..

I have recently upgraded a Windows 7 Home Premium PC with 12 GB of RAM. For some reason once I looked in the System tab it said only 7.96 GB of 12 GB of RAM is usable. I have already tried to go into the msconfig to see if the Maximum Memory was ticked, which it wasn't.  Is there a solution to this error? The other topics that I have viewed on Super User did not help me at all.  Installed RAM:   msconfig:   My Windows Edition is showing "Home Premium":   Resource Monitor:


I have recently obtained a MSc in Molecular Biology with research on viral gene expression. It has been a long interest of mine to work on stem cell biology and neuroscience and I am wondering if it would be possible to pursue a PhD on the field. Or is it too ''late'' for me and should only look into virology?   Thanks

I am a Physics undergrad who is interested in pursuing a PhD in pure maths in the future (algebraic geometry/topology) but I am a bit unsure. My question is quite general, and I don't wish to provide more background for fear of bias in the answers.  My question: Is it is advisable/possible/unfavorable/favorable to apply for a PhD in a field, different from that in which you have done most of your undergraduate research?  My research (includes just reading and understanding papers, writing summaries until now, I havent published anything) mostly includes Quantum field theory, and gauge theory. Would the selection committee turn down an application to a pure maths field, if I have no research experience whatsoever?  I would also like to ask the question other way round. What if I concentrate my undergraduate research SOLELY on topics in pure maths such as algebraic geometry/topology and take other physics courses, would I be able to apply to a string theory PhD with a high chance of success?  Should I consider spending time on both of these (which is almost an impossible task), to improve my chances in both the areas or would research in one area, and grad level courses in the other suffice?  In brief: Should the PhD field you are applying to be the same as your undergraduate research area?


A guy is in an outdoors penal colony or prison of sorts, and I think the prisoners are being forced to work, perhaps mining. There is a rebel group that tries to escape/free others and in the process the guy almost gets pulled in to a giant spinning fan or something in the ground (I'm not sure if he was wearing a prisoner chain that was pulled into the fan to try and kill him or if he was holding onto a chain that stopped him falling in to the fan/slicing thing).  It’s in colour, not sure if for TV or cinema, and probably released somewhere between 2000 - 2017. I think it’s a sci-fi and not horror.

All I remember is the guy was sent to a planet to test something or he did something illegal, and time moved really fast on the planet but slow to the outside world. He had to fix something to leave the planet I think. His dad was also dying and he checked how many days he had left every day, but in the end his dad didn't actually die as time was fast. It took place on a sandy planet.


My first application was refused in October 2018 and I have resolved all the reasons as per the refusal letter during the second.   I applied again for a UK visit visa in Feb 2019 with all necessary documents and got the refusal letter as below.   I provided six months worth of bank statements which include two months of salary from my old employer for August'18 and September'18 and four months salary from October'18 to January'19.   Expenses as per the application form is only the living cost per month. I paid for my car 3,100 GBP and 6 months house rent 3,200 GBP in advance resulting in a low opening balance. These payments were not included in the application as one is an asset purchase. Monthly rent is included in expenses.  When do you suggest for me to apply again? What points to improve again on the same?

Over the course of time here on TSE, I have observed individuals whose pattern of visa applications is best described as ''...     serial refusals - Two or more consecutive visa refusals issued by the same regime to the same person. Commonly for the same, or nearly the same, reasons. In some visa regimes Serial refusals can have a cumulative effect wherein the applicant's credibility is increasingly eroded, especially when the application pattern suggests a secondary agenda.   A common thread appears to be the need to visit the destination country (especially Schengen, the USA, or the UK) with a special sense of urgency. Also common in these cases are the following types of questions...   Should I just reapply once again? What are my chances? What can I do to improve my odds in the future? Can I somehow address the previous refusals to avoid them being a burden on all future applications? How can I break the pattern?      NB: This question is intended as a canonical about serial refusals. I have never been personally denied a visa.


I bought the windows 10 edition of Minecraft and I want to know if I can link that account to Mojang because when I tried using the account I had for the Windows 10 edition they wanted me to buy it again

If I purchase Minecraft Windows 10 edition, do I get a Minecraft/Mojang account? In other words, can I then play the older desktop edition as well?  (I know that the Windows 10 Minecraft is similar to Pocket Edition Minecraft. Advantages of the desktop edition include the ability to "mod", and the ability to load/save and share worlds.  I would like to have those capabilities on Windows 10.).


How to make my Ubuntu 18.04 LTS desktop look like this?

Just upgraded from Ubuntu 17.04 to Ubuntu 17.10.  Please help me to shift the side bar (aka Ubuntu Dock) to bottom.   I tried running the following command which used to work with older Ubuntu releases   gsettings set com.canonical.Unity.Launcher launcher-position Bottom   but it's not working.


I am confused with preposition. I have experiences in the field of children and young people or I have experiences on the field of children and young people? which is correct?

As it is common with people from my country, I have an immense difficulty with prepositions in English, especially with the use of in and on.   When the preposition indicates the position of the object it is a bit easier to decide which one to use, but as it requires thinking from me, I still say things like "I put the bill in the fridge", "my pencil is on my bag", etc, even though if I think about it, I would know how to say it correctly.  Of course, even in those cases where the preposition indicates position the decision is not always clear, as is the case for example with "on the bus" (you are not on top of the bus, you are inside the bus) or "he is in bed" (you are not inside the bed, you are on top of your bed).  Other cases are even less clear, and I believe there is no real rule to decide what should be said; the person should just know it. Two examples are "in a bad mood", "you are on my mind".  So my first question is whether there is really no rule to help me. The second question refers to two of the cases where I still don't know whether to use in or on:   good luck on/in your exam in/on the list   The last one is especially important to me, as I have asked a number of native speakers, and each time I get a different answer. The only consensus seems to be the case where you say "on top of the list". Apart from that, some people will say that I should say "his name is in the list" whereas others think I should say "his name is on the list". And yeah, a couple of people did tell me that I can use either.  Can someone help me?


I have the following dictionary: employees = [      {'Name': 'Alan Turing', 'age': 25, 'salary': 10000},      {'Name': 'Sharon Lin', 'age': 30, 'salary': 8000},      {'Name': 'John Hopkins', 'age': 18, 'salary': 1000},      {'Name': 'Mikhail Tal', 'age': 40, 'salary': 15000},  ]  I now want to sort this dictionary with the key 'age' using Lambda. You can find below how I tried to figure this out: print(list(map(employees.sort(key = lambda x: x.get('age')), employees)))  I get the following error: Traceback (most recent call last):    File "<string>", line 10, in <module>  TypeError: 'NoneType' object is not callable  How should I configure the lambda to get the correct output? Thank you!

I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the list: [{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]  When sorted by name, it should become: [{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}]


I'm having trouble finding a generic code that work, here, for both CentOS 5/6 and CentOS 7 versions pc the /proc/meminfo file. I Want to compute the "Real Used memory" like free does.  (amounts divided by 1024 for easier mental calculus)  CentOS 6 :  [root@web2-1 ~]# cat /proc/meminfo | gawk '{ $2=int($2/1024) ; print $0}' && free -m MemTotal: 3038 kB MemFree: 2580 kB Buffers: 34 kB Cached: 350 kB SwapCached: 0 kB Active: 216 kB Inactive: 189 kB Active(anon): 21 kB Inactive(anon): 1 kB Active(file): 195 kB Inactive(file): 188 kB Unevictable: 0 kB Mlocked: 0 kB HighTotal: 2185 kB HighFree: 1807 kB LowTotal: 852 kB LowFree: 772 kB SwapTotal: 4095 kB SwapFree: 4095 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 21 kB Mapped: 12 kB Shmem: 1 kB Slab: 30 kB SReclaimable: 22 kB SUnreclaim: 8 kB KernelStack: 1 kB PageTables: 1 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 5615 kB Committed_AS: 145 kB VmallocTotal: 120 kB VmallocUsed: 6 kB VmallocChunk: 99 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2 kB DirectMap4k: 9 kB DirectMap2M: 876 kB              total       used       free     shared    buffers     cached Mem:          3038        458       2580          1         34        350 -/+ buffers/cache:         72       2966  Swap:         4095          0       4095    Desired output : 73 which is MemTotal - MemFree - Buffers - Cached  CentOS 7 :  [maxime@g7r0x64-pkgbuild-mock-dev libexec]$ cat /proc/meminfo | gawk '{ $2=int($2/1024) ; print $0}' && free -m MemTotal: 993 kB MemFree: 89 kB MemAvailable: 710 kB Buffers: 0 kB Cached: 681 kB SwapCached: 5 kB Active: 341 kB Inactive: 361 kB Active(anon): 4 kB Inactive(anon): 23 kB Active(file): 336 kB Inactive(file): 337 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 4095 kB SwapFree: 4072 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 16 kB Mapped: 11 kB Shmem: 7 kB Slab: 134 kB SReclaimable: 111 kB SUnreclaim: 23 kB KernelStack: 2 kB PageTables: 3 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 4592 kB Committed_AS: 174 kB VmallocTotal: 33554431 kB VmallocUsed: 145 kB VmallocChunk: 33554275 kB HardwareCorrupted: 0 kB AnonHugePages: 2 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2 kB DirectMap4k: 39 kB DirectMap2M: 984 kB               total        used        free      shared  buff/cache   available Mem:            993          87          89           7         816         710 Swap:          4095          23        4072   Problem is, free gives me 816 MB for buffer + cache at the same time. Where are the missing 130 MB~?  I know I could do MemTotal - MemAvailable to get my real used, but MemAvailable doesn't exist on the previous version, and I would like my code to work with both versions of the meminfo file...  EDIT : by "portable" I mean I'd like the code to work for both 2.6 and 3.10 kernels (which means versions 5-7 of CentOS/RHEL), but I think I'll just have to make a big "if" in my code...

The standard files/tools that report memory seem to have different formats on different Linux distributions. For example, on Arch and Ubuntu.   Arch  $ free               total        used        free      shared  buff/cache   available Mem:        8169312     3870392     2648348       97884     1650572     4110336 Swap:      16777212      389588    16387624   $ head /proc/meminfo  MemTotal:        8169312 kB MemFree:         2625668 kB MemAvailable:    4088520 kB Buffers:          239688 kB Cached:          1224520 kB SwapCached:        17452 kB Active:          4074548 kB Inactive:        1035716 kB Active(anon):    3247948 kB Inactive(anon):   497684 kB  Ubuntu  $ free              total       used       free     shared    buffers     cached Mem:      80642828   69076080   11566748    3063796     150688   58358264 -/+ buffers/cache:   10567128   70075700 Swap:     20971516    5828472   15143044   $ head /proc/meminfo  MemTotal:       80642828 kB MemFree:        11565936 kB Buffers:          150688 kB Cached:         58358264 kB SwapCached:      2173912 kB Active:         27305364 kB Inactive:       40004480 kB Active(anon):    7584320 kB Inactive(anon):  4280400 kB Active(file):   19721044 kB    So, how can I portably (across Linux distros only) and reliably get the amount of memory—excluding swap—that is available for my software to use at a particular time? Presumably that's what's shown as "available" and "MemAvailable" in the output of free and cat /proc/meminfo in Arch but how do I get the same in Ubuntu or another distribution?


For years URLs nesting did matter. Structures like category/subcategory/article were useful to send signal to Google - these things are related.  Then some of big players overcome to flat structures, like    example.com/category1,  example.com/category2,  example.com/category1-article1,  example.com/category2-article2   In such flat structures the only signal of topical relation is an internal linking.  Q   How are your experiences at the moment?  Do you feel any boost of nesting? Specially in non-straight ecommerce environments (content projects and/or lead generation)   There are indeed some questions about the same topic - but they are seven respective four years old - my question is about your current experience (still matter)

I have a website with url like that :  www.xxxxxx.com/card/wow/20-euros   In term of SEO is it better to use slash or hyphen?  www.xxxxxx.com/card-wow-20-euros   Even though it will be trickier with hyphen to route correctly with only hyphen ...  Or it doesn't matter?


I want to know is it correct that "Lift" sometimes means to be "stop" as  claimed in 2016 about the usage of that word in "International sanctions lifted"? Google and almost everywhere that I have read ever, its meaning is "raise up, hoist, boost up, pick up, remove, etc. "

I want to say that an obligation that was present previously has been removed in a new approach. Can I say that in the new approach, the obligation has been lifted?


I am trying to send query to mysql to insert some values into a table , this is not the first time I do this stuff and this is what making me getting crazy ! when I am printing the query it looks like this :     INSERT INTO hc_family_receive_relief   (hc_family_id,hc_received_kind,hc_received_date,hc_received_month,hc_received_year)   VALUES ('89','��� ��������','30','5','2014')   This is the first time I face this issue , what is the reason of it ? I even try to save the PHP file as UTF-8 , UTF-8 with out BOM , Arabic characters still not inserted to the table ! .  the following is the function that I used to create the query dinamicly from $_POST array :  function add_family_recieve_relief($array) { if(empty($array))    return NULL; $i = 0; $titles = array(); $values = array(); $query = "INSERT INTO hc_family_receive_relief "; foreach($array as $key => $value) { if($i == 0) { $titles[count($titles)] = "($key,"; $values[count($values)] = "('".$value."',"; } if($i < count($array) - 1 && $i > 0) { $titles[count($titles)] = "$key,"; $values[count($values)] = "'".$value."',"; } if($i == count($array) - 1) { $titles[count($titles)] = $key.") VALUES "; $values[count($values)] = "'".$value."')"; } $i++; }  foreach($titles as $tvalue) $query .= $tvalue;  foreach($values as $vvalue) $query .= $vvalue; echo $query; $qresult = mysql_query($query);  if(!$qresult)     return False; else return True; }   and this is the page that recive $_POST and pass it to function add_family_recieve_relief:  <? require_once('../db.php'); require_once('familyReliefAPI.php'); if($_POST['addfamilyrelief']) {   if(empty($_POST['hc_family_id']) || !is_numeric($_POST['hc_family_id']))       die('
خطأ في المعالجة , الرقم المميز للعائلة غير موجود !
');          $family_id = $_POST['hc_family_id'];          array_pop($_POST);   $addfrr = add_family_recieve_relief($_POST);   if(!$addfrr)        die('
مشكلة في الاضافة , الرجاء التأكد من المعلومات أو الاتصال
');     else {          //print_r($_POST);          } } ?>   also I make SET NAMES utf-8 query in the connection page to fix the character issues , but still not work ..  please HELP ME .. thanks  NOTE :  The query is getting true and insert all the values in table except the arabic field it leaves it empty !

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


I was trying to put two plots of different functions in one graph, but the second one didn't show up in the graph. Does somebody see the mistake? Here is the code:  \documentclass{article}  \usepackage{pgfplots}% This uses tikz \pgfplotsset{compat=newest}% use newest version  \pgfmathdeclarefunction{FunctionA}{1}{%   \pgfmathparse{300 + 1000/x + 2.5*x}% }  \pgfmathdeclarefunction{FunctionB}{1}{%   \pgfmathparse{290 + 1000/x + 2.45*x}% }  \tikzset{My Line Style/.style={smooth, thick, samples=400}}  \begin{document} \begin{tikzpicture} \begin{axis}[     xmin=0, xmax=750,     ymin=300, ymax=600,     axis x line=bottom,     axis y line=left,      xlabel= $y$     ylabel=Cost,]     \addplot[My Line Style, color=black, domain=0:250] (\x,{FunctionA(\x)});     \addplot[My Line Style, color=black, domain=250:500] (\x,{FunctionB(\x)}); \end{axis} \end{tikzpicture} \end{document} \documentclass{article}

I tried to plot the following function but it didn't work:  y = 300 + 1000/x + 2.5x.  This is the document, but instead of the plot it only shows the axis.  \documentclass{article}  \usepackage{pgfplots}% This uses tikz \pgfplotsset{compat=newest}% use newest version  \pgfmathdeclarefunction{Function}{1}{%   \pgfmathparse{300 + 1000/x + 2.5}% }  \tikzset{My Line Style/.style={smooth, thick, samples=400}}  \begin{document} \begin{tikzpicture} \begin{axis}[     xmin=0.0,     xmax=250,     ymin=0,     ymax=50,     axis x line=bottom,     axis y line=left,      xlabel= $y$,     ylabel=Cost,      xtick={250},     xticklabels={250},         restrict x to domain=0:250,     ]        \addplot+[My Line Style, color=black, samples at={1,2,3,4,...,249,250}] (\x,{Function(\x)});   \end{axis}  \end{tikzpicture} \end{document} \documentclass{article}


I'm doing a little ajax question-result system. When user types something into the textarea, the result is automatically searched and outputted.   Problem is that every time user types the question that contains "" or '' - the search is unsuccessful. Is there any way I can add backslash to "" or '' inside the string, so it'd be ignored?  Or is there any filter that ignores the "" or ''?  I need the question to be searched with quotes, because questions in database contains them.  Here's the code:  $q = $_POST['q']; // for every " or ' in $q add \ before it $results = array(); $result = array(); $count = 0; $stmt = $dbh->prepare("SELECT result FROM quest WHERE quest LIKE '".$q."%'"); if($stmt->execute()){     $result = $stmt->fetchAll(PDO::FETCH_OBJ);     $count= $stmt->rowCount(); } if($result != NULL){     foreach($result as $part){         foreach($part as $item){             $results[] = $item;         }     }     echo htmlentities($results[0], ENT_QUOTES, "UTF-8"); }

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


I accidentally collided with this "proof" of the prime number theorem that is so painfully short and simple I can't even believe it, and it yields the right result, and there doesn't seem to be anything wrong with it, but I'm also pretty sure that if it worked it would have been published already, so there must be something wrong with it, I'd like someone to tell me where it fails:  Let $\phi (x)$ equal to the sum of the reciprocals of primes less than or equal to x $\phi (x) = \sum_{n=2}^x \dfrac{a_n}{n}$ where a_n is 1 when $n$ is a prime and $0$ otherwise Using Abel's summation method, choosing $b_n$ as $a_n$ and $f(t)$ as $\dfrac{1}{t}$ , $A(x)$ becomes $π(x)$ and we get $$\phi (x) = \frac{π(x)}{x} + \int_2^x {\frac{π(t)}{t^2}}dt$$ We also know that $\phi (x)$ is asymptotically equal to $\log(\log x)$ which is equivalent to saying that $\phi (x) = \log(\log x) + o(\log(\log x))$ and  this is equal to the expression given by Abel's method. $\frac{π(x)}{x}$ is $o(1)$, so when added to the other little $o$ you just have $o(\log(\log x))$  So we have $$\int_2^x {\dfrac{π(t)}{t^2}}dt = \log(\log x) + o\left(\log(\log x)\right)$$ So for this to be true, the integrant must be equal to $\dfrac{1}{t \log t} + o\left(\dfrac{1}{t \log t}\right)$ And this implies that $$π(t) = \dfrac{x}{\log x} + o\left(\dfrac{x}{\log x}\right)$$  which is the prime number theorem So what's failing here?

Mertens's second theorem states that $$\sum_{p \le x} \frac 1p = \log \log x+O(1).$$ Defining $p_x=p_{\lfloor x \rfloor}$ for all real $x \ge 1$, we can replace the sum by the integral $$\int_1^x \frac 1{p_t} \; dt=\log \log x+O(1)$$ and thus $\frac 1{p_x}$ is on the order of $\frac d{dx} \log \log x=\frac 1{x \log x}$, which simplifies to the prime number theorem. This is clearly not a valid proof, but why not? I suspect that it's in the step from the integral to the expression for $\frac 1{p_x}$, but I don't see why that isn't valid.


I am trying to figure out how to get to display two background-images in css so that the first background is a gradient image generated with css and then over that gradient to have some-image.png.   I tried adding someimage.png in another div above the div with gradient effect but I didn't find a way to add height to that div without messing up the page.  The idea is to have a gradient background and over that on the bottom of the page, an image that will have full page width, so I can not place it in the container div. I don't know if this is even possible :)  Any help would be highly appreciated!  This is the CSS code:  body { margin: 10px 40px; background: #fff; background-image: linear-gradient(to bottom right, #A33030 0%, rgba(182, 69, 69, 0.88) 100%); background-repeat: no-repeat; background-attachment: fixed; font-family: "Open Sans"; font-size: 17px; color: #FFFFFF; background-size: cover; } .overlay-image{ height:100%; background-image: some-image.png }   The HTML code:

 BlogAboutCoursesContact

Headline

Some text

Copyrigth

Is it possible to have two background images?  For instance, I'd like to have one image repeat across the top (repeat-x), and another repeat across the entire page (repeat), where the one across the entire page is behind the one which repeats across the top.  I've found that I can achieve the desired effect for two background images by setting the background of html and body:  html {     background: url(images/bg.png); }  body {     background: url(images/bgtop.png) repeat-x; }   Is this "good" CSS?  Is there a better method?  And what if I wanted three or more background images?


I have 4 files that I want to include them in a .zip file.  drwxr-xr-x  7 skemelio themelis 4,0K Οκτ  18 00:21 CSharp drwxr-xr-x 11 skemelio themelis 4,0K Οκτ  18 00:17 gnome-games drwxr-xr-x  8 skemelio themelis 4,0K Οκτ  18 00:17 gnome-music drwxr-xr-x  4 skemelio themelis 4,0K Οκτ  18 00:18 Test   As you can see in total their size is 16K.  After  I am creating the zip using the command bellow:  zip -r myfiles.zip *   The file was created successfully but now its size is 20M, as you can see bellow!   drwxr-xr-x  7 skemelio themelis 4,0K Οκτ  18 00:21 CSharp drwxr-xr-x 11 skemelio themelis 4,0K Οκτ  18 00:17 gnome-games drwxr-xr-x  8 skemelio themelis 4,0K Οκτ  18 00:17 gnome-music -rw-rw-r--  1 skemelio themelis  20M Απρ   4 02:00 myfiles.zip drwxr-xr-x  4 skemelio themelis 4,0K Οκτ  18 00:18 Test   What I've done wrong?  ps: Same thing (same size) happened when I try to create a .tar using tar cvf myfiles.tar *.

What does size of a directory mean in output of ls -l command?


I was wondering if the following sequence has a name:  Let $P$ be the set of prime numbers, and $p: \mathbb{N} \rightarrow P$ be the (increasing) enumerating function of the set.  Let's define $\alpha_1 = 2, \alpha_{n+1} = p(\alpha_n)$, i.e.,the $\alpha_n-$prime number.  Is there a name for this sequence? The first terms are $2,3,5,11,...$  I know they code one-branch-trees in  (in fact that's why I'm interested in them)

$127$ has an interesting property: It is the $31$st prime number and its rank ($31$) is also a prime. $31$ is the $11$th prime so its rank is also a prime. $11$ is also a prime number with a rank ($5$) that is also a prime. $5$ is the 3rd prime number and and so its rank ($3$) is also a prime. And finally $3$ is the $2$nd prime so its rank is also a prime... Is there a name for primes whose rank (index in the prime series) is also a prime? That is:     If $a_i$ is the $i$th prime number, then $i$ is a also a prime.   How about numbers like $127$ where going down ranks of ranks always produce prime numbers (down to rank $2$ of course)? The first $11$ :-) primes in this (infinite) series would be:  $3, 5, 11, 31, 127, 709, 5381, 52711, 648391, 9737333, 174440041, \dotsc$  Many thanks!


On a hp pavilion entertainment pc running windows vista have been unable to get it to boot from a usb drive.

I need my pre-installed version of Windows 7 (or any other version of Windows), how could I install Ubuntu without erasing it?


Given two elements $a,b$ in the Euclidean ring $R$ their least common miltiple $c\in R$ is an element in $R$ such that $a\mid c$ and $b\mid c$ and such that whenever $a\mid x$ and $b\mid x$ then $c\mid x$.   a) Prove that any two elements in the Euclidean ring $R$ have a least common multiple in $R$.  b) If the least common multiple of $a$ and $b$ is denoted by $[a,b]$, prove that $[a,b]=ab/(a,b).$   Proof:   (a) Consider the ideals $(a)$ and $(b)$, where $(x)=xR$. Their intersection $(a)\cap (b)$ is also ideal of $R$ since Euclidean ring is the ring of principle ideal then $(a)\cap (b)=(c)$ for some $c\in R$. I proved that this $c$ has all needed properties of least common multiple. Thus the LCM of $a$ and $b$ exists.  (b) We know that $\text{gcd}(a,b)$ exists in Euclidean ring for any $a,b\neq 0 \in R$. But I have no thoughts how to prove that $[a,b]=ab/(a,b)$.   So I would be very thankful answer.

Let $R$ be a UFD. Then for any two elements $a,b \in R \setminus \{0\}$ $ab \sim \gcd (a,b){\operatorname{lcm} (a,b)}$.   My attempt :  Let $d = \gcd (a,b)$.Then $d|a$ and $d|b$.Then $\exists x,y \in R$ such that $a = dx$ and $b = dy$.Now it is to be shown that $c = dxy$ is the lcm of $a,b$.Which I find difficulty to show.It is clear that $a|c$ and $b|c$. Now if $u$ is any common multiple of $a$ and $b$.Then $dx|u$ and also since $y|b$ we have $y|u$ i.e. $dxy|u^2$ $\implies c|u^2$.But I have to show $c|u$ to complete the proof which I fail to prove.Please help me to complete the proof.  Thank you in advance.


The area was damaged when a bottle of black mould killer tripped over. I hadn't realised till it was too late. Any recommendations on how to fix it without redoing the floors would be greatly appreciated.

There was some hand-disinfectant dropped on a lacquered wooden floor. Tried to remove as much as possible with a wet tissue but the stains shown in the picture remained... Anyone knows what could be used to remove these effectively?


Hello guys I hope you're all fine. This is the problem: When I execute the updater it always throws the same error saying: Failed to download repository information. Check your internet connection.  And when I run the sudo apt-get update I get these lines at the end:  W: Failed to fetch cdrom://Ubuntu 13.10 _Saucy Salamander_ - Release i386 (20131016.1)/dists/saucy/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 W: Failed to fetch cdrom://Ubuntu 13.10 _Saucy Salamander_ - Release i386 (20131016.1)/dists/saucy/restricted/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 W: Failed to fetch http://ppa.launchpad.net/tiheum/equinox/ubuntu/dists/saucy/main/source/Sources  404  Not Found W: Failed to fetch http://ppa.launchpad.net/tiheum/equinox/ubuntu/dists/saucy/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.

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


Unfortunately, in my Debian 8 jessie systemctl does not work at all.  Every systemctl command results in:  Failed to get D-Bus connection: Unknown error -1     systecmtl status udev           Failed to get D-Bus connection: Unknown error -1      How can I fix it?  I would be grateful for your help.

I am trying to setup a daemon width systemd on Debian.  systemd was already a part of the distro.. Have just added a new unit file my-daemon.service under /etc/systemd/system/ but after reboot I get this error no matter what I do. It worked before reboot  ~ # systemctl daemon-reload Failed to get D-Bus connection: Unknown error -1  ~ # systemctl list-units Failed to get D-Bus connection: Unknown error -1   Have also tried to delete the unit file my-daemon.service and rebooted the system.. But still get the same error  update  # dpkg -l | grep -i dbus ii  at-spi2-core                           2.14.0-1                             amd64        Assistive Technology Service Provider Interface (dbus core) ii  dbus                                   1.8.22-0+deb8u1                      amd64        simple interprocess messaging system (daemon and utilities) ii  dbus-x11                               1.8.20-0+deb8u1                      amd64        simple interprocess messaging system (X11 deps) ii  libdbus-1-3:amd64                      1.8.20-0+deb8u1                      amd64        simple interprocess messaging system (library) ii  libdbus-glib-1-2:amd64                 0.102-1                              amd64        simple interprocess messaging system (GLib-based shared library) ii  libdbusmenu-glib4:amd64                12.10.2-1                            amd64        library for passing menus over DBus ii  libdbusmenu-gtk4:amd64                 12.10.2-1                            amd64        library for passing menus over DBus - GTK+ version ii  libnet-dbus-perl                       1.0.0-2+b2                           amd64        Perl extension for the DBus bindings ii  libnih-dbus1                           1.0.3-4.3                            amd64        NIH D-Bus Bindings Library ii  libqt4-dbus:amd64                      4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus module ii  libqt5dbus5:amd64                      5.3.2+dfsg-4+deb8u1                  amd64        Qt 5 D-Bus module ii  libqtdbus4:amd64                       4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus module library ii  qdbus                                  4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus tool   update 2  # cd /run/dbus && ls -la total 4 drwxr-xr-x  2 messagebus messagebus  80 Feb  2 11:08 . drwxr-xr-x 21 root       root       740 Feb  6 19:33 .. -rw-r--r--  1 root       root         5 Feb  2 11:08 pid srwxrwxrwx  1 root       root         0 Feb  2 11:08 system_bus_socket   # cat /etc/fstab proc /proc proc defaults 0 0 /dev/md/0 none swap sw 0 0 /dev/md/1 /boot ext3 defaults 0 0 /dev/md/2 / ext4 defaults 0 0


I'm trying to create a dimension by extracting name prefixes like Mr, Ms, or Dr to do some audience profiling. I can't figure out the regex function to do it and I could use help with it. My data is structured like this: Sheikh, Mrs. Billie Kotecha, Ms. Ami Verma, Dr. Amit Steel, Mr. Murray   I need to extract the value between , & . and return it as the new dimension. This is what I'm trying: REGEXP_EXTRACT(guest_nm, '\,(.*?)\.') where the guest_nm is the column that holds my data. However, I'm getting an error message: Syntax error: Illegal escape sequence: \,. I'm not good enough with regex to understand what my syntax error is and how to fix it. Your help with this would be greatly appreciated!

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


If I have some predefined coordinate system — “my rest frame,” then I pick an “inertial frame” moving at some velocity with respect to my “rest frame.” Special relativity states that in the rest frame, the speed of an object can not exceed the speed of light — however I could pick any velocity for my inertial frame, say $99.9$% or even $200$% $c$, then say that my ship is traveling at $99.9$% $c$ in the inertial frame, and now I have a ship moving at $199.8$% or $299.9$% $c$ relative to the original rest frame?   Isn’t there some sort of self-contradiction here? Is the proposition that no object cannot exceed the speed of light simply a phenomenon resulting from observation assuming that time “runs” at the same rate for both observers, not from the motion of the actual object?

Let's say I fire a bus through space at (almost) the speed of light in vacuum. If I'm inside the bus (sitting on the back seat) and I run up the aisle of the bus toward the front, does that mean I'm traveling faster than the speed of light? (Relative to Earth that I just took off from.)


I just looked online to see if I could find a theory that I just had.  I was just watching TNG for the umpteenth time (thanks to Netflix), after watching DS9 through to the end first (as my personal favourite series).  Watching TNG Encounter at Farpoint, after they split the disc section away so that the warp section could turn around and face Q, Miles O'Brien is on the battle bridge, but isn't taken by Q. Although everyone else on the battle bridge is taken to the 21st century court, at no stage does Miles get taken or mentioned. It's almost like Q is actively avoiding Miles and leaving him out of his meddling with the humans.  The theory being - is it possible Q was aware of the Prophets and was told to stay away from Miles because of his involvement with the events that would unravel in the battle to come involving Sisko, the Prophets and the Pah-wraith?  It seems that although he boarded DS9 because of Vash, maybe he had heard of "The Sisko" and thought he would meddle whilst he was on board, we know how brash he is, and seeing how quickly he ultimately withdrew never to be seen again after fisticuffs with Sisko, seems odd knowing that he was happy to screw with the TNG crew for several years.  Anyway, I look forward to your thoughts and if there is anything I'm not aware of that can debunk this theory.

Does Q know about the prophets, since he was once on DS9 so close to the Bajoran worm hole?  Had he ever met them, or commented on them?


I came across new list implementation which called   I want to know when i should use over ArrayList or LinkedList.

I've always been one to simply use:  List<String> names = new ArrayList<>();   I use the interface as the type name for portability, so that when I ask questions such as these I can rework my code.    When should  be used over  and vice-versa?


I am trying to convert string to date using NSDateFormatter,but some how I am not able to do.  Here is my code:  var dateformatter = NSDateFormatter() // object of NSDataFormatter dateformatter.dateFormat = "dd-MM-YYYY"  //Format in which I want date println(dateformatter.dateFromString("2014-12-25 00:00:00"))

How do I convert, NSDate to NSString so that only the year in @"yyyy" format is output to the string?


Whenever I try to install (any) software using the terminal, the terminal is giving an output like:  E:Unable to locate package   Kindly help, as I am new to Ubuntu 12.04

I have installed Ubuntu 12.04 server , shows    E:unable to locate the package unzip   the above error is also shown, if I try to install packages also. Can any one help me out to get out from this error.


I am looking for a solution for Windows to be able to type the same commands in multiple terminals (SSH) at the same time. I am using ConEmu with Git bash, but any solution for Windows is of interest.

Hi I'm looking for a piece of software or some sort of technique that would enable me to do following in one terminal window:   Take as input a list of ssh-enabled machines with login, password and script path information, something like this:  login:pass@192.168.1.1/path/to/script/run.sh login:pass@192.168.1.2/path/to/script/run.sh Open ssh connections to these machines and run the specified scripts remotely. Output from all the scripts should be piped to my local window. When I send a signal like Ctrl-C, I want to kill the remote scripts and then the connection. A massive plus would be if my machine goes down, the remote scripts are killed also.   A plus would be if I could use this in Cygwin terminal since that's what I use, but I'm open to anything that would get this done.


Is it common/correct to say "thanks for having me" after an interviewer says to you "thank you for coming to this interview"?  Thanks :)  Update: I'm referring to a job interview. (Thanks for pointing that out)

Recently, I finished my phone job interview with the phrase "Thanks for having me". It was a reply to the other person's "Thank you for your time". So, does "thanks for having me" sound alright in this context?


Occasionally my computer(Lubuntu 16.04 64 Bit) gets stuck at shutdown. It shows the message nmi watchdog bug soft lockup - cpu#1 stuck for 22s and never finishes shutdown.This message comes after the message Reached target shutdown.. What causes this error? How do I resolve this?

I get this error message   NMI watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [plymouthd:305]    on the startup of my system (even with live-cd).  My PC is a dell inspiron 7559 with intel graphic and nvidia.  UPDATE - this issue also happens when attempting to install ubuntu 18.10 using LiveUSB


I have created the below script.  #!/bin/bash sudo echo "Hi, I'm root"   It is inside a file called script.sh  I have checked the permission to run as a program inside properties. When I double click, nothings happens. The only thing that happens is that the text editor opens. How can I see what is going wrong?

When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts?


I have git repos stored in different directories which have long paths /opt/too/long/path/to/type/every/time/git-repo and it's kind of difficult to remember plus to cd to the directory every time is a pain and tedious. (I know TAB helps but that gets tedious too.) So, my life would be much easier if I could store the pwd somewhere and later do something like cd thatgitrepo.

I would like to frequently switch between directories that are in totally unrelated paths, for example /Project/Warnest/docs/ and ~/Dropbox/Projects/ds/test/.  But I don't want to type cd /[full-path]/ all the time. Are there any shortcut commands to switch to previously worked directories?  One solution I could think of is to add environment variables to my bash .profile for the frequently used directories and cd to them using those variables.  But is there any other solution to this?


"I'm not use to this city life" OR "I'm not used to this city life" ?

Is use to incorrect because we use present tense if we talk present habit? What is the difference between the two sentences below?      I am used to GETTING up late in the morning.   I am used to GET up late in the morning.   Please help me to understand.


I've just done a fresh install of Ubuntu Gnome 13.10 and I'm trying to install Geary after adding the Yorba ppa. I'm getting the following returned every time with sudo apt-get install geary :  [sudo] password for tim:  Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies:  geary : Depends: libwebkitgtk-3.0-0 (< 2.1.0) but 2.2.1-2ubuntu1~ubuntu14.04.1~ppa0 is to be installed E: Unable to correct problems, you have held broken packages.   Can anyone help with this? I've tried many, many different things based on what I've read in different forums and nothing seems to be working.   Any help is appreciated. Thanks.

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


I have 100 Amp service. I can't determine the wire size but it appears to be 6/3 feeder's. My furnace is 14000 watts 240V at 60Amp.  I have a 980sq ft home with a electric dryer, a refrigerator 20 Amp, 2 20amp receptacles in the kitchen2bathrooms, 1 20amp outside receptacle, a electric flat top oven and range, a 30amp water heater, all the receptacles  and lights are 15amp,1 220v 30amp window a c. The furnace has 2 60amp breakers  installed on it and is controlled by a 40 amp 240 V breaker in my panel. I noticed the breaker gets quite warm but does not blow when furnace is on in Ohio. Are my wires good for this load The feeders are short by 10 feet of making it into the panel box, it had a 50Amp temporary cord the rest of the way The cord was 50amp with A 50amp receptacle in a metal box with no connectors and no conduit it burned up on one side of the cord  after a sewer back up last year it is burned up on one side and  very corroded. What would be the best way to repair the feeder's and get them into my main panel box directly? The feeder's run 30ft in conduit from the outside disconnect come up 3 feet out of the ground in no conduit they are are 3 single insulated wires under the mobile home. How would I connect 3 feeder wires to them  put it in a weatherproof box and run it 10feet into the main panel witch has a 100amp disconnect at the meter and main panel. No ground,  how should I add a ground rod and ground the system. Are the grounds and neutrals supposed to be bonded and mixed and bonded to the service panel. I am trying to get the mobile home park owner to repair this as I rent the lot. It was this way when I bought the home it started with a flood under my home last year Finally the cord shorted out, the cord is 6/4 but the green wire goes no where and is not connected in the receptacle box. The home is a 1978 single wide.I don't know when it was installed on this lot, I have been here 8 Years What would be the best way to proceed Am I right that the park owner should do the repairs as the whole park sewer backed up under my home  where do I as the Owner become responsible for electric hook up that was damaged Thank you for any advice

I  have 3 feeder wires coming up underground from the meter and main disconnect. They tie in to a 50amp receptacle box and a 6 AWG cord With 8Awg ground all in one. That cord goes into my electrical panel where the grounds and neutrals are mixed and bonded. As far as I know the green ground connects to the RV type receptacle box and goes nowhere except that it came with the cord. There is no ground at the meter or disconnect. The house has no grounding system, as I can not locate as much as a grounded water pipe. I can install 2 ground rods or maybe the ground wire to the water pipes was disconnected or cut. The 3 wire feeders leave the disconnect in conduit and I see no conduit coming out, just three wires. Perhaps the conduit is below the ground somewhere. It is a 30 foot run with 6AWG wire. What I need to know is: what Would be the best way to waterproof the connections and get them into my panel, not just replacing the RV type of box and 50 amp cord that lays on the ground with just loose wires running into it? That is why it was damaged in the first place  when the sewer backed up and corroded the receptacle and cord. It was fine for years, but what are my options? The disconnect is 100 Amp, as is my service panel. The home was installed in 1978. Can I just put conduit over the wires that come out of the ground and use a weather tight box. Should I replace the whole cord or just cut it and replace the plug end. Where should I install the grounds at. The meter disconnect or at my home. I think someone changed out the main panel as it is tag as being a sub panel with a main disconnect outside  not a service  entrance. I just checked the furnace it is 55amp minimum the water heater is 30Amp with a electric range and dryer and lights and receptacles also A 220a/c and 2 120A/C s in the summer time. I would not want to use a 50Amp power cord would i Would I be able to use the 100Amp service disconnect and 100amp panel  I believe the  service entry cables are6/2 4/0 with no ground in sight  no grounding rods nothing.  I rent the lot but own the home Would I or the landlord be responsible for the upgrade in lima,ohio. Should I upgrade to a 150amp panel with a 200amp disconnect outside how do I calculate the loads in the home to figure out what I need The flood and the over current has burned one side of the 50 Amp cord completely out I don't know what year the home was installed on this lot or if it was inspected as it is not even properly set up on it's foundation piers  it's just one mess after another. Thanks guys for your patience


I've tried the recovery mode still not working. Please help.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I traveled to Paris last year from London on my Indian passport with a Schengen Visa (From the French embassy). I am a UK resident with BRP. As my visit was via bus and the immigration officer was in a hurry to clear the bus, he didn't stamp my passport stating when I entered France.  Now when I made my last visit to Italy this summer, I was interrogated on arrival because I got an exit stamp from France, but no entry stamp. They were worried that I might have overstayed during my last visit, which is not the case.  Now I want to apply again to France to get another Schengen visa (mine expired last week). I am now worried that they might reject it for the same reason.  Shall I be worried? It's not my mistake, I didn't know then that I needed to get the passport stamped.  Edit: I stumbled upon this article,  It looks like french immigration officers do miss stamping quite often. Hope this wont be blocker, if someone can shed some light that would be useful

Last night I took a night train from Romania to Hungary. I shared a compartment with another American backpacker (and others.) The border crossing on the Romanian side was normal -- all of our passports were stamped and the border officer recorded our data in his notepad. On the Hungarian side, some sort of commotion broke out further down the train car while we were being processed. The officer who was scanning and stamping our passports left and never came back. As a result, the other American backpacker never had her passport scanned or stamped.  What sort of difficulties might she run into since her passport has not been recorded as entering the schengen zone, nor does she have an extra stamp? What might get options be now, from within Schengen, to get her entrance recorded?  (When I say "scanned", the officers had hand-held devices that read the passport biometrics and I assume, recorded some sort of data somewhere.)


I found many function generating prime numbers but all of them uses the knowledge of n-1 prime numbers that we already found or in a more inefficient way.  My question is not about existence of prime generating function but about the efficiency of such functions. Neglecting all other overheads, just the need to use all previously found primes making any algorithm to have $\Omega(n^2)$ running time.  Is there any efficient formula? If not, is there any argument supporting that you have to use all n-1 primes?

I've solved for it making a computer program, but was wondering there was a mathematical equation that you could use to solve for the nth prime?


No  wife, not  her  pregnancy but  the  son's  name  is   soma  lingam (some ×) Aalu  ledu, chulu  ledu kani  koduku  peru  matram  somalingam. (Telugu)  Some people  think  of the future  happening  without  any base  in the  present. This  idiom  is used  to  talk  about  such  people  in  a humorous context. _It  is  not  equal to  building   because  it  is  not  an  impossible  task  for  him to  marry  and  beget  a  son. He is  imagining  things  too  early. The  idiom  is  used  to  talk  about   a  person who  talks  about  something  well  in  advance  without  any  scope  for  such  a  talk. A  married  man may  talk  about   his/ her  son' s  being  christened but  it  is  a foolish  to  talk  about  the  name  of  a  son  well  before  his  marriage  without  having  a  wife. Is  there  such  a   phrase  or   an idiom  in  English?

I imagine there must be a term/idiom/phrase for polishing something too early...  For example:   Painting the walls of a room before completing other work which may accidentally damage them. Adding detail to a section of a drawing that you may likely need to radically change later (and lose the detail work) Optimizing a software function which might be deemed unnecessary before it's even used   Though I can't seem to think of what this is called (no luck with searching either).  Originally I posted this in the 'workplace' stack exchange but was recommended to try here.