The meaning of the word "in" in Romans 5:3

Question: Romans 5:3 challenges us to "rejoice in our sufferings". But the word "in" has (at least) two meanings in English. It could mean "rejoice during our sufferings" or "rejoice because of our sufferings" (akin to "rejoice in the Lord"). Which is meant here?
Comment: Nobody enjoys suffering (except those of a masochistic disposition). But we who suffer can find something to rejoice in, whilst we endure the suffering : is clearly the meaning.
Comment: Related: [In Romans 5:3 what is the nature of the sufferings (thlipsis)?](https://hermeneutics.stackexchange.com/questions/27324/in-romans-53-what-is-the-nature-of-the-sufferings-thlipsis?rq=1)
Answer: Perhaps a bit of both:

Matthew 5:10-12 Blessed are they which are persecuted for righteousness' sake: for theirs is the kingdom of heaven. Blessed are ye, when men shall revile you, and persecute you, and shall say all manner of evil against you falsely, for my sake. Rejoice, and be exceeding glad: for great is your reward in heaven: for so persecuted they the prophets which were before you.

Misfortunes offer us the unique opportunity to become children of God:

Matthew 5:43-45 Ye have heard that it hath been said, Thou shalt love thy neighbor, and hate thy enemy. But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use you, and persecute you; That ye may be the children of your Father which is in heaven: for he makes his sun to rise on the evil and on the good, and sends rain on the just and on the unjust.

2 Corinthians 12:10 Therefore I take pleasure in infirmities, in reproaches, in necessities, in persecutions, in distresses for Christ's sake: for when I am weak, then am I strong.
Answer: The meaning of the word "in" in Romans 5:3
It means : "rejoice during our sufferings."
Romans 5:3 Contemporary English Version

But that's not all! We gladly suffer, because we know that suffering
helps us to endure.

Paul says "We gladly suffer"- depends on endurance and naturally help from above. Such tribulation experienced and borne patiently with divine help produces endurance, something previously unknown.
Jesus for example suffered cruelty, was betrayed by a close friend, abandoned by his disciples, was spit on, lashed, punched. ridiculed, and tried illegally by the High Court. Yet while suffering he endured steadfastly with dignity and strength.
Answer: Thank's to Dottard point out in BGAD, the Greek preposition ἐν can have the meaning because of.  During fits the meaning of when.  "Rejoice when we suffer" = "rejoice during our suffering."
However, I should include this disclaimer from BGAD lexicon. There is much that ἐν can mean.  We are dependent on the context.

ἐν prep. w. dat. (...). For lit. s. ἀνά and εἰς, beg. For special NT uses s. AOepke, TW II 534-9. The uses of this prep. are so many-sided, and oft. so easily confused, that a strictly systematic treatment is impossible. It must suffice to list the main categories, which will help in establishing the usage in individual cases.
--
Arndt, W., Gingrich, F. W., Danker, F. W., & Bauer, W. (1979). In A Greek-English lexicon of the New Testament and other early Christian literature : a translation and adaption of the fourth revised and augmented edition of Walter Bauer's Griechisch-deutsches Worterbuch zu den Schrift en des Neuen Testaments und der ubrigen urchristlichen Literatur (p. 258). University of Chicago Press.

Reference to because of in BDAG.

a. gener. ἁγιάζεσθαι ἔν τινι Hb 10:10; 1 Cor 7:14. ἐν τ. ἐπιθυμίαις τῶν καρδιῶν Ro 1:24; perh. ἐν Ἰσαὰκ κληθήσεταί σοι σπέρμα 9:7; Hb 11:18 (both Gen 21:12). ἐν τῇ πολυλογίᾳ αὐτῶν because of their many words Mt 6:7. ἐν τούτῳ πιστεύομεν this is the reason why we believe J 16:30; cf. Ac 24:16; 1 Cor 4:4; 2 Cor 5:2. W. attraction ἐν ᾧ=ἐν τούτῳ ὅτι for the reason that=because s. IV 6d below. Sim., of the occasion: ἔφυγεν ἐν τῷ λόγῳ τούτῳ at this statement Ac 7:29; cf. 8:6.
--
Arndt, W., Gingrich, F. W., Danker, F. W., & Bauer, W. (1979). A Greek-English lexicon of the New Testament and other early Christian literature : a translation and adaption of the fourth revised and augmented edition of Walter Bauer's Griechisch-deutsches Worterbuch zu den Schrift en des Neuen Testaments und der ubrigen urchristlichen Literatur (p. 261). Chicago: University of Chicago Press.

This seems to be a good fit in BGAD.

e. circumstantially, of the condition(s) under which someth. takes place
--
Arndt, W., Gingrich, F. W., Danker, F. W., & Bauer, W. (1979). In A Greek-English lexicon of the New Testament and other early Christian literature : a translation and adaption of the fourth revised and augmented edition of Walter Bauer's Griechisch-deutsches Worterbuch zu den Schrift en des Neuen Testaments und der ubrigen urchristlichen Literatur (p. 261). University of Chicago Press.

The phrase in other verses (same phrase but varied meaning):
1)

 διὸ αἰτοῦμαι μὴ ⸀ἐγκακεῖν ἐν ταῖς θλίψεσίν μου ὑπὲρ ⸁ὑμῶν,* ⸀1ἥτις ἐστὶν δόξα ὑμῶν.*
(Eph. 3:13, NA28)

13 So I ask you not to lose heart over what I am suffering for you, which is your glory.
(Eph 3:13, ESV)

τὸ μηδένα ⸀σαίνεσθαι ἐν ταῖς θλίψεσιν ταύταις. αὐτοὶ γὰρ οἴδατε ὅτι εἰς τοῦτο κείμεθα·
(1 Th 3:3, NA28)

that no one be moved by these afflictions. For you yourselves know that we are destined for this.
(1 Th 3:3, ESV)

Figure 1 Senses of ἐν in the New Testament (generated with Logos Bible Software).

Passages on related subject

that I may know him and the power of his resurrection, and may share his sufferings, becoming like him in his death, 11 that by any means possible I may attain the resurrection from the dead.
(Phil. 3:10–11, ESV)

Therefore do not throw away your confidence, which has a great reward. 36 For you have need of endurance, so that when you have done the will of God you may receive what is promised.
(Heb. 10:35–36, ESV)

Count it all joy, my brothers, when you meet trials of various kinds, 3 for you know that the testing of your faith produces steadfastness. 4 And let steadfastness have its full effect, that you may be perfect and complete, lacking in nothing.
(James 1:2–4, ESV)

Rejoice in the Lord always; again I will say, rejoice. 5 Let your reasonableness be known to everyone. The Lord is at hand; 6 do not be anxious about anything, but in everything by prayer and supplication with thanksgiving let your requests be made known to God. 7 And the peace of God, which surpasses all understanding, will guard your hearts and your minds in Christ Jesus. (Phil. 4:4-7, ESV)

