Could a regularly erupting volcano create fertile soil for a fantasy empire to thrive?

Question: I have recently learnt about the flooding of the Nile and the irrigation around it, enabling plentiful crops by depositing nutrient rich silt during bronze age Egypt. I have also learnt about volcanic ash improving soil fertility as well. Is it conceivable that a fantasy empire could be built around this fertile soil? How would they survive the frequent eruptions that regenerate the fertility?
Comment: Do you want one volcano to provide for an entire empire?
Comment: that happen in real life so i dont see why not ? theres even empires or kingdoms build near volcano or ring of fire. even near or neighboured with krakatoa.
Answer: Yes but not really.
Volcanic soils can indeed be highly fertile. And floods of the Nile did indeed help keep the soils of the Nile Valley fertile. But that does not mean you want regular volcanic eruptions. Fertile volcanic soils and fertile river valleys are two different things.
What did the floods do?
They replenished the soils depleted of nutrients by agriculture and limited salinity caused by irrigation.
In the Nile valley this is very useful because the soils are brought by previous floods and have a structure that is not particularly suited to retaining its fertility. You can think of the soil as fine sand or clay or mud.
This is obviously a simplification, especially in ancient times when extensive wet lands had accumulated highly fertile soils, but you can fairly say that the particular soils that had been farmed for centuries and were subject to floods had this issue.
Similarly hot and dry climate and easy access to the Nile meant that extensive irrigation was used. And because of that same climate lots of water evaporated on the fields and left behind lots of salt in the soil. Salt in the soil reduces the ability of plants to draw water and nutrients and thus reduces fertility. The water from floods makes the excess salt dissolve and essentially resets the salinity back to a base "after flood" level.
So floods in the Nile valley and Mesopotamia could be potentially very useful in replenishing fertility reduced by agriculture.
Why are volcanic soils different?
The volcanic soil has different composition and structure and only coincidentally happen in river valleys so their agriculture tends to rely on rain water.
The structure of the soil is a big differentiator. The bubbling of gasses during the eruptions produces grains with large surface areas. This makes them suited for making concrete. It also makes them excellent places for nitrogen fixing soil bacteria to live in. And boosts their ability to retain nutrients or water.
Not all volcanic soils are like this but these are the fertile volcanic soils we are talking about.
This means that volcanic soils not only retain more nutrients, they can naturally recover the crucial nitrogen. In addition volcanic soils can be very thick and extensive. If the soil gets depleted, you can dig or mine more, you do not need to rely on new eruptions.
You can boost this by spreading agricultural waste and ash from fires back to the fields which even "primitive" civilizations can do. This is effective in replenishing nutrients other than nitrogen.
Fertile volcanic soils also often happen on sloped or elevated areas. This is simply because the process that creates them is additive and associated with a process that often creates mountains.
This means that agriculture in volcanic soils often relies on either directly on rain water or at least on water that comes from rains relatively close by. Either case it will carry less dissolved salt than the Nile in Egypt. The climate is also generally not as hot and arid as in Egypt, which has after all essentially a desert climate. And the slopes and the composition of the soil mean the water does not pool and evaporate on the surface.
These factors mean that accumulation of salt is much less of a problem than it was in the Nile valley or Mesopotamia. At least until pumps allow extensive use of ground water or water piped from more distant sources. There simply is neither the same rate of evaporation nor the same volume of salt carrying water to use. Abundant water would have to come from rain which does not cause a salinity issue.
So there is no need to replenish the soil with new eruptions to control salinity.
Answer:
Is it conceivable that a fantasy empire could be built around this fertile soil? How would they survive the frequent eruptions that regenerate the fertility?

