How do I get three stars on "The Pit" in Special Ops?

Question: I've completed the campaign mode of Call of Duty: Modern Warfare 2 and I want to complete Special Ops. I'm stuck on "The Pit". We have to complete the level in 35 seconds to get three stars. I was only able to get two stars no matter how many times or how hard I tried. Can you give me some suggestions (e.g., shoot from the hip, or shoot while running rather than aiming down)?
Comment: Well, I started playing multiplayer and it improved my game a lot. Now, completing Spec Ops is very easy for me :)
Answer: It's much easier with a co-op partner. When I did it, we split the targets between us in a predefined fashion so we had the whole run choreographed. I think aiming is necessary but only for a split second i.e. aim-shoot all at once.
Comment: You ABSOLUTELY have to do them in co-op. Some of them are pretty much impossible any other way. Especially some of the Echo's.  They are all possible though (I've done it!), but definitely find a buddy.
Comment: Co-op obviously helps but you need to get your accuracy, weapon choice and reload/weapon-change timing sorted before you can do it. Otherwise the other player will just be carrying you. If you practice and think about what weapons to use and where each shot goes it's totally do-able solo.
Answer: Use the pistol you start with and the Deagle. Line up your shots so one bullet takes out two targets (possible 3 or so times).
Switch to the other pistol instead of reloading.
Comment: This is the best way to go. I, now, manage to complete the pit within 25-30 seconds easily.
Answer: The key to completing The Pit in under 30 seconds is accuracy. The more accurate you are, the higher your bonus and the more seconds that are knocked off your actual time to give your final "score" time.
If you hit any civilians, forget it - start again.
Also, try and make use of the "snap" auto-targeting feature if you have the opportunity.
Other than that, it's just practice. It can be done solo - I did it a few weeks ago myself.
Comment: +1 These are the real keys to this mission (co-op obviously helps but is no good without these points). The key to the pit is absolutely accuracy. I did the pit on vet solo as well. Don't hit any civilians, you'll need almost all of your shots to hit (auto-targeting is crucial). I used 2 pistols (don't remember which ones) as they seemed best for getting off accurate shots quickly and fast reloading.
Answer: I did it solo, after a gazillion tries, found out that lining up targets is the key, and reloading as rarely as possible.
Use the MP5, its aim-down-sight (ADS) and reload time is shorter than others.
Run between targets, ADS, fire single shots, AIS, repeat.
Melee the target at the top of the stairs, reload before jumping down.
Comment: If you're sufficiently accurate, you don't need to reload. If I have to reload my gun, I start over as if I'd shot a civilian.
Answer:
Choose your guns: I recommend ACR and M9 Tactical.
Switch weapons: In the house, as soon Shepard says MELEE Switch to your pistol, continue like that.
Practise: Don't just think it'll be a one time miracle, practise.
Don't hit civilians.
Answer: Keep moving....the game itself gives you hints: if you listen to the voices talking as you negotiate the course you hear something about using the Desert Eagle.
I personally used the M9 and the .45, but the Eagle is good. Pistols are faster to change to, and you also seem to move quicker.
You can still auto aim as you move, it will slow you down a bit but not too much. You can move and shoot at the same time in other words. Hitting two targets is key, you have the possibility of doing it five times (I think).
At the third set of targets inside the house, change weapons at the top of the stairs as the dude yells "melee".
Once outside, If you've got double targets straight in front of you nail them, otherwise turn to your right and nail them (if you don't get the sync for hitting double targets here, I found shooting right to left is the fastest).
Reload before you jump and take out the two targets on the left simultaneously, then move right. Nail these guys here, the hit your two final targets.
Remember, move at all times. Its the only way I found to beat the obstacle.
Answer: There are some perfectly workable solutions here already, here's another.
I often run through the pit before a play session in order to warm up and "calibrate" my thumbs. If I'm not hitting stationary targets without any lag, I'm not going to hit moving ones in an actual game.
My goal is to get through in under 30 seconds twice in a row. With the M4.
Since I'm warming up for actual play, I use a real weapon like I'd use in the game. You could use one of the other weapons beside the M4 if that's more your style, such as the SCAR or the MP5. You should be able to get all the way through the course without reloading, so don't worry about your secondary weapon.
You can get through without reloading by firing single bullets, rather than bursts. You can get away with firing a few 2-3 shot bursts, but too many of those and you'll have to reload, ruining everything.
It's also very helpful to line up targets and hit two at a time. This also helps conserve ammo.
Double opportunities:

Before you enter the first room, you can line up one of the targets at the sandbags with the one moving back and forth in the lower room windows.
Depending on your timing, you might be able to line up some of the targets at the top of the stairs, after using your knife.
After jumping down you can line up almost every target with another one. The one on the far left lines up with one deep. You can aim at the deep one as you're falling, and once the close one is in the way, shoot.
At the very end, don't even aim at the targets in front of the exit tunnel. You can hip fire right through the one in front and hit the back, consuming whatever bullets you have left. Sprint to the end with your empty gun.
Comment: For me, In terms of best time possible, I found it easier to use two pistols - as you seem to run slightly faster with them rather than the M4 or MP5. Further to this, the 'fast switch to secondary' counts for both pistols. The M9 has a large clip, and the USP.45 has the tactical knife for the melee section.
Comment: @Robotnik I've gotten slightly faster times using two pistols, that's true. I wasn't trying to answer how to get the fastest time, though, as that's not the question. You do run a bit faster with the pistol than with the M4, but not faster than with the MP5. Submachine guns and pistols have full run speed. Assault rifles are slightly less. 97.5%, I think. Or maybe it was 92.5%. Pistols have the advantage of not slowing you down when looking down the sights, also.


Pi 3 goes to emergency message when trying to boot from pi 2 hard drive, can I make it boot?

