I am using Java to iterate a list and update it based on certain criteria. But since it will provide ConcurrentModificationException im using a duplicate list for this but this still provides the same exception.  I have a class named Storage that denotes a virtual storage that is represented as a folder (one folder for one storage) and this class contains an attribute fileList that denotes the list of files it contains (within the folder). The class is as given below,  public class Storage {     // List of files in storage     private List<File> fileList = new ArrayList<File>();      // Occupied size in MB     private double occupiedStorage;      // Location of storage folder     private String location;      public Storage(String loca) // Create a storage     {         this.location = loca;         this.occupiedSize = 0;     }      public addFile(File f) // Add file to storage     {         // Copy the file to folder in location 'this.location'         this.fileList.add(f);         this.occupiedSize = this.occupiedSize + f.length()/1048576.0;     }      public List<File> getFilesList() // Get list of files in storage     {         return this.filesList;     }      public double getOccupiedSize() // Get the occupied size of storage     {         return this.occupiedSize;     } }   I have created a total of 10 storage using 10 objects and each of them has separate folders. The i added many different files to all the folders using for loop and calling the this.addFile(f) function.  Then later i want to delete only specific files from specific storages that satisfy a certain criteria and i added the following deletion function to the Storage class,  public void updateFileList() {     List<File> files = new ArrayList<File>();     files = this.getFilesList();     for (File f : files)     {         if (/*Deletion criteria satisfied*/)         {             f.delete();             this.getFilesList().remove(f);             this.occupiedSize = this.occupiedSize - f.length()/1048576.0;         }     } }   But this provides ConcurrentModificationException in the Enhanced For Loop that i am using in the updateFileList() function. Within the enhanced for loop i am updating the this.getFilesList() list by removing the unwanted file, and the iteration is made using a duplicate list files. Then why am i getting the ConcurrentModificationException exception?? Am i doing something wrong?

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


Note: The JDK9, I tried to install is a 9 Early Access Release version.  sudo add-apt-repository -y ppa:webupd8team/java /* added repository */ sudo apt-get update /* updated */ sudo apt-get install oracle-java9-installer /* I can't instal JDK 9 */   Note: I have installed JDK 8 on my Ubuntu 16.04 system.    When I do sudo apt-get install oracle-java9-installer I get the error shown in below picture.   When I do sudo apt-get update –fix-missing, I get uses weka digest algorithm (SHA1) warnings for some gpg keys as shown below.   I can't do sudo dpkg --configure -a or any software installation, I get error because of JDK 9 installation incompete.  I removed oracle-java9 related ppa sources file from /etc/apt/sources.list.d, and also removed oracle-jdk9-installer folder from /etc/apt and removed oracle-java9 related packages from /var/cache/apt/archives.   I have not selected any java related ppa sources in my sources.list file.   Every time I try to install/remove/configure something, I get error of JKD9 aso shown below. And the folder oracle-jdk9-installer that I removed in the past from /var/cache again appears.   Because of this incomplete installation of JDK9, I can't install/remove/configure anything in my Ubuntu 16.04 system.   I searched how apt-get works in , nothing found because there is no single file inside /var/lib/dpkg/info directory. There is nothing related to java or oracle things in the /var/lib/dpkg/list directory as well.   After researching sometime in the internet, I found that I can install JDK9 using sudo apt-get -o Dpkg::Options::="--force-overwrite" install openjdk-9-jdk. I ran this script, but still I get the error as presented below picture.    I checked there is nothing in /etc/apt/apt.conf file. I wanna know, from where apt-get is reading the configuration information? So that I can remove all java9 reated information from that file and solve my problem

I uninstalled jdk packages and now can't install them back. I managed to install oracle-java7-installer and oracle-java8-installer but can't install oracle-java9-installer. It seems that my computer tries to download wrong version of oracle-java9-installer 177 when version i would be able to download is 178.    $ wget http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz --2017-07-21 11:00:02--  http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 200 OK Length: 293348142 (280M) [application/x-gzip] Saving to: 'jdk-9+178_linux-x64_bin.tar.gz'  jdk-9+178_linux-x64_bin.tar.gz     1%[>                                                          ]   5.42M  5.04MB/s               ^C  $ wget http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz --2017-07-21 11:00:16--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 11:00:17 ERROR 404: Not Found.   Can you help? apt-get tries to install Oracle JDK 9.  I run Ubuntu 16.04 in virtual machine hosted by win7  Full error message:  sudo apt-get install oracle-java9-installer Reading package lists... Done Building dependency tree        Reading state information... Done oracle-java9-installer is already the newest version (9b177-1~webupd8~0). 0 upgraded, 0 newly installed, 0 to remove and 147 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up oracle-java9-installer (9b177-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk9-installer/wgetrc Downloading Oracle Java 9... --2017-07-21 10:54:11--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 10:54:13 ERROR 404: Not Found.  download failed Oracle JDK 9 is NOT installed. dpkg: error processing package oracle-java9-installer (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  oracle-java9-installerE: Sub-process /usr/bin/dpkg returned an error code (1)


JSON String is like this:  {     "products": [{         "Variants": [{             "SellPrice": "18.00",             "VariantID": "1",             "VariantName": "50 GM",             "InCart": "0",             "MRP": "19.00",             "VariantImagePath": null         }],         "SubCategoryID": "44",         "ProductImagePath": "/images/patanjali/1819.png",         "SubCategoryName": "Bathing Soap",         "BrandName": "Patanjali",         "ProductID": "1",         "BrandID": "112",         "ProductName": "Body Cleanser - Lemon Honey Kanti"     }, {         "Variants": [{             "SellPrice": "24.00",             "VariantID": "47",             "VariantName": "75 GM",             "InCart": "0",             "MRP": "25.00",             "VariantImagePath": null         }],         "SubCategoryID": "44",         "ProductImagePath": "/images/patanjali/1817.png",         "SubCategoryName": "Bathing Soap",         "BrandName": "Patanjali",         "ProductID": "2",         "BrandID": "112",         "ProductName": "Body Cleanser - Mogra"     }] }    And this logic for parsing the string.  try {     JSONObject jsonRootObject = new JSONObject(jsonStr);     //Get the instance of JSONArray that contains JSONObjects     JSONArray jsonArray = jsonRootObject.optJSONArray("products");     //Iterate the jsonArray and print the info of JSONObjects     //utility.displayToast(jsonArray.length() + " ");     for (int i = 0; i < jsonArray.length(); ++i) {         JSONObject jsonObject = jsonArray.getJSONObject(i);         int id = Integer.parseInt(jsonObject.optString("ProductID").toString());         String name = jsonObject.optString("ProductName").toString();         String imagePath = Utility.BASEURL + jsonObject.optString("ProductImagePath").toString();          int brandId = Integer.parseInt(jsonObject.optString("BrandID").toString());         String brandName = jsonObject.optString("BrandName").toString();          Brand b = new Brand(brandId, brandName, null);          JSONArray variantArray = jsonRootObject.optJSONArray("Variants");         ArrayList <ProductVariant> productVariant = new ArrayList<>();         for (int j = 0; j < variantArray.length(); ++j){             JSONObject variantObject = variantArray.getJSONObject(j);             int variantId = Integer.parseInt(variantObject.optString("VariantID").toString());             String variantName = variantObject.optString("VariantName");             Double variantMRP = Double.parseDouble(variantObject.optString("MRP").toString());             Double variantSellPrice = Double.parseDouble(variantObject.optString("SellPrice").toString());             Variant variant = new Variant(variantId, variantName);             ProductVariant pVariant = new ProductVariant(0, variantSellPrice, variantMRP, variant);             productVariant.add(pVariant);         }          Product p = new Product(id, name, imagePath, b, null, productVariant);         products.add(p);         } } catch (JSONException e) {     e.printStackTrace(); }   Code is giving NUllpointer exception error in this line  for (int j = 0; j < variantArray.length(); ++j){  Can anybody help me on this?

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


Not too sure where to start. Seems like it should be an easy adaptation of a theorem, but have't been able to find it in my notes. Thank you!

Let $(X, \|\cdot\|_X)$ be a normed vector space and $(X^{\ast},\|\cdot\|_{X^{\ast}})$ its dual space. I have to prove, that  $$ \forall x\in X:\quad \|x\|_X = \sup_{T\in X^{\ast}}\{|T(x)| : \|T\|_{X^{\ast}}=1\}$$  How can I show this using Hahn-Banach theorem?


I have a content type named myContentType with these columns  Title Person Age  If i change the name of these columns to this  Title = Hello Person = Jo Age = Agee  If i now create a subsite, these columns will have the first name/internal names, title, person and age. How can i fix this? I want to have  the new names.

Can we direct change it from sql database? if yes then how?  or  any other solution?


blinks orange three times then turns off  when pressing ps button,ps button with share, same thing happens.  when pressing reset button, same thing also happens.  dosent charge  does not connect  my controller wont charge, connect, wont reset... everytime i press the ps button with share or ps button itself, it blinks orange three times and turns off. same if i press reset button... pls help me...

I was playing my PS4 two days ago and then packed it up with two controllers that were both connected to this PS4.   I got to where I was going, set everything up and now the controllers won't connect. They show pulsing orange when they plug in, but when I hit the PS Button to connect, it blinks white 1-2 times and goes back to orange.   I have tried resetting them both.  Can anyone help?


Into how many chunks can one cut a round piece of cheese with n straight cuts?  Consider the $3D$ version  My try:   f(x) = number of pieces and $'x'$ as number of cuts.  $f(1)=2$  $f(2)= 2 + f(1)$   and therefore   $f(n) = n + f(n-1) $ and after solving the recurrence relation I got  $f(n) = [n^{2}+n+2]/2 $  Is this correct?

This is an extension of a .  How many pieces can one get at most if one cut a unit cube with n plane cuts?  1,2,4,8, ???  And assuming cutting through an area 1 takes time t, what is the least time needed to achieve the maximal pieces for n cuts, asymptotically?


I have declared a (5x6) list called path in Python as:  path = [[' ']*6]*5   Now, when I change the value of any one element as:  path[4][5] = '*'   or  path[0][5] = '*'   I get the output as:  [' ', ' ', ' ', ' ', ' ', '*'] [' ', ' ', ' ', ' ', ' ', '*'] [' ', ' ', ' ', ' ', ' ', '*'] [' ', ' ', ' ', ' ', ' ', '*'] [' ', ' ', ' ', ' ', ' ', '*']   That is, all the elements of the specified column get changed to '*'. Why does this happen? My guess is that maybe this has something to do with the way this short-hand notation is implemented in Python. Maybe the interpreter takes the first row and copies it down for all columns.

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


I just posted a question to  and afterward realized that it might not be answered very quickly due to how specific it was. So I also posted it on the   I plan to update both the SU and Ubuntu posts with the final answer I end up using, but I can't help but feel users from both places might not like that I've posted to both.  So my question is: Is it frowned upon to post the same question elsewhere and link to it?

I made a question at Stack Overflow long ago and also posted the same question in a non-Stack Exchange website (Xtreme VB Talk). The question .  According to the answer, I shouldn't have cross-posted between Stack Overflow and XtremeVBTalk, because     it increases the probability that wires will get crossed and everyone will waste time.   But I'm not sure why is that wrong. You see, I simply see Stack Overflow and XtremeVBTalk as two different communities with different users. So posting the question in both sites would just give me more answers. And if I got the answer in one of them, I would report back to the other site and let everyone know (and perhaps someone else would be benefited as well). I really doubt it is a waste of time - the more input, the better. The fact that someone was a user in both websites is simply a coincidence.  I realize that Meta Stack Exchange question  exists, but apparently it involves cross-posting within Stack Exchange sites, but this is about external websites instead.  I also realize that I was told that as "advice" (since my question was not flagged or anything), but well, I am now curious: Why would anyone consider this a bad practice?


As we use Lorentz transformation equation to relate velocity of particle measured by observer which is in frame s this frame is  in relative motion having some velocity to that particle so Why the speed of light is independent of the relative motion of observer?

I was told that the Galilean relative velocity rule does not apply to the speed of light. No matter how fast two objects are moving, the speed of light will remain same for both of them.   How and why is this possible?   Also, why can't anything travel faster than light?


I have write a code here and want to know that, is it good idea to put the return in finally statement? I have put the return statement in finally block because if exception occurred then also it will send the message. So, is this right approach to send the exception message to jsp page or Is their any another way to do it.  public JSONObject SetKeyFunctionDAO(JSONObject obj) throws SQLException      {         DatabaseConnection dc = new DatabaseConnection();         Connection con = dc.openConnection();         JSONObject res = null;         int n ;          String sql = " update data_table set mkey = ? where unique_user = ? and website_name = ? ;";         try          {             PreparedStatement ps = con.prepareStatement(sql);             ps.setString(1, obj.getString("key"));             ps.setString(2, obj.getString("uniqueID"));             ps.setString(3, obj.getString("account"));              n = ps.executeUpdate();             res = new JSONObject();             if(n != 0)             {                 res.put("status", "success");             }             else             {                 res.put("status", "failed");             }         }         catch (SQLException ex)         {            res = new JSONObject();            res.put("status", "failed");            res.put("exception", ex);         }          catch (JSONException ex)          {             res = new JSONObject();             res.put("status", "failed");             res.put("exception", ex);         }         finally         {             dc.closeConnection();             con.close();             return res;         }     }   Thanks in Advance!!

I was surprised recently to find that it's possible to have a return statement in a finally block in Java.  It seems like lots of people think it's a bad thing to do as described in ''. Scratching a little deeper, I also found '' which shows some pretty horrible examples of other types of flow control in finally blocks.  So, my question is, can anyone give me an example where a return statement (or other flow control) in a finally block produces better / more readable code?


Pi is defined as the ratio of $\frac{c}{r}$. Many ancient scintist try to find the value of pi. Some of the values are $\frac{22}{7}$(good hold upto 10 decimal point), $\frac{355}{113}$ (good hold upto 63 Decimal point).  modern computer determine upto million decimal point.   my qustion is that how ( algorithm  or formula ) modern computer find the value of pi ?

Since Pi or $\pi$ is an irrational number, its digits do not repeat. And there is no way to actually find out the digits of $\pi$ ($\frac{22}{7}$ is just a rough estimate but it's not accurate). I am talking about accurate digits by either multiplication or division or any other operation on numbers.  Then how are the first digits of $\pi$ found -     3.1415926535897932384626433832795028841971693993...   In fact, more than 100,000 digits of $\pi$ are found (sources - )  How is that possible? If these digits of $\pi$ are found, then it must be possible to compute $\pi$ with some operations. (I am aware of breaking of circle into infinite pieces method but that doesn't give accurate results.)  How are these digits of $\pi$ found accurately? Can it be possible for a square root of some number to be equal to $\pi$?


The following packages have unmet dependencies:  account-plugin-facebook : Depends: libaccount-plugin-generic-oauth but it is not going to be installed or                                     ubuntu-system-settings-online-accounts but it is not going to be installed  gvfs-daemons : Depends: x11-utils  indicator-bluetooth : Depends: unity-control-center but it is not going to be installed or                                 gnome-control-center but it is not going to be installed or                                 ubuntu-system-settings but it is not going to be installed  libqt5feedback5 : Depends: libqt5multimedia5 (>= 5.0.2) but it is not going to be installed  yelp : Depends: libwebkitgtk-3.0-0 (>= 1.3.10) but it is not going to be installed         Depends: libyelp0 (= 3.10.2-0ubuntu1) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. E: Internal error, Upgrade broke stuff   How do I remove this error?  I'm new to Ubuntu so please give the details in the answer.  What kind of error is this and why does it occur?

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I saw some code that happened in javascript:  var date = +new Date(); //same as 'var date =+ new Date();'   and it gave me a number: 1441863253753 The previous programmer was using this to store unique ids  when I remove the + :  var date = new Date();   it gave me: "Thu Sep 10 2015 01:36:13 GMT-0400 (Eastern Daylight Time)"  can someone tell me what's going on?  I've seen +=, but never =+

I've seen this in a few   function fn() {     return +new Date; }   And I can see that it is returning a timestamp rather than a date object, but I can't find any documentation on what the plus sign is doing.  Can anyone explain?


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

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


I am an Indian citizen holding a regular passport, can I apply for a Schengen visa from within the UK?

We are Indians and will be visiting UK on short-stay visas for about five months.  Can we apply for Schengen tourist visas while we are in London?


So far I've studied a lot of courses like Algebraic topology, Homological Algebra, Differential Geometry and Manifolds but I've never studied Number theory and I am going to be enrolled to a master programme that includes in its curriculum the courses Algebraic Number theory and Arithmetic Geometry. I would like recommendations of number theory books (ideally with solved exercises) that build solid background for these two courses. Thank you very much in advance!

What would be a good book to learn basic number theory? If possible a book which also has a collection of practice problems? Thanks.


lshw says my hdd is ATA disk, and bus info is scsi    *-disk                          description: ATA Disk        product: WDC WD2500BEVS-0        vendor: Western Digital        physical id: 0        bus info: scsi@0:0.0.0        logical name: /dev/sda   I googled WD2500BEVS-0, and  says my hdd is SATA.  So I wonder which is my hdd interface type:   ATA i.e. PATA, IDE SCSI SATA?   Why do I have different information? Thanks.

I have 3 SATA devices on my system. They show up under /proc/scsi/scsi, although these are not SCSI devices. Why do my SATA devices show up under the SCSI directory?  $ cat /proc/scsi/scsi  Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00   Vendor: ATA      Model: WDC WD2500AAJS-6 Rev: 01.0   Type:   Direct-Access                    ANSI  SCSI revision: 05 Host: scsi1 Channel: 00 Id: 00 Lun: 00   Vendor: TSSTcorp Model: CDDVDW TS-H653Z  Rev: 4303   Type:   CD-ROM                           ANSI  SCSI revision: 05 Host: scsi4 Channel: 00 Id: 00 Lun: 00   Vendor: ATA      Model: ST3320620AS      Rev: 3.AA   Type:   Direct-Access                    ANSI  SCSI revision: 05


I'm working through a proof of Amitsur's Theorem, that if $\mathbb{K}$ is a field and $A$ a $\mathbb{K}$-algebra with $\dim_{\mathbb{K}}A<|\mathbb{K}|$, then $J(A)$ (the Jacobson radical) is nil (all it's elements are nilpotent). We let $a\in J(A)$. In the final step of the proof, we arrive at $$ 0 = a^k\underbrace{(b_0 + b_1a + ... + b_m a^m)}_{=: p(a)},\quad b_i\in\mathbb{K}, b_0\neq 0 $$ My prof says $p(a)$ is invertible "since each $b_i$ is a unit", but I fail to see how this is true. Is it true, in general, that if each $u_i$ is a unit of a ring $R$, and each $u_i$ commutes with $a$ along with every other $u_j$, then $u_0 + u_1a + \cdots + u_n a^n$ is also a unit? I know that if $u\in R^\times$, $a\in R$ is nilpotent, and $ua = au$, then $u + a\in R$, but this cannot be applied in our case as we cannot assume a priori that $a$ is nilpotent (this is what we are trying to show). If the general statement is false, what could be "special" about our $p(a)$ above which guarantees it's a unit?

Let $R$ be a commutative domain.   Prove that the Jacobson radical of $R[X]$, i.e. the intersection of all maximal ideals, is the zero ideal.  Thank you.


some country use Monday as the first day in a week, some country use Sunday.  in C#/.Net, the library Globalization can determine current webpage open in different country, but I didn't find any useful method for determine the which country use which day as start of week.

How do I find the start of the week (both Sunday and Monday) knowing just the current time in C#?  Something like:  DateTime.Now.StartWeek(Monday);


I have to solve a series of limits and I can't find out this one. $$\lim_{n\to+\infty} \sqrt{n}(\sqrt[n]{x}-1)= \,?$$ I have the feeling that this is equal to $0$, but I don't know how to prove it. Note that it may be a good idea to use $\lim_{x\to+\infty} \sqrt[n]{x}=1$.

$$\lim_{n\to\infty}\sqrt n(\sqrt[n]x-1)$$ I have never previously encountered functional sequences, so I am a newbie in this matter. I know that intuitively, $x^{1/n}\to1$ and that $\infty\cdot0=1$. As a result, the limit should be 1. However, can this reasoning be considered correct and rigorous enough? I'm pretty sure that if I write this in my first year bachelor exam, my answer will be considered incorrect.   What is the more formal way of doing this? (I think that the squeeze theorem should work, but can't choose suitable bounds). Thanks in advance.


I have a problem calculating the electrostatic potential energy.  I rely on these equations coming from mechanics:  \begin{equation} U_{B}-U_{A} = -W_{A \ \rightarrow \ B} (done\ by \ the \  field \ force) \end{equation}  \begin{equation} U_{B}-U_{A} = W_{A \ \rightarrow \ B} (done\ by \ the \ opposite \ force) \end{equation}  According to the next picture   Work done by the coulomb force (field force) is:  \begin{equation} W= \int_{A}^{B}  \! \vec{F}.\,\vec{dr} \end{equation}  According to the picture  \begin{equation} F = \frac{q_{1}q_{2}}{4\pi e_{o} x^{2}} \vec{i} \end{equation}  \begin{equation} \vec{dr} =- dx \vec{i} \end{equation}  Therefore:   \begin{equation} W= \int_{A}^{B}  \! \vec{\frac{q_{1}q_{2}}{4\pi e_{o} x^{2}} \vec{i}}.\,(- dx \vec{i})  \end{equation}  let  $B=r$ and A=$\infty$ be \begin{equation} W= -\int_{\infty}^{r}  \! \frac{q_{1}q_{2}}{4\pi e_{o} x^{2}} \, dx  \end{equation}  Let  $B=r$ and A=$\infty$  be \begin{equation} W= \frac{q_{1}q_{2}}{4\pi e_{o} } (\frac{1}{x} from\ \infty \ to \ r ) \end{equation}  Then:  \begin{equation} W= \frac{q_{1}q_{2}}{4\pi e_{o} r}  \end{equation}  When I put this result into equations at the top:  \begin{equation} U_{B}-U_{A} = -\frac{q_{1}q_{2}}{4\pi e_{o} r}  \end{equation} As $U_{A} =0$ Finally:  \begin{equation} U_{B} = -\frac{q_{1}q_{2}}{4\pi e_{o} r}  \end{equation} It turned out the potential energy is negative, but it is suppose to be positive since a external force is putting energy into the system. I don't know where my mistake is!

Let there be a hollow sphere (Throughout the question we will ignore the thickness of the sphere) which is positively uniformly charged,q of radius,  R. Suppose there to be a test positive charge, q' at point P which is r distance away from the hollow sphere(r>R, P is outside of hollow sphere).  Now I have an doubt on evaluating Electric Potential,V at point P.  Both source charge,q and test charge,q' are +ve, so source charge will repel the test charge which will make the charge, q' to go to infinity.I have to apply external force, F' to displace the charge, q' from infinity to point P against the equal but repulsive force, F.In short, F' is  displacing the q' from infinity to P.  So External Force, F' will do +ve work and Repulsive Force, F will do -ve work. This way the Electric Field,E produced by hollow sphere is Opposite to Displacement of test charge(i.e.,θ=180).  Now we know that E=k(q/(r^2))  [Please Notice that infinity is the lower limit of integration]  Also V=-∫r∞(E dr cosθ)=-∫r∞(E dr cos 180)=∫r∞(E dr)  At last I ended up to V=- k(q/r). I know that V=k(q/r).  I just want to know why I am having this shitty negative sign in my equation.


In Linux, a kernel thread have a PID:    Why is that? Is a kernel thread considered to be a process? And does a "normal" thread also have a PID?

I'm going through , Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel. It's from 2001, so a bit old. But I find it quite good anyhow.  However, I got to a point when it diverges from what my Linux produces in the shell output. On page 92 (116 in the viewer), the chapter 4.5 GNU/Linux Thread Implementation begins with the paragraph containing this statement:     The implementation of POSIX threads on GNU/Linux differs from the   thread implementation on many other UNIX-like systems in an important   way: on GNU/Linux, threads are implemented as processes.   This seems like a key point and is later illustrated with a C code. The output in the book is:  main thread pid is 14608 child thread pid is 14610   And in my Ubuntu 16.04 it is:  main thread pid is 3615 child thread pid is 3615   ps output supports this.  I guess something must have changed between 2001 and now.  The next subchapter on the next page, 4.5.1 Signal Handling, builds up on the previous statement:     The behavior of the interaction between signals and threads varies   from one UNIX-like system to another. In GNU/Linux, the behavior is   dictated by the fact that threads are implemented as processes.   And it looks like this will be even more important later on in the book. Could someone explain what's going on here?  I've seen this one , but it doesn't help much. I'm confused.  This is the C code:  #include <pthread.h> #include <stdio.h> #include <unistd.h>  void* thread_function (void* arg) {     fprintf (stderr, "child thread pid is %d\n", (int) getpid ());     /* Spin forever. */     while (1);     return NULL; }  int main () {     pthread_t thread;     fprintf (stderr, "main thread pid is %d\n", (int) getpid ());     pthread_create (&thread, NULL, &thread_function, NULL);     /* Spin forever. */     while (1);     return 0; }


I am new to Linux in general. As I am sure is the case with many of the new converts, I have an old XP machine that is getting slow and about to be unsupported so I decided to test the waters. I installed 13.10 along side XP only to find that my graphics chip doesn't support the Unity interface upgrade in 13.10 (no launcher, icons, etc). I did download 12.04 after the fact and confirmed that its interface does work (ran it from a flash drive). As I see it, I have 2 options: try to downgrade (which is officially unsupported) or remove 13.10 and install 12.04 fresh.  I looked up the process on removing 13.10, which is pretty simple (wipe out the partitions containing Ubunutu), but it also takes GRUB with it. I downloaded and tried to run EasyBCD to restore the master boot record, but it does not support XP Home. I don't have the original XP disc to repair it via that avenue either. Do I have any other options here that I don't know about? Thanks!

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


git log shows something like this:  commit hash3 New feature  commit hash2 bugfix  commit hash1 Initial commit   I want to squeeze first two commits, into one "Initial commit", to clean history. If i do:  git rebase -i hash1   It doesn't show first commit, so that I could squeeze bugfix commit into it. If i mark bugfix commit with "s", it says there is no previous commit to squeeze to. So how do i make git rebase -i, so that it shows whole history, including the first commit, so i could squeeze it?  I know I can just remove repository, make new one and have one single commit, but i do want to have commits "initial commit" and "new feature" in history.   Thank you!

Suppose you have a history containing the three commits A, B and C:  A-B-C   I would like to combine the two commits A and B to one commit AB:  AB-C   I tried  git rebase -i A   which opens up my editor with the following contents:  pick e97a17b B pick asd314f C   I change this to  squash e97a17b B pick asd314f C   Then Git 1.6.0.4 says:  Cannot 'squash' without a previous commit   Is there a way or is this just impossible?


I want to install metatrader through wine but they say that there's a firewall so they keep asking for proxy server option. How i allow it to install?

I am trying to install  under Wine. The program setup continually requests proxy settings. My broker tells me this shouldn't happen, and is a problem on my end. Here is what I have tried to attempt to solve this error:   I have gone into Network settings and proxy is set to none. I have looked in Wine Regedit and proxy_enable is set to 0. I have checked the firewall settings on my modem. I have tried reinstalling wine. I have installed lib32nss-mdns I can log on to my modem in iexplore using the gateway ip but thats it I've set my DNS to 10.0.0.138 to reflect the gateway I've set up a 32 bit Wine prefix   How should I proceed in solving this?


I have surprisingly made the experience that you don't get back your reputation points if the bounty ends and no one has answered your question.   Even if you find an answer yourself before the bounty ends, and mark it as answer you're not getting your reputation points back.  Why is this so? Is it a bug or is it done intentionally? In my opinion, it would be good to redeem the credits to someone if he/she comes up with an answer finally.

Consider this question on .  I put out a 200 bounty on the question, but did not get an answer from anyone other than myself that worked.    In fact, my answer is also the highest up-voted on it at this point.  I know that allowing OP's to retract a bounty can be a slippery slope; in fact I think that once the bounty is put up it should stay up.  But why not allow the OP to answer their own questions with a bounty and reward it to them if they receive the same up-votes as others?  Yes, I am fully aware that bounties are a risk.  People will use them for numerous reasons such as trying to draw extra attention to their issues.  However, in my specific question, the only valid answer is the one that I gave.  Had it been anyone else's question, I would have received the bounty, but since it was my own I did not.


Does a Lebesgue-measurable Subset $M \subseteq \mathbb R$ exist, so that $\lambda^{1}(M \cap I)= \frac{1}{2}\lambda^{1}(I)$ for any bounded Interval $I\subseteq \mathbb R$.  My idea:   Assume that such a lebesgue-measurable set $M$ did exist, it then follows that for any $\epsilon > 0$ we can find $O_{\epsilon}$ open and $C_{\epsilon}$ closed so that $\lambda^{1}(O_{\epsilon} \setminus C_{\epsilon})< \epsilon$ and $C_{\epsilon} \subseteq M \subseteq O_{\epsilon}$  it then follows for arbitrary bounded sets $I$ that $\lambda^{1}(C_{\epsilon}\cap I)\leq \frac{1}{2} \lambda^{1}(I)\leq \lambda^{1}(O_{\epsilon}\cap I)$  I am struggling to find any contradictions that I can use. Any ideas?

Is there a measurable set $A$ such that $m(A \cap B)= \frac12 m(B)$ for every open set $B$?  Edit: (t.b.) See also  for further answers.


Im working on GUI project(python) and want to control another program with its CLI.exe. So i need to feed some input and receive output from that CLI.exe. How can i do this ?

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?


i'm trying to count a notification from OneSignal, and make it display in the badge, but i still getting this error. What's wrong with my code?  public class HomeActivity extends AppCompatActivity implements NetworkBroadcastListener.iNetStats, iNotif {  Context context; SharedPref spref; TextView notif_badge;  protected void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);         OneSignal.startInit(this).init();         setContentView(R.layout.activity_home);  notif_badge = findViewById(R.id.cart_badge);         setupBadge();    private void setupBadge() {         int counter = spref.GetInt(localPref.TOTALNOTIF);         context=this;         spref = new SharedPref(this);         notif_badge.setText(String.valueOf(Math.min(counter,99)));     }   Here is my OneSignal ReceiveHandler  public class NotifReceivedHandler implements OneSignal.NotificationReceivedHandler {      Context context;      SharedPref spref;      public NotifReceivedHandler(Context context){         this.context = context;         spref = new SharedPref(context);     }      @Override     public void notificationReceived(OSNotification notification) {         Intent intent = new Intent();         intent.setAction("com.x.x.NOTIFICATION");         intent.putExtra("body",notification.payload.body);         intent.putExtra("title",notification.payload.title);         LocalBroadcastManager.getInstance(context).sendBroadcast(intent);         spref.AddInt(localPref.TOTALNOTIF,spref.GetInt(localPref.TOTALNOTIF)+1);     } }

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


The following packages have unmet dependencies:  vlc : Depends: vlc-nox (= 2.1.4+git20150226+r54594+19+11~ubuntu14.04.1) but it is not going to be installed        Depends: libsdl-image1.2 (>= 1.2.10) but it is not installable        Depends: libtar0 but it is not installable        Depends: libva-x11-1 (> 1.3.0~) but 1.0.15-4 is to be installed        Depends: libva1 (> 1.3.0~) but 1.0.15-4 is to be installed        Depends: libvlccore7 (>= 2.1.0) but it is not going to be installed        Recommends: vlc-plugin-notify (= 2.1.4+git20150226+r54594+19+11~ubuntu14.04.1) but it is not going to be installed        Recommends: vlc-plugin-pulse (= 2.1.4+git20150226+r54594+19+11~ubuntu14.04.1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.  I tried  sudo apt-get install -f sudo apt-get update sudo apt-get upgrade sudo apt-get purge vlc vlc-nox libsdl-image1.2 libtar0 libva-x11-1 libva1 libvlccore7 vlc-plugin-notify vlc-plugin-pulse   But the error remains. VLC is not the only thing. many other packages I try to install gave me similar dependency errors which I finally gave up installing. I have been using Ubuntu for a while now. I just don't understand why this happens every now and then. Please help ... EDIT: Output of apt-cache policy vlc vlc-nox libsdl-image1.2 libtar0 libva-x11-1 libva1 libvlccore7   vlc:   Installed: (none)   Candidate: 2.1.4+git20150226+r54594+19+11~ubuntu14.04.1   Version table:      2.1.4+git20150226+r54594+19+11~ubuntu14.04.1 0         500 http://ppa.launchpad.net/videolan/stable-daily/ubuntu/ trusty/main i386 Packages vlc-nox:   Installed: (none)   Candidate: 2.1.4+git20150226+r54594+19+11~ubuntu14.04.1   Version table:      2.1.4+git20150226+r54594+19+11~ubuntu14.04.1 0         500 http://ppa.launchpad.net/videolan/stable-daily/ubuntu/ trusty/main i386 Packages libsdl-image1.2:   Installed: (none)   Candidate: (none)   Version table: libtar0:   Installed: (none)   Candidate: (none)   Version table: libva-x11-1:   Installed: (none)   Candidate: (none)   Version table: libva1:   Installed: (none)   Candidate: (none)   Version table: libvlccore7:   Installed: (none)   Candidate: 2.1.4+git20150226+r54594+19+11~ubuntu14.04.1   Version table:      2.1.4+git20150226+r54594+19+11~ubuntu14.04.1 0         500 http://ppa.launchpad.net/videolan/stable-daily/ubuntu/ trusty/main i386 Packages

This is what happens:  sudo apt-get install vlc Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package vlc   Please help. I would also like to know when this error occurs, I've seen it before too.


I'm using LaTeX to draft a journal paper and I'm writing with TeXMaker. To make the navigation easier, I broke down the paper into several .tex files. The master .tex file looks like this:  \section{Introduction} \input{introduction.tex} \section{Method} \input{method.tex} ...   The journal to which I am submitting the draft (FYI I refer to Physical Review E) requires me to submit only one .tex file, meaning that I am not allowed to use \input. For the first submission I just manually copied and pasted all the contents of separate .tex files into the master .tex file. Since it's likely that there will be several revisions before the paper is accepted, I would like to keep the separate .tex files structure to make revision easier.   Therefore, my question is: Is there an automatic way (scripts, special program, etc.) to combine those separate .tex files into one single master .tex file? or better yet, a way to switch between having separate .tex files and having one single master .tex file?

Suppose I have a document with multiple include or input statements  \input{fileA} \input{fileB}   etc.   Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the actual content of fileA etc. without copying it manually?


I'm having a problem swapping two strings in my array. Let's say Array[0] is "Daniel" and Array[1] is "Paul", how do you go about switching them?  This is my code and it just throws a bunch of errors at me.  public void swap() {     String name1;     String name2;     String temp1;     String temp2;     System.out.print("\nWhich person would you like to swap?: ");     name1 = input.next();     System.out.print("Who are they swapping with?: ");     name2 = input.next();      for (int i = 0; i <= 10; i++)     {         if(seats[i] == name1)         {             temp1 = name1;             temp2 = name2;             name1 = temp2;             name2 = temp1;               return;         }     }      System.out.println(name1 + " and " + name2 + " have been swapped.\n"); }   Any help would be greatly appreciated, thanks in advance.

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


If the big bang was the birth of everything, and the big bang was an event in the sense that it had a location and a time (time 0), wouldn't that mean that our universe has a center?  Where was the big bang? What is there now? Are we moving away from the center still? Are these even valid questions?

TV documentaries invariably show the Big Bang as an exploding ball of fire expanding outwards. Did the Big Bang really explode outwards from a point like this? If not, what did happen?


A uniform, flexible chain of length $l$, mass $m$, hangs off a frictionless table-top of height greater than $l$. The length of the part of rope hanging off is $x$. Gravity accelerates the part of the rope that is hanging off, so the length of the hanging part increases, i.e. $x$ is a function of time t. Define $y:=x/l$. The kinetic energy of the system is $$T=\frac{1}{2}m\dot x^2=\frac{1}{2}ml^2\dot y^2,$$ and the potential energy is  $$V=-(my)(g)(\frac{1}{2}x)=-\frac{1}{2}mgly^2.$$ Using Lagrange equation   $$\frac{d}{dt}\left( \frac{\partial L}{\partial \dot y}\right)=\frac{\partial L}{\partial y}$$  with $L=T-V$, we obtain $$l^2\ddot y=gly,$$ and hence $$\ddot x=\frac{g}{l}x.$$ Now assume that friction coefficient between the chain and the table top is $\mu\ne0$. Using above result and $F=ma$, it is very easy to show that the new equation of motion is  $$\ddot x=\frac{g}{l}x-\frac{l-x}{l}\mu g.$$ How can we use only Lagrangian method to find the equation of motion so it accommodates the friction?

I am trying to write the Lagrangian and Hamiltonian for the forced Harmonic oscillator before quantizing it to get to the quantum picture. For EOM $$m\ddot{q}+\beta\dot{q}+kq=f(t),$$ I write the Lagrangian  $$ L=\frac{1}{2}m\dot{q}^{2}-\frac{1}{2}kq^{2}+f(t)q$$ with Rayleigh dissipation function as   $$ D=\frac{1}{2}\beta\dot{q}^{2}$$ to put in Lagrangian EOM $$0 = \frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial L}{\partial \dot{q}_j} \right ) - \frac {\partial L}{\partial q_j} + \frac {\partial D}{\partial \dot{q}_j}. $$  On Legendre transform of $L$, I get $$H=\frac{1}{2m}{p}^{2}+\frac{1}{2}kq^{2}-f(t)q.$$  How do I include the dissipative term to get the correct EOM from the Hamiltonian's EOM?


I saw this monitor clamp crush a hollow Ikea desk:  To prevent this, the load of the clamp should be spread. But spread how? Say I had a 1.5mm thick sheet of steel.  If I placed it here, would the same thing have happened, but this time the crack would have run along the long side of the steel sheet? Does the fact the width of the steel doesn't go past the front of the clamp make a difference?    If I moved it forward slightly, I predict it would have prevented damage to the desk. But why? Isn't the load spread amongst the same amount of surface area compared to the above image?    Would it make a difference if the steel sheet was placed like this? I think the steel sheet would have a sort of lever effect as the centre of gravity is closer to the area covered by the steel sheet load spreader    Does the tightness of the clamp affect anything? eg loose clamp, exaggerated for effect, the two red dots are where the force is concentrated:   tight clamp, the red lines are where the force is spread:  Or would there still be a concentration of force at the red dots as the monitor moves the centre of gravity and adds a torque effect? This question is not the same as  ; that question asks how, this question is more specific as it asks why.

I have  which I use for my computer. It currently holds two 27" monitors. The monitors are too low for my eyesight, so I bought  to hold them up and free some space underneath. I was reading a bit about how strong the desk is, and it looks like the desk is likely too weak for the weight to be put on one 5cm x 5cm spot on the desk, due to the wooden panel's structure:  So I need something to distribute the load across a larger surface of the desk. Probably something that's tough enough to actually distribute the load as opposed to something weak that will bend and just pass the load on the spot. I'm not very experienced with DIY projects, any idea what I could use? (I'm in London, UK, if it helps)


I am new to this one I need to parse json for Question and Answer Bank and set data in Custom ArrayList I unable to set the data using getter and setter.  My First Class  //Custom ArrayList ArrayList<DataBO> dt=new  ArrayList<DataBO>();  //Class With Getter Setter      public class DataBO     {          **public Questions[] Questions;**           public String PointsCanBeEarnedMsg;          public String ContentUrl;          public String getPointsCanBeEarnedMsg ()         {             return PointsCanBeEarnedMsg;         }          public void setPointsCanBeEarnedMsg (String PointsCanBeEarnedMsg)         {             this.PointsCanBeEarnedMsg = PointsCanBeEarnedMsg;         }          public String getContentUrl ()         {             return ContentUrl;         }          public void setContentUrl (String ContentUrl)         {             this.ContentUrl = ContentUrl;         }          public Questions[] getQuestions ()         {             return Questions;         }          public void setQuestions (Questions[] Questions)         {             this.Questions = Questions;         }       }   2nd Class for Question Array      public class Questions     {         public String CorrectOptionCount;          public String QuestionId;          public String QuestionString;      public String getCorrectOptionCount ()     {         return CorrectOptionCount;     }      public void setCorrectOptionCount (String CorrectOptionCount)     {         this.CorrectOptionCount = CorrectOptionCount;     }      public String getQuestionId ()     {         return QuestionId;     }      public void setQuestionId (String QuestionId)     {         this.QuestionId = QuestionId;     }      public String getQuestionString ()     {         return QuestionString;     }      public void setQuestionString (String QuestionString)     {         this.QuestionString = QuestionString;     }      public Options[] getOptions ()     {         return Options;     }       }   These   Questions [] qs=new  Questions[len]; qs[i].setQuestionId(data);   are not working, getting NullPointer Exception??? How to add data in Questions  after that in ArrayList??


I'm using Chrome, version 37.0.2062.124 m, and FireFox 22.0 and the computation gives me wrong result:  5*0.1 //the result is 0.5 6*0.1 //the result is 0.6000000000000001, it should be 0.6 7*0.1 //0.7000000000000001 8*0.1 //0.8   If possible to answer, how did they come up with this? If not, is there any library that does the job? I don't need new data type, float is enough, I just want this to get the correct result.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


The question is how to factor an identity.  The identity is shown below but it uses $f(x)$ as defined in Theorem 5.21, so let me show $f$'s definition first.  In the proof, we eventually get to this identity:  We have two equations there.  I'm good with the first.  Just expanding it out makes it obvious.  My problem is on the second equation.  By taking the expansion and factoring $x$ on all non-$x_0$ terms, I get $$x(c_n x^{n-1} + \cdots + c_2 x + c_1).$$ Similarly for $x_0$, $$x_0(c_n x_0^{n-1} + \cdots + c_2 x_0 + c_1).$$ Question.  How can I use these two expressions and get the second equation in the identity? If I let $g(x) = (c_n x^{n-1} + \cdots + c_2 x + c_1)$, then I have $g(x)$ in the first expression above and $g(x_0)$ in the second.  These are not the same, so I'm puzzled as how this is allowed.

In respect to a larger proof I need to prove that $(n-m) \mid (n^r - m^r) $ (where $\mid$ means divides, i.e., $a \mid b$ means that $b$ modulus $a$ = $0$). I have played around with this for a while now but to no avail and would be grateful if you could help me.


How can I express a countable noun together with its irregular plural form? For example, we may have the following sentence:     Find all critical point(s) of this function.   Since we do not know if the function has one or more critical points, we use the expression "point(s)".  What if the noun has an irregular plural form?  For example, should one say     Find all maximum/maxima of the function.   instead of using the parenthesis as we did in "point(s)"?

What happens if you have a written phrase like     We were looking at the same poster(s).   but with a noun that has an irregular plural? E.g. with baby/babies, would this be the correct form?     We were looking at the same baby(ies).   Or, as a more exotic case:     We were looking at the same matrix(???). (plural is matrices)   Is there a rule or guideline for this?


Does $F$ is an isomorphism $\implies F^{-1}$ is an isomorphism?  Let $\mathfrak{D, E} $ be some algebraic structures of the same 'kind' (say, groups, graphs, fields, vector spaces, etc.), and $F:\mathfrak D \to \mathfrak E$ is an isomorphism, is there any way to prove that $F^{-1}:\mathfrak E \to \mathfrak D$ is an isomorphism?  By isomorphism I mean a bijection that preserves whatever structure $\mathfrak D$ and $\mathfrak E$ have, clearly $F^{-1}$ is a bijection, so the important part is if it is a structure preserving map.

$F$ is an isomorphism from group $G$ onto group $B$. Prove $F^{-1}$ is an isomorphism from $B$ onto $G$.  I do not know which direction to go in.


Say I have an many html elements, a row in a table composed of table data () tags.  foo	 bar	 baz	   How would I return the id of the td that was clicked. I know that I should make them links so that I can click on them properly, but just for this case I don't want to put links.  $("td").click(function () {   id = //The ID finder goes here   clickFunction(id)  }   I was thinking this is how it would be formatted. JQuery would attach an onclick event listener to any table data tags and when it fired, a function would run with the id of the table data element that was clicked.

Is there any way to get the ID of the element that fires an event?  I'm thinking something like:    $(document).ready(function() {   $("a").click(function() {     var test = caller.id;     alert(test.val());   }); }); <script type="text/javascript" src="starterkit/jquery.js"></script>  <form class="item" id="aaa">   <input class="title"></input> </form> <form class="item" id="bbb">   <input class="title"></input> </form>     Except of course that the var test should contain the id "aaa", if the event is fired from the first form, and "bbb", if the event is fired from the second form.


The formula $\exists x[x=a]$, where $a$ is a constant, is always valid in first-order logic. See discussion and proof . The formula $\exists x[f(x)=a]$ is not valid, since the universal set, defined as the set that contains all elements, does not exist. Discussion . Now, I would like to know if the formula $\exists y[y=f(a)]$ is valid. Since $y$ belongs to the universal set, I would assume we can substitute it by $f(a)$ and since $f(a)=f(a)$, the formula is valid. If that's the case, I infer that the formula $\exists y[f^{-1}(y)=a]$ is valid as well.

Under , is $\exists x(x=a)$ true in every interpretation in first order logic (FOL) with equality? If so, could $\exists x(x=a)$ be considered a tautology? This question was motivated by  which was closed for lacking clarity. Here I have attempted to add that clarity myself so that the same question can be useful to others who are wondering a similar thing. This is a self answer question.


I am trying to center vertically and horizontally an image with variable width and height, maxing at 1000px. I archived vertical center but I am unable to add horizontal center without breaking vertical... Here is my code:

Best way to center a <div> element on a page both vertically and horizontally?  I know that margin-left: auto; margin-right: auto; will center on the horizontal, but what is the best way to do it vertically, too?


If $n\ge 0$, show $\sum_{k=0}^{n}  \binom{x+k}{k} = \binom{x+n+1}{n}$. Think as uses a well ordered set of naturals, induction can be used. Base case: $n=1$ Involves only single term, so trivial. Induction hypothesis: it is true for natural number $n$. So, $\sum_{k=0}^{n}  \binom{x+k}{k} = \binom{x+n+1}{n}$. Inductive step: need show for next natural $n+1$ $\sum_{k=0}^{n+1} \binom{x+k}{k} = \binom{x+n+1}{n} + \binom{x+n+1}{n+1} $. This should lead to : $\sum_{k=0}^{n+1} \binom{x+k}{k} = \binom{x+n+1}{n} + \binom{x+n+1}{n+1} \implies \binom{x+n+2}{n+1}$. Taking the LHS, get: $\binom{x+n+1}{n} + \binom{x+n+1}{n+1} = \frac{(x+n+1)!}{(n)! \, (x+1)!} + \frac{(x+n+1)!}{(n+1)! \, (x)!}$ Please help to proceed further, or suggest alternative approach.

Let $n$ be a nonnegative integer, and $k$ a positive integer. Could someone explain to me why the identity $$ \sum_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k} $$ holds?


My company is trying to improve the UX in our system. It's web based app, full with features.  The system development started 8 years ago, but it was never documented, and our programmers/support team can't remember every small thing about the features, that causes our clients who need support to wait while we dig into the source code to find things.  We want to document it, first for ourselves but later to publish some parts of it to our clients.  Since it's a big app, going through everything without a system/app could take forever and we probably won't be able to cover everything.   I was wondering if anyone knows about such system/app?  I need it to be easy to use for out support/sales teams and for the users but also efficient for the documenting process.

This is probably wishful thinking but here goes...  Now obviously I don't expect some magical app to crawl a website, summarise each page and detail all the assets within each page (if only!) however is there a crawler of some sort that will trawl a given website and produce a full set of links and respective hierarchy would be invaluable. That would ensure that no pages get missed out as they invariably would through a purely manual inventory.  From there I would be able to see the existing site hierarchies and taxonomy decisions that have been made when building the site, and could use this as the basis for creating a detailed website content inventory.  Whether this be an online application, script or even a useful manual technique other than just manually sitting at the site and following links would be great.


On vanilla 14.04:   run aptitude chose package redmine see broken conflicting package problem (something with ruby-rack)   How can I deal with it?

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


With conventional cameras your camera had a maximum shutter speed ( typically 1600 ), and the film you used had an ISO speed rating at which it was meant to be able to get a proper exposure under "normal" lighting conditions.  Essentially this was a way of rating the sensitivity of the film.  While you can push a given film to a higher than rated speed, unless you have lots of light, the quality of the picture is going to suffer due to being underexposed.  Why do digital cameras not seem to be given an ISO rating?  It looks like the manufacturers are trying to misrepresent the maximum shutter speed as an ISO rating and make ludicrous claims with very high numbers for the sake of specsmanship, but trying to use those high speeds invariably results in terrible, underexposed pictures ( due to the very small dynamic range that has to be highly amplified to get anything at all ).  One manufacturer could have a terrible sensor but push the maximum shutter speed to 100,000, and you're not really going to be able to use anything more than 200 in lower light conditions, while another could only have a maximum shutter speed of 3200, but you can actually use it at 1600 in low light and not get underexposed pictures.  How can you tell the difference?

If I understood correctly, base ISO is in full stop steps from the lowest possible ISO setting on my camera. For example if the lowest setting on my camera is ISO 100, than the following table would be base ISO:    100, 200, 400, 800, 1600, 3200, 6400   While steps in between like   125, 160, 250, 320, 500, 640, 1000, 1300, 2000, 2500, 4000, 5000   would be third-stop "pulled" values, which result more noise than perhaps higher base ISO values (for example 2500 is worse than 3200).   Did I get this right or missed by a mile, what did I miss? Do non-base ISO values generate more noise than next higher base-value ISO stop? How do I find what are my base-value ISO stops (is it the lowest ISO value multiplied by 2n)?


A few minutes ago, I submitted an answer on the question . When the page refreshed, I saw that the question had already been put on hold at 2013-11-25 16:16:02Z, while the answer was submitted at 2013-11-25 16:17:03Z.  I am not sure why this happened. Is it because I had typed in the answer a long time before it was put on hold, and the draft's save time was before the hold time? (I was waiting for the user to reply to my comment before submitting the answer, but got tired of waiting and just hit submit.) Or is it because the version of the page I was on had not registered that the question was on hold?  Either way, I do not think that the answer should have been able to be posted, and I think it is a bug that it did.

The question,  was closed at 04:50  And yet I was able to  at the time of 08:41 some four hours later.  The question was later reopened at 08:57


I just click tab to go to edit mode and the object disappears.  There aren't any armatures or anything else of that kind on the mesh. I'm using Blender 2.74 (latest one).

I have append a mesh (rex) from this .blend .  In edit Mode I see different vertices from objcet mode (see pictures). The vertices of belt are missing!  OBJECT MODE:   EDIT MODE:   How can I edit vertices of belt? Is It a bug?  This is my .blend  maybe can help.


I was looking at an example implementation of binder1st, that looks like this:  template <class Operation, class T>   binder1st<Operation> bind1st (const Operation& op, const T& x) {   return binder1st<Operation>(op, typename Operation::first_argument_type(x)); }   What is the meaning of typename Operation::first_argument_type(x). I understand first_argument_type to be a typename, but belonging to the binary_function base class. It looks to me that it is a function belonging to namespace Operation - in which case, why is typename used here?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


For an object, its destructor is called when it goes out of scope. Here's my program: #include <iostream> using namespace std;  class A {  public:   A() {}   ~A() { cout << "A's destructor called!" << endl; } };  class B {  public:   B() = delete;   B(int x_) {}   ~B() { cout << "B's destructor called!" << endl; } };  void func_a() { A a(); }  void func_b() { B b(1); }  int main() {   cout << "A" << endl;   func_a();   cout << "B" << endl;   func_b();   cout << "bye" << endl;   return 0; }  I thought either A's or B's destructor would be called. But the fact is only B's destructor called. I'm very confused. Is this because of the storage way of the class? Output: A B B's destructor called! bye

Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed?


I have an array of files that you receive files of an input type = file. I can not use the input because the user must have the ability to cancel a file. I need to pass this file array to my webservice in Java using ajax. How I spend my array using the method POST without using the form?  My big problem is the token and the header, the two need be dynamic and I deal in form, but in this case, I do not a form, I want to spend a var filearray declared in JavaScript. I cannot use a jQuery library file upload, because I need to show the files in other div after an user cancel a file and I have no idea how I show the files in other div because the library clean the input after the user chooses the files. I do not know where the library puts the files for me to handle them. "var filearray = []" is a global variable.  My HTML:  <input type="file" id="myFiles" multiple size="50" onchange="myFilesFunction()">   My JS:  function myFilesFunction(){ var x = document.getElementById("myFiles"); var contfilearray = 0; for (var i = 0; i < x.files.length; i++) {     filearray[contfilearray] = x.files[i];     contfilearray ++; }}   My Ajax:  function salvaanexoszip() { var numeroticket = 12345; var data = new FormData(); jQuery.each(jQuery(filearray)[0], function(i, file) {     data.append('file-'+i, file); });   $.ajax({     url: 'URL',     type: 'POST',     cache: false,     contentType: false,     processData: false,     data: {         ticket: numeroticket,         files: data,     },     success: function(data) {         alert("OK");     },     error: function (xhr, ajaxOptions, thrownError) {         alert("NOT OK");     } });}

I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); });  File <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/>     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?