It depends on the frequency of the eruptions.
Look at Etna and Vesuvius, for example. They were known since ancient times for the fertility of their soils, boosted by the volcanic material deposited there.
Latin authors prided the green sides of Vesuvius, covered in grapes producing a delicious wine.
If the eruptions happen quite spaced in time, say once every hundreds or thousands years, they cause temporary havoc and then allow for settlements.
If they instead happen more frequently, like with some Hawaiian volcanoes, there is no time for proper settlement as long as the volcano stays active.
Comment: And we know what happens when those "cultivated up to its peak" stratovolcanos decide to erupt, don't we?  Whereas the Hawai'ian shield volcanos may have areas of fresh lava, but you generally know where they are, and can usually get out of the way of fresh flows.  (See e.g. reports of Kileaua's recent flows.)  They're also relatively mild flows of liquid lava, as opposed to the infrequent but sometimes very explosive eruptions of stratovolcanos.
Comment: Yet Hawai'ian volcanos are active, and Hawai'i is extensively settled.  What I think you missed is the difference between the explosively-erupting stratovolcanos like Vesuvius &c, and the continuously erupting shield volcanos of Hawai'i.
Comment: @jamesqf, but Vesuvius was cultivated up to its peak, while Hawaiian volcanoes are a black barren land all around their eruption spots.
Answer: Stone mulch.
In 1740 a series of huge volcanic eruptions devastated the island of Lazarote in the Canary Islands.  When the volcano settled down, the little rocks that had spewed out and landed on the ground hugely improved the fertility of the fields.

http://www.harialanzarote.com/stone-mulching.html

FATHER Andres Curbelo, a priest in the small village of Yaiza in the
  centre of Lanzarote, provided the only surviving chronicle of the
  massive eruptions of the 1730s in a report to his bishop in Spain. He
  described how "on the first day of September 1730, between nine and
  ten at night, the earth suddenly opened; an enormous mountain emerged
  from the ground with flames coming from its summit. It continued
  burning for 19 days…Then a new abyss developed and an avalanche of
  lava rushed down, running as fast as water, [before] a great rock
  burst upwards with a thunderous sound and the pressure of the
  explosion forced the lava to change direction, instantly destroying
  two villages." …The geological mayhem continued…
The few thousand
  residents, a mixture of indigenous Berbers and Spanish colonists, were
  in grave peril from the explosions and the lava flows and, so it
  seemed, from famine. Their dry fields, which had once nurtured grasses
  and meagre crops of grains, were now covered with a layer of black
  volcanic stones. … As they returned to their wrecked fields across the
  lowlands of central and southern Lanzarote, looking for anywhere with
  soil that they could plant their crops in, they discovered something
  odd. Parts of the island had indeed been obliterated, mostly by lava
  flows. But in the areas that had become blackened fields of stone, the
  crops had not died, and in many places they were bursting forth
  between the stones with renewed vigour.
It didn't take the farmers
  long to discover why. The black stones shade the soil from the glare
  of the sun, reducing evaporation. Recent hydrological studies have
  shown that they cut water loss by around 75 per cent compared with
  uncovered soils. The pumice-like stones are porous and trap moisture,
  but they also provide a sterile barrier or "mulch" that stops weeds
  growing and makes ploughing unnecessary… … (F)ar from destroying the
  island's agriculture, the stones – which the local people called picon
  – were instead nurturing the crops…  (T)he farmers began to dig small
  holes through the picon to the soil beneath and to plant crops. They
  diversified from their usual grains and grasses to fruit and
  vegetables, having discovered that they too would now grow on the
  island, provided there was a layer of picon at the surface.
The stones
  revolutionised agriculture on Lanzarote… By 1776, an anonymous
  chronicler was recording a "prodigious mutation" of farming on the
  island. "Marvels abound, with the land being more fertile, becoming
  fruitful and bearing fruit two or three times a year. Like sponges,
  the picon soaks up the water, and the crops receive a delicate, gentle
  watering," he wrote. "Before the eruptions in 1730, the most the
  island produced was bread and beef; now on the strength of the picon,
  it produces grapevines, vegetables, maize, potatoes, pumpkins and
  other produce."

Original article from New Scientist; "The Miracle of the stones", Fred Pearce, Volume 191, Issue 2568, 9 September 2006, Pages 50-51.  Full text free at above link.
So too your land.  The volcano spews out stones (bring the kids inside during the stone rain!) that shower the fields.  The farmers rake them into organized plots.  With the stones and naturally occurring dew, they do not need to irrigate.
Comment: Good find. But two things that should be emphasized. First, Canary Islands are just west of Sahara so they have natural issues with getting enough rain and irrigation that were holding fertility down. Two, they are islands, surrounded by the sea, so the amount of irrigation from dew they can get is fairly high. Most other places would either have better baseline irrigation or less dew, so would benefit less. So you are entirely right but should explicitly mention these qualifiers to where this will work and how big the benefit will be for this to be more useful. IMHO, obviously.
Comment: @LiJun No? The opposite actually, my comment was about the Canary Islands having such dry climate due to their location and how this should be mentioned *because it might not be true for the Empire* and this affects the value of the extra water from dew.
Comment: @VilleNiemi doesnt seems like OP say his empire terrain is like egypt, OP dont even say what type of terrain or biome the empire is, OP just mention that nile flooding make egypt soil rich.
Comment: @LiJun True, why are you telling this to me?
Comment: @VilleNiemi because to me it look like you assume the magical empire terrain is like egypt or dry desert.
Comment: @VilleNiemi ohh....alright then. i assume so because of your answer too, it look like that to me, since as far as i know empire build near both volcano and river that prone to flood and erupt exist and even build as capital, though it was a tropical rainforest island.
Answer: People are burning down the Amazon forests to create fertile farm land to grow crops to feed cows to make burgers.
So yeah a never ending fire can have its uses in a modern society as demonstrated by the Amazon fires continuing over the course of 20 years of man made deforestation.
McDonald's and  Burger King would benefit a lot from such volcanic activities.
The same is happening in Australia but for similar yet different reason, they don't care about burgers they just want to boost the economy with agriculture... Most of Australia land is infertile.
Humans have practiced arson for agricultural reasons for millenia.
Also, if you think no human being would be stupid enough to settle and make farms near a volcano, then obviously you've never visited Italy. In Naples people literally live inside a volcano.


Geometric Transformations on the CPU vs GPU

Question: I've noticed that many 3d programs normally do vector/matrix calculations as well as geometric transformations on the CPU. Has anyone found an advantage in moving these calculations into vertex shaders on the GPU?
Answer: Generally speaking:
Mesh transformations are done on the GPU. You send in the transformation matrix to the GPU and the shader applies it to all verticies of the mesh.
Using the GPU to calculate the Matrix itself is a different matter & is actually slower on the GPU because there are so many stored values that change from frame to frame that are necessary to help determine the final transformation matrix. Sending this data to & from CPU - GPU is slow. Also, on the CPU, the calculations are done once, whereas on the GPU, they would be done for each vertex.
Comment: W.r.t. the "actually slower on GPU" part; this is a very broad statement. If you're talking about constructing the matrix for each vertex on GPU then your performance will depend on your bottlenecks. You'll only get slower performance if you are ALU/ register bound on the GPU, which is not necessarily the case. Doing exactly the same thing on a CPU would also be slower under these bottleneck scenarios. An example where this *is* commonly done on GPU: vertex shaders construct vertex tangent space matrices on the fly to save vertex fetch bandwidth. Again, dependent on your bottlenecks, so YMMV.
Comment: I can't downvote, but this answer should be downvoted. It's very wrong to say "actually slower on the GPU".
Answer: Many geometric transformations can be done on non-GPU processors, however one must consider the  target platform.  Your mileage will vary based on what platform you're targeting, and the bottlenecks of that platform.
One consideration is bus bandwidth between the device that is generating the geometry, and the device that is rendering the geometry.
In a typical modern PC system, the CPU is on one side of the PCIe bus (http://en.wikipedia.org/wiki/PCI_Express), and the GPU is on the other. The only way you can transfer per-frame generated data from CPU to GPU (and vice-versa) is via this bus. This means, you can be limited by the transfer speed of this bus. If your target platform has PCIe 2.x with 16 lanes, you have 8GB/s bandwidth. In practice, transfers across the PCIe are not 100% efficient, as some of the bandwidth is consumed for the protocol during your transfers. Depending on the size of your transfers, you could lose 5-10% of your bandwidth just on the per-packet overhead.
eg. Given a PC platform that is running PCIe 2.x with 16 lanes, how much data can you generate per frame for feeding to the GPU? Assuming you want the run at 60fps, this translates to 8GB/60 = 136MB per frame for PCIe 2.x. Multiplying by some (guestimated) 90% factor to account for driver communication overhead and PCIe transfer protocol overhead, you can generate around 120Mb data per frame without being limited by PCIe 2.x bandwidth.
Another question you have to answer: will the generation of this 120Mb of data be easily achievable in 1/60th of a second on your target CPU? Remembering that you have to perform a number of other game tasks on your CPU, you can run into a lack of time to generate the transformed data. In terms of just pure ALU throughput, this can limit you on CPU. In terms of CPU to sysmem buses, you can also be limited by the bandwidth (which varies, but is around ~8.5GB/s on recent CPUs).
Alright, so what factors makes it more viable to do on a GPU then? One factor is GPU memory bandwidth, which is the bandwidth between the GPU and it's local video memory. On contemporary mid-range GPUs this video memory bandwidth can be as high as 200GB/s (yes, that's 25x the PCIe 2.x bandwidth). Another factor is that the GPU is massively parallel, has hundreds of ALUs and is able to hide memory access latency by running thousands of threads at a time.
All of these factors can contribute to the obvious win of pushing more work onto the GPU, but again YMMV depending on your target platform.
Answer: What do you mean by "mesh transformations"? Transforming geometry by some set of matrices? Most games these days will let the GPU handle simple transformations, skinning, etc. And most of them will be using vertex shaders to do it. On some platforms you either don't have shaders, or there are other advantages to doing these things on the CPU. For example, on the PS3 you can take some load off the RSX by letting the SPUs handle skinning and transformation. If you're doing multi-pass lighting then skinning on the CPU can be advantageous, since you only have to do it once and submit the results to be drawn for each rendering pass. So there are exceptions, but in general most games are doing these things on the GPU and in shaders.
Or did you mean something fancier, like using the GPU for general vector math? These days we have general purpose GPUs that can run fairly generic C code via systems such as CUDA. It is possible to take advantage of this for heavy vector math, and I know there are programs out there that do this. I don't have any experience with it personally though.
Comment: changed "mesh transformation" to "geometric transformation" to help clarify the question. i'm also waiting for opencl es, which could be available early as next year.
Answer: There are situations where having everything on rendered on the GPU might make sense, but you can't set constants inside a shader and there is really no where else to set them up except on the CPU side before a draw call.
Even if you could compute your constants, like the bone transformation matrices, on the GPU with a custom initialization program, you probably wouldn't want to. the GPU is really good at parallel execution, but has a much slower clock speed.
Transforming a hierarchy is not trivially parallelizable, because the child nodes depend on the parents, but transforming all the vertices in a mesh is, because the vertices are computational independent from each other.
The general rule is:

Serial processing : CPU
Parallel processing : GPU


What are the best practices for growing cherry tomatoes from a sprout?

Question: I did a small quarantine experiment with some overripe grape tomatoes that I need some tips on. I managed to harvest the seeds and plant them and voila! Over 50 tomato sprouts. Now the question is...what is the next step with these spouts? Texas summer is coming and I hope they can survive. I am not sure if I should be repotting them so they aren't clustered together or start planting them directly into the soil. Tips appreciated!
Answer: You will need to prick them out into individual small pots and grow them on into small plants before planting outdoors in the ground. Select the strongest looking seedlings to transplant if you have too many, and some potting soil to grow them on, preferably a seed and cutting potting soil initially. As they grow, move into larger pots with ordinary potting soil, then plant outside when they are a good size,around 8 inches tall with sideshoots.
If you're growing them on indoors, you will need to harden the plants off before planting outside so they have a chance to acclimatize to the new, outdoor conditions.
Answer: There are a lot of ways to do this. There's no single best practice, in my opinion. Bamboo's answer is pretty good, except you should know that splitting them up at the roots is going to set them back, slow growth, and probably impact long-term production--this may not be as big of a deal for tiny tomatoes, or if you fertilize well, however. I've experimented with splitting them up versus just thinning to one plant, and there's a noticeable difference, IME. Undisturbed roots have better results. I still split some up sometimes, but I try to avoid it, and I try to be careful.
What I like to do is overseed (in containers in full sun outdoors, which I bring in at night when it's supposed to get below 42° F.), let a bunch of tomatoes sprout, grow them until they're 4+" tall, transplant them like that (after the primary risk of frost is over), and thin each to one plant (with scissors) maybe 8 to 10 days after the transplant.
Most people don't do this process, but there are a lot of advantages to holding off on the thinning until then (it's insurance against cutworms, pill bugs, the occasional dying plant, etc., and they don't fall over or get drowned as easily). Once thinned, they increase in size rapidly.
Because they stay outside most days (I keep them in on Sundays), they don't need to be hardened off.
If your area doesn't get much rain (rain leads to increased nitrates), you might try giving them foliar sprays of calcium nitrate weekly until they're strong (two or three weeks might be enough), starting three days after the transplant or so. Nitrates seem to help young plants mature better (including tomatoes), even when it's hot and dry. You might water them once every day or two, too, if they dry out—until they're stronger.
I think calcium nitrate can also help plants overcome being split up, too; it seemed to worked well with my peppers, this year (I split up a very few overseeded containers into about 42 plants at transplant time). Peppers are related to tomatoes, but they grow more conservatively, and have more sensitive roots.
FYI, don't give foliar sprays when the sun is shining much.


Is there a tool that can refactor this C code correctly?

Question: Lets say I have the following code (the array* function are what we use for resizable arrays and they operate on pointers-to-arrays that are null initialized):
typedef struct MyStruct
{
    int i;
} MyStruct;

MyStruct* GetNewMyStruct(int i)
{
    MyStruct* s = malloc(sizeof(MyStruct));
    s->i = i;
    return s;
}

int SomeFunction(int number, MyStruct *elem)
{
    MyStruct **structs = NULL;
    int i;
    for (i = 0; i < number; i++)
        arrayPush(&structs, GetNewMyStruct(i));
    arrayPush(&structs, elem);
    return arraySize(&structs);
}

I decide that SomeFunction is too large and I want refactor it. Currently where I work we use VisualAssist X, which has some refactoring capabilities, but when I use it on this it does not work correctly. If I attempt to use it to refactor out the loop, this is what I get:
void MyMethod( int number, MyStruct ** structs )
{
    int i;
    for (i = 0; i < number; i++)
        arrayPush(&structs, GetNewMyStruct(i));
}

int SomeFunction(int number, MyStruct *elem)
{
    MyStruct **structs = NULL;
    MyMethod(number, structs);
    arrrayPush(&structs, elem);
    return arraySize(&structs);
}

This is not correct. MyMethod should take a MyStruct ***, not a MyStruct **. This is because the code I'm refactoring takes the address of structs. The result is that the refactored version will always return 1 (since only one object has been pushed into my array) rather than number+1. Are there other tools out there that do this type of refactoring correctly?
Answer: Eclipse CDT does this correctly (at least the current version Juno). Selecting the declaration of i and the loop and doing Refactor > Extract Function, and setting structs to be an output parameter, produces:
void MyMethod(int number, MyStruct*** structs) {
    int i;
    for (i = 0; i < number; i++)
        arrayPush(&*structs, GetNewMyStruct(i));
}

int SomeFunction(int number, MyStruct *elem)
{
    MyStruct **structs = NULL;
    MyMethod(number, &structs);
    arrayPush(&structs, elem);
    return arraySize(&structs);
}


How to expand beyond a single series?

Question: I am currently writing a science fiction/fantasy quadrology and would like to eventually expand on it. I have an entire world built around it and I would like to know the best way to introduce it. Prequels? Separate series? Guides? Through experience, which one best enthralls readers and/or best conveys the expanded world?
Answer: Tell more stories.
If you've built a world, put sentient beings in it and put conflicts in front of them. Let the world unfold in front of your characters, and let the characters talk about the other parts of the world, and the history of it, which haven't been discussed before. Write stories set long before or shortly after your existing series. Link it to your existing series via character, plot, place, or time (so that there's some reason for your readers' interest to carry over).
Mercedes Lackey has the planet Velgarth on which her Heralds of Valdemar stories take place; she has jumped around something like a thousand-year timeline telling various stories with various characters who may or may not interact (depending on how far apart they are). Many of her books are set within a period of three generations, but there are also quite a few set hundreds of years earlier.
Anne McCaffrey created the planet Pern. Most of her stories are set in a twenty-five year period long after Earth humans colonized the planet, but there's also one story about the colonization and few set before that group. The main links are locations and species (the dragons and their growing intelligence).
If your series get popular enough, you might be able to publish your Silmarillion or Codex, but to get popular, write more books in your universe.
Comment: Another example is the red wall chronicles by Brian Jacques. He uses a bunch of different characters throughout his books. Each had its own plot, but other characters make cameos, or are referenced.
Comment: The *1632* franchise has taken this idea and really run with it, too -- not only do they have several anthologies of short stories and novellas written by the authors of the multi-book series, but they *also* publish collections of fan fiction set in that world.
Comment: @MonicaCellio That's brilliant! Lackey has edited like a half-dozen anthologies of short stories set in her universe, but official fanfic is awesome!
Answer: Before trying to expend it into more than a quadrilogy, publish the first one.
Make sure the book is a success and the world appreciated before spending more time on it.
Even great authors sometimes create universes that do not resonate with the reader.  Sometimes it is a game of try-and-miss.
Better fail with one book and spend time developing another universe or series, than spending more time than necessary in a bag end.
(Bag end, did you note the bad pun :) )

How to expand beyond a single series?


Map plugin with proximity search compatible with Buddypress

Question: I need to be able to display Buddypress users on a map while allowing proximity/distance searches but my research yielded in plugins with subpar docs and absence of an online demo to help reassure me before I buy. Any suggestions on anything that might satisfy those criteria would be highly appreciated.
Answer: In general for complicated map features I either use the gmaps API and pass the wordpress data to the initiation script via localization and json_encode() or the MapPress plugin for simpler things.  it's highly unlikely that you're going to find something that does what you want out of the box though.


What paperwork do I need to sell a car for $30k cash in New Jersey and deposit the proceeds into my bank account?

Question: I am selling my car to an individual who wishes to purchase the car from me for 30k in cash. I asked for a check instead but they stated they only have cash. What sort of paperwork would I need to submit to deposit this cash into my checking account. I am selling the car at a loss so there are no capital gains on this sale.
Comment: Slightly off-topic tip: If you are accepting a large amount of cash like 30k, do the transaction in a public place. Perfect solution is to meet at your bank, and to have the cash deposited directly into your account with the buyer present. This will really reduce your risk.
Answer: You don't need any paperwork other than a deposit slip to deposit the cash into the account. The BANK will need to fill out a form to help the Government detect money laundering, counterfeiting and other crimes. If you aren't doing any of these things you have nothing to worry about.
This is not going to trigger any tax liability unless you report it on your tax returns as a capital gain or other type of income.
The one thing you DON'T want to do is split it into several smaller deposits that are just below the reporting limit. That is called "structuring" and will trigger some alarm bells you don't want rung.
Comment: I'm from the UK, so I don't know how zealous the US is in investigating potential money laundering, but might it be prudent to keep copies of related documents in case OP is questioned? Not sure of the correct terms, but things like car registration document (pink slip?), any transfer of ownership document that might be sent to the DMV, and possibly some kind of "bill of sale" signed by the purchaser?
Comment: I'd consider contacting the bank ahead of time and see if they have any kind of service that would scan the bills for counterfeit and have the potential buyer meet you right there at the bank. Less likely you'll get robbed on the way out, etc. too...
Comment: The teller will fill out the CTR (Currency Transaction Report, FinCEN form 112 or equivalent) but they will want to see your ID to do it. (If you have been _driving_ the car legally, you necessarily have such ID.)
Comment: This answer could stand to have a stronger warning about structuring in the USA. It won't merely cause unwanted scrutiny that might turn out fine. Structuring (to avoid reporting) is a **federal crime** even if the money involved was obtained completely legally. https://www.law.cornell.edu/uscode/text/31/5324 https://www.irs.gov/irm/part4/irm_04-026-013
Answer: Your main risk is being tricked by the buyer. There are not many (legal) reasons why someone has 30k in cash but cannot use bank account to pay you, so chances are the money is illegal. That is not really your problem, unless the police thinks you should have reasonably known that, or the money is fake.
If the government comes after you (chances are they have bigger fish to fry), you should be able to prove how you came into posession of it - which should be easy, the car ownership was in your name, and is now transferred. Having a copy of the sale contract might be helpful.
It is legal to sell your car for cash; just be careful that you don't get tricked or robbed.


How balances are calculated?

Question: Is it the case that the blockchain has information on the balance associated with each public key-address, such that the client on my PC, say, will look at every public/private keys pair in wallet.dat, find all public keys in the blockchain for each of my private keys, sum up the balances for each, and show me the overall balance?
Comment: Essentially, yes.
Answer: The Bitcoin-Qt/bitcoind client computes the balance as you describe, by summing up all the transactions for all the Bitcoin addresses in the wallet.dat.
The blockchain contains all transactions since the genesis block (block 0).  So the balances are simply all the unspent transaction outputs (UTXOs).
There are third party services which will monitor the blockchain to provide balance info for a specified address or addresses.  BTCBalance.net is one.
Comment: I see, so there are no balances as such, only transactions. If I use the same address to receive / send the money 3 times, what will be recorded for that public key is, +20, -4, +7. These will be summed up along with everything else in the blockchain that corresponds to my wallet.dat when calculating the total balance.
Comment: And of course, the system rejects any transaction which would cause the balance for the public key used to become negative.
Comment: How do you go from a public address to a block?

How balances are calculated?


Sound glitches using fft segmented convolution

Question: I'm trying to build a binaural audio player, I'm using MIT Kemar c library to get the hrtf and a fft segmented convolution. It works on real time but the problem is each time I change the hrtf I hear noises like small cracks or something like vinyl noise. But I'm not sure why. Please help.
If you are interested in the project here is my github repo:
https://github.com/Bk8/Binaural
Answer: One possible way to reduce cracking noises between convolutional block filtering parameter changes is to use an overlapping of the blocks and do a cross fading (linear or raised-cosine) of the overlapping segments.
Comment: OP might already be doing Overlap-Add for his/her "fft segmented convolution".
Comment: In that case, the OP might need to complete and end one overlap-add sequence, start another overlap-add sequence using the some previously filtered blocks over again, and cross fade the two overlapped overlap-add sequences at some point a full impulse response length into the new sequence.
Comment: well, unlike Overlap-Save, in which if you suddenly change to another FIR coefficient set you *will* get a jump discontinuity, with OLS changing to a completely different coefficient set will result in some form of crossfading from the old to the new during the overlap-add portion.
Answer: Mixing just the overlaps didn't worked at all, I used the method described here:
https://codeandsound.wordpress.com/2015/04/08/implementing-binaural-hrtf-panner-node-with-web-audio-api/
First you filter low frequencies then you render the next segment and mix between the new segment and the old, and finally add the low frecuencies back.


How to disable fcurve sync?

Question: I created material with some parameters animated. I applied different copies (with unique names) of this material to different objects, but for some reason animation parameters are still in synchronization, like I edit exact the same fcurve in different materials.
How can I disable this and made fcurves unique for each of the materials?
Answer: There is a simple solution I use in 2.76b. Just use nodes for those materials, and animate values in the nodes. It will block each material instance. But if you animate the same options in the properties editor - it will animate them all. It's a bug.
Note: To see your keyframes on the timeline you have to select the node.
And yes, check beforehand, whether or not you use the different materials indeed. I mean, material can be linked to the objects, and to their respective object data as well. So, this check may show, if you have multiple objects, sharing the same object data, hence the materials.
I did reproduce that situation, and I think, I found a solution to avoid the channels to be linked but not copied on material duplicated.
So the solution is pretty simple - DO NOT PRESS PLUS BUTTON to copy the material, instead use the numbered button which shows the number of shares. This works for me in Blender v2.76b on Windows XP 32 bit.
See the explanations below.
The problem:

The solution:

And please, don't tell Captain Disillusion about those buttons! ;-)
Comment: It was already done by the node system.  Materials and objects are actually different, but animated nodes stay the same or share the same curve channel, idk, when being copied
Comment: each node has its own animation channel. Try this: in the node editor right click on the animated value, and clear the keyframes. It must change the color to gray. Then animate it again. Once again, do not use properties editor - change values, and add keys in the *node editor* window.
Comment: that's a way I do it at this moment, but I just tired of copypasting keyframes
Comment: they are Cycles materials or Blender internal? And can you create a blank blend file, append a couple of your materials to it, and assign them to a couple of cubes, and share the blend?
Answer: It happens as make single user retains animation action in shader node tree. The easiest way is to use this procedure:
TL;DR: Copy paste Material and Fcurve Data in a new blank material node.

Make sure your animation has a null keyframe at 0.
Now select another object you want to animate with material
press new material
select all in the material node and delete
go to the animated material node and select all node and copy ctrl+c
go to that second object blank material node and paste ctrl+v
Now copy the fcurve of your animation started from 0 by going to  graph editor>slect the animated node>select all fcurve>ctrl+c
now go to timeline "0" and select the non animated material. Set key to the parameter you want to animate
now paste Fcurve

A demo tutorial: https://youtu.be/gQVddQ9AgGs
Comment: I already wrote  that I tired of copypasting and that I am searching for another method, bro
But I am very amazed that people here are ready to wrote such informative step by step solutions, I wish you guys +1000 to karma

How to disable fcurve sync?


How do I avoid the maintenance screen on database errors?

Question: As I'm working on a D7 site, I'll occasionally hit a database-related bug in my code. When this happens, I get thrown to a version of my site's maintenance page; the error information doesn't show up on the page, but just in Watchdog. This makes sense for a production site, but it's a pain during development. Is there any way to turn this behavior off, so that the error messages show up on the page I'm working on? Thanks!
Answer: If you have a serious / fatal database error, you're probably not seeing the 'maintenance page' but the db_offline page which usually displays errors direct to screen. What kinds of database errors are you experiencing?
Assuming your site is not in maintenance mode, few things you can check and set:

Check the settings under admin/config/development/logging and make sure you have it set to display 'all messages'
Make sure you have php set to display errors -- you can add the following in your settings.php file to increase your error_reporting level:

error_reporting(-1);
$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

Answer: We utilise static error pages, to which the reverse proxy in front of drupal (varnish) serves on behalf of drupal whenever a

error 403
error 404
error 5xx

error occurs. This seems to solve the problem very elegantly
Comment: Thanks; I think the first response is more on point re the db_offline matter.
Answer: Install Xdebug to get a full stack traces if you hit a serios (PHP) problem.
Check http://drupal.org/node/158043 if you get an entierly blank page.
Comment: Thanks, but it's not that deep -- see above.
Answer: My issue was that everytime I logged in, it would hit me to the maintenace page, but never showed an error.
In my case, I had pending database updates I didn't do with file_entity. I had to see the errors initially by adding this to settings.php at the bottom:
error_reporting(-1);
$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

I then saw the errors that pointed out that it couldn't find the file_entity table. If its not there, that means it was never created and that means an update db didnt happen. I went and did a 'drush updb' and resolved this issue.


Average induced emf in a rotating coil after rotating by 180 degrees

Question: When a coil rotates in a magnetic field an emf is induced, and when the coil starts its motion from the position at which its plane is parallel to the field lines, and then it rotates by 180 degrees, the average induced emf in it is zero. I don't understand that point, and I would appreciate if someone explains it for me.
Comment: Please verify the answer if you find it satisfactory. Thanks in advance.
Comment: And for more intuition you can think that the rate of change of flux has equal values in both directions in a 180 degree turn hence EMF turns 0 on average.
Answer: For this question we must understand that the EMF produced is directly proportional to the rate of change of Magnetic flux linkage.
As the field is parallel to the plane at first we can write that the magnetic flux density, B=k ( assuming be a constant).
Then the function of the flux through the coil will be Flux,F = BAsin(theta)=kAsin(theta)
Note: We take sin as the function because we know t when field is parallel to coil, flux is zero so thus taking sin function which is zero when theta is zero.
Now EMF= -N(dF/dt)= -N(dF/dtheta )x(dtheta/dt)
Now as you will rotate the coil at a constant angular velocity so dtheta/dt will be constant, assume it to be c( it is essentially angular velocity which remains constant as you are rotating at a constant speed here).
So now EMF=-Nc(d/dtheta(kAsin(theta))=-NckAcos(theta)
So the derivative of sin is cos so in interval 0 to 180, cos changes sign and has equal parts positive and negative so as the EMF is now a function of cos(theta) it's average value over interval from 0 to 180 degrees is 0
Answer: The EMF in the loop can be calculated using Faraday's law of induction, which states that the $V_{ems}$ is related to the time derivative of the magnetic flux through the loop:
$$V_{ems} = -\frac{d}{dt}\iint_{loop}\vec{B}.d\vec{\sigma}$$
In the case of a plane with surface area $A$ and a uniform angular velocity $\omega=\frac{2\pi}{T}$ in a homogeneous magnetic field $B$, the $V_{ems}$ will be:
$$V_{ems} = -\frac{d}{dt}\left(BA\sin{\omega t}\right) = -BA\omega\cos{\omega t}$$
When we want the average of some time-dependent quantity we calculate the integral of that quantity over the given time interval and divide by that time interval:
$$-BA\int_{0}^{\frac{T}{2}}\omega\cos(\omega t) dt = -BA\sin(\omega t)\Big|_0^\frac{T}{2}=0$$
Extra: intuitively this means that the induced current will flow in a certain way and direction during the first 90°; between $90°$and $180°$  the current will flow in the opposite direction, symmetric to the first $90°$, therefore the currents (or voltages if you like) will cancel each other out during every cycle of $180°$
Comment: Excuse me ! I am poor at maths, could we discuss it from physics point of view?
Comment: I added something and tried to explain it intuitively, but if you really want to understand these kind of phenomena, you should really try to understand the math behind it.
Comment: @Asmaa Do you understand it better now?


What's the best way to quit a job in retail for another job?

Question: Yesterday was my first day working retail, and I absolutely hated it. Management is rude, the older employees are snobby, and the customers ignore you and are overall really hard to work with. I know that I could stick it out and it'll probably get better and easier with time, but why do that when I have other employers calling me for interviews? I might like those jobs better and I might get a higher rate of pay. What's the best way to resign from the retail job if I choose to? I read that you're supposed to leave a letter, but I'm not sure if something that formal is necessary for this type of job.
Comment: Seems like duplicate of: http://workplace.stackexchange.com/questions/47437/quitting-a-job-after-a-few-days/47514#47514
Comment: Voting to close, specific to your employer.  Ask your HR person on what they expect, it may be a letter, verbal, or a call/sms.
Answer: First day in a throw away non-career job, you are fine doing it over the phone.  "Hey manager, I don't think retail is for me.  Lets end this now and save you wasting money on training me."  Don't bother puting it on your resume or asking for references.


Is Microsoft breaking the same law again as they did with IE?

Question: It seems like Windows will soon be shipped with Microsoft's own AI assistant Windows Copilot. This seems awfully similar to the famous case they lost in EU because they used to ship Windows with Internet Explorer, thereby creating an unfair advantage against competing software.
Comment: In the US, it was never proven that Microsoft was breaking the law. A lower court initially found Microsoft's practices were illegal, portions were overturned on appeal, and further proceedings were in progress when the case was settled with a consent decree, which does not involve an admission of guilt.
Comment: @user71659 I still think the question is valid if they provide the feature in the EU as well. IIRC they lost quite a bunch of $$$ in that case.
Comment: By contrast, Microsoft has always shipped Notepad with Windows, and I don't think anyone ever seriously asserted that this created an unfair advantage against competing text editors.  So it can't be the bundling alone that creates the issue; it must be something about what the software is and its place in the market.  Thus it's not clear that there is a direct comparison between Internet Explorer and Windows Copilot.
Answer: No
australia
Tying and bundling are only unlawful if they abuse market power.
The Microsoft Explorer case may have been such an abuse (it was never litigated in Australia) because Explorer was free if you bought Windows, but there was a charge otherwise, and Microsoft was in a dominant market position. Neither appears to be true of Copilot.
First, it doesn't appear that there is a charge for Copilot. Second, Microsoft Windows is no longer the dominant OS for digital devices; Android is. Even if you limit the market to only desktop OS, its market share is only 69%; this is generally not considered a dominant position.
However, it doesn't appear that there is any tying or bundling going on here. Copilot does not appear to be a separate product independent of Windows - it just appears to be an optional product feature of Windows. Unless this is something that Microsoft is selling that can be used on other OS, the issue simply doesn't arise.


Iphone 6 plus will not default to SMS when other user iphone is not on wifi

Question: My iphone 6 plus will not revert to SMS when another iphone user is off wifi.
No problems before when I had an iphone 4s full plan and hubby had iphone 3gs go phone (no data) the imessage app worked great.
Now the iphone 4s is a go phone (no data plan)upgraded to ios 8.1.1. The iphone 6 plus is also 8.1.1. full plan.  The send as SMS is on on both phones.
Is the difference that imessages makes you sign in with an apple id which is an email address?  The phone number and email is checked on both phones for receive and send.  What a pain that my imessages never get to my hubby until he gets to wifi.  The 6+ does not sense or revert to SMS like the 4s always did.
Answer: If any capable device receives the iMessage, it's considered delivered.
Log out of iMessage all other devices/computers & then it should resend as SMS.


Space soap opera book where aliens kidnap people from Earth who must prove themselves worthy by killing the last captain

Question: Alien ships come to Earth in the middle of the night and kidnap people who must prove themselves worthy of being captain by killing the last captain. The hero is a teacher I believe.  The ship he becomes captain on actually took and killed his kids first.  It's lots of ships all over earth finding earthling captains so they can defend the earth against an alien fleet
Comment: This is extremely terse at the moment is there no other plot elements/details you can [edit] in? Do you also know when you read this? Was it new at the time you read it? Was it a novel, novella, short story, etc.?
Comment: It's been a couple years.  Received harsh reviews because the hero was a school teacher.  Ships took his kids, which were killed before he was taken.
Comment: You can [edit] that detail into the question.
Comment: Ships could reconfigure themselves for their pilots.
Answer: Swarm by B.V. Larson

Earth arms marines with alien technology and builds its first battle
  fleet!
Kyle Riggs is snatched by an alien spacecraft sometime after midnight.
  The ship is testing everyone it catches and murdering the weak. The
  good news is that Kyle keeps passing tests and staying alive. The bad
  news is the aliens who sent this ship are the nicest ones out
  there....
SWARM is the story of Earth's annexation by an alien empire. Long
  considered a primitive people on a backwater planet, humanity finds
  itself in the middle of a war, and faced with extinction.
Comment: Trent, if this is the right answer, you can accept it by clicking the checkmark on the left. Please do; it will show everyone the mystery was solved, and reward both you and Ayshe with some reputation :)
Comment: @Jenayah - It's always a good idea to wait at least 24 hours before choosing an answer. There's always the chance that a better answer will come along. Unless the poster is absolutely certain that the answer is correct.
Comment: @WhatRoughBeast on story-id most of the work is finding the right one; sure, someone else _could_ now post a new answer with quotes and the like, but as story-id tends to attract hit-and-run users, I think it's better to indicate the "acceptance" functionality exists in the first place. Totally agree outside of story-id, though. (That reply sounds familiar. Didn't we already have such a conversation? Or was that with someone else?)


