Pass by reference vs value: Is Java a hybrid?

I'm a Java programmer transitioning to C++ and need some clarification on how Java is considered "pass-by-value", rather than a "hybrid".  Java's baz() behaves identically to the C++'s foo() below, which is a pass-by-reference trait.  Edit: What I'm trying to understand is why bar() and baz() are pass-by-value despite different behavior.  I can't find this specific answer on the forums.  Java  public class CountKeeper {    private static void baz(CountKeeper ck) {     ck.inc();   }    public static void main(String[] args) {     CountKeeper ck = new CountKeeper();     System.out.println(ck.count()); // 0     baz(ck);     System.out.println(ck.count()); // 1   }    private int count;    private int count() {     return count;   }    private void inc() {     count++;   } }   C++  #include <iostream>  class CountKeeper { public:   CountKeeper();   CountKeeper& operator++();   int count(); private:   int count_; };  CountKeeper::CountKeeper() :   count_(0) {}  CountKeeper& CountKeeper::operator++() {   ++count_;   return *this; }  int CountKeeper::count() {   return count_; }  //pass by reference void foo(CountKeeper& ck) {   ++ck; }  //pass by value void bar(CountKeeper ck) {   ++ck; }  int main() {   CountKeeper ck;   std::cout<<ck.count(); // 0   foo(ck);   std::cout<<ck.count(); // 1   bar(ck);   std::cout<<ck.count(); // 1   return 0; }


Can the activity dropdown say more than just "+2 tag wiki"?

When one earns reputation from making tag wiki edits, the activity drop-down, shown when hovering over one's username, just says +2 tag wiki. There is no indication of which tag wiki was edited, or whether it was a tag wiki or a tag wiki excerpt. This gets particularly silly and useless if one edited several tag wikis at the same time, filling the list with entries that just say tag wiki, tag wiki, tag wiki over and over.  Can the activity drop-down say [tagname] tag wiki instead? It links to the right tag wiki, so it knows which tag the suggested edit was for, but I have to click through or look at the status bar to see which tag it was.


Two types of for loop - how come only one of them is working?

