Why was Anakin Skywalker taken to the Grand Medical Facility on planet Coruscant?

Question: Mustafar is a mining colony on the Outer Rim and Coruscant is the heart of the galaxy. Could the emperor not find a DD-13 medical assistant and 2-1B surgical droids anywhere else closer to Mustafar? Could Kamino clone tech be on Coruscant?
Comment: If the logic is "the emperor wanted his new apprentice to receive the best quality of meducal attention" How would that not include cloning?
Answer: The very prominent reason might be because the Emperor knew that Anakin would last the time back to Coruscant (they literally jumped to lightspeed), also because Coruscant was the capital of the galaxy and the Emperor wanted his new apprentice to receive the best quality of medical attention. Since the galaxy was now under the control of the Sith overlords, he wanted to ensure that every planet in the galaxy knew about their power and influence. There were no Jedi warriors left to fight or resist them.
Comment: Well that's not 100% accurate. In the second current Marvel Darth Vader comic series titled, 'Darth Lord of the Sith', Vader is immediately tasked to hunt down and kill many of the remaining Jedi after he awakes from surgery and confronts Sidious. (Not to mention steal a Jedi he kills lightsaber and bleed it's crystal red to make it his own). But there are Jedi (like Fallen Order's Cal Kestis) that survive Order 66. You're point is still valid, just that not all of the Jedi were gone, despite the Order fell.
Comment: @DarthLocke True, I really forgot about the part of Obi-Wan and Master Yoda surviving. Though I didn't really get the mention of Cal Kestis as I have not read the comics or any books related to _Star Wars_. Thanks for the knowledge.
Comment: It's cool. There's just a lot of new canon! :D


Am I able to travel with this H4 Visa?

Question: I am a 16-year-old student in Pennsylvania with Canadian citizenship, and I'm staying under my father's H1b. I have the opportunity to travel to Europe for two weeks on a school trip in June-July, but my H-4 visa expires in September 2024. My parents have stated that we can't travel within 6 months of its expiry, as we won't be allowed back in the country. Is there any way we can renew my visa early or provide documentation that will allow me to go on the trip? Thank you!
Comment: There's nothing that says you can't travel within 6 months of your visa expiry.  Does your passport expire at the same time by any chance?
Comment: Are you sure you're using the term "visa" correctly? A US "visa" is a sticker that takes up a whole page of the passport, says "VISA" on it, and can only be obtained at a US consulate. Canadian citizens do not need US visas to enter the US on most nonimmigrant statuses, so there would essentially never be a reason for you to get an H4 visa. You would simply enter the US into H4 status with your Canadian passport, evidence of your parent's H1b status, and evidence of your relationship to your parent. Do you mean that your I-94 expires September 2024 instead?
Comment: @Doc My passport does not expire at the same time. Our family also lives and works in the U.S, not in Canada. My parents were just concerned that as the as the status goes in for review during the renewal process, it would be unsafe or risky to leave the country in case the status was frozen or something similar, and we would not be allowed back in the U.S. Is this correct, or is it still safe and secure to travel within 2-3 months of the expiry? I'd be glad to clear anything up if this wasn't enough information. Thanks!
Comment: That makes more sense.  The simple answer is "Talk to your immigration lawyers".  It's impossible for anyone to answer your question without having the full facts around what they may be doing around visa/status extensions.
Answer:
My parents have stated that we can't travel within 6 months of its expiry

This is incorrect.  The US states in several places that a US visa needs to be valid only when you arrive in the US.  For example:

What the Visa Expiration Date Means
The visa expiration date is shown on the visa along with the visa issuance date. The time between visa issuance and expiration date is called your visa validity. The visa validity is the length of time you are permitted to travel to a port-of-entry in the United States.

Another example:

My visa will expire while I am in the United States. Is there a problem with that?
No. If the Department of Homeland Security, Customs and Border Protection Immigration Officer at the port-of-entry admitted you into the United States for a specific period of time, s/he will note your authorized period of stay on your admission stamp or paper Form I-94, called an Arrival/Departure Record. You will be able to remain in the United States during your authorized period of stay, even if your visa expires during the time you are in the United States. Since your admission stamp or paper Form I-94 documents your authorized stay and is the official record of your permission to be in the United States, it is very important to keep inside your passport.

You can use a visa to travel to the United States right up until the very last day of the visa's validity, as mentioned in Doc's comment.
Your question is a bit confusing, however, because, as noted in user102008's comment, Canadian citizens do not require a visa whatsoever to enter the US in H-4 status.  From the dedicated page for citizens of Canada and Bermuda:

Citizens of Canada traveling to the United States do not require a nonimmigrant visa, except for the travel purposes described below. ...

The list that follows does not include H visas; it includes all types of A, G, and NATO visa along with E-1, E-2, E-3D, K-1, K-2, K-3, K-4, S-5, S-6, and S-7.
Because you are Canadian, you should be eligible to travel to the US and enter in H-1B status without an H-1B visa.  This means that if you for some reason have an H-1B visa in your passport you should be able to return to the US after it expires.
Now in my experience, Canadians in the US often use the word "visa" to mean "immigration status."  For example, I have a friend who lived and worked in the US for many years in TN status, a status that is similar to H-1B that was created to implement the provisions of the North American Free Trade Agreement.  He was always talking about going to Canada to "renew his visa."
But he never had a visa; in fact, he was flying to Canada because the period of admission on his I-94 form was coming to an end, and he needed a new period of admission.  You can extend this period without leaving the country by filing an application along with its fee of $370, or you can leave the country and get a new period of admission when you return.
If your parents are talking about extending the period of admission rather than the visa then they may be thinking about how to time the filing of your I-539 extension application.  If that's the case then the best solution is probably simply to file it after you return from Europe.  You might get the extended admission at the border, saving the $370 fee; if not, you can file the extension application.
Comment: Canadians working in the US need some sort of work authorization. The easiest to get seems to be the TN, but most Canadians working for me wanted an H1B as a path to Green Card and eventually citizenship
Comment: Thanks for your detailed explanation! My question was a bit unclear, so I will try to clarify. My family lives and works in the US. My mom believes that the status will go in for review during the renewal process, and it will be unsafe or risky to leave the country if the status was frozen or something similar, as we wouldn't be allowed back in at the US border. Is this correct, or is it still safe to travel within 2-3 months of its expiration? When you stated that Canadian citizens can enter the US without a nonimmigrant visa, was that just for visitors, or also those who live and work here?
Comment: I am happy to clear up anything else that I may have left out.
Comment: @VidyanSarvesh your additional questions are already addressed in the answer.
Answer: Since you are a Canadian citizen, you most likely do not have an H4 "visa". You do not need a visa to enter the US into H4 status (or most other nonimmigrant statuses; it's not just visitor statuses). What you probably mean is that you and your parents' H1b and H4 I-94s expire in September, and the H1b petition also expires in September.
There is no problem with you leaving the US and returning in June and July. When entering the US, you will present your Canadian passport and your parent's H1b I-94, and be admitted into H4 status with an I-94 that expires at the same time as your H1b parent's I-94 (so presumably September).
I am presuming that the company will apply for an extension of the H1b petition, along with an H1b extension of stay, and you guys will apply for H4 extensions of stay along with it. In that case, the period of time that you guys would have most trouble returning to the US is after September and before the extension is approved. Although you guys can stay in the US (and the H1b worker can work) while an extension of stay is pending, you guys will not be able to enter the US during this period, since there is no valid H1b petition. This period can be reduced or eliminated by filing H1b extension with premium processing.
After the H1b petition and extension of stay extension is approved, you will again have no problem returning to the US, since you can enter into H4 status on the basis of your Canadian passport and your parent's new H1b I-94.
I don't know why there would be a concern about taking a trip in June or July. One possibility might be that they were planning on filing for extension really early, and if you leave the US while an extension of stay application is pending, it automatically abandons the application, so it would be a waste. However, you could just wait until you get back to file your extension of stay application. It just has to be received by USCIS before your status expires, so there would be plenty of time to file it after you get back in July.

Am I able to travel with this H4 Visa?


electromagnetic field cosmic radiation

Question: How does an electromagnetic field of a planet prevent cosmic rays to hit the planet?
Please explain it in a simple way.
Answer: Cosmic rays are charged particles moving at high speeds. As such, they interact strongly with the magnetosphere of a planet, as per the Lorentz force law in the absence of electric fields:
$\vec{F}=q\vec{v}\times\vec{B}$
As you can see, at such high speeds, even a weak magnetic field has a strong influence on a particle's trajectory. Due to the way the cross product in the above expression works, the Lorentz force tends to cause particles to tightly orbit magnetic field lines. From the picture included in the question, you can see that if we "pin" particles to magnetic field lines, they only hit the Earth at two places: the north and south magnetic poles. Thus, the rest of the Earth is protected from cosmic rays.
Side note: When the cosmic rays, following the magnetic field lines, hit the atmosphere above the poles, the energy of these interactions is converted to the shimmering light of the aurora borealis (in the north) and aurora australis (in the south).

electromagnetic field cosmic radiation


Myths on God committing suicide

Question: I am looking for information on myths where God commit suicide, specifically myths based from Central America, South America, and Africa; especially on the idea that earth was created through a God's suicide.
Any help is much appreciated. Thank you!
Answer: Directly from Wikipedia on Quetzalcoatl, the Aztec winged serpent and creator god:

In the Codex Chimalpopoca, it is said Quetzalcoatl was coerced by Tezcatlipoca into becoming drunk on pulque, cavorting with his older sister, Quetzalpetlatl, a celibate priestess, and neglecting their religious duties. (Many academics conclude this passage implies incest.) The next morning, Quetzalcoatl, feeling shame and regret, had his servants build him a stone chest, adorn him in turquoise, and then, laying in the chest, set himself on fire. His ashes rose into the sky and then his heart followed, becoming the morning star.

Source: The Death of Quetzalcöätl, David K. Jordan
Professor Emeritus of Anthropology, UCSD, website
In Mesoamerican mythology, there is also the legend of the Fifth Sun, where two gods compete in order to decide who has to sacrifice himself in order to save humanity. Nanahuatzin ends up jumping into the bonfire first and becomes the new Sun.
From Sub-Saharan Africa, I found the creation myth of Kuba people in Democratic Republic of the Congo. Mmombo the creator vomited the skies and part of the world, one of his sons, Nyonye Ngana, was supposed to finish the job but died after creating (vomiting) the ants.
Answer: Old Sumerian cuneiforms report that the Annunaki said the earth was created from a large chunk of the remains of a larger planet that that was destroyed when it collided with another larger denser planet. Thus, the large planet that bore earth was sacrificed so our earth could be born. In ancient times the planets were given the names of gods and the asteroid belt that was created from the smaller pieces resulting from the collision, was called the golden bracelet.
Comment: This uses too much modern scientific understanding that I doubt Ancient Sumerians would have believe such a story. Got any source?
Comment: If this is the case I would love to see some references to the Tablets and sources

Myths on God committing suicide


Grant Windows logins to read a secondary database of log shipping?

Question: The following link, Creating Users on secondary server in log shipping, shows how to create a database login on the secondary server. How to grant Windows logins on the secondary server to access the database? The primary server and secondary server are not in the same domain so I cannot create the Windows domain user on the Primary server.
Answer: Since the secondary in a log-shipping configuration is either READ ONLY or RESTORING, you cannot make changes to the database (i.e. create a USER) until a ROLE CHANGE happens (i.e. when you failover from primary to secondary). You can create a LOGIN on the secondary server.
You can use this script - How to transfer logins and passwords between instances of SQL Server to script logins - both SQL and Windows.
If you are using SQL Server 2014, then you can just create a ROLE and then grant that role connect any database and select all user securables. This works on readonly databases in logshipping configuration as well.
Note that above is not that elegant if you keep security in mind, but still is an alternative that can be considered.


How to release solution under GPL

Question: I work for a company which has developed a test automation solution and willing to release the same under GPL. I need to know where all do the company need to register and what is the overall process?
Answer: It is probably off-topic here. Perhaps better on open-source.
Beware, I am not a lawyer and your question might be a legal one (too).
(perhaps you want some written permission to do that, e.g. to protect yourself in case your employer gets bought by some external entity)
You don't need to "register" anything. You could just publish your source code, e.g. on github (or elsewhere). Don't forget a license file. Read carefully about the GPLv3 license (notably the GPL HowTo document explains the details). Don't forget to add a GPL license comment in every source file, and to put the (unmodified) text of the GPLv3 license with your code.
BTW, I would recommend to publish your code under GPLv3+ (not just GPLv3 but also future version) but that choice is yours.
NB: publishing some existing code under GPL is technically easy (but you'll better have explicit permission for that if the code legally belongs to your employer). Getting interest from outside users and contributors is much harder.

How to release solution under GPL


Is there a difference between window.onkeydown and document.onkeydown?

Question: Most of the code I've seen online uses document.onkeydown, but MDN only lists window.onkeydown. This comment also recommends using window.onkeydown. Is there a difference or a reason to use one over the other?
Answer: See the following graphic from Event dispatch and DOM event flow:

There are three event phases:

The capture phase: the event object must propagate through the target's ancestors from the defaultView to the target's parent.
  This phase is also known as the capturing phase. Event listeners
  registered for this phase must handle the event before it reaches its
  target.
The target phase: the event object must arrive at the event object's event target. This phase is also known as the
  at-target phase. Event listeners registered for this phase must handle the event once it has reached its target. If the event
  type indicates that the event must not bubble, the event object
  must halt after completion of this phase.
The bubble phase: the event object propagates through the target's ancestors in reverse order, starting with the target's parent
  and ending with the defaultView. This phase is also known as the
  bubbling phase. Event listeners registered for this phase must handle the event after it has reached its target.

Therefore, the main difference is that event listeners added to window will handle the event after event listeners added to document in case of bubble phase; and before in case of capture phase.
Comment: @Yay295 Did you mean the opposite?
Comment: I'm guessing the reason to use window over document is because it doesn't have to propagate as far?
Comment: As I understand it, if you use window it goes window->event->window, and if you use document it goes window->document->event->document->window.
Comment: @Yay295 The event flow is always the same, it doesn't depend on your event listeners. But depending on which node you attach your event listener, it will run in a different moment of that event flow.


file not found when click new in webpart gallery

Question: I am getting an error when i click new webpart in webpart gallery. I want to deploy my custom webpart to sharepoint webpart gallery.
I try to look in sharepoint log. Sadly, there is no further info in sharepoint log. They dont even throw correlation number error.
Comment: what error are you getting? Did you check the ULS logs? Do you have a custom master page? Did you try to add the web part with the default master page set for the site?
Comment: Only "file not found" error.. I try to upload image in this question for further clarity but my rep not allow it.
Comment: Are you talking about the web part gallery or add new webpart menu?
Comment: when I click new webpart in webpart gallery. In NewDwp.aspx. The problem has solved now. After I googling, i know that the culprit is "return of smartpart" component. Many thanks all...
Answer: Are you using smart-part in your SharePoint site? If so, maybe you should install AJAX 1.0 in your web front-end server to solve that error. This is a common error when you dealing with smart-part. If not, just ignore my answer.
Comment: yes, i'm using smartpart in my sharepoint site. Gonna try your advice..


smoke smell from the chimney/fireplace?

Question: With woodstove removed and not being reinstalled, how do we get rid of the burned wood smell in the fireplace/chimney?
Answer: Sometimes you've just got to roll up your sleeves and go to work...
Answer: Negative air pressure in the house draws air down the chimney.
Cap the chimney so it's airtight at the top.
Not sure whether this is a masonry fireplace with ceramic tile liner or multiwall metal stack, but the following helps.
They make blow up vinyl balloon type devices for completely blocking airflow lower in the chimney. Fireplace dampers are notoriously leaky if that's still installed, it may have been cut out if this is a fireplace insert conversion.
As the other answer indicates, sweep it out, the smell is worst in creosote (partially burned volatiles) and less in soot (carbon black). I guarantee that the acrid smell from what's penetrated into chimney tile will linger for a couple years though. A good stiff brushing will clear out most metal chimney liners and vastly attenuate the smell.

smoke smell from the chimney/fireplace?


In Toriko, what animal's skin does Atom show Terry, Kiss and Quinn?

Question: In chapter 319 page 3, "Kaka" (Atom in disguise) shows Terry, Kiss, and Quinn a piece of skin or fur of an animal that makes the three scared. What is this skin?
Answer:
Unknown creature's skin: ATOM possesses a mysterious piece of skin that appears to have belonged to a creature of tremendous power and vicious bloodthirsty ferocity. Just showing this little piece of skin could invoke paralyzing fear in the hearts of Terry, Kiss, and Quinn.

Taken from Toriko Wikia.
So, it seems never to be resolved from what kind of creature this skin was.


Baking bread with a firm texture that doesn't grow mold

Question: I bake large quantities of bread like 50kg a day. People are complaining that the butter bread, when I slice it, is like a sponge in texture and gets moldy in three days. How can I get a firmer texture and delay mold growth? The ingredients I use are margarine, flour, milk, nutmeg, yeast, vanilla extract, sugar and salt. I don't add eggs.
Comment: @GdD probably "slice". But we need more details anyway.
Comment: This might be more an issue with setting expectations, so people know what the texture and shelf-life of your bread and aren't surprised.  If you want to change the texture so it's less spongy, you might try cooking it slightly longer so it's drier inside.  This might also increase the time before it molds, but home-baked bread is never going to compete with factory made bread with preservatives and such.  But see https://cooking.stackexchange.com/q/7804/67
Comment: Welcome to the site! I'm sorry to say I don't understand your question. What do you mean by 'when I slide is like sponge' ?
Answer: Mold grows on bread because mold spores in the air, or on hands or other surfaces, get transferred to the bread. Bread has plenty of nutrients for these spores to grow.  Mold growth is enhanced by temperatures over 70 degrees F (21C). Humidity and moisture also favor mold growth.
There are a couple of things you can recommend or do to reduce mold growth.
Bread should be handled with clean hands.
Bread should be kept well wrapped.
Refrigeration dramatically slows mold growth.
Freezing virtually stops mold growth.
If not freezing, consume bread as soon as possible.
Margarine and milk help keep the texture soft, and reduce staling.  If you want a firmer texture, you might consider a formula without these ingredients.
Answer: Moist breads will get moldy faster than dryer breads, and moister breads also are more open, i.e. a have spongier texture, so reducing the milk in your recipe may help resolve both of those complaints. I would suggest you reduce the milk by 5% and see how that improves the situation, then keep reducing it by 5% until you get the texture you want. Reducing the moisture will make the bread less open, if it gets too tight add a bit more milk.
Take notes on the changes you do so you remember what works and what does not for your recipe.
There are answers about how to use preservatives in bread here.
Comment: When you recommend reducing the milk, are you suggesting simply leaving it out, or replacing it with water?  (leaving it out will remove moisture, but it going to change the dough more significantly)
Comment: Reducing the milk means leaving some of it out @Joe. The point it to change the texture of the dough.
Comment: You're still going to change it by moving to water.  (less sugar, for one)
Comment: @Joe, changing from milk to water will make other changes, that's not what I'm saying to do in my answer though.


DNS Server resolves external address,when vpn dns should resolve internal address

Question: We have a special situation where Juniper Network Connect is used as VPN connection. When the VPN starts it creates the network adapter. When the vpn closes the network adapter disappears. Each time the Juniper Network Connect vpn creates the adapter, the Win7 x64 pc automatically adds our internal DNS server as the DNS server for the vpn adapter. This causes an issue because some servers inside the vpn have an external address that is different than their internal address, so basically our internal dns server correctly resolves the external IP, but because the IP is resolved to the external IP, the packets never try to cross the vpn and instead try to traverse the WAN. wich fails miserably. I have changed the adpater manually to auto detect dns, but each time the service stops the adapter disappears and gets recreated the next time it runs.
Comment: I think this is a side-effect of (what is IMHO a bad practice) using "split DNS" where the DNS names resolve differently based on what DNS server you're querying.  Assuming you can get the DNS client to query the proper DNS server, you're still going to run a problem with caching.  Assuming the client resolves the IP from the public internet, it will cache that result, and then when you connect the VPN chances are good it will not attempt to re-query, it will simply use the cached result.
Comment: Gorilla, +1, but then how do you recommend one handle a situation what a server has a public IP address that is NAT'd to an Internal IP, but internal users need to be able to access it as well?  It is not always feasible/desireable to have the internal users cross the Firewall twice...
Answer: We use a Juniper SA box as well (with Network Connect for some clients/users).
First off, you shouldn't be manually changing anything on the virtual adapter itself, everything should be controlled by the Juniper SA box (using Central Manager).
The NIC that is created is the tunnel nic that sets up the new default route, IP, etc. (the Juniper Network Connect Virtual Adapter to be specific).
It should be setting up the default route when you connect to go through that interface and thus tunnel through the Juniper SA appliance.
If you are allowing split-tunneling however, then you might run into your issue, but seems odd.  Sounds more like a DNS issue where you should be resolving the VPN to the internal IP of the server and not the external IP.  You seem to say that they get the external IP but they should be connecting to an internal server inside the LAN.  So really DNS should be telling them to go to the internal IP that is local to the VPN subnet, and not to an external IP address.
That said, if it truly is a Network Connect issue and not a matter of DNS resolution, then the solution should lie in the SA central manager, under "Resource Policies, Network Connect", especially if you have a split-tunneling policy setup under there.  Check the profiles setup under there as well (Network Connect Connection Profiles) to make sure they are correct.
Finally, check under the user Roles for that group and the Network Connect options as shown in the screenshot below:

This isn't to say that one way is correct over another.  You'll need to decide which settings are right for your deployment.


What is the significance of the term "never start changing the borders in Eastern Europe by force?"

Question: I have read this was the cause of both World War 1 and World War 2. Russia has now seized the Crimea and followed that up with a War in Eastern Ukraine. What are some political theories behind such developments that may have relevance today?
Comment: Quote without context/citation; demonstrates insufficient preliminary research.  Sounds like a conspiracy theory, quote may have no significance whatsoever.
Comment: Isn't this essentially asking for an evaluation of the current political situation? In which case, it would be better suited in Politics SE.
Comment: Even World War is Politics by other Means strikes me as an odd view. Questioning "Why we Fight" strikes me as an odd form of Conspriracy as well.
Comment: It is much easier. When Ukraine agreed to stop being a nuclear power in 1992 or 3, USA and Russia guaranteed its borders and safety. And you can see how well they both keep their agreements. I think, from now on there will be no fool to stop being a nuclear power.
Answer: This relates to the so-called Heartland Theory by people like Britain's HJ MacKinder. Whoever controls East Europe dominates the "Heartland" (which also includes Germany and Russia) of World Island (the Eurasian land mass). Whoever controls the Heartland dominates World Island. And whoever controls World Island dominates the world.
Therefore, any forceful change of the balance of power in East Europe will likely have global domino effects (maybe not World War III).
Comment: I find the concept of "Western Betrayal" and World War 2 interesting...especially as it regards Finland. Great Britain declared War on Finland in World War 2 and I never understood that. Also now that we have "Space Travel" I don't really understand the whole "resource thing" anymore. The virility part seems overstated now as well too...though maybe not with the millions of refugees streaming into Western Europe currently. Thanks for the reply.


Simple Hamiltonian in curved space-time

Question: Consider the theory of a free massless scalar field with a non-trivial background metric:
$$ \mathcal{L} = -\sqrt{-g} \left( \frac{1}{2}\partial_\mu \phi \partial^\mu\phi\right) .$$
(I prefer the 'mostly +' metric signature). I want to find the Hamiltonian density. Intuitively, I would have
$$ \Pi = \frac{\partial \mathcal{L}}{\partial(\partial_0\phi)} = -\sqrt{-g}\;\frac{1}{2}\partial^0 \phi.$$
The Hamiltonian density should therefore be
$$\mathcal{H} = \Pi \dot{\phi} - \mathcal{L} = \Pi \frac{2\Pi}{\sqrt{-g}} + \sqrt{-g}\; (-\Pi^2 + \partial_i \phi \partial^i \phi)$$
$$ = \sqrt{-g}\;\left[ \left(\frac{2}{-g} -1 \right)\Pi^2 + \partial_i \phi \partial^i \phi  \right].$$
The factor in front of $\Pi^2$ just looks wrong to me. I therefore suspect I'm defining things wrongly and wished to know what was the standard formalism to obtain the Hamiltonian density with curved background?
Answer: First of all, notice that $$\partial_\mu \phi \partial^\mu\phi = g^{00}(\partial_0 \phi)^2 + 2 g^{0i} \partial_0 \phi \partial_i \phi + g^{ij}\partial_i \phi \partial_j \phi$$
Then
$$\Pi \equiv \frac{\partial \cal L}{\partial(\partial_0 \phi)} = \sqrt{-g} \partial^0\phi = \sqrt{-g}(g^{00} \partial_0\phi + g^{0i} \partial_i \phi)$$
You will then have
$$\partial_0\phi = \frac{\Pi}{g^{00}\sqrt{-g}} - \frac{g^{0i}}{g^{00}} \partial_i \phi$$
If you substitute this consistently in the Legendre transform, you get something much more complicated than what you have in the OP and that will be the correct result for the Hamiltonian ;)
Comment: Sorry, I guess I was thinking of a diagonal metric, but even then forgot the $g^{00}$ terms. So the point I should take is that it's normal for the Hamiltonian density to be very complicated even when corresponding to the simplest covariantly written Lagrangians.

Simple Hamiltonian in curved space-time


R and SQL Server 2008

Question: Is there a way to use R power in SQL Server 2008?, I mean use in console or communicate both of them.
If it is What would be the procedure?
Answer: SQL Server Data Within R:
An example using SQL Server data within R is here. This blog post deals with plotting data from a SQL server table using K-Means Clustering.
Calling R within SQL Server:
You can use the extended Stored Procedure XP_CmdShell to call R (or any command line tool as Nick points out) within SQL Server.
Enable Functionality In Server Level:
XP_CmdShell exposes the cmd shell within SQL Server. For obvious reasons, this is not    enabled by default. A SysAdmin (or someone with Control Server permission) can enable this functionality in server level.
Enable a specific User to Access this functionality:
 exec ON xp_cmdshell TO *YourLoginHere*

Refer this URL for more info on best practices  (such as using a proxy account for non-SysAdmin users) and example usage.
Answer: You want to use the RODBC package: http://cran.r-project.org/web/packages/RODBC/.
Vignette is here.
Answer: I think RODBC does the reverse of what you ask (I think you want to call R from within SQL Server). However, from stored procedures in SQL Server, and with the correct security settings (you probably want to talk to a highly skilled sysadmin here), you can run any command line tool, including R. I remember there being a system stored procedure for that (but forgot its name since it's been a while).
You could pass a script (maybe even a scripted script) to R, or pass it the right information to connect to the SQL Server again via RODBC, where it could find a table with statements to execute or data to use for analysis.
That should give you enough power to communicate both ways...

R and SQL Server 2008


PPTP VPN stops working after disconnected once

Question: I am using PPTP VPN connection on Ubuntu 16.04 and it is working fine after fresh boot and when I first establish connection. But if it get disconnected by some reason and I reconnect (it reports it reconnected successfully) it stops working - meaning I can not open any web page anymore, I get timeout for all connections.
I found temporary solution by restarting network manager as mentioned in this answer
<code>sudo systemctl restart network-manager.service
</code>
This behaviour only started recently, like 2 weeks ago (maybe bug in one of the updates?), before I had no problems. VPN connection itself is not problematic since it works without problems on different OSs.
Same problem happens if I suspend and resume.
How can I debug and resolve this issue?
Comment: This may be related to an existing bug - https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1639776 - which is "Fixed" in Zesty and has fixes pending in Xenial and Yakkety.
Answer: I came cross the exactly same problem after upgrading my Ubuntu 16.04.
I also found that the "disconnect VPN" button has disappeared after upgrade and "configure VPN" has become constantly gray.
At first i doubt if there's any issue with the NetworkManager package, thus i tried reinstalling all nm packages, but it didn't work.
Then i doubt if my system is corrupted, I even reinstalled the whole OS (only root folder) with newest stable release 16.04.02, but it neither worked.
I suspect that some update in 16.04.02 caused this problem.
Really hope this problem could be solved soon.
Answer: This happens to me as well (except with OpenVPN), and to fix it I used sudo killall dnsmasq. Unfortunately I have to do it every time I disconnect and reconnect to my vpn but its better than nothing!
EDIT: I found a solution. Go to the terminal and type
gksudo gedit /etc/NetworkManager/NetworkManager.conf
And comment out the line dns = dnsmasq
Here is the link for where I found this information
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1633912


Use of SRB for Saturn V

Question: In 1967, a solid fuel rocket motor with 260 inch diameter and 89 inch throat dia, was tested, and it was found to generate 5.8 million pounds of thrust. This was much higher than the F1 engines used in Saturn V. Why this motor was not considered suitable for Saturn V application?
Comment: Because it would be a different rocket.  Rockets aren't LEGO elements.  The system needs to be designed from the ground up to handle the loads imparted by each element.
Comment: That is a terrifying large SRB.  More than double the thrust of the Shuttle SRBs.  And 21 feet wide?  How would move it?  It must weigh an immense amount.  Would the crawler be able to handle that much mass?
Comment: @Tristan The SRB being discussed was specifically designed for use as a Saturn first stage.
Comment: @geoffc and imagine the results of an accidental ignition.
Answer: Rocket and rocket engine development takes years. The F-1 was first test-fired as a complete unit in 1959, and completed flight rating tests in 1964, and the first Saturn V flew in 1967.
Aerojet's 260-inch SRB was first test-fired in 1965. The third test in 1967 unexpectedly ejected the rocket nozzle toward the end of the burn, spewing corrosive material over a wide area. It simply wasn't ready for use by the time the last Saturn V had been ordered.
The 260-inch booster was considered for a number of post-Apollo variations on the Saturn V design, including the Saturn V-4/260, which would use four of the 260-inch SRBs as strap-on boosters with a strengthened Saturn V first stage and uprated second stage, which could have put ~360 tons payload into LEO -- almost 3 times that of the Saturn V. None of these concepts were developed past rough design proposals, as far as I know.

Use of SRB for Saturn V


Example of filtration in probability theory

Question: I'm studying Martingales and before them filtrations. Given a probability space $(\Omega, F, P)$ I define a filter $(F_n)$ as a increasing sequence of $\sigma$-algebras of $F$, such that $F_t \subset F$ and
$t_1 \leq t_2 \Longrightarrow F_{t_1} \subset F_{t_2}$. Here comes my question:
How can the $F_t$'s be $\sigma$-algebras and subsets of $F$ without being exactly equal to $F$? I suppose that $F_t$'s being $\sigma$-algebras mean that they are $\sigma$-algebras with respect to the measure space $(\Omega, F)$.
Can anyone explain why they are not necessarily equal to $F$ and give an example where this is obviously false?
Comment: Most trivial example: $\mathcal{F}_t := \{\emptyset,\Omega\}$ is the trivial $\sigma$-algebra and $\mathcal{F} := \mathcal{P}(\Omega)$ the power set.
Comment: "$F_t$'s being $\sigma$-algebras mean that they are $\sigma$-algebras with respect to the measure space $(\Omega, F)$." Sorry but what do you mean by being a sigma-algebra with respect to $(\Omega, F)$?
Answer: Another simple example.  The natural filtration when we model tossing a die twice in a row.  Here is how it works.  Let $X_1$ be the outcome of the first toss.  So the values of $X_1$ are in the set $\{1,2,3,4,5,6\}$.  Let $X_2$ be the outcome of the second toss.
As a sample space, we can take $\Omega = \{1,2,3,4,5,6\} \times \{1,2,3,4,5,6\}$, the set of all ordered pairs chosen from the set $\{1,2,3,4,5,6\}$.  If $\omega \in \Omega$, then $\omega$ is an ordered pair, say $\omega = (\omega_1,\omega_2)$. Let the two random variables be $X_1(\omega) = \omega_1$ and $X_2(\omega) = \omega_2$.  An "event" is a subset of $\Omega$.
[Note: a true probabilist thinks the first paragraph is quite natural, and the second paragraph is very artificial.]
The "times" that are relevant are: time $0$, before any tosses have been done, time $1$ after the first toss but before the second toss, and time $2$, after the second toss.  For each time $t$, the sigma-algebra $\mathcal F_t$ is "the information known at time $t$".  We have $\mathcal F_0 \subset \mathcal F_1 \subset \mathcal F_2$, with strict inclusion in all cases.
Now let's work out what these are.
$$
\mathcal F_0 = \{\varnothing, \Omega\}
$$
since at time $0$ we have no information about which sample point is the true state of affairs.  There are only two events such that we know whether it occurs: event $\Omega$ definitely occurs, and $\varnothing$ definitely does not occur.  For any other event, we do not know whether or not it occurs.
$$
\mathcal F_1
$$
consists of $2^6$ events:  all sets of the form $A \times \{1,2,3,4,5,6\}$, where $A \subseteq \{1,2,3,4,5,6\}$.  This is because, at time $1$, we know what the outcome $X_1$ was, that is, we know the first coordinate of $\omega$, but we do not know the second coordinate of $\omega$.  The events in $\mathcal F_1$ are events that contain no information about the second toss $X_2$.
Given an event $U$ in $\mathcal F_1$, at time $1$ we definitely know whether or not $U$ occurs.  But given an event $V$ not in $\mathcal F_1$, at time $1$ we possibly do not know whether $V$ occurs.
$$
\mathcal F_2
$$
consists of $2^{36}$ events:  all subsets of $\Omega$.  This is because, at time $2$ we know exactly what $\omega$ is, so, for any of the $2^{36}$ events $U$, we know whether or not $U$ has occurred.
[Probability language
$$
\text{event $U$ occurs}
$$
translates to set theory language
$$
\omega \in U.
$$
As you work with this, you will get more experience translating back and forth between them.]
Comment: @GEdgar $F_1$ consists of $2^6$ events????? Shouldn't it be $6$??? When $\omega_1$ is known then the possible combinations are: $(\omega_1,1) , \dots, (\omega_1,6)$ . And similarly for $F_2$ shouldn't it be $6^2$ rather than $2^6$ ??
Comment: @Nikolaj-K: the filtration contains any possible information of the process, that is, anything that can be answered. The subset $S=\{2,4,5\}$ corresponds to the information that answers the question *is the first throw a two or a four or a five?*. After one throw, you can answer this question, but you have no idea about the result of the second throw. This is what is stated by the element $\{2,4,5\} \times \Omega \in \mathcal F_1$. It says that you can reasonably ask the previous question about the first throw, but nothing specific related to the second throw (only that it's in 1 to 6).
Comment: You say all sets of the form $A\times \Omega$, although $\Omega$ is already a product. Is that right? The set $A$ has $2^6$ subsets, so F1 are sets holding triples? Why do we keep track of the later two components?
Comment: Ah, okay. Can you still comment a bit on the intuition regard why subsets of $A$ are considered? E.g. say the first coin was flipped and I know it's value. That's then a single concrete value and all info about the first component. How would e.g. the subset $S=\{2,4,5\}$ of $A$ ever relate to that? I can understand that it's a formal definition and just so defined, but I have no intuition why arbitrary size subsets of all dice faces come into play.
Comment: @Croma14: If $A$ is any subset of $\{1,\dots,6\}$, then $A \times \{1,\dots,6\} \in \mathcal F_1$.  That is, if we know $\omega_1$, then we also know whether or not $\omega \in A \times \{1,\dots,6\}$. There are $2^6$ such events. And every subset of $\{1,\dots,6\} \times \{1,\dots,6\}$ belongs to $\mathcal F_2$.  There are $2^{36}$ such events.
Comment: @Nikolaj-K ... You are correct, I have fixed this.
Comment: @FAM for set {1,2,3,...,6} there are $2^6$ subsets, $2^6$ events, $2^6$ questions can be asked. For example does this toss contains {1,2,6}, does this toss contains {3}? etc. For $F_2$ set {11,12,...,66} there are 36 elements, $2^{36}$ subsets, $2^{36}$ events, $2^{36}$ questions can be asked
Comment: If we consider a process, say, a sequence of coin tosses, what is $\Omega$ then?
Answer: Let me first state an interpretation for the meaning of a filtration: A filtration $\mathcal F_t$ contains any information that could be possibly asked and answered for the considered random process at time $t$.
Single dice throw:
Let's first consider the simple example of one dice throw:

Before the throw, all you know is that the result will be "1 or 2 or ... or 6". In set notation, this corresponds to $\Omega_1=\{1,2,\ldots,6\}$, i.e., to the full set of outcomes. Moreover, you can ask and answer the silly question "does nothing happen", which corresponds to the empty set. So the filtration is $\mathcal F_0=\{\Omega_1,\emptyset\}$.

After the throw, you get a single outcome $\omega_1 \in \Omega$. Now you can answer all kind of questions, for example: "is the result a 4" which corresponds to $\{4\}$, "is the result an odd number" corresponding to $\{1,3,5\}$, "is the result larger than 4" corresponding to $\{5,6\}$, and so on.

You see that all possible information after one throw -- all that can be asked and answered -- is contained in the power set $\mathcal P(\Omega_1)$ of $\Omega_1$.
Moreover, in a probability space, you cannot only ask whether a configuration might occur or not -- you can also consider the probability for a given configuration, for example $P(\{5,6\}) = 1/3$.
Two dice throw (ordered, i.e. thrown sequentially):
This is the example discussed in the answer by @GEdgar.

Before any throw, all you can ask and answer is that the result will be in $\Omega_2 = \Omega_1 \times \Omega_1$, so $ \mathcal F_0 = \{\emptyset,\Omega_2\} $.

After the first throw, you can only answer any of the questions related to the first throw we collected in the one-dice example, and nothing related to the second. So the filtration is $\mathcal F_1=\mathcal P(\Omega_1) \times \Omega_1$.

After two throws, you have the complete information, that is $\mathcal P (\Omega_2)$.

A few example configurations plus the corresponding question:
$\quad \quad \Big\{(1,5)\Big\} \in \mathcal F_2$ $\quad
\longrightarrow$ first throw is a one, the second a five
$\quad \quad \Big\{(1,5),(5,1)\Big\} \in \mathcal F_2$ $\quad
\longrightarrow$ one of of the two throws is a one, the other a five
$\quad \quad \Big\{\{1,3,5\}\times\{2,4,6\}\Big\} = \Big\{(1,2),(1,4),\ldots,(3,6),(5,6)\Big\}
 \in \mathcal F_2$ $\longrightarrow$ first throw odd, second even
Two dice throw (unordered, i.e. thrown at once):
Here, the set of outcomes is the set of ordered pairs $\Omega^+=\big\{(\omega_1,\omega_2)\ |\ 1\leq\omega_1\leq\omega_2\leq6\big\}$.
There is only one throw, and the filtration after it is -- just as in the one-dice throw example above -- given by $\mathcal P(\Omega^+)$. I won't go through this in detail. The only thing I want to stress is the following:
The unordered two-dice throw here can be reproduced by the ordered two-dice throw, if one restricts the sigma-algebra of the ordered example to contain all symmetric pairs. That is, for example, all elements of the form $\{(1,5)\}$ as in the previous example are disallowed and have to be replaced by $\{(1,5), (5,1)\}$. By this, the discrimination between "first" and "second" throw, basically disappears. In result, the unordered outcome set with the filtration being a power set is identical to the ordered outcome set with a filtration restricted to symmetric elements.
By this example, one can observe that the sigma-algebra is not a static thing. It depends on the set of outcomes $\Omega$ and on the questions one wants to ask.
Comment: Thanks! I appreciate you answer. I have a short question, though. In the ordered two dice throw have I got it right that you mean $F_0 = \{ \emptyset, \Omega_2 \}$?
Comment: Sure, corrected the $0$ to $\emptyset$, thanks!
Comment: I have a question about $\mathcal{F}_1$ of two dice throw (ordered). Shouldn't it be $\mathcal{F_1}=\mathcal{P}(\Omega_1)\times\{\Omega_1\}$?
Answer: Take the following simple model: a stochastic process $X$ that starts at some value $0$. From that value, it can jump at time $1$ to either the value $a$, either the different value $b$. And at time $2$, it can jump to $c$ or $d$ if it was in $a$ at time $1$, it can jump to $e$ or $f$ if it was in $b$ at time $1$. In other words, there are four possible paths for the variable $X$: $\omega_1=0\to a\to c$, $\omega_2=0\to a\to d$, $\omega_3=0\to b\to e$ and $\omega_4=0\to b\to f$. They constitute our space of outcomes
$$\Omega=\{\omega_1,\omega_2,\omega_3,\omega_4\} \; .$$
Hence, $\Omega$ is the space of possible paths for $X$. On the other hand, you can define a filtration as follows
$$\begin{eqnarray} \mathcal{F}_t  = &\{\emptyset,\Omega\} &, 0\leq t <1 ; \\ \mathcal{F}_t = &\{\emptyset,\{\omega_1,\omega_2\},\{\omega_3,\omega_4\},\Omega\} &, 1\leq t <2 ; \\ \mathcal{F}_t = & \mathcal{P}(\Omega) &, 2\leq t .\end{eqnarray}$$
with $\mathcal{P}(\Omega)$ the power set of $\Omega$. In this sense, the filtration is a reflection of the info you have at any time. In the beginning, you don't know which path the stochastic variable will follow, so your filter does not contain more than the events $\emptyset$ and $\Omega$, but in the next step, you can arrive at one of the values $a$ or $b$. Therefore you have two extra events in your set you can speak about. And finally at the final time, you have access to all possible events. As you can see $\mathcal{F}_1 \subset \mathcal{F}_2$ but $\mathcal{F}_1 \neq \mathcal{F}_2$.
Answer: This is a variation on @GEdgard example, that can be applied to real valued random variables. The probability plays no role. Let $X_j$ be the projection of $\mathbb{R}^n$ onto the the $j^{th}$ component, i.e.:
$ X_j(x_1,x_2,\dots,x_n) = x_j $. Let $\mathcal{F}_j = $ sigma-algebra generated by $X_1, \dots, X_j$. $\mathcal{F}_j $ is the sigma-algebra of Borel sets that can be defined in terms of the first $j^{th}$ coordinates, in the sense that.:
$$
\mathcal{F}_j = \{A \times\mathbb{R}^{n-j} | A \text{ is a Borel set of }\mathbb{R}^{j}\}
$$


Glass shader has black parts

Question: i'm trying to render this glass material but i have these black parts all over the model. Any idea what could be the cause of this ?
Comment: Could you show your Light Paths panel? Posssible related: https://blender.stackexchange.com/questions/82643/how-to-get-rid-of-internal-shadows-blackness-in-glass-transparent-refractive-mat
Answer: Look at the HDRI below the horizon. Many of these HDRI's have a black 'ground'. Glass will refract all light, so the black ground as well. That is probably where those dark shapes are coming from. Remember, glass only exists because of reflection and refraction, both of which depend heavily on the environment. If something is wrong with the way your glass behaves you probably need to tweak the environment.
Comment: The black parts on the hdri were indeed my problem. Thank you Niels.
Comment: @TrillDanny If the answer solves all the issues, don't forget to mark it as "accepted".

Glass shader has black parts


delete cart items using rest api magento 2

Question: I am using API to build  app but I need clear all items in cart but couldn't able find api for deleting cart..
Kindly let me know the API to delete the quote/all items in cart
Answer: By Magento default, we don't have API for remove all quote items,
so we have to extend to create an custom API with required access privilege
and get the quote repository by request cartId and loop through all of the items and delete it.
$quote = $this->quoteRepository->getActive($cartId);

foreach ($quote->getAllItems() as $item) {
$itemId = $item->getItemId();
$quoteItem = $quote->getItemById($itemId);
if (!$quoteItem) {
    throw new NoSuchEntityException(
        __('The %1 Cart doesn\'t contain the %2 item.', $cartId, $itemId)
    );
}
try {
    $quote->removeItem($itemId);

} catch (\Exception $e) {
    throw new CouldNotSaveException(__("The item couldn't be removed from the quote."));
}
}

$this->quoteRepository->save($quote);

Individual items removal
we can remove/delete the cart(quote) items by deleteById of item id,
/V1/carts/:cartId/items/:itemId

For guest cart items removable as ,
/V1/guest-carts/:cartId/items/:itemId

For customers' session cart items removable as,
/V1/carts/mine/items/:itemId

Please note, Replace your :cartId with cart/quote id and :itemId with quote item id
Answer: You can only delete the cart items one by one using the request DELETE {{magento_api_url}}/rest/default/V1/carts/<cartId>/items/<itemId>
Answer: I would create a new API clone of the default cart item remove v1/carts/cartId/Items/itemid and remove all the cart product using cartId. Please refer below code, that will help you to remove all the item from the cart.
  public function deleteQuoteItems(){
        //$checkoutSession = $this->getCheckoutSession();// Instead of checkout session you need to load quote factory using cart id in api.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$checkoutSession =$objectManager->create('Magento\Quote\Model\Quote')->loadByIdWithoutStore($cartId);

        $allItems = $checkoutSession->getQuote()->getAllVisibleItems();//returns all teh items in session
        foreach ($allItems as $item) {
            $itemId = $item->getItemId();//item id of particular item
            $quoteItem=$this->getItemModel()->load($itemId);//load particular item which you want to delete by his item id
            $quoteItem->delete();//deletes the item
        }
    }

    public function getItemModel(){
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();//instance of object manager
        $itemModel = $objectManager->create('Magento\Quote\Model\Quote\Item');//Quote item model to load quote item
        return $itemModel;
    }

Hope this will help you.
Comment: There is a cart truncate function in `\Magento\Checkout\Controller\Cart\UpdatePost::_emptyShoppingCart` which is: `$this->cart->truncate()->save();` So I think we don't need to rewrite the logic
Comment: Ya, you can use it but I think this is for the web, not for API. Still, you can check and make sure. :)
Comment: I'm sorry but I'm not sure if I understand what you mean by `not for API`. The API you wrote already in the answer, I just mean that you replace the function's body by the truncate cart method
Comment: @Jimmy yes you haven't got my point. In simple words, you can't use that controller file code for truncate cart from API. Because that is used for website only.
Comment: Could you give more information? I don't use controller at all, the function is `cart->truncate()` where cart can be get from session - just like in your code.


Could the Ancient Egyptian Ka be pronounced Ki?

Question: I am looking at the word /ki/ such as this . However, I noticed there are some words/sounds like /ka/ () which is one symbol. Typically you see the word for the "sun god of egypt" as Ra, but wikipedia has it as  and Re. So I'm wondering if Ancient Egyptian is sort of like Hebrew or Arabic in that the vowels could be left off and/or changed to anything really. Wondering how that works, and if it would be permissible to use the word  "ka" instead as "ki" (/ki/).
Comment: "... like Hebrew or Arabic in that the vowels could be left off and/or changed to anything really" ← that's definitely not how Hebrew and Arabic work. The vowels can be left off *in writing*, which doesn't mean they were randomly changeable in either writing or speech. What you might be thinking of is the fact that Semitic roots are often composed of consonants, and then what IE languages use suffixes or grades for is done by inserting different vowel patterns in between those consonants. They cannot be changed to anything, though, and the changes have specific meanings.
Answer: As Arnaud Fournet said, the modern "Egyptological" pronunciation has really very little to do with how the actual Egyptians pronounced the words. Hieroglyphic writing seldom if ever indicates vowels, and it has a bunch of consonants that English-speakers don't like.
So Egyptologists make the words pronounceable ("Ra", "Tutankhamun", "sekhem") like so:

If a consonant isn't in English, replace it with its closest equivalent (ḥ → /h/, q → /k/, etc)
If you can't find an equivalent, replace it with /a/ (ꜣ → /a/, ꜥ → /a/)
Replace w with /o/ or /u/, and j and y with /i/
Insert /ɛ/ wherever you like

In the case of "ra" (the word for "sun"), the Egyptian word is transliterated rꜥ. That second consonant (ayin) has no good equivalent in English, so it's replaced by "a". But the actual pronunciation was probably something like /riaʕ/ or /riʕ/, depending how you interpret certain evidence from Akkadian.
This does not mean the Egyptians didn't use vowels, or that they could change them around arbitrarily—it just means they didn't write them down. Pronouncing the word for "sun" as /ruʕ/ back in the Middle Kingdom would probably get you a bunch of blank stares. But nowadays, we generally don't know what those vowels were, and archaeologists are generally more interested in what inscriptions mean than how they were actually pronounced five thousand years ago. So they use the rules I mentioned above to turn them into something English-speakers can work with easily.
P.S. Because you mentioned it specifically: the "ka" you're talking about is kꜣ "life-essence", probably pronounced /kuʔ/, though Loprieno argues that ꜣ was actually /ʀ/ until somewhere after the Middle Kingdom. But the vowel definitely wasn't /a/, and the ꜣ was definitely a consonant.
You'll also see it spelled a bunch of different ways: D28 was the most common glyph for it, but it can also be spelled with a phonetic complement for the ꜣ, with a determinative for "life", and so on.
Answer: You have to be aware that the way modern Egyptology "reads" the hieroglyphs is artificial.
As you wondered on your own, hieroglyphs normally write only consonants. Egyptology inserts vowels to make blocks of consonants pronounceable in our languages.
For example god Râ or Re was written with two consonants r and &(ayn). We know from cuneiform that the vowels in these consonants were Ri&a.
Some languages in Nigeria have a word re& "noon".
Surprisingly, wikipedia explains nothing...
https://en.wikipedia.org/wiki/Egyptian_hieroglyphs


When was the earliest understanding that the stars were similar to the Sun?

Question: When did astronomers realise that the stars were similar to the Sun? I'm not asking for when this was established, but when also the hypothesis was first proposed.
Comment: At least Giordano Bruno thought so http://en.wikipedia.org/wiki/Giordano_Bruno#Bruno.27s_cosmology But I'm not sure that at those times there was such thing as "hypothesis" in modern sense.
Comment: He also suggested that the universe was infinitely large, and so nothing, in particular the earth, or the sun could be at the centre of it.
Answer: As found here, Anaxagoras suggested around 450 BC that the stars are far away Suns. This is the first known person to suggest this.
As is fairy common in the sciences, the idea was reinvented numerous times, but it didn't really catch on until the mid-1800s when spectral analyses on the Sun and stars carried out by Fraunhofer and Secchi (see this page) started showing remarkable similarities between Solar and stellar spectra.
Answer: Aristarchos of Samos was the first to talk of a heliocentric system. He certainly put the sun  at the center, though he puts stars on a sphere.

Archimedes wrote:
You (King Gelon) are aware the 'universe' is the name given by most astronomers to the sphere the center of which is the center of the Earth, while its radius is equal to the straight line between the center of the Sun and the center of the Earth. This is the common account as you have heard from astronomers. But Aristarchus has brought out a book consisting of certain hypotheses, wherein it appears, as a consequence of the assumptions made, that the universe is many times greater than the 'universe' just mentioned. His hypotheses are that the fixed stars and the Sun remain unmoved, that the Earth revolves about the Sun on the circumference of a circle, the Sun lying in the middle of the Floor, and that the sphere of the fixed stars, situated about the same center as the Sun, is so great that the circle in which he supposes the Earth to revolve bears such a proportion to the distance of the fixed stars as the center of the sphere bears to its surface.

His writings have been lost due to the great cleansing of pagan documents by christianity.
Comment: This is not really an answer to the OP's question...
Comment: It does have a bearing on it though. Its interesting that Aristarchus places the fixed stars at a much greater distance than the earth to the sun. I wonder whether this to get around parallax. Also for them to be visible at such a great distance they must in fact be very large. Whether he makes the plausible deduction then they must be similar things to the sun is something lost to history. If he had made that step, the next one would be to deduce that they must also have planetary systems. Why would our sun be the only one to have such a thing?
Answer: You have a good question. The answer is - we dont know. We know for sure it happened long time ago, probably at the beginning of science as we know it. You should know that there is no MATERIAL EVIDENCE about any ancient scientist. All text which are presented in posts above are just "official" hypothesis, in reality it could have been very different.
Look here http://en.wikipedia.org/wiki/Antikythera_mechanism
I would guess a guy who did that for sure had some clue about what stars are.


CSS box-shadow on three sides of a div?

Question: I want to have box-shadow on three sides of a div (except top side). How could I do that?
Comment: It's a dupe, but this one has a better answer in my opinion.  Can they be merged?
Answer: Here's a JS Fiddle for you, it only uses one single div to work.
#shadowBox {
    background-color: #ddd;
    margin: 0px auto;
    padding: 10px;
    width: 220px;
    box-shadow: 0px 8px 10px gray,
        -10px 8px 15px gray, 10px 8px 15px gray;
}

You set a shadow on the bottom, bottom left, and bottom right. With soft shadows it gets a bit tricky but it is doable. It just needs a bit of guesswork to decrease the middle shadow's blur radius, so that it looks seamless and not too dark when it overlaps with the side shadows.
Comment: I don't think this is the right answer, this seems to stack three separate box-shadows on top of each other, making each edge much darker than expected. Isn't there a way to add a single shadow to each side, or one shadow that will cover all three?
Comment: couldn't you get the same effect just by adjusting the y position of 1 box shadow?
Comment: @Vigrond I tried that, it doesn't make the shadow blur drop off of the sides far enough. You need to add two corner shadows to make the sides more even.
Answer: If you are looking for something like Google material design shadows:
.shadow1 {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.shadow2 {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
.shadow3 {
    box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}
.shadow4 {
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
.shadow5 {
    box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}

Source: https://medium.com/@Florian/freebie-google-material-design-shadow-helper-2a0501295a2d#.wyvbmcq10
Answer: Here's an example of the negative Y value suggested by @Vigrond
box-shadow: 0px -8px 10px 0px rgba(0,0,0,0.15);

Answer: I like @Chris C answer but I think, we do not need the first line of code. This is shorter and gives the same effect:
box-shadow: -10px 8px 15px lightgray, /*left and bottom*/
            10px 8px 15px lightgray; /*right and bottom*/

#note{
 position: absolute;
 top: 20px; left: 30px;
 width:100px; height: 100px;
 background-color: #eee;
 box-shadow: -10px 8px 15px lightgray,
 10px 8px 15px lightgray;
}

Answer: If you have a solid background color, then you can accomplish this by using a combination of background-color and z-index. The trick is to give the element with box-shadow and its previous sibling positioning, then give the previous sibling a background color and set it to have a higher z-index so that it's stacked on top of the element with box-shadow, in effect covering its top shadow.
You can see a demo here: http://codepen.io/thdoan/pen/vNvpKv
If there's no immediate previous sibling to work with, then you can also use a pseudo-element such as :before or :after: http://codepen.io/thdoan/pen/ojJEMj
Comment: It seems like a hack to stack the card on the other to cover up the shadow. Could cause breakage on other break points.
Answer: For translucent shadows with hard corners (i.e. no blur radius) I used this:
.shadow-no-top {
  position: relative;
  box-shadow: -5px 0 0 0 rgba(0,0,0,.2), 5px 0 0 0 rgba(0,0,0,.2);
}
.shadow-no-top:before {
  content: "";
  position: absolute;
  top: 100%;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background-color: rgba(0,0,0,.2);
}

This uses a shadow for the left and right parts and adds the :after pseudo content as the bottom shadow. This avoids overlaps which make the shadow darker or missing corners.
However, this does require the background of the element to be solid.

CSS box-shadow on three sides of a div?


Is it still possible to purchase 220 and 10×8 sheet film?

Question: Is it still possible to purchase 220 and 10×8 sheet film?  I am retired.  previously owned three pro. Photography studios looking to get back into work again.  Need help locating materials.
Comment: Are you comfortable buying online ? Also, why the photoshop tag ?
Comment: Where are you located? Also, are there particular types of film you are looking for (e.g. colour negative, reversal, black & white, particular emulsions, etc)?
Answer: There are a number of places where you can buy film today. That's mostly online now, but depending on where you live that could also be a specialty shop in your city.
To answer your question, 220 and 8x10 are still made, but not for all emulsion types.
Ilford (BW only) for example still makes 8x10 but 120 only, Fuji and Foma also make 8x10, Kodak is the only one I know of that still makes 220 but only for its colour negative line.
Here are two US based online shops where you can buy film, and filter by size

B&H
Freestyle photo
Answer: Whenever new technology comes around, it supposedly kills the older technology that it replaces. The thing is that technologies rarely fully cover the applications of another one.
Sure digital has its benefits and replaced film for most applications. The thing is that this doesn't mean that film is actually dead. People really like to see things dying (apparently) and made a big fuzz about it like the kodachrome becoming unavailable for example.
All that pretentious drama aside, film is not dead, because some applications of film are exclusive to film and digital simply doesn't deliver.
One such application is size. There's no digital medium format camera or any larger digital sensor readily and cheaply available. Well...admittedly, there is an 8x10 digital sensor, but its purpose is to replace the expensive polaroids, not the sheet film. This isn't mass market product either, obviously.

There are fewer film producers, but they still operate. The business condensed down.
I usually use ilford film, which is available in various types and sizes. They do not offer 220, but 120, if that's ok for you. They make no color film as far as I know.
http://www.ilfordphoto.com/products/producttype.asp?n=3&t=Black+%26+White+Films
They make sheet film as large as 20 x 24in, for situations like "Hey look at this super detailed large print I got from my gazillionpixel camera, isn't that great? Oh, you have a print, too. Can I take a look? Wait, why is it transparent and ...negative?"
Comment: This doesn't really answer where you can get film. The OP didn't specify what kind either, Kodak still makes 220 for colour for example
Comment: @Blackbird57 The question doesn't ask where one can get film, but if it is still possible to purchase it. My answer does answer that question: yes it is possible, because it is still produced. My answer also covers where to buy it, because the manufacturer provides information on his website (which I linked to) about that "WHERE TO BUY" is pretty clear in that regard.
Comment: Ilford is one manufacturer, they don't make 220 either. Also, *Need help locating materials* isn't asking where to buy ?
Comment: @Blackbird57 What's your problem? I stated in my answer that 220 is not available. Partial answers are valid answers, too. After all your own answer only mentions two online stores for film, which again, is perfectly fine, just the same as mentioning only one manufacturer. If you want to add something to my answer, edit it.
Answer: B&H, Adorama, and others may have online sales, but they have regular phone sales as well. Just call them with your film needs. Even if they don't carry the stock, they will have other suggestions.


present perfect progressive with stop/start

Question: A student asked me: Can I say 'I have been stopping this project / I have been starting this project' to express repeated action (with present perf. prog)?  My answer was 'no', but I am having a hard time explaining why.  The student is in an ESL class.  Can I explain this without using complicated semantics?
Comment: Is your student trying to say, "I've started and stopped this project many times"?
Comment: The reason is that starting and stopping are not ongoing actions, but occur at a specific point in time.  One could say "I have started this project three times but never get beyond the first exercise."
Answer:
I'm starting my homework = I haven't opened my books yet but presumably I will begin shortly or some time in the very near future.

I've started doing my homework = The focus is on the action and its results felt in the present (I am sitting at my desk, the books are open, etc.) If a time reference is mentioned then the Past Simple is needed e.g. I started doing my homework ten minutes ago

I've been doing my homework for over two hours = The Present Perfect Continuous is used for an action that began in the past and is currently in progress, i.e. doing. I am no longer in the process of starting homework, I am smack-bang in the middle of doing it.

They're stopping production = production will about to cease any moment, presumably it will happen soon.

They've stopped production = our attention is drawn to the fact that production has completely ceased. When the production stopped is not specified.

They have stopped producing X = The action which was stopped in the past and continues to the present is produce.

In order to use the PPC with stop, its meaning must be similar to "prevent from proceeding"

The drug has only been stopping the seizures for a year

to halt somewhere for a brief visit or stay

He's been stopping at all the best hotels

when it means to make a brief visit (to stop by) on one's way

People have been stopping by all day to pay their respects to Mrs. Bush.
and when the action of halting something or someone is repeated over a relatively limited span of time.

Police have been stopping and speaking to people all day in their bid to trace a missing woman.
Answer: I'm not sure about avoiding complicated semantics; it's either in many words or with words loaded with technical meaning.
To oversimplify considerably without using technical terms like aspect, perfect, or continuous, any verb form ending in '-ing' is talking about something that happens over a span of time (technically it is a grammatical 'continuous' aspect). But 'stop' and 'start' themselves are necessarily points in time (grammatically, this is the perfect or completed aspect).
To say "I have been stopping this project" is therefore very confusing, because either you stopped and are done, or you kept going and haven't stopped. To force some sense on to it would be like you are attempting to stop many times and failed to stop only to try stopping again, over and over.
"I am stopping now" is OK because you are in the process of slowing down to nothing, which takes a little bit of time. Also, you just tend not to say things like "I stop". While it fits all the grammatical patterns that people are taught, people hardly use it. Similarly, "I am stopping at" or "I am stopping by" more than one place is OK because you're doing a completed act at more than one place.
So it is strange (and not recommended) to say "I have been stopping a project" unless you really mean that you have stopped and started it many times including up to now.
Comment: Another technical term that could enter the discussion is *[telicity](https://en.wikipedia.org/wiki/Telicity)*.


Force Browser and Document Mode to ie9 in ie10

Question: This code:
<meta http-equiv="X-UA-Compatible" content="IE=9" />

seems to only change document to ie9 and not browser.  Any ideas other than hitting F12 and changing it manually?
Comment: It's not clear what you mean. The tag will cause IE to display the page using IE9 mode.
Answer: A site can not set the Browser mode. The browser mode is chosen before the browser requests content from the site. This specifies how the browser is identified to the site, such as the UA string.
As you mentioned, the Document mode can be set by the author by including a X-UA-Compatible meta element, or by the DOCTYPE used. This overrides the default set by the browser for that browser mode.
Changing the Browser Mode is only useful for using IE to test how an earlier version of IE would handle the site. You can change it on your local machine (but not for the site as a whole) by changing it in the F12 tool.
The user (and thus developer) can change the Browser mode by clicking on the Compatibility View icon in the URL field. This will also be only for that machine, and not for all users.
The only way to change the Browser mode globally is to get the site added to MS' Compat View List. But you don't want that unless the site uses a ton of old MS vendor specific code, and will not be updated.
You can read more at http://blogs.msdn.com/b/ie/archive/2010/10/19/testing-sites-with-browser-mode-vs-doc-mode.aspx
Comment: could you please tell me more about the - `get the site added to MS' Compat View List` . Is it something that can be done at the server level??
Answer: Optionally, you can alter the Web.config file to accomplish this as well. (You'll have to restart the service after publishing to see the changes.)
<system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="X-UA-Compatible" value="IE=Edge" />
      </customHeaders>
    </httpProtocol>
</system.webServer>

Answer: You can use the FEATURE_BROWSER_EMULATION feature of Internet explorer.
Start regedit.exe, go to
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
or
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
create a DWORD iexplore.exe and set the value to 9999 (0x270F).
Answer: see this.
you can force highest mode by adding:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />


Does visible light heat things up?

Question: During a sunny day the walls of my house warm up (no surprise). My question: how much of this warming up (if any) comes from visible light? I associate infrared with thermal energy. If my house was floating in space (to prevent any thermal exchange with its surroundings) and I installed a giant infrared (and UV) filter between it and the sun, would it still warm up (compared to its rest temperature in full darkness)?
Answer: Yes, it would, though not as quickly as if you were getting the full spectrum of sunlight. All frequencies of the light spectrum carry energy, so it becomes a question of how much of that energy is absorbed by the house.
For example, if your house was completely black, all that visible light energy would be absorbed by the house and converted into heat. If it was completely white (or massively reflective), there would be almost no heat transfer whatsoever.
Comment: Some misc point. Black is the best absorbing colour for our natural  spectrum of light. For different spectra the best absorbing colour could be different from black.
Comment: Interesting example: certain fabric cleaners make clothes appear "whiter-than-white" by leaving chemical residue on clothes that absorbs uv rays and emits visible light.  This is similar to absorbing visible light and emitting infrared (heat).
Answer: To add to the answers so far, here's a outline of a pretty crude calculation you could do.
Let's assume the house is in space. That way, we won't have to worry about the other parts of the Earth equilibriating with the house. Now let's assume your house is a perfect blackbody (which may or may not be a good approximation depending on how your house is painted.) Also assume the Sun is a blackbody as well. Then if the house-sun system is in equilibrium, the energy emitted by the Sun that strikes and is absorbed by the house will also be emitted in the form of blackbody radiation. Using the Stefan Boltzmann law, you could calculate the temperature of the house. If you put filters in, you'll need to use Planck's law and some calculus.
Answer: Yes. All matter that interacts with light absorbs it to some degree. This is true whether you're discussing UV or infrared or visible light. For example, the earth wouldn't be nearly as warm as it is if it didn't absorb visible light.

Does visible light heat things up?


ISC DHCP server: how to use "reserved" statement

Question: I've been looking online, cannot find a single example of how to use the "reserved" statement. Supposedly it goes into the dhcpd.leases file. Stop dhcpd, edit the file, and restart. But it doesn't seem to be working because after restarting it disappears from the file. Can someone give an actual example of where/how to use it and the procedure for making it work?
Answer: After more digging I finally across this: how to set the reserved flag using OMAPI
Apparently this can be done only from the omshell command, and there's an undocumented bit operator for the flag in order to set it. I followed the instructions, and the lease file does show "reserved" now. I dont' know how to test it, though.


Magnetic flux through circular loop due to infinite wire

Question: I'm trying to calculate magnetic flux that's going through circular loop with radius $R$, due to magnetic field of a infinite wire that is in distance $d$ from the center of the loop. $\vec{B}$ vector is parallel to $\vec{dS}$ vector. I know that magnetic field of that wire is equal to $B=\frac{\mu_0 I}{2\pi r}$ and that flux is equal to $$\int_{S} \vec{B}\cdot \vec{dS}=\int_{S} B\cdot dS$$ where $dS$ Is surface of the loop, but what I don't know is how to change that $dS$ so is possible to solve.
Comment: How is the loop oriented relative to wire?
Comment: @R.W.Bird surface vector is parallel to B vector
Comment: Is the wire coplanar with the loop, like its forming a chord?
Comment: @lineage yes, I didn't know the word for that, but it is exactly what I mean. I added photo for better understanding.
Comment: @KacperKowerski hint: what exactly do you think is the area that you need to integrate? What direction does the magnetic field of an infinite wire depend upon? Does it have any symmetry that may simplify the calculation?
Comment: @lineage I know that I need to integrate only half of this loop because other half has the same flux, but I don't know to write it down. Should I use polar coordinates or cartesian?
Comment: @KacperKowerski Cartesian works but the integral seem difficult to do by hand. For |d|>R, its $\propto(d+R)-\sqrt{d(d+2R)}$....center - geometric mean
Answer:
The convenient infinitesimal surface $\rm dS$ is shown in the Figure-01 :
\begin{equation}
\mathrm{dS} \boldsymbol{=}\mathrm{hdw}\boldsymbol{=} (2R\sin\theta)( \mathrm d\ell\sin\theta)\boldsymbol{=} (2R\sin\theta)( R\mathrm d\theta\sin\theta)
\tag{01}\label{01}
\end{equation}
so
\begin{equation}
\mathrm{dS} \boldsymbol{=}2R^2\sin^2\theta\mathrm d\theta\boldsymbol{=}R^2(1\boldsymbol{-}\cos2\theta)\mathrm d\theta
\tag{02}\label{02}
\end{equation}
We could verify that
\begin{equation}
\int\limits_{\theta\boldsymbol{=}0}^{\theta\boldsymbol{=}\pi}\!\!\!\!\mathrm{dS}=\pi R^2
\tag{03}\label{03}
\end{equation}
Hence for the magnetic flux through the circle we have
\begin{equation}
\Phi=\int\!\!\!\int\limits_{\!\!\!\!\!\!\bf circle}\!\!\mathbf{B}\boldsymbol{\cdot}\mathrm{d}\mathbf{S}=\int\!\!\!\int\limits_{\!\!\!\!\!\!\bf circle}\!\!\mathrm{B}\,\mathrm{dS}=\dfrac{\mu_{0}\mathrm{I}R^2}{\pi }\int\limits_{\theta\boldsymbol{=}0}^{\theta\boldsymbol{=}\pi}\!\!\!\!\dfrac{\sin^2\theta\,\rm d\theta}{\mathrm{ L}-R\cos\theta}
\tag{04}\label{04}
\end{equation}
In Figure-02 below we see a detail of Figure-01  corresponding to this comment of OP :

Why $\rm dw=\sin\theta d\ell$ ? – cover
Comment: How do you make these visuals??
Comment: You wrote that h=2R$\cos\theta$ and dw=Rd$\theta\cos\theta$, but later dS equals to $\sin^2\theta$, why $\sin\theta \cdot \cos\theta$ equals $\sin^2\theta$?
Comment: @Buraian : I use GeoGebra. It's free.
Comment: Why $dw = \sin\theta dl$?
Comment: @Buraian The images are fantastics....and also the answers :-)
Answer:
fig 1: The geometry of the calculation. Note that the distance of the wire from the center has been taken to be $D$, not $d$.
Let the magnitude of the magnetic field due to an infinite constant current carrying straight wire at a distance $r$ from it be $k/r$.
In the given geometry, the wire is co-planar with the loop. This makes the problem effectively $2$ dimensional. Taking the interior of the circle (in its embedding plane) as the surface of integration of flux calculation, the magnetic field is everywhere (anti)parallel to the surface normal vector, as noted in the question.
Since the magnetic field is only dependent on the distance from the wire, it is constant in the small differential patch of area $2\,y\, dx$, colored gray in fig $1$.  The magnitude of the total flux is then given by
$$
\begin{align}
I&=\int_{-R}^{R}\frac{k \,2 y dx}{r}&\\
&=2 k\int_{-R}^{R}\frac{\sqrt{R^2-x^2}dx}{D-x}\tag{1}\\
\end{align}
$$
which equals$^{A.1}$
$$
I=
\begin{cases}
2\pi k (D-\sqrt{D^2-R^2})& D>R\tag{2}\\
\phantom{}\\
2\pi k D & D\leq R\\
\end{cases}
$$

Appendix

The integral in the RHS of equation $1$ is (via Mathematica)
$$
-y+D\tan^{-1}\frac{x}{y}-\sqrt{D^2-R^2}\tan^{-1}\left(\frac{D x -R^2}{y\sqrt{D^2-R^2}}\right)
$$
where $y=\sqrt{R^2-x^2}$ with limits $(x,y)$ going from $(-R,0)$ to $(R,0)$. One has to be careful with the limits here. While the third term is imaginary for $D<R$, it cancels out for the limits.

First case of Eqn. $2$ has the expected asymptotic form, $ k \pi R^2/D$, for $D\to\infty$. Interestingly, if one considers only its real part, it holds for $R\to\infty$ too.

The second case of Eqn. $2$ viz. the case of the wire being inside the loop, is remarkably independent of $R$ and depends linearly on $D$. This was indeed verified numerically$(1\sigma)$.

fig 2: Monte-carlo verification of eqn. 2  for $R=1,2\,\,(k=1)$
Comment: What if i want $d$ to be in the center of the loop, because I came to same equation as you but in my case $d$ is in the center of the loop. How should I write integral with my $d$?
Comment: @KacperKowerski give me a sec I am changing it to centered form
Comment: Well, I meant on integral level. Because when I try to calculate integral with your replacement I get much more complicated answer than I should.
Comment: At the integral level, all that happens is in eqn 1, the denominator becomes $D-x$ ...the "level" of susbstitution shouldn't matter as $d,D,R$ are constant during integration. The limits are the same


Eclipse hangs on reverting resources

Question: I use eclipse Indigo, subclipse 1.10.x and javaNL. Whenever I try to refresh my project in eclipse, it gets stuck at Reverting Resources 0% and Computing Update Requirements 0%. I try to kill eclipse and reopen the project and it still does the same.  I do not understand why this happens. It started happening recently. Before it was working fine.
Answer: Question:  I do not understand why this happens
General Answer: http://www.ihateeclipse.com/
(I may share this opinions and dont think Eclipse should be called a IDE but that wont fix your problem - hence lets proceed with possible workarounds).
Possible Workarounds:
1.) Starting eclipse in clean mode How to run eclipse in clean mode? and what happens if we do so?. (This solved aprox. 80% of my continuously returning 'I messed up my own state' issues I experienced).
2.) If that doesnt help - you would have to stop eclipse, identify the according files (or just any files holding such information) and delete them manually, then restart eclipse. Like I still encounter issues with my "Search Type" (Ctrl+T) and have to delete the files like described here Eclipse type hierarchy not always working (unfortunately I don't know anything about files regarding your current issue - so feel free to downvote my "answer" since its not directly answering your question).
The best things I found about "the full reset" seem to be: http://letsgetdugg.com/2009/04/19/recovering-a-corrupt-eclipse-workspace/ or http://blog.pdark.de/2011/09/02/restoring-a-corrupted-workspace-in-eclipse/ (Note: I haven't verified the described behaviors).
3.) Recreate Workspace - delete any eclipse belongings like the <code>.metadata</code> folder and keep only belongings of your project (e.g. sources, resources etc.). Then create a new eclipse project based on you existing project sources).
4.) If Steps 1-3 failed consider reinstalling Eclipse (include above Step 3 in this process again) or switching to a proper IDE that can at least handle its own state.
5.) I experienced rare cases where in the end such things were triggered by me rather than occurred magically out of nowhere by eclipse - I don't see any possibility on how you could manage that in your case unless you messed around with the eclipse source itself).
Hope this helps - Even thus the SO community is big I experienced way better results asking the eclipse developer community directly when it came to such specific issues (you however oftenly get a link to a open Bug ... that they created because of your question) and ended up "just importing into a new eclipse workspace from existing sources" whenever I experienced such issues lately (It takes me about 5 minutes to checkout our sources, start Eclipse with -clean as default and import existing Maven projects solving any eclipse-only issue - while each of those eclipse-issues can take days to be solved without any further advantage for my daily business)
Comment: #2 fixed this problem for me. I deleted .metadata/.plugins/org.eclipse.core.resources and then reimported the projects.
Answer: I don't know if this will help any one but I had the same issue. Some links advised me to delete my metadata, which I did not want to do.
What fixed it for me was:

