Throw an exception on partial sucess

Question: Is it possible to throw an exception while performing a DML on a list of records, such that, successful records are committed to DB, but exception is thrown for the records which failed?
If I use Database class for DMLs with the allOrNone parameter set to false, successful records are getting commited, but no exceptions are thrown.
Answer: You could do something like this :
<code>for (Database.SaveResult sr :  this.someRecords) {
    if (sr.isSuccess()) {
        // Operation was successful
    }
    else {
        // Operation failed
        for(Database.Error err : sr.getErrors()) {
            throw new CustomExceptionClass(err.getMessage());
        }
    }
}
</code>
Comment: @d_k - throwing the error throws the error for the class no the individual record. Doing this will cause all records in scope to fail
Comment: In this case, won't the successful DMLs be rolled back?
Comment: Depends on which parameters you provide with Database.insert(), so yes. You could also have a boolean set up to check if even one record failed to save and then throw an exception
Answer: The system automatically rolls back a transaction if any exception makes it all the way up to the top of the call stack. You can't currently have any DML modifications survive an uncaught exception. I created this idea as something I believe would be practical: the ability to do something in response to a failed transaction asynchronously when an exception is thrown (e.g. in your case, we could take the survivors, stuff them into an asynchronous transaction, then throw an exception).
Comment: As a workaround to log failures, I am iterating over the list of SaveResults, and for unsuccessful ones, instead of throwing an Exception, I am creating a new CustomException with the error details as the message, and sending that exception to my Exception Logging Utility class which saves the exception details in a Custom Object. I am yet to test this, but it should work.

Throw an exception on partial sucess


can I upload an App developed in GWT framework (Eclipse IDE) to local servers?

