iPhone 7 screen is frozen on the shutdown screen

Question: my screen is frozen on the slide to power off screen and it won't let me get out of it. I've tried holding down the home button and the lock button for a long time and it hasn't worked. I've also tried using siri and haven't gotten anywhere. I plugged in my phone as well and that didn't do anything either. I have an iPhone 7
Answer: For iPhone 7 and 8, you need to hold down Lock and Volume Down at the same time to reboot. Older iPhones use Lock and Home button.
If you cannot restart the phone this way, you may have to use DFU mode.
(Note: These links are hosted by Verizon, but will work with any iPhone 7 or 8 on any carrier.)


Expansion of space or contracting of matter?

Question: Can the expansion of the Universe effect be explained by contraction of the overall matter instead? That is, all material objects are in fact contracting, due to what the universal space seems (and only seems) to be expanding. Are there any theoretical arguments or experimental data that preclude replacement of the universal space expansion by the universal matter contraction as an explanation tool of the nature of the very process?
Comment: Possible duplicate of [Is the universe expanding, or is everything in it getting smaller?](https://physics.stackexchange.com/q/530300/)
Comment: Yes, absolutely. The same physical phenomenon can be interpreted both ways: https://vixra.org/abs/1107.0016
Comment: At https://arxiv.org/abs/1408.0156, you'll find one of several papers written a few years ago by Wetterich on this sort of question.
Answer: This alternative that you mention is very imaginative, but It poses several problems. For example, if all matter is contracting, galaxies and clusters or any large scale structure would eventually collapse, and this is not something we have detected. In addition, the expansión of the universe not only affects matter, but also light: photons loose energy, which is equivalent to say their wavelengths are redshifted. A contraction would imply that light is blueshifted, again an effect that we have not observed.
Answer:
Can the expansion of the Universe effect be explained by contraction of the overall matter instead?

No. If the universe was not expanding, the tempeture of the of the universe would reamin the same. And this is not the case. Also according to GR the universe cannot be stationary. It should be either expanding or contracting.
Answer: The answers proposed by others here are correct and they give you intuitive reasons why they are correct.
I've thought about similar questions before.
Another way of asking it, if I were to try and guess what you are proposing, would be:
"Could dark energy expansion be explained by proposing that the Planck distance is not actually a constant?"
A good resource for thinking about this would be Leonard Susskind's YouTube Stanford lectures on cosmology.  At some point he derives Planck constants from scratch, and gives good explanations for why these things are constants and why they don't vary.
https://youtu.be/P-medYaqVak
Lots of equations, but always explained well.


How should I manage my time?

Question: There are times when just one bug that keeps eating away your time like hell ... for example this one. I generally end up wasting hours and realize I've gone terribly behind my schedule and not completed other tasks. With n number of tabs open in the browser, I end up posting the question in stackoverflow as a last resort. What are some time management techniques that lets you stop, rewind and get back in action when faced with a road block?
Comment: Try taking up something other than programming as profession or phrase your question so that it would sound like you are not 100% lost.
Comment: By the way, there is nothing wrong with posting on SO after you gave it a good old college try. It is when you are old enough to be a senior developer, but are still as stuck as a junior one, that you would want to reevaluate your life.
Comment: @Job .. pretty deep. Thanks. But "something other than programming as in profession" - not in this life :)
Comment: Have you looked at [David Allen's Getting Things Done](http://www.davidco.com/what_is_gtd.php)?
Answer: Pomodoro is a great way to manage your time in small increments.

The technique uses a timer to break down periods of work into 25-minute intervals called 'Pomodori' (from the Italian word for 'tomatoes') separated by short breaks. Closely related to concepts such as timeboxing and iterative and incremental development used in software design, the method has been adopted in pair programming contexts. The method is based on the idea that frequent breaks can improve mental agility..
Comment: What about breaking the "in the zone" condition that Joel Spolsky wrote about? don't you lose concentration for 15 minutes at a time?
Comment: Wow .. this sounds great!
Answer: My answer is timeboxing - only allocate a maximum amount of time for a bug before asking for help.
For example - one hour to solve issue x. This means that's going to be the maximum time you waste on it.
Comment: do you actually do that? What happens if you blow the timebox? Do you ask another dev or what? It's not like you can just say 'ahh, forget it, it, it's not that bad a bug!'. I don't know about anyone else, but in all the software I've ever worked with, the bugs are HIGHLY variable. Since many of them end up being either really esoteric cases, or oddball intersections of 'what the spec says' vs. 'what the other system actually does' vs. 'what the customer wanted to happen', I can't begin to think of time boxing a bug.
Comment: @Michael - I do this on occasion. When I can't even guess how long something will take, I timebox it. If I have blown the timebox I ask - either colleagues or here. In any case - sometimes the act of stopping give my mind enough of a rest from a problem to allow me to solve it faster at a later date.
Answer: The way I do it is to prioritize the things that need to be done and work on the most important first. Then if you have time, you can work on less important things. E.g., if you need to create a form that takes input for a patient, make sure you do the essentials first, e.g.:

database table/tables for all critical data
business logic code for validation/work flow
user interface with fields for all critical data

Make those things work first, from start to end, before adding anything "shiny". Don't worry about making the patient lookup use AJAX. Don't worry about making fancy validation graphics for the UI. Don't worry about making sure your javascript has as small a footprint as possible. Just make sure your code does what it is supposed to.
Once it is all working, then you can prioritize the rest. e.g.:

Make sure the UI has graphics/css/colors of the rest of the app
make sure database table(s) will perform properly with a large dataset (create stored procedures/indexes)
add the user-friendly AJAX lookup for existing patients

It takes discipline to force yourself to not get off track, but you will get better with practice.
People think focus means saying yes to the thing you've got to focus on. But that's not what it means at all. It means saying no to the hundred other good ideas there are. You have to pick carefully. ~ Steve Jobs
Answer: The key is to limit yourself to a fixed amount of time to spend on one problem. "Ok, I've got 2 hours to get this working, or else I'm setting it aside and working on another problem."
Don't come back to the problem until the next day.
Answer: Multitasking is bad. You should have a prioritized list of tasks, and if other less important things get delayed while you're working on that critical bug, that's how things go sometimes. If you have two top priority items, then you should probably bring this up to someone who can figure out which one they would rather have fixed in the near future.
That said, if you have downtime or just need to switch tasks to get come back to a problem with a fresh mindset, you can set aside a specified amount of time for a lower priority task.
Answer: "If it weren't for the last minute, nothing would get done," said a wisecracking piece of stationery I once came across in a store. But if you were to learn proper time management tips, you wouldn't need that procrastinator's motivator of a last minute in the first place. Here are some useful time management tips to help keep you and your time in tip-top shape:
see tips here

How should I manage my time?


Where do the energy and momentum come from when light is perfectly reflected on a surface?

Question: If you send a light beam to a surface which reflects the light perfectly I would say that on the surface is put a force of the light so the surface moves backwards. But where does that energy comes from? If it perfectly reflects the light than the frequency shouldn't be changed and the speed of light wouldn't change either. So were does the moving surface gets his energy from? Or isn't it possible to maintain their frequency or perhaps the surface is not moving at all?
Answer: The latter - energy is conserved, so the recoil of an atom (as a simple example) translates to a lowering of energy (lower frequency) of the reflected photon.
Answer: Let's treat a one-dimensional example, of an elastic collision of a single photon with a mirror.  Conserving energy (and cheating slightly by using newtonian kinetic energy, assuming $v \ll c$), we have:
$$hf_{0} = hf_{f} + \frac{1}{2}mv^{2}$$
While, conserving momentum, we have:
$$hf_{0}/c = mv - hf_{f}/c$$
from the second equation, we get:
$$hf_{f} = mvc - hf_{0}$$
so, we have:
$$\begin{align}
2 hf_{0} = mvc - \frac{1}{2}mv^{2}&\\
v^{2} - 2 vc + 4 \frac{hf_{0}}{m} &= 0\\
v &= c \pm \sqrt{c^{2}-4 \frac{hf}{m}}
\end{align}$$
the positive root is obviously unphysical, and in the limit $m \gg hf_{0}$ we have $v = 0$.  So perfect reflection and conserved energy are completely consistent.
Answer: Electromagnetic radiation does exert a radiation pressure and so there must be momentum transfer between the incident radiation and the surface.  So the reflector exerts a force on the incoming radiation.  In the case of light being reflected from a mirror this force is not very large and so the recoil of the relevtor is not noticeable.
The analysis can also be done in terms of photons which carry momentum being "reflected".
Although in the case of light and a mirror the radiation pressure force is comparatively small it is radiation pressure produced by photons trying to escape from the centre of the Sun which balances the inward gravitational attractive force.


How do electrical devices suck electricity?

Question: If the electric potential is 220V and some device needs 1500watts then how does it suck exactly that amount of electrical energy from outlet?
Comment: @propaganda - this isn't hackernews or 4chan. We want SO to be a respected source of technical answers. This isn't going to happen if schools/businesses start to block it because of naughty words.
Comment: Humor is allowed in the comments if it is reasonably related to the topic and projects a professional image. Unprofessional remarks deleted.
Comment: you get payed for sitting on .sx? I dont get payed so I dont get to be professional, a valid reason would be that my remark was utter b_llshit
Comment: who holds the copyright to questions and answers? if I dont get paid for my content users should not be enforced to do sx's homework for them... also sucking and pushing and shoving electric energy must rub off an image of being a respectable resource of technical answers
Comment: [CC commons license question](http://meta.stackexchange.com/q/89377/), [Are moderators paid to moderate?](http://meta.physics.stackexchange.com/q/848/)
Comment: curious, does SO have any way to ban users?
Comment: [A Day in the Penalty Box](http://blog.stackoverflow.com/2009/04/a-day-in-the-penalty-box/), [A Theory of Moderation](http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/),  and there are some automated partial bans that try to block users who contribute consistently poor material.
Comment: I completely agree that you cut away my remarks. Thats what collaboration is about, endless feedback. I did not say moderators get paid. Im saying if you dont get paid, why do you insist on "_projection_ of a professional image" so that SE can spam some ads in the face of innocent people? Id prefer a decentralized p2p protocol that would have users communicate and vote and use a language of concepts arranged in graphs like predicate logic...
Answer: It is not the most straightforward viewpoint to say that a device "needs 1500 watts". This is more a consequence than a condition. What happens is that you create an electric circuit by plugging in a device into the outlet. That circuit follows Ohm's law: $$V = I R$$ So for a given voltage and resistance a certain current $I$ will flow. The power is simply $$P = V I = V^{2}/R = I^2 R$$The device does not know anything, it just has a property, it's resistance $R$.
Comment: Tiny correction: the question refers, most probably, to an AC case, where a factor of $\sqrt{2}$ has to be added.
Comment: @yohBS: I don't think any factor is missing here. For a purely resistive device the description is correct and does not change for AC. The 220V is not the amplitude but rms.
Answer: If it's a light bulb or heater, it's just a resistor.
First, forget that it's alternating current, just to simplify things.
Think of the power source as a really big 220 volt battery.
If it's drawing 1500 watts, divide that by 220, and that will tell you the current I in Amperes.
(That just measures how many electrons per second are flowing. An Ampere is about 6x10^23 electrons per second.)
To get the resistance R in Ohms, just divide the voltage V (220 volts) by the current I that you got above.
(An Ohm is just the number of volts it takes to push one Ampere through the resistor.)
I hope you can see that the smaller the resistance is, the bigger the current is, and when you multiply that by the voltage, you get the power.
So the way you make a bigger heater or light bulb is by giving it less electrical resistance.
If you want to go back to alternating current (AC) the power is a time-average, and it swings up and down at twice the AC frequency.
I'll let you figure out why, if you want.
Answer: Probably easier to think of it in terms of pressure and 'pushing'
Electrical potential (volts) are an analogue of pressure - there is a certain amount of electrical pressure trying to push current through the circuit. The resistance is what impedes the flow of current. So a high power device, like a 3500W kettle, has a low resistance and so the 220V pressure can push a lot of current through it.
If you then take the same device to a country with wussy little 110V of electrical pressure then it will only be able to push half as much current through the same resistance and so only give 1/4 as much power. Which is why they generally don't use electrical kettles in north America.
Comment: P = IV = V^2/R? Want to upvote since I think this is the best answer so far, but please fix this.
Comment: @propaganda - brain-needs-coffeeeee.......  ;-)
Comment: I like the pushing analogy here
Comment: @zephyr - sorry lack of coffee, still waiting for the pathetic  110V kettle to boil!
Comment: but then again you are wrong: if U_{NA}=220V=I*R and U'_{JEU}=110V=I'*R then I' = I/2, and P'=U'*I'=P/4! so jewropean outlets can `push` 4 times more energy through the same kettle resistor than in Northern States of America
Comment: still wrong, half as much current, quarter power
Answer: Circuits in devices are designed to regulate their own power consumption: when they need more power they decrease their resistance, and when they need less they increase their resistance, often breaking the circuit open when they stop needing energy at all
Comment: LOL you remind me of Calvin's dad. You made me laugh
Answer: The easy devices have been covered already. More complex devices, such as PCs use smart power supplies. These power supplies need to create low DC voltages (e.g. 12V) from the input voltage (110V or 220V AC).
A simplified model of such power supply has a small battery at 12V. This battery is continuously discharged to provide the device with the power it needs. The power supply checks the battery charge level, and when it drops too low the battery is quickly charged from the rectified (= AC turned into DC) input voltage. When the device draws more power, the power supply will recharge the battery more often. But if the battery is too small, the power supply can't keep up.  Therefore power supplies for PC's come in different Watt ratings.


Is the amount of cubic inches in a cubic foot exact up to infinite significant figures?

Question: I know we are supposed to use SI units and I know they are defined very well.
But does that mean that Imperial units of length/volume aren't exact? Don't they  have infinite significant figures in the equations?
I couldn't find it in the SI brochure.
I'm asking because I need to convert from cubic feet to liters and trying to decide how many significant figures to use. My first thought is that the conversion factors are exact and I should use all the numbers my calculator comes up with. But the conversion factor wasn't in the back of my book so maybe cubic inches in a cubic foot aren't exact?
Comment: Cubic inches in a cubic foot is an exact conversion.  There may be some uncertainty in the conversion between SI and imperial -- I'm not 100% sure -- but if there is it's probably in the 8th or 9th decimal place.
Comment: @CurtF.  I guess the question boils down to: Is the amount of Liters in a cubic foot exact? Or if not, how many significant figures should we use?
Comment: A short time before the French revolution, the royal rent collectors showed up at farmsteads with the largest 'bushel' measures ever seen in that country, to measure out the royal share of the crops.  The problem with non-SI measurements is the multiple disagreeing sources of authority.
Answer: Dealing with imperial measures in science is problematic. The main reason for that is that you have (at least) two different definitions (fixed values) for a lot of them, one based on the laws of the United States and one based on the laws of the United Kingdom. While the differences are quite insignificant for everyday use (as in baking a cake), in the science world these small deviations can cause further inaccuracies. On Wikipedia you can find more, but for the argument, let's look at the values for the yard:
United States    0.914401829 m
United Kingdom   0.9143993   m
International    0.9144      m

In principle the definition of cubic inch to cubic foot is exact, while the conversion to the SI system may carry an error.
Unit        Abbreviation    Definition  SI equivalent (rounded 4sf)
Cubic inch  cu in or in³                16.38 cm³
Cubic foot  cu ft or ft³    1728 cu in  0.02831 m³
Cubic yard  cu yd or yd³    27 cu ft    0.7646 m³

Most of the time this shouldn't affect your measurements more than the use of significant figures, which is used as stating an error implicitly. That means it is in itself inaccurate. In any scientific capacity you would state the error explicitly.
When a value is stated as $1.00$ it has three significant figures it actually means that the measurement falls within the interval $0.99$ to $1.01$, or $1.00\pm0.01$.
Let's have a quick example. You measure the volume of water in a beaker to be $0.35~\pu{in^3}$. The beaker doesn't specify how accurate the measurement is, so we simply assume $\pm0.01~\pu{in^3}$. You would state that value as $0.35\pm0.01~\pu{in^3}$, or $0.34-0.36~\pu{in^3}$, or simply $0.35~\pu{in^3}$ with implied error. On the other hand, when we know significant figures are used, we would interpret a value of $0.35~\pu{in^3}$ as $0.35\pm0.01~\pu{in^3}$.
When you convert this to the SI system, your value doesn't become more or less accurate. You cannot use significant figures to express the error in one system in the same way you would do it in the other, because the implicit error is different.
The exact conversion (of the international yard) is
$$\frac{0.9144~\pu{m}}{1~\pu{yd}}=\frac{0.9144~\pu{m}}{3~\pu{ft}}=\frac{0.9144~\pu{m}}{36~\pu{in}}\implies1~\pu{in^3}=\left(\frac{0.9144}{36}\right)^3~\pu{m^3}.$$
The actual trust of the value is $\pm0.01~\pu{in^3}=\pm0.16387064~\pu{cm^3}$. When you convert your value $0.35~\pu{in^3}=5.74~\pu{cm^3}$ (keeping the same number of significant figures since the conversion is exact), you would imply an error of only $0.01~\pu{cm^3}$, which is far less than the actual trust. Instead your measured value falls somewhere between $5.58-5.90~\pu{cm^3}$. So the correct way of implicitly stating the error would be $6~\pu{cm^3}$.
TL;DR
The conversions are exact, the system of significant figures is not. In doubt, state error margins explicitly.
Comment: @Max I agree and I don't like the significant figure method either. I think implying an error is ignoring the error. However, it is used extensively and one should be aware of its inaccuracies.
Comment: Note that the value you list for the US yard-to-meter conversion is archaic. To make conversions precise, (and as noted in the Wiki article), the inch was redefined in 1960 to be 2.54 centimeters, exactly.
Comment: @Nicolau That is pretty much what I said in the last sentence. I also use the exact (international) definition (of the yard) in my answer. I only try to make the point that the implied error is completely different when using imperial units compared to SI units.
Comment: @JonCuster on Wikipedia it says this value is exact. However, this exactness does not extrapolate to the implied error.
Comment: Yes and no. Using "significant figures" is a sloppy method of doing error propagation. Typically two significant figures in centimeters gives two significant figures in inches. // We could debate if 0.35 cm is +/- 0.01 cm or +/- 0.005 cm too.
Comment: @Martin-マーチン Thank you for your answer. Can you join this chat? http://chat.stackexchange.com/rooms/51938/dimensional-analysis
Answer: Yes, there are exactly $12 \times 12 \times 12$ = 1728 cubic inches in a cubic foot.
Also, an inch is exactly 2.54 centimeters.
A foot is exactly 0.3048 meters.
A yard is exactly 0.9144 meters.
See NIST Special Publication 1038 for more information.
Answer: Within a certain system of measures, conversion factors are typically exact.
In imperial units, this means that a foot is always twelve inches, a yard is always three feet and a mile is always 1760 yards. With the exact conversion, we can use multiplication to see that:
$$1~\mathrm{yd} = 36'' \pm 0''\\
1~\mathrm{m} = 5280' \pm 0'\\
1~\mathrm{m} = 63360'' \pm 0''$$
Likewise, the conversion from cubic imperial units — which are defined as $\text{imperial unit}\times\text{imperial unit}\times\text{imperial unit}$ — to other cubic imperial units is equally exact.
$$1~\mathrm{yd^3} = 1~\mathrm{yd}\times 1~\mathrm{yd}\times 1~\mathrm{yd} = 3' \times 3' \times 3' = 27~\mathrm{ft^3}$$
This is akin to the exactness of the conversion of metric units, except that the metric factors are always multiples of 10. But there are also semi-metric units, such as the German 'metric pound', by definition $500~\mathrm{g}$. Conversion from grams to German metric pounds is as exact as conversion from grams to kilograms.

This becomes different if you leave your system of measures and compare different systems. Except in a few very special cases, where two systems chose physically identical starting and/or ending points but with different step sizes,[1] the conversion factors will be nonexact.
Any nonexact conversion factor will introduce an error of its own into the equation and how to deal with these is best shown in Martin's answer.
Note that even if the transformation is exact at a starting and ending point, measured values will still have an inherent uncertainty in them, as Martin pointed out. The uncertainty is transformed across the conversion and does not change magnitude.

[1]: See for example temperature. A measured temperature of $15~\mathrm{^\circ C}$ can be transformed into an exact value in kelvin because the kelvin and celsius scales are identical except for an addition factor. Thankfully, also the error is identical.
$$(15.00 \pm 0.005)~\mathrm{^\circ C} = (288.16 \pm 0.005)~\mathrm{K}$$
Similarly, the Réamur temperature scale is defined such that the boiling point of water is $80~\mathrm{^\circ r}$ while the zero-point is identical to the celsius scale. Therefore, the step is different and $1~\mathrm{^\circ C} = 0.8~\mathrm{^\circ r}$. Upon converting, we get a similarly exact value but a different error.
$$(15.00 \pm 0.005)~\mathrm{^\circ C} = (12.00 \pm 0.004)~\mathrm{^\circ r}$$
Comment: Thanks for your answer and example, could you stop be the chat too? http://chat.stackexchange.com/rooms/51938/dimensional-analysis


Why am I seeing a low voltage when the switch is open?

Question: I'm building a battery test circuit to check the voltage of the source battery and I've added a Sziklai pair of transistors in as I need to be able to shut off the voltage so that I don't have a low current constantly being drawn while the MCU is asleep.  I've put in a multimeter to simulate what I'd be getting as an input into an ADC.  When the switch is closed I get 4.815V which is what I expect, when the switch is open however, I am getting a reading of 0.108V and I can't for the life of me work out why there is any voltage present.
Comment: Do some more measurements, like where is current flowing, where is some other unexpected voltage, like on the gate of Q2 ?
Answer: I think that your are seen this small voltage because Q2 'open' model is a high value resistance but not a infinite value. So, there will be a voltage divider in the loop V1, Q2, R1, R2. Can you check the Q2 model?
.
.
.
edited to add that, by approximation, v_mesuared = 14V*7.87k/1M ~=0.11 V
So, we can have a guess on the open model of Q2 (~1 M ohm).
Comment: Yes that appears to be the case.  I didn't base the resistance on a real world value which is why I am seeing this. According to the sim it's drawing 13.7uA which is negligible for this use case, however replacing it with a 2SJ652 (38M Ohm) has brought down the simulated circuit to 16.4pA and 0.129uV which looks far better.
Thanks for your help
Answer: The zero gate voltage drain current of a 2SJ517 can be as high as 10 uA so, if that current flows through R2 you will develop a volt drop of nearly 80 mV. Those leakage currents can be a pain and you need to double check what curent is flowing from the drain to be sure.
If the "switch" is in fact an MCU output then you can make R1 and R2 much smaller and get a more accurate result. You also need to consider that if you are feeding an MCU ADC input, it might require a lower impedance source to guarantee accuracy. You only need to operate the switch for a short period and only infrequently so I don't see that the battery discharge potential is very significant.


How to insert the image field in the menu links

Question: How to insert the image field in the menu links? I've added an image field in the vocabulary I've created and uploaded image on each terms. I am able to display those images and the other fields I require using the views and I've used the taxonomy_menu to add the terms in the menu links, but one of my requirements is to display those image into the menu links. I don't think that the menu_icons module is the solution, I don't want to double up the work in uploading the image. Please bear with my English and hoping that I explained it well. Thank you.
Answer: You can try using the module Menu Minipanels. This module will allow you to use views and custom blocks inside the menu.
Or you can customize the menu display as specified here.


How do I create a star-rating system?

Question: Amazon has a star rating system. Other sites use smiley faces that change color when you mouse over them. Does anyone know of an API I can get or a simple way to put this together?
This is an ASP.NET 2010 app.
Answer: Have a read of this:
http://imar.spaanjaars.com/410/building-a-simple-rating-control-for-aspnet-20
Answer: Presuming it is ASP.NET web-forms you could try using the Rating control in the Ajax Control Tookit. Or you could check out Building a Simple Rating Control for ASP.NET 2.0 tutorial which guides you through all the steps. If you'd rather go the jQuery root then there are plugins to do this, though the back-end data capture and storage would be a bit more tricky in web-forms.
Answer: There are many Star Rating available as controls. From microsoft or  codeProject
or css Jquery etc. try  Binging/googling it :-)
Answer: Telerik has a nice one, if you are looking for commercial software (as opposed to free stuff)
Answer: i believe you need to look for javascript to solve this...
you can check:
http://speckyboy.com/2010/04/21/15-javascript-and-plugins-and-tutorials-for-adding-ratings/

How do I create a star-rating system?


Does Google Maps API or OSM provide location/place boundaries

Question: I've been digging around today in Google Maps and Leaflet API's to find if there is an easy way to get these boundaries instead of needing our users to manually outline these things (like drawing polygons on the map)?
Answer: You can export data for several boundaries from the main OSM database. Administrative boundaries are complete in OSM for admin_level=2 that are for whole countries, and they are very up-to-date.
The deper you go in admin_level there are countries that have 100% coverage for each place region, other countries still have some gaps.
When using data from OSM, pay attention to ist free licence ODbL.
Howto do that, search for "[openstreetmap] export boundaries" on this site, or search for "export boundaries" on http://help.osm.org
There you will find services how to get boundaries in different file formats. and you can display them via any framework like leafletjs, openlayers or any other.
Answer: Baed on the Openstreetmap database, there is a service https://osm.wno-edv-service.de/boundaries/ which lets you select and download boundary data in various formats. Just expand the nodes on the left panel of the countries you want.
If this is too slow for you, take the data from http://www.gadm.org/country or http://www.naturalearthdata.com/downloads/.
Comment: Url is outdated, page moved to https://wambachers-osm.website/boundaries/
Answer: Mapzen provides boundary data for all admin levels extracted from OpenStreetMap data as GeoJSON, divided by country as part of their Borders project. The data is available for download at https://mapzen.com/data/borders/
Answer: Yes, OSM provides boundaries if you pass the parameter polygon_geojson = 1, I use MapQuest webservice which is a mirror of OSM:
var mapquest_search = 'http://open.mapquestapi.com/nominatim/v1/search.php';
var params_mapquest_search = {
    params : {
        polygon_geojson : 1,
        'accept-language' : 'pt-BR',
        addressdetails : 0,
        format : 'json'
    }
};

Another option is to use MapIt webservice. Here's a fiddle - http://jsfiddle.net/jonataswalker/zqfk9t2x/. Click on map to get state boundaries.
I'm using Openlayers but can be easily port to other library.


Etymology of the word "Alambric"

Question: I saw the words "Alambric" and "Inalambric" in use on a forum recently and was surprised to find no results on Dictionary.com or Merriam-Webster. It seems to mean "wired" and "wireless" respectively. Google seems to understand the words as wired and wireless and returns results but also doesn't have any results regarding the definition or origin of the words. I'm very curious as to where they came from and why they're not in the dictionary.
Comment: @Nathan please quote your sources.
Answer: From Latin aerāmen, accusative aerāminem, "bronze", entering Spanish as arambre, "wire" (compare Latin nominem -> Spanish nombre, "name", or latin hominem -> Spanish hombre, "man). http://dle.rae.es/?id=3OmdsSM
Following that, arambre became the Spanish word for "wire" as it is today, alambre. http://dle.rae.es/?id=1Ry62WZ Spanish sometimes confuses r's and l's in words that have more than one of them: Argelia (Algeria), milagro (miracle), plus the old favorite coronel (from which we got our pronunciation of "colonel").
From alambre, Spanish has adjectives alámbrico and inalámbrico. http://dle.rae.es/?id=LAi5Jpk I hadn't been aware of the use of cognate words in English.
Comment: This is a good answer (I <3 references). I think I know what's happening. "Alambric" and "inalambric"are **not** words in English, but rather errors made by Spanish speakers who think they're words. Nobody except Spanish speakers will know what you're talking about if you use either word in English.
Comment: I think you're correct. I just checked the Oxford English Dictionary, and even that comprehensive work doesn't have an entry for "alambric".
Comment: Philip Pullman in His Dark Materials trilogy refers to electricity as anbaricity, or anbaric power - I guess he may have been influenced by the Spanish, or your speaker influenced by Philip Pullman.
Comment: "Anbaracity" is unrelated. "Electricity" comes from "elektron" (ἤλεκτρον), Greek for "amber". Amber manifests the sort of attraction caused by static electricity when rubbed. In turn, "amber" is derived from "ʕanbar" (عنبر), Arabic for "ambergris". Pullman generated a whole litany of alternative terminology based on alternative etymologies, including "anbaricity" for "electricity". (The [ʕ] sound is like a voiced "h" and usually omitted in English transcriptions and pronunciation--for example, it's the first sound in the Arabic names for "Arab", "Iraq", "Abdullah", and "Omar".)

Etymology of the word "Alambric"


Question about $M/GI/ \infty $ queue

Question: Consider an $M/GI/ \infty $ queue with the following service time distribution: the service time is $1/\mu_i$ with probabbility $p_i$, and $\sum_{i=1}^kp_i=1$ and $\sum_{i=1}^kp_i/\mu_i=1/\mu$. In other words the service time consists of a mixture of $K$ deterministic service times. I am trying to understand if the departure process of the model is Poisson? Does anyone have any ideas? Thank you in advance !
Answer: It seems that the departure process is indeed a Poisson process. See for example the first line of the paper: Newell, G. F. "The $M/G/\infty$ Queue." SIAM Journal on Applied Mathematics 14.1 (1966): 86-88.

Question about $M/GI/ \infty $ queue


Outlook Web Access...... internal access?

Question: I have a working OWA internally and externally. Users can access OWA externally through https://domainname.com/owa and internally through the IP address. What I want is internal users to access OWA by browsing to https://domainname.com/owa rather than the IP address for obvious easy of use.
Answer: This is a DNS problem, not a OWA one.
If your firewall/proxy can't handle requests for domainname.com from the inside, then you will need to create a "shadow" zone for domainname.com in your internal DNS servers, which maps your public names to internal IP addresses.
This way, domainname.com will map to some public IP address when resolver from the outside, while it will map to your CAS server's internal IP address when resolved from the inside.
Comment: Whats a "shadow" zone and how do I create one?

Does that mean it can resolve names to the internal address, internally? So externally nothing will change.

I don't really want internally traffic resolving to an external address when I know it works internally when browsing to the internal IP!
Comment: It's exactly that. If you create a zone called "domainname.com" in your internal DNS server, it will answer requests for names in that zone with whatever IP addresses you tell it to use; so, a client asking for something.domainname.com to the internal DNS server can get a completely different answer than a client asking the "real" external DNS server.
Answer: If you are not using AD DNS for your External DNS needs, then you can add "domainname.com" to your AD DNS, using your internal IP address.
This will solve your problem by providing the internal IP address to people in the office, but people outside will still resolve your external IP address as they do now.
However, once you add domainname.com to your AD DNS, AD will try and resolve ALL YOUR INTERNAL DNS REQUESTS - so you'll have to duplicate, or have appropriate counterparts for all of your external DNS records in AD.
Also be aware that people with laptops may cache the DNS records for either the internal or external IP address, and it could break owa for them when they move in and out of the office. - the solution is for them to flush their DNS or reboot.
Answer: It should work fine on the external address. Is your AD Domain name the same as your web domain name? If it is, this could cause DNS problems internally that would prevent this.
Comment: @mMarkM Actually no - there are good reasons why it might well not work with the external address, a lot of routers are set up to not allow loop backs from inside the network to the external IP address (I can't comment on why, but presumably its a security thing) so you need to deal with that by using and appropriately configuring a local DNS server as described in other answers
Comment: No our domain is .local
Answer: Have you tried to get to in from inside using the external address?
If it does not work, then just add a DNS record to your AD DNS server for the FQDN of the external address and point it to the internal IP address.
Or figure out why an external domain (yours) is not resolving correctly since your internal one as .local should not interfere with the the resolving of the external one.


Molecular integrals in spherical harmonics?

Question: I have been trying to write a basic HF code that can compute the MOs and total energy of a molecule. I followed the following reference for overlap and kinetic integrals. During a conversation with a developer of Libint, I was told that I should try implementing spherical harmonics into the code.  I found this paper for the conversion from cartesian to spherical harmonics. Any beginner or intermediate level pointers on how the integrals are computed in spherical harmonics would be much appreciated. I am not looking for specific implementation details, but for the general algorithm.
Comment: +1 but it's not clear to me where exactly your problem lies? You know what spherical harmonics are, but you don't know how to write a code to do integrals that involve them? It also might help for us to understand better the underlying motivation for this code. Is it meant to be faster than libcint (the GitHub repository talks a lot about parallelization)? I'll also mention this question: https://mattermodeling.stackexchange.com/q/9595/5 which was asked by a student that was writing an HF code for their high school project. That code is now complete: https://github.com/lela2011/Maturaarbeit
Comment: The motivation behind writing the code is twofold: (i) I would eventually need to teach students how these codes work (if I land a faculty position), and (ii) Even otherwise, it is good to know how the codes that we routinely use work. To answer the question about "is it meant to be faster than libcint?" No, I just want to know how these integrals are implemented in spherical harmonics.
Comment: Thanks, this answers my question about the motivation behind writing the code, but not the part about what your problem is. Right now I don't know how to answer the question because I don't know where exactly the problem lies! I do agree that there's value in knowing how a code works, but writing a full fledged software to do the same thing as an existing code, isn't the only way to learn how the existing code works. Writing a code for electron repulsion integrals is more time-consuming than it is valuable in my opinion. It's re-inventing a wheel rather than a car. But tell us how we can help!
Comment: Prof. Dattani, I agree that I would be reinventing the wheel if I try implementing it. Leaving the part of me implementing the routines, can you guide me to some pointers on how the integrals are computed in spherical harmonics?
Comment: Yes, I think the question needs to be more specific though!
Comment: Prof. Dattani, I have edited the question. Please let me know if it works.
Answer: Molecular integrals aren't typically computed in spherical harmonics. What you do instead is to compute the integrals in the Cartesian representation, where they are separable, and then transform to the spherical representation as quickly as possible your algorithm allows, since there are $n_c=\lambda(\lambda+1)/2$ cartesians but only $n_s=2\lambda+1$ spherical harmonics for angular momentum $\lambda$.
What this means is that when computing the $(pq|rs)$ integrals, you convert an index to the spherical basis as soon as possible, so that the recursions for the remaining indices only deal with $n_s$ components for each transformed index instead of $n_c$ components for untransformed indices.
In practice, it is hard to say at which point the transformation should be done, since this is where all algorithms are different: McMurchie-Davidson, Obara-Saika / Head-Gordon-Pople, and Rys quadrature all have different recursion relations and different scaling with the total angular momentum.
For a concise introduction to molecular integrals, I recommend you consult "the purple Bible" i.e. Molecular Electronic-Structure Theory by Helgaker, Jørgensen, and Olsen, which discusses the various algorithms at length. Its chapter 9 is dedicated to molecular integral evaluation and is almost a 100 pages!


Bump line-height for comments which use LH pitch accent markings

Question:
Right now, the accent marking across two lines sort of merge together in comments. If we could selectively (or even not selectively) raise the line-height by an extra px or two when pitch accent markings are being used I think that would resolve this issue.
Answer: I think it's generally a good idea, but maybe we should collect more data about different systems before trying to make global adjustments — on Firefox on Linux (Ubuntu) the accent marking across multiple comment lines displays fine:
Comment: Ah yes, important to note my screenshot is from iOS mobile


Why does my Mii Fighter occasionally have the wrong moves?

Question: Every once and a while, I'll select my Mii Fighter and all of the moves will be set to what I assume are the "default" moves. This usually means doing an Airborne Assault off the edge instead of throwing a Chakram and a lot of frustration. I can only assume this is a bug, but is there a way to avoid this bug? Does something in particular trigger it?
Comment: Last time I played, I wondered if the difference was whether "custom fighters" was turned on or off...
Comment: When you select a mii, there is a question mark option which will randomize your mii movesets (also appears for any character when custom moves are turned on), are you sure you are not sometimes selecting that?
Comment: @luisluix I remember seeing that for other fighters, but not Miis. I'll have to double check when I next play.
Answer: Check to see if you put in the right moves for your fighter and make sure to save it. Your game should not be able to change the moves that you set for a Mii Fighter.


Is "Quelle heure est-on ?" a valid way to ask about time?

Question: Is it allowed to say "Quelle heure est-on" instead of "Quelle heure est-il"? What's the difference between these questions?
Comment: Same thing.  "on" is an undefined pronoun which can replace personal pronouns, like "il" here.  I personally never heard the "on" version said by anyone around me, always the "il".  So I do not think it is grammatically a mistake, more a usage details.  http://www.espacefrancais.com/le-pronom-indefini-on-lon/#-On--se-substitue--nimporte-quel-pronom-personnel
Comment: Cela s'emploie pour l'identification du jour : On est vendredi. Je ne sais pas pour les heures.
Answer: I thinck it's not correct, bacause it is an impersonal form (forme impersonnelle), as, for exemple "il pleut". You can't say "on pleut" (unless as a kind of joke). The "il" doesn't refer to anyone.
Answer:
Quelle heure est-t-il ?

is what is taught at school but is somewhat formal and relatively infrequent.

Quelle heure il est ?

is by far the most common way to ask "what time is it?" in spoken French.
A common but regional (Switzerland and large South-Western France) sentence is:

C'est quelle heure ?.

and you might even hear the colloquial and dubious:

On est quelle heure ?

perhaps groaned by someone not fully awoken in the middle of the night, and due to the proximity and confusion with:

On est quel jour ?

On the other hand, the suggested:

*Quelle heure est-on ?

is extremely improbable from French native speakers if only because its formal structure doesn't mix with the informal and offbeat on.
The fact is there is no real flexibility with these kind of sentences. You can't say either:

il est quel jour ? or il est quelle année ?.

I suspect the specificity of il est vs on est might be due to the fact that while we are fully and clearly "into" the space-time of the days, month and years (on est vendredi, on est en janvier, on est en 2018, on est en hiver...), the ephemeral hour was, until a not so distant past, an imprecise and often inaccurate concept. That means we were not really sure to be "at" a specific hour, but only aware that some device like a sundial was suggesting an hour.
We still say:

il est quelle heure à ta montre ?

meaning that is not necessarily the right information.
Comment: I don't think it's just improbable because tones don't match, "Quelle heure est-on ?" is just not the proper interrogative form, because you don't say "On est 11h", but "Il est 11h". The same way you wouldn't say "Il est mardi" ...
Comment: @LaurentS. Not just because the tone indeed. My point was *quelle heure sommes-nous ?* seems to me more acceptable (more precisely less unacceptable) than *quelle heure est-on ?*
Answer: TL;DR : It is ok, but why would you?
It depends of what you mean by "allowed".
Is it grammatically correct? Yes. Will that carry the meaning? Sure. But if I hear someone say that, i would assume he's either from Canada or a remote place in France.
It sounds like "Quelle heure fait-il?" for me: it's understandable, yet not the "classic and corect way" of saying it.
Comment: I am from Canada, and I never heard it either...
Comment: @Nic3500 Indeed, and I never said people in Canada used it ^^ Check it again: I said my **assumption** if I heard that would be that you were from those places. Niot because they use it, but because they sometimes have weird formulations that we're unaware of.
Answer: That would be correct in my opinion. But that's really odd to the ear. I wouldn't use it myself, as a native speaker, and would be confused for a millisecond if anyone were to ask me that way.
Now if you really think about it, and had to use a more uncommon sentence construction, such as:

Est-il tard ?

I don't think you'd be able to replace it with "on". That wouldn't work, on pronunciation flow side. Or at the very least would sound odd.

Is “Quelle heure est-on ?” a valid way to ask about time?


Is it dangerous to block blows from someone bigger than you?

Question: If you were fighting someone bigger than you in a street fight (and a possibly trained thug), would it be dangerous to block it if the attacker is also stronger than you? Should you dodge instead? In the same case, is parrying safer?
Answer: In a street fight, physical size and perceived strength have little bearing.
In a famous example, a petite female MMA fighter (Polyana Viana) was mugged on the streets of Rio by a male.  After she was done with him, he looked like a truck hit him and required medical help... she did not:

source: mixedmartialarts.com
There's a world of difference between throwing a punch (or elbow, knee, or kick) and throwing an effective punch (or elbow, knee, or kick).  Similarly, there's a world of difference between know how to take a punch (or elbow, knee, or kick) and being hit.
I've seen people of all shapes and sizes involved in street fights with others.  The only consistency I've seen in outcome is how hard the really big guys hit the ground.
Whenever possible, it is best to avoid street fighting.  You never know the training of your opponent, or who has a weapon.  And if law enforcement eventually arrives, they often arrest both parties.  But if they only arrest one of the fighters, it's often the victor, regardless of who started it.
Answer: Really it depends what you call a block.
If you use 'cover blocking' from boxing in a street fight I would say this is dangerous because you are probably not wearing gloves.  You will have to adapt these to make them work against anyone without damaging your fingers.  You will probably adapt them into something resembling karate/taekwondo before they work well with bare hands.
Boxing Blocks
If you are using karate/taekwondo blocks (uke) you will not pull them off against a  much physically stronger attacker.  I say this because it requires actually pushing the arm out of the way.
Tae Kwon Do Blocks
If you train in Shorinji kempo we teach to dodge and parry (uke again) instead.
This does work against a stronger attacker (I weigh about 100kg and can use these sparing with a 140 kg opponent) but you have to carefully control the distance to allow yourself space to read the attack.  This is because you intend to move your entire body (and possibly legs too) in the time your opponent uses to make their attack.  If they are too close you won't have time to do this.
Shorinji Kempo Blocks
If you are training a Wing Chun or similar style (or Shorinji Kempo at 2nd dan level or above) you may manage to unbalance your opponent using your deflection, but this is really hard to do and gets harder the more training your opponent has.
At this point you are crossing the line from striking to light grappling but it's still a kind of block in a way.
Wing Chun Blocks
If your blocks of this kind are good enough you can actually prevent the second attack in a combination from coming by bringing your attacker to kuzushi with the block from the first attack.  I can't pull this off as yet though, even after 10 years of training but I am beginning to learn this method.
Bottom line is, blocking is not an easy thing to do.  It takes time to learn and you have to think carefully about what kind of strategy you are using too.  Also you have to train blocks without gloves if that is how you intend to defend yourself.
Comment: To be fair: 100kg vs. 140kg tends to have less difference in muscle mass (hence stability and power) than, say, 70kg vs. 90kg.
Comment: @PhilipKlöcking I suppose more to the point smaller people can block me this way.
Answer: You are never going to know whether the person is stronger than you until you've seen or felt the amount of damage they can do. Bigger guys exist that can't strike if their life depended on it, and there's also smaller guys who will surprise you. It also depends on how you block. A stronger guy may be able to wear down your forearms, but block his fist with an elbow a few times and I'm pretty sure he'll be worse off pretty quickly.
Dodging will obviously avoid any damage completely but it will mean you have to be much more mobile (and may run out of steam before they do) and be mentally ahead of them. In a realistic fight it is very difficult to avoid every blow unless you take out the opponent after their first one. And if worse comes to worse, it is always better to cover up just in case then be "dodging" and blocking with your face. Even if it was a baseball bat or knife coming at you, you would probably want to dodge, but I would certainly use my hands to protect the more vital parts of my body.
Comment: A slightly off topic question here: how can I block a punch with an elbow? Have this technique ever been successfully implemented in recorded fights before (assuming both sides are trained)?
Comment: I know it's just a movie but the following is pretty accurate I would say. Essentially it is finger bones vs the elbow (hardest part of the body). I can't imagine any scenario where a fist could straight on overpower an elbow: https://youtu.be/zdONLVwVZqk?t=212


My userid on Stack Overflow.com doesn't work on other Stack Exchange sites, how to fix?

Question:
When I first came to Stack Overflow.com I logged in with a Google account, and I have 2 Google accounts.
I went to unix.stackexchange.com and tried to use the same Google account , but could not. And I signed up for a regular Stack Exchange account. and that is what is used there now.
When I'm on Stack Overflow.com (using first account) then go to the unix.stackexchange.com, I'm logged out by the system. When I log in to unix.stackexchange.com, it doesn't ask me for an id, it just logs me in using the incorrect Stack Exchange account with only 1 point.
How do I use my Google account from Stack Overflow.com to read and post on unix.stackexchange.com? How do I use the points on Stack Overflow.com and unix.stackexchange.com at the same time? Do I have to delete a cookie or saved password somewhere? I use Firefox 29.
Comment: Just to say that you should have been able to register the google account - you didn't specify what was not working, which would be useful to know.
Comment: Please don't edit your question into something **completely different**, invalidating existing answer in the meanwhile. Ask a new question.
Comment: I edited my comments to reflect what I just found out. I'd like to see the same points on stackoverflow.com as on unix.stackexchange.com. Usually on other sites, if you log in with the same ID, my first SE account will be used on the unix.stackexchange.com site.
Comment: "I'd like to see the same points on stackoverflow.com as on unix.stackexchange.com". They are different communities and different sites. I understand you would like the reputation to be cumulative, but that's not how it works. Both can be linked to the same network account, but are otherwise completely separate.
Comment: Having the same rep on all your accounts on SE is a bad idea. Just because someone has a 5 digit rep on SE doesn't mean they know anything about cooking or aviation, for example.
Answer:
Go to your account page on unix.stackexchange.com (you didn't link to it, so...).
Click the "my logins" link at the top.
In the popup, click "add more logins...", at the bottom of the link.
Add your google login.
Comment: @Bulrush - well, yes. On each site you start with 1. Once you reach 200 on a single site, you will gain a 100 reputation bonus on the others.
Comment: The account on unix.stackexchange.com is already my Google account for some reason, but my points on unix.s.com are 1. I have more points on stackoverflow.com. Do I get zero points when I start each SE community?
Comment: Ah, there's the problem. I didn't know that.


Can I port a project built on Arduino Uno to a standalone ATmega328 using the exact same code?

Question: I'm building an IoT power usage monitor in which the data is logged using a RTC and an SD card module and a web app hosted on an ESP8266 gives access to this data. My question is can I use the exact same code (with libraries like "ESP8266.h") on a standalone ATmega programmed using Arduino as ISP?
Comment: Yes you can.  There shouldn't be any difference.
Comment: most code should run the same. try it and work through the compiler errors.
Answer: Almost all of my projects are roll-your-own-duinos with Atmega 328p chips, with code generated for an "Arduino/Genuino Uno" board. Many of them use an ESP8266-01 board as a WiFi interface. I either run the entire board at 3.3v or use a daughter-board that interfaces the ESP to a 5v environment.
If you're porting code from an actual Arduino Uno, there is nothing to do except to make sure your pinouts are the same between the Arduino and the RYO-duino. Otherwise, make all your pin definitions constants and group them together in such a way (e.g. with #ifdef / #else / #endif) that you can easily enable one or the other group just before you compile.
Update:

There's a bit more required, for example, the clock rate needs to
  match or the timing will be off ...

I did gloss over the power & clock since the question hadn't asked about departures from the Uno's design. But yes, a RYO will need a compatible power supply and a matching clock rate, to be able to assume an arbitrary sketch could be run on it successfully. To make the RYO look like an UNO, it will need 5v power and a 16 MHz crystal, just as the Uno design provides.
If a RYO is designed be other than like an Uno, considering power source, clock rate, fuse options, DIP instead of an SMT, then there is nothing to support the supposition that a port from an Uno could succeed without modifying the code for those differences.
Comment: There's a bit more required, for example, the clock rate needs to match or the timing will be off, and the clock source and supply voltage need to match or the fuses may make the system unbootable or unstable.
Answer: You can run any code on an ATMEGA328P that you can run on an Arduino Uno. For maximum compatibility, you would configure the ATMEGA328P with a 16Mhz crystal/resonator.
There are instructions for using an Arduino Uno as an ISP for programming other devices, many of which require a Uno with a DIP version of the ATMEGA chip which can be removed.
What you cannot do is directly run code for an ESP8266 on an ATMEGA328P.
Comment: fun fact: shorting reset to ground does the same thing as removing the DIP...
Comment: An Arduino with the processor removed or held in reset is not likely to be helpful for **ISP** operations, rather it could be borrowed as a serial interface for *bootloader* or *test* ones.  **BEWARE** that an ATmega with its reset grounded is susceptible to corruption (loosing the bootloader, etc) if it sees ISP-like traffic on the SPI pins.
Answer: Yes, it might work. But as a minimum you should check that the following is mapped between the two in a compatible way:

Pinout and configuration of pins. ESP8266 allows INPUT_PULLDOWN in some pins, whereas ATmega328 doesn't.
Use of timers and interrupts. ESP8266 accepts "true" interrupts on all I/O pins, whereas ATmega328 only accepts them in 2 pins (although you can use Pin Change Interrupts (PCIx), which are far less powerful than "true" External Interrupts (INTx)). Also, ESP8266 accepts HIGH level interrupts, whereas ATmega328 doesn't (even on INT-capable pins).
Use of specific ESP8266 libraries which won't work at all on an ATmega328

The Arduino library ports for ESP8266 may work as expected out of the box, it may require minor tweaks, or it may require a major revamp of key code fragments. It's difficult to say without seeing the code.
Comment: he's not switching to an ESP, he's switching to a bare chip and still wants to connect the ESP as a module. (not sure why; the ESP is faster, cheaper, etc...)


Deactivating Events - Registration Cancellation Notice

Question: every time i delete a participant in an event, a registration cancellation notice is sent to them. I would like to deactivate that function - I system workflow messages I can only change the content, but not deactivate this. I may have to change civievent code. Any hints where and how?
Best wishes, Michael
Answer: This could either already solve your question and if not give a very good idea of where to look: https://civicrm.org/extensions/prevent-sending-event-registration-confirmation-back-office


In what sense is mathematics thought to exist in the real world?

Question: It has been said that it is remarkable that the world (at least, parts of it) can be described by mathematics, especially in physics. After reading another question I know that it was Wigner who spoke of "the unreasonable effectiveness of mathematics": Nature speaks the language of mathematics and can reply to the questions we ask in this language. It would be remarkable (unreasonable) if she couldn't reply in that language but that's my opinion.
There are people (like Tegmark) who think that because of the remarkable fact that Nature replies in a mathematical way (or because of something else), mathematics must reside somehow in Nature. It is even supposed that because of this there must exist other worlds in which different mathematics exists. We can think of different kinds of mathematics though, even if there is no part of Nature that replies to us in the thought math or math structures.
In what way is mathematics thought to exist independently of us human beings?
Comment: Somewhere there's a bat Tegmark who thinks the world must be a big echo chamber.
Comment: Or a red ant one who thinks the world is one big meal to devour...
Comment: For further information, see [this SEP article](https://plato.stanford.edu/entries/nominalism-mathematics/), and perhaps also [this one](https://plato.stanford.edu/entries/fictionalism-mathematics/).
Comment: this is a duplicate question.
Comment: Does this answer your question? [What are the historic stances on the epistemological status of mathematics?](https://philosophy.stackexchange.com/questions/22448/what-are-the-historic-stances-on-the-epistemological-status-of-mathematics)
Answer: There are at least two schools of thought on this topic, I invite the experts here to add more.
The first school holds that mathematics is a human construct and that connections between the natural world and mathematics are human inventions. In this view, without humans there would be no math.
The second school holds that mathematics is (frequently) embodied in phenomena occurring in the natural world, and that connections between the two which are uncovered by humans are not human inventions, they constitute discoveries about the (hidden) world of mathematics.
I reject the first view because to me it implies that without someone around to observe the "mathematicity" of the universe, it would not behave in a mathematically-describable manner: the tree does indeed fall even if there is no one around to hear it.
I accept the second view- that math somehow "exists" in the universe independently of the presence of humans to "hear" it. In my experience in the worlds of engineering and physics, I have seen how completely "abstract" fields in mathematics, which were invented by mathematicians, were decades later discovered to be just what was needed to furnish a logical structure for mathematical reasoning about a newly-discovered field or phenomenon in physics.
In my opinion, the two best examples of this are Niels-Henrik Abel's creation of Abelian and non-abelian group theory and its later application to making sense of quantum chromodynamics and the strong nuclear force, and Riemann's generalization of euclidean geometry to include the concept of a curved space which was exactly what Einstein needed to mathematically describe gravitation.
Comment: I agree with you on the existence of the physical world. I'm not sure if I agree with the math though. It would be strange if the physical world (and we belong as well to it; we eat it every day...) didn't answer in the language of math if we ask a question in this language. But the language doesn't say anything about existence. I know what you mean when you talk to me but to say the language resides in you, independently of you, is a different thing. *How* should the math exist in the physical objects it describes? Is language a true aspect of you?
Comment: "didn't answer in the language of math if we ask a question in this language" Can you elaborate on what you mean by this? It seems easy to imagine a hypothical world where trying to predict/describe the world with math would just hit a wall at some point, like if we were in a Matrix style virtual reality and our "real" brains were outside the simulation and thus couldn't be investigated with measuring instruments within the simulation (which is not so far from what Cartesian dualists believe). Or an animist style world where *every* object was controlled by some intelligence outside it.
Comment: @Hypnosifl Morning! (or evening!) I mean that if we look at the right places (determined by the math itself) we will see Nature (the stuff around us) correspond to it. This doesn't mean that it exists (the math) in the "real" world we can't investigate. The same holds for the gods. They live in a world we don't have access to (yet) but we (or the old Greek) could correspond to them. Do you think that math is like these gods? That it exists in a world of which this world is a shadow? Or does the math live in the stuff of Nature itself? If so, then how?
Comment: When you say "look at the right places (determined by the math itself)", are you suggesting that--as in the virtual reality with external puppeteers--there might be *other* things we could look at that would resist all attempts to predict them using mathematical laws? Are you assuming the incorrectness of the reductionist view (see Einstein in the 5th paragraph [here](https://www.site.uottawa.ca/~yymao/misc/Einstein_PlanckBirthday.html) for ex.) that the laws of physics acting on basic physical states (arrangements of particles, say) could in princ. be used to derive all physical behavior?
Comment: (cont.) "Or does the math live in the stuff of Nature itself?" Yes, I tend to favor the notion of [structural realism](https://plato.stanford.edu/entries/structural-realism/)--that the physical world is wholly defined by a structure of mathematical relations, w/ no other properties. I also favor the type of physical reductionism I talked about above. So for example if you could build a sufficiently powerful computer, a simulation which was given the initial physical state of all the particles in a human brain and body, along with the fundamental laws of physics, would reproduce human behavior.


Starcraft 2: Custom achievements?

Question: I thought I'd be sneaky and try getting the custom achievements playing "the fastest map possible". Just beat 7 insane AIs in FFA, but didn't get the "Insane FFA" achievement... why not? Does it have to be done on a Blizzard map?
Comment: That would be to easy to create a map where all the AI get no minerals and you have the whole supply. You actually have to ACHIEVE the achievement.
Comment: @Tricky: K, but that still doesn't answer my question.
Comment: Thats why i made it a comment. I don't have an answer, just a theory.
Answer: I believe that it does have to be a blizzard sponsored map.  Easiest way to get it in this case is to play on Lava Flow as terran.  As soon as the game starts, load your scvs into your command center and fly to one of the islands.  Get an engineering bay pretty soon, and start to pump out turrents along the edges, and go strait to battle cruisers.  Soon there will only be one AI left, and you should have close to 20 cruisers, so you should be able to steamroll.
Comment: Not only that, but the games have to be created from the "Multiplayer" screen of Battle.net, and not a custom-game from the single player screen.
Comment: Yup, achievements can only be earned on Blizzard-published maps.
Comment: Damn...that was hard. Took me 4 or 5 tries, and BCs didn't work. Zerg kept mind controlling them, and they built a ton of devourers..err.. corrupters? Finally did it with marines/marauders/reapers/medivacs.. last player was Protoss that time. He had a wad of Colossi too..that scared me! Good thing most were fakes. Got 4 achievements at once out of it though :D (All the FFAs)
Comment: I can't remember the map I did it on (the dark grey map with the bases separated by chasms, kinda star-shaped), but I pulled it off, first try, with terrans. If you pick a map with a raised start, and a small ramp, you can depot/bunker/tank down pretty much everything early, and they'll get bored and kill each other, rather than kill your defenses. Don't expand early, you'll never hold it. I went BC's and that worked pretty well for me. The comp winner was heavy protoss ground, and that was an easy game over, though the early defense was tight a couple of times.
Answer: I developed my own way to do this. First I tried using just one base on abyss and walling off with loads of tanks and turrets but I always ran out of money repairing my tanks. So next I tried walling off at the wide choke after the natural. Just build 2 bunkers and rax there and then build 3 planetary fortresses to seal the choke ASAP. Build a bunch of tanks and turrets and no one can get in. The AIs will pretty much destroy each other and then you can just build a nice air force and destroy whats left. Took me about an hour but this method should work faster than that as I played very timidly.
Oh and I set all AIs to terran.
Answer: Battlecruisers work
Like Austen said, take one of the islands and mass battlecruisers with turrets surrounding island
Only use sweeps to scout players, don't send our units to scout or else you'll draw attention
Then, get one medivac and send scvs to the other island to mine vespene safely
Get Yamato, and pwnt, use orbital command for detection or get a raven
Deny Expos and demolish tech (so they can't get vikings, corruptors, or voids/phoenix/carriers depending on the race)
Comment: There is not really anything new added here, this should maybe just have been a comment on Austens answer.

Starcraft 2: Custom achievements?


Is it possible to see history of command blocks oín minecraft?

Question: So one of people i know said that somehow it is possible to see command block history (by that i mean commands that were there and then deleted/replaced) So i just wonder if it's possible. I cant find anywhere on internet that it is
Answer: No. In a Singleplayer World it is not possible.
But in a Multiplayer World, you probably can access the Commands in the Console History.
Answer: Actually, you can. I'm afraid I don not know what setting enables this. But when I use commandblocks, the commands are always put in the chat saying something along the lines of : Command block was changed to: my command here


Load on bed of pickup for extended period of time

Question: I just got a Toyota Tacoma 2012 Sport long bed. I'm an artist and I make driftwood horse sculptures. I have two horses on the bed of the truck currently which comes to about 500 lbs. I intend to cruise around NYC to show my horses to a few clients for the entire weekend. I'm wondering if it is bad for the truck's suspension to keep the load on for an extended period of time. Thanks!!
Comment: Can you upvote me answering your question?
Comment: Not relevant to th e question. Could you upload a picture of your horse sculptures? Just curios :D
Answer: Your truck is designed to carry that load.  If you consider carrying a full set of passengers.  1 in the front, 3 in the back, that weight would exceed your current load of 500 pounds.  I would not be concerned at all regarding doing on what you plan on doing.  In fact, make it 1,000 pounds and do it, your truck would handle that just fine although it may accelerate slower and take a bit longer to stop.  Enjoy your new truck, I have a 2013 and put a lot of weight in regularly.  I pick up used motorcycles and fix them up frequently.  Recently I went to LA, picked up two of them, drove around town on city streets meeting up with friends and drove back to Phoenix.  It handled it just fine.
The official load for your vehicle is 1,465 pounds and the towing capacity is 3,300 pounds.
Best of luck to you.
Comment: Agreed that 500lbs is nothing for these vehicles. I believe the payload rating is a bit lower than that (as far as what Toyota puts out). They rate it at around [1,200-1,500 lbs](http://www.toyota.com/content/ebrochure/2013/tacoma_ebrochure.pdf) ... Auto/Man tranny will differ, plus payload includes driver/passengers as well.
Comment: I corrected the load and added the towing capacity.  thanks for calling that out.
Comment: Ok great! Thank you everyone for the help.. I would like to post a picture but I am new to this site.. How do I post a pic?
Comment: My Instagram is francocuttica check it out!


How to insert logo in header so that it's visible on first page only

Question: In excel if I insert image in the header on first page it shows up on all other pages as well. How can I make sure it only displays on the first page only?
Answer: Check the "Different First Page" checkbox on the Design tab in the ribbon.
Also, please note there is a long-standing bug with Excel that stretches images in the header to an extra 10% of the original height.
Answer: You'll need to create a "Different First Page" header.
When you are editing the header on the first page, select the option Different First Page under Header & Footer Tools/Design in the menu bar.
If you want to add a header to the remaining pages, enter it on page 2 and it will be the same for all remaining pages.


Secure delete an erased file using same file

Question: Okay, so I have a late 2013 model retina macbook pro. A couple a days ago i placed a sensitive file on the desktop, and later deleted it by emptying the trashcan. I then read that was not the way to get rid of a sensitive file. I still have a copy on the file stored, on my other computer, and I was wondering if putting the same file in the same place (the desktop) would overwrite the old file I had deleted which now is allocated as "free space". I can use disk utility because I have an SSD. Then I can do a secure delete in order to erase it completely.
Answer: There is no way to guarantee to put the data in the 'same place', no matter where in the filesystem you put it.
Hard drives just don't work that way. They will put specific data anywhere they like [or to an algorithm unfathomable to mere users]
To be reasonably certain of overwriting the data [with as much certainty as you can have without destroying the drive] you would use Erase Free Space - which you will have noticed you cannot do on an SSD - though the way SSDs use their storage is completely unlike a HD; they try to allocate writes all across their memory-space to even out the wear. This makes recovery of a deleted file a much more difficult task than with an HD, but not impossible.
As far as I'm aware [& nothing ever seems certain in these things] the best way to 'erase free space' on an SSD is to fill the drive with random data - anything, a movie file copied over & over til the disk is full, then delete it all again.
That will have written over the previous data at least.
Repeat ad nauseum for multiple pass erase [if that even really has any meaning for an SSD.


Images in folder but not showing in admin and front

Question: I have moved site to another server but some of the images are not showing on front and admin.they are available in folder.
Is there any solution to it?
Comment: Did you try File permission
Comment: save all product and try
Answer: connect your server via ssh and
go to magento root directory
and fire below two commands
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

Answer: First, check whether you are able to get the image by hitting the image URL in the browser directly.
I think you would be getting either 404 or 500 error while accessing the image directly by hitting their URLs in the browser.
If it is the case, just rename the .htaccess file under media folder, clear cache and recheck.
You can also check server's error log if above steps do not solve your problem.
Go to next steps, if above steps don't work for you.
Open any product for editing and upload another image. Assign all radio to that image. Save the product. Check if you are able to see the newly uploaded image.
If yes, then you need to change the owner of media and skin folders.
Please let me know if it helped.
Answer: @Mohit..hitting url in browser showing default magento image. if I upload image from backend than it shows. I have already tried changing .htaccess but that did not help.
Answer: Expending Murtuza's answer,
Murtuza's answer is a temporary solutions as this happens due to file permission, so assigning permission to every image you upload is really not a good idea, as for once you can assign permission for uploaded content on your media folder but what if you upload new images?
Many users faced this problem after installing patch SUPEE-8788 and SUPEE-7405, these patches tightens file permissions on images uploaded from the Magento admin dashboard. Before the patch, the Varien file uploader used 0777 permissions for image uploads. Part of the patch installation changes these permissions to 0640 for files and 0750 for directories, which means only the user and group on the server can read these files.
To fix this, a manual change is required on the file lib/Varien/File/Uploader.php to adjust the 0640/0750 permissions to 0644/0755.
To perform this fix, open the file:
lib/Varien/File/Uploader.php

Search for this line:
chmod($destinationFile, 0640);

And replace it with:
chmod($destinationFile, 0644);

And search for this line:
chmod($destinationFile, 0750);

and change it to:
chmod($destinationFile, 0755);

Save the file and refresh Magento's cache. You should now be able to upload images correctly with permissions that the webserver can access.


Cloudfront, lambda @ edge, S3 redirect objects,

Question: I am building an S3 URL redirect, nothing special just a bunch of zero-length objects with the WebsiteRedirectLocation meta filled out.  The S3 bucket is set to server static websites, bucket policy set to public, etc.  It works just fine.
HOWEVER - I also want to lock down certain files in the bucket - specifically some HTML files that serve to manage the redirects (like adding new redirects).  With the traditional setup, I can both use the redirects, and also serve the HTML page just fine.  But in order to lock it down, I need to use Cloudfront and Lambda@edge like in these posts:
https://douglasduhaime.com/posts/s3-lambda-auth.html
http://kynatro.com/blog/2018/01/03/a-step-by-step-guide-to-creating-a-password-protected-s3-bucket/
I have modified the lambda@edge script to only prompt for a password IF the admin page (or its assets like CSS/JS) are requested.  If the requested path is something else (presumably a redirect file) the user is not prompted for a password.  And yes, I could also set a behavior rule in Cloudfront to decide when to use the Lambda function to prompt for a password.
And it works kind of.  When I follow these instructions and visit my site via the Cloudfront URL, I do indeed get prompted for a password when I goto the root of my site - the admin page. However, the redirects will not work. If I try to load a redirect the browser just downloads it instead.
Now, in another post someone suggested that I change my Cloudfront distribution endpoint to the S3 bucket WEBSITE endpoint - which I think also means changing the bucket policy back to website mode and the public which sucks because now its accessible outside of the Cloudfront policy which I do not want.  Additionally - Cloudfront no longer automatically serves the specified index file, which isn't the worst thing.
SO - is it possible to lock down my bucket, the server it entirely through Cloudfront with Lambda@edge BUT also have Cloudfront respect those redirects instead of just prompting a download?  Is there a setting in Cloudfront to respect the headers?  Should I set up different behavior rules for the different files (HTML vs redirects)?
Answer: Instead of using the WebsiteRedirectLocation meta, which is specific to S3 static website hosting and has no effect when Cloudfront is the server, replace your empty objects with HTML objects that contain a meta HTML tag with the desired redirect target:
<meta http-equiv="Refresh" content="0; url=https://www.example.com" />

The number before the semicolon is the delay before the redirect, in seconds, where 0 is immediate.
Don't forget to also change the Content-Type meta tag of the objects to text/html.
And if you want to support old browsers that might not handle the Refresh directive correctly, add an anchor link as explained here.
Comment: oh thats an interesting idea, I'll give that a shot and report back later! thanks


What type of wildflower is this?

Question: I live in Utah and I'm wanting to plant some Utah native plants in my backyard. There is this wildflower everywhere in the mountains of Utah and I really want to know the name. It looks like some sort of Paintbrush (Indian, Wyoming) but I've searched for those and they don't look the same.
Answer: As picture doesn't have different close up looks, by its color and looks I think, this is definitely a species of Castilleja ,commonly known as Indian Paintbrush or prairie-fire :

Castilleja, commonly known as Indian paintbrush or prairie-fire, is a genus of about 200 species of annual and perennial herbaceous plants native to the west of the Americas from Alaska south to the Andes, northern Asia, and one species as far east as the Kola Peninsula in northwestern Russia. These plants are classified in the family Orobanchaceae (following major rearrangements of the order Lamiales starting around 2001; sources which do not follow these reclassifications may place them in the Scrophulariaceae). They are hemiparasitic on the roots of grasses and forbs. The generic name honors Spanish botanist Domingo Castillejo.

It is more likely to be a species of Castilleja called Castilleja rhexifolia.
Common names : Alpine paintbrush , Rose(y)  paintbrush.
Family : Orobanchaceae (Broomrape Family)
From reference : Comparison between Castilleja haydenii and Castilleja rhexiifolia ;

Castilleja Rhexiifolia bract colours are most often hot rose-pink, but they range from subtle magentas to flaming rose to hot iridescent pink.

And on the left and right sides of the question picture have comparatively lower/light pink colour or iridescent pink color and the central flowers are comparatively darker or more magenta when compared to side ones.
Side ones :

Central flowers /focused flowers :
Comment: Welcome to Biology.SE. You are more likely to get a positive response to your answer if you explain why your identification is correct. Specifically, please [edit] your answer to add discussion of key features that led you to this conclusion and supporting references or at least validated images. Without this your answer is indistinguishable from opinion, which is not appropriate for answers on this site. ——— Thank you for taking the the [tour], but please also consult the [help] pages for additional advice on [Answer] effectively on this site.
Comment: @tyersome Thanks a lot for the guidance! I have updated my answer.

What type of wildflower is this?


Trigger for Freeze Button in Salesforce

Question: Is it at all possible to create a trigger, workflow rule, process builder, flow, etc that would automatically update a custom field on the User object when the "Freeze" button is clicked on the User's page? I have been down all of the avenues that I have listed above and have hit a wall each time. Since the isFrozen is located on the UserLogin object, I don't believe you can create a trigger that would populate the custom field. I wasn't able to create a formula field either since the isFrozen aspect is not on the User object. I am currently out of ideas at the moment. Any help would be much appreciated or a comment stating that this cannot be done at this point in time so I don't keep banging my head against a wall :) Thank you!
Comment: Would a Scheduable class work?
Answer: As long as these updates don't have to be close to real time (meaning: immediate), I would suggest taking the path @NewbieDeveloper27 alluded to and set up Scheduled Apex that does the following and runs every night, or whatever interval you deem appropriate:
<code>// Retrieve all UserLogin records with SOQL whose SystemModStamp is within the time range since the last run
// Use SOQL to retrieve all User records whose ID match UserLogin.UserID
// Update the custom field on User
</code>
One thing to be mindful of is Salesforce does not guarantee an exact execution time for Scheduled Apex; it can vary based on load. Therefore, it would be prudent to give the time range a little bit of a buffer to ensure no records are missed by the query.
Comment: is there anything that would perform this function immediately?

Trigger for Freeze Button in Salesforce


Cached or precomputed Immutable Functions in C# / C++

Question: By "immutable function" or "immutable method", I mean a function whose result will never vary if you give it the same arguments.
I would be interested to know if anyone know of a more generic or less verbose solution when you want to cache the precomputed value(s) of an immutable function.
Let me explain what I mean with a simple example:
//Let's assume that ComputeStuff() returns a widely used value
//and that
//1. It is immutable (it will always return the same result)
//2. its performance is critical, and it cannot be accepted to compute
//   the result at each call, because the computation is too slow
//I show here a way to solve the problem, based on a cached result.
//(this example works in a case of a method with no arguments.
// A hash would be required in order to store multiple precomputed results
//depending upon the arguments)
private string mComputeStuff_Cached = null;
public string ComputeStuff()
{
  if (mComputeStuff_Cached != null)
    return mComputeStuff_Cached ;

  string result;
  //
  // ...
  //Do lots of cpu intensive computation in order to compute "result"
  //or whatever you want to compute
  //(for example the hash of a long file)
  //...
  //

  mComputeStuff_Cached  = result;
  return mComputeStuff_Cached ;
}

Notes:
- I added the tag C++ as a solution in C++ would also interest me
- The concept of "immutable functions" is common for database developers, since a function can be defined as "immutable", or "immutable within a transaction" (this is a good way to improve the performance of the queries).
Thanks in advance
Answer: "Memoization" may be a useful term, here.  There are a few memoization libraries out there (I could swear there was one in boost, but I can't find it at the moment).  Doing a web search for "memoize" or "memoization" and your language of choice will reveal a few hits.
Here's a neat article in Wikibooks: Optimizing C++/General optimization techniques/Memoization
Answer: you could try something like this:
#include <functional>
#include <type_traits>
#include <map>
#include <tuple>

//requires c++14
auto add_function_cache = [](auto fun) {
    using fun_type = decltype(fun);
    return ([=](auto... run_args){
        using fun_return_type = std::result_of_t<fun_type(decltype(run_args)...)>;
        static std::map<
            std::tuple<decltype(run_args)...>,
            fun_return_type
        > result_cache;
        std::tuple<decltype(run_args)...> tuple(run_args...);
        if (result_cache.find(tuple) == result_cache.end()) {
            fun_return_type rv = fun(run_args...);
            result_cache[tuple] = rv;
            return rv;
        }
        else {
            return result_cache[tuple];
        }
    });
};

template <typename R, class... Args> auto
add_function_cache_old(std::function<R(Args...)> fun)
-> std::function<R(Args...)>
{
    std::map<std::tuple<Args...>, R> cache;
    return [=](Args... args) mutable  {
        std::tuple<Args...> t(args...);
        if (cache.find(t) == cache.end()) {
            R rv = fun(args...);
            cache[t] = rv;
            return rv;
        }
        else {
            return cache[t];
        }
    };
};

And then use it as follows:
//function_cache - usage
auto fib_cache = add_function_cache(&fib);

//function_cache_old - usage
function<decltype(fib)> fib_fn = &fib;
auto fib_cache_old = add_function_cache_old(fib_fn);

fib_cache(10);
fib_cache(10);

The idea is to create a function that takes a function (fun) as argument and returns another
function. The returned function wraps fun and provides a map form input parameters (run_args) to results. So it has the same signature as fun, tires to find the result for given parameters (run_args) in the map (cache). Then it returns the cached value or the result calculated by fun. Obviously fun's result has to be added to the cache in case of an unsuccessful look-up.
Regards
Jan
Comment: Maybe you can add a short summary to explain the idea behind your code?
Answer: Well, using a delegate such as Func<T> can make it more re-usable without requiring polymorphism / inheritance - but there is nothing more "inbuilt" in C#:
using System;
static class Program {
    static void Main() {
        var func = CachedFunc.Create(() => int.Parse(Console.ReadLine()));

        Console.WriteLine(func.Value);
        Console.WriteLine(func.Value);
    }
}
static class CachedFunc {
    public static CachedFunc<T> Create<T>(Func<T> func) {
        return new CachedFunc<T>(func);
    }
}
class CachedFunc<T> {
    T value;
    Func<T> func;
    public CachedFunc(Func<T> func){
        if (func == null) throw new ArgumentNullException("func");
        this.func = func;
    }
    public T Value {
        get {
            if (func != null) {
                value = func();
                func = null;
            }
            return value;
        }
    }
    public static explicit operator T(CachedFunc<T> func) {
        return func.Value; }
}

Answer: A C++ solution would be very similar to what you have outlined, differing only in the  heady mix of const qualified public interface(s) and (some) mutable members:
class Computer {
    mutable string cache;
  public:
    // I wouldn't call it ComputeXXX
    // since I want to hide the implementation
    // details from my client: for the client
    // there is no change in state due to a call
    // to this function
    const string& StringVal() const {
         if (cache.empty()) {
                // compute cache
         }
         return cache;
    }
    // ...
};

Comment: I'm not sure if a check to see if mComputeStuff_Cached is empty() is sufficient. It could be that empty() is a legitimately cached result. Depends on the application I guess.
Comment: Yes. But that's the closest we can in C++ to C#'s null, I guess.
Comment: Or for a higher difficulty tariff, use pthread_once (or boost::call_once) to thread-safely populate the cache. Which also solves the "empty value" problem.
Comment: Why are you returning a copy of the string rather than a const reference? Once computed it will not be changing.
Comment: @Martin York: Updated. Silly slip.
Comment: @onebyone.livejournal.com: The OP said this was a trivial program. I specifically wanted to avoid any references to multi-threading and issues thereof.
Answer: You can make it slightly less verbose:
private string mComputeStuff_Cached = null;
public string ComputeStuff()
{
  if (mComputeStuff_Cached == null) {
    string result;
    //
    // ...
    //Do lots of cpu intensive computation in order to compute "result"
    //or whatever you want to compute
    //(for example the hash of a long file)
    //...
    //

    mComputeStuff_Cached  = result;
  }

  return mComputeStuff_Cached ;
}

Other notes on this type of pattern:

If you use C++, and such a method const, then modifying members will not be possible because they are also treated as const within the context of that method. However, you can override this by marking the member(s) you need to modify as mutable.
There is a difference between "semantic const" and "bitwise const". When an author marks something as const, they usually mean "semantic const" (which is what you mean in this case), but the compiler can only enforce "bitwise const".
const methods usually give the caller the impression that they can be called from multiple threads simultaneously, because they have no side effects. In this type of pattern you have a "bitwise" side effect, but no "semantic" side effect. Therefore if it is possible that multiple threads could call such a method you must internally protect this initialization.
Answer: You can make your member variable mutable (keyword).
This will allow a const member function modify this value.  I use it all the time to cache intermediate results.
Answer: You can rewrite this code almost verbatim in C++
class CClass
{

  private:
     std::string* mComputeStuff_Cached;

  public:
     CClass()
       mComputeStuff_Cached(NULL)
     {

     }

     ~CClass()
     {
           delete mComputeStuff_Cached;
     }

     std::string ComputeStuff()
     {
         if (mComputeStuff_Cached != NULL)
         {
             return mComputeStuff_Cached
         }
         else
         {
             std::string calcedAnswer;
             ...
             // store away answer
             mComputeStuff_Cached = new std::string(calcedAnswer);
         }
     }
};

I'm not sure if a check to see if mComputeStuff_Cached is empty() is sufficient. It could be that empty() is a legitimately cached result.
Answer: You could use the static keyword inside the function. It will be computed only once:
std::string GetWidelyUsedValue()
{
   static std::string value = ComputeStuff() ;
   return value ;
}

std::string ComputeStuff()
{
   // Compute the string here.
}

Comment: Thanks for the answer. However, note that this works only if you do not require your code to be thread-safe : cf http://blogs.msdn.com/oldnewthing/archive/2004/03/08/85901.aspx
Comment: Yes, that's definitely true. I should have put a disclaimer.
Comment: So you just and add a simple mutex and this would work, in any case this **is** the way such things are done in C++ in 99% of cases.