I have multiple eclipse workspaces, I manually closed my eclipse using the System Monitor/Taskbar as it wouldn't let me close as it was hanging.
I switched workspaces and it seems to run fine. So I switched back to the one that was hanging and the problem seemed to have gone.
Comment: Worked for me, too. Killed eclipse -> Renamed my orig. workspace -> Restarted eclipse -> Closed eclipse again -> Renamed my orig. WS back -> Restarted eclipse.
Answer: This worked for me:
Go to to your workspace instalation, and manually delete the target directory under your maven projects (dont worry , maven will create another one when compiling). This removed my stuck Eclipse state  (thread) in "Revert sources", always at 0%.
Answer: this helped me:
delete files "*.snap" under org.eclipse.core.resources in
worskpace/.metadata/.plugins/org.eclipse.core.resources/
and share project again (setup SVN settings)
Answer: I accidentally checked in target files to SVN. And the target files were huge ans hence it was stuck on reverting resources. Once I deleted those target files from SVN this issue never happened.But JBA's answer is pretty comprehensive so I will mark that as a right answer.
Answer: I have this same issue, and I just quickly cancel the "Rerverting Resources" task while it's in "waiting" mode when restart Eclipse.
Answer: This should work to 100% and helped in my case (no other tried solution worked):

Go to "Eclipse > Help > About Eclipse IDE > Installation Details