Question: For Google App Engine service can't be accessed from China Mainland, so I plan to upload the App into local servers, can I do it?
Answer: If you are unable to use Google App Engine Service, there are lot many alternatives as well.
Like you can try with Jelastic.
http://jelastic.com/docs
try the trial and I guess that might help you .
Answer: To add to Bunta's answer, here are specific instructions on deploying GWT to Jelastic: http://jelastic.com/docs/google-web-toolkit
Jelastic is probably also the best choice for you because it is available in 10+ countries around the world (you can select the local hoster when you sign-up at http://jelastic.com right below the sign-up form) - so if one happens to be not accessible in your country - you can pick another.


"at combat" -- meaning?

Question: Example (news article headline): Japanese play at combat, wary of war
I don't understand what at combat means.
Answer: "Play" is a very old word, coming to us from Old English, and according to the OED, it has a history of about 600 years of having the meaning of both unseriousness (think playing a joke) and the unreality of a role (as in playacting).  The idiom "to play at" takes on those senses and has become a phrasal verb, i.e., the "at" has merged with the "play" so that their meaning together cannot be determined by taking "play," the verb, and adding the preposition of place, "at."  "Play at" in the sense of your example simply means to do something unseriously or in sham way.  Thus you must analyze your headline as "Japanese (play at) combat."
Confusion may arise from the literal use of "play" with "at," so when I say "the White Sox will play at home," you don't have to know anything about baseball to know I'm referring to a team that will play in their home city.  The analysis here is "White Sox play (at home)."
Comment: A fine answer deadrat. Welcome to ELL!  Note that you're describing a [phrasal verb](https://en.wikipedia.org/wiki/Phrasal_verb).
Comment: @CoolHandLouis Thank you for a very kind welcome.  I believe that I did note that it's a phrasal verb.
Comment: Ahh yes you did. It snuck past me. :)
Answer: It's an abbreviated version of the original title, Japan's 'survival game' fans play at combat, wary of war (Linda Sieg, Reuters, Jun 10, 2015).  The shorter form, Japanese play at combat, wary of war is a less-than-ideal headline that can come across as confusing or incomplete even for native English speakers.  The short version might convey that all (or a majority of) Japanese people, or perhaps the Japanese government is "playing at combat". The original is more clear: while the survival games fans (in US we call it paintball) like to play combat (aka like to play at combat), they are wary (cautious) about actually going to war.  [Note: it's not "weary", which means tired!]
Now consider play at combat.  There are some good definitions of this phrasal verb at The Free Dictionary.  play at something:

to pretend to be doing something. You are not fixing the car, you are just playing at repair work! Stop playing at doing the dishes and get the job done. (McGraw-Hill Dictionary of American Idioms and Phrasal Verbs. © 2002)

To pretend to be or to do something for amusement or out of curiosity: He was just playing at being a cowboy.
To do or take part in something halfheartedly: You're playing at your work and not taking it seriously enough.
(The American Heritage® Dictionary of Phrasal Verbs. Copyright © 2005)

Note that "play at" is sometimes considered child-like or youthful.  While the military may play war games, a child may play at war.  One might say that the military is "playing at war" if it was meant in a derogatory manner or comparing adult activities with children playing.
Here's another way to think about this phrasal verb.  If I say "He likes to play combat" then a listener might wonder if I'm talking about a general sense or if "Combat" is the name of a video game.  But if I say "He likes to play at combat" then it's a more general tone, and I'm probably not indicating some specific game.  This is not absolute.  You can also find "play at chess" meaning the same as "play chess".
Answer: They're playing at combat, which means that they are acting as if they are in a combat situation to practice for a possible war. They're not actually at combat with anyone, it's just a game where they're acting as if they are.
The term at combat means in conflict with someone, fighting someone, or perhaps even at war in a broader sense.

“at combat” -- meaning?


What is the difference between simple linear model and loess model?

Question: Can somebody explain to me the difference between linear model and loess model in statistics? I need to explain this to non-math people.
Answer: A VERY non-technical answer
A simple linear model fits a straight line through a set of points. The line is the best possible straight line (at least, for one sensible definition of best)
A loess model fits a complicated curve through a set of points. In some ways, it can be thought of as a complicated moving average. It is the best possible curve (at least, for one sensible definition of best)
Comment: +1 Out of curiosity, just what is the "one sensible definition of best"?
Comment: I don't think Loess optimizes any criterion of "best," except when the range is 0, in which case the result is trivial: the Loess fit passes through all the points!
Comment: It is the sum of squared errors, at least for simple regression.

For loess, it's a weighted sum of squared errors.
Comment: Note that a linear model can be used to fit curves by including polynomial or spline terms.  The model is linear in the coefficients, not necessarily limited to a straight line relationship.
Answer: The loess.demo function in the TeachingDemos package for R will interactively demonstrate the ideas behind a loess fit.  It will plot a set of data and the loess fit, then when you click on a point it will show the window used to fit at that point, the relative weights of the points within the window, and the "linear model" fit to that weighted data.  Clicking on additional points will then update the display to show the general concept of the loess fit.
This may help explain what loess does and may help in an explanation of the difference.
Comment: how do you run loess.demo in R?
Comment: @mike, first install R (if you have not already), run R and install the TeachingDemos package (exactly how depends on your system), load the package with `library(TeachingDemos)` then type `?loess.demo` to bring up the help page to see how to run it, you can scroll to the bottom where the example are and copy and paste that code to R's command line to see the examples, then run with your own data to further explore.
Answer: Here is a simple but detailed response.
A linear model fits a relationship through all of the data points. This model can be first order (another meaning of "linear") or polynomial to account for curvature, or with splines to account for different regions having a different governing model.
A LOESS fit is a locally moving weighted regression based on the original data points. What's that mean?
A LOESS fit inputs the original X and Y values, plus a set of output X values for which to compute new Y values (usually the same X values are used for both, but often fewer X values are used for fitted X-Y pairs because of the increased computation required).
For each output X value, a portion of the input data is used to compute a fit. The portion of the data, generally 25% to 100% but typically 33% or 50%, is local, meaning it is that portion of the original data closest to each particular output X value. It is a moving fit, because each output X value requires a different subset of the original data, with different weights (see next paragraph).
This subset of input data points is used to perform a weighted regression, with points closest to the output X value given greater weight. This regression is usually first order; second order or higher is possible, but require greater computation power. The Y value of this weighted regression calculated at the output X is used as the model's Y value for this X value.
The regression is recomputed at each output X value to produce a full set of output Y values.


How to disable username and password request when accessing the shared folders on Windows Server 2008 R2 for Windows home edition user?

Question: I have a PC with Windows Home edition and a machine running Windows Server 2008 R2 in a domain. Anytime I connect to its shared folders I get prompted for a username and password. How can I set a policy in Active Directory for that server not to ask for username and password?
Answer: The versions of Windows that aren't earmarked "Professional" cannot join a Windows Active Directory domain, but you can cheat and do what's sometimes referred to as the "poor man's domain trust". Basically, you create an account in the Active Directory domain that matches the username / password used on the non-Domain-joined PC. Once you've done this, access to domain resources from the non-Domain-joined PC will work as though the PC is domain-joined, because the PC is authenticating with a username / password that ends up being valid in the domain.
This is preferable to enabling the Guest account because it doesn't open up access to unauthenticated users.
Answer: To do what you want you will have to enable the "Guest" account on the computer hosting the files and then grant the "Everyone" group whatever access you want.
"Guest" is a user account, but its enabled / disabled status is interpreted by the operating system as a boolean "Allow unauthenticated users to connect?"


Altars for certain gods missing from Ecumenical Temple?

Question: I just reached Ecumenical Temple on dungeon level 4 and Okawaru's altar is missing. What gives?
Comment: This was explained 5 years later in [a Rock Paper Shotgun article](https://www.rockpapershotgun.com/2017/03/23/making-dungeon-crawl-stone-soup-with-253-cooks-and-no-head-chef/). Basically, a lot of Temple layouts - with fixed number of altar spots - had been made by the time number of gods exceeded the initial number. Since the person who did created most of these layouts didn't want to go and redesign them all, the idea of overflow altars appearing before the Temple was born.
Answer: The Ecumenical Temple never contains altars for every god.

Altars can be found in the Ecumenical Temple (which randomly contains 6-14 altars), as well as scattered around the Dungeon.

So if you visit the Temple and you don't see the altar you need, keep looking in the dungeon. By the time you reach level 9, you should have found the altar you want, with rare exceptions. Of course, reaching level 9 is no guarantee ...

Since version 0.6.0, altars for every god (except Lugonu, Jiyva, and Beogh) are guaranteed to appear either in the Temple or in the main Dungeon between level 2 and level 9. You can find additional altars in various other locations. Since 0.8, you can also find altars in the main Dungeon at level 1.
Lugonu's altar may be found in the Abyss. Jiyva's altar may found at the entrance to or inside the Slime Pits, and, very rarely, early in the main dungeon. Finally, altars to Beogh can appear in the Orcish Mines, or more rarely in the main dungeon, most commonly near the Mines entrance.


Covariance between individual IID variables and their sample mean

Question: If we know that $X_1, X_2, ..., X_n \sim \text{IID N}(\mu, \sigma^2)$, what is $\mathbb{Cov}(X_1, \bar{X}_n)$?  Because the set of variables follows an IID distribution, would the covariance just be zero?
Answer: The covariance here will not be zero because the sample mean includes the variable $X_1$ as part of it; a higher values of the latter variable is going to give you a higher sample mean and a lower value is going to give you a lower sample mean.  Consequently, we would expect these two things to be positively correlated.
Now, using the fact that the covariance operator is linear in each of its arguments, you get:
$$\begin{align}
\mathbb{C}(X_1, \bar{X}_n)
&= \mathbb{C} \Bigg( X_1, \frac{1}{n} \sum_{i=1}^n X_i \Bigg) \\[6pt]
&= \frac{1}{n} \sum_{i=1}^n \mathbb{C} ( X_1, X_i ) \\[6pt]
&= \frac{1}{n} \mathbb{C}(X_1, X_1) \\[6pt]
&= \frac{1}{n} \mathbb{V}(X_1) \\[6pt]
&= \frac{\sigma^2}{n}. \\[6pt]
\end{align}$$
This confirms that the covariance is positive so long as $\sigma>0$.  As $n \rightarrow \infty$ the sample mean depends less and less on the value $X_1$, and the covariance diminishes to zero.  (Note also that this result does not depend on the assumption of normality of the underlying variables; it holds for any underlying distribution with finite variance.)
Comment: (+1). I think I'm having an intellectual blackout: How do you get from the second line of the equation to the third? I'm suspecting because of the IID assumption?
Comment: @COOLSerdash: Since the data values are IID they are uncorrelated, so you have $\mathbb{C}(X_1, X_i) = 0$ for all $i \neq 1$.  Consequently, the only non-zero term in the sum is $\mathbb{C}(X_1, X_1)$.
Comment: Thanks Ben, I suspected it was something easy ...


Primer scraping off

Question: We primed our kitchen cabinets after washing them with regular cleaning supplies. We did not sand. The primer will peel off if we scrape it with our fingernails.  What should be our next step?
Answer: Could be the surface was too glossy before priming or poor primer for this surface. I would scrape off a few square inches of the new primer, sand the surface with 220 grit sandpaper, and re-prime. After it dries I would check the adhesion. If it adheres well, then you know what you'll have to do. If not, then I'd suspect the type of primer. Personally, after many years painting things at my house, I've come to select two primary primers for work like you're doing here: either Zinsser oil based primer or Zinsser shellac primer. I'm sure there are probably other equally good primers, but they are the ones that I found good reviews for and have used myself. For cabinets though, I would go with the oil. You might want to buy a quart of it to try. You definitely were smart to check the adhesion at this stage. You probably saved yourself a lot of time in the future.
Comment: +1 It also could be a buildup of grease (common in kitchens) that the cleaner did not fully remove. After following the scraping and sanding advice on a section, test with masking tape pressed well onto the surface and then pulled off. If paint comes away, you need a more serious stripping with a solvent like denatured alcohol or a commercial stripper before priming.

Primer scraping off


About the proof of the proposition "there exists irrational numbers a, b such that a^b is rational"

Question: What does the classical proof of the proposition "there exists irrational numbers a, b such that $a^b$ is rational" want to reveal? I know it has something to do with the difference between classical and constructive mathematics but am not quite clear about it. Materials I found online does not give quite clear explanations either. Could someone give a better explanation?
Comment: It is sad that this is a research-level question.
Comment: @AndrejBauer: remember that MathOverflow had a slightly wider remit in 2011; I suspect that if this were asked today, it would get migrated to math.stackexchange.
Answer: Presumably, the proof you have in mind is to use $a=b=\sqrt2$ if $\sqrt2^{\sqrt2}$ is rational, and otherwise use $a=\sqrt2^{\sqrt2}$ and $b=\sqrt 2$.  The non-constructivity here is that, unless you know some deeper number theory than just irrationality of $\sqrt 2$, you won't know which of the two cases in the proof actually occurs, so you won't be able to give $a$ explicitly, say by writing a decimal approximation.
Comment: I think the reason the $\sqrt{2}$ case is interesting is that the proof that $\sqrt{2}$ is irrational is very easy, and taught to young undergraduates. But the Gelfond–Schneider theorem is much more advanced. So for a student who is not very advanced, this gives a nice example of an existence proof where the student isn't in possession of a proof that any particular number is a witness. That's a nice pedagogical tool to develop students' intuition that the proof of an existence statement does not have to construct the thing that is shown to exist. Examples like $e^{\ln(2)} = 2$ don't do that.
Comment: @Carl, Pete: I think that the strategy-stealing proof that the first player has a winning strategy at Chomp (http://en.wikipedia.org/wiki/Chomp) is also a good example to convince students of this fact.
Comment: @David : The second one is the rational one. http://en.wikipedia.org/wiki/Gelfond–Schneider_theorem
Comment: Carl's remark is right on the money.  I have used exactly this example in a sophomore-level introduction to proofs course for exactly this purpose.  (Unfortunately the most common reaction was utter confusion...)
Comment: I just feel like saying $(\sqrt{2})^{\log_2 9}$. But more seriously, it is unpedagocial to speak about what we know and do not know when explaining the form of a given proof. The proof in question is *not* constructive because it employs the inference rule of excluded middle -- and the proof remains non-constructive no matter what else you prove or know. However, the proof can be *transformed* to a *different* proof which is constructive (assuming there is a constructive proof of irrationality of $\sqrt{2}^{\sqrt{2}}$).
Comment: But we do know which of the two cases is irrational - I suppose the question is how constructive is the proof of that fact?
Comment: @Maxime: in fact, I have assigned this problem (or rather a slight generalization -- Schuh's Divisor Game) as homework, but in a higher level course.
Answer: The proposition can also be proved without explicitly knowing any particular irrational number:
Fix a positive rational number $c$. Then for any positive irrational real number number $a$,
the equation $a^b = c$ has a solution, and the solutions for different $a$ are different.
Now assume that there would be no irrational numbers $a$ and $b$ such that $a^b$ is rational.
Then all these solutions would be rational, thus we would have an injective mapping from the
positive irrational real numbers to the rationals; however we know that the rationals are
countable and the positive irrational reals are not, so there is no such injection, and we
have a contradiction.
Comment: This proof can be made constructive easily enough. It is a constructive theorem (basically an exercise in Bishop and Bridges) that for any countable sequence, there is a positive real $x$ which differs from all its members.  Using this, construct $x$ which differs from all rational $q$ and from all $c^q$ where $q$ is rational.  Let $y$ be such that $x^y=c$.  Then both $x$ and $y$ are irrational.
Comment: Wait, what is your injective map?
Comment: @jmc: $a\mapsto\log_ac$.
Comment: @EmilJeřábek — Ah, of course! Thanks! I don't know in which way I was thinking, but somehow I wanted to map pairs $(a,b)$ or $(a,c)$ into the rationals, or something like that. But this is nice: simple and elegant, and it brilliantly does the job.
Answer: From a more abstract point of view, suppose you have a set $X$, a subset $\mathcal{I} \subset X$, an element $a \subset \mathcal{I}$ and a map $b : X \to X$ satisfying $b^n(a) \not\in \mathcal{I}$ for some $n$.
Then necessarily there exists $m$ such that $b^m(a) \in \mathcal{I}$ and $b^{m+1}(a) \not\in \mathcal{I}$.
The proof you refer to is not really mysterious; it's only presented to look mysterious, specifically by the choice of $\sqrt{2}$.  There are plenty of choices for irrational $a$ and $b$, such that $a^{b^n}$ is rational for some $n$, and exactly the same conclusion can be drawn.
Answer: The classical proof You have mentioned shows how powerful logic may be. The crucial point of the proof is the use of the law of excluded middle (A or not(A)). In that case we are lucky to have knowledge of which of the two possibilities:
i) $\sqrt{2}^{\sqrt{2}}$ is rational or
ii) $\sqrt{2}^{\sqrt{2}}$ is not rational
takes place to be. But You can imagine a statement A about natural numbers such that neither A nor not(A) is provable (in, say, ZFC). Now we may use analogously the particular statement of the law of excluded middle "A or not(A)"  in some proof of some statement B. In that case the statement B is proved both by supposing A and by supposing not(A) and at the same time we know in advance that we shall not resolve which of the cases has the place to be. In such a proof the purely logical priciple of excluded middle becomes even more important (or at least as important) than the axioms of actual mathematical structure (in this case that of natural numbers). It is this power that made some mathematicians (e. g. intuitionists under the head of Brouwer) to think that logical principles such as that of exluded middle have caused the paradoxes discovered in the beginning of the XX century.
For a classical mathematician the proof of B would be a legitimate proof since he/she believes that either A or not(A) is valid for natural numbers even if we shall never prove neither of them. (This position is often called platonism because it presupposes the "independent existence" of natural numbers.) Intuitionist, however, says that it is a hypothesis and to turn this reasoning into a valid proof one should prove that indeed one of those possiblities has the place to be.


What is Alluka's (Nanika's) gender?

Question: In the anime Hunter x Hunter, Alluka Zoldyck is considered as a girl by Killua, shown when they leave their estate and were accompanied by four butlers. Killua shouted to Gotoh and said that he needs a female butler to join them because Alluka is a girl.
However, I am confused because Milluki address Alluka as a brother, in the episode when he wished to Nanika to kill the tourist photographer. He clearly told the the tourist that he was just taking his brothers for a walk. In addition, the Hunter Wiki acknowledged Alluka as a male.
What is Alluka's actual gender?
Comment: Glad I stumbled upon this question because I was bound to ask about this myself. For additional reference, Killua exclusively refers to both Alluka and Nanika as 'she' (I mistakenly thought there was an instance in which Killua refers to Nanika in particular as 'he'.) Also, Alluka appears to identify Nanika as female, referring to her as 'she' (Crunchyroll, ep 146 around 18:50); thus, assuming Alluka and Nanika identify as the same gender, Alluka also self-identifies as female.
Answer: Actually, the Hunter x Hunter wiki addresses this, and is quite accurate in its assessment, though the references cite the wrong volumes (but correct chapters).

There is considerable confusion about Alluka's gender. Two of Alluka's brothers, Illumi and Milluki, refer to Alluka as their brother. But Killua, the closest brother of Alluka, specifically states that Alluka is a "girl" and refers to Alluka as his sister multiple times. This inconsistency can be explained by Killua's intimate and understanding bond with Alluka, hence he would know and care that Alluka is mentally female, versus Illumi's cold and dehumanizing attitude towards Alluka. While Alluka is most likely biologically male, Killua's interactions show that Alluka's psyche may be female.

Everyone (except Killua) addresses Alluka by her biological gender, which appears to be male. While she is quite small, she shows no female development.
However, she is very sensitive, gentle, and reserved, and has a very feminine side. Being that Killua is the only one who dares to actually interact with Alluka as a person, he would be the best one to understand that she probably is more feminine inside.
This does seem a bit odd to me; even if someone I knew were closer to "she" in his head, unless they specifically asked, I'd probably still say "he". But perhaps either Alluka did ask this of Killua, or Killua just took it upon himself because he knew Alluka so well.
Unfortunately, since it's never explicitly stated, this is somewhat assumption, but realistically it's the only explanation that makes sense since Killua is the only one to refer to Alluka as female.
Comment: Wow, i need to count but I'm starting to think that Hunter x Hunter has more genetically male characters who look female than female ones who look female.
Comment: You're correct at some point @kaine, not to mention how Illumi looks like. haha
Comment: Has it ever been stated in canon that Alluka is in fact anatomically male, or is it merely Killua's words against the rest of his family's words? Just because the others assume Alluka is biologically male doesn't mean that is true. If it has not been stated as fact in canon (i.e., more concretely than their assessment, which is in competition with Killua's assessment), then Alluka being biologically female (known by Killua, but unknown to everyone else who keep their distance from her) rather than it being about mental gender identity would be another possibility.
Comment: @seijitsu No, it is not explicitly stated. However I disagree for two reasons. One is that everyone except Killua seems to agree on the male thing (there's never any argument or discrepancy). And the other is that I'm pretty sure their mother would have known when she gave birth what the gender was.
Comment: I was pretty sure that it was commented in one of the episodes that even though Alluka is considered a sibling of the others, that they don't know where Alluka/Nanika came from, so I took that to mean that Alluka was not necessarily birthed by their mother but perhaps suddenly, mysteriously showed up in the family.
Comment: @seijitsu I'm pretty sure they only said that she "isn't human, but something else," referring to the fact that her nen conceals Nanika. If you could find a source though, that'd be cool.
Comment: This is insane ... it's obvious that the Zoldyck family just refer to their kids as sons...either because they don't want daughters, or its just a family thing.  Killua, having left the family and his assassins way, just refers to them normally.
Answer: Alluka is male. He just dresses like a girl.
From Alluka article on Hunter x Hunter Wiki (emphasis mine):

There is conflicting information regarding Alluka's gender.
The official data book lists Alluka's gender as male, and two of Alluka's brothers, Illumi and Milluki, refer to Alluka as their brother.
However, Killua, the person closest to Alluka, specifically states that Alluka is a girl and refers to Alluka as his sister multiple times. While Alluka may have been designated male at birth, Killua's interactions show that Alluka may identify as female.
This inconsistency may be due to Killua's intimate and understanding bond with Alluka, hence he would know and care that Alluka identifies as female, versus Illumi and Milluki's cold and dehumanizing attitude toward Alluka.

In the episode showing Alluka in his childhood, we can see that he used to dress like a boy. He ended up looking like a girl, because he played with doll too much that his parent decided to dress him up like a girl.
Answer: I've always played with two theories:

It could be the case that the family refer to Alluka as male to distance themselves from her, denying the fact that she's female to dehumanize her, or to further disassociate her from the family in some way.
Or it could very well be that, as Alluka's exact origin is unknown, she isn't strictly human and doesn't possess what we would call a conventional gender, but rather, her gender is simply non-existent, like a Nen beast.

Personally, I favor the latter, or a mix of the two. These are all just speculation, of course, but it's interesting to think about nonetheless.
Answer: He is physically a male, and mentally female. It is the reason why Killua referred to him as "she". This is stated in the databooks and also by the canon writers. So in other words, Alluka is transgendered. Though, I believe people have the right to think of him as whatever they like, male or female.
Answer: Here is my assumption: When Alluka was born, her mother didn't take care of her, she let the butlers to take care of her (like bathing her, etc), and because their mother always thought that all her children must be male, so she thinks that Alluka is male too, especially because she is cold to her and never bathe her, so she doesn't know that Alluka is actually female, and the butlers are too afraid to tell their mother that Alluka is female. While Killua is the one who really cares for her, and knows her the most.
So even thought in the birth-biodata and everywhere, Alluka is stated as a male, but Killua knows the truth, and so the butlers who ever took Alluka to bath also have known that.
It's just my hypothesis after watching the anime. I think if this hypothesis is true, this story will be a very nice scene, because then it will be stated that "Even the writer of the story doesn't know about Alluka's gender, but her brother knows it because of how he always set an eye on her."

What is Alluka's (Nanika's) gender?


