Protect against accidental deletion

Question: Today I first saw the potential of a partial accidental deletion of a colleague's home directory (2 hours lost in a critical phase of a project).
I was enough worried about it to start thinking of the problem ad a possible solution.
In his case a file named '~' somehow went into a test folder, which he after deleted with rm -rf... when rm arrived to the file bash expanded it to his home folder (he managed to CTRL-C almost in time).
A similar problem could happen if one have a file named '*'.
My first thought was to prevent creation of files with "dangerous names", but that would still not solve the problem as mv or other corner case situations could lead to the risky situation as well.
Second thought was creating a listener (don't know if this is even possible) or an alias of rm that checks what files it processes and if it finds a dangerous one skips sending a message.
Something similar to this:

take all non-parameter arguments (so to get the files one wants to delete)
cycle on these items
check if current item is equal to a dangerous item (say for example '~' or '*'), don't know if this works, at this point is the item already expanded or not?
if so echo a message, don't do anything on the file
proceed with iteration

Third thought: has anyone already done or dealed with this? :]
Answer: There's actually pretty good justification for having critical files in your home directory checked into source control. As well as protecting against the situation you've just encountered it's nice being able to version control .bashrc, etc.
Answer: Since the shell probably expands the parameter, you can't really catch 'dangerous' names like that.
You could alias 'rm -rf' to 'rm -rfi' (interactive), but that can be pretty tedious if you actually mean 'rm -rf *'.
You could alias 'rm' to 'mv $@ $HOME/.thrash', and have a separate command to empty the thrash, but that might cause problems if you really mean to remove the files because of disk quotas or similar.
Or, you could just keep proper backups or use a file system that allows "undeletion".
Comment: You probably mean "trash" instead of "thrash".
Answer: Accidents do happen. You only can reduce the impact of them.
Both version control (regular checkins) and backups are of vital importance here.
If I can't checkin (because it does not work yet), I backup to an USB stick.
And if the deadline aproaches, the backup frequency increases because Murphy strikes at the most inapropriate moment.
Answer: One thing I do is always have a file called "-i" in my $HOME.
My other tip is to always use "./*" or find instead of plain "*".
Answer: The version control suggestion gets an upvote from me.  I'd recommend that for everything, not just source.
Another thought is a shared drive on a server that's backed up and archived.
A third idea is buying everyone an individual external hard drive that lets them back up their local drive.  This is a good thing to do because there are two kinds of hard drives: those that have failed and those that will in the future.
Answer: You could also create an alias from rm that runs through a simple script that escapes all characters, effectively stopping you from using wildcards.  Then create another alias that runs through real rm without escaping.  You would only use the second if you are really sure.  Bu then again, that's kinda the point of rm -rf.
Another option I personally like is create an alias that redirects through a script and then passes everything on to rm.  If the script finds any dangerous characters, it prompts you Y/N if you want to continue, N cancelling the operation, Y continuing on as normal.
Answer: One company where I worked we had a cron job which ran every half an hour which copied all the source code files from everyone's home directory to backup directory structure elsewhere on the system just using find.
This wouldn't prevent actual deletion but it did minimise the work lost on a number of occasions.
Answer: This is pretty odd behaviour really - why is bash expanding twice?
Once * has expanded to
old~
this~
~

then no further substitution should happen!
I bravely tested this on my mac, and it just deleted ~, and not my home directory.
Is it possible your colleague somehow wrote code that expanded it twice?
e.g.
ls | xargs | rm  -rf

Comment: No, not twice, he just had a file named '~'. I added the '*' case because it is similar.
Answer: You may disable file name generation (globbing):
set -f

Escaping special chars in file paths could be done with Bash builtins:
filepath='/abc*?~def'
filepath="$(printf "%q" "${filepath}")"
filepath="${filepath//\~/\\~}"
printf "%s\n" "${filepath}"

Answer: I use this in my ~/.basrc
alias rm="rm -i"
rm prompts before deleting anything, and the alias can be circumvented either with the -f flag, or by escabing, e.g.
\rm file
Degrades the problem yes; solves it no.
Comment: The problem with this, I think, is that eventually you get tired of getting asked about deletion of each file, and resort to \rm. So issuing a \rm -rf by mistake is just a matter of time.

Protect against accidental deletion


Found an error in the title of published article (A phrase has been repeated twice)

Question: I have found an error in the title of my recently published article. A phrase has been repeated twice in the title. Considering that journal not accepted any changes what should I do about it?
Comment: There doesn't seem to be much you can do other than to take more care in the future, unless it was the publisher's error.
Comment: Did you contact the journal, or are you simply assuming they won't make changes?
Comment: If online only they will fix. Otherwise no action. If printed it will remain so. Errata and corrigendum are not for this thing...if it is online only see the answer by Richard Erickson.
Answer: Send the journal's editorial office a note and let them know.
I made the a similar mistake once with one of my first paper after the paper had been published online (the paper had a misspelling with one of the words and my department's admin staff caught when preparing a departmental highlight). The journal was happy to fix it, even though I had already returned the final version of the manuscript and they had published the article online. I suspect the editors did not want to have a typo in an article title in their journal.
Comment: Thanks very much. It was very useful.


Is evolution always unidirectional?

Question: Is it possible, at least in theory, for a species to evolve into another species and then evolve back into the first species?
Answer: It's possible, but very unlikely.  Usually it takes a substantial number of genetic differences to qualify two organisms as different species.  One might think that reversing the direction of selection pressure could reverse a genetic change, but genetic change begins with random mutations which are not determined by selection pressure.  It's very unlikely for one random process to undo another random process (imagine mixing black and white sand in a jar by shaking it, then trying to unmix by unshaking!).
Answer: While it doesn't go nearly to the extent of speciation, the classic example is the British peppered moth: https://en.wikipedia.org/wiki/Peppered_moth_evolution  Originally it was mostly white with black spots, which made a good camoflage on tree trunks &c.  During the industrial revolution, the "dark satanic mills" put out a lot of soot, turning the tree trunks dark.  The whiter moths were easy to spot, and got eaten before reproducing, so within a few decades most of the moths in industrial areas were black.
Later on, emissions control laws drastically reduced the amount of soot, the tree trunks became light again, and the moths evolved back to white.

Is evolution always unidirectional?


Kubernetes Cert-Manager Expired Certificates

Question: I inherited a GKE Kubernetes environment and have been trying to figure this out for days but unfortunately just don't know what to try next.
The cluster is setup to use cert-manager (installed via helm) to apply Let's Encrypt certificates to the cluster. For some reason, this has worked perfectly for over two years but starting on 4/16 I started seeing SSL warnings in browsers for all notes on the cluster.
When I run kubectl describe certificates site-cloud-tls the certificate seems to have renewed but is not being applied to the ingress traffic.
Name:         site-cloud-tls
Namespace:    cs
Labels:       <none>
Annotations:  <none>
API Version:  certmanager.k8s.io/v1alpha1
Kind:         Certificate
Metadata:
  Creation Timestamp:  2019-06-02T09:55:05Z
  Generation:          34
  Owner References:
    API Version:           extensions/v1beta1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Ingress
    Name:                  cs-nginx
    UID:                   7f312326-851c-11e9-8bf0-4201ac10000c
  Resource Version:        541365011
  UID:                     7f36cc40-851c-11e9-8bf0-4201ac10000c
Spec:
  Dns Names:
    site.cloud (changed name but is correct)
  Issuer Ref:
    Kind:       ClusterIssuer
    Name:       letsencrypt-dns
  Secret Name:  site-cloud-tls
Status:
  Conditions:
    Last Transition Time:  2022-04-24T05:26:13Z
    Message:               Certificate is up to date and has not expired
    Reason:                Ready
    Status:                True
    Type:                  Ready
  Not After:               2022-06-15T17:01:48Z
Events:                    <none>

kubectl describe ingress
Name:             cs-nginx
Namespace:        cs
Address:          192.168.1.32
Default backend:  default-http-backend:80 (10.16.3.12:8080)
TLS:
  site-cloud-tls terminates site.cloud (changed naming but seems correct)
Rules:
  Host                       Path  Backends
  ----                       ----  --------
  site.cloud
                             /   site:8080 (10.10.10.10:8080)

Annotations:                 certmanager.k8s.io/cluster-issuer: letsencrypt-dns
                             kubernetes.io/ingress.class: nginx
                             nginx.ingress.kubernetes.io/ssl-redirect: true
                             nginx.org/websocket-services: datahub
Events:                      <none>

We do have a staging environment which was also affected. I have tried re-installing cert-manager, re-installing nginx-ingress but unfortunately haven't been able to get things back up and running (likely due to a configuration error I've made).
After 3 days, I don't know which way is up and don't know Kubernetes well enough to know what to try next. Any guidance? Can I provide any additional info that might help?
Thank you!
Comment: was the answer useful?
Answer: The issue here is that you are referring to a cluster-issuer kind in your Ingress definition:
Annotations:                 certmanager.k8s.io/cluster-issuer: letsencrypt-dns

But the object you have defined is a Certificate kind:
Name:         site-cloud-tls
Namespace:    cs
Labels:       <none>
Annotations:  <none>
API Version:  certmanager.k8s.io/v1alpha1
Kind:         Certificate

That is why it is not being applied to the Ingress. What you need is to create an Issuer resource in Kubernetes to handle the certificate. Here you can find an example of a basic ACME ClusterIssuer manifest file:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
spec:
  acme:
    # You must replace this email address with your own.
    # Let's Encrypt will use this to contact you about expiring
    # certificates, and issues related to your account.
    email: email@example.com
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      # Secret resource that will be used to store the account's private key.
      name: example-issuer-account-key
    # Add a single challenge solver, HTTP01 using nginx
    solvers:
    - http01:
        ingress:
          class: nginx


iOS 10 no longer starts lock screen music player when headphones inserted

Question: Before installing iOS 10, whenever I plugged in my headphones (or car adapter), the lock screen music player would pop up (which is very convenient).  Was this a deliberate change to the OS, or some problem specific to me?  Is there some way to reenable this feature?
Answer: It appears to be deliberate, I miss the feature too as it will not appear whether I use wired or bluetooth connection.
I could not find a way to reenable it.
Answer: This appears to have been fixed in 10.2.1, sort of.  It now works most of the time, but I can't figure out what causes it to work or not.


