How do I detect the data type inside byte array?
Using .NET, how can you find the mime type of a file based on the file signature not the extension
How can I update youtube-dl? Security Review - CRUD/FLS Checks for every SOQL Query I know this sounds like a standard question, so please bear with me.  Recently our Security Reviews fail due to CRUD/FLS violations. The highlighted codelines include almost every SOQL Query in the application.  Our approach is usually as follows:   In case of displaying data on VF pages we either use sObjects fields or use the platform methods to check the accessibility of the fields In case of domain logic triggered by the user (e.g. by clicking a button on a VF page) we have a helper class that checks every field to be updated before doing the DML operation.   Up until recently this approach has worked fine (and passed pervious Security Reviews). As mentioned above the latest Security Review results seem to require us to check every field in a SOQL query for accessibility even if it is never displayed back to the user.    Let's suppose the following program flow as an example:   Query an object with some fields Perform some modification on said fields Perform an update on the sObject to save the modification using a helper class which checks for the required CUD/FLS rights for the modified fields   As I see it there is no need for checking field accessibility in step 1 in that case (since nothing is displayed back to the user and the dml operation is already protected). Is that correct or am I missing something? So is it really required to do an accessibility check for every SOQL Query in the code?  Another question would be how to handle background operations in that case like data purging. These have either to be running in system mode (which causes issues during the Security Review) or require the job to be started by a user with the appropriate access rights (which can be error prone and is not that user friendly). Is there any best practice regarding that.  Unfortunately I could not find a question targeting exactly that issue. Most of the questions I have found are related to how to perform that check (like  or ). So please apologize in case the question was already answered (I would really appreciate a link to the answer then).    Thanks for your time and help.  Mathias Why are the solutions of polynomial equations so unconstrained over the quaternions? An $n$th-degree polynomial has at most $n$ distinct zeroes in the complex numbers.  But it may have an uncountable set of zeroes in the quaternions.  For example, $x^2+1$ has two zeroes in $\mathbb C$, but in $\mathbb H$, ${\bf i}\cos x + {\bf j}\sin x$ is a distinct zero of this polynomial for every $x$ in $[0, 2\pi)$, and obviously there are many other zeroes.  What is it about $\mathbb H$ that makes its behavior in this regard to be so different from the behavior of $\mathbb R$ and $\mathbb C$?  Is it simply because $\mathbb H$ is four-dimensional rather than two-dimensional? Are there any theorems that say when a ring will behave like $\mathbb H$ and when it will behave like $\mathbb C$?   Do all polynomials behave like this in $\mathbb H$? Or is this one unusual? How do I determine which graphics card I'm using? WinForms: How to programmatically fire an event handler? Making sense of principal component analysis, eigenvectors & eigenvalues How do I process GET query string URL parameters in backing bean on page load? How to sort text in sqlite3 with specified locale? Sqlite3 by default sorts only by ascii letters. I tried to look in google, but the only thing I found were informations about collations. Sqlite3 has only NOCASE, RTRIM and BIARY collations. How to add support for a specific locale? (I'm using it in Rails application) What are the best practices for battery longevity? How do you maximize the cycle count of your battery?  There seems to be a debate between:   Leave plugged in 24/7 but do a full cycle once a month Charge to ~100%, drain to ~10%, repeat.   NOTE: Taking your   Which method is better and why? How much of a difference does it really make?  Here are some of the better sources I've found about battery behavior so far. Even still I feel they don't conclusively answer the question above. See my elaborations below:           Elaborating on Option 1  Now IF Apple engineers were smart and optimized for AC draw when plugged in to not use up your charge cycles, then it seem logical to assume that you are using effectively none of your 1000 charge cycles while plugged in. If that's the case, it would seem that the LiPo drop from holding at 100% would be vastly outweighed by the fact you're not using any charge cycles.  However, this is a purely speculative assumption and I could find no evidence to either confirm or deny.  If this is NOT true, and the AC adapter only goes to charging the battery, then there would be no difference. Your battery would drain to 99%, then back up to 100%, then back down to 99%, etc. Those micro-charge cycles would add up at the same rate as 100% -> 0% -> 100%, and you would get no gain. In this case the negative effect of holding LiPo batteries at 100% would outweigh everything else.  Elaborating on Option 2  There are lots of good reasons why Option 2 is the way it is:   Because of known LiPo chemistry issues, holding a 100% charge for a long time causes the battery to degrade Apple specifically recommends not to leave it plugged in all the time  Draining a battery all the way to zero all the time is bad for the cell (Which is why ~10% is used) Heat is a killer, and when plugged in AND charging, you get extra heat that causes damage.   There are a couple reasons why I'm challenging Option 2:   It seems silly that the most intuitive use case for thousands of people that use their macs as primary computers is wrong. If the hypothesis in option 1 is true, you're just burning unnecessarily through your finite charge cycles. It's a pain to have to remember to keep plugging in and plugging out and be worried about whether or not your device is plugged in. Suppose there are several journals with the same impact factor. Is it better to submit my papers to one of them or each time I finished a manuscript it is better to submit to an equally good journal that I have not published in yet.  I am early in my career and I already published two papers in the same journal and I am going to finish my third paper, which potentially can be published in the same journal as my previous two papers. Which personal pronoun is appropriate in single-author papers - 'I' or 'we'? Could the use of 'I' be considered egotistical? Or will the use of 'we' be considered to be grammatically incorrect? How to get color of pixel in coordinates 123, 456 in screen? My AppleScript app needs to get color of pixel in coordinates 123, 456 in screen. Does anyone know of a nice (and preferably free) way to integrate Prolog and C#?  Im looking to create a Prolog dll or similar to call from my managed code, and retrieve an answer once all the processing has been complete. Im looking for it to be predominantly one sided (c# calls Prolog).  I have seen  which talks about Prologs real world usage but I was wondering if anyone had either any experience with c# &amp; Prolog? or a nice tutorial/article? MySQL strip non-numeric characters to compare I'm looking to find records in a table that match a specific number that the user enters.  So, the user may enter 12345, but this could be 123zz4-5 in the database. I imagine something like this would work, if PHP functions worked in MySQL. SELECT * FROM foo WHERE preg_replace(&quot;/[^0-9]/&quot;,&quot;&quot;,bar) = '12345'  What's the equivalent function or way to do this with just MySQL? Speed is not important. How to import sextante(processing) for QGIS 1.9 (2.0) In ZF, how would the structure of the cardinal numbers change by adopting this definition of cardinality? In ZFC, a good way of ordering sets by cardinality is by leveraging the notion of an injection. We define: $$X \lesssim Y \leftrightarrow \mbox{ there exists an injection } X \rightarrow Y.$$  Alternatively, we can leverage the notion of a partial surjection, by which I mean a partial function that hits every point of its codomain at least once.  $$Y \succsim X \leftrightarrow \mbox{ there exists a partial surjection } Y \rightarrow X.$$  Now in ZFC, these approaches are equivalent, in the sense that $$X \lesssim Y \iff Y \succsim X.$$  But if we just consider ZF (that is, we drop choice) then the equivalence breaks down. However, we've still got the forward implication, because the converse of an injection is always a partial surjection.  A specific question. Define that two sets are weakly equipotent iff $X \succsim Y$ and $Y \succsim X$. Question: does weak equipotence imply genuine equipotence? I'm guessing "no."  A general question: In broad terms, how would the structure of the cardinal numbers in ZF be altered by adopting $\succsim$ rather than $\lesssim$ as the fundamental order relation, and taking equality of cardinal numbers to correspond to weak equipotence of sets? I'm guessing this would hide a lot of the (usually very complicated) structure of the cardinal numbers in ZF.  Remark. The order symbols can be written \lesssim and \succsim. Date api for managing off days in an year? Can I install a ROM made for a different device? Askers should be able to close their own question as a duplicate How can I download an entire website?