How does Siri come up with contact suggestions?

Question: Are they recent from days, months?  How long ago?  Are they calls, text, FaceTime?
Answer: Relevant people
As Apple specified on its website page dedicated to iOS 9, with your Siri suggestions you can

See the contacts you talk with most, those you talked to last, or even
  those you're next scheduled to meet

I'd definitely suggest you to have a look to all that Siri suggestions include from here, in fact it doesn't just suggest you Contacts, but also

Places
Apps
News

Hope this helped you!


Do I need to apply a mirror modifier before exporting to Unity?

Question: I exported my character without applying mirror modifier and it seems it works well in both situation. Will it make any differences?
Comment: Exporting in formats like .dae, .fbx, .obj has `Apply Modifiers` option, and in some cases it's checked by default. In this case the modifier has been applied automatically (even without your action). If it hadn't I think you would have noticed that.
Comment: ok, you can add your comment as answer. thanks.
Answer: In exporting options, you may see that in many cases there is Apply modifiers option, and often it is ticked by default:

Example is for .ply, the same behaviour is in case of exporting to .fbx, .obj, .x3d. Note: default options of Blender itself also may be changed.
In this case your exported objects/s will be actually mirrored without your action.
With that option unticked you will notice difference because if not applied, modifiers change how the object is displayed and rendered, but not actual geometry.
Comment: can you please check the link on your answer?
Comment: @cegaton thanks for notifying, don't know how could that happen, for some reason I didn't check it after including in the answer.


