Button in fragment gives null pointer for no reason

I've done fragments before and I've dealt with nnull pointers, but in this instance I get a null pointer when I try the onClickListener for the majorSecond5 button.  public class Intervals_and_chords extends Fragment {  Button majorSecond5;  public void majorSecond ()     {         notimportant     }  public View onCreateView(LayoutInflater inflater, ViewGroup container,                                  Bundle savedInstanceState) {             View view = inflater.inflate(R.layout.rhythm, container, false);           majorSecond5 = view.findViewById(R.id.majorSecond);           majorSecond5.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View view) {                majorSecond();            }        });   return view;  }  }   Here's the Logcat:  01-29 14:44:46.826 2508-2508/com.stefanawesome.piano E/AndroidRuntime: FATAL EXCEPTION: main                                                                        Process: com.stefanawesome.piano, PID: 2508                                                                        java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference                                                                            at com.stefanawesome.piano.Intervals_and_chords.onCreateView(Intervals_and_chords.java:158)                                                                            at android.support.v4.app.Fragment.performCreateView(Fragment.java:2354)                                                                            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1419)                                                                            at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1740)                                                                            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1809)                                                                            at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:799)                                                                            at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2580)                                                                            at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2367)                                                                            at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)                                                                            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)                                                                            at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)                                                                            at android.os.Handler.handleCallback(Handler.java:751)                                                                            at android.os.Handler.dispatchMessage(Handler.java:95)                                                                            at android.os.Looper.loop(Looper.java:154)                                                                            at android.app.ActivityThread.main(ActivityThread.java:6119)                                                                            at java.lang.reflect.Method.invoke(Native Method)                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)


How much quantity of saffron can be carried to India?

I will be traveling from Sharjah, how much saffron is permissible to carry in the main luggage?


Adding a link with a space in front causes the link to not work

When you paste a link into the "Insert Hyperlink" box, it adds it automatically as a citation link:  [Example 1][1]    [1]: http://example.com   But when you paste a link starting with a space , it tries to URL encode it, to change the space to %20, and then sticks a http:// on the front to make it a valid link:  [Example 2][2]    [2]: http://%20http://example.com   This, however, means the link doesn't work.    Please could leading whitespace be stripped from the URL?


Changing Linear Units on Scale Bar to a unit not listed

In ArcMap, how can I change my linear units on a scale bar for layout view to a unit not listed on the drop down menu in units of the scale bar?  I want to get survey chains in my map as a scale bar.


What is the trade-off between batch size and number of iterations to train a neural network?

When training a neural network, what difference does it make to set:   batch size to $a$ and number of iterations to $b$ vs. batch size to $c$ and number of iterations to $d$   where $ ab = cd $?  To put it otherwise, assuming that we train the neural network with the same amount of training examples, how to set the optimal batch size and number of iterations? (where batch size * number of iterations = number of training examples shown to the neural network, with the same training example being potentially shown several times)  I am aware that the higher the batch size, the more memory space one needs, and it often makes computations faster. But in terms of performance of the trained network, what difference does it make?


I currently have a foreign key between two entities, and I would like to make that relation conditional to the entityType of one of the tables.  Here's the hierachy of tables, this is done via FK refrences from child to parent                    Store             /                \   Employees                    \                              TransactionalStores                             /       |         \                      Kiosks         |          BrickMortars                                  Onlines   I currently have a FK relation from Employee to store  ALTER TABLE Employees ADD CONSTRAINT Employee_Store             FOREIGN KEY (TransStoreId)             REFERENCES TransactionalStores(StoreId)   I would like to add the conditional:  WHERE TransactionalStores.storeType != 'ONLINE_TYPE'   Is this possible or must I subclass TransactionalStores into two new subTypes (e.g. PhysicalStores and VirtualStores)


I just try to visualize some points using GeoServer to publish them as WMS and bind this WMS to my Openlayers website using the GeoServer internal Heatmap process to visualize it. I don't want to use the Openlayers Heatmap function.   But there seem to be some problems, look here:    I'm using this Openlayers implementation to bind my WMS URL:    Changing the params to:  params: {'LAYERS': 'test:points','TILED': true,'STYLES': 'heatmap'},   And using this as SLD to define the Heatmap:    Any ideas why this happens?


How to preserve php session variables when redirecting to https

I would greatly appreciate any advice on how to preserve my php session variables once i do a https redirect like this:  $location = 'https://' . BASE_URL . 'billing.php'; header("Location: $location"); exit();