Question: I have a raspberry pi 2 which I've had booting off a USB SSD hard drive for some time. Now I have bought a raspberry pi 3 and was hoping that it would be as simple as swapping the hard drive and setting the appropriate cmdline.txt on the SD card of the new raspberry pi. Unfortunately, the pi 3 seems to start the boot process, but ultimately stops and reports a message starting with "Welcome to emergency mode!". The exact message is the same as the one shown in the image at the bottom of this post (but this is just an image from the internet, net what's actually shown on my screen)
Here is exactly what I have done. On the pi 2 I had a large format SD card (which doesn't physically fit in the new pi 3). On this card I have set cmndline.txt to the following:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=712ae4a6-73d8-4aca-9ec6-b6e507c95f74 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait program_usb_timeout=1 max_usb_current=1

I have formatted my SSD USB drive and given the root partition the PARTUUID shown in the command line.
fstab on the SSD contains the following:
proc            /proc           proc    defaults          0       0
PARTUUID=d96b7723-01  /boot           vfat    defaults          0       2
#PARTUUID=d96b7723-02  /               ext4    defaults,noatime  0       1
PARTUUID=712ae4a6-73d8-4aca-9ec6-b6e507c95f74  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

To move to the pi 3, I have a new SD card with raspbian installed(pi 2 is also running raspbian, this is what is installed on the SSD), but have again edited the cmdline.txt to be the same as on the pi 2. Apart from that I have left everything the same.
In case it is relevant, during boot, I get a message:
a start job is running for dev-disk-by\x2dpartuuid-d96b7723\x2d01.device/start timed out

This runs for 90 seconds then the boot process continues. Looking through the systemd journal I see an entry like:
Timed out waiting for device dev-disk-by\x2dpartuuid-d96b7723\x2d01.device

There are other errors after this, but I guess this is the root cause?
So, can this work, and if so, how?
Answer: The problem is that my fstab still looked for the boot partition of the old SD card which was referenced by PARTUUID=96b7723-01. My SSD PARTUUID has not changed, but the SD card has. I changed this to /dev/mmcblk0p1 and I can now boot as it finds the new SD card partition.


Cancelling Schengen Student Visa Application

Question: I have applied for a student visa at the Portugal embassy in my home country and my visa has been granted. The embassy has called me to buy a ticket and present it to the embassy so that they can stick it to my passport. If I don't want to go to Portugal anymore (for personal reasons), can I ask them to cancel the granted visa and collect my passport? Does this cause any problem for my future Schengen visa or student visa applications?? Or would it be better for me to travel to Portugal and like stay there for 2 weeks and then come back?
Comment: Is it really necessary to close this as off-topic because it's about long-term travel? The question is about cancelling a visa. Unless the answer is different for a multi-year study visa than for a short-term visit visa, why not just answer the question here?
Comment: Why did they ask you to purchase the ticket before getting the visa affixed in your passport? Typically all they want is a printout of a booking without the ticket being actually purchased. Was there something during the visa interview which made them somewhat suspicious you would not be traveling?
Comment: @SheikPaul: It's the routine in here. When the visa is ready, you have to provide them with confirmed flight tickets.
Comment: @DavidRicherby: I tagged long stay visa because I'm talking about cancelling a long stay visa before using it. I just wanna know if that causes any problem or not (like banning from applying for another one in the future, bad visa application record, etc)
Comment: @Arrrr Your tags are fine and I think your question is fine. But people here seem to automatically vote to close any question about long-term visas as being off-topic.
Comment: @pnuts See my previous comment. In cases like this, where question applies to all visas, why close just because the visa mentioned happens to be a long-term one? If the question had just said "visa" instead of "student visa", the answers would be the same and nobody would vote to close. So is the question really off-topic? I don't think so.
Answer:
If I don't want to go to Portugal anymore (for personal reasons), can I ask them to cancel the granted visa and collect my passport?

YES. You are a free human being and are allowed to change your mind. Your passport is your (and your country's) property, not the Portuguese embassy's.

Does this cause any problem for my future Schengen visa or student visa applications?

In itself should not if there is no suspicion of fraud on their part. People are issued visas all the time and don't travel without any detrimental infect on them.

Or would it be better for me to travel to Portugal and like stay there for 2 weeks and then come back?

Would not make sense in general, and particular in this case where you have a students visa. Actually I think that could be viewed more negatively. A student visa is not meant for tourism.
Comment: +1 I don't know specifically about Portugal, but in general you are supposed to use a visa to enter a country only when traveling for the purpose you stated when applying for the visa.
Comment: Please if possible answer this question I have as it is rather urgent, I have talked to a lawyer today and I have been told that if I ask to cancel my visa, they will most probably reject all my future applications. To what extent is this true and what if I apply through another embassy next time?
Comment: The lawyer does not know what he is talking about. Unless you lied on your student visa application. Did you tell some lies on the student visa application? If no, you have nothing to worry about. If yes, then you could be in trouble and subsequent applications denied for fraud. What good reason do you have for not wanting the students visa anymore?
Comment: I did not lie. I did want to go to Portugal but I just changed my mind. The actual reason is that instead of going there I wanna start a business somewhere else and not interested in doing my master degree anymore.


db2 SQL0930N error on linux - not enough space to process this statement

Question: This is another newbie question on db2, related to space.
How to I start diagnosing and then solving what the problem is so that users can connect to this database?
This error is displayed when both connecting to an existing database as well as when creating a new database.
db2 => list database directory

 System Database Directory

 Number of entries in the directory = 1

Database 1 entry:

 Database alias                       = SAMPLE
 Database name                        = SAMPLE
 Local database directory             = /home/mylogin/sqllib
 Database release level               = f.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

db2 => connect to sample
SQL0930N  There is not enough storage available to process the statement.
SQLSTATE=57011
db2 => !uname -a
Linux myhostname 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
db2 => create database newdb
SQL0930N  There is not enough storage available to process the statement.
SQLSTATE=57011
db2 =>

Answer: Check db2diag.log around the time of the error -- you will see what memory pool is exhausted or misconfigured.


Combination of Triangles and Quads in a mesh

Question: Is it topological correct to combine triangles with quads to form a mesh. If not, why?
Answer: Topologically correct is a very vague.
I believe you think of Polygon-Meshes when you say meshes, which is to represent the surface of the object by a patch of polygons, in most cases triangles or quads. There are other options to model meshes, one idea would be to use signed distance functions as for example in constructive solid geometry.
So back to the question. Is it correct to mix the type of polygon? Yes. There is, mathematically and theoretically nothing stopping you from doing it.
The only real 'correctness' criteria that comes to my mind is the one of the mesh being a manifold. This is in (overly) simplficated the property that the mesh has a defined outside and inside and no strange places where you can't decide. (This happens for example if the mesh intersects with itself, but it get's freaky). And having different types of primitive does not violate the manifoldness of the mesh.
But most algorithms can actually deal with non-manifolds. There is no problem in rasterizing or raycasting a non-manifold as these algorithms process each primitive separately.
The more interesting question here is: Why DONT we mix the type of primitive?
And here the answer is very simple: Efficiency. You want to design an algorithm that handles your mesh as efficient as possible, and so you assume it's only one type of primitive. And at some point in time, because triangle-meshes are really handy, hardware and hardware-api began to adpot mainly to processing triangles. And now they are good at that and even other primitive types get split into triangles since splitting and rendering triangles is still faster than rendering the polygons directly.
So in short: You can mix polygon types, but if you want to be fast, use only triangles since they are simple and widely used.
Comment: Also if you use subdivision meshes then all quads makes it easier for you to anticipate how the mesh flows. Which can be important to the artist
Answer: None of today's graphics interfaces support quads by default in the first place.
This means that quads, when actually set up for rendering, are just pairs of triangles.
Comment: Well on hardware side but in software renders its actually pretty common. After all a quad representation is more compact.
Comment: "_After all a quad representation is more compact_". Surely not when compared to a triangle strip/fan.


How can I add a calender to my Android tablet?

Question: How can I add a calender to my Android tablet? In Settings>Accounts& Synch I can only create Exchange account. There is no option to create any calendar. I do not have android market, google calender, gmail android apps. I standard calendar pre-installed - but I can do nothing because I have no calendars to save events. How to fix it?
Answer: Seems like you have an Android tablet without the Google APIs. This are devices that use Android but without a Google branding ("with Google (TM)") and Google Services Framework (Google API) to avoid paying fees to Google.
Android itself is open-source so every manufacture can use it without charge on their devices, but if they want to have the Google Services like Market, Maps, Navigation, Google Calendar and so an, they have to pay a license fee to Google. You can recognize devices with Google Services based on the "with Google (TM)" branding on the back of the device.
AFAIK there a ways to install the Google API when you have root on your device.
Comment: What do you mean by "avoid paying fees to Google"
Comment: @roxan I have updated my answer
Comment: Thanks I didn't know about that. Do you have some reading material regarding the license fee?


How does a mobile WordPress theme differ from a simple theme?

Question:
What should be taken care of while coding a mobile theme as compared to a simple one?
Is there any tutorial available that teaches how to develop a mobile theme from scratch?
Answer: It's really not a "wordpress" specific, it's just the css. You just give it a css for mobile browsers. That's it.
here are few good readings on how to get about the css for mobile:

http://www.html5rocks.com/en/mobile/mobifying.html
http://net.tutsplus.com/tutorials/html-css-techniques/responsive-web-design-a-visual-guide/

if you still have some questions, feel free to ask. ;)
Answer: The best would be to use (or take a look at) Carringtion Mobile. It's developed by a known Author with lots of reputation since a long time.
Answer: You might find this series helpful is creating your own mobile theme.
http://mobile.tutsplus.com/tutorials/mobile-web-apps/jqtouch-mobile-wordpress-1/
A good idea would be to work a mobile stylesheet into your current theme. As one of the links added before this answer will stipulate, making your theme responsive is the way things are moving these days.


