Redirect user after login/registration globally

Question: How it possible to redirect all users, even administrators after login to specific page? And also redirect users after successful registration? Any simplest way? For example I want to redirect users after login, to the "Updates" page of my website. And after registration, to the "Home" page of website.
Answer: This code adapted from: Registration Redirect
add_filter( 'registration_redirect', 'ckc_registration_redirect' );
function ckc_registration_redirect() {
    return home_url();
}

This code adapted from: Login Redirect
add_filter( 'login_redirect', 'ckc_login_redirect' );
function ckc_login_redirect() {
    // Change this to the url to Updates page.
    return home_url( '/Updates' );
}

Add the code to the functions.php theme (or child theme) file.
Comment: Above codes goes in theme's `function.php`. When theme changed, again both pages redirect to their default locations. How we can redirect by changing WP core files?
Comment: Never change the core files. Changes will be removed when WordPress updates. You could do this from a plugin to make them theme independent.
Answer: To add one more to the list for logout:
add_action('wp_logout','go_home');
function go_home(){
  wp_redirect( home_url() );
  exit();
}

Answer: To globally redirect after successful login, find this code in wp-login.php, under <form name="loginform"> section.
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />

and replace <?php echo esc_attr($redirect_to); ?> with your  URL where you want to redirect. The URL must start with http:// and ends on /other wise page redirect to default location.
Do same thing form redirect after registration with in same file but under <form name="registerform"> section.

Edit:
This method involves changing WordPress core code. It is rarely recommended by any serious WordPress programmer. Proceed at your own risk.
Answer: With plugin:

Peter's Login Redirect
and a new one with fine features Register Plus Redux

Enjoy!


How to reduce shadows on product photos when there is no room between the subject and the background?

Question: I sell horse equipment and my photos are created against a white background with the items on hooks right against the wall or background. I get a lot of shadows, but it is the only way to display the products. I would love to blow out the background but there is no space between the product and the background.
Comment: I believe a sample image will give you better answers.
Comment: I really doubt there is only "one way" to display the products.
Comment: You can either use a larger space where the shadow does not fall within the image space or use stronger/more lights to illuminate the shadows.
Answer: A two (2) light set up will do this deed.  You can use pin-up lamps from the hardware store, best is reflector flood bulbs. Place one lamp high to simulate afternoon sun. Measure distance lamp to subject. Place second lamp at lens height as close to the camera as you can get without it getting in the way. Close placement is the key, you are filling shadows from the camera's viewpoint. Set the second lamp at the same distance as the main light. Shoot a test shot. Back the fill by multiplying its distance by 1.4 and make a test shot. The density of the shadows are thus adjusted by the distance fill lamp to subject.
Answer: So MAKE space between sample and background.  Hooks don't have to be on walls, they can be on other types of support.
Maybe use black supports and photograph against black.  This can be very effective with the right lighting.  And 'the right lighting' only needs to be a few cheap LED torches these days.
See how I approached photographing this trinket?  A bit smaller than your stuff, yes!  But the same idea could work.  Total cost of lighting equipment well under £20.

If it must be a white background, be prepared to do some retouching in Photoshop or similar!   I very much doubt these pictures came straight from the camera...
https://www.thesaddleryshop.co.uk/d_7_saddles-tack
Comment: I'd be willing to bet that all of these images in the link above were first cut out in Photoshop, then the background layer was filled with white, and then the cut out image was pasted back in.  This is how most major sites like Amazon do it.
Comment: You don't have to 'paste back in' in order to white out a background.
Comment: Technically correct.  You could just as easily reverse the selection and press delete.  But if you paste the image in, you now have a multi-layer image ready for a drop shadow if ever needed, and you also have the item still cut out from the background for use in marketing if ever needed.
Comment: You had a multi-layer image already, if you cared to treat it as such!
Answer: Shine (separate) light on the background, not just the objects. If you use flash, this is even more important, or you get hard-edged shadows.
Answer: Bounce each light off large, very large white boards placed equidistant on both sides of the camera.  Those large surfaces will spread the light evenly across your subject.  You may have to boost contrast a bit but your shadow problem will be gone.  The reason why you have shadows is because your light source is too small.  The larger the source, the softer an more omni-directional the light is.  Bounce the light.
Answer: Light the background with 2 lights one from each side behind the object. Have another to light the object. Make sure that the ones pointing at the background are brighter than the front light.
Answer: An object illuminated by a single light source can produce shadows whose illumination is many f-stops below that of the non-shadowed background.  Illuminating the background with even a moderate amount of light can make shadows far less harsh.  For example, illumination with 1/3 of the primary light can reduce shadows from being many F-stops to being two.  Blowing out the background is seldom necessary nor desirable when trying to create an aesthetically-pleasing shot.
If one wants to completely eliminate the background, one approach is to take one picture with only the background lit, so the entire subject will be dark, and then take another picture with the camera in exactly the same place, focusing only on the illumination of the subject (not worrying about which parts of the background are or are not lit).  Once this is done, the two pictures can be composited, with the second one being used to fill in areas that were black in the first.  Alternatively, the subject picture can be composited with an separate background picture, using the picture of the lit background as a mask to control which parts of the picture to replace with the new background.
Answer: You could just use a translucent background with another light source pointed at from behind.
And of course, you can always just do it the way most websites like The Gap, or Amazon does it, which is to use the pen tool in Photoshop to cut the image out then paste it back on top of a white background.
Answer: Lighting is difficult and I am still learning all the tricks. I believe the typical setup for photographing what I am assuming is tack would be a two-light system using two soft-boxes as big as the object being photographed. One soft-box would go on either side of the object at about a 30 degree angle parallel to the wall. You will likely still get some shadows, but the soft-boxes will diminish them - and moving the boxes farther away will diminish them further. I tried to duplicate a setup with the equipment I have - unfortunately I have only one soft box and a gray wall.

I placed a soft box on the right and a reflector umbrella on the left. Here is the result:

You can still see  shadows mostly to the right of the "tack" that are generated from the reflector dish, but they are not as distracting as they would be with direct lighting.
If you don't have or want to invest in this kind of equipment, you might be able to get the same result using large work lights and some kind of material in front of them to diffuse the light.
The alternative - depending on where your wall is located - is to not use any direct lighting. If there is enough indirect lighting from doors, windows, overhead lights, etc., you can take a photo with virtually no shadows by adjusting your camera settings to take advantage of the natural light.
Here is my shop, where I had my "tack" wall set up.

Light hits the "wall" from the garage door in the back, the windows on each side and the overhead florescent lights. A photo of this arrangement came out with very few shadows.

The photo was shot at about 6:00 PM with an f-stop of 5.6, a 1/30 exposure time and an ISO of 400. The drawback with this approach is that the color doesn't pop as much in low light. If you are experienced with post-processing tools, you can make some good improvements to this photo, but it may look bland otherwise. (I did a little post-processing on this shot to show what is possible.)
And if by chance the white wall you are using has adjoining white walls and ceilings, you might try pointing work lights at the walls and ceiling and use the diffused reflection to light the object of interest. The bounced light should have few if any shadows.
Answer: Minature LED lights will do the trick. Put them inside clothes and under shoes and even the floor!
Comment: I'm not sure what you mean. The asker isn't trying to photograph clothes or shoes. Could you give more detail about how this technique would work in the asker's situation?


About the Media Gallery Module