plot deviance residuals vs fitted values or log(fitted values)

Question: I did a poisson regression by hand and want to create a diagnostic plot. Now iam not sure, should i plot deviance residuals vs fitted  values or vs log(fitted values)?
Why or why not?
Comment: Try it both ways and see which makes more sense to you!
Comment: use https://cran.r-project.org/web/packages/DHARMa/index.html
Answer: Against actual fitted and against the fit on the scale of the linear predictor would both be reasonable -- either should be fine as far as assessing whether the residuals deviate from flatness as the fitted values change.
Which is easier to work with may depend on a number of factors (e.g. how broad a range of predicted values is covered, the pattern of the predictors, personal preference)


May I use my graduate school's letterhead right after graduating, when applying to jobs?

Question: I just completed my MFA in Film this August, 2017. Now I am freelancing and not associated with an academic institution. May I still use my graduate university's letterhead when applying to faculty positions? I don't have any other nice looking letterhead with a logo, unless I make it up.
Comment: "I don't have any other nice looking letterhead with a logo, unless I make it up." - why do you need a logo to represent yourself?
Answer: No you may not. The use of an official letterhead implies not only a current affiliation with the university, but it some countries and contexts also implies that the correspondence is for official purposes. Each university has it's own rules and policies, but I would be shocked if your university would consider this acceptable, and both universities that I have attended have specific guidance to not do this. In general, you do not have the right to use that letterhead simply because you attended the university, and using it in that fashion is inappropriate because you are representing yourself as having a professional position that you don't have.
Comment: I would characterize the top-voted answer to the linked question as constituting a majority, but not a consensus. Furthermore, I suspect this is country-specific, field-specific, or generation-specific.
Comment: I'd encourage OP to contact his/her school, especially the career service if there is one. When reviewing job application letters during hiring, I often see some institute-issued alumni letterheads. Maybe your institute have something similar. It's their interest to see you getting employed. The worst you can get is a "no."
Comment: I agree that if you are no longer affiliated with an institution, it is inappropriate to use its letterhead. But a current grad student applying for jobs *is* using the letterhead for "official purposes."  [https://chroniclevitae.com/news/50-the-professor-is-in-why-letterhead-matters](https://chroniclevitae.com/news/50-the-professor-is-in-why-letterhead-matters)
Comment: @ElizabethHenning There seemed to be a consensus at the linked question that this is inappropriate, though some people voiced the opposite opinion. However I want to strongly push back against the sentiment in the article you linked to. Telling someone to "use whatever means necessary to acquire a sheet of letterhead, and Photoshop it into a replicable file for the purposes of your job applications," in response to being told that the university specifically disallows you to use its letterhead worries me.
Comment: @ElizabethHenning I have reworded my answer taking your responses into account.
Comment: @Penguin_Knight I would vote for this if you made it an answer!
Answer: Comment posted as answer: I'd encourage you to contact your school, especially the career services office if there is one. When reviewing job application letters during hiring, I often see some institute-issued alumni letterheads. Maybe your university/institute has something similar. It's in their interest to see you become employed, so ask them how they can help you to best showcase your academic background. The worst you can get is a "no."
Answer: In short, you are using a letterhead if you are "speaking for" the institution whose name is on the letter head. This would, for example, be the case if you're an administrator writing to one of the suppliers of the school cafeteria, or if you're a professor writing a letter of recommendation for a former student.
In your case, you are writing for yourself. You do not have an official role in the university, nor are you speaking on its behalf. Don't use the university's letterhead.
Answer: My recommendation would be to create your own letterhead. As a freelancer, you need your own brand identity anyway. And, working in a creative field, I imagine that anyone you contact would expect you to have the skills to make a letterhead.
The letterhead of the university will be copyrighted and will not have your contact information in. It's very unlikely that you will permission to use it, or that this will be granted even if you ask for it.
As a further example, in universities where I have worked, letterheads have been carefully protected even for staff. Only a small group of staff would have access to them and the would record how they were used. For instance, if I needed to write a reference letter for a student, I would not be able to directly print it onto headed paper. This would need to go through an assigned administrator.
Now, in practice, of course I could very easily have scanned in the end result and created my own letterhead, but that just wouldn't have been acceptable. If a student were to have done this, the matter would not have been taken lightly.
The closest suggestion I can make, if you do want to include a visual representation of the university on your letter, would be to see if you can get permission to include their logo. This will be less controversial than the full letterhead, but it might also be protected.


Can someone steal money from my bank account if they know my IBAN and personal details?

Question: To deposit money into your account, some websites require that you provide them with a lot of details about your bank account: name, complete address and IBAN which includes your account number and identifies the exact bank.
Can a skilled cracker use this information to steal money from an account? How safe is it to provide these details?
Comment: Hi Kathy, welcome to [security.se]! Answers here are expected to be provide information to base an answer on, either research, logic, etc - and not just an assertion or anecdote (btw, sorry to hear about that - I imagine it was not a pleasant experience).
Comment: Usually public records searches will allow someone with your name and an incomplete address (or location deduced by IP geolocation) to get your complete address, so the complete address by itself is not all that significant.
Comment: Yes they can it happened to me a few days ago my bank is on it. It also happened in 2009 and they caught the person.
Answer: This question is likely to be country-specific.  In the US, an account number is generally not enough to steal money from someone's account.  This is fortunate, because every time you write a check or make a bank payment to someone, they receive your account number.
However, learning someone's the bank account number is enough to learn their account balance.  There is an attack that is not widely known:

Most banks have a phone number that merchants can call and, via an automated voice response system, learn whether a particular account has enough money that a check for a particular amount will clear.  Basically, you just call up, hit a few digits to go through the phone tree to the merchant check verification option, then type in the account number and the amount, and the phone system will respond with whether the account balance is at least as much as the amount you've provided.

This allows an attacker who knows your account number to learn your bank account balance, by using binary search.  This is a confidentiality breach that is not widely known.
If this bothers you, you may be able to protect your own account against this by calling up your bank and asking them to put a fraud alert on your account.  At least for my own bank, when the bank does this, it disables the merchant check verification service for your bank account.
Comment: FYI, the routing number is not at all secret. You can [look it up](http://www.fedwiredirectory.frb.org/search.cfm).
Comment: Write a check and they have your account number and routing number, seems it would be that much easier to get money out of an account.
Comment: @WayneInML, yes, I agree, that is a risk too.  I just wanted to point out an additional, separate risk that not as many people know about.  P.S. The privacy risk I mentioned relies only upon knowing the victim's account number (routing number is not needed).
Comment: Interesting. Do most banks still do this? I'm aware that you can get amount ranges (e.g, <$1000, $1000-$50000, etc.), but not exact amounts.
Comment: My credit union only allows calls from the phone number registered on the account.
Answer: IBAN are used to identify a recipient.

The check digits enable the sending bank (or its customer) to verify the validity of a routing destination and account number from a single string of data at the time of data entry.

To be able to send money from your account to another account, someone needs to impersonate your identity. I doubt your bank would let somebody claiming they are you and giving an IBAN and an address, make transfert of money.
If they do, change your bank.
Comment: All German banks do allow [direct debit](http://de.wikipedia.org/wiki/Lastschrift) without requiring permission from the account owner. If he or she does not check the account in time to issue a reverse order, the money is lost. For direct debit, the account number, owner name, bank id and bank name are sufficient.
Comment: Are you serious? That seems crazy - especially for Germany where there seems to be so much protection in other areas, especially wrt privacy etc.
Comment: In France, I am required to send a letter of authorisation for each automatic withdrawing order (phone company, energy company etc). Hopefully the lack of proper authorisation should trigger refusal?
Comment: @TimX: yes, but. 1. Even with authorization the payment can be canceled by the account owner without giving any reason within 2 months of the payment, no questions asked (you sign with your bank that it is your duty to check your account statement and that it is considered approved if you do not reject it within so many weeks after they provide it). 2. If the payment was not authorized/fraudulent, AFAIK the usual 3 year statutory period of limitation applies (though being outside time frame 1 there'll be more hassle). In addition, IIRC it is possible to tell your bank that you do not ...
Comment: ... authorize any direct debits. Also, there are accounts that do not allow any overdraft, so you can make sure no money is withdrawn by not having money in that account while you can still receive money. On the side of the party that initiates the direct debit, they need to have a particular accreditation with their bank, and that can include a deposit to cover possible reversals of direct debit or AFAIK also that the amount withdrawn is held for some time.
Comment: But OTOH, IBAN is the number that is exchanged over here in order to allow others to pay you as M'vy writes. There are literally thousands of IBANs out in the public of businesses who want their customers to pay their bills. Also keep in mind the destination of money that leaves an account via direct debit is *known*.
Answer: It's possible to transfer money out of an account knowing only Account Number, Sort Code and address.
There was a reasonably high-profile case where Jeremy Clarkson, not believing this to be the case, published his bank details in a newspaper. The details were then used to send money to a charity.
http://news.bbc.co.uk/1/hi/7174760.stm
Comment: Although to be fair, that is not what was important in this case. You can't take money out of an account using just these details - you need more info, and a bit of social engineering. But an attacker with this info requires less effort to complete the attack.
Comment: Plus, it is known exactly *where* the money went (to a Diabetes charity who probably could get money that way only because they were in good standing with their bank for not initiating fraudulent direct debits so they are approved for initiating direct debits). If you do not just want to cause damage/hassle, but want to *get* that money it is far more difficult to both get it and stay unknown/undetected.
Answer: The following is based primarily on US Banking, but most countries have similar risk management practices if they follow Basel Practices.
To perform an ACH requires a routing number and an account number.
However, for an ACH to go through requires it to pass internal controls and screens. The bank is required to monitor for fraud and if you are making irregular transactions for your account they should detect it. In the US, hopefully they are complying with the federal regulator's recommendations to implement layered controls FIL-50-2011, e.g., there is so security-gate to go through to move money out (e.g., out-of-band one time token, such as SMS one time code). Also, in the US, you are protecting against electronic funds transfer fraud through Regulation E. Regulation E allows you to make a claim against fraud. Often the bank can reverse fraudulent transaction.
You may want to read this paper by Microsoft Research: Is everything we know about password stealing wrong? (PDF) Is addresses the risk to individuals of bank account compromise.
Comment: There are usually a greater number of controls for money flowing out of a bank versus in (though most banks will try to filter for money laundering and fraud patterns going in). Things like positive pay can help reduce outgoing fraud. Some banks may also prevent outgoing transfers without first requiring a confirmation through an out of band channel (e.g., click a one time link in an email or respond to an SMS).
Answer: Normally, a bank will require proof of identification, such as a signature or online password, before allowing someone to withdraw or wire money from an account. Also, a bank may call or email the account holder before making the wire or withdrawal, especially if it is unusual activity for the account.
Comment: And signatures are of course copy-proof because they vanish when you try to photocopy them... So yeah, they practically allow anyone to withdraw money.
Comment: Not in Germany.
Comment: @AndreySapegin Elaborate?


What does @@ ("at at") mean in ES6 JavaScript?

Question: I've noticed @@ used in a few pages about new ES6 features, but I don't know what exactly it means (whether it's actually syntax or just some kind of documentation convention). And it's hard to google. Can someone explain it?
Comment: Can we agree that well-known symbols are now more well known? :)
Comment: It's an internal (spec-only) convention, and [it's going to change](https://github.com/tc39/ecma262/pull/1314)
Answer: @@ describes what's called a well-known symbol. (Note that it isn't actually valid syntax in JS.) According to the ES6/ES20151 specification:

Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless otherwise specified, well-known symbols values are shared by all Code Realms (8.2).

Code Realms refer to different instances of a JavaScript environment. For example, the Code Realm of the root document would be different to that of JavaScript running in an .
An example of where it matter what code realm an object comes from is when trying to use instanceof to determine whether an object is an array (hint: it won't work if it's from another frame). To avoid these kinds of issues from popping up with symbols, they are shared so that references to (say) @@toString will work no matter where the object came from.
Some of these are exposed directly through the Symbol constructor, for example, @@toPrimitive is exposed as Symbol.toPrimitive. That can be used to override the value produced when attempting to convert an object to a primitive value, for example:
let a = { [Symbol.toPrimitive]: () => 1 };
console.log(+a); // 1
console.log(a.valueOf()); // (the same object)
console.log(a.toString()); // "[object Object]"

In general, symbols are used to provide unique properties on an object which cannot collide with a random property name, for example:
let a = Symbol();
let foo = { [a]: 1 };
foo[a]; // 1

There is no way to access the value except by getting the symbol from somewhere (though you can get all symbols for an object by calling Object.getOwnPropertySymbols, so they cannot be used to implement private properties or methods).
1: See this es-discuss topic for some discussion about the different names.
Comment: Notice that this doesn't fix cross-frame `instanceof`. A better example would be cross-frame iterable arrays.
Comment: @Bergi: I was trying to provide an example of a cross-frame issue in general, that's not really what I meant -- maybe I'll try and reword that.
Comment: @Bergi What does 'cross-frame' mean here?
Comment: @1252748 Across frames or iframes
Comment: @Bergi What would a cross frame iterable be then?
Comment: @1252748 Just an array instantiated by code in the other frame. Or even `new (window.frames[0].Array)()`/`new (iframeElement.contentWindow.Array)()`


Sticky BottomPlaceholder

Question: Is there anyway to make a bottomPlaceholder footer (using ApplicationCustomizer) sticky? The footer I am making is rather large and cannot be on the screen all the time.
Answer:
A class that derives from the ApplicationBaseCustomizer class
Use of the this.context.placeholderProvider.tryCreateContent()
method to get a reference to the appropriate placeholder and it's
content - and the fact that it gives you the DOM element to
manipulate (e.g. set innerHTML)

You could refer below code:
import { override } from '@microsoft/decorators';
import { Log } from '@microsoft/sp-core-library';
import {
  BaseApplicationCustomizer, PlaceholderContent, PlaceholderName, PlaceholderProvider
} from '@microsoft/sp-application-base';

import * as strings from 'Cob12ApplicationCustomizerStrings';
import styles from './AppCustomizer.module.scss';
import { escape } from '@microsoft/sp-lodash-subset';

const LOG_SOURCE: string = 'COBApplicationCustomizer';
const FOOTER_TEXT: string = "This is the bottom zone";

// used if you wish to pass properties to your extension..
export interface ICob12ApplicationCustomizerProperties {
  TopContent: string;
}

export default class Cob12ApplicationCustomizer
  extends BaseApplicationCustomizer<ICob12ApplicationCustomizerProperties> {

  @override
  public onInit(): Promise<void> {
    console.log("onInit: Entered");

    console.log("Available placeholders: ",
      this.context.placeholderProvider.placeholderNames.join(", "));

    // bottom placeholder..
    let bottomPlaceholder: PlaceholderContent = this.context.placeholderProvider.tryCreateContent(PlaceholderName.Bottom);
    if (bottomPlaceholder) {
      bottomPlaceholder.domElement.innerHTML = `

                      ${escape(FOOTER_TEXT)}

`;
    }

    return Promise.resolve<void>();
  }
}

And the CSS is implemented by adding an SCSS file in your extension's directory - named AppCustomizer.module.scss(in this code) and has the following content:
.app {
  .footer {
    height:60px;
    text-align:center;
    line-height:2.5;
    font-weight:bold;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: darkgreen;
  }
}

Remember this is imported to the class for your customizer e.g:
import styles from './AppCustomizer.module.scss';

Reference
Update:
Try below CSS:
    .footer {
   position: fixed;
   left: 0;
   bottom: 0;
   width: 100%;
   background-color: red;
   color: white;
   text-align: center;
}

Comment: This is what I've already got basically, however I need it to only show up on the bottom of the page (when its scrolled all the way down) and not always in the view port. This may not be possible
Comment: Try updated CSS, you could modify the colors based on your requirement.
Comment: I can't tell if that worked yet, SharePoint's layout is a bit weird for testing this, but I'm going to assume that it did, so thank you :)
Comment: @Styrac Please upvote and mark the answer as accepted since it helped you
Comment: This doesn't work if you need the bottom not to be fixed, which is like that by design

Sticky BottomPlaceholder


How to/Should I stop my 3-month old puppy from humping?

Question: My 13 weeks old puppy humps his bedding when I'm not around.
I'm not sure how I should stop this behaviour or if I should even try to..?
Is this normal?
Answer: Yes it's perfectly normal for a young dog to hump things. Dogs hump for a number of reasons, both male and female, usually it's due to excitement - especially in such a young pup. But it can be sexual under a year, or in older dogs a sign of dominance.
You can stop the behaviour, it is possible he may or may not grow out of it, but it's not bad to stop the behaviour if you wish to no. It'll certainly be more pleasant / less embarrassing to have a pup that doesn't hump.
Usually if you want to prevent a behaviour like this just interupt, like you would do when they're peeing unwantedly. Startling a dog generally makes them pause their actions. Give a 'No' command, but not agressively, just to grab their attention. Get them to focus on you, with a Watch command, then reward it.
At 13 weeks some males already have descending/descended testicles, so it's worth having a check to see if that's happening/happened yet. You can consult a vet in regards to when your breed usually drops, and when it's best to neuter. Having your dog neutered will drop the testosterone levels and your dog will more than likely lose interest in this.
Answer: This is a natural behaviour and is not a sign of dominance. The dominance theory has been disproved for many years now. Dogs, both male and female do this behaviour when playing and is only seen as wrong by humans as we sexualise it. It would be like pulling your friend's arm. Can I ask why you would like to stop it? What would you like your dog to be doing instead? I agree with Aravona about desexing as this may decrease the humping behaviour but there are no guaranties.
Since you have said that he is doing it while you are not around, giving him a "no" command when you are around will just tell him that I can't do this normal behaviour when the human is around so I'll just do it when they are not around.
Comment: @Aravona This heavily depends on the individual dog. We've got two Huskies. For the first, "no" means "no". But for our youngster we have to train most stuff twice: once for when we are around and once for when we don't look/are away.
Comment: @Aravona I just wanted to say that some dogs indeed don't immediately consider a "no" to be ultimate no matter whether someone is around or not.
Comment: If it were true that telling a dog 'No' for something means they'll just do it when you're not there then peoples dogs wouldn't be toilet trained... You tell a dog No to interrupt peeing, then put them outside. Dogs don't just go peeing in the house because you're not there unless there's an underlying anxiety issue... you train the behaviour out of them when you're around.
Comment: @Mario yes some dogs take more effort to get it, but you're still saying you say No for the dog to learn, aren't you?
Comment: @Mario that's very true but I wouldn't have thought anyone would think a dog would understand the first time. Our trainer used to say they'll get it by the 20th time most of the time. The idea is to simple distract the process.
Comment: @Aravona Ah, didn't want to imply that. Of course it would take more tries to teach something, but for more interesting stuff (read: e.g. food), we essentially have to train twice, once when we're there, once when we're away (or looking away).


How is average network hashrate determined?

Question: ethstats has this statistic, currently at 48.3TH/s, but how do they determine it?  Are hashrates reported by nodes added up and averaged over so many blocks?
Answer: While I can't tell you how ethstats calculates the average network hash rate, I can tell you that they almost certainly don't use reported values from nodes. Firstly, it would be difficult for them to connect to all nodes. This would be okay if they were to connect to all the nodes with substantial mining capacity, but I don't think all nodes report a speed.
More likely, and the way I would calculate it, is to look at the average difficulty (this is baked into the blocks themselves) and the average time to solve a block. Since the expected time to solve a block is difficulty / hash rate (this relationship can be derived from the Ethereum source code), one can solve, algebraically, and find that the network hash rate is the average difficulty divided by the average block time. Then you just need to pick your window in terms of number of blocks used for computing the average. For example, right now, the difficulty is ~1240TH - which means that one successful hash is expected to be found every 1240 trillion hashes. Since the average block time is roughly 18.9s, the current network hash rate is roughly 65TH/s.
Comment: Ethstats require nodes to register, so it's not *all* nodes. (just adding to your answer)


Moving files from Linux server to Window 2012 Server

Question: I normally store my Linux system backup files to CD's. I want to move the backup files to a 2012 Windows Server I use for management purposes.  I am limited to Linux CLI and 2012 Server services, no 3rd party software allowed.
Answer: Your options boil down to 3 basic methods:

Sneakernet:  That is, copy your files from the Linux server to a removable medium such as a flash drive or an external hard drive.  It sounds like you already have the files on physical CD.  If the Windows server has an optical drive, just pop the CD's into the drive and copy the files.
Mount a Windows share on the Linux server:  For that you'll probably need to install some packages on the Linux server.  The specific packages depend on your distro.
Mount an NFS share on your Windows server.  You'll need to install the NFS Client, which is part of Windows Features.

Option 1 involves copying the files twice, but is probably easier overall.
Comment: Could probably also use FTP which I believe is supported by win server 2012 though probably have to install as a windows feature.
Comment: Yes, that would work if the OP wants to install an FTP server on the Windows server.  It comes as part of IIS.
Comment: Thanks fellas, I was leaning more towards a SFTP or SCP option.  However, I have not found any "How to" instructions on how to pull it off.  I keep running into hurdles that side tracks me to point of frustration.
Comment: If you have a Windows 10 computer, you can use either of those.  Install the Windows Subsystem for Linux, which you can use to connect to your Linux server via SFTP or SCP.  That will get the files onto your Windows 10 box.  After that, you can just use SMB (Windows sharing) to move them onto the Windows server.
Comment: Good Idea Charles, I will look into that. Thanks


ASP.NET 5 project hosting on IIS

Question: I want to host my ASP.NET 5 project which uses MVC 6 and Entity Framework 7 on Amazon free micro instance.
I can't find any step-by-step manual on how to host ASP.NET 5 projects on IIS, all materials just mention that this is possible but without any guides.
Basically, I'm deploying to local folder and then copying to newly created site, but nothing is working.
Unfortunately, I can't use Azure as it only has one month free trial, not a year.
Answer: I'm using Visual Studio 2015 Preview to create ASP.NET 5 projects. I don't think that's difficult to deploy on IIS now.
First publish your website by publishing it as file system in VS 2015 preview, then copy the published folder to your server, create an application in IIS and set the application folder to the wwwroot folder (rather than the root folder), that's all.
Be aware, check if "Microsoft.AspNet.Server.IIS" exists in your website project.json before publishing it.
Edit:
there should be a web.config in wwwroot folder, the content of web.config may be like this (with precompile option when publishing):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="kpm-package-path" value="..\approot\packages" />
    <add key="bootstrapper-version" value="1.0.0-beta1" />
    <add key="kre-package-path" value="..\approot\packages" />
    <add key="kre-version" value="1.0.0-beta1" />
    <add key="kre-clr" value="CoreCLR" />
    <add key="kre-app-base" value="..\approot\packages\Rvc.PopUpSite\1.0.0\root" />
  </appSettings>
</configuration>

or like this (without precompile option):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="kpm-package-path" value="..\approot\packages" />
    <add key="bootstrapper-version" value="1.0.0-beta1" />
    <add key="kre-package-path" value="..\approot\packages" />
    <add key="kre-version" value="1.0.0-beta1" />
    <add key="kre-clr" value="CoreCLR" />
    <add key="kre-app-base" value="..\approot\src\Rvc.PopUpSite" />
  </appSettings>
</configuration>

Please notice the value of kre-app-base. Occasionally its value is empty string after publishing in Visual Studio.
Comment: kre has been renamed to dnx
Comment: Hi Ricky, just tried as you said copy published folder to Amazon, so I have my site in C:\Inetpub\wwwroot\Blog on Amazon, created new site in IIS, pointed it to C:\Inetpub\wwwroot\Blog\wwwroot, but it's not working. I have "Microsoft.AspNet.Server.IIS" in roject json. Any Ideas what I'm doing wrong?
Comment: @Sergey just edited my post. I don't know if you can get notification of my edit, so added this comment. It would also be very helpful if you could post the error message you got, if any.
Comment: Hi Ricky, thx, now it's working. Faced another issue, after changing packages in project.json from *beta-1 to *rc-1, during publishing to local disk both versions are published, do you know how to remove old dependencies?
Comment: The ```kre-app-base``` value being empty was the root of all the problems I was having with this. Thanks!
Comment: I had to publish my wwwroot not in the (very long) default directory from the publish wizard. The path / file names became too long.
Answer: 1. First you need to publish the site to the file system:

2. Create a new application in IIS:

3. Unzip the file you've created in step 1 in the website directory from step 2. The folder should look like:

4. You may also need to install DNVM (formerly KVM) and the DNX Runtime Environment (formerly KRE):
Install the DNVM - dotnet version Manager (KVM)
Install the DNX runtime environment inside DNVM  (KRE)
Comment: Hi Nikolay, first 3 steps already done, so I've just installed KVM and was unable to run "kvm upgrade" command until changed path to C:\Users\Administrator\.kre\bin> After this I was able to run "kvm upgrade comand" but result the same, when I'm trying to open web pageI'm receiving following error: HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory
Answer: I had the same problem with DNX Beta 4.
If someone has the same problem :
You have to target x64 framework (Target DNX Version) when you publish your website in Visual Studio 2015 RC and write "XXX\wwwroot" in Physical Path in your IIS website configuration.
Comment: Does anyone know if this can be set in a json file somewhere?
Answer: You can use the File system publish method. Follow these steps:
1/ Generate in a folder with Visual studio the .dll files
2/ Create a website in IIS manager and give in the path to your folder
Comment: I've already did this, but site still not opening, see my comment to previous message from Nikolay
Answer: I found what I've missed, I need to change url to my public DNS in projct.json file:
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://ec2-54-68-21-4.us-west-2.compute.amazonaws.com/
then after uploading site to Amazon I need to run web.cmd in site root

ASP.NET 5 project hosting on IIS


Wacom Tablet (integrated; X201T) disconnects sporadically

Question: I have an X201 tablet with stylus and finger multitouch running Ubuntu 14.04.4 with the 4.2.0 kernel. For no apparent reason, it seems to have an affinity for not recognizing finger (henceforth referred to as "touch") input after previously working. A typical scenario is a seamless boot into a completely functioning tablet, with both touch and stylus completely functional. After some usage, the length of time for which is entirely different each time, an attempt to use the touch function results in disappointment. However, after suspending and waking, functionality returns (although initially suspend would result in the complete loss of functionality of the tablet, but this was remedied after applying this workaround).
Things I've tried:

xsetwacom list devices successfully shows all of my devices, even if they are non-functional at the moment. Here is the output of xsetwacom list devices:
Wacom Serial Penabled 2FG Touchscreen stylus    id: 13  type: STYLUS
Wacom Serial Penabled 2FG Touchscreen eraser    id: 14  type: ERASER
Wacom Serial Penabled 2FG Touchscreen touch     id: 15  type: TOUCH

sudo inputattach --daemon --w8001 /dev/ttyS*, where * is from dmesg and the command is called after killall inputattach.
lsmod shows both wacom and wacom_8001w.

I've ruled out the possibility of an issue with a connection to an input-layer device. So the serial data is going through (even if it is erroneous). The driver is also loaded.
What is going on? And why does it get fixed by a suspend cycle? And why does it not follow any discernible pattern?

As an aside, sometimes, after waking from suspend and logging in, touch and stylus will work for about 5 seconds, and then completely stop functioning. The same 3 points enumerated above have been tried in this scenario as well with the same results.
Answer: Try to downgrade the kernel from 4.2.0 to e.g 3.19.


Can I use HDMI 1 instead of HDMI 0?

Question: I am using a raspberry pi 4 and I only have an adapter, so it's to big to fit in HDMI 0 is there a way I can make it work with HDMI 0?
Comment: The Pi4 has two micro HDMI sockets. I presume he has a rigid adapter and it's interfering mechanically with the USB C power cable when plugged into HDMI0.
Comment: What do you mean by HDMI 0 and HDMI 1? The Pi4 has a micro-hdmi-plug. With the correct adapter, you can attach any HDMI-capable screen.
Comment: Do you only want to use HDMI0? Seems there is typo in your question. Can you please clarify this?
Answer: A fully updated Raspberry Pi 4 will boot up properly and show the desktop, regardless of which hdmi port was used.
Now I faintly remember this not being the case at some point, but Forum moderator & engineer Jamesh has made it clear:

This rumour just won't die. You only need to use Hdmi zero if you want 4kp60.
Answer: I've not seen a way to swap HDMI 0 with 1 but there is a note towards the end of video options in Raspbian that MAY do it.
Add
<code>framebuffer_priority = 7
</code>
to config.txt This says HDMI 1 is to be the output of the pre-KMS frame buffer.
Best thing to be honest is hunt an adapter that fits as I have no idea what will happen with application software and future drivers.
Please note I have not tried this (no Pi 4B - had to buy wallpaper) so please let us know if it works.

Can I use HDMI 1 instead of HDMI 0?


OAuth? ,OpenID? Neither? Which one should my site support?

Question: I working on a new website and wanted some advice/feedback on OAuth vs OpenID vs Standard site owned username/password.
Answer: You may want to read this article by Malcom Tredinnick which explains what openid and oauth are, and do. They serve different purposes.
In summary, openid would be used to uniquely identify users - it's an identity solution. oAuth would provide a means to interact with data that your site's users have access to by allowing the user to grant your site temporary access to external services, their flickr account, for example - it's an authorization tool.
Offering only the standard site-specific account is always an option, of course but IMHO, supporting openid is better for your users and for the web. Many sites that implement openid allow users to use an openid if they have one, but also allow users to sign in and create accounts without openid as well. So, it's not necessarily an either/or proposition. You can do both!
Comment: Here's a version from the Wayback machine: http://web.archive.org/web/20080318052514/http://www.pointy-stick.com/blog/2008/03/13/explanation-difference-between-openid-and-oauth/
Answer: Keep in mind that even if your site doesn't need to access your users' private data on other sites, OAuth may still apply if you site has data that users may want to access either through an API or from another web site.  With OAuth, either end or both might apply to your site.
Answer: My impression of OAuth is that it's more for allowing secure, authenticated access to an API rather than for general user access.
Personally, I'd love to see more sites support OpenID.
Answer: I am in favor of supporting integrating user authorization using OpenID, Facebook and any other authenticators out there. Give the user a choice.
ALSO give them the option of not using them. Particularly in adult oriented websites your users may choose not to go with something that isn't as anonymous as a simple sign up to your website. Just use best practices when it comes to storing passwords.
Answer: You can combine all of them and get the best out of it, but it depends on your design choices.
For example if you are using Java, you can configure Acegi(Spring Security) to allow openID along with your normal authentication mechanism.
openID has OAuth extensions
OAuth has openID extensions
It's up to you...
Answer: JanRain lets you accept just about everything.  Given that the big players will always want to be providers but not consumers, this may be the only realistic "universal" option.
Answer: Here is the brilliantly clear explanation.
Coming directly from the OAuth documentation.
Answer: There is a new standard, called OpenID Connect in developer preview as of November 2011. It is built on OAuth 2.0 and, as far as I understand it, standardizes the way Facebook does things, which is also built on OAuth 2.0. It looks promising as there is a lot of experience with the Facebook authentication protocol, and it could possibly be the solution that many web developers are looking for. I haven't dived into it yet though so I might be misunderstanding it, but this is how I understand it after reading this blog post about it.


Featured Image Cetegory Not Shown In WordPress

Question: I am trying to create a post for a new WordPress website, and want to show a thumbnail in my blog for the post. However, the "Featured Image" tab is not there. I have seen the solution to add this code: add_theme_support( 'post-thumbnails' ); to my theme file, except it is already there, and there still is no featured image tab.
Answer: It's possible you've turned off that panel. You can check by clicking on the "three dots" menu (top right of the post editing screen) and selecting Preferences at the end of the menu. On the pop-up that appears, select Panels and ensure that the Feature Images slider is active.


Can we use one scale in another scale (the active scale)?, in which case could we do that?

Question: I play piano and guitar. It looks like there are talented people that improvise in some way that they play in a really different scale than the main scale they were playing on from the start, but after, the original scale remains.
I just know Major scales. I and I also know some other scales but don't know when to use them.
I want to enlarge my knowledge, so I already thank you guys for your help.
Comment: What particular style/genre of playing is this question aimed at? Different ones will require different 'other' scales.
Answer: Assuming you can play all the scales I mentioned, you're nearly there. Let's say you want to play some blues. Listen to some blues players, and you'll realise that the notes they play are from blues scales. Work out what key they're in, and try to pick up the actual notes they use, parrot fashion. Shouldn't be too difficult, given that you know which notes would be available to them in a given key. Be aware that some players use three different sets of notes - for instance, blues in A would mean they use A blues scale notes over A, then change to D blues notes over D, etc.
This is a fairly simplified version of what you would do, but it seems to be a good place to start. If it's jazz, then complications roll in, as the chords and keys may change more often and drastically. Country is often quite static and would give a good start for you, often using pent. majors.
Answer: I understand your plight of knowing the scales but not exactly knowing how to implement them into your playing. First, I'll say don't expect the practice to yield results over night. The scales will have to be almost second nature before you start to utilize them in practical playing. The best advise I can give (based on experience) is to start out simple, but focus more on the SOUND of the scale. Of course, you should be very comfortable with the "shapes" and notes so that you aren't thinking about what note to play next which will  then free your mind to really start to listening to the sound. This was an eye opener for me when I was working with the dorian scale (2nd mode of the major scale). If you are familiar playing over a minor chord - which I was - the dorian scale should come pretty naturally as soon as you get the sound of that major 6 interval in your ear (e.g. over Am7, playing A - F#, as opposed to A-F which you find in the natural minor). Using your ears will really help with scalular playing. As Charlie Parker was known to have said, and I paraphrase: "Learn it. Then FORGET  it!"
Answer: A better question would be: What's the supporting structure for the current harmonic function? Which substructures are contained in this main structure?
For example if I see a Cmaj7#11, I automatically associate the function with a Lydian sound, but there are many other scales (structures) that have the maj7#11 as their main chord, and all these scales are also available for you to improvise over the Cmaj7#11.
Also which are substructures of the Lydian? (or any of the others)

For example the Minor Pentatonic a half step bellow the root of the Lydian is a substructure. So on a Cmaj7#11 the B minor Pentatonic is a great scale (structure) to use for improvisation
Here's a cool video explaining extacly this example


How do I convert open street map export to geojson?

Question: I am trying to render this output from open street map into geojson to add into a map. I only need to export the data one time. How do I do that? OSM lists it as a use case. I see a js library to do this (but I need a backend solution). It also seems like you can export it as geojson from the api somehow. How do most people usually do this?
Comment: You might want to think about marking some of the questions that you've got answers to as "answered".
Comment: [out:json] gives overpass json not geojson. But there is an option in overpass turbo to export as geojson.
Comment: Please keep in mind that this isn't an appropriate way to add a OSM map, this only makes sense e.g. if you filter to highlight roadnetwork etc.
Please refer www.switch2osm.org
Answer: There are many ways

overpass turbo has on option to export as geojson.
JOSM also has option to export as geojson.
OpenLayers can directly read OSM format to be displayed in map. (you can also use it to convert to geojson but the above methods are much easier.
Answer: Please see the page about converting map data between formats in the OSM wiki. It lists two converters, OSM2GEO and osmtogeojson. The second one seems to support more features and is the one used by overpass turbo.


Stroke amelioration

Question: Excessive sugar, like Pepsi, is considered harmful. However, I am wondering if it could be helpful if taken by a victim of stroke during or immediately after a stroke, or somewhat after a stroke? My heuristic reasoning is partly that the brain likes energy in the form of sugar, and so if animals have evolved a method to ameliorate a loss of blood supply to a part of the brain, then that method probably needs energy, and needs to be provided quickly.
Answer: When you have an ischemic stroke, the oxygen-rich blood supply to part of your brain is reduced. With a hemorrhagic stroke, there is bleeding in the brain.
During an ischemic stroke, brain cells die of a lack of oxygen. Nutrient supply is indeed cut off as well, but the most acute threat to neurons is lack of oxygen. Because if their high activity, they need a continuous supply of oxygen. Bathing them in Pepsi cola won't stop them from suffocating. Note that they can switch to other fuel sources than glucose and hence nutrient supply isn't the critical factor.
During a hemorrhagic stroke there is pressure buildup in the brain and subsequent mechanical damage. Also here, pepsi coke won't relieve the damage done.
Last but not least, digesting food takes a lot of time. Oxygen deprivation kills neurons in minutes.
Source
WebMD

Stroke amelioration


How can we compile and call a smart contract in ethereum wallet

Question: I have created a sample smart contract in the online solidity compiler called Remix and I have also created a private blockchain. Then I also have an ethereum wallet running on this private test network.
 Can anyone tell me how can I use this smart contract in the ethereum wallet?
Answer: There are 2 ways.

Deploy the contract using ethereum-wallet and using this directly.
Deploy the contract using remix and add the deployed contract to ethereum-wallet.

Let's see each one by one:
Deploying using Ethereum wallet (or Mist)

Start privet blockchain and run ethereum-wallet(or Mist).
Make sure Mist is connected to your private network and not the public network.
Go to contracts tab in Mist.
Click on deploy new contract.
Paste the contract code in SOLIDITY CONTRACT SOURCE CODE tab.
Choose the owner account from which you want to deploy the contract.If you have multiple contracts, choose the contract you want to deploy. (You may need to specify constructor arguments if your contracts have them).
Choose the account from which you want to deploy the contract under thr FROM tab.
Click on deploy.
Make sure miner is running. (you can type miner.start(4) in geth console to start mining and miner.stop() to stop mining.
Once the contract is deployed, you can access the contract in COntracts tab of Mist

Deploying using Remix

First, connect your remix compiler to your private network.
Go to run tab of remix and under environments, choose Web3 Provider.
Under Web3 Provider Endpoint enter Rpc address of your node. (like http://127.0.0.1:8015)
Once your node is connected, you can choose the account from the accounts tab and deploy the contract. (I guess you have already done this).
Remember you have to run miner if it's not already running to mine your transaction.
Once the contract is deployed, copy the address of smart contract and abi.
Open your ethereum-wallet, which must also be connected to same private blockchain to which remix was connected.
Go to contracts tab and click on Watch contract.
Enter the name of contract and the address and abi you just copied. And your contract will be visible under Contracts tab.
Comment: while deploying using remix when i gave the rpc address it alerted an error which said    "Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC)."
Comment: I have tried the first method you mentioned and deployed my smart contract. Thank you Prashant.. :)
Comment: Good to hear that I was able to help. And for the second method, remix was unable to connect to your private network. Make sure you have `--rpc` and `--rpcport "some_port"` flag set. I guess you will also need rpccorsdomain flag as `--rpccorsdomain "*"`. But do remember don't set `rpccorsdomain` flag to * in production. It's just for testing.
Answer: make sure your private network is running. Then simply open a terminal and do
$ ethereumwallet --rpc path/to/geth.ipc

for example for me
$ ethereumwallet --rpc privateNetworks/geth_PoA/node1/geth.ipc

if you have rpc allowed then
$ ethereumwallet --rpc "http://localhost:8545"

should also work (update the rpc port to your config). From there, use the ehereum wallet UI for deploying contracts. You'll need the bytecode and abi of your smart contract. To get them, do
$ solcjs --abi --bin yourContract.sol

and just copy paste the content in the ethereum wallet under "create contract".
The process is exactly the same for mist.


If I create magical darkness with the Silent Image spell, can I see through it if I have the Devil's Sight warlock invocation?

Question: Since Devil's Sight allows one to see through magical and nonmagical darkness, and Silent Image can create any visual phenomenon, can I create darkness as a visual phenomenon which Devil's Sight can then see through?
Comment: Related: [Can I Use Major Image to Create Darkness?](//rpg.stackexchange.com/q/92316) and  [How can Silent Image be used to obscure vision in combat in 5E?](//rpg.stackexchange.com/q/70586)
Comment: The trivial answer to the question is "yes, because you know it's an illusion and you don't even need the invocation". But I believe you're asking whether someone other than the caster can see through this given Devil's Sight - is that correct?
Comment: Just as a note, those related are not dupes. Identical answers do not mean identical questions. But having said that, is there something in those questions that doesn't answer yours?
Answer: Silent Image probably does not create the same effect as Darkness
Silent Image, a 1st-level spell says:

You create the image of an object, a creature, or some other visible phenomenon [...] The image appears at a spot within range and lasts for the duration. The image is purely visual; it isn't accompanied by sound, smell, or other sensory effects.
[...]
Physical interaction with the image reveals it to be an illusion, because things can pass through it. A creature that uses its action to examine the image can determine that it is an illusion with a successful Intelligence (Investigation) check against your spell save DC. If a creature discerns the illusion for what it is, the creature can see through the image.

The wording of Silent Image is a little vague because it allows the caster a lot of room for creative use but it is probably unbalancing to allow it to duplicate the effect of the higher level Darkness spell. The fact that a creature can investigate it to nullify the effect means that it is not as strong as the true Darkness spell and so there is room to argue both ways.
I think it's also worth pointing out that the Silent Image spell does not convey any sort of effect or benefit to the generated image ("It is purely visual"). If you create the image of lava, it does not deal fire damage to any creature that stands in it. (That would be what Phantasmal Force, another higher level spell, does.) So it shouldn't convey the benefits of Darkness spell by the same token.
Even if you did rule that Silent Image replicated Darkness, in actual use, it might not function as well. The rule for Silent Image contains the sentence "Physical interaction with the image reveals it to be an illusion, because things can pass through it."
This creates a conflict: A creature or object can move through both a true Darkness and an illusory version just as easily. But the fact that the Silent Image version specifically states that "physical interaction reveals it to be an illusion" means that there must be some difference between the two (whatever that is) which causes it to not function as a true Darkness.
In the cleanest presentation, a creature might be outside of the effect and look through it at another creature that is also outside the effect. But as soon as, say, a projectile traveled through it, that would arguably be physical interaction with the illusory darkness and therefore reveal it to be normal darkness.
In short, it's messier to give Silent Image the ability to replicate all aspects of the Darkness spell than it is to say that it can create an area of darkness that lacks the full benefit of Darkness and therefore it's probably a better to interpret the rules so that it does not.
Comment: this is reasonable, but both Silent Image and Major Image mention being able to both create a visual phenomenon, and the spell descriptions both mention that they are images, it doesn't actually mention anything along the lines of "visual image" in the description for the Silent Image spell.
Comment: @guess I went ahead and removed that paragraph. I must have skimmed the first line of the spell too quickly. Thanks for pointing that out!
Comment: @guess A _visible_ phenomenon, not visual. Darkness is not visible; it's the opposite of visible.
Comment: I'm not sure illusory darkness *could* be physically interacted with. As a DM, I don't think I'd give the 'instant reveal of illusion' just for touching it, because they wouldn't be touching darkness anyway.
Answer: By the rules, we know that you can create an illusion of darkness, and I suppose even magical darkness.  The rules are not entirely clear, but by logic there are only two possible ways a DM could rule on this:
Interpretation #1: Yes.
Since you copy magical darkness so perfectly, the Warlock's Devil's Sight would work, and they see through it.  Even if they don't do a great job, it would still be darkness, and the Devil's Sight should work on it.  It seems reasonable that any darkness effect would be covered by the term:

You can see normally in darkness, both magical and nonmagical, to a distance of 120 ft

Interpretation #2: No.
A weaker argument could be made that because the illusionist doesn't know about/can't copy the magical nature correctly just create "blackness" that isn't really magical darkness. Since it doesn't work like magical darkness, the Warlock not being able to see through it would have reason to believe something odd is going on and would have a reason to investigate to learn if it is an illusion.
Odd Edge Case
Note: there is (at least) one form of darkness that Crawford tweeted Devil's Sight is known not to work on, and that is the void created by hunger of Hadar.  One small issue to that is that I don't think it made it into Sage Advice, and so despite being official ruling when it was made, it wouldn't be under the new Sage Advice header.  Take all of that for what you will, but an illusion of the void, would be harder to rule.
Answer: Here's my 2 cents:
"The image is purely visual; it isn't accompanied by sound, smell, or other sensory effects. - As a DM I'd consider "Blindess" a sensory effect.
It also says Physical interaction with the image reveals it to be an illusion, and that a creature that discerns the illusion for what is is is able to see through the image.
You could, with silent image, create a 15 foot cube of black colour, but anyone standing inside it is physically interacting with it, and would there for be able to see through it. Anyone attacking you inside it we can assume is also physically interacting with it, and can again see through it.
So using Silent Image to create darkness would be about as effective as using a flashlight with a coloured gel as a lightsaber.
Lastly, Devils sight - which says you can see normally in darkness, both magical and non magical - since you're not creating darkness, but rather an illusion of darkness, this isn't applicable either.
Answer: In my opinion, the darkness is a visual phenomena, and thus could be used to replicate the effects of darkness, and devil sight could not see through it, because it is still not actual darkness, you are imprinting the image of darkness regardless of other magical effects. The thing that dispels illusions is disbelief in the illusion, physical interaction applies this because when you move through mist or solid objects, they do not react as they should. As such, I imagine in the case of darkness, the indicator would be how the light reacts to it. The darkness doesn't actually block light, so if you imagine a dome of darkness, a darkness spell would cast a shadow where it blocks surrounding light, while an illusion spell does not. The spell is meant to be open ended for creativity, the DM just needs to be creative in details that differentiate the illusion from the real thing.


Request 2(both) engine startup then pushback at the gate?

Question: Usually, the engine starts after pushback.
but if the pilot requsests two(both) engines startup before pushback, can the controller approve it?
Answer: This can be done, and can be approved when needed.
The most common case would be an inoperative APU, requiring the use of external high pressure air to start an engine. Once one engine is started, you can push back and perform a "crossbleed" start for the other engine, using bleed air from the operating engine to start the other one. That does require power above idle on the operating engine, and sometimes it's easier to just use the external air to start both engines at the gate before pushback.
It's important to keep vehicles, especially large, high profile vehicles like catering trucks, away from the tail while the engines are running; that's accomplished with marshallers with lighted wands. ATC would protect the area behind the aircraft from light aircraft for the same reason; on a big airline ramp, that isn't so much concern, but at a smaller airport with a taxiway close behind the gate, it could be.
So you tell Ground Control what you need to do, they wait for (or create) a break in traffic flow behind you, and then they approve it. And when the engines are started, you request clearance for pushback as normal, and go on with your day.
Comment: Ramp space is usually not controlled by ATC.
Comment: @RetiredATC Technically not, but Ramp Control (when operating) functions as such and issues startup/pushback clearances the same way that Ground Control would.  In some contexts, the distinction between actual ATC and Ramp Control matters, but when you're in the cockpit requesting clearance to push back or start engines at the gate, the distinction is basically lost.
Comment: Is ramp control regulatory or advisory? If a pilot pushed back w/o ramp control permission, could a Pilot Deviation be filed?
Comment: Reality: get permission from Ramp Control before you push (assuming they're operating & issuing those). Can they file a PD? AFAIK, no, but that doesn't change the fact that, *de facto*, they **do** control movement on the ramp. (Besides, a pilot who doesn't follow the published procedures for getting permission from Ramp opens himself up to delays, or in the bad case, "careless & reckless" possibilities.)


Can I use a Nikon SB-25 on a Canon G9?

Question: How can I use a Nikon SB-25 on a Canon G9? I know that they are not current production, but I have to use what I have.
Answer: The SB-25 should be safe to use, as its sync voltage is around 4V. The Powershot Gs were initially limited to a 6V voltage limit, and I'm not sure if they were upgraded to the 250V limit the post-300D dSLRs are.
It should fire in sync on the hotshoe of the Powershot G9 (my SB-26 fires on my G9), but you may want to tape over the non-sync pins (those four arranged in a little square below the main sync pin) to avoid cross talk with the hotshoe contacts. The pins shouldn't hit the contacts (Nikon places their pins differently), but the clearance isn't very big on the lower two pins.
However. Firing in sync is all that's going to work. You have to set the power on the flash in M mode and manually set the zoom. You can use the A mode to automatically set the flash power, but you'll have to set the ISO and aperture you're using on the flash as well, since it can't talk to the camera.
Unlike the SB-26, however, the SB-25 does NOT have a built-in optical slave, so to use it off-camera, you'd have to use a TTL cable (the Powershot G9 has no PC sync port, only the hotshoe) or radio triggers. I would, however, recommend going the radio trigger route. A full-sized speedlight with 4xAA batteries in it is so much bigger/heavier than a G9 that it's an unwieldy combination, and the stress on the flash foot is not ideal. Radio triggers being much smaller/lighter, it's an easier combination to handle.
Answer: As Manual flash mode, it should work if off camera, triggered by PC sync cord, or by optical slave, or by radio trigger.
It ought to work on the hot shoe. As Manual mode, only the large center pin is used on the hot shoe, and any additional hot shoe pins don't match anything, and will not matter.  It will not have any flash to camera communication on any modern camera, but the large center pin is all that matters to trigger it in sync.
Have you tried it, and it didn't work?  You can test with any metal object, like a paper clip or small screw driver blade. Use it to short the large center pin to the metal foot, and the flash should fire if it is still operative.  That is all the camera hot shoe will do.  Don't flash it in your face, nor if face down on anything that the heat can scorch (it can do it).
Comment: The Powershot G9 doesn't have a PC sync port, so PC sync cord is out.
Comment: If a camera has a hot shoe but not a PC port, you can use a [hot shoe/PC sync adapter](https://www.amazon.com/Pixel-e-TTL-Flash-Adapter-Flashguns/dp/B00554PCDG/) to trigger a flash with a PC connector.

Can I use a Nikon SB-25 on a Canon G9?


UCI- canada Application

Question: I have an expired Canadian visiting visa and am about to apply for another one, Please how can I get my UCI ( Unique client identifier) number for the expired visa? Additionally, is it important to put the previous UCI number of my present application?
Thank you
Answer: Your UCI appears on any document from the Government of Canada. If you don't have your UCI or any documents with it shown but want to fill out an application form you can leave the field for UCI (Client ID) blank. The latter implies it's not important to include it.
Source: http://www.cic.gc.ca/english/helpcentre/answer.asp?qnum=772&top=4

UCI- canada Application


How can I find out the species of my baby turtles?

Question: I just received 3 baby turtles as a gift from my boyfriend and we were looking online to see what species they are. The smallest one is a darker shade of green. I saw some called red-eared slider turtles, but my turtles don't have any sign of red ears, unless they are too small to notice. I also saw tiny red-eared slider turtles and they look like normal red-eared turtles.
Also, how do you tell a turtle's gender; and what kind of foods other than the normal turtle food, can I give them as treats?
Answer: I'd be more inclined to think they're probably yellow belly sliders which are the same as far as care and size go, but they don't develop the red marks on the side of their head.
I would stick with turtle food and you can give snacks like the veggies you have in there or crickets, but the turtle food will be much better as far as nutrition is concerned.
I would do a lot of research on care, they get rather large, and need heated water and a heated basking area. They are cold blooded so the basking area, which should be heated to roughly 90 degrees, is extremely important. The very general rule for housing is 10 gallons of water per 1 inch of shell, per turtle, so right now, you're looking at roughly a 30 - 40 gallon aquarium. They grow fairly quickly as juveniles but will slow down, but for 3 adults you honestly are in the territory of needing a pond, they get commonly 10 - 12in in length.
Comment: They are loners, only like meetings to make babys. So you can not add up the rule of Jestep for three turtles three times...


Charge controller for Li-ion or Li-Polymer battery

Question: I am trying to work out the good charger for Mobile phones, which can serve as good performer for various smart phones out there in market these days & mostly using Li-ion battery. Charging has 4 stages -- "the initial trickle-charging, then constant current charging, then constant voltage charging & finaly Top-up charge" -- all this is controlled & monitored by a control circuit/IC of charger. So, my concern is if such circuit/module/IC is already there in Mobile phones & taking care of all protections to battery/phone including overheating during charge OR The charger designer have to incorporate these circuits in Charger itself? If former case, that means we just need to make a charging source giving ample current & 4.75V-5.25V voltage, like a high-powered USB output port would gives.
My feeling is such stages-wise charging & control/monitor circuitry is already within the phone set, i just want to reconfirm.
Answer: Chargers are just dumb wall warts these days; the charger circuitry is in the phone, or (rarely) even in the battery itself.


Uploaded documents of extensions .docx /.xlsx with metaData, metaData are not saved

Question: When the documents with extensions .docx /.xlsx is/are uploaded along with metadata mandatory fields on SharePoint online. These mandatory fields are empty. Any reason?
Answer: This issue is resolved, I have implemented Deferred and Promise in our jquery code. Initially document is uploaded in the document list and then second function is called to update metaData values..


Proving a vector state is pure

Question: Let $\mathcal{M}$ be a until $*$-algebra of 3x3 complex matrices. We have the general form of a vector state $\omega_{\psi} : \mathcal{M} \to \mathbb{C}$ over $\mathbb{C}^3$ as given by
$$\omega_{\psi}(A) := \langle \psi, A\psi \rangle, \quad A\in \mathcal{M}, \psi \in \mathbb{C}^3, \|\psi \|=1.$$
I need to pick an $\psi$ such that the above is a pure state (i.e. it cannot be written as a convex combination $\lambda \omega_{\sigma} + (1-\lambda)\omega_{\phi}$ of pure states $\omega_{\sigma}, \omega_{\phi}$ and $\lambda \in (0,1)$).
The proof I have formulated is to pick a basis of $\mathbb{C}^3$ over $\mathbb{C}$ and take $\psi$ to be one of these basis vectors, for example
$$\psi = \begin{pmatrix} 1\\0\\0 \end{pmatrix}.$$
In this case a convex combination would be of the form
$$\langle \sqrt{\lambda}\sigma + \sqrt{1-\lambda}\phi, A\left(\sqrt{\lambda}\sigma + \sqrt{1-\lambda}\phi \right)\rangle,$$
which implies that for $\omega_{\psi}$ to be mixed, $\psi$ must be a linear combination of the form $\sqrt{\lambda}\sigma + \sqrt{1-\lambda}\phi$, but since it is a basis vector, this isn't the case and we have a contradiction.
I have a feeling this isn't totally sufficient as a proof - does anyone have any ideas/hints?
Comment: The way you've defined $\omega_\psi$, it appears to be a scalar. Kindly check and clarify the definition. Do you require $A\psi$ to be a pure state?
Comment: @GautamShenoy This may be a difference in language - here I mean a state is a normalised, positive linear functional $\omega_{\psi} : \mathcal{M} \to \mathbb{C}$, rather than the quantum mechanical meaning of state being just a vector.
Answer: I don't think your argument works. For instance you can write
$$
\begin{bmatrix} 1\\ 0\\0\end{bmatrix}
= \sqrt{\frac12}\,\begin{bmatrix} 1/\sqrt2\\ 1/\sqrt2\\0\end{bmatrix}
+
\sqrt{1-\frac12}\,\begin{bmatrix} 1/\sqrt2\\ -1/\sqrt2\\0\end{bmatrix}
$$
Now, any state of the form $\omega_\psi$ is pure. Suppose that $\omega_\psi=\lambda\omega_\sigma+(1-\lambda)\omega_\phi$. Take $A=P_\psi$, the projection onto $\mathbb C\psi$. Then
$$\tag1
1=\langle \psi,P_\psi\psi\rangle=\lambda\langle \sigma,P_\psi\sigma\rangle+(1-\lambda)\langle \phi,P_\psi\phi\rangle.
$$
Since $0\leq \langle \sigma,P_\psi\sigma\rangle\leq1$ and $0\leq \langle \phi,P_\psi\phi\rangle\leq1$, it follows that
$$
1=\langle \sigma,P_\psi\sigma\rangle=\langle \phi,P_\psi\phi\rangle.
$$
Then, since $P_\psi$ is a projection, $1=\langle \sigma,P_\psi\sigma\rangle=\langle P_\psi\sigma,P_\psi\sigma\rangle=\|P_\psi\sigma\|^2.$ From
$$
1=\|\sigma\|^2=\|P_\psi\sigma+(1-P_\psi)\sigma\|^2=\|P_\psi\sigma\|^2+\|(1-P_\psi)\sigma\|^2=1+\|(1-P_\psi)\sigma\|^2,
$$
we conclude that $(1-P_\psi)\sigma=0$. In other words, $P_\psi\sigma=\sigma$. So
$$
\sigma=P_\psi\sigma=\langle\psi,\sigma\rangle\,\psi.
$$
That is, $\sigma=\alpha\,\psi$, with $|\alpha|=1$. Similarly, $\phi=\beta\psi$ with $|\beta|=1$. Thus $\omega_\sigma=\omega_\phi=\omega_\psi$.
The above reasoning can be made more general. You can consider states of the form $A\longmapsto \operatorname{Tr}(XA)$ for some $X$ with $X\geq0$ and $\operatorname{Tr}(X)=1$. Your $\omega_\psi$ is obtained when $X=P_\psi$. Even in this setting, the pure states are precisely the point states $\omega_\psi$ for some $\psi$, and the proof is basically the same as above.
Comment: In the calculations on the norm of $\sigma$, shouldn't the third equals sign from the left be a "$\leq$"?
Comment: No, they are all equalities.
Comment: Are we not applying the triangle inequality there?
Comment: No. It's an equality, and it is by definition. If you want to put a name to it (although that wouldn't be entirely correct) it would "Pythagorean Theorem".
Comment: Sorry, yes I now agree after expanding the norms into scalar products and calculating explicitly. Thanks for the answer and patience :-)

Proving a vector state is pure


How to resolve high priority issue at the time of delivery

Question: What will you do if you find a high priority bug and your client wants to deploy the software after knowing that critical bug and you don't have your Developer to fix that bug he is on vacation?
Answer: This question may have different answers from various perspective. My opinion is You can explain to the client about the impact of the critical bug on the end user. So that you can delay the release by not losing the brand reputation or find out is there any workaround to fix the bug without developers help.  But the go-live decision needs to be taken by the client.
Still, client wants to move it to live you can defer the particular functionality with the bug to next release with the fix.
Answer: You cannot technically resolve it due to time restraint.

Testing lead has a final say during decision making stage, if it is a blocking issue, a testing lead can recommend against its release.
If it has to be released, you can at least document it as a known issue; even better, write down any potential work around if there is any.
I have never personally encountered a situation that a customer wants a piece of software so bad that they are knowingly accepting a buggy release.
Comment: Yes I agree, why client would like to go ahead with critical bug knowingly...
Answer: In this scenario you can have multiple options:

If the release is so important on that date then disable the module and launch the product. Once the release is over fix the bug, test the entire product and move to Live.
Keep this issue as a known issue and launch the product. Then later fix it and move to Live.
Try to find the root cause on which build it has got failed and deploy the previous builds and verify that.
If the client still wants launch the product on the same date then in such worst case try to contact the developer who is in vacation to get some clarification about that module and work with the alternate developer.


fit to screen in chrome?

Question: In Opera if I zoom pages I can still have the page fit to screen so no scroll bars appear. How to do that in Chrome?
Comment: Did you mean 'zoom to fit width and height'?
'How to do that?' Did you mean by a function in chrome or by a chrome extension or by programming in google-chrome-extension?
Comment: i have a tiny screen and when i zoom a webpage, i get scrollbars esp horizontal , in chrome.....like mobile , text does not auto fits to screen. If u do same on Opera, no matter how many levels you zoom , you wont get any horizontal scrollbar on any webpage.

So is there any extension for chrome to do same ?
Comment: Ok, so, you need an extension.
Answer: There a few Chrome extensions than can add that functionality. Here are some of them:
Fit to width:
https://chrome.google.com/webstore/detail/fit-to-width/dfdmbpdbpocelpgahddghhkomnefchkl?hl=en
iZoom:
https://chrome.google.com/webstore/detail/izoom/iheccogfcpjfjbnlohnlgdljaefpgaoi
Zoomy:
https://chrome.google.com/webstore/detail/zoomy/jgfonhdeiaaflpgphemdgfkjimojblie
EZ Zoom:
https://chrome.google.com/webstore/detail/ez-zoom/pgjddfakmeeljhjhnhgakblggcfkmima
Chrome extensions are little additions to browser developed independently by individual external developers. They can be installed directly in browser. And some also have their own settings which you can modify to suit your exact requirements. Go to 'Settings -> More Tools -> Extensions' for installing, uninstalling or fine-tuning each extension individually.

fit to screen in chrome?


Have gas or dust or rock accumulated in our solar system on its 20 orbits around the Milky Way?

Question: Also,does the absence of the accumulation of anything large such as rogue planets by the solar system suggest the Milky Way has been orderly and stable for billions of years?
Comment: Our solar system has been orderly and stable, our existence proves this.  Dust and gas wouldn't "accumulate" as there is nothing to slow it down and keep it in the solar system. Dust and rocks that enter the solar system from the interstella medium fall towards the sun, speeding up, and then sail away, unless they hit something
Comment: You assume that the solar system moves through stuff. Yet everything orbits the galactic center at about the same speed, thus it won't accumulate stuff like you do when driving a Cabrio, but more like you overtaking or being overtaken by other runners at a marathon past half distance: something which happens rarely. And even then James's logic applies
Comment: @James K  The stability of our solar system over billions of years as it circles the galactic centre suggests that there are no large accumulations of randomly moving cold dark bodies .
Comment: @planetmaker  I was  assuming that there could be some matter moving randomly around in the Galaxy over the last 4 billion years for example stars orbiting the central black hole can be ejected from its vicinity.I think the stability of the solar system shows that most matter moving too fast or too slow to orbit the Galaxy moved to the centre of  or was ejected from the Galaxy early on in its history.
Comment: Or that the Galaxy formed initially in a very orderly manner.
Answer: How does objects in space accumulate other objects? If we ignore direct, inelastic collisions, the way to capture a passing object is to have an interaction where it loses enough momentum to get gravitationally bound. If it doesn't, it will just sail past. For slow objects tidal interactions might do it, but for fast ones you typically need a third object to pick up the momentum in some kind of three-body interaction.
However, the probability of this being enough goes down rapidly with higher relative velocity. Typical interplanetary velocities are about 10 times the typical interplanetary velocities: it takes a very precise angle and moment for some interloping dust grain or planet to get captured. Old calculations suggest this is very rare (about one comet per 60 million years), but modern multi-planet simulations suggest about 1200 captured (asteroid sized) objects per million years.
Note that since these interactions are time-reversible the solar system also likely loses objects over time.
Another thing to note is that there are many more tiny dust grains than interstellar asteroids or comets, and they in turn outnumber rogue planets. So while we may capture some dust and asteroids, the number of rogue planets captured (or just messing up orbits) is very low even under 20 galactic rotations.
Comment: How many rogue black holes or stars are there ?  Would these have left the Galaxy a long time ago?
Comment: An article about stars that  escape from their birth place https://phys.org/news/2023-10-astronomers-infant-star.html     Whether or not they can become rogue stars that could affect our solar system isn't discussed.


Kernel density estimate vs Dirichlet process mixture

Question: Nowadays the Dirichlet process mixture (DPM) seems to be the default Bayesian approach for density estimation. My question is why not simply use the kernel density estimate (KDE) to model the density? One can surely use a Bayesian sampler (e.g. MCMC) to infer the bandwidth of KDE and thus make it "Bayesian". I would argue that posterior draws from Bayesian KDE are easier to check convergence than DPM. What would be the theoretical benefits of DPM over KDE?
Comment: Two comments: (1) bandwidth choice for KDE is not a trivial problem. You can set it to zero and have a solution that perfectly fits the data, but is a horrible approximation of the density. (2) Methods for checking the convergence of MCMC for both models would be exactly the same no matter of the model definition.
Answer: After some research and thinking, here would be my own tentative answer to the question I posted; just in case someone else is interested in this question.
Given n data points, KDE uses a mixture of n kernels to approximate the "true" density while DPM, in finite samples, typically ends up with a smaller mixture even though it theoretically uses an infinite number of mixtures. Moreover, KDE fixes the mixing weights at 1/n while DPM allows it to follow the stick breaking process. Assuming Gaussian kernels, it is easy to see that KDE fixes the means of the kernels at the data points while DPM estimates them from data. Taken together, DPM could argue that it is more parsimonious (using a smaller mixture) and is more flexible (not fixing mixture weights and kernel parameters) than KDE. The empirical findings in http://mlg.eng.cam.ac.uk/pub/pdf/GoeRas10.pdf contains a comparison of the performance of KDE and DPM and seems to suggest that DPM performs better.
(To Tim's comments: Rob Hyndman has a paper on estimating KDE bandwidth https://robjhyndman.com/publications/bandwidth-selection-for-multivariate-kernel-density-estimation-using-mcmc/. There are probably more papers on that topic. As for convergence, depending on the algorithm for DPM, the number of kernels as well as their labels change across MCMC iterations and hence makes it challenging to check the draws' convergence.)
Comment: I'd like to hear more about your exploration of this question--can we discuss by email? I'm here: http://www.sethrf.com


Electric hook up for residential shed in back yard

Question: I have 2 12/2 UF-B I'm running from my house to supply a double pole 20 in my shed to have 2 120v supplies out there I just dont know what size breaker I need in my main to supply the box in the shed and what size box in the shed to just hold a double pole 20 and maybe another spot if I ever want to add another one ( it will not use a lot of power only 3 led lights and 4 outlets the biggest thing will be a small window unit on one of the outlets
Comment: THWN in conduit is fine, but don't braid it. Four wires: white, ground, and your call for the remaining two colors, but whatever you do make them different for your future sanity. Black and red is the traditional pairing.
Comment: This sounds like a detached shed.  If so you probably also want two ground rods for it to be in code.  If plans/materials not already bought, using larger gauge wire now will help to future proof work/cost later.  Same with the panel in the shed.
Comment: I think (the experts will say for sure) you can only run *one* circuit of a given type to an outbuilding. If that is indeed the case, and to save money besides, instead of running 2 x 12/2, you could run 1 x 12/3 and install an MWBC. That will give you the same power, using a 20A double-breaker, but only one cable instead of 2 and technically counts as one circuit.
Comment: Instead of direct burial I had some 3/4 cpvc laying around so I  used that for extra cover for the wire and the 12/3 wouldnt fit. Could I run braided THHN/THWN wire and just run an extra black for my second hot ?
Answer: Depends on the pipe.
If you have proper PVC conduit and are willing to run it "end to end" from the panel to the outlets:
Then you can use THWN wires.  You will need burial depth of 18" of cover.  You cannot use the individual wires out of UF-B cable unless they have individual markings (they don't).
You can do a MWBC with THHN wires.  You cannot do it with /2+gnd UF cable.
MWBC means a shared neutral circuit with two legs of 120V both feeding outlets and sharing a neutral.  You do not need a subpanel in the shed for this use and that means you do not need ground rods.
If you have random PVC pipe of some kind:
Then you need to get proper PVC conduit for the stub-ups where it comes from above ground to depth, and the depth must be 24" of cover, since it's effectively not in conduit since it's not conduit at all.  You cannot use individual wires and must use suitable direct-burial cable such as UF.  Note UF is very flat and won't like to fit in normal sized pipe.
For the MWBC you would need 12/3 UF cable.  Can't run 2 separate circuits to an outbuilding unless one is a different voltage or usage - for instance, it could be hooked into lights and controlled from a switch from the house. (no, the switch can't be the breaker).
Comment: So I'm returning the 12/2 and getting the 12/3 I know it will be tight it shaved a thing layer off the end when trying to go through but  still not sure what breaker I would need of my main to supply this and then what I would need in my shed on the other end of the 12/3 would I just   Pull in and it goes straight to the outlets/ receptacles or is there some sort of junction I need to have a shut off on it?


Angular 9 mat-progress-buttons error: ERROR in Failed to compile entry-point mat-progress-buttons (es2015 as esm2015) due to compilation errors

Question: Getting an error with mat-progress-button given below after updating from Angular 8 to Angular 9.
It was working fine with Angular 8. Is MatProgressButton incompatible with Angular 9?
node_modules/mat-progress-buttons/esm2015/mat-progress-buttons.js:181:26 - error NG1010: Value at position 1 in the NgModule.imports of MatProgressButtonsModule is not a reference: [object Object]

The import looks like:
import { MatProgressButtonsModule } from 'mat-progress-buttons';
My package.json looks like this:
  "dependencies": {
    "@angular/animations": "^9.0.2",
    "@angular/cdk": "^9.1.0",
    "@angular/common": "~9.0.2",
    "@angular/compiler": "~9.0.2",
    "@angular/core": "~9.0.2",
    "@angular/forms": "~9.0.2",
    "@angular/material": "^9.1.0",
    ...
    "@angular/router": "~9.0.2",
    "core-js": "^2.5.4",
    "mat-file-upload": "^1.3.2",
    "mat-progress-buttons": "^8.0.7",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.3",
    "@angular/cli": "~9.0.3",
    "@angular/compiler-cli": "~9.0.2",
    "@angular/language-service": "~9.0.2",
   ...
    "typescript": "^3.7.5"
  }
}

Comment: I have the same issue (here my [SO question](https://stackoverflow.com/questions/60726180/angular-9-value-at-position-x-in-the-ngmodule-imports-is-not-a-reference)) and it seems related to how Angular 9 treats deep imports, but I could not find any solution.
Answer: I had the same issue. It seems like there was some kind of error with the versions of the installed modules. I resolved it by deleting the
node_module folder and reinitiating it with npm install.
Answer: Deleted node_modules folder, dist folder, and package-lock.json file
npm cache clean --force
npm cache verify
npm i

Then it worked for me!


If I get my personal quarters in the Institute, then attack the Institute later do I lose everything in the quarters?

Question: The Institute would get blown up, and if I left things in there, are they gone forever, or are they teleported to one of my settlements?
Answer: When the Institute becomes inaccessible, everything in it will unfortunately be lost forever. So don't stash anything of value in there, unless you plan to finish the game on the Institute route.
Comment: This is basically true, but the other faction quest lines eventually result in an assault on the Institute. I can't recall if there's a way to get to your room and loot the containers at that point.
Comment: @DCShannon I don't think so. There are a lot of closed doors in the Institute atrium during the assault which block most of its areas.