Why is SQL considered to be a session layer "protocol"?

Question: Within the OSI-Model, why is SQL considered to be a session layer "protocol"? Isn't SQL a language and not a protocol at all?
Comment: Are you sure not to confuse SQL with SSL?
Comment: https://learningnetwork.cisco.com/thread/4344
Comment: This is a networking theory question, not a security question.
Answer: SQL includes many things (I'm skipping a few):

the SQL syntax itself (there is a standard, just more or less applied by various databases). I believe this is what you are referring to.
the wire protocol format (there are a few of those). This is mostly about how to represent data.
the interaction between clients and servers. This is closely integrated with the first two.

The third one concerns session establishment, use, and close. This fits fairly well within OSI level 5.
In SQL, you can create and reuse a session. The actual statements (specific keywords and sql syntax) are using that session. So you could say that the SQL language itself is closer to layer 6, although that's debatable as well.
You could also view transactions as "sessions", but not in the networking sense.
This may sound like a vague answer, but that's because SQL covers so much that it doesn't fit neatly into one box.
Answer: Because SQL servers setup and manage sessions between clients and the server and has the concept of transactions. These are the two main functionalities that session layer services perform -- session management and synchronization points (in SQL that would be transactions):
https://en.wikipedia.org/wiki/Session_layer


Redmine install not working and displaying directory contents - Ubuntu 10.04

Question: I've gone through the steps to set up and install the redmine project tracking web app on my VPS with Apache2 but I'm running into a situation where instead of displaying the redmine app, I just see the directory contents:

Does anyone know what could be the problem? I'm not sure what other files might be of use to diagnose what's going on. Thanks!
<code>#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
# with ServerRoot set to "" will be interpreted by the
# server as "//var/log/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 188.8.131.52 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/apache2/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

# Enable fastcgi for .fcgi files
# (If you're using a distro package for mod_fcgi, something like
# this is probably already present)
#<IfModule mod_fcgid.c>
#   AddHandler fastcgi-script .fcgi
#   FastCgiIpcDir /var/lib/apache2/fastcgi
#</IfModule>
LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.7
PassengerRuby /usr/bin/ruby1.8

ServerName demo
</code>
and my vhosts file
<code>#No DNS server, default ip address v-host

#domain: none
#public: /home/casey/public_html/app/

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
#   ScriptAlias /redmine    /home/casey/public_html/app/redmine/dispatch.fcgi
    DirectoryIndex index.html
    DocumentRoot /home/casey/public_html/app/public

    <Directory "/home/casey/trac/htdocs">
        Order allow,deny
        Allow from all
    </Directory>

    <Directory /var/www/redmine>
        RailsBaseURI /redmine
        PassengerResolveSymlinksInDocumentRoot on
    </Directory>

#   <Directory />
#       Options FollowSymLinks
#       AllowOverride None
#   </Directory>
#   <Directory /var/www/>
#       Options Indexes FollowSymLinks MultiViews
#       AllowOverride None
#       Order allow,deny
#       allow from all
#   </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /home/casey/public_html/app/log/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel debug

    CustomLog /home/casey/public_html/app/log/access.log combined

#    Alias /doc/ "/usr/share/doc/"
#    <Directory "/usr/share/doc/">
#        Options Indexes MultiViews FollowSymLinks
#        AllowOverride None
#        Order deny,allow
#        Deny from all
#        Allow from 127.0.0.0/255.0.0.0 ::1/128
#    </Directory>

</VirtualHost>
</code>
Comment: do you have ruby on rails installed and working properly ?
Comment: whats your virtualhost container and apache configuration look like? Also you di start the server with `passenger start` from the redmine install directory correct?
Comment: Edit: I included my vhosts and my apache configuration files, as far as I know I have.
Comment: @haknick, I believe I installed Ruby on Rails properly during while following the instructions. Is there a command I can run to verify this?
Comment: `ls -l /var/www/redmine`? Did you enable the passenger module `sudo a2enmod passenger`?
Answer: I use following redmine.conf file in apache2 which runs perfectly.
<code> # Loading Passenger
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13
PassengerRuby /usr/bin/ruby

<VirtualHost *:80>
   ServerName redmine.mycompany.com
   DocumentRoot /var/www/redmine/public
   <Directory /var/www/redmine/public>
      # This relaxes Apache security settings.
      AllowOverride all
      # MultiViews must be turned off.
      Options -MultiViews
      allow from all
   </Directory>

   ErrorLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-error.%Y-%m-%d.log 86400"
   CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-access.%Y-%m-%d.log 86400" "%h %l %u %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""

</VirtualHost>
</code>
Answer: Do you have an .htaccess file? If so, please post its contents. If not, try updating the directory block in the vhost config:
<code><Directory /var/www/redmine>
    #RailsBaseURI /redmine
    #PassengerResolveSymlinksInDocumentRoot on
    Options Indexes ExecCGI FollowSymLinks
    AddHandler fastcgi-script fcgi
    RewriteEngine On
    RewriteBase /redmine
    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</Directory>
</code>
Answer: Where is you Redmine installation? I'm unable to undestand if it is in /home/casey/public_html/app/redmine/ or /var/www/redmine.
Anyway, your DocumentRoot should point to /path/to/your/redmine/public


How Can the Quantization Noise of an ADC be Measured using the Digital Output?

Question: The ADC quantization noise is the error signal generated by rounding the sampled analog values of  signal. Suppose that we have the digital output of an ADC, how can we measure the quantization noise, only using the digital data, and without converting the digital signal to analog and comparing it against the original analog signal?
Comment: Look up "ADC histogram test" in your favorite search engine. It's a way to determine ADC digitization error without detailed comparison between input and output. So much has been written on this technique that I'll decline to summarize any more.
Answer: An ADC requires an analogue input signal to convert. Something must be known about the input signal, in order to evaluate the ADC. Depending on the type of application, there are several signals that could be used.
The most popular signal is a pure sinewave, covering most of the ADC range. Quantisation noise will tend to produce a flat broadband noise floor, for an input signal that is uncorrelated with the sample rate. Measuring the power in the signal, and in various definitions of 'not in the signal' allows one to separately estimate the quantisation noise (broadband noise), the distortion (power in the harmonics), and for pipeline ADCs, how well the different stages overlap one another (by tracking the behaviour of spurious signals as the input amplitude changes). If all the non-signal power is lumped together, and this power equated to a model of a perfect ADC with quantisation noise, then we end up with the ENOB figure, or Effective Number of Bits. As you're evaluating noise and distortion separately, it doesn't necessarily need to be a low distortion signal for assessing quantisation noise, but it does need to be low noise.
A signal I use when evaluating an ADC that needs to read a DC signal, that I've not seen described in the literature, is that from a slowly discharging capacitor. Obviously the quality of the input signal is paramount when using it as a benchmark to test an ADC, and that from a single large capacitor is going to be low noise, low impedance, floating so free from power supply noise, and very predictable. I make the rate of discharge low enough so that there are at least a handful of counts at each output level. This allows me to check for noise, differential linearity, monotonicity, missing codes, as well as the basic quantisation noise, though it's not useful for drift or overall linearity. With care and very large capacitors, you can characterise right down into the noise.
A third signal source that can be used is that from a 'calibrator', which is basically a precision DAC in a box, with a certficate of traceability from a test laboratory. Needless to say they are expensive, and you're limited to inferring accuracy only up to their certification.
Answer:
Suppose that we have the digital output of an ADC, how can we measure
  the quantization noise, only using the digital data

You could resample your digital signal to a significantly higher digital rate and make digital numerical comparisons with the assumed digital image of the input. So, if your input is a pure sinewave at 10 kHz and the ADC converts this at a sample rate of (say) 30 kHz, you could resample digitally at (say) 300 kHz and compare it with the digital representation of the sinewave input also having a sample rate of 300 kHz.
It does rely on being able to generate a very accurate sinewave or input signal because, differences in amplitude will also show up as errors but, this can be accommodated by modifying the amplitude of the digital representation of the input until the compared quantization noise reduces to a minimum.
You will also want to time shift the digital representation of the input until the error is minimized. See this picture below that shows the general idea of moving one of the digital representations until the q-noise is reduced to a minimum: -

Without that subtle time shift, there is an extra error term that you might not want in your q-noise RMS calculation. The picture above has the "true signal" time-aligned with the digital output of the ADC ("the quantized signal") so that the computed RMS is minimized. If you don't time align you will get an error term in the q-noise that contains artifacts of the original input signal: -

Notice how the q-noise in the upper half of the picture above rises and falls with a sinusoidal nature related to the input sinewave. The lower half shows how this is avoided by time shifting (a more useful way of calculating true q-noise).
2nd picture taken from here.
Answer: You can make a "calibrator", able to set the DC Vin within 1ppm, using a 10 turn pot. From the center wiper, hang a 1-turn pot of value 100X smaller.
As you vary the 1_turn pot, if the ADC is good, you can measure the size of the steps between output codes.
Last ADC I did this with was SPT7920: 12 bits, +_2.5volts input, about 50 microvolts transition width, about 800 microVolts steps between codes. ohhh That ran at 10MSamp/sec.


Server Virtualization on Ubuntu Server or Something Else

Question: Disclaimer
I have little experience with Linux, VMware, or server stuff.
Also, I had posted this question originally at https://serverfault.com/questions/490037/server-virtualization-on-ubuntu-server-or-something-else
It was voted down and closed. I was told I should have posted here.
My goal is run Ubuntu Server VMs (or possibly another, smaller linux distribution) with exception of possibly 1 windows server instance.

What I've done so far
Copied the gz from a usb thumb to a folder I made called /vm_tgz
Changed directory to /vm_tgz/vmware-server-distrib/
Executed sudo -s -H
Executed ./vmware-install.pl
I get prompted for a C compiler.
I exited the install and ran apt-get install gcc.
Executed ./vwmare-install.pl again
This time I make it past the prompt for the compiler.
I know get asked for the linux headers.
I break out of the installer...
After reading around on the interwebs, I try creating a symlink at /lib/modules/3.5.0-25-generic/build/include/linux with the following commands:
ln -s /lib/modules/3.5.0-25-generic/build/include/generated/autoconf.h /lib/modules/3.5.0-25-generic/build/include/linux/utsrelease.h
ln -s /lib/modules/3.5.0-25-generic/build/include/generated/autoconf.h /lib/modules/3.5.0-25-generic/build/include/linux/utsrelease.h
I run ./vmware-install.pl
I get past the prompt for the headers, but it fails when when trying to build the vmmon module.
Also, I see a previous error stating conflicting types for poll_initwait.
I saw a post about installing VMware Server 2 on Ubuntu 11, but I don't really understand the instructions. I checked for an install.sh and a patch file, but didn't see one.
I found another post detailing the steps again, but I still don't understand.
Can someone point me in the right direction?
Install.sh
Patch

EDIT: A change of direction

After taking the initial feedback to heart, it seems I'm trying to fit a square peg through a round hole.
I am not aimed at desktop virtualization, but rather server virtualization (I may have an instance of Windows Server in the mix), so I still want to go as "bare-metal" as possible.
I read Alternatives to Esx.
This article recommends VirtualBox for desktop use, and Xen in an HVM mode or KVM for server virtualization.
I also saw a post where someone used TinyCore with VirtualBox, and though I am willing to give it a go, I'm a bit leery of the "fringe" linux distros. I've had much success with Ubuntu working with little effort.
At this point, I am looking for a "straight-forward" solution. If I need to scrub my Ubuntu install for KVM, and KVM will "just work", perfect! If I need to pick a better stack, ok, but what?
Can someone steer me in this new direction? All opinions and suggestions will be taken to heart.

I see this post is bad enough to merit a -1...
Well, I just learned this type of product is called a Hypervisor. It's hard to know how to ask a question well without the proper vocabulary.
I also understand the question may be a bit subjective. I really am trying to make this as objective as possible. This is why I included my disclaimer. I hope for some responses. I am going to continue to press to get a good solution for my home, and once I have it, I am going to post my results. Hopefully, the next person struggling to get started with Hypervisors will find this post and know how to approach solving this problem.
Answer: Well assuming you want to virtualize Windows Servers, I would go with HyperV from Microsoft. To give you some background, a hypervisor is basically and extremely lightweight OS that enables you to run VMs on top of it. That way, you don't have the weight of a full OS under your VMs when all you really need is a basic OS to run your multiple VMs on. HVs give you other perks too but this is just a primer, that info is documented better elsewhere.
If you aren't really going to run Windows OSes, then I would use a Linux based hypervisor, as HyperV will run Linux OSes, but to get good networking support you would need to run RHEL or CentOS, just FYI. I don't have experience with Linux based Hypervisors like the one you mentioned, but hopefully this will clear up some of your confusion.
Comment: I will mostly be running Ubuntu Server vms (or possibly another, smaller linux distro).


Performance differences running PHP under Windows/IIS 7 vs. Linux/Apache?

Question: There is a PHP application right now on a Linux box running under Apache with MySQL. Since we are a windows shop, management wants to get rid of the Linux box and move everything over to windows. Is there a performance difference between the two platforms? Or, is there any significant difference at all, in terms of performance or management?
Answer: Microsoft had a team help out optimising PHP for Windows, which work is part of PHP 5.3. Some figures I've seen places the performance close to PHP + Apache on a unix system. Before 5.3 (Which means currently, since 5.3 isn't out yet), performance is bad on Windows. I think there are some patches and tricks you can pull to improve it, but it's going to cost you a bit of performance. That may or may not be a problem; People have a tendency to overestimate performance.
Note that there are other reasons to use unix than just performance. Code may not be portable and even though the core php runs fairly ok, you can well get into trouble with php-extensions and third party libraries. No matter how you look at  it, Windows is a second-rate system for running php on.
Answer: If your application isn't huge or get hit a couple thousand times per second, there's no difference between the two.
LAMP == WAMP in php small projects. Just install something like XAMPP if you want your environment to be as close as possible to your existing one but in Windows.
Good luck with your project!
Answer: You should consider the MS WebPI (download at www.microsoft.com/web ) which would install the entire stack for you to run PHP in IIS7 environment.
the performance is comparable for most apps.
Answer: I've just done this for the same reason.  Mgt wanted to get rid of the Linux box. I was able to completely move my php application and MySQL database. It took longer for me to configure PHP for IIS than it did for me to move the existing content over.
I have found though that the IIS server is a fair bit slower when it comes to loading pages and images. Where in Linux it appeared instantaneous, in IIS it takes a half second for the page to load and another second for images.