Suppose that $a_n > 0$ and that, for n sufficiently large, $$\frac{a_{n+1}}{a_n}\leq 1- \frac{c}{n}$$ for $c>1$  Prove that the series $\displaystyle \sum_{n=1}^{\infty}a_n$ converges.  Hint supplied : Prove the inequality $log(1-x)<-x$ for $0<x<1$  I'm not entirely sure how to approach this, the ratio test fails and I'm trying to show the series is Cauchy but to no avail.

Suppose $a_n>0$ and, for large enough $n$, $\frac{a_{n+1}}{a_n} \leq 1-\frac{c}{n}$, where $c>1$. Prove the series $\sum a_n$ converges.  I tried looking at the tail of the distribution, at which point we have a decreasing sequence of positive reals, but other tests don't seem to yield anything. Can't see how the particular form of the RHS helps.


I'm trying to prove this for Riemann integration (not very rigorously, just finding an outline for how the proof should go). The substitution $y=1-x$ seemed handy, as I got  $$\int_0^1 \frac{f(x) - f(1-x)}{f(x) + f(1-x)}dx = 0,$$ but I could not continue after that. Can anybody give me some kind of hint?

If $f: [0,1]\rightarrow \mathbb{R}$ is continuous function positive, so $$\int_{0}^{1} \frac{f(x)}{f(x)+f(1-x)}dx=\frac{1}{2}$$???  all examples that I tested have worked.