Chain not meshing with new cassette

Question: My chain is a SRAM PC-971, worn less than .75", and my derailleur is 9-speed 105. I just installed a new Shimano HG-400 cassette, and it seems like the chain isn't 'meshing' correctly, causing a rhythmic crunching noise as it jumps from the jockey wheels to the cassette (video, worse when under load). This happens in all gears, big/small chainring, with the B-screw in all the way and with it removed completely. The bike shifts well and otherwise performs fine. Is this noise/misalignment anything to worry about? Will it go away over time?
Screencap from video of chain and cassette before a "jump":

And immediately after:
Comment: Typically, similar issues when replacing a cassette but not the chain are due to the chain being worn. The old cassette wore along with the chain, so changing only the cassette and not the chain maximizes the wear mismatch even if the chain seems to still have usable life left in it. I'd try a new chain and save the old one if you want for use when your cassette is more worn.
Comment: A previous similar question with some more ideas: https://bicycles.stackexchange.com/questions/65215/chain-cassette-noise
Comment: Another possibility is that when you rejoined the chain as part of reinstalling it, the link there is stiff or misaligned. Perhaps undo and redo the quick link, and make sure it is fully seated after closing it by e.g. applying rear brake to secure wheel and using foot to rotate crank forward with quick link chain section taut between cassette and cranks.
Comment: My chain wear indicator says the chain is worn less than 0.75", and it seems to 'jump' every couple of links (precluding the possibility of a single stiff link). I also never removed the chain, just removed the wheel and swapped cassettes.
Comment: That question seems pretty relevant -- it seems like other people have had issues with 9-speed sram chain + shimano cassette compatibility
Comment: Is the chain properly aligned with the cassette?
Comment: One needs to keep in mind that there is some variation in the width/thickness of chains.
Answer: The chain checker tools are only an indicator and in my experiences are relatively coarse.
Your results show that the chain is indeed skipping on a cog.   Possible causes:

Chain is worn or damaged.  Grab two adjacent links between forefingers and thumbs, and feel for play.   "Barely perceptible" is okay, much more indicates wear.
Chain is too long and has insufficient tooth engagement.  Ensure there's barely enough chain to be in big-big without binding.
Cassette is damaged or poorly made.  Might have burrs on it.
Indexing is a bit off and the chain is not sitting clearly on one cog.  Twiddle a barrel adjuster and see if this helps.
Chain is not consistent across its length - you many have a stiff link, or maybe a damaged master link.

I had the stiff link once, but only in one direction when going over the top jockey wheel.  It was not easily visible even when standing beside the bike.  Try and mark the chain with permanent marker and see if the skip happens at
or near the same link, or some other commonality.
Good luck !  These problems can be challenging to isolate, but a new chain may be the quickest and easiest solution.   If it doesn't fix the problem, then you have a spare chain for the future.
Comment: New chain mostly resolved it

Chain not meshing with new cassette


Tagging and adding attributes on OSM road layer in QGIS

Question: I have downloaded an OSM road layer and I want to add attributes and tag specific line segments. I have another layer of centroids from a polygon layer of cities which will be the basis for my nodes. How can I tag/ select specific line segments based on the nodes layer (route from point A to point B) and is it possible to do this in batch processing? I want to add attributes (i.e. funding agency) to these specific segments. Do you know a tool/ plug-in in QGIS or GRASS that can do this?
Answer: Unfortunatly, QGIS can not edit an .osm-file.
Therefore you can make use of JOSM: https://josm.openstreetmap.de/
If you save those .osm-layers as a different layertype (eg. shapefile, geopackage, ...) you can edit them and add the desired tags
Answer: Use the routing tool from the OSM Tools plugin to create the routes as a separate line layer.
Then use Spatial Query (in old versions of QGIS) or Select by location (in newer versions) to select roads that intersect the routes.
Once selected, you can save these roads as their own layer, or simply edit their attributes using the Field Calculator with the "update selected" option.
Note: As PieterB mentioned, the roads layer must be in a file format QGIS can edit.


