I get the error:     Notice: Undefined index: marca    When I'm trying to do this:  echo $data[0]['marca'];   But if I print the array, like this:   print_r($data[0]);   The output is:  Array ( [marca] =&gt; Jack&amp;co [stock] =&gt; 10 [nome] =&gt; JW0114M2 [codice] =&gt; JW0114M2 [caratteristiche] =&gt; JW0114M2 Classe articolo: orologio da polso Sesso: unisex Movimento: quarzo Bracciale: acciaio Tipologia: cronografo [prezzo al pubblico €] =&gt; 99,00 [sconto %] =&gt; 75 [prezzo orologistock €] =&gt; 25,00 [img] =&gt; http://orologistock.it/virtual_img/ )        //^^^^^ See the element exists!   So why can't I access the array element?   EDIT:  The output from the source code with var_dump($data[0]); is:  array(9) { ["marca"]=&gt; string(7) "Jack&amp;co" ["stock"]=&gt; string(2) "10" ["nome"]=&gt; string(8) "JW0114M2" ["codice"]=&gt; string(8) "JW0114M2" ["caratteristiche"]=&gt; string(117) "JW0114M2 Classe articolo: orologio da polso Sesso: unisex Movimento: quarzo Bracciale: acciaio Tipologia: cronografo " ["prezzo al pubblico €"]=&gt; string(5) "99,00" ["sconto %"]=&gt; string(2) "75" ["prezzo orologistock €"]=&gt; string(5) "25,00" ["img"]=&gt; string(35) "http://orologistock.it/virtual_img/" }    I'm getting my array from a .csv file:  function csv_to_array($filename='', $delimiter=';') {     if(!file_exists($filename) || !is_readable($filename))         return FALSE;      $header = NULL;     $data = array();     if (($handle = fopen($filename, 'r')) !== FALSE)     {         while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE)         {             if(!$header){                 $header = $row;             }             else{                 if(count($row) == 9)                     $data[] = array_combine($header, $row);             }         }         fclose($handle);     }     return $data; }   $data= csv_to_array($_FILES['data']['tmp_name']);
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
In Oracle, I can re-create a view with a single statement, as shown here:  CREATE OR REPLACE VIEW MY_VIEW AS SELECT SOME_FIELD FROM SOME_TABLE WHERE SOME_CONDITIONS   As the syntax implies, this will drop the old view and re-create it with whatever definition I've given.  Is there an equivalent in MSSQL (SQL Server 2005 or later) that will do the same thing? "This product is good value" vs "This product is of good value" in a sentence 1.This product is good value. 2.This product is of good value.    Are there any difference in meaning between "good value" and "of good value"? I am currently working on a project to create a (not prepaid) postage label.  In java, I would go about doing this by creating a bufferedimage and adding various other images to it to create what I want.  What I want is to put text, converted to an image, onto a template letter, to make a proper postage label.    For example, imagine I was given a document with blank spaces such as:  "Name: _________"  This document is in the form of an image, and I want to use apex and visualforce (the page is already constructed, I am just stuck at the image manipulation part) to add whatever name the user types in onto the image and pack it and email the new image.  The question I have here is: where do I even start?  Java is a little nicer when it comes to image manipulation, as far as I can see.  I've looked into using a web service and sending a soapxml request to return a proper encoded image, but I haven't found a web service that can do this.  Any pointers would be nice. Thanks. Android, how do I stop a pointer appearing below an EditText math behind complex numbers C||RLC I have a mathematical problem with the following formula. The goal is to transform this equation to have a seperated real and imaginary part. I have already done this with several other equasions, but for this particualar one I don't know where to start.  I dont expect you to do the complete work of transforming for me, it would already be very nice if you could give me a hind on how you would start.  Thank you in advance!  C||RLC      This is my current progress:    My question is:  How can I get rid of the imaginary part jωC2*R?  When the denominator is completely real I can just split up the formula and have an imaginary and a real part. Passing list to viewparams variables in GeoServer SQL views? I have a sql view which take only one parameter, but this parameter is a list, and a need to know how can i pass this parameter in the url  Here is my sql view  SELECT * FROM shop WHERE id IN %list%   When I put the default value for %list% as (1, 2 ,3) as example, the layer preview works and show the shopa with the default ids,  but when I try this in the url  viewparams=list:(1,2,3)   does not work.   I already tried other things like   viewparams=list:"1,2,3"   but nothing works.  Does anyone know how to do this? Principal $n$th root of a complex number This is really two questions.   Is there a definition of the principal $n$th root of a complex number? I can't find it anywhere. Presumably, the usual definition is $[r\exp(i\theta)]^{1/n} = r^{1/n}\exp(i\theta/n)$ for $\theta \in [0,2\pi)$, but I have yet to see this anywhere. Is this because it has bad properties? For instance, according to this definition is it true that for all complex $z$ it holds that $(z^{1/a})^b = (z^b)^{1/a}$? Structure of a C++ Object in Memory Vs a Struct If I have a class as follows     class Example_Class     {        private:          int x;           int y;         public:           Example_Class()           {               x = 8;              y = 9;          }        ~Example_Class()         { }     };   And a struct as follows  struct {    int x;    int y; } example_struct;   Is the structure in memory of the  example_struct simmilar to that in Example_Class  for example if I do the following  struct example_struct foo_struct; Example_Class foo_class = Example_Class();  memcpy(&amp;foo_struct, &amp;foo_class, sizeof(foo_struct));   will foo_struct.x = 8 and foo_struct.y = 9 (ie: the same values as the x,y values in the foo_class) ?  The reason I ask is I have a C++ library (don't want to change it) that is sharing an object with C code and I want to use a struct to represent the object coming from the C++ library. I'm only interested in the attributes of the object.  I know the ideal situation would be to have Example_class wrap arround a common structure between the C and C++ code but it is not going to be easy to change the C++ library in use. Multiplication in Permutation Groups Written in Cyclic Notation I didn't find any good explanation how to perform multiplication on permutation group written in cyclic notation. For example, if $$   a=(1\,3\,5\,2),\quad b=(2\,5\,6),\quad c=(1\,6\,3\,4), $$  then why does $ab=(1\,3\,5\,6)$ and $ac=(1\,6\,5\,2)(3\,4)$? Simultaneous collaborative editing of a LaTeX file Could authors overturn recent community review decisions? When new users edit a post, the review is posted to a review queue and other reputable users can review the edit and choose to approve or reject it. However, I feel that a lot of people do it pretty quickly.    to . He was fixing broken links in the answer, and as soon as I saw it I knew it would have been a good edit. However, only one reviewer found so, and three others rejected it. I ended up manually doing the edit, and poor Onato didn't get any credit for it (in fact, he got an undeserved 'rejected' for it).  The point I want to bring is that, first and foremost, the person who wrote the answer probably knows best if an edit is acceptable or not. Could there be a time frame where the author of the answer (or question) can overturn a review decision?    EDIT: one more  was rejected by overeager reviewers as well. I absolutely disagree with the notion that the community knows better. The community repeatedly proves that it only wants Internet points.    EDIT: I told a commenter to fix something himself in one of my posts, but . I went back and applied the changes myself. It's not credited to him and his stats got a rejected edit now (which really should be an approved edit). The reason ("This edit is incorrect or an attempt to reply to or comment on the existing post") is blatantly wrong and shows once more that the community has much less insight into edit quality than the people who wrote the answers in the first place. It's true that the UI didn't make it easy for them, but those guys clearly didn't read the comment thread; I did, because as the author, I was notified.    EDIT: This time around, a user fixed a blatant (though small) mistake in one of my accepted answers. One hour later, another, unrelated 10k user , even though it had been approved by the community. I went back to undo his undo.  This goes on again to show that an active user is the best judge for the quality of an edit, and that since I can have the last word on edits on my own posts, I should be allowed to retroactively overturn a community edit vote and accordingly credit the person who proposed the change.    EDIT I wrote a  years ago. Some guy found it and tried to fix it but the community thought that it wasn't worth it. I think that the changes are great and once more I'll integrate them by myself into my post. Unfortunately for this user, he won't be credited for it. I still don't understand why I can't have a binding vote on edits on my posts. jquery's append not working with svg element? In biblatex, treat periods in journal as abbreviation dots I would like to consistently have a comma between the journal and volume number for article references using biblatex with biber as the backend. Unfortunately, the punctuation between the journal and volume is not consistent. Journals whose last word is abbreviated have no comma between the journal and the volume, and the word "Vol." is capitalized. Journals whose last word is not abbreviated have a comma and the word "vol." is not capitalized. I can fix the capitalization by un-commenting the commented lines in the below MWE, but the comma problem is quite perplexing. Apologies if this fix is in an answer somewhere, but I cannot find it (or at least, I don't know what to search for!).  Current output: [1] First Author. “Blah Blah 2”. In: Am. J. Phys. Vol. 72, no. 3 (Mar. 2004), pp. 367–375. [2] Second Author. “Blah blah”. In: Energy Fuel, vol. 27, no. 12 (Dec. 2013), pp. 7778–7789.  Expected output: [1] First Author. “Blah Blah 2”. In: Am. J. Phys., vol. 72, no. 3 (Mar. 2004), pp. 367–375. [2] Second Author. “Blah blah”. In: Energy Fuel, vol. 27, no. 12 (Dec. 2013), pp. 7778–7789.  MWE:  \documentclass{article} \usepackage{filecontents} \usepackage[     backend=biber,     citestyle=numeric-comp, ]{biblatex} \addbibresource{\jobname} % \DefineBibliographyStrings{english}{%     % volume = {\lowercase{v}ol\adddot}, % avoid capitalization after dots. % } \DeclareFieldFormat[article]{volume}{\bibstring{volume}\addspace #1} \DeclareFieldFormat[article]{number}{\bibstring{number}\addspace #1} \renewbibmacro*{volume+number+eid}{%   \printfield{volume}%   \setunit{\addcomma\space}%&lt;---- was \setunit*{\adddot}%   \printfield{number}%   \setunit{\addcomma\space}%   \printfield{eid}} \renewbibmacro*{journal+issuetitle}{%   \usebibmacro{journal}%   \setunit*{\addcomma\addspace}%&lt;---- was \setunit*{\addspace}%   \iffieldundef{series}     {}     {\newunit      \printfield{series}%      \setunit{\addspace}}%   \usebibmacro{volume+number+eid}%   \setunit{\addspace}%   \usebibmacro{issue+date}%   \setunit{\addcolon\space}%   \usebibmacro{issue}%   \newunit}  \begin{filecontents*}{\jobname.bib} @article{York2004, author = {Author, First}, journal = {Am. J. Phys.}, month = mar, number = {3}, pages = {367--375}, title = {{Blah Blah 2}}, volume = {72}, year = {2004} } @article{Baumgardner2013a, author = {Author, Second}, journal = {Energy Fuel}, month = dec, number = {12}, pages = {7778--7789}, title = {{Blah blah}}, volume = {27}, year = {2013} } \end{filecontents*}  \begin{document} \nocite{*} \printbibliography \end{document} Why don't electrons crash into the nuclei they "orbit"? If/When to move to secondary fermentation Digression from   What are the good rules of thumb for determining a. whether to use secondary fermentation at all and b. when to move from primary to secondary.  Preferably any rule of thumb should have both chemical and anecdotal rationale supporting it. How to load a taxonomy term with case-sensitive? I used this      $this-&gt;termStorage-&gt;loadByProperties(['name' =&gt; 'test']);   I got two terms: Test, test. I want to get only one: test  This is working without case-sensitive:       $this-&gt;termStorage-&gt;getQuery()-&gt;condition('name', 'test', '=')-&gt;execute();       \Drupal::database()-&gt;select('taxonomy_term_field_data', 't')       -&gt;condition('t.name', 'test')       -&gt;fields('t', ['name'])       -&gt;execute()       -&gt;fetchAll();       \Drupal::database()-&gt;query("SELECT name FROM taxonomy_term_field_data WHERE name='test'")-&gt;fetchAll(); I am trying to prove this inequality  $$|e^z-1|\leq e^{|z|}-1\leq |z|e^{|z|}$$  I've tried calculating the difference in their power series   $$\sum_{k=0}^\infty\frac{|z|^k}{k!}-1-\left|\,\sum_{k=0}^\infty\frac{z^k}{k!}-1\,\right|$$   but did not get anywhere. I'm trying to prove that the converse of Lagrange's theorem is true for finite abelian groups (i.e. "given an abelian group $G$ of order $m$, for all positive divisors $n$ of $m$, $G$ has a subgroup of order $n$"). This is an exercise from a book, and it is in the section on finite abelian groups, so I know I have to use the fundamental theorem of finite abelian groups. I have come up with a proof, but it seems a bit messy, and I'm not entirely sure if it's correct. It is given below.     Let the order of $G$ be $m$ = $p_1^{\alpha_1} \ldots p_k^{\alpha_k}$. It is known that $G$ is a direct product of $p$-groups, say:      $$G = G_1 \times \ldots \times G_k$$      where each $G_i$ is a $p_i$-group. By the fundamental theorem of finite abelian groups, each $G_i$ is isomorphic to a direct product of cyclic groups of the form      $$\mathbb{Z}_{{p_i}^{\beta_1}} \times \ldots \times \mathbb{Z}_{{p_i}^{\beta_l}},$$      where $\beta_1, \ldots, \beta_l$ are positive integers such that $\sum_{j=1}^l \beta_j = \alpha_i$. Now if $n$ divides $m$, then we must have      $$n = p_1^{\gamma_1} \ldots p_k^{\gamma_k}$$      for some $\gamma_1, \ldots, \gamma_k$ with $0 \leq \gamma_i \leq \alpha_i$.      Claim: Each $G_i$ has a subgroup of order $p_i^{\gamma_i}$      Proof: As above, we have that       $$ G_i \cong \mathbb{Z}_{{p_i}^{\beta_1}} \times \ldots \times \mathbb{Z}_{{p_i}^{\beta_l}} $$      where $\beta_1, \ldots, \beta_l$ are positive integers such that $\sum_{j=1}^l \beta_j = \alpha_i$.      Now since $0 \leq \gamma_i \leq \alpha_i$, we can find   $l$ numbers $\delta_1, \ldots , \delta_l$ such that $\gamma_i = \sum_{j=1}^l \delta_j$, and $0 \leq \delta_j \leq \beta_j$. (This choice of numbers is not necessarily unique).      Then $p_i^{\delta_j} | p_i^{\beta_j}$ for each $j = 1, \ldots , l$. Hence, for each factor $\mathbb{Z}_{{p_i}^{\beta_j}}$, there exists a subgroup of order $p_i^{\delta_j}$, namely $\mathbb{Z}_{{p_i}^{\delta_j}}$ (using the fact that the converse of Lagrange's theorem is true for finite cyclic groups). Taking the direct product of each of these subgroups, we get a new subgroup $G_i'$ of $G_i$:      $$G_i' \cong \mathbb{Z}_{{p_i}^{\delta_1}} \times \ldots \times \mathbb{Z}_{{p_i}^{\delta_l}}$$      The order of this subgroup is $p_i^{\delta_1} \times \ldots \times p_i^{\delta_l} = p_i^{\delta_1 + \ldots + \delta_l} = p_i^{\gamma_i} $. So we have found a subgroup of $G_i$ of order $p_i^{\gamma_i}$, as required.      So each factor $G_i$ in the product $G = G_1 \times \ldots \times G_k$ has a subgroup $G_i'$ of order $p_i^{\gamma_i}$.       Therefore, $G$ has a subgroup   $$G_1' \times G_2' \times \ldots \times G_k'$$       of order $p_1^{\gamma_i}...p_k^{\gamma_k} = n$, which completes the proof.   I have two questions about this: firstly, does this proof seem to work? Secondly, is there a way to make the proof more concise (e.g. a way to prove the statement without using all these indices)? Nignx - worker_connections are not enough What are the differences between git pull and git fetch?