Is there a good way to manage and store RAW photo files to the cloud?

Question: I love my Nikon d7000, takes great images. I upgraded from a 6MP D50 and one thing I was not prepared for was the huge amount of disk space that collections of 16MP files were going take up. I use Aperture 3 and now Lightroom 5 for my photography workflow. Both are great but the real bottleneck is deciding how and where to archive the RAW files. I've tried backing up LR catalogs to cloud accounts but there were literally 45k files that had to be transferred and whole process was incredible show because of the amount and size of the files. The best thing I'v come up with is to just use an external drive but in this cloud age there has to be a better way, no?
Comment: @AJHenderson - I'm not convinced. This is a relevant issue to photographers and we do want to be a complete source of information. Essentially, storage and archiving problems are very real for photographers. Now, having said that, this could be a duplicate. There are similar questions on the site.
Comment: I agree that this question is essentially a duplicate of the one linked. Is it best to just delete this post?
Comment: JoanneC: that's fair, I guess my main thought is that this basically boils down to "uploading is slow, is there a better way to upload."  It really has nothing to do with photography and really isn't a good question in the first place since the answer should be the obvious. Internet upload speeds are generally slow for consumer connections and you just have to wait.  There isn't some magical way to improve it.  Now a question about how to best work an online backup in to your workflow would be very good or asking about features of a cloud storage that would be helpful for sharing.
Comment: @AJHenderson The fact that one answer seems so obvious doesn't mean that there's not a non-obvious approach that might help. For example, there are plenty of cloud-based solutions that back up your files in the background. It may not matter that it takes a week or two to do your initial backup as long as it proceeds unattended and you're not adding data faster than it can be backed up. Or, if your connection isn't the bottleneck a distributed peer to peer system can be a cheaper and speedier solution.
Comment: @Caleb - yeah, but at that point it's moving back in to the realm of being a general computing question that is agnostic to photography concerns.  If asking what kind of chair I should use when editing photos on-topic?  It's an extreme example, but the combined effect is why I felt this wasn't a very good fit.
Comment: @AJHenderson There's an obvious general computing aspect to the question, but it's one that's of great importance to photographers and is therefore IMO very on topic here. Sure, you can treat your image files like any other file and back them up to carbonite.com, but maybe a photo-specific solution like SmugMug makes more sense. The question isn't "how do I back up a lot of files," but rather "how do I back up a lot of image files?" One valid answer is "just treat them like all your other files," but that's not necessarily the only answer.
Comment: @Caleb - I guess I saw the core of the question as, is there a better way to backup 45k large files.  Time seemed to be the primary concern and for that concern, being images doesn't matter.  If it was about how to organize them, or what kinds of files they should upload or what kind of host is ideal for images in general, I'd agree completely.  That said, it appears that the majority of people disagree with me, so I'll drop it.
Answer: In general, cloud storage is only a good idea if you don't mind the idea of losing all your work.  Unless you have a provider with an SLA that guarantees availability, any number of things could take out your provider and leave you high and dry.  For archival purposes, the easiest and cheapest approach is always going to be local storage.  Cloud backups work well for off-site storage as a secondary backup (in case of local destruction) but they should never be trusted as your sole or primary means of backup.
As for the speed of uploading.  Most residential connections have horribly slow upload speeds.  There is no way around this.  Any decent file storage site is going to take files as fast as your home Internet can provide them.  There is no magical secret to making it go faster other than to buy a better Internet connection.  If you want to verify if your home connection is the issue, I'd recommend trying something like Speedtest.net and checking if your upload rate differs significantly from your upstream bandwidth as reported by Speedtest.
Beyond that, there is nothing magical about cloud storage.  You manage it just like you would manage a local external hard drive.  The only difference is that you have no direct control over the cloud storage and it may have an option to be able to share your files out to other people.  Some services are more targeted at images, offering features like the ability to resize, edit or sell the photos online and providing galleries, however that won't help you any with the pain and slowness of uploading a large number of large files.
Comment: I don't follow your logic at all. "Cloud storage is only good if you don't mind losing all of your work"? What? That doesn't make any sense. I also don't agree that the cheapest and easiest way to archive is local. Most cloud options are a download of a program a single time that takes 1-2mins, and you never touch it again. It also can be much more cost effective than running a NAS 24/7, buying drives to replace dead ones, the cost of managing and learning about it, etc. Further, the fact that "[cloud] storage should never be trusted as a sole backup" is true of any storage! Not just cloud!
Comment: @dpollitt - the point is that cloud is out of your control.  You have no control over how your data is handled or how secure it is.  There are cases of cloud storage providers going out of business or being shut down suddenly and people simply losing access to their data.  The general rule in data storage is that if you don't control what it's stored on, it isn't reliable.  It is true that no backup should be trusted as sole for high critical data though, even local.  I trust a local redundant raid array far more than I trust anything short of an Enterprise SLA'd cloud provider though.
Comment: And an enterprise class SLA'd cloud provider is going to be very pricey.  You get what you pay for when it comes to storage.
Comment: I should perhaps add that I work for an enterprise class cloud SAAS provider.  Cloud based services can be great, but they also have to be something you manage and understand the risks of.  Most people don't and end up getting burned before they realize why the cheapest guy around is the cheapest guy around.
Answer: There is an option who can easily fit in a photographer workflow. The people from SmugMug offers and option called SmugVault. With SmugVault you can upload RAW files, but  you can also upload PSD, TIF and almost others formats. The price is a little high, you need to have a PRO account which start $40/yr plus the extra fee of the SmugVault account witch is approximately $0.09 per gigabyte per month. If you upload the contents of a 4 GB memory card, you'll be out $0.36 per month for storage (quote from website). This is for storage of files which are not JPG, GIF, and/or PNG. Again the maybe is a little pricy (who knows) but the peace of mind and the easily way to implement it in my photography workflow sometimes is priceless. (I don't work for SmugMug I just think is a great option for serious photographers).
Comment: Depending on your level of expertise, getting your own server is cheaper than that.  I've got a mirrored 1TB drive on my personal server (which is also a beefy machine that handles all my web hosting and such) and I only pay $110 a month for it.  Just the storage would be $90.  There are also managed packages for around the same price where you don't have to worry about maintaining the server.  (I use a 1&1 Dedicated Server.)
Answer: Initial upload to any cloud based system is going to be pretty painful, but with background processing and patience once it is complete, maintaining the incremental uploads are not nearly so hard.
Amazon Glacier is a reasonable choice, at $0.01/GB/month (slightly more for the initial upload) it is affordable and if Amazon is to be believed very reliable. They do charge more for retrieval, but for me this is a non-issue -- I hope to never use it, as I have local backups -- but if something terrible were to happen it is a good safety net.
You mentioned Aperture, so I am guessing you use a mac, in which case Arq is a nice backup solution that supports Amazon Glacier directly.


