What are the differences between a digital signature, a MAC and a hash?

Question: A message may be accompanied with a digital signature, a MAC or a message hash, as a proof of some kind.
Which assurances does each primitive provide to the recipient?
What kind of keys are needed?
Comment: Seems like an attempt to create a canonical question that explains the difference between commonly confused operations.
Comment: Good question indeed
Answer: These types of cryptographic primitive can be distinguished by the security goals they fulfill (in the simple protocol of "appending to a message"):

Integrity: Can the recipient be confident that the message has not been accidentally modified?

Authentication: Can the recipient be confident that the message originates from the sender?

Non-repudiation: If the recipient passes the message and the proof to a third party, can the third party be confident that the message originated from the sender? (Please note that I am talking about non-repudiation in the cryptographic sense, not in the legal sense.)

Also important is this question:

Keys: Does the primitive require a shared secret key, or public-private keypairs?

I think the short answer is best explained with a table:

Hash
MAC
Digital signature

Integrity
Yes
Yes
Yes

Authentication
No
Yes
Yes

Non-repudiation
No
No
Yes

Kind of keys
None
Symmetric
Asymmetric

Please remember that authentication without confidence in the keys used is useless. For digital signatures, a recipient must be confident that the verification key actually belongs to the sender. For MACs, a recipient must be confident that the shared symmetric key has only been shared with the sender.
The longer answer:
A (unkeyed) hash of the message, if appended to the message itself, only protects against accidental changes to the message (or the hash itself), as an attacker who modifies the message can simply calculate a new hash and use it instead of the original one. So this only gives integrity.
If the hash is transmitted over a different, protected channel, it can also protect the message against modifications. This is sometimes be used with hashes of very big files (like ISO-images), where the hash itself is delivered over HTTPS, while the big file can be transmitted over an insecure channel.
A message authentication code (MAC) (sometimes also known as keyed hash) protects against message forgery by anyone who doesn't know the secret key (shared by sender and receiver).
This means that the receiver cannot forge any message – thus we have both integrity and authentication (as long as the receiver doesn't have a split personality), but not non-repudiation.
Also an attacker could replay earlier messages authenticated with the same key, so a protocol should take measures against this (e.g. by including message numbers or timestamps). (Also, in case of a two-sided conversation, make sure that either both sides have different keys, or by another way make sure that messages from one side can't sent back by an attacker to this side.)
MACs can be created from unkeyed hashes (e.g. with the HMAC construction), or created directly as MAC algorithms.
A (digital) signature is created with a private key, and verified with the corresponding public key of an asymmetric key-pair. Only the holder of the private key can create this signature, and normally anyone knowing the public key can verify it. Digital signatures don't prevent the replay attack mentioned previously.
There is the special case of designated verifier signature, which only ones with knowledge of another key can verify, but this is not normally meant when saying "signature".
So this provides all of integrity, authentication, and non-repudiation.
Most signature schemes actually are implemented with the help of a hash function. Also, they are usually slower than MACs, and as such used normally only when there is not yet a shared secret, or the non-repudiation property is important.
Comment: One interesting variation is using the result of a DH key exchange as the key for a MAC. That way you can use asymmetric keys, but you avoid non-repudiation.
Comment: so basically: MAC is a Hash that uses a "symmetric" key, Signature is a Hash that uses an asymetric key.
Comment: Note that this diagram is not really correct anymore. Some cryptographers say that a MAC provides "integrity", not authentication anymore, since it's clearer. Whereas a hash does not provide integrity, but rather pre-image, second pre-image, collisions resistance.
Comment: @Mindau isn't that the repudiation aspect? ie. the sender can repudiate the message.  However.. assuming the shared key is safe and the receiver has only shared it with the sender it follows that the receiver *knows* the message came from the sender. ( if a MAC is used )  So the sender is "Authenticated" via MAC
Comment: A hash and MAC can be truncated to an arbitrary size. A signature cannot.
Comment: @flimm check something like Dan Boneh and Shoup's book on cryptography. http://i.imgur.com/j0vL8Rw.png
Comment: @David天宇Wong I don't read that many cryptography textbooks, but as far as I know they have the definitions that are used here. In any case, I'm glad that the answer includes the definitions before the table, which is the clearest solution.
Comment: Very good answer. Can someone extend on that table with regards to the "security goal" or "confidentiality" ?
Comment: I guess MAC does NOT provide anti-spoofing mechanism while the Digital Signature provides that.
Comment: @shuva digital signature does not protect against spoofing.. It's just like plaintext+signature so it doesn't provide confidentiality by itself.
Comment: MAC does not prove Authentication, because Receiver can create identical message and Sender can disagree about sending anything
Comment: `If the hash is transmitted over a different...` --> Usage example: mega.nz
Comment: just one correction:quote:"A message authentication code (MAC) (sometimes also known as keyed hash) protects against message forgery by anyone who doesn't know the secret key (shared by sender and receiver).", this is only true to good MAC like HMAC, not bad MAC based on hash functions like md5 sha1 which are prone to Length extension attack
Answer: Hash = A result of a mathmatical function that is difficult to reverse engineer.
The result of applying hash to a text is a long code.
Examples of hashes: MD5, SHA1.
The length of MD5 code is 128 bits, the length of SHA1 code is 160 bits.
With a hash: You cannot revert back to the original message. But the same message will always give the same hash. So if you receive a message along with a hash. You an always calculate your own hash. If the 2 hashes match it means the message is the original one, if not, the message has been tampered with.
The important thing about a hash is that a minor change to the message makes a huge difference to the hash code.
This means that a hash assures the integrity of the message.
Encryption (you didn't ask but it's important in the context) = You replace the text of a message in a way that is impossible or at least very difficult to decrypt, unless you have the key. If you combine the key with the encrypted message you get the original message.
This means that an encryption assures the secrecy of a message.
There are 2 types of encryption: symmetric and assymentric.
The symmetric is faster but less secure. It uses only 1 key for encryption and decryption. Both the sender and the receiver need to know the key and keep it a secret.
The risky part in the symmetric encryption is sending the key from one to another, because there is only one key and if compromised the whole conversation is compromised.
Examples: AES, DES.
The assymentric is slower but more secure. It uses 4 keys, each user has 2 keys, one for encryption and one for decryption, these 2 keys are mathmatically linked. The encryption key is the public key while the decryption key is the private key. A public key can only be decrypted by it's matching private key.
The public key, as the name suggests, is not a secret, the owner of the pairs of keys can post his public key on his website or whatever for anyone to pick, and in fact he has to in order to receive encrypted messages that can only be decrypted with his private key. It's like an address or mailbox. The private key, as the name suggests, must be kept a secret. If the owner of the pairs of keys has his private key compromised, then anyone can know what messages he received. Best thing to do in that case is generate a new pair of keys.
To communicate with assymentric encryption, exchange public keys. Unlike symmetric encryption, you can do this in the open, nobody can read your messages if he only knows your public keys.

If you want to send a message, use the public key of the other person to encrypt the message and send it to them, only they will be able to unlock the message with their private key and read it.
If you are to receive a message, the other person must have used your public key to encrypt your message, that means only your private key can decrypt the message.

Examples: RSA, DSA.
Of course, most of the time this is done automatically by e-mails or other forms of messaging. You may have communicated with assymentric or symmetric encryption already without manually encrypting and decrypting a message.
Now, in digital signature the opposite is done. You don't encrypt with the other person's public key but with your own private key. Because of this, anyone can use your public key that is out in the open to decrypt that message. How is this a signature? Because only you had access to your private key, which means that if decrypted only you could have sent that message.
This doesn't only create authenticity, but also integrity of the message and non-repudiation. Why as latter 2 as well?
Because what the digital signature actually encrypts with the private key is a hash of the whole message that you are sending.

If your message is: "Hello there, General Grievous!" a hash is used for all this text that generates a code, that code is then encrypted with your own private key.
The one who receives your message, uses your own public key to decrypt the signature, then he gets a code. He applies the same hash algorithm (for example MD5 pe SHA1) that you used to the whole message, you should mention what hash algorithm you used in the message, and if the hash result he got matches the code/hash result that he got after decrypting your digital signature with your public key, it means not only that the message was sent by you, since you are the one who owns your private key that encrypted the digital signature, but also that the message he received is the original one you meant to send, since its hash matches the hash in the signature. Because of the signature, you cannot deny the authenticity of the message and of yourself.

But how can you make sure that the public key you send in the open cannot be tempered with, or have someone make a public key of their own and claim it's your key? That way they can decrypt the messages that are meant to you, and you can't. That is where digital certificates come in. Digital certificates make sure that the public key posted in your name is indeed your public key.
Digital certificates include information about the public key, information about the identity of its owner called the subject and the digital signature of an entity that has verified the certificate's contents, a 3rd party called the issuer. If the signature is valid, and the software examining the certificate trusts the issuer, then it can use that public key to communicate securely with the digital certificate's subject.
Why can't you just make a simple hash to guarantee the integrity of the message? Because an attacker can take your message, create a new one, and then make a new hash then send them to the receiver. The hashes will match and there's no way the receiver can tell whether he got that message from your or an attacker. Where as in the case of digital signature, the attacker doesn't have your private key to go that extra mile of asymmetric key encryption. He can encrypt it with his own private key, but then the receiver won't be able to decrypt it with your public key and will realise that signature is not from you.
But what if you want to ensure the integrity of the message but not necessary the authorship of the message and you just want the messages to work faster? You're not at work or in a public institution, you talk to a friend and none of you cares about the legal bindings of making sure the message is from each other. That's where HMAC comes in, unlike digital signature, the HMAC encrypts the hash of the message with a symmetric key.
Being encrypted with a symmetric key, the authorship of the message cannot be tracked back to you, because you're not the only one who has access to that symmetric key. The receiver also has the same key and he could have made that message himself. Of course, they are the only 2 people that have access to the symmetric key, so unless one of them compromised the key, the message that you received, if you know that you're not the one who wrote it, you can be sure that it came from the other person who has the symmetric key.
The H in HMAC stands for hash and the MAC stands for message authentication code, meaning a code that guarantees data integrity as well and authenticity, by allowing the viewers who posses the secret key to detect any changes to the message content. A MAC usually has 3 parts: a key generation algorithm, a signing algorithm and a verifying algorithm.
In short:
Digital Signature = Hash of the message is encrypted with the private key of the sender.
HMAC = Hash of the message is encrypted with the symmetric key.
Comment: Welcome to crypto.SE. This answer has multiple issues. A few: "[reverse engineer](https://en.wikipedia.org/wiki/Reverse_engineering)" is finding specification from example or code, when the standard assumption with hashes is that their construction is public; you want: difficult to "reverse", but that's only one of the desired properties of a hash. "The result of applying hash to a text is a long code" is misleading: output is typically shorter than input; you want "a fixed-size bitstring". "If the 2 hashes match it means the message is the original one" is wrong, the hash can be altered too!
Comment: Other issues: Asymmetric crypto is not inherently more secure than symmetric one. _"Digital Signature = Hash of the message is encrypted with the private key of the sender"_ uses incorrect terminology: encrypts implies intend to make what's encrypted unintelligible to adversaries. Also, that wording does not reflect how some signatures schemes like DSA work. _"HMAC encrypts the hash of the message with a symmetric key"_ is incorrect: it would imply ability to find the hash of a message from it's HMAC and the key, and that can't be done for an arbitrary unknown message.


Feedback for logo

Question: I would appreciate some feedback for a fictional l brand I devised. so basically, the company creates fresh, authentic Italian food for people who are looking for something quick to eat, but aren't willing to sacrifice quality. Therefore, I'm aiming for a logo that gives a real rustic and homely feel when viewed.
Thanks
Comment: There's an apostrophe missing.
Comment: Moreover, heartland has specific connotations - especially to someone with some knowledge of Italy - is this food specifically Tuscan style? What makes this restaurant the "heartland" of Italy, versus you know, the actual Italian heartland? "Food *from* the Italian heartland" maybe, but as written it seems as though you are saying this restaurant IS the heartland of Italy proper - which seems like a grandiloquent claim a priori. Secondarily, though you have a slight touch of Italian flag colours, the only other symbolic or graphic element you have to tie to "Italian" is a wooden spoon...
Answer: Despite the scarce information in the question about the concept and the total absence of the logo realization process, it presents some formal details that may need solution.

The combination of a calligraphic font with an italic is never recommended, since it's nearly impossible to find two different families fonts with the same directional axis. On the contrary, the contrast with a normal regular font is preferable.

In addition to the two fonts, there are two other different graphic styles. Four elements to unify in a logo. This added to four formally different elements harms his visual unity.

Added to the double typographies directionality, the white of the Italian flag is interpreted as a space, which causes each of the color strokes tend to escape the limits of the logo, again disadvantaging the formal unity

Personally I think that there are four elements placed in a random way without any sense, which makes it difficult to try to create a unique image, a logo. So the only vertical alignment axes are the left and right edge, the rest is chaos, no vertical axis matches.

My recommendation, organize everything, not only the conceptual but also the formal elements and study in depth if what you have resolved conceptually is reflected visually.
Being the designer or the owner of the company, imagine that someone accuses you of plagiarism and you must defend this logo in a court describing each of the points you wanted to represent when creating it:

It's not about finding a graphical solution for each point, but at the level that is now, the judge will only clearly see Italy and Food. Maybe he will ask:

It's quality a British calligraphic wedding font?
It's rustic an imperceptible graphic treatment?
It's home feel a bad made pictogram of a wooden spoon?
Answer: I don't find it rustic or homely.
Looks to me like you wen't more for elegant.
I also think you're trying to put to much into it. I realize it's a flag, but the white sort of melts into the background so it just looks like two colored rectangles on each side. Add to that the spoon and the slogan, I think it's a bit too much for a logo.
I would take away either the spoon and center the slogan or take away the flag.
A logo needs to be more cohesive, like one solid thing.
Also Scott's right, there should be an apostrophe in "Nonna's".

Feedback for logo


How to Install Ubuntu on Windows?

Question: I downloaded Ubuntu from torrent, and opened it by extracting the file.
Now, I don't know what to do, and copied all the files in C: drive and restarted my PC, but Ubuntu doesn't get started. What more I've to do ?
Answer: To install Ubuntu, first you need to burn the ISO that you downloaded to CD.  To do so see Burning ISO How to.  Once that is done, you need to boot from that CD, and make sure that your system is set to boot from CD. Once it boots, you will have the option to install Ubuntu alongside windows, and that way you have both Ubuntu and Windows on the same machine.  A second way, is to install Ubuntu from within Windows, just like any application, by running wubi.exe from the CD. For more information on how to install Ubuntu you may check out Installing Ubuntu Desktop or Welcome to the Ubuntu installation guide!
Answer: You can always install from within Windows with WUBI.
Answer: you have downloaded and extracted the files in you C drive but you have not made an instance of Ubuntu at the boot loader.
WUBI is the Windows Ubuntu Installer but it is very risky to use but after sometime it would freeze you windows. So I suggest you to make a separate partition of Ubuntu and swap of 4-5 GB and install ubuntu in that make the USB Bootable.
Answer: Ubuntu is an operating system. it does not run in Windows, it is an alternative to Windows. Go to Ubuntu.com for advice on how to install and try Ubuntu
Comment: Ubuntu can run in Windows through WUBI .

How to Install Ubuntu on Windows?


View of moon from South Pole?

Question: What would the moon look like to someone at the South Pole?  To a first approximation, it's bisected by the horizon. But how far above and below does it get?
Comment: A nice short related page:   http://curious.astro.cornell.edu/about-us/46-our-solar-system/the-moon/observing-the-moon/134-why-is-the-moon-higher-in-the-sky-in-winter-and-lower-in-the-summer-beginner
Comment: Just to clarify: the Moon is not bisected by the horizon. The Moon's orbit around the earth is bisected. So the Moon is visible for half of its 27.3 day orbit, then below the horizon for the other half of the orbit.
Comment: @JohnHoltz I got that, from tge last paragraph in James' answer.
Answer: The moon orbits close to the plane of the ecliptic, which is tilted at 23.5 degrees to the equator, the moon is slightly off the ecliptic, and can be about 5 degrees above the ecliptic.
So, on the winter solstice (June 21) if full moon happens to be furthest from crossing the ecliptic, the moon would be 28.5 degrees above the horizon: roughly a third of the way between the horizon and the zenith. It can get the same distance below the horizon, and during summer the full moon would not be seen at all.
Our moon is unique in being close to the plane of the ecliptic, and not in the plane of the equator, which suggests its formation was not like that of other moons in the solar system.

View of moon from South Pole?


Does setting httponly prevent stealing a session using XSS?

Question: If a session token is stored in a cookie that has httponly set, is there any way that a XSS vulnerability could allow a malicious user to steal a users session token?
Comment: you may find this interesting http://security.stackexchange.com/q/39524/21234
Answer: In general, if httponly is set on its token then an XSS attack shouldn't be able to retrieve a session token. Modulo past bugs in browsers and plugins, and server misconfiguration (eg responding to HTTP TRACE).
But it's not worth much. You can stop XSS from getting hold of the token, but an XSS attack still has full control of the session on the user's machine: it can force the user to do pretty much anything on the site, or falsify the user's interface to the site (eg to phish for site credentials). See BeEF for an example of what an attacker can achieve with a compromised session: you've pretty much lost already.
Not setting httponly at best makes life slightly easier for the attacker in that they can access the session from their own machine in their own time, rather than being limited by the amount of time the user keeps their browser window open. It's worth having httponly where possible, but it's a mild mitigation that does not magically protect you from the effects of XSS.
Answer: The HttpOnly feature can be bypassed in certain versions of some browsers and web servers.
More data (natexim)
More data (google)
XSS attacks are so flexible that they can still be executed if, for instance, the HttpOnly feature has been used to hide the cookie from JS and ETC . Other possible scenarios include bypassing CSRF tokens, exploiting browser weaknesses, spoofing internal web pages, etc.
Answer: If done correctly, HttpOnly prevents an attacker stealing the cookie. However, they can still perform arbitrary web requests impersonating the victim users, and extract the responses. For example, BEEF has a module to do this.
In other words, HttpOnly makes things harder for an attacker, but does not stop a skilled attacker.
Also, as others have pointed out, there are various flaws that can allow an attacker to extract an HttpOnly cookie.
Bottom line - all XSS is potentially serious and you need to fix the XSS flaws.
Answer: Yes. Mostly. The header prevents "Cookie Stealing" which is an easy way for a script to hijack your session.
It also depends if your browser supports the HTTPonly header. If not then it is ignored and the functionality that it creates never happens.
Here is a link explaining the header a bit more. It also contains a table showing which browsers support it:
https://www.owasp.org/index.php/HttpOnly
Answer: if the HTTPOnly is not set in the header you will be vuln. to XSS, only as much as your browser supports this flag in the header. The big item to understand is this is primarily contingent on the web browsers ability to set this flag.


How to convert a chocolate fudge frosting recipe to white chocolate?

Question: I love the Betty Crocker recipe for fudge frosting! My problem? I really need a white chocolate instead of a cocoa frosting and have no idea how to substitute white chocolate for the 2tbsp cocoa the recipe calls for.
Comment: Hello Erin, and welcome to the site. We insist on a somewhat stricter structure of our questions and answers, to make them easier to find by all other people who need this information. So, I edited your title to reflect what is said in the question body. Besides, it looked like you are asking for somebody to give you a completely new recipe, which would be off topic, as we don't swap recipes here, we troubleshoot problems and discuss techniques. But your actual question, as described in the question body, is on topic, and fits the site well. Welcome!
Comment: Forgot to mention: In substitutions questions, please include the full recipe, it is important because substitutions are so hard and one has to know what other ingredients are there. I have never heard of a Betty Crocker recipe for fudge frosting, and searching for it on the Internet only shows a ready to buy product, not a recipe.
Answer: I'm afraid this is not possible at all. Dark chocolate flavor comes from aromatics in the cocoa bean, which give flavor already in low amounts. The flavor of white chocolate is very subtle, it's a combination of the aroma of the cocoa fat and the concentrated dairy solids. You cannot add it to anything as a flavoring, because practically anything else will have a stronger flavor of its own and mask the white chocolate taste.
The only way to have a cake which is covered in something which tastes like white chocolate is to make a white chocolate ganache. But then the texture will be a ganache and not a frosting. You will not be able to use your original recipe.
See this question for the correct ratio on white ganache, many people just try it like dark (that's what I did the first time too) and it ends up liquid.


Get Windows 7 to remember my multi-monitor configuration and automatically restore windows when reconnected

Question: I'm looking a way to enable one feature: when I disconnect one of my monitors (e.g. to do a presentation with a projector), when I come back and reconnect that monitor, restore all my windows to where they were before I disconnected. In this case I've only got my desktop monitor and 1 (of many) projectors to remember, but ideally the software could remember as many setups as necessary. It would be nice if it could group configurations (e.g. built-in screen + high resolution external, built-in + low resolution external) rather than having a setup for every projector I might ever have connected to.
Is there any way Windows 7 can do that? I haven't found anything in Windows that appears to provide that functionality. I'd have thought that after at least 15 years of supporting multiple monitors, I can't be the only person who's tired of having all their applications jumbled up just because I had to connect to a projector for a presentation. All the third-party software I've looked at seems to require me to manually create and switch between profiles and don't seem to be able to automatically select one based on connecting a specific monitor configuration. They also expect that I'm going to take the time to assign specific applications to specific monitors, but what I really want is for the computer to just remember which window was on which monitor and what state it was in the last time this configuration was connected (there's already a UI built in to Windows allowing me to indicate which application windows I want on which screen -- it's the Windows Shell and Desktop Windows Manager).
Thanks.
Comment: Welcome to superuser. Please know that your question is [off-topic](http://superuser.com/help/on-topic) as this site does not offer purchase recommendations.
Comment: I've edited the question to make it clear that I don't need a purchase recommendation, just a way to make Windows 7 a little intelligent about how it handles multiple monitors.
Answer: You could use IconRestorer
Or Midi-ox Desktop Restore
Both are fine with W7 and do what you want. I won't provide links (since they die). Google either, or Google the search term windows 7 save desktop layout


08 impreza wont start in morning unless jumped new battery

Question: '08 impreza turns over but wont start. Replaced battery twice, new. This morning same thing, cranks and feels like it's going to turn over but doesn't. Attached jumper cables, starts in a heartbeat. Drove it for a few minutes, no problem starting after that. This has happened the previous 4 mornings. It's my son's car and he's driving me crazy.
Comment: Is the battery of the right capacity? I went to a battery shop where they tried to sell me a 20 amp-hour one for a lawn mower, when I needed a 70 ah one. But it's not just the capacity that varies, but the amperage it can deliver. When the engine is warm, you don't need as much battery power to start it.
Comment: I had a battery store and mechanic replace the batteries so I would think they're correct. Thanks
Comment: Exactly where are you connecting the jump leads to on the faulty car?
Answer: This sounds like you have a power leak somewhere draining the battery as it sits overnight. This could be a simple as a map light being left on or a trunk light or something similar staying on due to a faulty switch.
The other cause of a power leak would be a short in a wire or component that isn't bad enough to blow its fuse but enough to drain the battery. I've had that happen with a stereo once, it could be many other things though.
Tracing the problem, first I would wait until dark and look for lights still on. Try pushing the glove compartment light switch in to see if it turns off, have someone sit in the trunk when you close the lid to see if the trunk light goes off as well.
Checking the lights takes minutes and no tools, confirming you have a battery leak and tracing the leak to the source requires a multimeter. You connect it inline with the battery's negative battery terminal and look for amps above 50Ma, a serious drain would be well above that. You have to wait for everything to turn off in a modern car though, it often takes up ti 30 minutes for all the electronics to turn off. I'm not going to go into more detail on this because there are several sites to help, for instance this one.
Comment: I'm inclined to think there might be a parasitic drain as well - New Age Imprezas  can be awful for this. Alarm, immobilizer and tracker (if fitted) are common culprits as well as what you mentioned
Comment: I think vehicle specific guidance like that is worth an answer on its own @motosubatsu.
Comment: That makes sense, I'll look for that tonight. Thanks, I appreciate the advice. BTW, this is my first time on this forum and thanks for the quick responses.
Comment: We all know what it's like @Russ6261, I hope you get it resolved quickly!


Web server slow when transfering many images

Question: Here is a little background of a intermittent but very real problem. I maintain a web application that is running on Esxi private cloud. We have a database server, and 4 web application servers. The 4 web application servers all have a very odd problem. The servers all run (Ubuntu 10.04.3, 2.6.32-28-server, Apache web server, proftp ftp) When I transfer many images, either over ftp or http, (internal or external), most of the time it is very slow. For example, downloading a directory of about 400 images (< 2 megabytes) have very slow transfer speeds, sometimes at a complete stand still. Similarly over http if I load one of my pages in my browser for the first time, depending on how many images there are, it may have the same struggle. When I load the same page again, it is ok because of browser caching, however as soon as i clear the cache, it is back to the very sluggish speeds. I say may because this doesn't happen all the time, sometime it transfers the files at normal speed which is virtually instantly. All of these machines are virtual, and I have tried just building them again, with no success. Someone suggested it could be a host name, or a naming problem, but didn't really give a clue of where to being to trouble shoot this theory. I'm not a server guy, nor do I pretend to be one. Our servers are hosted by a 3rd party with managed hosting, however the managed hosting doesn't seem to know what to do with this problem. Any help would be greatly appreciated
Answer: Your goal here is to locate the bottleneck. In other words, the particular place in the pipeline that is causing the slow downs.
Collect your Vitals
The first step to this is to collect data. The most common bottlenecks are Network IO, Disk IO, CPU, and Memory Constraints. You can either use a full fledged monitoring system that collects data like Cacti, or something local like sar which is part of the systat package.
Once you have this data, you should be able to cross reference it with response time from your web logs and see if any of this data correlates. It might not and you will have to dig deeper -- but this of these as the vitals that you always check first.
Less fancy, you can just watch something like vmstat output and you might get lucky and catch the problem -- but intermittent problems can be hard to solve.
Localizing the Problem is a fundamental troubleshooting skill
When solving a problem it often makes sense to use a sort of binary search along the pipeline to try to eliminate variables.
So for example if you are testing from a browser on workstation, run tests from the server itself to cut out your workstation and the network. If you no longer have that problem, it is either your desktop or the network between you and the server. If you still have the problem, it must live somewhere in the server.
Other Places to look
Also if this is a dynamic web page there could be problems with the application itself, so you might approach this from profiling production code as well.
Lastly, one of the difficulties with virtualized environments is that other virtual servers might be impacting yours -- but you probably don't want to jump to this conclusion until you are at least monitoring your vitals.
Answer: Slowness, either permenant or intermittent, could just be due to I/O contention. If there are many active VMs on the same host as yours you will be competing with them for I/O bandwidth. It could also be that the host is overcommitted in terms of memory use so the memory pages allocated to your VM(s) are actively swapping, which has much the same effect but worse.
When transferring many small image files via HTTP, the problem may not be the server though. If you are some distance away from the machine it could simply be a latency issue. If there is 100ms between you and the server (you can check this with a basic ping command) and the browser uses 2 concurrent connections then you are going to see an averge of around 50ms per image added to the page load time just due to network latency.
Similarly for sending many files via FTP, though the FTP protocol is very chatty (transferring a file takes at least two round-trips on the command connection and the opening of a new data connection) so is more sensitive to latency related performance issues than HTTP. You can improve on file transfer performance by using a more modern protocol like SFTP or SCP (both provided by OpenSSH and other SSH servers) (not FTPS: this is just FTP via SSL streams, so has all the bottlenecks of normal FTP plus those of SSL).


Why is the Aleph diminished in size in Vayikra 1:1?

Question: Vayikra 1:1 "And He called to Moshe and spoke..."
In some Torah scrolls the Aleph in the first word is diminished in size. What is the significance of this anomaly? (The very next word — to Moshe — begins with a full-size Aleph.)
Comment: http://www.aish.com/tp/b/mt/48961066.html
Comment: Also see http://judaism.stackexchange.com/q/9510/3
Answer: The Lubavitcher Rebbe writes in Likutei Sichot concerning the small alef in Vayikra:

He called to Moses: The alef of the word for "He called" (ויקרא), the first word in the Book of Leviticus, is written smaller than usual, alluding to Moses' humility even in the face of his own greatness and his selection by God for his exalter role in human history. In contrast, the alef in Adam's name (אדם) as the first word of the Book of Chronicles is written larger than usual, alluding to Adam's self-esteem as the acme of God's creation. Although it is both necessary and good to be aware of one's positive qualities, Adam allowed his self-esteem to degenerate into conceit, and this caused his downfall.
Moses rectified Adam's mistake. He recognized his greatness but nevertheless remained humble. His humility was not self-delusional but the result of simple reasoning. "I cannot take any credit for any of my gifts or accomplishments," he thought, "since they are all God-given. Indeed, were another person to have been given my potentials, he would have accomplished more and climbed greater heights than I have." He understood that true humility does not mean denigrating oneself but seeing the virtue in others.
We are all spiritual heirs of Adam and Moses. When we feel inadequate we must remember that we are Adam, with a big alef. When thoughts of "Who am I?" deter us from our task, we must recall that we are Adam, formed by God's own hands, and fully capable of caring for His garden. At the same time, we must recall that we are Moses, are thereby ensure that our self-assurance does not develop into conceit.
Moreover, if we remember the small alef, we, too, will merit to be called by God, and this revelation will provide us with the strength to answer God's call, drawing ourselves and the world at large closer to Him. This is the true essence of the sacrifices, whose laws are introduced by the lesson of the small alef.
(Likutei Sichot, vol. 17, pp. 7-8)

(From the Kehot Chumash)
Answer: Baal Haturim:

א' דויקרא זעירא שמשה לא רצה לכתוב אלא ויקר כדרך שנא' בבלעם כאלו לא נראה לו השם אלא במקרה ואמר לו הקב''ה לכתוב גם באל''ף וכתבה קטנה.

loose translation:

Moses wanted to write it without an aleph to hide, [out of humility,] the fact that G-d called him [warmly, with affection and love,] contrarily to the manner in which He called non Jewish prophets such as Bil'am [and Hagar],  expressing that prophecy to them was just "an accidental event". The Torah wrote "called/encountered/appeared" for them without an aleph. Calling [with love] should be written with an aleph. G-d ordered Moses to write it with an aleph. [Out of humility] Moses wrote it with a small aleph.

See Rashi for a good explanation of the difference between "ויקר" and "ויקרא".
Answer: Rabbi Shmuel David Luzzato, more commonly known by the acronym "Shadal," wrote the following concerning the small alef:

.(ויקרא: לענין א' זעירא עיין מה שכתבתי על קצתי בחיי (בראשית כ"ז מ"ו

So now we go and check his commentary on Bereshit 27:46, like he tells us to, and here it is:

ותאמר רבקה אל יצחק קצתי בחיי: הקו"ף זערה, נ"ל כי היה מנהג הסופרים בימי קדם כשהיתה תבה מתחלת באותה האות שהתבה הקודמת מסיימת, היו משמיטין אחת מהאותיות הדומות, ואולי היו מציינין האות ההיא באיזה סימן להודיע שהיא עומדת במקום שתים, ואחר זמן הוסיפו בין שתי התבות האות החסרה, ולהיות המקום צר כתבו אותה זערה, וכיוצא בזה ויקרא אל משה (ויקרא א' א'). והנה מהמנהג להשמיט אחת מהדומות נמשכו כה וכה קצת טעיות, קצתם נתקנו אח"כ על ידי כתיב וקרי, וקצתם לא נתקנו, כגון (שמואל ב' ה' ב') והמבי את ישראל, במקום והמביא, (ירמיה ל"ב ל"ה) החטי את יהודה, במקום החטיא, (שם כ"ג י"ד) לבלתי שבו, (שם כ"ז י"ח) לבלתי באו, במקום ישבו, יבאו, (ישעיה מ"ה כ"ה) עדיו יבא ויבושו, (יחזקאל כ' ל"ח) ואל אדמת ישראל לא יבא ויעדתם, במקום יבאו, (ד"ה א' י"ז י"א) כי מלאו ימיך, משפטו כי ימלאו , (שמואל א' י"ט ט') ודוד מנגל ביד ויבקש, צ"ל בידו, ועוד זולת אלה.

[Paraphrase:] When a word begins with the same letter as the word before it ended, the scribal practice used to be skipping one of them and perhaps including a symbol to indicate that one letter was standing in for two. Later, they added back in the repeated letter but if there was little space they wrote it smaller. Successful examples of this two stage evolution are this one, "ותאמר רבקה אל יצחק קצתי בחיי" and "ויקרא אל משה".

[Also:] Sometimes the practice of condensing identical neighbors caused further mistakes when one of them got left out entirely. Examples include "והמבי_ את ישראל" and "החטי_ את יהודה".
Answer: According to Midrash Osiyos Ktanos is to teach us that HKBH reveals His shehina partially to other nations but not to Yisroel. See the way ויקרא is used with Bilam (without alef) in balak 23:4 but ויקרא (with alef) is used for Yisroel. The question then is, the midrash says, why is the alef here small? The answer is, to differentiate between the way Hashem addresses the malachim and the way Hashem addresses Moshe rabeinu.
Answer: Rav Hirsch points out that the phrase Vayikra 1:1

וַיִּקְרָא אֶל משֶׁה וַיְדַבֵּר יְהֹוָה אֵלָיו מֵאֹהֶל מוֹעֵד לֵאמֹר:

means that Hashem called to Moshe in order to speak to him. That is

to prevent that misused representation which tries to change the
  Divine revelation to Moses into some kind of revelation in Moses
  on a par with all those imaginary visions of a so-called ecstasy, or
  simply as an inspiration coming from within a human being.

Rav Hirsch connects this with the term וַיִקָר used with Bilam and the statement of the Chachamim that Moshe never knew when Hashem would speak to him, while Bilam knew when Hashem would speak to him (or had to seek the Word of Hashem).

But the word of Hashem came to Moses without any previous preparation
  on his part, without his having any idea that It was coming. Perhaps
  also this is the reason for the small א, in ויקרא, just to give a
  suggestion of Moses being completely "unprepared". Of the Word of
  Hashem to Moses one could leave out the א and say וַיִקֶר (קל) it was
  something that "happened to him, came to him completely unforeseen.
  This characteristic call to attention preceding Hashem's speech to
  Moses, is taken in ספרא as occurring before every occassion when
  Hashem spoke to Moshe.
Answer: From Artscrolls Stone Chumash:

The word Vayikra from the root word Kra - to call, also indicates that
  God wished to speak to Moshe, and purposely called to him. G-d's
  prophecy to Bilaam (Numbers 23:16) however is introduced by Vayikar,
  without an Aleph, a word that two connotations: Chance (mikreh) and
  spiritual contamination (as in I Samuel 20:26). This implies that,
  while G-d had a reason to speak to Bilaam, He did not do so lovingly.
In this verse, the summons to Moshe is spelled with a miniature Aleph,
  as if to make it appear like the word used for Bilaam. The
  commentators find mile rival insights in this usage, among them:
The Ba'al Haturim (as previously quoted by an answer above) writes
  that in his monumental humility, Moshe wished to describe G-d's
  revelation to him with the same uncomplimentary word used for Bilaam -
  without an Aleph - But G-d instructed him to include the Aleph as an
  expression of affection. Too humble to do so wholeheartedly, Moshe
  wrote a small Aleph.
Rav Bunim of P'schis'cha writes that the smallness is meant to give
  prominence to the letter, as if it were a separate word. The word
  "Aleph" means to teach thus implying that one should learn always to
  be "small" and humble. No man was better qualified to teach this
  lesson than Moshe, who was not only the greatest of prophets, but the
  humblest person who ever lived.


Some people say that Prophet Muhammad (PBUH) is present among them during let's say a naat or zikar mehfil. Is this true?

Question: I think the question is pretty self-explanatory. Would Prophet Muhammad (PBUH) be present (i guess spiritually) in a mehfil zikar? I have seen people decorate chairs or sofas in such ceremonies saying that the prophet will be among them.
Comment: I'm voting to close this question as off-topic because it is asking whether a particular practice is "true" without defining any sort of scope. We are not a site for determining which beliefs and practices are "true Islam" and which are not.
Answer: Let's look at what you are asking, Is the messenger of God, Muhammad (SAW) present somewhere? You then elaborate, "Would Prophet Muhammad (PBUH) be present (i guess spiritually)...". I take that you find it obvious that his physical and bodily presence is not the question. Consider,

"Who perfected everything which He created and began the creation of man from clay." Quran 32:7
  "Then He proportioned him and breathed into him from His [created] soul and made for you hearing and vision and hearts; little are you grateful." Quran 32:9
  "And present to them the example of the life of this world, [its being] like rain which We send down from the sky, and the vegetation of the earth mingles with it and [then] it becomes dry remnants, scattered by the winds. And Allah is ever, over all things, Perfect in Ability." Quran 18:45
  "Every soul will taste death .." Quran 3:185
  "Every soul will taste death. Then to Us will you be returned" Quran 29:57

These verses show that a human/naas (as per Islam) is seen as a combination of flesh (body) and soul (spirit, or whatever you name it). Clearly, the body (as mentioned above) dies and is dissolved like organic matter. We understand the biology of body thoroughly, but before we answer if the messenger of Allah, Muhammad (SAW) is present in a gathering, "in spirit", ask the people (who make this claim) what they mean by presence in spirit. Quran itself says that humans can not understand the idea of spirit or soul,

"And they ask you, [O Muhammad], about the soul. Say, "The soul is of the affair of my Lord. And mankind have not been given of knowledge except a little." Quran 17:85

The "little" being the knowledge already present in Quran. Then how do the attendees of such gatherings make claims of anyone's (in) spiritual presence when they have not been given of knowledge except a little. As a general rule, no one should make any claims about something they know very little of. Messengers of Allah are humans and so was Muhammad (SAW). Abu Bakr (RA) said at the death of Muhammad (SAW),

"...'To proceed, if anyone amongst you used to worship Muhammad , then Muhammad is dead, but if (anyone of) you used to worship Allah, then Allah is Alive and shall never die ..." Sahih al-Bukhari Book 64, Hadith 472

Then Abu Bakr (RA) recited,

"Muhammad is not but a messenger. [Other] messengers have passed on before him. So if he was to die or be killed, would you turn back on your heels [to unbelief]? And he who turns back on his heels will never harm Allah at all; but Allah will reward the grateful." Quran, 3:144

So, it is absurd at best to say that someone, let alone Prophet Muhammad's (SAW) spirit is present somewhere and then leave a spot vacant for it. Spirits require chairs now? What if two such gatherings are held at two different places at the same time? Is the spirit present at the same time at different places? As you can see, this gets silly as soon as you start to contemplate on what does it even mean to claim the presence of someone's ruH/soul/spirit.
The object of a muslim's reverence and adoration is not the physical presence or the mystical spirit of a Prophet as clearly quoted above. We must revere and adore the message of Allah's messengers, and the truth in it.


How can I debug a wpad.dat file?

Question: I am having obscure problems within the JScript included in my browser proxy autoconfig file (aka PAC file). All this is taking place on Internet Explorer 7, so what I am dealing with is actually the so called wpad.dat file. From what I understand, the browser executes this file's FindProxyForURL function to determine which proxy to use based on host and URL.
So my question is: How can I put a debugger on my code? Ideally, I would like to start Internet Explorer and step through my wpad.dat code in Visual Studio 2010's debugger. Is that possible? If not, how do you folks debug wpad.dat files?
Thanks and best regards!
Comment: For what it's worth, I resorted to a combination of alert(); and Wireshark.
Answer: I use pactester to evaluate which proxy will be used for a certain URL:
http://code.google.com/p/pactester/

How can I debug a wpad.dat file?


Violation of PRIMARY KEY constraint on landing page

Question: I'm getting Violation of PRIMARY KEY constraint when submitting a email address on a landing page. all I am doing is capturing the email address. the data extension is sendable and only contains the email address which is set as the PK. is there a way to check if the email already exists in the data extension.
CODE: SET @Response = InsertDE("DE", "EmailAddress", @EmailAddress)
Any help is appreciated
Answer: updated to upsertDE and it worked


Can I start using a Gateway netbook right out of the box?

Question: I have bought a Gateway netbook for my husband's birthday, and would like to give it to him ready to use. Best Buy wants $100 to set it up for me, but I would rather do it myself, if possible. Any tips or instructions would be greatly appreciated!
Answer: New computers have very little setup needed.  The first time you power it on, it will guide you through a few steps, like setting a password and connecting to a WiFi network, then it's ready to go.
New computers often come with a lot of "garbage" pre-installed, such as trials to various programs you probably don't want.  Sometimes the set-up services from places like Best Buy include removing all that stuff, but if you've ever uninstalled a program before, it's easy to do.
Lastly, you'll need an Anti Virus.  Most new computers come with one that's good for 60 days or so.  After that you'll need to purchase an Anti Virus or use a free one such as Avast or AVG.  Sometimes the price of the set-up services will include a 1 or 2 year Anti Virus subscription.
All in all, it's not worth what they charge unless you're very unfamiliar with computers and the price includes a good deal on Anti Virus or other security software.
Comment: It may be worth saying that, if the netbook comes with Windows 7 (as most do at the moment), you can use "Microsoft Security Essentials" for Anti-Virus.


Does new lawn/sod need aeration?

Question: I recently bought a house and am new to gardening and lawn care. Some guys stopped by and asked me if I need "aeration service." I was wondering if I need it for my new lawn/sod. I still don't see the grass coming up yet. It's still dry. I bought my house last winter around November. Could some one shed some light on this question please?
Comment: What part of the world are you in and what kind of grass is it? Also confused when you say you don't see the grass 'coming up yet', what exactly does that mean?
Answer: "Aeration" is where the lawn service folks use a machine to poke "holes" in thick grass sod, in order to let the air and moisture penetrate beneath it.  While a lot of people do this as a regular part of lawn maintenance, I don't believe it is helpful under all circumstances.  If you don't even have a lawn growing yet, I can't see how it could be of any benefit to you.
By the way, if your lawn is newly seeded, you need to keep it moist during the germination time for your grass seed or it may never sprout and grow.  So if it is dry, you should definitely get some water on that.  If it has been weeks or months since it was seeded, and you don't see any new growth yet, you may need to reseed.
Edited to add:  Ah, I misread.  Looks like you have sod.  I stand by what I said, though, if it's a new lawn (whether sodded or seeded) it shouldn't need aeration services.
Answer: Your question asks about "aeration" for your "new sod/lawn"... did you have a lawn installed already? Sod is basically "insta-lawn" and you would see the results immediately. I have never done aeration on sod lawns I have installed.
My experience is that Aeration is a way to help promote the growth and rejuvenation of older, existing lawns. As mentioned in another answer, it allows the soil to absorb moisture easier (bypassing the "thatch" problem most older lawns have).

Does new lawn/sod need aeration?


What is the frequency distribution of each base in a DNA sequence?

Question: Can we say that the frequency distribution of each base in a DNA sequence is equiprobable?

After the negative answer; i rephrase: Is there a use case in which the frequency distribution of the bases is equiprobable?
Comment: No. It is not. Very simple case - see GC percentage.
Comment: Just making an educated guess... DNA sequences are not random, thus the probability of any base being present at a particular location is not equal for all the bases.
Comment: My question was about their frequency.
Comment: ? so should your question say "what is the probability distribution" or "what is the frequency distribution"? I guess I'm not following your question - can you help me out?
Answer: The frequency of the bases in the genome isn't equal to 0.25, the frequency depends on what kind of organism you mean. However let's take a look at some of them:

bacteria, most of the time we can see a bias towards some bases, this could be a GC bias, for example if the bacteria lives in extreme conditions, because GC can vorm three hydrogen bonds compared to AT which can only form two hydrogen bonds. So it's genome is more resistent to extreme temperature, less denaturation chance because the stronger bonds. In bacteria there are also some polymerases which have a bias towards bases, I won't discuss this in depth to keep it short, but from these two points we can already conclude the genome isn't random
Homo Sapien, for example we need CpG Island near our promotor region, to regulate transcription. Further we have higher GC% in gene coding regions to reduce mutation chance, because we don't want to mutate genes wich are needed for survival. Their are also some sequence which are very specific for example TATA box and Poly-A signal, if our genome would be random, so all base would have a frequency of 0.25 these specific sequence could occur at place where we don't want them or they wouldn't occur at places where we want them. We need a promotor (with TATA box) for RNA polymerase binding, if our genome was random we have a big chance we would have genes wihtout a TATA box so no transcription of these genes will occur

There are a lot  more properties of the genome we could discuss but I think this will give you enough insight why the bases in the genome don't have a equally alike frequence of 0.25
UPDATE:
in addition to your second question: I think the chance of finding a genome which has an equally alike distribution is very small. because almost all organisms have undergo evelution, and when we have evolution there is natural selection and natural selection relies on mutations. So (almost) all genomes have udergo mutation, however this sometimes can favor an equally distibution for example if our genome is AGAA and one A mutates to an G we will have an equally alike proportion. So to summarize: maybe you can take a look at NCBI and look for a gc 50% wich means 50% AT so 25% of each base. If you find a genome wich has exact 50% gc, you have found your answer
Answer: There are two main driving factors to consider here:
First, G/C and A/T represent complementary base pairs, as G is always paired with C (and vice versa), while A is always paired with T (and vice versa).  Therefore the frequency of G is always equal to C, and the frequency of A is always equal to T.
Second, G is paired with C via 3 hydrogen bonds, while A is paired with T via 2 hydrogen bonds.  Therefore, G/C bas pairs are more thermodynamically stable than A/T base pairs, and require higher temperatures (more energy) to be pulled apart during replication and also transcription.  For that reason, organisms that have a higher body temperature tend to have a higher proportion of G/C base pairs than those which have a lower body temperature.  For example, the G/C content is higher in thermophilic bacteria than in mammals, and higher in mammals than in plants.  This fine-tuning of the G/C content enables the optimum balance between stability and the extra energy required to pull the strands apart when required for replication and transcription.


Is there a web view of my synchronized Google Chrome bookmarks?

Question: Google Chrome synchronizes my bookmarks between computers. When I am away from a computer that has Chrome on it is there a way to view these bookmarks on the web?
Answer: Currently, no, there is no way to view your Chrome bookmarks on the web.  You will need to use Chrome or some other 3rd party extension to get access to your bookmarks.  There is no URL or drive folder for Chrome bookmarks that can be viewed directly in a browser.
Prior to the release of Google Bookmarks there was the ability to view your Google Chrome Bookmarks via Google Docs:

In the previous version of the
  Documents List, if you were using the
  syncing feature in Chrome, your
  bookmarks were saved in a folder in
  the Documents List. With the newer
  version of the Documents List, we're
  no longer offering this feature;
  however, your settings in Chrome
  continue to sync across computers.

There is an option for a web interface for Google Bookmarks - however it is old and not related to Chrome bookmarks.
Answer: There is an option for a web interface for the google bookmarks link. I don't know when it was set up, but it works.
Comment: This is separate from the bookmarks that Chrome syncs. Interestingly, it's presently showing me the list of places I've stared in Google Maps on my phone.
Answer: Yes, I realize this is 3 years old but it's the top option on Google and the problem hasn't gone away...
What I do is periodically download the Chrome bookmarks HTML file (go to chrome://bookmarks/, then under Organize -> export the HTML file). The easiest way would be to simply host with Dropbox or similar (you could even do Google Drive) and while it isn't very pretty, it is still then available. It doesn't sync, though, but a lot of times, if you do this every once in a while, that's enough for when you need a website but don't remember the URL. What I would personally love is a combination between Xmarks and http://www.clippingsconverter.com/ (which is for Kindle clippings but the same concept). It would be separately hosted with a better interface then the default HTML file.
Comment: Can you do this on mobile Chrome?
Comment: To answer my own question, it doesn't even load the URL!
Answer: Other options using third party tools like http://www.xmarks.com/ include

http://www.linkcloud.org/
http://www.bookmarksany.com/
http://www.boodori.com/
https://icrumz.com/
http://markitbot.com/


Raspberry pi video streaming image error

Question: I have a problem with video streaming on raspberry pi. When I want to stream the webcam's image trough the network, the image has many errors, like fall apart, other colors and lot of garbage appear on it. I thought that it is my program's error, so I ran the mjpg-streamer, but the errors are the same. Then I removed the raspbian and installed the Arch Linux ARM and the mjpg-streamer, but no changing. I ran out from ideas, and I couldn't find a solution on the Internet.
Peter
Comment: Is your webcam under the supported devices list? http://elinux.org/RPi_VerifiedPeripherals#USB_Webcams
Answer: I would suggest using gstreamer for streaming. You could start with simple pipeline and try to stream your camera via UDP, that should be simple. By adding queue elements you should avoid errors in incomplete stream.


batch processing SNB files

Question: I am running Android 4 on SAMSUNG Galaxy Note 10,1, and using the S Note app,
Is there a way to process multiple SNB files at once? For example, S Note can export 1 SNB to PDF but not multiple,
but it would be better if there's also a way to export multiple SNBs to a single PDF
Answer: Yes, it is possible.
Try to go at the root of the note program. From a note, click the back button, then click on 'most recent notes' to see all notes. If you select "share", you'll be given to select more notes, or even folders.
For more information on compatibility, please provide with your exact version of s-note.

batch processing SNB files


Cookie created on page called by Jquery Ajax not working in Internet Explorer

Question: I have a page that does a AJAX call with jQuery to log a user in by setting a cookie on the ajax-called page. When I travel to another page in Firefox, Safari Chrome, etc, the login has worked.
But in IE6-9 the cookie isn't set. I did find some tips on specific header settings to satisfy IE's security preferences, but those all pertained to ajax calls to external domains, I am calling a page on the same domain ( by a relative path ). I tried it anyway, and it didn't work. Anyone seen this before?
Answer: Could be related to the path of the cookie set by the ajax request. Is it the same as the path of the login cookie you want? ie /my/ajax/request or /my/container/page instead of "/"
I'm working with a similar ajax issue where jquery won't set a cookie from within a loaded ajax block... intermittently :/  very strange
<code>$.cookie("my_setting", "true", { path: "/" });
</code>
simplified cookie path for now. Some browsers may scope cookies differently based on paths.
Also in some situations setting a cookie to false can make logic difficult, so I use string "false" instead of false 0 or null.
Edit:  My issue is limited to firefox 14.  Safari, IE9 and Chrome all have correct cookie behavior, allowing me to set cookies in the "/" scope from an ajax-loaded block, while FF has seemingly intermittent problems doing so.


Does an optimal path imply the heuristic is admissible?

Question: If we are given an A$^*$ path search with some heuristic $h$ that yields an optimal path, without knowing that the heuristic is admissible beforehand, would this imply that $h$ is admissible?
Comment: Have you tried constructing a counterexample? Have you tried proving the conclusion? Where did you get stuck?
Comment: I'm thinking to assume the opposite, that an optimal path is not admissible. Then, h(n) > h*(n).  That is, h(n) has a greater cost than the cost of an optimal heuristic and so h(n) is not optimal, a contradiction.  Would this be sufficient.
Answer: No.
Let us consider an extreme example. Let graph $G$ contain only two nodes, the starting node $s$ and the destination node $t$. The distance of edge $(s,t)$ is 1.
We have a heuristic function $h$, $h(s)=2$ and $h(t)=0$. $h$ is not admissible since $h(s)>1$.
However, using $A^*$ search algorithm, we will end up with the path $s, t$, the unique and, hence, optimal path.

Exercise. Construct a counterexample where there are more than one path.
Comment: Is it not admissible because the heuristic over-estimated the cost of getting to t?
Comment: Correct, since the definition of admissible heuristic is that it never overestimates the cost of reaching the goal.
Answer: The solution provided by Apass Jack is absolutely correct but beyond simple examples proving that the answer is "definitely no", let me add another consideration (which actually provides a solution to the exercise suggested by Apass Jack):
A heuristic which is inadmissible does not necessarily mean that paths found by A$^*$ with that heuristic should be sub-optimal
The reason is that heuristics serve for the purpose of ranking nodes. Admissibility simply implies that if two nodes are wrongly ranked (so that one node gets expanded before the correct one) this will have a limited effect in the number of subsequent expansions as A$^*$ will never expand nodes beyond the $f$-layer that contains the optimal solution (provided that the heuristic is admissible, which is the hypothesis in this paragraph).
Consider now the case where one heuristic is inadmissible but always (always!) ranks nodes perfectly. Then, certainly nodes will get sorted in the open list in their optimal order and the optimal solution is necessarily found.
To see this consider a perfect heuristic function, $h^*(n)$ and now and inadmissible heuristic function which adds a large constant $M$ to $h^*(n)$, $h(n)=h^*(n)+M$. Well, $h(n)$ is clearly inadmissible for values of $M$ arbitrarily large, but if one node $n$ has an $h^*$-value strictly less than another $n'$, then it will be perfectly ranked by the perfect heuristic function, $h^*$, so does $h()$ because adding the same constant $M$ does not alter the ordering.
So far, the solution to the exercise suggested in the other reply is simply the following: take any graph $G(V, E)$ and compute $h^*(n), \forall n\in V$. Construct now a new heuristic function $h(n)=h^*(n)+M$ for all $n\in V$ with a constant $M$ arbitrarily large, run A$^*$ ... and smile! :)
Hope this helps,


Why are most weapons in AC-130 on the left-hand side?

Question: Lockheed AC-130 gunship is a heavily armed ground-attack aircraft variant of the C-130 Hercules transporter. The plane is manufactured by Lockheed and converted by Boeing.

Why are most of the guns in AC-130 installed on the left-hand side (but not right)?
Picture Source
Comment: The picture above is somewhat misleading. In that image, it is not firing weapons at all. Those are countermeasures. "Most" of the guns on an AC-130 are not on one side, _all_ of them are.
Comment: He is talking about the guns not about countermeasures.
Comment: Weapons on the other side would be useless because they'd be firing at the sky
Comment: I rather doubt there's an extremely good reason for the weapons to be on the left instead of right. They had to pick *a* side, might as well be the side the pilot sees out of. As a counter-question, why should they *not* be on the left?
Comment: @slebetman I think the question is not only why are there weapons on one side only but also why are they on the left and not on the right.
Comment: Please provide attribution for your image.
Comment: Is there anything I can add to my answer for you?
Comment: *"Developed by the USAF Aeronautical Systems Division (ASD), the gunship applied a principle adopted by bush pilots in South America. This was the use of a weighted bucket suspended on a rope from an aircraft flying a very tight continuous turn to keep the bucket stationary at the tip of an imaginary cone for the collection of mail and the like from inaccessible sites."* **Source:** [Defenders: a comprehensive guide to the warplanes of the USA](https://books.google.com/books?id=4vMgs9FSpFgC), Oriole, 1989.
Answer: It is not designed to strafe, it is designed to loiter over a target or, to apply suppression fire or support fire for a sustained period of time.
It often circles a target area and a counter clockwise orbit (circling to the left) makes sense since the captain sits on the left and can keep the area in view at all times.
Therefore, the weapons are mounted on the left.
Comment: Furthermore, if you've got guns on both sides, it implies that you have enemies on both sides. That doesn't happen very often, so most of the time you're carrying guns you can't use. You could fly back and forth, but then each set of guns is only in use half of the time, while the other set is useless weight. Putting all the guns on one side means that if one of them can see the target area, they all can, so you can use all the guns, all the time.
Comment: A photograph of its predecessor (AC 47) showing this - https://upload.wikimedia.org/wikipedia/commons/a/a4/AC-47_night_attack_Pleiku_1969.jpg
Comment: @ManuH, while that should probably be its own question, I would assume that while the aircraft is circling an unfriendly zone, laying down heavy suppression fire, it's highly likely that the captain would be the PF. Were something to happen to the captain, I'm sure the FO could take over and continue to circle from the right-hand seat, however, they would then have to weight the value of the mission vs addressing whatever issue has caused the captain to relinquish control.
Comment: Given your answer, I understand that to efficiently pilot this aircraft, you should seat at the left. Does this mean only the captain can do so?
Comment: While piloting the aircraft in normal flight, it follows all the same rules and procedures as any similar aircraft would. When conducting a fire mission, the required [pylon turn](https://en.wikipedia.org/wiki/Pylon_turn) is probably easier from the left seat, but not impossible from the right.
Comment: This is the correct answer. Because circling to the left makes it easier for the captain to see what's beneath.
Answer: Traditionally, the doors most used on an aircraft (including civilian ones) are on the left (captain's) side. Often weapons are mounted in door apertures so that additional holes do not have to be introduced into the fuselage. It follows that there are more, more accessible, pre-existing holes on that side of the fuselage.
Answer: The AC-130 is the evolution of modified C-47s from the Vietnam War. At the time, a small group of USAF personnel explored arming cargo aircraft with side mounted weapons in order to bring greater firepower to bear for ground support. In particular, they wanted to solve the problem of strafing, where aircraft can only bring their firepower to bear for a short period of time, and often without a great deal of time to aim.
Captain Ron Terry was in charge of the initial effort which adapted these planes to gunship use in Vietnam in 1964:

Terry arrived at Bien Hoa Air Base near Saigon on December l. After the miniguns arrived the following week, he selected two test crews of six flight members and an interpreter, and two C-47s with relatively low flight time from the 1st Air Commando Squadron. The planes were modified to accept three minigun pods along the port side (two in the last two windows and one in the cargo door); an MK 20 Mod 4 gunsight mounted in the left cockpit window; and a selective trigger placed on the pilot's control to fire one or all the guns.

source
Since AC-130s are now specially converted from C-130s by Boeing, and they use modern targeting sensors (IR and visual cameras), and that windows/doors are no longer large enough for the custom mounts they use to install the weapons, there's probably no specific reason for keeping them on the left except that it's the status quo.
Comment: So according to this, the guns were on the left originally because that's where the cargo door was, making it easier to install the guns?
Comment: I think it leans that way, I wasn't able to find any definitive source for the technical decisions they made.
Comment: They're on the left because the pilot has to see the aim point.  The 'solution' to the strafing problem is to do a turn about the target. By doing that your aim point is the target (no lead required.)  The AC-130 has a side-looking HUD for the pilot to see the target and adjust his turn rate to keep it at the center of the turn.
Comment: That's obviously the other option, but I don't think it's definitive. For instance, if you look at the same source I quote above, Capt. Terry says his aiming point is between the left prop hub and engine cowl.  My understanding of the site lines of the interior of a DC-7 is that the copilot would be able to see a similar position, so I don't think that was a deciding reason for making that choice.
Answer: All the guns are on the left side. The method of targeting is that the aircraft circles counterclockwise so that the left side is pointing downward. Thus all the guns can be brought to bear on the target (unlike an old frigate with guns on both sides) and the pilot can see the target as he circles.
Comment: Thanks for answering, however, I don't think your answer really added anything to the discussion that hadn't already been stated.


How to hide certain tags from the_tags()?

Question: I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone tell me how to do this?
Answer: The best way is not to do this. Use a custom taxonomy instead.
Answer: I echo @toscho's suggestion. You can setup a taxonomy via your functions.php (use the reference he gave you) file or by using a plugin like Ultimate Taxonomy Manager.
A custom taxonomy will let you organize your posts as you'd like, without worry about interference with the standard post tags.


How can I see all the aplications and to select which one should be in start up?

Question: I would like to include in start up applications some additional programs, but I don't know the launching command. Is it any simple way to see all the installed programs and to select the ones to be included in start up?
Answer: in Startup applications, you go to "Add", and then "Browse". Most or all of your apps will be in the directory "/usr/bin". To get to that folder, after clicking "browse", on the left pane of the file explorer, clck "computer", then "usr", then "bin", then click the program you want to be on startup


Possible to open photo straight to Adobe Camera Raw?

Question: Is there any way to open a photo straight into Adobe Camera Raw without loading Photoshop or anything? I am trying to use my own program to browse my DNG photos and I would like to be able to open them one off into Camera Raw. Is there a way to do this with bridge without having to select the file again? Are there any execution arguments to do this?
Answer: ACR is not a stand alone application, but a Photoshop/Bridge plug-in. But if the file extension of your raw files is associated with Photoshop, PS should load and the file should open immediately in ACR when you double click it from explorer.
Functionally, there is no difference then to your requirement.
What your own browsing program does is, of course, determined by this program itself. You could, eg., implement the ability to use PS plugins.


What is the intention of salat sunnah after salat Jumuah?

Question: I notice that after salat jumuah people do two versions of salat sunnah, 2 rakaat or 4 rakaat. What are the proper intentions of those two versions?
Answer: Both have been narrated in the authentic sunnah, as for doing two Rak'at the Prophet ﷺ used to pray them after leaving the Masjid at home:

كَانَ لاَ يُصَلِّي بَعْدَ الْجُمُعَةِ حَتَّى يَنْصَرِفَ فَيُصَلِّي
  رَكْعَتَيْنِ
He never prayed after Jumua prayer till he departed (from the Mosque),
  and then he would pray two rak`at at home.

صحيح البخاري (Al Bukari)
In regards to four Rak'aat, The Prophet ﷺ said:

إِذَا صَلَّى أَحَدُكُمُ الْجُمُعَةَ فَلْيُصَلِّ بَعْدَهَا أَرْبَعًا
When any one of you observes the Jumu'a prayer he should observe four
  (rak'ahs) afterwards

صحيح مسلم (Muslim)
This matter is in fact quite flexible, and scholars took different stances.  The stance I will take to answer your question, is the stance that Ibn Taymiyah took, and that is if you pray at the Masjid your pray four, and if you pray at home then pray two.  Another stance is making six Rak'aat, two for taking with what the Prophet ﷺ action, and four taking with what the Prophet ﷺ said, and it is viewed that doing six Rak'aat is liked as is narrated from Ali Ibn Abi Talib and a group of Salaf.  Another Stance is the choice between the two.
And as I mentioned, I take the stance of Ibn Taymiyah to answer your question, and for more information see this (Arabic).


Why is my iPhone 4S's home button not responding from home screen?

Question: My home button seems to be working okay to move out of apps etc, and double tapping brings up the expected menu, but on the home page, a single tap no longer swaps to the search interface, and when modifying app positions, clicking home no longer stops the apps 'shaking' - is there any way to rectify this?
Answer: These features should definitely work with the home button on your 4S. You should contact Apple to get a solution, which may include repairing or replacing the phone. If you are near an Apple retail store, set up a genius bar reservation. If not, call Apple for support.


What's the deal with all the washings?

Question: Sometimes we wash with a cup, sometimes not; sometimes we wash twice, sometimes thrice; and not everyone agrees on method or pattern in all cases.  Who says which ways we are supposed to wash, in which situations, and why?
Comment: To add to the confusion, I'm aware that there are certain chassidic families who wash four times.
Comment: can you give examples for the different type of washings?
Comment: @HodofHod I didn't read the answers below but the Gra holds to wash four times each hand ironically.
Comment: @HachamGabriel Ironically? Do you have a source?
Comment: @HodofHod Chassidish-Gra...On the Shulhan Aruch Siman 4 in Orah he says this. It is quoted in the Mishna Berura regarding Netilat Yadayim Shaharit.
Answer: Sources: Mishnah Yadayim, Chullin 106a, Chagigah 18b, Shabbos 14b
There are, of course, two reasons to wash hands. One is physical cleanliness the other is for Taharah. I think physical cleanliness is understood. Hands need to be completely physically clean before washing them for Taharah.
Originally, DeOraisah, there was no specific Tumah of the hands. If something made a person Tamei then their whole body was Tamei. The Sanhedrin decreed that hands could become Tamei derabbanan under certain circumstances. The first such decrees came in the time of King Solomon and were expanded by the Sanhedrin over time. These decrees were made so that people should be careful about touching certain things such as Torah scrolls or other holy writings or Terumah. Later this was expanded even to touching Chullin (as a precaution for Terumah) so that today we need to wash before eating bread. Tumah of the hands also occurs if we touch certain parts of our body that are normally covered. It is possible that while a person sleeps this may happen or if a person is not paying attention this may happen so that we need to wash hands before doing certain things such as saying a berachah or praying or learning Torah. There is also an additional decree that water that touches hands that are Tamei can make other things Tamei. That is Tamei hands are Tamei in the second degree but water that touches them becomes Tamei derabbanan in the first degree. Today we only continue to do this as a takanah since everyone has a status of second degree Tumah out of doubt anyway.
For washing the hands to be effective in terms of Taharah it must be done in one of two ways. One way is to put your (physically clean) hands once into a valid mikvah at least up to the wrists. This can be done with both at once or with either hand first so long as the Tamei hand doesn't touch the Tahor hand in between. For example, if you dipped your right hand into the Mikvah, took it out and then touched it with the still Tamei left hand then the right hand would become Tamei again so it would have to be dipped again.
The other way is to pour water water from a vessel over them. The vessel has to be a complete unbroken vessel of at least a certain size. Each hand needs to be washed at least twice. Once to purify the hand and then a second time to purify the water on the hands (because of the decree that such water becomes Tamei). The first washing must be exactly up to the wrist. If it doesn't go up to the wrist it doesn't purify the hand. If the water from the first washing touches any part of the body above the wrist it makes the body (including the hand) Tamei again. If the Tahor hand is touched by a Tamei hand or by Tamei water then it becomes Tamei again.
To prevent these problems and make sure the hands are properly purified various customs and practices of hand washing were instituted. Some people also have the custom to wash even more than two times.
In practice today we wash before eating bread or upon waking up from a sleep of at least half an hour. One should also wash hands before learning Torah, praying or saying a berachah unless one has had his attention on his hands to make sure they have remained clean.
Comment: You mention that one needs to wash twice per hand for tahara to remove the tamei water. The shulchan aruch and rama in OC 162:2 paskin that this is only if he didn't use a full reviit the first time. But, if he used a full reviit the first time, there is no tamei water and there is no need to wash a second time. Most people nowadays I imagine use at least a reviit of water per time. In fact, I have tried once not to and found it exceedingly difficult to cover the whole hand. In short, we almost never require 2 washes per hand.
Comment: You are assuming that washing after touching unclean parts of the body prior to tefilah requires a keli (it sounds like you want to apply this to removing ruach ra'ah as well).  Do you have a source for that?
Comment: What I said was that for washing to be effective in terms of Taharah it needs to be either in a valid mikvah or poured from a complete unbroken vessel. This is clear from the Mishnah that I referenced above. The law about a vessel is in Yadayim 1:2.
Comment: "Tumah of the hands also occurs if we touch certain parts of our body that are normally covered. It is possible that while a person sleeps this may happen or if a person is not paying attention this may happen so that we need to wash hands before doing certain things such as saying a berachah or praying or learning Torah."  yadayim askanios would require a cohen to wash with a keli for teruma (although touching his body would not since the rest of his body is obviously tahor, otherwise his entire body would need a mikvah).  It would not require a keli for nekius for davening.
Answer: Maran writes (Shulhan Arukh 4:1) that one shall wash his hands in the morning and make the Berakha "Al Netilat Yadayim." The Rama writes (ibid.) that one that did not use the restroom recites the Berakha of "Asher Yasar" anyways. However, we do not follow this Pesaq, because Rabenu HaAri writes (Sha'ar HaKawanot pg. 2) that one does not make a Berakha if he did not use the restroom (and the Rashash also writes so). Maran continues (ibid.) that waters that are unusable for washing for a meal are permitted for Netilat Yadayim in the morning, however some one doesn't bless upon them.
The Halakha Berura brings down five opinions as to the reason one washes their hands in the morning (however the answer of the Ari HaQadosh is not written in Halakha Berura): Introduction- The Gemara writes (Berakhot 60b) that one makes the Berakha "Barukh Ata A-donai E-lohenu Melekh HaOlam Asher Qideshanu Miswotaw WeSiwanu Al Netilat Yadayim."
The answers:

The first answer is in the Zohar HaQadosh (Parashat WaYesheb 184b) when one sleeps his pure soul leaves his body and he tastes the taste of death and the evil spirit rests upon his body and even when his soul returns the evil spirit is still present, and in order to remove this one must wash their hands
The second answer is from the Gemara in Shabbat (108b-109a) the evil spirit rests upon one's hands at night and it doesn't leave until one washes their hands properly. This has nothing to do with the sleeping, it has to do with the night.
The third is from the Rosh (Berakhot 9:23) one's hands are disgusting because while one sleeps their are bound to touch disgusting places.
The fourth answer is from HaRashba HaQadosh (Shu"t 1:191) in the morning a person is as a "new creation" as it written (Ekha 3:23) "New to the morning; Your faithfulness is great." For this reason we are required to thank Hashem that He created us for His honor and to respect His name.
The fifth answer is from Rabbi Dawid Abuderham (Hilkhot Netilat Yadayim Shaharit) just like the Kohanim must wash their hands before the service of the Hashem in the Bet HaMiqadash so too a man must wash his hands prior to serving his Creator, in order to serve Him with clean hands.
However the sixth answer is brought down in the Sefer of the Ari HaQadosh "in whose words we live by [a saying by Rabenu Masliah Ma'azuz]" Sha'ar HaKawanot (pg. 2) one's hands touch disgusting places and therefore one must wash them (so far- same as the Rosh). One must wash their hands in order to remove the Qelipah referred to as "Shibta" and that is the reason that we wash our hands in the morning. It is very important to note: it DOES make a practical difference in reason for the washing because according to some one would be unable to bless in some situations (Halakha Berura ibid.).
Answer: There is an authoritative article at http://rabbikaganoff.com/archives/376.
Washing in the morning. Three times on alternate hands. To take away the "rouach ro'o" OC Siman 4 and especially seif 2.
Washing for davenning. It seems to need three times on alternate hands. OC 92 (4)
Washing for bread see question already answered:
What is the source of netilat yadayim before eating bread?
It can be done with one pouring on each hand (if using around at least 150 mls (Chazon Ish) of water each time) or with two.
For the custom in your community, CYLOR
MB 4 (2) [10] mentions the custom of washing 4 times to remove the "rouach ro'o".
Comment: Where does washing for davening seem to need 3 times?
Comment: It seems to be implied in MB 4(1)[1} and see OC 233(2). But I take your point.
Comment: Can you explain how it is implied?
Comment: Washing for tefillo and when getting up are mentioned together.
Comment: That's because they are related.  When you get up, you must wash your hands for tefila either because they are unclean or because of kedusha, neither which require 3x. The status for which you need 3x is ruach raa which is not discussed in that s"k.
Comment: @YDK So how many does Tefillah require?
Comment: @SethJ Just once per hand. It's a cleanliness thing not a tumah thing.
Comment: So why use a Keli at all? Why not just wash with soap and water?
Comment: @SethJ See YDK's comment on follick's answer.

What's the deal with all the washings?


Is it easier to hold serve in tennis doubles than in singles?

Question: I've read somewhere that in doubles it's easier to hold one's serve, and as a consequence in average there are not as many consecutive breaks as in singles; but no explanation or reference was given. Is it true at all?
Answer: As pointed out by others responding to similar questions, there likely aren't statistics like this for tennis available at all. Sports like baseball and basketball have seen an influx of analytics in past years, and although this is also true for tennis, there is still nowhere near the statistical tracking as there is in other sports. Although, if I were to guess as to the validity of the claim that it's easier to hold serve in doubles then I would have to agree based on both prior experience and the reasoning that often times in singles, players are able to hit strong returns to break serves. However, with another player present to try to absorb returns, in my experience watching and playing tennis there are far fewer winners on returns of serve in doubles than in singles. Granted, I have no hard facts to substantiate these claims because tennis has unfortunately neglected to keep up with the advanced analytics that other sports are employing.


What is a non-equilibrium boundary layer?

Question: I studied a manual of Ansys CFX about turbulence models and I came across the term  "non equilibrium boundary layer".  What does this term mean?
Comment: I am not sure because your quote is so out of context I might get it all wrong. However, I would guess the equilibrium refers to the state of production and dissipation of turbulent kinetic energy. This means the characteristics of the boundary layer are changing in stream wise direction and therefore ordinary turbulence models might have problems predicting the flow correctly.
Comment: Thanks,
What is your exact meaning of "stream wise"?
It means "In the direction of a stream"? Am I right?
Comment: Exactly, however it broadly means where the flow is coming from and is usually not referring to a specific streamline. Which in this particular case would actually make some sense as well.
Answer:
For the equilibrium boundary layer, the local skin friction coefficient is independent of two parameters, both the streamwise distance and the Reynolds number, based on the momentum thickness, and the boundary layer thickness is proportional to the streamwise distance. On the other hand, for the non-equilibrium boundary layer, the local skin friction coefficient depends on the above two parameters.

This is from here
PS: This seems self explanatory. Please comment if you think an explanation is required. I have highlighted the parameters in bold myself.


Can we add a tag for Workflow 2013

Question: Is there a need in the tags to differentiate between SharePoint workflow and the new in 2013 workflow manager that is not specifically for SharePoint? There are a few new and big features in workflow manager with SP 2013 that will make those answers occasionally irrelevant for users of a previous versions.
Answer: There is already a tag for workflow-manager, so I guess that answers your question. But if you'd like you could improve the tag wiki so we know what its for. The only link I find valuable is Installing and Configuring Workflow Manager 1.0.
Answer: I feel as though Workflow Manager is specific to the installation/setup and not pertaining with the implementation and integration with SharePoint 2013. I agree here with @ghangas, at least a tag synonym for workflow 2013 would be a good idea. Plus workflow manager is a little ambiguous for those users that aren't sure what workflow manager pertains to.

Can we add a tag for Workflow 2013


What exactly makes a person's voice differ from other's?

Question: What are the characteristics of a voice that make it different from other voice, in terms of properties of the sound wave ?
Answer: The direct answer is very generic:

Frequency: Changes in wave frequency relate to pitch/intonation
Amplitude: Changes in wave amplitude relate to stress and pronunciation

But that is pretty much the answer to every other "What are the characteristics of X that make it different from other X'es, in terms of properties of the sound wave?"
The more interesting aspects are the harmonies and resonances, or formants. The formants are formed by chamber and tube resonances, which is what makes us able to distinguish the different vowels. But the formant "weight" or tendency of a voice is also what makes it very characteristic (and the main difference between male and female, along with pitch) (source).
Check out this interactive formant/vowel app
In terms of wave properties formants describe how multiple frequences relate and work together.
Answer: The thing that makes one voice sound different from another is the same thing that makes a trumpet sound different from a tuba: the different size and shape of the instrument. That produces a dramatically different sound wave. You'll get a different frequency spectrum from each voice. Imagine a trumpet, a slightly bigger trumpet, a slightly longer trumpet, and so on for 7 billion more trumpets until you get to a tuba. Every one of them will make the spectrum on an EQ light up slightly differently.


How are the speed, distance and time of India's MOM and USA's Maven Mars missions calculated?

Question: How do the scientists calculate the correct time to launch the Mars mission so that the satellite travel time is less? How they are synchronizing the speed of satellite with respect to earth and mars ?
Refer this link for more understanding:
Animation of MOM and Maven launch
Answer: There is an extremely accurate model of the solar system and the positions of the planets and so on. So basically you have to lay Newton's equations for Mars, the probe, Earth and so on, you have an equation that models Mars's path, and you have equations for your probe, so you get some x's and y's that eventually will have to match if you want to reach Mars. From there you can then calculate the values for the initial conditions of the probe -such as velocity and direction- that will satisfy you equations.
Answer: First of all, trajectories of interplanetary missions are not designed to minimize the TRAVEL TIME but to minimize the COST, which is directly related to the fuel required to transfer the probe between the Earth and another planet. One can easily find a solution on how fast and in what direction should the probe travel, and how much time and energy will be spent after departure from the near Earth orbit by solving the gravitational force equations. But that's far not enough to launch a real probe. Scientists have built accurate kinetic models and databases of the motions of solar system objects, such as DE405, by NASA Jet Propulsion Laboratory. Some of them even take account of the perturbations of all major planets in the solar system. Engineers should also build models for the probe itself. For example, how much acceleration will the spacecraft get when turn on the booster, and how does the solar radiation pressure change the attitude angle during the trip. What's more, every probe carries at least one gyro system. Optical guiding telescopes are also widely used to calculate the attitude angle. The speed of the probe can be calculated by the Doppler shift of the radio frequency.
For more details, see the book Interplanetary Mission Design Handbook


Sharepoint 2010 see list of rss subscribers

Question: Is there a way to see a list of the subscribers to an RSS feed of a blog site?
Answer: Not OOTB. RSS feeds provide no tracking features, but with a little wit and digging, you can look at the web logs to get an accurate count of how many times your RSS feed has been visited.
You can also implement a code counter for the RSS Feed page...


A problem about rational number for right triangles.

Question: If a right triangle has hypotenuse of length 5, and the remaining two sides $a, b$ have rational lengths, what can we say about $a$ and $b$?
Answer: Hint: Think Pythagorean Triples.
Answer: Following Peter's lead, let $(\frac{q}{p})^2 + (\frac{r}{s})^2 = 25$. Here, assume all fractions are in their reduced forms.
Then $(\frac{sq}{p})^2 = (5s+r)(5s-r)$
LHS is an integer as so is RHS. This immediately shows us that p must divide s as it has no common divisors with q. Moreover, by the same argument applied the other way, s must divide p. Therefore, s and p are the same. As far as the question is concerned, this should be enough to say that the rational numbers a and b must have the same denominators in their reduced forms.
EDIT: Just for fun, let's try to categorize all these triplets. Substituting s for p, $q^2 + r^2 = 25s^2$. Thus $q^2 = (5s+r)(5s-r)$. Now, any common factor betwen $5s+r$ and $5s-r$ is also common between 10s and 2r. As s and r have nothing in common, this can be only 1 or 2. In the first case, both $5s+r$ and $5s-r$ must be squares, and in the other both must be twice some square. Once we choose the squares, we can find s and r accordingly. Knowing the quadratic residues mod 5, we can easily choose the squares to make the condition hold, (the only condition is that the average or in the second case the sum of the squares is a multiple of 5). eg. 9 and 121 is a valid pair for the first case (gcd 1) as their average is 65, a multiple of 5. Setting 5s+r=121 and 5s-r=9, we get s = 13, r = 56. So q = sqrt(121*9) = 33.
This gives us $(56/13)^2 + (33/13)^2 = 5$.
Answer: Let $a = q/p$ and $b = r/s$ with $p,q,r$ and s $\in \mathbb{Z}$
Then $(q/p)^2 + (r/s)^2 = 25$ i.e., $(sq)^2 + (pr)^2 = 25$
Therefore, $sq = 3, pr =4$ or $sq = 4, pr =3$
If $sq = 3, pr =4$
$s = 1$ or $3$ and $p = 1$, $2$ or $4$
The other side is similar.
================ wrong record above =================================
If we doesn't require $gcd(p,q) = 1$ or $gcd(r,s) = 1$ above
We can suppose $a = p/r$ and $b = q/r$ with $p,q,r \in \mathbb{Z}$.
We have $p^2 + q^2 = (5r)^2$. By moving $r = 1,2\dots$.
Comment: $\left(\frac{7}{5}\right)^2+\left(\frac{24}{5}\right)^2=25$.  Many others.
Comment: Oh! I think I lost something...
Comment: Oh! I forget, $(sq)^2+(pr)^2 = 25$ is not correct... I want to write $(sq)^2+(pr)^2 = 25(ps)^2$. Thank you very much!
Comment: Aha~ I have no idea now~ sorry~
Answer: We want to generate the rational solutions of $u^2+v^2=25$. Equivalently, we
generate the solutions of the equation $x^2+y^2=25z^2$ in integers, with $z\ne 0$, and set $u=x/z$, $v=y/z$. Ultimately the procedure we get is a close analogue of the standard way of generating primitive Pythagorean triples. The case where $5$ divides one (and therefore both) of $x$ and $y$ is not interesting, so assume that neither $x$ nor $y$ is divisible by $5$.
The square $3+4i$ of the Gaussian prime $2+i$ must divide one of $x+iy$ or $x-iy$. By changing the sign of $y$ if necessary, suppose that $3+4i$ divides $x+iy$.
So $x+iy=(s+it)(3+4i)=(3s-4t)+(4s+3t)i$, and therefore $x=3s-4t$, $y=4s+3t$.
Squaring, we find that $x^2+y^2=25(s^2+t^2)=25z^2$, so we want $s^2+t^2=z^2$.
It is enough to consider primitive solutions of this equation. These are given by
(i) $(a^2-b^2,2ab,a^2+b^2)$, and (ii) $(2ab, a^2-b^2, a^2+b^2)$, where $a$ and $b$ are relatively prime and of opposite parity. We have to consider both possibilities because of the lack of symmetry between $s$ and $t$ in $x=3s-4t$, $y=4s+3t$.
Case (i) gives us the solutions $x=3(a^2-b^2)-8ab$, $y=4(a^2-b^2)+6ab$, $z=a^2+b^2$, and therefore the rational solutions
$$u=\frac{3(a^2-b^2)-8ab}{a^2+b^2},\qquad v=\frac{4(a^2-b^2)+6ab}{a^2+b^2}.$$
Case (ii) yields something similar.
Comment: The above procedure, with possibly changes of sign, generates all non-trivial rational solutions. There is undoubtedly a more attractive way of doing this. Furthermore, it seems likely that even though we are taking $a$ and $b$ relatively prime and of opposite parity, some rational solutions are generated more than once.
For a more elementary way of getting at a parametric solution, rewrite the equation $x^2+y^2=25z^2$ as $x^2-9z^2=16z^2-y^2$, and imitate the analysis of Pythagorean triples. It is somewhat messy.


Why don't any Arizona craft breweries export their beer?

Question: Why don't any Arizona craft breweries export beers out of state?  Is it a legal restriction, a private agreement, or just a market force?
Comment: This is likely an issue with state legislation and how they are typically licensed. There should probably be a meta discussion about how much legal stuff we want to be on topic for this site.
Answer: In the United States, interstate beer export is an extraordinarily complicated matter.  Unlike other areas of commerce, states are allowed to directly regulate import of alcoholic beverages to their state because of the 21st Amendment specifically reserved that right in the repealing of prohibition.  States, through the licensing process, can also control export, but this is rare since usually states like to export stuff to other states (and thus bring money into their state).
This means that beer, wine, and spirits are extraordinarily complex to sell in the interstate market.  Small craft breweries are going to have a huge amount of legal compliance in every case and so you have an issue that it is essentially impossible to be both small and interstate in this market.