Uninstall the following packages "Subclipse", "Subclipse Integration for Mylyn", "Subversion 1.14 JavaHL", "Subversion Revision Graph", "SVN Client Adapter".
pluginsToUninstall

Go to the marketplace and install "subclipse" again.

Rightclick on your project > Team > Refresh/Cleanup

You are welcome. :)

Eclipse hangs on reverting resources


Mounting ISO image from USB at boot time

Question: Is it possible to mount a ISO image from USB disk and to use it as a filesystem at boot time(with grub)? I ask it because I would like to put the kernel linux image and an ISO to be used as a filesystem(with fedora bootstrap) into an USB disk(without creating new partitions, etc.), as it is possible to do by using Qemu, for example.
Answer: Qemu is a virtualization/emulation environment. Grub is a bootloader, designed to get a kernel loaded into memory and start it executing.  Neither program is directly related to your question, although you could certainly use Qemu to execute a VM that uses Grub to start Linux to do what you want.
Modern Linux distributions create an initrd, which the bootloader puts into memory for the kernel to use as its initial root file system.  The initrd does things like loading the modules necessary to access the hard disks where the real root file system lives.  In your case, you should look at having the initrd find your ISO, mount it, and use it as the root.
The contents of initrd vary based on what distro you're using.  I'd grab a livecd from somewhere, dump its initrd's contents with zcat /boot/initrd-2.6.whatever.img | cpio -id, and check out what it's doing.  Look for the init file, which will be the first user-space process run by the kernel.
Answer: Grub's loopback feature should allow you to boot a kernel and initrd from within an ISO image.  Unfortunately, there's no way to allow the kernel to mount a loopback device as the root filesystem, so I think you're out of luck.