OpenGL Transform Feedback output size

Question: I'm working on a particle system using transform feedback, and I would like to know if it is possible to render to anything other than floats, like halfs, using Transform Feedback (OpenGL 3.3)? It would save some bytes and possibly speed up the process a little bit.
Answer: You can write unsigned integers and use bit manipulation to pack data into them into half of those integers.
You can use the ARB_shading_language_packing extension to help out in this process; it's pretty widely supported, even on older AMD HD3-5xxx cards (though I make no claim as to how well this actually works. They simply claim to support it).
Comment: Do you have any information about if that's a worthy optimization?
Comment: @KromStern NicolBolas hasn't been active around SO/SE for about 6 months, so I think it's unlikely he will be able to provide any further information.  Personally, I would expect this, like most optimizations, to only be helpful in select few situations, for instance if you have an ungodly number of particles.

OpenGL Transform Feedback output size


Jcrop + Canvas Transparent Image Issue On Crop

Question: Currently we are using ONLY Javascript + jQuery on our project and we are trying to convert out final image from jCrop to a base64 to be passed to a third party service with the help of HTML canvas. So far we have everything figured out expect one piece. When a user uploads a transparent PNG to jCrop, we crop the image and in the canvas preview, the transparent part of the image gets blurred when moving or expanding the jCrop select.
You can see the example of the problem here and you can see that when I was dragging the select in jCrop the transparent part of the image blurred badly: http://i46.tinypic.com/23jl946.png
I've played with some opacity settings in jCrop like:
bgColor: 'transparent'

And tried globalAlpha for canvas but these don't seem to work.
var c           = canvas.getContext('2d');
c.globalAlpha   = 0;

Any ideas?
Answer: Actually just using canvas's clearRect fixed it.
context.clearRect(0, 0, canvas.width, canvas.height);


How to remove null production from context free grammar?

Question: How to remove null production and simply the grammar?
$$
S \to a \mid Ab \mid aBa \\ A \to b \mid \epsilon \\ B \to b \mid A
$$
Can the simplification result in this CFG?
$$
S \to a \mid aBa \\ A \to b \\ B \to b
$$
Answer: The given grammar is:
$$
S \to a \mid Ab \mid aBa \\ A \to b \mid \epsilon \\ B \to b \mid A
$$
Now the algorithm for the removal of null productions is as follows:

We need to find all the nullable symbols from the grammar. A nullable symbol is one that generates the null string in one or more steps.
Since $A \rightarrow \epsilon$ so the symbol $A$ is nullable.
Due to $B\rightarrow A$ we shall have $B\Rightarrow ^* \epsilon$. So $B$ as well is nullable.
These are the only two nullable symbols in the grammar.

Remove all null productions in the grammar, and use substitution for the nullable symbols to incorporate the effect which could have been obtained due to their nullable nature as follows:
For each nullable symbol on the RHS of a production, rewrite the production, by once including it, and another time by not including it. Only with the exception that if due to this rewriting of rules, a null production is introduced, then just ignore that production.
So for the given grammar, we have:
For $S$ productions:
$S \to a \mid Ab \mid b \mid aBa\mid aa$
For the $A$ productions we have:
$A\to b$
For the $B$ productions we have:
$B\to b$

Since $A$ and $B$ are unit productions, they can be removed by substituting their RHS in the productions for $S$.
So the final grammar:
$S \to a \mid bb \mid b \mid aba\mid aa$
Answer: Your simplification is wrong. The language of the first grammar includes $b$, but the one of the second grammar does not.
If you replace the definition of $A$ in the productions of $B$ you obtain $B \to b \mid \epsilon$. Then if you replace $A$ and $B$ with their definition in $S$ you have.
$$
S \to a \mid bb \mid b \mid aba \mid aa
$$
Answer: To remove A->eps, you go through all right hand sides, and add right hand sides with any combinations of A's removed. You have a rule S->Ab, so you add S->b. And you have B->A, so you add B->eps, and that all done you remove A->eps.
Now you got a new null production B->eps, so you remove that in the same way. There's only the rule S->aBa, so you add S->aa and remove B->eps.
S->eps cannot be removed, you need that to have an empty string in the language.


How to create compressed iron without explosions?

