How to make a dynamic datatable with dynamic column count?

Question: How to make such datatable, that will fetch all the columns in my custom object with particular data type and, when I add a new field to my object, the table will automatically fetch this field and make a new column for it without updating the code?
Answer: Unless you absolutely need it - I won't recommend it. This is kind of common use case, but code is complex.
You need to reference SObject Schema in order to get fields info and query those fields and pass it into results.
Here is a small part of the code, since you also need to handle different field Types and add some code for querying your Object.
I can also found a video for that thing.
<code>Map<String, SObjectField> fieldsMap = SObjectType.Some_Type__c.fields.getMap();
Set<String> fields = new Set<String>();

for (String fieldName : fieldsMap.keySet()) {
    SObjectField field = fieldsMap.get(fieldName);
    if (field.getDescribe().isAccessible()) {
        fields.add(fieldName);
    }
}

String query = '';
// Build query for your SObject

List<SObject> records = Database.query(query);

List<Object> result = new List<Object>();
// Iter through records and wrap your info

return new Map<String, Object>{
        'fields' => fields,
        'data' => result
};
</code>


Can I put a one minute delay on my hose so I don't get wet when the sprinkler turns on?

Question: All I want is a water timer with about a 1-minute delay for those times that I have to run away after starting it and still get wet.  Like when I'm ready to go to work and don't want those clothes to get wet.
Answer: Put a valve at your hydrant, so that you can turn on the hose/sprinkler  after walking back to your source. It's the easiest way if you aren't looking for a permanent sprinkler system install.
Answer: Sheila, this is very sweet.  There are timers that you can set on your hose to go off when you are high and dry in your car.  No delay is necessary other than the start time is after you are in your car.  Most timers are built like that.  I would purchase a GOOD timer...like more expensive than the cheapest?  What plants are you watering and for how long?  How do you know how much time to set your sprinklers for?  We could help with that.  In fact we could help you train your lawn and plants to be drought tolerant and save huge bucks on your water bill. Watering a little every day is not at all a good thing.  Tell us more about your situation, send pictures. Wouldn't you be proud to come home to a thriving landscape surrounding your home?  Lower your water bills?


android emulator disconnecting from DDMS view when accessing file explorer

Question: when i go to the DDMS view to access data folder of my app on an emulator, every thing works fine but after a few seconds the list of devices becomes empty which means that the DDMS lost connection with the emulator and even if i restart the adb server it keeps disconnecting and worst it doesnt even show the processes running on that emulator for the short perid of time when it is visible on the devices tab.
please could any one tell me if there is a solution.
thanks.
Comment: could you please tell me how to attach my logcat text file to this comment.
Comment: http://help.eclipse.org/helios/index.jsp
Comment: you can edit your own question and append your longcat text file
Answer: You could use reset ADB menu in DDMS window as in attached.


Why is British English often 'corrected' to American English here?

Question: Multiple times I have seen people 'correcting' British English words and terms in a question to their American equivalent. Words like colour are changed to color and customisation is changed to customization. No matter how big the US is, British English is still the world language and the main language on the interweb. I get that they automatically use their own grammar in their own questions, but editing other people's questions to fit their grammar seems a bit odd to me.
Why do people feel the need to do that?
Comment: As a Brit who has worked with American engineers for decades, I'm not bothered about their spelling, but on many internet forums (including this one) I'm more bothered by the unthinking assumption that *everything* related to motoring (including law, insurance, etc) is the same world-wide as it is in the USA.
Comment: Re "original" English: 'Original' English hasn't been spoken by any nation for nearly a millenium. If you study etymology, you will find that the modern American spelling is sometimes actually the older one and the modern British version is a more recent change. It works both ways at times, but neither is 'original' in any meaningful sense. As far as number of speakers is concerned, there are more than twice as many native speakers of American English than all other native English speakers put together. Of course, you're right that people shouldn't edit others' posts to change dialects.
Comment: It's possible that some users don't even realize that there are completely different ways that people spell words in English. They might genuinely think they are spelling errors. That's what I thought they were when I first encountered British English.
Comment: @reirab That was the word i was looking for. But i'm not a linguist.
Comment: Lol, I got in trouble for doing the opposite.  :)  By mistake, btw.
Comment: @reirab While that may be entirely true, that's not what i meant by 'Original English'. I mean the English that is the world language, which is spoken here. It's a bit confusing to name that English English isn't it? Also, if the english would decide to change the word 'car' to 'vroomvroom-device' we'd also have to use that word, even when the american word 'car' is older, because English is the world language. That's the language taught in Dutch, German, and French schools, or any other school outside America.(Canada may be an exception..) I bet they outnumber the americans by the way.
Comment: I think you will find that basically all linguists call what you're referring to '[British English](https://en.wikipedia.org/wiki/British_English),' not 'original English.'
Comment: I corrected tyre to tire before realizing tyre was somewhat correct. In my defense, isn't stackexchange based out of the USA (New York)... And since when was "original (british) english ... the main language on the interweb"? where is the source on that?
Comment: @alephzero Yeah i have noticed that, too. I think that's a culture thing of them. A bit similar to how we westerners as a whole, often assume other countries cultures have the same customs regarding handshakes, greetings etc. (The other way around also applies, of course.)
Comment: "The English that is the world language"? There's no such thing. English is a language with many dialect poles. British English is one of them, but it has no special status. There is no single official ["World English"](https://en.wikipedia.org/wiki/World_Englishes#Classification_of_Englishes) where BE spellings are right and AmE's are wrong. I do support your right to use spellings and words that are considered correct where you live, but I'm detecting a desire to go a bit further than that, and that I can't support.
Comment: @T.E.D. The question was predominantly about people changing British English to American English. Or the grammar, to be more specific. And British English may have no official status, but it is the dialect taught in schools and used in companies as second language (almost) everywhere. So i think you could say that that is the world language, or the most common one at least.
Comment: @Bart - Variants of AmE dialect are taught in the Philippines, some in China and Brazil, and many other countries that primarily do business with the USA. So yes, this **the** world language thing is just flat out wrong.
Comment: @T.E.D. Right, a few countries also teach AmE for use in business relations with the US. Here in Europe all countries use BE, whether it's schools, companies or whatever. Communication between companies here and China, South America and such, are done in BE. But you're completely losing the point of the question, which was about correcting dialects. I don't get why you're going in on that so hard, while someone else already adressed that point. Let's end this useless discussion.
Answer: To be quite honest, these types of edits should not be approved. To me it boils down to a term called "local color" (or local colour in your case, @Bart :o). While Stack Exchange is (for the most part) supposed to happen in English, the rules don't dictate "American" or "British" or "Whathaveyou" English. As long as we can read it, there shouldn't be an issue with you (or anyone) using "tyre" instead of "tire", or even "bonnet" for "hood". As long as the version used can be read and understood, it should not be changed.
A bit in people's defense, this is more of a reactionary change than it is to try and mess with someone (in the vast majority of the cases, anyway). I'd bet most people don't even realize they are doing it. They see something, which in their mind, is spelled wrong, and find the need to fix it. They don't give thought to where the other person is from or what have you. It was a mental bridge which I had to cross at one time, but I do think about it now before I arbitrarily just change something.
There is one caveat and that has to do with tagging. We should not have multiple tags for the same thing. There was a tag war which occurred a while back because of the use of tyre instead of tire. While both are understood to be the same thing, the use of two different tags for the same thing muddles the waters. Because of this, it was decided to use the American version of tire with tyre being a synonym. While this didn't sit well with a few people, it was done in an effort to conform to one standard and one tag so stuff could be more easily found. It has nothing to do with which is right or wrong, because neither is.
If I see it happening, I will rollback the edit. If you see it happening to your posts, I'd suggest you do the same.
Comment: @Bart - You mention "they're" and "their" ... while it isn't obvious to some native English speakers, *it should be*. I make the mistake sometimes when I'm typing really fast and trying to get something out (like with texts or even emails), but I will invariably catch it upon reading it again ... usually after I've sent it, of course!
Comment: Good answer. I suppose it's different for me since english is my second language. Dutch, my native language, works completely different. I think these kind of grammar differences will be noticed quicker by non-native speakers because they read the same text different. Same goes for they're/their or you're/your. As a non-native speaker they're two completely different words. Probably it's not so obvious for a lot of natives. Luckily those mistakes aren't made often here.
Answer: I would consider localization-related edits to be too minor to approve, since they don't really add much value.
That said, it may be that the edits are coming from individuals who don't realize that there is more than one way to spell "customise", so I wouldn't make a big deal out of it.
If it bothers you and the edit is made to your own post, my suggestion would be to roll back the edit and not think twice about it.
Comment: @Bart When the political leaders of a country think that "Africa is a country" or "Belgium is a European city," don't over-estimate how much the less well educated citizens know about anything outside their own back yard. (And don't forget they need to use names like "Paris, France," in case everybody in the world thinks they are talking about Paris, Texas.)
Comment: @alephzero Just pronounce the names properly and I'm pretty sure that nobody will confuse Paris, Texas, United States of America for Paris, France! A little hard to do in text, admittedly.
Comment: I agree that it's unnecessary to correct american english to original english, but the other way round is a bit odd. It's probably because most or at least many of the users here are from the US. But I thought most of them would know the difference between english and american english.
Comment: @Bart - A lot of people just don't understand, while it's more of a knee jerk reaction to others. Please see my answer I've posted.
Comment: @alephzero Haha that's a good point! A really sad one actually, regarding the politicians.
Comment: @alephzero Doesn't everyone know that Belgium is the rudest word in the universe? https://en.wikiquote.org/wiki/Belgium


Shuffle an array with python, randomize array item order with python

Question: What's the easiest way to shuffle an array with python?
Answer: import random
random.shuffle(array)

Comment: is there an option that doesn't mutate the original array but return a new shuffled array?
Comment: @{Charlie Parker} Just make a copy of the original array before using random.shuffle:
`
    copy_of array = array.copy()
    random.shuffle(copy_of_array)
`
Comment: @Tushar Despite the name, the object you get from `np.array()` is not an "array" in the sense of this question. You may want to look for another question to find out how to shuffle a _Numpy_ array specifically. (Or you can search the web to find the right page in the Numpy documentation.)
Comment: @Charlie That would be a good thing to ask in a separate question. (Maybe someone else has already asked it.)
Comment: @CharlieParker From the python docs `shuffled = sample(array, k=len(array))`
Comment: out put is  none for  a4 = np.array((blockshaped(c, 2, 3)))[3] where blockshaped return nd'array
Answer: import random
random.shuffle(array)

Answer: Alternative way to do this using sklearn
from sklearn.utils import shuffle
X=[1,2,3]
y = ['one', 'two', 'three']
X, y = shuffle(X, y, random_state=0)
print(X)
print(y)

