Can we use Normal Equation for Logistic Regression ?

Question: Just like we use the Normal Equation to find out the optimum theta value in Linear Regression, can/can't we use a similar formula for Logistic Regression ? If not, why ? I'd be grateful if could someone could explain the reasoning behind it. Thank You.
Comment: Some relevant discussion on [stats.stackexchange.com](http://stats.stackexchange.com/questions/949).
Answer: Unfortunately no, only two methods in classification theory have closed form solutions - linear regression and linear discriminant analysis/fischer discriminant.
In general it is considered a miracle that it "works" even for linear regression. As far as I know it is nearly impossible to prove that "you cannot solve logistic reggresion in closed form", however general understanding is that it will not ever be the case. You can do it, if your features are binary only, and you have very few of them (as a solution is exponential in number of features), which has been shown few years ago, but in general case - it is believed to be impossible.
So why it worked so well for linear regression? Because once you compute your derivatives you will notice, that resulting problem is set of linear equations, m equations with m variables, which we know can be directly solved through matrix inversions (and other techniques). When you differentiate logistic regression cost, resulting problem is no longer linear... it is convex (thus global optimum), but not linear, and consequently - current mathematics does not provide us with tools strong enough to find the optimum in closed form solution.
That being said there exists (absolutely impractical computationally) closed form solution if all your input variables are categorical (they can only take finitely many values that you can enumerate): https://www.tandfonline.com/doi/abs/10.1080/02664763.2014.932760?journalCode=cjas20
Comment: Thank you for explaining that. Can you suggest any material where I can read more about it ?
Answer: Yes, if we develop a mathematical model to solve the differentiated form of cost function which is case of linear regression is 'matrix' and its inverses. But no such tool is available in this uptil now. So till now a big NO.
Answer: Yes, but im not sure on to what extent.
This works for binary logistic regression.
Note that we are dealing with logistic regression and not linear regression.
So if we use normal equation as it is, which supposed to be used for linear regression, the solution of theta would only be for y = 0s, not both 1s and 0s.
The correct solution is to make the binary logistic term y of 1s and 0s into linear terms. It is quite simple,
from logistic function y in terms of theta * x:
y = 1/( 1 + e**(-thetax))  #corresponds to linear regression y=thetax
to thetax in terms of y:
thetax = -ln(1/y -1)
This means, in normal equation's y of [0  1] into [-inf inf]. Since inf term is not applicable in normal equation, we can use approx [-99999 99999]. The close the better.
In short, from y=[0s 1s] to y=[-999s 999s].
Comment: Can you share a source that explains this in detail?


How to determine the language of a piece of text?

Question: I want to get this:
Input text: "ру́сский язы́к"
Output text: "Russian"

Input text: "中文"
Output text: "Chinese"

Input text: "にほんご"
Output text: "Japanese"

Input text: "العَرَبِيَّة"
Output text: "Arabic"

How can I do it in python?
Comment: this may help http://stackoverflow.com/questions/4545977/python-can-i-detect-unicode-string-language-code
Comment: Nicely summarized here https://stackoverflow.com/a/48436520/2063605
Comment: Maybe see also https://github.com/topics/language-identification?l=python
Answer: 1. TextBlob. (Deprecated - Use official Google Translate API instead)
Requires NLTK package, uses Google.
from textblob import TextBlob
b = TextBlob("bonjour")
b.detect_language()

pip install textblob
Note: This solution requires internet access and Textblob is using Google Translate's language detector by calling the API.
2. Polyglot.
Requires numpy and some arcane libraries, unlikely to get it work for Windows. (For Windows, get an appropriate versions of PyICU, Morfessor and PyCLD2 from here, then just pip install downloaded_wheel.whl.) Able to detect texts with mixed languages.
from polyglot.detect import Detector

mixed_text = u"""
China (simplified Chinese: 中国; traditional Chinese: 中國),
officially the People's Republic of China (PRC), is a sovereign state
located in East Asia.
"""
for language in Detector(mixed_text).languages:
        print(language)

# name: English     code: en       confidence:  87.0 read bytes:  1154
# name: Chinese     code: zh_Hant  confidence:   5.0 read bytes:  1755
# name: un          code: un       confidence:   0.0 read bytes:     0

pip install polyglot
To install the dependencies, run:
sudo apt-get install python-numpy libicu-dev
Note: Polyglot is using pycld2, see https://github.com/aboSamoor/polyglot/blob/master/polyglot/detect/base.py#L72 for details.
3. chardet
Chardet has also a feature of detecting languages if there are character bytes in range (127-255]:
>>> chardet.detect("Я люблю вкусные пампушки".encode('cp1251'))
{'encoding': 'windows-1251', 'confidence': 0.9637267119204621, 'language': 'Russian'}

pip install chardet
4. langdetect
Requires large portions of text. It uses non-deterministic approach under the hood. That means you get different results for the same text sample. Docs say you have to use following code to make it determined:
from langdetect import detect, DetectorFactory
DetectorFactory.seed = 0
detect('今一はお前さん')

pip install langdetect
5. guess_language
Can detect very short samples by using this spell checker with dictionaries.
pip install guess_language-spirit
6. langid
langid.py provides both a module
import langid
langid.classify("This is a test")
# ('en', -54.41310358047485)

and a command-line tool:
$ langid < README.md

pip install langid
7. FastText
FastText is a text classifier, can be used to recognize 176 languages with a proper models for language classification. Download this model, then:
import fasttext
model = fasttext.load_model('lid.176.ftz')
print(model.predict('الشمس تشرق', k=2))  # top 2 matching languages

(('__label__ar', '__label__fa'), array([0.98124713, 0.01265871]))

pip install fasttext
8. pyCLD3
pycld3 is a neural network model for language identification. This package contains the inference code and a trained model.
import cld3
cld3.get_language("影響包含對氣候的變化以及自然資源的枯竭程度")

LanguagePrediction(language='zh', probability=0.999969482421875, is_reliable=True, proportion=1.0)

pip install pycld3
Comment: You actually don't have to deal with the whole Polyglot package if language detection is the only thing you need. As [stated in the docs](https://polyglot.readthedocs.io/en/latest/Detection.html), the detection is done by [pyCLD2](https://github.com/aboSamoor/pycld2), which is very simple and easy to use library.
Comment: @Anwarvic TextBlob uses Google API (https://github.com/sloria/TextBlob/blob/dev/textblob/translate.py#L33)! that why it's slow.
Comment: `polyglot` ended up being the most performant for my use case. `langid` came in second
Comment: There is also [pyCLD3](https://github.com/bsolomon1124/pycld3).
Comment: `detectlang` is way faster than `Textblob`
Comment: I had very good results with pyCLD3 even on short snippets of my strange native tongue.
Comment: For anyone trying polyglot, apart from the libraries mentioned, I had to install the following libraries to make the import work: through pip - pycld2 & through conda and their dependencies - pyicu, morfessor
Comment: This is a model answer
Comment: pyCLD3 is likely the best option of these. Accurate/fast with its word embedding approach while being much easier to use than fasttext, which requires a separate model, doesn't support paragraphs, etc.
Comment: Pretty crazy, TextBlob fails with "HTTP Error 429: Too Many Requests"
Comment: `guess_language` repository on bitbucket seem to have disappeared. So I made a rewrite of the library at https://github.com/alvations/spirit-guess, hope it helps!
Comment: Good tip on fasttext. Just tried it and it's pretty good. Seems to preform better on longer passages than shorter ones.
Comment: textBlob need to fix an error https://stackoverflow.com/questions/69173608/why-do-i-get-an-http-error-404-when-using-textblob
Comment: fasttest is very heavy, but langdetcet is very light and smart.
Answer: Have you had a look at langdetect?
from langdetect import detect

lang = detect("Ein, zwei, drei, vier")

print lang
#output: de

Comment: Not very accurate - detects language of text 'anatomical structure' as `ro`(Romanian). Multiple language output required for such cases. polyglot performs much better.
Comment: Interesting, for the same example `langdetect` can determine different languages :-)
Comment: Is not accurate, detects "god is love" as hr that is Croatian
Comment: for some reason, langdetect is given errors, I am using Python 3.6
Comment: @DenisKuzin I am getting romanian only for "anatomical structure". Wonder if you can share the langdetect version you are using?
Comment: `langdetect` is actually broken if operated in a loop and you don't reset the text buffer between loops. https://github.com/Mimino666/langdetect/issues/77
Answer: @Rabash had a good list of tools on https://stackoverflow.com/a/47106810/610569
And @toto_tico did a nice job in presenting the speed comparison.
Here's a summary to complete the great answers above (as of 2021)

Language ID software
Used by
Open Source / Model
Rule-based
Stats-based
Can train/tune

Google Translate Language Detection
TextBlob (limited usage)
✕
-
-
✕

Chardet
-
✓
✓
✕
✕

Guess Language (non-active development)
spirit-guess (updated rewrite)
✓
✓
Minimally
✕

pyCLD2
Polyglot
✓
Somewhat
✓
Not sure

CLD3
-
✓
✕
✓
Possibly

langid-py
-
✓
Not sure
✓
✓

langdetect
SpaCy-langdetect
✓
✕
✓
✓

FastText
What The Lang
✓
✕
✓
Not sure
Comment: Thank you for your answer, according to your experience which one gives the most accurate/ and fast results for detecting sentences that are written in english?
Comment: https://pypi.org/project/fasttext-langdetect/
Comment: https://github.com/adbar/py3langid
Answer: If you are looking for a library that is fast with long texts, polyglot and fastext are doing the best job here.
I sampled 10000 documents from a collection of dirty and random HTMLs, and here are the results:
+------------+----------+
| Library    | Time     |
+------------+----------+
| polyglot   | 3.67 s   |
+------------+----------+
| fasttext   | 6.41     |
+------------+----------+
| cld3       | 14 s     |
+------------+----------+
| langid     | 1min 8s  |
+------------+----------+
| langdetect | 2min 53s |
+------------+----------+
| chardet    | 4min 36s |
+------------+----------+

I have noticed that a lot of the methods focus on short texts, probably because it is the hard problem to solve: if you have a lot of text, it is really easy to detect languages (e.g. one could just use a dictionary!). However, this makes it difficult to find for an easy and suitable method for long texts.
Comment: `polyglot` language detection is based on `pycld2`, that is not that fast all in all. Or is there a way to use it to identify the language in a kind of a batch mode? I have only tried handling sentence by sentence.
Comment: I mean, I check languages of millions of separate documents that are all one line strings. That is slow with pycld2.
Comment: I assume that the long text is in the same language. I read the 10000 documents and keep them in memory. For fastextcc I have to remove the `\n` characters, but not for polyglot (cdl2 results were pretty much the same, I tested it  as well). I don't understand why you think polyglot is slow, It was the fastest. Do you think I should have removed the `\n` as well, and that my results just reflect the first sentence (i.e., before the first `\n`)
Comment: I see, I don't think there is a way to do that. You have to do it one by one. Depending on where your documents are stored you migh be able to use the multiprocessing capabilities. Also, I ended using fasttextcc because I was having some troubles with asian language encodings.
Comment: In my case, most of the documents were long, and a benchmark might look very different with short sentences.
Comment: But what was the success ratio in recognising the language. Parsing the text is one thing, getting the correct outcome another one. If you get 10k document parsed incorrectly in 14s with cld3, I prefer wait 4 mins and use chardet.
Comment: @Andrea, they all should be quite solid options for long texts; as I mentioned the language detection problem is only difficult when the texts are short.  Of course, the quality also depends on your collection,. You will always need to manually tag a random subset of your documents to evaluate the accuracy. I bet most of the "misclassifications" will appear on short texts and/or multi-language texts. Some of this methods will also offer you a confidence/probability value that you can use to cut off noisy texts.
Answer: There is an issue with langdetect when it is being used for parallelization and it fails. But spacy_langdetect is a wrapper for that and you can use it for that purpose. You can use the following snippet as well:
import spacy
from spacy_langdetect import LanguageDetector

nlp = spacy.load("en")
nlp.add_pipe(LanguageDetector(), name="language_detector", last=True)
text = "This is English text Er lebt mit seinen Eltern und seiner Schwester in Berlin. Yo me divierto todos los días en el parque. Je m'appelle Angélica Summer, j'ai 12 ans et je suis canadienne."
doc = nlp(text)
# document level language detection. Think of it like average language of document!
print(doc._.language['language'])
# sentence level language detection
for i, sent in enumerate(doc.sents):
    print(sent, sent._.language)

Comment: I followed your answer, but I think I am still getting the same speed as with the `langdetect`. I have a DF column with texts, I am using `column.apply()` with a function doing `scipy_langdetect`. Any suggestions?
Comment: You need to use a parallel library to be able to take advantage of the parallelization of the function like [`dask`](https://dask.org), otherwise it wouldn't make any difference.
Comment: What is the issue with parallelization?
Comment: I don't remember exactly what was the issue but when I wanted to use `langdetect` library for `dask` parallelization it threw an exception but `spacy_langdetect` worked fine.
Answer: You can use Googletrans (unofficial) a free and unlimited Google translate API for Python.
You can make as many requests as you want, there are no limits
Installation:
$ pip install googletrans

Language detection:
>>> from googletrans import Translator
>>> t = Translator().detect("hello world!")
>>> t.lang
'en'
>>> t.confidence
0.8225234

Comment: This Method is Great but I have gone ahead and implemented it commercially, it is unstable as after 1-5K Converts you have to change your IP Address. This Interface can be made useful by using a proxy list or an automated VPN change after 100 Converts, in the code, I hope that this helps any one of you trying to implement this. :)
Answer: I would say lingua.py all the way. It is much faster and more accurate than fasttext. Definately deserves to be listed here.
Installation
poety add lingua-language-detector

Usage
from typing import List
from lingua.language import Language
from lingua.builder import LanguageDetectorBuilder
languages: List[Language] = [Language.ENGLISH, Language.TURKISH, Language.PERSIAN]
detector = LanguageDetectorBuilder.from_languages(*languages).build()

if __name__ == "__main__":
    print(detector.detect_language_of("Ben de iyiyim. Tesekkurler.")) # Language.TURKISH
    print(detector.detect_language_of("I'm fine and you?")) # Language.ENGLISH
    print(detector.detect_language_of("حال من خوبه؟ شما چطورید؟")) # Language.PERSIAN

Comment: I have tried detect_language_of method and it was the slowest out of all previous options for me.
Answer: Pretrained Fast Text Model Worked Best For My Similar Needs
I arrived at your question with a very similar need. I found the most help from Rabash's answers for my specific needs.
After experimenting to find what worked best among his recommendations, which was making sure that text files were in English in 60,000+ text files, I found that fasttext was an excellent tool for such a task.
With a little work, I had a tool that worked very fast over many files. But it could be easily modified for something like your case, because fasttext works over a list of lines easily.
My code with comments is among the answers on THIS post. I believe that you and others can easily modify this code for other specific needs.
Answer: Depending on the case, you might be interested in using one of the following methods:
Method 0: Use an API or library

cld2-cffi
Google Cloud Translation - Basic (v2)
TextBlob
langdetect
etc.

Usually, there are a few problems with these libraries because some of them are not accurate for small texts, some languages are missing, are slow, require internet connection, are non-free,... But generally speaking, they will suit most needs.
Method 1: Language models
A language model gives us the probability of a sequence of words. This is important because it allows us to robustly detect the language of a text, even when the text contains words in other languages (e.g.: "'Hola' means 'hello' in spanish").
You can use N language models (one per language), to score your text. The detected language will be the language of the model that gave you the highest score.
If you want to build a simple language model for this, I'd go for 1-grams. To do this, you only need to count the number of times each word from a big text (e.g. Wikipedia Corpus in "X" language) has appeared.
Then, the probability of a word will be its frequency divided by the total number of words analyzed (sum of all frequencies).
the 23135851162
of  13151942776
and 12997637966
to  12136980858
a   9081174698
in  8469404971
for 5933321709
...

=> P("'Hola' means 'hello' in spanish") = P("hola") * P("means") * P("hello") * P("in") * P("spanish")

If the text to detect is quite big, I recommend sampling N random words and then use the sum of logarithms instead of multiplications to avoid floating-point precision problems.
P(s) = 0.03 * 0.01 * 0.014 = 0.0000042
P(s) = log10(0.03) + log10(0.01) + log10(0.014) = -5.376

Method 2: Intersecting sets
An even simpler approach is to prepare N sets (one per language) with the top M most frequent words. Then intersect your text with each set. The set with the highest number of intersections will be your detected language.
spanish_set = {"de", "hola", "la", "casa",...}
english_set = {"of", "hello", "the", "house",...}
czech_set = {"z", "ahoj", "závěrky", "dům",...}
...

text_set = {"hola", "means", "hello", "in", "spanish"}

spanish_votes = text_set.intersection(spanish_set)  # 1
english_votes = text_set.intersection(english_set)  # 4
czech_votes = text_set.intersection(czech_set)  # 0
...

Method 3: Zip compression
This more a curiosity than anything else, but here it goes... You can compress your text (e.g LZ77) and then measure the zip-distance with regards to a reference compressed text (target language). Personally, I didn't like it because it's slower, less accurate and less descriptive than other methods. Nevertheless, there might be interesting applications for this method.
To read more: Language Trees and Zipping
Answer: I have tried all the libraries out there, and i concluded that pycld2 is the best one, fast and accurate.
you can install it like this:
python -m pip install -U pycld2

you can use it like this:
isReliable, textBytesFound, details = cld2.detect(your_sentence)

print(isReliable, details[0][1]) # reliablity(bool),lang abbrev.(en/es/de...)

Answer: Polygot or Cld2 are among the best suggestions because they can detect multiple language in text. But, they are not easy to be installed on Windows because of "building wheel fail".
A solution that worked for me ( I am using Windows 10 ) is installing CLD2-CFFI
so first install cld2-cffi
pip install cld2-cffi

and then use it like this:
text_content = """ A accès aux chiens et aux frontaux qui lui ont été il peut
consulter et modifier ses collections et exporter Cet article concerne le pays
européen aujourd'hui appelé République française.
Pour d'autres usages du nom France, Pour une aide rapide et effective, veuiller
trouver votre aide dans le menu ci-dessus.
Welcome, to this world of Data Scientist. Today is a lovely day."""

import cld2

isReliable, textBytesFound, details = cld2.detect(text_content)
print('  reliable: %s' % (isReliable != 0))
print('  textBytes: %s' % textBytesFound)
print('  details: %s' % str(details))

Th output is like this:
reliable: True
textBytes: 377
details: (Detection(language_name='FRENCH', language_code='fr', percent=74,
score=1360.0), Detection(language_name='ENGLISH', language_code='en',
percent=25, score=1141.0), Detection(language_name='Unknown',
language_code='un', percent=0, score=0.0))

Answer: I like the approach offered by TextBlob for language detection. Its quite simple and easy to implement and uses fewer lines of code. before you begin. you will need to install the textblob python library for the below code to work.
from textblob import TextBlob
text = "это компьютерный портал для гиков."
lang = TextBlob(text)
print(lang.detect_language())

On the other hand, if you have a combination of various languages used, you might want to try pycld2 that allows language detection by defining parts of the sentence or paragraph with accuracy.
Answer: You can try determining the Unicode group of chars in input string to point out type of language, (Cyrillic for Russian, for example), and then search for language-specific symbols in text.
Answer: If the language you want to detect is among these...

arabic (ar)
bulgarian (bg)
german (de)
modern greek (el)
english (en)
spanish (es)
french (fr)
hindi (hi)
italian (it)
japanese (ja)
dutch (nl)
polish (pl)
portuguese (pt)
russian (ru)
swahili (sw)
thai (th)
turkish (tr)
urdu (ur)
vietnamese (vi)
chinese (zh)

...then it is relatively easy with HuggingFace libraries and models (Deep Learning Natural Language Processing, if you are not familiar with it):
# Import libraries
from transformers import pipeline
# Load pipeline
classifier = pipeline("text-classification", model = "papluca/xlm-roberta-base-language-detection")
# Example sentence
sentence1 = 'Ciao, come stai?'
# Get language
classifier(sentence1)

Output:
[{'label': 'it', 'score': 0.9948362112045288}]

label is the predicted language, and score is the assigned score to it: you can think of it as a confidence measure.
Some details:

The training set contains 70k samples, while the validation and test
sets 10k each. The average accuracy on the test set is 99.6%

You can finde more info at the model's page, and I suppose that you could find other models that fit you needs.
Answer: You can install the pycld2 python library
pip install pycld2

or
python -m pip install -U pycld2

for the below code to work.
import pycld2 as cld2

isReliable, textBytesFound, details = cld2.detect(
    "а неправильный формат идентификатора дн назад"
)

print(isReliable)
# True
details[0]
# ('RUSSIAN', 'ru', 98, 404.0)

fr_en_Latn = """\
France is the largest country in Western Europe and the third-largest in Europe as a whole.
A accès aux chiens et aux frontaux qui lui ont été il peut consulter et modifier ses collections
et exporter Cet article concerne le pays européen aujourd'hui appelé République française.
Pour d'autres usages du nom France, Pour une aide rapide et effective, veuiller trouver votre aide
dans le menu ci-dessus.
Motoring events began soon after the construction of the first successful gasoline-fueled automobiles.
The quick brown fox jumped over the lazy dog."""

isReliable, textBytesFound, details, vectors = cld2.detect(
    fr_en_Latn, returnVectors=True
)
print(vectors)
# ((0, 94, 'ENGLISH', 'en'), (94, 329, 'FRENCH', 'fr'), (423, 139, 'ENGLISH', 'en'))

Pycld2 python library is a python binding for the Compact Language Detect 2 (CLD2). You can explore the different functionality of Pycld2. Know about the Pycld2 here.
Answer: The best way to determine the laguage of a text is to implement the following function:
from langdetect import detect

def get_language(text):

    keys =['ab', 'aa', 'af', 'ak', 'sq', 'am', 'ar', 'an', 'hy', 'as', 'av', 'ae', 'ay', 'az', 'bm', 'ba', 'eu', 'be', 'bn', 'bi', 'bs', 'br', 'bg', 'my', 'ca', 'ch', 'ce', 'ny', 'zh', 'cu', 'cv', 'kw', 'co', 'cr', 'hr', 'cs', 'da', 'dv', 'nl', 'dz', 'en', 'eo', 'et', 'ee', 'fo', 'fj', 'fi', 'fr', 'fy', 'ff', 'gd', 'gl', 'lg', 'ka', 'de', 'el', 'kl', 'gn', 'gu', 'ht', 'ha', 'he', 'hz', 'hi', 'ho', 'hu', 'is', 'io', 'ig', 'id', 'ia', 'ie', 'iu', 'ik', 'ga', 'it', 'ja', 'jv', 'kn', 'kr', 'ks', 'kk', 'km', 'ki', 'rw', 'ky', 'kv', 'kg', 'ko', 'kj', 'ku', 'lo', 'la', 'lv', 'li', 'ln', 'lt', 'lu', 'lb', 'mk', 'mg', 'ms', 'ml', 'mt', 'gv', 'mi', 'mr', 'mh', 'mn', 'na', 'nv', 'nd', 'nr', 'ng', 'ne', 'no', 'nb', 'nn', 'ii', 'oc', 'oj', 'or', 'om', 'os', 'pi', 'ps', 'fa', 'pl', 'pt', 'pa', 'qu', 'ro', 'rm', 'rn', 'ru', 'se', 'sm', 'sg', 'sa', 'sc', 'sr', 'sn', 'sd', 'si', 'sk', 'sl', 'so', 'st', 'es', 'su', 'sw', 'ss', 'sv', 'tl', 'ty', 'tg', 'ta', 'tt', 'te', 'th', 'bo', 'ti', 'to', 'ts', 'tn', 'tr', 'tk', 'tw', 'ug', 'uk', 'ur', 'uz', 've', 'vi', 'vo', 'wa', 'cy', 'wo', 'xh', 'yi', 'yo', 'za', 'zu']

    langs = ['Abkhazian', 'Afar', 'Afrikaans', 'Akan', 'Albanian', 'Amharic', 'Arabic', 'Aragonese', 'Armenian', 'Assamese', 'Avaric', 'Avestan', 'Aymara', 'Azerbaijani', 'Bambara', 'Bashkir', 'Basque', 'Belarusian', 'Bengali', 'Bislama', 'Bosnian', 'Breton', 'Bulgarian', 'Burmese', 'Catalan, Valencian', 'Chamorro', 'Chechen', 'Chichewa, Chewa, Nyanja', 'Chinese', 'Church Slavonic, Old Slavonic, Old Church Slavonic', 'Chuvash', 'Cornish', 'Corsican', 'Cree', 'Croatian', 'Czech', 'Danish', 'Divehi, Dhivehi, Maldivian', 'Dutch, Flemish', 'Dzongkha', 'English', 'Esperanto', 'Estonian', 'Ewe', 'Faroese', 'Fijian', 'Finnish', 'French', 'Western Frisian', 'Fulah', 'Gaelic, Scottish Gaelic', 'Galician', 'Ganda', 'Georgian', 'German', 'Greek, Modern (1453–)', 'Kalaallisut, Greenlandic', 'Guarani', 'Gujarati', 'Haitian, Haitian Creole', 'Hausa', 'Hebrew', 'Herero', 'Hindi', 'Hiri Motu', 'Hungarian', 'Icelandic', 'Ido', 'Igbo', 'Indonesian', 'Interlingua (International Auxiliary Language Association)', 'Interlingue, Occidental', 'Inuktitut', 'Inupiaq', 'Irish', 'Italian', 'Japanese', 'Javanese', 'Kannada', 'Kanuri', 'Kashmiri', 'Kazakh', 'Central Khmer', 'Kikuyu, Gikuyu', 'Kinyarwanda', 'Kirghiz, Kyrgyz', 'Komi', 'Kongo', 'Korean', 'Kuanyama, Kwanyama', 'Kurdish', 'Lao', 'Latin', 'Latvian', 'Limburgan, Limburger, Limburgish', 'Lingala', 'Lithuanian', 'Luba-Katanga', 'Luxembourgish, Letzeburgesch', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Maltese', 'Manx', 'Maori', 'Marathi', 'Marshallese', 'Mongolian', 'Nauru', 'Navajo, Navaho', 'North Ndebele', 'South Ndebele', 'Ndonga', 'Nepali', 'Norwegian', 'Norwegian Bokmål', 'Norwegian Nynorsk', 'Sichuan Yi, Nuosu', 'Occitan', 'Ojibwa', 'Oriya', 'Oromo', 'Ossetian, Ossetic', 'Pali', 'Pashto, Pushto', 'Persian', 'Polish', 'Portuguese', 'Punjabi, Panjabi', 'Quechua', 'Romanian, Moldavian, Moldovan', 'Romansh', 'Rundi', 'Russian', 'Northern Sami', 'Samoan', 'Sango', 'Sanskrit', 'Sardinian', 'Serbian', 'Shona', 'Sindhi', 'Sinhala, Sinhalese', 'Slovak', 'Slovenian', 'Somali', 'Southern Sotho', 'Spanish, Castilian', 'Sundanese', 'Swahili', 'Swati', 'Swedish', 'Tagalog', 'Tahitian', 'Tajik', 'Tamil', 'Tatar', 'Telugu', 'Thai', 'Tibetan', 'Tigrinya', 'Tonga (Tonga Islands)', 'Tsonga', 'Tswana', 'Turkish', 'Turkmen', 'Twi', 'Uighur, Uyghur', 'Ukrainian', 'Urdu', 'Uzbek', 'Venda', 'Vietnamese', 'Volapük', 'Walloon', 'Welsh', 'Wolof', 'Xhosa', 'Yiddish', 'Yoruba', 'Zhuang, Chuang', 'Zulu']

    lang_dict = {key : lan for (key, lan) in zip(keys, langs)}

    return lang_dict[detect(text)]

Let's try it:
>>> get_language("Ich liebe meine Frau")

... 'German'


SCORM Integration With local DB

Question: I have a PHP web application, I need to integrate SCORM with my application.I know that there is cloud option for integrating SCORM. But our requirement is that saving course details into our local DB.
Please help me.
Comment: this is not very well defined question(vague). Try to edit it and ask better (I tried it like this but it doesn't work).Otherwise you ganna get bad score for wrong question
Answer: You have a couple options for integrating SCORM content into standalone (web or otherwise) applications.
One is SCORMCloud (www.scorm.com), which gives you an integration API.  They have PHP based plugins for both WordPress and Drupal, which you can use as a guide.
SCORMCloud has a couple of methods based whereby you can bring your learner data back into your database.
When a course launch is finished, SCORMCloud will redirect back to your website.  At that point, you can hit the SCORMCloud API and fetch the results of your launch, and write that back to your database.
Our company (www.aura-software.com) produces an application integration framework for cloud based elearning sources (Vimeo, SCORMCloud, TinCan LRSs) called Bright CloudConnect.  Depending on what your integration requirements were, it can perform the same functions and a few others.  Enabling trackable elearning in existing applications is Bright's primary function.

SCORM Integration With local DB


Does every finite dimensional subspace of any normed linear space have a closed linear complement?

Question: Let $Y$ be a finite dimensional subspace of a real NLS $X$ and let $Y=span \{y_1,...,y_n\} $ ; then by Hahn-Banach theorem ,  we can find continuous linear functionals $l_1,...,l_n \in X^*$ such that $l_j(y_k)=\delta_{jk}  ; j,k=1,...,n $ ( where $\delta_{ij}$ is the Kronecker delta ) , and consider $Z_j :=\ker l_j$ , then each $Z_j$ is a closed linear subspace , then so is $Z=\cap_{j=1}^n Z_j$ , now I can prove that $Y\cap Z=\{O\}$  my question is , Is it true that $X=Y+Z$ ?
Answer: Yes. We need to express $x\in X$ as a sum $x= y+z$ where $y\in Y$ and $z\in Z$.
Fix $x\in X$. By choice of the $l_j$'s, letting $c_j=l_j (x)$, and writing $y = \sum_j c_j y_j$, it follows that for any $j_0$,
$$l_{j_0} (y) = c_{j_0} l_{j_0}(y_{j_0})+ \sum_{j\ne j_0} l_{j_0} (c_j y_j)=  c_{j_0} =l_{j_0} (x).$$
Now  $z= x-y$, then from the equality above, we have that $ l_{j_0} (z) =0$ for all $j_0$, that is $z \in Z$.
This completes the proof.
Answer: Let $x\in Y$. Then $x=\langle l_1, x\rangle y_1 + \ldots + \langle l_n, x\rangle y_n$. If $x\in Z$, then $\langle l_1, x\rangle = \ldots = \langle l_n, x\rangle = 0$, so $x=0$. The reverse inclusion is immediate, so $Y\cap Z=\{0\}$. Now, define a map $P\colon X\to X$ by $$Px = \langle l_1, x\rangle y_1 + \ldots + \langle l_n, x\rangle y_n\;(x\in X).$$
Clearly $Y$ is the range of $P$ and $P^2=P$. We have $I=P+(I-P)$ and the range of $I-P$ is precisely $Z$.
Comment: Thanks for your valuable answer
Comment: The norm of P here is n right? Can we get a projection of norm 1 ?
Comment: I mean if Y is finite dimensional normed space of a Banach space , then can we say that Y is complemented by a projection that has norm equal to one ?  Can we find such a projection
Comment: @SaraSuradi, no. If every 2-dimensional subspace is 1-complemented, then the space is isometric to a Hilbert space. The best constant you can get in general is $\sqrt{\dim Y}$ (this is the Kadets-Snobar theorem).


Removed air lock ,while in the first day of fermentation

Question: Can any damage be done when air lock is removed for about 3 to5 minutes. I repitched yeast this morning.what can I expect?
Answer: Don't worry, your beer or wine will be fine.
Of course you have air in your fermenter anyway, and air always has some wild yeasts and bacteria. But when you pitch your yeast, it quickly overpowers anything else that may be in there. It uses up the oxygen and creates alcohol, making the whole environment unfriendly to many other microbes.
Besides later keeping wild yeast and bacteria out, the airlock also blocks insects like fruit flies, which can be attracted by the fermentation. You probably didn't get a bunch of flies in your fermenter in 3 to 5 minutes, and even if you did, you can just take them out when you bottle or keg.
Comment: I agree. A short time rarely does any harm.
Comment: I havent used an air lock for years.  just good sanitation and a clean environment. RDWAHAHB
Comment: Yes airlock is makes sense after fermentation begins to slow..
Answer: "What can I expect?"
Beer.
Seriously, let's step through this: Normal air is about 78% Nitrogen which has an atomic mass of about 14.  CO2 has an atomic mass of about 44.  CO2 is much heavier than air.  So, there will be a cushion of CO2 under any air that got into your fermenter, as long as you didn't agitate it.
Comment: Atomic mass is very different from density (or specific weight, the gravity-dependent version of density), which is what determines what sinks or rises when two bodies of liquids (or gasses) are in contact. CO2 and Oxygen are very similar, so a good amount of mixing does occur, but, and here you're correct: not enough to damage beer.
Comment: Just as a helpful way to think of it: oleic acid (80% of olive oil) has a molecular weight of 282.468 g/mol, water has a molecular weight of 18.015 g/mol. The oil floats on top of the water.
Comment: What could happen if i agitated the Wort
Comment: Sloshing your wort (or any liquid) allows the nearby gas to dissolve into it.  It'll also remove the CO2 cushion from the air resting on top of it. This will let Oxygen into your wort. That said, it's not only perfectly fine but, encouraged to agitate your wort before pitching yeast.
Comment: My findings are that I used a lot of Fermentables. Which sometimes don't show the High Kruzen phase of fermentation.


How to make chocolate cigarellos in a quicker way?

Question: I wanted to make chocolate cigarellos from scratch and looked it up but all I could find was this, which the author describes as being time consuming. Can someone suggest any other way to make them that might be quicker?
Comment: They are going to be fundamentally time consuming to make, especially without automated equipment.  You can buy them ready made from various sources.  One example:  http://www.chocolatetradingco.com/buy/dark-chocolate-cigarellos
Comment: @SAJ14SAJ: I was wondering if someone has tried to make them in plastic straws and how would you make the ends from being runny
Answer: One thing you can do is use much longer pieces of acetate and cut the long cigarillos afterwards gently with a hot knife.  That way your spreading and rolling action is cut down to 1/2 or 1/3.


View and/or Export all versions of a SharePoint List

Question: I'm using SharePoint 2016 and need to analyze all the versions of a list.  How do I export all the versions into an excel file or access the versions in another way to do some analysis (using PowerBI)?  Not individual records, all records, all versions.
Answer: You should be able to extract version history of individual items using PowerShell.
This script is a good starting point. You may need to adjust the script to your likings:
https://gallery.technet.microsoft.com/office/Test-bb3ed1ca


Proof of Poincaré algebra with Poisson bracket

Question: I'm trying to prove that the generators of Poincaré group in Poisson bracket close the well-known Poincaré algebra. In particular, I don't know how to prove that $\{P_\mu,P_\nu\}=0$.
Let's take an infinitesimal translation in space-time, such that
$$
x^\mu\rightarrow x'^\mu=x^\mu+\epsilon^\mu\Rightarrow\delta x^\mu=\epsilon^\mu
\\\phi(x)\rightarrow\phi'(x)=\phi(x-\epsilon)=\phi(x)-\epsilon^\mu\partial_\mu\phi(x) \Rightarrow \delta_0\phi(x)=-\epsilon^\mu\partial_\mu\phi(x)
$$
and suppose that our physical system has an action which is invariant under this translation
$$
\delta S|_{off-shell}=0
$$
From Noether's theorem we know that we have a conserved charge, so in this case we have 4, one for each direction. And we also know that these charges are the components of the four-momentum
$$
P^\mu=\int_\sigma d\sigma_\nu T^{\nu\mu}(x)
$$
where $d\sigma_\nu=n_\nu d\sigma$ ($n_\nu$ is the vector normal to the space-like surface $\sigma$) and $T^{\mu\nu}=\pi^\mu\phi^\nu-\mathcal Lg^{\mu\nu}$ is the stress-energy tensor ($\pi^\mu=\frac{\partial \mathcal L}{\partial\partial_\mu\phi}$ and $\mathcal L$ is the Lagrangian density). We also know that this quantity can be thought as the generator of the transformation, meaning that, if we call $F\equiv-\epsilon^\mu P_\mu$, we have
$$
\delta_0\phi=\{\phi,F\} \Rightarrow \partial_\mu\phi=\{\phi,P_\mu\}
$$
At this point I'm supposed to be able to say that $\{P_\mu,P_\nu\}=0$, but I don't know how to prove it with the means that I have. I think that, since $P_\mu$ does not depend on the particular point that I want to translate, it doesn't depend on $x$, so this could be a proof, but is it the only one? I'd like to prove it mathematically if it is possible.

Edit: In Roman, Introduction to QFT, page 77, the author says that also $J_{\mu\nu}$ (Lorentz generators) is coordinate-independent and he also uses this to prove the relation for $\{J_{\mu\nu},J_{\sigma\rho}\}$, and he claims that by saying that it follows from the definition (as he says for $P_\mu$), but

Once again, how this follows from the definition? Both $P_\mu$ and $J_{\mu\nu}$ are defined as an integral in $d\sigma_\mu$ over a space-like surface of a current density. But this is true for every generator, so are all generators always coordinate-independent? Do all of them commute with $P_\mu$? It doesn't seem true to me. For example, it is not true for $\{P_\mu,J_{\sigma\rho}\}=g_{\mu\rho}P_\sigma-g_{\mu\sigma}P_\rho$.
If, like Roman says, $J_{\mu\nu}$ is coordinate-independent, than $\{J_{\sigma\rho},P_\mu\}=\partial_\mu J_{\sigma\rho}=0$, but we know that $\{J_{\sigma\rho},P_\mu\}=-\{P_\mu,J_{\sigma\rho}\}\neq 0$, so how is that possible? Am I misunderstanding something?
Answer: I'm not sure if you are stymied by language or subtleties of the abstract generalization you are seeking. By way of a hint, I'll just review the free scalar field, flat-space case you no doubt learned in your first week of CFT, namely,
$$
\pi=\partial_0 \phi, \\
P^i = \int d^3x ~T^{0 i} (x)=\int d^3x ~\pi(x) \partial_i \phi(x) \\
P^0= \int d^3x ~(\pi^2 +(\partial_i \phi)^2 )/2,
$$
so that, directly,  given $\{ \phi(x),\pi(y)\}=\delta^3(x-y)$,
$$
\{ \phi(x), P^i\}= \partial_i \phi(x), \\
\{ \phi(x), P^0\}= \pi (x) =\partial_0 \phi(x), \\
\{ P^\mu, P^\nu \} = 0.
$$


Example of a calculus optimization problem where the answer occurs at an endpoint

Question: I'm teaching optimization problems in calculus right now. An easy example would be something like: Find the dimensions of a rectangle with perimeter $100$ m whose area is as large as possible. The goal would be to find the value of $x$ that maximizes $$A(x) = x(\frac{100-2x}{2}) = x(50 - x),$$ where $x \in [0, 50].$ When working over a closed interval, I teach them to find the critical points, and then evaluate $A(x)$ at the critical points and also the endpoints of $[0, 50].$ They know that critical points aren't necessarily absolute max's or min's, so that's why they need to check the endpoints as well. My question is if there are any examples of some optimization problems where the absolute max or absolute min occurs at the endpoints of a closed interval. Every time we do these problems, the answer is always at the critical point, and it makes the last step of checking the endpoints seem pointless.
Comment: I assume you mean application-ish examples? Generally this will mean that somehow there is no tradeoff to making $x$ as large or small as possible, so this amounts to situations like a profit function where the revenue per unit always exceeds the cost per unit. Or else that there is a tradeoff but it only comes into play outside the domain that you're limited to.
Comment: Yes that's the idea
Comment: Just keep your existing applications. The maximum of a convex function over a convex set occurs at the boundary, so as long as the objective function is nonlinear, you can always pick a sense (max or min) such that the optimal solution is at the boundary.
Answer:
The height of an object above the surface of the water is modeled by the function $$h(t)=-t^3+5t^2-8t+4$$
  On the interval $t\in[0,3]$, when was the object furthest above the water?  Furthest underwater?

Critical numbers are $t=\frac43, 2$.  Test and compare $h(0), h(\frac43), h(2), h(3)$ to get extreme values.
The object is furthest above the water at $t=0$ and is furthest underwater at $t=3$.
Answer: Suppose your rectangle is limited to having width $\leq 20$ (i.e., same maximization problem but $x\in[0,20]$). Now the maximum will occur at the endpoint $x=20$. This example may be unsatisfactory since now the critical point doesn't even lie in the interval, but you can easily cook up an example where the critical points do occur inside the interval yet the extrema are on the boundary. For instance, finding the maximum and minimum of $y=x^3-x$ on $[-2,2]$.


Downloading Public Test Realm Client

Question: I have a fully updated retail client of Diablo 3 installed. I have downloaded the public test realm (PTR) installer. When I run this installer, it starts to download and indicates it needs 15GB of free hard drive space. Does the PTR installer download the entire game again, or just the latest (PTR) patch?
Answer: The PTR client is completely separate from the standard D3 client, so it will have to be a separate install.  Once you've installed it once, any future PTR patches will be downloaded just the same like the normal servers.
Comment: @sabrewolfy its the same as reinstalling a entirely separate diablo 3 client, so you'll have to basically redownload all of diablo 3
Comment: But does installing the PTR download a DVDs-worth of data? Like downloading 4 or 8GB?
Comment: I recently saw a post describing a way to avoid this large initial PTR download. It involved copying the D3 live client data to the PTR folder and then updating, along with some other steips. If I find the link, I'll post it here.

Downloading Public Test Realm Client


Shalom Bayit vs. Making shabbat bread

Question: If someone has the option to fix their marriage and save it or make bread for Shabbat (which would put fixing the relationship on hold) which one should be the priority?
Comment: This seems like such an unusual choice to have to make that it's highly unlikely a source already discusses it.
Comment: What is the practical application of such a situation? I am very confused.
Comment: @ezra Weird stuff happens in some marriages. Some women really despise bakery challah, or maybe are allergic to certain ingredients or can't spend the money or time to buy it. I know - some stuff makes my eyes spin in their sockets, but, Some of these problems are quite real in marriages. You have to pick your fights.
Answer: I'm afraid your question assumes a great deal of information we don't have here, and would really best be addressed to a competent rabbi in-person.
But for theory's sake: assuming one could easily buy bread -- if baking it from scratch themselves would cause a strain on their marriage, then they shouldn't do that and should instead buy.
Baking bread from scratch is a nice-to-have that could maybe be a fulfillment of "doing extra to honor Shabbat." There's been a recent resurgence in treating baking as a big ritual thing. But keeping peace in the home is even more important, and was in fact the main reason the Sages instituted lighting candles on Friday night.
Now: if someone has only one candle on the Friday afternoon of Hanukkah, the Talmud (Shab 23b) says better to light it inside as a Shabbat candle, than light it outside as a Hanukkah candle, as having it inside will promote family harmony, which is more important than declaring the miracle to the world (outside).
And same thing with the wine for the qiddush:

נר ביתו וקדוש היום, נר ביתו עדיף, משום שלןם ביתו

"[If one has to choice between Friday's night] candle and [to make] the qiddush, candle is better, because of house harmony."
From this source, the preference is even over no wine at all to say qiddush on it.

Shalom Bayit vs. Making shabbat bread


How can I disable the End key for all operating systems(Windows and Linux)

Question: I noticed an issue in my Laptop recently, everytime I opened a webpage it would auto scroll to the bottom of the page. Initially I thought the PageDown key might be stuck, and so I googled for similar errors, finally I used Passmark Keyboard Test and it turned out the End Key was getting randomly pressed, so I guess it is stuck and I cant get it "unstuck". So I used Sharpkeys and turned off the End key and now Windows 10 has no issues.
My main issue is that I use both Ubuntu(64bit) and Windows 10, and this issue still persists on Ubuntu and also Grub menu when the system boots up. I think this is because the Sharpkeys fix uses registry. Is there any way to deactivate the End key for all the operating systems or like a hardware disable such that it doesnt get clicked even for the Grub boot menu?
Any help is appreciated :)
Comment: The permanent fix would be to replace the faulty keyboard all together. If you're on laptop, then you could unplug the keyboard from its socket and just use external keyboard.
Answer: Sounds like a mechanical problem with your keyboard. I'd try cleaning or even replacing the keyboard.
Comment: Yeah, I guess it is, just wanted to find a temporary fix by disabling the key, I did it for windows but wanted to know if I can universally disable a key in the System. Is it possible to get a keyboard replaced at a Lenovo Service Center? I really dont trust in replacing it myself.
Comment: Laptop keyboard replacements are straightforward. Any computer shop will do it for you, but you might have to wait until they get the right keyboard in stock.
Answer:
Is there any way to deactivate the End key for all the operating systems or like a hardware disable such that it doesnt get clicked even for the Grub boot menu?

No.  This is not a standard feature of the BIOS.  Software like Grub tends to be rather focused on the minimal tasks that the software performs.  In truth, the developers of such software tend to do a rather impressive job of cramming such functionality into a rather small number of bytes.  Playing around with an option like "disable one key" is probably not widely supported by boot loaders, although maybe (and this is a big "maybe") such functionality might be supported by some larger boot loaders (like grub) as part of internationalization efforts.  So, if the software supports different keyboard layouts, maybe another layout might treat the keyboard scan code of the "End" key as something different (which might get ignored).  However, you might also end up breaking some other keys (perhaps especially the arrow keys, and maybe even something important like the Enter key).
Even if you could break the End key in grub, each operating system probably assumes that it has the job of starting to support hardware, including keyboard support.  That is the common behavior.  Operating systems may assume that earlier code, such as the BIOS and boot loader, provided only very minimal support of the hardware, and that the operating system (including any drivers that get used) may typically provide support that is equal or superior to the simplistic software used during the earlier parts of the system boot process.  Therefore, to provide the best experience for end users, operating systems are typically designed to not handle this task without relying too much on the configuration details provided by earlier parts of the system.
The end result is that you will likely need to find a solution for every single operating system that you use.  (The good news is that if you can solve this for the operating system, most software will trust the operating system, so once you have this set in an operating system, you won't need to go around re-configuring most pieces of software.)
Note: My information is based on some dated technologies, like BIOS.  (U)EFI might provide some functionality that I haven't read up on, so if the world does offer a glimmer of hope that my answer is wrong, then I think (U)EFI may be the glimmer you may want to further research.  Even if (U)EFI does have some functionality, different operating systems might provide different amounts of support for such a setting.  So if you spend your time researching information for the operating systems you desire to use, you might be better off anyway.  If (U)EFI doesn't provide you a solution, I suspect the widely-used standards may not typically provide you wish any other solution.
Comment: Thanks alot for the information, I'll check if I can get the keyboard repaired or something. Can you suggest some links which explain how to disable a key in Ubuntu? I can manage the Grub menu even with the problem by keeping the arrow key pressed and changing, and I have a temporary fix for Windows.
Comment: (I'm not planning to answer your question for Ubuntu anytime soon.  If you don't get more feedback, consider making a separate Ubuntu-specific question here on SuperUser or, even better, on [Ask Ubuntu](http://askubuntu.com), which is another Stack Exchange site.)


Why was this question seeking empirical evidence closed 'as primarily opinion-based'?

Question: In For long-term savings: Short-term Bond ETFs vs High-interest Savings Accounts, I specifically asked for academic empirical evidence.
Answer: Note that the question has now been deleted by the Community user under the standard cleanup policies for old, closed questions.
It described competing strategies for investing in short-term bond ETFs versus high-interest savings accounts and ended by asking:

But what do the empirical evidence and academic studies prove? Which is recommended?

"Primarily opinion-based" is often a judgement call - some questions do require some degree of subjective judgement to answer, but still aren't primarily opinion-based. However I think this question does fall on the wrong side of the line.
It's unlikely that there will be clear cut empirical evidence or academic studies that prove anything. In the end any answer will be someone's opinion about which is better, even if an informed, academic opinion.
Another possible problem with the question is that it's inviting a list of academic resources, and list questions are discouraged on StackExchange.
I think it might be possible to ask a question about this area and keep it on-topic, perhaps by asking a more direct question that focuses on concrete trade-offs rather than asking which is better. For example, someone commented on your question:

Recommended for what? The two approaches trade different amounts of risk for different returns.

I think a question about the relative risks and returns of the two investments would be on-topic. The answers to such a question would be reasonably factual, rather than coming down to an explicit recommendation of one strategy over another.
Comment: Thanks for your constructive advice, because of which would you like to edit my OP?
Comment: I suggest you do the editing as you understand what you actually want to know. I've undeleted the question so other users can see it.
Comment: Thank you for your help. I just edited the OP. Better?
Comment: OK, I've cleaned it up a bit more and reopened it.
Comment: Many thanks for your helpfulness!


Qt delegate module of a QTreeView, delegate non-top widgets only?

Question: I use Qt's delegate module for a QTreeView, but this works for both top-level widget and non-top ones, is it possible to control this behavior ? Just delegate for non-top widgets only
Answer: I'm sure you already know that you can set a delegate for a given column or a given row.  However, the easier way might be to inherit your delegate from whichever Qt one makes sense.  In the delegate functions, you should be able to check the model index's parent and see if it is the same as the tree view's root index.  If it is, it is a top level item, and then you could call the parent class's functions.  Otherwise, implement your own for the non-top level widgets.


what tools can be used to perform automation and performance testing

Question: We have a SFDC application and as a functional tester I would like to know what tools can be used to automate the test scripts. Need to test UI as well as the functional requirements of application. Can I use QTP, selenium to achieve this. Or is there better tool given by SFDC?
Answer: For automating testing and builds in general, I would try Jenkins:
http://blogs.developerforce.com/developer-relations/2013/03/setting-up-jenkins-for-force-com-continuous-integration.html
Which has a Selenium plugin too:
https://wiki.jenkins-ci.org/display/JENKINS/Selenium+Plugin
tbh, discussions around automated UI testing always seem to gravitate around Selenium.  There are other options, but it is a good place to start.
For fine tuning (not auto) UI perfomance, I would look at using either Chrome or FireFox's built in development tools as well as the View State inspector in Visualforce:
http://developer.force.com/releases/release/Winter11/View+State+Inspector
Comment: Autotuning is not fine, you mean?
Answer: Selenium is a good choice if you are planning concurrent testing.
http://www.slideshare.net/developerforce/df121279-patterson-randy-changes
This is an excellent slide to refer.Load runner can be used for load testing.
http://en.wikipedia.org/wiki/Apache_JMeter
Jmeter is a free tool that can be used for testing .You may also engage salesforce for performance testing.Fiddler is another excellent tool
Comment: I'd be careful about using something like JMeter directly on Salesforce to load test.  SF does their own loading testing and [states that it is unnecessary](http://www.salesforce.com/us/developer/docs/dev_lifecycle/Content/test.htm).  Like you said, it would be a good idea to contact them first.  Don't want to get into trouble, multi-tenant environment, etc.
Comment: Completely agree that involving salesforce in load testing is a better approach
Answer: Disclaimer: I work for Provar, a Salesforce test automation product (www.provartesting.com). I will give an honest answer but of course I am biased :)
I worked for a Salesforce consultancy for many years implementing Salesforce projects. Salesforce doesn't have any native options for test automation (this was why Provar was created in the first place). So your options are:

use something like Selenium, QTP and build it yourself
use a specialised 3rd party product.

There are big overheads to writing and maintaining your own framework. In general we recommend against writing code when implementing Salesforce itself, because it is more time-consuming and difficult to maintain than configuration. But granted there are also overheads to 3rd party products. consider what is the best strategy for your business, but be prepared for some kind of overhead either way.
In my opinion a good Salesforce test automation solution should be the following:

does not require code to use
allows you to run test cases across different environments and browsers without requiring changes to the test case
can handle minor cosmetic changes without tests breaking (e.g. moving fields on a page layout or Visualforce page)
can test advanced elements like Visualforce and Service Cloud console (even if you don't use these elements now: you may want to in future, and it's a good test for product capability)
can be connected to other systems such as databases and email integrations, as this will help you to do true end-to-end testing instead of just Salesforce
can generate reports automatically
is Lightning compatible (Lightning is the new Salesforce UI - if your business is considering a future move to this UI, invest in a product that will allow you to run tests in both UIs)

Our tool, Provar, does all of these. But actually I recommend you avoid taking product recommendations from individuals on this thread as you will be bombarded with marketing messages :) so take a look at the suggestions, but also do your own googling for 'salesforce test automation' and compare the tools yourself depending on what you want.
Answer: Perhaps AssureClick (AppExchange) is what you are looking for: functional tests, deployment and security testing. No coding required.
Generates Apex test code which can be leveraged in the code.
See www.ext-it.com
Not a free app, though.
Comment: Do you work for them by chance? If so you edit your answer to disclose that.
Answer: Another option for staging and configuring your existing Salesforce data Test Data Architect (TDA).  You can extract the SF data objects/columns of your choice and then configure the tests you need based on data attributes. It would pair very well with any UI solution out there like Selenium to serve as a reusable data foundation.
http://www.testdatarchitects.com/
Answer: Please check out ATTEST for your UAT/BAT and Integration Testing needs. It is available in AppExchange with a free trial. ATTEST helps you to easily test not only your Salesforce Applications but also other applications in your enterprise including Oracle Applications, SAP, Workday etc.
Disclosure: I am CEO and Co-founder at Entegration Software
Answer: Check out ITAS for Salesforce. It is totally scriptless plug and play solution for functional test case automation, performance and regression testing. It has cloud based version and in minutes can scale up and down load. Literally automate Salesforce testing in hours! ITAS is already on Salesforce AppExchange.
http://fusionsystemsinc.com/salesforce/
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000DpSm7EAF


how to symetrize a part of the mesh in its normal orientation/position in edit mode?

Question: how can i symmetrize this mesh in this position? i mean to do it by the median point and by the normal orientation rather than local or global transforms orientation, in this case in the X axis in normal orientacion or custom orientation in this case. because i need to symmetrize in that position the selected mesh of the object, but i have notice that symmetrize option in b3d only works by the object´s median point and global axis, no i cant perform this in this exact position and orientation, so does someone know some trick to preform this action in edit mode?
Answer: In general:

Establish your Pivot (transform origin, somewhere in the mirror plane). This probably involves ShiftS snapping the 3D Cursor to a known point, or the median of some selection, and setting the 'Pivot' to 'Cursor'.
Establish your Transform Orientation, either using the View, or more likely a Custom Orientation (the '+' at the right of the Transform Orientation dropdown). For example, it could be the normal of a face: select the face, and create an orientation from it. Z in that orientation will now be the direction of the face's normal.
ShiftD duplicate your part..
SZ-1 scale the duplicate by -1 in the appropriate axis of your custom orientation, about your pivot.

You may have to ShiftN, turn the mirrored duplicate right-side-out.
Comment: shift+n does not do anything in b3d 2.81?
Comment: yeah it worked the another else thing you said but still its a bit inacurate and not a quick way to do it, there should be a free addon for this already...


How to use Opera Mobile Widget

Question: I face a problem in running Opera Mobile Widget. I try to download .wgt files from widgets.opera.com but I cannot run them on my mobile device. First, I try to run them on my Apple ipod 4, then on Android mobile phone and both the devices have Opera installed. However, it is impossible to run the widget. Please let me know the reason why and how to run the widgets. Any help is appreciated.
Answer: Widgets do not run in Opera Mobile or Mini. However, you can run them on Android using this Labs build of the Opera widgets runtime: http://dev.opera.com/articles/view/labs-widget-runtime-wac-1-0-compliant-golden-for-android/

How to use Opera Mobile Widget


In a polyhedron with vertices, if a vertex has two basic feasible basis, is there a redundant inequality?

Question: We consider a polyhedron $P = \{ x \in \Bbb R^n \mid Ax \leq b\} \neq \emptyset$, $A \in \Bbb R^{m \times n}$, $b \in \Bbb R^m$, $A$ with full column rank. With those hypotheses, we know that $P$ has vertices.
Each vertex $v \in P$ can be described by a set of rows of $A$ indexed by $B \subseteq \{1, ..., m\}$, called a basic feasible basis, such that $\lvert B \rvert = n$, the submatrix $A_B$ (the rows from $A$ indexed by $B$) has full rank, and $A_Bv = b_B$.
We have degeneracy when a vertex can be described by two different basis. If this happens, does it mean that $P$ has at least one redundant inequality (i.e. one that can be deduced from the others) ? If not, what hypotheses should we add to avoid degeneracy ?
Answer: The answer is yes: degeneracy implies at least one redundant constraint. See the link in this answer for an example.


How to make Notepad++ open each file in new window?

Question: There is -multiInst launch parameter that lets you open more than one instance of Notepad++, but how to make it launch a new window every time when I click on "Edit with Notepad++" or "Open With..." shell context menu?
Comment: Notepad++ is a decent text editor, but its "settings" page is just horrible.
Comment: see Settings->Preferences->Multi-instances->Default (mono-instance) tab
Answer: create a totally empty file called 'asNotepad.xml' and put it in the Notepad++ directory at the same level as the notepad++.exe file
Comment: Thanks, that worked. Why not just put it as an option...
Comment: This is still not quite what I want. This totally obliterates the tabs. I still want documents to open in tabs when I go to file->open, I just want a new window when I open it from the explorer.
Comment: no idea as I am not the developer just a pro at Googling, perhaps there was some legal issue with having it act like Notepad? That seems unlikely though..
Comment: most open source developers add features based on what the user base requests or what they feel is most important for usability and stability. If you want it as an option, request it from the developers.
Comment: @MatthewScouten: would http://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/1859159 help?
Comment: Hint to create the file on cmd: 1) run as administrator (right click) 2) `type NUL > EmptyFile.txt`
Comment: Note: when this was asked 10 years ago there wasn't an option. There now is, in the Settings page, for Multi Instance mode which does what the OP wanted.
Comment: @TheStudent - In Total Commander, place the cursor on notepad++.exe then press Shift+F4  to create an empty file named "notepad++" :)
Answer: I was just looking for the same thing.
You can change the shell's file type settings to make this work.
My computer still has XP on it, so here's how to configure XP.
Windows Vista/7 will be different but similar.

Open Explorer Menu Tools | Folder Options...
Tab File Types
Scroll and select TXT Hit Advanced...   (If missing, hit Restore and the
button turns into Advanced.)
(Edit File Type Dialog)
Select action 'open', hit Edit...
"Application used to perform action" is the command line that is used to open the
file.

"C:\Program Files\Notepad++\notepad++.exe" "%1" -nosession -multiInst

I added the switches -nosession and -multiInst so that when I open up Notepad++ from the start menu, it re-opens my session files.  But opening a file from explorer opens in a new window, and doesn't get added to my session.
Answer: Settings -> Preferences -> Multi-instance
Right click on filename in tab, choose "Move to other view" for split screen.
Comment: Do you know the difference between the settings "Always open in mulit-instance mode" and "Open session in a new instance"?  Official help file not really clear and real-world behavior not any clearer.
Answer: Another way to get multiple windows is to simply drag a tab onto the desktop and a new instance of NP++ will start, with that tab in it (you can drag as many as you want).
Clicking on a file associated with NP++ will open that file in the last active NP++ window.
Also there is a tab context menu, right click a tab and you will see 'Move to new instance' and 'Open in new instance'. Both start a new instance of NP++.
'Move...' closes the tab in the current instance and opens file, that was in that tab, in a tab in the new instance (i.e. a 'move'). 'Open..' starts a new instance but keeps the file open in both instances.
Comment: Excellent, that saved me a lot of troubles :)
Answer: Noticed in v6.6.9 that it's possible to set shell options when installing the extension:
 regsvr32 /i nppshell_06.dll