Question: I play on a 1.7.10 server with no griefing, so breaking blocks with explosions is not possible. When I started Pneumatic Craft nobody knew how to get these compressed iron ingots. I tried to explode them. I wasted about 4 stacks of iron. The server support is not responding.
Is there a way to create compressed iron ingots without using explosions?
Answer: There are two ways to make compressed iron.  Blowing up a dropped stack (of any size) of iron ingots on the ground, or using the pressure chamber.  The pressure chamber, however, requires compressed iron to craft, which means that you must use TNT to get started on PneumaticCraft.  If your server's administrators have installed a anti-griefing plugin that makes TNT-compressed iron not work, you will have to work something out with the administrators to make it happen.
You may have to point out that without some form of fix for this problem, they might as well disable PneumaticCraft, because you cannot progress in the mod at all without compressed iron.
The official PneumaticCraft wiki has some information on mod progression, and is the source of my assertion that there are only the two ways to make compressed iron.
Answer: Nevermind I found out that this server has a crafting recipe plugin that allows you to craft compressed iron thank you for responses I derped. I hope this will help someone with a similiar problem.


Does the default Wordpress video player support closed captions?

Question: We want to used closed captions on a video so people can turn them on/off in the player like you do in Youtube. We aren't hosting this particular video on Youtube; it will just be uploaded to the site and embedded by pasting in the video url.
Comment: It supposed to, at least it has a corresponding interface for adding captions tracks in VTT format to the video media element via the classic editor (default Gutenberg video block does not have such an interface), but when I tried to use it, I can't manage to get it working.
Comment: My question was about embedding videos in the classic editor but the video block in Wordpress 5.6 now allows you to upload video captions directly in the block editor.
Answer: I don't know Wordpress has its own video player, but HTML5 video player supports closed captions.
This is the example.
<code><video  width="320" height="240">

     <source type="video/mp4" src="/my_video_file.mp4" >
     <track src="/captions_file.vtt" label="English" kind="captions" srclang="en-us" default >
     <track src="/French_captions_file.vtt" label="French" kind="subtitles" srclang="fr" >

</video>
</code>
But, I recommend this Video.js


confused in using modulation technique

Question: I am given a question in which I have to draw the spectrum of the signal $m(t)$ and then draw the spectrum of this modulated signal. The signal is
$$m(t)=\cos(1000\pi t)$$
Now in solution manual what they have done is that they have staright away drawn two pulses. One pulse in positive x-axis at $1000$ and at at negative x-axis at$-1000$. I was looking at the online solution of this question and in that solution following steps were taken:
We know that the Fourier Transform pair is:
\begin{align}
\cos(2\pi f_ot) &\leftrightarrow \frac{1}{2}[\delta(f-f_o)+\delta(f+f_o)]\\      m(t)&= \cos(1000\pi t)\\
&= \cos(2\pi 500t)
\end{align}
Apply Fourier Transform and we get:
$$M_1(f)=  \frac{1}{2}[\delta(f-500)+\delta(f+500)]$$
Hence two pulses of are drawn at 500 and -500.
Which of the above mentioned method is correct.
The solution manual is of Modern and Analog Digital Communication 4th edition.
Comment: you're right, the solution manual isn't.
Answer: You're right, the solution manual isn't.

confused in using modulation technique


What could cause a wet soil / moisture smell on concrete slab

Question: I have a wet soil smell coming from the living room concrete slab.
I had to remove all the tile in the leaving room.
A remediation company came, they removed the drywall and dehumidified the place, without any success. We still smell the same things when it's cold outside.
There is no trace of water on the concrete whatsoever.
The living room is on the north-east side of the house.
Thanks
Comment: the smell is caused by mold.  but I can't guess where the mold is.
Answer: It sounds like moisture under the slab.
Have you tapped a pice of plastic down to the slab for 24 hours? Taping a trash bad down then remove it the next day if the bag has water droplets on it or the area is wet under the bag the slab has moisture under it that is weeping up through the concrete. I have good luck sealing these floors in summer when the water table and possibly a spring are not causing the problem, in winter the moisture coming through will prevent the epoxy coatings I have used from sealing. I have fixed several homes with this problem by acid etching the slab and applying 2 part epoxy, it has worked well for me and may solve your problem.
Comment: Thank you. This issue started after my house flooded during Harvey hurricane. I had to remove a newly installed tile in the living room. I also laid a leveling compound on the slab, without success. Do you think the epoxy would work on it? Also, can I use epoxy in the living room?
Answer: It definitely sounds like water, and as @EdBeal correctly says you can seal it, which is a good idea. I would also suggest looking at how the water is getting there and ways you can stop it, because it could over time cause damp problems in the rest of your house. Look for areas where water is collecting against your house, and look at raising the ground level if you need to in order to get water to flow away. Check for pipe leaks as well.


How do I tune my guitar like a bajo sexto

Question: I was just wondering how to tune my guitar to sound like a bajo sexto. I watched a video on YouTube, but it was confusing.
Comment: Hi Mercedes, welcome to the site :)
Which Youtube Video did you watch, and why did you find it confusing? You will get better answers if you show you made some effort towards finding the answer yourself.
Answer: The bajo sexto strings are tuned in pairs, one octave lower than a typical 12-string guitar:1

                fourths
  |------|------|------|------|------|

E1-E2  A1-A2  D2-D3  G2-G2  C3-C3  F3-F3 2

|_________________|  |_________________|
     octaves               unison

This post is distilled from the Wikipedia page on Bajo sexto tuning.

