How to get the file extension or content type from file byte array. in C#  we have a problem in our production environment that, after last production upgrade PNG files uploaded previously were saved as JPG file extension. so when i read that file i cannot set mimetype as PNG, since currently it takes from path.getextension, but this is wrong- my actual file is PNG type. this is causing issues in rendering images.  How to get the file extension or content type from file byte array. in C#
I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).  What's the best way to determine the image format in .NET?  The application that is reading these downloaded images needs to have a proper file extension or all hell breaks loose.
I'm more of a math guy than a physics guy so bear with me....  In fractal geometry, fractals are considered to have fractional dimension. For instance an object such as the Koch curve has a fractal dimension of around $1.2$. You can also define a concept called fractal extent (which is the experimental version of hausdorff measure). This extent is a measure of how large a fractal is. It's even been used to more accurately model the distribution of coastline bird nesting.   Even though fractals work as an interpretation of geometrical units, I don't think they would describe things such as $kg^{1/2}$ very well. In addition, I've heard about white Gaussian noise that has square root time units.   What is the physical meaning of fractional units such as the above? (Since it obviously has little geometric meaning) Why only light nuclei are able to undergo nuclear fusion not heavy nuclei? Is it because of the binding energy or the binding energy per nuclei .  I am having trouble with this whole binding energy and nuclear fusion concept. $\mathbb{Q}(\sqrt p_{1}+\sqrt p_{2})=\mathbb{Q}(\sqrt p_{1},\sqrt p_{2})$ for $p_{1},p_{2}$ primes. How to prevent "Write Failed: broken pipe" on SSH connection? What can I do to configure SSH on both client and servers to prevent Write Failed: broken pipe errors? It often occurs if you sleep your client computer and resume later. How is the nature of logical principles commonly defined in contemporary philosophy? In contemporary philosophy, how exactly is the nature of logical principles defined? For example, the way I've commonly seen logical principles construed are as true propositions which described the most general laws of reality. The previous definition does seem very intuitive to me; if we understand logical principles as being concerned with truth, and if we accept a correspondence theory of truth, then logical principles simply describe fundamental laws regarding various states of affairs occurring in reality. (e.g. If state of affairs S1 obtains and state of affairs S2 obtains, then state of affairs S3 must also obtain given logical law L).  However, I've mostly heard the previous view expressed among laypersons. I'm interested to know how most philosophers would think about the nature of logical principles. I've ran out of chocolate bars and didn't realize I could enchant my giant spoon and knight's armor. Is there any way to get more reliably? Remount squashfs root filessytem read-write I am working on an embedded device. The fstab shows the following info:  &lt;file system&gt; &lt;mount pt&gt;      &lt;type&gt;  &lt;options&gt;         &lt;dump&gt; &lt;pass&gt; /dev/root       /               ext2    rw,noauto                           0               1 proc            /proc           proc    defaults                            0               0 devpts          /dev/pts        devpts  defaults,gid=5,mode=620             0               0 tmpfs           /tmp            tmpfs   defaults                            0               0 ramfs           /var            ramfs   defaults                            0               0 sys             /sys            sysfs   defaults                            0               0   Running the mount command I get this:  rootfs on / type rootfs (rw) /dev/root on / type squashfs (ro,relatime) proc on /proc type proc (rw,relatime) sys on /sys type sysfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620) ramfs on /var type ramfs (rw,relatime)   Which means that the root filesystem is read-only.  How can I remount the read-only part as read-write? I currently have a valid Schengen tourist visa that expires next year, issued by the French Consulate in Saudi Arabia.   I am going to a 60-day study abroad program in Italy and they require a student visa. I went to the Italian Consulate in Boston and they asked me to go to the French Consulate and cancel my visa. However, the French Consulate said that I needed to contact the French Embassy in Saudi to cancel the visa.   How can I cancel my tourist visa if I am currently in the United States? My Italian student visa application is due tomorrow morning. What are acceptable reasons for flagging as "Requires Moderator attention"? After reading , I feel I don't quite understand this function. What are the guidelines for flagging a question as &quot;Requires Moderator attention&quot;? Root filling up although it should have some space This has been perplexing me for some time. I'm on Ubuntu 11.04. My root partition is filling up and I can't figure out what's causing it. Even stranger, when I run df -h, this is the output:  Filesystem            Size  Used Avail Use% Mounted on /dev/sda2             9.2G  8.8G     0 100% /   As you see, there should be about 400 MB free, but Avail shows 0. What could be causing this? I've even uninstalled some programs to free the space and it fills up again. Suggestions on how to find out which, if any, files are filling up the space are also welcome. Prove that $\sqrt{n} \le \sum_{k=1}^n \frac{1}{\sqrt{k}} \le 2 \sqrt{n} - 1$ is true for $n \in \mathbb{N}^{\ge 1}$ I'm trying to solve  proposed by the department of mathematics of Oxford University. I don't know how to give a valid proof for the third one which says the following:     Prove that for $n \in \mathbb{N}^{\ge 1}$: $$ \sqrt{n} \le  \sum_{k=1}^n \frac{1}{\sqrt{k}} \le 2 \sqrt{n} - 1 $$   My first approach has been to convert the summation into a function in terms of $n$ so that I could find the maximum and minimum values in the interval. However, there doesn't seem to be an easy way to express the summation as a function. Thanks in advance! How can I get back a system file after deleting it from my Mac? I've deleted a system file from my Mac and need to get it back.  System files can include:   hidden files in the root of / - especially unix files in /private  /System files /Library files /Applications files that ship with the core OS   System files are not any app, user files or files that can be regenerated by a known sequence such as cache files, Spotlight index files, etc…    Canonical question and answer for . What is the definition and purpose of a pre-amplifier? I find in many places mentions of pre-amplifiers being used to boost audio signals prior to feeding to a power amplifier.  Wikipedia's article on  gives some hints at their usage, but it doesn't really explain why it would be necessary to have two amplifiers in series rather than a single one with greater gain.  If a pre-amp is just a power amp with a smaller gain, what's the point, and why the distinction between the two kinds? Is the distinction in function, or simply purpose? Alternatives to "and/or"? As a programmer, I have no problem with seeing or using "and/or" in technical documentation. For example,     I can upvote an answer that satisfies me and/or mark it as accepted.   That's perfectly good English to me. However, if I were writing a novel, or even just an essay, or — heaven forbid — a poem, "and/or" would seem extremely out of place.  My question is, what should I be using instead? (I solemnly swear I will not use that knowledge to actually write a poem.) Which process scheduler is my linux system using? I'm not quite sure if stackoverflow or serverfault is the forum to use for this question, but ill try here.  Is there some command I can use or a file I can check in order to find out which process scheduler I'm using on my Linux system? I am not looking for the I/O scheduler, but the process scheduler, and please, do not refer to guides or howtos for what a scheduler is, what I'm simply asking is if there is a command or file I can run/check to see this. I could check the doc for my kernel but again I'm just wondering if there is a command or file i can check.  I might have been a little redundant above but that's because the posts I've seen people seem to confuse process scheduler with the i/o scheduler, and they don't seem to answer the actual question, just provide links to what a scheduler is which is not what I'm after here, so apologies if the above comments sounded rude. It is commonly stated that there are four fundamental forces, or interactions, in nature. It is natural to consider which of those is responsible for the normal force we meet in elementary physics. What is the nature of the force exerted on a body by the floor on which it rests?  Of the four forces, the only one that seems relevant is the electromagnetic force, and I always assumed the repelling force in question is ultimately the EM one. The Wikipedia article on  seems to agree:     Molecular and quantum physics show that the electromagnetic force is the fundamental interaction responsible for contact forces.    An alternative explanation is that the force results from Pauli's Exclusion Principle; however, reasonable as it may seem, it doesn't seem to answer the question of what force is actually at play here. The exclusion principle isn't a force, or at least it's not normally described as such.  I've recently come across a rather forcefully presented argument that states that the normal force is a macroscopic force that is not directly reducible to the EM force, or to any of the other forces; rather, it does indeed result from Pauli's Exclusion Principle by way of interaction of electron wave functions. The argument further claims that attempts to correct the Wikipedia article have met with the usual "source needed" objections, and that this topic is either misunderstood by or poorly covered in the standard texts.  (The argument can be found ).   Which way is it? Map composer issue Setting up LVM Snapshot as a backup/restore point in ubuntu Is this notification that keeps coming up on my phone a virus? This notification keeps coming up, and i'm not sure if it's real or a virus, or how to stop it coming up. It says 'Android system warning! Google has found serious bugs in your Battery Module!Click on [OK] to view details.'   Screenshot (click for larger variant)  Any help appreciated, thanks. Lauren. Software for drawing geometry diagrams