Rejoice always, 17 pray without ceasing, 18 give thanks in all circumstances; for this is the will of God in Christ Jesus for you.
(1 Thes. 5:16-18, ESV)
Comment: It is with the great reticence that I (or actually BDAG) begs to differ with your first sentence (see BDAG #9) in places like Heb 10:10, 11:18, 1 Cor 7:14, Rom 1:24, 9:7, Matt 6:7, John 16:30, 2 Cor 5:2, etc.
Comment: @Dottard Thanks for the heads up.
Answer: The Greek preposition ἐν (en) is extremely flexible and often deliberately vague.  BDAG lists 12 basic meanings with a caution that this is probably not exhaustive!
Further, the very fact that some of the verses are listed in more than on category confirms that the writers be not trying to be overly precise.
In Rom 5:3 we have the phrase, "we exalt in tribulations".  Taking the meanings of BDAG, this could mean any of the following:

during tribulations (other examples are Matt 2:1, 3:1, Luke 7:11, John 4:31, etc.)
because of tribulations (other examples are Heb 10:10, 11:18, 1 Cor 7:14, Rom 1:24, Matt 6:7, John 16:30, etc.)
under circumstances of tribulations (other examples are Rom 2:1, 14:22, 2 Cor 11:12, 21, 1 Peter 2:12, etc.)

I do not believe it is necessary to be precise because the Greek is not precise.  Paul is effectively saying all the above meanings in a single preposition.
Comment: +1 so far this seems to be the best we can say.
Comment: Sometimes people don't understand that the original languages don't always answer their question and can even bring up more questions, but those languages do get them to the real issues.


Forecast error differences when using weekly vs monthly data

Question: Why is forecast error (MAPE) much higher when using weekly periodicity vs monthly?  I am using exactly the same data for both.
Answer: Monthly data are more aggregated. The aggregation will compensate for random fluctuations. Therefore monthly data will be much smoother. (Look at plots of your data and compare how "wiggly" monthly vs. weekly data are.) Therefore monthly data are much easier to forecast than weekly (or worse, daily) data.
Comment: This is related to the concept of "ecological correlation" - see, for example, the Wikipedia page http://en.m.wikipedia.org/wiki/Ecological_correlation


Calculation of Market portfolio from efficient frontier

Question: I have a specific Portfolio frontier. Can someone provides me with details about how can I calculate the market portfolio from the efficient frontier? I know that I have to draw the tangent line from the risk free asset, but how? is there any specific formula to calculate the risk free asset? Any help will be appreciated.
Comment: As I said, go to data bases. You need $R_f$, which in your case is the LIBOR rate. Publicly known... Either way, real-life trading based on mean-variance principles is not a very successful thing.
Comment: To draw the tangent line, you need to know what the risk-free rate $R_f$ is. The tangent line goes through point $(0,R_f)$.
Comment: @stans thank you for your answer. And how can I know the value for $R_f$ ?
Comment: Somebody should give it to you. The professor if this is an assignment. Bloomberg / Quandl if this is a personal project.
Comment: No It is a research project. I don't have $R_f$, but I think I have to calculate the sharp ratio curve and then find the market portfolio.
Answer: As @stans already said in the comments to your question, the existence of the market portfolio hinges on the existence of a risk free rate $r_f$, where risk free, in this context, means that its value can be perfectly contracted for the relevant return horizon, e.g. you will with probability one get that rate for 1 month or 1 year. In theory, we must also be able to lend out and/or borrow at that same risk free rate.
For sake of argument, let us assume that you have queried the LIBOR rates or any other interbank rates panel for the relevant risk free rates.*

What does the tangency condition imply?
Draw a line from the $0,r_f$ point in your diagram such that it is tangent to your efficient frontier. Without knowning the market point ab initio, let us just call that point $M$, and let us denote its expected return and its volatility as $\mu_m$ and $\sigma_M$.
Given this (yet unknown) point, the formula for the capital market line $L$ is:
$$
\mu_L=r_f+\frac{\mu_M-r_f}{\sigma_M}\sigma
$$
i.e. if $\sigma = \sigma_M$, the line is at the market point and has an expected return of $\mu_L=\mu_M$. Furthermore, given any investment weight vector $\mathbb{w}$, the assets' expected return vector $\mathbb{\mu}$ and the assets' covariance matrix $\mathbb{\Sigma}$, our portfolio's expected return is:
$$
\mu_p(\mathbb{w})=r_f + \left(\mathbb{\mu}-\mathbb{1}r_f\right)^T\mathbb{w} \qquad
$$
NB: With a risk free rate in the mix, we could add it to our portfolio (and in the efficient frontier its weight is simply fixed at zero,though).
... and our portfolio's volatility is:
$$
\sigma_p(\mathbb{w})=\left(\mathbb{w}^T\mathbb{\Sigma}\mathbb{w}\right)^{\frac{1}{2}}
$$
At the tangency point (market point) the slope of the capital market line $L$ and the slope of the efficient frontier (at portfolio $p$) are equal, i.e.
$$
\left.\frac{\partial \mu_L}{\partial \sigma}\right|_M=\left.\frac{\partial \mu_p}{\partial \sigma_p}\right|_{M}
$$
Let's write this out (suppressing the $M$):
$$
\frac{\mu_M-r_f}{\sigma_M}=\frac{\partial \mu_p}{\partial \mathbb{w}}\bigg/\frac{\partial \sigma_p}{\partial \mathbb{w}} \Leftrightarrow \frac{\mu_M-r_f}{\sigma_M}\frac{\partial \sigma_p}{\partial \mathbb{w}}=\frac{\partial \mu_p}{\partial \mathbb{w}}
$$
From matrix calculus, we know that $\frac{\partial}{\partial x}a^Tx=a$ and $\frac{\partial}{\partial x}x^TBx=Bx+B^Tx$, and in our case, due to symmetry of $\mathbb{\Sigma}$, $\frac{\partial}{\partial w}w^T\Sigma w =2\Sigma w$. We can thus rearrange the tangency condition and find:
$$
\frac{\mu_M-r_f}{\sigma_M}\frac{1}{\sigma(w)}\mathbb{\Sigma}w=\mathbb{\mu}-\mathbb{1}r_f
$$
At $M$, the portfolio volatility and the market volatility coincide, i.e. $\sigma(w)\equiv \sigma_M$. We can hence solve for $w$ as:
$$
w=\frac{\sigma_M^2}{\mu_M-r_f}\mathbb{\Sigma}^{-1}\left(\mathbb{\mu}-\mathbb{1}r_f\right)
$$
And as we are looking for a portfolio whose asset weights sum to 100%, we introduce the condition $\mathbb{1}^Tw=1$, yielding finally:
$$
\begin{align}
w_M&=\frac{w}{\mathbb{1}^Tw}\\
&=\frac{\mathbb{\Sigma}^{-1}\left(\mathbb{\mu}-\mathbb{1}r_f\right)}{\mathbb{1}^T\mathbb{\Sigma}^{-1}\left(\mathbb{\mu}-\mathbb{1}r_f\right)}
\end{align}
$$
This is the formula for the market portfolio, derived using the tangency condition. Note that you can also arrive at this result using a Lagrangian ansatz.
HTH?

* NB: In practice, you will also see treasury bill rates as risk free rates as these are the most-risk-free rates available.

Addendum for a problem with positivity constraints
If your problem is bounded by non-negativity constraints, $w_i\geq 0$, one approach could be to formulate a quadratic program with a target return $m^*$:
$$
\min \frac{1}{2} w^T\Sigma w \qquad s.t. \quad w_i \geq 0,\quad w^T(\mu-r_f)=m^*
$$
You then vary $m^*$ until $\sum w_i=1$. This results in your tangency portfolio under non-negativity constraints.
Ultimatively, you could use your preferred non-linear optimizer and simply instruct it to maximize the Sharpe ratio s.t. non-negativity and full investment constraints....
Comment: Hi Christina, it will be a bit more cumbersome as you will have to resort to quadratic programming methods. This is not really too complex, but the ansatz is a different one based on a quadratic problem with linear (in-)equality conditions.
Comment: Thank you. And if we also have the constraint that w is positive, does this calculation remain the same?
Comment: Which of the market portfolio's inputs ($r_f, \mu, \Sigma$) contributes most to its poor out-of-sample performance?
Comment: Taking a wild guess, $\mu$ is the least stable-y estimated; but then again isn't the whole normality assumption thing a little bit wild, no?
Comment: someone said the mean-variance efficient portfolio solutions based on the sample covariance matrix do not require the assumption of normality because Markowitz never assumed it either


Anti-symmetry of polynomial time reductions

Question: I read somewhere that, if $A\leq_p B$ and $B\leq_p A$, then it is said that $A\equiv_p B$. What exactly does this mean? Is it saying that both $A$ and $B$ are the exact same level of complexity?
Comment: this is more a "symmetry" than an "anti symmetry"
Answer: $A\equiv_p B$ is by definition $A\le_p B$ and $B\le_p A$.
It means that they are in the "exact same level of complexity", but only with respect to polynomial time reductions! For example, if $A\in LOGSPACE$ and $B\in NLOGSPACE$, then trivially $A\equiv_p B$. But clearly $A$ and $B$ are not in the "same level of complexity".
This is part of a general observation about reductions: A reduction that is computable by a machine that works in $t(n)$ time (resp. $s(n)$ space) is only useful if you use it in classes that are provable at least as strong as $TIME[t(n)]$ (resp. $SPACE[s(n)]$), and are conjectured to be stronger.
So, polynomial time reduction are used in $NP$ and $PSPACE$, $LOGSPACE$ reductions are used in $NLOGSPACE$, etc.
Comment: It is a possibility, but it is unnecessary. Indeed, if you show that $B\le_p A$, then $A$ is NP-hard. All that remains is to show that $A\in NP$. To do this, you can proceed in several ways: You can give a nondeterministic polynomial time algorithm for $A$, or you can show that $A$ has a polynomial time verifier (probably the easiest way), or you could show that $A\le_p C$ for some problem $C\in NP$ (not necessarily $B$).
Comment: In the context of an assignment question I recently had, then... If I am given an arbitrary language $A$, and am asked to show that it is NP-Complete... do I need to pick a known NP-Complete problem $B$ and show that $A\leq_pB\wedge B\leq_pA$? If I understand correctly, $B\leq_pA$ only proves that $A$ is NP-Hard... but to bring it down into NP, I'd have to do the other way around, right?
Comment: I like that explanation... Thanks a lot. Hopefully it will help come my midterm exam on Friday.
Comment: Something else: Could you elaborate a bit more on that? I'd like to write this down properly for a collection of notes I'm taking on the subject. Or where could I find more details about this? How is $\equiv_p$ read? I'm guessing "is polynomial-time equivalent to"?
Comment: "is polynomial time equivalent" sounds about right. This is not a common notation, since all NP-complete problems are polynomial time equivalent. Thus, we just prove NP-completeness, rather than stating this equivalence. I don't know of any problems that are $\equiv_p$ without knowing that they are complete w.r.t some class (e.g. NP, PSPACE, etc).


Java Netbeans JAR building and running

Question: I have several packages in my Netbeans project.
One of these packages has a main method, which is set as the main method for the project.
I use clean and build and the Jar is created successfully, however when I try and run the .jar file The application does not run correctly.
The Main.class that I am running has buttons that create instances of other classes which are in other packages within the project, however when I run it from the command line clicking the buttons usually prints null or an exception out the the console. How would I set up Netbeans so that the .jar runs successfully?
Comment: Null pointer exceptions on some methods
Comment: There is a null pointer exception in one of the classes but this does not occur when I run the application within netbeans?
Answer: "How would I set up Netbeans so that the .jar runs successfully?"
You don't. Once the jar and s built, it is, or should be, independent. NetBeans is not what's wrong with it.
You didn't specify where your NPEs are happening, but it's likely your application uses a certain file-structure, and that you're attempting to run the jar while not having or maintaining the files in the same positions or with the same names as when working with them within NB.

Java Netbeans JAR building and running


What is the point of revealing the end of time to Daniel only to conceal it?

Question: The book of Daniel chapter 12 seems to provide Daniel with information related to the end of time only to then instruct Daniel to keep the information secret (12:4). Daniel then asks when the end of time will be and is given more cryptic information. To this day no one has been able to accurately ascertain the meaning of the information imparted. My question is what then is the point of providing this information at all? If God does not want people to know when the end of time will be then why reveal it and then hide it within the text instead of simply omitting it or telling Daniel not to write down his experience.
Answer: Our vision of torah is limited to our own temporary mortal limitations. This same torah is being studied in heaven, and also we will receive new and deeper understanding of Torah after our redemption.
Torah must be all encompassing.
Just imagine our DNA would have been a fraction of it's size just because we didn't understand it?!
Everything in Torah MUST be there. Our final redemption will come about ONLY because it has been recorded in the Torah. Hashem simply doesn't want us to know the exact time just yet, but since the Torah is the blue print of all of creation through all of time, everything must be at least cryptically recorded in it.
Comment: it is actually a full answer to the question.
Comment: I highly recommend explaining your answer better. I see how it's an answer, but I didn't realize how until I read it a few times.
Comment: i added a paragraph. i hope its clearer now.
Comment: This is an interesting answer.
Answer: I would suggest that the information is provided so that when the "end time" arrives we will be able to see that it had been predicted. (The "end time" is not the end of humanity, it is the end of the exile and hardship, the galus; this is what is described in the prophecy preceding the verse in question.) I think this is what the verse means by עַד־עֵ֣ת קֵ֑ץ, until, but not including, the end time. The Malbim explains the verse that "at the end time the doubt will be removed."
Comment: What's the value in that?
Answer: So that it should be more  tangible. When you know someone was promised  to someone else  even if you don't share that information the fact that it happened  makes it more of a reality.
Comment: then why not share the idea without specific dates?


How to Switch the Colors in my Logo in Illustrator

Question: Total newbie needing help so that the background is maroon and logo in white...thanks in advance]1
Answer: It depends how the logo has been built, but this should work...