Output:
[2, 1, 3]
['two', 'one', 'three']

Advantage: You can random multiple arrays simultaneously without disrupting the mapping. And 'random_state' can control the shuffling for reproducible behavior.
Comment: Also note that the `y` is optional
Answer: Just in case you want a new array you can use sample:
import random
new_array = random.sample( array, len(array) )

Answer: The other answers are the easiest, however it's a bit annoying that the random.shuffle method doesn't actually return anything - it just sorts the given list.  If you want to chain calls or just be able to declare a shuffled array in one line you can do:
import random
def my_shuffle(array):
    random.shuffle(array)
    return array

Then you can do lines like:
for suit in my_shuffle(['hearts', 'spades', 'clubs', 'diamonds']):

Comment: Python doesn't actually aim to be as brief as possible.  Python aims to balance readability with expressivity.  It so happens to be fairly brief, mainly because it is a very high-level language.  Python's own built-ins *typically* (not always) strive to *either* be "functionlike" (return a value, but don't have side effects) *or* be "procedurelike" (operate via side effects, and don't return anything).  This goes hand-in-hand with Python's quite strict distinction between statements and expressions.
Comment: It doesn't return anything *specifically* because it is trying to remind you that it works by altering the input in place.  (This can save memory.)  Your function alters its input in place also.
Comment: I guess it's a style thing. Personally I prefer the fact that I can write a single line to achieve what would take a couple otherwise. It seems odd to me that a language which aims to allow programs to be as short as possible doesn't tend to return the passed object in these cases.  Since it alters the input in place, you can replace a call to random.shuffle for a call to this version without issue.
Comment: Nice. I suggest renaming it to my_shuffle to see the difference in the code immediately.
Comment: Maybe, but this could be premature optimization (it could be helpful, but the need to shuffle doesn't explicitly require the need to return the array). Also, shuffle(array) followed by some use of shuffle would only be 2 lines as opposed to 3 + n (times usage), although I guess it would be a saving if you use it many times. Here is a great video that discusses this type of thing (e.g. phantom requirements and premature optimisation) - http://pyvideo.org/video/880/stop-writing-classes
Answer: When dealing with regular Python lists, random.shuffle() will do the job just as the previous answers show.
But when it come to ndarray(numpy.array), random.shuffle seems to break the original ndarray. Here is an example:
import random
import numpy as np
import numpy.random

a = np.array([1,2,3,4,5,6])
a.shape = (3,2)
print a
random.shuffle(a) # a will definitely be destroyed
print a

Just use: np.random.shuffle(a)
Like random.shuffle, np.random.shuffle shuffles the array in-place.
Comment: what does destroyed mean, exactly?  (i mean, in this context -- i'm not an ELL.)
Comment: Well if I try A = np.array(range(9)).reshape([3,3])
Answer: You can sort your array with random key
sorted(array, key = lambda x: random.random())

key only be read once so comparing item during sort still efficient.
but look like random.shuffle(array) will be faster since it written in C
this is O(Nlog(N)) btw
Comment: This is O(n log n), not O(log n), and inherently slower than an O(n) shuffle, C aspect aside.
Answer: In addition to the previous replies, I would like to introduce another function.
numpy.random.shuffle as well as random.shuffle perform in-place shuffling. However, if you want to return a shuffled array numpy.random.permutation is the function to use.
Answer: I don't know I used random.shuffle() but it return 'None' to me, so I wrote this, might helpful to someone
def shuffle(arr):
    for n in range(len(arr) - 1):
        rnd = random.randint(0, (len(arr) - 1))
        val1 = arr[rnd]
        val2 = arr[rnd - 1]

        arr[rnd - 1] = val1
        arr[rnd] = val2

    return arr

Comment: yes it returns None, but array is modifed, if you really want to return something then do this

import random
def shuffle(arr):
    random.shuffle(arr)
    return arr
Comment: This swaps n−1 random pairs of adjacent items, which isn't a correct (uniform) shuffle.
Answer: Be aware that random.shuffle() should not be used on multi-dimensional arrays as it causes repetitions.
Imagine you want to shuffle an array along its first dimension, we can create the following test example,
import numpy as np
x = np.zeros((10, 2, 3))

for i in range(10):
   x[i, ...] = i*np.ones((2,3))

so that along the first axis, the i-th element corresponds to a 2x3 matrix where all the elements are equal to i.
If we use the correct shuffle function for multi-dimensional arrays, i.e. np.random.shuffle(x), the array will be shuffled along the first axis as desired. However, using random.shuffle(x) will cause repetitions. You can check this by running len(np.unique(x)) after shuffling which gives you 10 (as expected) with np.random.shuffle() but only around 5 when using random.shuffle().
Answer: # arr = numpy array to shuffle

def shuffle(arr):
    a = numpy.arange(len(arr))
    b = numpy.empty(1)
    for i in range(len(arr)):
        sel = numpy.random.random_integers(0, high=len(a)-1, size=1)
        b = numpy.append(b, a[sel])
        a = numpy.delete(a, sel)
    b = b[1:].astype(int)
    return arr[b]


onPushButtonClick code redirects to another Widget/Class(mainWindow.cpp)

Question: I am wondering how I can redirect my code into mainWindow.cpp where my main program will be located after the user clicks on the "login" button(onPushButtonClick). Currently when the user pushes the button it opens the second widget but it stays at the smaller size equivalent to the login window, so how can I redirect the code in mainWindow UI so after they click "login" it opens a new window at the correct size as my MainWindow.ui.
Picture of code
Answer: I don't know how much help this will be but personally I would create a new widget for the login page, so that mainwindow.ui stays as the main. This would than be easier in theory. Sorry if this is no help.
Comment: I believe that is what I did as you can see the login.cpp and also the mainWindow.cpp, but how do I go about telling the code to start running mainWindow.cpp after they push the button?
Comment: With out seeing your code, you would go to your login.ui and right click on your login button and go to slot, inside the slot you need to execute the mainwindow. Recommend watching this tutorial https://www.youtube.com/watch?v=VigUMAfE2q4


Can we show that the helmholtz free energy at equilibrium is minimized from its second derivative?

Question: I can show that $dF = 0$ at equilibrium, where F is Helmholtz free energy. But mathematically, starting from $$dF = d(U-TS)$$ I want to show that its second derivative, $d^2F > 0$ at equilibrium and thus I can prove that the equilibrium state has minimum Gibbs free energy. I am starting like $$d^2F=d(d(U-TS))$$ $$d^2F = d(dU-TdS-SdT)$$$$d^2F=d(TdS-PdV-TdS-SdT)$$$$d^2F=d(-PdV-SdT)$$ For a system at constant volume, $dV =0$ and at equilibrium state, $dT =0 $, so clearly I would get $d^2F=0$ which is obviously incorrect, so am I doing something wrong in here, or my approach is totally wrong. Please do suggest. Thanks.
Answer: The first derivative at an extremum point $x_0$ is $0$ only when evaluated at $x_0$. Same goes with the second derivative. So you first have to evaluate the second derivative, then you plug in the specific $x=x_0$.
For example, take $y = x^2$. $\frac{\mathrm{d}y}{\mathrm{d}x}= 2x $ and $\frac{\mathrm{d}^2y}{\mathrm{d^2}x}= 2 $. At $x = 0$, the minimum, $\frac{\mathrm{d}y}{\mathrm{d}x} |_0 = 0$, and $\frac{\mathrm{d}^2y}{\mathrm{d^2}x}|_0= 2$.  If we were to apply your logic however, we would have $\frac{\mathrm{d}^2y}{\mathrm{d^2}x} = \frac{\mathrm{d}}{\mathrm{d}x} \underbrace{\left (\frac{\mathrm{d}y}{\mathrm{d}x}  \right)}_{=0}=0.$
So, you have to expand your last line.
$$\mathrm{d}^2F = -\mathrm{d}P\mathrm{d}V - P\mathrm{d}^2V-\mathrm{d}S\mathrm{d}T-S\mathrm{d}^2T. $$
Now you apply the condition that you are at equilibrium, so $\mathrm{d}T|_{\mathrm{eq}} = \mathrm{d}V|_{\mathrm{eq}} = \mathrm{d}P|_{\mathrm{eq}} = \mathrm{d}S|_{\mathrm{eq}} = 0$, so that:
$$ \mathrm{d}^2F|_{\mathrm{eq}} = - P\mathrm{d}^2V|_{\mathrm{eq}}  -S\mathrm{d}^2T|_{\mathrm{eq}} .  $$
Then I guess that if pressure is positive, then the volume is a maximum so $\mathrm{d}^2V<0$ so that the first term is positive. Probably a similar argument for the second term...?
Comment: Thanks, but I am finding it hard to understand how $d^2V < 0$ and $d^2T<0$. I know that both P and entropy S is positive, but how $d^2V$ and $d^2T$ are negative. I would be very grateful of you could elaborate it a bit further. Thanks.
Comment: I am kinda guessing here, I was just pointing out the maths. I gave a plausible reason for the first term to be positive in the answer. For the second term, Wikipedia says "at constant temperature, the Helmholtz free energy is minimized at equilibrium." (on the Helmholtz free energy page) so I guess the temperature change is 0, which eliminates the term.
Comment: Ok, thanks, but then even though $dT=0$, it should not mean that $d^2T=0$ right, also I have not been able to grip this idea why $d^2V<0$ or shall I say how Volume is minimum at equilibrium. Thanks.
Comment: Well if temperature is constant, then $T=c$, $\mathrm{d}^mT =0$. For the volume: My interpretation is that, if the pressure $P$ is positive, then the gas occupies the maximum volume it can by pushing on all its boundaries. So I say the volume should be a maximum, hence $\mathrm{d}^2 V$ @ eq $ < 0$.
Answer: Start with the 1st and 2nd Laws written as $dU=\delta Q + \delta W$, $F=U-TS$ and $\delta Q \le TdS$, where $\delta W$ is the work done by external forces on the system whose internal energy is $U$, and $\delta Q$ is the heat transferred from the environment to the system.
Then we have for any process that $$d(F+TS)=dF+TdS+SdT \le TdS + \delta W $$ and
$$dF+SdT \le \delta W \tag{1}\label{1}$$
where in $\eqref{1}$ equality holds iff the process is reversible.
Now assume that the process is such that the external work done is zero $\delta W=0$ then you have $dF\vert_{\delta W=0} \le -SdT$, and if the process is also isothermal, that is $T=const,\; dT=0$, then you must have $$dF \le 0 \tag{2}\label{2}$$
What does it mean that the free energy cannot increase $\eqref{2}$? If a reversible process then $dF=0$ and it is not changing. If it is an irreversible process then $dF<0$ and $F$ must decrease. As $F$ is bounded from below when decreases it must reach a minimum eventually. Being a minimum its 2nd derivative, if exists, must be positive, that is equilibrium with the given constraints.

Important: Actually, we do not have to assume that the whole process is isothermal. Instead, it is sufficient to assume that the heat (entropy) exchange with the environment is always at the same temperature, $dT=0$. For example, the system's internal temperature during equilibration may change, only its interaction with the outside world must be at a fixed temperature.
Comment: If you accept the entropy maximum principle and its consequence that $S$ is a concave function of its variables from below then it follows that $F$ and $U$ and $G$, etc., (the various potentials by Legendre transformations of $U$) are convex functions from below. You can find it in Callen: THERMODYNAMICS AND AN INTRODUCTION TO THERMOSTATISTICS chapters 5 and 8. (This is an excellent book, strongly recommended. Here is  an older edition https://archive.org/details/thermodynamicsin00call/page/16 that you can read online)
Comment: Well, I was not looking for this answer particularly, as I was more into Mathematical understanding of it, I mean is there any way I can prove $d^2F > 0 $ at equilibrium. But, thanks for a great explanation of why F is bounded from below and will have minimum as it is decreasing.


How do you htdigest 400 user accounts?

Question: How do you generate user accounts for 400 users to do a load testing?
Htdigest forces you to type in a password each time, I have tried dos pipes like
echo password > htdigest -c realm username%1

htdigest -c realm username%1 < password.txt

but it is not working...
Answer: You can also check out the python script that trac distributes on their website for htdigest passwords, you can then automate it:
Generating htdigest passwords without Apache
They also suggest something along these lines will work:

It is possible to use md5sum utility to generate digest-password file using such method:

$ printf "${user}:trac:${password}" | md5sum - >>user.htdigest

and manually delete " -" from the end and add "${user}:trac:" to the start of line from 'to-file'.

I have tested this on FreeBSD, not sure if this will work on Linux or Windows, so you may need to modify it a little:
(echo -n "user:realm:" && echo -n "user:realm:testing" | md5) > outfile

outfile contains:
user:realm:84af20dd88a2456d3bf6431fe8a59d16

Same thing with htdigest:
htdigest -c outfile2 realm user

output in outfile2
user:realm:84af20dd88a2456d3bf6431fe8a59d16

They are both the same, thereby proving correctness of the command line implementation!
Comment: On GNU/Linux one could use (adapted from the FreeBSD command above): `(echo -n "user:realm:" && echo -n "user:realm:passwd" | md5sum - | cut -d' ' -f1) >> outfile`
Answer: (Aside: On unix/linux the first one should be:
echo password | htdigest -c realm username$1

)
As htdigest doesn't have any nice way to pass the password in, I would use expect to automate the process.
An example from http://www.seanodonnell.com/code/?id=21:
#!/usr/bin/expect
#########################################
#$ file: htpasswd.sh
#$ desc: Automated htpasswd shell script
#########################################
#$
#$ usage example:
#$
#$ ./htpasswd.sh passwdpath username userpass
#$
######################################

set htpasswdpath [lindex $argv 0]
set username [lindex $argv 1]
set userpass [lindex $argv 2]

# spawn the htpasswd command process
spawn htpasswd $htpasswdpath $username

# Automate the 'New password' Procedure
expect "New password:"
send "$userpass\r"

expect "Re-type new password:"
send "$userpass\r"

It's left as an exercise to the user to convert this for Windows if required.
Answer: Here is a script that will read in a list of user names, generate a random password for each, and output them to both an htdigest file, and a plain text file. It has been tested on Linux, but may need to be modified for other systems. In particular, md5sum may be md5, and head does always accept the -c flag.
#!/bin/bash

# auth realm for digest auth
AUTH_REALM=MyRealm

# file locations

# a file containing a list of user names,
# one name per line, e.g.,
# $ cat users.txt
# joe
# curly
# larry
USER_FILE=users.txt

# htdigest file, needs to exist
HTDIGEST_FILE=passwd.htdigest

# insecure password file
PASSWD_FILE=passwd.txt

# read the names from the user file
while read username
  do
  # generate a pseudo-random password
  rand_pw=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8`

  # hash the username, realm, and password
  htdigest_hash=`printf $username:$AUTH_REALM:$rand_pw | md5sum -`

  # build an htdigest appropriate line, and tack it onto the file
  echo "$username:$AUTH_REALM:${htdigest_hash:0:32}" >> $HTDIGEST_FILE

  # put the username and password in plain text
  # clearly, this is terribly insecure, but good for
  # testing and importing
  echo "$username:$rand_pw" >> $PASSWD_FILE
done < $USER_FILE

This is what the input and results look like, first the user names file:
$ cat users.txt
joe
curly
larry

Running the script:
$ ./load_users.bash

The resulting htdigest file:
$ cat passwd.htdigest
joe:MyRealm:2603a6c581f336f2874dbdd253aee780
curly:MyRealm:fd3f9d87bba654439d5ba1f32c0286a8
larry:MyRealm:c1c3c0dc50a9b97e9f7ee582e3fce892

And the plain text file:
$ cat passwd.txt
joe:aLnqnrv0
curly:3xWxHKmv
larry:7v7m6mXY

How do you htdigest 400 user accounts?


Install PDO on OS X Leopard

Question: What's the easiest way to install PDO on the default php installation of OS X Leopard?  I'm trying to get ModX running.
Answer: It can be a hassle to build PHP extensions with the Leopard default PHP. If you are just doing development work, look into MAMP, which has a whole bunch of extensions (including PDO for MySQL and PostgreSQL) built-in. It includes its own copy of Apache so you won't be using the OS X default Apache. Don't worry, there's no installation needed.
A second option is Mark Liyanage's PHP package which is a PHP module that you use instead of the one that comes with Leopard, but has a lot of extensions built-in.
MAMP is easier, but Liyanage's package works with the built-in web server.
Comment: Not exactly what I was hoping for, but using Entropy (Mark Liyanage's package) worked great.  No conflicts and no problems.  Thanks
Answer: If you're looking for something that's a little bit more robust than MAMP, I'd recommend Zend Server Community Edition. It's similar to MAMP, but gives you more control over your server environment.
Comment: Disclaimer: Only for Intel macs.

Install PDO on OS X Leopard


Stainless steel ladies bike frame failure?

Question: i am new to this group and this is my first post. My Japanese Miyata ladies bike had this problem for so long time.  The down tube had come out for about 3mm from its connecter.  It looks like there is no welding in it.  The frame is made of stainless steel and the 3mm gap remains same (i often check it after every ride ) for years.  Is is repairable ?  or should i continue using ?  Thank you.
Answer: In principle, this is likely repairable if you can find a competent framebuilder. They will know how the down tube was originally joined to the bottom bracket lug. However, we don't know if it will be cost effective.
Usually tubes are brazed to lugs using bronze or silver. You can verify that the tube is disconnected by trying to move it in and out of the socket. Anyway, a competent framebuilder could probably determine the brazing material, and determine how they would conduct the repair. The problen is that the labor to redo the bicycle would probably be more than the cost of a used replacement. Also, as far as I know you should be able to braze stainless steel, but if the bike is really that material, framebuilders probably won't be used to working with it - it's normally a premium material used for some custom steel bikes. There might be something about its material properties that doesn't play well with usual brazing equipment.
Comment: I think you underestimate the value of the frame: a repair will likely always be cost effective if it's possible.
Comment: @noise Doesn't that very strongly depend on the country OP is in? It seems at the very least you need to disassemble the bike to get the frame out. A few hours of local labor cost more than an entire used bike in Western Europe or the US.
Comment: Plus framebuilders are a skilled service and they should charge accordingly, plus it depends on how you figure the replacement cost. Buying a cheap used bike might be as much as a repair.
Comment: But it's a stainless steel frame on a bike with a belt drive. if you don't care for the bike, that's ok, but this one is unusual and has been chosen specially
Comment: Though to be realistic, this should be covered under warranty as it appears to be a current model


Listing all users and their personal site in SharePoint Online

Question: I would like to get a list of all users and their personal sites (mysites). (This is supposed to run on SharePoint Online from an app or a timer job.) I have tried all day but I can't get past the first step: i.e. to get all users in the tenancy. Anyone know how to?
Answer: I would try using Search REST API for this. The API can be used to query User Profiles and return the path to their My Site. You could even create a A-Z directory if you wanted. Very easy to do with search.
Answer: The following technet artcile should help -
https://technet.microsoft.com/en-us/library/dn911464.aspx
Comment: Provide brief explanation of answer along with reference link to allow other users to understand the answer rather than opening the link each time.


How do I disable gizmo and get hotkeys back?

Question: Recently installed blender v 3.1.2. I've always used hotkeys G+X/Y/Z to move objects, or r to rotate and s to scale. After downloading the new version, I couldn't use the hotkeys and pressing g/r/s will show the Gizmo thing, even when I didn't check the Object Gizmo boxes. If I turn off the 'show Gizmo' tab, I can't move the objects at all. Help T.T
Answer: You can export the Keymap Preferences from old verison if uninstall not yet.

Other solution:

Right click the Gizmo and Remove Shortcut.

Right click to change stortcut

Or set shortcut in Preferences
Comment: It's also possible that OP selected the modern keymap of blender when first opening the splash screen on new install. IIRC opening a new install post 2.8 would ask if you wanted to use the older style keymap or the new one with the emphasis on tool widgets, standard keymap etc. Maybe just reinstalling and opening a new install again and checking that box would take care of all these kinds of issues that might crop up in one fell swoop.


Linux distribution on USB stick used to banking for begginers

Question: Is it good idea to use up-to-date Linux on USB stick instead liveCD to online banking?
What is the best Linux distribution for not advanced people who commonly use Windows to make online payments safely?
Answer: Yes, using a second separated system will protect your privacy much more like doing this kind of stuff on the same PC. You can use ANY Linux distribution for this and there could be battles over which one is better, but since you already said you are a total beginner, I would suggest you to try out Ubuntu at the start, since it's a very user friendly distro and has a big community. However, if you have a special focus on privacy, you could also consider Tails, Whonix or Qubes which are all more designed for privacy enthusiasts.
Also it should be noted that Live Systems are not really that necessary nowadays where we have huge USB sticks. Nowadays you can mostly just install the distros on the sticks directly as if they were hard drives.
Comment: +1 although live systems still have the advantage that _you know_ that no session info, or history, or malware persist between reboots, if you're worried about that sort of thing.
Comment: But malware cannot change files on liveCD. On USB stick it can. On the other hand liveCD is usually not up-to-date.


Static temperature

Question: A Professor of Fluid Mechanics a told that the static temperature is the temperature observed when the relative speed between observer(thermometer) and fluid is zero.
I have trouble understanding as to how will the temperature of fluid depend on the reference frame since temperature is a quantity which should be a function of Static Pressure and not Pressure itself.
How can the temperature of a body depend on its speed?
Answer: Moving fluid has kinetic energy which will be converted to internal energy if the flow changes. This is straight-up first law.
So you might consider air blowing through a venturi for instance; if you were to insert a thermometer at different points along the airflow, you would measure different temperatures as the airflow accelerates and decelerates.
Comment: But if the fluid motion is assumed uniform and steady, and two thermometers, one moving with same speed as fluid, other stationary with respect to ground. Then shouldn't both thermometers read the same temperature?
Comment: No! How do you measure temperature? You allow the relative motion of one set of molecules to come into equilibrium with the relative motion of another. That will change if the relative motion changes, whether that's macroscopic or microscopic. This is precisely why water is colder at the top of a waterfall.

Static temperature


How to add MS SQL table using python console?

Question: I have MS SQL Server 2008 R2 database. How to add MS SQL Table using python console in QGIS?
Comment: Welcome to gis.SE. To help us provide a better answer, can you expand your question a little (just click edit, above) to tell us more about your specific scenario - database schema, table structure (especially the geometry) and whether you are doing this on the local machine or to a remote server?
Comment: My database is on the local machine. I have a table with 2 fields:id (int) and shape(geography).
Comment: Mari: Its easier to understand if you actually update the question, rather than just putting the details in comments. You can amend the question text by clicking "edit" below the question.
Answer:
Each data provider has its URI and its provider key. Once added via User Interface, it's easy to collect them and use them from the console.
Enter this statement in your python console, to collect the URI and key for all map layers:
for layer in QgsMapLayerRegistry.instance().mapLayers().values():
    uri = layer.dataProvider().dataSourceUri()
    providerKey = layer.dataProvider().name()
    print("URI:\n%s\nKey:\n%s\n" % (uri, providerKey))

to create a new map layer based on this information:
Vector Layer
vl = QgsVectorLayer( uri, 'MyLayerName', providerKey )
QgsMapLayerRegistry.instance().addMapLayers( [vl] )

Raster Layer
rl = QgsRasterLayer( uri, 'MyLayerName', providerKey )
QgsMapLayerRegistry.instance().addMapLayers( [rl] )

The key for MS SQL is 'mssql'
The uri follow the QgsDataSourceURI standard, which has an example in the PyQGIS cookbook chapter Loading Layers, Vector Layers. MS SQL works analogue to postgres.
The above example duplicates just one layer, but prints the necessary information to add each of them and gives an idea about the principle.


TeX program conceivable at all which produces output other than .dvi or .pdf directly, e.g., .rtf/.doc/.docx

Question: Donald E. Knuth's TeX outputs .dvi files.
Hàn Thế Thành's pdfTeX outputs .pdf files.
Is a program rtfTeX or docTeX or docxTeX conceivable that instead of .dvi or .pdf directly outputs Word .rtf or .doc or .docx files?
If not: Why is it impossible?
Is this impossible due to the characteristics of the output formats in consideration, so that it is not worth thinking further into this direction?
Are there issues regarding output formats like rtf/doc/docx being proprietary?
Comment: AFAIK, docx isn't proprietary, but a zipped documented xml structure (though, again AFAIK, the docx output by Word makes those xmls unnecessiraly complicated). Also those formats don't define page layout as precisely as pdf or dvi. But I think the most crucial point is: This doesn't exist because no one bothered (yet?).
Comment: [Make4ht](https://ctan.org/pkg/make4ht), maybe?
Answer: At the suggestion of Ulrich D.:
There are several issues. The the most basic level, which Ulrich already discussed, is the problem of workflow. But even if that is not the issue, there is the difficult problem of syntax. TeX is primarily intended for mathematics. Word processors are not. Visualize a conversation between someone doing Algebraic Topology, and someone doing Postmodern Deconstruction of literature. The underlying terminology is very different. You cannot "convert" between them.
If you use TeX only for literary work, where that markup involves little other than the occasional large type or Italics, then it
is reasonable to strip a few standard TeX macros, and insert XML.
And if you have XML with a very limited style sheet, it might be possible to strip the XML and insert TeX markup. I believe this has been done, with unknown (to me) results.
But that is not good enough. Going from TeX to XML would require using only a very limited number of TeX macros, in very limited contexts, and without custom macros. Going from a word processor output (which may be XML) is headache, because the XML is far more complex that it needs to be. For example, take what is probably the simplest word processor, AbiWord. Its native *abw format is XML, and can be read as plain text. Yet it is mind-boggling, even for a simple "hello World" text document.
And in the end... Even if all that could be done, the printed results would differ. TeX (and its varieties) and the various word processors use algorithms for determining exactly where each character will be printed on a page. The algorithms differ, and are likely to be proprietary. So, the printed results will look
different, possibly even with different paragraph breaks and pagination. It gets worse,if there is active content (links, etc.) or forms.
Your best bet is to manually strip TeX code from a document, and send plain text. Have the word processor export as plain text.
EDIT:
Comparison: Hello, World.
Plain text: 14 bytes, including the final line ending.
AbiWord document, readable as plain text XML: 2468 bytes.
HTML, as exported from AbiWord (with styles): 1416 bytes.
HTML, above manually edited to minimal markup, no styles: 253 bytes.
Rich Text Format: 2472 bytes.
PDF from AbiWord: 5561 bytes.
Ultra-minimal helloworld.tex: 70 bytes.
Above compiled PDF: 3390 bytes.
Comment: @cfr Does anyone use TeX for literary work? Yes! Me! I am the developer of the `novel` document class, for print-on-demand fiction. Several other folks have used it. But that is not the kind of literature you envisioned. As for myself, if I find a book with more complicated markup than Italics, I put it down. Well, OK if it has pictures.
Comment: 'TeX is primarily intended for mathematics.' I don't think that's true, at least as Knuth conceived it. I wonder if anybody does use TeX for 'literary work' with very little markup. I suspect if you're in the humanities and using TeX, for example, you have very strong motivations to use it and those tend to revolve around either logic or similarly technical material or because you want to use powerful markup or both. (You didn't say anybody fell into this category, but I think it's important to be clear that non-mathematical uses are not limited to the odd `\textit{}`!)
Comment: I'm not talking about complicated markup in the result, though *any* document has more than that. Do you put a book down because it has page margins, epigraphs, page numbers or footnotes? Probably not. I have a highly customised class for producing teaching materials. I do not teach mathematics. Mostly I use it for ethics, as it happens. The kind of markup I'm talking about is the kind which lets me use standard text repeatedly, with variations, to link student names to entries they're writing for a class glossary, to spit out custom-headings and fancy boxes, multiple tables of contents etc.
Comment: It's markup when you say `\chapter{}` or when I say `\taflen{intro,bibkey=keyname,focus on={1-3,5-6},no bib,title={Title},multiauthored,excl={key2,key3}}` or whatever. This isn't 'literary'. Nor is it maths. Nor is it suitable for turning into a docx.
Answer: About twenty five years ago I thought about this, too, and came to the conclusion that the benefits would be limited:
Word processors provide for input, editing, formatting, and output of text.[1]
Thus, input file and output file is the same with word processors.  Input/output files of word processors (.rtf/.doc/.docx) are to be edited directly, using the word processor.
TeX is not a word processor. TeX is a typesetter and provides for input (in the sense of reading .tex input files), formatting and output of text, but not for editing. Input file and output file is not the same. TeX's output files (.dvi/.pdf) are not intended to be editable directly easily by the user. Instead, one edits the .tex input file and (re)compiles.
These two workflows are not that compatible:
Assume two people work on the same project.
One of them uses the hypothetical program docxTeX and edits .tex input files and (re)compiles to get .docx output.
The other one does not work with .tex input files but edits the .docx files in a word processor like Libre Office or Word or whatever.
The other one's changes to the .docx files will not be reflected in the .tex input files.
Thus the .tex input files and the word files are easily out of synchronization.
So back then I came to the conclusion that thinking about the question whether implementing such a program is feasible is not worth it due to the incompatibility of the two workflows of modifying the content of the final output files.

References:

[1]
Wikipedia contributors, "Word processor," Wikipedia, The Free Encyclopedia, https://en.wikipedia.org/w/index.php?title=Word_processor&oldid=1175641306 (accessed September 21, 2023).
Comment: Exactly. In any case, even if the syntax could be exchanged (not unreasonable for non-math text), PDF may adjust the position of individual characters as they are placed. A word processor can also do that, but the algorithms are utterly different. So, in the best case imaginable, the results would nevertheless look somewhat different.


Integration from SalesForce into a SharePoint Dashboard

Question: Our Sales teams are tracking their sales objectives on SalesForce and they would like 2 of the reports (graphics mostly, as shown below) to be visible from their SharePoint team site. Is it possible? If so, how?
Answer: I dont think you can do it without 3rd party tools.

1st you need a connector to connect the Salesforce and SharePoint.
Then develop a Dashboard in SharePoint on the base of data.

http://www.layer2solutions.com/en/community/FAQs/cloud-connector/Pages/Office-365-Salesforce-Integration-Migration-Replication.aspx
http://www.slideshare.net/Netwoven/integrating-salesforce-and-sharepoint-2013
Answer: Agree with @WaqasSarwar, there is no direct way since Microsoft has not developed any direct API that plug in data from Salesforce to Sharepoint.
Just expanding on the answer, there are 3 ways you can achieve this:

Integrating using a third party system installed adapter
Integrating using a Microsoft Azure hosted service
Integrating using a third party integration service.

Indepth steps for all 3 methods here.


Watchkit doesn't see Parse Framework

Question: Previously implemented Parse by dragging and dropping files into my projects Frameworks folder.  Because I needed to utilize another 3rd party library, I installed this library using cocoapods (and must use the workspace now instead of xcode project).
Since I had a podfile now, apparently Xcode was looking to it instead of my Frameworks folder because it didn't recognize the library...so I deleted the frameworks from the project and installed Parse through cocoapods.
My main app looks fine now, however now my Watchkit Extension classes do not recognize the module Parse.
This is what my Watchkit Extension Linked Frameworks and Libs looks like... I don't understand the red?

I think the problem is that my search paths in my Build Settings of WatchKit Extension are pointing to the old Framework files instead of the new one....but I'm not sure where to set these search paths to point toward my Pods?
Answer: Make sure that when you click on the bolts / parse framework / cocoa pods that the target for watch kit extension is also ticked.
Comment: thanks but I'm not using cocoa pods...just dragged frameworks manually, but Watchkit is seeing Parse fine... again I can query 1 level deep and return, just not 2...

Watchkit doesn't see Parse Framework


Does this boiler flame look ok?

Question: This is my natural gas hot water heating boiler flame.   It lights up initially with a fair bit of orange flame, and after 10 seconds or so settles into what's pictured.  I believe it mostly looks as it should, but there are several parts of the flame burning orange.  How bad is this?  I know I should clean it, which I'll do in the spring.  This doesn't need immediate attention does it?   I have a CO detector nearby, reading 0 all the time.
Answer: Cleaning the burners every few years or so is always a good idea, because loose debris accumulates on and around the burners.  This debris gets sucked into the flames, causing those intermittent yellow bursts, as seen in the picture.
But, the flames in the picture look normal otherwise.

Does this boiler flame look ok?


Hide source of particles

Question: I want to hide the particle source (tree), but so that the forest itself is displayed. In 3d viewport this works, but only particles of the pie are displayed on the render. The differences are that the tree is used as a collection, the cake is used as an object. But if I use the tree as an object, then it will be without leaves, despite the fact that the leaves are children. I want to just hide the tree, but render the forest.
Answer: I solved it this way: I turned off the tree collection on the current layer, but created a new layer and there the tree collection is turned on. Still it's not comfortable, but that's all I have

Hide source of particles


Check If Arduino has FET

Question: I have read that Arduino can be powered by both 12v from dc jack and from USB as it is equipped with FET which takes power from only one input. At the same time I read that many people destroyed their arduino as they were not equipped with FET. How do I know if mine has one? Basically I want to power from 12v and open Serial Monitor on USB.
Comment: *I just wanted to confirm If I can connect both USB and 12v at same time?* This depends on the model of Arduino and what the schematic of that model is. There is no straight answer unless we **exactly** know the design. Also explain **why** you need to power the Arduino from 12 V when you already have a 5 V available through USB.
Comment: What arduino model do you have? The arduino uno and some others accept 5v to 12v. Your best bet is to check the arduino site. See the "tech specs" tab here: https://store.arduino.cc/usa/arduino-uno-rev3.
Comment: @JustinBuchanan I just wanted to confirm If I can connect both USB and 12v at same time? 12v + 5v
Answer: This is an example of Arduino with FET:

Check if you can find a similar component or add a clear picture of your board so we can assist you with it. Or just indicate the type and version.

Check If Arduino has FET


Is plant photosynthesis more efficient than solar panels?

Question: Is photosynthesis more efficient than solar panels?  If so, by how much?
Comment: It would help if you could define what you mean by "efficiency". Solar panels work by converting radiation to electricity, while photosynthesis uses radiation to synthesize sugars. It's difficult to meaningfully compare the energy output of the two since the useful work you might do with each is typically quite different.
Comment: @kyle Actually, the 2 processes are very similar; both capture light and excite electrons. If you take just this portion, then you can compare the 2.
Comment: I think this is a nice question, but as Kyle points out efficiency is kind of ambiguous.  For instance, if you are talking about ultimate conversion into energy in the grid, then you also have to account for the burning of the plant matter to extract its chemical energy.  Perhaps you mean quantum efficiency which tells you number of output electrons per number of incident photons.  In either case, I expect that solar panels are better except in some narrow wavelength regimes.
Answer: Rather than considering quantum efficiencies or such details it's instructive to step back and take a broader view. One of the main fuel crops grown in the UK is miscanthus. There are various figures around for the yield produced by miscanthus, but these people estimate it as about 14 tonnes per hectare per year. The energy content is 19GJ/tonne, so that's 266GJ per hectare per year or about 8.5kW per hectare.
Commercial PV panel installations typically produce 500kW per hectare (NB the link is a PDF) though this is peak power and would be a lot less averaged over the year. However, even if averaging over the year reduces the yield by a factor of 6 this still leaves the PV panels producing ten times as much power as miscanthus per hectare.
For comparison the intensity of sunlight at midday is around 10MW per hectare.
Incidentally, I don't mean to belittle miscanthus. PV panels are vastly more expensive to make than miscanthus is to grow, and we have yet to persuade PV panels to reproduce themselves. Both have their role to play in supplying energy.
Comment: Further to your last paragraph and maybe of interest to the OP: biofuel is portable, like oil: a property we have yet to really reproduce in solar. This property is vital for mechanised agriculture: hence the reason for keen interest in battery technology, and hydrogen fuel cells (hopefully both will allow solar to be stored and used for agriculture in the future). Also, there are many more hectares in the world that could be solar hectares toegther with other uses (rooftops for example): the ones that can be miscanthus hectares are far fewer in number.
Comment: [Hemp is a considerably more efficient bioenergy feedstock than the dominant annual energy crops.](https://www.researchgate.net/publication/257126475_Hemp_A_more_sustainable_annual_energy_crop_for_climate_and_energy_policy) algae and bamboo [even more so](https://gist.github.com/CTimmerman/2725a5aa5bbbb24efe69218a947051f5).
Answer: Photosynthesis is less efficient than solar panels. According to the Wikipedia page on photosynthetic efficiency, typical plants have a radiant energy to chemical energy conversion efficiency between 0.1% and 2%.
Most commercially available solar panels have more than 10 times this efficiency.
Comment: That page doesn't mention algae ([up to 98% efficient?](https://www.uu.nl/en/news/ingenious-control-panel-in-algae-provides-blueprint-for-super-efficient-future-solar-cells)) and bamboo ([up to 87% efficient?](https://www.sciencedirect.com/science/article/abs/pii/S1359431119323555)).
Comment: @CeesTimmerman These numbers cannot be total efficiency. The Wikipedia article talks about how there are different measures of efficiency, and for total efficiency, there is a theoretical maximum of around 11%
Comment: @stochastic Explain why `while plants only store an average of 12 percent of the energy, algae can store up to 98 percent. "That enormous degree of efficiency makes algae ideal for energy storage and conversion", explains Sem Tamara, PhD Candidate at Utrecht University.` is incorrect.
Answer: The big difference is that plants are "storing" the energy, and solar cells are not. The utility of stored energy is much greater than the output of something like a solar cell.
Comment: A Tesla Powerwall (old car battery) is over 90% efficient. Passenger car diesel engines have energy efficiency of up to 41% but more typically 30%, and petrol engines of up to 37.3%, but more typically 20%.


What kind of Crocosmia are these?

Question: There are many of these Crocosmia growing in my garden in South East England and I would love to know the exact type. They have just started blooming in the last week or so.
Comment: Can you add another photo taken from further away, showing the whole plant please? Need an idea of leaf to flower ratio, growth habit and its height and spread
Comment: Ok just added another photo. If it helps the max height of the foliage is about 70cm. It's popping up all over the place which is fine as I really like it. Just wish I knew more about it! Thanks
Answer: It is the one that grows wild here in the UK, commonly known as Montbretia, latin name Crocosmia crocosmifolia. Originally a French cross between two other crocosmia, it was introduced to the UK in 1880 as a garden plant, but escaped and spread widely from 1910 or so onwards. It is often seen in hedgerows in Cornwall particularly, but also Devon and Wales, and on wild land in the south east generally, as well as being ubiquitous in our gardens. You will not find it for sale anywhere, it's usually acquired by donation from someone else, or just appears. Newer hybrids and varieties generally have stiffer leaves, are often taller, usually flower a little earlier than yours, and the flower colours range from yellow through to bright red. Crocosmia 'Lucifer' is one of the best of the taller varieties.
The only image I can find is within a PDF document, and I have no clue how to link to this - it's a page on Montbretia from the GB Non Native Species Secretariat. Although there are other sites that come up if you Google montbretia, none of them show the now endemic variety which grows wild in Cornwall and the South East - they all show newer varieties.
Comment: Thank you so much for the information.  I found the page you are talking about and it seems to fit the description perfectly!
Answer: It seems to be Crocosmia Lady Hamilton.
It's the best matches of descriptions found on Garden Guides:

"Lady Hamilton" dons upright flower spikes filled with golden yellow blooms with centers blushed with apricot-yellow hues. It grows 24- to 30-inches tall.

What kind of Crocosmia are these?


Speedup Image comparison

Question: I'm looking for an algorithm, that would do image comparisons at real time, basically on images acquired from a webcam (like 30 frames/second). My current implementation is pretty slow, tired to improve it by dropping a few frames and reducing the resolution -- but with no success.
So, I'm exploring options like using better algorithms like Key-point Matching etc. And on a different note, I'm also looking for a GPU based image comparison sample implementations (either DirectX or OpenGL APIs).
Answer: Have you tried Perceptual Image Diff?
Answer: I didn't read the entire thread but it may help you somehow
Image comparison - fast algorithm

Speedup Image comparison


Fully Healing after being Stilled/Gentled

Question: So when someone who has been stilled/gentled is healed by someone of the same gender, they are only healed to 1/3rd of their original power. If, after being healed to 1/3rd of their original power, they are stilled/gentled again and then healed by a member of opposite sex, can they recover 100% of their original power?
Comment: Welcome to SFF.SE! Very interesting question - what counts as "original" power after a second stilling/gentling? But I suspect there's no canon answer. Even in-universe this would make sense, since AFAIK there's nobody who's _been_ stilled/gentled twice. So the answer is probably "no way of telling", but maybe someone will come up with a relevant quote.
Comment: I got the impression when I was reading, that you could restore someone to their pre-stilled power, but the weave needs to be different for women than for men. Nynaeve used the exact same weave to heal Siuan and Leane that she did for Logain, which, while it worked, reduced their power. I think if she had spent more time thinking about it and tweaking it, she could have healed them back to their previous power. But this is all speculation on my part.
Comment: Thanks Rand. By original power I mean the level of the One Power they could channel before being severed the first time.
Answer: From the mouth of Robert Jordan himself, "RAFO", for those unsure what this means, read and find out, was Jordan's response to questions that were either spoilers or he himself had not yet decided.

QUESTION:
Siuan and Leane being stilled again and Healed by a male to full
  strength...
ROBERT JORDAN
"RAFO, because I might decide to use that as a plot device!" (That got
  a few chuckles).

Number 13
So we know Jordan thought about this, however, he died before ever confirming what would happen.
This quote leads me to believe though, that it would be possible to heal someone again, and to full power, he was just debating actually using this in the plot or not.
Also Number 10 Confirms OP's claim that healing done by the opposite gender is required for 100% healing.

ROBERT JORDAN
For Alys Kinch, the Healing of stilling must be done by the other
  gender to be fully effective. A woman Healing a woman or a man Healing
  a man results in less than full restoration. It all ties into that
  theme I keep harping on. Men and women have to work together to be
  their most effective. And while the weave used by Flinn for Healing is
  not exactly that used by Nynaeve, either would use the same weave on a
  man or a woman.
Comment: Note that the novels may be finished but there are still rumors of a WoT encyclopedia, to include informatin from Jordan's notes that never made it into the books. Perhaps there will be an explanation of severing and healing it.
Comment: @MichaelEdenfield there not rumors tor has a release date for it in November 2015 i believe. until then this is as good as OP can get after scrolling through about 10 pages of interviews about gentling and stilling lol. http://www.tor.com/2015/01/07/wheel-of-time-companion-cover-release-date/
Comment: Very nice effore Himarm. So apparently we are to wait till (and if) there's a WoT encyclopedia released by Tor.
Comment: @6packkid This is the answer, from his own words, its only speculative if the encyclopedia will expand on this, the interview i pulled this from is right before he got sick so im not sure if you should wait around and hope.
Answer: In The Wheel of Time Companion, we finally get a canon-answer to healing being 100% effective, rather than just the interview quotes or educated guesses we were previously left with. (Interview quotes from Jordan were sometimes subject to change).
Under the entry for Logain Ablar:

Logain was accidentally Healed by Nynaeve; the rebel Aes Sedai held him prisioner while they decided whether or not they could afford to gentle him again, give Rand and his amnesty. Since Leane and Siuan were not as strong as they once were after being Healed, the rebel Aes Sedai assumed that Logain wasn't either; none of them knew that this Healing needed the opposite sex for completeness. In fact, because he had been Healed by a woman, he was just as strong as ever.

We also see that Damer Flinn healed three Aes Sedai that were stilled at Dumai Wells, and they didn't seem to be any worse for the wear.
We are never given any evidence that anything special happens when gentling/stilling someone that's already been Healed of the same affliction.
It never happens in the books, so Jordan's "RAFO" meant that we actually "find out" nothing. We can only assume that:

They'll be healed to their original power levels, as it'd be like taking a poorly-fit bandage and putting a proper one on
They'll only be healed to their post-Healing levels, as the first healing capped them

Unless additional materials are published, we'll never know. The Companion was the last major addition to The Wheel of Time planned, and Robert Jordan is no longer with us to give Word of God answer.
Comment: OK, the *Companion* is officially crap. "the rebel Aes Sedai assumed that Logain wasn't either" is just wrong. They're aware right from the start (LoC chapter 30) that he's as strong as he ever was. I'll find the relevant quotes later.
Comment: Also, this isn't an answer to the question. The OP is perfectly aware that "when someone who has been stilled/gentled is healed by someone of the same gender, they are only healed to 1/3rd of their original power"; they're asking whether such a person could then be stilled/gentled again and *re*-Healed by someone of the opposite gender to their original power. Your answer doesn't address this issue.
Comment: @randal'thor 1) There's speculation about his strength from Nynaeve, but it's not the rebel group as a whole who voice it. 2) The *Companion* foreword indicates possible errors. Maybe a future edition will fix discrepancies. 3) You're right, I updated it.
Comment: I think the point number 2 in the answer above might be as close to an answer to this question as we can get. It seems logical to assume that if a person is stilled, they can only be healed to the level of strength they were stilled at no matter how many times they have been healed/stilled previously.
Answer: Being healed of stilling by someone of the same sex can't be fixed. Nyneave specifically tells Siuan and Leave when they ask her to try again that what has already been Healed cannot be Healed again.


I installed Kali Linux and Windows XP on a Mac using VirtualBox. How can I share a file from Kali with Windows?

Question: I tried to follow the same instructions as you would if you were sharing files between a host and a guest, but the sharing files option did not work.To be more specific, I would like to share a file from Kali and have it on my XP virtualbox.
Answer: The way I dealt with this situation is to make sure that every host has access to the common place where files are. There are 2 scenarios to consider; I will mention file permissions in the 2nd.
One user scenario: host operating system runs virtualbox under your account name. Guest systems (VMs) are accessing the shared folder as if it was a network share mounted the usual way for each VM. So for each VM you need to set up in their Settings - Shared Folders the path to point at the same location on the host. For each of your guests it will be a network share mounted at boot (if you selected Auto-mount). For your host (Mac) it will be the local path you entered in the Shared Folders. You should be able to access files alright because all VMs are running under your account. Situation gets trickier if you have several people log into your Mac and want all of them to be able to run VM's and access the same files.
Multi-user scenario: Because I have several users who may run virtualbox on my main Linux machine and I want all to access the files I have used ordinary group permissions, which Mac also has. As any Unix system Mac also has /home directory, except for you it will be called /Users. I put the VM images in a directory called VM under /home. Then I made sure the images have group permissions that allow all my users to run VMs and I tested that is possible. Virtualbox setup on Linux creates a group called vboxusers and I used that group and made sure all who I anted to run VMs would be in that group.  Then I created /home/VM/folder_share directory and made sure it has rw permissions to that directory to the vboxusers group. Lastly I made sure that all guest VMs have the Shared Folder path to point to /home/VM/folder_share and tested - it works very well.
You do not have to create this shared folder under /Users - you could do it in another place, you just have to make sure permissions work. As my head is often so full with other stuff I thought home - the Linux equivalent of Users is handy because it is logical and because I have /home on a separate disk partition which is left untouched if I have to reinstall the system.
If you are unsure about file permissions - the easiest way is to change them via terminal http://www.chriswrites.com/how-to-change-file-permissions-using-the-terminal/ feel free to ask about permission structure; it is easy to get bogged down if you also need to think about ACLs - my advice would be - if you can get away in your situation with common Unix permissions as seen on ls -l - do that. On Linux I use ACLs only very rarely - it can introduce unneeded complexity.


If I put the bushing wavy side the wrong way will it affect my build? (Technic Ferrari car)

Question: I am on step 81 and just realized that the small parts have a wavy and straight side and that I have to put them a certain way, I'm not sure if all of them are the correct order will this affect my build? If it shows that the wavy side is on the inside and I put it on the outside?
Comment: Could you please clarify which set number you are referring to? LEGO has produced at least 6 Technic/Racers sets over the years with two (42125 and 42143) in just last 2 years.
Answer: Assuming you're talking about Technic Bush :

The wavy side is such that it can interface with studs. For example using a Technic, Plate 2 x 4 with 3 Holes :

As long as the bushing isn't sitting against studs (like the example above), the orientation doesn't really matter.
Answer: I assume your set is Ferrari Daytona SP3 (42143).
The step 81 you refer to looks like this:

In this particular case and most of the time it doesn't really matter which side you place Technic Bush within the model. Well, maybe for reasons of aesthetics you may want to keep symmetry. Modern sets have a tiny ring around both end to reduce surface friction. As long you don't push bush too much it will allow rotation no matter which side you place it.
"Wavy" feature isn't really used that much these days. But the reason one of the ends is wavy is illustrated in answer by Sander De Dycker.
Comment: Thank you so much


What's the best way to find the inverse of datetime.isocalendar()?

Question: The Python datetime.isocalendar() method returns a tuple (ISO_year, ISO_week_number, ISO_weekday) for the given datetime object.  Is there a corresponding inverse function?  If not, is there an easy way to compute a date given a year, week number and day of the week?
Answer: Python 3.8 added the fromisocalendar() method:
>>> datetime.fromisocalendar(2011, 22, 1)
datetime.datetime(2011, 5, 30, 0, 0)

Python 3.6 added the %G, %V and %u directives:
>>> datetime.strptime('2011 22 1', '%G %V %u')
datetime.datetime(2011, 5, 30, 0, 0)

Original answer
I recently had to solve this problem myself, and came up with this solution:
import datetime

def iso_year_start(iso_year):
    "The gregorian calendar date of the first day of the given ISO year"
    fourth_jan = datetime.date(iso_year, 1, 4)
    delta = datetime.timedelta(fourth_jan.isoweekday()-1)
    return fourth_jan - delta

def iso_to_gregorian(iso_year, iso_week, iso_day):
    "Gregorian calendar date for the given ISO year, week and day"
    year_start = iso_year_start(iso_year)
    return year_start + datetime.timedelta(days=iso_day-1, weeks=iso_week-1)

A few test cases:
>>> iso = datetime.date(2005, 1, 1).isocalendar()
>>> iso
(2004, 53, 6)
>>> iso_to_gregorian(*iso)
datetime.date(2005, 1, 1)

>>> iso = datetime.date(2010, 1, 4).isocalendar()
>>> iso
(2010, 1, 1)
>>> iso_to_gregorian(*iso)
datetime.date(2010, 1, 4)

>>> iso = datetime.date(2010, 1, 3).isocalendar()
>>> iso
(2009, 53, 7)
>>> iso_to_gregorian(*iso)
datetime.date(2010, 1, 3)

Comment: Tom: from the formal ISO definition of week 1 (the week containing the first Thursday of the year) it follows that 4th January is the latest that week 1 can start.
Comment: This is a good answer, but it can be simpler. You don't need to work out the start date of the year. See my answer.
Comment: Can you clarify the significance of the 4th of January? Is there a description of the ISO calendar standard somewhere that's appropriate?
Comment: Thanks for this solution. However, generation of `fourth_jan` does not work for me (using Python 2.7), and I had to write: `fourth_jan = datetime.strptime('{0}-01-04'.format(iso_year), '%Y-%m-%d')`.
Answer: As of Python 3.6, you can use the new %G, %u and %V directives. See issue 12006 and the updated documentation:

%G
  ISO 8601 year with century representing the year that contains the greater part of the ISO week (%V).
%u
  ISO 8601 weekday as a decimal number where 1 is Monday.
%V
  ISO 8601 week as a decimal number with Monday as the first day of the week. Week 01 is the week containing Jan 4.

Given a string with year, weeknumber and weekday number, it is easy to parse those out to a date with:
from datetime import datetime

datetime.strptime('2002 01 1', '%G %V %u').date()

or as a function with integer inputs:
from datetime import datetime

def date_from_isoweek(iso_year, iso_weeknumber, iso_weekday):
    return datetime.strptime(
        '{:04d} {:02d} {:d}'.format(iso_year, iso_weeknumber, iso_weekday),
        '%G %V %u').date()

Comment: If you get an error `AttributeError: type object 'datetime.date' has no attribute 'strptime'`, use `from datetime import datetime` instead.
Comment: @yl_low that's absolutely right, not sure why I made that mistake here or why it took so long for someone to notice! All corrected now.
Answer: import datetime

def iso_to_gregorian(iso_year, iso_week, iso_day):
    "Gregorian calendar date for the given ISO year, week and day"
    fourth_jan = datetime.date(iso_year, 1, 4)
    _, fourth_jan_week, fourth_jan_day = fourth_jan.isocalendar()
    return fourth_jan + datetime.timedelta(days=iso_day-fourth_jan_day, weeks=iso_week-fourth_jan_week)

This was adapted from @BenJames's very good answer. You don't have to know the first day of the year. You just have to know an example of a date which is certainly in the same ISO year, and the ISO calendar week and day of that date.
The 4th of Jan is simply one example, because, as Ben pointed out, the 4th of Jan always belongs to the same ISO year and Gregorian year, and is the first day of the year to do so.
Since weeks are all the same length, you can simply subtract the days and weeks between the ISO of the date you want, and the ISO of the date which you know in both forms, and add on that number of days and weeks. (It doesn't matter whether these numbers are positive or negative, so you could choose some other 'fixed day' such as Dec 28th.)
Edit
I corrected this because, as was helpfully pointed by @JoSo, the first day of the Gregorian year which also belongs to the ISO year is Jan 4th not Jan 5th. As the explanation says, it doesn't matter which date is chosen as a reference point, but choosing the Jan 4th makes this choice less 'magic'.
Comment: @GeorgeSolymosi I have used the hypothesis Python testing library to search for any valid `datetime` objects for which this function isn't the inverse of `isocalendar`. It hasn't found any/ See https://github.com/jwg4/qual/blob/master/qual/tests/test_iso.py This isn't a guarantee of course - I would be interested in hearing about any bugs. If you work through the logic of the code, you might or might not be convinced that it does the right thing.
Comment: Could you please tell me, if it does really work flawless in each situation?
Comment: this is more complicated than necessary. Look at Ben's answer or or at Wikipedia. January 4 will do as well and furthermore always lies in the first ISO week of its ISO year.
Comment: @JoSo How is this more complicated than Ben's answer?
Comment: doesn't lie in the first ISO week of its year. You can use any date between Jan 4 and Dec 28, but only Jan 4 always lies in the first week. The choice of Jan 5 is odd if you consider Wikipedia, and you have to calculate with the ISO weeek of Jan 5, which you don't if you take Jan 4. (See my clean-up answer).
Comment: You are right about Jan 4 v. Jan 5. As seem from my answer, for some reason I mistakenly thought Jan 5 was the first day of the Gregorian year guaranteed to belong to the same ISO year. As for your answer, I would say that they are similar in complexity. You make a call to `isoweekday` instead of `isocalendar`. But I would say that yours is less clear - it isn't immediately obvious whether start is a date, a number of days, a weekday, or what, much less what the first timedelta calculation is supposed to be calculating.
Answer: For the next people coming here,  a shorter, single-def, version of Ben's good solution:
def iso_to_gregorian(iso_year, iso_week, iso_day):
    jan4 = datetime.date(iso_year, 1, 4)
    start = jan4 - datetime.timedelta(days=jan4.isoweekday()-1)
    return start + datetime.timedelta(weeks=iso_week-1, days=iso_day-1)

Answer: Starting in Python 3.6, datetime.strptime() will support the %G, %V and %u directives, so you can simply do datetime.strptime('2015 1 2', '%G %V %u').date(). See: https://hg.python.org/cpython/rev/acdebfbfbdcf
Answer: Note that %W is the week # (0-53) which is NOT THE SAME as the ISO week (1-53).  There will be edge cases where %W will not work.
Comment: I sort of noted that in my answer above, any chance you could expand on what those edge cases would be?
Comment: @Tom, years 2009 and 2013, for example.
Answer: I came up with a solution similar to the one posted by Ben James, but using a single function:
import datetime
def getDateFromWeek(year,week,day):
    """Method to retrieve the date from the specified week, year and weekday"""

    year_start = datetime.date(year,1,1)
    ys_weekday =  year_start.weekday()
    delta = (week*7)+(day-ys_weekday)
    if ys_weekday<4:
        delta -= 7

    return  year_start  + datetime.timedelta(days=delta)

I tested it out with boundary values such as the last week of 2020 and first week of 2021, and it worked out pretty well.
Answer: EDIT: ignore this, the edge cases are a pain. Go with Ben's solution.
Ok, on closer inspection I noticed that strptime has %W and %w parameters, so the following works:
def fromisocalendar(y,w,d):
   return datetime.strptime( "%04dW%02d-%d"%(y,w-1,d), "%YW%W-%w")

A couple of gotchas: The ISO week number starts at 1, while %W starts at 0.  The ISO week day starts at 1 (Monday), which is the same as %w, so Sunday would probably have to be 0, not 7...
Comment: Which version are you using?, I was testing on 2.4.2 and didn't work for me, found http://bugs.python.org/issue1045381 but says it's done on 2.3
Comment: This looks like you answered it.  Why not accept your answer?
Comment: @Tom:  S.O. does let you accept your own answers.  See this discussion on meta:  http://meta.stackexchange.com/questions/9933/is-there-a-convention-for-accepting-my-own-answer-to-my-own-question
Comment: @GreenMatt, yeah, that feature's new since I made that comment.  And this answer isn't as good as Ben's anyway.
Comment: @Tom:  Oops!  Didn't catch that this was from '08.
Comment: this is failing in 2012/2013


Calculate percentage change between two values

Question: I've searched a sea of results but haven't found a solid answer to my specific question. Hopefully someone can help me out. I'm using cells C2,D2, and E2. Here's what I'm after. In cell E2, if C2 is greater than D2, E2 must display C2-D2/C2x-100, or if C2 is less than D2, E2 must display C2-D2/C2x100. The formula for those interested is stocks, if the current price of a stock is less than the opening price of the stock, display the percentage decrease (negative number) and vice versa.
Comment: Welcome to [Web Applications Stack Exchange](https://webapps.stackexchange.com/tour). Consider sharing a publicly editable [sample spreadsheet](https://webapps.stackexchange.com/a/138383/269219) with _realistic-looking_ data, and showing your _hand-entered_ expected results there.
Answer: You are probably looking for this:
=iferror( (C2 - D2) / D2 )
With the current price 101 and opening price 100 this will give 1.00%.
With the current price 99 and opening price 100 this will give -1.00%.
That is however not what you asked for. Your description calls for the result to always be a negative percentage, because you specify that the denominator should take the sign that is opposite to the sign of the numerator. I think this formula implements what you are asking for:
=iferror( (C2 - D2) / (C2 * sign(D2 - C2) * 100) )
With the current price 101 and opening price 100 this will give -0.01%.
With the current price 99 and opening price 100 this will also give -0.01%.
Alternatively, taking your description literally, we get:
=iferror( C2 - (D2 / C2) * sign(D2 - C2) * 100 )
...which gives 20000.99% and -201.01% with the above inputs.


Splicing help due to no power

Question: So, I have had a buddy lead the way on wiring my basement of a basement finish in a home built in 2017. The builder ran two wires from the panel in the garage to facilitate the finishing of the basement. Of course, now my buddy is on vacation for 2 weeks and I'm at the point of hooking up all my receptacles (so I thought). We spliced the two wires coming in I've attached a picture of that. When testing for power in boxes, I've only got about 60% with power. I'm assuming this has to do with the way the hots are together. Is it about just playing around with them and figuring out the best match? Any insight is much appreciated.

Click for larger
Comment: Don't experiment. There are many combinations that you'll stumble upon, that *will work* (mission accomplished, button it up) *but will kill you*.
Comment: Ummm.. what? Can you provide another picture that clearly shows how many cables enter that box? I can see 2 in the top and it appears that there's one in the bottom, is there a 4th? Also, what are you attempting to accomplish here? Is there supposed to be a switch or two? Outlets? Some of each? Is this just a junction where you're not going to put anything into this box, just have the power flow through to other places? MOAR DETAILS!!!
Comment: There are 5 cables entering the box. The 2 that the builder put in running to the panel, and there are 3 going out to the basement. This is just a box to splice as the 2 cables the builder put in are only long enough to reach this area. Hope that makes more sense, sorry.
Comment: The builder didn't put 2 cables in running from the panel just because he had some spare cable lying around. Look at where those cables connect in the panel - they're almost certainly on 2 separate breakers, and those breakers may well be on *different phases*. *Those wires should not ever be connected together!*
Comment: They were not connected to the panel. Simply ran into the basement for future use.
Answer: Stop. Now!
Honestly, the follow up questions you've been asking lead me to believe you really don't understand how this works and I'm growing concerned that you could seriously hurt yourself!
I'm all for you learning to do this yourself, however, electricity can be deadly if you don't know what you're doing, and I don't want your family coming here after you're gone to blame us.
Wait until your buddy gets back from vacation and learn from him with hands on experience. Have him explain things to you, show you how to do it right, and how to avoid doing it wrong.
Waiting 2 weeks is far better than being dead or burning down your house. When he gets back, have him read this (and other answers) to your question, and show you how it works.
Seriously heed Harper's advice from a comment on your question:

Don't experiment. There are many combinations that you'll stumble upon, that will work (mission accomplished, button it up) but will kill you.

You've got 2 circuits in (A and B) and 3 outbound "circuits"* (1, 2, and 3).
Assuming that you want:

lines 1 and 2 to be on breaker A

put one wire nut each on all 3 White, all 3 Black and all 3 Ground wires from each of the 3 cables

line 3 will be on breaker B

Put one wire nut each on the 2 White, 2 Black and 2 Ground wires involved

If your desired connections are different, then rearrange them to match to suit your needs.
You should not need any pig-tail wires anywhere in this box. In no case will you need more than 3 wires nutted together, so, using the correct size nuts, there is no need for pig tails at all. It appears that there's a white pig tail from the nut at 12 o'clock connecting to the nut at 4 o'clock (though it may just be the angle causing confusion). If you can find ANY path between breaker A and breaker B you've done it wrong.
While you have the box open and things are fresh in your mind, I would strongly urge you to label the cables so you know which is which next time you open this up for repairs/modifications. A Sharpie applied to the white cable housing (Breaker A, Ceiling Lights, etc.) or a fancy label maker will do the trick.
* No, they're not really circuits - a circuit is based on the breaker and you only have 2 involved - but you're probably thinking of it as 3 "circuits".
Comment: You won't get power magically jumping from one cable to the next. _Actually, sometimes you do - it's called a spark, and in home wiring it's a Bad Thing™._ It will run to whatever devices are wired, but no further. Once you've got the splices made in this box, go to the next box on line `1`, wire your outlet, make sure that line `2` has no stripped, exposed copper (other, perhaps than the ground) and flip the breaker on - check for power. If you've got it, breaker off, go to the next box, otherwise figure out what you missed here.
Comment: As you gain confidence, you can do multiple outlets before checking for power. Test the last one in the line, then work your way backwards if it's not working. The problem is in the first one _without_ power or the last one _with_ power. But that's a whole nuther question...
Comment: Yeah, everytime you hook up a hot-neutral pair, that should only extend power to one outlet.
Comment: Wait, what? You're growing concerned I may hurt myself? The box was spliced exactly how you said it should be - that didn't solve my problem. I posted other questions I had without doing a single thing with the electrical - just wanted clarified answers/possible solutions.
Comment: Your comments, now removed, have me concerned that you're groping in the dark, @EGrant23, potentially to be lit up by a spark. If you've done what I suggested and are still having issues, I would suggest that you open a new question to ask about the new issues. Include what's happening at the panel, what's happening in this box, and what's happening at the next box where you're having the new problem. I don't want to be the one responsible for you possibly getting hurt, so I'm going to back out of any further advice/discussion on this one.
Answer: First off, all the grounds should be joined.
Second, you should verify that both of your input cables are hot (presumably they go to different breakers - they should.)
If both input cables are hot, and are joined to your other cables, (in any array - which should not matter if all loads are 120V, so long as you keep the hots and neutrals together for each set) then not having power on some outlets is not likely to be in this box, unless you have a phenomenally bad wirenut connection here. [that's not unheard of if you have little experience using them.]
There's a bad connection or no connection somewhere, though.
Comment: They are both hot - just confirmed. Going to different breakers as well.

Splicing help due to no power


Monitoring laptop activity while logged into school's Microsoft account

Question: I logged into my school-based Microsoft account on my personal laptop. But is it possible that somehow my school is monitoring my Google searches and other browsing history through the school Microsoft account? If my activity is being monitored by my school with the aid of the Microsoft account, does a VPN prevent it from happening?
Answer: Logging in to a microsoft portal on a personal laptop that has no remote control software installed does not permit monitoring or control of any other activities outside the realm of the microsoft products being used with or without a VPN in place.
If, however, you have remote control software installed on your computer, whether it's been pushed by microsoft products (e.g. intune), then anything the software is capable of becomes available to the controlling party, regardless of you being on a VPN.


How do I put an image in my answer?

Question: I would like to put a plot in my answer such as in this question but I don't know how.  Any suggestions?
Answer: If you look at the icons above the answer window where you enter text there is an icon that allows you to upload an image from either a url or a local drive.
Comment: Thanks @andy - always something small that is missed!
Answer: As @Andy said, it is much simpler to use the embedded editor, as it will, for example, automatically manage the list of hyperlinks and allow you to upload an image directly from your computer.
Technically, images are hosted on imgur, after they have been loaded from your computer (the base address will be https://i.stack.imgur.com/). In case you already have images on this web-sharing system, giving the URL works just fine.
In Markdown syntax, embedding an image is as simple as
![RLogo](http://www.r-project.org/Rlogo.jpg)

or
![RLogo][1]

[1]: http://www.r-project.org/Rlogo.jpg

which produces

So, this is basically the same idea as for a simple hyperlink, which when written as [Here is the R logo](http://www.r-project.org/Rlogo.jpg) actually reads Here is the R logo. We just need to prefix the hyperlink with a single !. The rest of the syntax is pure Markdown.

How do I put an image in my answer?


Change the country of interview

Question: Can I change the country for an interview while applying for my F1 visa? My first interview was in Kyiv (Ukraine), I would like to reapply but the emergency interview in Ukraine is father than in Poland. I am half-Polish and I would like to change the country for the interview due to approaching date of my study.
Answer: You are allowed to apply in any embassy (US case).  But according a consular officer, this is often not well interpreted, if you do not have good reason to do it.  It could seems that you look for the less strict consular office (and if I read correctly your question, it seems that first interview was not so good, so ...).  In addition the Polish embassy may have more problem to understand your school system, and to read/translate the documents.
So you can do it, but unless it is very unfavourable, I would try to get to Kiev.

Change the country of interview


I can't remove alarms set with old apple mail app

Question: I set some alarms using older mail program that came with OS X 10.6. During all upgrades, the alerts were preserved, but now I want to remove them and I can't find where they are defined. They are not in reminders, not in calendar, not on mail program. I'm now running on iMac, OS X Mavericks (10.9.3)
Comment: so how do you get the reminder ? by whom ?
Comment: That's what I'm trying to figure out. Back in the days of OS X 10.6, the mail app had a note button and I could higlight a text and make it a to do item with an alarm. See this post here: [http://support.apple.com/kb/ht2500](http://support.apple.com/kb/ht2500). That's what I did and now I can't find where these odl arlams are defined to remove them. I have one to send me a message once a month and I'm still receiving it every month.
Answer: In Reminders there should be a folder titled 'Notes' where all your old Mail todo's have been moved.  To see your folders you have to click one of the buttons on the bottom right of the side-menu.  There should be a similar folder in the Notes application where all your old Mail notes have been moved.
Comment: On my Reminders here (Mavericks) there are no right side buttons, only bottom left buttons, and when the side bar is expanded, I see only Completed, Today, and then the iCloud folders.


Why doesn't my Google group show up in Google Search?

Question: I created a group three days ago. It is a private group (meaning people need permission to become members) but everyone can ask to join. I specifically marked "List this group in the directory", and yet I can't find my group in a Google search.
Answer: The Google Groups directory is a separate thing from the regular Google Search.
The directory is simply the listing of groups available from the Groups home page (see bullet point #9 here).
As for why your group isn't showing in Google search, it's probably just a matter of being patient:

Crawling and indexing are processes which can take some time and which
  rely on many factors. In general, we cannot make predictions or
  guarantees about when or if your URLs will be crawled or indexed.

See the Google FAQ on indexing.
Answer: Another option is to use the Google submit URL. Don't spam it, but add that page, it has always worked well for me. I think you might be limited to 30 or so submissions per day, so if I knew that I needed Google to crawl it, I would submit before heading to bed, and when I wake up, it is always in the index. Relying on Google to auto-index you, especially for something new, so be proactive and just ask Google to crawl.   https://www.google.com/webmasters/tools/submit-url?hl=en_uk
Comment: Speaking from experience, this seems to have solved my issue with my Google Group but it was by no means same-day. I think it was at least a week, if not multiple weeks, before I eventually did see it in my search results.
Answer: You need to set "Who can see group" to "Anyone on the web" for it to show up in the Google Groups Search.
Then it will show up here, using 'MyTestGroup' as an example search:
https://groups.google.com/search?q=MyTestGroup


distribution function of the difference of two correlated chi-squared variables

Question: I am trying to get the probability distribution function of the difference of two correlated chi-squared variable, $Z=X−Y.$ Given that $f_X(x)$ and $f_Y(y)$ are known, and both variables are chi-squaree distributed. $X$ and $Y$ have the same degree of freedom. lets assume that the mean and variance values for $X$ and $Y$ are $\mu_x, \sigma^2_x$ and $\mu_y$ and $\sigma_y^2,$ respectively. the covariance between $X$ and $Y$ is $\sigma_{xy}.$ So how can I calculate the variance and distribution of $Z$ ($f_Z(z)$). what if $\sigma_y^2= \sigma_x^2$?
Comment: There are infinitely many models that allow for marginal $X$ and $Y$ Chi-squared random variables, so to find the distribution of their difference, given that they are dependent, you will need the joint pdf of $(X,Y)$, which you have not specified. By contrast, you can find Var(Z) immediately, given Var(X), Var(Y) and Cov(X,Y), via $$Var(Z) = Var(X) + Var(Y) - 2Cov(X,Y)$$
Comment: I have tried to edit your Question, using standard notation. There were some ambiguities. Please check that I have not changed the meaning.
Comment: Thanks for the comments. But I have no idea about the joint PDF!
Comment: As in my Answer, I think you need a model that explains the source of correlation. For example, in my (1) you could say $X = A+B$ and $Y = B+C,$ get the tri-variate distribution of $A, B, C,$ whence the bivariate distribution of $X,Y.$ You haven't told us the context of the problem, so there is no way for us to know how to model the covariance. To know the _shape_ of the bivariate dist'n of X and Y, one needs more than the moments. In the background is there a lurking mechanism for the connection between X and Y? (In my Answ it's inherited from overlapping normals.)
Comment: The distribution of the difference depends on how they're dependent, not just the size of the correlation. The question needs more details.
Answer: Comment. Here are a couple of examples. I hope they will
help clarify the Question, and perhaps help you find an answer.
(1) Suppose $Z_1, \dots, Z_5$ are iid standard normal.
Then $X = Z_1^2 + Z_2^2 + Z_3^2$ and $Y = Z_3^2 + Z_4^2 + Z_5^2$
are both distributed $Chisq(df=3),$ but they are correlated
because of they 'share' $Z_3^2.$ I will show some approximate
quantities using simulation. You should be able to find some or all
of the exact values by analysis.
m = 10^5;  n = 5;  z = rnorm(m*n)
DTA = matrix(z, nrow=m) # each row is std norm samp of 5
DTA2 = DTA^2
x = rowSums(DTA2[ ,1:3]); y = rowSums(DTA2[ ,3:5])
mean(x); mean(y)
## 3.003144  # aprx E(X) = 3
## 2.989661  # aprx E(Y) = 3
var(x); var(y); cov(x,y); cor(x,y)
## 6.013771  # aprx Var(X) = 6
## 5.936772  # aprx Var(Y) = 6
## 1.970101  # aprx Cov(x,Y)
## 0.3297159
mean(x-y); var(x-y)
## 0.01348286  # aprx E(X-Y)
## 8.010341    # aprx V(X-Y)

Below are histograms of the simulated distributions of $X$ and $Y$
along with the exact density of $Chisq(3).$ The third panel shows
the simulated distribution of $X - Y$ along with its density estimator
(roughly, a smoothed histogram).

(2) Now suppose the $Z_i$ are as before, but
$X = Z_1^2 + Z_2^2 + Z_3^2$ and $Y = Z_2^2 + Z_3^2 + Z_4^2,$
so the distributions of $X$ and $Y$ are as in (1), but their
covariance is greater because of the increased 'overlap'.
Notice the change in $Cov(X,Y)$ and in the distribution of $X - Y$
x = rowSums(DTA2[ ,1:3]); y = rowSums(DTA2[ ,2:4])
mean(x); mean(y)
## 3.003144
## 2.994843
var(x); var(y); cov(x,y); cor(x,y)
## 6.013771
## 5.997225
## 3.990319
## 0.6644449
mean(x-y); var(x-y)
## 0.008301117
## 4.030358

(3) At an absurd extreme,, $X \equiv Y \sim Chisq(\nu).$ Then $X - Y \equiv 0$
(degenerate), and $E(X-Y) = Var(X-Y) = 0$.

Finally, because you're trying to visualize joint distributions, here are
plots of the simulated joint distributions in (1) and (2). In each case
the joint distribution is suggested by showing 100,000 realizations of the model.
All four marginals are $Chisq(3).$