Setting up Cloud9 IDE to compile and run Java?

Question: I have tried posting this request in Cloud9's forums, but since it never posts, I am hoping someone here could give me a hand. (The forum keeps saying my question is being submitted for review, but then never shows up).
I can't get Java code to compile and run. I've Googled the issue and read other posts in their limited forums, but I can't get it to compile and run a simple Hello World! program. My .java filename matches the class and the code is fine.
I have tried putting my .java files in the following directories:
test/java/

test/src/

I just get this:
bash: src/HelloWorld.java: No such file or directory

I tried this: http://www.programmingforliving.com/2014/09/java-coding-with-cloud9-ide.html
But I just get:
Running HelloWorld.java

Error: Could not find or load main class HelloWorld

Any suggestions? Given I'm essentially a Java noob I am hoping the solution is fairly simple.
Answer: I think that Codenvy is much better in java than Cloud9. It provides easy build & run configuration, code completion, project sharing with permissions or factory (creates clone of your project with one click in minutes).
Take a look at official java spring factory. This link opens temporary(personal) java project ready to code, build & run.
Also Codenvy has project wizard that has a lot of project types including java console app (uses maven).
Answer: Without you pasting in your code it's tough to tell but make sure your class and filename are both titled HelloWorld. Make sure your src folder is in your main workspace folder so your file should be at /home/ubuntu/workspace/src/HelloWorld.java.
Also, this documentation looks pretty similar to the blog you referenced but still worth a look https://docs.c9.io/docs/custom-runners.
Comment: Yea, I wish I had seen that before. I just figured it out and then saw your post. Pretty much detailed exactly what I needed to do.
Answer: Ok, decided to screw around with it and figured it out... (then saw that Brady Dowling had posted a link that explained in better detail what needed to be changed).
At any rate, I noticed a few things in Cloud9.

Even after making the changes and saving, it would still not compile correctly. I had to close my session of C9 and go back in. Then it would work.
After compiling, and trying to run the program, it wasn't automatically picking the Java runner I made. So if you are running into issues, make sure the Java (or whatever you decided to name it) runner is selected in the console.
You have to compile and run separately. Kind of annoying, but at least it works. Unlike C/C++ in C9, it won't compile and run by simply hitting 'Run'. If you do, it creates an error saying the .class doesn't exist. Simple as pressing F7 to build, then F5 to run.

Anyway, I took screenshots of what I had to change to get it working. Essentially, just the directories it looks for the .java file in (the right arrows) and the directory it looks for/compiles the .class file to (the left arrows). Since I was putting the .java and .class in the same directory (java), I just changed both to 'java'. In the links Brady and myself posted, they used .bin (for .class) and src for (.java).
1st picture is the Builder file (I called it javac) and the 2nd picture is the Runner file (I called it Java).

Anyway, I hope this helps someone out. I am really liking C9 and it perfectly suits my novice needs at the moment. I like the ability to dabble in multiple languages to see what I like without having to switch applications. The real-time live preview HTML/CSS like Brackets is another huge plus for me.
Regards
Answer: For what I understand, C9 workspaces don't come with jdk installed. But I always use these commands:

sudo apt-get update

(wait a while for it to finish processing. Then)

sudo apt-get install default-jdk

(Then It will ask you for some permission. Type "Y")
And then it compiles and runs normally using the terminal.
Answer: Sometimes you will also need to install a package to get javac.
Example:
sudo apt-get install openjdk-7-jdk
Answer: The java command works right of the box. You may java -version to see that it is Ubuntu running. You can also locate the java binary and see that it is amd64. That is all you need to know to download jdk manually from Oracle.com, like
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"  http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-i586.tar.gz

tar xf jdk-8u92-linux-i586.tar.gz

and voila, jdk-1.8.0_92/bin/java(c) can be executed! It allows you to compile java files.


Can I query a DVWP with javascript?

Question: Is it possible to query results in a data view web part with javascript? If so, how do you reference the DVWP in the syntax?
Answer: You'd use it like any other HTML on your page.  Since you'd have control over the DVWP, it'd make sense to properly set IDs and classes for things you want to hook into on the client side when the DVWP is loaded.
And to further add, I've done this on numerous occasions where I get the DVWP to output the content I want in the format I want to utilize jQuery tools like jQuery UI.
Comment: @pirateEric...thanks for the reply.....could you possibly point me to a reference for learning how to do this? I am new to this....or provide an example please?
Comment: What does your dvwp output and what are you trying to do with javascript?
Comment: well the first scenario I would try is this calendar recurrence issue. I can create a current view which shows 'today's events', so I can create a web part that references that view (this seems to be the ONLY way I can get those My Start and My End times that SP creates for the events that occur that day whether they are recurring or not). So a simple use case to start is I would like to be able to query and filter that web part...plus a larger goal is learn how to do it for other uses. Like I said I am just starting out so I am sort of learning the context; greatly appreciate the help!!

Can I query a DVWP with javascript?


Regression equation in tree algorithms