Use the direct selection arrow to select any of the maroon elements
Go to Select > same file colour from the menu bar
Change all of the selected items to a different colour (doesn't matter what colour, it's temporary, but I'm going to say Yellow)
Use the direct selection arrow again to select any of the white elements
Select same fill colour again
Change all of the selected (white) elements to maroon
Repeat steps 1-3 to select the bits that were maroon, but are now yellow (or whatever) and change them to white

You might have to do some cleanup and/or add a maroon circle behind the logo to back up the white elements, but this should get you close to your goal.
Answer: Try this one: Select all the white color and change it gray(for example). Select the whole object and go to: Edit>>edit color>>recolor artwork. Grab the small rectangle and move it to the other small rectangle, this will swap the colors. Click the gray color and change it back to white and hit OK. Bye.


How can you travel between terminals at DFW (Dallas Fort Worth International Airport)?

Question: How do you change terminals at DFW?
Answer: There are 2.5 ways, but in almost all cases you need the free Skylink train between terminals. If you're in a rush, the Skylink train is almost certainly fastest.
There is an interactive map which provides step-by-step directions between any two supported points. https://map.dfwairport.com/
Skylink train
Do not exit the secured area. Just find the nearest Skylink station and follow signs for your terminal (A-E) and gate (approx. 1-60). There are two stations per terminal (A-E) and two entrances to each station (one at each end of the linear station). They are accessed via escalator, elevator, or stairs.
The trains run in 2 directions in a complete circuit. The penalty for going the "wrong" direction would be 10-30 minute longer (guesstimate) train ride than the correct direction. https://www.youtube.com/watch?v=b19PF-zTZpk
Despite DFW statements otherwise*, the maximum estimated trip time is at least 12 minutes. "Trains arrive every 2 minutes". It would not shock me to find an estimated route of 15 minutes, with a real world worst case wait+travel time of 20+ minutes, if you arrive just after your train left and have to wait for the next one. (This ignores any unplanned downtime / breakdown.)
* "Average ride time of five minutes, Maximum ride time of nine minutes between farthest points" https://www.dfwairport.com/explore/plan/connect/

Walking/carts/etc. (secured area)
You can technically walk between most of the terminals without exiting the secured area (citation needed). However this is a long walk probably on the order of 3+ miles unless the terminals are adjacent and connected by a pedestrian bridge.
I think terminal E is for international flights and thus requires its own security checkpoint, but I can't confirm this. You can enter planned routes on the DFW map site and see if it makes a popup warning you that you will go through security.
DFW says when skylink is down for maintenance: https://www.dfwairport.com/skylinkfaqs/

DFW Airport has other options to navigate between terminals (see map to the right)

Customers can walk between Terminals C & A, Terminals A & B, and Terminals B & D
For customers in Terminal E, there will be a shuttle available to transport them to Terminal D from Gate E33
Customers can also take the Terminal Link shuttles which are outside security and available every 20-25 minutes curbside
For additional questions, call 972-973-3112

Annotated map:

Blue lines = alleged walkway
Red X = no pedestrian connection within the secured area

This annotated map (red Xs added to signify no bridge) is extremely suspect. I think the bridges I put Xs over are for outside the secured area. Thus they are near useless for layovers. More info: https://www.lafp.com/projects/dfw-airport-terminal-cd-pedestrian-skybridge/
https://www.dfwairport.com/explore/plan/connect/walkride/

Walking/carts/etc. (leave the secured area)
There may be additional bridges outside the secured area but then you would have to go through TSA security again.
Answer: I have some additional information to supplement Atomic Tripod's answer.
Source: I'm in the Dallas airport right now, so I checked things out myself.
Below is a photo of a map I found at the airport (sorry for the reflections). Based on what I saw while exploring, the map seems to be accurate.

Terminals A, B, C, D are connected by four walkways forming a square. From gate A39, one can take a skybridge to gate B4, then a floor-level hallway to D40, then the other skybridge to C2, and finally another floor-level hallway back to A39. (Obviously, it's possible to go the opposite direction as well.) All of these have moving walkways except B4 to D40.
These connections between A, B, C, and D are all inside the secure area.
There don't seem to be any other pedestrian connections between terminals. In particular, I went to gate A4 and the connection to gate B49 did not seem to exist!
Using the Skylink train, it is possible to travel freely between terminal E and the other terminals; there's no need to go through a separate security checkpoint.


How is your pan depth set?

Question: Does everybody use a -3dB pan depth?
Answer: I believe thats pretty much the standard according to the stereo pan law. I hear it translates into mono better as well.
I think some DAWs let you change the setting to others, but the only other setting I have seen/heard of is the -4.5 for SSL consoles.
Answer: Meant to respond to this sooner. -3dB is the default because of it's relation to power level and phantom imaging. If you want a full strength image centered between two sources, the crossing point of two "equal power" curves needs to be at -3dB. If it's lower, it will sound weaker as it moves through the center point of the image; higher, and it will sound stronger. -3dB just helps you maintain that even stereo field.
As such, I don't mess with it in my DAW's settings. ;)

How is your pan depth set?


Who is monetarily responsible?

Question: Owner entered into contract with client to have guard on premises for certain days.
Owner told manager to get Contractor guard to perform services.
Manager said they did that and that contractor performed the guard services.
Manager paid Contractor and demands reimbursement from owner.
Client says guard not there and refuses to pay invoice.
Cameras on premises back up client's claim.
Manager cannot produce any verification that guard worked and guard did not sign time sheet.
Manager tells Owner "pay me or I will sue you".
Who is responsible?
Who takes the monetary loss?
Can owner claim loss on income taxes?
Comment: Why does the manager need to get reimbursed? Do they pay company expenses out of their own packet? Why don't they sue the guard, instead of each other on who to eat the loss?
Comment: Owner, Client, Guard, Contractor, Manager are some of these the same people? Please simplify your question.
Comment: NO. The Owner is the Owner (A).  The Client is the Client (B) who wants a guard.  The Contractor Guard is the Guard, (C) and they are a Contractor not any Employee.  The Manager  (D) is the Manager of the Contractor Guard. The Owner supervises the Manager.  The Manager supervises the Contractor Guard.
Comment: Hi, and welcome to workplace.SE! Unfortunately, your question is unclear and will likely be closed shortly. Please edit to add the details requested in comments. Also, try to give some context - what type of company is involved, relationship between owner and manager, etc.
Comment: Owner pays Mgr Annual Salary to handle all Employee & Contractor Guards for Owner.  Both Owner & Mgr have their own separate Guard Companies.  Mgr also works for Owner.  Mgr often pays Contractor Guards who worked for Owner, & is then reimbursed by Owner, as convenience.  Guard is Contractor Guard w/little $.  Suing him would be futile.  Owner says it was Mgr's fault because he paid Contractor Guard before the Client got the Invoice.  Mgr says it's Owners problem because he was paying Contractor Guard as a courtesy to Owner, & he wants to be reimbursed.
Answer: Who is responsible is a legal question.
Typically, these questions are answered on a balance of probabilities.
If one party can provide evidence that supports their claim, and the other party cannot, then a judge is more likely to agree with the first party.
Note that in most situations, the party without any evidence supporting their claim will instead decide to pay rather than face an expensive legal battle.

In this particular instance, distilling it all down, you have:
BusinessA <-> BusinessB <-> BusinessC
If BusinessC didn't fulfil their obligations, then BusinessB has breached its contract with BusinessA, as BusinessC has breached its contract with BusinessB.
Ultimately in such a situation, BusinessC would be responsible. Because they have already been paid, BusinessB would want to press them to repay.
Typically BusinessA would have no interest in the business relationships between BusinessB and BusinessC. From their perspective, BusinessB has not performed according to contract.
Comment: I'm not sure that there are three businesses involved, though I'm also not sure why an employee would have paid for a contractor out of their pocket and then threatened their employer with a lawsuit over it...
Comment: Thank you all for helping with your answers.  Sorry that it's so convoluted. But you have been helpful.

Who is monetarily responsible?


Is it okay grammatically?

Question:
Tall animals, for example, a elephant weighs 100kg at least.

Or, should I only use the plural of the word elephant?
Answer: I would use the following:

Tall animals, such as the elephant, weigh at least 100 kg.

When we speak of an animal as a type in a formal or scientific context, it's common to say "the elephant", "the zebra", etc.
Here's an example.
If you want more understanding of article use, try this link.
The information which follows is not absolutely important to understand thoroughly, but I'm including it in case you want to know more.
I prefer using the "such as" form, rather than "for example", because "such as" is smoother inside a sentence.  You can use "for example", but it's usually either at the beginning of a phrase or it feels more like a break in the sentence.
Here are a couple examples of how "for example" might be used naturally:

Tall animals (for example, the elephant) weigh at least 100 kg.
Tall animals -- for example, the elephant -- weigh at least 100 kg.

The following is probably acceptable to most, but it feels unnatural to me.  (I'm a reasonably literate American native speaker.)

Tall animals, for example, the elephant, weight at least 100 kg.

(Yes, I realize that in this day and age there is a bit of irony in the phrase "reasonably literate American", but you get the idea.)
The reason it feels unnatural is that there's too much of a break of the main idea, so it's a parenthesis which feels better with punctuation marks indicating more of a break from the main idea.
Answer: It should read:

"Tall animals, for example, an elephant, weigh 100kg at
  least."

Everything else is fine.  The plural is unnecessary.  You have to make the subject and verb agree.  "Tall animals" is the subject and "weigh" is its verb.

Is it okay grammatically?


Drove with parking break on

Question: I just started driving and I was driving in the rain today so I was already anxious. I went about 30 minutes going 50-60. The total distance was 20 miles. After I fixed the parking break the breaks seemed to be working fine but could there be a lot of damage? For reference I have a 2011 chevy aveo ls.
Comment: That is a possible problem with only partially applying the emergency brakes. Either put it on maximum/ forcefully ,or don't put it on.
Answer: You say you fixed the parking brakes, so they should be fine. The rain helped cool the brakes, although that's a long ride with brakes engaged. It still might of cooled them enough to prevent damage. If the brakes work fine and there is no vibration or pulsing in the brake pedal while braking, you should be fine. But it would be wise to have the brakes inspected, if you have any concerns.

Drove with parking break on


Globally value not getting changed and also script not getting load

Question: Basically I have to ask two questions through this explanation.
I am using Red Hat Linux 6.0 ... using davinchi board. I have to change system clock resolution so I am changing HZ env var. For this I have written script so that I can change HZ = 1000 and insert that script in /etc/profile.d and write code for loop in /etc/profile (as it was not there) so that while running as usual /etc/profile can load the scripts present in /etc/profile.d. But when I am logging into the system at root level then this error is shown -bash: ./etc/profile.d/resolution.sh(my script name): No such file or directory

Question 1: Why it is showing ./etc and not /etc. Is something related to that??
Question 2: I tried to add script in /etc/init.d but still no change in value of HZ takes place globally but it is getting reflected in home onle means ~/.bash_profile.swo but when I am doing export not getting reflected why so as changes done in /etc/profile should be reflected all over system or did I understand something wrong?

The script (resolution.sh) written has:
#!/bin/bash
export HZ=1000
---------------------------------------------
The content of /etc/profile which I entered is:

if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
        if [ -r $i ]; then
            .$i
        fi
    done
    unset i
fi

And the output of grep command is
-rw-r--r-- 1 root root  535 Feb 4 2004 profile
-rwxr-xr-x 2 root root 4096 Feb 2 2004 profile.d

Answer: The directory /etc/profile.d should have permissions 0755 not 0644 as in your case: now only root user can read the contents and thus the files in that directory, regardless of file permissions. Thus your script is not sourced properly for any other user but root.
Answer: $i equals to /etc/profile.d/resolution.sh, so .$i (./etc/profile.d/resolution.sh) is not found.
Try to remove the dot, or to execute sh $i, instead of .$i.


Can a dummy variable be used to correct ARCH?

Question: Is it possible to use a dummy variable to allow for a structural break, in order to correct Autoregressive Conditional Heteroscedasticity?
Answer: If you have a one-time jump in variance occuring due to a structural break and nothing but the error variance changes at that point, you can use a dummy in the variance equation of the model. If the other parameters may have changed at the same time, you can estimate two different models for the periods before and after the break and see how the models differ.
If you have autoregressive conditional heteroskedasticity (ARCH), thus autocorrelated squared errors, a dummy variable will not help; a model with a dummy simply cannot represent the ARCH kind of behaviour in the conditional variance.
Answer: Yes. A simple "regime-switching" GARCH model could be implemented by specifying the GARCH equation as
$$
\sigma_{t+1}^2 = \alpha + \alpha^* I(t>T^*) + \beta \sigma_t^2 + \gamma \varepsilon_t^2
$$
where $I(t>T^*)$ is one when time is larger than a given threshold. This model will allow the intercept (and thereby the baseline volatility) to be time-varying. A more general model could be obtained by multiplying the dummy onto all elements of the GARCH equation.
$$
\sigma_{t+1}^2 = \alpha  + \beta \sigma_t^2 + \gamma \varepsilon_t^2 + I(t>T^*)(\alpha^*  + \beta^* \sigma_t^2 + \gamma^* \varepsilon_t^2 )
$$
Comment: Looks like we agree. I would not call a single structural break regime switching though, given the context of typical regime switching models. And the second model is essentially (if not exactly) the same as splitting the sample in two and estimating two separate GARCH(1,1) models, right?
Comment: The second model has everything changing, which is why I asked about it, so then there should be no gains in efficiency from join estimation but some gains in clarity from estimating separately. Though if the conditional mean model is kept the same before and after the change, then you are right. But why would anyone expect that if the variance dynamics is changing completely...
Comment: A lot of models in the GARCH literature assume that the mean dynamics is the same, e.g. just constant mean and only look at the vol dynamics.
Comment: @RichardHardy I will agree that a proper regime-switching model should have the switching dynamics as an integral part of the model. A dummy variable approach will be more like a regime-switching, and not only a model allowing for a structural break, if we replace time as a state variable with a macroeconomic variable (say the ADS index). Then we will have a type of macro-regime model. I believe it will be more efficient to estimate the model jointly - at least if only the intercept is changing.
Comment: Just a constant? I would call that "mean statics" then :) But surely, for financial returns this may be good enough.


Turn off built-in display ubuntu 18.04 LTS

Question: I have ubuntu 18.04 LTS installed with gnome 3.28.1. In settings I can't find a switcher which turns built-in display off. I proceeded settings->devices->displays. And there is no buttons as were on 17.10. How can I turn the display off either via bash or GUI?
See a screenshot
Answer: Use the Single display tab instead of Join displays tab.
Answer: In the part where the two screens are numbered, you can adjust which one you want to be the primary display by sliding the screens over each other with your mouse cursor.
Once you choose your primary display -the one you want to use-, click on Single Display and by doing that, screen number one will work, whereas the second one will turn off automatically.
Comment: @Fabby, thank you for your comment, but that was not the case.. I literally described the process that I do at work with my PC: I use a Samsung screen as a second display. And I had the same problem at the beginning then I fixed it, so I described what I did.
Unfortunately, it is weekend here -the second display is at work-, or I would upload a screenshot about that.
Comment: Understood.  An edit and an upvote until the timing becomes more clear.  Removing my original comment.
Comment: Thank you.
I came here to learn more about Ubuntu and to help whenever I can, I would never steal others' answers, my purpose is not gaining reputations, it is gaining more knowledge about Ubuntu.
Another thing : I started typing my answer first (there was no answer when I started writing my answer),  but since my answer is more detailed it took more time to finish it. And when I finished, I found another answer, I thought about deleting mine since they are almost the same, but I let it because it is more detailed.
However if you or anyone else has any problem with that, I will delete it.
Comment: Keep as is because if you delete the Answer, you'll lose the reputation that now goes with the answer...


Is it impossible in Salesforce to authorize a URL endpoint (in remote site settings) that contains an underscore?

Question: I just discovered that we cannot access from Salesforce any URL which contains an underscore (_). When you try to enter a URL with an underscore in remote site settings, you get the error below. I assumed there would be a simple solution to this, but after searching I've found nothing at all. Is there something obvious I missing?
Comment: Yes you cannot! You can map the url to some other as a workaround!
Answer: RFC 2872 allows underscores for subdomains, as written in your example, but not all services support this nomenclature. Unfortunately, at this time, you'll need to choose a hostname and subdomain that does not include underscores. In particular, you also won't be able to reference sandboxes that include an underscore in its name, so you should avoid naming sandboxes this way.
Answer: Thanks, the funny thing I discovered is that this is easy to work around by using a named credential, there is no problem using an underscore there. You would think if Salesforce allows it in named credentials, it would allow it in remote site settings.
Comment: I don't think it does, throws an error later in the flow:
FATAL_ERROR System.CalloutException: Invalid characters in hostname
Don't seem to be able to encode it either.


What difference does training with kettlebells make to the appearance?

Question: I read that kettlebells training does not isolate the muscles, contrary to dumbbell or dead-lifts. What does this mean to the effects in the body? If you look at someone and try to guess how he was training, would you be able to see it?
Comment: This is boggling my mind.
Comment: its guess its hard to say. a difference between a buff "normal trained" and a buff one using whole body excercises like kb would be the range of motion and flexibility. Ask the normal pseudo Bodybuilder to try and bring their forarms in contact with one another with the hands before their face. s.o. only doing bench press and the like often has problems with this.
Answer: Your original statement is not correct. Deadlifts are compound exercises that, when completed, activate a large group of muscles [1].

The grip strength (finger flexors) and the lower back (erector
spinae) work isometrically to keep the bar held in the hands and to
keep the spine from rounding.
The gluteus maximus and hamstrings work to extend the hip joint.
The quadriceps work to extend the knee joint.
The adductor magnus works to stabilize the legs.

It is extremely hard to guess how someone is training by their physique. If you assumed that all people train in a *optimal way then you could say that of people lifting weights, newbies are aiming for compound exercises with no isolation. Intermediates are working on a mix of compound and isolation and advanced are working mostly isolation.
This, in practice does not work as a estimation method. For evidence, go to a gym and ask around.
(* optimal according to source [1])
[1] Mark Rippetoe with Lon Kilgore, Starting Strength, The Aasgaard Company Publishers, 2005, ISBN 0-9768054-0-5


Storable actions and promises

Question: From the salesforce promise documentation:

Don't Use Storable Actions in Promises
The framework stores the
  response for storable actions in client-side cache. This stored
  response can dramatically improve the performance of your app and
  allow offline usage for devices that temporarily don't have a network
  connection. Storable actions are only suitable for read-only actions.
Storable actions might have their callbacks invoked more than once:
  first with cached data, then with updated data from the server. The
  multiple invocations don't align well with promises, which are
  expected to resolve or reject only once.

Should that deter me from using promises with the following use cases:

I have to retrieve the current user information across multiple components before I allow a callback to the server.
I also have to grab the entire role hierarchy to determine the roles above the user in order to determine the public group relationships from the group member table.

Both sets of this info would remain relatively static and would likely benefit from storable actions.  If I do this across 4-5 components on the same app page, I think that would degrade performance, especially in the latter use case.  How much of a hit would be taken from using a storable actions with promises, if any?
Comment: I received 148-152 ms for using a storable action with the component.
I received 600-100 ms varying on the component *without* using a storable action with the component. This leads me to believe that storable actions, even though the documentation says that it may not lend itself to promises, still drastically increases performance time when used.
Comment: with ur use case, you should be safe to use storable actions and promises. wat the doc says is if its a more frequently changing data, then chaining callbacks with promises is risky because your follow up actions will be performed multiple times everytime the framework retrieves & refreshes the cached data.
Answer: I've been thinking about this too as I'd like to build a reusable utility that can make metadata describe info available in Lightning. This falls under the "rarely changing info" category so it might be a place where it's OK to mix storables and promises.
I've also been thinking though about what kind of patterns might be possible if you wanted to account for the second return. First off there is a way to know whether the callback is running a second time:
var action = cmp.get("c.myAction");
var firstTime = true;
action.setCallback(this, function(response) {
    if (firstTime){
        firstTime = false;
        // Do whatever logic is appropriate for first callback execution
    }
    else {
        // Do whatever logic is appropriate for second callback execution
    }
};
$A.enqueueAction(action);

But now what do you do when you want to connect that to a Promise? What we need is a way to signal "Do this when a response comes back, but also do this other thing when a second response comes back, if it does."
So I have no idea if someone can come up with a better architecture but here is my thought:
executeAction: function (cmp, action) {
    var p1,p2,resolve2,reject2;
    var firstTime = true;

    p2 = new Promise(function(resolve, reject){
        resolve2 = resolve;
        reject2 = reject;
    });

    p1 = new Promise(function(resolve1, reject1) {
        action.setCallback(this, function (response){
            // which resolve function to use?
            var resolve = firstTime ? resolve1 : resolve2;
            var reject = firstTime ? reject1 : reject2;
            firstTime = false;

            if (response.getState() === 'SUCCESS') {
                resolve(response.getReturnValue());
            } else if(response.getState() === 'ERROR'){
                reject(response.getError());
            }
        });
        $A.enqueueAction(action);
    });

    return [p1,p2];
}

You'd pass an action into this function and get an array with two promises, [p1,p2]. The first (and possibly only) time a value returns, it will resolve p1. If a second time happens, it will resolve p2. So this way you can specify different behaviours to follow through with if p1 is returned vs p2.
A somewhat messy thing is that we export the resolve and reject functions of p2 so that they can be addressed in the scope of p1's function. But this gives us the ability to choose which promise resolves when the callback executes.
Any better ideas? Comments/suggestions?

Storable actions and promises


In Return of the Living Dead, how did the tiny amount of gas released cause all of the zombies?

Question: The catalyst for Return of the Living Dead is when James Karen's character slaps the side of a drum releasing some gas into the atmosphere. The result of this is that every dead organism in the building is brought to life, including a cadaver which is eventually cremated. This in turn revives everything in the nearby cemetery. It's implied that the gas within the cadaver was released by the cremation and deposited into the soil by rain. My question is, how did the amount of gas released cause all of that? Did I miss a line about Trioxin spreading or am I reading too much into this?
Comment: I've never seen this but judging from what I've come to expect from 80s B horror my bet is you're probably reading too much into it. Those movies usually don't ask too much of the viewer in the way of plot analysis.
Answer: There were two incidents that caused the zombie outbreak.
Firstly a significant amount of gas was released, filling the warehouse and 'infecting' all the specimens there.
If we refer to the screenplay, it seems that it was not intended to appear as a small amount of gas, but quite a large volume.
Scene Setup (for context)

FREDDY.
These things don't leak, do they?
FRANK.
Leak? Hell, no. These things were made by the Army Corps of Engineers.
To prove his point, Frank SLAPS the side of the tank with the palm of
his hand.
With a loud CRACK, a welded seam on the tank SPLITS open, and a cloud
of yellowish VAPOR squirts out, under PRESSURE hitting Frank and
Freddy RIGHT IN THE FACE.
They stagger back, coughing and choking.
FRANK & FREDDY
Argh! Cough-cough-cough-cough!
Both of them fall to the floort clutching their throats. In a moment,
they are unconscious.

Relevant section that follows:

CAMERA CRANES UP over the top of the tank, looking down THROUGH the
little window. Inside, the corpse is beginning to DISSOLVE -- boil
away to a black, nasty liquid, right in front of our eyes, as the
oxygen hits it.
The gas in the tank has lost some of its pressure, and is no longer
squirting out like a hose. Instead, it is FUMING UP out of the crack
in the metal, rising up, and rolling along the ceiling toward the
basement STAIRWELL.
The smoky gas RISES up the basement steps, and passes out into the
warehouse.
INTERIOR - WAREHOUSE - AFTERNOON The GAS rises up out of the open
basement door, and travels across the floor of the warehouse, rising
to SATURATE EVERYTHING.
Some of the gas rolls along the floor and enters the open DOOR of the
COLD LOCKER.
INTERIOR - COLD LOCKER - AFTERNOON The noxious, toxic GAS crawls in
around the edge of the door, and curls up over the plastic-wrapped
CADAVER, hanging like a suit in the laundry.
The cadaver starts to TWITCH.

Secondly, the burning of these specimens releasing the toxins into the atmosphere.
Again, referring to the screenplay helps to describe the situation:

EXTERIOR - CREMATORIUM - NIGHT
BLACK SMOKE pouring from the SMOKESTACKS. CAMERA PANS UP the fat
column of black, oily SMOKE, following the smoke up toward the SKY,
until it reaches
. . . THE CLOUDS .

When the smoke mixes with the clouds, there is a blinding EXPLOSION OF LIGHTNING -- a veritable hydra of electricity
dancing all over the sky. The cloud begins to RAIN.
CAMERA FOLLOWS THE RAIN DOWN
... to the CEMETERY.
EXTERIOR - CEMETERY - NIGHT
CAMERA CRANES DOWN to the GROUND, to watch the RAIN saturate the
GRAVES. Splattering on the gravestones and tombs.
The droplets running over the green grass, and down into the rich
earth.

Conclusion:
So. A lot of bodies that had absorbed the Trioxin were burned during a storm. The smoke from the burning was in turn absorbed by the rainclouds in the atmosphere. Lightning then struck the clouds, fusing the gasses and the rain together thereby 'infecting' the rain. Which then fell to earth across the city, further infecting anyone and anything it touched.


The "computability" of fundamental physical constants

Question: I would like to ask if any of the fundamental physical quantities like the speed of light or plancks constant (all measured according to a common standard of of units) can be classified as computable or non-computable in the sense of of Turing? I don't know if the question makes sense, becuase I have not been training in either theoretical physics or computability theory. But still, the question is relevant in comparing the power of analog vs digital computers, the engineering design of which is the prime concern of EE techies.
Comment: The the speed of light is integer *by definition* (http://en.wikipedia.org/wiki/Speed_of_light).
Comment: [See this](http://physics.nist.gov/cgi-bin/cuu/Info/Constants/index.html)
Comment: 1 kg is the mass of a body of a specified cylindric shape made of a specific platinum/iridium alloy. The Avogadro constant is the number of atoms in 0.012 kg of C$^{12}$. So with a suitably good model of quantum physcs you might compute the Avogadro constant from first principles. But it is a really long way to go (and requires trust in the models being accurate enouhg)
Answer: Some of the physical constants are measured, some are defined, and some are computed.  The measured ones are just that and have some error attached.  The best measured value is a terminating decimal, which is certainly computable.  There are (infinitely many) values within the uncertainty range that are not computable.  The defined ones again are fixed values with a terminating decimal.  For example, the speed of light is defined to be $299 792 458 m/s$  The anomalous magnetic moment of the muon can (in theory) be computed as an infinite sum over all the interaction processes of interest.  It can then be compared with experiment.  We can imagine computing as many decimals as desired.
Comment: I am primarily interested in physical constants that are not computable. The idea is to obtain say, an "analog" computer out of some mechanical contraption that uses a rod for basic copmutation and whos length is turing non-computable. So the first thing is, how to construct such a "non-computably long" rod. One could imagine accelerating to a speed such that relativistic effects would contract a "computable" rod to some "noncomputable" one. Obviously, there has to be some physical constant that is noncomputable that enters into the transformation from one frame to the other.
Comment: On some more reflection, the actual length of any (most) rods would be non-computable right?
Comment: The problem is that the computable and noncomputable numbers are both dense in the reals.  You can't measure any physical quantity and say whether it is computable or not because the uncertainty covers numbers of both sorts.  On the other hand, some argue that space is granular, say at the Planck length.  Then all physical objects have a length that is computable because it is an integer multiple of the Planck length.  I don't think there is anything useful in linking the computable numbers and the physical world.


How to calculate flow duration curve for a set of 12 year data?

Question: Given, discharge data alone for each month in each year, is it possible to calculate the flow duration curve? Some of the discharge values in some months were found to be 0. Do we need to consider those values?
Answer: Spreadsheets work well for this.
You have 12×12 observations so use 144+1 = 145 as the number of observations for calculating your probabilities.
Put your discharge data in a column and sort from highest to lowest. Put a column of Rankings next to it and number from 1 up to your maximum (1 to 144). Put a column next to that and calculate your probability of exceeding each discharge value:
P = Ranking×100/145
(P as a percent)
Graph discharge vs. P.
You need to consider your 0 discharge months in determining the number of periods but you don't need to calculate P for them.  That's handy if you don't want errors in plotting log discharge vs. P.
Comment: I would recommend moving away from spreadsheets where possible, there are handy scripts already built to do this type of stuff, such as the `fdc` function in the `hydroTSM` package in R. That being said, useful to know how to do it manually too.
Comment: R certainly has a lot of power. I actually use an Access database form to extract the data and then it automatically opens Excel and plots the data. Turns out it is much more efficient for plotting the P values than an Access function and the graph can be easily tweaked by users. Whatever gets the job done.
Comment: I also recommend using a script like R, Python, Matlab and not excel. My datasets are most of the time too large (hourly values for example) for spreadsheets like Excel. But it depends, of course, on your dataset and personal preferences.


Node.js server.address().address returns ::

Question: If I remember correctly it used to display "localhost" a few days ago. I am not sure what had changed that made server.address().address return double colons (::) instead.
I read here that it returns an IPv6 address (::) if it is available but it's disabled on my PC.
https://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback
Comment: A hack I implemented successfully: var host = server.address().address; host = (host == '::')? 'localhost':host;
Answer: As the docs say,

Begin accepting connections on the specified port and hostname. If the hostname is omitted, the server will accept connections on any IPv6 address (::) when IPv6 is available, or any IPv4 address (0.0.0.0) otherwise. A port value of zero will assign a random port.

So, the following code would print running at http://:::3456:
var express      = require('express');
var app          = express();
var server = app.listen(3456, function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log('running at http://' + host + ':' + port)
});

But if you add an explicit hostname:
var server = app.listen(3456, "127.0.0.1", function () {

It would print what you want to see: running at http://127.0.0.1:3456
Also, you might want to use some IP lib as pointed in this answer
Comment: IPv6 literals in URLs should be surrounding by square brackets, e.g. `http://[::]:3456`
Comment: Thank you I understand it better now. What I still don't understand is why it is choosing the IPv6 instead of the IPv4 even though I have IPv6 disabled on my machine?
Comment: @Jake I'm not sure about disabling IPv6m but this also happens in old node versions (in particlular, 0.12)
Comment: @Jake It's quite possible you haven't actually disabled IPv6 on your machine. For instance, it's almost impossible to do so on Windows since Windows Vista/2008, and succeeding to do so breaks the system so badly Microsoft won't support it and will tell you only to re-enable IPv6 or reinstall Windows.
Comment: Square brackets work well with `127.0.0.1` too. E.g.: `http://[${address}]:${port}`
Answer: The reason why its choosing IPV6 address is possibly because some other process is using IPV4 port no 3456.
This happens sometimes due to automatic updates where new processes are installed.
Comment: IP, neither IPv4 nor IPv6, has port numbers. Port numbers are transport addresses for _some_ transport protocols (UDP and TCP). Other transport protocols use other or no addressing. IP, of course, has IP addresses.


Is the closure of a Hausdorff space, Hausdorff?

Question: $(X,\mathcal T)$ is a topological space which has a dense Hausdorff subspace. Is $X$ Hausdorff?
Answer: For a generalisation, one can easily show that every Hausdorff space can be embedded as a dense subset of a non-Hausdorff space.  Given a Hausdorff space $X$, define a new space $Y = X \cup \{ \alpha , \omega \}$ so that the open sets are just the open sets of $X$ together with the whole space $Y$.  Then $X$ is clearly a dense subspace of $Y$ (the only neighbourhood of either $\alpha$ or $\omega$ is the entire space $Y$), and $Y$ is not Hausdorff (actually, it is not even T$_0$, since $\alpha$ and $\omega$ have exactly the same open neighbourhoods).
Answer: No.
Consider $\Bbb R$ with the trivial topology $\{0\}$ is a dense subset, it is certainly Hausdorff, but space itself is certainly not.
Comment: It is even a completely uniformizable non-Hausdorff space! :)
Answer: For a slightly less trivial example, consider $X = [0,1] \cup \{1'\}$, where $1'$ is an "extra copy of $1$" so that basic neighbourhoods of $1'$ are $\{1'\} \cup (1-\epsilon,1)$
for any $\epsilon > 0$.  On $[0,1]$, the usual topology is taken.  Then $[0,1]$ is
a dense subspace which is Hausdorff, but $X$ is not Hausdorff because $1$ and $1'$ don't have disjoint neighbourhoods.
Answer: Algebraic geometers will smile and think of the generic point of their favourite irreducible scheme...
[For non algebraic geometers: a scheme is the basic object studied in algebraic geometry.
It has an underlying topological space which is almost never Hausdorff.
 Very often however a scheme $X$  has a so-called generic point $\eta\in X$, such that the singleton set $\{\eta\}$, obviously a Hausdorff subspace, is dense in $X$. The scheme $X$ is then called irreducible.
I am answering the question in order to show that the situation arises in real (mathematical) life, contrary to what some (excellent) other  answers might suggest.]
Comment: The trivial topology arises more often than one thinks! It's one of my favorite sources for counterexamples! :-)
Answer: No, Sierpiński space is the closure of its non-closed point.


Is there a list of all municipal government forms in a machine readable format?

Question: I've found a list of government forms at the US federal level by looking at the OIRA PRA Information Collections XML file. Is there a list of similar forms at the state/local level for the US?
Comment: I suppose you are looking for US specifically?
Comment: Yes. Sorry for the omission.
Comment: At the *municipal* level?  There are 27 municipalities in my county alone ... and we don't even have a machine-readable master list for my town.  (I don't even know that we have that list at all ... we've spent the last 6 years that I've been a Town Commissioner trying to get much of our documentation standardized & in digital form)
Comment: And when I saw the question, I thought you were looking for something like the [NLC categories](http://www.nlc.org/build-skills-and-networks/resources/cities-101/city-structures/forms-of-municipal-government) ... my town is 'Council-Manager' by that scheme, but '[Strong Mayor](http://www.mdmunicipal.org/index.aspx?NID=417)' by MML's classifications, even though our mayor isn't elected separately (it's a decision of the board, non-rotating for the 2 year term).
Answer: Probably not.
There is definitely no such list for Washington, DC (Government of the District of Columbia).
There was forms automation project back in 2006/2007 where some forms where converted to database backend using LiquidOffice tool. You can see list of all currently published forms for DC.gov here http://forms.dc.gov/index.html (click Forms on the left). But beware, there are plenty of forms that are just stan alone PDFs or custom webpages.
Comment: I would certainly believe this would be the case as states/localities tend to like to choose their own reports.
Answer: While surely not as comprehensive as what you're looking for, the Open311 GeoReport API standard does cover a wide range of forms for service request transactions with city governments. Currently, this is primarily focused on location specific things in public space, like a form to request that a broken streetlight gets repaired, but some Open311 APIs are also starting to include location-agnostic forms that are more targeted at the needs of an individual. Since the Open311 API allows for a lot of flexibility in publishing and receiving custom forms it may get even wider use as a standard way to make this available in a machine readable format. You can see a list of city Open311 endpoints at http://wiki.open311.org/GeoReport_v2/Servers and an aggregate list of the forms that are managed by these APIs at https://scraperwiki.com/scrapers/open311_services/


Installing Ubuntu in a external hard drive and NOT placing GRUB of my C: hard drive

Question: what I want to do is this.
I have an external hard disk drive, a SEAGATE expansion 1TB, you can take it a look here:
http://www.seagate.com/external-hard-drives/portable-hard-drives/standard/expansion-portable/
As you can see this is not a flash usb hard drive, it is a USB hard disk drive.
What I want to do is installing Ubuntu in this external hard disk drive... BUT NOT PLACING THE GRUB ON MY C: DRIVE.
In other words, I don't want to see the GRUB splash Window asking me every single time if I want to load Windows or Linux.
I want my PC turn on or restart and go directly to Windows... BUT...
I want to have Linux in my external USB hard disk drive
How do I want to load Ubuntu then?
Easy, when I restart my computer or just start it... in ASUS mother boards I have the possibility to select the boot device by pressing F8, and I get the boot menu.
I want to turn on my computer, press F8, my mother board ask me what drive I want to use to load the Operating Sytem, I select the USB external hard disk drive where do I have Ubuntu, and bingo, I run Ubuntu.
When I finish to use Ubuntu, I close it and turn off my computer. Later, I turn on my computer, and if I don't press F8, automatically load the hard disk drive C: and load Windows.
My question about this, is what are the necessary steps to install the latest version from Ubuntu, doing exactly this. Not placing the GRUB in my C: hard disk drive, and installing it entirely in the external USB hard disk drive (normal one, not flash one).
Answer: Bug Alert!
There is a bug (bug number: 1396379) in the Ubuntu installer that installs the grub bootloader on the first ESP it finds. See https://ubuntuforums.org/showthread.php?t=2182302 for discussions on this.
To workaround this bug you will need to take a few extra steps.
For Ubuntu 23.04 and above
I understand that this bug was fixed in 23.04. I have not tested it. If it works, the Workaround below is not needed anymore.
Workaround

When you boot from the LiveUSB in UEFI mode, use the Try Ubuntu
without Installing option.
Open the Gparted application when the Ubuntu desktop starts.
Select the Windows (first) drive within Gparted at the top right
corner(1):

The NVME drive in this picture does not have Windows. However, it has an EFI System Partition (ESP).

Highlight the ESP in the bottom list of partitions as shown above (2). Right click on the highlighted partition and select Manage Flags from the context menu. You will see:

You should see two flags, boot and esp checked. Uncheck those two flags. Click Close button to exit the Manage Flag window. Click the green "Apply" ✅ button if it is clickable.
You will need to restore those check marks once Ubuntu is installed using the same above process so that Windows can boot from the first drive.
Close Gparted.
This is the end of the workaround.
Original Answer
See How do I install Ubuntu to a USB key? (without using Startup Disk Creator)
Even though it is for USB key, the same principle applies for the USB Hard drive. Pay extra attention to the second answer. The relevant parts are noted below:
During install choose "Something Else"

Partition and format the USB drive
After having chosen Something else the graphical partition manager GParted will guide us through the partitioning process:

At this point take extra care that the boot loader Grub indeed will
be installed to the USB drive (/sda in the picture, but yours will be different) and not to anywhere else

See the bottom of the image above, and make your selection where it says: Device for bootloader installation. The bootloader is another name for the GRUB. It should be installed in the MBR of the external USB hard drive and not in one of its partition.
You will need at least one ext4 partition with a mount point root (/). In the example above an additional /home (also ext4) partition was created. If in the future you need to reinstall Ubuntu, by unticking Format box you can keep the data in /home partition. You will also want a small swap partition of 4GB size (not shown in the picture) with no mount point, in its own Linux/Swap format to be used as virtual memory.
hope this helps
Comment: +1, I understand that you have spent some time on this, and know that it works :-)
Comment: @sudodus Thanks! Disabling the SSD/HDD in the UEFI works too, provided one can find that hardware setting in the specific UEFI. :)
Answer: Simply install grub to the external usb device instead of to your internal hard disk.  Leave the boot order with the internal hard disk before the usb, and you should have the setup you described.
  Other answers have indicated that the "Device for Bootloader Installation" is the place to enter for grub.  HOWEVER, if you have an UEFI machine, the world has changed, and the installer will just ignore any device entered there -- I head you need to enter the (EFI) partition as the location, instead of the device (e.g. /dev/sdc2 instead of /dev/sdc)
Comment: Yes, but can you give me more specifics about this please? **how do I install the grub in the external USB device?** may I do this during the installation process of the Ubuntu ISO file? can you give me some screenshots where may I see the steps clear?
Comment: you need to run some live version of system you want to have, `mount` external device, e.g. `mkdir -p /mnt/sdb3; mount /dev/sdb3 $_`, then `chroot` to this installation (it becomes a little bit problematic if your boot partition is on another partition - is it?) and then run `grub-install` with some root parameter.
Answer: You don't need to have grub on the external device, just have the external device be bootable.
This can be done from within Windows using the Universal USB Installer, available here: http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/. Download the ISO for the distribution of Ubuntu you want to use and place it somewhere on your system. Install the USB installer program and run it, and after following the instructions (and pointing it at the ISO you downloaded when requested), you should have a bootable, portable Ubuntu HDD. (The instructions pertain to a USB stick, but to all intents and purposes for this use, a USB hard drive is the same thing, just bigger)
I would suggest using either 13.04 or 12.04 - according to the webpage it will allow for installation of 13.10, but this hasn't been fully released yet and so is unsupported. 13.04 is the latest supported version, and 12.04 is the current LTS or Long-Term Support version of Ubuntu.
Source: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows
Comment: but he said that he doesnot want to touch bootloader on internal drive
Answer: "You will also want a small swap partition of 4GB size (not shown in the picture) with no mount point, in its own Linux/Swap format to be used as virtual memory."
Never install a swap partition on a Jetflash transend thumb drive, you will use all the write cycles in a few minutes and the drive will be finished!!
Answer: Unplug your internal drive or use a computer without one.
boot your Live DVD or Live USB.
Plug in your target drive and do a normal install.
(You cant screw up your HDD if it is not there).
If you want to make part of your external drive visible to a Windows machine, (for transferring files etc), use "something else" and make the first partition FAT32 or NTFS and install to a partition at /.


Does supporting multitasking in iOS 4 mean dropping support for iOS 3?

Question: I can't find anywhere definitively, if you build an app against the iOS 4 SDK, to thus support multitasking, does that mean the app won't work in iOS 3?  If not, how can you support iOS features like multitasking but still support iOS 3? I'm sorry if there are Apple docs on this, I'm happy to read them, I just can't find them.  Thank you
Answer: No it does not. iOS 3 just ignores the delegate methods that get called.
However, if you try and launch a background task, you'll have to check for the API first, otherwise yeah, you'll not run on 3.
Comment: Feel free to tick the checkmark next to this question if it helped you out.
Answer: You can build against a 4.x Base SDK, and set the Deployment Target to 3.x.
But you have to make sure not use any of the new 4.x APIs without checking for their availability first (or you will start to run, then crash as soon as you call one of those APIs on a device running 3.x).  And you will need to test thoroughly on an actual device running iPhone OS 3.x since there is no simulator support for this kind of OS portability testing.
In some cases, converting a 3.x app to also allow what is called "multitasking" under 4.x is as easy as rebuilding the app using a new 4.x Base SDK, but leaving the deployment target where it was at 3.x, and adding an applicationWillResignActive: delegate to handle both suspend and potential termination.


Nautilus Preference won't save in root

Question: My nautilus file manager won't save any preference setting everytime I run it via root, run sudo nautilus the icons views are big and sort files is set by default.
I want to force save my preference for root nautilus so everytime I din't have to click icons smaller/sort files/etc.
please reply thank you.
Answer: It is an extremely bad idea to run graphical applications with the sudo command.
For these scarce moments where you need to use the graphical file manager with root permissions, do it the supported way. Run
nautilus admin:///

to run nautilus in the system root folder and be able to manage files with root permissions. The first time, you need to provide your password twice in a row.
This immediately solves your problem. Nautilus will act and feel as usual, and adopt/remember your daily user settings. In fact, you are not running nautilus as root, you only give it the possibility to do things for which you need to be root.
Close such instance of nautilus as soon as possible. You can directly open in a location where you need to work by providing the path name, e.g.
nautilus admin:///usr/share/applications

Nautilus Preference won't save in root


geth export file name

Question: I have a private etherum node setup in local machine and I want to try geth export command. For this I need to specify the .rlp file . Can anybody help me to locate the .rlp file.
Answer: You don't need to to specify name of an existing file.  You need to specify name of the file to export blockchain data into.  Geth will create this file and fill it with information.
So you do:
geth export my-file.rlp

to dump blockchain data into file my-file.rlp, and then, probably on another machine, you do:
geth import my-file.rlp

to load blockchain data from file created by geth export command on first machine
Answer: in addition to also @Mikhail Vladimirov, there are official wiki here:
https://github.com/ethereum/go-ethereum/wiki/Backup-&-restore
other options to export until specific block numbers(ex: from zero to 29999 to my-file.rlp file),
You can do :
geth export my-file.rlp 0 29999

geth export file name


What exactly was in the redacted document about Skye from Agents of Shield Season 1?

Question: We know that Coulson won't tell her the truth, but I can't remember what the document actually ends up saying? Did it provide different info than the ex-SHIELD agent Coulson and May picked up for interviewing?
Comment: It was about how ███████████ █████ to █████████ when ██████ ████ ██████████, because ██████ ██████ ██████████ and █████ ██████████.
Comment: Wasn't that the file about Skye getting dropped off as a baby by a SHIELD agent, and the village that was destroyed where they found her, etc?
Comment: Was that the document or the ex-agent? Or both?
Comment: Could someone please tell me how to read @KSmarts's comment?
Answer: The redacted document seen on-screen was an internal SHIELD memo detailing the results of a medical exam performed on baby Skye at the orphanage.
The letterhead on the page leads us to believe it was written from within St. Agnes Orphanage, indicating that at least one SHIELD agent was undercover at the orphanage to keep tabs on Skye.
There were apparently other pages contained in the file (at least one of which apparently identified the gender of the agent who delivered Skye to the orphanage), but the medical results memo is the only document shown on-screen:
Comment: @gannawag I could be wrong, but I think that was the part he told May at the end of the same episode - that the agent who took Skye to the orphanage (and whom Skye believed was possibly her mother at the time) was murdered afterwards.
Comment: So we never learn what exactly Coulson learned from the document but couldn't bring himself to tell Skye?


Converting SLD to MapboxGL style

Question: I'm struggling to convert SLD (from Qgis) to MapboxGL style format.
Does anyone have any ideas if this is possible?
Comment: Use the plugin qgis2web to transform seamlessly your entire project to Mapbox GL (including styles).
Answer: I used qml to convert Corine vector data style to mapbox style. Qml style doesn't work for raster style.
npx geostyler -t mapbox -o corine_AllClass.mapbox - s  qml corine_AllClass.qml
Answer: https://github.com/terrestris/geostyler/blob/master/README.md
GeoStyler will do this and other conversions
Comment: I am using rule based symbology method for Corine data. Geostyler gave a result without color info. qgis2web can't handle this type of symbology and give me just base map. Not only for mapbox, also for leaflet and openlayers option didn't work

https://github.com/tomchadwin/qgis2web/issues/866
Comment: I was also not getting the colors, till I replaced  to
Answer: As mentioned before. Geostyler can do thejob
Here is the repository: https://github.com/geostyler/geostyler-cli
and how to use it
npm install -g geostyler-cli
geostyler -t mapbox -o output.json input.sld
you can optionally use the option -s se for SLD 1.0 or -s sld SLD 1.1

Converting SLD to MapboxGL style


Difficulty using StringCases to obtain desired substring

Question: I have extracted and stored some plaintext strings (derived from a pdfs) from the web that I wish to search for various values following certain text substrings that are different for different records.
An example of a partial record is as follows:
 arc110250 = "Data resource Atlantic Reference Centre
 Institution code Atlantic Reference Centre
 Supplied institution code The Atlantic reference Centre
 Collection code Atlantic Reference Centre Museum of Canadian Atlantic
 Organisms
 Catalog number 110250
 Occurrence ID ARC_110250
 Basis of record Preserved specimen
 Life stage juvenile"

In InputForm it looks like this (Taking the first 750 or so characters):
"12/27/23, 1:28 PM Record: ARC:110250 | Occurrence record | Canadensys
explorer\nhttps://data.canadensys.net/explorer/occurrences/a4a842ba-c08c-4560-9301-027e40cf8dcd 1/5\nOccurrence
record:\nARC:110250\nPreservedSpecimen of Sebastes Cuvier,\n1829 | rockcod recorded on 1978-08-22\nCanadensys\nDate loaded: 2019-12-09\nDate
last processed: 2019-12-09\nDataset\nEvent\nTaxonomy\nGeospatial\nAdditional properties\nData quality tests (1 :f057, 2 :f06a, 28 :f058, 11 :f059, 44
:f05e)\nDataset\nData partner Canadian node of the Ocean Biogeographic Information\nSystem\n+\n-\nLeaflet | Map data © OpenStreetMap, imagery ©
CartoDB\n12/27/23, 1:28 PM Record: ARC:110250 | Occurrence record | Canadensys
explorer\nhttps://data.canadensys.net/explorer/occurrences/a4a842ba-c08c-4560-9301-027e40cf8dcd 2/5\nData resource Atlantic Reference
Centre\nInstitution code Atlantic Reference Centre\nSupplied institution code "The Atlantic reference Centre"\nCollection code Atlantic
Reference Centre Museum of Canadian Atlantic\nOrganisms\nCatalog number 110250\nOccurrence ID ARC_110250\nBasis of record Preserved
specimen\nLife stage juvenile\n"
I want to search for the substrings, such as "Catalog number",  or "Occurrence ID" and retrieve back a substrings containing "Catalog number 110250" and "Occurrence ID ARC_110250" respectively. That is the strings or digits on the same line immediately following the requested "key words".
When I try for example:"
 occurrenceID =  StringCases[arc110250, StartOfLine ~~ "Occurrence
 ID" ~~ __ ~~ Except[EndOfLine]]

I get back the substring I want as the first entry in output, but then I also get all the text that follows on subsequent lines of the text string:
 {"Occurrence ID ARC_110250
 Basis of record Preserved specimen
 Life stage juvenil"}

Same is true if I try to get the strings following "Catalog number":
 catalognumber =  StringCases[arc110250, StartOfLine ~~ "Catalog
 number" ~~ __ ~~ Except[EndOfLine]]

This returns:
 {"Catalog number 110250
 Occurrence ID ARC_110250
 Basis of record Preserved specimen
 Life stage juvenil"}

Using Except[] or not using Except[] seems to make no difference.
I've tried to use RegularExpression[], but my efforts with weak skills with RegEx returns no substrings at all.  For example:
 icoderegex = StringCases[arc110250,
 RegularExpression["^Institution" ~~ "\\s+" ~~ "code" ~~ ".*"]]

How can I get StringCases to return just the substring that includes only the first line of the output and not those of the other lines that follow?  In other words, how can I get the pattern to terminate in the appropriate place?
Answer: Clear["Global`*"];
arc110250 = "Data resource Atlantic Reference Centre
 Institution code Atlantic Reference Centre
 Supplied institution code The Atlantic reference Centre
 Collection code Atlantic Reference Centre Museum of Canadian Atlantic
 Organisms
 Catalog number 110250
 Occurrence ID ARC_110250
 Basis of record Preserved specimen
 Life stage juvenile"

keys = {"Occurrence ID", "Catalog number",
   "Basis of record Preserved specimen"};

fstr = First@
    StringCases[
     arc110250, # ~~ Repeated[WhitespaceCharacter, {1, ∞}] ~~
       Shortest[___] ~~ EndOfLine | EndOfString] &;

If you just want to isolate the substring only, use hstr instead:
hstr = First@
    StringCases[
     arc110250, # ~~ Repeated[WhitespaceCharacter, {1, ∞}] ~~
        h : Shortest[___] ~~ EndOfLine | EndOfString :> h] &;

Usage:
fstr@"Catalog number"

"Catalog number 110250"

fstr /@ keys

{"Occurrence ID ARC_110250", "Catalog number 110250", "Basis of
record Preserved specimen  Life stage juvenile"}
Comment: You make it look easy.  Now I better understand how to make use of Shortest and Repeated.
Comment: @StuartPoss I am glad I was able to help. Thanks for the accept.


Would a boggart-basilisk kill someone?

Question: If a boggart appeared to someone as a basilisk, would direct contact with its eyes kill that person?
Comment: nope, it only _shows_ what people fear doesn't _become_ that thing itself! The same way it showed moon for Prof.Lupin but didnt become the moon itself exerting gravity inside the classroom! But if someone dies of heartattack coz they just saw basilisk's eyes, then boggart is the culprit!
Comment: Now I got a doubt, All the victims either die or get petrified when they see Basilisk's eye, Did the ones who were petrified even had time to register in their mind how exactly the eyes of the basilisk looks like?, coz how else can a boggart turn into basilisk with full and proper eyes if the viewer doesn't even know how the eyes of Basilisk looks exactly?
Comment: Im not sure.. wouldn't the boggart itself become a visual image or take form of the fear as it's disguise? I mean still.. wouldnt the boggart itself having the eyes of the basilisk still kill someone?
Answer: I would say no.
We have two canon instances of a boggart taking the form of a deadly creature.
The first is a banshee, which materialises as Seamus's fear in the first class with the boggart.

Where the mummy had been was a woman with floorlength black hair and a skeletal, green-tinged face – a banshee. She opened her mouth wide and an unearthly sound filled the room, a long, wailing shriek that made the hair on Harry's head stand on end – Riddikulus! – shouted Seamus.
— Prisoner of Azkaban, chapter 7, The Boggart in the Wardrobe

In traditional mythology, the banshee's scream usually precedes an imminent death, or is itself fatal. (I don't believe the canon precisely defines banshees in the Harry Potter universe.) Since none of the class get so much as a nosebleed, I think that the boggart in banshee-form doesn't have the ability to actually kill people.
Later, Lupin brings a boggart for Harry to practice the Patronus charm, and at the start of the lesson he remarks:

It's the nearest we'll get to a real Dementor.
— Prisoner of Azkaban, chapter 12, The Patronus

This sounds like a boggart in Dementor form isn't as dangerous as a fully-fledged Dementor. Indeed, he notes earlier that they can't use a real Dementor:

I'll have to think carefully about how we're going to do this… We can't bring a
  real Dementor into the castle to practice on…"
— Prisoner of Azkaban, chapter 12, The Patronus

If a boggart in Dementor form is as dangerous as a true Dementor, then I think it would be disallowed on the same grounds. So we can safely conclude that a boggart cannot be as dangerous as a full-blown Dementor.
As well as these two examples, I'd argue that if it could transform into truly dangerous creatures, then it would never be allowed to leave the wardrobe, and instead be killed in situ. The risk of something like a manticore, lethifold or Lord Voldemort materialising in a third-year classroom is simply too great, even for Hogwarts.
The stare of a boggart transformed into a Basilisk might do some damage, like petrification or a bad headache, but I don't think it could kill you.
Comment: Additionally, Professor Lupin didn't turn into a werewolf when the boggart appeared as a full moon.
Comment: @Theik That year, the school is under constant Dementor guard. The reason they don't enter the castle is Dumbledore's dislike of them; see, for example, the night Sirius breaks into Gryffindor towter.
Comment: This might be way late, but I don't think "We can't bring a real Dementor to practice on" is meant to imply that they're not allowed to do so, but that they simply can't because they don't have Dementors.
Comment: @alexwlchan The dementors don't answer to them, though. They can't just walk up to one and tell it to be a target dummy, as they have zero control over them. They're working for the ministry and Lupin can't just grab one and haul it to the castle.
Comment: I think that a Boggart Basilisk can kill a person by scaring them to death, but not by actual Basilisk gaze.
Answer: We have to speculate, but I'd lean towards saying yes.
When Lupin was teaching Harry how to combat the effects of the Dementors and perform the Patronus charm, they used a Boggart that would then assume the form of a Dementor. In those situations Harry suffered exactly the same effects that he did when encountering a real Dementor: the cold feeling of despair, hearing his parents murder, and passing out. The cure for those effects was also the same (eating chocolate) and Harry was, eventually, able to conjure a Patronus to drive the Boggart Dementor away.
That suggests that when a Boggart assumes the form of a magical creature it behaves identically to the real thing, including any associated powers (the ability to suck away happiness in the case of a Dementor, or the death stare in the case of a Basilisk) and its weaknesses (e.g. a Patronus).
Comment: Killing I think is doubtful(Didn't the effect of Boggart(Dementor) was less soul stealing compared to the real one), but petrifying maybe possible like when seen through a ghost/reflection. Still I wonder if the viewer even knows in memory how the eyes of Basilisk looks like exactly for Boggart to recreate it.
Comment: According to Wikia: Boggarts sometimes do not have the same strength or magic as what they imitate, for example, a Boggart transformed into a Dementor has weaker magic than a real Dementor, according to Lupin, or having a deadly scream as a true Banshee (Seamus's boggart), which would otherwise have slaughtered the entire class. So I guess it wouldn't be able to *kill* a person. Maybe petrify...
Comment: @TheDragonRiderwhoLived I don't know if you could make the claim that a lesser version of a basilisk (i.e. a boggart version) could not kill a person. It may be that the destructive power of a real basilisk is far more than enough to kill a person, it's just that you can't really do much more damage than kill. If killing someone takes x amount of killing power, and a basilisk possesses 10x whereas a boggart-basilisk possesses 2x, then a boggart could still easily kill you.
Answer: No. I would think if it were capable of replicating the effects of a basilisk to the point of killing someone, it would not be allowed in classroom full of hormonally out of control teenagers with overactive imaginations.
There would be certain too much risk involved with that. Emotional interactions, fear, despair, okay those things might have a short term effect on a student, but no worse than their next interactions at lunchtime!
If they were that powerful, the Ministry of Magic would either be weaponizing them or disposing of them, they would never find their way into a classroom in either case.
Comment: Hogwarts isn't exactly famous for not having any students die... and they could only be weaponized if you could find an enemy that feared basilisks, and in that case it would still only kill that one person.
Comment: Hogwarts employed Hagrid, who created blast-ended skrewts.  I think they're okay with a few dementors, especially since a Basilisk is a very specific thing to be most afraid of, and a teacher is right there in case of problems.
Comment: The Ministry of Magic wouldn't be able to get rid of all the boggarts with how many there are, it would be like trying to get rid of all the rats in the muggle world. Plus, how would you manage to capture the boggarts if they were so powerful they could kill you.
Answer: I would definentaly say NO, it would not be deadly.
I agree with former answers based on facts from wiki. According to Lupin, the boggart form of a dementor is not fatally dangerous as the real dementor would be. As previously said by Rps the moon that formed itself before Lupin did not change the gravity of the classroom and the Banshees shriek was not harmful, which means that while Boggarts may take the form of the viewers greatest fears, they do not in fact become them. Whether this is true physically or not I am not certain, but the look of the boggart basilisk would neither kill nor petrify, or else (as previously stated) the Banshees shriek would have atleast caused a nosebleed. Whether this is true to all boggarts or just the one used for the lecture, I leave up to you.
But then comes the interesting issue of whether the basilisk would be able to kill with its fangs, poison or no poison. Can a boggart physically effect you? Can, for example, the basilisk bite you and leave a fatal wound? Can the spider crawl on you? Would Snape be able to slap you or cast a spell?
If so there is no logic as for how the moon would be able to take form as it physically would effect the athmosphere, if the boggarts magic isn't to weak to make it any bigger than the size shown in the films. Which would explain that theory.
But if not, if the boggart is more of a picture, a shadow or hologram of a kind, as you cannot touch it but it is there, then there would be no reason for Lupin to jump in front of Harry in case Voldemort took form. The argument that he would be concerned for the mental health of the students is invalid, as he is forcing them to face their greatest fears (if it's not for Harrys sake of course, he is rather partial to Harry).
If the boggarts magic was to weak to harm like a real dementor, change the athmosphere in the classroom like a moon appearing out of nowhere would or make Lupin change into a werewolf then and there, I do not see any reason for Lupin to be scared of the boggart taking the form of Voldemort. Logic would say it's magic would be to weak for its Voldemort-form to cast any fatal spells. As the Banshee couldn't harm with its voice, the magic of the boggart would be to weak for its Basilisk-form harm the viewer with its eyes.
Personally I belive that the boggart is more of a shadow picture and would only be able to harm emotionally and mentally. As itself is mostly effected by emotions.
Answer: I don't believe it would - I think they would be petrified instead.
When Harry was practicing the patronus charm he comments that it's

one nasty dementor

To which Lupin tells him that was that it was only a boggart.

The real thing would be much much worse

From this we can assume a boggart's representation of a creature's power is a lower level. So perhaps the Boggart-Snape could cast spells but they wouldn't be nearly as powerful. Lupin didn't transform when he saw the moon (although who's to say he didn't feel a little wolfy?)
Let's think about what happens when a basilisk's gaze doesn't quite work. We have examples of this.

What happens when someone sees the reflection of it's eyes?
What happens when it's seen in a mirror?
What happens when it's seen through a ghost?
What about a camera lense?

They're petrified.
I believe if you looked straight at a boggart which was in a basalisk for you wouldn't die, but you'd be petrified instead.
Comment: Where exactly are the quotes from? A search of *Prisoner of Azkaban* for the phrase "one nasty dementor" turns up zero results.
Comment: @Alex I do recall a nearly-word-by-word translation of that passage in the movie, Lupin's response in particular, but the movies aren't considered 100% canon. That said, the same characteristic of boggarts is implied in the books.

Would a boggart-basilisk kill someone?


How to calculate the real output voltage of a rectifier circuit (center tapped rectifier)

Question: In my class, we are using Proteus 8 to simulate simple rectifier circuits. We are not familiar with analog electronics yet. Since the class is all about using engineering software, there are not many explanations for the theories.
In this particular class, we tried 3 different rectifiers including half-wave, center tap, and bridge rectifier. I applied the same signal and resistor value to all of the circuits, 6V,10Hz, RL = 500ohm, 1:1 ratio for all transformers, and the same setting for both the oscilloscope and signal generator.
I was able to figure the half-wave and the bridge rectifier's output voltages. The half-wave rectifier's output voltage is 5.25V (5.3V) because of the diode's voltage drop 6V-0.7V, while the bridge rectifier got 4.65V(4.6V) because the current goes through 2 diodes in each cycle 6V-0.7V-0.7V.
Half-wave rectifier:

Bridge rectifier:

Now for the real question.  From what I understand, since the voltage is divided across the secondary winding, each cycle has 3V. If current only passes through 1 diode in each cycle, shouldn't the amplitude be around 2.3V?

I know it should be more complicated.  From what I understand, it should include something like Vrms, Vavg which includes integrals, or something like that, but I turned the output channels to DC instead of AC as per my lecturer instructed so that I can only calculate it as in DC analysis, so I'm confused right now. I'm not sure if this all makes sense at this point, hope anyone would help me understand better, thank you for reading this far.
Comment: Your question title says "center tapped rectifier". Shouldn't that be "center tapped transformer"? You can't tap a rectifier.
Comment: So the center tap transformer shouldn't be 1H to 1H?Hmm, if the secondary is twice the primary.. Then shouldn't it be 1H to 2H?.
Comment: No. L is proportional to N^2.
Comment: I note a little problem with the transformers. In the first picture, it is a TRAN-2P2S. In the second, TRAN-2P2S. In the last, it is TRAN-2P3S. Have you changed the transfo ?
Comment: Have you changed the parameters accordingly ? In the first two cases, the primary and secondary value of the selfs (1H, 1H) are the same, ok. For the last case, the number of globals turns at secondary is twice the values as in the first cases. So here, the primary self is 1H, the total secondary self is 4 H.
Answer: Review the tran-2p3s in the library.

The 3 windings are identical. If primary has N turns, each secondary has N turns. Proteus lib for trans-2P3S is done so that the 2 secondaries are taken together into account for defining the numbers of turns of secondary line and inductance in the library. So, if N turns for primary give 1H, secondary has 2*N turns ... this lead to inductance of 2^2= 4 H.