I have something like this . I know how to assing OnClick function for each element. Problem is with the body of Onclick function, I can also determine what element was clicked.   function onClickHandle() { //go to page www.mypage.com?page=selectedPage }    I can make the selectedPage string (specify the target page), problem is only with the action GO TO SPECIFIED PAGE.  In my web app I use html, css, php, javasript.


I am a Young leaner of Mathematics in the university and I found this problem a bit challenging et me.  Please can someone help me integrate   $$\int_{-\infty}^\infty e^{-x^{-2}} dx$$ Thanks.


Is there a quality compact camera with AA batteries?

When my wife has retired later this year we intend to hit the road big time. We are aiming to travel light (single hand luggage bag) so I want a compact rather than my DSLR. I also insist on AA batteries as cannot guarantee access to recharge options. Having trouble finding almost anything that isn't rechargeable batteries. Is there anything decent? Or will I have to buy an older second hand model?


Minimal polynomial of intermediate extensions under Galois extensions.

Let $K$ be a Galois extension of $F$, and let $a\in K$. Let $n=[K:F]$, $r=[F(a):F]$, and $H=\mathrm{Gal}(K/F(a))$. Let $z_1, z_2,\ldots,z_r$ be left coset representatives of $H$ in $G$. Show that    $$\min(F,a)=\prod_{i=1}^r\left( x - z_i(a)\right).$$   In this product $\min(F,a)$ is of degree $r$. That is true from fundamental theorem.  And if one of $z_i$ is the identity, then $a$ satisfies the polynomial.  My question is:  What is the guarantee that $z_i(a)$ belongs to $F$ for all $i$?  What if I choose a representative which is not the identity of $\mathrm{Gal}(K/F)$?


I'm a little conflicted as to why we consider $\vec{a}^T\vec{b}$ to be the same as dot product $\vec{a}\cdot\vec{b}$ is some calculations, where both $\vec{a}$ and $\vec{b}$ of let's say size $n\times1$. We know that $\vec{a}\vec{b}^T$ results in a matrix of size $n \times n$, shouldn't $\vec{a}^T\vec{b}$ result in a matrix of size $1 \times 1$? In comparison, $\vec{a}\cdot\vec{b}$ is a scalar. I feel like I'm missing some kind of convention?


How to create Facebook style user notifications?

Using Heartbeat I have been able to effectively make streams of user activities through Rules triggers. However I would like to be able to have users notified of new activities, and keep a count of the number of new activities like in facebook, or even similar to new email counts in most email systems.   In Drupal 6 there were a few modules which could achieve this well, however how can this be done in Drupal 7?  I have done quite extensive research on this but am unable to find the right module at this point: There's the  and  modules, which would be the perfect solutions except only D6 versions exist. There's  which cannot be integrated with any activity logging module since it lacks proper Rules support. Two interesting implementations are  and  which provide dropdown trays with lists of activities, but don't count the number of new activities and no longer integrate with Rules. Finally  is great as a dynamic counter, even though at the moment it only counts Flags and provides a link to a list of the flagging users. Perhaps with some tweaking it could be used via Flags Rules integration to track recent (flagged) activities and link to a list of these recent activities.  Is it possible to achieve functionality similar to this in Drupal 7?


How to run a sudo command without a password where the command can be altered?

I know this question gets asked a lot but my situation is a little different. I am using Qt and the user has the ability to change timezones. Therefore, the following commands need to be used (America/Los_Anegles can change):  $ sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime   I would like to run these commands without a password. I read that you could write the following in  /etc/sudoers :  user = (root) NOPASSWD: command   where command is something like:   sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime   However, the command has to be specific and as I stated before, America/Los_Angeles could potentially change. Is it possible to make this work?


Update: Does the Planck scale imply that spacetime is discrete?

This question has already been asked     however I'm wondering if there has been any change in the community since it was asked roughly 8 years ago.  In particular, the accepted answer on the previous question seems to be pretty emphatic in the negative:      The proposition that distances or durations become discrete near the Planck scale is a scientific hypothesis and it is one that may be - and, in fact, has been - experimentally falsified. For example, these discrete theories inevitably predict that the time needed for photons to get from very distant places of the Universe to the Earth will measurably depend on the photons' energy.   The Fermi satellite has showed that the delay is zero within dozens of milliseconds.   However, there was another good answer that appeared roughly two years later which takes the idea of a discrete universe as a serious scientific question.  They also link an 89 page PDF () which takes the issue very seriously.  Did the author of that PDF fail to just read Luboš Motl's answer?   Does Luboš Motl's answer give zero chance for such a model or is it simply very unlikely.  Has the science changed at all?  Note:  I realize that this is a `duplicate' question, but the second answer in the other question seems both sincere and respectable yet largely ignored.  What's up with that?


Are rainbows three dimensional? If so, what determines their depth?

I am wondering whether rainbows are three dimensional, and if so, what determine their depth? How to calculate the depth of a rainbow, given its radius?  From what I understand, all rainbows are circular and their radius are determined by the distance between the observer and the water drops. How can one determine the depth based on this information, assuming the depth is non zero?  Edit: As stated in a comment by Solomon Slow, a rainbow is not really an object. My question still applies, the rays of light that make us see a rainbow are coming from droplets. What is the depth extension of these (real) droplets?


Can we implement the low quality flags to delete posts after a certain number of flags?

Can we implement the low quality flag to be like the abuse or spam flags. So if a certain number of low quality flags are made  on a post (whether it be a questions or an answer) the post is deleted?  This would also relieve *close vote and delete vote queues. *which is a much discussed topic.        related:


Importing Nodes to D7 with all custom fields

I've got a Drupal site with an obscene about of content that has been given to me in CSV format. I'm toying with the idea of building a module to let me do this but if there's one already out there that I can use to just get this site out of the way that would be awesome.  My question is: Is there anything out there that allows you to import a CSV file into D7 that will populate the node table and all the custom fields tables as well?  Thanks.


How do I substitute dates for these null values in SQL?

For all the days between 2003-04-01 and 2003-04-07 find the number of trips from town Rostov. Result set: date, number of trips.  Here is the database schema:   query and result set:  SELECT MyDates.d as Dt,         count(distinct trip.trip_no) as Qty FROM   trip   JOIN pass_in_trip           ON trip.trip_no = pass_in_trip.trip_no  FULL OUTER JOIN (select cast(cast(x.yr as varchar)+'-'+cast(y.mo as varchar)+'-'+cast(z.dy as varchar) as datetime) d from (select 2003 yr) x CROSS JOIN (SELECT 4 mo) y CROSS JOIN (select 1 dy UNION ALL select 2 UNION ALL select 3 UNION ALL select 4 UNION ALL select 5 UNION ALL select 6 UNION ALL select 7) z where dy<=7) MyDates ON Mydates.d = pass_in_trip.date WHERE  trip.town_from = 'Rostov'  GROUP BY MyDates.d, pass_in_trip.date, trip.trip_no  +-------------------------+-----+ |           Dt            | Qty | +-------------------------+-----+ | NULL                    |   1 | | NULL                    |   1 | | NULL                    |   1 | | NULL                    |   1 | | 2003-04-01 00:00:00.000 |   1 | | 2003-04-05 00:00:00.000 |   1 | +-------------------------+-----+   Here is the result set I want  +-------------------------+-----+ |           Dt            | Qty | +-------------------------+-----+ | 2003-04-01 00:00:00.000 |   1 | | 2003-04-02 00:00:00.000 |   0 | | 2003-04-03 00:00:00.000 |   0 | | 2003-04-04 00:00:00.000 |   0 | | 2003-04-05 00:00:00.000 |   1 | | 2003-04-06 00:00:00.000 |   0 | | 2003-04-07 00:00:00.000 |   0 | +-------------------------+-----+   FYI - I think this is using MySQL or sql server, it's a bit unclear to me.


Flow in vertical pipe and Bernoulli's equation

If we had a flow in an open vertical pipe kept in atmosphere so that external pressure is equal at both ends and if we try to apply Bernoulli's equation to it would stand to reason that due to pipe being vertical, potential energy is smaller at the lower end so, kinetic energy must be bigger, which is sensible because gravity did positive work and increased fluid's kinetic energy. But, if pipe's diameter is the same on both ends how can we agree this with continuity principle? From this principle, velocity should have been the same. Is Bernoulli's continuity equation applicable here in its simplest form ? Although I am not quite sure what is missing here.


JavaScript - How to check if alphabetical characters or symbols have been entered in a number input field

I'm trying to make a JavaScript program where you enter a numeric value into an input field, and then the program returns a message based on what number you entered.   There are two main parameters with the number input field I want to have:  1. The number you enter in the field must be between 0-100, and if it's not then an alert will be called telling you to enter a proper value.  I have done that, but it's the next parameter I'm having trouble with.  2. You may only enter numeric values into the input field. If you don't (e.g. you enter an alphabetical character) then an alert will be called saying that you may only enter numbers.  Both of these parameters are checked off when the user clicks a button; the button calls some functions that do this. I'm having problems with the second parameter, however.  I can't figure out how I can get the program to look at the what the user typed and determine if any values in it are alphabetical characters (letters).  So, to recap, my overall question is this: How can I check if any characters that are inputted into a number field are alphabetical letters, through a function that is called with a button?  If my question is confusing at all please tell me and I will try to clarify. Any help would be greatly appreciated. Thanks.


You should choose your Display Name when signing up

When a user signs up , their username is something along the lines of "user########"  Granted, in the welcome email it does say something along the lines of "Head over to your user account page to chose a display name!", however only a few people actually read that email.  I'm not saying we should restrict people from changing their display name again in the future - Everyone would still be able to do so. It's just that when you sign up you choose an initial display name that will be what your first display name is instead of "user########".


Can I turn off macOS Catalina's internal display without close the lid while using an external monitor?

I'm using two external monitors, and I want to be able to disable the built-in monitor without closing the lid. Option with disabling brightness doesn't fit my requirements because I don't want every time to search my cursor in the black screen. I need the lid to be opened because I'm ofently using touch id sensor.


Get a list of ALL facebook friends and their details

I have used a number of different applications to get what they claim to be a list of all my facebook friends into a .csv file or a similar format.  For some reason, these applications never export all of my friends and the total number of friends listed in the file is always over 100 less than the actual number of friends I have on facebook.  How can I properly export the names of ALL my friends and their details?


Joining bash arguments into single string with spaces

I'm trying to join all of the arguments to a Bash function into one single string with spaces separating each argument. I also need to have the string include single quotes around the whole string.  Here is what I have so far...  $array=("$@") str="\'" for arg in "${array[@]}"; do     let $str=$str+$arg+" " done let $str=$str+"\'"   Obviously this does not work but I'm wondering if there is a way to achieve this?


Using a background image to model in Blender

I have chosen the book BlenderBasics_4thEdition2011.pdf to use in teaching my first 3D Animation Class using Blender.  In it, on page 38, there is a lesson that uses a background image as a guide to create a 3D logo.  The text says to scroll down on the Transfom Panel to find the "Background Images" panel.  I cannot find that panel.  I have downloaded the latest Blender 2.72 release.    Can someone help me with this please?  I have done a couple Google searches and found images of that panel but I can't seem to find it on the Transform panel.  What am I doing wrong?


I was toggling between layout views (Default, Animation, etc) and I accidentally got this:    I don't know how to simply restore the "Default" layout... or any layout. Many of the interface elements are gone and I was able to bring back some by clicking "maximize area" in one of the tool bars  So, anyone knows a way of restoring the default layout without using the layout button? thanks in advance!  (I've tried searching and apparently no-one had this problem before...)


machine learning techniques for longitudinal data

I was wondering if there were any machine learning techniques (unsupervised) for modelling longitudinal data? I've always used mixed effects models (mostly non-linear) but I was wondering if there are any other ways of doing this (using machine learning).  By machine learning, I mean random forest, classification/clustering, decision trees and even deep learning, etc.


Will deleting a question remove reputation (clarification)?

Per this answered question from 5 years ago,    I see that reputation will be retained for answers that   1) Have a score of 3 or greater and/or 2) have had exposure for 60 days.  In order for reputation to be retained for an answer to a deleted question, do BOTH conditions have to be fulfilled, or either?


I have two variables X and Y with weights a and b respectively.  Pl. see the link for sample data.    I know how to calculate weighted mean and weighted variance for the variables X and Y.  How to calculate weighted covariance values? What is the formula?  I have gone through the following website:    but my problem is I Have different weights for each observations under each variable.


Windows: how to install driver from recovery command prompt?

I'm trying to enable Intel SRT on my laptop. To do this, I need to change SATA controller mode from AHCI to RAID. The problem is that windows has no drivers for RAID and I can't install it while controller is in AHCI mode.   For now I have RAID driver in INF package (inf, sys, cat files). And I can load Windows recovery console with controller in RAID mode. The last thing to do is to intall this driver, but I don't know how to do it.  Google says rundll32.exe setupapi,InstallHinfSection DefaultInstall 123 <filename>.inf might help, but it doesn't.


In Python, if l1 is a list and if we assign l2 = l1 and change l1 directly to some other list by assigning it, then l2 will also change to the list that we assigned l1 to.  It is being the case that this can be avoided by using something like this.  l2 = list(l1)   or  l2 = l1[:]   or  import copy l2 = copy.copy(l1)   or  import copy l2 = copy.deepcopy(l1)   For my question,  I have a 4 × 4 grid of numbers within into some type of two dimensional structured list of table, that is being something like this:  ------------- | 0| 1| 2| 3| |--|--|--|--| | 4| 5| 6| 7| |--|--|--|--| | 8| 9|10|11| |--|--|--|--| |12|13|14|15| -------------   such that table[n/4][n%4] = n, for all values of n, 0 ≤ n ≤ 15.  The case that, I am trying out to solve a  4 × 4 size of board for its extended version of , a game in which one of the two players must (and then should) win definitely after 14 moves by using both of the two players, unlike the drawish version of Tic Tac Toe n × n size of board, for any value of n ≥ 3 only.  For solving within this very problem, for being writing into Python,  let win = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15], [0, 4, 8, 12], [1, 5, 9, 13], [2, 6, 10, 14], [3, 7, 11, 15], [0, 5, 10, 15], [3, 6, 9, 12]] that which essentially corresponds enough within into four horizontal elements, four vertical elements and two diagonal elements.  I have a list  line = [[]] * 16   For all values of i, 0 ≤ i ≤ 15, I will have to add win[item] within into line[i] if win[item] contains i.  Consider within this very following piece of code, for being written into Python,  for item in win:     for i in line:         line[i].append(item)   That is being simplifying within into,  it is being right now that,  why ever does line[i].append(item) add the structured list of item for all indices of structured list of line, values of indices, 0 ≤ index ≤ 15, but not only for the index i of structured list of line?  Why ever do these two very pieces of problem happen?  What ever are the alternative ways and then methods available, in order to resolve within this very following piece of issue, for being written into Python?  By making use of the same way only, I am only making use of database instead of dictionary, for the former's ability to store data in hard disk and continue computing at any period of time from its last saved state, and then I am trying to avoid using slower enough operations such as those like Multiplication, Division, Modulo and Power and making use of faster enough operations such as those like Addition, Subtraction, Logical And, Logical Or, Logical Not, Left Shift and Right Shift only.  Thank you in advance.


Rigid body animation with constraints and relationships

I want to drop a Padlock object that not only bounces the main body of the lock but has an open lock that also swivels when it hits.  I can't do this with a parent child relationship since it isn't calculated in the simulation...  any ideas?


Using reflection to supply generic type to a method?

I'm not sure this is possible with reflection, but thought I'd ask.  I'm using a data access class that relies on generics to determine the 'row type' which we're querying against.    A couple of examples will show what I mean better than anything:  int count1 = connection.Count<PersonRow>("i.FirstName ='David'"); int count2 = connection.Count<CarRow>("i.CarModel = 'Chevrolet'");    Both PersonRow and CarRow inherit from an abstract Row class.  As you can see, the type of Row we're querying against dictates what our query structure will be.  I'd like to store a bunch of these queries as strings in a database or configuration file, rather than hard-code them.  That way we can let users write their own queries as they like, and the code loops over the configuration and runs them one at a time.  Trouble is, I don't know if I can pull this off given the Generic requirement above?  I'd love for the configuration to store the kind of row (as a string) along with a string for the query itself, then use reflection to supply the row class in the Count<> method.  I've been playing with Type.GetType() and Type.MakeGenericType() to see if  I can finagle something, but am having no luck.    While looking around, I've seen several articles like  that show how to instantiate a generic class using reflection, but I need the class type, not an actual object.  Is there a way to pull this off?


Video Sequence Editor - How to make subtitles?

Is there a way of adding Subtitles directly in the VSE? Or do I have to make an animation of text meshes and add it to the video via a Scene strip?


If $E$ is a finitely presented left $A$-module, then tensor product by E commutes with direct product.

Please can anyone help me to prove this statement:       If $E$ is a finitely presented left $A$-module, then   for every family $(F_i)$ of right $A$-modules the canonical homomorphism $\phi: E\bigotimes_A \prod F_i \rightarrow  \prod (E\bigotimes _A F_i)$ is an isomorphism.   I have proved that the map is surjective, and I want anyone to help me to prove that the map is injective.  Thank you!


Spacetime Torsion, the Spin tensor, and intrinsic spin in Einstein-Cartan theory

In  gravity, the action is the usual  but now the Torsion tensor is allowed to vary as well (in usual GR, it is just set to zero).  Variation with respect to the metric gives:  $$R_{ab}-\frac{1}{2}R g_{ab}=\kappa P_{ab} \quad (1)$$  where $P_{ab}$ is the canonical stress energy tensor.  Variation with respect to the torsion tensor ${T^{ab}}_c$ gives:  $${T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d = \kappa {\sigma_{ab}}^c \quad (2)$$  where ${\sigma_{ab}}^c$ is the .  By contracting that equation, I can see that if the spin tensor is zero, the Torsion tensor is identically zero:  $${T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d = \kappa {\sigma_{ab}}^c = 0$$ $$ {g^b}_c({T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d) = 0$$ $$ {T_{ab}}^b + {g_a}^b{T_{bd}}^d - {g_b}^b {T_{ad}}^d = 0$$ $$ {T_{ab}}^b + {T_{ad}}^d - 4 {T_{ad}}^d = 0$$ $$ {T_{ad}}^d = 0$$ $${T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d = 0 \quad \Rightarrow \quad {T_{ab}}^c =0$$  My understanding is that:  The spin tensor and the stress energy tensor, are defined entirely in terms of whatever matter Lagrangian we add to the theory.  Therefore, from above, the equations in vacuum are exactly the same as normal GR (so solving for outside matter, only the boundary conditions with the matter could be different).  Assuming my understanding up to here is correct, my line of questioning is:   How is the Spin tensor (and hence Torsion) related to the concept of material with intrinsic spin? Hopefully answered by 1, but if the matter has zero intrinsic spin, yet we have an extended "spinning" body, is the spin tensor still zero (as I'd consider that orbital angular momentum then)? Does this mean Einstein-Cartan predictions are identical to normal Einstein GR if (and only if) the instrinsic spin of any particles and fields in the theory are zero?


I've got two noetherian rings $A\subset B$ such that $B$ is a finite $A$-module. Now, if I consider the associated map between spectra that given $q \in \operatorname{Spec} B$ consider $q \cap A \in \operatorname{Spec}  A$ and I should demonstrate it has finite fibers.  I really don't know how to even start. I tried to use the fact that the extension is integral etc but i didn't manage to do anything. Ty for the help


Prove: Any open interval has the same cardinality of $\Bbb R$ (without using trigonometric functions)

I want to prove that every open interval has the same cardinality of $\Bbb R$.  The question is:  Is it enough to prove that any open interval is uncountable? If I prove it, can I say that this interval has the same cardinality of reals?  I know that I can get a bijection using the tangent function, but I am not allowed to use trigonometric functions.  I've proved that |$(a,b)$|=|$(0,1)$| so I may prove that |$(0,1)$|=|$\Bbb R$| but I did not find the bijection without using trigonometric functions.


Linking directly to a specific point in time of a YouTube video

If I find a video on YouTube that I want to send to a friend, but I really only care about something at the two minute mark, can I send him a link that will start at two minutes into the video for him?  Is there a specific URL or setting when sending a link to a YouTube video that jumps directly to a point in the timeline?


How to make an HTTP server listen on multiple ports?

I am trying to create a python server that listens on multiple ports at once, I know I have to create multiple sockets however I am not sure how to accomplish this. My current server uses the SimpleHTTPServer module and listens on Port 8000. However I would like it to also listen on 8001 and 8002.  Here is the current server code:  #!/usr/bin/env python  import SimpleHTTPServer import SocketServer import logging  PORT = 8000  class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):      def do_GET(self):         logging.error(self.headers)         SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)   Handler = GetHandler httpd = SocketServer.TCPServer(("", PORT), Handler)  httpd.serve_forever()   I have tried to adapt the code to listen on port 8001 and 8002 like so:  #!/usr/bin/env python  import SimpleHTTPServer import SocketServer import logging  PORT = 8000 PORT1 = 8001 PORT2 = 8002  class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):      def do_GET(self):         logging.error(self.headers)         SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)   Handler = GetHandler httpd = SocketServer.TCPServer(("", PORT), Handler) httpd = SocketServer.TCPServer(("", PORT1), Handler) httpd = SocketServer.TCPServer(("", PORT2), Handler)   httpd.serve_forever()   However this only listens on the last port (8002). How can I adapt the script to listen on all 3 ports?


Methods of list (like remove, contains, removeAll) have Object type arguments instead of generic  type

public boolean remove(Object o) {  // implementation }   This is an ArrayList method which takes object type as argument. Lists are always generic in Java, then why does the method accept Object type as argument instead of <T>.


Short story (50s? 60s?) with a man trapped inside a sentient cave

In the story, the man (a marooned astronaut on an alien planet, perhaps) is living inside a sealed cave. The cave is sentient, and speaks to the man, and even provides food and water.   There's a weird scene where the cave wants to "become pregnant", and the only way for that to happen is for the man to use a knife to rip into a membrane in the cave... but there's danger involved, because the process (as with a black widow spider) involves the death of the one doing the membrane-shredding. The sentient cave somehow overcomes the instinct to kill the man, who has become her friend.   It was a bizarre story, probably from one of those Best Of ...." Books from the old Science Fiction Book Club.


How to dissolve a subset of a multipolygon vector in QGIS?

I have a multipolygon layer. Some of the polygons within the layer overlap. I would like to dissolve only the polygons which overlap and not any discrete polygons. Is this possible? I am currently using QGIS.


I didnt understand the truth table for $p \implies q$ (where $p$ and $q$ are statements). Can someone please explain it to me?  It would be better if someone explains with an example.


Is there a need to set Objects to Nothing

I always read that it is recommended to set objects to nothing, once I am done with them. But I normally use them only in functions inside forms.  Isn't the reference lost and memory released when the function scope is left, regardless of setting objects to Nothing?   i.e. is it really necessary to do:  Set db = Nothing Set record_set = Nothing


Entity Framework : Error when trying to Deep clone an object

I'm using Entity Framework 6 , with Database First. The model is created using wizard from existing Sql server database. I'm using this code to do a deep clone :  Imports System.ComponentModel Imports System.Collections Imports System.Data.Entity.Core.Objects.DataClasses Imports System.Runtime.Serialization Imports System.IO Imports System.Reflection Imports System.Runtime.CompilerServices  Module Extensions  Private Function ClearEntityObject(Of T As Class)(ByVal source As T, ByVal bCheckHierarchy As Boolean) As T     If (source Is Nothing) Then         Throw New Exception("Null Object cannot be cloned")     End If     Dim tObj As Type = source.GetType     If (Not tObj.GetProperty("EntityKey") Is Nothing) Then         tObj.GetProperty("EntityKey").SetValue(source, Nothing, Nothing)     End If     If bCheckHierarchy Then         Dim PropertyList As List(Of PropertyInfo) = Enumerable.ToList(Of PropertyInfo)((From a In source.GetType.GetProperties             Where a.PropertyType.Name.Equals("ENTITYCOLLECTION`1", StringComparison.OrdinalIgnoreCase)             Select a))         Dim prop As PropertyInfo         For Each prop In PropertyList             Dim keys As IEnumerable = DirectCast(tObj.GetProperty(prop.Name).GetValue(source, Nothing), IEnumerable)             Dim key As Object             For Each key In keys                 Dim childProp As EntityReference = Enumerable.SingleOrDefault(Of PropertyInfo)((From a In key.GetType.GetProperties                 Where (a.PropertyType.Name.Equals("EntityReference`1", StringComparison.OrdinalIgnoreCase))                     Select a)).GetValue(key, Nothing)                  ClearEntityObject(childProp, False)                 ClearEntityObject(key, True)             Next         Next     End If     Return source End Function  <Extension()> _ Public Function ClearEntityReference(ByVal source As Object, ByVal bCheckHierarchy As Boolean) As Object     Return ClearEntityObject(source, bCheckHierarchy) End Function  <Extension()> _ Public Function Clone(Of T)(ByVal source As T) As T     Dim ser As New DataContractSerializer(GetType(T))     Using stream As MemoryStream = New MemoryStream         ser.WriteObject(stream, source)         stream.Seek(0, SeekOrigin.Begin)         Return DirectCast(ser.ReadObject(stream), T)     End Using End Function  End module   Now , I try to use this code like this :    Private Sub DoClone     Dim litm, newitm As MyObject     litm = context.MyObjects.FirstOrDefault     newitm = litm.Clone()     newitm.ClearEntityReference(True)     context.MyObjects.Add(newitm)     context.SaveChanges() End Sub   I get an error :     An unhandled exception of type   'System.Runtime.Serialization.SerializationException' occurred in   System.Runtime.Serialization.dll         Additional information:Type   'System.Data.Entity.DynamicProxies.MyObject_F2FFE64DA472EB2B2BDF7E143DE887D3845AD9D1731FD3107937062AC0C2E4BB'   with data contract name   'MyObject_F2FFE64DA472EB2B2BDF7E143DE887D3845AD9D1731FD3107937062AC0C2E4BB:'   is not expected.       Consider using a DataContractResolver or add any   types not known statically to the list of known types - for example,   by using the KnownTypeAttribute attribute or by adding them to the   list of known types passed to DataContractSerializer.   This is my model that I use :  Partial Public Class Myobject Public Property id As Integer Public property name as string Public Overridable Property chld As ICollection(Of chld) = New HashSet(Of chld)  Public Overridable Property chld1 As ICollection(Of chld1) = New HashSet(Of chld1) End Class  Partial Public Class chld     Public Property id As Integer     Public Property date1 as DateTime     Public Property quantity as Integer     Public Property ParentID as integer     Public Overridable Property MyObj1 As MyObject End Class  Partial Public Class chld1     Public Property id As Integer     Public Property nm as string     Public Property ParentID as integer     Public Overridable Property MyObj1 As MyObject End Class


Is there a way to programmatically determine if a font file has a specific Unicode Glyph?

I'm working on a project that generates PDFs that can contain fairly complex math and science formulas.  The text is rendered in Times New Roman, which has pretty good Unicode coverage, but not complete. We have a system in place to swap in a more Unicode complete font for code points that don't have a glyph in TNR (like most of the "stranger" math symbols,) but I can't seem to find a way to query the *.ttf file to see if a given glyph is present.  So far, I've just hard-coded a lookup table of which code points are present, but I'd much prefer an automatic solution.  I'm using VB.Net in a web system under ASP.net, but solutions in any programming language/environment would be appreciated.  Edit: The win32 solution looks excellent, but the specific case I'm trying to solve is in an ASP.Net web system.  Is there a way to do this without including the windows API DLLs into my web site?


Solution for quadratic formula in physics problems

I’ve solved a physics problem about acceleration with the quadratic formula and I don’t understand the solutions. There is two vehicles A and B. A is before B of 50 meters. The velocity of A is 20 $ms^{-1}\hat{i}$ and B is 30 $ms^{-1}\hat{i}$.Then A start an acceleration of 2 $ms^{-2}$. How long do A overtake B. I’ve collapsed two equation such as: $\frac{1}{2}a_{A}t^2+v_{0A}t = x_{0B} + v_{B}$  Then i have à second degree equation to find the time, and i solve it with the quadratic formula: $x_{1,2} = \frac{-b \pm \sqrt{b^2- 4ac}}{2a} $  But then i have 2 solutions with one negative ex: 6 and -2. The positive solution is right but the negative can’t work because it lend to a negative time. Why there is a « false » solution ?


Is there an upper limit to the number of characters in a question

As a programmer, I would like to know if there is an upper limit imposed on the string length of a question/answer. And if not, how does Stackoverflow achieve unlimited string length in a database.


So I've installed TOR, via the directions   sudo apt-get install tor deb.torproject.org-keyring Reading package lists... Done Building dependency tree        Reading state information... Done deb.torproject.org-keyring is already the newest version. tor is already the newest version. 0 to upgrade, 0 to newly install, 0 to remove and 109 not to upgrade.   But I can not locate my tor browser in apps?


How to get name of variable that was passed as parameter

Is it possible to get get name of variable that was passed as parameter?  As you asked me to explain why I need this, here is my explain. I'm building a testing framweork using selenium. Here is example where I need that name of variable that was passed as parameter.  I have a page object with field:  [FindsBy(How = How.CssSelector, Using = "input[name='sample']")] private IWebElement SampleButton { get; set; }   I'm clicking it like:  Click(SampleButton, nameof(SampleButton));   Here is a body of Click function that u see above:  public void Click(IWebElement element, string elementName)         {             element.Click();             Logger.Log("Click: '{0}'", elementName);         }   Result: Button that was passed to function was clicked and in log file I have "Click: SampleButton"  Now I'm looking how to change Click function that it woul be call like:  Click(SampleButton)   It would look like:  public void Click(IWebElement element)         {             element.Click();             Logger.Log("Click: '{0}'", getNameOfVariableThatWasPassedToThisParameter(element));         }   Expected result of getNameOfVariableThatWasPassedToThisParameter(element) will be string = "SampleButton"  I'm am using things like SendKeys(SampleInput, nameof(SampleInput), valueToSet) and it set value and log where it was set. So I just want to get rid of that nameof(SampleInput). I want to reduce amount of variables than need to be passed to function.


I am trying to create search menu in my website, i am using php and mysqli ,i have created all the credential stuffs which are all required to it but still it showing me some errors,can anyone help me from this. analyze.php    <!DOCTYPE html>         <title>Gtec NetWork</title>     <meta name="viewport" content="width=device-width, initial-scale=1.0">          <link href="asset/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">

             GTEC Network

Home

Boys

Girls

                     <form method="POST" action="search.php">                     Search                             <input type="text" name="keywords" >                             <input type="submit" class="btn btn-primary lg" value="Search">                                                   </form>

        search.php  <?php       require_once 'lib/db.php'; ?><?php     if (isset($_GET['keywords'])) {         $keywords = $db->escape_string($_GET['keywords']);         $query = $db->query("             SELECT *             FROM user              WHERE  registernumber LIKE '%{$keywords}%'             OR username LIKE '%{$keywords}%'              "             );         $run = mysqli_query($query);      }  ?>     <!DOCTYPE html>         <title>Gtec NetWork</title>     <meta name="viewport" content="width=device-width, initial-scale=1.0">          <link href="asset/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">

             GTEC Network

Home

Boys

Girls

                 Found<?php echo $query->num_rows;?> results.                 <?php                       if ($query->num_rows) {                         while($r = $query->mysqli_fetch_array())                         {                         ?>
                             <?php echo $r->username;?>
                         <?php   }                     }?>

         The problem is  Found Notice: Undefined variable: query in C:\xampp\htdocs\php\search.php on line 39  Notice: Trying to get property of non-object in C:\xampp\htdocs\php\search.php on line 39 results.  Notice: Undefined variable: query in C:\xampp\htdocs\php\search.php on line 41  Notice: Trying to get property of non-object in C:\xampp\htdocs\php\search.php on line 41  Please help me


How I can get a Turkish visa to visit Istanbul on a layover?

I am flying to Tbilisi, Georgia with Turkish Airline. My stay in Istanbul is 12 hours. Can I get transit visa to visit Istanbul city ?    I am from Pakistan with Oman employment visa.


So I'm using jquerymobile for an app I'm creating.  I have a link that if all the validation passes I'd like to go through, but if something fails I'd like to redirect.   In the jquery something like this.  Since it is jquerymobile the link will be a new div on the same index.html page - if that helps.  $(#link).click(function(){     if(validation_fails) link_elsewhere;     else return true; }


Vertical centering a container of text not working with margin auto

So I want to have a block of text centered next to an image, and I tried to use margin auto 0px; but it nothing. I also don't understand why the text starts at the bottom of the container instead of the top.  Here is the code:    .feature {   margin: 5px 0px; }  .feature img {   display: inline-block;   width: 49%; }  .feature .feature-detail {   display: inline-block;   width: 49%;   margin: auto 0px; }

Feature Title

Feature Description


python 2d array indexing: setting a value changing whole column?

It might be a very stupid question but I just don't understand this code:  >>> a=[[0]*3]*3 >>> a [[0, 0, 0], [0, 0, 0], [0, 0, 0]] >>> a[0][1]=3 >>> a [[0, 3, 0], [0, 3, 0], [0, 3, 0]]   Why a call a[0][1] will initialize the whole second column to be 3?


Are pie charts, at least the 2d versions, the best choice in some cases?   Or, should they be simply taboo for any serious objective data visualization?


How do I evolve Kadabra to its final form without trading it?

I play Pokemon Emerald on the computer using VisualBoy Advance, so I can't evolve my Kadabra by trading it. Is there any other way I can turn my Kadabra into Alakazam?


How do I change how executable files are handled by the file manager?

When I double click on text files, nautilus asks me what I would like to do with them. I find this to be intrusive, as I just want them to open.  How can I fix this?  Note: This question is a "canonical" question on the subject; edit if needed. Note 2: Text files can be HTML, CSS, TXT, and more.


creating Java program which process output from another Java program

I have a certain Java program which convert an Image and produces the traits of those image (Mean red, Stdev Red, etc) I run the program this way java –jar TheProgram.jar Picture.jpg Which produces this output FileName [feature1,feature2,..]  However I need to process those output into more proper format, I will use Java to process the outputy. The problem is I dont't know how to call the TheProgram.jar inside the Java source code.


Can someone help me with this problem ? I am new to Linux, so I do not know commands and I never did something like installing or compiling with command-line.  I bought WiFi adapter from Edimax, model EW-7811UN for my PC (not laptop, so I do not have wifi card, only ethernet). When I go through guide on CD, I came across a version of kernel. It said I need version 2.6, but I have 3.5.0-22-generic.   I got errors like I do not have file or folder etc. Can someone tell me where I can download compiled driver and where I need to put it? Or some other advice. I don't want downgrade kernel when it is not necessary.


Python: Quotient unequal to a variable with the same value

Am working on a small math-checker using Python and everything works well except of divisions.  Problem: The quotient with two decimals (2/3 = 0.67), float, is equal to an input (0.67). But the if-statement I use to compare a user's input with the result says it isn't equal.   Assumption: the problem is related to float.   My code:  result = float(value0 / value1) result = round(result,2)  value3 = input("Number 1") value3 = float(value3)  if result != value3:     print "Wrong!"     print result elif result == value:     print "Right!"   Of course I could create a function with a different approach, but I am curious to understand why it doesn't work.  If there's a similar thread, please post the link and close this one. Thanks for any help.


Doubt regarding the proof of row rank = column rank

provides two methods to prove row rank of a matrix is equal to its column rank. My doubt is regarding the second method. But the  page mentions that this proof is valid only for real matrices. What part of this proof breaks down if the matrix is complex? I've added the proof here for easy reference.  Proof:    Let $r$ be the row rank of a matrix $A$. Let $x_1, x_2, \ldots x_r$ be a basis for row space of $A$. Claim: $Ax_1, Ax_2, \ldots Ax_r$ are linearly independent (LI). To prove, I need to show that  $$\sum_{i=1}^{r}c_iAx_i = 0 \iff c_i=0, \forall i=1,2,\dots r$$ $$\sum_{i=1}^{r}c_iAx_i = A\sum_{i=1}^{r}c_ix_i$$ Let  $$v=\sum_{i=1}^{r}c_ix_i \implies v \in C(A')$$ $$\sum_{i=1}^{r}c_iAx_i = Av = 0 \implies v \in N(A) $$ $$ \therefore v \in C(A') \bigcap N(A) \implies v = \vec{0}$$ $$ v = \sum_{i=1}^{r}c_ix_i = 0 \implies c_i=0 \forall i $$ Because $x_i$ are LI. This proves $Ax_i$ are LI.  We know that $Ax_i \in C(A)$ and $Ax_i$ are LI, dim($C(A)$)$\ge r$ i.e. column rank is greater than or equal to row rank. By doing the same steps with $A'$, we get that row rank of $A$ is greater than or equal to its column rank. This proves that row rank is equal to column rank.


Are there one or more words that take only a singular form?

In a Cambridge dictionary, it distinguishes a singular form from a countable form, but, in an Oxford dictionary, it only says the word is uncountable or countable.


How to prove that a given ideal is a principal ideal?

I know that principal ideals are ideals which are generated by a single element, but I have no clue how to show that $\mathbb Z: I= \langle 14, 21 \rangle$ is a principal ideal.  Could anyone please give me a rough idea or a hint in the right direction.


How can you get the "real" HttpContext within an ASP.NET MVC application?

Unfortunately, I need to do this.  I'm using ELMAH for my error log.  Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exception.  You used to be able to use   Elmah.ErrorLog.Default   However, this is now marked as obsolete.  The compiler directs me to use the method  Elmah.ErrorLog.GetDefault(HttpContext context)   MVC's context is of type HttpContextBase, which enables us to mock it (YAY!).  How can we deal with MVC-unaware libraries that require the old style HttpContext?


So, who remembers the whole "Pakistan kills YouTube" debacle from February last year? Here's an article on the topic to refresh your memory:    The gist of the story is that Pakistan intended to block YouTube for their national network. They tried to accomplish this by advertising routing information with a higher priority than YouTube's own information, and which mapped YouTube's IP addresses into their network. This route advertisement propagated onto the internet, causing every server in the world to think that the way to get to YouTube was through Pakistan.  My question is: if something like that can happen accidentally through incompetence, could a malicious party do this deliberately? What safeguards are in place to prevent an attack like this? If Pakistan can do this to YouTube by accident, why can't Iran do this to Twitter on purpose?


Recently I discovered that, after years of thinking various software was adding a newline to the end of my files, it was actually Pluma (or Gedit -  same difference) silently adding them all along. Currently I'm working on a website that will have lots of PHP includes, parsing data saved on disk and the likes, so it would make my life a lot easier to do away with the extra line added to the end of each file. As far as I can tell, there isn't a way to stop this behaviour.  I'd like to either get this sorted or find a text editor similar to Gedit without this issue. I don't really want to resort to using Notepad++ via Wine, but that may be an option. Terminal text editors are also a possibility but I'd rather use one with a GUI for anything more than minor edits to files.


How can I easily swap colors / swap channels in Photoshop?

Back before I could afford a Mac I used a PC (when Windows XP ruled the earth). At that time I couldn't afford Photoshop either. So I had a WinXP box with Irfanview installed - and I thought that was pretty cool. Now I have a Mac and PhotoShop but I can't figure out how to do one of the things Irfanview did so easily - swap colors / channels:  What it Does Using those menu items you could take an image like this one:  and make it look like this:  or like this:   How can I do something similar in Photoshop? It seems like it might be really complicated. What if I wanted to make that button another color besides one of the primary channel swaps - like a maroon or aqua - what is the best way to do that in Photoshop? Shouldn't it be especially easy if the image has a (kind of) grayscale background?  ps: Irfanview does not run on Mac without WineBottler or something like that which I don't really want to run.


Can I disable the cache in Chrome for specific hosts?

I like using Chrome as my everyday browser, as well as for web dev work. I'd like to be able to prevent Chrome from caching anything from localhost (or really, any arbitrary host name) so that I don't have to hard-refresh (Ctrl-Shift-R) all the time.  Is this possible? How?


Ubuntu doesn't detect my Windows partition

I have a windows machine with which I want to explore ubuntu. I downloaded and put it on a disk OK. I fixed my boot order and booted into ubuntu. Right there on the screen it asked me if I wanted to install ubuntu. I was feeling optimistic and said yes. Then I got to the part where it wants to know where to put it, but it informed me that there was no other OS on my HD! It wanted to wipe the drive. I got out of there quick and booted back into Windows, just to make sure. Why is it not seeing 9 GBs of Windows and associated programs?  Additionally, is this going to make a partition on my HD? I hope so!


How to add Drag and Drop to Lightning Components?

Can anyone recommend a javascript library that allows drag and drop functionality (desktop and mobile) and works in a lightning component? Maybe point me to a post or better yet, provide some sample code for the cmp and js files.  I've attempted to implement both the  and the  js libraries but while I don't get any errors, they don't seem to fire when I attempt to drag anything. No errors are appearing in the js console either. Running the sortable example in plain html works though.  It's almost like the js libraries are being ignored but I've gotten jQuery to work just fine in the component.


When are objects or something else said to be "first class" in a given programming language, and why? In what do they differ from languages where they are not?  EDIT. When one says "everything is an object" (like in Python), does he indeed mean that "everything is first-class"?


Comma usage with compound sentences {actually compound predicates as per Rob's answer}

Rule 101 of compound sentences is that a coordinate conjunction must be accompanied by a comma most of the time when joining independent clauses, yet I stumble across sentences all that time that seem to abuse this rule. Normally, it's a case of the subject not being present in the second clause, as in the following example:      "They usually start out as an abbreviation, but turn into acronyms   when they become well known."   (taken from the Oxford Style Manual)   To me, this comma cannot be correct because the clause after the comma doesn't contain a subject and therefore cannot be independent (right?). As far as I'm concerned, it's not the 'Comma to set off a contrast rule because I can find plenty of other where 'and' is used and the subject's missing in the second clause.  what's the deal here?   Thanks in Advance for any responses I may receive!


Translate of an ideal by $a$ coincides with the ideal iff  $a \in I$

How  can I show the following?     Show that, if $a$ and $b$ are elements of a ring $R$ and $I$ is an ideal of $R$, then $$a+I=0+I \iff a \in I$$    I am so interested to know the proof.Thanks and good night all!


Group isomorphic to all its proper quotients, and not simple

Let $G$ be a group such that for any proper normal subgroup $H \subset G$, we have $G/H \cong G$ (of course this isomorphism may not be given by the projection $G \to G/H$). Does it follow that $G$ is a simple group? What can we say about such a group $G$ in general?  Notice that $G/H \cong G$ doesn't imply $H = \{e\}$, for instance $z \mapsto z^2$ is a surjective morphism $\Bbb C^{\times} \to \Bbb  C^{\times}$ of kernel $\{\pm 1\}$.


I have an iPad 3, running iOS7. Following some articles I read, alleging to degraded performance undr iOS8, I decided to not upgrade (if anyone can contribute any experience to the contrary - I'd be thanklful).  Recently, when I connected the iPad to my laptop to transfer some files, the iOS8 upgrade file was downloaded off the internet and onto my iPad. I now have a permanent notification asking me to upgrade, not to mention a 3.3GB file stuck on my iPad.  How do I get rid of it? Is there a way to delete it on the device, or do I need to do it through iTunes?


Inexplicable behaviour: round brackets without parameters in C++ primitives/objects initialization

making some simple tries about initializations (and default constructors) of object and primitives in C++, I found a behaviour that I don't understand, so I need an help.  Let's first talk about primitives types.  The code I tested is the following:  int main() {      int i(5);     cout<<i<<endl;      int j();     cout<<j<<endl;      int k;     cout<<k<<endl;      return 0; }   The result I get is this:  5 1 6487956   Obviously I was especting the first result (initialization in object style), and also the third (not initialized value), but the second? About the second, I was especting a default initialization, instead I get a warning that told "the address of 'int j()' will always evaluate as 'true'"... Infact the printed result is 1, but what kind of sintax is the empty round brackets near a primitive variable?  And now about the object, the case is similar... The code is:  class Pluto { public:     int a;     int b;     Pluto() {         a = 0;         b = 0;         std::cout<<"Constructor call"<<std::endl;     } }  int main() {     Pluto p(); }   I have a class with a default constructor inside which I've put a print to underline its invocation, then I declare an object with a similar sintax to the previous case, and I was expecting a call to the default constructor, while I get nothing in output, so the constructor was not called. In a next test, I try to access the members of the object, but I get the error "Field 'a' could not be resolved".  I'm sure that the anwer to my question is stupid and obvious, but now I really can't find it, so thanks to who will help me.


How to lock the position and size of a text-frame in InDesign CS6?  I would like to lock those properties in each page in Indesign. Sometimes the designers get wrong and drag and drop the text frame without noticing.  Then we have to remove the page and create again. If this is not done when I update the master will not update the size and position of the text frame


I would like to learn how to use it so I can start to use the terminal more.


Minimum bounty on a question is now 100 rep?

The first time I started a bounty I was able to choose 50, but every bounty since then the minimum is 100.  I still see other bounties of only 50.  Any idea of why I don't have the 50 option any more?  (This is across Stack Overflow and Programmers, at least.)  This is the latest answer I considered placing a bounty on    That particular question does have an answer from me.


How to use scale-rule based renderer in QGIS?

I wish to render a shapefile of buildings such that at scales below 1:5000, they have a border, and above 1:5000, they do not have a border.  For this, I went into layer properties, selected Rule-Based, and then selected the current Rule and then went to Refine Current Rules>>Add Scales to rule. After this I set the symbol for scales >5000, like I wanted.    Here is my layer properties.    You can see that there is an initial symbol. How Do I remove this? This causes problem because it is present behind the symbol; for example You can see the boundary here even though the scale is greater than 1:5000:    I have found that that if I remove the boundary of the first symbol(the one in blue), the layer appears as expected at scales >1:5000. This seems like a workaround rather than the straightforward procedure. What is the correct procedure to use scale -rule based renderer in QGIS?


Proof of the relationship between fibonacci numbers and pascal's triangle, without induction

I must prove, without induction, the relationship above is:  $$\sum _{ k=0 }^{ \lfloor n/2\rfloor}{ \binom{n-k}k } ={F}_{n+1}$$  I understand how the equation works but I have no idea how to prove it.  Thanks for any help!


Ubuntu 16.04 with AMD Radeon HD-6450 - what are my options?

I've just upgraded to 16.04 and my graphics card, AMD Radeon HD-6450, isn't holding up so well. I can't use my dual screens, and cannot adjust the warped screen resolution.   What are my options?


Using a .htaccess to RewriteRule and Redirect 301 at the same time?

I have a couple of specific URLs that I want to display differently on my website, like this:  RewriteRule ^contact$ contact.php   To get ride of the ".php" extension.  And to be SEO friendly (to avoid having 2 different URLS pointing to the same page), I also want to do a 301 redirect between the old URL and the new one:  Redirect 301 /contact.php http://www.example.com/contact     Each of the lines above works well separately. But if I add them both in my htaccess, I have a redirect loop, and nothing is displayed on my website. How can I fix that?  In the end, if I either type "/contact" or "/contact.php", I want to see the contact page with the url "/contact".


What is the deeper intuition behind the symmetric proposal distribution in the Metropolis-Hastings Algorithm?

In the Metropolis-Hastings Algorithm, one usually considers a symmetric proposal distribution:  $$ J(\theta^*|\theta^{(s)}) $$  where $\theta^*$ is a proposal point and $\theta^{(s)}$ is the accepted value at iteration $s$. The symmetry states that:  $$ J(\theta^* = \theta_b|\theta^{(s)}= \theta_a) = J(\theta^* = \theta_a|\theta^{(s)}= \theta_b) $$  An example usually stated is a Normal or Uniform distribution. My questions are:  1) the Normal and Uniform are symmetric probability density functions themselves, is this notion of "symmetry" the same as the "symmetry" above?  2) Is there an intuitive way of seeing the deeper meaning behind the symmetry formula above? Why is it needed?  Thanks!


In a little project of mine I have situation like this:  // Header file template <typename T>; class AClass { public:     virtual void doSomething() const; private:     std::vector<T> *v; };  // separate cpp file template <typename T> void AClass<T>::doSomething() const {     // use the vector here }  // main.cpp #include "AClass.h"  int main() {     AClass<int> anObject;     anObject.doSomething();      return 0; }   This piece of code compiles fine but is unable to link because in the main file the linker is unable to find an implementation for AClass unless I add this to the cpp file:  template class AClass<int>;   But that is just stupid, because it takes away the advantage of using templates.  Now the question: Is there a way to solve the linking problem without using the class forwarding in the cpp file or is this just impossible to have something like this in a separate .h file and .cpp file? Putting the forward class declaration is not an option for me.  I'd really like to have some clarification on this.  Thanks


I have a project where I want to get numbers only as input so I'm using a input of type number but this also allows decimal seperators etc. how would I prevent the use of , . and e.  I have looked around and couldn't find one that gave the desired result, sinds they either didn't block the decimal inputs, or would allow a user to still paste it in the field.  I have javascript and jquery that I can use, but I do not want to use an external librairy.  If anyone would be able to help me that would be appriciated.  function LimitKeys($id) {             $field = document.getElementById($id);     $value = $($field).val(); //if the value contains multiple e , or . the value is no longer valid and gives me blank     console.log($value);     $regex = /[^\d]/;      $val = $value.replace($regex, "");// cant replace in blank     console.log($val);     //$($field).val($val); }  $('.number-only').keypress(function (event) { //sinds it's on keypress it won't catch the paste of data.     console.log(this.value);     var regex = new RegExp("^[0-9]+$");     var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);     if (!regex.test(key)) {         event.preventDefault();         return false;     } });


Working independently where you should work collaboratively

What phrase or word is used to describe someone, specifically in a vocational context,  who is making decisions without first discussing it with a superior or other members of the team?


How many derangements are there of the word MATHEMATICAL?

I know how to get the number of derangements for a word that has no repeating letters for example "guitar":  $$6!\left(\frac{1}{0!}-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}+\frac{1}{6!}\right)$$  I also know how to get the number of derangements of a word with one set of repeating letters, such as "bottle", as this has been answered in another post.    However, when there are MULTIPLE sets of repeating letters, as in "MATHEMATICAL" (2 M's, 2 T's, and 3 A's), it becomes a bit more complicated considering if the first M is in the second M's place, according to the formula it's a derangement, but it actually is not. Could anyone help me out with this? Thanks!


Python: Test server availability without using ping

For a small script i have to test if a server i'm trying to download a file from is available to prevent errors. I Tried pinging the server (school website), but pinging is not allowed so i wouldn't get any responses. I could try pinging google.com, but this only checks the client side of the connection. pinging also doesn't work when i'm at school because of the same reason.  Code i am using now:  import subprocess  try:     subprocess.check_output(["ping", "-n", "1", "-w", "1000", "google.com"]) except subprocess.CalledProcessError:     # Code to run when no internet connection is available     return False   I was wondering if there's another way to check server availability without using ping, but by still using python. For the solutions I was able to find only i couldn't find a way to implement it in python (by my experience)


Which copy will be used when RAID1 loses a piece of data?

The case of complete drive failure is pretty clear for RAID1: the faulty drive simply does not work and data is being read from the good one.  Now the other real situation: the drive works, but some of it's data becomes slightly, uh ... different from the original data due to some local magnetic surface failure or SSD cell failure. One drive in RAID1 contains real data, other contains corrupted data.  How Windows 7 software RAID1 detects which copy to use?


Is there any way to get the optimization time in PostgreSQL?

I'd like to see how long it takes to optimize a query. Does PostgreSQL support this feature?


Any app that tells me to take regular breaks from working?

Various health reports indicate that sitting for too long working on the computer is not good for health. I need an app that can tell me to take a break, for example once every hour of continuous work.  It would be optimal if it can automatically detect how long it has been since my display was last unlocked or logged in and count from that time. When I take a break, I will lock the display and unlock it when I'm back.  Is there any such app for Ubuntu which help the user take regular breaks?


can I put a double 50 amp pole in a 100 amp box


Non constant entire function satisfying two conditions

Let $f$ be a non constant entire function satisfying the following two conditions: a) $f(0)=0$ b) For every positive real number $M$, the set $\{z:|f(z)|<M\}$ is connected. Prove that $f(z)=cz^n$ for some constant $c$ and positive integer $n$. Since zeroes of an analytic function are isolated, I can take a closed disc of positive radius in which $0$ is the only zero of $f$. The conclusion I need, suggests that I must prove that $f$ has a pole at infinity. That will prove that $f$ is a polynomial. In addition I must prove that $0$ is the only zero for $f$. Is there any more elegant way of approaching the solution? Help me to prove the two assertions I made above.


select multiple columns with aggregations

I have a table with some fields (time, text, type). I want to build a query to return for every type the text that was introduced with the maximum value of time. Oracle has some restrictions and it is not simple to build the query without some tricks.  I am struggling to get the right query, can anyone help me with it?  TIME TEXT TYPE -------------------------- 03.05.2020 AA 2 02.04.2020 BB 2 01.04.2020 CC 1   I want a query that returns  03.05.2020 AA 2 01.04.2020 CC 1


Black screen after login on main account, after LaTex install failed

I recently tried installing LaTex on my Ubuntu 13.10 system. The installation failed but I can't remember the error-messages. After the failed installation the memory cache was quite full and the system was running slow. I therefore restarted the system. However, after reboot, the screen turns black with only the mouse pointer showing after I have typed in my password and hit enter on the login screen.  The weird things is that Guest Session login is seamless, but I cant access anything from there.


Proving a particular subset of $R^n$ is closed

Let $S,X$ be subsets of $R^n$ given by $$S=\{(a_1,a_2,\dotsc,a_n)\in R^n|\sum a_i^2=1\}$$ $$X=\{(b_1,b_2,\dotsc,b_n)\in R^n|\sum\frac{b_i}{i}=0\}$$  Then prove that $S+X$ is a closed set in $R^n$.


Why should there be electrostatic equilibrium inside a conductor?

I have been trying to understand why the net electric field inside a conductor is zero regardless of the exterbal electric field. But why should equilibrium ever be attained?


I want to install a package on Ubuntu 16.04, but receive an error when performing this command: $ sudo apt-get install libavcodec-dev libsdl1.2-dev xsltproc libbullet-dev libsdl1.2-dev libgoogle-glog-dev protobuf-compiler python-wstool  E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?  What seems to be the problem?


How to prove that $x=0.1234567891011\dots $ is irrational?

I'm in $9th$ class and I was wondering how to solve this problem. I only know how to prove that $0.1010010001\dots$ is irrattional.


Updating entities in response to collisions - should this be in the collision-detection class or in the entity-updater class?

In a game I'm working on, there's a class responsible for collision detection. It's method detectCollisions(List<Entity> entities) is called from the main gameloop.  The code to update the entities (i.e. where the entities 'act': update their positions, invoke AI, etc) is in a different class, in the method updateEntities(List<Entity> entities). Also called from the gameloop, after the collision detection.  When there's a collision between two entities, usually something needs to be done. For example, zero the velocity of both entities in the collision, or kill one of the entities.  It would be easy to have this code in the CollisionDetector class. E.g. in psuedocode:  for(Entity entityA in entities){     for(Entity entityB in entities){         if(collision(entityA, entityB)){             if(entityA instanceof Robot && entityB instanceof Robot){                 entityA.setVelocity(0,0);                 entityB.setVelocity(0,0);             }             if(entityA instanceof Missile || entityB instanceof Missile){                 entityA.die();                 entityB.die();             }         }     } }   However, I'm not sure if updating the state of entities in response to collision should be the job of CollisionDetector. Maybe it should be the job of EntityUpdater, which runs after the collision detection in the gameloop.  Is it okay to have the code responding to collisions in the collision detection system? Or should the collision detection class only detect collisions, report them to some other class and have that class affect the state of the entities?


How can one shutdown a PC using the keyboard?

I would like to find a way to speed the shutting down process up by using shortcut keys.  I installed Ubuntu 14.10 - Utopic Unicorn on a Compaq HP, but I am not able to do that by following the methods used for the previous Ubuntu versions.  Is there a way to do that?


"He committed a crime killing/by killing a bird"

Which wording with kill should be used here:     He committed a crime (killing/by killing) a bird.   My guess is the answer would be by killing. But I am really confused with the answer killing.   My questions relating to this sentence are:   Which one is correct and why? (or are they both correct?) If one of them is incorrect, why is it incorrect? (or, if both of them are, why?) If they are both correct, what is the difference in meaning? If they are both correct, what is the difference in their grammar?


I am not a professional photographer, I am just taking pictures as a hobby. I take portraits, landscapes, and some wedding pictures. I am using a Nikon D750 camera, should I be shooting in jpeg fine or raw?


How can I search for a package which provides an uninstalled command?

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


Dumb Question - Can I undelete files in a directory I deleted in Unix - Centos. Is this possible ?


I am currently reading 'Vector Calculus, Linear Algebra, and Differential Forms: A Unified Approach' by J. Hubbard and B. Hubbard.  In the first chapter, there is the proposition:     Let A be a square matrix. If $|A|<1$, the series $$S=I+A+A^2+\cdots$$   converges to $(I-A)^{-1}$.   The proof first shows that $$S_k(I-A)=I-A^{k+1}$$ and similarly $$(I-A)S_k=I-A^{k+1}$$ where $S_k$ is the sum of the first $k$ terms in the series.  Then it shows that $$|A^{k+1}|\leq|A|^{k+1}$$ and according to the proof in the book, it can be said from this that $\lim_{k\to \infty}A^{k+1}=0$ when $|A|<1$.  Consequently, $S(I-A)=I$ and $(I-A)S=I$.  Therefore $S=(I-A)^{-1}$.  However I do not understand how it can be said that $\lim_{k\to \infty}A^{k+1}=0$ when $|A|<1$.  In addition, all similar propositions I have found on the internet state $|\lambda_i|<1$ as the necessary and sufficient condition.  How does this relate to the condition, $|A|<1$?


Guys I have a question:  39268112/50000000*4 is exactly 3.14144896  But when i write a code in c++ as such:  #include<iostream.h> using namespace std; int main() {    int a = 39268112;    int b = 50000000;    cout << (double)a / (double)b * 4; }      But, I get 3.14145.   This is not the exact value.  So my question is:      how can i always display the exact value of a double division?   EDIT: I am aware of the setprecision option, the problem here is just, that I have to know the exact value of the result to know how many decimals the result will have. Since I wrote a program, which approximates PI based on dart throws, the two integers a and b can have much bigger values than 39268112 and 5000000.  If I would use   cout << setprecision(some number) << (double)a / (double)b * 4;   I need to know the exact result first, before I can even enter the argument in setprecision()  My edited question would be if there is a way to automaticly put an argument in setprecision() so that it can display the exact result, without having to calculate it myself first.


Finite Markov Chain: $ X_n = X_{n-1}+B_{n} $ with two recurrent states.

I have a simple and rather basic question regarding Markov Chains: let $B_{n}$ be an i.i.d process that gets the values $\{-1,1\}$ with probability of $\frac{1}{2}$. We define the following Markov Chain above $\{0,1,...,K-1,K\}$ states: $X_{n}=\begin{cases} X_{n-1}+B_{n}, & 0<X_{n-1}<K\\ X_{n-1}, & X_{n-1}=\{0,K\} \end{cases}$ The State Diagram for ($ p=\frac{1}{2} $):  I'm interested in finding the transition probability: $\rho_{ji}=P\{\exists n>0:X_{n}=i|X_{0}=j\}$ for $i,j\in\{1,2,...,K-1\}$ which is the probability that the process $X_{n}$ reaches state $i$ at some time $n$, given that the initial state was $j$. first, I was able to calculate: $\pi_{k}=\rho_{k0}=P\{\exists n>0:X_{n}=0|X_{0}=k\}=\begin{cases} 1-\frac{k}{K}, & 0<k<K\end{cases}$ which is the probability to reach state $0$ given that the initial state was at state $0<k<K$. this was done by assuming a general solution $\pi_{k}=a\lambda^{k}+b$, and solving an equation that has a relation between $\pi_{k,}\pi_{k-1,}\pi_{k+1}$, which gives $\pi_{k}=1-\frac{1-\lambda^{k}}{1-\lambda^{K}}$ where $\lambda={{\frac{p}{1-p}} }$. taking the limit $\lambda\rightarrow1$ , which suits our case, (in which $p=\frac{1}{2}$), gives the result for $\pi_{k}$ that I wrote above. I want to use $\pi_{k}$ to find an expression for $\rho_{ji}$ for $i,j\in\{1,2,...,K-1\}$. I argue that, in case $j>i$: $\rho_{ji}=P\{\exists n>0:X_{n}=i|X_{0}=j\}=P\{\exists n>0:X_{n}=0|X_{0}=|j-i|\}=\pi_{|j-i|0}$ from symmetry. which means moving (to the left) from state $j$ to $i$ (where $i,j\in\{1,2,...,K-1\}$), is equivalent to moving from state $|j-i|$ to state $0$. thus, by using the previous solution for $\pi_{k}$, one can find $\rho_{ji}$ for $j>i$ case: $\rho_{ji}=P\{\exists n>0:X_{n}=i|X_{0}=j\}=P\{\exists n>0:X_{n}=0|X_{0}=|j-i|\}=\begin{cases} 1 & |j-i|=k=0\\ 1-\frac{k}{K} & |j-i|=k\in\{1,..,K-1\}\\ 0 & |j-i|=k=K \end{cases}$ I somehow concluded also that $\rho_{ji}$ for $j<i$ should be equal to to the expression I got fior $j>i$ case, since intuitively, it sounds right to me. but turns out, according to an official solution (which wasn't really detailed), that the final answer for case $j<i$ (moving to the right) should be: $\rho_{ji}={ {\frac{j}{i}} }$ I can't figure out why, and I would be glad for some enlightenment. Note: it's possible that there is a mistake in the official solution, and I hope you can help me verify that.   Modification: Thanks to Misha's Answer, I figured out that the reason behind replacing $K$ with $K-i$ is the following: for example for $i<j:$ we are interested in defining a "new" Markov Chain depending on the distance we want to move from $j$ to $i$. (from right to left) for example if $K=6$ and we want to move from $state$ $j=5$ to $state$ $i=2$ , its equivalent to moving from $state$ $j=$$3$ to $state$ $i=0$ in a "smaller" Markov Chain that has the state $K-i$ at it's far right instead of $K.$ (which is the state we are never interested to visit, since our goal is to meet the wanted state which happens to be on the left). in other words, the Markov chain $\{0,...,K-i\}$ includes all the possible traveling distances to state $0$ starting from the state $\{K-i-1\}$, and the largest distance is moving $\{K-i-1\}$ $states$ down to state $zero$, which is equivalent to the largest traveling distance from $state$ $j=5$ down to $state$ $i=2$, which is $\{j-i\}$.


Showing that $ \int_{0}^{1} \frac{x-1}{\ln(x)} \mathrm dx=\ln2 $

I would like to show that   $$ \int_{0}^{1} \frac{x-1}{\ln(x)} \mathrm dx=\ln2 $$  What annoys me is that $ x-1 $ is the numerator so the geometric power series is useless.  Any idea?


I have a web service load driver that's a Windows Script File (WSF), that includes some VBScript and JavaScript files. My web service requires that the incoming message is base64 encoded. I currently have a VBScript function that does this, but it's very inefficient (memory intensive, mostly due to VBScripts awful string concatenation)  [Aside; Yes, I've seen . The concatenation is happening in a loop across messages that are 1,000's to 10,000's bytes in size.]  I've tried using some custom string concatenation routines; one using an array and one using ADODB.Stream. These help, a little, but I think it would help more if I had some other way of encoding the message rather than via my own VBS function.  Is there some other way of encoding my message, preferebly using native Windows methods?


How to derive the formula for the sum of the first $n$ perfect squares?

How do you derive the formula for the sum of the series when $S_n = \sum_{j=1}^n j^2$?  The relationship $(n, S_n)$ can be determined by a polynomial in $n$. You are supposed to use finite differences to determine the degree and then use a calculator to derive the function. But how?


Mathematical importance of the golden ratio

I know the golden ratio is the limit of the ratios of consecutive Fibonacci numbers and that it appears when studying many related combinatorial objects (such as the sequences of zeros and ones with no consecutive ones and the Fibonacci substitution $1 \mapsto 10$, $0 \mapsto 1$). I have also read  which states that it is, in some sense, the hardest irrational to approximate by rationals. I'm also familiar with its geometrical definition.  Are there any other interesting properties or applications of this number within mathematics, maybe outside of combinatorics? I'm not interested in its applications within physics, aesthetics or any other discipline.  Edit: This is not a duplicate, since I'm explicitly asking for a different answer than the one given for the other question.


Way to quickly select random objects with variations in foreground/background

So, I'm Trying to find a way to select areas of images that have similar levels of contrast, but with variations of color.  Is there a way through scripting or otherwise in Photoshop to select something as wispy as clouds and extract most of them from the sky?  I've played with the lasso longer than any cowboy ever has and I don't believe in magic after I've failed so many times with the wand. I don't see a way to make PS perform as desired (consistent or fast).    Am I missing something or is this genuinely difficult?


Get the filename from wget URL --trust-server-names

A lot of website redirect URL to let you the last version of a binary.  For example:  wget https://download.mozilla.org/?product=firefox-aurora-latest-l10n&os=linux64&lang=fr   Will let you download the latest Firefox Developper Edition. Output file will be "firefox-50.0a2.fr.linux-x86_64.tar.bz2".  But  wget https://download.mozilla.org/?product=firefox-aurora-latest-l10n&os=linux64&lang=fr -P $HOME   will leads to an output filename like: "?product=firefox-aurora-latest-l10n&os=linux64&lang=fr".  So I will use:  wget https://download.mozilla.org/?product=firefox-aurora-latest-l10n&os=linux64&lang=fr -P $HOME --trust-server-names   to redirect to the good file name: "firefox-50.0a2.fr.linux-x86_64.tar.bz2".  But on the next update the filename will be different.  I'm currently writting a script so I need to download the file with the good filename.  My question is:  How can I get the downloaded filename in a $var in order to use it next for example to extract the archive?  Note : I can't use basename as the name is not in the URL.  Note 2 : I use --trust-server-names because --content-disposition is experimental and not reliable.


How prove this $\sum_{k+j=n,0\le k,j\le n}\binom{2k}{k}\binom{2j}{j}=4^n$

Show that $$ \sum_{k\ +\ j\ =\ n\atop{\vphantom{\LARGE A}0\ \le\ k,\phantom{A} j\ \le\ n}}{2k \choose k}{2j \choose j} = 4^{n} $$  I think use integral solve it. But I don't it,and this problem is .  Thank you


Suppose that $5\leq q\leq p$ are both prime. Prove that $24|(p^2-q^2)$.   This is what I got so far. I figured that since $p,q$ are bigger than $5$, there are only odd primes for this conjecture. Then I can rename $p=2m+1,q=2n+1,m,n∈Z$.  We want to show $(p^2-q^2 )=24k,k∈Z$. By substituting $2m+1$ for $p$ and $2n+1$ for $q$, we get  $((2m+1)^2-(2n+1)^2)$. If we expand it, we get $4(m^2+n^2+m-n)$ Q. I think I can make $4(m^2+n^2+m-n)$ look like $24k$. How should I approach ?  And my prof. commented that "I would take this proof in small steps.  Rather than trying initially to prove that $24 | p^2-q^2$, look at the progress you already have.  You proved $4 | p^2-q^2$.  Can you prove 8 is a factor?  What about 3?  Then see if you can put together what you have to get 24 as a factor."  I am stuck here. Any helps?


I'm studying the book A Primer for the Mathematics of FinancialEngineering, along with it's solution guide. I've ran into trouble with the solution to question 7 in chapter 1.    The problem is:  Show that $(1+\frac{1}{x})^x < e < (1+\frac{1}{x})^{x+1}$ .   Specifically, I'm having trouble with one step in the solution.    It says that  $$x\ln\left(1+\frac{1}{x}\right)<1<(x+1)\ln\left(1+\frac{1}{x}\right)$$  can be written as   $$\frac{1}{x+1} <\ln\left(1+\frac{1}{x}\right)<\frac{1}{x}, \forall \ge 1.$$  How can the first equality (or is it inequality?) be written as the second?


How to show $\mathbb{Q}(\alpha^{4})=\mathbb{Q}(\alpha)$?

From Berkeley Problems in Mathematics, Spring 1999, .  Let $f(x)\in \mathbb{Q}[x]$ be an irreducible polynomial of degree $n\ge 3$. Let $L$ be the splitting field of $f$, and let $\alpha\in L$ be a zero of $f$. Give that $[L:\mathbb{Q}]=n!$, prove that $\mathbb{Q}(\alpha^{4})=\mathbb{Q}(\alpha)$.   (BELOW IS NONSENSE, SHOULD BE IGNORED)  Following Gerry Myerson's advice, since $L$ is the splitting field of $f$, $L$ must be Galois over $\mathbb{Q}$. Thus the Galois group for $[L:\mathbb{Q}]=S_{n}$. Gerry now asserts that either $\mathbb{Q}(\alpha^{4})$ is of degree 2 over rationals or it must be $\mathbb{Q}$. But assuming this one can rule out the case $\mathbb{Q}$, since this would imply $\alpha$ is the root of a 4th or 2nd degree polynomial over $\mathbb{Q}$. But we know $n\ge 3$. So $\alpha$ must be the root of a 4th degree polynomial. We know $S_{n}$ has normal subgroups $A_{n}$ when $n\not=4$ and $V,A_{4}$ when $n=4$. I do not know how to proceed any further.   Now assuming $\mathbb{Q}(\alpha^{4})$ is a degree 2 abelian extension over $\mathbb{Q}$. We should have a chain of normal extensions $\mathbb{Q}(\alpha)\supset \mathbb{Q}(\alpha^{2})\supset \mathbb{Q}$. This would imply $S_{n}$ has a normal subgroup which has a normal subgroup. But we know $A_{n}$ for $n\ge 5$ are simple. So the only possibility is $\mathbb{Q}(\alpha)$ has a Galois group isomorphic to $V$. In this case $n=4$ as well. I can only proceed to here.


It would be nice if you could pick which profiles to show on your combined flair image. Or to create multiple combined flair images with different associated profiles.  I'm suggesting this because I believe not all SE sites are relevant to each other. I'd like to use a combined flair for SO, Programmers.SE and Code Review, but not other SE sites I'm active on.


Invariant subspaces of specific dimension

Could any one just tell me a sketch of the proof of the followings?  $1$. If $n>1$, does every linear transformation on $\mathbb{R}^n$ have an invariant subspaces of dimension $2$?  $2$ Is there a vector space $V$ and a linear transformation $T$ on $V$ such that it has exactly $3$ invariant subspace?  Thank you!


I wish to install the newest Ubuntu 14+ on a 32 GB USB Stick. I want to boot a fully operating ubuntu OS right but off the stick itself How do I do this? Thanks


Running a mono program without typing in 'mono foo.exe'

When running a .net program on Ubuntu I have to type in "mono foo.exe" instead of just foo.exe or double-clicking the icon. Is there any way to just run foo.exe?


What is C++ global variables usage risk vs. C?

Everywhere I read, people advise against using global variables. If the program consist of single cpp file, will using global variables still be a risk?  Will using global variables in C have the same hard-to-find bugs?


How to Understand the Relationships Among Random Variables, Samples, and Populations?

I am trying to understand the relationship of a Random Variable to a population and random samples. I understand that a Random Variable is a function that maps each event in a sample space to a number. In this context, what would be a sample space and mapping? Would each sample be governed by the probability mass function?  Do we think of each sample as a Random Variable that takes on values from a population (sample space) randomly?   Or do we think of a population as a Random Variable and our sample as a random collection of those points?  I would appreciate if you can explain this to someone who is new to mathematical statistics. Thank you!


I am trying to load content as the user scrolls from my database. I am trying to load 10 items at a time in order. currently I have achieved everything I want to do except I am loading the first 10 items every time. I don't really know how to keep track of what items were loaded last. If I made a variable it would reset anyways everytime the script is called.  What do I need to change in order for it to load the next 10 items instead of the first 10?  php:  <?php     // database connection info     $conn = mysql_connect('localhost','root','') or trigger_error("SQL", E_USER_ERROR);     $db = mysql_select_db('test',$conn) or trigger_error("SQL", E_USER_ERROR);      //offset     $offset=0;     // number of rows to show per page     $rowsperpage = 10;      // get the info from the db      $sql = "SELECT ID, confession, image FROM test LIMIT $offset, $rowsperpage";     $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);      // while there are rows to be fetched...     while ($list = mysql_fetch_assoc($result)) {         echo '
';         echo "
";         echo "
" . '' . "
";         echo "
" . "#" . $list['ID'] . ": " . $list['confession'] . "
	";         echo "
";         echo "
";         echo "
";         //next ten rows         $offset+=10;     } ?>   javascript:    //load content as page scrolls   function yHandler() {        var content = document.getElementById('content');       var contentHeight = content.offsetHeight;       var yOffset = window.pageYOffset;       var y = yOffset + window.innerHeight;        if (y >= contentHeight) {           // Ajax call to get more dynamic data goes here           content.innerHTML += '

';           document.onload = $.post('test5.php', function (data) {               $('.newData').html(data);           });       }   }   window.onscroll = yHandler;


Why Can't Palpatine and Maul use the Force to stop themselves from falling?

Palpatine tossed around Senate "pods" with no problem, Yoda picked up X-wings and such, and there are many other examples of pretty impressive levitation feats. So why couldn't Sidious/Palpatine stop himself from falling to his death? Why couldn't Maul levitate himself away instead of falling to his (assumed for a while until The Clone Wars) death?  Is it a Sith thing?


Topology - closures of intervals with the order topology

a question from my h.w.:  Let $(X,<)$ be a totally ordered set. Lets examine $X$ with the order topology. a. Prove that $\overline{(a,b)} \subseteq [a,b]$ (where the overline denotes closure of the set). Give an example where the inclusion is strict. b. Give necessary and sufficient conditions such that $a\in\overline{(a,b)}$ and such that $b\in\overline{(a,b)}$  So I've managed a. easily enough. I think a proper example of strict inclusion would be a finite set - say $\{1, 2, 3, 4, 5\}$ with the obvious order. Then $(2,4)=\{3\}$ so indeed $ \overline{(2,4)} = \{3\}$ and not $[2,4]$. I'm stumped about the conditions though. Can anyone give me some help? Thanks!


How to fix GRUB's "file not found." error

I see this:  GRUB loading. Welcome to GRUB!  error:file not found. Entering rescue mode... grub rescue> _   I tried using the Windows installation disk but it didn't work.  I also tried reinstalling Kali or Debian but they didn't boot to the installation part and it also doesn't want to boot the original operating system.


$-1=(-1)^1=(-1)^\frac{2}{2}=((-1)^2)^\frac{1}{2}=\sqrt{(-1)^2}=\sqrt{1}=1$  This proof bugs me for the following reasons:   Mathematicians have defined the symbol $\sqrt{}$ (Named the principal square root) to mean 'take only the positive square root of the number under the radical' This makes it so that the $y = \sqrt{x}$ is a function and therefore for every x-value (input) there is only 1 y-value (output). Therefore $\sqrt{x^2}=|x|$ due to the above definition. But then this means $\sqrt{(-1)^2} = |-1| = 1!!!!$   I really don't understand what's wrong with the above proof, the only way this could make sense is to define $\sqrt{a} = \pm k$ where the symbol know gives rise to two solutions to the equation, but then y = $\sqrt{x}$ is not a function and is simply a relation.   If we have $\sqrt{a}=\pm k$ then $\sqrt{(-1)^2}$ can be equal to -1 as well and then $-1=(-1)^1=(-1)^\frac{2}{2}=((-1)^2)^\frac{1}{2}=\sqrt{(-1)^2} = -1 = -1$ and everything works out fine.  Side Note: Why do we even want y = $\sqrt{x}$ to be a function anyway? What's the harm in defining $\sqrt{x} = \pm k$ where y = $\sqrt{x}$ is not a function?     Proof for $\sqrt{x^2}=|x|$  Let k = $\sqrt{x^2}$ where k is a constant.  $k^2=(\sqrt{x^2})^2=(((x^2))^\frac{1}{2})^2$  $k^2=x^2$  $k^2-x^2=0$  $(k+x)(k-x)=0$  $k = x$ or $k=-x$  But $\sqrt{a}>0$ for $a>0$ by definition of the principal square root.  $\therefore k \neq-x$  In order to make this identity work properly, an absolute value sign is required.  $\therefore \sqrt{x^2}=|x|$    Btw, my question is not the same as why $\sqrt{-1\times-1}\neq(\sqrt{-1})^2$ as I am not using the property $\sqrt{a}\sqrt{b}=\sqrt{ab}$ here and I am not bringing up the concept of imaginary numbers.


Did the moment when the Chinese general tells his phone number actually happen?

In the movie Arrival, the main character has dream-like premonitions of events that happen later.  She also has what is apparently a premonition in which she meets the Chinese general at a formal state function, and he tells her his private phone number. Then after waking from this premonition, she is able to recall the number, even though the general has not actually told her it yet.  Overall, if I recall correctly, all her other premonitions ended up happening -- so did the moment when the general tells his number also happen? (I ask because the conversation about the number would seem unnecessary once she had learned the number from her premonition)


The question is, "We might expect method3 to run faster than method2, why is that?" but I have no idea. It seems like both methods do the same amount of operations. Could someone please enlighten me?      ArrayList<Person> method2(Person x, ArrayList<Person> people){     ArrayList<Person> friends = new ArrayList<Person>();     for (Person y : people) if (x.knows(y)) friends.add(y);     return friends;   }   ArrayList<Person> method3(Person x, ArrayList<Person> people){       ArrayList<Person> friends = new ArrayList<Person>();       for (int=0; i<people.size(); i++){          Person y = people.get(i);         if (x.knows(y)) friends.add(y);     }     return friends; }