Use a different template file if use is on a mobile device

Question: I currently am using page-front.tpl.php to display my Blog content type in a View. I want to use a different template if the user is on a mobile device, and have them either redirected to the mobile view, or have the Drupal theme layer use a different template.
Answer: To do this you need to setup some method that will detect whether the use is coming from a mobile device and than add a function in your template.php file to switch to your mobile template.
For the mobile detection, there are a number of modules available for this but for this specific use case, I would recommend Mobile Switch because it provides a specific variable you can use for testing in your theme (others like Mobile Tools might as well, this is just one I've used before). From documentation:
Development with Mobile Switch.

The module provides four system variables:

1. mobile_switch_ismobiledevice
2. mobile_switch_istablet
3. mobile_switch_ismobiletheme
4. theme_mobile

From here, you just need to add a template suggestion to your theme through the preprocess_page function using this variable, ex:
function YOURTHEME_preprocess_page(&$variables) {

  global $mobile_switch_ismobiledevice;

  if ((request_path() == 'YOUR_PATH') && $mobile_switch_ismobiledevice) {
    $variables['template_file'] = 'mobile-YOURTEMPLATE';
  }

}

This method assumes you want to specifically switch between two template files, if you would prefer to use a separate mobile theme, than the Mobile Switch or Mobile Tools module have configuration options to help you do this.
Comment: Note for Drupal 7: use `$variables['theme_hook_suggestions'][] = 'page__YOURTEMPLATE';`
Answer: You should be able to use a combination of Browscap and Mobile Switch.
Browscap

Browscap provides an improved version of PHP's get_browser() function.
The get_browser() function can be used to tell what a visitor's
  browser is capable of [...]

Mobile Switch

The Mobile Switch module provides a simple automatic theme switch
  functionality for mobile devices, detected by Browscap or Mobile
  Detect.

If you're looking to do it through code (e.g. you would prefer to put something in your existing tpl.php) then Browscap provides a handy browscap_get_browser() function which is a kind of replacement for the PHP function get_browser(), so you could do something like the following (pseudo-code):
$browser = browscap_get_browser();

if ($browser == "MOBILE_BROWSER") {
 print $MY_MOBILE_VIEW;
}
else {
 print $MY_DESKTOP_VIEW;
}


What are the main advantages and disadvantages of sortition?

Question: Ancient Athens, what is by many considered the first democracy, resorted extensively to sortition to assign its political offices. In modern times however the only place where this method of selection remains in widespread use is for selecting trial juries. What would be the main advantages and disadvantages of using sortition in politics? Specially in the case of bodies large enough so that they can be considered statistically representative of the population at large.
Answer: I will give a list of what can be considered advantages and disadvantages. If any point is not clear, please ask for clarification in the comments and I'll amend the answer.
Advantages

Effective representation of the interests of the people
Fairness & Equality
Democratic
Less corruptible than elections
Fair representation
Power to ordinary people
Voter fatigue
Loyalty is to conscience not to political party

Disadvantages

Pure sortition does not discriminate
Misrepresentation
Sortition can put in power people with minority views
Voting confers legitimacy
Some forms of sortition entail compulsion
Enthusiasm of the representatives
Accountability
Comment: Sven, I now see the points seem to be almost identical to those of wikipedia, you should have credited the source.
Comment: I believe the fact that an allotted body is less **corruptible** is debatable (although I personally tend to agree it would be). As for **compulsion**, although it might be desirable to properly represent the people, it seems to be in no way an intrinsic requirement of sortition, or am I missing something?
Comment: Regarding **corruption**, I do agree that sortition alone is no guarantee for it, but it could help with the problem because you can not promise sth. that has implications beyond your "reign".
In some forms of sortition you would not need to accept the result but you would be put in power whether you like it or not, that is the **compulsion** I was talking about. Should I clarify that in the answer?
Comment: As I see it, if one thinks compulsion would have more cons than pros, the obvious solution is to allow people to refuse and simply draw somebody else in their place. In this sense sortition does not have to include compulsion, unless yo think it is an advantage having it. You could still argue compulsion is the best way to implement sortition over all, but has *some* undesired consequences (which ones?).
Comment: That's why I put it as "Some forms of sortition entail compulsion"
Compulsion needs to be considered a negative effect as it is an effect against the free will of somebody. Even if we could alleviate the effect it would imho still be a negative one.
Comment: Is there any proof that "Effective representation of the interests of the people" is indeed the case? Starting with a workable definition of what "interests of the people" mean :)
Comment: J. Burnheim (pol sci) argues: "But do we, in order to have democracy, have to find a way in which the demos first makes up its mind what is to be done and then controls its representatives in the process of carrying it out? What I want to suggest is a different conception. Let the convention for deciding what is our common will be that we will accept the decision of a group of people who are well informed about the question, well-motivated to find as good a solution as possible and representative of our range of interests simply because they are statistically representative of us as a group."
Comment: DVK, if we define interest of the people as what the people want, on any topic where the majority of the citizen of 50%+x (where x is any number > 0) has a certain opinion, you can make the probability of an allotted body having a different majority as small as you want by increasing the number of members. Said more simply, as a consequence of the law of big numbers, an allotted body will approximately have the same opinions as the general population, the approximation is better the bigger the body is. Elections have no such property.


What is the best way to detect mobile screen width using JavaScript

Question: What is the best way to check mobile screen width using JavaScript? I've tried screen.width but get mixed results.
Comment: http://stackoverflow.com/questions/6990070/mobile-redirect-using-screen-resolution
Answer: Modernizr would be a good tool for you to use. Have a look at the mq() function (media query). It uses the CSS @media tag to evaluate media types and screen sizes.
Answer: You can use the Javascript mobile detection method at HandsetDetection.com.
Create a site profile with no redirection rules and embed the detection javascript in your page. Then you can access the HandsetDetection.width and HandsetDetection.height variables directly from javascript for screen resolution.
Hope that helps.
(Disclaimer: I work there).


Are there any studies that validate the golden ratio principles in designing websites?

Question: Something like this that suggests the golden ratio is indeed appeasing to the eye from a user experience perspective?
Applying Divine Proportion To Your Web Designs
Comment: I don't think so. And, in practice, I find it to be abused as a crutch more often than not.
Comment: Agree with DA01. I find it similar to the "rule of thirds" - it's a good way to start thinking about composition, but by no means the only way; and it's certainly not a magic tool that can correct other poor decisions.
Comment: Have you looked around after being 'inspired' by the smashingMagazine find? Any other sources you have for reference?
Comment: I think this duplicates an earlier question: http://ux.stackexchange.com/questions/2536/why-does-the-golden-ratio-work-or-does-it
Answer: The golden ratio can be seen as a compelling argument for providing a beautiful interface, but by definition it is also a design constraint.
The golden ratio is great for sizing some elements of content in subtle ways that make little other difference, but as a content layout strategy, it belongs with print media where there is static content. It has no place with modern multi-channel media consumption that feeds desktop, tablet, mobile or TV and needs to be flexible, fluid and responsive to cater for all the different display modes.
Twitter put up a picture in their flickr stream that shows #newtwitter (not #newnewtwitter) being designed around the principle of the golden ratio:

So you may say "What could be better validation of using the golden ratio than Twitter using it?" Well, wait a minute - as they point out, your mileage will vary as soon as you go beyond the narrowest view. So they didn't use it as a constraint, they used it as a starting point only.
And that is the key - by all means use it as a guide - a starting point - but don't make it a constraint.
Don't be a slave to the ratio. Design for your content, design for your users.

I wrote more on this topic for another question and included some quotes from an article by Jason Santa Maria
Answer: Golden ratio has been used by mankind for centuries.Its use may have started early as with the Egyptians in the design of the pyramids - or atleast they were the first passing the measurable proof.
It also appears in physical proportions of the human body, movements in the stock market and many other aspects of life, love and the universe.
Its validation can appear in hands/eyes of the user when the Golden ratio is utilized in the design. The validation of order and rhythm is seen in Greek buildings on using the Golden ratio. But I cannot pull out any websites that says due to the use of Golden ratio we had got more users or ROI that has pumped up.
The only way this could be done is to do A/B Testing of two designs with and without Golden proportion and clearly find results when using best of design principles.
Comment: If you're [quoting an external source](http://itunes.apple.com/us/app/goldenratio-the-tool-for-every/id485258055?mt=12), you might want to use the quotation markup and cite the source.
Comment: +1 not quite an answer, but good points all the same.
Comment: That is not an answer at all. Even more, you clearly state that you do not have an answer "I cannot pull out any websites that says due to the use of Golden ratio we had got more users or ROI that has pumped up". You then proceed to answer a question that was not asked.
Answer: The golden ratio isn't specifically about websites, it's a general principle about proportion in design. The best treatment I've seen explaining how it works is in "Design for hackers" () by David Kadavy, where he devotes a chapter to exploring what the golden ratio is, its strengths and limitations, and how it is applied to design in a number of domains.
Comment: The question was not "what is golden ratio". Perhaps the cited book has something to say about websites? That would be relevant to the question.
Comment: The OP asked about the relevance of the golden ratio to websites; the point I made was that the golden ratio is not just about websites, it's a general design principle, and thus applicable to all design domains with a visual component. To make the point further, the book does cover website design in this context.
Comment: Peter could you link to the book and possibly quote something from the book? We prefer to have things on the site so that if the source is no longer available in the future, the answer is still useful.
Comment: Link added; will add a precis later on, but thought it might help.


Why do you have to enter your e-mail when commenting a blog post?

Question: Why do you (usually) need to enter your e-mail adress when commenting a blog post? I guess it's for some kind of spam-protection but if the system doesn't need it - is it ok to skip that input field or could the be another reason to keep it?
Comment: The email can also be a handle for automatically checking/retrieving an avatar - eg from gravatar.com or disqus.com
Comment: but more importantly it is for email marketing !
Answer: One of the main advantages for requiring the user to enter in their email address when commenting is actually for the site administrator. There may be instances where your comment prompts a response not suited to, or too large for the comments section, and as such they will contact you directly.
It also acts as an extra barrier (although not a very good one) against spam and troll commenters. The mere fact that the user has to complete an extra field and make up an email address just to write "first" on a post, will turn that user away in many cases.
Answer: My web comic doesn't have login accounts -- it's more secure for my site as a one-person operation and it reduces barriers to getting people to comment. Asking for an email address serves two purposes:

It allows me to pull up the associated Gravatar with that account, giving the user some degree of identity.
Because the email address is not shared on the live website, this combined with the gravatar functions as a de facto password -- People could attempt to impersonate another user, but without knowing that user's email address (to produce the right gravatar), nobody'll believe them and it won't work. Yes, this gets defeated as more people know that person's email address, but it prevents at least passive spammers and vandals from doing so, which is enough for my purposes.
Answer: Reason to include an email address:

The blog owner might receive the comment as e-mail, by adding the
commenter his/her email address, the owner can immediately respond by
sending a reply email.
The commenter might receive an email notification after posting comment

If both cases do not apply, leaving it out might simplify the commenting experience.
Answer: because emails are valuable to resell as info and names are not. Also, it harder for spammers to create email accounts.


Problem with apache

Question: I have problem with apache, when I get configure a LAMP then I write:
sudo apt-get install apache2

And everything been fun, but next I wrote
cd /etc/apache2/mods-available
sudo cp * /etc/apache2/mods-enabled

And when I start a apache I get error log
"* Starting web server apache2                                                                    *
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/lua.load: Cannot load /usr/lib/apache2/modules/mod_lua.so into server: /usr/lib/apache2/modules/mod_lua.so: cannot open shared object file: No such file or directory
Action 'configtest' failed."

How I can repair this? Please give a simple council because this is my first time on ubuntu. (I have ubuntu 14.04 LTS)
Answer: Files in /etc/apache2/mods-enabled are supposed to be links to files in mods-available, so delete those files which are not links:
sudo find /etc/apache2/mods-enabled -type f -exec rm {} +

And in the future, use a2enmod and a2dismod.
Answer: Lua support in Apache in 14.04LTS is broken, see also: mod_lua is missing in 14.04?
Apparently, a patch has been around for a while now, but no one has bothered shipping the fix yet. See also: https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1323930, specifically - have a look at the suggested work-around.

Problem with apache


Group action on a stack and fixed points