any online sfx library that has the exact (the same) files that are sold on cd's?

Question: Hello, I am looking for a online database of sound effects that has the same audio files that you can find on commercial cd's so i can buy separately just the sound i need. I've heard some sounds that would be perfect for a project at my friend's studio but don't want to buy whole collection. The example would be Hollywood Edge Foley series. Are there any 1:1 online copies of cd's?
Answer: There's also sonomic.com
Comment: this looks good! already found some hollywood edge samples! Will check some more but positive for now! thanks Morten!
Answer: I'm not aware of any that do specifically what you are looking for.
You could try contacting those libraries to see if they will sell you just the specific sounds you are looking for, but there are a bunch of online resources that sell individual sound files you can purchase. Sounddogs.com is one of the best resources in that respect.
Comment: +1 Sounddogs.com is the place to go when you've searched your library for an hour and can't find that exact wind you want or the squeeky hinge you need that puts the cherry on top of your design.
Answer: Sounddogs.com has all the Sound Ideas and Soundstorm stuff.  Not sure if any site has HW Edge.
Answer: Gamecues seems to be a pretty good place to start. It offers many sound effects from the Sound Ideas collections, BlastwaveFX, and others.  There's an integrated search engine on the website which I believe allows you to sort by author/publisher.  I'm not sure if the have any Hollywood Edge sounds though.  http://www.gamecues.com/
Answer: Check out http://www.audiomicro.com.  They have a lot of Hollywood Edge sounds available individually.  You might need to do an advanced search and narrow the results to the artist "hollywoodedge" to find them.
Answer: I believe SFXSource.com has the BBC libraries.


Why wasn't the Torah given in Israel?

Question: One might naturally expect that the Jewish people would enter the land and then receive the Torah there. It seems logical to me that the Torah should come from a holy place characterized by the revelation of Hashem, in keeping with passages like "Ki mitziyon tetze Torah." The wilderness, in contrast, seems to represent a sort of exile, or at least an imperfect condition. So why was the Torah given in the desert rather than in Eretz Yisrael?
Comment: I have no source for this, so I'll leave it as a comment, but I always understood that until we got the Torah, we were not worthy to settle in Israel, much less to kick anyone out!
Comment: The אור החיים הקדוש in פרשת בהר writes that we only got ארץ ישראל because we became Jews — by accepting the Torah.
Answer: Mechilta Drav Yishmael - Yisro - Parsha 5 says that it was not given in Eretz Yisroel in order that the non Jews would not to be able to say that they did not accept it since it was given in the Jewish land. Another reason was to avoid a dispute between the Shevatim.