The math book i'm using states that the cross product for two vectors is defined over $R^3$:  $$u = (a,b,c)$$ $$v = (d,e,f)$$  is:  $$u \times v = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ a & b & c \\ d & e & f \\ \end{vmatrix} $$  and the direction of the resultant is determined by curling fingers from vector v to u with thumb pointing in direction of the cross product of u x v.    Out of curiosity, what's the cross product if u and v are defined over $R^2$ instead of $R^3$ instead:  $$u = (a,b)$$ $$v = (d,e)$$  Is there a "degenerate" case for the cross product of $R^2$ instead $R^3$?  like this is some type of 2x2 determinant instead?  for instance if had a parameterization:  $$\Phi(u,\ v) = (\ f(u),\ \ g(v)\ )$$  and needed to calculate in $R^2$:  $$ D = \Bigg| \frac{\partial{\Phi}}{\partial{u}} \times \frac{\partial{\Phi}}{\partial{v}} \Bigg| $$  There are plenty of examples in the book for calculating the determinate D in $R^3$ but none at all for $R^2$ case.  As in:  $$ \iint_{V} f(x,y) dx\ dy = \iint_{Q} f(\Phi(u,v) \Bigg| \frac{\partial{\Phi}}{\partial{u}} \times \frac{\partial{\Phi}}{\partial{v}} \Bigg| $$  $$ \Phi(u,v)=(2u \cos v,\ \ u \sin v) $$

Wikipedia introduces the vector product for two vectors $\vec a$ and  $\vec b$ as $$ \vec a \times\vec b=(\| \vec a\| \|\vec b\|\sin\Theta)\vec n $$ It then mentions that $\vec n$ is the vector normal to the plane made by $\vec a$ and  $\vec b$, implying that $\vec a$ and  $\vec b$ are 3D vectors. Wikipedia mentions something about a 7D cross product, but I'm not going to pretend I understand that.  My idea, which remains unconfirmed with any source, is that a cross product can be thought of a vector which is orthogonal to all vectors which you are crossing.  If, and that's a big IF, this is right over all dimensions, we know that for a set of $n-1$ $n$-dimensional vectors, there exists a vector which is orthogonal to all of them.  The magnitude would have something to do with the area/volume/hypervolume/etc. made by the vectors we are crossing.  Am I right to guess that this multidimensional aspect of cross vectors exists or is that last part utter rubbish?


I ran a logistic regression moderation analyses and I noticed that with the addition of the interaction term, one of the predictors flipped signs. The variable (X) was previously -.015 and became .006 when the interaction term was added. I suspected this might be an issue with multicollinearity but the VIF for each of the variables is below 1.5. I understand that suppressor effects can occur upon adding predictors.  However, can someone tell me whether they think the sign switching upon adding an interaction term is a problem? Would it make sense to correlate the variables in the interaction term?

Imagine   You run a linear regression with four numeric predictors (IV1, ..., IV4) When only IV1 is included as a predictor the standardised beta is +.20 When you also include IV2 to IV4 the sign of the standardised regression coefficient of IV1 flips to -.25 (i.e., it's become negative).   This gives rise to a few questions:   With regards to terminology, do you call this a "suppressor effect"? What strategies would you use to explain and understand this effect? Do you have any examples of such effects in practice and how did you explain and understand these effects?


I have a scenario where I need to select a list of employees from a table where both a min birthdate and a max birthdate could be passed. So what I need is something like this : -  Select all from employees where active=1 and   if (not @min_birthday is null and @max_birthday is null)     birthday > @min_birthday   else if (@min_birthday is null and not @max_birthday is null)     birthday < @max_birthday  else if (not @min_birthday is null and not @max_birthday is null)     birthday between (@min_birthday and @max_birthday)   Is there anyway to acomplish the above in a single sql statement?

Is it possible to use an IF clause within a WHERE clause in MS SQL?  Example:  WHERE     IF IsNumeric(@OrderNumber) = 1         OrderNumber = @OrderNumber     ELSE         OrderNumber LIKE '%' + @OrderNumber + '%'


I need to make this table in Jaspersoft Studio:    My table sometimes have one test, two, n test or nothing. Is it possible? How can I solve this task?

I'd like to show/hide a column at runtime based on a particular condition. I'm using "Print when expression" to conditionally show/hide this column (and it's header) in my report. When the column is hidden, the space it would have occupied is left blank, which is not particularly attractive.  I would prefer if the extra space was used in a more effective manner, possibilities include:   the width of the report is reduced by the width of the hidden column the extra space is distributed among the remaining columns   In theory, I could achieve the first by setting the width of the column (and header) to 0, but also indicate that the column should resize to fit its contents. But JasperReports does not provide a "resize width to fit contents" option.  Another possibility is to generate reports using the Jasper API instead of defining the report template in XML. But that seems like a lot of effort for such a simple requirement.


My friend has installed some kind of a shell for terminal and on that machine i can see in which branch I am at the moment. It looks like this:    And now i want to install that on another machine but i don't know the name of it. I hope someone will recognize it from the screenshot.

I am using  to show the branch name in gnome terminal (Ubuntu 15.10) when working in a git repository. Based on the above I now have the below in my ~/.bashrc file:  # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes    ...  # Add git branch if its present to PS1 parse_git_branch() {  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } if [ "$color_prompt" = yes ]; then  PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' else  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' fi unset color_prompt force_color_prompt   As a result I now get:    so it works. But why has the coloring of my user@host been removed? And I would also expect that the branch name should be colored. Before it looked like this:    UPDATE: I have now tried this guide instead:    adding this to .bashrc:  parse_git_branch() {      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "   and that works:    Notice in .bashrc I also have this (default):  # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes   I have yet to find the reason why that snippet gives the correct result and the other version does not. Any input on this?  Here is the version of my .bashrc that has the old snippet enabled that does not work:


I want to make a adventure map, but the spawn is incorrect. I watched loads of videos, but cannot find something that works. Please help!

I don't know the command to set our spawn in Minecraft 1.12.1.  Is it /set spawn? I honestly can't figure it out. Thanks!


In the same document (article), I'm using some math packages (amsmath, amssymb, mathcomp, wasysym), and it all works fine; but when I use TIPA with the special latex spaces (\, \; \! \:), LaTeX told me it was unable to build the pdf output. It gives me something like:   LaTeX Warning: Command \! invalid in math mode on input line 45.   Is there a way to make this type of space in math mode with TIPA?  A minimal working example:  \documentclass[a4paper]{article}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[francais]{babel} \usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tipa}  \begin{document} $\forall x \in \mathbb{Z}, x=3k+c, c\in [\![0;2]\!]. -1\equiv 2 \;\:[3]$, so $\forall x \in \mathbb{Z}, x=3k+c, c\in [\![-1;1]\!].$\\ \textepsilon \end{document}

I copied the following command from a post on this web site.  \newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}   I have used it in other code and it has typeset the symbol for parallel lines nicely.  Why is it not compiled in this code?  (I try to use it in the last sentence.  I put a % in front of it so that the code will compile.)  \documentclass{amsart} \usepackage{amsmath} \usepackage{amsfonts}  \usepackage{tikz} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings,decorations.pathreplacing,backgrounds,patterns}   \usepackage{graphicx,tipa}% http://ctan.org/pkg/{graphicx,tipa} %This command typesets an arc symbol over letters. \newcommand{\arc}[1]{%   \setbox9=\hbox{#1}%   \ooalign{\resizebox{\wd9}{\height}{\texttoptiebar{\phantom{A}}}\cr#1}} %This command has LaTeX typeset the symbol for parallel lines. \newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}}   \begin{document}  \noindent {\textbf{Proposition}} \vskip1.25mm {\em $\overline{AB}$ and $\overline{CD}$ are chords in a circle that do not intersect. They are parallel if, and only if, $\arc{AC} = \arc{BD}$.} \vskip0.2in  \noindent {\textbf{Demonstration}} \vskip1.25mm \noindent $\overline{AB}$ and $\overline{CD}$ are chords in a circle centered at $O$. $\arc{AC} = \arc{BD}$ if, and only if, ${\mathrm{m}}\angle{AOC} = {\mathrm{m}}\angle{BOD}$. \begin{equation*} {\mathrm{m}}\angle{ABC} = \frac{1}{2} \, {\mathrm{m}}\angle{AOC} \qquad \text{and} \qquad {\mathrm{m}}\angle{BCD} = \frac{1}{2} \, {\mathrm{m}}\angle{BOD} . \end{equation*} So, ${\mathrm{m}}\angle{AOC} = {\mathrm{m}}\angle{BOD}$ if, and only if, ${\mathrm{m}}\angle{ABC} = {\mathrm{m}}\angle{BCD}$. $\angle{ABC}$ and $\angle{BCD}$ are alternate interior angles. ${\mathrm{m}}\angle{ABC} = {\mathrm{m}}\angle{BCD}$ if, and only if,  %$\overline{AB} \parallelsum \overline{CD}$.  \end{document}


I've always seen that the preferred alternative to   function MyObject ( ... ) {     this.MyFunction = function ( ... ) { ... }      // ...  }   is  function MyObject ( ... ) {     // ...  }  MyObject.prototype.MyFunction = function ( ... ) { ... }    My understanding is that in the way that the JavaScript hierarchy known as the prototype chain works, MyObject.prototype is the object from which MyObject derives. In English, what this is saying is      "Give me a property by giving it to my ancestor who I will then   inherit it from."   which seems like a very obscure and inefficient way of going about things. Coming from a C# background, how I see this is like the equivalent of having a class   class SpecialString : String  {  }   and saying      Ok, I want SpecialString to have a function SpecialFunction, so   I'll go into String and give it public void SpecialString (...). Now SpecialString has it! Mission accomplished.

What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };


