Sort PHP multi-dimensional array based on value in inner array?
How can I sort arrays and data in PHP?
How can I find out which apps I have already downloaded on my iPhone? When you attempt to download an app that costs money, you will not be charged if you already bought the app. After you press buy and enter your iTunes password, it will say "You have already purchased this item. To download it again for free, select OK."  The problem is that I deleted hundreds of apps from my phone, some of which were paid for. Later on I might find an app I like but notice that it costs money. It might be an app I had already paid for, or an app which I got when it was free.  How can I know if I tap the buy button if I will be charged for the app or not?  In other words, how can I know if I owned a previous version of an app before? Am I allowed to make a Stack Overflow clone? SO is not Open-Source, but I like the whole idea of Stack Overflow :   Giving bounties for Questions Up/Downvoting Questions The Badges The intelligent use of Ajax-Technologies Highly Rated users have administrative powers Reputation system Editing posts like a wiki   So I would like to program a (what is it called) Q&amp;A site / board / wiki system. Am I allowed to? I have a Python function that takes a numeric argument that must be an integer in order for it behave correctly. What is the preferred way of verifying this in Python?  My first reaction is to do something like this:  def isInteger(n):     return int(n) == n   But I can't help thinking that this is 1) expensive 2) ugly and 3) subject to the tender mercies of machine epsilon.   Does Python provide any native means of type checking variables? Or is this considered to be a violation of the language's dynamically typed design?  EDIT: since a number of people have asked - the application in question works with IPv4 prefixes, sourcing data from flat text files. If any input is parsed into a float, that record should be viewed as malformed and ignored. Give read-only access to specific folders? How do I share a folder on SAMBA? Is it possible to make macros give different results at the beginning of a new sentence? Suppose that I want the macro "\secname" to write "Section" at the beginning of a new sentence, and "section" anywhere else. How can I do so? BBWC: in theory a good idea but has one ever saved your data? I'm familiar with what a BBWC (Battery-backed write cache) is intended to do - and previously used them in my servers even with good UPS. There are obvously failures it does not provide protection for. I'm curious to understand whether it actually offers any real benefit in practice.  (NB I'm specifically looking for responses from people who have BBWC and had crashes/failures and whether the BBWC helped recovery or not)  Update  After the feedback here, I'm increasingly skeptical as whether a BBWC adds any value.  To have any confidence about data integrity, the filesystem MUST know when data has been committed to non-volatile storage (not necessarily the disk - a point I'll come back to). It's worth noting that a lot of disks lie about when data has been committed to the disk (). While it seems reasonable to assume that disabling the on-disk cache might make the disks more honest, there's still no guarantee that this is the case either.  Due to the typcally large buffers in a BBWC, a barrier can require significantly more data to be commited to disk therefore causing delays on writes: the general advice is to disable barriers when using a non-volatile write back cache (and to disable on-disk caching). However this would appear to undermine the integrity of the write operation - just because more data is maintained in non-volatile storage does not mean that it will be more consistent. Indeed, arguably without demarcation between logical transactions there seems to be less opportunity to ensure consistency than otherwise.   If the BBWC were to acknowledge barriers at the point the data enters it's non-volatile storage (rather than being committed to disk) then it would appear to satisfy the data integrity requirement without a performance penalty - implying that barriers should still be enabled. However since these devices generally exhibit behaviour consistent with flushing the data to the physical device (significantly slower with barriers) and the widespread advice to disable barriers, they cannot therefore be behaving in this way. WHY NOT?  If the I/O in the OS is modelled as a series of streams then there is some scope to minimise the blocking effect of a write barrier when write caching is managed by the OS - since at this level only the logical transaction (a single stream) needs to be committed. On the other hand, a BBWC with no knowledge of which bits of data make up the transaction would have to commit its entire cache to disk. Whether the kernel/filesystems actually implement this in practice would require a lot more effort than I'm wiling to invest at the moment.  A combination of disks telling fibs about what has been committed and sudden loss of power undoubtedly leads to corruption - and with a Journalling or log structured filesystem which don't do a full fsck after an outage its unlikely that the corruption will be detected let alone an attempt made to repair it.   In terms of the modes of failure, in my experience most sudden power outages occur because of loss of mains power (easily mitigated with a UPS and managed shutdown). People pulling the wrong cable out of rack implies poor datacentre hygene (labelling and cable management). There are some types of sudden power loss event which are not prevented by a UPS - failure in the PSU or VRM a BBWC with barriers would provide data integrity in the event of a failure here, however how common are such events? Very rare judging by the lack of responses here.   Certainly moving the fault tolerance higher in the stack is significantly more expensive the a BBWC - however implementing a server as a cluster has lots of other benefits for performance and availability.  An alternative way to mitigate the impact of sudden power loss would be to implement a SAN - AoE makes this a practical proposition (I don't really see the point in iSCSI) but again there's a higher cost. How can you prove that a function has no closed form integral? In the past, I've come across statements  along the lines of &quot;function $f(x)$ has no closed form integral&quot;, which I assume means that there is no combination of the operations:  addition/subtraction multiplication/division raising to powers and roots trigonometric functions exponential functions logarithmic functions  which when differentiated gives the function $f(x)$. I've heard this said about the function $f(x) = x^x$, for example. What sort of techniques are used to prove statements like this? What is this branch of mathematics called?  Merged with &quot;&quot; by : Sometimes we are told that some functions like $\dfrac{\sin(x)}{x}$ don't have an indefinite integral, or that it can't be expressed in term of other simple functions. I wonder how we can prove that kind of assertion? I recently tried to change a bulb using an adaptor (converting from a E27 to B22 fitting). After switching on the light fitting the fuse had blown. After inspection it turns out the adapter is faulty and must have caused a short-circuit.  After removing the bulb and resetting the switch in the main fuse box, I am now unable to operate the switch on the wall to turn the fitting off (the switch physically won't click).   Is there something I can do to fix the problem?  Thanks, Iteration over std::vector: unsigned vs signed index variable What is the correct way of iterating over a vector in C++?  Consider these two code fragments, this one works fine:  for (unsigned i=0; i &lt; polygon.size(); i++) {     sum += polygon[i]; }   and this one:  for (int i=0; i &lt; polygon.size(); i++) {     sum += polygon[i]; }   which generates warning: comparison between signed and unsigned integer expressions.  I'm new in the world of C++, so the unsigned variable looks a bit frightening to me and I know unsigned variables can be dangerous if not used correctly, so - is this correct? Here is the documents needed.     Here are the documents needed.       Which is grammatically correct and why? My guess would be the second one because of the plural form. Where $F$,$K$ are two fields. What does the element in the composite field $FK$ look like? All the elements are generated by the elements of $F$ and $K$? (combination of the elements of $F$ and $K$) I think $FK$ is pretty close to the free product of $F$ and $K$; is $FK \subsetneq F*K$? Thank you! Printing the value of a variable in SQL Developer How do I get the distance meter value between two geometries in PostGIS? I have a simple question about calculating distances in PostGIS.  I would like to get the distance between two geometries. I am using this sid : 4269 in meters what i am doing now is this : ST_Distance((a.geom,b.geom)) FROM ... but I am getting result in degrees. I think that I should work with geography but how can I cast a geom to a geography? I tried with (a.geom::geography) but i am getting an error.  What can I do to get my result in meters?   Thank You Why can't I log into minecraft with a mojang account? Comment font sizes are inconsistent on Android What is the best way to "carve" a terrain created from a heightmap? I have a 3d landscape created from a heightmap. I'd like to "carve" some holes in that terrain. That will allow me to create bridges, caverns and tunnels inside it.    That operation will be done in the game editor so it doesn't need to be realtime. In the end, rendering is done using traditional polygons.  What would be the best/easiest way to do that ? I already think about several solutions :  Solution 1  1) Create voxels from the heightmap (very easy). In other words, fill a 3D array like this : voxels[32][32][32] from the heightmap values.  2) Carve holes in the voxels as i want (easy too).  3) Convert voxels to polygons using some iso-surface extraction technique (like marching cubes).  4) Reduce (decimate) polygons created in 3).  This technique seems to be the most promising for giving good results (untested). However the problem with marching cubes is that they tends to produce lots of polygons thus reducing them is mandatory. Implementing 4) also seems not trivial, i have read several papers on the web and it seems pretty complex. I was also unable to find an example, code snippet or something to start writing an algorithm for triangle mesh decimation. Maybe there is a special decimation algorithm (simpler) for meshes created from marching cubes ?  Solution 2  1) Create some triangle mesh from the heighmap (easy).  2) Apply severals 3D boolean operation (eg: subtraction with a sphere) to carve the mesh.  3) apply some procedure to reduce polygons (optional).  Operation 2) seems to be very complex and to be honest i have no idea how to do that. Also applying many boolean operation seems to be slow and will maybe degrade the triangle mesh  every time a boolean operation is applied. Did spacetime start with the Big bang? Did spacetime start with the Big Bang?  I mean, was there any presence of this spacetime we are experiencing now before big bang? And could there be a presence/existence of any other space-time before the big bang? C# Unsafe/Fixed Code Unable to modify files/folders in NTFS partition