ומפני מה לא ניתנה תורה בארץ ישראל? שלא ליתן פתחון פה לאומות העולם, לומר: לפי שנתנה תורה בארצו, לפיכך לא קבלנו עלינו. דבר אחר: שלא להטיל מחלוקת בין השבטים, שלא יהא זה אומר: בארצי נתנה תורה, וזה אומר: בארצי נתנה תורה, [אלא] במדבר ובאש ובמים. לומר לך: מה אלו חנם לכל באי העולם, כך דברי תורה חנם לכל באי העולם .
Comment: http://www.ravhanania.022.co.il/BRPortal/br/P102.jsp?arc=169481. Explains this midrash in great detail.
Comment: http://midreshetqa.cet.ac.il/PageView.aspx?id=1593 See also there about this and similar midrashim.
Comment: That's "rabbi Yishmael"
Answer: Additionally, it was given in the desert (no-man's land) so that no people would be able to claim that they have no share in the Torah.
(See English comments in the Stone Chumash; I can't give a more specific reference because I don't have the book on my lap ATM, sorry).
edit:
Mekhilta De-Rabbi Ishmael (Exodus 19:2).
Comment: Hi sds, welcome to Mi Yodeya and thanks for the tip! If you can [edit] in a source for this idea that would greatly increase its value, because after all, you're just another random internet user right? :) I look forward to seeing you around!
Comment: Thanks for your quick response and +1! Feel free to come add in a more specific citation later.
Comment: My previous comments and links bring many other similar ideas. I will leave it to others to explore them and perhaps write them here. I prefer to provide my own.
Answer: Spinoza in his Theological-Political Treatise argued that the legislation of Judaism was political legislation, necessary for the conduct of a state. According to Spinoza, the end of Jewish sovereignty made the law of Judaism irrelevant. The Torah was given before the people entered the land because Spinoza is wrong--the Jewish people are bound by the Torah even in exile.
Michael Wyschogrod in his Body of Faith expands on this idea as follows:

[T]he national identities of other nations are land-bound identities.
  The nation is defined by the territory it occupies. But [the Jewish
  nation] comes into national existence before it occupies the land. It
  becomes a nation on the basis of a promise delivered to it when it is
  a stranger in the land of others. This awareness of being a stranger
  is burned into Jewish consciousness. The God of Israel is not a God
  whose jurisdiction is defined by territorial boundaries.

Similarly, Rabbi Jonathan Sacks:

It was in the desert that the Israelites made a covenant with God and received the Torah, their constitution as a nation under the sovereignty of God. It is the desert that provides the setting for four of the five books of the Torah, and it was there that the Israelites experienced their most intimate contact with God, who sent them water from a rock, manna from heaven and surrounded them with clouds of glory.
What story is being told here? The Torah is telling us three things
  fundamental to Jewish identity. First is the unique phenomenon that in
  Judaism the law preceded the land. For every other nation in history
  the reverse was the case. First came the land, then human settlements,
  first in small groups, then in villages, towns and cities. Then came
  forms of order and governance and a legal system: first the land, then
  the law.
The fact that in Judaism the Torah was given bemidbar, in the desert,
  before they had even entered the land, meant that uniquely Jews and
  Judaism were able to survive, their identity intact, even in exile.
  Because the law came before the land, even when Jews lost the land
  they still had the law. This meant that even in exile, Jews were still
  a nation. God remained their sovereign. The covenant was still in
  place. Even without a geography, they had an ongoing history. Even
  before they entered the land, Jews had been given the ability to
  survive outside the land.

Somewhat relatedly, Rabbi Joseph B. Soloveitchik, Abraham's Journey:

We emerged as a people from the sand dunes of the Sinai Desert where
  we wandered for forty years. Why could we not rise as a people in our
  own land, in prosperity and abundance? the answer is simple. If our
  morality was to be one of kindness and hesed, it could not have been
  formulated for people who knew not what suffering is. Only people in
  exile could understand and appreciate a morality of kindness.
Answer: According to the Ari, the air of Eretz Yisrael was present with the people and moved with them -- wherever they went in the wilderness they had the air of Israel and of the beit hamikdash with them.  So even though they were in the wilderness, it is like they were in Eretz Yisrael. So the torah  could be said was given "in Israel",  just not within its boundaries.
This can explain the gemoro in Shabbat 31b, which says that since they travelled because of Hashem's word, that was like the mishcan being built and taken down on the same spot. The gemoro there is discussing if one is chayiv on shabbos for pulling down a building, if you don't intend to  build on the same spot. The gemoro brings a proof from the mishcan where the dinim of shabbos are learned from, where they pulled down the mishcan and didn't build it again on the same spot. On that the gemoro says, since they, the Jewish people, traveled because of Hashem's word, it is counted as though it was still built again on the same spot.
The meforshim have difficulty understanding this.Just because hashem was telling them where to go it should all be considered the same spot.
The shvisas shabbos at the beginning of his sefer explains why it was considered the same spot. He brings an Ari that where ever they went in the desert they had the 'air' of erez yisroel with them and the 'air' of the bais hamikdosh. So the mishcan was always on the same spot of the bais hamikdosh. The gemoro in eiruvin 55b present daf yomi can also be explained with this theory, to explain why although they were living in tents in the desert, it is considered like living in a city 'bikviuss', since hashem was directing them. So the meaning of hashem directing them in the desert, is travelling with hashem, ie with the bais hamikdosh and erets yisroel therefore it was considered like living in a city in Israel.In other words although they were moving about in the desert they really were on the same spot all the time, this being no contradiction.
R Chaim Shmulevich adds that it's like a child with its mother. Even though the mother moves about, the child's place is with its mother. So even though they were in the desert it's like they were in Eretz Yisroel.
This also explains how they could make sacrifices in the desert and not in Israel. According to this explanation of the Ari it was given in the 'avira' the air of erez yisroel plus it also had the attributes of the desert mentioned in other posts.  I must state the 'air' is not meant in a physical sense but a metaphoric one.
Comment: @shulem see http://judaism.stackexchange.com/a/9448/732
Answer: if they received the Torah in Israel , people might think that the obligation to fulfill the Torah is linked to their presence in the land . for that reason , the Torah was given as we were in transit , to foreshadow Jewish history which is a series of expulsions , exiles , wanderings, upheavals, etc. and to show that we are bound by the Torah in all circumstances .
Comment: Interesting idea. Did you come up with this yourself? If you have traditional support, please [edit] it in.

Why wasn't the Torah given in Israel?


HA web cluster setup

Question: I'm setting up a highly available web cluster, I'm planning to start out with 2 web servers connected to shared storage (perhaps via NFS). What's the best way of implementing this? Should the web servers only have Apache running on them and all web content (html,css) reside on the shared storage? So if i decide to scale out, then I only need to add additional Apache nodes? If I use a CMS such as Wordpress, does this mean I only have to install Wordpress once (on the shared storage) and just keep adding servers running Apache to share the load?
Answer: Making a very reliable NFS server that runs nothing but NFS is paramount.  Running a dual head/single shelf system can give you some redundancy there, but, once you try to go dual head/dual shelf, you run into quite a few problems.  While you can run master/slave with dual head/dual shelf, dual primary requires a clustered filesystem like OCFS or GFS.  So, step one, make a very reliable, very simple NFS server.
You can use heartbeat and run your webservers on the edge, and in the event that one fails, the other poisons your arp and starts answering the requests.  However, this becomes a little unwieldy and eventually you will want to put a load balancer (or pair) in front of your webservers and use IPVS/LVS to direct requests to your backends.  With ipvs, you will want to set up connection affinity to make sure that users usually hit the same server which makes anything that uses php sessions happy.  You can also share the sessions directory on the NFS server which would allow both machines to access the same session files.
MySQL becomes fun.  It requires three nodes to run clustering, though, with a little trickery, you can do it with two nodes.  MySQL doesn't play well with NFS filesystems, so, you will want to run a master/slave setup with heartbeat to failover, or, set up a pair of mysql servers and run them in a clustered setup.
Your read/write load will be the real determining factor.  You'll want to run a gigE LAN connection to the NFS servers, and a separate connection to the Internet.  If you are running a heavy read load, you won't have too many issues.  If all of your servers are running a heavy write load, you'll run into quite a few other things.  If possible, use Jumbo frames on your LAN if you have large files that you typically serve.  Since the files are on the NFS server, if you use sendfile with apache, and the file is later deleted, the next time you access the file you'll get a bus error.
If you wanted to get tricky, and you were doing a high read volume, you could consider using AFS which does small local caches from the shared storage.  That way, if the webserver disconnects from the storage node, it could still serve most of the static content.  Alternatively, using Varnish/Squid or some other caching system will considerably cut down on LAN bandwidth.  Then, you have the issue of having one or two Varnish servers that have their own cache, duplicating content in memory.  That could be a worthwhile tradeoff to reduce LAN traffic.
Once you get the framework set up, going from two webservers to three is just a matter of adding a new server.  It is the step from one to two that usually is quite a leap.  Some software behaves differently when running on a cluster as opposed to running on a single machine.
Answer: That sounds like a reasonable plan to me.  Are you just looking to scale or eliminate single points of failure?  If the latter, your shared storage could present a problem as well (and add additional latency if the reads are not cached locally by the Apache servers).  If your content is mostly static, there are ways to have an authoritative content store and then replicate it out to your web nodes periodically so they each have a local copy.  This is more complex, but allows your centralized storage to fail as well without taking all of the web nodes with it.

HA web cluster setup


should questions about [ffmpeg] be moved to Audio-Video production

Question: FMPEG is a command-line tool for working with audio and video, do questions relating to it belong more on Audio-Video production?
Answer: ffmpeg is computer software. It's not exclusively used by programmers or audio-video experts—it fits perfectly within the scope of Super User. That is not to say questions about ffmpeg are off topic for Audio-Video Production, but one of the most important rules regarding migration is:
Don't migrate on-topic questions away.
You should be a little jealous of your community. Don't reject good, on-topic questions and move them to another site. The whole idea is summarized in this blog article: Respect the community – your own, and others':

As members of a community, your first loyalty should be to that community. When evaluating a question, you shouldn't be looking to push it off on some other site; instead, ask if it could be appropriate and on-topic for you, the experts who the author decided to ask.

Furthermore, it is not allowed to migrate questions to Beta sites (which AVP.SE is). These sites are still growing, and they should be able to attract traffic by themselves—not by force-feeding them with questions from established sites.
Comment: Interesting point about being jealous of your own community.  I was asking because I regard VPSE as my community and noticed that a lot of questions that would be perfect for it get asked here.
Answer: I think FFmpeg questions should be steered / migrated to VP.SE.
The trouble, IMHO, with @slhck 's line of thinking is that SU has a very broad scope; it's a catch-all site. His policy would be OK for sites with a narrower focus like, say, Home Theater. But if questions traditionally asked on Super User, for lack of a dedicated site, are allowed to remain on SU even after a dedicated site is introduced, then that leads to a vicious cycle where new visitors searching for a forum to ask FFmpeg questions continue to post on SU. This simply tends to make the new site stillborn. Especially in the case of VP where most questions which are posted there deal with the use of software such as editors, compositors and converters such as FFmpeg.
Note that Video Production is not a site for video experts only - it is a site for any questions, asked by anyone, concerning methods, processes and tools related to video generation or modification.
The sentiment about loyalty should be loosely applied within a community of sibling sites, especially for a catch-all site such as SU. If a team leader continues to do a task, even after a job has been created for a task, on the basis that their job is to oversee everything, then that job officer will remain idle. The idea of a dedicated subsite is to concentrate activity and people with specific interest/expertise at a single locus, for a more efficient operation, resource-building effort and attracting and retaining qualified users in that domain.
Comment: You seemed to have missed "Furthermore, it is not allowed to migrate questions to Beta sites (which AVP.SE is) from @slhks answer...
Comment: I didn't. I ignored it because I have seen  questions migrated to VP over the past few months, and his answer is dated Jan '14 so I assumed the policy had changed.


Why was Surya killed by Lord Shiva?

Question: I heard of an incident in which Suryadev was once killed by Lord Shiva. Can somebody explain to me what is this incident and what Surya's mistake was? And also, please let me know how he became alive again. Please also include the source reference for this story.
Comment: Are you referring to the story told in these two episodes of the Hindi TV serial Devon Ke Dev Mahadev?  http://www.india-forums.com/forum_posts.asp?TID=1241170 http://www.india-forums.com/forum_posts.asp?TID=1241937
Comment: Yes Keshav, I am referring to the same incident covered in your link.
Answer: The story of Shiva (temporarily) killing Surya the sun god is told in the Ganesha Khanda of the Brahma Vaivarta Purana.  (See page 349 here.)  As I discuss in this answer, one of the most prominent incarnations of Vishnu in ancient times was the sage Narayana, son of Yama god of death and twin brother of the sage Nara.  (Nara and Narayana were the prevous births of Arjuna and Krishna.)  In any case, in the Brahma Vaivarta Purana's account, the sage Narada asks Narayana about the birth of Ganesha, and then he asks how the remover of obstacles could have suffered such a big obstacle as losing his own head:

If Ganesha is Vighnahara or Vighnesha, that is, the one who removes all impediments, how came he to incur an impediment?  Why did he have his head chopped off?

Narayana responds that it was due to a curse that Shiva had incurred.  Once Surya the sun god tried to kill the evil Rakshasas (demons) Mali and Sumali.  But these Rakshasas were devotees of Shiva, so Shiva came to their rescue, piercing Surya with his trident and (temporarily) killing him.  The Sun immediately went dark, and the sage Kashyapa, Surya's father, was furious.  (Kashyapa is the son of Marichi, one of the mind-born sons of Brahma, and Surya is one of the Adityas, the sons of Kashyapa and his wife Aditi.)  Shiva restored Surya's life to pacify Kashyapa, but Kashyapa still put a curse on Shiva that he would kill his own son just as he had killed Kashyapa's son:

Mali and Sumali were two demons who were devoted to Shiva.  The sun-god Surya did not like the demons and was about to kill them.  The demons prayed to Shiva and Shiva intervened. He struck Surya with a trident and this made the entire world plunge into darkness.   Surya was the sage Kashyapa's son and so, for this act, Kashyapa cursed Shiva.  "Just as you pierced my son's chest with a trident, your son's head will be chopped off one day," said Kashyapa.

By the way, as I discuss in this answer, the Rakshasa Sumali had a daughter named Kaikeshi, who married the sage Vishravas.  Together they had several children, including Ravana, Kumbakarna, and Vibhishana.  So it's possible that if Shiva had allowed Surya to kill Sumali, Ravana might never have been born!
Comment: @Tezz What I mean is "authentic references to Ganesha".  Many Puranic references to Ganesha occur in parts of Puranas that scholars consider to be interpolations.  For instance, the sort of passages that reference Ganesha are often also the sort of passages that reference Radha and Goloka.  In any case, there's a reason why Ganesha isn't mentioned in either the Ramayana or the Mahabharata, other than Vyasa dictating the Mahabharata to Ganesha, whereas Kartikeya is frequently referenced.  It's because he wasn't that popular in ancient times.
Comment: @Tezz No, it's not just my belief, it's the considered conclusion of scholars based on things like style of languages in different passages of Puranas, discrepancies of manuscripts etc.  It's universally agreed by scholars that Ganesha was not that popular in ancient times, and that it's only relatively recently that he became more popular.
Comment: what is your base on "references to Ganesha in ancient Hindu scripture are few and far between...." ?... I just checked all the 18 Puranas... except Vishnu Purana I found mention and stories of Ganesha on every Purana...
Comment: Oh then it's your own belief.... but as there are no stories in Mahabharat and Ramayana... we should get basic stories like... how he was born?... how he got elephant head?... how mouse became his vehicle?... how he became one tusked?.. how he became Ganapati and Vinayaka?... stories relating and explaining these things... and we have to look Puranas to know this .... Regarding Radha and Krishna it's your own belief that you doubt on existence of Radha... Iskcon and other devotees consider those passage of Padma and Vaivarta Purana the most authentic and revealed Passage among Puranas...
Comment: I think Narayana is the son of Dharma, the son of Brahma and not the son of Yama. Only ISKCON interprets Dharma as Yama. Other translators used Dharma only.
Answer: Suryadev was angry on King Vrisadhvaja (father of Tulas) for ignoring other Gods and only worshiping Shiva and cursed him that he word lose all his wealth and prosperity.
When Shiva heard this curse he got angry on Suryadev for cursing his greatest devotee and ran behind him to kill him. On this Suryadev got afraid and along with his father Kasyapa went to Vaikuntha.
Due to being afraid and with all the terror their throat started drying out (this is where surya was about to die), they went to the supreme god Narayana and he granted them abhaya (no fear).
http://www.sacred-texts.com/hin/db/bk09ch15.htm
Comment: I don't think this is the story the OP is thinking of.  This is a story where Shiva was about to kill Surya, not a story where Shiva killed Surya and Surya came back to life.
Comment: Thanks user3236549 for the story but it as Keshav said, this was the not the one I was searching. But anyhow, its good have another story.
Answer: Some reference said that Once Surya Deva showed he the most powerful Deva in the world. Without Him whole world is priceless. Then His son Shani Deva tried to calm Him and not present Him as great than Lord Shiva. But Surya Deva was so angry that time. Even he stopped his work to give light to the world. Without Surya Light whole world was going to dark space and Asuras are getting powerful. Than Shani put a Rudraksha on the Surya Planet and worshiped to Lord Shiva. Than the Rdraksha give most brighter light than Surya Light. Then Devraj Indra suspended Surya Deva from Divinity and Surya came to a Jangal and He saw two person who worshiped to Lord Shiva. Then Surya tried to kill those two Asuras Mali and Sumali. But they had a boon from Shiva that who would tried to kill them Shiva will totally destroy him. Thats why Shiva killed Surya for attacking to the Asuras. After geting this news to Surya's father Rishi Kashyppo cursed Shiva, Oneday The Trishul will kill Shiva's son.
Comment: Welcome to Hinduism SE! You should cite sources.
Answer: Mali & sumali perfomed penace. Lord shiva was pleased by their penace and appeared before them. Mali  and sumali got boon from lord shiva such that whoever attacks them will be killed by lord shiva. Surya dev once went fr rescue of his wife chaya who was attacked by mali and sumali. He attacked  mali and sumali in order to rescue chaya. Lord shiva killed surya dev.  After that chaya decided to give her life in order to save surya deva. Pleased by devotion of chaya lord shiva gave life to surya dev.
Comment: Welcome! As per site rules, you should cite sources. Please see [Guidelines for new users answering questions](https://hinduism.meta.stackexchange.com/q/125/3500)

Why was Surya killed by Lord Shiva?


Does CP determine the aggressiveness of a wild Pokemon?

Question: I have started to notice a potential pattern with wild Pokemon. It would appear that the higher their CP, the more aggressive they are; that is, they jump more, dodge more, or "attack" more. Is this true, or am I just imagining things? Are there specific levels of CP where certain behaviors are more prevalent?
Answer: There really isn't a concrete answer to this, but if you're interested in some approximations here is a good Google Spreadsheet listing the Catch Rates and Flee Rates of Pokemon. See below for explanation of the columns.

Base Catch Rate and Flee Rate are for Pokemon with a decent CP (not too high, not too low)
Effective Catch Rate takes into consideration both Base Catch Rate and Flee Rate to determine what are the chances of you catching the Pokemon without it escaping
-50% Catch Rate is for Pokemon with much higher CP
+50% Catch Rate for lower CP Pokemon
+100% Catch Rate for very low CP Pokemon

Credits to the Google Spreadsheet goes to this Reddit Post. The OP of that post did quite a lot of math to figure this stuff out so kudos to him!
Answer: I believe this to be pretty true. From my experience, the higher cp, and evolution stage, the more aggressive the pokemon behaves. This can be indicated by the color of the shrinking circle. while a circle is green, the pokemon is generally pretty docile. However, if you find a 2nd or 3rd evolution stage with 600 or so cp, the shrinking circle will be orange, and presumably, will continue to red as it gets higher.
Comment: I don't think this really answers the question since it doesn't address how the Pokemon behaves, just the catch difficulty as indicated by the circle
Comment: i dont believe niantic has released any sort of information about that. the only thing we have to go off of is our personally experience. from my experience, they indeed get more aggressive as their cp, or evolution stage increases. as for specific "brackets" of behavior in relation to cp, we have no way to consistently measure this without a large amount of weak and strong pokemon to contrast.


my Atlas page is blank

Question: I am getting a bit worried that I may not have configured TOR correctly because my Atlas page is blank, the search window does not return anything. How is this feature suppose to work. I read around and it is suppose to contain a information on the exit nobes. Can anyone help?
Answer: One way to look at Atlas page is:

Click Test Tor Network Settings from about:tor page.
Click Atlas at the middle of check.torproject.org page and make sure you allow script before initiation of step 2.
Answer: If you can't find any information about your relay at Atlas, the best guess is that your relay is not configured correct.
So check your log file first. It should not contain any error messages or warnings. In the case of a relay you should find a confirmation that your relay is reachable from the outside.
If the above log file seems correct to you, you can use Exonerator to find out if your server was registered as relay. Furthermore you can download another copy of Tor or Tor Browser Bundle and look for your IP address in the consensus information.

my Atlas page is blank


Text Characters Calculation

Question: How to calculate numbers of characters in a text box, and to make sure it is not lesser than or greater than a specific amount of numbers?
Answer: You have two options.  The first involves creating a custom error that checks the length of the string.  The second involves using the settings for a text field which includes a minimum and maximum text length for the field.
I am an Engineer on the Cognito Forms team
Comment: I don't know to do this,
Comment: What I mean was, in a multiple text box, if a text characters length is below 150, it should show error, and if it is more than 350 characters, it should show error as well, that is minimum of text required is 150 and maximum is 350.  How do I place a calculation box for the multiple text box?  Regards
Answer: You would do show custom error when:
<code>=(TextBox < 150 and TextBox > 350)
</code>
I believe you need to have text for the error or it won't work.

"Please use between 150 and 350 characters."
Answer: The error does not show when the maximum number of characters is reached.  I need a character counter that the user will see when filling out the form.

Text Characters Calculation


Snippet Syncing not working

Question: I am building an html5 theme into expression engine. The theme came with a lot of JS that wasnt needed and it slows the pages down. When initially building the theme into expression engine i broke the site up into snippets and templates as expected. I have now cleaned up the code and removed all unnecessary js. The issue is that my html-header with the JS links in it wont sync. The snippet is still showing the old code and not the updated version. ANy ideas?
Comment: How did you edited your snippet? Directly in CP or you are using Mountee or some addon?
Comment: check the permissions on the folder/file.
Answer: Check that the file path matches snippet sync's file path.
$config['snippet_file_basepath'] = '/my/path/';

Answer: The issue was that in snippet sync it was looking for {snippet:global_sidebar}  - rather than {sn:global_sidebar}
Answer: Just wanted to throw this out there in case some one else ran into it, but I had a similar issue and for some reason snippets were being created with incorrect permissions.  Making changes in the text editor appeared to be working correctly, while loading the same snippet via the EE edit panel Design -> Templates -> snippets -> snippet name still showed the old code for that snippet.  Updating permissions solved this issue.

Snippet Syncing not working


Duplicate smart object inside element

Question: To be more specific, I'm working on some posters project, and I need mockups. I have one showing one A3 frame with one smart object inside.
Now I need mockups for set of 2, 3, 4, 5 and 6 posters. I've tried to make one for set of 3 posters, I duplicated original frame, and when I positioned the first poster and saved, it was shown on all 3 frames. I've tried not duplicating but copying (New Smart Object via copy) smart object and placing it into other 2 frames but with no success.
I'm pretty sure this can be done, but I just don't know how. Any help welcome. Thanks.
Comment: I can't really work out what you are asking (perhaps I'm too stupid).  Do you want to use one smart object in all the documents, so that for example when you edit the smart object, it updates in all the documents?
Comment: Or maybe I wasn't clear enough. I have downloaded mockup frame (one frame). It has smart object and works fine with one poster. Now, I want to use that one frame, to make another brand new document, which will show set of 3 posters one next to another. So I will copy the original frame, but don't know how to make smart objects, so they don't update image on all 3 frames, because the 3 posters are different. Hope I cleared this now.
Comment: In the newest CC version of Photoshop, there are three ways to create smart objects - you can place linked PSDs as a smart object, or embed them, or create a smart object from within Photoshop.  Obviously linked objects will update over all the documents you have them inserted in.  I have to ask, do you really need to use smart objects for this? Quite honestly I don't see the benefit if all the posters are different.
Comment: I need to use smart objects as they are in original element, but I have found a way, answered below. Thanks anyways.
Answer: You're on the right track... Not sure what you're doing wrong.
Right-click on your Smart Object layer and choose 'New Smart Object via copy'.
Double-click on the Smart Object layer thumbnail and place your individual images (File > Place...) behind your frame.
Now editing the contents of either the original or the copy should not affect the other. Here for example are the same frames created this way with different contents:
Comment: @Jimi If I'm following you - you've made three Groups with Smart Objects within. Your problem is that you're just triplicating the Group. You're not going to get new Smart Objects that way, just copies of the original Smart Object. Just do right-click, 'New Smart Object via copy' twice right inside the original Group. This will give you two new (and separate) Smart Objects. Then just drag those new Smart Objects one by one into your other two Groups and delete the ones that were created when copying the Group. Now you can edit your individual Smart Objects without affecting the others.
Comment: I think the problem is because the element has many layers, like different frames, mat, reflection etc. Here's a screenshot: http://imgur.com/6fWm9YP

When I duplicate group, editing contents reflects on all 3 frames. Don't know how to properly use 'New Smart Object via copy' in this particular situation, because of element being complex.

But I played around and found a way, I just drag an image an place it above smart object layer. Maybe not the proper way, but it works.
Comment: Yes, you're right, I'm triplicating the Group with Smart Objects within. I also tried to copy original smart object and drag it into Group, but when I delete original SO within group, I get like transparent square between frames, guess it has something to do with positioning of SO in correspondence with frames (original SO is placed on left side, when I drag the copy of it into other group it stays on the left, while it should be centered and right). And as each element has its frames, mat, shadows, reflections and color settings, makes it more complex. I'm fine with drag 'n drop though.

Duplicate smart object inside element


How hot must a star get before it is considered to be a star?

Question: How hot must a star get before it actually becomes a star? Why does it need to get so hot? Please find an official site to quote from, if you can.
Comment: related, the answer at http://astronomy.stackexchange.com/questions/79/what-is-the-upper-and-lower-limit-of-temperatures-found-on-stars
Answer: From a physics perspective
From a physics perspective an object is a star when it is undergoing nuclear fusion, generally of hydrogen atoms at its core, this is regardless of its temperature!
A star is not determined by its temperature, it is instead determined by it's internal processes.
This does mean that if Jupiter began nuclear fusion it would be considered a star, albeit a minuscule one.
In this case it is a yes/no distinction of if an object is a star.
From an observational point of view once something is classified as a star there are 7 groups it can fall in to determined by its features.
Sourced From: http://en.wikipedia.org/wiki/Star#Classification

Class Temperature  O:    33,000 K+
  B:    10,500–30,000 K  A:   7,500–10,000 K
  F:    6,000–7,200 K  G:   5,500–6,000 K
  K:    4,000–5,250 K  M:   2,600–3,850 K

Note: Three more classifications L T and Y have been added to the colder end of this list, but I am unsure of the cut off points so omitted them.
But strangely they are not classified by temperature but by their spectrum, it just so happens that their spectrum correlates to their temperature! The temperature spoken of here is of the photosphere of the star (where the photons begin free streaming), not its core (where photons are created from ongoing fusion reactions).
Dwarf stars have their own classification system prefixed by the letter D though.
Quote from Wiki article:

White dwarf stars have their own class that begins with the letter D. This is further sub-divided into the classes DA, DB, DC, DO, DZ, and DQ, depending on the types of prominent lines found in the spectrum. This is followed by a numerical value that indicates the temperature index.
Comment: This is kind of an "observer point of view" more than a "physical point of view". From a physical point of view, this question is clearly a "Yes/No" question: you cannot burn hydrodgen, you're not a star.
Comment: Actually, defining a star based only on its surface temperature is even hazardous: hot Jupiters can have surface temperature close to M-type stars, and are definitely not stars!
Comment: I still disagree with the bulk of the answer, that I still see as misleading. We're here talking about the definition of a star, and surface temperature does not enter in this definition. Stellar classification has nothing to do with the definition of a star.
Comment: @MBR its relevant in that it explains classifications of stars once something is determined to be a star, i made this clearer, how do you feel about the edit?
Comment: "Dwarf stars..."? You mean "White dwarf stars...". Also note that L, T and Y dwarfs can never be stars; they are brown dwarfs. The coolest of the M-dwarfs are also probably brown dwarfs. The definition of a star is hydrogen fusion. You have not answered the question.
Comment: Reverse, reverse. Very old L0-L2 dwarfs could still be stars.
Answer: Star temperature is an interesting question since temperature varies a lot in a star. I think that the more relevant temperature to this question is the core temperature of the star: a star is born when it starts to burn hydrodgen in its core.

Finally, hydrogen begins to fuse in the core of the star, and the rest
  of the enveloping material is cleared away. This ends the protostellar
  phase and begins the star's main sequence phase on the H–R diagram.

(See this Wikipedia page)
The temperature needed for hydrodgen burning is 10 million Kelvin, so that's how hot a star must be to be considered as a star. It needs to get so hot, because else it will fail to burn hydrodgen and will become a "failed star": a brown dwarf.
Edit:
Surface temperature can be misleading, since the temperature ranges in which lay stars are not populated only by stars, but also by other objects such as hot Jupiters, with surface temperature ranging from 1000 to 3000 K.
Comment: The coolest "stars" are actually red giants.
Comment: Actually I'm wrong about the giants - an old L2 dwarf is about the coolest star. But you have got your nuclear burning temperature threshold way too high.
Answer: As other answers have said, the definition of a "star" is generally taken to be an object that is undergoing sufficient hydrogen fusion to reach an equilibrium between energy produced by fusion and the energy it is radiating. The exact definition varies, but does not affect this answer much.
When "stars" are young, they are large, their cores are too cool to initiate hydrogen fusion. They then contract and hydrogen fusion is initiated when their cores reach about 3 million K (e.g. see Burrows et al. 1997.
Why so hot? Because the Coulombic repulsion between positively charged protons prevents fusion. The fusion reaction proceeds by quantum mechanical tunneling, but even then requires that the protons have sufficient kinetic energy to at least partially overcome their Coulomb repulsion.
In terms of their surface temperatures, the lowest mass objects that begin hydrogen fusion are about $0.075 M_{\odot}$. Their surface temperatures when fusion commences are about 2800 K, but then their surfaces continue to cool, so that the oldest in our Galaxy might now be around 2300 K and "L dwarfs" (for example see Chabrier & Baraffe 1997).
However, red giants are also stars - either burning hydrogen or helium, or both in shells around an inert core. Their interior temperatures are much hotter than the low-mass objects described above, but because they are very large, their surfaces can be very cool. The coolest red giants also have temperatures of around 2600-2800 K.


Is it possible to query smart contracts inside a smart contract?

Question: I want to know if it is possible to query (discover) smart contracts inside my smart contract. For example, I want to find a smart contract with some name and/or parameters and then call it. Is that possible?
Comment: Somewhat related: https://ethereum.stackexchange.com/questions/1391/can-a-contract-access-another-contracts-storage
Answer: It's possible for a contract to call another arbitrary contract, knowing its address and the function signature of the function you want to call.
It's also possible to make a contract that acts as a database of other contracts, and returns a contract address and function signature when sent some kind of search parameter.
Those two things together would satisfy the stated requirements. However, I don't know of anyone making the latter thing, and I can't imagine how it would be useful.
A common pattern for unspecified contracts that take known parameters, which may or may not solve whatever problem you're trying to solve, is:

Define an interface (a function signature), and make your contract able to call that for some particular task
Allow the user to specify the address and pass it in to your contract as a parameter, and have your contract call the other contract at the specified address using the expected interface.

For instance, a contract might allow you to sell songs for any ERC20 token. (An ERC token is a contract, with an interface that matches the ERC20 token standard.) The seller would look up the address of the contract for the token they wanted to sell their song for using the website of their choice, and pass it into the seller contract, along with the song ID and the price in that token. Later, when a buyer showed up, the seller contract would call its expected interface, in this case transferFrom() method, to complete the payment for the sale.
This pattern works because the user is able to browse the internet and use common sense to decide what would be a good contract to use (in this case as a token), so they don't need a smart contract to be able to do it for them.


If the world were blown to pieces, what would remain?

Question: My question involves the earth being blown up using theoretical dark energy.
In this scenario, the crust and mantle are destroyed by precisely placed weapons so that all that remains is the core.
Would the core freeze to become a dwarf planet comprised of solid iron after it's completely exposed? Or would the sudden lack or pressure cause the matter to become gaseous?
I also need to know about the moon.  Would it continue to orbit the dwarf planet (if that is what remained) or would it begin its own orbit of the sun?
Comment: `If the world were blown to pieces, what would remain?` "Just pieces" seems like the obvious answer.
Comment: "*If the world were blown to pieces*", the the core would also be blown to pieces, since the core is part of the world.
Comment: As the accountant said to business owner, "What do you want to happen?"
Comment: Welcome to WorldBuilding.SE! As RonJohn pointed out, the title of your question doesn't quite match the question itself: you ask "what would remain" and then tell us that only the core would remain. It's an interesting question, though. Please take the [tour] and visit the [help] to learn more about the site, and I hope you enjoy your stay!
Comment: Please edit to add how this related to worldbuilding or the question will likely be put on hold.
Answer: The answer depends strongly on the nature of the process which removed the rest of the planet.  As it turns out, events which are capable of blowing a planet to tiny bits (in thine mercy) are pretty darn violent.  They will have some effect on the core, and that effect may dramatically change the result.  But for some simple cases, we'll find that you do indeed get a dwarf planet.
Let's, for a moment, assume that the outer parts of the Earth simply vanish, leaving the core.  This consists of an outer core, which is liquid, and an inner core which is solid.  Let's let those start to decompress.  The information that the rest of the Earth vanished will propagate at the speed of sound.  Now the core is quite hot, ranging from 4,000K to 10,000K, depending on where you are.  This is quite a bit higher than the boiling point of iron at atmospheric pressure (much less at vacuum), which is around 3200K.  Thus we should expect large amounts of the iron in the core to flash boil.  This will rapidly impart a net outward velocity to all particles involved.  To get a sense of just how violent this could be, I've replaced our planet with an Earth-substitute (a beaker of superheated water), and the cause of boiling replaced with the addition of sugar (which nucleates the boiling event), and made this video. (okay, maybe I lied.  Professionals made that video).
Note: the core will need something to nucleate around as well.  However, this is a statistical process.  It's very difficult to have a lack of nucleation sites when your beaker is the size of the Earth's core
The result, in the low gravity of the remaining core, will be that the boiled iron/nickel material quickly flies outwards and starts to behave like a rarified gas (very few collisions because the particles are far apart).  Now we need to talk escape velocity.  Escape velocity is calculated by $V_e=\sqrt{\frac{2GM}{r}}$, where $G$ is the universal gravitational constant ($G=6.67\cdot10^{−11} \frac{m^3}{kg\cdot s^2}$), $M$ is the mass of the gravitational source, and $r$ is the radius from the center of that object that we're calculating at.  The mass of the core is roughly 30% of the mass of Earth ($M=1.79\cdot10^{24}$), and its radius is roughly 3,400km ($r=3.4\cdot 10^6$).  Put these together and you get $V_e=\sqrt{7.0\cdot10^{7}\frac{m^2}{s^2}}$ or $V_e=8.4\frac{km}{s}$
, which is a good portion of the escape velocity of the whole Earth before the explosion ($V_e=11.186\frac{km}{s}$).
So how fast can the nickel and iron fly?  Well that's a more difficult question.  It's a question of how the energy is distributed.  The specific heat of iron is $450\frac{J}{kg\cdot^\circ K}$.  Our iron can drop on average of roughly 4000K before solidifying, so we have about 1.8MJ/kg to work with.   Now it takes a lot of energy to reach escape velocity here, 35MJ/kg, to be specific.  That means even in the most extreme of circumstances we could only fling 5% of our total mass out into space, and realistically it wont be that high.  This means we can assume that most of the mass does not achieve escape velocity.
So, assuming your event simply makes the crust and mantle disappear, you would have a violent flash boil, sending gas and material off into space, but then gravity would take hold once again, and all of the material would coalesce roughly back together.  During this time, it is emitting radiation, cooling off into the emptiness of space.  Eventually it will cool enough to not boil, and reach a liquid or solid phase.  That liquid will then not have enough heating to retain its temperature without the huge insulative  coat of the mantel, so it will solidify.  The vast majority of the core material will remain.
Answer:
would the sudden lack or pressure cause the matter to become gaseous?

No.  It (most, at least) will turn into a gas because the core's temperature is about 10,800F, and the boiling point of iron in 5,200F.  Thus, yes it'll boil off from intrinsic heat.
Once it cools off to below 5200F, then it'll still boil off since "5200F" is the boiling point at Standard Pressure.
Answer: The energy needed to blow up a planet is similar to the energy needed to vaporize it.
Suppose you release some energy in the center of the earth, say with an antimatter bomb. A large amount of rock is vaporized, much of it turned to plasma. The pressure produces huge splits along the earths crust, which blast out superhot rock. The earth is split into fragments that reach kilometers in height. But nothing is moving at escape velocity. The crust and mantle fragments crash back into each other. The atmosphere is replaced with a thick layer of vaporized rock. Which cools and rains down on the surface.
Suppose you released even more energy. Most of the planet is vaporized, but some fragments of the surface ride the shockwave away from the planet. Much of the planet is launched at escape velocity, mostly in the form of vapor. Some stays in orbit and some remains in a ball. The remaining mass cools into a small, metal rich planet with a ring system.
Answer: Ron John's answer covers what happens to the core.
As to what happens to the Moon, it depends. If the Earth is blown to pieces, but the pieces still remain bound by gravity, the Moon would still be there. It might be hit by debris, which could change its momentum and thus alter its orbit, but it would still be there.
If the non-core pieces are removed from the Earth-Moon system, though... According to this source, the core makes up for only ~32% of the mass of the Earth. Which would mean the pull between the remains of the Earth and the Moon would not be as strong. They would each orbit the sun directly, though with very close orbits. They would have encounters in intervals ranging from years to millenia depending on how they disconnect, and depending on how the encounters go, they might each be pushed to other orbits, or they might impact upon each other and form a new planet.


German verbs vs English verbs

Question: Why do all English verbs have to start with "to" and German verbs don't? In English we say "to play" but in German we would just say "spielen". why don't we say "zu spielen"? Why don't we do this in German? Is it just a weird grammar thing we do in English?
Comment: Is there really that much of a difference? After all, this seems to be mainly a convention determining how to name verbs in a meta context -- when we use German and English verbs in actual language, the forms with and without _to/zu_ seem to occur in similar contexts. If I were to speculate, maybe English verbs use _to_ simply to unambiguously mark them as verbs (since you can "verb any noun", there usually exists a noun with the same spelling).
Comment: Im Deutschunterricht wurde bei jedem Verb der Infinitiv vorgestellt - `spielen und zu spielen`. Die Annahme, `zu spielen` würde nicht gesagt, ist also falsch.
Answer: Maybe it's because the infinitive of German verbs is the root + "-en" ("kochen"), or "-ln"/"-rn" ("lächeln", "meistern"), plus they are written in lowercase, so it's easy to see that they are verbs even without a "zu" before.
But in English you have "smile" (noun), "smile" (verb) - likewise for "cook", "beat", "play" etc. - so you need something to differentiate those words. The suffix mentioned above effectively fulfills that function.
Comment: Thats a good point, like to play could mean to play a sport but just play could mean 2 different things, it could mean play, as in a play, or play, as in to play.
Answer: First of all, language is an expression of personality.
You can say "Willst du spielen?", "Hast du Lust zu spielen?", shorter and childish "Willst spielen?" or even "Spielen?".  All examples are correct but saying more...revealing the personality of the speaker or his intention.
Well this works in English "Play?", "Do you want to play" or "Would you like playing ...".
English provides "to" and "the" which can be use ubiquitously, makes it an easier and predictable language.
It's not very different -IMO-, just style and intention in spoken language.
Comment: `You can say` is true, but does not mean it is correct usage of the Language. I can ask `Bahnhof?` in a foreign city, but that doesn't make it a German question.

German verbs vs English verbs