Proof limit of the sequence $\lim_{n\to\infty} [\frac{1}{n+1}+\frac{1}{n+2}+...+ \frac{1}{2n}]=\log 2$
The limit of truncated sums of harmonic series, $\lim\limits_{k\to\infty}\sum_{n=k+1}^{2k}{\frac{1}{n}}$
As my client software uses lat/lon coordinates when communicating with my (spherical mercator) postgis database i decided to ST_Transform every geometry to WGS-84.  However i noticed that ST_Distance for WGS-84 returns units as degrees (i need meters). So i decided to use ST_DistanceSpheroid(geom1, geom2, 'SPHEROID["WGS 84",6378137,298.257223563]') but this method seems to be extremely slow.  Therefor i switched back to using spherical mercator again and transforming my input and output to and from wgs-84 as that performs a lot better.  Am i using the correct method or is this a known issue? Ubuntu Wifi drivers not working after getting update Run Script on Wakeup? Ideally, I'd like to write a unit test to help me "dummy check" for unexpected effects of the upcoming guest user sharing setting changes.  We'd had some controller/trigger code "gracefully handling" data it couldn't see thanks to the new sharing restrictions ... which resulted in simply "not doing" some work that it was supposed to do, which from a business process perspective isn't "graceful" at all (it was an important automation for downstream processes).  I'd like to write up a unit test with some system.assert statements validating that "data still goes where it's supposed to" when the "submit" button a public-facing Visualforce page of a community is clicked.  Unfortunately, I can't seem to make the "submit" button on a Controller for a public-facing Visualforce page work in the context of a unit test because the record whose creation it results in doesn't get its corresponding "sharing setting" record created in time for the execution context to pick it up.  I did a little proof of concept here ...  @isTest public class TestClass {      private static Id guestProfileId = Util.getProfileIdByName('Public Facing Portal Profile');     private static User guestUser;     private static Id portalGroupId = [SELECT Id FROM Group WHERE Name = 'Public_Portal' LIMIT 1][0].Id;      private static Custom_Object__c co;       private static testMethod void runTest() {         createCO();         Test.startTest();         // Note that putting createCO() inside the test and doesGuestSharingRuleExistForCO() doesn't help.         // That's what I was afraid of.         try {             doesGuestSharingRuleExistForCO(co.Id);         }         catch (Util.DeveloperException e) {             System.assert(FALSE, e.getMessage());         }         Test.stopTest();     }       private static void cacheUsers() {         guestUser = [SELECT Id FROM User WHERE profileid = :guestProfileId AND IsActive = TRUE LIMIT 1][0];     }      private static void createCO() {         co = new Custom_Object__c();         INSERT co;     }      private static void doesGuestSharingRuleExistForCO(Id coId) {         List&lt;SObject&gt; existingSharingRulesOnCO = [             SELECT Id FROM Custom_Object__share             WHERE RowCause = 'GuestRule' AND AccessLevel = 'Read' AND ParentId = :coId AND UserOrGroupId = :portalGroupId LIMIT 1         ];         if ( existingSharingRulesOnCO.isEmpty() ) { throw new Util.DeveloperException('Guest User sharing is not on for this custom object ID'); }     }      private static Boolean isCOSharingFlippedOnAtAll(){         String lookingFor = 'Custom_Object__Share';         for (Schema.SObjectType sObjectType : Schema.getGlobalDescribe().values() ) {             String sobjName = String.valueOf(sObjectType);             if (sobjName.contains(lookingFor) ) { return TRUE; }         }         return FALSE;     }  }   Am I just out of luck?  Is there no way to properly unit-test the effects (to automations relying upon "guest user" sharing settings when running as "guest user") of simulating the insertion of records into my database from a Visualforce page, due to not being able to separate out "execution context" enough and "wait" for the sharing rule record for the new record to come into existence? In sampling without replacement the probability of any fixed element in the population to be included in a random sample of size $r$ is $\frac{r}{n}$. In sampling with replacement the corresponding probability is $\left[1- \left(\frac{1}{1-n}\right)^r\right]$.  Please help me show how this is proved. Is there a bulletproof way to know a file has been successfully decrypted? I am wondering whether there is a bulletproof way to know if one is successful in decrypting a file.   As an example, say I encrypt a text file and protect it with a 3 letter password. I use brute force to decrypt it, but two different passwords lead to a file that contains English intelligible text. Is there a way for me to know which one is the original one? In other words, is there an infallible way to know I've entered the password correctly? How to remove a filter that is an anonymous object? Wiki-tag edit error is non-descriptive I've been editing some wiki entries on the new Expatriates site, and started to get the following error:    When I go to a normal post, I see what is presumably the proper explanation:    Can the Wiki Tag edit error be updated to show a more meaningful error message? Ambiguity of “not.... because” You are not hired because you are qualified.   I think this means you are hired but it is not because you are qualified. But I think this can  also means you are not hired, and the reason for it is that you are qualified.   Does this ambiguity really exist or do I mistake anything? Awk: if pattern not found add some text at the end of file Do full frame sensors gather more light than crop sensors? Lots of people say that full frame sensors receive more light than cropped sensors. I have never found a proof of this claim so I tried to do the computation by myself, and proved the contrary! Could you tell me if I am wrong ?  We want to compare the same frame with the same depth of field. I'm not concerned by the quantity of photons by photosite, which is unrelated to sensor size but to the density of pixels. I have neglected effects like vignetting or angle effect on the edge of the micro-lens array. Here is my simple reasoning :  If you want the same  α~2arctan(size/2f) with a full-frame sensor and a crop sensor with crop ratio c, you have to multiply the focal length by approximately c. Now, in order to maintain the , the f-number N have to be divided by c. If we measure the "amount of light" with the well defined  Ev provided by the same frame of the same scene (so the  is fixed), we have Ev ~ f/N.  Putting all together, Ev_crop = Ev_ff x c², so the cropped sensor receive more light than the full frame sensor !  For those who are interested in the price of two equivalent systems, one with a FF+50mm+135mm and the other with Crop+35mm+85mm, see this . Why does my procedure run slowly until I update statistics? LibreOffice Calc - Disable rounding There are a  on this topic, but no simple and definitive answers.    Can someone please tell me how to permanently disable cell rounding on the .csv file which is created by script?  Basically, '377635637222436751' is being converted to '377635637222437000' automatically and that isn't really acceptable for my needs.  I've tried this: Tools->Options->Calc->Calculate "Precision as shown"   and this: Format > Cells > Numbers > Category > (scroll down for) Text. (but considering my script creates the .csv -- this option isn't very good since it must be done after the file is created)  And neither is working.  The number stays rounded -- even after formatting the column after the file is created.  Does anyone have any suggestions? Can you Dash twice on the same turn? The Dash action gives you extra movement for the current turn (equal to your speed). If I have an effect (like the Expeditious Retreat spell or the monk's Step of the Wind feature) which allows me to dash as a bonus action, can I also dash as my regular action, for triple movement? $ax\equiv b\pmod{\! n}$ has a unique solution if $\gcd(a,n) = 1$ How can I prove that $\,ax\equiv b\pmod{\! n}\,$ has a unique solution if $\,\gcd(a,n) = 1$?  I suspect that the Bezout identity for $\,\gcd(a,b) = 1$ is the key but I don't see how to proceed. Two blue arrows at top right of icons What is an example of "this" assignment in C#? Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself. I am unable to figure out simple solution to add "Bookman Old Style"  as a main font in my latex document. I have used below line but does not give me required font.  \usepackage{bookman}   Could not find any Simple correct answer for this. Pl. suggest how to do it.  I am using windows, pdflatex.  thank you How to define global functions in PHP Changing order of features in shapefile I have a shapefile and I want to change the order of the features. Is that possible? I want to sort the features in the shapefile because I'm embedding this shapefile in a mobile app. The app will display a list of features, and although I could do the sorting at load time, I'd prefer to have them sorted.