if string begins with "xx" (PHP)
How to check if a string starts with a specified string?
Why is $(2, 1+\sqrt{-5})$ not principal in $\mathbb{Z}[\sqrt{-5}]$?   Say $(2,1+\sqrt{-5})=(\alpha)$, then since $2\in(2,1+\sqrt{-5})$ we have $2\in (\alpha)$, so $\alpha\mid2$ in $\mathbb Z[\sqrt{-5}]$. Writing $2=\alpha\beta$ in $\mathbb Z[\sqrt{-5}]$ and taking norms, $4=N(\alpha)N(\beta)$ in $\mathbb Z$, so $N(\alpha)\mid4$ in $\mathbb Z$. Similarly, since $\sqrt{-5}\in(\alpha)$ we get $N(\alpha)\mid5$, thus $N(\alpha)$ is a common divisor of $4$ and $5$, therefore $N(\alpha)=(1)$, so $\alpha$ is a unit. But that means $1\in (2,1+\sqrt{-5})=(\alpha)$, so it must be the whole ring, but it cannot to reach a contradiction, so how can I find an element, which is not in $(2, 1+\sqrt{-5})$.  Or is there a simpler method ? (Maybe not UFD would imply not PID) Dynamic dispatch and binding Getting a vector into a function that expects a vector Can't access global variable inside function Compute $P(X_1+\cdots+X_k\lt 1)$ for $(X_i)$ i.i.d. uniform on $(0,1)$ Consider $N=\min\{n: S_n&gt;1\}$, where $S_n=X_1+\cdots+X_n$ and $(X_i)_{i=1}^\infty$ is i.i.d. uniform on $(0,1)$. So, $N$ is the first time that $(S_n)_{n=1}^\infty$ crosses $1$. I'd like to calculate $E(N)$. To this end I'd like to calculate $\Pr(N\gt k)=\Pr(S_k\lt 1)$.  Is there a way to actually do this for any arbitrary $k$? I mean, certainly there is as I know about the distribution of $S_n$ but the formula is just formidable when you move with $k$ toward $\infty$ and even though tractable with a computer, I don't think it's tractable without it.  Is there maybe a better way to calculate the expectation? Thanks for any help. Prove that $f_n$ converges uniformly on $\mathbb{R}$ I'm trying to follow a line in a derivation for $P(Z&gt;X+Y)$ where $X,Y,Z$ are independent continuous random variables distributed uniformly on $(0,1)$.  I've already derived the pdf of $X+Y$ using the convolution theorem, but there's a line in the answer that says:  $P(Z&gt;X+Y) = \mathbb{E}[\ P(Z&gt;X+Y\ |\  X+Y )\  ]$ where $\mathbb{E}$ is the expectation.  I'm not familiar with this result. Could anyone give a pointer to a similar result if one exists?  Thanks. Construct a Borel set on R such that it intersect every open interval with non-zero non-"full" measure For $n$ a positive integer, let us write $\zeta_n = e^\frac{2 \pi i}{n}$, a primitive $n$th root of unity. It is clear that, if $m$ divides $n$, then we have an inclusion of cyclotomic fields $$ \mathbb{Q}(\zeta_m) \subseteq \mathbb{Q}(\zeta_n).$$ On the other hand, these inclusions are not always strict. For example, since $\zeta_3  = \frac{1+i \sqrt{3}}{2}$ and $\zeta_6 = \frac{-1 + i \sqrt{3}}{2}$, we have $$\mathbb{Q}(\zeta_3) = \mathbb{Q}(\zeta_6) = \mathbb{Q}(i\sqrt{3}).$$ Does this sort of thing happen infinitely often, or are there just some coincidences among small numbers? If this continues, is there some way to know when a particular inclusion of cyclotomic fields is strict? I would like to pause a render that I have started, with the intention of resuming it at a later time (but during the same Blender session).  How can I do this? Note: I cannot specificly tell which version of which of the two conflicting packages fixed the issue, but as of 2016 mathpec and polyglossia no longer show the issue.   Basically, I have encountered the same error as  and the workaround suggested by Andrey Vihrov reenables me to compile the document. The problem now is, that any shorthand defined by the ngerman-package (most notably the non-breaking hypen "~) has now been disabled, and I see combinations of american style closing quotes followed by a non-break space where a non-breaking hyphen should be.  Is there any way possible of keeping the shorthand definition, or redefining it to something else (something like \nbhy pops up to mind)?  I am using XeLaTeX as supplied by TeXLive. Does driving an microcontroller's GPIO when it is powered off weaken the chip? We are using the  in a project. The way our design is now, the IC's GPIO pins will sometimes be driven high (to 3.3V) or low when it is powered-off. Will this weaken the chip? The absolute maximum ratings state the voltage on any digital I/O pin is -0.3V to VSupply+0.3V. If the answer is no, could the IC be weakened during power up?  The LTC5800-IPM does not have the most detailed datasheet. If it is not clear for that device in particular, I'd be interested to know for CMOS microcontroller GPIOs in general. test class with Batch and Callout I have a problem with FeedItems in my Test class, it's very weird behaviour Does someone explain to me why this happens?  Callout Class  public with sharing class Callout {  public static void runProccess(Case[] records) {     Database.executeBatch(new CalloutBatch(records), 10); }  public static void send(Case[] records) {     Case[] toUpdate = new Case[]{};       for (case record : records) {         HttpRequest req = new HttpRequest();         req.setEndpoint('callout:test/SOME_URL');         req.setMethod('POST');         req.setHeader('Content-Type', 'application/json');         req.setBody('');         Http http = new Http();         HTTPResponse res = http.send(req);          Map&lt;String, Object&gt; response = (Map&lt;String, Object&gt;) JSON.deserializeUntyped(res.getBody());          toUpdate.add(new Case(Id = (Id) response.get('Id'), Status = (String) response.get('Status')));     }      update toUpdate;  } }   CalloutBatch Class  global with sharing class CalloutBatch implements Database.Batchable&lt;Case&gt;, Database.AllowsCallouts{  private final Case[] records;  global CalloutBatch (Case[] records) {     this.records = records; }  global Iterable&lt;Case&gt; start(Database.BatchableContext BC) {     return records; }  global void execute(Database.BatchableContext BC, Case[] scope) {     Callout.send(scope); }  global void finish(Database.BatchableContext BC) { } }   Test Class  @IsTest  private class CalloutTest { @IsTest static void shouldReaciveData() {     String status = 'Closed';     Case caseRecord = new Case(Type = 'Web', Status = 'New');     insert caseRecord;      //insert new FeedItem(ParentId = caseRecord.Id, Visibility='AllUsers', Type = 'TextPost', Body = '');      System.assertEquals(0, [SELECT Count() FROM Case WHERE Id = :caseRecord.Id AND Status = :status]);      Test.startTest();     Test.setMock(HttpCalloutMock.class, new CalloutTestMock(caseRecord.Id, status));     Callout.runProccess(new Case[]{caseRecord});     Test.stopTest();      System.assertEquals(1, [SELECT Count() FROM Case WHERE Id = :caseRecord.Id AND Status = :status]); } }   Mock Class  public with sharing class CalloutTestMock implements HttpCalloutMock {  private Id recordId; private String status;  public CalloutTestMock(Id recordId, String status) {     this.recordId = recordId;     this.status = status; }  public HTTPResponse respond(HTTPRequest req) {     HttpResponse response = new HttpResponse();      response.setStatusCode(200);     response.setBody('{"Id": "' + recordId + '", "Status": "' + status + '"}');      return response; } }   This code works, but when I uncomment insert FeedItem in Test Class I receive an error message:     System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out   Class.Callout.send: line 23, column 1   Class.CalloutBatch.execute: line 20, column 1   FeedItem doesn't have an impact on this functionality, (I don't have any Process Builders, triggers etc. on FeedItem object) Bind a key for multiple units to use the same spell I'm having the strangest issue since updating to OS X El Capitan. My "Open File" dialogs show the sidebar but all my main (and useful) locations are missing. Take a look at this screenshot. This screenshot shows Keychain Access but this happens in Safari when I'm trying to attach a file to Gmail for example, or uploading an image to Facebook.  What I would like is for the sidebar to show my home directories, such as Desktop, Documents, Downloads, etc.  Help? Is it possible to install Windows from an external hard drive?  I have Windows XP installed on my laptop, and I want to remove it and install Windows 7.  My Windows 7 installation is in an .iso format on an external USB hard drive.  Is it possible to install it or will I need to put in a DVD before I start installing? How do I mimic Pathauto transliterated output for an alias in my custom PHP code? When writing my custom function I need to manually append node name to a taxonomy term link. To get the taxonomy term part done I use:    $link_uri = taxonomy_term_uri($term);   $path_alias = drupal_get_path_alias($link_uri['path']);   This works ok, now - I want to append node name ("/" . $node_name), but instead of raw string, I want the Pathauto transliterated output, as set in the URL alias configuration, for that node context.  What function should I use to mimic that output? I looked at hook_pathauto_alias_alter(&amp;$alias, array $context) but I'm not sure that's what I need. PHP regex delimiter, what's the point? So I took an introductory abstract algebra course a few semesters ago, and we were shown that groups and rings can both be made into products, i.e. if I have some group $G$ (resp. ring $R$) and some indexing set $I$, then I can make a group $G^{I}$ (resp. ring $R^{I}$) with the appropriate cardinality. However, it was also demonstrated that for fields, you cannot keep the multiplicative inverse under a product structure, i.e. if I have fields $F_{1}, F_{2}$, then $F_{1} \times F_{2}$ will still be a ring, but you will not (not just "not in general", but won't) have multiplicative inverses for all non-zero (i.e. not $(0, 0)$) elements, as you could pick $(0, x)$, where $x \neq 0$. According to Wikipedia, an ultraproduct will preserve field structure, but I'm not sure what the cardinality of $\prod_{i \in I} F_{i} / \mathscr{U}$ would be in general.  I saw  that said you could make a field of arbitrarily large cardinality by extending a given field through throwing in a whole bunch of "transcendental" elements. The example given was that if I had $\mathbb{Q}$, I could start by dumping in the complexes, but then I suppose after that I'd just start throwing in dogs and cats or something; I'm really not sure what that responder meant, and ceteris paribus, my dogs tend to stay inside, so I'd rather keep them out of my fields, particularly the large ones the thread was interested in.  Moreover, the thread mentioned earlier seemed more concerned with just making the fields big. My question is a bit more nuanced: Given any cardinality $\kappa &gt; 1$, can I generally construct a field $F$ of a cardinality $\kappa$? Moreover, how vague do I have to be about it (i.e. do I have to use some really choicy methods, or can I make it a bit more straightforward)?  Thanks.  EDIT: Sorry. I am aware that for finite fields, you are limited to powers of primes. I meant for infinite cardinals. If $(A-\lambda{I})$ is $\lambda$-equivalent to $(B-\lambda{I})$ then $A$ is similar to $B$