What is the difference between traditional and modern IPA?

Question: I have recently come across this while researching the phonetic spelling for "love", and I have come across a website (the website) that had both traditional and modern IPA spellings (with the modern IPA spelling being lə́v and traditional being lʌv). What's the difference?
Comment: That looks more "this particular website's favorite mangling of IPA due to opinionated views on its flaws" than "modern IPA" (the very website doesn't even define such a thing). The alleged "traditional IPA" is just what *current* IPA would generally end up for transcribing "love".
Comment: Transcribing _love_ as /lə́v/ is utterly misleading. The schwa is reasonable enough, but English is not a tonal language, and the acute accent in IPA means 'high tone'. A high tone is not a phonemic property of the word _love_, or any other syllable in English.
Comment: @JanusBahsJacquet I believe modern IPA on YouGlish is taken completely from Dr. Geoff Lindsey's transcription methods. You can find explanations of his choices on CUBE dictionary and possibly englishspeechservices.com
Comment: @GrahamH. Geoff Lindsey doesn't transcribe love with a schwa though, giving it as  /l ʌ́ v/, because SSBE speakers don't merge the CUT and comMA vowels (if comMA merges at all, it's usually with FOOT). This is likely an American attempting to apply his transcription and botching it because they don't properly understand the correspondences between the lecical sets
Comment: @GrahamH. I can see that he does use the acute to mark stress, but I can't find any reason for that decision. I tried looking through his site, but it's an unnavigable, unstructured mess, and I failed to find anything that actually mentions it at all. Even if it does come from him, I would advise against it. Choosing how to transcribe a phoneme in IPA is a matter of preference; repurposing a tone diacritic to indicate lexical stress is just misuse. It's like writing /bɒtl̥/ (with the 'unvoiced' diacritic) to indicate that the final /l/ is syllabic.
Comment: @JanusBahsJacquet I've also not seen any justification from Geoff Lindsey, but someone else pointed out that it does have the advantage of handling ambisyllabic consonants (which in some analyses are common in English) better than the proper IPA. Of course, placing the proper stress symbol immediately before the vowel rather than at the start of the stressed syllable would handle them just as well and be much less of an abuse of notation
Comment: @JanusBahsJacquet There is some explanation here under "stress:" http://cubedictionary.org/ The ambisyllabicity thing is definitely important. I don't use the acute and grave (sometimes used for secondary stress) for stress in transcriptions, but I think it is an aesthetically pleasing and not wholly irresponsible method.
Answer: The IPA doesn't actually tell you how language sounds are to be transcribed, it tells you what the standard "meaningss" of their symbols are. The letter [ɛ] means "open-mid front unrounded vowel" and [e] means "close-mid front unrounded vowel". The linguist then decides whether a certain word in a language has a "close-mid front unrounded vowel" or a "open-mid front unrounded vowel" – that is a matter of analysis.
Schwa and wedge are in complementary distribution in English, so it is mostly arbitrary to select one vs. the other symbol in a phonemic transcription. For English, there have been certain traditional choices made for various reasons, and lʌv is the traditional choice for this particular context ("that vowel" when stressed). The same goes for the various ways of transcribing other vowel qualities including diphthongs (e vs ɛ; eɪ vs ɛj). I don't know whether anyone has done a systematic study of transcription conventions for English to see whether [eɪ] is definitively the "traditional" transcription of that phoneme. More likely, traditionality is a gradient property and [eɪ] is
most traditional, followed by [ei].
The choice of an acute accent for stress is not "modern", it is non-standard.
Comment: It's worth noting that in most contemporary American English varieties the comMA and CUT vowels are phonetically extremely close, making the phonemic identification of them (given their complementary distribution) pretty appealing. British speakers however have a strong phonetic distinction between the two, with comMA being much closer to FOOT, making the traditional schwa-wedge distinction more reasonable when talking about British varieties (like the link here claims to be)


colpitts oscillator does not work with small inductance

Question: Hi I am trying to build a colpitts oscillator with frequency of 10K Hertz. This circuit works fine with L2, C3 and C4 as they are in the picture. However, there is no way I achieve 10mH of inductance even with winding a toroid due to lack of material. So I had to decrease it to 100uH as this is the inductor with highest inductance that I can find in my school's lab. I re-found capacitor values as 2.5uF and 0.25uF using a online calculator with feedback fraction of 10%. However, the circuit does not work now. I tried and played with everything, even I tried unity gain amplifier to isolate tank circuit output before it is given to C5 for coupling, but it does not work. What can I do? Oscillation does not start. The bjt below has approximately 0.7V base-emitter turn on voltage and its current gain is about 300.
Comment: With a very low-impedance resonator (using 100uH), you'll need much more collector current to achieve oscillation. If you have a 300mH inductor, why not use that as the resonating inductor instead?
Comment: @glen_geek I dont have. Also I have to figure out with what I will replace that L1 inductor. This diagram ideal and not fully buildable by me
Comment: Seems like 10% feedback is not enough. Try to change the ratio if C3 and C4. Remember to model the ESR in your simulation, or the result will be really inaccurate.
Answer: You might try using the resonating inductor to feed DC voltage to the transistor collector in a different arrangement of so-called "Colpitts" oscillator:

 Be aware that using a 100uH inductor at 10 kHz gives a low-impedance resonator. If you want decent output amplitude at the collector, a lot of collector current is required.
Don't forget to add a large capacitor from the top of the resonating inductor to the bottom of those two resonating capacitors (C4, above). Much of the resonating AC current will likely flow through this capacitor.

A larger-value resonating inductor would improve this oscillator.


QGIS snapping issue

Question: I'm facing the issue when I use the snapping tool at line layer in QGIS. I turned on "snapping to segments" and then I've drawn that green lines (picture below) which touches other (purple) lines. After this I've used Vector->Analysis Tools->Line intersections and some of expected points of intersection wasn't detected. Dots are the points of intersection. I was drawing from bottom to top and vice versa. Is this a QGIS problem or any snapping tool issue?
Using QGIS 3.16.0, Windows 10.
Comment: Does this answer your question? ["Line Intersections" tool does not create point where lines intersect](https://gis.stackexchange.com/questions/413719/line-intersections-tool-does-not-create-point-where-lines-intersect)
Comment: It isn't clear how your red line actually looks. Please adjust the symbologies and upload a new screenshot.
Comment: do you mean they should be green or sth?
Answer: I can confirm your finding. It seems that even when activated snapping, points do not always snap. When they do and when not seems unpredictable to me. In the screenshot I draw the pink lines first, than the green ones. For the 6 lines on the left side, I started at the bottom, for the 6 lines on the right, I draw them top-down. So from this sample, one could guess that end-point snapping on the pink line is more problematic than starting point, however, there are exceptions.
So it really seems that the lines do not intersect, even though zooming in as much as possible shows the end-point of the green lines always perfectly on the pink ones.
A workaround: create a new layer for the green lines where their ends are a little bit extended to be sure that they cross the pink line. To do this, use the function Menu Processing / Toolbox / Extend lines and set a small distance. If you now use again Line intersections with the extended layer, all intersections show as expected. So this shows that snapping does not guarantee intersection.

Edit: you can use Geometry generator to create the same effect, so you don't have to create a new layer. I added a symbol layer on the green layer and defined it by geometry generator:
intersection(
   extend(
      $geometry,0.1,0.1),
      geometry(
         (get_feature_by_id(
            'pink_layer'
            ,1
          )
       )
     )
)

Comment: is there a chance that qgis devs will fix it in next deployment?

QGIS snapping issue


Backup - rsync or tar

Question: We're looking to backup about 100gb+ of data containing small files (10kb+) each. The backup needs to be done as fast as possible to another harddrive weekly. Which is the better (especially speed wise) way to backup in such scenario? Rsync, or tar?
Comment: Information about the files would be interesting. Are the existing ones static and only new ones are added or are all files prone to changes?
Answer: Definitely rsync.
The advantage of rsync is that it will copy only the files which have changed.
If you have 100GB+ of relatively small files, you don't want to copy them all each time.
Note: the first backup with rsync will be slow because all files are copied. Subsequently only the changed files are copied, and they can be compressed during the copy.
Be sure to familiarise yourself with all the options of rsync ... there are many.
Tar is an archive utility. You could conceivably create a tar file for the entire 100GB+, but you don't want to transfer it all, each time.
Comment: why would you "definitely" use rsync if you could use tar.gz and combine it with find to create incremental compressed backups?
Comment: @asa more work i assume
Answer: I would like to add that, although in general I agree with pavium's reply and I would choose rsync, there are options in tar for incremental backups. From man:

-g, --listed-incremental F
            create/list/extract new GNU-format incremental backup

   -G, --incremental
      create/list/extract old GNU-format incremental backup

EDIT: Following a recent comment, I will further expand on how both backups work:
tar initially creates a large file, possibly compressed (-g gzip flag) with all backed up files. Then each incremental backup creates a new file only with the modified files, in which it also specifies which of them have been deleted.
rsync on the other hand initially keeps a second mirror directory with the exact tree and files of the source directory, uncompressed. Then with every incremental backup (-B flag), it continues to have a mirror copy of the source, keeping in another directory by date all changed files (both modified and deleted).
Therefore, one can understand that each method has its plus and minus. A tar backup is more difficult to be maintained in a medium with limited capacity, as it happens with the classic incremental method. rsync is not considered a classic backup solution. It requires more disk space for the mirror, since it is uncompressed. It requires more time to reconstruct a full backup of a previous date.
UPDATE: Since Mar 2016 a newer alternative came up: borg backup. I very strongly recommend it. It uses the 'deduplicating' method. More information on the link provided above.
Comment: I hope the recent edit covers your question.
Comment: Why would you choose `rsync` over `tar` if both have incremental backups?
Answer: rsync can be somewhat painful if you have a very large number of files - especially if your rsync version is lower than 3. On the other hand: if you use tar, you would generate a very big resulting tar-file (unless the data may be compressed a lot). Personally, I would look at rdiff-backup, but make sure that you test your restore situation: rdiff-backup can be very memory demanding when restoring.
Answer: if your files do not change much - i would vote for rsync.
Answer: Do you need history (multiple backups) or just a plain copy of your data to some other disk? Backing up 100GB of 10KB files would take ages  if you don't use a block level backup. Think about making block level snapshots or some other block level based solution, if you really need a fast solution.
Comment: for a general use (home directories) rsync works fine even for several terabytes of data (including a mix of small and big files).
Comment: Block-level backups by design only work for entire filesystems, not single directories. This is especially true for simple solutions like "dd if=/dev/foo of=/dev/bar" but AFAIK also for the more advanced Snapshot-based products from NetApp, EMC and the like.
Comment: Do not need a history, just a plain copy of data to a secondary harddisk mounted on the server. Any suggestioon on a faster solution?
Comment: ``dd=/dev/sdX of=/dev/sdY'' in a cron job should be the fastest solution since it's block level copy if sdX being copied to sdY. Benchmark that against a tar'ed or rsync'd copy.
Comment: Can you take a block level backup of just certain folders?
Answer: Take a look at rsnapshot, it's just a script that you can use as front for rsync. It will only backup stuff that has changed and rotate your backups.
Answer: Consider just using the RAID1 capabilities of your controller, a linux softraid that you mount in that directory (can even be done on imagefiles with loopback devices) or use btrfs on files (has the added beauty of COW Snapshots, but is still to be considered experimental).
This link should give you some ideas.
This way you create your backups as you go.
EDIT: Ok, before I get more (somewhat angry) downvotes I need to clarify:
The idea is to swap out one of the discs in the RAID 1 with a blank one.
The one you yanked out is your backup, (done in constant amortized time), the other one should be happily hot-syncing. In linux I can do that completely automated in software and it works.
RAID hot-sync might just be the slowest discussed backup method, but it happens concurrently, and easily within one week.
This answer fits the requirements of the OP perfectly, so I do not see a reason for the downvotes.
I have to admit though, yanking a disk out of a hot (meaning heavily trafficked) array feels somewhat risky, it should work fine though, since all components are just doing what they were built to be doing. If RAID wouldn't resync, you could just as well not use it at all.
One could argue that this is abuse of a one-time fail-safe mechanism for regular use. Tell that to professional parachuters. We live in the digital age, if this wouldn't work, it would be broken.
Comment: For the millionth time: RAID IS NOT BACKUP
Comment: It is, if you know how to use it. You didn't even bother to read through my answer to the btrfs cow bits. A full sync takes time and causes system load, but you can do it live, as long as hot-sync is well supported on whichever technology you use.
Comment: I did read and comprehend your answer. I am fully familiar with the in's and out's of BTRFS. (Hell, I've written parts of BTRFS.) You can use BTRFS with a combination of snapshots and RAID to achieve something that would act as a backup, but it is finicky, uses experimental features and IN GENERAL it is not a solution for a generic backup problem. I stand by my statement: RAID by itself is not backup. RAID+snapshot can be backup, but it is very hard to do it right. Just snapshot+blockbases image-copy of the snapshot is a much simpler approach to the posters question.
Comment: If computer strikes by thunder or fire, will your raid 1 backup surrive?
Comment: @Yuan: Of course it would survive, you just swap out one Hard disk with a blank one, done. It is definately the quickest method. Albeit I wouldn't have the guts to yank out a disk from an actively used RAID, I have done this to backup our backup RAID and it worked like a charm.
Comment: @Tonny: Since btrfs was only one of 2 provided options, I still do not understand the yelling and the downvote. Swapping out images from a softraid is done in a handfull of lines of script.

Backup - rsync or tar


Exchange 2010 Global Address Book

Question: We have issues with Outlook and Exchange 2010: The global address book doesn't get updated on any Outlook clients (but works fine on the  web access). We tried deleting the local address book and let the server push out the updated version, but after a local machine reboot, the global address book reverted back to the older version. We disabled Cached Exchange Mode and it seemed to fix the update issue, but we would like to keep that feature enabled.
Comment: Doesn't get updated at all, or just not for around 24 hours? The OAB (offline address book), which is what users in cached mode access, doesn't get updates by default for roughly 24 hours.
Answer: This is a known condition for cached mode. It will always work on OWA because it always uses the online address book.
http://msexchangetips.blogspot.com/2006/09/outlook-demystifying-outlook-cached.html
The link above has a reg entry you can put on the clients to always use the online Address Book, rather than the cached one.
Answer: Outlook 2010 downloads the OAB every 24 hours. The files are downloaded from OABVirtualDirectory and are updated every 8 hours (=Pollinterval 480). If OAB is manually updated, but not the OABVirtualDirectory, Outlook will have nothing to download.
Try this to update the OAB files:
<code>Update-FileDistributionService -Identity Server1 -Type "OAB"
</code>
Comment: I'll give that a shot and let you know!
Answer: Get-OfflineAddressbook | Update-OfflineAddressbook|
Get-ClientAccessServer | Update-FileDistributionService
Comment: This needs better explanation.

Exchange 2010 Global Address Book


What will you call someone who loves people of his own state within a country?

Question: Is there any noun for a person who has special place/respect/love for people belonging to his own state within a country?
Answer:
A patriot is a person who loves and zealously supports and defends their country.

Wiktionary
It is also used to show one's love and attachment to their own state.

Faulkner was a Mississippi patriot with a profound understanding of the historic injustices done black Americans but...
  (Bye Bye, Miss American Empire: Neighborhood Patriots, Backcountry Rebels, and Their Underdog Crusades to Redraw America's Political Map, by Bill Kauffman)

Abraham Owen, a Kentucky patriot who sacrificed his life at the Battle of Tippecanoe in 1811.
It's a rather touchingly nostalgic essay in regret by a Kansas patriot mourning that his fellow Kansans have been left behind by that same wonderful "history"...
Google search on Michigan patriot.
etc...
Comment: @stangdon This is certainly the term I would use for someone with a particular affinity for his/her state: *as good New Jersey patriots, they always have Bon Jovi in the rotation*, or *you can't expect a Michigan patriot like Uncle Frank to even consider a Toyota*.
Comment: That doesn't have anything to do with their own state within a country, though.
Answer: Something that I've seen used (and have used myself) is by saying that such a person is a proud [insert state demonym here]. For example, I'm from the state of Oregon. If I was to call myself "someone who loves the state of Oregon and the people of Oregon", I would say this:

I am a proud Oregonian.

All the states have a demonym that can be used instead of "Oregonian".
EDIT: Of course, this can be used for states outside of the US, as @ColleenV mentioned in their comment.
Comment: Keep in mind that countries other than the US have states within them, like India.
Comment: @ColleenV Yes, that's true. I was just using the US as an example.
Comment: I just got stuck on the definite article in "all **the** states" - it's probably true though that all states in the world have some way of referring to their residents.


How do I translate sentences into propositional logic symbols?

Question: For example, how would I turn this sentence into logic symbols: "Provided that the MONEY is deposited, the LENDER will get the payment if the WIRE goes through"?
Comment: If that question could be answered generally, we would not need propositional logic itself.  We can all work your example, but we would all give you different advice, and that divergence of experience would not answer the overall question.  My suggestion would be to address it like a language "How do I translate English to French?"  Well, uh, carefully?  Write some formations and change them until they mean what you want to say.
Answer:
Provided that the MONEY is deposited, the LENDER will get the payment if the WIRE goes through

To analyze the sentence into its components and translate it into the constituent conditional symbols, it might help to start with a small portion of the sentence. We can read, "provided that" as "if", and it can be helpful to explicitly articulate the "if's" and "then's". So we have the statement:

If the MONEY is deposited, then the LENDER will get the payment.

...and this can be thought of as the proposition:

If M, then L.

...such that M represents the general idea of "money deposit" and L represents the general idea of "lender payment." We can then neatly symbolize the conditional statement like so:

M --> L

...such that the "arrow" indicates a conditional relationship between the two variables, M and L where the former "implies" (or "sets the condition for" etc.) the latter. (1 - see below)

So what to make of the rest of the sentence and how to fit it into symbolic logical notation, "M → L ...if the WIRE goes through"?
The latter half is also a conditional statement, i.e. "if the WIRE goes through, then the LENDER will get the payment". We can analyze this into "if W, then L" and similarly use the symbols "W → L" - so in short, we've now analyzed the sentence into two propositions that are conditionals resulting in the same consequence:

If MONEY deposit, then LENDER paid.

and

If WIRE goes through, then LENDER paid.

i.e.

M → L
W → L

But how to combine these two conditionals in a way which reflects their relationship as stated above in the ordinary language formulation?
Since both M and W result in L, how about a conjunction?

(M & W) → L

...such that:

If M and if W, then L

This conveys the logical relationships of "If the MONEY is deposited AND if the WIRE goes through, then the LENDER gets paid."
...but is this the relationship as stated in the original sentence?
Not quite. While it details the separate conditions - money deposited & wire sent - it doesn't really capture the dependency of the wire being sent upon the money getting deposited. (2 - see below)

So, in order to express the chain of conditions, how about something more like so:

"If MONEY gets deposited, then if WIRE gets sent, then LENDER gets
paid."

or

"If MONEY gets deposited, then (if W, then L)."

...which can be reduced to:

If M, then (if W, then L).

...which can be symbolized as:

M → (W → L)

And conveys the logical relationships analyzed in the sentence,

Provided that the MONEY is deposited, the LENDER will get the payment if the WIRE goes through

(1) Note, there are many different acceptable symbols for representing a conditional relationship. In this instance the "-->" arrow between two terms is adequate. If, however, you want to use markup language to display a single arrow, try → and you will see: → ("rarr" is for "R"ight "ARR"ow and the "&" ampersand and ";" semi-colon are just for formatting so the markup can be parsed to display the symbols correctly.)
(2) Of note, the ampersand ( "&" ) is generally no longer used for connective notation and it is common to see "the carrot" ^ or in markup language, ∧ displays "and" as ∧ so likely you'd write the above like so: (M ∧ W) → L


How to simulate Mac flooding attack in Cisco Packet Tracer?

Question: I'm trying to see effectiveness of port security on Cisco switches using simulations in Packet Tracer.but first I need to run some Mac flooding address attacks on switches in Packet Tracer. Can anyone tell me how can I simulate this attack in Packet Tracer?
Comment: "_I'm trying to see effectiveness of port security on Cisco switches using simulations in Packet Tracer._" That is _not_ how to do it. Packet Tracer is a simple simulation to help you pas the CCNA. It is missing many features of real Cisco equipment and software, and you could not tell if something you find is real or an effect of Packet Tracer.
Answer: As I have searched allot for this so I put it hear maybe it can save time for others like me.
I have understood that hosts in Packet Tracer are not really configurable to do much works so I can't install packages or run special codes on them.
Instead I decided to use GNS3 which i can have my own configured VMs on hosts and so I can run my desired attack scripts for simulation.
There are lots of tutorials on how to create your own VMs in GNS3.
Comment: This is much better than Packet Tracer, but it can still give you results that are not real. There are companies that will rent you racks of real Cisco equipment to which to can connect and configure. You will then have real Cisco hardware (not a simulation or emulation) and software from which you can get real results.


What's the ruling on poetry?

Question: Is it halal for a writer to write phrases like "Life blesses us with opportunities," "Time changes everyone completely," or "Life tests everyone." Is one commiting shirk if one uses these phrases while talking or writing poetry?
Comment: Oh my God. Please everyone on this website stop saying on simple stuff like this totally unrelated to the Oneness of God and His worship "is this shirk". No it's not shirk. It would be if you were writing on some imaginary god etc.
Answer: "life" and "time" exist, they are not imaginary deities. It is definitely not shirk.
It is also allowed to say such "kitchen wisdom" without direct reference to God who is the source of life or the ruler over time.

What's the ruling on poetry?


HTTP callout In Vlocity integration procedure

Question: I have a Vlocity integration Procedure where I call a SOAP web Service.
When the reponse of the HTTP has the code 500, it's not possible to use that  response on the following steps of the Integration procedure.
do you have any idea about how i can go to the following steps of my integration or use the response of the HTTP Action .
Thank You
Answer: Method 1-
Fail On Step Error: If this option is enabled in any step of the integration procedure then the Integration Procedure terminates if that particular step fails.
So, to proceed to the next steps of the integration procedure, simply disable the checkbox - fail on step error on your HTTP action. Also, you can then use this response on the following steps of the integration procedure. For e.g. - say after this HTTP action you have a response action. You can give any node name in the Response JSON Node of the HTTP action and use the same node in your response action's Send JSON path.
Method 2 -
You can use a try catch block.
Drag a Try-Catch Block into the Structure panel and make sure its Fail on Block Error checkbox is checked. Configure the "catch" behavior — what the Try-Catch Block will do if a failure occurs. For this, under Failure Response, specify a key-value pair to return as the response. The value can be a formula. In Spring '20 and later releases, the value can include merge fields. Now, drag HTTP Action into the Try-Catch Block, and make sure the Fail on Step Error checkbox is checked for your HTTP action which will trigger the "catch" behavior if it fails. Also, you can then use this response on the following steps of the integration procedure.
Answer: Hello when you are in an Integration Procedure and you want to use the return of an HTTP ACTION (not talking about the actual Response Body but all the other information including HTTP Request Status and statusCode) :
Please make sure to use the name of the HTTP ACTION + Info Ex:

Name of HTTP ACTION = GetPrices
Variable to use after calling the HTTP ACTION : GetPricesInfo

GetPricesInfo contains the status of the HTTP action and the statusCode and other information. (status :"OK",statusCode :200).
You can use it this way : GetPricesInfo:status or GetPricesInfo:statusCode.
Comment: Welcome to Salesforce Stack Exchange (SFSE)! Different forums and sites have different rules, culture and mores. While we do want and prefer questioners to accept answers, here on SFSE it is frowned upon and considered poor etiquette to prompt for having your answer upvoted or marked as best. When I edited your answer I removed that line.
Comment: Thank you ! I just had same issue yesterday and wanted to make sure others will benefit from this information because its not mentionned over the documentation of Vlocity.


How can a retail investor short the German car industry and its suppliers?

Question: Suppose that I want to make a small investment of around 1000€ and that I want to short the German car industry and its suppliers over the long term (5-15 years). How would you do this?
Answer: Very simple: Buy Put Options, and sit on them.
If they go down, you make money - the difference between the exchange price and the price the Put is for.
If they don't go down, your options are worthless, and your money is gone.
After some month, you will need to replace your puts with newer ones, as they have limited run times.
Example (simplified, and with made-up data):
Audi trades currently for 100, you think it will go down. You buy an Audi Put option with a strike price of 90. This option allows you to sell Audi shares for 90 (which currently would be a dumb idea, as they are worth 100); it will cost only a small amount, say 2 for a count of 100.
A. After six month, Audi is still above 90. Your options run out and are worthless.
B. After six months, Audi trades at 80 (so you were right with your prediction). You execute your options, and sell 100 Audi shares for 90 (buying them for 80 on the market at the same moment), this gains you (90-80)*100 = 1000 cash. Remember, you paid 2.
Scaling this up, for the whole 1000, you get 500 of those 100 packs, and you would make 500 * 1000 = 500 000. If your prediction is right. Or you lose your 1000, if your prediction is wrong.
Note that this is not for beginners, as most people don't realize they probably lose everything if they guess wrong. Start with small amounts, or better, start with 'simulating' your actions in Excel to see what you would gain/lose.
Comment: Thanks for the answer. But are there 1000€ put options?
Comment: I don't understand your question? I'll add an example.
Comment: My question is simply if I can buy options for around 1000€. I always thought options cost much more.
Comment: Oh, Ok. Options are typically dirt cheap; especially if the market thinks different than you.
Answer: There are a few ways to do it:
1. Shorting the Stock (naked)
One could short the stock, i.e. borrow the stock from your broker;  sell the stock in the market; and promise your broker that you will buy it back either when you choose to, or when they ask you to.
This is risky.  In one way, because the stock price could more than double (so you would end up owing more than the original amount).  Also, if the company pays a dividend, you would be obliged to pay your broker the same amount.  Also if the people your broker borrowed the stock from sell it, your broker may ask for it back (which is usually the worst possible time, resulting in a 'short squeeze').
2. Selling Puts
Put options give you the right to sell the stock (even if you don't have it) at a certain price.   If the stock goes down, then the put options should go up in value.  However, they have a certain amount of 'risk premium' included in the price, and that risk premium increases based on the length of time the option is valid.  5 to 15 years out is a very long time. I don't think there is much that is listed even 5 years out, and the market is unlikely to be very liquid, so the spreads would be wider.
3. Selling Covered Calls
You buy the stock, and then you give people the right to buy that stock from you at a certain price (by selling the call option in that stock on the market).
While it may seem that you will benefit if the stock goes up, you won't, because you've sold that right to the market with the call option.  You will still receive any dividends (unless someone exercises the option you sold them before the ex-dividend date).  You still have to think about whether or not you would lose money from your stock position and if that is offset from the money you make from the options position.  There are unlikely to be 15 year out options listed, so you would likely have to sell call options again after the ones you sold expired or re-open the position if you get 'assigned' (the holder of the option exercises theirs).
4. Shorting the Stock (with protection)
To reduce the risks of losing more of the money than you initially started with, you could also combine your short position with a call option to buy the stock back if it went up (e.g. 50%).  That would be unlikely so the cost would be lower.
You should consider all of the possible outcomes and what your risk tolerance for those outcomes (no matter how unlikely).
Individual Stocks vs. ETFS
You might also be able to do this with combination of positions on individual stocks.  There may be Exchange Traded Funds on the sector, but they would need to be sufficiently liquid that they would have options listed or are shortable. ETFs also have higher fees, so that may not be so helpful to your long term objectives.   Also the more exotic the ETF, the less liquid it is and the higher the fees.  In the US, there is the XLI Industrial Sector Select Spider ETF which is sufficiently heavily traded that it has options listed on it, but this is just for 'Industrials' as a whole, and not oriented towards the auto industry let alone the German one.
Risks
Shorting and options are risky - you could potentially lose more money than you started with(!).  Your (US) broker will not discuss specific options strategies until you have read and understood the OCC risk and disclosures document:
https://www.theocc.com/components/docs/riskstoc.pdf
http://www.goldmansachs.com/disclaimer/salesandtrading/theooc-doc.pdf


creating a transparent layer background in QGIS

Question: I  have created a heatmap in QGIS  to cover my point data and I have saved it as geoTiff so that I can import into tilemill, which I managed to do but my background is black .In QGIS however  I want to make the background of the layer transparent not black so that it shows my heatpoints/areas only . I hahve tried playing around with singleband and changing to singleband pseudocolor but this then removes the heat map coverage and leaves single coordinate points?
Answer: Right Click on the layer name and then left click "Properties", then click the "Transparency" tab. In the box Headed "Transparency Pixel List" click the right hand icon marked with an arrow and a ? ("Add Values from Display").  Then click the black area on the display that you would like transparent.  Then click OK. All black area with the same value will now be transparent.


how to make salt-minion generate new keys

Question: I am playing around with salt and what my problem is launching instance from Amazon EC2 AMI results minion keys being the same. How do I refresh individual minion to get it's new identity (key)?
Answer:
Stop the minion service.
service salt-minion stop

Delete old identity
rm /etc/salt/pki/minion/minion.pem
rm /etc/salt/pki/minion/minion.pub
cat /dev/null > /etc/salt/minion_id

Make sure salt will begin on startup
chkconfig salt-minion on

Create your a new AMI
Answer: Give the following command a try:
sudo salt 'name_of_host_whose_keys_you_wish_to_regenerate' saltutil.regen_keys

Source:
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.saltutil.html#salt.modules.saltutil.regen_keys
Comment: What if I need to generate keys bc the salt 'broadcast' doesn't work yet?
Answer: Based on user325017's answer.
I adapted this for Ubuntu Bionic Beaver 18.04, since it has systemd:
#!/usr/bin/env bash

systemctl stop salt-minion
rm /etc/salt/pki/minion/minion.pem
rm /etc/salt/pki/minion/minion.pub
cat /dev/null > /etc/salt/minion_id
systemctl enable salt-minion
systemctl start salt-minion

Answer: On Debian 10 and possibly others, the files have changed location.
Do this:
# Stop the service.
service salt-minion stop

# Delete key files.
rm /var/lib/salt/pki/minion/minion.pub
rm /var/lib/salt/pki/minion/minion.pem

# Edit minion_id to the desired name you want to appear in saltstack.
# Or you can rm this file and the minion will create it containing the hostname.
vi /etc/salt/minion_id

# Start the service.
service salt-minion start

Answer: Following @user325017 answer for Windows, tweak step 2 with:
Remove C:\salt\conf\pki\minion\minion.pem
Remove C:\salt\conf\pki\minion\minion.pub
Edit c:\salt\conf\minion, and update the line with "id:"
Comment: This should be a comment to the answer you're referring to.


Why does Lord Harkon do nothing when I accept his offer of becoming a vampire?

Question: I come in to Castle Volkihar and I accept Lord Harkon's offer of becoming a vampire and nothing happens.
Answer: This is a (sadly) common bug.
Usually the only fix is to reload a previous save.
But what works (PC only as far as i know seeing you need access to console commands) is to go to the entrance door, activate console commands (press ` next to the 1 on your keyboard) click on the door in the console command menu and then type unlock go outside and then back in and the quest semi resets.


Should we downvote an old answer that did work at some point so that maybe the answer could be updated?

Question: I found a question about a problem that I was having while building an Android app. The question had lots of answers associated with it, yet none of the answers worked. They probably did work at some point, but the Android platform has transformed a lot over the years. My question is, should we downvote an old answer that did work at some point so that maybe the answer could be updated? In my case, I figured out the answer and added my answer to the question. The question
Comment: Have you tried commenting first?
Comment: In that question, your case seems to be different from the OP. The OP had a reference to the Context in a class that is not an Activity and wanted to finish that activity. You seem to be calling that method from an Activity class... So the difference there is not due to the platform being updated. You and the OP have 2 different situations.
Comment: Hard to see it, every answer says "use finish()".  If you actually meant to document that a cast is no longer necessary then be sure to state that explicitly.
Comment: @TylerH the difficulty with "Have you tried commenting first?" is that not everyone can comment. (Eg. newbies) I've been on the site ~1 year, and only just recently got the privilege to comment everywhere.
Comment: I didn't at the time.
Comment: Actually, I would not normally comment. I would continue my search for the answer, but I will keep that in mind for future situations.
Comment: That could be the case. I am very new to `Android` and I was new to programming in general when I had this problem.
Comment: @EdwinChua I was replying to Sedrick who has the ability to comment everywhere. It was a request for more info on what OP had already done; it wasn't general advice. But aside from that, a year is an abnormally long time to participate on a site without getting to 50 rep.
Answer: You should be voting on whether or not a post is useful.  Not whether or not a post used to be useful.
Now whether or not  the age of the post has made it no longer useful is a question that you'll need to decide on yourself.  For many products there are lots of users still using older versions of a product, so the existence of an answer for that old version may well still be very useful, and at most you would only need to edit a post to make it clear what version(s) the answer applies to (because often people don't bother to say so when they're using the version that was current at the time of the post).
For other types of products certain types of old information may simply have no use at all.  For example information about a hosted app for which it's not possible to use older version even if you wanted to might be determined by subject matter experts to just not be useful to anyone anymore, if it's not even possible for it to apply to anyone.
Where feasible, and useful (which should often be the case) it's good enough to just edit an older post to indicate what version(s) it applies to, (or to make that information more prominent, if necessary).
Also note here that sometimes it's appropriate to edit the answer, but sometimes it's appropriate to edit the question.  If there's a problem that someone asked about that just doesn't even make sense to ask about after version X of a product, update the question to indicate that it's asking about how to do [this thing] before version X, rather than editing an answer to say "This is a good solution before version X".  For problems where the problem is the same regardless of version/age, but only the answers are different, then that's where you'd edit the answers, not the question.
But at the end of the day, if you can't edit the post into something that is useful, then your vote should most certainly reflect how useful it actually is.
Comment: hat tip deserved ...
Comment: Do you have boilerplate answers ready or so? In the time I manage to produce 2 mediocre comments, you post a full fledged answer ...
Comment: I like the point you made about `Versions`. Many Android phones do still run an old version of Android and people can still make apps catering to those phones. When I answer a question in the future, I am going to try to make a habit of putting version info in the answer. I answer some `Java` and `JavaFX` questions and with the new `Java9` some things are different  from the older still popular `Java8`.
Comment: @rene Well I did edit some of this in.  Most of the second half of this answer was ninja edited in.  But no, I didn't write any of this before reading the question.
Comment: @Victoria If someone is blindly copying some code without even reading the answer that they're using then, frankly, they're going to have pretty major problems as a programmer, and there isn't much SO can do about that.  If they're not even willing to read a disclaimer at the start of the answer that it only applies to people using version X of a product, when they're using version X+10, the consequences are on them at that point, at least in my view.
Comment: You can hardly "bring to top" highly voted post which uses even, for example deprecated API. I bet many "gimme teh codez" programmers will use the "top voted one code" without reading the "whole thread" no matter what.
Comment: @Servy, well, to be honest, I'm not the one who introduces answer with _"this applies since "_ and with the new, modified version changes the answer by adding _"..until "_. I have different things to do as well :) How can a newbie then distinguish between just outdated and wrong answer without having even possibility to see the score balance?
Comment: @Victoria That's fine, and of course for the vast majority of answers that type of information isn't necessary.  It's only really important *after* the solution in the answer is entirely obsolete and no longer usable in the current version.  Once that happens, the answer may cease to be useful if not edited to properly address that fact, and you may find that votes reflect that until the post is edited.
Comment: @Servy, if there was a _mechanism_ as used to be in documentation, I would use it (that frame with version looked good anyway). The rest would be categorising tags into versions. All that is not so diffictult.