1 For help tuning a guitar down an octave, see Is it possible to tune guitar down an octave?(or to f#?)
2 For more on scientific pitch notation (E1, F3, etc.), see What do the terms E2 A2 D3 G3 B3 E4 actually mean?
Comment: Normal 12 string guitars have an octave G, but unison B and E, due to the string tension problem there. Any idea why bajo doesn't have *all* strings in octaves - no tension problems there?
Comment: @Tim Maybe just to preserve the bass range of the instrument?
Answer: Just play with the top 4 strings
Comment: I'm unclear why using the top 4 strings is the best way to emulate the tuning of a 12-string instrument?


Real self-hosted password manager

Question: I am looking for a password manager that doesn't have any intermediary entities between me and my vault. It has to have desktop versions for Windows and Linux (at least debian/ubuntu) and browser extensions for chrome and furryfox. The vault would be either in a form of docker container or DB server that i can launch in the cloud. The most important part is that it doesn't store master password hash anywhere except my vault. Is there something you can recommend?
Answer: What about Buttercup?
As far as I know, it meets most of your requirements:

Desktop version on Linux, MacOS and Windows
Browser extensions to store passwords
Stores master password in vault db file

While it does not use a docker container or DB server, you can easily get similar functionality by storing the vault db file in a cloud drive of some sort.
Answer: Bitwarden seems like a good option.
It uses docker, and can even be air-gapped if you need to be absolutely certain it doesn't talk back to the developers.
You can use it on Linux, MacOS, Windows, Android, iOS, and basically all the popular browsers.

Real self-hosted password manager


PHPMailer - what sending method is most appropriate?

Question: I need to use PHPMailer to send emails out for the following reasons:

small lists (less then 500)
password resets
general notifications, 100ish emails at a time

And PHPMailer gives me the option to send via mail(), sendmail, or SMTP. Is there any reason to prefer one of these methods over the other?
I don't know enough about email services in general to make an informed decision.
Answer: The mail() function of PHP will automatically use your webhost's sending method, which will usually be sendmail. That should be preferable. If mail() doesn't work, you could use an SMTP server, or ask your host, they'll know whether it is preferable to use sendmail. Sendmail will only work on Unix systems though.


SSRS Lookup #Error on some rows

Question: I'm having trouble working out the details with an IIF containing some lookup statements.
The setup:
<code>Dataset 1: Transactions
Fields: itemid, transactionnotes, rdesc

Dataset 2: EmployeeInfo
Fields: code, fname, surname
</code>
I have an expression column with the following:
<code>=iif(Fields!itemid.Value = 100785,
    "Allocated to: "
    & lookup(cint(Fields!transactionnotes.Value), fields!code.value, fields!fname.value, "EmployeeInfo")
    & " "
    & lookup(cint(Fields!transactionnotes.Value), fields!code.value, fields!surname.value, "EmployeeInfo")
  , Fields!rdesc.Value)
</code>
itemid = 100785 indicates a line in the DB where it records a transaction allocated to another staff member. In all isntances where the itemid = 100785 the transactionnotes field (datatype string) will contain a numeric value of who it was allocated to. For those lines, this expression is working exactly as intended.
The problem:
For rows that do not contain itemid = 100785, the rdesc value should just be a string description of the transaction. For about half the rows this is working fine. But for about half the rows it shows #error. I've dug into the DB and the transactionnotes.value is NULL for all the rows getting #error. But its also NULL for the rows that are working. I'm including a screenshot so you can see the relevant values for itemid and rdesc for some rows that work and some that get #error. Description Calc is the field with the expression.
Answer: If I had to guess I'd say that the datatype of transactionnotes does not match the datatype of code. I suggest trying ...
<code>=iif(Fields!itemid.Value = 100785,
    "Allocated to: "
    & lookup(cint(Fields!transactionnotes.Value), cint(fields!code.value), fields!fname.value, "EmployeeInfo")
    & " "
    & lookup(cint(Fields!transactionnotes.Value), cint(fields!code.value), fields!surname.value, "EmployeeInfo")
  , Fields!rdesc.Value)
</code>
or perhaps it should go the other way using CStr() instead of CInt() for both transactionnotes and code. Try it out and see.

SSRS Lookup #Error on some rows


Why does Fate Accelerated Edition cost so little?

Question: I feel like Fate Accelerated Edition shouldn't cost so little. Does anybody know why or were the developers just being nice?
Comment: This is *very* similar to [What is an SRD for?](http://rpg.stackexchange.com/q/67590/4398), which explains Evil Hat's approach toward Fate and FAE costs in greater length than any answer here yet.
Answer: Economies of scale.
From Fred Hicks of Evil Hat, publishers of FAE:

We printed like 13,000 copies of those. Because we hit that economy of scale, our actual cost (not counting up front costs of writing — minimal — and art — reasonable) came in at less than 40 cents per copy (close to 35). To make a MSRP $5, 40-page book work for distribution our costs needed to be neatly under $2 per copy, so that's given us a lot of breathing room. It also means that those 13k copies cost us maybe $5,000 to print. And, yeah: the KS presold enough copies of FAE to more than cover that.

So, they made a decent amount of profit at $5, and why charge more if you don't really have to, particularly since it's their introductory product?
Answer: It's part of their marketing strategy. FAE is a simpler version of Fate; if you want something with a little more detail, you'll want to buy one of Evil Hat's other Fate-based products. "If this little taste interested you, why not buy one of our other products?"
The other advantage of having a low-cost entry point for the Fate system is that it leads to more people playing Fate. If you and your friends enjoy FAE, then you'll tell other people about how much you like FAE, which will lead to more sales of various Fate-related items. And having a low-cost product means that you'll sell things to those people who wouldn't pay $10 for an unknown RPG product, but might be willing to drop $5 on something new.
Answer: From Fate Core and Fate Accelerated are not different games by Fred Hicks.

FAE will also catch enthusiasm because of its price point (you can buy enough books for your whole table for the amount you'd normally pay for one player's handbook in another system) and because — frankly — it appeals to the lazy as well as the young/new player set. Lots of folks don't have the time to game that they used to, and FAE's going to look particularly shiny and sparkly to those folks. Myself included. This also means it'll catch a certain amount of fire for folks looking to make a convention slot happen with no or little prep.

So from the perspective of ease of entry, a lighter and less expensive book hits a lot of the high points of their marketing strategy for Fate Core as an platform, not a game.
Comment: Very belatedly, thanks for the edit! That made the quote and the whole answer easier for a reader to follow and connect to the question. (I've removed the old comments since there were made obsolete by the edit.)


Can I stack more spawn rate enhancement(s)?

Question: Blood Moon, Battle Potion, and a water candle placed. Is there any other way or do any of these work by adding more? (more players using battle potion, or more water candles on the screen)
Comment: The effects stack, but the candle must be **held** not placed.
Comment: Water Candle only works when it's equipped. Meaning that when you place it somewhere, it won't work.
Comment: If watercandle worked from the time its placed on then it would be immediately active, since there are multiple ones places in the dungeon.
Comment: @Batophobia the "official" wiki claims placed water candles do increase enemy spawns if they are nearby, and also stack with held water candles as of 1.2, though I don't know what their source is. http://terraria.gamepedia.com/Water_Candle
Answer: The Jungle has an increased spawn rate. There's a chart here showing the spawn rates, and it shows that the Jungle during a Blood Moon has a 1-in-60 chance of a monster spawning every 'tick', compared to 1 in 108 during Blood Moon in other biomes.
The Jungle also has the highest spawn limit, with a limit of 15 mobs during a Blood Moon, vs. 11 in other biomes.
Comment: So THAT's why I seem to be constantly swarmed by jungle bats and hornets there.


ADC conversion rate

Question: I have an ADC which is part of the Zynq-7000 SoC. For details please see the attached datasheet. I need to asses whether this ADC is appropriate for my application (measurement of stator currents in field oriented control of induction motor). Due to this reason I need to know the conversion time of the ADC. By inspecting of the datasheet I found that the ADC has conversion rate equal to 1 Msps. Does it mean that the conversion time is not longer than 1 us? Thanks for clarification.
Comment: Page 2 says:  One million samples per second maximum conversion rate. Maximum might be the key word here.
Answer: Yes, it would imply that the conversion time is <1us.  If you need up to twice the sampling rate, page 20 suggests that both XADCs can be configured in a ping-pong configuration for up to 2Msps.

ADC conversion rate


How do I remove log out, reboot, and shut down from GNOME shell application list?

Question: I'm new to Ubuntu. I don't know where the log out, reboot and shut down icons in my application list came from. I just need to remove this from here.
Answer: If we talking about these gray colored icons:

then they are provided by session-shortcuts package.
We can hide them by copying to current user settings folder and then adding property NoDisplay=true here:
mkdir -p ~/.local/share/applications/
cp /usr/share/applications/{logout,reboot,shutdown}.desktop ~/.local/share/applications/
echo "NoDisplay=true" | tee -a ~/.local/share/applications/{logout,reboot,shutdown}.desktop > /dev/null

then logout (and login again) or reboot.
Answer: Open a terminal and run the following command:
sudo apt purge session-shortcuts

Logout and then login again.


confused by Symbol.iterator with typescript and returned value type in a for-of-loop

Question: I'm experimenting with type script and trying to teach myself how to write generic containers as a learning experience.
I've created a LinkedList class that I want to add the ability to iterate over, example
for (const item of ll) {
}

where item should be of type T.
however, this is my implementation in the class of Symbol.iterator
  [Symbol.iterator]() {
    const head = this._head;
    let node = this._head._next;
    return {
      next() {
        if (node === head) {
          return { value: undefined, done: true };
        }
        const r = { value: node.item, done: false };
        node = node._next;
        return r;
      }
    };
  };

the problem is, that typescript then seems to interpret the type of "item" in the for loop above as T | undefined (even though, the "value" associated with the done = true which is never seen by the consumers of the iterator.
Wondering what the appropriate way to handle this is, as this is all new to me, and googling around hasn't helped me find the answer to this Q.
The closest I found to answering my Q is to use a generator instead.
i.e.
  *[Symbol.iterator]() {
    const head = this._head;
    let node = this._head._next;

    while (node !== head) {
      yield node.item;
      node = node._next;
    }
  };

since it never yields anything besides a T, the typing works better.
But, this sees "wrong" to me that the first doesn't work as I expect, but the second does (even though I can see why in practice it works that way, next(), returns 2 possible types for value, while the generator method only ever ever returns 1 type).  Does one have to use a generator to get what I want, or should a non generator iterator work as well?
In looking closely at the transpiled javascript code, typescript seems to go "wild" (to me, I'm new at this) with the generator version (creating what seems to be a very complicated _generator object), where the initial non generator version is basically the exact code I wrote.
As an aside, I realize that if nodes can be removed from my linked list, that the iterator could become problematic (ala a ConcurrentModificationException error in java).
Answer: Your method [Symbol.iterator]() is returning two possibilites, it's either returning { value: undefined, done: boolean } or { value: T, done: boolean} and Typescript will try it's best to make a type based on your return values.
The "for...of" loop will use the types from value and in this case it's either T or undefined.
Instead of letting Typescript guess the return value of your iterator you can tell what it's returning with the generic type Iterator<>
[Symbol.iterator](): Iterator<T> {
  // implementation
}

I think you can make a simplier implementation of your Iterator object if you combine Iterator and the Iterable protocol and make a IterableIterator
class MyIterator<T> implements IterableIterator<T> {
    next(): IteratorResult<T> {
       // next implementation
    }

    [Symbol.iterator]() {
        return this
    }
}

I have written an article about Iterator, Iterable, IterableIterator and Generators that explains this more in depth at https://medium.com/@lostfields if you are interested.
Comment: thanks, the return type was useful, makes sense, didn't think about it.


If your flight is inside the USA, will you be asked about your immigration status?

Question: If your flight is inside the USA (e.g. Salt Lake to New York), will you be asked about your immigration status?
Comment: No, on SLC to NYC they will not. On a flight between some U.S. Territories and mainland USA, they will.
Comment: There is a possibility, but I will bet money that you wouldn't be asked.
Answer: It is very unlikely.  The TSA does not concern itself with immigration status.
At some airports, the Border Patrol had been known to question people at the TSA checkpoints, but this seems to happen only, for the moment at least, at airports near the Mexican border, such as McAllen and Brownsville, Texas.
There was also a single isolated incident of a flight from San Francisco being met by officers from the Department of Homeland Security and passengers being asked to show identification, though the legal authority for this was questionable at best.
In Salt Lake City and New York, the chance of being asked about your immigration status is exceedingly low.