Can I directly call an Apex method from Python without exposing an endpoint?

Question: We have a Python test library that uses Simple Salesforce that we use to run tests on our code base. So far we have been using endpoints to trigger Apex methods from outside the org. As per the documentation under "Using Apex", we can only call endpoints. Is there any way to trigger an Apex method without exposing an endpoint, maybe using the session Id or something?
Answer: You cannot directly execute Apex Code purely using the REST API. The two means for executing code directly are Web Services (SOAP API) and Execute Anonymous (Tooling API). You could modify the Simple Salesforce library to use either of these techniques, but you'll need to write your own code to get this to happen. Using the Tooling API would arguably be easier, as you just call /services/data/vXX.X/tooling/executeAnonymous?anonymousBody=<<encoded-apex-code>>, but requires Author Apex in order to run. Using a web service requires implementing a simple SOAP client, such as the one implemented in the AJAX Toolkit (sforce.apex.execute). One could look at the source and port it to Python, but again, this is work you'd have to do, since the library doesn't currently have this feature.
Answer: It's possible, although it may not be useful or wise in all situations.
simple_salesforce does not directly provide Tooling API support, but it does provide a generic Salesforce.restful() method to make a call to (a) REST API. You can execute Anonymous Apex (assuming your user account has the right to do so) like this:
import simple_salesforce