a=Hello-World b=$(a|cut -d- -f1) echo "$b"   The above commands are not working for me. Any input?

I want to assign the result of an expression (i.e., the output from a command) to a variable and then manipulate it – for example, concatenate it with a string, then echo it.  Here's what I've got: #!/bin/bash cd ~/Desktop; thefile= ls -t -U | grep -m 1 "Screen Shot"; echo "Most recent screenshot is: "$thefile;  But that outputs: Screen Shot 2011-07-03 at 1.55.43 PM.png Most recent screenshot is:   So, it looks like that isn't getting assigned to $thefile, and is being printed as it's executed. What am I missing?


I have two tables, one is projects, and the other is users.    PROJECTS table ID     |     USER_ID    |   NAME ------------------------------------- 80     |        1       |   ABC Co. 82     |        2       |   XYZ Inc.  USERS table ID     |     FIRSTNAME  |   LASTNAME ------------------------------------- 1      |     Joe        |   Namath 2      |     Jimmy      |   Fallon   What I want is to write a query such as:   SELECT * FROM PROJECTS, USERS WHERE PROJECTS.USER_ID=USERS.ID AND FIRSTNAME = "Joe"   I can successfully run the query in php, but when I attempt to access the results, I don't get what I want.  I understand why, but I can't figure out a way to correct it.  For example:  $row = mysqli_fetch_query($awesomeDatabaseLink); echo $row['ID];  //returns '1' and I really wanted '80'   I get it.  The two tables have fields with the same name, but it's not the same data.  MySQL returns its best guess at what I so ambiguously asked for.  However, I have also tried:  echo $row['PROJECTS.ID']; //returns an empty string.   I should mention that I desperately need "*" from both tables. The Projects table has dozens and dozens of fields (not my design, and re-engineering the database is out-of-scope).  The Users table is also very extensive, so listing each field individually is much more impractical than it would appear by looking at my example tables.  Any suggestions? SH

I have two tables in my database:  NEWS table with columns:   id - the news id  user - the user id of the author)   USERS table with columns:   id - the user id   I want to execute this SQL:   SELECT * FROM news JOIN users ON news.user = user.id    When I get the results in PHP I would like to get associative array and get column names by $row['column-name']. How do I get the news ID and the user ID, having the same column name?


