Recover pictures from damaged phone
iPhone 4 water damage - how to recover data?
Choosing variables to include in a multiple linear regression model I am currently working to build a model using a multiple linear regression. After fiddling around with my model, I am unsure how to best determine which variables to keep and which to remove.  My model started with 10 predictors for the DV. When using all 10 predictors, four were considered significant. If I remove only some of the obviously-incorrect predictors, some of my predictors that were not initially significant become significant. Which leads me to my question: How does one go about determining which predictors to include in their model? It seemed to me you should run the model once with all predictors, remove those that are not significant, and then rerun. But if removing only some of those predictors makes others significant, I am left wondering if I am taking the wrong approach to all this.  I believe that  thread is similar to my question, but I am unsure I am interpreting the discussion correctly. Perhaps this is more of an experimental design topic, but maybe someone has some experience they can share. What's a good SSH tunneling client for OS X? I've been using SSH Tunnel manager to easily set up and stop port tunneling over SSH to various servers at my company. That saved me the pain of opening up a new terminal window which will hang out there just for the sake of having a tunnel open.  This worked great (well , sort of) but SSH Tunnel Manager is a PowerPC application. With Lion, it is not supported any more.  What is a good replacement? Is $(\mathbb{R}^2, lexicographic) \cong (\mathbb{R}, discrete)\times (\mathbb{R}, usual)$? I have the following question:  Is $(\mathbb{R}^2, lexicographic) \cong (\mathbb{R}, discrete)\times (\mathbb{R}, usual)$?  Note: the symbol $\cong$ denotes a homeomorphism between topological spaces  What I think:  I think that in fact there is a homeomorphism between those spaces, because is possible to express the lexicographic order as union of vertical lines with open extremes, I mean this is a basis for the lexicographic order. If I consider the Identical function I have the homeomorphism. Am I right? How can I model flips until N successes? You and I decide to play a game where we take turns flipping a coin. The first player to flip 10 heads in total wins the game. Naturally, there is an argument about who should go first.  Simulations of this game show that the player to flips first wins 6% more than the player who flips second (the first player wins approx 53% of the time).  I'm interested in modelling this analytically.  This isn't a binomial random variable, as there are no fixed number of trials (flip until someone gets 10 heads). How can I model this?  Is it the negative binomial distribution?    So as to be able to recreate my results, here is my python code:  import numpy as np from numba import jit   @jit def sim(N):      P1_wins = 0     P2_wins = 0      for i in range(N):          P1_heads = 0         P2_heads = 0         while True:              P1_heads += np.random.randint(0,2)              if P1_heads == 10:                 P1_wins+=1                 break              P2_heads+= np.random.randint(0,2)             if P2_heads==10:                 P2_wins+=1                 break     return P1_wins/N, P2_wins/N   a,b = sim(1000000) test fails because of TestMethod do not support getContent call My below test fails because of Run Failures: TestRangehoodObjectionSheet.RangehoodObjectionSheetTest Methods defined as TestMethod do not support getContent call. I added the Blob thinking it might resolve but it doesn't work. What could be the problem here? Have I used the Blob correctly?  @isTest public with sharing class TestRangehoodObjectionSheet {      static testMethod void RangehoodObjectionSheetTest() {             String Build                = NBATRecords.getIdFromDeveloperName('Plan_Reviews__c','Building_Plan_Review');             Account a = new Account(Name = 'Test1' ,Type = 'Lead Acct',BillingState = 'CA',Industry = 'Business Services');             insert a;              Establishment_Record__c er = new Establishment_Record__c(Account__c=a.Id ,Project_Name__c = 'TestPreet',PremiseStreet__c='Manhattan ave',PremiseBorough__c='Manhattan',PremiseState__c='NY',PremisePostalCode__c='11102',Referral_Source__c='311',Data_Source__c='CAMIS',Phase__c='Initiate',Business_Status__c='Open' );             insert er;              Application__c ap = new Application__c(Establishment_Record__c=er.Id,Job_Number__c='222222222');             insert ap;              Plan_Reviews__c pr = new Plan_Reviews__c(Application__c =ap.Id ,DOB_Job_Number__c='222222222',RecordTypeId =Build,Objections__c='Pipe size not indicated');             insert pr;             PageReference pageRef = Page.RangehoodObjectionSheet;              Test.setCurrentPage(pageRef);               Blob content = Test.isRunningTest() ? Blob.valueOf('UNIT.TEST') : pageRef.getContent();              Plan_Reviews__c              p   = new Plan_Reviews__c(id=pr.Id);                ApexPages.StandardController sc  = new ApexPages.standardController(p);             System.assertNotEquals(sc,null);             RangehoodObjectionExtention    ext = new RangehoodObjectionExtention(sc);              ext.Savecopy();       } }   Actual class for the test:  public with sharing class RangehoodObjectionExtention { private final ApexPages.StandardController controller; private final Id                           planreviewID; public String imageURL{get;set;} public List&lt;String&gt; objlist {get;set;}  public string currentdate {get; set;}    public RangehoodObjectionExtention (ApexPages.StandardController stdController) {         controller   = stdController;         planreviewID = (Id)controller.getRecord().get('Id');         Date dt = Date.today();         currentdate = dt.format();         list&lt;Plan_Reviews__c&gt; prlist = [select FDNY_Objections__c from Plan_Reviews__c where id = :planreviewID limit 1];         string obj;         for(Plan_Reviews__c pr: prlist){            obj = pr.FDNY_Objections__c;             }         if(obj!=null){            list&lt;string&gt; objections = obj.split(';');             integer i =1;            objlist = new list&lt;string&gt;();            for(string o : objections){               objlist.add(i++ +'. '+o);            }         }         imageURL='/servlet/servlet.FileDownload?file=';         List&lt; document &gt; documentList=[select name from document where Name='RangehoodObjectionLogo'];         if(documentList.size()&gt;0)         {            imageURL=imageURL+documentList[0].id;         }       }          public PageReference Savecopy(){       PageReference p = Page.RangehoodObjectionSheet;       blob b = ApexPages.currentPage().getContentAsPDF ();       Attachment a = new Attachment();       a.body = b;       a.name = 'Rangehood Objection sheet Issued '+currentdate+'.pdf';       a.parentid = planreviewID;        insert a;        PageReference pref = new PageReference('/'+planreviewID);       return pref;    } } Get list of all tables in Oracle? Please provide a way to download SEDE data via an API I recently suggested on the Stack Apps site that , and it was suggested I reference the feature request here, for visibility.  My use case is a query that the API does not support, so I thought it would be interesting to get it programmatically from SEDE instead. I wonder if this feature might be of interest to others here?  outlines the current ways that SE data is available via various APIs and UIs.  I wonder if my use case (retrieving revisions filtered by user) might have been supported by OData,  since April of this year.  This question has sort-of , though that was not an explicit feature request, and is now rather out of date. It would be good to find out what the current views are on this topic, and indeed whether there is much demand.  My use-case does not urgently require this, since I can use public SE screen scraping or SEDE CSV downloading. From reading around the SE Meta network, both of these approaches seem to be tolerated, as long as it is done with careful regard to frequency and bandwidth. Why can't I press the Install button when installing applications from unknown sources? How to delete (invalid) files with colon in their name under Windows? Can I use a variable which has a non-linear relationship to the dependent variable in logistic regression? Let's say I am building a logistic regression model where the dependent variable is binary and can take the values $0$ or $1$. Let the independent variables be $x_1, x_2, ..., x_m$ - there are $m$ independent variables. Let's say for the $k$th independent variable, the bivariate analysis shows a U-shaped trend - i.e., if I group $x_k$ into $20$ bins each containing roughly equal number of observations and calculate the 'bad rate' for each bin - # observations where y = 0 / total observations in each bin - then I get a U shaped curve.  My questions are:   Can I directly use $x_k$ as input while estimating the beta parameters? Are any statistical assumptions violated which might cause significant error in estimating the parameters? Is it necessary to 'linearize' this variable through a transformation (log, square, product with itself, etc.)? How do I insert a nice tilde that is centered in the middle in a lstlisting? I found another thread about  but I can't apply it because the method described there only works outside of lstlisting as lstlisting displays all the text literally. Any ideas?  Here is how the tilde looks in my document at the moment - it's at the very top of the font and I would like it to be in the middle (like ~ this).    Here is the LaTeX for this fragment:  \section{Remove duplicate, consecutive lines (emulate "uniq")}  \begin{lstlisting} awk 'a !~ $0; { a = $0 }' \end{lstlisting}  Variables in Awk don't need to be initialized or declared before they are being used. I'm trying to have a surface with soft body hold obects that are falling on it with rigid body physics, but for some reason, no what matter what mass I give it, the objects just fall trough the softbody enabled surface.  Is there a toggle or a value I need to change to make them stay there? Given two separate annulus with centers $[C_1,C_2]$ and their corresponding radii being $[R_1,r_1]$ and $[R_2,r_2]$ respectively, larger radius being $R$. There are methods to look at whether they are overlapping or not. If they overlap how to find the overlapping area. Is there any close form expression for it?  equation of first annulus   $r_1^2&lt;(x-x_{c1})^2 + (y-y_{c1})^2 &lt;R_1^2$   equation of second annulus  $r_2^2&lt;(x-x_{c2})^2 + (y-y_{c2})^2 &lt;R_2^2$  If there are three circles overlapping, we get overlapping area as solution to set of 4 in-equations by least squares approach(Though we don't end up getting total area but, area within tangents of circles ). "This edit would have to be a suggested edit" / edit button grayed out A couple of times recently when I attempted to edit a post while reviewing it from the "First Posts" queue, I received the following message when I tried to submit the form:  This edit would have to be a suggested edit. (x)   This is a rather cryptic message, considering that edits made from a review are suggested edits, subject to the same peer review process. There was no indication of how the edit would have to be submitted differently, much less why. I searched both help and meta for more information about this message, but came up empty.  The first time it happened, after I cancelled out I saw that someone else had just edited the post, so I thought maybe that's why I couldn't submit an edit from the review (and wondered why, if that's the case, the error message didn't just say that instead of telling me something that doesn't make any sense - that the edit I'm trying to suggest can't be submitted because it would have to be a suggested edit). However, the second time I received this message (last night, for this question: ), there was no other edit. So, I clicked the No action needed button and tried to edit the post outside the review process, only to discover that the edit link was grayed out.   I see several explanations of possible causes for graying out the edit link here: . However, there was no tooltip when I hovered over the disabled link, and the edit queue was in the single digits.  A few minutes later, I noticed that the edit link was no longer grayed out, so I edited the post and my edit was accepted.   My best hypothesis based on my experience with the error so far and the explanations I've read here at meta is that someone submitted a suggested edit while I was reviewing the post, which (a) caused me to get the cryptic error message and (b) caused the edit link to be grayed out when I accessed the post the normal way. Then a few minutes later, the suggested edit was rejected, opening up the question for new edit suggestions.  Rather than speculating about it and trying to determine the answer scientifically, it would be helpful if someone could give me the answer (as Seinfeld fans might put it, "Why don't you just tell me why I can't edit the post?"). It would be even more helpful if the error message itself provided the explanation, or if the message were defined somewhere in the help pages. But, at the very least, hopefully there will soon be an answer on meta to enlighten people who scratch their chins over this in the future. :) Formal basis for variable substitution in limits What happens to the temperature when an ideal gas is compressed? I am rather confused about this. I know from Charles' law that under constant pressure, the volume of a gas is directly proportional to its absolute temperature i.e.  $$\frac{V_1}{T_1} = \frac{V_2}{T_2}$$  Thus accordingly, during compression, temperature of the gas would decrease. But in Lectures of physics ,vol 1 by Feynman, it is written:     Suppose that the piston moves inward, so that the atoms are slowly compressed into a smaller space. What happens when an atom hits the moving piston? Evidently it picks up speed from the collision. [...] So the atoms are "hotter" when they come away from the piston than they were before they struck it. Therefore all the atoms which are in the vessel will have picked up speed. This means that when we compress a gas slowly, the temperature of the gas increases.   (Constant pressure?) So, this is contrary to Charles' law. Why does this happen? Who is right? Or are they both correct? I am confused. Help. Difference in meaning and use of future perfect forms Projectile/orbital motion over very long distance We know the optimum angle for greatest horizontal displacement when launching an object with projectile motion is 45 degrees.  How to solve the angle when it is real long distance around the earth where we cannot assume that gravity is constant but is given by $F=\frac {-GMm}{r^2}$. I use differetial equation to solve it and obtain 45 degrees.   First, for the vertical distance $y$, change $v=u-gt$ to $y'=u-y''t$. Then solve it to obtain a function $y(t)$. When $y'(t)=0$ we have the time for maximum vertical distance. Then insert the value to horizontal equation.   Can anyone guide me through this problem because I am not confident with my working The shrine indicator (shrine detector? GPShrine?) has both visual and audio cues, so when I'm near a shrine, it beeps constantly. Unfortunately, I occasionally play the game near other humans who are engaged in their own activities, and my wife is decidedly unimpressed with this feature.   When I got the shrine indicator, I could have sworn that the dialogue said I could press [Y] to disable it... but pressing Y pulls out my weapon.   Ideally, I'd like to just make it stop beeping, but stay on for visual cues. But I'll settle for being able to turn it off entirely at times. How do I set environment variables from Java?