Question: Is there any possibility to obtain regression equation (y=...) by using tree algorithms (e.g.random forest, gradient boost or xgboost) ? As I understand, the target that we attempt to use these algorthims is only to learn which predictors are important or not. If that is the case, the only way to achieve a regression model is to use a OLS or PLSR methods by utilizing the most influential predictors coming from tree algortihms. Am I correct? What is your advice on using tree algorithms for those who wants to get a response model like me?
Comment: In it's current form this question is very unclear. Please have a look at it again and try to express it in a clearer manner. E.g. , what do you mean by "how does this model predict my response data values *regardless of being based on a mathematical expression*" ? Or in the first paragraph, what do you mean by "regardless of sticking to any mathematical expression" ?
Comment: Could you specify which ML model are you talking about? There are many different ones, and they depend on different math principles.
Comment: I made my question simple as it is. Let's talk specifically. For example, tree algorithm (random forest regression) gives us a correlation coefficient between predicted and true value. But, as I know it does not give us a regression equation. Without constructing a model like in statistical learning, how does it give us an estimation on true value? And if tree algorithms does not give us a regression equation, why do they include "'regression term" in their names such as random forest regression?
Comment: This question is very broad, and I believe you would profit from
reading an introductory level textbook. [We have a helpful list of
free statistical
textbooks.](https://stats.stackexchange.com/q/170/1352) If
afterwards you still have more specific questions, then please do ask
them here. If you already *have* read such a textbook, please edit
your question to make it more specific. Thank you!
Comment: I revised my question. I know the regression model and how it works. I took many courses on it during my master. So, I am quite experienced on statistical modeling and machine learning in practical as an applied engineer. But the theory behing the machine learning  intermingle with statistical learning. Some concepts (like regression) are using by both ML and Stat.learning. By the way, the main question that brings myself to this point is the current (revised) question about tree algorithms and random forest regression. Thanks for your advices.
Answer: You can turn a single tree structure into a regression-like equation with the use of indicator functions to indicate the different nodes of the tree. That is, you  can make an equation with the dependent variable on the left side and the independent variables on the right.  These equations get cumbersome quickly, if the tree is at all complex.
As far as I can see, the same ought to be possible with methods such as random forests, but I am not expert on them and can't say for sure.
Answer: The XGBoost portion of the question is answered here: How does gradient boosting calculate probability estimates?
Peter Flom's outline, that you can use boolean logic to represent the decision tree output, is correct. The same procedure generalizes to random forests.

In the case that each tree votes (that is, makes a binary decision), another perspective is to think of each tree as producing a 1-hot sparse vector. An ensemble of $T$ such trees produces a $T$ hot sparse vector. The average of that vector is the average over each ensemble member.
In the case that each tree produces a proportional score in $(0,1)$, the result is a sparse vector with one float, and you can acquire average scores in the same manner.

Regression equation in tree algorithms


What does Morgoth look like?

Question: Is Morgoth, the original enemy in J. R. R. Tolkien's Middle-earth ever visually described? I envisage him as a bigger, meaner version of the physical Sauron, but I cannot find any reference in The Silmarillion.
Comment: He's big, he's black, he's bald...  No, wait - I'm thinking of Marcellus Wallace.
Comment: Simarillion -> Silmarillion
Comment: I always pictured him as a taller Major Frank Burns.
Answer: Depends. He takes on various forms at different times. He's mostly described as a huge dark man and this is the form he takes and is locked into after his first imprisonment.
His first appearance during the creation and the First War was

"a mountain that wades in the sea and has its head above the clouds
  and is clad in ice and crowned with smoke and fire; and the light of
  the eyes of Melkor was like a flame that withers with heat and pierces
  with a deadly cold."

He lost his foot and suffered various un-healable wounds after his combat with Fingolfin and burnt his hands stealing and holding the silmarils.
Answer: Melkor was grandiose. His helmet, as the Morgoth, was so heavy Beren could not lift it [Lays of Belereiand, 8.4136-4137], and he had a scar and limp [12.3604-09, 3615-3617, 3632-3634]. Melkor's physical form in the beginning is described as:

because of his mood and the malice that burned in him that form was
  dark and terrible. And he descended upon Arda in power and majesty
  greater than any other of the Valar, as a mountain that wades in the
  sea and has it head above the clouds and is clad in ice and crowned
  with smoke and fire; and the light of the eyes of Melkor was like a
  flame that withers with heat and pierces with deadly cold. [Silmarillion; Ainulindalë]

He is also said to have walked around in various "shapes of power and fear" [Of the Beginning of Days]

he put on again the form that he had worn as the tyrant of Utumno: a
  dark Lord, tall and terrible. In that form he remained ever after. [Of the Darkening of Valinor]

Don't over-estimate how big Melkor, or any of the Ainu were. There is also another description of him when he battles Fingolfin:

Morgoth came, climbing slowly from his subterranean throne, and the
  rumour of his feet was like thunder underground. And he issued forth
  clad in black armour; and he stood before the King like a tower,
  iron-crowned, and his vast shield, sable unblazoned, cast a shadow
  over him like a stormcloud...
Melkor held aloft Grond, the Hammer of the Underworld, and swung it
  down like a bolt of thunder... Grond rent a mighty pit in the earth,
  whence smoke and fire darted...
Morgoth bore his shield upon him. Thrice he was crushed to his
  knees... Morgoth set his left foot upon his neck, and the weight of it
  was like a fallen hill. Yet with his last and desperate stroke
  Fingolfin hewed the foot with Ringil [The Ruin of Beleriand]

Morgoth is big but not like a giant. When he put his foot on Fingolfin's neck he could still use his arm to swing his sword.
Comment: That's a bit of a tangent but he was not stuck in his form because he fought Ungoliant. He was stuck because he dispersed his power so widely in middle-earth that he became bound to it. That's why Aman is known as Morgoth's Ring.
Comment: Nice answer, you could also mention that he was stuck in form and shrank because of fight with Ungoliant.
Comment: @Belegorn I assume you meant Arda, not Aman specifically.
Answer: Along with the othe Ainur, I think the idea is that they have no form defined that we can grasp, but each has a preferred form when they appear before other beings.
Morgoth was stuck in form because of his misdemeanors. That was a form reflecting his evil.
Comment: Tor Books' website has a series of essays by Jeff LaSala (iirc) that say Morgoth lost the ability to change shapes because he spent his power on too many grand schemes.
Answer: Morgoth can take on different evil forms at will, but his true appearance is an invisible cloud of dread that sucks out the color and light from its surroundings
In 1967, Tolkien wrote some linguistic notes about the elvish root √PHAN- "cover, screen, veil", from which he derived the elvish word fanar, meaning the physical forms adopted by the Valar and Maiar. He then digressed for a few pages to discuss these forms. These notes were published in Parma Eldalamberon #17, and then later republished in The Nature of Middle-earth.
During these notes Tolkien discusses a bit what Valar were like when not "clad" in their fanar.

Melkor, they said, was invisible, and his presence was revealed only by great dread and by a darkness that dimmed or blotted out the light and hues of all things near him. The Maiar corrupted by him stank. For this reason neither he nor any of the evil Maiar ever approached one of the Eldar that they wished to persuade or deceive except clad in their fanar. These they could still make to appear beautiful to Elvish eyes, if they wished — until after the great treachery of Melkor and the destruction of the Trees. After that Melkor (Morgoth) and his servants were perceived as forms of evil and enemies undisguised.
The Nature of Middle-earth - "The Visible Forms of the Valar and Maiar"
Answer: Initially he could take any form at will, but upon becoming evil he chose a form that is said to be "a mountain that wades in the sea, and has its head above the clouds, and is clad with ice and crowned with smoke and fire, and the light of the eyes of Melkor was like a flame that whithers with heat and pierces with a deadly cold", and The Silmarillion stated that "he stood over the king as a tower...and...cast a shadow over him like a storm cloud".

...a mountain that wades in the sea, and has its head above the clouds, and is clad with ice and crowned with smoke and fire, and the light of the eyes of Melkor was like a flame that whithers with heat and pierces with a deadly cold.
—The Silmarillion, Ainulindalë

He stood over the king as a tower...and...cast a shadow over him like a storm cloud.
—Quenta Silmarillion, "Of the Ruin of Beleriand and the Fall of Fingolfin"

After stealing the Silmarils, he used them as his crown jewels, so they shone on his head. There are illustrations of him that depict his appearance:

Also, Sauron's armor in the movies was based on Morgoth's in the illustrations: https://lotr.fandom.com/wiki/Sauron#The_Lord_of_the_Rings_film_trilogy

He also wears black armor and a helmet similar to Morgoth's in The Silmarillion, and wields a giant mace (perhaps based on Grond) capable of killing scores of men in one hit.

So I guess Morgoth looks like a gigantic movie!Sauron with three Silmarils on his helmet's forehead.
Comment: As I mentioned in response to one of your other answers, it's preferable to use direct quotes from the books or films wherever possible, rather user-generated content from sites like Wikipedia or LOTR Fandom. You have included some direct quotes from the books here, but the majority of what you've quoted falls into the user-generated category. It'd be better to remove most or all of the user-generated stuff, and just focus on the direct quotes from the books, and your own interpretation of them.
Comment: It's up to you, but ideally, it's best to only quote the source material, and explain what you're quoting (and why) in your own words. For one thing, it removes the need to have quotations within quotations, which doesn't look very nice in terms of the formatting. Also, if your answer relies heavily on user-generated content from another page, it potentially makes your answer redundant, as we could just go read the other page and find exactly the same text written verbatim there.
Comment: I don't think you broke any rules, per se. These are just suggestions on how to present your answers in such a way that they're more likely to be viewed favourably by (and hopefully earn upvotes from) other users. I recommend looking at the most highly voted answers in any given thread to help get a better idea of what a really good answer looks like. I've learned a lot myself from doing that.
Comment: OK, but can I keep the quote where Sauron's armor in the movies is based on Morgoth's?
Comment: I edited the comment. I'm gonna need to learn more about the rules regarding answers.
Comment: Ah no, I didn't mean I break the rules. I mean I need to familiarize myself with the site's rules for future answers.

What does Morgoth look like?


When did physical Death come to the world?

Question: Death is certain. It comes to everybody except to those stated in the bible. But where and when did Death come to the world. Is it a natural phenomenon or something like a curse?
Comment: According to whom? There are a minority (historically speaking) of Christians who say physical death entered the world when Adam and Eve first sinned. Others say death has always existed, and this is when spiritual death entered the world. Your question needs to be made much more narrow to be answerable.
Answer: The Bible teaches that death entered into the world because of Adam's sin:

Therefore, just as sin entered the world through one man, and death through sin, and in this way death came to all people, because all sinned— To be sure, sin was in the world before the law was given, but sin is not charged against anyone's account where there is no law. Nevertheless, death reigned from the time of Adam to the time of Moses, even over those who did not sin by breaking a command, as did Adam, who is a pattern of the one to come. (Romans 5:12-14)
For since death came through a man, the resurrection of the dead comes also through a man. For as in Adam all die, so in Christ all will be made alive. (1 Corinthians 15:21-22)

There are debates over what type of death was involved in the fall. I believe that it was holistic death. It clearly involved spiritual death, as Adam was a sinner needing redemption. But earlier in 1 Corinthians 15 Paul says that if the resurrection we are hoping for isn't physical then our hope is in vain:

For if the dead are not raised, then Christ has not been raised either. And if Christ has not been raised, your faith is futile; you are still in your sins. Then those also who have fallen asleep in Christ are lost. If only for this life we have hope in Christ, we are of all people most to be pitied. (1 Corinthians 15:16-19)

The solution matches the problem, and so if it required the Son of God to be resurrected to give us life, then I believe that physical death is a result of sin too.
Is death natural or a curse? There's a very real sense in which it is natural. So I would say that death's naturalness is a curse. The curse changed the world from a world where death was unnatural to one where it is the most natural thing of all.
Comment: I am a little confused by your answer. Do you mean death for humans only, or for animals as well? (Very small animals do not die at all so maybe they were without sin.) If you only mean humans, what do you mean by a human? Would you consider Homo Erectus a human for example? You cannot say 'the Bible teaches' as a general statement. I understand Paul to mean something completely different to you - something that actually makes sense. Maybe you can change, your opening sentence to say that to people that believe the Bible the way you do, it teaches such and such.
Comment: I believe that animal (but not insect) death is also from Adam, but that the Bible is only explicit about human death. I believe human includes H erectus. If you have a different interpretation make an answer, I would be interested to read it.
Answer: It is a pious opinion, fairly commonly held based of Romans 5:12 ("Sin came into the world through one man...") and Romans 6:23 ("The wages of sin is death...") that there was no death sin in the world until Adam committed the first sin. However, this ignores two facts: first, neither the condemnations pronounced by God against Adam (Genesis 3:17-19), or Eve (Genesis 3:16) mention either taking away physical immortality; second, in Genesis 3:22, the reason given for expelling Adam and Eve from the Garden of Eden is "lest he put forth his hand and take also of the tree of life, and eat, and live forever."  If Adam were immortal to begin with, then the immortality would have had to have been taken away, and "lest he put forth..." would have been unnecessary.
Further, some of the smallest aquatic creatures created on day 5 would have had to have eaten before Adam's creation on 6, and they would have consumed other creatures, since the smallest creatures have to eat almost constantly to maintain enough energy to survive, killing them in the process.
So evidence from the Bible supports that death was part of creation from the beginning, both for other creatures, and for humans.
Comment: If by "die", you mean physical death, then yes. On the other hand, in Romans 6:23, Paul juxtaposes "death" with "everlasting life", which I submit means that Paul intended to communicate that the wages of sin is death of the Soul, for certainly by the time Paul wrote Romans, there was already physical death.
Comment: so it is a wrong notion when we say we die because of sin then.
Comment: Your first "fact" is an argument from silence, and a poor one. 1 Cor 15 indicates that even if the most serious death is spiritual, our hope is that we will be saved from physical death. "For as in Adam all die, so in Christ all will be made alive." I believe that in Adam we have holistic death and in Christ holistic life.
Comment: UnlessNo, the first argument is not an argument from silence.
Comment: Please disregard pervious comment. I started it before I realized I had to think more how to get what I wanted to say within the space allotment.


How does foreign trade work in a planned economy?

Question: I know that in a planned economy all economic processes are ruled by the state and that there are disadvantages such as too much bureaucracy and that sometimes deals are not always met with demand... But how is foreign trade ran in a planned economy and are there any advantages or disadvantages in such? And how do exporters deal and go ahead in a planned economy?
Comment: For a factual and historical point of view, during the 20th century, many nations existed with a central government overseeing foreign trade affairs. I believe you can look into that.
Answer: The trade in itself was not that much different per se but it was restricted and overseen by the government.
For example,  USSR was net oil exporter and most of its oil was sold for US dollars at international market prices and then USSR used dollars to buy imports that government officials decided to import. For example, you can see overview of trade in USSR in Zoeter (1983). This is really not that much different from Russia's state companies selling oil and gas at international markets now.
One peculiarity of trade in many centrally planned economies was that it was not rare to trade in kind, as due to general economic mismanagement most centrally planed economies had very weak currencies so they either had to trade paying with hard currency (e.g. dollars), or trade was conducted in kind as the famous Pepsi -  Stolichnaya vodka/warship in kind trade (yes as bizarre as it might sound that is not typo they exchanged some warships for Pepsi as well).
From economic point of view there is no advantage to government completely overseeing/controlling trade to this extent (I don't think there are many serious economists who would even entertain that as a serious option). A disadvantage of such arrangement is that government faces an informational asymmetry when it comes to the preferences and demand of its population, so when government tries to guess how much goods should it import it will likely get it often wrong resulting in shortages. In fact foreign consumer goods were as a result not even widely avaiable to ordinary citizens (see this Investopedia explainer). As a result foreign imports were often avaiable primarily through special shops (in Russia 'Beryozka') where people had to pay in hard currency effectively excluding ordinary non-privileged people, or through black market.   However, it is hard to disentangle how much this was due to mismanaging trade and how much due to general economic mismanagement under central planning.


Is homotopy category of chain complexes abelian

Question: I would like to show that  homotopy category of chain complexes of any abelian category is not necessarily an abelian category. Here's my attempt:
Assume homotopy category of chain complexes is abelian than any chain map $f:X \rightarrow Y$ splits into $p_2 \cdot p_1$ where $p_1:X \rightarrow Z $
$p_2: Z \rightarrow Y$ and $Z$ is both coim(f) and im(f) and thus $p_1$ is an epimorphism and $p_2$ is a monomorphism.
Let $C(f)$ denote a mapping cone of $f$.$$$$Then chain map $X \rightarrow Y \rightarrow C(f) $ is homotopic to zero but $p_1$ is an epimorphism, so $Z \rightarrow Y \rightarrow C(f) $ is also homotopic to zero. We can combine this map with $a: C(f) \rightarrow Y$ ( it's just a projection from $X^{n+1} + Y^{n}$ to $Y^{n}$) and now it means that
$Z \rightarrow Y $ is homotopic to zero, which gives a contradiction. Is this  right approach to this task? It looks suspiciously simple.
Answer:
I would like to show that homotopy category of chain complexes of any
  abelian category is not necessarily an abelian category.

The problem with your approach is that the homotopy category $K (\mathcal{A})$ is almost never abelian, but it seems like you are trying to show that it's not abelian for any $\mathcal{A}$, which is not true (for instance, if $\mathcal{A}$ is the category of vector spaces over a field, then $K (\mathcal{A})$ is abelian; or in general $K (\mathcal{A})$ is abelian iff all short exact sequences in $\mathcal{A}$ split).
A counterexample should use something specific about $\mathcal{A}$ (essentially a non-split short exact sequence in $\mathcal{A}$). For $\mathcal{A} = \mathbb{Z}\textit{-Mod}$ it's easy to deduce a contradiction. See for instance here:

https://mathoverflow.net/questions/15658/ (using the language of triangulated categories)
Exercise A3.51 in Eisenbud's "Commutative Algebra with a view toward
Algebraic Geometry"


What are the final polymorph rules?

Question: The polymorph self spell and its friends were an ever-changing pile of errata. What was the final word on how polymorph effects work in Dungeons and Dragons, Third Edition? I am uninterested in the Dungeons and Dragons 3.5 rules for polymorph effects.
Comment: Hey I Can Chan's cleanup of this question is good and captures my intent.
Answer: Tome and Blood is the final word on those spells… probably
Andy Collins, he of the Dungeons and Dragons 3.5 revision, says in the Wizards of the Coast Design and Development Web column "The Polymorph Problem" that Tome and Blood is the most recent source for the spells.  I flipped through some Third Edition books post-Tome and Blood to confirm this and didn't find any later reprints of the polymorph spells. So, while it's possible errata later than Tome and Blood (July 2001) appeared on the Wizards of the Coast Web site or in Dungeon or Dragon, I've not been able to locate any.
A few months prior to Tome and Blood, the spell polymorph other did appear as Official Errata from the Sage on page 45 of Dragon #280 (Feb. 2001). Also, I've Psionics Handbook errata from May 2002 that includes the text of the 4th-level psion/psychic warrior power polymorph self [psychometabolism] (Psionics Handbook 92) that's different from the Tome and Blood spell polymorph other and self, even after accounting for a necessary switch in pronouns and targets, but this undated PDF claiming to be Psionics Handbook errata includes the Tome and Blood version of polymorph self (altered appropriately from other and to a psionic power), so I don't know what's up with those.
By the way, this is pretty handy collection of errata for Third Edition through Magic of Faerûn (Aug. 2001), and if you're sifting through Third Edition books anyway, you can go in order using this list.
Answer: Use Polymorph (et al.) from the 3e PHB, noting there are clarifications, but not errata, to it. The reprints in the 3.5e PHB may be superfically different, but are fundamentally the same "become a monster manual entry" that later 3.5e era errata changed
Comment: Reading your answer, it's not clear to me why the 3.5e PHB spells and errata get mentioned. (Unless you mean it's the same spell that later ***3e*** era errata changed, or something..?) Could you clarify why you're mentioning that exactly? Consider also confirming whether there are no 3e era errata for polymorph, given you're recommending the raw PHB version.
Comment: In its description of the *polymorph other* and *self* spells, *Tome and Blood* says , "This version of the spell is now official and supersedes the version presented in the *Player's Handbook*."

What are the final polymorph rules?


Install Ubuntu 14.04 / 15 in computer with Windows 8.1 Legacy installed before

Question: I want to install Ubuntu 14.04 to dual boot with Win 8.1 installed before.
I installed Windows 8.1 in Legacy mode, my laptop is Dell Vostro 2420 which support UEFI but I disable UEFI boot mode before install Windows. Now, when I create Ubuntu 14.04 installation in my usb by Linux Pen Drive, it's UEFI certainly which I can't change. Can I install Ubuntu in Legacy mode and how?
Comment: You could use virtualbox :3
Comment: You mean create a VirtualBox VM install ubuntu to my VM? I want Ubuntu to do something pretty heavy in windows like Netbean and Android developing :) I have 4 GB RAM only, how much I give for the VM? I don't think they will be smooth on a VM with 1GB RAM
Answer: Legacy boot can be turned off after the install is completed - it is only for the usb boot support. UEFI boot is the problem, I'm pretty sure changing that may corrupt the win bootloader. Can't really help you there - re-install?
During the install I believe fast boot and secure boot is what you want to disable in the BIOS. I'm pretty sure I put both UEFI files in the same partition (I could be wrong) - once installed, grub will become your default boot manager.
From there you can go to Windows or Linux - sometimes you have to "fix" the grub - after major Windows updates -  I use (http://sourceforge.net/projects/boot-repair-cd/) and do the recommended repair option.


Only one hour for changing flight from Victoria BC to SFO to LHR

Question: United changed our departure from Victoria, BC, Canada to SFO which only leaves us one hour to transfer in SFO to our flight to LHR.
Is this even possible? Any advice or experience is welcome.
Comment: @phoog my experience is that United do not check such things. When they delayed my flight (notififcation ~14 hours in advance) such that it would mean I would miss the following 2 flights, I had to point this out to them. THey left the itenary as was and made no attempt to correct.
Comment: Yes it's possible or they would have changed your second flight, too.
Answer: Victoria is one of the few airports in Canada that does NOT have US immigration pre-clearance for flights to the US, thus on arrival at SFO you will need to pass through immigration, re-collect your bags, go through customs, re-check bags, re-clear security and then head to your gate.
If you have Global Entry/Nexus and have no checked bags then it's possibly that you might be able to do this within 1 hour (well, 45 minutes before the boarding cut-off time) - but otherwise I'd say that it's extremely unlikely bordering on impossible.
60 minutes is also below the allowed MCT (Minimum Connection Time) for United international to international flights at SFO, which means that United would not sell you this connection if you asked for it.
You should contact United and point out that this is not sufficient time for your connection and see what other options are available.
(Thanks to Alexander Woo for pointing out that Victoria airport doesn't have Pre-clearance, even though the ferry terminal does!)
Comment: Victoria does NOT have preclearance.  (Only YVR, YEG, YYC, YWG, YYZ, YOW, YUL, and YHZ have preclearance.)  A flight from Victoria to SFO will clear US immigration in SFO.
Comment: Actually you don't have to re-check your bags; bags will be checked through - you should _claim them_ and then drop them on the dedicated station. I'm not sure if this is why your answer was downvoted, because other than this minor issue; its right on point.
Comment: Indeed you are correct!  I did check the CBP website before answering and it listed Victoria, but it turns out that this is actually at the Belleville ferry terminal in Victoria, not the airport!
Comment: It was downvoted before the edit - it has now been undownvoted.
Comment: @BurhanKhalid Technically when you drop your bags (and they are scanned) you are checking them in again.  They will have been tagged all the way though, but when they are returned to you in SFO the airline will record that they no longer have possession of the bag, and it's not until they re-scan them that they become "checked bags" again.


What will happen to a Nissan if it was refilled with antifreeze meant for an Audi?

Question: My friend had to replace the radiator in her Nissan Rogue and bought "blue" antifreeze as specified by her mechanic.  After the job was done and she'd been driving for a few days, she went to return the extra blue antifreeze and discovered that it was meant for an Audi or Mercedes. Does she need to have her radiator drained and refilled or is it going to be ok?
Answer: There is no antifreeze "for Nissan" or "for Audi". There are liquids made by different manufacturers or under different trademarks that meet (or don't meet) certain standards.
The requirements for the cooling liquid are related to the materials used in the engine, radiators and other parts that the coolant runs in. And, rest assured, all car manufacturers use the same steel, cast iron, brass, aluminium and differnt kinds of rubber like anyone else. There ARE some subtle differences, of course, but they don't change the overall chemical properties of the material.
What's more, in a lot of cases, different car manufacturers source their radiators, rubber hoses, water pumps, etc... to the same pool of subcontractors, so the parts in different cars may happen to be made in the same place.
Usually, vendors boast compliance of certain vehicle manufacturers internal standards on the label. This doesn't mean that the substance is bad for some other car.
In some cases, the antifreeze (or the motor oil, for that matter) is branded with some car manufacturer brand (e.g. Audi ot Mercedes-Benz). This means nothing (except for some price tip).
Neither VAG group (=Audi) nor Mercedes-Benz, nor Nissan, nor Ford really produce antifreeze. And even if they do, they can't put some "other brand engine poison" in it. It is still OK to use it in any other car that requires the antifreeze to conform to the same standards.
If the antifreeze was specified only as "blue", this generally means "G11" antifreeze standard. This is somewhat old, but still pretty much widely used (even in new cars) type of antifreeze. Other types of antifreeze include "G12" (usually pink), "G12+", "G12++" (minor improvements over "G12", still pink), "G13" (purple), etc, etc...
Same color coolants are generally interchangeable and freely mixable.
Tell your friend to run her car happily and check for leaks under the car in the first month or two. An antifreeze change sometimes promotes cooling system leaks.
Comment: While I agree with you for the most part, there are some exceptions, for instance Honda. There is a specific coolant to use in Honda engines (or at least it has been that way in the past). If you don't use the right coolant, it doesn't affect the hard parts of the engine (block, head, water pump), but it can affect the soft parts, namely head gasket. The D17 engine was notorious for this. The stock head gasket would go bad over time if you didn't use Honda blue coolant. My main point is not all coolant is good for every vehicle and you should check to see what is compatible before you use it.
Comment: It still boils down to the liquid conforming to some standard, be it an internal Honda standard.


How can I print a variable with padded center alignment?

Question: How can I print $myvar padded so that it is in the center of the terminal, and to either side are = to the edge of the screen?
Answer: I found two pieces of information here on the stackexchange network that helped me arrive at this working answer:

https://stackoverflow.com/q/263890/5419599
https://stackoverflow.com/q/4409399/5419599

However the code in this answer is my own.
See the edit history if you want more verbosity; I've edited out all the cruft and "steps along the way."

I think the best way is:
center() {
  termwidth="$(tput cols)"
  padding="$(printf '%0.1s' ={1..500})"
  printf '%*.*s %s %*.*s\n' 0 "$(((termwidth-2-${#1})/2))" "$padding" "$1" 0 "$(((termwidth-1-${#1})/2))" "$padding"
}
center "Something I want to print"

Output on a terminal 80 columns wide:
========================== Something I want to print ===========================

Note that the padding doesn't have to be a single character; in fact the padding variable isn't, it's 500 characters long in the above code.  You could use some other form of padding by changing just the padding line:
padding="$(printf '%0.2s' ^v{1..500})"

Results in:
^v^v^v^v^v^v^v^v^v^v^v^v^v Something I want to print ^v^v^v^v^v^v^v^v^v^v^v^v^v^

Another handy use is:
clear && center "This is my header"

Comment: can you set the padding string as a variable?
Comment: @qodeninja the padding string *is* a variable in the code shown.  If you mean can it be hard coded as a literal long string rather than set using a fancy printf command, the answer is yes.  :)
Answer: With zsh:
$ var='some text'                                                              |
$ print -r - ${(l[COLUMNS/2][=]r[COLUMNS-COLUMNS/2][=])var}                    |
===================================some text===================================|

That both left-pads and right-pads with = to half the number of columns in your terminal. With the m flag, the padding takes into account the width of characters in case there are zero-width or double-width characters in $var.
With bash and GNU wc, you can do the same with:
var='some text'
width=$(wc -L <<< "$var")
printf -v pad "%$(( (COLUMNS - width) / 2 ))s"
pad=${pad// /=}
printf '%s%.*s\n' "$pad$var$pad" "$(((COLUMNS-width)%2))" =

Where we use GNU wc -L to get the display width of $var. If your strings will only ever contain single-width characters, you can use width=${#var} instead.
Note that in any case, those assume $var doesn't contain control characters (including TAB, NL, CR, colouring escape sequences, etc).
Answer: This proposition seems functional but implies that the terminal supports the terminfo capabilities cols, hpa, ech, cuf, and cud1, c.f. tput (1), terminfo (5), infocmp (1m).
#!/bin/bash

# Function "center_text": center the text with a surrounding border

# first argument: text to center
# second argument: glyph which forms the border
# third argument: width of the padding

center_text()
{
    local terminal_width=$(tput cols)    # query the Terminfo database: number of columns
    local text="${1:?}"                  # text to center
    local glyph="${2:-=}"                # glyph to compose the border
    local padding="${3:-2}"              # spacing around the text

    local border=                        # shape of the border
    local text_width=${#text}

    # the border is as wide as the screen
    for ((i=0; i<terminal_width; i++))
    do
        border+="${glyph}"
    done

    printf "$border"

    # width of the text area (text and spacing)
    local area_width=$(( text_width + (padding * 2) ))

    # horizontal position of the cursor: column numbering starts at 0
    local hpc=$(( (terminal_width - area_width) / 2 ))

    tput hpa $hpc                       # move the cursor to the beginning of the area

    tput ech $area_width                # erase the border inside the area without moving the cursor
    tput cuf $padding                   # move the cursor after the spacing (create padding)

    printf "$text"                      # print the text inside the area

    tput cud1                           # move the cursor on the next line
}

center_text "Something I want to print" "~"
center_text "Something I want to print" "=" 6

The following proposition is robust and extensible and clearer than @Wildcard's solution.
#!/bin/bash

# Function "center_text": center the text with a surrounding border

# first argument: text to center
# second argument: glyph which forms the border
# third argument: width of the padding

center_text()
{

    local terminal_width=$(tput cols)     # query the Terminfo database: number of columns
    local text="${1:?}"                   # text to center
    local glyph="${2:-=}"                 # glyph to compose the border
    local padding="${3:-2}"               # spacing around the text

    local text_width=${#text}

    local border_width=$(( (terminal_width - (padding * 2) - text_width) / 2 ))

    local border=                         # shape of the border

    # create the border (left side or right side)
    for ((i=0; i<border_width; i++))
    do
        border+="${glyph}"
    done

    # a side of the border may be longer (e.g. the right border)
    if (( ( terminal_width - ( padding * 2 ) - text_width ) % 2 == 0 ))
    then
        # the left and right borders have the same width
        local left_border=$border
        local right_border=$left_border
    else
        # the right border has one more character than the left border
        # the text is aligned leftmost
        local left_border=$border
        local right_border="${border}${glyph}"
    fi

    # space between the text and borders
    local spacing=

    for ((i=0; i<$padding; i++))
    do
        spacing+=" "
    done

    # displays the text in the center of the screen, surrounded by borders.
    printf "${left_border}${spacing}${text}${spacing}${right_border}\n"
}

center_text "Something I want to print" "~"
center_text "Something I want to print" "=" 6

Answer: To center text with bordering characters :
center() {
term_width=$(tput cols)
string_width=$(echo "$1" | wc -m)
# echo $term_width $string_width
padding=$(awk "BEGIN {print int(($term_width-$string_width)/2)}")
# echo $padding
len=$padding ch='='
printf '%*s' "$len" | tr ' ' "$ch"; printf "$1"; printf '%*s' "$len" | tr ' ' "$ch"; echo;
}

center " Something I want to print "

Output :
========================== Something I want to print ==========================

To print centered text with bordering lines :
center() {
printf '=%.0s' $(seq 1 $(tput cols))
echo "$1" | sed  -e :a -e "s/^.\{1,$(tput cols)\}$/ & /;ta" | tr -d '\n' | head -c $(tput cols)
printf '=%.0s' $(seq 1 $(tput cols)) | sed 's/^ //'
}

center " Something I want to print "

Output :
================================================================================
                            Something I want to print
================================================================================

Comment: `wc -c` counts the number of bytes, not the number of characters (for which you need `wc -m`) nor display width (for which some implementations have `wc -L`).
Comment: I tested both the scripts on Mac and Ubuntu Linux. They work pretty well and meets the requirement....
Comment: Thanks Stéphane Chazelas for the correction....
Answer: You can just do
WIDTH=$(tput cols)
WIDTHDIVIDED=$(($WIDTH/2)) # Solves "tput cols divided by 2"
clear
tput cup 0 $WIDTHDIVIDED # Puts the start of the PS1 at column 0 and the terminal width divided by two

Hope that helps.
Comment: Imagine the output string is 30 characters long on an 80 character screen. The first character of the string will be at position 40. To be centred it would need to start at character position 25. Also doesn't have the "_`=` either side to the edge of the screen_" requirement
Answer: Very similar to other answers, but I believe this is a POSIX solution as it prefers $COLUMNS over the non-standard tput cols:
text='unicode áåà string'

offset=$( echo "$text" | awk -vcols=${COLUMNS:-$(tput cols)} '{ start = (cols - length($0))/2; print start < 0 ? 0 : start }')
padding=$(printf "%*s" $offset | tr ' ' '=')
printf "%s%s%s\n" "$padding" "$text" "$padding"

Output
===============================unicode áåà string===============================

Strings with an odd length will leave a single space at the rightmost side of the terminal output. Strings with a length exceeding the width of the terminal will output with no padding.


What is the name for the tall concrete tower in the southwest of Paris?

Question: I don't have a picture of it, but there is a very tall round cylindrical building that looks like a giant vent because it doesn't have any windows except for some openings at the top. But it's not in the list of the tallest buildings and it's nowhere to be found. it's very tall and visible in the background of the Eiffel tower when looking from the center area. Can someone please let me know what this is? Thanks. https://en.m.wikipedia.org/wiki/List_of_tallest_buildings_and_structures_in_the_Paris_region
Comment: Do you mean the white cylindrical thing here: https://imgur.com/SXulv2o ?
Answer: If it's the thing shown in this screenshot from Google Maps, then it's the Cheminée du Front de Seine. It's a chimney from a steam heating plant.
Answer: In addition to previous answer, this site is operated by the Compagnie Parisienne de Chauffage Urbain, the chimney height is 130 m, it was built in 1970-71 (more info).


Help, I can't log in to my account

Question: I had an account on Social Sound Design and now when I try to log in, it wants me to create a new account. Why is this happening and what can I do to fix it?
Answer: What can I do?
This is a simple issue that can be quickly rectified by following the steps below:

Go ahead and create a new account using whatever authentication service you were using previously. Make a note of the profile URL - you can get to the new profile by clicking on your user name at the top of the page. Keep this handy.

Locate your original profile URL, if you don't already know it. You can do this by going to the users page and entering your user name. Keep this handy as well.

Contact Stack Exchange and provide them both links, and indicate that you can no longer access your account and have made a new one.

Wait for a short while, you'll receive a reply indicating that you can now access your account. We try to process these as soon as they come in during the transition and we have overlapping coverage in many time zones.

Please, use the link to contact the team directly as that's where they're monitoring for requests to fix this issue. If you post here, it might be a while before someone from the team sees your request.
Why did this happen?
This happened because OpenID is handled differently on the Stack Exchange 2.0 platform than it was on the 1.0 platform. Your account is still fine, we just need to fix your credentials.
How do you fix this?
By asking you to create a new account to merge with your established account, we ensure that you'll log in properly using the same credentials that you've always used. Once done, it will be as if this never happened, and no remnants of the temporary account you created for merging will remain.
Answer: I was struggling with this as well, but I ended up just clicking the 'forgot my password' link.
Put your e-mail address that you used for SSDv1 and they'll send you a link. Click that link and they'll ask for a new password. Once you've entered your new password you'll be able to log in without waiting at all - all done within 15 mins or so.
Hope this helps!
Comment: Awesome Fred! Thanks :) This works if you used Stack Exchange as your OpenID provider on the 1.0 site - if you used Google / Yahoo / Facebook or another provider, you'll probably still need to contact us to sort it out.

Help, I can't log in to my account


SharePoint Online: Is it possible to have an announcement from a team sub-site published to all sub-sites?

Question: 1st Post-
    My question is something that I am trying to resolve. I am a "sharepoint newbie" and I am a Network Technician by trade, so I am out of league. I have created Team Cite for my organization with sub-sites for each department. As part of this, I have created a Site Wide Announcement App, that I duplicated on all of the sub-sites. The announcement needs something that I could have certain users be able to add/edit and could "pushed" to all of the sub-sites quickly and easily. The need is to be able to get out word that an organization event is occurring, meeting or an emergency, etc... Is there any way to do this?
Answer: Usually in SharePoint you do the other way around, any department writes their own announcements in their own sites or subsites and they are all collated together on the main page of the intranet via content search web part, content query web part or search results. This saves up time and effort since it is a consolidated way that has been around for a decade.
If you want to keep your scenario as it is and not follow what is the most common way to disseminate news based on what I wrote above, you should put a content search web part in every site that has basically the same settings (which is to retrieve announcements from anywhere or announcements tagged in a certain way - details of the query will be up to you)
Comment: I am sorry for not replying to this right away. How do I do the latter? How would I configure a department site to be able to create and publish Announcements to the remaining department sites? I have been trying to find this on my own, have come up empty. Thanks
Comment: I repeat this is not the most common sense approach. You create an announcement list (only one). You follow a good guide about the content search web part (http://www.sharepointnutsandbolts.com/2013/03/displaying-right-data-in-content-search.html - in your announcement list the image is optional) and you place in every other site you want the news to be displayed in, the content search web part, note that they have to be configured one by one with the same details inside.


Are there any good brute force programs in C#?

Question: I'm planning to research & learn from brute force methods, but all the popular ones I found like John the Ripper or hashcat are written in C & OpenGL which I don't have much knowledge about so far. Can anybody recommend a decent brute force program written in C#, if it includes source code that would be nice.
Comment: Interesting question. C# would probably be a poor choice for a brute force application because of garbage collection, and to use GPU you'd probably need to marshal across to unmanaged libraries. That would be quite slow. C is the language of choice for this type of application because speed is critical for effectiveness.
Comment: In it's simplest form, a brute force attack would just be a while loop, testing variations on input. Beyond that, it gets much more complex depending on the system you are attacking. I don't have a recommendation, but you might want to just learn to use the tools and why they work before trying to reverse engineer them.
Comment: yeah i learn about that recently but i barely knew C or OpenCL for the moment. Is there any specific document instruct you how to write a brute force program in C?
Comment: What specifically are you trying to learn about brute force methods?
Comment: @user52472 there're two key method i like to learn; generate, hash password & check them with hash list, both as fast as possible. I did write some small project but never check the hash result in one second when lots of program can do so
Answer: I don't know any particular brute force in C#, but having worked in both C and C# (and inferring that you know C# from your question) I think with a good reference you should be able to jump into C. You will of course need to be very careful with garbage collection (malloc, etc.) and it will require learning procedural vs. object oriented coding but it's doable.
Here's a good thread: https://stackoverflow.com/questions/4002442/learning-c-from-a-background-in-c-sharp
One of the recommendations is The C Programming Language which is a classic. For something much lighter and very funny I'm a fan of Dan Gookin's C for Dummies which is light but still informative.
Good luck!
Comment: You are asking him to learn C language. OP asked for recommending a brute force program. Normally this forum is not suitable/allow for recommendation and your answer is very generic. You should have mentioned fuzzy testing/buffer overflow, etc.
Comment: That's true, but in the follow up comments, and perhaps I should put information in there, OP talked about writing a program in C which is why my answer contained the information it did. Thank you very much though for the feedback and I'll keep trying to improve my answers! Cheers!


Workflow question and advice [uv-mapping, modular or singular build?]

Question: Now that i have just recently been able to wrap my  head around uv-mapping i don't see it to be sensible to build a complete structure like this one [inside & out] and then try to un-wrap it. So would it be better to build in pieces un-wrapping as you go? and piece it together when complete, then import?. How would you pros go about building a enter-able structure such as this stave church i'm building. It's the church from netflix's show DARK. A must see BTW.
Comment: It is more manageable to unwrap the pieces as you make them.
Comment: It depends on a lot on your workflow, how close are you going to be to the object when rendered ? do you want to use it in a cinematic animation or realtime in a video game ? etc
Answer: I think you ask mainly what is answered on this post which is relevant because it describes when you need different textures and uvs :
Texturing each object separately VS all in the same texture file
generally there is no any rule but it is a common practice to keep things separated depending again on their final usage (gaming, archviz, animation etc), it is more a combination of scale, complexity and purpose.


If your app requires an email address to register, but you also allow registration via FB, what if FB doesn't return an email?

Question: Our registered users must provide an email address. However, if they register via FB, sometimes that does not return an email address. So the question is, what is the best method to collect that email address after registration?
Answer: I would simply ask the users. Once you discover that their email address is missing, show a message like this upon their login:

Please, complete your profile information by providing your email address and enjoy the full experience of our service.

Then it's up to you whether the email address is a requirement to use the service or only the addition.
Answer: Can you not check on the fly when they are registering?
When people are registering using fb, your db gets all the fields name, email id etc. Put a logic if DB is not getting email id, show rest of info + email id or only mandatory email id field on screen (let users know why it is valuable for them to provide email id.

It's not easy to get users attention to provide email id after registration.
Answer: It seemed that you are using FB data to fill your own registration form. Anyways this is good practice to show such form with Submit button to give user possibility change anything he wants before registration. So, you need not do anything special because you are processing your form in usual way - it alerts on email if this is required field for your registration form.
Comment: Hmmm. That would resolve the "no email" problem. But I think many users would find the extra click an annoyance. I don't know if I've seen what you're suggesting implemented.
Comment: You may not display this form if everything is good with data. But the other thing is - you are asking *what is the best method to collect that email address _after_ registration*. Does it mean that registration could be done without entering email? If so, then it is about not completed user profile. So you may allow user to login and then ask to complete profile by entering email.
Comment: Actually, I misstated that. Registration on our site is not complete until the user provides an email. They need the email to login.

We're debating between showing the whole populated form (name, email, password) or just a form asking for email. I think we're gravitating toward the latter.


Learning AI, Machine Learning, Deep Learning

Question: I am a recent college graduate with a bachelors in computer engineering. I am very interested in deep learning however someone had mentioned to me that I should learn machine learning before I learn deep learning. Is that true ? And if so which online course would you recommend I start at ?
Comment: I voted to close this question because it is entirely based on opinion. However, I would suggest Andrew Ng's Stanford course. It is a very good start. Then you should look into the algorithms that further interest you through tutorials or academic papers.
Answer: Bascially this is true. Deep Learning is kind of like stacking your machine learning algorithms on top of each other. Have a look here and the associated picture.


Php5 - Unicode string length

Question: I need to get correct length of unicode text getting via HTTP Post/get.
"हेल्लो स्टैक ओवरफ्लो"
When I set a browser's character encoding as Unicode, then
mb_strlen($text) gives me correct length of unicode string which is 20.
But when I submit form with browsers encoding as 'ISO-8859-1', it behaves oddly.
mb_strlen($text) gives me byte length of unicode string which is 128, which is wrong and also
mb_detect_encoding($text, "auto") returns me ascii.
while
mb_detect_encoding($text, "UTF-8") returns UTF-8.
I need correct length of unicode text, irrespective of Browser charset.
anyone can help me sovling this problem?
Regards,
Sandip
Answer: ISO-8859-1, aka the Western European character set, refers to the extended Roman alphabet, which does not include the characters you specified above (is that Hindi? I'm not so well-versed in such languages). The mb_detect_encoding call will not detect your encoding, because you mangled the characters into ISO-8869-1, which doesn't support the characters you gave it.
You should specify an encoding that supports the character types that you need to display. UTF-8 would probably be your best bet. You can explicitly set the encoding in your HTTP headers using the Content-Encoding header. You can also repeat this in a meta tag in your HTML for maximum support.
Comment: Addition: When the *browser* is set to send ISO-8859 encoded content and attempts to send content that cannot be encoded in that encoding, it usually turns the unencodable characters into HTML entities. That would be the reason the strings become rather long.
Comment: Just use UTF-8 or UTF-16 encoding everywhere. Set it in the `Content-Encoding` header and a `` tag.
Comment: True. When encoded as HTML entities, you're going to get something like `ካ` for each character. That's at least eight bytes instead of (potentially) two.
Comment: yes its in hindi, I am working with chinese text actually. any solution? I dont have control over browser as I dont want to teach all customers to set their browser charset.
Answer:
I need correct length of unicode text, irrespective of Browser charset.

You can't know the length if you don't know the encoding. A string of bytes may represent a different valid string in different encodings at once. mb_detect_charset gives you nothing more than an unreliable guess.
There is a sneaky way many modern browsers support for them to tell you what encoding they have used, which is to include this hack (originating in IE) in the form:
<input type="hidden" name="_charset_"/>

You'll then get an encoding name submitted in that field, which you can theoretically use to mb_convert_encoding a string you have received to UTF-8 for further handling. You definitely want to keep all your strings in a single encoding in your scripts, only converting to other encodings at the input/output ends where necessary; it's very unpleasant trying to keep track of byte strings in arbitrary encodings.
However you can't convert a ISO-8859-1 string containing हेल्लो... to UTF-8 because ISO-8859-1 can't contain those characters. Your data have already been corrupted as described by deceze: when you submit form data in an encoding that can't contain the characters, the browser escapes them using HTML &#...; character references. This is a lossy conversion that you can't accurately recover, because you can't tell the difference between these escapes and actual ampersand-hash sequences the user originally typed. Never rely on this long-standing but quirky and undesirable behaviour.
In general it's really much better just to ensure that the form submission always comes in using a known encoding that covers all the characters you are likely to want. That way you don't have to worry about conversion, or whether there has been any character-reference-mangling. The only sensible encoding to pick for this purpose is UTF-8. (UTF-16 has some browser problems apart from being generally less efficient.)
Browsers submit forms using the same encoding that they used to display the page, so use the Content-Type: text/html;charset=utf-8 header and/or <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> equivalent to specify the page encoding, rather than letting the browser guess. It will then use that encoding for the form submission too.
The only remaining wrinkle is that if the user deliberately overrides the encoding of the page with the form in, you'll get the wrong data submitted. This is very unlikely to happen unless your page is already broken, so usually it's not worth bothering with.
If you want to cover that possibility you can set the attribute accept-charset on the form. However! This doesn't work right in IE, which only treats accept-charset as a fallback suggestion for when it has form data that doesn't fit within the page's natural encoding. If you want to ensure you get UTF-8 even in the face of the user changing the encoding to something else, you'd have to include some data in the form that can't be encoded in any of the other encodings the user is able to pick. The traditional way of doing that is:
<form accept-charset="utf-8">
    <input type="hidden" name="unicodesnowman" value="☃"/>
    ...

Php5 - Unicode string length


What is the proper way to cook a hamburger on a Pit Barrel Cooker that doesn't result in fast cooking taste?

Question: I have a Pit Barrel Cooker. I have made hamburgers on it before but I keep running into several issues.  When it comes to anything else, brisket, ribs, chicken, etc. everything turns out great! But hamburgers, even with the provided online videos, my burgers always come out like I just fried them on the stove.  I try to regulate the heat by closing the circular air vent on the front but then my fire dies down too fast and it doesn't seem the burgers are being cooked properly. I use 80% ground beef and my burgers also always shrink up like crazy.  Does anyone have a proper method of using the Pit Barrel Cooker to get slow cooked, bbq tasting burgers?
Comment: There isn't a point in slow cooking burgers -- they don't have enough connective tissue to break down to make it worth while and will likely dry out if you try a slow long cook. On a grill, you normally do a 2 zone fire, start with the hot side, get the browning, and if its not done to your liking with that, move to the cooler side to finish.
Comment: I haven't used the pit barrel, but I'm just pointing out the fact that burgers are an innately fast and hot cook unlike brisket or ribs due to being small ground up meat from mostly more tender areas. You don't have the time to get smoke flavor on a burger.
Comment: @Batman have you used a Pit Barrel Cooker? I'm just trying to get burgers that aren't shrunken flash fried pieces of meat. Besides, I know your game, you just want me to try something on my cooker that isn't possible so you can sneak up on me and take me back to Arkham.
Comment: One point of a 80/20 burger is to try to keep in some of that moisture (fat).   Slow cooking will defeat that pretty much every time.  It may sound backwards, but if you are intent upon trying slower cooking, then try a leaner grind,  20% is usually fat added and the added fat will melt and be lost fast, while the leaner meat sometimes has more chance of retaining a little bit of the fat content it had.  The method Batman is suggesting, to try to sear the burger to seal it then slow finish to pick up more flavor it a shot but your particular set-up may not allow that.
Comment: If you're running a thick patty, reverse searing might be a good shot too -- start indirect finish direct.
Comment: @Batman that is helpful advice, how can I do this on my Pit Barrel Cooker? The heat sort of travels up the drum so I'm not sure how to get indirect heating of the burger. Any specific tips?
Answer: There is no method because you cannot do it. Ground meats lose moisture rapidly when cooked as much of the fat is not contained within the meat itself, but mixed in. This mixed in fat melts rapidly and runs out. The fat that is marbled within the meat itself is lost faster as the ground strands have much more surface area. Therefore, if you cook a burger low and slow it will end up dry.
Slow cooking and long roasting is only good when a piece of meat has enough marbled fat so it will still be juicy when cooked, and a low surface area to slow moisture loss (ie it's fairly big). Burger cooking on the other hand is a race to get a good crust and to the right temperature before losing all moisture.
As for shrinking up this is normal for burgers and you cannot prevent the process from happening. You can, however, shape them flatter and thinner to compensate. I make a flat, thin-ish burger patty, then I use my palm to make the middle slightly thinner than the outside. The result is a burger that has the right shape after cooking. If you start with a thick burger patty you'll more often end up with a meatball shape at the end.
Answer: Use a coarser grind, make the patties larger, and cook at a low temperature (no more than 225f). Temperatures can be difficult to regulare with such a small amount of food in such a large cooker. You will want to put the burgers as far away from the fire as possible, and you will need a big thermal mass like a very large pan of water to try to regulate and normalize the heat. Finally, while you have not specified your cooking conditions, my gut tells me you are cooking your burgers for far too long. Try 45-60 minutes.
It is possible to make good smoked burgers, you just need to adjust for the variables that will cause your poor outcomes, starting with what I have suggested above.
Comment: Although this is a helpful answer for general guidelines, I'm looking more for something that deals with the Pit Barrel Cooker or at the very least a customized drum cooker that stands upright.  Everyone frustratingly seems to think this is impossible to make a burger with that cooked-in bbq taste. This isn't true because I know of people who slow cook/bbq burgers and they don't turn out dry or small.  The only problem is they don't use a Pit Barrel Cooker. I'm not necessarily looking for slow cooking, just that it tastes like a bbq hamburger and isn't the size of a sausage patty.
Comment: What do you define as "bbq taste" and "slow cooked"? Have you asked them how they do it? (I'm guessing that if there is smokey flavor, its liquid smoke)
Comment: Everything in my answer would be equally applicable to a drum smoker as any other. Especially the part about regulating temps with a large thermal mass. I think you need to better understand the concepts involved with barbecue a bit better before moving to advanced topics such as this one.
Comment: @SeanHart I'm not trying to question your methods, just want specifics to my cooker. I can use a pan of water, but that would cut my cooking area down quite a bit if I placed on the cooking grate.  So do I need to do something clever with the placement of it? I can also use the rebar to regulate temp as well, but do I use both or just one? Or maybe someone uses strictly wood (with just a small amount of charcoal) in their Pit Barrel Cooker, to avoid the additional heat that charcoal provides, but then I may oversmoke the burgers. I actually like your answer but need specifics.


Why is the tenor low in this arrangement of Silent night?

Question: I found a video with the tenor line to an arrangement of Silent night.
The tenor is found in this video:

It is a low tenor line. I would even sing up to F4 or even G4 if I sang the melody as a solo piece. Is there a good reason why the tenor line is not higher?
Shouldn't tenors sing higher notes in a choir?
Comment: If you want that the tenor can sing higher you can transpose the last phrase an octave higher by all tenor voices or you can change the pich 2-3 semitones higher.
Answer: The answer is simple: this is a low-pitched hymn arrangement in general.  It's very similar to this one, though the last couple measures of the tenor line are varied.  This is a very old arrangement of "Silent Night" found in many hymnals, and typically pitched in B-flat.
Note that the soprano is very low for most of the song, going down to a low B-flat (also unusual for soprano).  Trying to fit alto and tenor parts below the melody (where they almost always are in hymn arrangements) means that the tenor line is necessarily lower in its range for this setting.
Also, note the general character of the setting, where the soprano and alto move in thirds much of the time (probably to mirror the hymn's simplicity, which was emphasized in early years and in its origin story).  The bass is mostly just doing chord roots.  The tenor line therefore must fill out the other note of the chord when necessary, and given the low range for the women's voices, it's often at the highest note it could be to allow the women to sing in simple thirds or sixths.
There are only about two places in the whole hymn where the tenor line could potentially go much higher while still filling out the simple chords.  (1) First would be on "virgin" and "infant," but the arranger here chose to create a nice voice exchange between the melody and tenor line, which also leads smoothly back to the B-flat of the opening motive.  (2) In the first "Sleep in heavenly peace" all the upper voices could be moved up together, but the arranger of this standard version decided (with good reason) to vary the texture a bit and move to an "open voicing" structure with the chords after all the parallel thirds in the soprano and alto for the previous four bars.  The tenor does get its highest note there anyway still.
I'm not sure why this is any great mystery.  It's a low-pitched hymn because it's meant to be sung quietly (Silent Night) usually late on Christmas Eve in a dark church.  The melody and alto are already pitched low, making the tenor squeezed in about as high as it could be with the women's voices in their positions.
Comment: You can sing G4 with a very light head voice if you are a good tenor. It is really nice.
Comment: I think Gösta Winbergh really hit the G4 without disturbing the feeling of the tune. https://open.spotify.com/track/57UAqJo6lycx04iBuqzhwe?si=vw0n-T3wTyWGZGvquuxSQA
Comment: @Hank: I didn't mean to imply that *skilled singers* can't sing high notes very quietly and pleasantly.  As I mentioned, this is very similar to a traditional hymn arrangement for *congregational* singing that dates back a long time.  All the notes in all parts are relatively easy to reach for just about all men and women.
Comment: You can at least sing your own voice/line. I cannot sing soprano (melody) kn Bb as I do not have that low voices need for the extremely low Bb. It is very diccifult to sing for me as an untrained singer.
Comment: Simple answer: it is written for baritone who sing tenor lines.
Answer:
Silent Night is a popular song and the melody of the Soprano is quite high, this means it has a wide range (almost 1 and a half octave!) and ends on the lower root note. If so the 3rd has to be in the Tenor, if the setting wants to avoid an voice crossing of the Alt-).
Woman voices in congregations or school classes of today are not used
to sing higher than Eb'' of F'', (the same with male voices of men
that are not singing in a choir) while male voices (also tenor range) normally don't have problems to sing in this range of your copy.
Even a "normal" tenor singer (with classical voice training) would be able to sing this d of the final chord. But I agree with you: An arrangement for a professional choir could  be in D major.

I would even sing up to F4 or even G4 if I sang the melody as a solo piece.

(maybe a major 3rd higher you couldn't have sung the melody)
As you can see: d is in the range of the tenor

https://en.wikipedia.org/wiki/Voice_type
Comment: It is actually in Bb so the soprano is pretty low. It would expect a soprano to sing it in D without any problem at all. It is very low since people at church are untrained and cannot deal with head voice.
Comment: That-s what I meant to say. In D that highest note would be G and in a church (especially at Xmas there are grandparents and elder who wouldn't reach this pich. (I have it in the ear -memory how the old men are singing the last phrase unisono an octave lower.
Comment: One octave down is pretty cool
Answer: Just because tenors can scream top C's (or like to pretend they can, even when they can't) doesn't mean the result is musically appropriate in every song.
For a quiet piece like "Silent Night" is it perfectly reasonable to stay in the bottom half of the range throughout.
The range chart in another answer is misleading. Most "tenors" in amateur choirs (who might really be baritones in any case) are not comfortable above about A4, And writing even an A4 at any dynamic level less than "f" would be asking for trouble.
Top Cs are best kept in captivity in an opera house, and not allowed to run wild in the outside world :)


2009 4,1–5,1 Mac Pro Upgrade Only Shows 1066 on RAM. NVRAM Reset Didn't Work

Question: So I just finished my 4,1–5,1 build. I installed a pair of X5675's along with two sticks of Samsung 16GB DDR3,4RX4 PC3-10600R 1333MHz 240-pin ECC REG Server Ram, for 32Gb. Trouble is, it's showing up as 1066 instead of 1333.
Now, the machine is running fine, but I'm curious as to why my memory isn't showing full speed–I triple checked the specs on that RAM before I bought it and thought it should work, and it does, but not at 1333. Tried zapping the NVRAM, to no avail. Anyone have any ideas?
Comment: I had the same problem.
Try zapping P-Ram. OK
Comment: The OP literally said, in the title of the question that the NVRAM reset didn't work.  Also, PRAM is for PPC Macs and NVRAM for Intel Macs
Answer: I can't find out what actually decides it, however I just noticed this note on the Apple KB - Mac Pro (Mid 2012 and earlier): How to remove or install memory

Note:   Although the memory speed of the UDIMMS is 1333 MHz, they will
  operate at 1066 MHz or 1333 MHz depending on the processor in the
  computer.

Typically, MacPro5,1 models with one of the Nehalem processors only support a memory speed of 1066 MHz, while those with one of the Westmere processors support a memory speed of 1333 MHz. In your case, the X5675 processors are one of the Westmere variety, so I can't explain the discrepancy in speed.
I have a pair of X5690 in mine & RAM runs at 1333MHz.
It's probably worth making sure you have the pair in the correct places, just in case...

BTW, the Pros run fastest in triple channel - so if you can afford one more RAM stick...
Comment: OK! Great info! I'll try all that! Thank you! Yeah, I'm planning on getting more RAM for sure, amybe as high as 96, which will be 6–16Gb sticks–get the most out of that triple channel function!
Comment: Hi, I just updated the firmware of my 2009 (4,1) mac pro to 5,1. I tried to swap out the dual processors for 5690s. I have 32GB of 1066 DDR3 ram, but after I upgrade the processors, the memory does not seem to be recognized (steady flashing white power LED). Do I HAVE to use 1333 RAM if I upgrade the processors to 5690 or can I just use my old RAM?
Answer: It is known that 4rx4 modules does not work properly on Mac Pro, and when they work they do at 1066Mhz.
The recommended modules are 2Rx4, in fact, they are faster on terms of latency


Skull of which animal ist it?

Question: Hi someone found this skull in ancient city of iran I'm just curious to find out which animal belongs this skull?
Comment: Welcome - if you think that I have given the correct answer, use the check (tick) mark next to my answer to indicate that.
Answer: This will be one of the two-toed ungulate mammals (Artiodactyls), I think one of the smaller ones, probably in the family Bovidae, which includes the antelopes and goats as well as cows and sheep.
Furthermore, because the laws of frequency tell us that it is rare to come across a rare species, therefore this is most likely to be a common species. So, what species are common in Iran, that have two horns curved gently towards the back of the skull?
Goat (Capra hircus) or sheep (Ovis aries) are the most likely animals, though I lean towards goats in this case because of the shape and position of the horns.
Comment: Having had many goats (of several breeds) and having to guard my rear around some of them, that was the first thing I thought of when I saw that partial skull.

Skull of which animal ist it?


How to deal with a dishwasher height issue without tearing out cabinetry when installing flooring?

Question: The house I purchased has nice new cabinetry and counter tops but cheap flooring.  We plan to install 3/4" wood flooring (already purchased) but learned that installing the flooring would make it so we can't get our dishwasher out, if it were to leak or fail (the legs of the dishwasher are almost all the way up).  It seems that we would need to remove the cabinetry and raise it to solve this problem.  But how well will the cabinetry go back together and can the counter tops (granite) be salvaged? I imagine it won't go back together just as it was.  Are there better ways to solve this problem?
Comment: Pictures are always helpful.
Comment: What kind of counter top? Cabinets come out easy, and it's the only right way to do it.
Comment: The counter top material is granite
Answer: Can you keep a section of wood flooring separate in front of the dishwasher? Or, if the floor boards will be parallel to the front of the dishwasher, you would just have to remove a few of those to get the dishwasher out. ( Keep extra floor boards in case you damage the originals and need to replace them?)
Just an idea.
(Never done this or seen it done.)
Comment: Seen this work successfully in an old student flat I lived in. Two sections had the tongue removed so they could be pried up. They were tight enough they didn't move in normal usage.
Answer: This is not going to be easy. Because you have Granite, you run a risk of breaking it when you remove it. If you must remove it, I would try to get an installer that would assume responsibility of the removal and re-installation.
Can the dishwasher be relocated? Perhaps in an island? A base cabinet can be added to where the dishwasher was.


No article with president

Question: If I were president...
Why don't we have article "a"  before "president"?
Thank you!
Answer: This is what "Advanced Language Practice" by Macmillan says about it:

Of course, since "president" is a countable noun, we can say "a president" (She is a president and he is a doctor). Note that we use "a" before "president" just like before any other singular noun when we are talking about a job, occupation:

If I were a teacher, I would work with children.
If I were a builder, I would have to be physically strong.
If I were a president, I would probably feel stressed out.

When we talk about being the political leader of a particular country (and it's a unique title for that country, that is there is only one president in that country), we can use "the" or we can omit it (see the explanation of "Advanced Language Practice" above).
Therefore, "If I were President" = "If I were the President."
But "If I were a president" is just different. It's like "If I were some president."

No article with president


Can alkenes have triple bonds?

Question: Or is it characteristic of alkynes only ? also, can they (the alkenes) have double and triple bonds in the same molecule ?
Comment: If it has a carbon-carbon double bond and a carbon-carbon triple bond the molecule is both an alkene and an alkyne.
Comment: [Alkenes in the IUPAC Gold Book](http://goldbook.iupac.org/html/A/A00224.html)
Answer: A compound containing both a C-C double and triple bond is both an alkene and an alkyne. This is readily apparent in such a compound's systematic name, which will be something like alk-#-en-#-yne. Such a compound can be referred to as an enyne, or (equivalently) alkenyne, especially if the bonds are conjugated.
Answer: Alkenes can have triple bonds but, they should be between carbon and any other hetero elements and not between carbon and carbon. Otherwise, the compound ceases to be an alkene.
Feel free to correct me if I am fallible.

Can alkenes have triple bonds?


Shall I enable 'send all traffic over VPN' on my Mac?

Question: I want my Mac to be as secure as possible, but I don't know if the send all traffic over VPN option is safe or not. Please can someone explain if it is more secure to enable it or not.
Answer: This depends upon what threats you are trying to mitigate against.  By using a VPN you are essentially changing then end point of you traffic, or where it connects to the Internet.  If you are using an insecure WiFi connection this will encrypt and thus protect all of your traffic that traverses the wireless network.  This is significantly more secure then passing all of your Internet traffic over and open/insecure network.  However you are only moving the "on ramp" that you are using to connect to the Internet.  If you are concerned with your Internet Service Provider monitoring your connections to particular networks this is also a good technique to use.  Using a VPN will not however give you and end to end secure connection, so if you are using insecure protocols such as HTTP or email in plain text then you are just as insecure once that traffic reaches the public Internet.  Using a layered approach including multiple layers of encryption both at the protocol level and at the network level (VPN) afford you the most security.


Exercises to Counter act muscluar imbalances

Question: I have overdeveloped quads, which has affected my knees, what are some exercises that will help counteract this imbalance?
Answer: Patellofemoral pain syndrome is a fairly common complaint from cyclists.  You really should consult with a medically-trained therapist, but straight leg lifts, oddly, are a good place to start.  (Lay on back, hold leg straight, lift without bending knee.)
Answer: First, you should really consult with a sports medicine doctor. That's the only way to truly diagnose and evaluate the best way to correct the specific problem that you're having.
That said, this problem is usually a result of a combination of over developed quads, as you suspect, and also a lack of flexibility in your hamstrings. Any hamstring stretch will most likely help, over time.
Try seated and standing toe touches, downward facing dog, and those seated one legged stretches where you  reach for one foot while the other is folded in. You'll find plenty of other stretches if you do a search for "hamstring stretches."
Most importantly, don't push it. Gaining flexibility takes time more than effort. Pushing is actually counter productive. Just do the stretches gently and trust in time to do the real work for you.
Comment: Should you try toe touches, remember to bend your hips only, keeping the back straight. Looking one metre in front of your feet (if standing) or looking at the ceiling (if sitting) will help you keeping the spine aligned. Arching your back doesn't improve the stretch as much and damages your spine as an added bonus. More importantly: stretching is not at all about pain/endurance. It is about taking your time, relaxing and tiring the contraction reflex.
Answer: Like the other two state, consulting a specialist first is a good idea.  If there truly is something wrong (not just minor inflamation) you'll save yourself a lot of time and headache by getting an early diagnosis.
That said, tTreatment largely depends on the factors that have caused the pain.  Are you a power lifter or someone who runs 80 miles a week?  Do you lift heavy things at work all day?  Are you arthritic?  The first step is to identity the activity\ailment that has caused the pain and either stop the acdtivity completely or cut back drastically.
After that, begin strengthening and stretching the hamstrings and quadriceps by way of low weight high rep exercises.
Here's a link to some hamstring exercieses that I swear by:
http://www.trainwithmeonline.com/Exercises/Fitness/Videos/Hamstring/Medicine-Ball
Comment: Note that the usual problem with patellofemoral pain syndrome is that unequal tension is pulling the kneecap off-center.  One can guess at which muscles are involved and give the "usual" therapy, but medical evaluation is *really* required to be sure, before one exacerbates the problem by exercising the wrong muscles.
Comment: Agreed.  It's difficult (impossible really) to answer questions like this without (1) being a professional in this area and (2) being able to diagnose the specific cause of the pain.


The difference between the Bayes Classifier and The Naive Bayes Classifier?

Question: I'm trying to find the connection between both classifiers. In NBC we assume that all the features are independent of each other so we can calculate the posterior probability easier. I assume Bayes Classifier is more complex but how is the process different from NBC?
Answer: Naive Bayes assumes conditional independence,
$P(X|Y,Z)=P(X|Z)$, Whereas more general Bayes Nets (sometimes called Bayesian Belief Networks) will allow the user to specify which attributes are, in fact, conditionally independent.
There is a very good discussion of this in Tan, Kumar, Steinbach's Introduction to Data Mining textbook. They also have instructor powerpoint slides: Tan, Steinbach, Kumar - Introduction to Data Mining - Lecture Notes for Chapter 5 - Data Mining Classification: Alternative Techniques which should give an example of this assumption and why it can be flawed.
Comment: First off Thank you for answering. I don't access to Steinbach's Introduction to Data Mining textbook. The In the slides page 52-53, the author skips presents the Naive Bayes Classifier as a way to maximize the likelihood $P(C=c|X)$. I know how NBC works, I wanted to know how we would maximize the posterior without NBC. You said Bayes Nets requires the user to specify dependence, how would this look like written more formally?
Comment: It's a much much much more complicated model. Wiki Bayesian network gives much detail
Comment: @ShainaR I want to clarify my understanding: Lets say I have a training dataset $x_1 = 1, y_1 = 0, z = 1$, $x_2 = 0, y_2 = 0, z = 1$ so that means $P(z = 1 | x = 1, y = 0) = 1/2$ and if my test data is $x_3 = 0, y_3 = 1$, that means $P(z = 1 | x = 0, y = 1) = 0$?
Comment: P(z=1|x=1,y=0) = p(z=1) * p(x=1|z=1)*p(y=0|z=1) = 1 * 1/2 * 1 = 1/2
P(z=1|x=0,y=1) = p(z=1) * p(x=0|z=1)*p(y=1|z=1) = 1 * 1/2 * 0 = 0
Yep. If you're looking at that saying "how silly to predict a zero probability," you're right -- there is something called a Laplace/Lidstone correction/smoothing that you can implement so that you don't predict zero probabilities in cases like this..
Answer: How would a "non-naive" Bayesian classification work?
Each record is classified as:

Find all records that have exactly the same features
Determine what class of those records is most common
Assign the most common class to the record

Problem: if there are many features, it is unlikely to find records that match exactly the same features.
Solution: Naive Bayes classifiers compute therefore the probabilities of each feature occurring in a class independently.
Answer: For the Bayesian network as a classifier, the features are selected based on some scoring functions like Bayesian scoring function and minimal description length(the two are equivalent in theory to each other given that there are enough training data). The scoring functions mainly restrict the structure (connections and directions) and the parameters(likelihood) using the data. After the structure has been learned the class is only determined by the nodes in the Markov blanket(its parents, its children, and the parents of its children), and all variables given the Markov blanket are discarded.
For the Naive Bayesian Network which is more well-known nowadays, all features are considered as attributes(all attributes are part of the class variable Markov blanket) and are independent given the class.
Bayesian networks and naive Bayesian network have their own advantages and disadvantages and we can see the performance comparison(done on 25 data sets mainly from the UCI repository) as depicted below:

We can see that there are some points below the diagonal line representing the Naive Bayes performs better than the Bayesian Network on those datasets and some points above the diagonal line representing the reverse on some other datasets.
Bayesian Network is more complicated than the Naive Bayes but they almost perform equally well, and the reason is that all the datasets on which the Bayesian network performs worse than the Naive Bayes have more than 15 attributes. That's during the structure learning some crucial attributes are discarded.
We can combine the two and add some connections between the features of the Naive Bayes and it becomes the tree augmented Naive Bayes or k-dependence Bayesian classifier.

References:
1. Bayesian Network Classifiers


External semidirect product application

Question: I am trying to find all normal subgroups of $\mathbb D_n$. I've read here Normal subgroups of dihedral groups that one could show the external semidirect product $(\mathbb Z/n\mathbb Z) \rtimes (\mathbb Z/2\mathbb Z) \cong D_n$. I've just read about semidirect products and I am pretty lost on how could I define the semidirect product and then show it is isomorphic to $\mathbb D_n$. I would appreciate a proof or suggestions to show this and I would appreciate if someone could tell me how this result could be used to find all normal subgroups of the dihedral group. Thanks in advance.
Comment: So the first thing you need is the normal subgroup $\mathbb{Z}_{n}$. Can you think of an element of order $n$ in $D_{n}$? Next you need a subgroup of order $2$ generated by some suitable element of order $2$. Finally you need these two elements to generate $D_{n}$. This should be reminding you of something in the manner in which $D_{n}$ is constructed. Finally, to get the isomorphism of $D_{n}$ with the semidirect product of these two groups, you can apply the Recognition Theorem.
Comment: Read [this](http://www.math.uconn.edu/~kconrad/blurbs/grouptheory/dihedral.pdf) and [this](http://www.math.uconn.edu/~kconrad/blurbs/grouptheory/dihedral2.pdf) for more about Dihedral groups.
Comment: It is not clear what you are asking. If you are asking for help with trying to find the normal subgroups of $D_n$, then look at the answer by Dietrich Burde to the linked question. For this puirpose, it is not particularly helpful to think about $D_n$ as a semidirect product. It is easier just to think of $D_n$ as the group of symmetries of a regular $n $-gon.
Answer: This is only a partial answer, because realizing $D_n$ as a semidirect product doesn't help us find all the normal subgroups in certain cases (for example, if $n$ is a power of $2$). To make the notation a little clearer, I will write $\Bbb Z_n$ and $\Bbb Z_2$ additively.
We have the homomorphism (monomorphism, actually): $\phi: \Bbb Z_2 \to \text{Aut}(\Bbb Z_n)$ given by:
$\phi(0) = \phi_0 = 1_{\Bbb Z_2}$, the identity automorphism;
$\phi(1) = \phi_1 = \text{inv}$, where $\text{inv}(x) = -x$; since $\Bbb Z_n$ is abelian, this is a homomorphism, and is clearly bijective, so an automorphism.
We can combine these with this clever trick, writing $\phi_b(x) = (-1)^bx$.
So our semidirect product binary operation becomes:
$(a,b) \ast (a',b') = (a + (-1)^ba',b+b')$ where the first coordinate is mod $n$, and the second mod $2$.
Geometrically, $(a,0)$ represents a rotation through $a/n$-ths of a circle, and $(0,1)$ represents a reflection across a line through two opposite vertices. Note that:
$(a,b) = (a,0) \ast (0,b) = (a+(-1)^00, 0+b)$, so that $(a,b)$ represents rotating, then flipping, if $b = 1$, in which case the direction of rotation is reversed.
It is easy to see that: $(1,0)$ and $(0,1)$ generate this group:
$(a,b) = (a,0) \ast (0,b) = (1,0)^a\ast(0,1)^b$; that:
$(1,0)^n = (n,0) = (0,0) = (0,2) = (0,1)^2$ and:
$(0,1)\ast(1,0) = (-1,1) = (1,0)^{-1}\ast(0,1)$ -that is we have a group of order $2n$ which satisifes the same presentation as $D_n$ ($(1,0)$ plays the role of $r$ and $(0,1)$ plays the role of $s$).
It is easy to check that:
$(1,0)\ast(a,0)\ast(-1,0) = (a,0)$ and that:
$(0,1)\ast(a,0)\ast(0,1) = (-a,0) = (a,0)^{-1}$, so any subgroup that contains only rotations is normal.
If a subgroup contains a reflection $(a,1)$ for it to be normal we must have:
$(1,0)\ast(a,1)\ast(-1,0) = (a+2,1)$ in it as well. If $n$ is odd, this implies the only normal subgroup containing a reflection is $D_n$ itself. However, if $n$ is even it only gives a necessary (but not sufficient) condition.
It turns out for even $n$ we get exactly two conjugacy classes of reflections:
$\{(a,1): a\text{ is even.}\},\ \{(a,1): a\text{ is odd.}\}$ (any normal subgroup must contain all of any given conjugacy class, so a normal subgroup that contains a reflection has at least size $\frac{1}{4}|D_n| + 1$. If $n = 2k$, our subgroup is at least of size $k + 1$. It can be shown such a subgroup must contain $\langle(2,0)\rangle$ which has $k-1$ non-identity elements), and that the only two additional normal subgroups (when $n$ is even) are:
$\langle (2,0),(0,1)\rangle$ and $\langle (2,0),(1,1)\rangle$ which are both of index $2$.

External semidirect product application


Is their a way to ensure random recruits are always of a particular nationality and/or gender?

Question: Can you set up your starting pool of recruits so that that are all the same nationality or gender, or only selected from countries in one region? It would be kind of fun if all your recruits were only from regions you have made contact with.
Answer: Yes to your first question, no to your second.
Filling your character pool with enough recruits to fill your entire starting roster and then selecting the "From Character Pool Only" option will cause the entirety of XCOM to be populated with these characters.  Simply pre-generate the characters to be of whatever nationality or gender you wish.
However, this will only effect the start of your game.  It is not possible to expand this concept to include "only regions you have made contact with" as the game progresses.  Furthermore, even your starting location is random, meaning that you will not be able to know what nationality to choose ahead of time.
Comment: As a slight addition to your question: The game does track where your recruits come from (region wise) and favors namelists (and nationalities) from that region. _Not 100% of recruits, but a large majority_. Which is at least closer to what OP is hoping to achieve. I am not sure if this was in X2 from the beginning, or whether it was patched in after your answer was posted.
Comment: @Flater Super interesting!


Automatically resume Transmission torrents

Question: Is there a way to make Transmission on OS X automatically resume seeding/downloading when it's launched?
Comment: Is there a way for it not to do this?
Answer: It does that already.
If you have not downloaded the complete file it will automatically try to reconnect to peers to continue to download.  It may not start back up if...

No peers can be found
Other downloads have been listed (by you) as a higher priority and there is a download limit set.

Another situation may be if you've deleted the torrent file.  I'm actually not sure if the absence of the original torrent file will prevent the download from starting again or not.  But keeping it around until you're done doesn't hurt.
Transmission will also automatically seed the file when the app starts.  It may not restart if you have a max ratio set per file in the preferences -- if you've hit that ratio the file will not reseed.