I want to convert a character array to a string object using the toString() method in java. Here is a snippet of the test code I used:  import java.util.Arrays; class toString{     public static void main(String[] args){         char[] Array = {'a', 'b', 'c', 'd', 'e', 'f'};         System.out.println(Array.toString());         } }   In principle, it should print abcdef, but it is printing random gibberish of the likes of [C@6e1408 or [C@e53108 each time the program executes. I don't need an alternative out of this but want to know why this is happening.

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


How do owls in Potterverse know how to deliver letters? Is there some sort of training they go through before being out in the field? Can any owl be used, or are there only specific breeds that are more suited for the task?

In the beginning of Goblet of Fire, Harry sends Snuffles a letter.  Hedwig somehow finds him after the extremely specific command from Harry, "Just find him, okay?"   Theories:   Hedwig has a scanning system, like Baymax in Big Hero 6. Hedwig got super lucky. Hedwig flies really, really fast.   Now I know that owls are intelligent beings in the Harry Potter canon. But.... those ideas are just as crazy as the next.  So how did Hedwig do it?


I'm needing to debug one of my themes and I want to be able to switch on a debug mode so I can output more information or switch off debug mode and not see any information.   I noticed there is a debug variable defined in wp_config.php. I can easily set this to true or false. Is it OK to use this variable for my own debugging purposes or should I create my own?   Also, how do I check for if debug is true? My PHP is a bit rusty. Is this correct:   define('WP_DEBUG', true);  if ($WP_DEBUG) {    // do something }   My question is different.

I'm trying to disable WP_DEBUG_LOG if and only if debug.log exists. I'd like to hook into wp_footer and test if the file exists and if so disable my debug log. All I've found though is that WP_DEBUG_LOG is a constant and can only be changed from the wp-config.php file which is too early for my case. Is there a way to change it from a constant on install and keep it working as normal?   My only other thought is to create an option on install in the options table and just check it every time wp-config loaded to see if the value has changed but I was wanting to avoid that.   Granted I could check if the file exists before I define WP_DEBUG_LOG but somebody would have to view a page twice before debug log actually exists and is detected by the file_exists() (since it's run very early) which is not optimal.  Does anybody know of a workaround to programmatically turn off WP_DEBUG_LOG?


I am new to sculpting and I am trying to figure out how to make two meshes seem to be made as one. I have heard of the Boolean modifier, but I just get what I had before with extra dots all over one object. What am I doing wrong? Thank you. This is what I have. I found a good example for what I am going for in the Blender 2.83 Sculpting Time lapse- Gotic Witch by Guilia Marchetti. There is a before and after image. The technique used here was the grab tool in sculpt mode. I can't seem to get that to work.

I am beginner and sculpt a body at the moment. I guess my way wasn't very effective. I created a body with different body parts. Each body part is a separate object. I sculpt mostly and I realized I wanna connect the different object to sculpt in a better way. This should be the way anyway at the end. I have no idea how to do this. I used a subdivision surface mod and it is just.. messy. In a old video I have seen there is a kind of bridge addon? I would be happy for any recommendation or tip. I attach a picture.


I see some of the questions in the Unanswered section having an accepted answer and the accepted answer having upvote also in the Android app. In the  post it is defined as  Unanswered questions have no answers with upvotes (or accepted)  But the accepted answer with upvote also still list in the Unanswered questions. Is my understanding is wrong or is it a bug? Screenshot for reference:

I've noticed this a few times on the Feed activity on the Android app, but never thought anything of it.  Why does this question (How To auto enable checkbox?) appear as "Unanswered" when there is an icon which denotes there are 5 answers, one of which has been marked as the answer?  Dragging down to refresh doesn't seem to clear the unanswered flag either.  Device: Nexus 5


I'm fairly new to java and I believe the problem comes from my lack of understanding. I am trying to read an Array List of CSV values.  Below is my code:     public static void readFile(){         String line = "";         try{             BufferedReader br = new BufferedReader(new FileReader(Main.filepath));              while((line = br.readLine()) != null){  //reads whilst the next line is not null                 fileData.add(line);                 //adds current line to array list         }         catch (Exception ex){             System.out.println("File Not Found");   //if file not found, print         }     }  public class Film{     public static void duration(){         readFile();         for (int i = 0; i < (fileData.size()); i++) {             //System.out.println(fileData);             String[] temp = fileData.get(1).split(",");             System.out.println(temp);         }     }  readFile() reads the CSV file and saves each line as an element in an ArrayList filedata is the ArrayList filepath is the path to the file The CSV file is in format "filmName,releaseDate,filmRating,filmGenre,filmDuration,filmScore" I'm trying to get Film() to print out the release dates of every element in the ArrayList, however my output is: [Ljava.lang.String;@6bf2d08e [Ljava.lang.String;@5eb5c224 [Ljava.lang.String;@53e25b76 [Ljava.lang.String;@73a8dfcc  When I'm expecting something more like 1999 2007 1956 1987  Any help is appreciated.


let G be a group of order pq,where p and q are primes. Show that any non-trivial subgroup of G is cyclic  how do we exactly go about doing this question

Problem.  Let $G$ be a group of order $pq$ such that $p$ and $ q$ are prime integers.  I am to show that every proper subgroup of $G$ is cyclic.  My attempt.  What I know: Any element $a$ divides $pq$ and $a^{pq} = e$.  The order of subgroups $H$ divide $pq$ by Lagrange.  If I could show that $G$ is cyclic, then all subgroups must be cyclic.  If I can show that $G$ is a group of prime order, then I can show that it is cyclic.  I'm not sure what more I can do here...I've tried looking at Fermat's Little Theorem but I can't seem to properly understand it and how it could affect my problem..


I have a text input for a calculator that is already set up to only accept numbers, and I want to allow for both positive and negative integers, but when the input is used, I want to disallow + and - to be entered. Instead, I want to have those inputs cause operations to be performed.  display.keypress(function() {   if (temp === 0 && $(this).val().isInteger()) {     temp = $(this).val().toString();   } else if ($(this).val().isSafeInteger()) {     temp += $(this).val().toString();   } });

Is there a quick way to set an HTML text input (<input type=text />) to only allow numeric keystrokes (plus '.')?


I have never encountered a situation where I needed eval().  Often times, people say that the [] property accessor makes eval() redundant.  Actually, isn't the execution of a pain statement exactly the same thing as pushing it as an argument into the eval() function. What is it actually used for?  Can you provide examples of when it might be useful to use eval()?

I'm writing some JavaScript code to parse user-entered functions (for spreadsheet-like functionality). Having parsed the formula I could convert it into JavaScript and run eval() on it to yield the result.  However, I've always shied away from using eval() if I can avoid it because it's evil (and, rightly or wrongly, I've always thought it is even more evil in JavaScript, because the code to be evaluated might be changed by the user).  So, when it is OK to use it?


I'd like to keep my large format camera in the car during the day at work, along with filters, adapters, tripod, etc. The car sits outside and I'm sure the temperature soars to over 120F some days inside that car. If I take the film inside with me, is it possible the camera or lenses will suffer damage in heat like that?  Please note I am not asking about operating temperature ranges, as answered in . I am asking about long term damage that can occur during storage, specifically in temps higher than normally occur while operating.

I notice that most camera have operating temperature of 0 degree Celsius to 40 degree Celsius. As for weather-proof camera, they can usually operate at -10 degree Celsius to 40 degree Celsius.  So, I was wondering if the camera can be used in the following temperature:     Above 40 degree Celsius (maybe in a desert or a sauna room) Below -10 degree Celsius (maybe in Antarctica or heavy snow)   From what I understand, most DSLR are able to withstand -10 degree Celsius. (Do correct me if I am wrong). However, I doubt any camera can withstand far beyond their temperature tolerance but would like to know if any camera experts did take their camera to their extremes.      by :  I have a canon t3i and I am curious to know just how much heat they can handle. I've seen proof that they can handle short bursts of , but long-term heat is another matter. I live in Texas and it's not uncommon for +110F temps in the summer.  If I leave that camera in the trunk - will it be ruined? Will the sensor quality go down? I want to take my camera with me everywhere - but if there is no air-conditioned area to keep the camera in I am worried I'll ruin it and be left without a camera.  , I should not be using the camera above 104F/40C - but what about the non-working range where I have it sitting somewhere?


I can't overstate the significance of "instantly"! I'm trialling a working process that makes very heavy use of spaces. Heavy enough that any delay when switching spaces is making it essentially unworkable.  I made a change — turned "Reduce Motion" on — which I think sped things up, but nowhere near enough. I need the delay to be as little as it is when, for example, switching windows within the same app+space i.e. instant.  To demonstrate the issue, open a few applications across a couple of spaces, then try to cmd-tab between a) apps on different spaces b) apps on the same space. Note that, even with "reduce motion" enabled, switching is much faster within a space.  Is there any setting I can change, or third-party app, that will totally eliminate the delay? Failing that, can anyone familiar with macos programming weigh in on whether this is even possible or not, or whether its something imposed by the OS which there is no chance of changing at all (without hacking the os binary!)  I'm running a MacBook Pro Retina Mid-2014, macOS 10.13.3, with 10 workspaces configured.  My preference would be for the animation to be totally eliminated for every switch-spacing mechanism. However, my main method is going to be using Ctrl+[1-0] to switch between 10 workspaces.

I would very much like to disable the sliding animation that occurs when switching desktops via ctrl+→/← or ctrl+[number] in Lion.   This was previously accomplished in previous versions with this command:  defaults write com.apple.dock workspaces-swoosh-animation-off -bool YES && killall Dock   This new animation is even more slow than in Snow Leopard - nearly 1 second to switch - a real productivity killer.  Any help greatly appreciated!