I have a application made in PHP, on this application I have the option to translate the page with some languages, but if I try to translate to Spanish the characters with accent marks, shows a question mark symbol (�) like: acci�n. To generate the transalation files, i'm using the following command: msgfmt messages.po -o messages.mo  On my file .po, with the following structure from top to bottom: msgid &quot;Yes&quot; msgstr &quot;Si&quot;  On twig: {% trans &quot;Yes&quot; %}  My mysql is set to UTF-8(but in this case I'm not using info from the database) , all my .php files are set with UTF-8 encoding, my html pages too. I don't why this happen? Could it be nginx configuration?
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.
How to identify whether a file is normal file or directory Is there any direct relation among first, third, fourth order moments? I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that has a footer which I can't make sit at the bottom of the page. I want the footer to  stick to the window bottom when the page is short and the screen is not filled, and stay at the document end and move down as normal when there is more than a screenful of content (instead of overlapping the content).  The CSS is inherited and befuddles me. I can't seem to change it properly to put a minimum height on the content or make the footer go to the bottom. I am a graduate student of math right now but I was not able to get a topology subject in my undergrad... I just would like to know if you guys know the best one.. How to fix the Brazilian daylight saving time (Summer Time) of 2018 in Olson database files? The Brazilian Government has just issued a law that shifts the beginning of the Brazilian DST (Daylight Saving Time) locally called as Summer Time.   This new DST date will come into force in the next month, to be more precise on 18th of November of 2018. So, we won't have enough time to wait for a new Olson update through the operation system updates, neither downloading a new Olson database package might be enough.  I have downloaded the file tzdb-2018e.tar.tz from . Inside that package I found the file southamerica and I have located the following entry:  ... # From Steffen Thorsen (2017-12-18): # According to many media sources, next year's DST start in Brazil will move to # the first Sunday of November, and it will stay like that for the years after. # ... https://www.timeanddate.com/news/time/brazil-delays-dst-2018.html # From Steffen Thorsen (2017-12-20): # http://www.planalto.gov.br/ccivil_03/_ato2015-2018/2017/decreto/D9242.htm Rule    Brazil  2018    max -   Nov Sun&gt;=1  0:00    1:00    - Rule    Brazil  2023    only    -   Feb Sun&gt;=22 0:00    0   - ...   The comments preceding the entry rule for 2018 matches the old law from the end of 2017, but there's a new law that shifts it to the 3rd Sunday of November of 2018.  How to fix that Olson entry shifting it to the 3rd Sunday of November? I have tried Sun&gt;=3 yet, and it didn't work. I've recently been learning about differential equations, and my teacher has been giving some particularly difficult examples out for those of us who finish early. He gave us the following differential equation: $$x=y\frac{dy}{dx}-\left(\frac{dy}{dx}\right)^{2}$$ With the hint "Differentiate with respect to $y$, then let $\frac{dy}{dx}=p$". I've solved it after the lesson and would like someone to check whether or not I've done so correctly.    Following the hint, $$\frac{dx}{dy}=\frac{1}{p}=p+y\frac{dp}{dy}-2p\frac{dp}{dy}$$ Which rearranges to $$p-\frac{1}{p}+y\frac{dp}{dy}=2p\frac{dp}{dy}$$ Multiplying through by $\frac{dy}{dp}$, $$\left(p-\frac{1}{p}\right)\frac{dy}{dp}+y=2p$$ Rearranging into the form $\frac{dy}{dp}+f(p)y=g(p)$, and writing $p-\frac{1}{p}=\frac{p^{2}-1}{p}$ $$\frac{dy}{dp}+\frac{p}{p^{2}-1}y=\frac{2p^{2}}{p^{2}-1}$$ Our integrating factor is $$e^{\int\frac{p}{p^{2}-1}dp}=e^{\frac{1}{2}\ln(p^{2}-1)}=\sqrt{p^{2}-1}$$ So we have $$\sqrt{p^{2}-1}\frac{dy}{dp}+\frac{p}{\sqrt{p^{2}-1}}y=\frac{2p^{2}}{\sqrt{p^{2}-1}}$$ The left hand side is, by design, $\frac{d}{dp}(y\sqrt{p^{2}-1})$, and the right hand side can be integrated as follows: $$\int \frac{2p^{2}}{\sqrt{p^{2}-1}}dp=\int\frac{2(p^{2}-1)+2}{\sqrt{p^{2}-1}}dp=\int 2\sqrt{p^{2}-1}dp+\int \frac{2}{\sqrt{p^{2}-1}} dp$$ These can both be solved using the substitution $p=\cosh(u)$, and gives $$y\sqrt{p^{2}-1}=p\sqrt{p^{2}+1}-\cosh^{-1}(p)+\alpha$$ Where $\alpha$ is an arbitrary constant. Dividing, we finally have $$y=p+\frac{\cosh^{-1}(p)+\alpha}{\sqrt{p^{2}-1}}$$  Here I was stuck for a long time, until I realised that we also have the equation we began with: $x=py-p^{2}$, which we can solve as a quadratic in $p$ to also get $$p=\frac{y\pm \sqrt{y^{2}-4x}}{2} \implies p^{2}=\frac{y^{2}+y^{2}-4x \pm 2y\sqrt{y^{2}-4x}}{4}$$  Thus, $$y=\frac{y\pm \sqrt{y^{2}-4x}}{2}+\frac{\cosh^{-1}\left(\frac{y\pm \sqrt{y^{2}-4x}}{2}\right)+\alpha}{\sqrt{\frac{y^{2}-2x \pm y\sqrt{y^{2}-4x}}{2}-1}}$$  This is as good as I can do - we have a relation between $y$ and $x$ - am I done? Is this the correct answer? Is there an easier way?     Thank you for your time.    Following the suggestion by @Valentin $$\frac{dy}{dp}=1+\frac{\frac{1}{\sqrt{p^{2}-1}}\sqrt{p^{2}-1}-p\frac{\cosh^{-1}(p)+\alpha}{\sqrt{p^{2}-1}}}{p^{2}-1}=1+p\frac{1-\frac{\cosh^{-1}(p)+\alpha}{\sqrt{p^{2}-1}}}{p^{2}-1}$$ Hence, $$dx=\frac{dy}{p}=dp\left(\frac{1}{p}+\frac{1-\frac{\cosh^{-1}(p)+\alpha}{\sqrt{p^{2}-1}}}{p^{2}-1}\right)$$ Why does the field of an electric dipole drop off as $1/r^3$? Electric field of a point charge drops off inverse squarely but that of a dipole varies as $1/r^3$. Why the field drops off more quickly for a dipole? How can I use color in a mathematical expression without losing horizontal spacing? SQLite - UPSERT *not* INSERT or REPLACE Is there some clever way to do this in SQLite that I have not thought of? Basically I want to update three out of four columns if the record exists, If it does not exists I want to INSERT the record with the default (NUL) value for the fourth column. The ID is a primary key so there will only ever be one record to UPSERT. (I am trying to avoid the overhead of SELECT in order to determine if I need to UPDATE or INSERT obviously) Suggestions?  I cannot confirm that Syntax on the SQLite site for TABLE CREATE. I have not built a demo to test it, but it doesn't seem to be supported. If it was, I have three columns so it would actually look like: CREATE TABLE table1(      id INTEGER PRIMARY KEY ON CONFLICT REPLACE,      Blob1 BLOB ON CONFLICT REPLACE,      Blob2 BLOB ON CONFLICT REPLACE,      Blob3 BLOB  );  but the first two blobs will not cause a conflict, only the ID would So I assume Blob1 and Blob2 would not be replaced (as desired)  UPDATEs in SQLite when binding data are a complete transaction, meaning Each sent row to be updated requires:  Prepare/Bind/Step/Finalize statements unlike the INSERT which allows the use of the reset function The life of a statement object goes something like this:  Create the object using sqlite3_prepare_v2() Bind values to host parameters using sqlite3_bind_ interfaces. Run the SQL by calling sqlite3_step() Reset the statement using sqlite3_reset() then go back to step 2 and repeat. Destroy the statement object using sqlite3_finalize().  UPDATE I am guessing is slow compared to INSERT, but how does it compare to SELECT using the Primary key? Perhaps I should use the select to read the 4th column (Blob3) and then use REPLACE to write a new record blending the original 4th Column with the new data for the first 3 columns? Installing particular versions when repo has newer versions? Let's have a metapackage which depends on the following packages  Depends: A (=2),  B (=2),  C (=2)   Note the '=' - I want to install these particular versions, not the most recent ones.  Additionally:  B depends on A(>=1)  C depends on B(>=1) and A(>=1)  If the most recent versions of A,B,C in the repository are 2 then this works.  Since I have put version 3 of A and version 3 of B in the repo sudo apt-get install my-meta-package refuses to finish with the following info:  The following packages have unmet dependencies:   my-meta-package: Depends: B (= 2) but 3 is to be installed                    Depends: A (= 2) but 3 is to be installed   If I manually install versions 2 of A and B then the metapackage installs correctly, which strongly suggests that there is no hidden dependency on A3 or B3. This is not a solution for the problem as the metapackage is installed automatically on many machines.  QUESTION: What to do to make sudo apt-get install my-meta-package install versions 2,2,2?  Additionally, is there a way I could get an extended info what actually creates the need for version 3 of A and version 3 of B? A better serial voting trap Currently we capture fanatic, voting ring or rage-type activities, by measuring the number of up-votes or down-votes between the same two users in a certain (relatively short) time period. When this is detected by the system, the votes are reversed, and I've never bothered to investigate what else happens after that - though I'm sure some form of wrist-slapping ensues.  While it is intended to be well-guarded for obvious reasons, the algorithm used is not exactly a secret, and I am sure there are plenty of examples where people are dangling (maybe intentionally, or maybe by dumb luck) just on the safe side of getting caught.  Personally I believe there are active, intentional, long-term vendettas in operation right now where users either:   blindly up-vote every answer from a user; or, down-vote a particular user once or twice a day, regardless of topic or quality.   Now, maybe the first one is valid - if I'm operating in the same tag-sphere as some smart person, it may just be that I'm constantly enthralled with their answers, and I'm not even noticing who they're written by. (Though, even Skeet isn't perfect, and I haven't up-voted every answer I've seen him post.)  But still, can we do a better job of catching - or at least noticing - this activity over the long term in addition to the short term?  The behavior is the same, and shouldn't be tolerated, regardless of the time frame - vengeful rage serial voting, blind staker crush serial voting, and painstakingly patient serial voting are all undesirable behaviors IMHO.  I'm not saying it has to do anything automatically, as I'm well aware of the possibility of false positives. And I'm not even sure what to propose as a time frame or a vote threshold.      But if a large percentage of my up-votes or down-votes are against a particular user, and especially if on a majority of those posts I am the only one voting in that direction, I think it should at least be raised as some kind of flag to moderators.   This would work much like how other suspicious activity is highlighted (but also not dealt with automatically). If a pattern becomes obvious and persists, then they can intervene in some way (or not, but at least they were provided with the information - just like they can reject and ignore manual flags). Today, all I can do is e-mail team@stackoverflow.com, and unless I know exactly which person(s) are involved, there is not much they can do about it.  And you're thinking, "Meh, let some hater down-vote you once or twice a day. Unless all you're posting is utter crap, it should be statistically insignificant." You're right. But reputation is not the point, and is not the motivation behind my request. What I'd like to see curtailed is the tendency for folks to down-vote a question or answer because of who posted it, not because of what it said or didn't say. When a down-vote is personal it can leave a person second-guessing the quality of their post. Which isn't necessarily a bad thing, except when it happens repeatedly.  Sorry for the essay but I wanted to try to anticipate and cover all the objections and hole-poking. I'm using the plugin  which registers it's own post type but the capability is assigned to "post".   I want to change it to "manage_options".  Is there a correct way without altering the plugin to do that? Calling a hook, a function or whatever?   public function register_post_type() {      $labels = array (         'name'               =&gt; _x( 'Custom Code', 'post type general name' ),         'singular_name'      =&gt; _x( 'Custom Code', 'post type singular name' ),         'menu_name'          =&gt; _x( 'Custom CSS &amp; JS', 'admin menu' ),         'name_admin_bar'     =&gt; _x( 'Custom Code', 'add new on admin bar' ),         'add_new'            =&gt; _x( 'Add Custom Code', 'add new' ),         'add_new_item'       =&gt; __( 'Add Custom Code' ),         'new_item'           =&gt; __( 'New Custom Code' ),         'edit_item'          =&gt; __( 'Edit Custom Code' ),         'view_item'          =&gt; __( 'View Custom Code' ),         'all_items'          =&gt; __( 'All Custom Code' ),         'search_items'       =&gt; __( 'Search Custom Code' ),         'parent_item_colon'  =&gt; __( 'Parent Custom Code:' ),         'not_found'          =&gt; __( 'No Custom Code found.' ),         'not_found_in_trash' =&gt; __( 'No Custom Code found in Trash.' ),     );     $args   = array (         'labels'              =&gt; $labels,         'description'         =&gt; __( 'Custom CSS and JS code' ),         'public'              =&gt; false,         'publicly_queryable'  =&gt; false,         'show_ui'             =&gt; true,         'show_in_menu'        =&gt; true,         'menu_position'       =&gt; 100,         'menu_icon'           =&gt; 'dashicons-plus-alt',         'query_var'           =&gt; false,         'rewrite'             =&gt; array ( 'slug' =&gt; 'custom-css-js' ),         'capability_type'     =&gt; 'post', // &lt;--- I want to manipulate this         'has_archive'         =&gt; true,         'hierarchical'        =&gt; false,         'exclude_from_search' =&gt; true,         'menu_position'       =&gt; null,         'can_export'          =&gt; false,         'supports'            =&gt; array ( 'title' ),     );      register_post_type( 'custom-css-js', $args ); }   The above code is in custom-css-js.php lines 200-239. How do we fetch data through REST service which hosted in azure from SharePoint site which in office 365? How do we fetch data through REST service which is hosted in window azure, from SharePoint site which in office 365? Can we need to create app for SharePoint which contain restAPI endpoint or any better solution than this? What Wording Did Witches and Wizards in Other Cultures Use for Spells? How can I start Hoard of the Dragon Queen with 4th level characters? I'm pretty new to DM'ing and was just wondering if there would be a way to start the hoard of the dragon queen adventure with a group of 4th level characters?  There don't really seem to be any modules for that level range yet.  We just finished a short module that took our party to level 4, but id really like to play through this adventure because it seems awesome. Also I couldn't really find any other ones that start around that level so rather than re-roll characters we'll just start a little of the way in. Let$\ p_n$ be the$\ n$-th prime. Can you give me a proof for$\ \prod_{i=1}^\infty \frac{p_i-1}{p_i}=P\approx \frac{1}{11.0453}$? I found$\ \prod_{i=1}^\infty \frac{p_i}{p_i-1}\approx 11.0453$ on . Moreover, writing a paper, should one provide a proof or it is trivial? Thanks in advance. Gravitational potential at a point in a gravitational field is defined as work done per unit mass in bringing a small test mass from infinity to the point.  I know that:   By integration, we find that gravitation potential is negative. The maximum value of gravitational potential which is at infinity distance is 0, therefore minimum value should be negative.   But, what I do not understand is force is in the same direction as displacement so why work done is not positive? Changing parameter values according to other parameter choice in Processing script using QGIS 3? I couldn't find anything about this problem.  Suppose to have the first parameters in a Processing script defined as an Enum:     self.addParameter(         QgsProcessingParameterEnum(             self.CHOICE,             self.tr('Choose the parameter'),             ['param1', 'param2']         ) )   While the second one as a number:  self.addParameter(     QgsProcessingParameterNumber(         name=self.VALUE,         description=self.tr('My value'),         type=QgsProcessingParameterNumber.Double,         defaultValue=40,         optional=False,         minValue=0,         maxValue=100     ) )   Is it possible to change the minValue, maxValue, description, ecc.. of the second parameter depending on the first or second choice of the first parameter already in the GUI?  e.g. if the user choose param1 then the second parameter should become:  self.addParameter(     QgsProcessingParameterNumber(         name=self.VALUE,         description=self.tr('My value'),         type=QgsProcessingParameterNumber.Double,         defaultValue=40,         optional=False,         minValue=0,         maxValue=100     ) )   while if he choose param2 it should became:  self.addParameter(     QgsProcessingParameterNumber(         name=self.VALUE,         description=self.tr('My AWESOME value'),         type=QgsProcessingParameterNumber.Double,         defaultValue=0,         optional=False,         minValue=50,         maxValue=500     ) ) How to prevent iMessage syncing without access to device I foolishly logged into someone's iPad with my Apple ID. This person is now receiving my full communications on iMessage. I know I can remove my account from that iPad but I don't have access to it. How can I stop the device from getting my iMessages without physical access? How to find a good topic for a PhD research proposal? In many countries an application for a PhD position includes a written research proposal, so my questions is what are some advises/strategies to come up with a good topic/idea for a PhD research proposal and how can one assess the quality/fruitfulness of an idea? As an undergraduate student one just doesn't have the experience to foresee which ideas might have promising research results and which probably won't have. (And I doubt that potential supervisors have the time to comment on every idea of every potential applicant in cases where it is possible to establish some kind of contact before the actual application.)