Question: This is mostly a reference question. Suppose that I have an action of (say, finite) group $G$ on an algebraic stack $X$ (in my case it is a Deligne-Mumford stack, but this shouldn't matter). As far as I understand, in this case it makes sense to talk about the fixed points stack $X^G$ (which is not a closed substack of $X$). Does anybody know a good reference for this notion and various things related to it (tangent spaces etc.)?
Answer: A standard reference is
Romagny, Matthieu
Group actions on stacks and applications.
Michigan Math. J. 53 (2005), no. 1, 209–236.
http://projecteuclid.org/euclid.mmj/1114021093
http://perso.univ-rennes1.fr/matthieu.romagny/articles/group_actions.pdf
Comment: Yes, great! I think in Graber-Pandharipande localisation on stack you define the fixed locus as the zeros of the vector field generated on the stack by the group action. But I still do not know a reference for these vector field generated by a group action on a stack.


Why wasn't the Product Attributes Index Included in the Scheduled Updates in 1.13?

Question: In 1.13 most of the indexes now use triggers in the DB to track when changes are made to entities and the indexes are updated via cron selectively for just the entities that have changed.
The Product Attributes index was left out of this scheme however (this is the index that drives the filtered navigation):
<code>Mage_CatalogIndex_Model_Indexer_Eav
</code>
I'm just trying to figure out why this would be the case - the EAV attributes for products are tracked in the new scheme and the catalog_product_flat_* tables are updated via the cron.
Only thing I can figure is that the update of the Product Attributes seems to put a lock on the cataloginventory_stock_item table which could cause checkout issues, but I'm wondering if there was another reason why this index couldn't be kept in check dynamically?
Answer: Magento implemented this, but they didn't finish the task until the release. This will be released with the next minor update. At least I expect that.


What was the symbolic significance of Odin breaking his staff?

Question: In Der Ring des Nibelungen, Odin breaks his staff and uses it to set Valhalla on fire. However, his staff had all contracts and covenants in the world written on it, and was seen as protecting law and order. What is the significance of the destruction of the staff, and what effect does it have on the world?
Comment: Is opera allowed on SciFi?
Comment: I was writing this in response to a request on meta.
Comment: The [Composition of the poem Der Ring des Nibelungen](http://en.wikipedia.org/wiki/Der_Ring_des_Nibelungen:_Composition_of_the_poem) has a short section on Wagner's evolution of the ending. See 'The End of the Ring'.
Answer: In Wagner's opera cycle; Der Ring des Nibelungen, Wotan's (Odin's) spear is made from the wood of the world tree Yggdrasil and engraved with the contracts from which Wotan's power derives.
In Act 3 of Der Walkung we see him use the spear to break the sword of Siegmund, leading to Siegmund's death. When he tries to bar the eponymous hero of the opera; Siegfried (Siegmund's son), from awakening Brünnhilde from her magic sleep, Siegfried breaks the spear in two and Wotan flees. It is implied that this is also the end of Wotan's power and we never see him on stage again.
In terms of immediate effects, Brünnhilde is told that "the Gods war no more" and that they "dwell in silence" awaiting the day when happiness comes upon the world again. We can reasonably assume that in the human world, the effects are a cold and dark time with the people suffering from a sort of general malaise or mild depression.

Recently he returned; in his hand he held the splinters of his spear:
  a hero had shattered the shaft. With a silent sign he sent the nobles
  of Valhalla to the forest to fell the World-Ash.
He bade them pile the logs from its trunk in towering heaps around the
  sacred hall. He summoned the council of the gods; he took the throne
  in state: by his side he bade them sit, fearful as they were; in rings
  and rows the heroes filled the hall.
So he sits, speaking not a word,
  silent and solemn on his sacred throne, the spear's splinters held in
  his hand; Holda's apples he will not touch. Amazement and awe strike
  the gods numb. He sent his two ravens on their travels: if ever they
  return with good tidings, then once more, for the last time, the god
  will smile into eternity. We Valkyries lie clasping his knees; he
  remains blind to our tearful glances; terror and endless anguish
  consume us all.
Answer: Another psychological  interpretation would be that, He decided to lose the battle to allow his daughter out of the ring by somebody (A Hero) in order to end his own guilt for what he had caused. Consequent of loss of spear was end of the rule of Gods. He knew that but for his daughter's freedom he decided to do so.


Voltage reference vs voltage regulator

Question: I need to bias some op amp inputs with a voltage. I'm in the 10-60 hz range. I need the bias voltage to be as low noise as possible, like -155 dbv . Would a voltage reference, voltage regulator, or even zener diode work the best here?  I'm confused as to which part would work the best. And do I need to drive the bias through a voltage buffer or can I put it right onto the inputs?
Comment: How stable must this be, as temperature changes?
Comment: "as good as possible"  how much liquid helium can you afford?
Comment: Sounds like an XY problem to me.
Comment: possible duplicate of https://electronics.stackexchange.com/questions/221312/voltage-regulator-vs-voltage-reference ?
Answer: A voltage regulator is meant to keep voltage consistant across widely varying output current. A voltage reference keeps it consistant across a range of other conditions but is meant to operate without a load on it. You want a voltage reference.
Answer: Your goal of -155dBv, given -160dBv is 10^-8 below 1volt (peak-peak?) is 10 nanoVolts.
We know, using Vnoise = sqrt(K * T /C)
that 10 picoFarads as the Cap, in a low-pass-filter with any value of R, will produce 20 microVolts RMS total integrated noise.
You want to be 2,000X lower noise than 10pF will produce.
Thus your capacitor must be 10pF * ( 2,000 * 2,000) = 40 uFarad. Try a 47uF.
Pick your R as you wish. Just use at least 40uF in the LPF.
==================
The OP wants at least -155, which is close to -154, which is 6dB more voltage than the 40uF produces. 6dB, or 2x more voltage, allows 4x small cap, at 10uF.
Comment: How about thinfilm cap?
Comment: That's a neat trick with the capacitor value, presumably it involves the resistor having a defined noise_power/rtHz regardless of R. I've not seen a derivation of that result anywhere. Is there a published derivation you could link to?
Comment: I was exploring the relationship of R and C and the total integrated  random thermal (resistor) noise, and attempting to come up with a nomograph to summarize. A very experienced Aps Engr looked briefly at my efforts, and advised "That is just the total noise of a sampled-capacitor," and YES he was right. @Neal_UK: have not found one yet.
Comment: This is the ideal noise case for a thin film resistor, but a Zener or any voltage ref diode may be worse so you choose an ultra low noise Vref that is ultra-stable, I believe.
Comment: @ Sunnyskyguy Is the excess noise (in non-thin-film Rs) a shot-noise proportional to sqrt(current) thru the resistor?

Voltage reference vs voltage regulator


How do I rescue sick people?

Question: In Alpha 8, how do I redirect colonists to do things like rescue sick people? Or eat or sleep in the right place? Sorry, I seem so clueless but am new to this kind of game, but love it.  Simple navigation instructions would be very useful.
Answer: Rescue:  Left click a healthy colonist to select them.  Right-click the sick or injured colonist to open the context menu.  Left click "Rescue [name], [title]" to order the colonist to rescue them.  You will need an empty bed or sleeping spot that you've marked for hospital use for this to work, otherwise the colonist won't know where to take the patient.
Eat where you want them to:  How far a colonist will look for a table and chair to sit and have their meal depends on how hungry they are.  If they're just kinda hungry they'll walk with their meal a decent distance to find a good place to eat.  If they're taking starvation damage they'll carry whatever food they find a few steps max before they start devouring it.  I suggest making a small, high-priority food stockpile near the table you want them to use, or just storing ALL your food in a freezer near it.
Sleep where you want them to:  Build a bed (or sleeping spot), click the bed to select it, at the bottom of the screen click "Set owner", choose the colonist you want to sleep in that bed.  Note that no matter how tired they are or how far from bed they are, they will walk all the way back every time they go to sleep, so if you have them doing work a long way from home for a while, you might want to change their owned bed to one nearer the work.
General navigation stuff:

It's a little counter-intuitive, but to have colonists interact with things that are constructed, you usually pick the thing first and use one of its menu options to interact with the colonist (like the bed example above, or setting a "bill" for item production in a workshop).
To have a colonist interact with a piece of equipment, another colonist, or a visitor, you select the colonist and then right-click on the the thing/person you want them to interact with (like the rescue example, or for equipping gear).
To have a colonist interact with the environment, you usually use the "Orders" tab in the architect.
To have a colonist interact violently with something or someone (besides hunting, that's "Orders"), you pick the colonist, draft them using their menu, and then can use right-click to move them to specific locations (they will fire around corners, using them as cover) or order them to attack specific targets.

How do I rescue sick people?


Is there an unarmed strike proficiency in D&D 3.5, and, if there is, do monks get it for free?

Question: I'm trying to settle a coffee break argument - does a weapon proficiency for unarmed strike exist (either explicitly, or under some other more general weapon proficiency) under D&D 3.5 rules, and, if so, are monks automatically proficient in unarmed strike?
Answer: One: The Unarmed Strike is a Simple Weapon
It's listed in the table of simple weapons. The errata rules clarify that in the case of a contradiction between rules text and a table, the text should be taken as correct ("text trumps table"), but no text states that Unarmed Strikes are anything but a Simple Weapon. Ergo, that is what they are, despite being very strange weapons in general.
Two: The Unarmed Strike is also sort-of a Natural Weapon
Despite being a simple weapon (a classification of manufactured weapon), and despite the fact that it generally follows the rules of manufactured weapons (e.g. iteratives), the Unarmed Strike is frequently treated as a natural weapon. You can use magic fang but not magic weapon on it (unless you're a Monk), you can take Improved Natural Attack (unarmed strike), and so on.
Three: Humanoids do not automatically get proficiency in their natural weapons
Unlike most creature Types, the Humanoid type does not grant proficiency in its own natural weapons. Compare Humanoid to Animal or Dragon or what have you.
For the record, Fey, Monstrous Humanoid, and Outsider types don't grant such proficiencies either. However, they all get proficiency in all simple weapons, which leads me to...
Four: The Humanoid type does not grant simple weapon proficiency if you have class levels
The Humanoid type, unlike the other types that lack automatic natural-weapon proficiency, does not get simple weapon proficiency if the creature has class levels.
Five: The Monk class does not grant simple weapon proficiency, or proficiency in unarmed strikes
Neither is listed, and Monks are explicitly one of the few classes that doesn't get the entire simple weapon proficiency.
Six: Improved Unarmed Strike neither requires nor grants proficiency in unarmed strikes
Nowhere in the feat's text is proficiency mentioned. The Monk's better version of the feat does not either. Both deal with unarmed strike damage rolls; proficiency is about attack rolls. There is no inherent contradiction between a Monk taking a penalty to attack rolls (from nonproficiency) and getting a bonus on damage rolls (from the unarmed strike feature); after all, that is how Power Attack is supposed to work. It's just a matter of it not making much sense for Monks to lack basic proficiency with the weapon they are supposedly masters of.
Conclusion
A Humanoid Monk does not have any feature granting him proficiency in unarmed strikes. As a result, the default case holds true: he's not proficient.
This is universally agreed to be an oversight. The Monk is a very-weak class; it really does not need to either lose its best class feature or take a −4 penalty for using it. Just proof that Wizards did not have a particularly impressive editing staff for the D&D 3.x project.
Comment: Humanoid monks can, of course, take [Simple Weapon Proficiency](http://www.dandwiki.com/wiki/SRD:Simple_Weapon_Proficiency) to fix this.
Comment: why did you hyphenate "very weak"?
Comment: @srcs I could not tell you precisely what thoughts crossed my mind over a decade ago when I made that choice. However, the idea would be that "very" modifies "weak" rather than "class," and so the hyphen disambiguates the association. See [here](https://ellii.com/blog/when-to-use-hyphens-rules-for-multiple-word-adjectives) for the first Google result I got for the concept. In this case, though, it's really unnecessary—and arguably therefore undesirable—since "very class" isn't a thing outside of memes, and there is therefore no ambiguity.
Answer: Humanoid Monks are not proficient with their Unarmed Strikes.
This is because proficiency with Unarmed Strikes, the ability to use Unarmed Strikes to deal lethal damage and be considered armed while using them, and the Unarmed Strike class feature are all separate things. Monks enjoy the later two, but not the first.
There are a few ways to get proficiency with a given weapon in 3.5.

You can be granted proficiency by your class. Monks have a fixed list of proficiencies, which does not include all Simple Weapons (which an Unarmed Strike is). Thus the Monk does not get proficiency in Unarmed Strikes from their class.
You can be granted proficiency by your creature type. Humanoids are "Proficient with all simple weapons, or by character class", which means humanoids with class levels do not get proficiency with all simple weapons.
You can have explicit special abilities, racial traits, or feats. Monks in general do not.

So, humanoid Monks manage to fall through the cracks on all counts and therefore don't have proficiency. They can acquire proficiency, but the type and class do not provide.
This is one of 3.5's most famously dysfunctional rules.
Comment: you can also gain proficiencies via race.
Comment: "Or" is an *alternative* and not an *exclusive alternative* therefore it allows *both* sides to be true simultaneously
Comment: @Drejzer If that were functionally the case, then all humanoid characters would be proficient in simple weapons, and such a wizard could use any simple weapon without penalty. It's reasonable to rule that Unarmed strike is a natural weapon rather than a simple one, and that all creatures are automatically proficient with any natural weapons they have, but it's not exactly in the rules that way.
Answer: I believe the unarmed strike falls under the Simple weapons, so you are proficient with unarmed if you are proficient with simple weaponry. Monks are not the only proficient characters, but they do get the Improved Unarmed Strike feat, and improved unarmed damage class ability. Also, as BESW mentioned in the comments, unlike nearly any other weapon, you are not "considered armed" with unarmed strike unless you have the Improved Unarmed Strike feat.
EDIT: Since the three classes that do not get automatic simple weapon proficiency (druid, monk, wizard) do not seem to mention any Unarmed proficiency, I believe it is safe to assume that every character is automatically proficient with his own unarmed strike (See KRyans more complete answer for information about that). However, extremely RAW, these three classes are not proficient with their own unarmed strikes. Funny for the monk, isn't it?
Answer: Unarmed Strike is not a weapon, thus it does not take a weapon proficiency penalty
There are many flaws with the arguments made for the "Answers" in this thread. With everything I have researched, I have came to the conclusion that Weapon Proficiency is intended for Weapons, and not intended for Unarmed Strikes.
No where in the book does it state that an Unarmed Strike is a Simple Weapon
This is very important because the book references Simple Weapons in several different areas, the only time that Unarmed Strikes are seen together is in the 7-5 Weapons Table on Pg.116. The table is not used solely for weapon proficiencies, it has several purposes:

These categories pertain to what training is needed to become proficient in a weapon's use (simple, martial, or exotic), the weapon's
usefulness either in close combat (melee) or at a distance (ranged,
which includes both thrown and projectile weapons), its relative
encumbrance (light, one-handed, or two-handed), and its size
(Small, Medium, or Large)

In that very same table there are categories: Unarmed Attacks, Light Melee Weapons, One-Handed Melee Weapons, Two-Handed Melee Weapons, and Ranged Weapons. We know several instances where the book refers to an Unarmed Strike being considered as a "Light Weapon" (Page 113, Page 121 for example) Yet it is not located under "Light Melee Weapons"? Why would this be differentiated? Because we know that it is "Light" and "Melee", but it is not a "Weapon" it is an "Attack".
You are proficient with your natural weapons
There is no example where this is not true. Using the druid as an example. The druid specifically mentions that "They are also proficient with all natural attacks (claw, bite, and so forth) of any form they assume with wild shape ...". This is not an "ability" or "feat" that grants the druid these proficiencies, this is implying that if the druid were to take the form of a wolf or other beast, they would instinctively be proficient with their own body.
I don't consider the Unarmed Strike to be a natural weapon. The book mentions on Page 41 of the Players Guide: "A monk's unarmed strike is treated both as a manufactured weapon and a natural weapon for the purpose of spells and effects that enhance or improve either manufactured weapons or natural weapons"
Also it mentions right under the monk class that:

Unarmed Strike: Monks are highly
trained in fighting unarmed, giving
them considerable advantages when
doing so.

Examples in the book that differentiate between Unarmed Strikes and Weapons

WEAPON FOCUS [GENERAL]
Choose one type of weapon, such as greataxe. You can also choose unarmed strike or grapple (or ray, if you are a spellcaster) as your weapon for purposes of this feat. You are especially good at using this weapon.
Prerequisites: Proficiency with selected weapon, base attack
bonus +1.

Prerequisites specifically state that you need "Proficiency with selected weapon". It also states that the feat can "also" be applied to: Grapple, Unarmed Strike, and Ray (if you area spell caster). Is Grapple / Ray considered a weapon that you need to select proficiency for?

WEAPON SPECIALIZATION [GENERAL]
Choose one type of weapon, such as greataxe, for which you have
already selected the Weapon Focus feat. You can also choose
unarmed strike or grapple as your weapon for purposes of this feat.
You deal extra damage when using this weapon.
Prerequisites: Proficiency with selected weapon, Weapon Focus
with selected weapon, fighter level 4th.

Same as above, the feat applies to "Weapons" however, an exception is made for Grappling and Unarmed Strikes.
Conclusion
The book only refers to the Unarmed Strike as a Weapon when it is "considered" or "treated" like one. All characters have the ability to make an Unarmed Strikes, it is not a weapon you "Pick up" or "Purchase". Using an Unarmed Strike is described as "Striking for damage with punches, kicks, and
head butts is much like attacking with a melee weapon"
The book handles Unarmed Attacks separately from you typical weapon attacks in the same way that it handles trip attempts or grapple attempts. Instead of applying Proficiency Penalties, the Unarmed Attack incurs an "Attack of Opportunity" (Page 139 "Armed" Unarmed Attacks).
To answer your question, You do not need Weapon Proficiency for Unarmed Strikes just like you do not need it for Trip attempts. Instead you will need the Improved Unarmed Strikes feat, just as you would need the Improved Trip feat, to avoid taking the attack of opportunity penalty (which yes, the monk is already proficient with). My apologies for not finding this thread sooner to post the correct answer.  Also, the current accepted answer does not site any sources for any of the claims, most of which are unfortunately false (And all debunked because it is not a Simple Weapon, it is only "considered").
If anyone wishes to claim that a monk character incurs a -4 penalty for not being proficient, then please show an example where an official stat block for an npc monk character includes this penalty. You won't find one.


Could you say exactly what the density matrix $\rho(x,y)$ describes when $x \neq y$ in QM?

Question: I understand that if $\psi$ is a many-body electronic state function and
$$
g(x) = \int \psi^*(x,x_2,\cdots,x_n) \psi(x,x_2,\cdots,x_n) \, dx_2\cdots dx_n,
$$
then $g$ describes the probability to measure a particle in a volume element at $x$. And if I add the prefactor $n$, it becomes the density, simply because the density is the probability of measuring one electron in a volume element scaled by the number of electrons in the system (as the electrons are identical). But if instead I focus on this function
$$
f(x,y) = \int \psi^*(x,x_2,\cdots,x_n) \psi(y,x_2,\cdots,x_n) \, dx_2\cdots dx_n,
$$
what exactly is the physical interpretation of $f$? Alternatively, what is the physical interpretation of $n\cdot f$ (if it's easier to understand)? Please explain in the simplest possible terms, I am trying to wrap my head around it, but struggling.
Answer: This is known as the one-body correlation function, sometimes noted $g^{(1)}(x,y)$. In some way it describes the link between the wavefunction at two different points in space, when tracing over all other particles (in terms of second quantization, it describes the correlation between the field $\psi(x)$ and its conjugate $\psi^{\dagger}(y)$).
For $y=x$ it is equal to the local density up to some prefactor (depending on your normalization of the wavefunction), but as $y$ differs more and more from $x$ it can be thought as a description of how the field at position $x$ affects the field at position $y$.
For systems with long-range order, such as a Bose-Einstein condensate, $g^{(1)}(x,y)$ stays finite when $|x-y| \to \infty$, otherwise it goes to $0$.
Since it can be hard to visualize the meaning of this "field", you can also consider the two-body correlation function, $$g^{(2)}(x,y) = \int \psi^*(x,y,x_3,...,x_N) \psi(x,y,x_3,...,x_N) dx_3 ... dx_N$$
It can be shown that $g^{(2)}$ is linked to the density-density correlations of the system, that is how the presence of a particle at position $x$ affects the probability to find a particle at position $y$. Furthermore, when considering non-interacting Bosonic (resp. Fermionic) systems, $g^{(2)}$ can be reduced in a combination of $g^{(1)}$ terms.
$$\langle n(x) n(y) \rangle \sim g^{(2)}(x,y) = \langle n(x) \rangle \langle n(y) \rangle + \left| g^{(1)}(x,y) \right|^2 \mathrm{(resp. } -\left| g^{(1)}(x,y) \right|^2)$$
Hope that helps.


Meaning of the word "weisure"

Question: Does the word "weisure" has the same meaning as leisure? If not, what is the difference?
Answer: Weisure is a portmanteau formed from work+leisure.It means working while in times of leisure.
Answer: Let me improve a bit the answers already offered.
It seems that the term was coined by Dalton Conley
As already stated by both @user69503 and @jsheeran, it's the merging of work and leisure. I've connected the dots when I though about the term in Spanish: trabajaciones
Here you can find interesting declarations by Conley himself but let me quote an excerpt

what it does mean is more and more Americans are using smartphones and
  other technology to collaborate with business colleagues while hanging
  out with their families

When I read the Spanish equivalent term trabajaciones (trabajo + vacaciones), I though that they were trying to sell us the idea that it's supercool to keep working on weekends and during holidays.
I don't agree with them.
Comment: And then you get the noisy beach neighbor that answers work calls all day long. "Hello? Rocca Speaking..." - We still remember that one after 15 years.
Answer: According to Wiktionary, it's a neologism with the definition:

The merging of work and leisure activities.

The only example it gives is from 2010, and the word doesn't appear to be in common use. I'd certainly never encountered it until reading it in your question.

Meaning of the word "weisure"


What is this measure of error called?

Question: I am investigating prediction errors in a context where the errors can be extremely large. Someone advised me that in addition to reporting the mean or median of the absolute errors $$|\hat{x} - x|$$ that I should also report the mean or median of this quantity:
$$\exp(|\ln(\hat{x}) - \ln(x)|)$$
...the idea being that, for example, an error of twice the true value is treated as being of equivalent magnitude as an error of half the true value. This person referred to this as the "relative error," but Googling "relative error" suggests that this refers to something else. Is there a name for the measure I was advised to report? Or is there a specific subliterature in which this measure is referred as "relative error" (and if so, what subliterature is this, and could I be pointed to an example paper)?
Comment: For an account of relative errors and various ways to define them, see https://stats.stackexchange.com/a/201864/919.  The quantity you ask about is a simple variation of the $d_\infty$ measure in the Wikipedia article.
Answer: @whuber's comment gave me the direction I needed to find additional relevant information on this topic. It seems there are many approaches to calculating relative error. The particular measure I inquired about is the exponential of the absolute value of what has been referred to as the "log change" or the "log difference", and there is a spirited defense of it here:
Törnqvist, L., Vartia, P., & Vartia, Y. O. (1985). How should relative changes be measured? The American Statistician, 39(1), 43-46.

What is this measure of error called?


Record and play louder volume avaudio

Question: I used the tutorial found here to record and playback a sound.  The recording and playback work fine, but I can barely here the sound when I play it back.  I've tried the following code:
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,
                             sizeof (audioRouteOverride),&audioRouteOverride);

I add it to my "play" method, right before I play the sound.  I've also tried to add it to my viewDidLoad.  Both of them make it so I can't here the playback at all.  It seems to be working for others, but where should I add it?
I checked out SpeakHere, Apples example AVAudio app.  The volume is very quiet.  When I use the Voice Memos app, the recording is played back very very loud.  Has anyone been able to play a recorded message and play it back that loud?
Answer: Try setting this property of AVAudioPlayer ...
@property float volume; /* The volume for the sound. The nominal range is from 0.0 to 1.0. */

Record and play louder volume avaudio


What is the difference between apologize and apologise and how could use it in suitable place?

Question: I am confused every time when I am using these words, then using any one of them without knowing its difference. Can anyone help me how could I use these words in appropriate situation?
Comment: There's an ocean of difference -- the Atlantic ocean.
Comment: ... and numerous others closed as duplicates.
Comment: There's no difference at all; there's only a different spelling. They're pronounced the same in both American and British English. If you speak RP, spell it with an S; if you speak American English, spell it with a Z. Anywhere else, use either. But be consistent.
Answer: The alleged American (-ize) vs British (-ise) usage tells an incomplete story, more on which can be found here:
http://www.metadyne.co.uk/ize.html
Suffice to say that the z-form has a long history in English.
To summarise (ha!) my own experience: Whilst at the University of Cambridge in the mid 90s I would consistently rely on the z-form unless the word came directly from French, probably because my dictionary of choice through school was one printed by the Cambridge University Press, I don't know.
After a return to the UK after twenty years in an academic environment in the United States, I have reverted to the s-form, deliberately over-emphasising my Britishness.
Above all else, be consistent.


Second Order Elastic Analysis

Question: When analysing a structure using traditional methods (e.g. Hardy Cross, Slope Deflection, Force Method, etc.), it is a first-order elastic analysis. My question is, how would one analyse a statically indeterminate frame by hand but taking into account the second-order effects. This is more from an academic perspective and that is why I am asking for hand calculations using traditional methods or even direct stiffness method.
Comment: It is not clear what you are asking here. Second-order effects can occur in both statically determinate and indeterminate structures. Also there are many differenent types of second order effects (finite size displacements, infinitesimal displacements with finite size rotations, nonlinear material behaviour, pressure loads whose direction depends on the deformation of the structure, etc, etc...) Even Euler buckling is in some sense a "second order effect".
Comment: Would I be able to take into account the above consideration when completing hand calculations?
Answer: By hand? I believe you have to use matrixes to include all the formulae by superposition, then to solve the matrixes using our friendly Mathematics by hand instead of computer.
Comment: Would you by any chance be able to suggest where I can find the matrices? Is it similar to direct stiffness method?
Answer: After completing some further research, I have come across a few approximate methods which were described in the book: Stability Design of Steel Frames. These include the two-cycle iterative method and modified slope deflection equations which can both analyse statically indeterminate structures while taking into account second-order effects. Thanks for all the answers.

Second Order Elastic Analysis


Which address should I give my registrar NS or SOA?

Question: I'm hosting my apps in amazon ec2 server and using route 53 for hosted zone, I created a Hosted Zone for my domain. I'm wondering which addresses should I provide to my registrar, NS or SOA for primary and secondary DNS?
Comment: You should clarify your question.  It sounds like you are asking about what information to give you registrar in order to use the DNS being hosted by your Amazon EC2 virtual server.  If that is the case, you will need to give them name server names and addresses that point to your DNS server hosted in the Amazon cloud.
Answer: The registry will need the nameservers for your domain and possibly the addresses for those nameservers.
If your domain is example.com, you will need to supply the registrar with the NS records for example.com.
If any of the host-names given for the name-servers are under the example.com domain, e.g. ns1.example.com, you will need to supply the addresses of them separately, often called glue records or host records by the registrar.
You do not need to supply SOA records, since this record type is meant to be answered by authoritative servers, which does not include the registry.


Android Library Project - Error when calling context.getResources().openRawResource()

Question: I'm developing an android library project that should read from an xml file in its raw resources (let's call it xml_file_name.myextension).
What I do is basically  creating a jar file of the library project including these folders:

src
gen
lib
res/raw

and referencing it as a library in a test app. This is the code that I use (inside the library project) in order to get the xml file:
int xml_res_id = -1;

for (Field f : R.raw.class.getFields()) {

  System.out.println("Raw resource found: " + f.getName());
  if (f.getName().equalsIgnoreCase("xml_file_name"))
    xml_res_id = f.getInt(null);

}

if(xml_res_id != -1){
  System.out.println("xml_file_id: " + xml_res_id);
  InputStream is = context.getResources().openRawResource(xml_res_id);
  // Decode xml file with SAXParser..
}

(I have the app context because the app explicitly passes it to the library project.)
What happens is that when I launch the test app (and call the method that reads the xml file) I get this error:

It seems that the xml file is actually in the right folder, because:
1) The for loop actually prints "Raw resource found: xml_file_name.myextension" and "xml_file_id: 2130968576"
2) If I put a file named "xml_file_name.myextension" in the res/raw folder of the app, it does not compile, and the error is: "Error generating final archive: Found duplicate file for APK: res/raw/xml_file_name.myextension". This basically gives me the proof that the
file is correctly "imported" from the library project.
Please Note:
I also tried in this other way
InputStream is = context.getResources().openRawResource(R.raw.xml_file_name);

getting the same error.
I honestly don't understand what could be the problem.. what am I doing wrong?

Edit:
for anyone interested in this issue:
I finally realized that this is not possible, basically because when I try to get a resource through context.anymethod I refer to the R file of the app, so I can't give the resource ID got from the R file of my library project.
It will compile, because the library project jar file contains the resource (R.raw.xml_file), but the call to context.something will always give null as a result because it refers to the app R file, that does not have that particular resource in it.
I finally had to put my xml file in the res/raw folder of the app, and access the xml_file raw resource in this way:
int xml_id = context.getResources().getIdentifier("xml_file_name", "raw", context.getPackageName());

// Getting input stream from xml file
InputStream is = context.getResources().openRawResource(xml_id);

Answer: I have actually done this with success - the library object should be within the app context.  However, it only works with Activity and no other type that I have found.  Using the same library with a FragmentActivity fails with NoClassDefFoundError.
EDIT****
It may work with a FragmentActivity within the same root namespace as the library.  I was accessing from a different root namespace.
END EDIT****
I have a library project that references an xml file:
InputStream is = context.getResources().openRawResource(R.raw.application_table_defs);

when I call the library method that executes the previous line I have to pass in a context:
Context context = this.getContext();

The key is fully qualifying the getResource to context.getResources()... that was injected.


Can Muslims go to war against a secular government for refusing refugees?

Question: Does Islam support Muslims, in a secular country, to go against their government if the government does not allow Muslim refugees (Not for religion reason but for some bureaucratic reasons)?
Comment: Islam doesn't support a secular kind of state.
Comment: Is the question about "war" (which might involve killing people) or simply "going against" (which might involve protesting)?
Comment: @Medi1Saif: Nevertheless muslims do live in secular societies.
Answer: Absolutely Not, they can influence the policymaker or authority by writing, peaceful demonstration and be participating in election etc.
Muslims are also not allowed to go against a Muslim state or just rulers
Answer: On the authority of Abu Sa`eed al-Khudree (may Allah be pleased with him) who said:

I heard the Messenger of Allah (pbuh) say, "Whosoever of you sees an evil, let him change it with his hand; and if he is not able to do so, then [let him change it] with his tongue; and if he is not able to do so, then with his heart — and that is the weakest of faith." (Hadith 34).

As a citizen of a democratic secular state there are allowed avenues of protest - voting out a government, writing to senators, MPs, charities or NGOs, or going on rallies, public meetings and marches - so these are protests of the 'tongue'; citizens who feel more strongly can engage in civil disobedience, and these are generally outside of the law and hence judged by the courts - so these are protests of the 'hand'.
Take for example the history of the Dakota Access Pipeline Protests as a very recent example where one can say all three possibilities were explored: by hand, by tongue & by heart.
Comment: Out of context Hadith. Protests and rebellion is a forbidden act in Islam. Muslims have to accept the decree of the ruler of the nation. He can advise the ruler/Minister in private if he has communication channels. Just because a country allows you to protest and vote, these acts don't become halal for a Muslim.
Comment: @Riyaz: You are being ridiculous. Protests and rebellion is enjoined upon in the Qu'ran as one should "raise one's hand" against "opression". What you are referring to is a theory of kingship in Islam that you seem to know very little about other than the simplest and grossest of cliches.
Answer: I'm not sure how you define "war" on your question. But there a sahih hadith told by Tirmidzi, that moslem can criticize the despotic, tyrant or zalim goverment in a country.
<code>إِنَّ مِنْ أَعْظَمِ الْجِهَادِ كَلِمَةُ عَدْلٍ عِنْدَ سُلْطَانٍ جَائِر
</code>
This hadith has a shaih (hasan) grade. You can look it up from https://sunnah.com/tirmidhi/33/17


Is using a 125VAC Kill-A-Watt (Power meter) on a 220VAC network possible?

Question: A 125VAC Kill-A-Watt has come to my hands, but in my country, the grid operates at 220VAC.
I know I can't use it as-is, but is it possible to modify it to be usable?
Comment: The specs are clearly 125Vac max,  WARNING: Do not exceed maximum ratings as detailed on label.  They do not even show any UL labels on their website even though it appears to be intended for the American market. You might ask techsupport if you can adapt it ( and void the warrranty ) for your own use. firstname.lastname@example.com
Comment: I suspect it is marketing invalid for EU and UK but they only cost $25 at NewEgg. I saw a CETL logo on the back with # 3140244. I wonder if anyone can find out more details?
Comment: You would need to open it up and see what is inside. Maybe you can change the transformer to work on 220VAC- But end of the day it only needs 12V/15V/18VDC to power the internal circuitrty (assumption) So break it open- make a few photos, search the internet for schematics.. or dump it in the bin
Comment: Thanks for the suggestion :) it is still in his wrapping, so maybe I'll try to sell it then
Answer: The kill-a-watt unfortunately does it's own RMS conversion, and does not use a off-the-shelf power monitoring IC or anything.
Also, the controller IC is unfortunately, a epoxy-blob device, so it's not possible to easily reverse engineer it, or even determine what it is. The only IC I could look find the data sheet for in the kill-a-watt I took apart a while ago was a simple quad-op-amp (a LM2902).
Overall, I think it would probably be easier to build your own, rather then try to convert a existing kill-a-watt.
Anyways, no matter what you do, there is really no way to make the voltage readout work properly without a firmware change, so I can't see how useful even swapping some parts would be.

Note the high-quality soldering job. It was like that from the factory.

I did this tear-down a few years ago, and I've been just too lazy to actually post it anywhere.
Answer: Ask sales for availability of the 220Vac unit by email/ It shoukld be easy to adapt with the correct p/n component changes, an adapter cord pair and perhaps an MOV protection clamp with proper HV rated series line 1MOhm resistor.
I believe this may be  the schematic for 220Vac using the same chip used in the 120Vac kill-a-watt.  They are cheap,but how accurate depends on attention to many details.
Answer: Just get an old power meter and connect it.
I have about 10 in my office monitoring several devices and have built a couple of portables for home (using an sturdy extension cord with the meter in the middle).
Knowing the consumption has led me to change old power hungry devices for new efficient ones.
I have sold meters to the utilities for ages, so I had quite a few spare leftover samples to use.


How to install proprietary drivers via CD-ROM on a netbook?

Question: I need to install the internet card drivers on my netbook the problem is that it doesn't have CD tray so I can't install them via the Cd or at least I don't know where to mount the ISO so Ubuntu recognizes it so I can put the Proprietary Drivers. So is there any other way? Or where can I mount the ISO?
Comment: What do you mean by 'privative'? Is this the name of the company/network card or do you mean 'proprietary'? From a dictionary: privative (1) Causing deprivation, lack, or loss.
Comment: oh sorry y mean proprietary, the drivers that are not open-source
Comment: Can you provide more specific details in your question? Are you trying to mount the CD for the proprietary drivers or for Ubuntu? What is the maker of the hardware you're trying to install?
Comment: I want to install the propietary drivers that come on the Ubuntu Cd. I know that the drivers are in the Ubuntu 10.10 cd because when in Software Origins I check the box that says install software from Ubuntu Cd and I go to active the propietary drivers it says that I can active them but it tolds me to insert the Cd, but as I am on a netbook I dont have Cd Tray.
Comment: What is the name and model of your wireless card? Seems odd to me that you have got it on a CD since (unless these are windows drivers used through ndiswrapper) needs to be recompiled at every kernel update. Is'nt it possible to download the drivers from the manufacturers website?
Answer: Try this, taken from here How to use a .iso image as a CD-ROM Repository?
If you want to use the ISO image as a software source without burning it, the process will be a bit more complicated. You will need to open a terminal Applications -> Accessories -> Terminal and run these commands:
sudo mkdir /aptoncd-mountpoint
sudo mount /media/USB/aptoncd.iso ~/aptoncd-mountpoint -oloop
sudo apt-cdrom -d=/aptoncd-mountpoint add
(source: http://www.debianhelp.org/node/10486)
Answer: You can install .deb packages by double-clicking them, so just install them that way from the mounted .iso image?
Answer: When it asks for your cd, you can mount the ubuntu iso from the website, in the way that the other 2 people have told you.
Once it is mounted, you can add the mounted iso in software sources as a software cd. Then you should be able to install from there.
Do you have the option to get internet using an ethernet cable? That would be the easiest option for you.


Add a refinable inside my Search Result Web-part to filter based on the library name

Question: I have 5 document libraries inside my SharePoint online site collection, and i create a search result web part to filer and search documents from the 5 document libraries (the 5 document libraries uses the same content type). but i am not sure if i can add a refinable inside my search result web part, to filter the documents based on their library name or title, i can see there is a managed property for ListID, but not sure if i can user or create a managed property for the List Title/Name?
Answer: There is no refiner that is pointing to document library name. As a workaround you need to create a new hidden column in the document library, give it default library name. Add a managed property tagging this column and then after the crawl add it to the refinement panel. refer here.


Web based tool to explore how different machine learning models perform on my dataset

Question: I'm new to machine learning and want to try a few models on my dataset. I'm looking for a web based tool where I can upload my data (in my case images), select a pre-trained model and then view its performance. Next, I want to retrain the model on my own data or play around with certain parameters. Then I might want to upload other/own models and view its performance. Does anybody know something that could help me with this? For me, it's quite tedious to set up all the different machine learning models on my machine. There are a lot of ML papers that don't provide a proper implementation with a nice setup README. There are issues with different python versions, GPUs and so on. If I just want to play around a bit, this feels like an unnecessary overhead.
Answer: I suggest you to go cloud with Amazon SageMaker.
If you are a student you might have free credits. SageMaker allow you to see if the pattern of your ML is convergent or divergent and alert you if your ML is bringing you no where and stop the calculation.


Why does a '.' work in chown?

Question: Why does GNU chown user.group work? The docs say nothing of the syntax being supported. Is there a juicy story behind it?
Comment: Same question [here](http://serverfault.com/q/194295)
Comment: great example of a question that should have been migrated here.
Answer: info chown is clear on that:
Some older scripts may still use `.' in place of the `:' separator.
POSIX 1003.1-2001 (*note Standards conformance::) does not require
support for that, but for backward compatibility GNU `chown' supports
`.' so long as no ambiguity results. New scripts should avoid the use
of `.' because it is not portable, and because it has undesirable
results if the entire OWNER`.'GROUP happens to identify a user whose
name contains `.'.

In case of GNU programs it's often worth checking not only man but also info pages because GNU folks abhor man pages (from man tar).
Comment: Important historical context: when `chown` first gained the ability to do user and group in a single command (4.3BSD is the earliest such example I can find), people didn't do crazy things like put dots in their usernames. Dots, dashes, capital letters, more than 8 characters long... all unthinkable. Also the colon is the one character that's safe from future growth of the set of allowable usernames, because it's the separator in `/etc/passwd`

Why does a '.' work in chown?


What is the root in word "вынуть"?

Question: What is the root in word "вынуть"?
Answer: Aleks G is right, there are many theories about the structure of this word. Here is the one I like most, it is connected with the history of this word.
From the historical point of view, the root of this word is -им- which, before consonants, has an alternative form -я-. The reason for this alternation is the fact that according to the Law of open syllables a nasal consonant could not be followed by a voiceless stop, like т in the infinitive suffix -ти > -ть, so the Proto-Slavic diphthong *im before voiceless stops became a nasal monophthong *ę which later in Russian changed into я. Thus Old Church Slavonic had an imperfective-perfective pair of words имати - яти (take), these words could be used without prefixes then, but in modern Russian only prefixed forms are used, and there are many imperfective-perfective pairs with the 2 forms of this root, -им- / -я-:

снимать-снять, внимать-внять, обнимать-обнять, поднимать-поднять, взимать-взять, etc. {1}

The -н- between the prefix and the root is also due to historical reasons. The modern prefixes (which derive from prepositions) в- and с- in Old Church Slavonic had the form of *vъn and *sъn and this final -n regulary reoccurs before vowels in modern Russian, both in verbs and before pronouns:

его, but в него, с него

By analogy this -n is used after other prefixes and prepositions, too.
So, taking into the account everything said above, the word, actually, had to have the form *вынять with the imperfective counterpart вынимать, fitting well the word-building pattern {1}. But for some reasons the morpheme boundaries inside the word shifted, the -ня-, which consisted of the last sound of the prefix and the root, got contaminated with the single act suffix -ну-, by analogy with the verbs прыгнуть, вдохнуть, чихнуть, etc.
In modern Russian it is impossible to find the root of this word, but such explanation shows the reason for that and gives us the clue to where the root is hidden.
Comment: +1. An actual answer to the question would be "it has zero root".
Comment: @Quassnoi - Thank you. You know, I'm against the idea of "zero" morphemes, that's why I avoided using the term. If one accepts the existence of zero morphemes, this will entail the need to accept the existence of zero words, which, in turn, will entail the need to compile dictionaries of such words. :)
Comment: Interesting transition from morphemes to words! What is to word as allomorph is to morpheme?
Comment: @Quassnoi The transition from morphemes to words is logical: "books" has a plural marker "-s", "book" is singular, it has a zero morpheme singular marker. "Is not" is negative, it's marked by the word "not", and "is" is positive, it's marked by the zero "not" word. You accept zero morphemes, then you must accept zero words, like "make" is present since it has a zero "will" future marker, and "made" is past since it has a zero "have" perfect marker. The question is if all those zero morphemes and zero words are different or they are the same _zeros_? That's quite interesting to discuss.
Comment: you are talking about zero constituents, not zero words. Concepts of zero subject (*Ты ∅ красивая.*) and zero predicate (*∅ вечереет.*) are universally recognized. "No word" = "zero constituent", just the same as "no morph" = "zero morpheme".
Answer: Вынуть is quite a unique word.  There are multiple theories about its structure.  One of them states that it's

Вы-ну-ть
вы- - prefix
-ну- - root
-ть - suffix (or ending - depending on your favourite theory)

Another one states that it's

Вы-н-уть
вы- - prefix
-н- - root
-уть - suffix

and that word вы-ним-ать has the same root.
According to yet another theory, this word does not have a root at all and only has prefix вы- and two suffixes -ну- и -ть-.  This theory was taught to us in school in 1980s.
Generally, there are loads of discussion on this subject - and specifically this word.  Search google for корень слова вынуть - and you'll see what I mean about theories. (I am assuming that you're ok reading Russian.)
Answer: Here one meets the phenomenon of application. When root ends with the same phoneme as the suffix starts, then the both phonemes fuse into one. In this case underlyingly the root is -н- as seen from the verb "вынь". But it was fused with the suffix -нуть-: вы-н-нуть => вынуть. Now one can consider either root or the suffix deformed by the process of application, or count the last root phoneme as belonging to both root and suffix.
A similar process can be seen in у-сн-нуть => уснуть, об-ман-нуть => обмануть, регби-ист => регбист, такси-ист => таксист
Comment: The common known history of "вынуть" from "вы(н)ять" contradicts to your response, and the latter is quite radical POV. Could you please ground it with authoritative sources?
Comment: @Netch application is the common rule of the language, it happens always. One can say that after н the suffix -нуть becomes -уть.
Comment: There is no original suffix -ну- in "вынуть", it's result of reinterpretation. So the "application" described by you has never happened in this word.
Comment: @Netch you have a misconception that the application is some historical process. It is not. There was no moment when "усннуть" became "уснуть". The application is a language rule,  rather than some historical sound change.
Comment: if you show possible forms with asterisk, you mean some historical form and describe historical process. Maybe "application" is rule, but then you should avoid to describe it as some development.
Comment: @Netch okay i will do
Answer: There is no root in this word. It is one word in all Russian language that has no root.

Вы - prefix
ну - suffix
ть - suffix

ru.wiktionary.org/wiki/вынуть
Answer: Феликс Кривин утверждал что в глаголе "вынуть" исчез корень.
Comment: Спасибо за Ваш ответ. К сожалению, он не содержит никакой новой информации по сравнению с предыдущими ответами.  Постарайтесь избегать дублирования существующей информации.

What is the root in word "вынуть"?


Secure Webservice to write data IN & OUT of sharepoint list

Question: We have a SharePoint 2010 portal running and now we decided to integrate with the existing ERP application. It works like there is a Request generate through SharePoint 2010 custom form and then a NINTEX workflow product takes approvals and finaly send the approved data with request details to ERP...then in next stage INVOICE generates in ERP based on Request and comes to SharePoint invoice custom list library for further workflow processing and write back to ERP.
I designed this as the following
Purchase Request (OUT from SharePoint)
SharePoint (Form)  -----> [ WebService ] ------> ERP
Purchase Invoice (IN to SharePoint from ERP)
SharePoint (Custom List)  <---------------- [ WebService ] <----------------- ERP
I know client object model and how to read/write into list but just don't know how to create a SECURE webservice which access SharePoint environment so it can write back into lists and not every tom dick and harry can access webservice and send parcels ...the webservice should be accessible in a secure way.
What is the industry standard to write such secure services to integrate with SharePoint and other 3rd party products. Is it some kind of WCF based service or SharePoint webservice..or what...would appreciate the guidance.
Answer: Use SSL (https) and secure using account credentials in the workflow context.


Why is PROXY so weary after projecting Vader?

Question: Why does the holographic droid act so weary and 'faint' whenever he finishes delivering a message from Vader to Starkiller? He never acts like that when projecting other things.
Answer: PROXY "hates" impersonating Vader:

Source: Youtube
The disgust PROXY felt at being forced to impersonate such a hated individual is probably strenuous and makes him weary.
Also, Wookieepedia's article on PROXY cites the Star Wars: The Force Unleashed comic to explain why PROXY hated Vader in particular:

PROXY already had issues with the Sith Lord, as he found impersonating him during his frequent communications with Marek highly strenuous, and his realization about the brutality of Vader's methods left PROXY disgusted by him.
Answer: It seems that by projecting Vader, Proxy absorbed some of Vader's extreme negative emotions.

Proxy (on Vader): I hate being him.

Now, it doesn't really make sense why projecting Vader is emotionally draining, while projecting similarly angry beings such as Maul isn't, but it's the best info we've got.


How can I stop Toronto District Schoolboard's's Academic Workspace from intercepting my gmail login on my laptop?

Question: I can access my gmail from my phone, but on my laptop, I'm redirected to tdsb's login. I don't have an account with them, but my daughter does, and her email is connected to mine. How can I regain access to my email?
Answer: You can also ask your student to log into the account, and then from there you will be able to switch between accounts from the user icon at the top right corner of the browser screen.
Answer: Could be a captive portal. Like in malls with public WIFI the first time you have to "log in".


MOS current mirror region of operation

Question:
The mosfet M1 is clearly in saturation as gate and drain terminals are shorted. Why we take M2 also in saturation? I know Vgs1 = Vgs2 and they are identical MOS but i cant justify why M2 should be in saturation, as drain voltage of M2 can be any value..
Comment: Can you share the exact text you're asking about, that says we can assume M2 is in saturation?
Comment: The basic current mirror can also be implemented using MOSFET transistors, as shown in Figure 2. Transistor M1 is operating in the saturation or active mode, and so is M2.
 https://en.wikipedia.org/wiki/Current_mirror
Answer: According to Sedra/Smith text (because textbooks do a better job at explaining things than I do), Microelectronic Circuits, on the subject of basic MOSFET current mirroring:

Now consider transistor \$Q_2\$ (or \$M_2\$ from your picture):  It has the same \$V_{GS}\$ as \$Q_1\$... (from Figure 8.1) For proper operation, the output terminal, that is, the drain of \$Q_2\$, must be connected to a circuit that ensures that \$Q_2\$ operates in saturation... To ensure that \$Q_2\$ is saturated, the circuit to which the drain of \$Q_2\$ is to be connected must establish a drain voltage \$V_o\$ that satisfies the relationship \$V_o \geq V_{GS}-V_{tn}\$.

– Microelectronic Circuits ed. 7 by Sedra and Smith
So in order to have a proper current mirror, we have to assume that the M2 is in saturation. Drain voltage for M2 can be arbitrary (to an extent) with that condition of \$V_o \geq V_{GS}-V_{tn}\$.
Answer: The drain voltage of M2 "can" be of any value but it's only useful as a controlled current sink when Vgs is high enough that the pair functions as a good current mirror.
The compliance voltage for saturation (where the current is mostly constant) is:
Vout > Vgs - Vt  so if you are operating M1 at a current that creates a Vgs only slightly above Vt (in other words, a very low bias current) you can have Vout almost zero and still get constant current.
Here you can see a current mirror compared at 100uA/1mA/10mA and the behavior as Vds increases from 0V to a few hundred mV. At higher currents, the compliance range of voltage is less (you need more Vds to maintain a constant current). Vgs is about 1.41V to 1.73V in this simulation, depending on current.
Answer: If M2's drain voltage drops too low then of course it won't be in the saturation region but, importantly, neither will it be a good current mirror. M2 should have a drain voltage no lower than M1's to ensure it remains in the saturation region but some devices may be able to go lower without entering the triode region too deeply.
The red markers on the curves below show where the diode connected MOSFET M1 sits: -

So there is some scope in some places to drop the drain voltage of M2 below that of the diode connected MOSFET and remain reasonably in the saturation region. It all depends on the particular MOSFET characteristic.
The 2N7000 for instance has a fair bit of leeway to drop below M1's drain voltage: -

No real MOSFETs were harmed in the creation of the above pictures.

MOS current mirror region of operation


Can Congress/anyone sue the President for his agencies' either un/intentional underperformance on their legislative mandates?

Question: The title pretty much sums it up. Is the President not immune to being sued in cases related to his agencies' performance?
Answer: No.
First, who is starting the lawsuit (as long as they have standing) does not make a difference.
Sovereign immunity means that the government (including public officials) cannot be sued unless the government consents to it. The government includes all of the public officers while acting in their functions.
The basic of it is the separation of powers: if the executive power may be sued, it could lead to the judiciary power stepping into the functions of the executive power.
This what somewhat loosened by the Federal Tort Claim Acts, that allows the state to be sued due to tort acts. But even that does not allow to sue for underperfomance (from the article, The FTCA exempts, among other things, claims based upon the performance, or failure to perform a "discretionary function or duty").
Of course, the alternative for Congress is to impeach the president, but that is a political process.
Comment: I may draft a longer answer later, but the notion that sovereign immunity covers public officials is _not_ correct. See Ex Parte Young. The primary way you get around sovereign immunity is by suing other government officials. (Sometimes officials will have specific kinds of immunity, but they are not protected by sovereign immunity except in extremely rare cases).
Answer: You, personally, cannot sue the President or any member of Congress for any act they have done in the service of their office.  You can however, sue the government as a whole for some legislation they have passed or some action an executive agency has committed, so long as you have standing to do so.  You can also sue the President or a member of Congress individually for something they did that was not connected to their official duties, but it can't have anything to do with their job as a public official.  A possible example of this would be if a senator punched a protester at a political rally; that person could sue them for assault
Congress, however, CAN sue the President (and they have done so many times), but the President cannot sue Congress.  This is because in the American system, the President is supposed to act according to the laws Congress passes.  They can hold him responsible for failing to do so, or acting where he did not have authority.  But the President does not participate in the legislative process nor direct the actions of Congress (except to veto bills), so he would never have standing to sue them.
Comment: Just as a note "so long as you have standing" sounds easy, but is exceedingly difficult to fulfill in most cases.


Saving account vs. money market - do my numbers add up?

Question: My savings account has 0.15% APY.  I use it as an emergency fund.  I was thinking about moving much of it to a money market fund.  This fund's expense ratio is 0.64%, and its 5-year total return is 0.24%.  If I understand this correctly, I pay more in expenses than I get in returns, and I'm losing in the long term (if the numbers stay steady).  Am I missing something?
Comment: The total return takes into account the expense ratio. So it's "real" return rate is .88%.
Comment: Just an FYI there are several online banks that offer higher APY (1+%), see discover, synchrony, sallie mae, goldman sachs,....the list goes on
Comment: Another FYI, there are several online banks that offer 6 month CDs at around 2% APY.
Comment: @depperm  - added the united-states tag
Comment: The highest MM rate that I know of with a low minimum deposit is CIT Bank at 1.85%.  For me, it makes no sense to lock it up in a 6 month CD for 15 basis points
Answer: The return being quoted should be net of expenses, so 0.24% would be what you would be getting once the expenses are taken out.  See this answer for more information about the different kinds of returns that might be reported.
Also, similar to what I noted in that other answer, 0.64% is very high for an expense ratio for a money market fund.  Money market funds with expense ratios below 0.20% are easy to come by.
Finally, when comparing a money market fund to a savings account, do note that unlike with the savings account, the returns in a money market fund are not guaranteed.  It is possible for the fund to return less than expected, or even to lose money.  The latter is very rare, but it has happened.
Answer: I would say , shop around. Vanguard VMFXX money market paid 1.18 % over the last year; 1.79% rate this week. ( After what ever tiny fee they have.). With some low risk you can get 10% in REITs.
Comment: @horsehair  it doesn't answer the question.
Comment: @horsehair First sentence good; second sentence sort of OK but possibly misleading in the context the question was asked; last sentence totally undermines the answer as a whole.
Comment: Would someone explain why this is downvoted?
Comment: I use REITs in my Vanguard account as a money market when I want to park money for a few weeks or more , fees are very close to zero. I hate to see banks rip people off.


Sum all numbers in a range

Question: I have implemented the "Sum All Numbers in a Range" challenge from Free Code Camp quoted below.
The code works like a charm, but I don't think it's idiomatic. The challenge hints imply I should be using Math.max(), Math.min() and Array.reduce(). In addition I used the spread operator from ES6 to simplify both Math calls.
I'm looking for a more idiomatic way to solve this. I think it can be done in a one-liner, something like:
return arr.sort((function(a, b) { return a - b; })).reduce(function(a, b) { /* */ });

But I'm pretty sure I'm heading the wrong way with the above.
The challenge:

We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.
The lowest number will not always come first.

The code:
function sumAll(arr) {
  var out = 0;
  for (var i = Math.min(...arr); i <= Math.max(...arr); i++) {
    out += i;
  }
  return out;
}

Test cases:
sumAll([1, 4])
sumAll([4, 1])
sumAll([5, 10])
sumAll([10, 5])

Expected output:
10
10
45
45

Comment: ever heard of Gauss? (https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss#Anecdotes)
Comment: the oneliner you give is very close. in the final function you have a and b being the min and max values. just apply gauss to it: `return (a+b)*(b-a+1)/2;`
Comment: How do you get freecodecamp to use es6?
Comment: @Barry It's not allowed for every challenge for some reason, but on this one it just gave a notification ES6 was required. Nothing else.
Answer: I don't know what you would use reduce() for to be honest. But you don't need to loop. We just have a simple arithmetic sequence with a straightforward formula:
$$\sum_{i=min}^{max} i = \frac{(max-min+1)(min+max)}2$$
We just need to pick out which one is larger:
function sumFrom(min, max) {
    return (max-min+1) * (min+max) / 2;
}

function sumAll(arr) {
    return sumFrom(Math.min(...arr), Math.max(...arr));
}

Or we could generalize to any arithmetic sequence:
function sumArithmetic(a1, n, d) {
    return n*(2*a1 + (n-1)*d) / 2;
}

function sumAll(arr) {
    var min = Math.min(...arr);
    return sumArithmetic(min, Math.max(...arr) - min + 1, 1);
}

I guess if you really want reduce() you'd do it this way (not using ES6 because I don't know how to get freecodecamp to use it):
function sumAll(arr) {
  var min = Math.min.apply(null, arr);
  var max = Math.max.apply(null, arr);

  return Array.apply(null, Array(max-min+1))   // get array of correct size
      .map(function(_, b) { return b+min; })   // change it to have correct values
      .reduce(function(a, b) { return a+b; }); // and sum it
}

Comment: you would use reduce because it is a way to not access the array by indexes.
Comment: $max(a,b)-min(a,b)=|a-b|$, $min+max=a+b$ saves you some steps.
Answer: Like Barry mentioned, you are probably expected to use Gauss and the property of triangular numbers.
reduce is a funny way of accessing your array without touching the indexes, hence without needing to verify that they exist. (consider what would happen if your function was called with [] or [0]).
The one-liner you give is very close. In the final function you have a and b being the min and max values in that order. just apply the sum formula to it: return (a+b)*(b-a+1)/2;
So:
return arr
        .sort((a, b) => a - b)
        .reduce((a, b) => (a + b) * (b - a + 1) / 2);

You'll notice that since the array is size 2 and known to be that way, the complexity is O(1), while if you actually sum the numbers, it becomes O(n) where n is the amount of numbers to add.
Answer: Personally, I'd change out to result. And also the structure in something like the following:
function sumAll(arr){
    var smallest = 0;
    var greatest = 0;

    if(arr[0] < arr[1]){
        smallest = arr[0];
        greatest = arr[1];
    } else{
        smallest = arr[1];
        greatest = arr[0];
    }

    return sumRange(smallest, greatest);
}

function sumRange(from, to){
    var result = 0;

    for(var i = from; i <= to; i++){
        result += i;
    }

    return result;
}

In this way it becomes more readable IMO.
Comment: Javascript does not support ad hoc polymorphism. only the second function exists.
Comment: @njzk2 thanks for pointing that out. Silly mistake. Now it should be ok.

Sum all numbers in a range


Jersey 2 client for StreamingOutput

Question: I have a Jersey service that output binary data as StreamingOutput,  MediaType.APPLICATION_OCTET_STREAM.
How to implement a client using Jersey 2 for handling the response from such service?
Comment: There is a Client API section in Jersey Docs, look at this example: https://jersey.java.net/documentation/latest/client.html#d0e4349
Answer: Below is one way of implementing Jersey 2 client for downloading a file from a REST service which is returning binary data as StreamingOutput with MediaType.APPLICATION_OCTET_STREAM -
    Client client = ClientBuilder.newClient();
    // change SERVER_URL, API_PATH and PATH as per REST API details
    WebTarget webTarget = client.target(SERVER_URL).path(API_PATH).path(PATH);

    Invocation.Builder invocationBuilder = webTarget.request();
    Response response = invocationBuilder.get();

    String contentDispositionHeader = response.getHeaderString("Content-Disposition");
    String fileName = contentDispositionHeader
            .substring(contentDispositionHeader.indexOf("filename=") + "filename=".length()).replace("\"", "");

    InputStream responseStream = response.readEntity(InputStream.class);

    // Set location here where you want to store downloaded file.
    // It will replace the file if already exist in that location with same name.
    Files.copy(responseStream, Paths.get("H:/"+ fileName), StandardCopyOption.REPLACE_EXISTING);

    System.out.println("File is downloaded");

Jersey 2 client for StreamingOutput


Càdlàg process and a predictable stopping time

Question: Let $A_t$ be a predictable càdlàg process, and let $a > 0$. Define
$$ T = \inf \{t \geq 0 : \Delta A_t > a \} \ .$$
I wish to show that $T$ is a predictable stopping time, so we must show that there exists a sequence of stopping times $T_n \nearrow T$ and $T_n < T$ when $T > 0$. My guess is that the sequence is given by
$$T_n = \inf \left\{ t \geq 0 : \Delta A_t > a - \frac{1}{n} \right\} \ .$$
To show that this sequence is increasing, let $\varepsilon > 0$. By the definition of the infimum, we know that there exists $t < T_{n+1} + \varepsilon$, such that $t$ satisfies
$$ \Delta A_t > a - \frac{1}{n+1} \ .$$
We have
$$ \Delta A_t > a - \frac{1}{n+1} > a - \frac{1}{n} \ ,$$
so $t \geq T_n$, and thus we have the inequality $T_n \leq T_{n+1} + \varepsilon$. Since this holds for all $\varepsilon > 0$, we have $T_n \leq T_{n+1}$. One can also show, in the same way, that $T_n \leq T$ for all $n$. I would like to show that
$$ \lim_{n \to \infty} T_n = T,$$
however I am having problems since $A_t$ is only càdlàg. In particular, we have an increasing sequence $T_n$, yet $A_t$ is right continuous, so I am unable to use the right continuity. Any hints?
Comment: you should have a look at George Lowther 's blog he might have results that could help you : https://almostsure.wordpress.com/
Comment: I think that $T_n$ does, in general, **not** converge to $T$. Just consider for instance a Poisson process and $a=1$, then $T=\infty$ but $T_n = \tau_1:= \inf\{t; \Delta A_t = 1\}$ for all $n$.
Answer: $T=\inf\{t\ge 0:\Delta A_t>a\}$ is a predictable stopping time: Since $A$(and $\Delta A$) is a predictable process, $B\stackrel{\text{def}}=\{(t,\omega)\in \mathbb{R}_+\times\Omega:\Delta A_t(\omega)>a\}$ is a predictable set, denote it by $B\in\mathscr{P}$. Since $A$ is càdlàg and $a>0$, there are at most finite numbers of $t$, for which $\Delta A_t>a$, in every finite interval $[0,N]$, this means
that $\Delta A_T>a$ on $\{T<\infty\}$ and
$$ [\![T]\!](=\{(T(\omega),\omega)\in \mathbb{R}_+\times\Omega\})\subset B.$$
Hence $[\![T]\!]=[\![0,T]\!]\cap B\in \mathscr{P}$, since both $[\![0,T]\!]$ and $B$ are predictable sets.   Therefore $T$ is a predictable stoping time.


How do I write my name in traditional Chinese characters (with pinyin)?

Question: I'm starting my first Chinese class in a few days, and I was hoping someone could help me write name in Chinese (with a pinyin transliteration because I can't read Chinese characters yet)? My first name is Ren :D
Comment: @Scharlach Nachtfalter Oh, I see! Thank you for your help!
Comment: Do you know what your full name is?
Answer: The only person with the surname Ren I can think of that is not Japanese or Chinese is Kylo Ren, whose translated name seems to be 凱(Ky)羅(lo)·忍(Ren). However, you probably shouldn't use 忍 (tolerate, withstand) as your name as it is highly unusual and people would probably think you are a chuuni as it is part of the word 忍者 (Ninja)
In Japanese names, Ren can be Kanji such as 蓮 (lotus) and 錬 (smelt), however, the pronunciation is more like Len rather than Ren.
Ren (任) is a Chinese surname, and its pronunciation is also not the same as the original. It probably won't suit your purpose.
If we are talking about characters that are less common in names, 仁 (benevolence, one of the five virtues in Confucianism) is probably also OK?
Answer: The characters pronounced "Ren" in CC-CEDICT are:
<code>人 人 [ren2] /man/person/people/CL:個|个[ge4],位[wei4]/
亻 亻 [ren2] /"person" radical in Chinese characters (Kangxi radical 9)/
仁 仁 [ren2] /humane/kernel/
儿 儿 [ren2] /variant of 人[ren2]/"person" radical in Chinese characters (Kangxi radical 10), occurring in 兒, 兀, 兄 etc/
壬 壬 [ren2] /ninth of the ten Heavenly Stems 十天干[shi2 tian1 gan1]/ninth in order/letter "I" or Roman "IX" in list "A, B, C", or "I, II, III" etc/ancient Chinese compass point: 345°/nona/
忍 忍 [ren3] /to bear/to endure/to tolerate/to restrain oneself/
棯 棯 [ren3] /jujube tree/
稔 稔 [ren3] /ripe grain/
腍 腍 [ren3] /be satiated/cooked/good-tasting/
荏 荏 [ren3] /beefsteak plant (Perilla frutescens)/soft/weak/
荵 荵 [ren3] /polemonium/
仞 仞 [ren4] /(measure)/
任 任 [ren4] /to assign/to appoint/to take up a post/office/responsibility/to let/to allow/to give free rein to/no matter (how, what etc)/classifier for terms served in office, or for spouses, girlfriends etc (as in 前任男友)/
刃 刃 [ren4] /edge of blade/
妊 妊 [ren4] /pregnant/pregnancy/
姙 妊 [ren4] /variant of 妊[ren4]/
恁 恁 [nen4] /to think/this/which?/how? (literary)/Taiwan pr. [ren4]/
牣 牣 [ren4] /fill up/to stuff/
祍 祍 [ren4] /old variant of 衽[ren4]/
紉 纫 [ren4] /to string/to thread (needle)/
紝 纴 [ren4] /to weave/to lay warp for weaving/silk thread for weaving/variant of 紉|纫, to sew/to stitch/thread/
絍 絍 [ren4] /to weave/to lay warp for weaving/variant of 紝|纴[ren4], silk thread for weaving/
肕 肕 [ren4] /old variant of 韌|韧[ren4]/
葚 葚 [shen4] /fruit of mulberry/also pr. [ren4]/
衽 衽 [ren4] /(literary) overlapping part of Chinese gown/lapel/sleeping mat/
袵 衽 [ren4] /variant of 衽[ren4]/
訒 讱 [ren4] /(literary) slow in speech/
認 认 [ren4] /to recognize/to know/to admit/
軔 轫 [ren4] /brake/
靭 韧 [ren4] /variant of 韌|韧[ren4]/
靱 韧 [ren4] /old variant of 韌|韧[ren4]/
韌 韧 [ren4] /annealed/pliable but strong/tough/tenacious/
飪 饪 [ren4] /cooked food/to cook (until ready)/
餁 饪 [ren4] /variant of 飪|饪[ren4]/
鵀 鵀 [ren4] /hoopoe/
</code>
From here, it's possible to choose whatever you consider to be meaningful, and then check http://name.renren.com/ to see if it's actually used, and what gender it's appropriate for.  Taking 忍 (suggested by Scharlach Nachtfalter) for example, if we attach an arbitrary surname 王, we find:

人人网上姓名为 王忍 的用户共有 660人,其中 女生20.45%, 男生79.55%
RenRen Wang users called 王忍 together comprise 660 people, among which 20.45% are female and 79.55% are male.

人人网上姓名为 王忍忍 的用户共有 49人,其中 女生55.10%, 男生44.90%
RenRen Wang users called 王忍忍 together comprise 49 people, among which 55.10% are female and 44.90% are male.

(Note, usually Chinese teachers can help you choose a Chinese name.)


How to neutralize spicy vapors if inhaled during cooking to stop nostril burning sensation and coughing?

Question: Yesterday I did something wrong when adding some pepper flakes into an extremely hot pan with oil. The air around me instantly got spicy, and everyone standing in my kitchen or within its vicinity started tearing up and coughing. I believe I inadvertently created a pepper spray effect, and my nose and throat began to sting. Is there something I can ingest or do to relieve the pain immediately? Is there something I can apply inside my nostrils to alleviate the burning sensation?
Comment: Ok, I'm not writing a full answer but this is not unexpected with really a hot pan. Your pepper flakes will act popcorn-like to some extent.  Yogurt is relieving for hot sensations in your mouth.
Comment: Did the oil spray pepper oils around your nose? Also how much is "some pepper flakes"?
Comment: @CaptainGiraffe about a TSP worth of red chili pepper flakes into the extremely hot oil in a skillet. I don't believe any of the oil went into my nose but the flumes that I breathed in WoW burned!
Answer: I get the same situation repeatedly when preparing stir fry. Fragrant dry spices (like red pepper flakes) intensify in flavor when roasted in hot oil for a short (!) amount of time, lest they burn.
To circumvent the peppery air that can be quite unpleasant if you're not used to it, you could:

not add pepper flakes or other highly aromatic compounds into hot oil at all, but toss them in later with other ingredients that "catch" them, or omit them completely (if you want spiciness that's a bit of a useless answer though)
reduce the temperature of your skillet to medium heat or so; not really that good an answer if you are cooking a wok-style meal that needs the intense heat to quickly fry stuff
turn up your exhaust hood to the maximum; additionally, open a window in your kitchen
gas mask ;-)

But I am not aware of anything that can really draw the peppery vapors out of the air in your kitchen.


Is very high specificity and very low sensitivity attributable to mismatched class sizes?

Question: I've generated a gradient boosting model using r-caret on data which I expect to have little to no predictive value. Class distribution is heavily skewed with ~15000 negative and ~1000 positive. Caret's confusionMatrix function reports a sensitivity of ~0.02 and a specificity of >0.99. How should I interpret this?
Answer: Definitions:
Sensitivity (SEN) is defined as TP/(TP+FN). It represents the ratio of positive samples labeled correctly out of all the positive samples.
Similarly, Specificity (SPC) is defined as TN/(TN+FP), which is the ratio
 of negative samples labeled correctly out of all negative samples.
Now, you have a 15:1 negative:positive samples ratio. A very naive algorithm, which always returns "False" regardless of the sample given, would naturally produce SPC=1 and SEN=0. A random algorithm, which returns "True" 1% of the time (regardless of the sample given) and "False" 99% of the time, would produce on average SEN=0.01 and SPC=0.99. This means that your model is pretty much in the range of a random model, and not very useful for classification.
Try oversampling (or better, get more positive data) to improve the model.