sf = simple_salesforce.Salesforce(YOUR_CREDENTIALS_HERE)
result = sf.restful('tooling/executeAnonymous',
                    { 'anonymousBody': 'insert new Account(Name=\'Test\');' })

You'll get back a response like:

OrderedDict([('line', -1), ('column', -1), ('compiled', True), ('success', True), ('compileProblem', None), ('exceptionStackTrace', None), ('exceptionMessage', None)])

Bearing in mind that Anonymous Apex applies user permissions as test context does not, I would suggest that this is broadly not a good way to perform testing. It is more useful in glue scripts. For automated testing, I would rather use Salesforce DX to initiate the test run and return results.
Comment: I wholeheartedly agree, @SebastianKessel, that it is in most cases a terrible idea. I have some sandbox setup-type scripts where I need this, though, and I think it's a fair solution there.
Comment: I really want to upvote because it's certainly a creative solution, but it's such a dangerous practice that I'd rather nobody get the idea that this is ok to do in most cases.
Comment: It definitely is. I admit I only didn't upvote to avoid the impression of your idea being a good one for all cases.
Comment: this has been updated to sf.toolingexecute('executeAnonymous', method='GET', data={'anonymousBody': 'insert new Account(Name=\'Test\');'})


What are degenerate polygons?

Question: What are degenerate polygons? How does one check whether a given pair of polygons is degenerate or not?
Comment: Context? I don't believe "degenerate polygon" has a standard definition.
Comment: My guess is that these are polygons in which two adjacent vertices are the same.
Comment: If I have two convex polygons, how what would be degenerate ? if they share a common side or if they overlap? or none? or both?
Answer: A polygon is degenerate if some of its vertices lie on each other. e.g the triangle (0,0),(0,1),(0,0) is degenerate. It has 3 sides, and 3 vertices, but two of vertices repeat. It's possible to repeat a vertex multiple times (for example (0,0),(0,0),(0,0) is another degenerate triangle). By definition, checking whether a polygon is degenerate or not is easy.
But what are the uses of degenerate polygons? One application from graphic acceleration (3D drawing) is as follows:
In 3D drawing GPUs normally use triangulation to render images. The (simple) reason for using triangles is because they are simplest possible 2D objects so don't need much hardware.
If we want to draw a complex 3D image, by this GPU limitation, we have to decompose it into multiple triangles. But if we call the GPU to render each triangle separately, it would be very slow (because of the number of calls). So the triangle strip is used to reduce the number of calls to the GPU.  A good explanation of triangle strips can be found on Microsoft Documentation: Triangle Strips, also you can see the wiki for: Triangle Strip.
But the problem arises when we want to draw two separate objects in one strip. In this case degenerate triangles help. The GPU can detect the degenerate triangles and skip their drawing. So we can connect two separate strips with one degenerate triangle.
In general if we have $n$ different components, such that we already have their corresponding triangle strips, we can draw them all by just one call to the GPU. This causes to extra memory usage, but it is a trade off between the number of calls to the GPU for rendering and the overhead of using an extra, degenerate triangle.
Comment: Could you clarify if degenerate means only *adjacent* equal vertices, or if the definition includes non-adjacent equal vertices? (A sincere question—not just trying to improve answer)
Answer: A degenerate polygon is one that has zero area.
The answer chosen above does not fully define a degenerate polygon. Consider the case of a square with two identical vertices. This could be defined as one or two non-degenerate triangles.
Comment: If user742's answer is correct then this wouldn't be true.  Take a square.  If two and only two vertices are the same then it is a triangle and thus the area is > 0.
Comment: and you clarified this well. a triangle is not degenerate.
Answer: As others have noted, it depends. Generally speaking, a polygon is non-degenerate if it has no anomalous points, but this just pushes the problem back one step; what is "anomalous"?
The real answer is that a polygon is degenerate if it violates the specification. The slightly rude answer is that a polygon is degenerate if it is an edge case which your algorithm can't handle.
Here's an example from the world of GIS. The OGC Simple Features Specification has a very careful definition of what makes a polygon "valid". Quoting from Section 188.8.131.52:

The assertions for Polygons (the rules that define valid Polygons) are as follows:
a) Polygons are topologically closed;
b) The boundary of a Polygon consists of a set of LinearRings that make up its exterior and interior boundaries;
c) No two Rings in the boundary cross and the Rings in the boundary of a Polygon may intersect at a Point but only as a tangent, e.g.
  $$\begin{align*}
& \forall P \in \hbox{Polygon}, \forall c_1, c_2 \in \hbox{P.Boundary}, c_1 \ne c_2,\\
& \forall p, q \in \hbox{Point},\,p,q \in c_1, p \ne q,\\
& \left[ p \in c_2 \right] \Rightarrow \left[ \exists \delta > 0 | \left[\left|p-q\right|<\delta\right]\ \Rightarrow \left[ q \not\in c_2 \right] \right]
\end{align*}$$;
Note: This last condition says that at a point common to the two curves, nearby points cannot be common. This forces each common point to be a point of tangency.
d) A Polygon may not have cut lines, spikes or punctures e.g.: $\forall P \in \hbox{Polygon}, P = \hbox{P.Interior.Closure}$;
e) The interior of every Polygon is a connected point set;
f) The exterior of a Polygon with 1 or more holes is not connected. Each hole defines a connected component of the exterior.
In the above assertions, interior, closure and exterior have the standard topological definitions. The combination of (a) and (c) makes a Polygon a regular closed Point set.

What are degenerate polygons?