I have the following code in Javascript:  var controller = { initApp: function(){     var getCartData = $.ajax({ url: '/cart' }),         getCategoryData = $.ajax({ url: '/categories' }),         getSupplierData = $.ajax({ url: '/suppliers'}),         getProdcuts = $.ajax({url: '/products'});      // Main controller logic starts when all data are loaded in     $.when(getCartData, getCategoryData, getSupplierData, getProdcuts     ).done( function( cart, categories, suppliers, products ) {         var model = new Model(cart, categories, suppliers, JSON.parse(products[0]));          console.log(model.products);         console.log(typeof model.products);          for(var i = 0; i<model.products.length; i++){             console.log(model.products[i]);         }          for(product in model.products){             console.log(product);         }      }); }   };  I would like to iterate through model.products. At the end of the code I use two types of for loops. How come only one of them (the first one) is working as expected? The second one prints numbers in the length of the array.


On a mac, when you enable 'Other' on the login screen so that network accounts can log in, the large circular image that comes along with it is a gray silhouette of three heads.  Where is this image on the hard drive?  I'd like to swap it out with something else.


I have wifi adapter TP-Link TL-WN722N I want to use it to access internet and to share wifi access point at once.  I did it on windows 8:  netsh wlan set hostednetwork mode=allow ssid="APname" key="mykey" keyUsage=persistent  wlan start hostednetwork   How can i do this from ubuntu 14.04?


Is medical insurance mandatory for entering the Schengen area if you are not required to have a visa?

For nationals that request the Schengen visa, the traveller must have insurance that covers, for a minimum of €30,000, any expenses incurred as a result of emergency medical treatment or repatriation for health reasons.  But what about citizens of 'Annex II' countries and territories (Japan, Brazil, etc)? Are they also required to have such insurance?


Is it OK to send email to journal asking for extension for a revision?

I am in the process of sending the response to reviews to a journal. It looks like it will take some days for the revision.  In the reviews, the associate editor had commented the following      Finally, I would appreciate if you could submit your revised paper by Jan 12, 2018. If you cannot meet this deadline please contact us (xxx@elsevier.com) to request an extension, otherwise your paper may be withdrawn.   I was wondering if it was OK to write to them asking for an extension or should I somehow submit the revision by Jan 12?


In present perfect tense, Does 'hot news' in present past tense contains 'recent past'? Let't take this sentence for example. "Malcolm X has just been assassinated." Does the sentence mean hot news and recent past? Or It depends on the phrase? I want to know that hot news contains recent past(so we can simultaneously call 'hot news' and 'recent past'?)


If $a \in \mathbb{Z}$ is not coprime with $n$, then there is no $b \in \mathbb{Z}$ such that $ab \equiv 1 \: mod \: n$.

If b = 0, then the result immediately follows. If $b \neq 0$, as $a$ is not coprime with $n$,  $ab$ is not coprime with $n$ as they share a divisor. Therefore, there is no $b \in \mathbb{Z}$ such that $ab \equiv 1 \: mod \: n$ as $1$ is coprime with $n$ for all $n$. I just saw this statement and my solution looked quite a bit different from the one given, so I am not sure if it is correct. Thanks for the feedback.


Coulomb's law with an $r^3$, not $r^2$, in the denominator

I am reading an older physics book that my professor gave me. It is going over Coulomb's law and Gauss' theorem. However, the book gives both equations with an $r^3$, not $r^2$, in the denominator. Can somebody please explain why it is given as r^3? An image is attached for reference.  Also for equation 1-24, can somebody please explain how the middle side is equal to the right side with the del operator?


Human and alien stranded on a barren world. Initially enemies but come to respect each other

The movie is about a human and an alien being stranded together on a barren world. They initially hate each other, but grow to respect each other.  I remember the quote     I need to look at a face.  Even a face as oogly [how the alien  pronounced ugly] as yours.


Polynomial divisibility is unchanged by coeff. field extension

I would like to verify the validity of the following line of thought:  Let $K \subset E$ be a field extension. Let $K[x]$ be the polynomial ring over $x$ and denote $K(x)$ its field of quotients (the rational functions over $K$).  Now assume $f(x)=g(x)h(x)$ with $f(x),g(x) \in K[x]$ and $h(x) \in E[x]$ and all $f$, $g$, $h$ are different than zero. Then $\frac{f(x)}{g(x)} = h(x)$ in $E(x)$. So $h(x) \in K(x)$. But $h(x)$ is a polynomial, so $h(x) \in K[x]$.  Is there any other simpler argument than that?  Added:  Let me be more specific. Let $x^p - a \in K[x]$, with $p$ being prime and $char(K)=p$. Let $b$ be the unique root of $x^p - a$ in its splitting field $K(b)$. Then $x^p - a=(x-b)^p \in K(b)[x].$ Let $m_b(x) \in K[x]$ be the minimal polynomial of $b$ over $K$. Then $m_b(x)$ divides $(x-b)^p$ and so $m_b(x)=(x-b)^l$ and $l$ is the smallest positive integer for which $(x-b)^l \in K[x]$. Let $p = lq+r$ where $0 \ge <l$. Then $x^p-a=(m_b(x))^q (x-b)^r$. Can i conclude that $(x-b)^r \in K[x]$ and so $r=0$ by the minimality of $l$?  Thanks.


My approach: change $4^n$ to $2^{2n}$, then we're trying to show $\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=\sum_{k=0}^{2n} \binom{2n}{k}$, but then I got stuck. Any help would be appreciated.


Test Class for Batch Apex Schedulable batch Process

I need help in writing test class for the below Apex Schedulable batch Process.  Can anyone help me out.  global class CLM_Batch_ExpireAgreements implements Database.Batchable<sObject>,Schedulable,Database.Stateful {      //Batch Start method     global Database.QueryLocator start(Database.BatchableContext BC) {         string Agreement_Status = 'Activated' ;         string strQuery='SELECT id,Apttus__Contract_End_Date__c , Apttus__Status__c , Apttus__Auto_Renewal__c ,Apttus__Status_Category__c FROM Apttus__APTS_Agreement__c';              strQuery+=' WHERE Apttus__Status__c = \'Activated\' and Apttus__Contract_End_Date__c < today and Apttus__Auto_Renewal__c = False' ;                 system.debug('  febgdg'+ strQuery);         return Database.getQueryLocator(strQuery);     }     //Batch Execute method      global void execute(Database.BatchableContext BC, List<Apttus__APTS_Agreement__c> Scope) {          list<Apttus__APTS_Agreement__c> agr = new list<Apttus__APTS_Agreement__c>();         for(Apttus__APTS_Agreement__c agrObj : scope){             agrObj.Apttus__Status__c ='Expired' ;            agrObj.Apttus__Status_Category__c ='Expired' ;             agr.add(agrObj);                     }        update agr;     }       //Batch Finish method          global void finish(Database.BatchableContext BC) {       }     //Method which schedules the batch        global void execute(SchedulableContext sc) {               CLM_Batch_ExpireAgreements snInstance = new CLM_Batch_ExpireAgreements ();        ID batchprocessid = Database.executeBatch(snInstance);     }   }


Why can't override inherited class virtual function?

I've been trying to understand C++ inheritance and polymorphism a little bit better. But I'm having a really hard time getting this to work. I have a base class called Shape. I have Rectangle that is child of Shape. And Square that is child of Rectangle. Shape has no area. Rectangle and Square have area equal to width*height. Setting width and height for Rectangle is independent. In the case of Square, when setting width or height, the function will set both attributes to the same value. Unfortunately that is not what is happening if I try to use polymorphism by creating a Square on a Rectangle.  shapes.hpp: #ifndef SHAPES_H #define SHAPES_H  // Base class class Shape {     public:         virtual void setWidth(int w);         virtual void setHeight(int h);     protected:         int width;         int height; };  // Derived class class Rectangle: public Shape {    public:       int getArea(); };  class Square: public Rectangle {    public:       void setWidth(int w) override;       void setHeight(int h) override; };  #endif /* SHAPES_H */  shapes.cpp: #include "shapes.hpp"  // Base class void Shape::setWidth(int w) {     width = w; } void Shape::setHeight(int h) {     height = h; }  // Derived class int Rectangle::getArea() {      return (width * height);  }  // Overloading void Square::setWidth(int w) {     width = w;     height = w; } void Square::setHeight(int h) {     width = h;     height = h; }   Testing the getArea() functions:     Shape rect = Rectangle();     rect.setHeight(7);     rect.setWidth(5);     //I had to cast the Rectangle so it would be able to call getArea()     cout << "Total rectangle area (w5xh7): " << ((Rectangle*)&rect)->getArea() << endl;     Rectangle square = Square();     square.setHeight(7);     square.setWidth(5);     //I would like to be able to call Square's getArea() without having to cast it.     cout << "Total square area (w5xh7): " << square.getArea() << endl;  I had to cast the Rectangle so it would be able to call getArea(). I would like to be able to call Square's getArea() without having to cast it. Is that possible? Thank you.


implement function object bind without using c++11

I'm trying to implement my own function object class and bind function (only need to wrap member functions of 2 parameters). I'm restricted to use GCC 4.4.6 and c++0x is not an option.  My Code is as follows. It wouldn't compile.  #pragma once  namespace utils {  template<class> class CFunction;  template<class TRet, class Arg1, class Arg2> class CFunction<TRet(Arg1, Arg2)> { public:     typedef TRet (*FuncPtr) (void*, Arg1, Arg2);     void* m_pObj;     FuncPtr m_FuncPtr;      TRet operator()(Arg1 arg1, Arg2 arg2)     {         return m_FuncPtr(arg1, arg2);     }      template <class TObj, TRet (TObj::*TMemFunc)(Arg1, Arg2)>     static CFunction Create(TObj* pObj)     {         CFunction Ret;         Ret.m_pObj = (void*)pObj;         Ret.m_FuncPtr = &Caller<TObj, TMemFunc>;         return Ret;     } private:     template<class TObj, TRet (TObj::*TMemFunc)(Arg1, Arg2)>     static TRet Caller(void* obj, Arg1 arg1, Arg2 arg2)     {         TObj* pObj = static_cast<TObj*>(obj);         return (pObj->*TMemFunc)(arg1, arg2);     } };   template<class TRet, class TClass, class Arg1, class Arg2> CFunction<TRet(Arg1, Arg2)> Bind(TRet (TClass::*func)(Arg1, Arg2), TClass *pObj) {     return CFunction<TRet(Arg1, Arg2)>::Create<TClass, func>(); }  } // end of namespace utils   The compile reports   Functional.h: In function ‘utils::CFunction<TRet(Arg1, Arg2)> utils::Bind(TRet (TClass::*)(Arg1, Arg2), TClass*)’: Functional.h:48: error: expected primary-expression before ‘,’ token Functional.h:48: error: expected primary-expression before ‘)’ token   Would anyone tell me what's wrong with the code and how to make it work    After fixing the problem @Vittorio and @MSAlters metioned. I got new Compile errors.  Fixed Code  #include <iostream>  namespace utils {  template<class> class CFunction;  template<class TRet, class Arg1, class Arg2> class CFunction<TRet(Arg1, Arg2)> { public:     typedef TRet (*FuncPtr) (void*, Arg1, Arg2);     void* m_pObj;     FuncPtr m_FuncPtr;      TRet operator()(Arg1 arg1, Arg2 arg2)     {         return m_FuncPtr(m_pObj, arg1, arg2);     }      template <class TObj, TRet (TObj::*TMemFunc)(Arg1, Arg2)>     static CFunction Create(TObj* pObj)     {         CFunction Ret;         Ret.m_pObj = (void*)pObj;         Ret.m_FuncPtr = &Caller<TObj, TMemFunc>;         return Ret;     } private:     template<class TObj, TRet (TObj::*TMemFunc)(Arg1, Arg2)>     static TRet Caller(void* obj, Arg1 arg1, Arg2 arg2)     {         TObj* pObj = static_cast<TObj*>(obj);         return (pObj->*TMemFunc)(arg1, arg2);     } };   template<class TRet, class TClass, class Arg1, class Arg2> CFunction<TRet(Arg1, Arg2)> Bind(TRet (TClass::*func)(Arg1, Arg2), TClass *pObj) {     return CFunction<TRet(Arg1, Arg2)>::template Create<TClass, func>(pObj); }  } // end of namespace utils  class TestLogic { public:   bool Test(std::string& str, double d) {      std::cout << str << ",  " << d << std::endl;      return true;   } };  int main(int argc, const char **argv) {     TestLogic testObj;     utils::CFunction<bool(std::string&, double)> f = utils::Bind(&TestLogic::Test, &testObj);     std::string str("hello");     f(str, -1.0); }   New Error:  prog.cc: In function 'utils::CFunction<TRet(Arg1, Arg2)> utils::Bind(TRet (TClass::*)(Arg1, Arg2), TClass*) [with TRet = bool, TClass = TestLogic, Arg1 = std::string&, Arg2 = double]': prog.cc:59:   instantiated from here prog.cc:43: error: 'func' is not a valid template argument for type 'bool (TestLogic::*)(std::string&, double)' prog.cc:43: error: it must be a pointer-to-member of the form `&X::Y' prog.cc:43: error: no matching function for call to 'utils::CFunction<bool(std::string&, double)>::Create(TestLogic*&)'   Can anyone help me with this pls?  You can run this code


Does a downvoter receive a notification on a post edit?

Is a notification sent to someone who downvoted a question when that question has been updated?  Initially, my question got a downvote because it was lacking sufficient information/code/explanation/etc..  Now, I have updated my question & it looks good. Will a notification be sent to the downvoter that this question has been updated, so that the downvoter can review the question again & if it looks good to him/her they can remove the downvote?


Prove that $b_n = \frac{1}{\sqrt{n^2 + 1}} + \frac{1}{\sqrt{n^2 + 2}} + \dotsb + \frac{1}{\sqrt{n^2 + n}} \to 1$ as $n \to \infty$

I need to prove that $b_n = \frac{1}{\sqrt{n^2 + 1}} + \frac{1}{\sqrt{n^2 + 2}} + \dotsb + \frac{1}{\sqrt{n^2 + n}} \to 1$ as $n \to \infty$  My initial thoughts are to sandwich this (seems sensible to me). Finding the above inequality $b_n < 1$ was easy, since clearly $\frac{1}{\sqrt{n^2 + k}} < \frac{1}{n}$ for integer k. But I'm stuck on how to compare it with something from below.   A hint I've been given is that if $a_n \to a$, then $\sqrt{a_n} \to \sqrt{a}$ as $n \to \infty$, though I'm struggling to see a way of applying this.


Question about Schengen visa application

I hold an Indian passport. I am applying for a Schengen visa for a short trip in Eurpe in September 2018.  My itinerary is Bangalore, India -> Dubai on September 22. Dubai -> Sofia, Bulgaria on September 25. Sofia -> Brussels on September 27. Brussels -> Amsterdam on September 28. Amsterdam -> Brussels on October 1. Brussels -> Sofia -> Dubai on October 2. And Dubai -> Bangalore on October 3.  While applying for the visa there is this question: "Is your final destination inside the Schengen Area?"  As per my itinerary, I will be going to Sofia the second time on October 2 using my Schengen visa. What should be the answer to this question?


Can I use multiple complements for a verb

I wrote:     We implemented the proposed system as a visual tool. It is a Windows application using an embedded web browser to render the web page to provide the user with the visual identification of the page elements.    Here, I used the pattern "use A .... to do X"; however, I used two "to do", is it a correct usage of this pattern? I mean if I can add extra "to do" as complements of "use" or not? (My question is not about repeating of "to", I don't care it here)


As a part of one computer algorithm, I want to find sum for $$n+ \frac{n(n+1)}{2!} + \frac{n(n+1)(n+2)}{3!}+....+ \frac{n(n+1)(n+2)...(n+r-1)}{r!} $$. I looked at $$\frac1{(1-x)^n}$$. But it is infinite series. Is there some formula? Please help.


Display "$xx.90" instead of "$xx.9" in Javascript

When I use p=10000 ,r=15 and n=60 in the below ...  var x = parseFloat((Math.round(r/12/100*p/(1-Math.pow(1+ +(r/12/100),-n))*100)/100).toFixed(2));   x = 237.9 instead of 237.90.  If the combo of p, r and n result in a number that is not $xx.x", then the code snippet works fine ...ie. formats to 2 decimal places.  But why is it displaying 237.9 instead of 237.90?


Python Script to JSON as Geo-processing service

I have been having some trouble with this script that I created. Ideally, I would like to query between to a layer file and feature class to find certain features in the class withing a certain distance from the layer file.  Then take certain attributes from those selections and store them in a python dictionary which will be converted into a JSON format and uploaded as a geoprocessing service.  I have excluded the remaining code because this bulk is what seems to be dis-functioning.  As a standalone script, it works fine and gives me the information intended. As a service -- here is the error received     import arcpy import sys, os import json   arcpy.env.overwriteOutput = True segid = arcpy.GetParameter(0)                                                                                connection1 = r'Database Connections\DDOTLRS as LRSVIEWER.sde' connection2 = r"Database Connections\Connection to DDOTGIS as DDOTEDITOR.sde" supports = os.path.join(connection2, 'TOA.Supports')                                                                                def getFeatureOIDsNearSeg(selectthesefeatures = None, segid = None , distance=150):     '''  Function to spatially query for features within a certain distance of a street segment.     user has option to provide distance '''                                                                                streetsegs = os.path.join(connection1,'Ddotlrs.RH.LRSE_StreetSegment')                         streetsegs_lyr = "streetsegs_lyr"                                                                   selectthesefeatures_lyr = "selectthesefeatures_lyr"   try:     arcpy.MakeFeatureLayer_management(streetsegs, streetsegs_lyr, "STREETSEGID = " + str(segid)) #only selecting this block street seg ID except ValueError:     print "Error.  Cannot find this StreetSeg ID.  Check ID or source (currently set to {0})".format(segid)  try:     arcpy.SelectLayerByLocation_management(in_layer=selectthesefeatures_lyr,                                            overlap_type="WITHIN_A_DISTANCE",                                            select_features=streetsegs_lyr,                                            search_distance=str(distance) + " FEET",                                            selection_type="NEW_SELECTION")     #need to find out what was selected...     selectthesefeatures_lyr_sel_desc = arcpy.Describe(selectthesefeatures_lyr)     selectthesefeatures_lyr_sel_FIDS = selectthesefeatures_lyr_sel_desc.FIDset.split(";")     selectthesefeatures_selected = ','.join(map(str, selectthesefeatures_lyr_sel_FIDS)) #capture all the IDs for the selected supports     OIDs = "OBJECTID in ( " + selectthesefeatures_selected + ")"     return OIDs except ValueError:     print "Error.  Problem selecting supports along this segment {0}.".format(segid) return OIDs


How to apply ArcGIS time slider on Multiple Data Frames at once?

Is there a way to use the Time Slider on multiple data frames simultaneously?   Example: My Dataframe 1 shows precipitation values over an area and DataFrame 2 shows corresponding temperature.. I want to be able to use the slider to advance both DFrames at once. Right now only the 'activated' dataframe is being changed with the slider..    Another example:  I have one main map and 4 inset maps with the same time-aware dataset (see image with main frame activated). I can only export the animation with one frame following time. I would like the end result to be sequential images.  Has ESRI evolved some way to control multiple frames, or can you suggest a method that would get the same result?


If $g$ is the generator of a group $G$, order $n$, when is $g^k$ a generator?

Say a cyclic group of order $9$ is denoted by $G = \langle g \rangle$. I have a claim that  $\langle g^k \rangle = G $ whenever $k$ is a unit in $\mathbb{Z}_9$. I'm struggling to understand why this is true. Is this specific to order 9? In general, for a group of order $n$, do we require that $k$'s multiplicative inverse in $\mathbb{Z}_n$ be $n$ itself? Otherwise the generating group will be of order less than $n$, and thus cannot be equal to the group.


App crashed using realtime Firebase database

The app crashed when retrieving data from the database. What I want is when user navigates to profile, it will shows the data being registered in the database. This is what is shown by Android Studio in the RUN section when the app crashes: E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.emergencynotificationhealthcare, PID: 24585 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String  java.lang.Object.toString()' on a null object reference     at com.example.emergencynotificationhealthcare.profileGuardian$1.onDataChange(profileGuardian.java:43)     at com.google.firebase.database.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:75)     at com.google.firebase.database.core.view.DataEvent.fire(DataEvent.java:63)     at com.google.firebase.database.core.view.EventRaiser$1.run(EventRaiser.java:55)     at android.os.Handler.handleCallback(Handler.java:761)     at android.os.Handler.dispatchMessage(Handler.java:98)     at android.os.Looper.loop(Looper.java:156)     at android.app.ActivityThread.main(ActivityThread.java:6605)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:999)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:889)  This is the reported profileGuardian.java: public class profileGuardian extends AppCompatActivity {  TextInputLayout guardian_username, guardian_email, guardian_phoneNo, guardian_password, address; TextView usernameLabel, emailLabel;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_profile_guardian);      //Hooks     guardian_username = (TextInputLayout)findViewById(R.id.full_name_profile);     guardian_email = (TextInputLayout)findViewById(R.id.email_profile);     guardian_phoneNo = (TextInputLayout)findViewById(R.id.phoneNo_profile);     guardian_password = (TextInputLayout)findViewById(R.id.password_profile);     emailLabel = (TextView)findViewById(R.id.email_field);     usernameLabel = (TextView)findViewById(R.id.username_field);      DatabaseReference rootNode = FirebaseDatabase.getInstance().getReference();     DatabaseReference reference = rootNode.child("user");       reference.addValueEventListener(new ValueEventListener() {         @Override         public void onDataChange(@NonNull DataSnapshot dataSnapshot) {             String username = dataSnapshot.child("username").getValue().toString();             String email = dataSnapshot.child("email").getValue().toString();             String password = dataSnapshot.child("password").getValue().toString();             String phoneNo = dataSnapshot.child("phoneNo").getValue().toString();              guardian_username.getEditText().setText(username);             guardian_email.getEditText().setText(email);             guardian_password.getEditText().setText(password);             guardian_phoneNo.getEditText().setText(phoneNo);             usernameLabel.setText(username);             emailLabel.setText(email);         }         @Override         public void onCancelled(@NonNull DatabaseError error) {             throw error.toException(); // never ignore errors         }     });  } }


What's the difference between declaring a function static and not including it in a header?

What's the difference between the following scenarios?  // some_file.c #include "some_file.h" // doesn't declare some_func  int some_func(int i) {     return i * 5; } // ...   and  // some_file.c #include "some_file.h" // doesn't declare some_func  static int some_func(int i) {     return i * 5; } // ...   If all static does to functions is restrict their accessibility to their file, then don't both scenarios mean some_func(int i) can only be accessed from some_file.c since in neither scenario is some_func(int i) put in a header file?


Can't connect to 802.1x EAP network in recent Ubuntu versions

In my college there's a WiFi network using 802.1x PEAP. In Ubuntu 12.10 and older, I can sucessfully connect to it, but in Ubuntu 13.04, 13.10 and 14.04, it keeps asking for password and never connect.   At first I thought it was a problem with my Ralink RT5390 WiFi card as it doesn't have good open-source support and other friend were having trouble connecting to the same network with Ralink cards. So I got an Atheros AR5B22 and it solved a lot of small isues I was getting (including connecting to this netowrk), but I'm stuck in Ubuntu 12.10 because of this. Is there something I can do to get that network working in current versions, like 14.04 or it's a know bug?  I'm not sure what kind of technical info you guys need, so, just ask me if necessary...


I want to upgrade my ubuntu server 64bit 11.04 to ubuntu 12.04. I tried to do it with the command:  $ do-release-upgrade  but the output is:  Checking for a new Ubuntu release  No new release found  Does anybody know what the reason might be?


undirected graphs and Hamiltonian cycles

I'm trying to prove that if all vertices of a finite undirected graph are of odd degree, then each edge is contained within an even number of Hamiltonian cycles. (or none).   I know a Hamiltonian cycle in a graph is every cycle that contains each vertex in the graph exactly once. I tried to prove the problem by using geometrical figures with some extra edges added but it didn't work out. I would be really thankful if someone could explain their solution to this problem!


It seems like a lot of people try to display tables in Stack Overflow questions, but don't do a very good job. Is there Markdown syntax that supports creating a proper table?


I came across something rather interesting today. I was browsing Area 51 on Chrome when I happened to click on . To this, I was greeted with a prompt asking:    As , and fully expecting a crash, I clicked on SE. However, that didnt happen.     Now, since Area 51 Meta is working correctly as far as Q&A is concerned, I think it should be added to the All Sites list and if at all possible, made directly browsable from within the app.


So I'm just getting into topology and I see spaces such as $S^1$ or $S^2$  used a lot. What is the meaning of $S^1$ or $S^2$? Furthermore, what is  meant by the cartesian product $S^1 \times S^1$ or $S^2 \times S^2$? I've looked everywhere and it's a difficult question to Google. All I know is that it has to do with circles. Like a two-dimensional torus is composed of two circles and a three dimensional torus is composed of three circles. I know this website is for higher-order, computational/proof-based questions but I don't know where else to go to find this information


Is the South Africa border control able to cross-reference dual citizen passports (USA & Spain)?

I would like to travel to South Africa as a tourist 6-months after I overstayed a SA visa due to emergency hospitalization. As a result of the overstay I was classified as undesirable & am restricted from re-entry for 1 year (under the new May 2015 SA Home Affairs policies). The overstay is associated with a US passport but I am also a citizen of Spain with a Spanish passport.   Is the SA border control electronic system at the Johannesburg International airport able to cross reference passports from 2 nations (e.g, by name & birth date)?  Has anyone had experience crossing the SA border with the undesirable status?


I was talking to some friends and I said "I ate (/et/) chocolate yesterday...". Then my friend corrected me: "you ate (/eit/) chocolate...". I repeated my sentence with the /eit/ pronunciation and we moved on.   But later at home I checked some dictionaries and online debates on the subject, and now I'd like to know if it's possible or not to pronounce ate as /et/ rather than /eit/.


How to resize the visualforce page in the pagelayout

How to resixe the inline visualforce page in the pagelayout. Is there any ap exchange products or any code that I can do this ?


Summary of Issue: The Edge Lengths are inconsistently displayed on an obviously square object. Issue Detail: I'm still quite new to Blender. Iam busy creating door frames using Cube, boolean difference, deleting the inner faces, capping the inner faces, and finally extruding the door frame out. However, I've noticed some strange behavior. I'm sure this is by design, but it seems to have caused me problems now. What I initially did was extrude, and type the measurement I wanted (0.004) for the door frame faces. However, I realized that I actually needed to set it to 0.04 instead. So instead of extruding again, I selected the faces and used the Move tool to specify my new measurement numerically (0.04) and hit enter. It seems however that it appends the measurement using some unknown logic which doesn't make sense to me. The side effect that I'm dealing with now in order to try regain consistency using "Edge Lengths" is that the edges of what is seemingly a square, is actually of different lengths. I have no idea what is going on, however I can only find help on this for Blender 2.8, and apparently the entire application UI changed within a single minor version number. Please may somebody help me out here. This is what I'm talking about:


Disable internet access but leave LAN working

I'm looking for a command (or command line program) to toggle (disable/enable) internet access to the outside world in Windows XP machines. It should temporarily block internet access but leave the LAN working.   I looked for ways to change the DNS, but browsers like Chrome keep their own cache. The machines are configured via DHCP.


Possible Duplicate:          Here is a test case:   void foo(int i, int j) {    printf("%d %d", i, j); } ... test = 0; foo(test++, test);   I would expect to get a "0 1" output, but I get "0 0"  What gives??


I am cooking beans   , after soaking beans in water overnight.   I realized that when i cooked them in morning for 20 minutes in pressure cook, there are very few beans are still as hard as uncooked soaked beans, why these few exceptional beans are not softened ?


setfacl incorrectly changes group permissions

To backup the "/home" directory tree of a server, I've created a 'backup' account and used setfacl to make the whole directory readable by it. My cron job runs this command as root each night:  setfacl -R -m u:backup:rx,d:u:backup:rx /home   Great, except for one problem: whenever I run this command, it changes the group permissions of my ssh key.  me@myserver:~/.ssh$ ls /home/me/.ssh/id_rsa -l -rw-r-x---+ 1 me me 1679 Jan  8 18:35 /home/me/.ssh/id_rsa   Well, this causes my ssh program to barf because it is now group readable. Strangely, getfacl disagrees with the permissions.  me@myserver:~/.ssh$ getfacl /home/me/.ssh/id_rsa getfacl: Removing leading '/' from absolute path names # file: home/me/.ssh/id_rsa # owner: me # group: me user::r-- user:backup:r-x group::--- mask::r-x other::---   getfacl thinks the file is not group readable. If I run the obvious command  chmod 400 id_rsa   the permission is fixed, but reverts every time I re-run the original command (setfacl -R -m u:backup:rx,d:u:backup:rx /home). What's going on?  Note: I do want my id_rsa to backup up, so let's not worry about those security implications.


Invariants in subject size and depth of field?

I was curious if I could cheat my way around having to focus stack an object by using different lenses.  Playing with the  I noticed something interesting:  No matter what focal length I select the depth of field for the same angle of view (at the subject) is constant.  For example, fixing sensor format at APS-C, aparture at f/22, and a supposing I need a distance from subject of 2m for a 300mm lens I get a depth of field of 3cm.  I get the same DoF with a 600mm lens at 4m, 150mm at 1m, and 75mm at 0.5m.  Is this a quirk of practical lenses (or of that calculator), or is there a theoretical constraint here, and if the latter can someone show the math and theory?  Update: To clarify some potential confusion in the first paragraph, the question may be restated as follows: Given a fixed sensor, object, aperture, and magnification, is it possible to vary Depth of Field by varying lens focal length?


Why size of int pointer is different of size of int array?

Lets be the following code:  int x; int *p = &x; int t[3];   Then sizeof returns:  sizeof(x) -> 4 sizeof(p) -> 8 sizeof(t) -> 12   I suppose that sizeof(t) is the result of 3 * sizeof(int). But as t is a pointer to his first element, its size should be sizeof(p).  Why sizeof(t) returns the size of the memory block which represents the array ?  Thanks.


Environment variable assignment followed by command

What exactly is happening in the below bash incantation?  x=10 echo $x   I was under the impression that commands on bash can be chained using &&, || or ; but not simply separated by white-space. The above only works if the first command is an assignment. E.g. ls ls fails but foo=zoo ls works just fine.  A real case of the above style is found in .


Comparing two normal distributions with different mean

If I have two normal distributions $\mathcal{N}_1(\mu_1 = 8, \sigma^2 = 2)$ and $\mathcal{N}_2(\mu_2 = 10, \sigma^2 = 2)$, how do I turn these into the standard normal distribution, so I can easily calculate relations between the two. Do I use the same mean on both $Y_1 = \dfrac{X_1-\mu_1}{\sigma}$, $Y_2 = \dfrac{X_2-\mu_1}{\sigma}$ or two different means $Y_1 = \dfrac{X_1-\mu_1}{\sigma}$, $Y_2 = \dfrac{X_2-\mu_2}{\sigma}$ on the transform?


Does MS access(2003) have anything comparable to Stored procedure. I want to run a complex query in MS acceess

I have a table, call it TBL. It has two columns,call them A and B. Now in the query I require one column as A and other column should be a comma seprated list of all B's which are against A in TBL.  e.g. TBL is like this  1   Alpha  2   Beta  1   Gamma  1   Delta  Result of query should be   1   Alpha,Gamma,Delta  2   Beta  This type of thing is very easy to do with cursors in stored procedure. But I am not able to do it through MS Access, because apparently it does not support stored procedures.  Is there a way to run stored procedure in MS access? or is there a way through SQL to run this type of query


wifi doesn't work on ubuntu 16.04 , dell inspiron e5520

After installing OS update, reboot and wifi doesn't work. Looked at similar problems, but unfortunately there was nothing to help.   $ lspci -knn | grep Net -A2 08:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)     Subsystem: Dell Wireless 1704 802.11n + BT 4.0 [1028:0016]     Kernel modules: bcma, wl   sudo systemctl restart network-manager.service doesn't help, driver is worked. property reinstalled.


On Page 2 of Baby Rudin contain proof of $\sqrt {2}$ is not rational Number .I understand that .But Below that above content is written.How to obtain that relation between p and q I don't understand .Please Help me .


What's the difference between "$\to$" (implication) and "$\vdash$" (therefore)?

In Wikipedia,  in the last axiom of the Natural deduction system, it says "From [accepting $p$ allows a proof of $q$], infer $(p \to q)$." Isn't that a tautology? In the big table "Basic and Derived Argument Forms" that follows, I see it using a new symbol "$\vdash$" to express "therefore". Isn't that something can be done by the symbol "$\to$"? For example, what's the difference between "$(p \land q) \vdash p$" and "$(p \land q) \to p$"?  An interesting symbolic representation of the last axiom of NDS is that $(p \vdash q) \vdash (\vdash p \to q)$. Which I don't understand why is made so complicated.    What also puzzles me is in the  that follows. Since you list "$A$" as a promise, which is basically saying "assuming $A=\text{True}$", then why you have to go around such a big circle, using disjunction, conjunction, and conjunction elimination to prove back that "$A$" is true? If it is me, I would say "assuming $A=\text{True}$, we will know that $A=\text{true}$. Bang! Now we get $A \vdash A$, so we have $\vdash A \to A$." What's wrong in this deduction?


Generating spherical world from heightmapped terrain

I am using a standard heightmapped procedural terrain in my project.  However, I want the terrain to appear spherical when the user zooms out.  This is an attempt to simulate the appearance of a spherical planet.  Here is my current algorithm:          //get the direction from the "planet" center to this vert         Vector3 sphereCentertoVertPosition = vert.Position - SphereCenter;         sphereCentertoVertPosition.Normalize();          //our rotation axis is the cross between the direction from this vert to the planet center and the root (center of the terrain) to the planet center         RotationAxis = Vector3.Cross(sphereCentertoVertPosition, sphereCenterToRootPosition);          //the amount we rotate is based on the distance of this vert from the center of the terrain         Vector3 fromCenter = vert.Position - Root.Position;         float amount = (fromCenter.Length() / ((myTextureWidth / Scale) / 2)) * (float)Math.PI;          Quaternion rot = Quaternion.CreateFromAxisAngle(RotationAxis, amount);          Vector3.Transform(ref vert.Position, ref rot, out vert.Position);   My main concern is that the rotation axis is not correct.  Theoretically, should it be the cross between the vert-to-planet-center and the terrain-center-to-planet-center?


What does Responsive Web Design actually mean....?

I've gone through with many articles to understand exact difference between Responsive and Fluid web design. But couldn't make my understanding differentiate between these two.  Can anyone help me to understand it with my following questions (please pardon me if the same are too silly to ask)!   Does responsive mean, developing a website 'only' for three view-ports i.e. smartphone (320*480 including orientation), tablets (768*1024 including orientation) and desktop (980/960 width). So if there comes any other in-between resolution for eg. from 480 to 768, it is not compulsory for website to have the same perfect look as it would have in three main view-ports resolution?   or in other words, if my client asks me to create a responsive website he is meaning to create a website for three view-ports only i.e. smartphone, tablet and desktop? He doesn't mean any other resolution apart these three?   While in fluid, the website looks perfect on any resolution i.e. from 320 till 1900?   [when I see responsive web samples online and resize my browser width, then their content/layout appears perfect on any width. I don't see any extra space appearing around a content due to shift of other content in next row. How it happens then?]   Another question is, does one use media-queries only while doing responsive web design, and the same don't need to make fluid web design?


position text at the top of cell in table

I want to position the text at the top of the box as it is declared, but when the column on the right contains a long text, it automatically changes to the bottom of the box :  There is my code :  \documentclass[12pt]{report}  %% Je suis francophone ! \usepackage[francais]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fancybox} %% Je veux utiliser néanmoins des fontes qui « paraissent bien » en PDF \usepackage[cyr]{aeguill} \usepackage[table,svgnames]{xcolor} \newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}} \newcolumntype{L}[1]{>{\raggedright\arraybackslash }b{#1}} \newcolumntype{R}[1]{>{\raggedleft\arraybackslash }b{#1}} \begin{document} \begin{center} \begin{table}[h] \begin{tabular}{||C{0.5cm}||C{5cm}||C{4cm}||C{6.5cm}||}   \hline  \cellcolor{Gray} \textbf{RG} & \textbf{Définition} & \textbf{Mapping} & \textbf{Règles de gestion spécifiques}\\   \hline \hline   \multicolumn{1}{||L{0.5cm}|}{\parbox{0.5cm}{1}} & \multicolumn{1}{|L{5cm}|}{\footnotesize {Portail \-Date Traitement Courant}} & \multicolumn{1}{|L{4cm}|}{\scriptsize{RBP \_ vTBADMRBP \_ SUIVI \_ APPLI.D \_ TRAIT}} & \multicolumn{1}{|L{6.5cm}||}{\footnotesize {CASE WHEN [RBP \- Presentation View].[Dimension \- Référentiel Datamart].[L\_DATMR] = 'PORTAIL' THEN [RBP \- Presentation View].[Fait \- Suivi Application].[D\_TRAIT] END}} \\ \hline  \end{tabular} \caption{Équipe de travail} \end{table} \end{center}  \end{document}   There is a result that i have :


It looks as if the colors are inverted, but I don't know if that's lighting or how to fix it. There ARE faces there, but I don't know why they are appearing wrong.


std::function::target with template parameter pack gives "error: expected primary-expression"

When I attempt to call the method target on a std::function object using a template parameter pack, the compiler throws an error, but it works fine if the template parameters are specified explicitly in a proxy variable. Example, modified from : #include <functional> #include <iostream>  int f(int, int) { return 1; } int g(int, int) { return 2; }  template <typename... Args> void test(std::function<int(Args...)> const& arg) {     auto && ptr = arg.target<int(*)(Args...)>(); // error: expected primary-expression before 'int'      if (ptr && *ptr == f)         std::cout << "it is the function f\n";     if (ptr && *ptr == g)         std::cout << "it is the function g\n"; }  int test() {     test<int, int>(std::function<int(int, int)>(f));     test<int, int>(std::function<int(int, int)>(g)); }  I've tried various other ways to call target including the following: int (*const* ptr)(Args...) = arg.target<int(*)(Args...)>(); // error: expected primary-expression before 'int' int (*const* ptr)(int, int) = arg.target<int(*)(Args...)>(); // error: expected primary-expression before 'int' int (*const* ptr)(int, int) = arg.target<int(*)(int, int)>(); // error: expected primary-expression before 'int'  const std::function<int(Args...)>& func = arg; auto && ptr = arg.target<int(*)(Args...)>(); // error: expected primary-expression before 'int'  The compiler only appeared to be satisfied when using a proxy variable as seen here: const std::function<int(int, int)>& func = arg; auto && ptr = func.target<int(*)(Args...)>(); // OK, but requires specifying the template arguments for func  As can be seen, this workaround deviates from the previous non-working example only by explicitly specifying the function parameters instead of relying on the parameter pack. (I could bypass the proxy variable with a static_cast e.g. static_cast<std::function<int(int,int)>&>(arg).target<int(*)(Args...)>(), but this also requires knowing the parameters for the cast.) If I already knew what parameters were going to be used then I wouldn't be using a variadic template since it wouldn't be necessary. But since I don't, how can I fix this? Am I doing something wrong, is this a compiler bug, or what exactly is going on here? Note: For reference, I'm compiling with GCC version 6.3.0 with MinGW on Windows 10.


We're told that a real image is formed when light rays actually converge to a point. That's all good. But what happens if a screen isn't there to take the image on? Is it still there?


I need help with a competition math problem please.

I am a competition math student, and I was doing a practice test when I found this problem: "The fourth degree polynomial equation $x^4 - 7x^3 + 4x^2 + 7x - 4 = 0$ has four real roots a, b, c and d. What is the value of the sum $1/a + 1/b + 1/c + 1/d$? Express your answer as a common fraction." First of all, I don't think this polynomial can be factored, so I don't know how to find the reciprocals of the roots. I need help and any help would be appreciated! Note: When they say "Express your answer as a common fraction.", it means that the answer IS a fraction. I tried asking this question already, but I worded it differently, and they didn't get a fraction so I knew it was wrong. This is the link to my other question:


Space between acronym entry and it description

I am using latex to write my thesis report, so i use the glossary package to generate the acronym list , but i get a small space between acronym and it description ,here is my minimal code:  \documentclass{report} \usepackage{graphicx} \usepackage[colorlinks]{hyperref} \usepackage[savewrites,nopostdot,toc,acronym,symbols,nogroupskip]{glossaries}  \makeglossaries   \newacronym{CICS}{CICS}{Customer Information Control System} \newacronym{EHDM}{EHDM}{Enhanced Hierarchical Development Methodology} \newacronym{ASF}{ASF}{Algebraic Specification Formalism} \newacronym{ProCos}{ProCos}{Provably Correct Systems} \newacronym{HOL}{HOL}{Higher Order Logic} \newacronym{LOTOS}{LOTOS}{Language Of Temporal Ordering Specification} \newacronym{CCS}{CCS}{Calculus of Communicating Systems} \newacronym{CSP}{CSP}{Communicating Sequential Processes} \newacronym{RAISE}{RAISE}{Rigorous Approach to Industrial Software Engineering} \newacronym{VDM}{VDM}{Vienna Development Method }  \begin{document}     \tableofcontents     \chapter{Sample}     This is a sample document that uses the dummy glossary entries     supplied with the glossaries bundle for testing.     \gls{ASF} \gls{CICS}     Here are all the entries (including acronyms):      \gls{ASF} \gls{CICS} \gls{CSP} \gls{ProCos}     \gls{VDM} \gls{RAISE} \gls{CCS} \gls{ASF}     \gls{HOL} \gls{EHDM} \printglossary[type=acronym,style=tree]  \end{document}    and I get this output:     How can I change the space between the acronym entry and it description?? Can you help me please??


Case-insensitive string comparison in C++

What is the best way of doing case-insensitive string comparison in C++ without transforming a string to all uppercase or all lowercase?  Please indicate whether the methods are Unicode-friendly and how portable they are.


Is $\{ (e^{2\pi i a n},e^{2\pi i b n }) : n \in \mathbb{Z} \}$ dense in the torus, where $a,b$ irrationals such that $a/b$ irrational?

I know that the set of points of the form $(e^{2\pi i t},e^{2\pi i a t })$ where $t \in \mathbb{R}$ is dense in the torus $S^1 \times S^1$ when $a \in \mathbb{R}$ is irrational. (This problem is asked .)  I also know that the set of points of the form $e^{2\pi i a n}$ where $n \in \mathbb{Z}$ is dense in $S^1$, when $a$ is irrational. (This problem is asked .)  I believe it is true that the set of points of the form $$ (e^{2\pi i an},e^{2\pi i b n }) $$ is also dense in the torus, where $n \in \mathbb{Z}$ and $a,b$ are irrationals such that $a/b$ is also irrational. But I am unable to show this, and would appreciate any hint on how to proceed.    I tried viewing the torus as the unit square $[0,1] \times [0,1]$ with edges identified appropriately. So, I need to show that the set of points $$(an \pmod 1, bn \pmod 1)$$ is dense in the unit square.  In showing that the line $(e^{2\pi i t},e^{2\pi i a t })$ is dense in the torus, it suffices to show that it intersects every ball with centre on the vertical edge $\{ 0 \} \times [0,1]$. However, to apply the same idea here, I need to find an integer $n$ such that $an \pmod 1$ and $bn \pmod 1$ are both arbitrarily close to $0$.  I can find integers $n_1$ and $n_2$ such that $an_1 \pmod 1$ and $bn_2 \pmod 1$ are both arbitrarily close to $0$, by the same argument used to show that $e^{2 \pi i a n}$ is dense in $S^1$. But I'm unable to arrive at a single integer that does the job for $a$ and $b$ simultaneously.  I'm possibly missing only some small idea. Can anyone help me?


Markarth guards charge me with murder no matter what crime I commit

Every time I steal something the guards say:      "You have committed murder and conspiracy against the city of Markarth".     How do I fix this?


How to approximate the caption to the Figure

I'm trying to remove all the unecessary space, but I don't know how to proceed here, I already done what is possible to delete all blank space of the graph (the figure starts at the edge of the chart). Does anyone know how to remove or decrease this space?  \begin{figure}[ht] \includegraphics[width=0.4\textwidth]{figures/pontosdesejados.pdf}\centering \caption{$r$ fixed points} \label{desiredpoints} \end{figure}


How to get function names which bind to the delegate

For example, with winform, I drag a button named button1 on the winform.  this.button1.Click += new System.EventHandler(this.button1_Click); this.button1.Click += new System.EventHandler(this.Alert);   the answer is how can I get the function names bound to button1 in code.  I want to get the function names,then use names to find source codes about button1, when user click button1, I will give the source code about button1.


What does the a mean in the following sentences?   She is a do it like this. Sam is a visit the new market today.   Does the word a represent a future action like :     Sam will visit the new market today. ?


How to make password show asterisks as I type it when running `sudo` command?

Is it possible to make the password visible as asterisks (or any other character) on using sudo command?  Currently, it does not display anything, thus making it difficult to count the number of keystrokes pressed..


Determine whether an array contains a value

I need to determine if a value exists in an array.  I am using the following function:  Array.prototype.contains = function(obj) {     var i = this.length;     while (i--) {         if (this[i] == obj) {             return true;         }     }     return false; }   The above function always returns false.  The array values and the function call is as below:  arrValues = ["Sam","Great", "Sample", "High"] alert(arrValues.contains("Sam"));


Python 2D array - appending row into a list of rows without Numpy

I am trying to append a row into a list of rows. When I use print statement, everything prints correctly. However, when I use append, only the last value of the for loop appends into the statement. I am not using Numpy, because I am learning how to use for loops. This question is not relevant to this answer here  since it is not about the behavior of the list. I am simply trying to append the row into the list. It is the issue in the for loop, not in the list behavior. mat = [[5, 1, 1, 6, 8, 1, 7], [5, 0, 9, 0, 3, 5, 4], [5, 8, 3, 2, 5, 6, 5], [2, 9, 0, 0, 9, 1, 5]] binrow = [0]*4 num = 0 bincol =[[0]*4]*6  matbinrow = []  for i in range(0,len(mat[0])):   for j in range(0,4):     lbs = mat[0][i] % base     binrow[4-j-1] = lbs     mat[0][i]//= base   print(binrow)    bincol.append(binrow)       print(bincol)    My output is [0, 0, 0, 1] [0, 0, 0, 1] [0, 1, 1, 0] [1, 0, 0, 0] [0, 0, 0, 1] [0, 1, 1, 1] [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 1, 1, 1]]  I want it to be: [[0, 1, 0, 1],[0, 0, 0, 1],[0, 1, 1, 0],[1, 0, 0, 0],[0, 0, 0, 1],[0, 1, 1, 1]]


Determine if a generic class type needs to be instantiated

I have a class Data<T> which I use to store data received on a communication link.  The Data<T> class contains a Value property of type T and a Timestamp property of type DateTime.  Is it possible to determine in the class constructor that the requested type's default value is null, and in that case instantiate it?  I've looked at the new() class constraint.  But then I'm having trouble using the class with a string type, as I'm getting errors about string not having a parameterless constructor.  Here's an example causing a NullReferenceException on dataValue4.Value, since the Value property of type Foo is not instantiated.  public class Data<T> {     public Data() {         _timestamp = DateTime.Now;     }      private T _value;     public T Value {         get { return _value; }         set {              _value = value;             _timestamp = DateTime.Now;         }     }      private DateTime _timestamp;     public DateTime Timestamp {         get { return _timestamp; }     } }  public class Foo {     public int Value1 { get; set; }     public bool Value2 { get; set; } }  public class Program {     public static void Main() {          var dataValue1 = new Data<int>();         var dataValue2 = new Data<bool>();         var dataValue3 = new Data<string>();         var dataValue4 = new Data<Foo>();         //dataValue4.Value = new Foo();          Console.WriteLine(dataValue1.Value);  // Output is "0"         Console.WriteLine(dataValue2.Value);  // Output is "False"         Console.WriteLine(dataValue3.Value);  // Output is ""         Console.WriteLine(dataValue4.Value.Value1);  // Output is "0"         Console.WriteLine(dataValue4.Value.Value2);  // Output is "False"     } }


How to remove configuration files completely

Recently I uninstalled some software using sudo apt-get --purge autoremove, thinking that this would remove all traces of it including unused dependencies and configuration files. However I discovered that a configuration file was left behind in my home folder.  Is there a more powerful command which would remove even that?   Also, is it safe to delete the hidden files and folders under home, if they are merely configuration files, or are there other kinds of files?


Installed Ubuntu 13.04 on a Dell laptop I had laying around.  Install goes well but when I'm done, I only get a command line, no GUI at all.  Tried several versions, tried 32 vs 64 bit all give me the same result.  Any ideas on what to do/try?


Has anyone figured out a way to use custom fonts in Marketing Cloud emails, where the font is specified only with Free Form content block level?   There is a hacky solution provided for full HTML emails in , but this method doesn't seem to work or I'm doing something wrong.   First encode font file on  site.  Then create codesnippet with the code:  %%[ SET @customFont = "T1RUTwAMAMKAAAMAQENGRiDCu2zDikEAAgTCuAAAwoITR1BPUzA.." ]%%   Then add the @fontface to the block  @font-face {               font-family: CustomFont;               src: url(data:font/ttf;charset=utf-8,base64,%%=v(@customFont)=%%) format('truetype');  }   Then style the areas with simple  div {      font-family: CustomFont; }   However even just adding the @font-face to the Free Form will disappear after saving it.   Anyone else have had any luck using custom fonts with emails HTML?


Should I say "a LSM-tree" or "an LSM-tree"?

The "LSM-tree" is an acronym term for "Log-Structured Merge Tree". I wrote "a LSM-tree", but Grammarly keeps reminding me it should be "an LSM-tree". What is the reason for this?


Find the number of ways to launch satellites in space?

Question: Let X= {S1,S2,S3,S4,S5} and Y = {L1,L2,L3} be the sets of satellites and launching sites respectively. If each site launches at least one satellite, find the number of ways to launch satellites in the space. My solution: L1 have choice of 5 satellites L2 have choice of 4 satellites L3 have choice of 3 satellites Remaining two satellites can choose any station among 3 Hence my answer is 5*4*3*3*3. But the answer is wrong.


I'm trying to use Guice 4.0 for web applications with Tomcat 8. I tried to do example from wiki but the I get this error in Tomcat Localhost log:      28-Nov-2015 16:36:26.136 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class com.nirus.guice_confige.MyGuiceServletConfig  java.lang.NoClassDefFoundError: com/google/inject/servlet/GuiceServletContextListener     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2496)     ...   This is my web.xml file:  <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"          version="3.1">     <filter>         <filter-name>guiceFilter</filter-name>         <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>     </filter>      <filter-mapping>         <filter-name>guiceFilter</filter-name>         <url-pattern>/*</url-pattern>     </filter-mapping>       <listener>         <listener-class>com.nirus.guice_confige.MyGuiceServletConfig</listener-class>     </listener>  </web-app>   And my config file for Guice:  public class MyGuiceServletConfig extends GuiceServletContextListener {     @Override     protected Injector getInjector() {         return Guice.createInjector(new ServletModule(){             @Override             protected void configureServlets() {                 serve("/JoinLobby").with(JoinLobby.class);                 serve("/UpdateLobby").with(UpdateLobby.class);                 bind(ILobby.class).to(Lobby.class);             }         });     } }   UPD1: This is my Maven pom.xml file      <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelVersion>4.0.0</modelVersion>      <groupId>NiRus</groupId>     <artifactId>ImagServerApp</artifactId>     <version>0.0.1-FirstStep</version>      <dependencies>         <dependency>             <groupId>com.google.code.gson</groupId>             <artifactId>gson</artifactId>             <version>2.5</version>         </dependency>         <dependency>             <groupId>com.google.inject</groupId>             <artifactId>guice</artifactId>             <version>4.0</version>         </dependency>         <dependency>             <groupId>com.google.inject.extensions</groupId>             <artifactId>guice-servlet</artifactId>             <version>4.0</version>         </dependency>     </dependencies> </project>


If I want to prove that $A_n$ is a normal subgroup of $\:S_n$ I know how to prove that $A_n$ is a subgroup, but if I want to prove that it is a normal subgroup. Can I prove like that: Let  $f_1\in S_n$ then we need to provef that: $f_1A_n=A_nf_1$. $\DeclareMathOperator{\sign}{sign}$ So we know that: $\forall h\in A_n:\:\sign\left(f_1\:\circ \:h\right)=\sign\left(f_1\right)\cdot \sign\left(h\right)=\sign\left(f_1\right)$ On another hand: $\forall h\in A_n:\:\sign\left(h\:\circ f_1\right)=\sign\left(h\right)\cdot \sign\left(f_1\right)=\sign\left(f_1\right)$ Because we know that $\sign(h)=1$ So we can say that: $f_1A_n=A_nf1$ Is this correct?


The idea of degrees of freedom is pretty well sunk into my head, but I was wondering could someone perhaps give me few easy examples on how one would determine the number of degrees of freedom?   For example: Lets say that we have a sample of $n$ observations $x_1, x_2, ..., x_n$ following some distribution.  Could someone come up artificial examples of different number of degrees of freedom with this sample, say: examples where degrees of freedom are:  $$\text{degrees of freedom} = n$$ $$\text{degrees of freedom} = n-1$$ $$\text{degrees of freedom} = n-2$$ $$\text{degrees of freedom} = n-3$$  This would help get a grasp on, how one would determine the actual number of degrees of freedom. Thank you! :)


Luis arrived in the United States in June 2002.   He started school on August 29th.   Why June is used with 'in' and August is used with 'on'?


How do I add classes to main menu ul and li in Drupal 8

I want to generate the html elements and their classes to fit my styling of the main menu.    I'm confused by all the near-possibilities offered in the api documentation and by looking at core themes etc. and still can't quite see what I have to do, or where I have to do it. I would be very grateful for clear pointers to:     which php functions I have to write;  which variables I need to add / update;  in which files the functions will go.   Presumably, in MYTHEME.theme I will need a preprocess function of some sort to add to the attributes and item.attributes variables that links.html.twig uses to print the menu ul and the menu item li's.   [Update] So far I have discovered one way to place classes on the Main Menu's ul but ideally I would like to add a class to each submenu's ul indicating the depth of the sub-menu. And I cannot locate any documentation or examples from which I can understand the generation / modifying of the main menu's individual link items.    This function goes into the file  MYTHEME.theme.  function MYTHEME_preprocess_page(&$variables) {    // Pass the main menu and secondary menu to the template as render arrays.   if (!empty($variables['main_menu'])) {     $variables['main_menu']['#attributes']['id'] = 'main-menu-links';     $variables['main_menu']['#attributes']['class'] = array('links', 'clearfix', 'MYNEW_class');   }  }


Equicontinuity on a compact metric space turns pointwise to uniform convergence

I know that   If $\{f_n\}$ is an equicontinuous sequence,  defined on a compact metric space $K$, and for all $x$, $f_n(x)\rightarrow f(x)$, then $f_n\rightarrow f$ uniformly.  I'm having trouble proving this.  I see the same problem  but am having trouble following the proof, particularly with part (3).  Can someone guide me through a proof of this result?


So I got a request converting xls to xlsx. After a few hours of researching all sites and solutions I managed to adapt some code i found on various site... Now I am stuck with a java.lang.NoClassDefFoundError: org/apache/log4j/Logger  here is a list all my libs i am using to get this working so far, I had to add a few libs just to get this far and now i am stuck.  dropbox-core-sdk-1.7.7, itextpdf-5.3.0, jackson-core-2.2.4, PDFBox-0.7.3, poi-3.10-FINAL-20140208, poi-ooxml-3.5-beta5, poi-ooxml-schemas-3.10-beta1, rs2xml, slf4j-api-1.7.5, sqlite, sqlite-jdbc-3.8.7, xmlbeans   Below is my code where i call he class  private void exportRepBtnActionPerformed(java.awt.event.ActionEvent evt) {                                                  connect();            exportRepairReport();     // This is where I am trying to convert the xls file     convertExcelFiles.convertWorkbookHSSFToXSSF(workbook);     //     int selectedOption = JOptionPane.showConfirmDialog(null,             "Generate Comprehensive Report?",             "OPTIONAL",             JOptionPane.YES_NO_OPTION);      if (selectedOption == JOptionPane.YES_OPTION) {         exportRawRepairs();     }  }    Hers is the class where things go south.  public static XSSFWorkbook convertWorkbookHSSFToXSSF(HSSFWorkbook source)  {     XSSFWorkbook retVal = new XSSFWorkbook();         for (int i = 0; i < source.getNumberOfSheets(); i++)          {             XSSFSheet xssfSheet = retVal.createSheet();             HSSFSheet hssfsheet = source.getSheetAt(i);             copySheets(hssfsheet, xssfSheet);         }     return retVal; }   Any help will be appreciated, let me know if you need more info.  Thanks in advance.


Predicting Uncertainty in Random Forest Regression

Scenario: I'm trying to build a random forest regressor to accelerate probing a large phase space.  I'm using python/scikit-learn to perform the regression, and I'm able to obtain a model that has a reasonably low cross-validation error on known data split into training/test sets.  Now I'd like to begin asking my model how confident it is (I'm a bit confused about the difference between confidence intervals and prediction intervals).  Currently I know how to return some estimator $y$ given data $x$, and now I'd like to be able to get a measure of uncertainty.  If the model is sufficiently uncertain, I'd like it to let me know so that I can add that case to the training set.  My impression is that random forests are an ensemble methods.  We grow $N$ decision trees, and then our predictor is given by: $$ y = \sum_i^N w_iT_i\left(x\right) $$ Where $w_i$ is some weight and $T_i(x)$ is the value predicted by the $i$-th tree.  Perhaps the simplest (and by no means most promising) approach would be to try to take something like a variance:  $$ \sigma^2 = \sum_i^N \left(T_i(x) - y(x)\right)^2 $$   seems to suggest we can do quantile analysis using each tree as an observation.  Unfortunately I'm not sure I follow that logic, because it seems to me that even for data points that were in the training set that there should be some variance among the trees.   seems to mention the flaws in the above methods, however I unfortunately can't really follow what they suggest we do instead (as my skills in R aren't what they could be).  Can someone weigh in on whether this is the train I should be following, and perhaps help me understand what's going on?  I can't understand where to work in assumptions about the sample.  Seeing similar code in Python would likely be really helpful to me.   also seems like it might be useful, but the terms/notations are entirely outside of my specialty, and its essentially unreadable to me right now.  While I've worked in statistics on an application level, it's been a while since my last formal class.  So part of the barrier to entry for me is terminology/symbol use.  Edited to provide more detail.


How many frames does a 'worn' camera have on its back? 10,000? More? Less?  When should you decide not to buy a used camera, frame-wise?  My girlfriend and I shoot something like 3000 frames a month.  Should we stop taking 'pointless' photos that we know won't be great? Any good tips to reduce wear and tear on your camera?


How do you install Google Chrome on Ubuntu?


We have several user accounts that we create for automated tasks that require fine-grained permissions, such as file transfer across systems, monitoring, etc.   How do we lock down these user accounts so that these "users" have no shell and are not able to login? We want to prevent the possibility that someone can SSH in as one of these user accounts.


I have the following question concerning Bayesian linear regression on my machine learning assignment:     Consider $f = w^Tx$, where $p(w) ∼ N(w | 0, Σ)$. Show that $p(f | x)$ is Gaussian.    I believe that $p(f|x) ∼ N(w^Tx, \sigma^2)$ for some variance $\sigma^2$ but I'm not sure how to show it. I'm also not sure why the prior was mentioned for this question since we're deriving an expression for the likelihood. If anyone could give me some tips to push me in the right direction it'd be appreciated (please don't solve the entire problem).


Prove that the function : $f(x) = x$ when $x$ is rational and $f(x) = 1 - x$ when $x$ is irrational is continuous at $x = \frac{1}{2}$  To prove the continuity it is necessary to prove that for every $\epsilon$ there exists a $\delta$ such that $|f(x) - f(\frac{1}{2})| < \epsilon$ whenever $|x -c| < \delta$ $- (1)$ Now if we choose $a  \in (\frac{1}{2} - \delta, \frac{1}{2} + \delta)$ and also $a $ is rational and choose $\epsilon < |a - \frac{1}{2}|$ then condition in $(1)$ is not satisfied. How to move from here?


What is the best way to add a user to the sudoer group?

So far I have found four different ways to add a user to the sudoers group and not all methods work in all systems.  Why so many different implementations? What is the best? What is the standard (i.e. work in most systems)?  Different implementations:   Adding the user to the 'wheel' group.  Adding the user to the 'sudo' group.  Editing the file /etc/sudoers Editing the file /etc/sudoers using visudo


Users past 10,000 reputation see fewer CAPTCHAs but this is not listed in the  page.


Clipping raster layer with *raster* mask layer in QGIS

Given two input layers  The clip layer - an arbitrary layer (though in my case it's a float 1 band geotiff) The mask layer - a paletted raster in which every pixel is either NO DATA or a single "color" value, same for every pixel.  I want to create an output raster whose overall extent matches the extent of the mask layer and each pixel is either NO DATA if the corresponding pixel of the mask layer is NO DATA or the value of the corresponding pixel from the clip layer if the corresponding pixel of the mask layer is not NO DATA. I know I can mask the clip layer with a polygon, but the mask layer is a raster. Polygonizing the raster layer is possible in principle, but would result in a polygon with a lot of very short edges. Is there a direct way to do this in QGIS? I suppose there's probably a path that involves creating a new layer and using the raster calculator, but I'm hoping there's something more direct. Further complicating the matter is that the two rasters might not have the same resolution and origin. I believe this is equivalent to  in ArcMap.


2D isometric: screen to tile coordinates

I'm writing an isometric 2D game and I'm having difficulty figuring precisely on which tile the cursor is. Here's a drawing:    where xs and ys are screen coordinates (pixels), xt and yt are tile coordinates, W and H are tile width and tile height in pixels, respectively. My notation for coordinates is (y, x) which may be confusing, sorry about that.  The best I could figure out so far is this:  int xtemp = xs / (W / 2); int ytemp = ys / (H / 2); int xt = (xs - ys) / 2; int yt = ytemp + xt;   This seems almost correct but is giving me a very imprecise result, making it hard to select certain tiles, or sometimes it selects a tile next to the one I'm trying to click on. I don't understand why and I'd like if someone could help me understand the logic behind this.  Thanks!


Locked from tablet lenovo version above 5 no forgot button

I cant remember my password and i am locked out on my lenovo tablet. What should i do without fa tory resseting? I need help i cant find also a forgot button and i have no idea what to do


I have just done a clean install of 17.10 I am finding that synaptic package manager won't work:     synaptic-pkexec No protocol specified Unable to init server: Could not connect: Connection refused  (synaptic:9019): Gtk-WARNING **: cannot open display: :0   Also finding that after installing Shotcut from Snap I get the following error: 'This program requires SDL2' I wonder if it's related? Any help would be very welcome.  Thanks!


Apple Silicon: port all Homebrew packages under /usr/local/opt/ to /opt/homebrew

I recently purchased a MacBook Pro 13" with the M1 chip and transferred all my data over using a Time Machine backup. Homebrew packages are currently installed in /usr/local/opt/ but it is my understanding that they should be under /opt/homebrew for Apple Silicon Macs. How can I:  Get the list of packages I currently have installed Remove those from /user/local/opt Reinstall them under /opt/homebrew  I kind of assumed Homebrew would be clever enough to do this automatically but apparently it needs some manual maintenance. Here's my Homebrew config if it helps: HOMEBREW_VERSION: 2.7.2 ORIGIN: https://github.com/Homebrew/brew HEAD: dad7dc6a1498b80770d98f2d7cd6fb927c300bbb Last commit: 3 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 2b1d79d038bffdbfcee93283051d48919a4caf3d Core tap last commit: 16 hours ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_REPOSITORY: /usr/local/Homebrew HOMEBREW_CELLAR: /usr/local/Cellar HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit arm_firestorm_icestorm Clang: 12.0 build 1200 Git: 2.30.0 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl macOS: 11.1-arm64 CLT: 12.3.0.0.1.1607026830 Xcode: N/A Rosetta 2: false  Thanks in advance!


Copy-pasting external (Wikipedia) entries into tag excerpts and SO wiki

has been making some Wiki edits while I was reviewing. I noticed that his edits were actually sentences copy-pasted from various sources like project homepages or Wikipedia.  In general, these edits make sense, though I hesitate to accept them.


Show that $\bar{A}=\{x \in M | d(x,a)=0\}$

Let $(M,d)$ be a metric space. Let $A$ be an arbitary subset of $M$ and let $x$ be an arbitary point. Define $d(x,A)=\inf  \{d(x,y)\mid y \in A\}$. Show that $\bar{A}= \{x \in M \mid d(x,A)=0\}$  How would I approach this? How should I begin?


Assuming the formulas $$\sin(z)=\frac{e^{iz}-e^{-iz}}{2i}\quad\text{and}\quad\frac{\sin(\pi z)}{\pi z}=\prod_{n=1}^\infty\left(1-\frac{z^2}{n^2}\right),$$ I want to find the Hadamard product of $e^z-1$. I think I've done the work correctly, but I end up having an extra factor of $2\pi i$ at the end (this is from Stein and Shakarchi's book and they list the answer for this particular problem). So, my work is \begin{align} e^z-1&=e^{z/2}\left(e^{z/2}-e^{-z/2}\right)\\ \\ &=e^{z/2}\left(e^{i(-iz/2)}-e^{-i(-iz/2)}\right)\\ \\ &=2ie^{z/2}\left(\frac{e^{i(-iz/2)}-e^{-i(-iz/2)}}{2i}\right)\\ \\ &=2ie^{z/2}\sin(-iz/2)\\ \\ &=2\pi i ze^{z/2}\frac{\sin(-iz/2)}{\pi z}\\ \\ &=2\pi i ze^{z/2}\frac{\sin\left(\pi(\frac{-iz}{2\pi})\right)}{\pi z}\tag{*}\\ \\ &=2\pi i ze^{z/2}\prod_{n=1}^\infty\left(1-\frac{\left(\frac{-iz}{2\pi}\right)^2}{n^2}\right)\\ \\ &=2\pi i ze^{z/2}\prod_{n=1}^\infty\left(1+\frac{z^2}{4n^2\pi^2}\right). \end{align}  The answer according to the book is $$e^z-1=e^{z/2}z\prod_{n=1}^\infty\left(1+\frac{z^2}{4n^2\pi^2}\right).$$Have I made a simple mistake in calculation, or are the two somehow compatible with each other?  Update: Thomas Andrews has pointed out a mistake in my infinite product formula. I've corrected that mistake.  $(*)$ The error occurs from this line to the next. Instead of multiplying and dividing by $z$, I should have multiplied and divided by $\frac{-iz}{2\pi}$. That would cause the appropriate cancellation.


How do I force `sudo` to ask for a password each time when a specific command is used?

Is there a way to force the sudo command to ask for a password each time when I'm using sudo rm /path/file?  I want to protect my self from stupid mistakes, committed due to low attention when I'm running some commands from the history.


Is there a performance improvement when using JOIN vs a WHERE clause?

Is there a performance difference (or any other reason) to use a JOIN instead of a WHERE clause as per the code examples below:  ex1.  select * from table_1, table_2 where table_1.id=table_2.id;   ex2.  select * from table_1     join table_2 on     table_1.id = table_2.id;


Can complicated code (particularly, TikZ code) which defines a macro be processed only once, rather than per macro call?

The question is pretty straightforward, but here is some context for clarification.  In the present document I'm writing, I find myself using a particular math symbol, which I wrote in TikZ, with tremendous regularity, so I encased the TikZ code in a macro call in the preamble.  FYI, the code overlays a clipped \ell and a clipped italics n to create a cursive-like h, and the macro labels this \ehh.  As of this writing, the \ehh  call is in use over 130 times, and processing all those TikZ environments is significantly adding to the compile time.  It should be noted the macro output is precisely the same in each instantiation; there is no change to the output given the local environment of a given \ehh call. As a test, I replaced the TikZ computation in the definition with just the letter h, and the compilation was back up to speed.  It really is the \ehh processing slowing things down. The questions: When a macro is defined using a computationally complicated structure, but where the output is the same for each call to the macro, is there a way to allow the processing of that portion of code one time, and just have the macro point to (or call, or whatever the correct vernacular is) the output, instead of processing the defining codeset repeatedly? If the answer to the general question is "no," then with a more specific TikZ focus, is there a way to process TikZ code written in the preamble and have calls to the macro (or maybe, subsequent calls after the first) not process the full TikZ code set, but rather just reference the already processed output?


LAMP stack with apache and php on one linux server and mysql on a different linux server

I am pretty new to linux and LAMP setup. I want to setup a LAMP environment with AP on one linux server and M on a different linux server. I have a hard time finding a relevant document with such a configuration.  I have done the following steps so far:  server1:  yum install -y httpd /sbin/service httpd restart yum install -y php php-mysql sed -i "s/Listen 80/#Listen 80/g" /etc/httpd/conf/httpd.conf yum install -y mod_ssl openssl /sbin/service httpd restart service iptables stop   I changed the ServerName in /etc/httpd/conf/httpd.conf from  #ServerName www.example.com:80   to  ServerName 172.32.35.14 (ip address of server1) /sbin/service httpd restart   server2:  yum install -y mysql-libs yum install -y mysql yum install -y perl-DBI yum install -y perl-DBD-MySQL yum install -y mysql-server /sbin/chkconfig mysqld on /sbin/service mysqld start mysql -u root  -e "CREATE USER 'mysqluser' IDENTIFIED by 'password'"  mysql -u root  -e "CREATE USER 'mysqluser'@'localhost' IDENTIFIED by 'password'" mysql -u root  -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'localhost' WITH GRANT OPTION" mysql -u root  -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'%' WITH GRANT OPTION" mysql -u mysqluser -p password -e "CREATE DATABASE mysqldb"  mysql -u mysqluser -p password mysqldb < /tmp/mysqlinstaller/world.sql service iptables stop   Then I had these post configuration steps:  On server 2, where my mysql is installed, I did the following:  bind-address = 172.32.35.14 (ip of server 1 where apache/php are installed) service mysql restart   But I am not able to establish a connection. Can you point out what I am missing and guide me please.


Is there a blender plugin that allows me to click on a material and see where it is used on the mesh/model?

I have gotten another problem whit my project. The model i based my project on has 23 textures that are not named really usefully(some are in other language i dont speak).  Basically is there a way in blender to see(trough some plugins or external program) which material is used on which faces(so i could get a bigger picture what materials i can delete, re name, etc...)? Basically id like to see materials used on faces in sort of a same way like we can see selected faces in wireframe rendering mode(while the faces are chosen in edit mode).  Is there a plugin or external program(that i can buy or get for free) that allows me to see materials like this?  Where faces would be selected based on the material i have inputted into somewhere(eg clicked on the material in question)?


Multiple authors in a Journal style (llncs) Document

How to display multiple authors in a journal style e.g. \documentclass{llncs} document?  The solution suggested in  does not work for me, as \and is not working in my document.


Is there a negative word for an overt display of emotion?

I recently discovered a friend who always believed that cheesy, corny and tacky meant (to use their words) a "pornographic display of emotion".   As in: The end of a TV show where that Dad says to the son, "I love you and I want the best for you". To them such things are "cheesy" because they're too "explicitly emotional" -- but not because they're cheap or insincere.   So when they heard people say "that song is cheesy" or "the ending of that movie was so tacky" they thought it was referring to an exposed display of emotion which makes them feel uncomfortable. Not necessarily because the movie was trying too hard, and therefore coming across as fake or mawkish, but simply because the characters were sharing their innermost.  For example, this person could be at a wedding in real life, and watching a proud father welcome his new daughter-in-law to their family, describe it as "tacky" -- solely because his feelings are on display.   I've explained that corny, tacky and cheesy actually refer to insincerity and cheapness, much to their surprise, but now I'm wondering if there is such a word the means what they thought other people were referring to.   Is there a word that to negatively describe an overt display of sincere (ie. not mawkish, contrived or exaggerated) emotion?  Edit: I don't think this question can be answered, as I believe looking upon such things negatively is purely in the eyes of the beholder, and not necessarily something that is objectively appreciated by a large number of people. Happy to be proven wrong, but to restate: I'm not referring to exaggerated or overly sentimental displays of emotion -- just honest displays of deep emotion, period.


How do we show that  $X^4-10X^2+1$ is reducible modulo every prime $p$?    I've managed to show it for all primes less than 10, for primes greater than 10 we have $X^4+(p-10)X^2+1$. Where do I go from here?


How to compare 2 strings in UNIX shell script?

I have a variable which stores a string, the output of a sed command. I want to execute a set of commands only if this string value matches either of the 2 other strings.  I used the below code.   #! /bin/ksh request=”Request” fault=”Fault” while read lines; do     category=`echo $lines|sed -n -e 's/.*Summary: Value//p'| awk '{print $1}'`     if [ ! -z "$category" ]     then         if($category = $request)         then             echo $category         fi      fi done<content.txt   But it's giving me an error:  sample.sh: Request: not found   The variable category will have either value Request or value Order  Can someone point the error or a solution to this?  If inner if is eliminated and echo $category will print the exact string value.


Is it a bug? (LuaLaTeX AND [russian](Polyglossia OR Babel) AND Cleveref) => ERROR

So, with the following code  \documentclass[12pt, russian]{article}  \usepackage{fontspec} \defaultfontfeatures{Ligatures={TeX},Renderer=Basic} \setmainfont[Ligatures={TeX,Historical}]{Linux Libertine O} \setsansfont{Linux Biolinum O} \setmonofont{Inconsolata} \usepackage{babel} \usepackage{cleveref}    % \tracingall   % \tracingassigns=5   % \tracingmacros=2   % \tracingcommands=2   % \tracingrestores=1   % \tracingstats=0   % \tracingoutput=10   % \tracinggroups=10   % \tracingonline0  \begin{document} 123 \end{document}   %%% Local Variables:  %%% mode: latex %%% TeX-master: t %%% End:    I have the following error  ! Undefined control sequence. \@tempa ^^@-\CYRR \cyri \cyrs                              \cyru \cyrn \cyro \cyrk  l.3 \select@language{russian}  ? X   The word 'Risunok' stands for 'Picture' in Russian. (That's the word you get by stripping "\cir"s from what is in the error message.)  Is it a bug? Any help or suggestions?  (As you can conclude by playing with the code it's because of the exact combination in the title of the question - well, it is like so on my machine with fully updated TeX Live 2014).


Star Trek: Discovery, the first new Star Trek television series in 12 years, debuted last week.  As with a number of recent Star Trek efforts, this is a prequel to the Original Series, occurring roughly one decade prior chronologically.    The Original Series, the Next Generation, Deep Space Nine, and Voyager occur in a chronological sequence that, generally speaking, moves forward (although TNG, DS9, and Voyager overlap to various degrees).  The linear trajectory of Star Trek productions took a sudden shift with the television series Enterprise, which was set just over 100 years before TOS. This was followed by J.J. Abrams' 2009 film Star Trek, which created a new timeline and which followed the characters from TOS, but at a time that is also chronologically one decade before TOS.  Given that the last few interpretations of Star Trek were prequels in one sense or another, I was disappointed that Discovery was yet another prequel.  I'd like to know why the showrunners decided to take this direction.  I haven't been able to find any statements about the rationale.    That being said, I find it interesting that Star Trek (2009) was set in 2255-2258 and Discovery is currently set in 2256, even though they are ostensibly in different timelines — the former in the reboot timeline and the latter supposedly in the original timeline.  Also, one of the showrunners for Discovery, Alex Kurtzman, was one of the principal members of the creative team behind the Abrams films.  Why did the creative staff behind Discovery decide to make another prequel?  Does it have anything to do with the fact that Star Trek (2009) and Discovery are set in roughly the same years?


Marketing Cloud Rest API and Business Units

We have our main BU (business unit) at the top of the tree, and one of the other BUs is TEST. In TEST we have created an Installed Package and in that installed package we have added a Server-to-Server API Integration. In the Access tab of that API Integration we've disabled the integration for the Parent BU, and have enabled it for the TEST BU.  When we make Rest API calls to the endpoint created in that API Integration we always get data from the "Main" BU, and not from the TEST BU.  If I create a contact that is available in both the Parent and TEST BU, but if I try to trigger an email based on a Triggered Send definition only the definitions created in the Parent BU are available and not the definitions from the TEST BU.  How can I access the data in the TEST BU from the Rest API? And why aren't the permissions preventing me from taking actions on the Parent BU?


Integral of the product of $x^k$ and the upper half circle of radius 2.

As I was browsing through the introduction of a paper, I came across the following equality:  $\displaystyle\frac1{2\pi}\int_{-2}^2x^k\sqrt{4-x^2}~dx=\begin{cases}\frac1{ k/2+1}\binom{k}{k/2}&\text{if $k$ is even;}\\0&\text{if $k$ is odd.}\end{cases}$  Given that the equality in the case where $k$ is even was not intuitively obvious to me (the case where $k$ is odd is trivial), I decided to try to compute if myself. However, after trying to use most of the integral tricks I remembered, I am at a loss.  I would appreciate any partial solution/hint of this if anyone knows it.


Is it possible to move a vertex, and have that vertex also be moved on the UV mp as well? I'm trying to improve the boundaries of a modeled leaf:  And it is a pain to fist move the vertex and then correct the UV map.


Why did Lucius give Tom Riddle's diary to Ginny?

In The Chamber of Secrets, Lucius slips Tom Riddle's diary into Ginny's cauldron in Diagon Alley.  Did Voldemort or one of his followers instruct Lucius to do this?  If not, why did he do it?  If he was just trying to dispose of evidence, this seems like a rather stupid way to do it.  Arthur works for the Ministry and is a friend (or at least a fan) of Dumbledore's; if he discovered the diary quickly enough, it could go very badly for Lucius.  And if Lucius was deliberately trying to open the Chamber (for some reason?), the whole thing seems very poorly planned and executed.  There was no one at Hogwarts besides Ginny working towards opening the chamber, so the plan has a single point of failure.  What was Lucius trying to accomplish, and why?


Looking for a movie about the military (or intelligence agency) creating an AI system that decides to act on its own.  I do not recall the system's primary function.  Near the beginning of the movie, we see the primary operator die in a car crash.  His brother (identical twin?) is sent in, possibly to investigate, and discovers that the AI system decided to kill the brother to protect itself, and did so by changing a stop light so that he would get t-boned.  It would have been between 2000 and 2010, probably pre-2005.  I had thought maybe it was a Jake Gyllenhaal movie, but his IMDB page begs to differ.


What should I consider when upgrading my 30 year old flash?

I have a Canon 60D, 18-55mm kit lens, and a 70-200mm f/2.8 that I use to shoot my kids sporting events. I want to replace my 30+ year old flash with a new unit. I am considering Godox and Yongnuo third party flashes as Canon are out of my price range.  I have questions about:   Trigger differences.  Should I be using RF or Optical triggering? Master/slave functionality.   Yongnuo 600EX-RT vs the Godox v860c. Any advice between the two.  There is about a $50 difference between the two.   Other considerations:   I want to get a flexible powerful flash with a range of at least 150ft. High school sports are fast action I would prefer Li-Ion batteries but AA are fine as well I would like to have a TTL radio transmitter for future use


Is there a term for "enforcing rules you don't understand"?

Today I was scolded for leaving my access card at home for the second time. From my point of view, this causes about 10 seconds of work for the people at the reception. When I asked why this would be such a big deal, I got only evasive answers pointing to policies and power plays ("this is not up for discussion"). This leaves me with the impression that the person scolding me doesn't actually know of any negative impact, but just tries to overly strongly enforce policies. Is there a term describing such behavior?  EDIT: My use case for the term I am searching for is for writing a blog post about my experiences with this company. Example sentence: "The company is very hierarchical, beaurocratic, and  encourages ${TERM}."  EDIT2: I know it's a bad idea forgetting your key card. I am just trying to understand whether the harshness of the reaction is justified. Imagine you are 5 mins late for a meeting - you know it's bad behaviour, but you would probably consider it too harsh if you get fired for that.


If two functions f,g are both discontinuous at some point a in the domain, does this mean that the sum f+g is also discontinuous at a?

Real analysis question. Having trouble either coming up with a counterexample where the sum would be continuous at a, or proving that the sum would be discontinuous at a for all cases.


How do I remove the extra Ubuntu option on the Windows Boot Manager menu?

I installed ubuntu using Wubi side by side with Windows. I decided to uninstall ubuntu and install Kubuntu, which I did successfully. However now when I boot my computer, the Windows Boot Manager displays 3 options:   Windows Ubuntu Kubuntu    The Ubuntu option does not work, but the entry did not get removed when I uninstalled  Ubuntu the first time. How do i get rid of this extra entry?


What is a female or gender neutral form of gentleman that relays the same tone of respect?

At my office when referring to customers or external vendors I often use the word gentleman. I do this in effort to show that I’m speaking respectfully about them so the content and tone of my statement is less likely to be mistaken. For example, “I spoke with the gentleman about the issue he was having and it turned out he forgot to turn his computer on.”  However, when the subject is a female the use of the word lady doesn’t seem to project the same level of intended respect.  Is there an alternative female or gender neutral word that I could use in these cases?


GZip of drive image created by using `dd` command

I created yesterday a drive image using GZip.  I opened the 51.3 GiB file named ssd.img.gz to see one icon thats a package of 3.9 GiB, yes, thats THree point Nine Gigabytes in size and has the name of the image as ssd.img  That does not seem right to me, has the image creation worked or not?  Yes the drives have data and an operating system on it.  Should I have used cat instead? only I did and it kept on saying that it had nothing to do.  Would using the | zip instead be a better option?    ** EDIT **  The command used was:  mark@zotac:~$ sudo -l Enter password:<entered password to get in to root> root@zotac:~# dd if=/dev/sda | gzip -c > "/media/mark/Seagate External Drive/ssd.img.gz   the terminal spent the best part of 10 Hours at building the image, something in itself that I also found suspect, why so log when copying the files to a folder that I wanted, some 40GiB took 45 minutes...  The source drive /dev/sda had no mounted partitions.     ** EDIT **  Just to clarify, I am trying to make an image of the drive to back up later if things go wrong with a repair, the drive itself needs to be a file on a drive as the target drive partition is using almost all of the drive, the partitions can't be resized on it without formatting it and I am not about to lose 1.4TB of data.   So the dd if=/dev/sda of=/<target> isn't what I need, what I do need is an image of the drive that I can restore the image from to the drive should the repair go wrong.  So what command do I use, dd or cat? Why does | zip keep telling me it has nothing to do when used with cat but no error or warning with dd


Why does $\frac{\sin x}{x}$ have no anti-derivative

I've been messing around with indefinite integrals. Watching some youtube videos and I found the Sinc function and that it has no finite Anti-derivative.  Desmos being my favourite program ever I decided to graph to the equations $y=\frac{\sin(x)}{x}$ and $y=\int_0^x\frac{\sin(a)}{a}da$ (only way I could do indefinite integrals in Desmos)  If you do this you might notice $y=\frac{\sin(x)}{x}$ looks very similar to $y =\sinh(x)$ and $y=\int_0^x\frac{\sin(a)}{a}da$ looks very similar to $y=\arctan(x)$  I wondered how we know that $\frac{\sin(x)}{x}$ has no finite anti-derivative because these simple functions give seemingly accurate approximations  Best approximation I could get for it in the short time I had was: $$\int \sinh(x)-\frac{d}{dx}\bigg[\frac{\sin(x)}{x}\bigg]-\frac{\pi}{2}$$ or $$2\arctan(e^x)+\frac{\sin(x)}{x^2}-\frac{\cos(x)}{x}-\frac{\pi}{2}$$ (In all the examples I'm assume $C=0$ because it's not important and I'm assuming any points with $\frac{0}{0}$ evaluate to their limits as $x$ tends to $0$)


$G$ is a group with $|G| = n$ and $p$ is the smallest prime dividing $|G|$ , then any subgroup of index $p$ is normal.

What we do in this proof is :   We say let $G$ acting on the left cosets of $H$ in $G$ where $H$ is a subgroup of $G$ , with $ | G : H | = p$  We consider $K$ as the kernel of the action  such that $ | H : K | = k$,   Then we make a statement that $ G/K $ is isomorphic to a "subgroup" of $S_p$ ,  I know the first theorem of Isomorphism is applied here , but I am a little confused ,   According to the first isomorphism theorem ,  $ G/K $ should be isomorphic to $S_p$ and hence , $ |G/K| = |S_p|$ , i.e $ |G/K| = p!$ ..  From where does that "subgroup" term comes from ?  I know , only that "subgroup" helps in completing the proof as , that implies $|G/K|$ divides  $p!$ , but the actual statement of the theorem confuses me , could anyone help me with this?


I know using turn command and a sample code like this:  \usepackage{rotating}  \begin{turn}{90} Supervised Learning \end{turn}}   we can rotate a text inside a cell, however, I couldn't find a way to vertically center this rotated text. Any suggestions is appreciated.  Here is the sample MWE:  \begin{table}[]     \centering     \begin{tabular}{|>{\centering\arraybackslash}m{0.5cm}|c|>{\centering\arraybackslash}m{8cm}|}         \hline         \multicolumn{2}{|c|}{Classification} & References \\ \hline         %\multirow{2}{*}{{\begin{turn}{90}Supervised Learning\end{turn}}}            \multirow{2}{*}{\rotatebox[origin=c]{90}{Supervised Learning}}  \end{tabular}     \caption{A Classification}     \label{tab:Machine_Learning_models} \end{table}


JavaScript: Unable to access module's variable from chrome's console

I am trying to access some variables (of script.js) on chrome's console. I'm able to do so only until I turn my script.js into a module (type="module") in index.html. If i try to access any variable when i have type=module on my script tag, i get the following error:  Uncaught ReferenceError: variable_name is not defined at <anonymous>:1:1  <script type="module" src="./script.js"></script>


Exercise similar to prime avoidance theorem in R.Y. Sharp's textbook

I'm a beginner in commutative algebra, and I'm self-studying this subject via R.Y. Sharp's textbook.      Let $R$ be a commutative ring with $1$ which contains an infinite field as a subring. Let $I$ and $J_1,\ldots,J_n$ where $n\ge2 $, be ideals of $R$ such that:       $$I\subseteq J_1\cup J_2\cup\cdots\cup J_n.$$       Prove that $I \subseteq J_j$ for some $j$ with $1\le j \le n$.   It looks similar to the Prime Avoidance Theorem, but in this case each $J_i$ just to be ideals and I can't figure out what the role of "contains an infinite field as a subring" in this situation.   I expect for some idea / suggestion. Thank in advance.