Question: Right now in each gallery, when a user clicks on the thumbnail, a larger version will show up in the middle of the screen. With it are arrows to navigate, a "1 of x" caption, a link to start a slideshow, and an x to close it. When I click the image, it takes me to the page of the media. What I want it to do is take me to the next image in the slideshow (like the arrows would have done). I tried looking at the configuration of the Media Gallery Module but there were only options on column and row layout. When I tried to check the settings in the gallery content type, all of the fields were locked and could not be edited. I tried Google for a solution, but not really anything turned up for this specific problem.
Comment: I see that the [module](http://drupal.org/project/media_gallery) is in beta version, and what you are asking is more of a feature request rather than question. Similar thread is running on [Issues for media gallery](http://drupal.org/node/1088738).
Answer: You should use Firebug and take a look at the function that gets called, when clicking on the "Next"-Button.(Something like onClick() )
Now take a look at the function, that gets called, when you click on the image.
Now just place the "Next"-Button function into the image. Delete the old one.
The functions are usually in a .js-File.
This is not so hard, i am a beginner and managed it with the shadowbox.
Answer: You may use this JQuery script to achive your required result. You can use JS Injector Module to insert this script or simply upload a js file in your theme folder and call it through .info file
<code>/*
Redirects lightbox image click to advance to next image instead of opening image details.
Via http://drupal.org/node/1088738#comment-4362570
code from #12
Posted by stephandale on April 10, 2011 at 12:26pm
*/
(function ($) {

Drupal.behaviors.initColorboxDefaultStyle = {
  attach: function (context, settings) {
    $(document).bind('cbox_complete', function () {
    $('.lightbox-stack .gallery-thumb-inner a').click(function(e) {
        e.preventDefault();
        $.colorbox.next();
      });
    });
  }
};

})(jQuery);
</code>
Comment: you may see it working on http://go2georgia.travel/
Answer: I have had the same problem, and I can tell a little more about the reasons, in an example:
On the Gallery ( /galleries/myGallery) , you click on a photo and the colorbox opens. But the content of the colorbox is not only the image, but the body of /media-gallery/lightbox/11/22 . And this content features a link around the image, namely /media-gallery/detail/11/22 .
I cannot find a way to remove that link, but maybe this helps somebody to remove the problem without overwriting the standard behaviour with JavaScript. Which works of course, but there should be a better way.

About the Media Gallery Module


What can be the main political reason behind mass cloning of soldiers?

Question: Cloning of human have been a taboo even in the late 21st century society, many nations still at odd with each other. Countries like China despite having the most population on Earth decided to clone more soldiers to boost it's frail but growing military prowess, soon many other nations would follow suit. What would be the main political reason for countries to disregard ethical issue and violate such a taboo?
Comment: You mean violate a taboo, right? If so, edit your question.
Comment: @o.m.: yes I've amended it.
Comment: How would cloning help to boost a country's military prowess? The problem with training soldiers lies in getting them from the zygote stage to the soldier stage, not in getting zygotes. If you've got a good solution to that, then IVF with donated eggs and sperm is easier than cloning.
Comment: @MikeScott: I think that the demography shows that population is growing much older in developed country due to lower birth rate, if you can groom 1 Einstein in Chuck Norris body and then duplicate many copies that passes QC they can certainly be a good addition to the national defense.
Answer:
The need to maintain a standing army against a large perceived threat. Space Above and Beyond had cloned/tank grown humans as a counter to rampant AIs going against humanity. In essence national survival trumps all.
A culture where military service isn't seen as a noble profession, especially at the cannon fodder level. Conscription would be the traditional way to deal with this, but the political costs of this would be too high.
"Clones arn't people" legally and culturally so it may be politically more acceptable to use them, especially in a war of offence.
You can bring up clones from the beginning with specific values. Imagine a culture where right from the beginning your country is your father and your mother. You're brought up to fight, kill and die for your country. You're brought up as a mechanic or a rifleman, and effort isn't wasted on teaching you any skills you don't 'need' in your profession.
With genetic engineering you can build in certain traits. Have a safety switch against a uprising by making them require specific supplements to live. Have bigger stronger infantry, leaner pilots designed to handle gforces better. Pick whichever gender does the task better and mass produce them. Disease resistance, and better natural fitness.
Answer: Years of television pictures and reports of weeping parents and children and friends of dead soldiers have made it unpalatable to ask or force natural born people to fight in wars. Every time the subject of the military or fighting is brought up, there is huge political pressure against it from the families of people who have lost, or are worried about losing loved ones to battle.
There is no one to cry for the clones though. Previously difficult decisions are easier when it's "Someone Else's Problem" for everyone.
Yes everyone agrees it's a terrible, unethical thing they're doing, and there are probably protests against it organised by people regarded as hippies, lefties and unemployed intellectuals with too much time on their hands, and they have the right to be heard.
But there is no outrage, no inferno of emotion. Scenes of parents shouting at, abusing and attacking recruiters while refusing to allow their sons & daughters to be taken away do not occur. No local representatives / councillors / members of parliament who have heard the real life stories and are willing to stand up in the government, not for the clones.
Answer: The easiest way to 'justify' cloning for soldiers, is two fold, one you can manipulate their genes to be 'better' soldiers and two, they won't have a 'family'.
It is much easier to send people you don't know into a life threatening situation than your owe friends and family.  It would also be easier to make 'claims' about these soldiers making them not quite human.  On top of that removing their ability to reproduce would go a long way to removing some of their humanity.
So now you have a country that is sending these 'semi-human' 'super' soldiers into combat against other countries.  Why would I as another country be willing to send my sons and daughters to fight these beings?  I'll be losing 'real' humans to their 'monster' hoard.  So fight fire with fire!  We will make our own 'monster' army of 'super soldiers'!  We "need" to do it to protect ourselves!
Answer: The taboo could come into place for a variety of reasons.
To protect the clones by making sure they don't exist to start with. Sounds weird, but creating a clone could be taboo because you don't do that to clones. Raise a normal child instead.
To protect the rest of humanity from a world where the human genome is used arbitrarily. Creating a clone is taboo because you can't take human DNA for that.
Both reasons could be ignored for military necessity. Remember how major western countries decided to reintroduce torture after 9/11. We could talk about a top-secret supersoldier clone program, few in number and not admitted in public. Or a mass clone army, viewing them as expendable cannon fodder.
How do the clones grow up? If they're raised in normal families, it becomes harder to see them as faceless masses. If they're raised in giant orphanages, it might be easier to ignore them.


What role (if any) did lend-lease equipment play in the Second Battle of El-Alamein?

Question: I'm specifically thinking military materiel and its significance in the outcome of the Allied victory.
Answer: Lots of supplies were from the US lend-lease, but the most visible was tanks, lots of them. Of the over 1000 tanks available to the British for the battle, half were from the US.

170 M3 Grant medium tanks
252 M4 Sherman medium tanks
119 M3 Stuart light tanks

Source
This gave the British not only a 2:1 quantitative advantage, but also a qualitative one.
This is the only time the M3 Grant shined. Rushed into service as a stopgap, it's generally considered a very flawed tank. It has a very high silhouette. It's riveted armor means those rivets will fly everywhere inside the tank when it takes a hit. It's then enormous 75mm gun was powerful, but the bulk of the tank had to be exposed to use it. The 37mm "anti-tank" gun was underpowered. But in North Africa in 1942 its heavy armor and heavy firepower outclassed most of what the Italians and Germans had to offer.
The M4 Sherman did even better. With that same 75mm gun now in the turret and thicker cast and wielded armor on the same reliable M3 drive train, it had all the strengths of the M3 without the flaws. It was superior to even Germany's Panzer III and IV at the time. (The Panzer III did anti-tank work with a 50mm gun, the Panzer IV was for infantry with a howitzer. These roles would later be reversed.)
Comment: Worth noting that per the same WP article, most of the Panzer IVs at El Alamein were F2s with long guns (30 versus 8 short-guns). But the general argument is correct - and there weren't many in either case.
Answer: According to this concerning lend-lease Sherman Tanks in North Africa,

The first Shermans to see battle were M4A1s with the British Eighth
  Army at the Second Battle of El Alamein in October 1942. The tanks had
  been supplied in a hurry from the US which had removed them from their
  own units. They were then modified to British requirements and for
  desert conditions.[5] Over 250, in 12 regiments, started the battle.

Probably as important would be supplies of ammo and gasoline, but I can't find much info there.  The sinking of several supply ships bound for the Axis forces definitely left the Allied forces with superiority in numbers and supplies by the beginning of the battle.
Answer: Another possibility.  There was a South Atlantic Air Ferry route/Central African Air Ferry route that sent lend-lease aircraft, to, among other places, North Africa (it supplied lend-lease aircraft to the RAF in the Western Desert Campaign, so I'm guessing that some of these were used in the second battle of El-Alamein.)
In general, the South Atlantic route is interesting... many aircraft were sent either from Brazil or even assembled in Africa (Takoradi, in West Africa) and then flown across Africa to supply planes for North Africa and India.
Comment: According to Wikipedia the Western Desert Air Force was operating quite a number squadrons flying numerous variants of the American Curtiss P-40 fighter aircraft around the time of El Alamein.
Answer: The Lend Lease was present in the multiple aspects of the North African victories, with the contribution to equip the RAF and in a lesser extent the Royal Navy.
For El Alamein specifically, the tanks have been already developed in other questions, especially the role of the Grant. I will just highlight the role of the Stuart, former in the war, that was a fast cavalry tank useful for recon in the desert and for guarding the colulns of infantry and artillery when they moved.
In artillery, the British army was largely based on national equipment, but the Lend Lease helped in mobility by providing trucks. The same should be accounted for infantry and logistics.


What were the reasons why Windows never had a decent shell?

Question: I was reading a topic on SO: Why are scripting languages (e.g. ...) not suitable as shell languages?. Especially I liked the answer by Jörg W Mittag, from which I learned interesting things about Windows PowerShell. So after more than 20 years Windows finally has a well designed shell (Windows 1.0 - 1985, PowerShell stable release - 2009). On other hand Unix systems has a bunch of various shells since 1978 Bourne Shell. I've read some articles about MS job interviewing and I have an impression of very "geekish" company. I am wondering why didn't they had a need for command-line tools compared to Unix people who do all their work with those tools.
Comment: Please take the [extended, off-topic discussion to chat](http://chat.stackexchange.com/rooms/21).
Comment: @JerryCoffin, it probably depends for how long you were  in this industry. I'm just starting here so I am quite happy with all this great software which was given for me. There is place for big improvements but it always will be.
Answer: The same reason that the iPod, iPhone (any phone for that matter), and the iPad don't: the command line is not the primary channel of user interaction with the computer in Windows. It is in UNIX or GNU/Linux - so that's why they're more mature. Same argument why the linux GUI desktops were rubbish for so long compared to Windows (Mac OS kind of cheats here since they got the unix command line kinda for free).
Answer: Maybe I'm oversimplifying, but I think of it as a cultural thing:

In Microsoft culture, developers focus on writing programs for their users. The programs are all GUI-based.
In Unix culture, developers focus on writing programs for other developers. The programs are small and focused on doing a specific thing well.
Answer: Note that there's no reason that Microsoft can be the only one to write a shell for Windows.  The guys who write bash are different from the guys who write *nix kernels.  You don't even need root privileges.  I've compiled my own shells to use when I didn't like the one the sysadmin installed.  If there was a true demand for a better Windows shell, someone would have written one.
Answer: Because there has never been enough call for one, I guess.
Windows Scripting Host has been installed as standard since Windows 98 (I assume it was around before that); VBScript was very capable; or you could easily write a command-line tool, which had access to the whole Windows API.
Powershell, put simply, is just another step in the same direction. COM isn't popular any more, so WSH has become quite a learning process. But .NET is the current Big Thing in the Windows world and learning Powershell from a .NET background is relatively easy.
One place I think Powershell has gone wrong though is in trying to appeal to the *nix crowd as well, with all its aliases that make it look like Bash when it clearly isn't.
Apart from the commandline switches, piping is very different in Powershell and is really the first thing you should learn when you pick it up.
And honestly, it is much more like a scripting language, a la Perl, than a shell, a la Bash. There are some serious gotchas if you try to use it as your primary shell.
For example, try doing a simple SVN dump from Powershell. It doesn't handle binary data in stdout very well. On the other hand, manipulating an SVN log is an absolute dream, thanks to its built-in xml type.
Comment: I do not mind the aliases, but I do not like too many edge cases in its syntax.
Comment: @Job: I have many issues with Powershell, that just seemed the only one pertinent here. That said, there are enough good things about Powershell to make it worth the pain sometimes.
Comment: +1, having VBScript really eliminated the need for a shell scripting environment in many ways.
Comment: Another thing is that typical unix IPC is awfully slow and clumsy in Windows. Pipes are worthless there.
Answer: Because there is little need and much pain in developing a second parallel Windows toolset.
Shells are made powerful through the number and power of helper programs on a GNU system, such as sed, find, xargs et al. Re-implementing these tools is a lot of work, and just building a POSIX compliance layer on top of Windows has proven much easier. Cygwin is such a POSIX compliance layer and provides for most of the needs shell users have when they are forced to use Windows.
I would personally guess that the developer community that is both unwilling to jump the POSIX and Linux bandwagon and still sufficiently devoted to shell programming is so small that it took 20 years to develop a stable shell.
Answer: If you consider the Unix shells "decent", then there's been at least one shell for Windows that's been "decent" for decades. The Hamilton C shell is reasonably close to the Unix C shell (though note that the C shell has never had particularly huge market penetration on Unix). Quite a few people have also used JPSoft's various shells (4DOS, 4NT, now called Take Command) for quite some time -- as you can probably guess from the name, 4DOS goes back to the MS-DOS days.
If you insist on a shell distributed by Microsoft, 15 years ago or so the Windows NT Resource kit used to include an NT port of the PD Korn shell1, along with a fair number Unix-ish utilities. It probably didn't include enough to run a lot of shell scripts without modification, but was enough to handle a fair amount of use, especially quite a bit of interactive work.

1In all honesty, I don't know that it was a port of that exact shell, or just something quite similar -- I used it enough to verify that it was as annoying as I remembered Unix shells being, and left it at that.
Comment: Since we're talking shell "programming" here, wouldn't that need to be "...was enough to handle a fair amount of _abuse_..."? `:)`
Comment: yay 4DOS - I was really confused the first time i had to use MSFT's default shell after growing up with 4DOS (before switching to Linux and Unixes) good memories ...
Answer: This is one of those questions that, ignoring conspiracy theories, probably doesn't have a single answer and is the kind of thing historians could argue about forever without ever finding a definitive answer.
My impression is that the power of the shell is not immediately obvious. I started in on programming in Windows 3.1 and there was very little use of the shell. Everything was done through the Visual C++ IDE, and I never looked at makefiles and DOS batch files were so limited that I rarely tried to use a batch file to automate anything more complicated than a basic backup. None of the Windows focused programming books (I have fond memories of Petzold) I was reading at the time discussed using the Windows shell for anything. It wasn't until I started using and programming Linux that I understood how useful a powerful shell could be. I remember when Windows came out it was so exciting because you didn't have to use old command.com anymore. We finally had a pretty interface with more than one font and multiple programs running at the same time without the need for a TSR...
I think that most programmers who start in Windows just don't have experience with a powerful shell and so, don't feel a pressing need to implement one for Windows. Programmers who work in Linux and appreciate the shell, prefer to work in Linux and so don't feel inclined to spend the time working in an environment they aren't as comfortable in to implement one for Windows, especially considering (as has been pointed out in another question) the need to also implement all the CLI tools that are needed along with the shell itself.
The increasing popularity of Linux is, probably, the main reason that Microsoft finally put a proper shell in. As more and more people realized what a shell is useful for it became more and more clear that Windows was missing an important tool.
Answer: Windows has design features that do not lend themselves to scripting.  This is a result of making the graphical interface the primary mode of operation.  Many tools do not have functional command line interfaces.  Without a decent command line interface it is very difficult to generate a good shell.
Often things that need to be scripted in Windows require mouse clicks and key strokes to be simulated at various locations on an applications window.  The resulting scripts can be quite fragile.  Describing where to script in a command language is not a trivial exercise as the relevant geometry is not readily available.
Windows also did not have a functional piping mechanism in early versions.  As it was described to be, the first process would run and its output would be saved to a temporary file.  That file would be used as input to the next command.  This could be disk intensive and would fail if sufficient temporary space was no available.  Unix pipes pass the data in memory and schedule the processes in a manner that minimizes delays.
Answer: When it was launched, in 1993, Windows NT was a move by MS into the space previously occupied by Unix servers and at the time a big deal was made about POSIX compatibility and portability.
But it didn't quite do the job - instead its users were more the desktop crowd using better hardware (these were the days when a 486dx 50MHz with 32MB of RAM was close to the top end) and wanting a better OS. But they weren't interested in shells, so that all slipped.
By the time of Windows Server 2000, which was a second serious attempt to crack this market I think MS had realised they were weak on the shell side - as admins love shell scripts - but even then it took them some time to scratch the itch.


Should questions that portray a clear opinion be closed as opinion-based?

Question: This was inspired by this question. The topic as such is not necessarily opinion based and could be answered by citing scientific studies. But the author already has a clear opinion on the matter and is just looking for confirmation. I voted to close as opinion-based but I'm not sure whether this is a) the correct reason to close and b) whether this should be closed at all? As of writing this question had a negative vote count but so far no close votes.
Answer: I think it is fine to ask about arguments in favor of the (proposed) legalization of certain narcotics.
In your example, the question contains some of the author's opinion which in turn attracted down and close votes. That's fine, and it is up to members of the community to cast such votes.
Another option might be to edit out some of the opinionated parts. As long as the author agrees to that (i.e. the edits aren't reverted leading to an edit war) then that's fine as well.
If the author stats reverting such edits because they don't agree with them, then it might be better to take a step back. That doesn't happen often, but when it does it could be cause for voting (down or to close) or flagging it for moderator attention (if the edit war persists).
So in my view, it's up to the community to decide what to do with the question. I don't see a reason to mod-hammer it one way or another.
Answer: Given how strongly they went with marijuana = dangerous, I'd say that was a push/loaded question... to rephrase for emphasis, it was something like: how could they possibly legalize something so dangerous? There were some clear signs of that in the q like this kind of alarmism:

It may undermine the nation's gene pool.

There's a more specific close reason for that: "The primary purpose of this question appears to be to promote or discredit a specific political cause..."

I'd say that the top-voted answer did a fair job of debunking some of those preconceptions, thus it worked as a decent frame challenge to the question's main assumption, but it would have been an answer better suited to Medical Science SE and to a straightforward [rather than loaded] q like: "are there [medical] science-based reasons to reduce restrictions on marijuana?"
When 95% of the answer has to be a frame challenge on (medical science) facts... the question is a bad fit here (on Politics SE) for that reason also. As discussed elsewhere, not everything that political decisions may hinge on are on-topic here on Politics SE.


Does HTTPS allow replay attack on authentication request?

Question: If I sent a username and the password to a website over HTTPS, is it possible that someone on the net would save this request and re-send it later to authenticate on the website?
Answer: If someone just records encrypted HTTPS session and if the connection served over the secure TLS protocol version with the strong cipher suite, then the answer is no. Neither they will be able to decrypt your credentials nor replay traffic to create bogus session. TLS protocol provides message authentication and has its own replay attack protection.
Answer: Unless they hijack your session (at which point you wouldn't need the re-authenticate), no. When setting up a new session the TLS protocol will negotiate a new session key. So the intercepted authentication will be encrypted with a different key making it impossible for the server to understand what the attacker has just sent. For more info on how TLS works please read this question and answer.
Answer:
is it possible that someone on the net save this request

Since HTTPS is usually end-to-end encryption that someone needs to be at one of the ends, i.e. in the client (bad browser extension or similar) or the server (compromised server) to get the unencrypted request. The encrypted data will be of no help.
In case of legal SSL interception in firewalls that someone can be also there to access the request in plain. Illegal SSL interception (man in the middle attack)  is similar, but in this case you get a browser warning which you should not ignore.

re-send it later to authenticate on my web site

If the data are grabbed then they can be resent.
Comment: " in this case you get a browser warning which you should not ignore." I'm behind a network that pops up those warning in some websites. Does that mean they are intercepting traffic?
Comment: @JoaoMiesler: Possible but hard to tell without further details. It might also be that the sites you visit send a wrong certificate by themselves.
Comment: It's possible because at home I don't get those warnings. Thank you for the answer.


Arduino PWM Pins Interrupt

Question: I am creating pwm from an arduino pin with 50% duty cycle. I just want to know how can i detect its every falling edge using timer interrupt? I don't want to connect that PWM pin to an external interrupt pin. Please help me.
Answer: You can define an interrupt service routine (ISR) for each Timer and PWM pin that it handles. These are known as TIMERn_COMPA_vect, TIMERn_COMPB_vect and TIMERn_COMPC_vect. The Mega has six Timers (n=0..5).
<code>ISR(TIMERn_COMPA_vect)
{
// Timer/Counter compare match A
}
</code>
Check the PWM configuration for how the pin is set, cleared or toggled.
Cheers!
Comment: Besides creating the `ISR(...` you also need to enable that interrupt (e.g. `TIMSK1 |= _BV(OCIE1A)`)
Answer: Referring to the datasheet of ATMega328P: If you want to generate an interrupt every falling edge you must know if the Pin is inverse mode or not. As you can see from the timing diagram the Pin stays high until the compare unit matches (current value of the TCNCT == value stored in OCRn ) and then goes low in the normal mode or works as opposite in the inverting mode.
This could be regulated by changing the bits COMnx in the TCCRn register. If, for example: COM0 = 1 and COM1 = 1 the table says: Set OC0A on Compare Match, clear OC0A at BOTTOM, (inverting mode).
Now with these settings the falling edge happens when the timer overflow, so the ISR must occur when the timer reach its maximum value.

Arduino PWM Pins Interrupt


How do Mormons translate, "Elohim"?

Question: According to Mormon doctrine, Elohim is God the Father. The literal translation of Elohim (אֱלֹהִים), is "Gods". How do Mormons interpret Elohim to mean, "Heavenly Father?"
Answer:
El (אֵל), as the Hebrew word for God or Divine Being, is used in various Hebrew word combinations to identify Deity and to reveal particular things about him. Thus El Elyon (אֵ֣לעֶלְי֔וֹן) means the Highest God, the Possessor or Creator of heaven and earth:

And he blessed him, and said, Blessed be Abram of the most high God,
  possessor of heaven and earth: (Gen. 14:19);

El Shaddai (אֵ֣לשַׁדַּ֔י) signifies God Almighty

And when Abram was ninety years old and nine, the Lord appeared to
  Abram, and said unto him, I am the Almighty God; walk before me, and
  be thou perfect. (Gen. 17:1);

El Elohe Yisrael (אֵ֖לאֱלֹהֵ֥ייִשְׂרָאֵֽל׃ס) is the God of Israel

And he erected there an altar, and called it El-elohe-Israel.
  (Gen. 33:20.)

Elohim is the plural of the Canaanite El or the Hebrew Eloah; consequently, its literal meaning is Gods. Accordingly, as the Prophet pointed out, such Old Testament passages as,

"In the beginning God (Elohim) created the heaven and the earth" (Gen.
  1:1),

should more properly be translated,

"In the beginning the head of the Gods brought forth the Gods," and they created the heavens and the earth. (Teachings, pp. 370-371.)

Elohim, plural word though it is, is also use as the exalted name-title of God the Eternal Father, a usage that connotes his supremacy and omnipotence, he being God above all Gods. (The Father and the Son: A Doctrinal Exposition by the First Presidency and the Twelve, cited, Articles of Faith, pp. 465-473; 1 Cor. 8:6.)1

1 Mormon Doctrine, Bruce R. McConkie.
Comment: In other words, Elohim doesn't mean "Heavenly Father", but it refers to God the Father (the literal meaning of Elohim being "Gods", or the plural of "God"). We don't claim the literal meaning is "Heavenly Father".
Comment: I didn't say that mormons claim the literal meaning is, "Heavenly Father." The words used in my answer are that Elohim is, *"the exalted **name-title** of God the Eternal Father."*
Comment: I was refering to the question, not the answer. Sorry for the confusion.
Comment: So the Mormon believes "Elohim" means: "the head of the Gods brought forth the Gods"?
Comment: @kutschkem - In that case, refer to [the guide to the scriptures](https://www.lds.org/scriptures/gs/elohim?lang=eng). If you look up Elohim, you're directed to see "Father in Heaven." This is what I was referring to in the question.
Comment: @Rick - No, just: "head of the Gods". The rest is considered to be a more proper translation of the entire verse. For more context read the [Book of Moses](https://www.lds.org/scriptures/pgp/moses?lang=eng).

How do Mormons translate, "Elohim"?


Expresso Store Custom Order Number?

Question: Is there a way within Exp:resso Store to change the starting number on orders so they match my client's internal invoicing numbers?
Answer: If you order number is a simple number you need to start from such as 12001 you would just need to modify the auto increment start for the ex_store_orders table
ALTER TABLE exp_store_orders AUTO_INCREMENT=12001;

You should be able to run this in the Tools > Data > SQL Manager > Database Query Form as long as you have at least one order already in the system.
If you don't feel comfortable doing it with sql you can do it in phpMyAdmin or something like Navicat.
If you need an order ID that is numbers and letters you would need to either create an extension to extend Store's default behaviors or you could store the special order number in one of the custom order fields during the checkout.
Answer: No. I suggest to print your suffix by hard coding it in your template and/or notification emails templates.
{exp:store:orders}

prefix_{order_id}
{/exp:store:orders}

Answer: Good new is the next version of Store will have separate order numbers from cart numbers and you will be able to customize this. Look for this in Store 2.5.

Expresso Store Custom Order Number?


How can I make Vim not use the entire screen for spelling suggestions?

Question: If I type z= on a spelling suggestion it uses the entire screen. Is there any way to disable that?
Answer: There is the 'spellsuggest' option for this, which controls various options for the spelling suggestion. You can add a limit by appending a number (note the +=):
set spellsuggest+=10

Which limits the height of the spell window to ten lines.
It looks like this feature has always been present; I just never knew.

Another option I've been using for the last week is the below script; it will display suggestions in the commandline window, and just pressing a number (1-9) will replace the word while pressing 0 will load original z= screen. Any other keys will be sent to Vim as normal, making it pretty easy to abort the search by just entering Vim commands.

" Don't hijack the entire screen for spell checking, just show the top 9 results
" in the commandline.
" Press 0 for the full list. Any key press that's not a valid option (1-9) will
" behave as normal.
fun! QuickSpell()
    if &spell is 0
        echohl Error | echo "Spell checking not enabled" | echohl None
        return
    endif

    " Separator between items.
    let l:sep = ' | '

    " Show as many columns as will fit in the window.
    let l:sug = spellsuggest(expand('<cword>'), 9)
    let l:c = 0
    for l:i in range(0, len(l:sug))
        let l:c += len(l:sug[l:i - 1]) + len(printf('%d ', l:i + 1))
        " The -5 is needed to prevent some hit-enter prompts, even when there is
        " enough space (bug?)
        if l:c + (len(l:sep) * l:i) >= &columns - 5
            break
        endif
    endfor

    " Show options; make it stand out a bit.
    echohl QuickFixLine
    echo join(map(l:sug[:l:i - 1], {i, v -> printf('%d %s', l:i+1, l:v)}), l:sep)
    echohl None

    " Get answer.
    let l:char = nr2char(getchar())

    " Display regular spell screen on 0.
    if l:char is# '0'
        normal! z=
        return
    endif

    let l:n = str2nr(l:char)

    " Feed the character if it's not a number, so it's easier to do e.g. "ciw".
    if l:n is 0 || l:n > len(l:sug)
        return feedkeys(l:char)
    endif

    " Replace!
    exe printf("normal! ciw%s\<Esc>", l:sug[l:n-1])
    echo
endfun
nnoremap z= :call QuickSpell()<CR>

Comment: Another option is to use `s` in insert mode to bring up spelling suggestions. It will probably take up the whole screen, but I find insert mode completion to be less jarring than `z=`.
Comment: Sounds like that could be posted as an answer @PeterRincker (personally I've never liked using completion for spell checking because it removes the word on the first `s`)


How does AGPL affect Microservices?

Question: So if I had a microservice architecture and one of my services relied on a piece of AGPL software, and that service wasn't customer facing, but a service that communicated with it was, would I be required to open source all of those services? or any of them? How does this license impact this architecture?
Comment: @gavv: Why cite a specific answer (not even the top answer) instead of the question itself? Because you support that specific interpretation? Be careful that this is a very controversial interpretation (just have a look at the comments it got).
Comment: Related: http://programmers.stackexchange.com/a/314908/198703
Comment: @Zimmi48, you're right. I like that specific answer, but a link to the question would be more appropriate.
Answer: If the the services together form a derivative work under copyright, then the AGPL source-sharing provisions apply to the entire work, and you must share the source code for the entire work. If they do not form a new work (i.e., they are considered independent program-works that merely happen to interact with one another), then the source-sharing provisions apply at most to the AGPL work only, and only if you have modified it in a way that qualifies as a derivative work under copyright. Note that the determination of when two programs interact with sufficient closeness to form a new single program-work is a subjective determination.
If the AGPL service is indeed a separate work from the rest of your code, then if both

the user interacts with the service in a way that satisfies the AGPL's standard of "interacting with it remotely through a computer network," and
you have modified the service in a way that produces a derivative work under copyright law

then you must make the source code available to your users.
I am not aware of any case law about what level of network interaction is necessary, but if the AGPL service is a utility used by another service that the user actually interacts with (e.g., an AGPL database used by a Web service that the user actually sends packets to) then it probably does not satisfy that condition. (However, note that in my parenthetical example, the database/Web service combo could be a modified work of the AGPL work and the AGPL may apply to both, in which case source-sharing would be necessary for the whole thing, as mentioned in the first paragraph.)
Comment: @apsillers Let's say I create a microservice for PDF Conversion using the AGPL version of iText7. Then I build a copyrighted web application that calls that microservice. **#1**: Should I disclose only the microservice source-code, or also the web application source code? **#2**: should I disclose the source code with the customers only, or with the whole world (on GitHub for example)? Thanks in advance
Comment: @AndreaLigios The central question for #1 may be a difficult legal determination: does your use of an AGPL microservice create a derivative work? I would personally lean toward "no, it does not" but as I detailed in my answer, I don't know of any real case law on the subject. By contrast, #2 is very easy to answer: whenever you have AGPL obligations, you have them only toward people who actually use (or receive) your software -- you have no obligations toward people who have never interacted with your software. (Same for GPL: you have obligations only insofar as you distribute the software.)
Comment: IMHO you are mis-representing the AGPL. If the code is used as-is and unmodified, the AGPL is not much different from the GPL.
Comment: @Philippe I tried to make that clear with the requirement that "you have modified the service in a way that produces a derivative work" is necessary to trigger AGPL provisions. How can I make it more clear?
Comment: Very clear! The more I read the AGPL, the more I better understand the licensing approach of MongoDB for instance.

How does AGPL affect Microservices?


Transferring a domain to another registrar and downtime

Question: I have a domain A redirecting (301) to another domain B.
If I take the domain A to another registrar, what will happen with the site content? How much time will it be without showing the content?
Answer: I'm not sure why you think the content will be affected.
When you change registrar they may (or may not) allow you include the DNS information. Most do now-a-days but that is not always the case.
However, the content on the server will not be affected by this move, the risk is when changing registrar is if they update the records (A records, MX records etc) and therefore point to your existing server. The key thing is when the switch between registrar's is complete, all settings are as they should be. This is what will create/not create downtime...
In regards to how much time, it depends on how quickly the transfer takes place, but if you speak to the new registrar and explain you want certain (all/some) records to be copied over too, they will do that for you. If not, you need to keep an eye on it, and as soon as the transfer is complete, log on  and update the DNS manually.
Answer: First, nothing at all will happen to your site's content.
Most registrars take up to 24 hours to update/change your name server (to display your content on an another registrar. This means that the page/domain which is using 301 redirecting; which you are updating the DNS records to, will be down for a day at the most. It usually takes much less time than this, it will depend on how busy the administrators at the new registrar are at the time.
Note: During this time, the domain where your 301 is directing to will be up and displaying your content, unless you are updating the name servers/records for the redirected domain's registrar as well. Also, some registrars with enough resources can have the DNS records updated within minutes, I have had this happen a few times.
Answer: There will be no down time the domain will be working similarly like it is working now.
Comment: Can you explain how this works with no down time more fully?
Answer: Send the new registrar a support ticket and tell them that you need the DNS records transferred too. They got the work done and had no downtime.


When is it appropriate to submit multiple answers to the same question?

Question: Many times I have several ideas to answer a question. For instance, in response to, "How do I mitigate tendency X in game Y?", I might have a few strategy ideas, as well as a couple of expansions I think make this less of an issue, or possibly even house rules to help. Some of these ideas are better than others. Should I just pile this all into one big answer, or split it out into several? I prefer to split up my answers, so that each answer can be voted up or down on its own merits, but I've had several people ask me to just condense everything into one answer. What's the right thing to do?
Answer: This is a question and answer site, not a forum.
The fact that you have to click through a warning dialog box is a strong message that multiple answers from one person are not encouraged here.  If you think you need multiple answers for one question, then the question is probably not the best OR you need to condense your answers into one.
No matter how many answers a question gets, we all know that most folks are only going to read a couple of them.  I don't think it is fair for one answerer to try to attract extra eyeballs by submitting multiple answers.
Let's keep ourselves to voting on complete answers, not items or ideas.  Every answer follow the "back it up" principle.

It contains personal experience
You link to an outside source.

If your answer contains phrases like, "I haven't tried it but ..." or "Many people use ..." or "I've heard that ..." just strike that whole section.  Speculation doesn't belong on a StackExchange site.  There are plenty of forums that would love that sort of discussion.
Comment: I certainly haven't been trying to attract extra eyeballs, just doing what made sense to me. If splitting up answers is not helpful to people in the context of SE expectations, I'm happy not to do it.
Comment: I think this is unnecessarily absolute. I do definitely agree that it's better if you can write a single comprehensive answer, with all the pieces connected, but if there are two very distinct solutions to a problem ("how should I store game X?") it might be most organized and fair to present them separately.
Answer: If you feel that you must split your response into two answers then that's a good sign the question wasn't very well formulated to begin with. As per the FAQ:

All questions on Stack Exchange are expected to be objective and have concrete answers; we're not a place for conversation, opinions, or socializing. We also expect questions to represent real problems, not just imponderables, hypotheticals, or requests for opinions.

StackExchange sites are built upon the premise of precise, well-formed questions that have a concrete answer. If you feel you have contradictory answers to a question, or answers that would make more sense if they were two separate answers, then the question needs to be made more specific, or perhaps itself split into two questions.
To use your example "How do I mitigate tendency X in game Y?" I can see how this question is so broad that you feel that more than one answer is required. I would first request clarification of the question. Are you looking for house rules? Strategy? Game expansions which deal with this issue?
It might be best to request the question be made more specific, or split into multiple questions: "What house rules could be made to mitigate tendency X in game Y?" "Which expansions help solve tendency X in game Y?" "What game strategy can I employ to mitigate tendency X in game Y?"
Answer: The general consensus is: don't.  The stackexchange network likes canonical answers.  Cover the question as good as you can in one question.  You'll get more upvotes that way.


Limiting File Attachments to a SQL Server 2005 DB to a value > 8000 bytes

Question: I have a .Net app that will allow the users to attach files to a SQL Server 2005 database.  I want to limit the filesize to 10MB, so from what I can tell, I have to declare the datatype varbinary(max), since the max size I can actually specify is 8000 bytes.  But the ~2GB filesize varbinary(max) allows seems like overkill.  Is there a way for me to limit it at 10MB in the database, or do I just need to check that they're not trying to attach something larger on the frontend.
Answer: Using varbinary(max) is totally okay, since it is varbinary, you will only use as much place as the content requires, up to 2 gigs. However, you could add a CHECK CONSTRAINT in the db, checking the datalength() of the upload. I would rather just check the upload in the application though.
Comment: Can you think of a reason not to do both application and DB side checking?
Comment: I probably wouldn't do the DB checking because it don't add anything of value to the application. The size limit is a business decision which is best kept in the application logic. The DB will handle a 10 or 20 or 100 MB file perfectly fine.
Answer: Slightly off-topic:
While it is certainly possible, I have found it is usually a bad idea to actually store attachments directly in the database.
The primary problem is the explosive growth of the overall database size due to large attachments, which makes backups and other routine maintenance much more difficult.
Simply storing the path information of the file in the database, and storing the actual file in a shared network folder is an alternative I recommend considering.
(Of course, this means that you now have to worry about network file permissions, and some other issues, but is still a better alternative in many cases.)
Answer: I think you need to make it in the frontend. You can limit the HTTP request size in the web.config like that:
<code></configuration>
   </system.web>
      <httpRuntime maxRequestLength="60000"/>
   </system.web>
</configuration>
</code>
You may also need to explicitly check the posted file size when the user try to upload a file more than the specified threshold.
Answer: In ASP.NET you already have a limit on the upload size (default: 4MB IIRC). You could use that to limit your downloads.
IMO it would be better because it's sooner on the path to the DB, so you minimize the overload on the server.
The only downside is that the user will see an error page if he tries to upload a file bigger that the ASP.NET limit.
Answer: Ah - my fault.  This is a VB.Net desktop app.  I forgot to mention that.  But I would imagine that the suggestion of having to handle it on the frontend still holds.
Thanks
Answer: I would be checking the file limitation in your application, you don't want to go through the process of inserting it into the db, just to find out it is too big.
A little application logic before hand can save time, and provide a better user experience.
Answer: It seems like it would be a best practice to limit attachment size on the front end and in the database. Kaboing's check constraint solution seems to fit the database side of things.


Resize artboard to content in Sketch

Question: Does the Sketch app provide something like a "resize artboard to content" command? If yes, where can I find it?
Comment: the question looks like offtopic, but anyway what the version on the Sketch do you use? in last versions  there is a command for fitting the artboard to artwork
Comment: Where should I have posted the question then? ^^
Comment: Cool, where can I find the command. I'm using the latest version (3.0.1)
Comment: Have no access right now, try "Trim Transparent Pixels"
Answer: This question has not been accepted and I think what OP were looking for is resize the artboard to fit to the content with it, and thus it got no answer so far.
While I don't know when this feature had been available, but in Sketch 3.7, you can achieve it exactly. Just select the artboard and on the Inspector, click on the Resize to Fit. Sketch automatically resize the artboard to fit to the content.
Comment: For some reason, the 'Resize to Fit' button (pictured above, in the properties pane when the Artboard tool is active) is always greyed out for me, but I can instead do `Layer > Resize Artboard to Fit`
Answer:
Select the content around which you want to make an artboard.
Click on the artboard button (or) go to Insert → Artboard.
On the right you will see various artboard sizes. The top one will be called "around selection".
Comment: Welcome to GraphicDesign and thanks for the contribution!  This question is not asking *how to create* an artboard, but rather *how to resize one*
Answer: FYI, my suggestion is an extension to Jagrat Jagz Desai's method. It's not fully automated but does save you the step of checking the size of your content in order to create an artboard at that exact size.

in the Layers List on screen left, select the artboard that
corresponds to your content
delete artboard and hit 'Keep Layers' button when prompted
highlight content, then insert new artboard (A)
select 'Around Selection' option in the Inspector on screen right
Comment: Unfortunately, this really is the best way to do it.
Answer: Use 'Edit → Scale' command to resize artboards.
Comment: Have you tried it? in Sketch 3. Select artboard -> Edit -> Scale to resize
Comment: Thanks. This one worked for me when I want to resize/scale down the size of an existing artboard.
Answer: Click the art-board layer on the left, there in the right panel you will see the size of an art-board, just readjust according to your need.
Comment: Hi Shrés, welcome to GDSE and thanks for your answer. If you have any questions, please see the [help] or ping one of us in the [chat] once your reputation is sufficient (20). Keep contributing and enjoy the site!
Answer: Having not previously found a good solution to this problem, I went and built a plugin to do just that.
http://zhifengkoh.github.io/resize_artboard/
Summary of features

Hitting Ctrl+Shift+Z resizes the parent artboard of your currently selected layer. You can also resize one or more selected artboards (or the parent artboards of one or more selected child layers) all at once.
Resize all the artboards on the current page with Cmd+Ctrl+Shift+Z. However, if you have a very large Sketch file with tons of artboards on the page, I'm not sure what kind of performance impact that'll have.
The relative positioning of all layers on the artboard is always preserved
The positioning of the artboard's layers with respect to the artboard's top-left corner will only consider visible layers. That means if a hidden layer is sticking out to the left of the visible layers, when you resize the artboard it will stick out the left side of the artboard's X axis.
The artboard itself is never moved relative to other artboards on the page

Let me know (preferably on Github) if you have any comments or feedback!

Resize artboard to content in Sketch


How to create a mathematical mechanism in order for a game to be balanced?

Question: For example, in a game like Diablo, how did they decide how much damage each skill does?
Is it the amount of clicks that the player needs to do? Or maybe the expected lifetime of a player? Maybe calculate the probability that the player will die?
Answer: This is called "experience."  Blizzard has made games before and learned from experience.  The heuristic to rating and improving that knowledge is "Is it fun?"
In Blizzard's case they are known for iterating when trying to find fun and balance, a lot, and that shows that there is no secret math but just a lot of work.
A better question might be "once I find out what feels fun, how do I create the math and code to match so that all of my game is fun?"
Comment: Worse comes to worse you can build tests with hand-picked numbers at various intervals and curve-fit, that would kind of seem like hidden math to someone outside the box.  It's a wildly broad question and so only wildly broad generalizations can be discussed.  Kind of like asking "in a painting like Van Gogh's, how did he decide how much yellow to use?"
Comment: From your comment, it sounds like there is a hidden math. Only the path to it is unknown. Kind of like a blind optimization.
Answer: With a lot of iteration and playtesting.
I think this is what makes interesting the job of a Game designer. You can imagine balancing the game is a big part of what a game designer does once the coding has started.
I've always found Sirlin's articles very enlightening on the kind of work you have to do. He used to work at Capcom as a game designer. Here are a few you can check and are pretty good:
Balancing Multiplayer Games
Super Balance Articles II Turbo (How he balanced the remake of Street Fighter II)
Balancing Puzzle Fighter
He is algo very good at picking apart other games and figuring how they work. Check his site.
Answer: There are a few things to point out, balance isn't done exclusively by the programmer, and in most cases shouldn't actually rely (entirely) on the programmer, but the designer instead. Which leads me to the important notice, that it doesn't usually depend on the algorithm itself (unless it needs a big change) but the variables OF the algorithm. For example, the Starcraft II team had something in the editor that could exclusively edit balance through the various inputs and testing the actual design inputs by hand (through play testing combine with common sense and decidind (as previously posted) what is "fun")
In other words, it's up to you how the actual algorithm works entirely. Some people will base it on damage per second, meaning the designer only has to alter how much damage, that the unit will 'do' per second. And the algorithm will say maybe, "once every second, do  amount of damage" and it will recieve  from the DPS that the designer put into the files via la editor.
Answer: There are countless factors to consider. Question is too broad IMO :)
It's all relative too... dmg is only relative to hp, etc. Damage over time (eg damage per second) is likely a good place to start when evaluating a weapon's power. Divide an enemy's HP by the Damage to get the amount of time it would optimally take to kill it... and so on. I'm just talking flow-of-consciousness... I'll stop.
Answer: Well the first step is to define what "balanced" is.  How long an encounter should be, how much "grinding" there is, how much health should a given NPC take away from the player, that kind of thing.
From there you can pick some equations that get you something close to what you want.  From there's it's a matter of testing and iteration.  Some things don't have a complete corollary to your predefined values (i.e., how long a stun is worth X amount of damage, that kind of thing) and you have to do testing to figure out what the ratio of things are.
Someone linked to a article in a similar question here that goes into this process a bit more: http://www.eldergame.com/2010/11/how-to-balance-an-mmo-and-how-to-stop/
Answer: This is answered but I thought I would comment on Diablo 3 balance, specifically, and how it was described by Jay Wilson and other designers. D3 works off of one large "monster spreadsheet." The rows are monsters and the columns are monster attributes weighted in %. So 100% would be considered average. Paraphrased/very simple view:
<code>Monster   | Health  | Damage  |   Exp
------------------------------------------
Monster_A   100%       100%      100%
Monster_B   80%        50%       65%
Boss_A      200%       120%      300%
</code>
This way, they can tune different monsters along the same relative scale. Smaller monsters that appear in packs have lower individual health and damage, but other monsters that appear alone may have higher health and damage (relatively speaking).  As others stated, there is tons and tons of play-testing an iteration involved to get both the weighted and base values in a good place against what the players are capable of doing.
Diablo games, in general, use a lot of different tables/weightings to make everything easily scalable.
Answer: It sounds odd but Rock, Paper, Scissors is a condensed version of what you're talking about.  I don't need to explain the rules, but there is a clear balance between the different elements.
Similarly, as most games progress, there are elements of levelling-up as the player increases in skill.  RPGs are most notable for this: you have a level which then applies a multiplier on your attack, defence, health etc.
You could try to design the interactions between the numbers beforehand, but it's easier to adapt them by hand to suit the gameplay you want to achieve.  If you want some kind of "method" then you could start by picking a realistic number and then, if that's not right, halve or double it.  If that number isn't right either, choose a number halfway between and repeat.  Eventually, you'll reach a satisfactory point.


What is the difference between う and お when they come after an -o sound? Ex. とお and とう

Question: I've seen some words with とお and とう and I was wondering how are you supposed to know which one, and if there is any difference in pronunciation.
Comment: Highly related: https://japanese.stackexchange.com/questions/54169/why-is-%e3%81%93%e3%81%8a%e3%82%8a-spelt-with-an-%e3%81%8a-rather-than-an-%e3%81%86/54171#54171
Answer: I guess you mean how to know which kana to use for a word that you've heard, but don't know how to write?
I'm not a native speaker, but I think the pronunciation difference is quite subtle. It might be difficult to know which one if you hear a word for the first time. Comparing とお in 遠い to とう in 当然 for example, I don't think I'd be able to guess if I heard them for the first time, and didn't know the kana already.
That said, as a rule of thumb, I feel that とう is much more common, so if you're not sure that's probably the safer guess. Other than that, depending on your vocabulary, how well you know kanji pronunciations, and whether you know or can guess the meaning of the word from context, you might be able to make a guess at which (if any) kanji is used, and from there know which kana.


use of graphics stock icon (spoon,fork,skull head) for logo

Question: I am a new graphics designer I want to  use skull head, spoon icon, fork, etc in my logo from free stock but I don't know how to avoid copyright issue
Comment: If you wish to "avoid copyright issues" *never* use stock images. And **most**, if not all, stock image sites expressly forbid use in a logo unless all rights have been purchased.
Comment: If the shape is so innocuous and plain that you feel it's merely a nondescript "icon" then simply draw your own. A "spoon" or "fork" could simply fall into that area. A "skull" would depend a great deal upon the artwork itself. In many cases, a "skull" may be too unique to be classified as a general "shape".
Answer: Simple answer: don't use other's work in any logo you design - yours or a client's.
That will avoid any copyright issue.
However, also bear in mind that a "derivative' work, at least here in the US (and I believe in UK & EU, but others will have to verify) doesn't have to start with a literal copy: if you copy the design intent, the idea, the visual concept, and execute it yourself, you can still be at legal risk.
Put it another way away from the legal nonsense - why would you want to use someone else's work for your logo as a designer anyway?


What is Difference between GhostableInLibrary vs Ghostable Files?

Question: Can any one explain me the difference between GhostableInLibrary and Ghostable files, also what are prons and cons for each one?
Comment: http://sharepoint.stackexchange.com/questions/50232/difference-beween-wiki-page-application-page-web-part-page-and-publishing-page have a look at this link
Comment: http://sharepoint.stackexchange.com/questions/59798/understanding-ghosting-unghosting-site-pages-and-application-pages is also relevant.
Answer: In SharePoint, any file (outside _layouts: _layouts is a huge exception to what's following here) is either "ghosted" or "unghosted".
"Ghosted" means the file source (content) is stored on the disk of each SharePoint server (WFE) of the farm.
Whenever a user requests a page from SharePoint, and the page is ghosted (and marked as ghosted in the DB, along with its physical path), the file is taken from the disk and then served to the client.
If the user requests an unghosted page, it means the content of the page is stored in the SQL DB, and the SharePoint server has to get that content from the DB to serve it to the client (actually, a memory cache mechanism enters the game, so the SharePoint server doesn't always request the entire page content from SQL if there was no change in it).
Initially, default/OOTB SharePoint pages are ghosted (i.e. on the disk of each WFE). Also, you may have different files in different libraries (including Pages or SitePages libraries) that actually refer to the same physical version of the file on the disk.
As soon as you edit a file (from SharePoint Designer for .aspx pages, or from Word for .docx, etc.), that file becomes unghosted. [note: you can de-unghost it (!) from SPD]
Of course, when you upload a new file into a library (the most common scenario for end-users), it's naturally unghosted (i.e. sent immediately to SQL, never written on disks of WFE), and there's no way to "de-unghost" (aka "re-ghost") it.
Also, as the file resides in a document library, it supports all the library features (it has an associated item with meta-data, versioning, etc.).
The file is said to be "in library".
When you develop a custom solution, and create "modules" to populate files at feature-activation, your files are naturally "ghosted" since you have a physical copy of them that will be deployed on the disk of each WFE (in the 14, or 15 or 16 hive). But you still have the choice between "ghosted" and "ghosted in library".
"ghosted in library" will be the choice most of the time, since it means your new files will behave exactly as if they were uploaded by an end-user (they'll have an associated item, metadata, properties...) (the only slight difference is that they can be re-ghosted after unghosting, while real end-users files are always plain unghosted).
"ghosted" only will be the choice if you want the file to be stored in the library; but the file will be kind-of "hard-coded" (or let's say "static"), with no normal library features. You'll choose that option for code files like .aspx forms, if you want.
Answer: Solution-1 : Source

The decision between Ghostable and GhostableInLibrary really is based on the type of file that you are deploying and whether you want users to view and access the document view a list or a library.
If you desire users to view the file within a library then you would select the InLibrary option.  Both Ghostable / GhostableInLibrary implies that the file will be cached in memory.
GhostableInLibrary however specifies that the file be cached as part of a list whose base type is Document Library and that you can work with the file as you would with any other file in the library (check-in, check-out, version history).
Solution-2 : Source

Ghostable and GhostableInLibrary Specifies that the file be cached in memory on the web front end. Both values specify that the file be cached,
GhostableInLibrary specifies that the file be cached as part of a list whose base type is Document Library and that you can work with the file as you would with any other file in the library and provides you same features like check-in, check-out, version history etc.
When changes are made to those files only the differences from the original page definition are stored in the database, while original file is cached in memory along with the schema files. The HTML page that is displayed in the browser is constructed through the combined definition resulting from the original definition cached in memory and from changes stored in the database.
Both values specify that the file will be cached, but GhostableInLibrary specifies that the file will be cached as part of a list whose base type is DocumentLibrary
If you don't set a value this means that the file is Unghostable implying that the file will not be cached in memory in web front end servers and that it'll be completely stored in the database.
If you need to understand the difference in terms of Programming context then please refer Ghostable vs. GhostableInLibrary – A Lesson on Custom Form Deployment in SharePoint
Comment: The meaning of _Ghostable_ is not exactly "cached in memory". It's about where the full page is stored: either on the disk or in the SQL DB.


Can cilantro be used for tea or tisane?

Question: I love using my dehydrator. Can I use dried cilantro as tea, or with other herbs to make tea? If so, how would I pick herbs to use with it?
Comment: What's wrong with fresh-cilantro tea?
Answer: Cilantro is one of the herbs that doesn't retain much flavor when it's dried; it's unlikely to be particularly tasty when made into a tisane. On the other hand, the dried seeds of the plant -- called "coriander (seeds)"* --  have a pleasantly tangy and floral/citrusy taste.
They are occasionally used as a flavoring agent in beer, so it's perfectly reasonable to think of them as a candidate for tisane. The flavor of coriander is not dissimilar to chammomile, and might complement that. It would probably make an interesting mix with black tea, too -- in fact, it should be noted that coriander is sometimes an ingredient in Masala Chai, the sweet Indian tea-milk-spice drink.

*In the US, the leaves are referred to as "cilantro", whereas "coriander" most often means the seeds (although sometimes the leaves).
Comment: The wierd cilantro (leaves) and corriander (roots/seeds) distinction arose with the sudden rise in popularity of Mexican/Southwestern cuisine in the 1980s.  That cuisine tends to use the Spanish word, and tends to only use the leaves--and so the word cilantro came to mean the leaves in English.   Before then, it was always coriander or Chinese parsley for all parts of the plant.
Comment: Beer is hardly the most common use of coriander - it's a basic spice. It's very common in Indian cuisine, and used plenty elsewhere too.
Comment: I mentioned beer only because it's a beverage like tea, not because of its frequency. I'll make that clearer
Answer: According to this The Hour For Tea blog entry, cilantro is one of several ingredients in a tisane for which it claims some medical benefits (emphasis added):

Catnip tea was used as a sedative, along with lavender, chamomile,
  coriander or cilantro; peppermint could also be used to loosen phlegm,
  and a tisane of thyme with honey was used as a sore throat remedy and
  for scratchy coughs.

Note that this was not described as tasting good, or even that flavor was the point.
Answer: Cilantro tea is used in several Ayurvedic remedies.
You will need approximately 15 minutes to make cilantro tea.
Here you can get how to make Cilantro tea.
Comment: Discussing health/nutrition is off-topic, see the [faq]. I removed this portion of your answer and kept the reference to the tea technique.
Answer: In Russia (an all xUSSR) tarhun is very popular carbonated sweet drink that made from tarragon. So why don't try using cilantro? Combination with sugar and maybe a little lemon should be ok.
Comment: Well, in Poland its also use as popular sweet drink. I tried the method chupvl described, and it tasted soo good
Answer: I think cilantro would make a quite unpleasant-tasting tea.  For other herbs, I suggest chammomile, peppermint, spearmint, lemongrass: blends work very well for tea.  You could also experiment with dried fruit, like blueberries, hawthorn berries, and lemon zest.  And, things I'm unsure how to categorize, such as rosehips, rosebuds, blackberry and blueberry leaves.  Experiment and have fun! :)
Re: other uses for cilantro, I think it works well in Italian and Mexican food.
Comment: You could transform this from just your opinion into a more informative, expertise-based anwser by describing the flavor and what makes it unsuitable for tea. The ideal behind this site is to build a collection of factual questions, answered with information that is at least somewhat objective and can be applied by anyone who reads it. Your opinion is quite welcome -- personal taste always comes in when discussing food -- but it becomes much more helpful to the asker and to future readers if you can support it with detail and data.
Comment: Can you explain _why_ you think it would be unplesant, or _why_ you think it works in Italian or Mexican food? Cilantro (as distinct from coriander, the seeds, may actually be the only herb that is _never_ used in Italian cuisine (aside from a rumor I've heard that they use it in Campania).
Comment: Well, it's just my opinion.  I actually find dried cilantro to have a rather strong taste, and consider it as a cooking spice, along the lines of basil, oregano, rosemary, thyme, etc., all of which I would also find unpleasant as a tea.  It could just be a matter of personal taste, however...
Comment: As to why I think it works well in Italian and Mexican food, that is pretty much the same (personal preference).  Those are my main uses for cilantro, and I just like the way it tastes, and complements other spices.
Comment: I do not have a wealth of data on cilantro, nor do I care enough about it to seek it........

Can cilantro be used for tea or tisane?


Proper way to stretch the pectoral muscles

Question: What is the best way to do pectoral stretches? A specialist recommended that besides avoiding bench presses and strengthening my back, I should stretch my pectoral muscles as often as possible, as they have grown accustomed to being in a shortened state and will actively try to make me slouch. Preferably those stretches should use no equipment.
Comment: @GetFitChimp gave you good pec stretches. To add to that, if your pecs are pulling to the point of rounding your shoulders, your upper back and shoulder blade muscles are pulled into a lengthened and weakened state.  This q/a includes some exercises for [strengthening the opposing muscles](http://fitness.stackexchange.com/questions/6994/i-have-extremely-bad-posture-what-can-i-do/7015#7015) in the optimal position. See section: "Back, Upper Back and Scapular muscles".
Answer: KL,
Your pectoral has two portions and two muscle groups: the upper portion and the lower portion, the pec major and the pec minor.  So to effectively target both portions and both muscles, here are two simple stretches that you should try:

Corner stretch for the entire lower and upper chest and mainly the pec major

This corner stretch to mainly target the pec minor, which has been shown to be more problematic in the PT world from my experience.

A few things to consider:

Make sure you do not have any shoulder instability problems before doing these stretches as they may cause some pain.
You should feel the stretches in the muscles, not in the shoulder joints.  Try not to lean forward to far in the beginning to reduce stress on the shoulder joints.
I recommend holding the stretches for about 20-30 seconds, repeat 2-3 times and perform them at least 2-3 times per day for best results.
In addition to these stretches, you can try this one on a foam roller for 5 minutes before bed for an awesome stretch of the entire chest, shoulders and biceps.

Hope this helps!
Answer: I would look at some of the stretches used for swimming, and while the pectoral muscles play some part in posture, one of the major causes of slouching/rounded shoulders is over development of the front deltoid compared to the rear deltoid. This is extremely common in swimmers, and can often be seen in people that emphasize front muscular development and neglect rear development.
Stretches 1
Stretches 2


Hypothetical, is it possible to retrieve stolen blockchain currency?

Question: It is my understanding that blockchain technology is decentralized meaning there is no middle man in transactions. This seems like it has benefits but it also has downsides. When necessary, middlemen are able to retrieve objects under their control and redistribute. But with blockchain, if a private key is stolen (this will inevitably happen a lot; probably due to social engineering) and funds are transferred, how can they be recovered? Other than getting the culprit to hand over their private key of course. Is there any "police" mechanism within the blockchain technology?
Answer: Proof-of-work blockchains offer transaction immutability, meaning transactions can't be undone or modified after the fact without having to redo all the work that was done since the time of the transaction.
In the case of a fraudulent transaction, several problems arise:

How can it be proven the transaction was indeed fraudulent? How can validators and miners determine which of the parties involved is the "rightful" owner? As far as the system is concerned, providing a valid signature is proof of rightful ownership.
If the transaction in question was confirmed, you'd need 50+% of miners to agree to redo all the work they already did in order to create an alternate history where the fraudulent transaction didn't occur. This rewriting has a huge cost on the network (while miners redo the work, they can't build on top of the latest block, grinding the chain to a halt). Getting people to agree to this would be nearly impossible.

Some blockchains (in particular Ethereum) had to deal with this issue (DAO problem) and opted for a custom change to the consensus code, which made that change opt-in and eventually resulted in a chain split between the people that wanted to remove the "fraudulent" transactions and those that didn't. Others (OMNI in the case of a Tether heist) decided to blacklist the addresses containing the stolen funds, requiring yet another custom, opt-in change to the consensus code.
Both cases involved humans making hard decisions and leaving some people unhappy about it, there isn't so far a generalized, on-chain, way to deal with this issue.
Comment: Does each individual bitcoin have a serial number?
Comment: @mathewbruens No. The blockchain is an immutable record of transaction outputs by which a balance is available to spend for the holder of the relevant private key. Transactions are instructions to move utxo's to new utxo's. Really, all that exists is utxo's and the instructions necessary to spend them.
Comment: If a transaction had to be reversed, it cannot be. What is necessary is a new transaction spending the balance of the fraudulent transaction's utxo's to a new address, which requires the private keys for the fraudulently obtained utxo's to sign for the transaction. Only catching the crook and forcing him to pay back stolen Bitcoins will work.
Comment: The attraction of bitcoin is that it has no administrative functions. If it had some kind of "reverse transaction" administrative function, who would be authorized to operate it? Every government? Some governments? There is no government that represents everyone who might use bitcoin.


Best method for transitioning into Hook Grip for barbell?

Question: I'm looking to get my hook grip developed to the point where I can lift with it without pain/injury. I'm also concerned about the impact that hook grip may have on my ability to play piano/keyboard. Any advice?
Comment: Where do you feel the pain? It's possible that you grip the bar the wrong way. It can be quite painful on your thumb or calluses for example depending on how you do it.
Answer: Slowly. Do hook grip on your first set for a week, and regular grip for your remaining sets. Then do hook grip on your first two sets for a week. Then your first three sets for a week, and so on. It helps if you have a ramp up routine (start with lower weights until you get to your working set) because you can do this scheme with lower weight and build up.
Hook grip will initially feel really weird. It should feel more natural in every set after a few weeks.
If your thumbs feel a little burnt, then simply don't do hook grip for one or two workouts then go back on the plan when they heal. There's no reason to torture yourself by pushing through pain.
As far as the piano concern... I can't speak to that. Anecdotally, hook grip will create slight calluses on your thumbs. It might make your thumb a little stiffer and harder to move (very slightly). I wouldn't expect it to significantly impact playing piano (my typing speed hasn't gone down any). Initially, your thumbs may feel like they're burning or sore immediately following a workout which will impact playing. Though that shouldn't be a concern once you're acquainted with it.
Answer: In addition to the other answer I would just add: use tape!
You can employ this when getting used to hook grip, but I've also seen elite folks continuing to use it. For me it not only helps with comfort but I think it improves the strength of my hookgrip a bit.
Not just any tape. Use stretchy, self-adhesive sports tape. This type of tape is flexible and sticks to itself, not you. Regular sports tape can actually make things much worse. Here is an example, but it's available in most any sporting good store. https://www.amazon.com/dp/B07TTGCZGC/ref=cm_sw_r_tw_dp_U_x_HsBkEb8RAD373
Use it sparingly. You don't want to overdue it and add bulk to your thumb. Get the 2inch roll and go around your thumb about 1.5 times.
Comment: +1: how have I never seen this.


What is a stock warrant? How do warrants work?

Question: What is a stock warrant?  How do warrants work?  I've been told they are similar to options; how?  Then why not just call them options - what makes them different?
Answer: In general, a warrant is a security issued by a company allowing the holder to purchase a certain number of a particular class of shares at a certain price for a particular period of time.  They differ from exchange traded options (i.e. calls and puts) in that they are issued by the company that issued the underlying shares that they allow you to purchase whereas calls and puts are generally written by other investors.
The other big difference between options and warrants is that options are standardized.  Any call or put you buy on a particular exchange has basically the same set of rules governing use.  By contrast, a warrant may have all kinds of stipulations that must occur before you can execute, such as price events (e.g. only if the stock hits a certain price) or business events (e.g. only if the company elects to defer payment on a bond issued at the same time as the warrant).
Warrants are generally a bad choice for small and inexperienced investors since each warrant issue is different and you often need a lawyer or other qualified professional to fully understand all to possible outcomes.
Answer: In Australia there are 2 type of warrants (I don't know if it is the same in the US, UK and other countries), the first are trading warrants and the second are instalment warrants.
The trading warrants are exactly what it says, they are used for trading. They are similar to option and have calls and puts. As Cameron says, they differ from exchange traded options in that they are issued by the financial companies whereas options are generally written by other investors.
Instalment warrants on the other hand are usually bought and sold by investors with a longer term view. There are no calls and puts and you can just go long with them. They are also issued by financial companies, and how they work is best explained through an example: if I was to buy a stock directly say I would be paying $50 per share, however an instalment warrant in the underlying stock may be offered for $27 per warrant. I could buy the warrant directly from the company when it is issued or on the secondary market just like shares. I would pay the $27 per warrant upfront, and then in 2 years time when the warrant expires I have the choice to purchase the underlying stock for the strike price of say $28, roll over to a new issue of warrants, sell it back on the secondary market, or let it expire, in which case I would receive any intrinsic value left in the warrant.
You would have noticed that the warrant purchase price plus the strike price adds up to more than the share price ($55 compared to $50). This is the interest component inherent in the warrant which covers the borrowing costs until expiry, when you pay the second portion (the strike price) and receive the underlying shares.
Another difference between Instalment warrants and trading warrants (and options) is that with instalment warrants you still get the full dividends just like the shares, but at a higher yield than the shares.


Taking a procedure for ICP and adapting it to use with AAS

Question: I was reading a paper regarding metal detection and they gave their procedure for an acid digest of a soil sample which was then analysed by ICP-OES.
They used nitric acid, hydrogen peroxide and sulfuric acid.
I want to do a similar analysis, but I only have AAS available to use.
Can I simply dilute the acid digest in a volumetric flask and analyse with the AAS?
Or are there other steps to consider?
Are the choices of acids of concern? Can they cause interference in the flame ionisation?
Answer: In short - it depends. For most metals no problem in using the same digestion protocol for ICP (OES or MS) or AAS. Are you using flame or graphite furnace?  If you are using flame AAS -just prepare a blank digest (same ratio of acids but no sample) use that as you blank.  If you are looking to quantify Na, K or Ca there can be significant background issues from soil samples - most trace metals are not a problem - but you need a good blank to qualify.  The LOD (limit of detection) will vary depending upon the matrix S/N (signal to noise).
Hope that helps.  If using graphite AAS you are typically limited as to the amount (volume wise) you can add to  the furnace.  You can try multiple dry downs before atomization.  Again a good plank is paramount.


Left-ideals in subalgebras

Question: Suppose $A$ and $B$ are (complex) unital associative algebras (with not necessarily the same units) and $B\subseteq A$. Also, let $\mathcal{L}$ be a maximal left ideal in $A$. Is it true that either $B\subseteq\mathcal{L}$ or $B\cap \mathcal{L}$ is a maximal left ideal in $B$?
Answer: The answer is no. Let $A = \mathbb{C}(x)$ and $B = \mathbb{C}[x] \subset A$, i.e. the field of rational functions in one variable and the subring of polynomials. Consider $\mathcal{L} = 0$, the zero ideal in $A$.
If $A$ and $B$ are commutative, finitely generated, and have the same unity element, the answer is yes: this is nontrivial and closely related to the Nullstellensatz. This counterexample shows that the finitely generated hypothesis is necessary, but I am unsure about the rest.
Edit: You may be interested in the notion of PI ring (short for polynomial identity ring). Some Googling and a Springerlink search turned up a 1966 paper of Amitsur and Procesi, "Jacobson rings and Hilbert algebras with polynomial identities," which contains a closely related theorem (I think it implies an affirmative answer to your question) for finitely generated PI algebras over a field.
Before spending too much time investigating these topics in noncommutative algebra, I would suggest getting comfortable with the relevant commutative algebra, if you aren't already. Look up "Jacobson ring" if you are unfamiliar with this notion.
Comment: Thank you. Do you think it might work in finitely generated, non-commutative algebras?

Left-ideals in subalgebras


How can I install the Google Apps Package (Play Store, ...) on my Android device?

Question: I have recently installed a custom ROM and cannot find the Play Store. It seems like all apps that belong to Google are missing.
How can I install the Google Apps Package (Play Store, ...) on my Android device?
Comment: @tomm13b: Cyanogenmod are not "official", the only official distribution of Gapps is from manufacturers that shipped a device that passes the CTS and Google Play for updates.
Answer: Background
Only Android devices that are licensed by the Open Handset Alliance contain the so called Google Apps. Usually people associate apps like Google Maps, Google Play Store, etc. with Android, but because of the open-source nature of Android, manufactures can sell Android devices without Google Apps and therefore avoid to pay the license fee.
Custom ROMs
At first cyanogenmod shipped its ROM with pre-installed Google Apps. In September 2009 the founder of Cyanogen received a cease and desist letter from Google, demanding that the Google Apps not be included in the team's ROMs, since the ROM could be ported to devices which are not licensed to have the Google Apps. In turn, that would bypass the requirement for the devices to be licensed. For a few days, development on the ROM ceased, there were outcries from Android users all over the Internet, and many bloggers suspected Google had just shot itself in the foot.
Eventually, an alternate method was found, whereby Google Apps are not included in the ROM proper but the Google Apps which came with a device would be backed up by the device's custom recovery or another app, and then re-installed onto the device once the new ROM was flashed. This would therefore "Google-ify" one's ROM.
Source
How to install Google Apps?
Generally speaking:
First download the package corresponding to your version of android. Currently (november 2015), there are several "distributors" of Gapps available. Each typically offers a set of packages per android version, each package with more content. The apps in the packages range from a lite package with the basic apps (~100MB) to all of googles apps(200+MB). The applications themselves are untouched.

If you don't want to or cannot root your device:

Flash the Gapps (Google Apps Package) zip package with a custom recovery.

You may first need to flash a custom recovery (like CWM or TWRP) using a PC tool such as Fastboot or Odin/Heimdall. This flashing in turn may require an unlocked bootloader on the phone.

If root is not a problem: (See if you can root the device)

Some stock recoveries will let you "update with adb". Just install adb, then adb command to install is:adb sideload gapps.zip--assuming the package is in the adb folder and is called gapps.zip
You may also install a custom recovery like in the unrooted case.
Root typically allows android apps to flash a new recovery (i.e. without a pc).
OR
Install a ROM with the Google Framework, if it exists for your device. Though many ROM developers have followed CyanogenMod's example of separating distribution.
If you flash a Gapps ROM, it may be possible to re-flash with another non-Gapps ROM afterwards while retaining the Gapps. This assumes the android versions are compatible.
Most users capable of flashing a ROM will be capable of flashing Gapps separately.
Further References

How to install Google Apps (GApps) on your Android Device / Phone
Comment: The download links do not seem to work.
Answer: As detailed in the FAQ, download the appropriate gapp from this site

http://opengapps.org/

Then install it using recovery.
Answer: I wanted to add to this as there is no link to where to get the GApps.  The newest group is Open Gapps.  These do not work with EVERY custom ROM, but the vast majority (and those based on AOSP should work).
Open Gapps: http://opengapps.org/
This site is awesome because when loaded you get a basic UI with a couple selections that allows you to specify what you want (some packages have more google apps, others have less), they even have an option to include the Aroma Installer version which when flashed in TWRP or clockwork will actually bring up a menu system which you can tap to make selections of which apps and which settings you would like at the time of the install! Of course it is large as it includes everything, but it can be nice to be able to customize the gapps install as you are installing it (and yes it has the ability to save your selections for future installs at the end of the setup UI it will ask if you want to save your selections.  If you do future installs it just opens the UI and you tap to load the saved file and done).
Open Gapps has help ?s all over and documentation on their site to help you with many questions.
Cyanogen MOD has their own version of Gapps (page lists gapps packs for every version of CM ROM from CM4+ on this page.  Note that as of CM11 CM Roms can now flash Open Gapps.):
https://wiki.cyanogenmod.org/w/Google_Apps
(looks like as of CM13 they have stopped their custom Gapps zips and now fully use Open Gapps).
With these 2 links you should be good to flash GApps with just about any version of Android (I can not account for a severely custom job done by someone that may not work with Open and/or CM GApps, as we know what happens when we assume in the tech world!).