Answer: Rather then modifying existing functionality I created a new right click command 'Edit with Notepadd++ in new window' for any type of file.

Create a new key as per below export, or copy the context into a blank.reg and double click it.
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Notepad++]
@="Edit with Notepad++ in new window"

[HKEY_CLASSES_ROOT\*\shell\Notepad++\command]
@="C:\\Program Files\\Notepad++\\Notepad++.exe %1 -multiInst -nosession"

Answer: I like to reuse a Notepad++ window only explicitly by dragging a file over one of the existing Notepad++ windows. Otherwise, every time I click on the Notepad++ icon or open a file, I want a new window.
Here is how I do this: I've added -multiInst to the Notepad++ shortcut, so a new window pops up every time I open Notepad++.
Then I've also added -multiInst to the (Default) value under the following regkey:
HKEY_CLASSES_ROOT\Applications\notepad++.exe\shell\open\command\
...so that every time I open a file, it opens in a new window.
Answer: recently I got same problem.
As I think the easiest way is to write simple .bat file something like this:
...
SET var1="C:\Users\churaev.s\Desktop\a01_strt.bat"
SET var2="C:\Users\churaev.s\Desktop\b02_code.mat"
SET var3="C:\Users\churaev.s\Desktop\c03_data.txt"
...
START "" "C:\Program Files (x86)\Notepad++\notepad++.exe" %var1%
START "" "C:\Program Files (x86)\Notepad++\notepad++.exe" %var2%
START "" "C:\Program Files (x86)\Notepad++\notepad++.exe" %var3%
...
Answer: Another option that I discovered looking at the Registry Editor on windows:
HKEY_CLASSES_ROOT/*/shellex

There should one of the following folders:

ANotepad++64
Notepad++64

Now, on both of then the "Default" key should have the GUID of the registry to run, copy this value and search for it, select the "Settings" subkey:
Notepad++ RegKey values
Edit "Custom" to have the same options as the image, if you wanted with session, don't add the "-nosession" flag.


Is it considered retaliation for an organization to reject an applicant who has sued or filed a complaint against someone in the organization?

Question: Is it considered retaliation for an organization to reject an applicant who has sued or filed a complaint against someone in the organization?
Answer:
If One Files an Official Complaint Against or Sues a University, Is It Retaliation if They Reject Your Application?

Not necessarily. Retaliation has to do with the criterion that prompts an adverse decision, not the decision itself. You are asking about the event of rejection itself, which might be lawful nonetheless.
You mention that you are a good candidate academically. That might not suffice, though, since it is lawful for universities and many others kinds of entities to ponder some criteria in addition to applicants' purely academic profile. Such criteria might include those which realistically subject others to safety risks.
It is unclear from your post whether that university is a public one and the legislation puts it in the category of "arm of the state". If so, the university will certainly resort to the doctrine of sovereign immunity and have your case dismissed without even allowing you to pursue discovery. One effect of that doctrine is that a public university can blatantly indulge in many types of torts and wrongful conduct, and yet the court would not rule against it even if the evidence fully supports your claim(s).
Even if you overcome the issue of sovereign immunity or the doctrine is not applicable, the ensuing discovery proceedings might feel invasive to you. That is because procedural law would entitle the opposing party to conduct discovery on the matter of your mental health (my understanding is that the episode you mention refers to your mental health, but that is not entirely clear from your post). Pursuing this line of discovery is quite predictable insofar as the prior grievance and the alleged retaliation are premised on the acute mental health episode you mention.
Consequently, the university could prevail on grounds that your admission therein would pose a risk to faculty, students, and/or staff to the extent that the university cannot ensure the preemption of further episodes [involving you] that might hurt others in the university.
Comment: There are some special grounds, like union organizing, that are particularly protected.


Is there a way to run an ssh server on an Android device?

Question: I'm looking to install Debian over my Android installation so as to be able to use openssh-server, as it's so much better than Dropbear. Is there an easy way to do this, or just to simply install openssh-server on my phone? I'm running Android 2.3.X on a Google Nexus One.
Comment: You mean to run Debian programs on the Android kernel? I'm not sure it's possible, the Android kernel is compiled without some features that are normally enabled on Linux installations.
Comment: The main goal would be to run openssh-server if possible, or a minimal Debian if possible, in that order.
Comment: @TKKocheran: Can you be more specific? Usually openssh in itself isn't an end goal, it's a means to an end. Are you aware that switching OS's is going to get you into an entirely different beast with different problems? And that you're going to loose some functionality of the device because Debian software doesn't support it?
Comment: I don't really want to _replace_ Android if possible, I'd like at least to have OpenSSH as opposed to Dropbear (can't stand Dropbear), and if possible a Debian installation installed alongside my Android install to make it easier to install Linux software.
Comment: @TKKocheran: It doesn't sound like you know what you are asking for. Changing OS's to get a different ssh server is like moving to a new house to get a new faucet. You realize everything is going to be different right? They don't run side by side. I think you can hack a dual-boot system where you can boot up one or the other at a given time, but they are not inter-operable. You won't be able to use the Debian OS to interact with your Android environment.
Comment: Alright, so let me just ask this: is it possible to run openssh on Android?
Answer: If you want to run an ssh server on a rooted phone, you can install SSHDroid.
You can build a Debian image via deboostrap. Debian runs on ARM so you wont have problems building an image for that arquitechture. There is an interesting howto writen for SG1, you could try it out.
Comment: I think it's probably on-topic here, but you can [bring it up on meta](http://meta.unix.stackexchange.com/questions/ask) if you want; I don't think we've ever discussed installing Linux on handhelds
Comment: @Torian: The Nexus-One is rooted out of the box.
Comment: @Caleb didnt know that :). Then it should be fairly simple to do.
Answer: It is possible to run a more traditional Linux distro such as a stripped down Debian on the Nexus-One and many other handsets that were made for Android. Since Android is based off of a modified Linux kernel, it's not very hard to port the rest of an OS to go along with it. The Nexus-One is a particularly open device that's not hard to boot something else up one. A full version of Debian with X and WiFi can be shoe-horned in. See an example video here.
However you must realize that you are going to give up some functions. Software is not available for Debian to run the SIM card and make calls or send texts.
Here is one example tutorial of how to do it. The basic process involves setting up a partition, mounting it from your computer and using a bootstrap install process to shove all the Debian stuff in, making a few key changes like using an Android kernel is configured for that phone's hardware, then hacking on the boot routine a bit to startup to that environment.
Answer: There are many experiences of installing, say, Debian in a chroot inside Android.
There is even an app for doing this automatically: https://unix.stackexchange.com/a/20124/4319 .
(I agree, I had a similar wish: just get an environment I'm used to instead of figuring out how to do something with Android apps. It could save a lot of efforts and time when using such a device.)


How do I get the hidden badge on Steam for the SteamSale ARG?

Question: There seems to be a hidden badge on Steam which hints towards an ARG. How do I get this badge?
Comment: "Upcoming?" No, this is apparently the **end** of the ARG.  See Reddit's [/r/steamsaledetectives](https://www.reddit.com/r/steamsaledetectives) if you want to see how the various clues were discovered.
Comment: @Powerlord the activity on that subreddit seems to indicate that the hunt is ongoing. The comic with the clues is still ongoing, so I'd be surprised if the ARG is finished.
Comment: @murgatroid99 What they've discovered is that the stuff they missed is a [new wave file](https://t.co/Sc4rZZ7UPh) that has the text `LLLLHTBEEU` in its waveform.  This is an anagram of `BULLET HELL`, which was the clue to get they to Ikuraga that was found just by trying all non-translated tags for Undertale as passwords.
Answer:
Go to http://store.steampowered.com/app/253750 in your normal browser (you will need to log into Steam first if you are not already)
Wait until the site has been fully loaded
Type search on your Keyboard then press ENTER key
In the new popup window, enter the code 1v7531

This is how it looks like:

Remark for 3: Don't click into the search field, just type it directly after the site has loaded without hovering or clicking anything.
After enterting this, you will be redirected to a page showing your new badge. The badge is also featureable on your profile. This does not work within the steam client.
Make sure you are logged into Steam while doing this, otherwise you will get an error. Thanks to Gauzy for the reminder.
Comment: This worked for me, in Chrome on Ubuntu.
Comment: Make sure you're logged in to your Steam account before doing this, otherwise you'll just get a null page.
Comment: @murgatroid99 Also works in edge, just tested it
Comment: The holiday sale is over now, and I can't seem to open the pop-up window. Am I too late?
Answer: In case the other answer doesn't work, you can open the game Ikaruga's page through a browser, and run this code in the javascript console:
This will simulate the process of doing it:
$J.ajax({
    url: "http:\/\/store.steampowered.com\/actions\/clues",
    dataType: "json",
    cache: false,
    data: {key: "1v7531"}
}).done(function( result ) {
    if( result && result.url )
        window.location = result.url;
    else if( result.response )
        alert(result.response);
});

Source: YanirX on Pastebin
Comment: This helped a lot of users which asked for my help when I announced this over my group, hence I posted it here.
Comment: This method worked for me.


Requirements for a clan war?

Question: I am currently in a clan with three members. When we tried to initiate a clan war it said we had insufficient clan requirements. Does anyone know what the full requirements are? Is there a minimum clan member requirement?
Answer: The only requirement is that a clan must have at least 5 members eligible for war. (This used to be 10, but 5 vs 5 war size is also available now.)
Members who are new to your clan will be ineligible for war if they left their previous clan while a war was in progress. They will become eligible for war again when the previous war is completed. You can check your clan member list to see if any members are ineligible for war, and see when they will be eligible again. If you start the clan war while members are still ineligible, those members will not be able to participate.
You can see when players will be eligible in their profile through clan's chat room.
Comment: what do you mean by 'eligible for war'? do the players themselves need requirements too?
Comment: @DavidToh,post updated ...
Comment: Hmm... I do wonder if there are other requirements besides just clan member head-count.  Looking for a full list.
Comment: Clan members can opt out of war (on their profile) and show as "ineligible" on the war search screen, but the leader or co-leader can override the "I am Out" choice and include them anyway.
Answer: Clan War eligibility is simple:

Your clan must have at least 10 members.
You can only wage wars in increments of 5, giving us the following available wars:
05 v 05
10 v 10
15 v 15
20 v 20
25 v 25
30 v 30
40 v 40
50 v 50
If your clan has more members than is required for war, then the eligible members with the highest trophy count are chosen.
This is likely what's causing your confusion. If you have 12 members, the 2 members with the lowest trophy count won't be able to participate.
Members will be ineligible if they left a different clan after a war was started (for which they are participating in), they will be eligible again once that war ends. You can view their profile to see when they will be eligible.
Comment: if we have 15 eligible people, can we still make a 10v10 war?
Comment: @esq yes you can just set 10 of those 15 to be active in the next clan war whenever you start it.
Comment: Thanks. I didn't know about the increments of 5 rule

Requirements for a clan war?


Fertilizing multi-variety fruit trees

Question: I have a few fruit trees (apple, pears, oranges, grapes) and need to fertilize them.  What is the best way to fertilize them?  I am planning to use a mix of chicken manure and horse manure.  Do I need to add anything else? What proportion of each should I use?  Do I just spread it around the tree base or do I have to dig soil around the main step?  My concern around digging the soil is potentially damaging the roots.
Comment: Those aren't stone fruits.  Do you have other fruit trees?
Comment: Applying manure to the surface of the ground is a good idea, however it is also important to apply fertilizer to the root level. This is easiest done with a liquid fertilizer that you can apply to the surface and let filter down.
Comment: @graham thanks for the correction. Edited the original question
Comment: Have you composted the manure first, or is it raw?  And are they already mixed now, or separate?
Comment: @graham I bought these from the store in separate bags.  Right now they are separate but I plan to mix them before fertilizing the plants.  Looking for recommendations on the right proportions and way to apply the fertilizer.
Answer: It is a good thing to have mixed fruit trees. I hope they are not too close together.
The best fertilizer is nature. But nature needs time to do its work. You should store leaves and mulched grass beneath your trees, and you shall see a lot of little beasts doing the fertilizing work for you. Of course some of them will take their share of the fruits, but if there is a sufficient variety of life beneath your trees, the balance between predators should allow you to have your share too.

Here is how it looks on my field -- see how big the grass grows around the tree:

And after I worked around and spread the mulch

right its a peculiar sense of beauty, but just because we're not used to it
note that mulch should not be disposed too deep close around the trunk. It can
over-heat and over-moist the plant and kill it. Keep a 2 inches space free
around the trunk, and remove wild weeds too.

Fertilizing multi-variety fruit trees


Change the week start on Clock alarms

Question: Is there a way to change the start of the week to Monday (instead of Sunday) in the default clock program?
Note that my local is set to English (UK) so it should be the default but is not. I am running v4.2.2, if that matters.
Answer: Looks like it's just/about to be fixed in Clock 4.0.1 as reported on AndroidPolice.

The new APK for the clock app from the Android M Developer Preview doesn't look very different from the one you'll find in Lollipop - most of the functions (alarms, world clock, timer, and countdown) are in the same place and operate in the same way. But there's one tiny change that a small amount of users will be extremely happy to see. The Clock app can now "start" your week on Saturday, Sunday, or Monday.

Update: As of 18 June 2015 the stock app on my MOTO E 2 was updated by the normal 'My Apps" update notification and I still have the option of what day to start the week.
Answer: I'm afraid you can't change it. When I set my phone's language to French (France), the first day is still Sunday, where it should be Monday (like you).
Google may have skipped this...
Comment: @dotVezz: Already at Monday... Clock still on Sunday :/
Comment: What if you change the week start day in Calendar?

Change the week start on Clock alarms


Do I need to include all DB Tables in my Entity Data Model? (VS2010)

Question: I model my database 1st using DB Designer Fork, complete with keys, indices and relationships. I then make an SQL Create script for this then run it in MySql 5.5 (sometimes MS Sql).
Then I create an ASP.NET/c# website in VS2010. This is my new software and I intend to use Entity Data Model (the one that uses .edmx files) for my new projects.
I can actually "drag-and-drop" my existing db tables in the edmx and it comes complete with relationships and all. But do I really want/need to do this, knowing that I need to create new entities for joined tables?
BACKGROUND: I'm more comfortable with SQL queries and Database ER diagrams than "Application Class Diagrams" but I want to use this Entity Data Model because I believe it will save me a lot of time and hassle managing hundreds of queries like how I used to do things.
Answer: There is not required to include all the tables in the selected database. See this article for clarification.
But I suggest that if you are creating a new project then use EF Code First model.


Why do we always say in spring setup with 2 blocks that when their velocities will be equal it will have maximum elongation/compression?

Question:
In this Case the velocites are opposite.Here's my undrestanding:
There are spring setups in which a block having a velocity strikes a spring attached to another block and in that case we find maximum compression by saying that at the point when both the blocks have equal velocity the compression would be maximum as one block with the greatee velocity tends to increase the elongation and the other with less velocity tends to decrease it and the spring opposes the block having more velocity whereas it increase the velocity of the block that was at rest and has less velocity intially So naturally when the both have equal velocities its the maximum compression because after that the spring tend oppose the other block and the process repeats .....
BUT
in this case when they have opposite velocities I say that both the blocks tend to elongate the spring and the speing tries to oppose the motion of both the blocks...so one block (the one with facing more retardation will stop first and the other one woukd still be trying to elomgate the spring)Thats my point of maximum elongation becausw after that the other block tends to compress the spring.But somehow this is wrong as with my calculation I got it around 26 cm when that point occurs and then according ti the method if equal velocity it gives 30 which is more than 26.So where Am I wrong?
Answer: So, you said that when the left hand side block is at rest, the spring should have maximum elongation as just after this instant this block will try to compress the spring. But how can you compare the rate of compression and that of the elongation? the spring will be in maximum elongation and compression only when their rates are equal.
Assume the displacements of the blocks to be $\vec{x_1}$ and $\vec{x_2}$. Elongation in the spring will be $\vec{x}=\vec{x_1}-\vec{x_2}$
Differentiating both the sides, $$\frac{d\vec{x}}{dt}=\frac{d\vec{x_1}}{dt}-\frac{d\vec{x_2}}{dt}$$
Therefore, $$\vec{v_1}=\vec{v_2}$$ since, $\frac{d\vec{x}}{dt}=0$
Answer: When the two velocities are not equal, then the spring will be either expanding or contracting, and therefore its changing length cannot be at an extremum.  Only when the velocities are equal will the length of the spring be temporarily constant and therefore at a maximum or minimum.


Is there a general FAQ/Wiki section for each tag where we can put useful functions?

Question: I've got a list of date functions that I use pretty regularly in my Access apps; stuff like LastDayOfMonth, IsWeekend, DaysInMonth, etc...  General stuff that's definitely helpful if you work with dates at all.  I'm wondering if there is currently a place in the SE network where we can put these functions so other people can use them?  I've also got a few for C# (I'm still a n00b there but I use them a lot) as well that I'd be happy to dump somewhere if they'd be of use to others.
Comment: Be careful of asking questions that are easily answered with minimal knowledge/searching, even if you are answering them yourself for the purpose of sharing knowledge.  Seen people get downvoted/closed for trying to do a good deed. :/
Answer: You can ask a question for which that information would be (part of) an answer, and then self-answer the question.
Having said that, good self answered questions are hard.  It's important that the question be of sufficient quality for the site.  It should be good enough that if you asked that question and didn't answer it yourself others would think it was a good question, well researched, follows all site guidelines, etc.  This is a lot of work, and many people struggle with it.
Because of the difficulty in asking quality self answered questions you may be better off just creating a blog or using some other external resource (there are lots of code sharing sites, if that's primarily what you want to share) that's better suited as a platform for you to simply share information that you would like to, without spending the considerable effort to force it into a Q/A model.
Answer:
I've got a list of date functions that I use pretty regularly ... I'm wondering if there is currently a place in the SE network where we can put these functions so other people can use them?

I'd suggest forming them into a library, and releasing it as an open source project. Post it to GitHub or somewhere similar.
Comment: Was going to make a joke about a github repository for Access, but then I checked and saw there were a couple people with 'em.
Comment: @Won't: it's all code, right? Why not.
Comment: Because beat Access with a hockey stick until its a closed casket?
Comment: Hehe. Well, yes, there is that I guess  ;-)


How can a waterproofing material be "water-based"?

Question: I've been trying to determine how a particular waterproofing material, which claims to be "water based", can still be hydrophobic. First of all, the product in question is EPRO ECOLINE-R, which also claims to be an asphalt emulsion. My first guess is that the curing process causes a change in some way to become hydrophobic once applied. But I just can't wrap my head around how a product, which is designed to resist water absorption, can also be water based? I can find no information on the exact chemical makeup, other than "petroleum hydrocarbons".
Answer: One might need to have more information about the product you've posted to say what occurs in the specific example. But, the general concept could be similar to Latex (water-based) paint. Where the water proofing chemical is dispersed by an emulsion, and once the water evaporates, the proofing material is restructured by its, now unhindered, intermolecular forces. These forces might be strong enough, once the proper structure exists, to resist water coming back and trying to interrupt the interactions.
Below is the Wikipedia explanation for my example of latex paint.

The term "latex" in the context of paint in the USA simply means an aqueous dispersion; latex rubber from the rubber tree is not an ingredient. These dispersions are prepared by emulsion polymerization. Such paints cure by a process called coalescence where first the water, and then the trace, or coalescing, solvent, evaporate and draw together and soften the binder particles and fuse them together into irreversibly bound networked structures, so that the paint cannot redissolve in the solvent/water that originally carried it.
Comment: After reading up on the article you linked and a few others on latex paint, I think you nailed it on the head. Water is the vehicle with which the petroleum product is applied, which is why it can still be applied to a damp surface. The curing process is essentially the water evaporating out of the porous structure. This makes me question, however, how water cannot be reintroduced through the pores after curing. Perhaps as the petroleum product naturally outgasses, the water trapped within gets pushed out to the surface and effectively closes the porous pathway to the interior?
Comment: Such a question goes beyond my understanding. Its possible there's a strong lattice structure and chemical bonding, such as oxidation, happens at the edge, preventing a reintroduction of water. We would have to know the formula and structure of the material to really speculate about that.


Replication: Procedure or function sp_MSupd_PROC has too many arguments specified

Question:
Source is one service pack behind destination (2012).  I know service packs can be issues here, but it looks like this is only for versions 2000 and 2005.
When using sp_helptext sp_MSupd_PROC the objects uses a CASE WHEN with the binary input (last parameter) and updates or adds columns with the other parameters where the primary key column is equal to the primary key passed in.  For non-SQL types reading this - is there an Entity Framework approach to this, as this entire replication process looks slow and completely outdated and I highly doubt is using efficient .NET code?
Using sp_help on the objects on both the source and destination show that they're both the same.  Also, I did look at this briefly, but the no specific transaction number comes with the error - so I can't do his second step.
I did a quick verification on the data in the table, confirming that it matches with the parameters shown from the sp_helptext.

I haven't found anything else I can do to troubleshoot here and updating service packs right now isn't an option.  Note that this replication was fine yesterday and the day before yesterday, so what would cause it to be fine for multiple days, but now not be fine.  I realize that if users change or update the source or destination object, that would cause problems, but I don't see that being the case.
Thanks.
Answer: It sounds like the replication procedures might need to be recreated. Use the sp_scriptpublicationcustomprocs procedure on the publisher to generate the replication procs and recreate them on the subscriber.


Find all non-negative integers $a, b, c ,d$ such that $a! + b! + c! = 2^d$

Question:
Find all non-negative integers $a, b, c ,d$ such that $a! + b! + c! = 2^d$.

By trial I found  $a= 2 , b= 3 , c= 5$ and $d= 7$ which is one solution. How to find all the solutions of it ?
Comment: [This problem](https://www.youtube.com/watch?v=gAPNzzeNWZg) seems pretty similar. Based off the approach in the video, it may boil down to finding just a few using some logical reasoning about what can and can't happen in this kind of situation.
Comment: Hint: Can $a,b,c$ be all greater than $3$?
Comment: oh shit i only realised they can't all be greater than 5 @JannikPitt :((
Answer: Better version.
Notice that $3 \mid x!$ for $x \geq 3$ and $3 \not \mid 2^d$. Therefore, at least one of $a, b, c \leq 2$. WLOG let $a\leq b\leq c$.
If $c\leq 1$, $a\leq b\leq c\leq 1, a!=b!=c!=1$ which gives no solution.
If $c=2$, $a!+b!+2=2^d$. $a,b\in \{0,1\}$ gives $4$ solutions, while $(a,b)=(1,2)$ and $(2,2)$ doesn't give solution.
For the cases below, $c\geq 3$.
If $b\leq 1$, $2+c!=2^d$. Notice that $2^2|c!$ for $c \geq 4$, so $c=3$. This gives $(a,b,c,d)=(a,b,3,3) \forall a,b\in \{0,1\}$ (Extreme laziness)
If $b=2$, $a!+2+c!=2^d$. Note that $a!=1$ doesn't give any solution (parity), so $a=b=2$. $4+c!=2^d$. Noticing that $2^3\mid c!$ for $c \geq 4$, $c=3$. $(a,b,c)=(2,2,3)$ doesn't give a solution.
For the cases below, $c \geq b \geq 3$. $2\mid b!+c!$.
Note that $a!=1$ doesn't give a solution. Therefore, $a=2$.
$2+b!+c!=2^d$. If $c \geq b \geq 4$, $2^3 \mid b!+c!$. Therefore $b=3$ gives $8+c!=2^d$. Note that $c\geq 6$ means $2^4 \mid c!$. Therefore, $c=4$ or $c=5$. Checking shows both of them work.
Therefore all the solutions:
$(a,b,c)=(0,0,2),(0,1,2),(1,1,2),(0,0,3),(0,1,3),(1,1,3),(2,3,4),(2,3,5)$ , up to permutations.
Comment: Thank you, that's what I was looking for.
Answer: A simplier approach
$a!+b!+c! = 2^d$ where $a,b,c,d€Z$
Notice that $2^d$ must be even, therefore $a!+b!+c!$ must also be even..... We know that the factorial of a number must always be even
Therefore $a!$, $b!$ and $c!$ are all even and $a,b,c > 1$
Since $3*x! ≠ 2^d$, then $a,b,c$ can't be equal, therefore $a < b < c$
$even + even + even = even$
If I sufficiently divide by $2$ it breaks down and at some point becomes
$odd + odd + even = even$
So to find $a$ and $b$, we'll look for two factorials that have a common factor of $2$ or multiples of $2$ and a odd number
$a!$ and $b!$ can be $(2!,3!) = (2×1,2×3)$
It turns out this is the only value that works, because there is no integer that satisfies $x! = 2^n×y$ , where $y$ is odd
$2!+3!+c! = 2^d$
$8+c! = 2^d$
Then the range of values of $c$ is
$c = 4,5,......$
Answer: Without loss of generality, we can assume $a\leq b\leq c$. Let's do some remarks. I will suppose $d> 3$, the first cases are easy to check by hands and they will coincides with the solutions in $a=1$.
If $a,b,c\geq 3$ then $3$ divides $a!+b!+c!$, but $3$ does not divide $2^d$.  Hence $a=1,2$. (the case $a=0$ is equal to case $a=1$; in the solutions you can replace $0$ with $1$)
Case $a=2$
We have $2! + b! + c! = 2^d$ that is $1+\frac{b!}{2}+\frac{c!}{2}=2^{d-1}$.
If $b,c\geq 4$ then the LHS is odd and the RHS is even. Then $b$ has to be $2$ or $3$.
If $b=2$ we have $c!=2^{d}-4 = 4(2^{d-2}-1)$. So we need $c\geq 4$ in order to have a factor $2^2$ in the LHS. But now the LHS have a factor $2^3$ in its factorization, and the RHS don't, a contradiction.
If $b=3$ we have $c!=2^d-8=8(2^{d-3}-1)$. As above we need $c\geq 4$ in order to have a factor $2^3$ in the LHS, but if $c\geq 6$ we have a factor $2^4$ in the LHS factorization and the RHS don't. So $c$ can be only $4$ or $5$.
With these considerations, the solutions are:
$$(a,b,c,d) = (2,3,4,5), (2,3,5,7)$$

Case $a=1$
We have $1+b!+c! = 2^d$ that is $b!+c! = 2^d-1$. The RHS is odd, so $b!+c!$ has to be odd. For, we need $b!$ odd and $c!$ even (because $b\leq c$). Hence, the unique case is $b=1$.
So now we have $c! = 2^{d}-2 = 2(2^{d-1}-1)$, and using the same argument used in the case above, we will find that $c$ can be only $2$ or $3$.
With these considerations the solutions are:
$$
(a,b,c,d) = (1,1,2,2), (1,1,3,3)
$$
Edit: Thanks to Gareth Ma for his remark (case $a=1$).
Comment: The variables are non-negative, so you need to consider $0$ cases. Also you missed $a=b=1$ case anyways.
Comment: @GarethMa You are right! Thanks!
Answer: Without loss of generality $a\le b\le c$, so $a!|2^d\implies a!\in\{1,\,2\}$.
If $a!=1$, $b!+c!$ is odd so $b!=1$ and $c!=2^d-2$, so $c!\nmid4$ and $c\le3$. This gives the solutions $c=2$ and $c=3$.
If $a!=2$, $b!+c!$ isn't a multiple of $4$, so $b\le3$. In particular, if $a=b-2$ then $c!=2^d-4$ is a multiple of $4$ but not $8$ so $4\le c\le7$, and similarly if $a=2,\,b=3$ then $8\le c\le15$. I'll leave you to check these cases.
Answer: Just to give a slightly different approach, let's show that $\max(a,b,c)\le5$, which reduces the problem to a finite search.
Let's assume $a\le b\le c$. As others have noted, we must have $a\le2$, since $a!\mid(a!+b!+c!)$. Now if $b\gt3$, then $4\not\mid(a!+b!)$. It follows that $16\not\mid(a!+b!)$, since $a\le b\le3$ implies $a!+b!\le12\lt16$.
Now suppose $c\ge6$.  Then $c!=720n$ for some $n\ge1$ and thus $2^d=a!+b!+c!\gt720$ implies $d\ge10$, in which case
$$a!+b!=2^d-720n=16(2^{d-4}+45n)\implies16\mid(a!+b!)$$
which is a contradiction.
To complete the search, note that if $c=5$ or $4$, then we have $2^d\gt4!=24$, hence $d\ge5$, and thus $8$ divides $2^d-c!=a!+b!$, which occurs if and only if $a!=2$ and $b!=6$ (i.e., $a=2$ and $b=3$), while if $c=3$ or $2$ then $a!+b!=2^d-c!$ is divisible by $2$ but not by $4$, and this occurs if and only if $a!=b!=1$ (i.e, $a,b\in\{0,1\}$). Finally, we cannot have $c=1$ (or $0$) since that would give $a!+b!+c!=1+1+1=3$, which is not a power of $2$. Thus the factorial values $(a!,b!,c!)$ (with $a\le b\le c$) that sum to a power of $2$ are $(1,1,6)$, $(2,6,24)$, and $(2,6,120)$. All other solutions are permutations of these.