Could a slow rotating planet combined with high density atmosphere create high winds?

Question: I am trying to design an alien ecosystem around a K type star. My idea was to have purple plants and high wind atmosphere so originally I wanted to make it tidally locked. However after watching some Artifexian videos I was wondering if I could achieve this in other ways. For example, if the air density on the planet would be around 3.078 kg/m³, much higher than on Earth (1.225kg/m³) and have uneven heating via long day and night cycles (let's say about 24 hours each) could that result in high winds on the surface? Also, if the planet is rather close to its star, would it become tidally locked anyways? According to my calculations the habitable zone is somewhere between 0.61 AU and 0.87 AU.
Comment: I want the planet to orbit a red dwarf star. Due to the weeker light and heat that it radiates the habitable zone is sowhat close to the star. Considering this aspect I was wondering if the planet would always end up tidaly locked or if I would have more freddoms in design.
Comment: @RaduDanCoroian For future reference, please be aware that we allow one and only one question per post - which in this case would have removed some confusion. In the mean time, on a tidally-locked world you're likely to only have significant winds at the terminator and no where else. If that's not what you want, tidal locking is not what you want. As for will it become tidally locked? Yes, eventually. If you don't want it tidally-locked, deal with it as a younger planet.
Comment: I can be mistaken, but doesn't [tidal locking](https://en.wikipedia.org/wiki/Tidal_locking) means the same side of the planet is looking at the sun? So you have a crispy hot side, a freezing one and no days or nights, which is quite incompatible with a 48h day-night cycle.
Comment: We are talking about 2 different scenarios here. One scenario in which the day/night cycle is very slow and one where there is no day and night cycle at all.
Comment: What I mean is that you tell that your world have long days. Why do you ask whether it could be tidally-locked then?
Comment: Don't have a proper answer, but I would say that Venus is an extant example of a slowly-rotating, thick-atmosphere planet with high winds. I'd just adjust the distance from the star to reflect the change in magnitude/brightness and gravity. See if you have a new goldilocks zone that can work to not be tidally-locked but not be an ice world, with the given radiation and gravity constraints.
Answer: With such a rotation speed, or even slower, you could have it where the high daily temperature is higher than Earth norm, while the daily low is lower than Earth norm. Hotter temp equals more evaporation, which rushes towards the dark side of the planet to equalize the pressure and temp. This would result in nightly storms in most locations on the planet. Your plants would likely need to close their leaves during the main heat of the day and receive most of their solar energy during the long mornings and evenings.
Next, we have the issue of coronal mass ejections (solar flares) with the planet being as close as it is. A slowly rotation planet means a slowly rotating core. This causes a weak geomagnetic field and little protection against high energy particles. The result is the destruction of ozone and the stripping of atmospheric gasses from the planet. Fortunately, there is a solution which solves multiple issues. A dense near-orbit moon will increase the rotation speed of both the core and the clouds while also increasing tidal height and subsequent evaporation.
Earth's moon has a negligible effect on wind. Obviously, a denser or larger moon with a closer orbit would increase that effect. The increased speed of the core rotation would generate a stronger magnetic field. As the moon is closer to your planet, it would need to be travelling at a higher speed. This would result in more frequent high and low tides than on Earth (which has high/low tides roughly every six hours). If we guestimate a tidal frequency of every four hours, your planet has water nearly constantly surging and retreating, and at a much higher height. On Earth typical coastal tidal range can reach over 11 meters, but on your planet, you could have it reach twice that height or more. This would result in a lot of flooding near coastal regions. As the water retreats, the shallow water, tidal pools, and puddles evaporate in the hot sun. More wind is created.
Average day cycle: The sky is clear as the Sun rises. Waterlogged plants are fully open to receive light. As the sunlight intensity increases, the leaves of the plants curl closed. This allows sunlight to reach the wet ground and evaporate any standing water. The sky becomes cloudy as the evaporated water moves towards the dark side of the planet. When midday passes, the plant leaves open back up, relying on stored water to release heat and moisture. The sky is now partially cloudy, as most of the afternoon evaporation is due tidal water. As the sun sets, massive thunder clouds move in to pour rain back down on the plants, which store it for the following day. Thick layers of decaying plant matter on the ground help prevent the cold night air from harming the plant roots. This material also acts like a sponge, absorbing the water and preventing flooding. While the top layers might dry out during the heat of the day, dig down a handful of centimeters and the thick humus will be damp to the touch. When the sun has fully set, a thick fog rises from the warm ground to fill the cold air. The cold stiff breeze causes a second mock rain as the condensing water drips from the foliage. In colder climates, thick frost covers every available surface. The sky clears as the air becomes too cold to hold much moisture.
A possible backstory could be that the moon originated from outside the system, perhaps as a remanent core from an Earth-type planet after its star went nova and burned off the crust. The nickel/iron core was ejected from the system and drifted through space until it was captured by the gravity of the local star, and eventually the planet. The planet was initially rotating slower than modern times, but the moon has increased the speed over the last few million years. The plants had originally colonized areas closer to the poles, where the sunlight and radiation was less intense. The increased geomagnetic field strength and rotational speed increased their habitability zones to the rest of the planet. The moon has still not become tidally locked with the planet but will in another few million years.
Answer: Le Atmosphere; So, the number you give is possible but ill advised. You can use this website to estimate the atmospheric properties. Using fairly standard numbers (0.7 N2, 0.25 O2 and 0.05 CO2) at 3 bar and 30 Degrees we get a density of about 3.5 kg/m³.
However, if your goal fast winds a dense atmosphere is not the metric to look at. And in fact, making your atmosphere this dense will only decrease the wind speed. Because, like if the atmosphere is physical heavier it might be harder to move it.
Wind; Wind, and storms, are generally driven by Oceans. Large bodies of water evaporate water. This vapor accumulates in the atmosphere and is kept from condensing by the constant influx of energy from new vapor. The oceans keep clouds saturated with vapor essentially. When these clouds eventually fly over land, this energy source is adios and the energy is released in the form of Rain or storms.
From this, we can see that the main driving factor for Storms and wind are the oceans. Having a tidally locked planet is just about the worst option as one side of your planet will have a water concentration measured in the g/km³ while the other side will be in permafrost. So, if there even is an ocean, it wont be big. And the temperature differences in the twilight zone wont really substitute a global ocean system.
If your goal is to maximize winds and storms, you need to look at what makes them. And like... make more of that.
In this case we want lots of wind and storms. As such we want big oceans. they dont have to be deep, as a matter of fact we want shallow bikini lagoons. Not just to maximize the number of hot woman trapped in inexplicable situations that could be resolved by any number of basic precautionary measures.
But also to maximize evaporation. Shallow water has a lower energy capacity (because there is less water) and will release it faster when the sun sets.
What also helps is a big moon that creates strong tides as that too contributes to evaporation and winds.
Vegetation helps a LOT to. Go to this site for some truly cool footage. You will notice that clouds are generated by Rainforests in South America like there is no tomorrow. For good reason, plants trap a lot of water and give it of when the sun hits them. So the more tropical regions there are, the more vapor there is in the air which drives even more storms.
Lastly, geography matters too. You can engineer mountain changes and similar features to deliberately concentrate a lot of vapor in one area. Which will lead to a lot of wind.
You will notice, the atmosphere did not come up once in here. Is it important ? Yeah, sure. But i would argue these factors above are not only more visually appealing but also just more important. We have to assume the atmosphere is a certain way anyways. So it is really not a variable i would take into account so extensively this early. The main factor you have to look out for here is the Specific Heat Capacity, but like for most mixtures you can realistically use it is going to be around 1000 J/kg-K. So very earth like.
Tidal locking; Eventually, every planet would become tidally locked. Just put a big boy moon in the sky and dont worry about it.
Plants; On a closing note, quick tip. Evolution has no reason to it. My headcanon is that the reason why plants on earth are (generally) green is because like idk at least 3 billion years ago there was bob the green algae and alice the red algae but oh no alice just got rushed by a random rock, hence why all plants are green.
Obviously it is a bit more complex, the spirit is true. You can just have purple plants with the justification "Well, * Claps *, thats just what evolved first". So much of what we find in nature is the most half assed solution to a problem imaginable and it just stuck for millions of years. So dont stress to much about justifying those colors.
Comment: @ErikHall Based on an answer [here]( https://biology.stackexchange.com/a/56739) Your head cannon is not quite correct, but not inaccurate. Though the reason is because of a purple bacteria that absorbed green light. which led to only red/blue light being available for use by proto-algae.
Comment: I had been under the impression plants are green because green is the center of the spectrum of light that hits the Earth. Both infrared and ultra violet light can be harmful to plants, so dead center would be how you absorb the most light for photosynthesis with minimal cell damage.
Comment: @TitaniumTurtle Last i checked the Green color is more related to heat management. In truth there really is no single reason why some plants are green. We need to remember that there are red plants. As i said, the true reasons will be very complex. To the point where i would argue it is ok to just pick a color.
Comment: @TitaniumTurtle plants are green because they reflect green light, and absorb red/blue... Remember that the color of an object is based on the color that it reflects and not on what color that it absorbs
Answer: Let's consider the wind on the planets in our solar system:

Mercury: No significant atmosphere, no detectable wind.

Venus: ~100 m/s in the upper atmosphere, 1-2 m/s at ground level.  Very thick atmosphere.

Earth: 25+ m/s average in the upper atmosphere, ~9 m/s average at ground level.

Mars: Up to 30 m/s, 1-4 m/s average at ground level.  Thin atmosphere.

Jupiter: 100+ m/s average.

Saturn: 225 m/s average.

Uranus: 250 m/s average.

Neptune: 530 m/s average.

Pluto: 10 m/s average. Thin atmosphere.

The general trend we see here is that winds are paradoxically higher further away from the sun, and that they are higher in bodies with thicker atmospheres.  Where we are able to measure wind at multiple altitudes, wind is slower nearer the ground.
I believe that the limiting factor in wind speeds is turbulence.  Turbulence increases near rough surfaces like the ground and in systems with more energy.  Note that the wind speed in the gas giant planets where the atmosphere is very thick is both high and increases with distance from the sun.
So, to have a world with a high ground-level wind speed, you would need a thick atmosphere, a short day, low temperatures, a low day/night temperature differential and a smooth ground surface.
Unfortunately, these conditions are also not terribly great for supporting life.


"When it comes to doing something" Are there alternatives?

Question: Do you think "When it comes to" is a formal or informal expression?
I want to use this in the TOEFL writing paper.
Answer: Informal. Use this.
<code>Concerning ...
With regards to..
</code>
Comment: Bib's 'about' is the least marked way to state this. 'When it comes to' is semantically equivalent, but has a varying degree of pragmatic flavour. It can be used as a topic-change marker (Although many people look at the hotel reviews before booking, when it comes to travelling, people tend to make subjective decisions.), or a 'crescendo-marker' (Many people say they are in favour of greener forms of energy, but when it comes to having to pay bills twice as big as before, ...).
Comment: Maybe try *about*.
Comment: I want to say : People tend to make subjective decisions when it comes to traveling. How do you use "with regards to" for conveying this meaning?
Answer: Aside from "with regard to," consider "with respect to."

People tend to make subjective decisions with respect to traveling.


From which play YouTube video of Al Pacino belongs to in Jack and Jill?

Question: In Jack and Jill, there is a YouTube video of Al Pacino having a nervous breakdown. In that video, what play is he doing? It seems like Shakespeare to me but which play of Shakespeare is it? And when he says "Shut all cell phones off! This is what the man said!!" Who is he referring to as "the man"?
Comment: he's referring to the announcement made before a play starts over the loud speakers asking the audience to turn off their phones, etc.
Answer: It is a Shakespeare play, he's doing Richard III (he's also dressed like him). The line he's reading is from act IV, scene IV in the play:

If I did take the kingdom from your sons, to make amends, I'll give it to your daughter.

As for "the man", it's unclear; bear in mind that he's going nuts. He's looking and pointing up when he says that, so it's possible he means God, Shakespeare, Richard III or some higher up like the director.


Bridge Scoring Question

Question: Rubber Bridge:  Declarer is vulnerable.  The bid is 3 clubs.  Declarer only makes 5 tricks for down 4.  What is the penalty?
Comment: I already knew the answer, however a bridge buddy is insistent that unmade tricks towards book do not count towards a penalty, only those odd tricks above book are considered for penalties.
Answer: Four tricks down vulnerable not doubled is 100 points per trick, 400 points total for the opposing team. Nobody scores below the line, opponents do get 400 points above the line.
More information here.

Bridge Scoring Question


What's causing my washer to stop running during the wash cycle?

Question: I have an Frigidaire Affinity washer that runs perfectly fine, (all the way through wash & rinse cycles), when empty, but as soon as you put even a small load of clothes in it, it stops working halfway through the wash cycle, leaving a tub half full of water and very wet clothes. I noticed that when this happens the timer resets to the start of the wash cycle, and then will shut off after about 15 minutes.  What could be causing this sort of behavior?  The machine is only 4 years old and is all digital.
Comment: Please include the model number.
Answer: The machine is not emptying properly for some reason.  All washing machines are designed never to spin whilst full of water.  The default is either to pause indefinitely or reset the program.  It's odd that the machine is fine when empty though.
I would still do the following before calling out a repair company.

Check that it isn't blocked or partially blocked.  If the machine has a service panel at the base then it might have a round filter dial that when turned comes out of the machine (plus old baby socks, coins etc).  Make sure to grab loads of old towels and put them around the base of the machine before doing this.  The machine might have several litres of water or more still in it.  If you can see water inside the machine then you will need a lot of towels when unblocking the filter... you have been warned ;)  Get a well insured friend to do it otherwise :D
Make sure that the grey waste hose at the back of the machine is not trapped.
Make sure that the grey waste hose is not higher than the machine or pushed too far into the drain pipe.  This can cause water to back up into the machine and complicate matters.
The machine might have a coin lodged in the pump or something similar.  Listen for any rattles when it is emptying.  You should at least hear a churning sound coming from the pump.
Give the door a push in case the lock is faulty and the clothing is pushing outward causing the lock to break a circuit.
Check that both Hot and Cold water are actually going into the machine.  If you have turned the Hot off at the wall and the machine has an economy mode then it is waiting for hot water.
Answer: The most common cause is a failed timer. Most machines use an electromechanical unit that is prone to breaking. Hard to fix and is almost always just replaced.
You say that the machine is "all digital" but the valves are mechanical, and many digital machines operate physical relays.
Even if it is out of warranty, it may be worth a call to service since total failure should not occur on a four year old machine (and your problem is effectively total failure).  Occasionally they will cover the cost of the part if not the service call.
Comment: Granted mechanical bits fail, in particular relays and valves, but how does this explain working without clothes but not with? Without knowing anything about this machine, I would guess it's some sort of overload sensor that is faulty, assuming such a thing even exists on this machine.
Comment: @bcworkz Good point.


How to set up Tortoise SVN comment length requirement

Question: I know somehow in Subversion you can ensure x chars when a developer commits in the comments section.  I'm using Tortoise but don't see where to specify this globally and ensure that x number of characters will be entered on any commits made by developers.  I'm using Visual SVN Server as well to setup repositories.
Answer: To be effective across an entire development team, this is a setting that should be set on the server, rather than in the TortoiseSVN clients. If you still wish to set this setting on the client, the setting that Tim refers to is illustrated in this blog post:
http://www.anujgakhar.com/2008/07/22/forcing-svn-comments-with-tortoisesvn/
Comment: doesn't really say how to set this on the server.  I have seen that you must use hooks but there has to be an easier way and I have yet to find a hook that requires all developers to be prompted to enter x chars in for comments on pre-commit
Comment: so how would you set this server-side?  IF you have a hook you can share please do cause I can't find one on the net or in the docs.
Comment: @Tormod, Just a note,the link in your answer pops up an anti virus warning that the page contains a virus.
Answer: from the tortoise svn menu (explorer plugin) choose properties -> Add ->
tsvn:logminsize
see also:
http://www.anujgakhar.com/2008/07/22/forcing-svn-comments-with-tortoisesvn/
and
http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/ch05s15.html
EDIT
Tormod is right - it is good to have that policy on the server, but I just "enforce" it on the clients.  We basically have an svnprops file we propagate.  If people don't adhere to it then we have some discussion...
Comment: Well if you want to enforce it on all your clients you'd have to have it set on the server!
Comment: should not be a discussion, should be a standard thus you enforce x chars to be entered. IF you can't deal with a required comment, that's BS.
Comment: There are some cases where comments might not be needed.  We trust our developers to be smart about it.  I am not saying it should not be on the server - what I am saying is that there is no 100% always correct rule.  Where do you draw the line?  How many characters?  And why?
Comment: I draw the line at the fact that every commit should have a message so anyone looking at the history can tell wtf is going on without having to look at ALL code in the repository which would be an unreasonable start and which is why you have a history feature (comments) in subversion or any other source control to begin with!  Even a small change has a purpose or underlying effect for the team!
Comment: @coffeeaddict - that's nice - but can you tell me how many characters that is supposed to be? If I am going to make a rule on the server - like you advocate - how do i translate what you said (which I agree with) into a hard/fast rule?  Is that 3 characters?  10? 25? 100?  200?
Comment: Just think about it.  I think you know first off a sentence can't possibly make any sense without at least 100+ chars.  You can't really form a detailed sentence with anything less for starters.
Comment: I wouldn't want my developers to always just put in a sentence if there's more to be told either.  The more detail the better especially if the set has a lot of changes in it.
Comment: So the requirement being at least one detailed sentence to determine a base of x chars to start with.
Comment: So you don't think just a link to a defect issue is enough, with perhaps three or four words? We disagree there. I find that perfectly acceptable in some cases - especially for trivial issues or other cases. For example: ["Fixed memory leak issue 1234 - delete pointer in dtor"] and note that with the integration of svn and some other tool there is a url/link to the issue that you can click on.  That comment has half of your required 100 and is very detailed and specific.
Comment: If you "force" people to put in comments that long (and I have seen this happen) then people put in nonsense, or "blah blah" or ellipses or whatever. And then you are back to the same problem that you have with just putting that in the client.
Answer: Here's an article on preventing blank comments. This one's on SO already
Comment: Ok, but where is that limiting per x chars?  It just checks that you have entered a char.
Comment: and that SO link does nothing to help me, just says to create a hook.  I've found no good articles on how to do that in Windows hook files.  It's not that easy or easy to find.  I just want an example of someone who has already created this hook.  Pain in the ass.


Using TFS 2015 Power Tools for Workspace Templates

Question: Has anyone managed to use the Create Workspace from Template with a local path value replacement working?
I have set the local folder to C:\ROOT\ and then entered a folder name in the Local Path field when creating a workspace but it always creates the workspace with C:\root\ and doesn't replace using the path.  The Source Control Folder path does accept ROOT and the Branch Path replaces this ok.
Thanks in advance for your help.
Answer: When you create template from original template, set the local folder to Z:\\ROOT\xx, check the screenshot below:

When create workspace from new created template, set local path to e:\ws\ (example), check the screenshot below:

Check the new created workspace setting:
Comment: Thank you very much. Although you have just spelled out to me the instructions again I just realised while ROOT is replaced on a Server path, Z:\\ROOT is replaced on a local path.  It was the Z drive part I was excluding in my trials previously which I have changed to get this working now.  Thanks again!


Generate LULC maps using Sentinel data of European Space Agency?

Question: I found out that Sentinel data is of 10m x 10m resolution whereas LANDSAT data is of 30m x 30m resolution. Did anyone come across research in which Sentinel data is used for making LULC maps or is applied for some other purposes?
Answer: Sure, there are many projects on going using Sentinel-2 as input for land cover maps production
A few examples:
Inglada, J.; Vincent, A.; Arias, M.; Tardy, B.; Morin, D.; Rodes, I. Operational High Resolution Land Cover Map Production at the Country Scale Using Satellite Image Time Series. Remote Sens. 2017, 9, 95.
Patrick Griffiths, Claas Nendel, Patrick Hostert, Intra-annual reflectance composites from Sentinel-2 and Landsat for national-scale crop and land cover mapping,Remote Sensing of Environment, Volume 220, 2019,Pages 135-151,
ISSN 0034-4257,
https://doi.org/10.1016/j.rse.2018.10.031.


Why is ACE2 not used as drug against covid?

Question: Can ACE2 be produced and used as drug against covid? I read it is the receptor molecule. If it is in the organism the virus should bind to it and could not attack cells anymore? Is that right?
Answer: There's a Cell pre-print by Monteil et al. (DOI: 10.1016/j.cell.2020.04.004) which argues that human recombinant soluble ACE2 protein can competitively bind to SARS-CoV-2 virus and reduce its ability to infect and replicate:

Here, we report that clinical-grade human recombinant soluble ACE2 (hrsACE2), which has already been tested in phase 1 and phase 2 clinical trials (Haschke et al., 2013, Khan et al., 2017), can reduce viral growth in Vero E6 cells by a factor of 1,000-5,000. Moreover, we show that human blood vessel organoids and kidney organoids can be readily infected, which can be significantly inhibited by hrsACE2 at the early stage of infection.

Though it is not perfect, in that other factors and receptors may be implicated in infectivity:

Our data now show that this clinical-grade human ACE2 molecule - but not mouse soluble ACE2 - can significantly inhibit SARS-CoV-2 infections and reduce viral load by a factor of 1,000-5,000. However, as observed in antibody neutralizing experiments of many viruses, the inhibition is not complete, though clearly dose-dependent. This may be due to the fact that there might be other co-receptors/auxiliary proteins or even other mechanisms by which viruses can enter cells, as had been initially proposed for SARS (Jeffers et al., 2004; Qi et al., 2020).

One person is right to comment that these are in vitro studies. In other words, they treat cell cultures on the functional equivalent of a Petri dish: Vero cell lines or simulations of human tissues (organoids), and they see what happens.
The in vitro studies are useful and important but it is a big step from those to 1) treating people in vivo — designing a drug that can actually and safely target the virus where it infects respiratory and renal tissues — and, 2) making and distributing that drug in quantity, cheaply, safely, etc.
But the larger point of these studies is to show that scientists are definitely thinking about the mechanisms by which the virus infects cells, and to see if there are ways to interfere with and limit the virus, by doing so.
Like your thought to use ACE2, some researchers have looked at other viruses, like poliovirus and HIV, to see if there are similar soluble ligands that they can bond to antibodies and deliver safely to humans, as a general therapeutic idea.
They found that HIV-1, which uses binding to the CD4 receptor as a means to infect T cells, could develop mutational resistance to soluble CD4 and use other mechanisms to cause infection. But by adding a second receptor CCR5 to the immunoglobulin, other researchers were able to limit the ability of HIV-1 virus to evolve resistance to both receptors, which provides some possibility of this approach as a vaccine, down the road.
These issues all complicate use of receptors as a way to "fake out" the virus. But it is an avenue being explored, especially for this virus during a time of emergency.
Comment: It should be noted that the study referenced is *in vitro* and no efficacy has been demonstrated in actual infected individuals, though there are earlier trials (I assume these are the citations in the quote) showing clinical efficacy in ARDS - I believe that relates to the enzymatic activity of ACE2, though, not anything to do with binding to viral particles, and I don't know of any proof-of-concept that would suggest the receptors make it into the lungs where the virus is.
Comment: I don't know if such a therapy exists. Maybe others would know. Usually these are immunoglobulins, immune system proteins with unique bits attached that a virus would bind to, instead of the receptors on a lung or other cell that it would normally try to infect.
Comment: Good points, definitely. Read the preprint in depth.
Comment: @AlexReynolds thank you. In that regard I have a question. Has someone tried to use human cells with artificially damaged cell interior that will accept the virus by its ACE2 and other receptors (but not reproduced it and finally destroy it)?
Comment: What about any side-effect of "taking away", i.e. scavenging, the natural ligand of ACE2 (which is physiologically expressed on membranes of epithelia and neurons too(?), thus especially  leading to a lack of counterbalancing of high blood pressurem as ACE2-axis is considering beneficially downregulating the AngioensinII-AT2-axis?


How to join two lines created by curvature pen tool

Question: I am trying to use curvature pen tool to draw shapes, but unable to draw further lines on this shape with curvature tool. how to join curvature pen tool line with another pen tool line in illustrator???
Comment: Can you please elaborate a bit more? Maybe adding screenshots?
Answer: Many ways to join two lines/paths drawn by curvature tool.

If you've drawn a path, click on it using curvature tool. It will start again from the end you had ended it.
If you hover on either ends when path is selected, you'll see small circle with a dot which denotes that you can continue path from here.
When drawing a new path, you can move it towards the end of another path and click on the end, it will join both.
You can alternatively use Cntl+J to join two ends. Just select both ends with Direct Selection too.

You can observe them in following GIF:

Sometimes, if you'll need Direct Selection tool to perform steps like this:

Feel free to use Pen tool itself where you need to.


Does the half-life of an element mean it will never decay completely?

Question: Example:
Half life of Polonium-194 is 0.7 seconds. If we supposedly take 50g of Polonium, there will surely be a time when no more of this Polonium will be left because if we consider the decay discretely, in the form of individual atoms, won't there be a time when the last atom decays completely?
Does this mean an element can decay completely?
If so, why don't we actually 'run out' of natural radioactive elements?
Is it so because the elements they decay into combine to form the parent element again?
Answer: There will certainly come a time at which we can say "it is more likely than not that not even one atom of the original Polonium sample is left".  So, yes, the sample can decay completely.
The fact is, the earth is running out of natural radioactive elements.  Most of what is left are Uranium, Thorium and Potassium because they have half-lives which are not tiny compared to the age of the solar system.
The reason why we had any radioactive elements to start out with is that the solar system formed from a cloud of dilute gas which contained debris from an exploded supernova.  In the violence of a supernova explosion smaller nuclei can be slammed together so hard that they fuse into the heavier radioactive elements.
In reactors we can make samples of heavy radioactive elements - but usually at the cost of many uranium atoms.  Other than that the number of radioactive nuclei is winding down here on earth.
Comment: Until we get fusion power going ...
Answer: No, not really.  For example, suppose you have a sample of $2^{1000}$ atoms with half-life $t$. (Note: there are only about $10^{80}$ protons in the Universe.)

If you wait for a time $t$, then half of them have decayed, and you have on average $2^{999}$ remaining.
If you wait $1000t$, then you will have on average a single radioactive atom remaining.
And if you wait $2000t$, then the average number of remaining radioactive atoms is $2^{-1000}$.  That means it is overwhelmingly likely that actual number of remaining atoms is zero.

Your half-second polonium isotope was among the isotopes produced in the supernova explosion whose detritus recombined to form our solar system, five-ish billion years ago.  That "primordial" polonium  is entirely gone. The radioactive elements that remain are the ones with billion-year half-lives.
A famous consequence of this is the natural fission reactor at Oklo, Gabon, where several tons of uranium ore underwent rainwater-moderated fission about two billion years ago.  This was possible because, on a younger Earth, there was more of the highly-fissionable, shorter-lived isotope U-235 in uranium ores than there is today.  A similar structure formed by geological processes today wouldn't fission because natural uranium is no longer sufficiently enriched.
Comment: If you removed "No, not really" from the beginning of your answer then with light editing we could probably delete mine ...
Comment: @PaulYoung I hope you don't! I like your answer, too.
Comment: While it's quite likely that [a supernova triggered the formation of our solar system](https://astronomynow.com/2016/11/29/did-a-low-mass-supernova-trigger-formation-of-solar-system/) and contributed some radioactives, the ingredients for the solar system came from a very large number of stars (many of them *not* supernovae), as explained [here](https://astronomy.stackexchange.com/questions/26691/do-we-know-how-old-the-matter-that-makes-us-is) by Rob Jeffries.
Answer: When discussing radioactivity, it is important remember that all $^{194}$Po atoms are independent. No atom "cares" if other atoms have or have not decayed. If the decay probability per unit time is constant ($\lambda$), then the probability that a given atom has decayed by time $t$ is given by the CDF of the decay probabilty:
$$ P_i(t) = 1-e^{-\lambda t} $$
This applies to each atom in your $\frac 1 4$-mole of polonium independently. Discussing collective phenomenon like the time it takes half the sample to disappear obscures this fact: each atom operates independently.
If you have $N$ atoms, the probability that they all have decayed is the product of the probabilities the each has decayed:
$$ P(t) = (1-e^{-\lambda t})^N \approx 1-Ne^{-\lambda t} $$
which gets close to 1 when
$$ e^{\lambda t} \gg N $$
or
$$ t \gg \frac{1}{\lambda}\ln{N} = \tau\ln N$$
where $\tau$ is the mean-life.
Answer: We are running out of some radioactive elements.  It is those which are not replaced by human activity and natural processes.
Nuclear reactors are a source of radioactive elements which replace those which have decayed with the Manual for reactor produced radioisotopes showing what can be done.
A example of replenishment by natural processes is the production of the radioisotope $\rm ^{14}C$ in the upper atmosphere.
Examples of depletion without natural replacement are the four decay chains, Thorium series, Uranium series, Actinium series and the Neptunium series with only the last two isotopes of the Neptunium series occurring naturally because the parent and its other offspring have a comparatively short half life.

Going back to your example if you  read the relevant part of this paper in which the production of $\rm ^{194}Po$ is described it should be apparent that starting with $50\, \rm g$ of $\rm ^{194}Po$ is nigh impossible.
So you can say that this radioisotope does not occur naturally.
Answer: As pointed out in the other answers, half-life is usually defined for a very big collection of particles, where we can take thermodynamic limit, i.e., assume that the number of particles is infinite for all the practical purposes.
However, an exact solution is available in terms of pure death process (see this answer for the mathematical details and references), which gives the probability that at time $t$ we still have $n$ non-decayed atoms left as
$$
P(n, t|N_0) = \begin{cases}
{N_0\choose n}e^{-n\lambda t}\left(1-e^{-\lambda t}\right)^{N_0-n}, \text{ for } n\leq N_0,\\
0, \text{ otherwise},
\end{cases}
$$
where $N_0$ is the initial number of atoms. Thus, the probability that all the atoms have decayed by time $t$ is
$$
P(0, t|N_0)=\left(1-e^{-\lambda t}\right)^{N_0}.
$$
Note that in this case all the atoms might have decayed before time $t$, which is just a parameter. If we want to know the time at which all the atoms decay (which is obviously also random), we can obtain the distribution function for this time as (see here for some basic survival analysis math)
$$
f(t|N_0)= \partial_t P(0, t|N_0) = \lambda N_0 e^{-\lambda t}\left(1-e^{-\lambda t}\right)^{N_0-1}
$$
One can now calculate its moments $\langle t\rangle$, $\langle t^2\rangle$ and other statistical characteristics.
Answer: Take an ordinary banana for example. It contains approximately 60 micrograms of Potassium-40 ($\,^{40}K$), a naturally occurring radioactive isotope. This is about $9\times10^{17}$ atoms. It takes 60 half-lives for this to decay into less than a single atom. Since the half-life of $\,^{40}K$ is 1.25 billion years, it will take 75 billion years before the last atom decays.
Comment: The half life of a banana is very much shorter than that.
Comment: I am sure it is a violation of the rules for me to say so, but that made me LOL my2cts
Answer: The probability that all nuclei have decayed in a 50g sample of $\rm^{194}Po$ is a function rapidly approaching unity after a few periods of $0.392* ~^2 \! \log(1.5 \cdot 10^{23}) \approx 31 $ seconds.


How will C+ and many B+ during online school affect PhD admissions?

Question: I'm finishing my second year at a top research university in mathematics, and my major gpa is still a 3.99, however my grades in other subjects have suffered tremendously due to the pandemic stress and online learning (B+ in a physics class, C+ and B+ in CS classes etc.) I have been completely burned out by zoom classes. My overall GPA is currently at a 3.7 but it used to be a 3.9 and it is only decent because I still have high grades in math, including rigorous honors courses. Before covid, I didn't know I wanted to pursue a PhD in mathematics but I started doing mathematical research a few months ago and found out that it is what I want to do with my life. But I have become increasingly worried about my declining performance during covid. I know that many PhD applicants have 4.0s overall and many more stellar qualifications from undergrad, so I am worried that I am nowhere near good enough at the moment. I guess I would like to know how lenient or strict PhD admissions are with online school grades.
Comment: There is very little experience. The first generation of applications who have been marginally affected have applied just now. So I think it is still too early for definite answers.
Comment: I agree with Maarten but as someone who regularly reviews grad school applications, I can say that I would probably pay more careful attention to letters of recommendation in this situation.  That said, grades outside of math aren't of primary importance, as Buffy says.
Answer: The nature of the question suggests that this is in the US, so I'll assume that.
If your lesser grades are outside your major (math) and you otherwise have a good/great application including stellar letters of recommendation, then I think grades elsewhere will matter very little. Given the pandemic, even less.
Don't worry too much about it, but make sure everything else is first class. You can't do anything about the past in any case.


Websafe encoding of hashed string in nodejs

Question: I am creating a re-director of sorts in nodejs. I have a few values like
userid // superid
these I would like to hash to prevent users from retrieving the url and faking someone else's url and also base64 encode to minimize the length of the url created.
http://myurl.com/~hashedtoken
where un-hashed hashtoken could be something like this
55q322q23
55 = userid
I thought about using crypto library like so:
crypto.createHash('md5').update("55q322q23").digest("base64");

which returns: u/mxNJQaSs2HYJ5wirEZOQ==
The problem here is that I have the / which is not considered websafe so I would like to strip the un-safe letters from the base64 list of letters, somehow. Any ideas about this or perhaps a better solution to the problem at hand?
Answer: You could use a so called URL safe variant of Base64. The most common variant, described in RFC 4648, uses - and _ instead of + and / respectively, and omits padding characters (=).
Most implementations of Base64 support this URL safe variant too, though if yours doesn't, it's easy enough to do manually.
Comment: I end up using urlsafe-base6 npm library for what you describe. I encode to base64(unsafe) then use library to encode to safe.
Answer: Here's what I used.  Comments welcome :-)
The important bit is buffer.toString('base64'), then URL-safeing that base64 string with a couple of replace()s.
function newId() {
  // Get random string with 20 bytes secure randomness
  var crypto = require('crypto');
  var id = crypto.randomBytes(20).toString('base64');
  // Make URL safe
  return id.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
}

Based on the implementation here.
Makes a string safe for URL's and local email addresses (before the @).


Calculating effective SSN (sunspot number)

Question: I am doing research on SSN-like parameters. As I can see, effective SSN is a parameter that is derived from SSN or other parameters. Do anyone know how to calculate effective SSN?
For example, this file has some parameters. See also this page.
Answer: The effective sunspot number $R_{\text{eff}}$ is calculated through a mix of observations and model calculations. It focuses primarily on some parameter called the frequency of the ionosphere F2 layer, denoted $\text{foF2}$, the highest frequency of electromagnetic radiation which can be reflected off the F2 layer; it can be observed as well as computed based on a certain model (real-time observational data from stations around the world is available here). More information on $\text{foF2}$ can be found on this page.
The mean-squared error between the observational value $\text{foF2}_{\text{obs}}$ and the calculated value $\text{foF2}_{\text{calc}}$ over observations by $n$ stations is
$$\Delta=\frac{1}{n}\sum_{i=1}^n\left(\text{foF2}_{\text{obs},i}-\text{foF2}_{\text{calc},i}\right)^2$$
where $_i$ denotes the value at station $i$. $R_\text{eff}$ is defined to be that chosen sunspot number such that $\Delta$ is minimized.
This is just an application of a least squares method to fit a model framework to match observations. An example of this using the Simplified Ionospheric Regional Model (SIRM) is Zolesi et al. (2004), although the procedure for calculating $R_\text{eff}$ was first proposed by Houminer et al. (1993). This was introduced to augment or replace something called the 12-month smoothed sunspot number, $R_{12}$, which is entirely based on observations. Zolesi et al. write

It is therefore expected that during periods of relative ionospheric quietness, when the observed $\text{foF2}$ value is much closer to the model predicted median values, the $R_{\text{eff}}$ does not differ much from the $R_{12}$. On the contrary, during periods of ionospheric activity, the $R_{\text{eff}}$ should have large difference form [sic] $R_{12}$.


Test equivalence of circuits exactly on qiskit

Question: I have two circuits that I believe are equivalent. When I say 'equivalent' I mean that they have equivalent unitary representations up to a global phase. How can one check this using Qiskit? How I would show equivalence isn't clear to me.
Answer: As it is point out, depends on your notion of equivalence.
State vectors
Two circuits are equivalent upto global phase if they represent the same state vector. Consider the following two circuits:
from qiskit import QuantumCircuit
import numpy as np

qc1 = QuantumCircuit(2)
qc1.h(0)
qc1.cx(0,1)

qc2 = QuantumCircuit(2)
qc2.u2(0, np.pi, 0)
qc2.cx(0,1)

It is possible to check if their state vector is the same with the Qiskit qiskit.quantum_info module:
from qiskit.quantum_info import Statevector
Statevector.from_instruction(qc1).equiv(Statevector.from_instruction(qc2)) # True

Unitary matrices
If you need to consider global phase, in that case you need to compare their unitary matrices via simulation.
In the following case:
qc1 = QuantumCircuit(1)
qc1.x(0)

qc2 = QuantumCircuit(1)
qc2.rx(np.pi, 0)

These circuit has the same state vector, but not the same unitary:
Statevector.from_instruction(qc1).equiv(Statevector.from_instruction(qc2))  # True

backend_sim = Aer.get_backend('unitary_simulator')
job_sim = execute([qc1, qc2], backend_sim)
result_sim = job_sim.result()
unitary1 = result_sim.get_unitary(qc1)
unitary2 = result_sim.get_unitary(qc2)

np.allclose(unitary1, unitary2)  # False

Counts
If your circuits have measurements, you probably want to consider these to circuits equivalent, since their measured results are equivalent.
qc1 = QuantumCircuit(2,2)
qc1.h(0)
qc1.measure(0,0)
qc1.measure(1,1)

qc2 = QuantumCircuit(2,2)
qc2.h(0)
qc2.swap(0,1)
qc2.measure(0,1)
qc2.measure(1,0)

In this case, you want to compare their result counts, considering some statistical error:
backend_sim = Aer.get_backend('qasm_simulator')
job_sim = execute([qc1, qc2], backend_sim, shots=1000)
result_sim = job_sim.result()
counts1 = result_sim.get_counts(qc1)
counts2 = result_sim.get_counts(qc2)
print(counts1, counts2)

Up to Ancillas
You might want to consider these two circuits equivalent:
qc1 = QuantumCircuit(3)
qc1.x(0)

qc2 = QuantumCircuit(1)
qc2.rx(np.pi, 0)

It was suggested to invert one of them, compose them (wiring the ancillas) and check if it is the identity. For example:
from qiskit.quantum_info import Operator

composed = qc1.compose(qc2.inverse(), qubits=range(len(qc2.qubits)))
Operator(composed).equiv(Operator.from_label('I'*len(qc1.qubits))) # True

Comment: Actually the statevector is not enough. You need to show the unitaries corresponding to the circuits are the same. This check must take into account That there could be a global phase difference that may or may not matter depending on if you are later going to control the circuit.  if the circuits are the same up to swap mapping then you need to check for equivalence up to a one sided permutation. If the qubit orderings are different than there is also a row and column permutation to deal with.

In the case above one can simply use the definition of unitary to verify equiv up to phase.
Comment: A couple of comments:  1) You may want to compute the unitary of the first circuit concatenated with the inverse of the second circuit, and check if it's the identity. Simiarly can also be done for the state vector.  2) There is a notion of equivalent circuits with a different number of qubits (for example because of ancilla qubits), which may make this somewhat more complex.
Comment: Also note that there's a difference between comparing the unitary and comparing the single outcome on the |0> state - the former verifies the circuits produce the same outcome for every input, not just |0>, which is similar to our usual notions of "equivalance"; but if you only want output on |0> unitary is overkill in terms of runtime and you can deduce the phase difference from two nonzero entries in the statevectors.
Comment: Generally, the statevector is not the same because there is a global phase. For example, I tried using a circuit with only 1 qubit. Let the circuit be obtained through `circ.x(0)` and `circ.rx(numpy.pi, 0)` and this solution fails due to numerical error (there is a $10^{-17}$ somewhere and a phase error)
Comment: I updated the answer with unitary matrices and one example considering swap.

@JasonFring, if you want to add tolerance for floating point errors when checking for equivalence, `equiv` allows you to set relative (`rtol`) and absolute (`atol`) tolerance values for comparison.
Comment: Thank you for detailed answer!
Comment: I included "up to ancilla", based on [the comment from @YaelBen-Haim](https://quantumcomputing.stackexchange.com/questions/13723/test-equivalence-of-circuits-exactly-on-qiskit/13724#comment18456_13724)
Answer: A simpler method is to use equiv method directly from the Operator class. Basically convert both the circuits to operators and then use equiv. You can check out the documentation for the Operator class here.
The basic syntax would be something like,
from qiskit import *
from qiskit.quantum_info import Operator

Op1 = Operator(qc1)
Op2 = Operator(qc2)

Op1.equiv(Op2)

Where qc1 and qc2 are your two quantum circuits.
Comment: simple and straight to the point! good answer.
Comment: Does this answer ignore the overall phase?


How to determine if Linux OS is on virtual hardware or physical hardware?

Question: From a Linux OS, is there a way to determine if the OS is running as a guest OS on a virtualized VMware environment as opposed to running directly on non-virtualized/bare metal/physical host?  In my case it is either VMware or not, but I am also interested the more general question of whether the OS is on physical hardware or virtualized hardware of any sort.
Comment: Use the "virt-what" command.
Answer: In VMware:
# dmidecode --string system-product-name
VMware Virtual Platform

In Virtualbox same command outputs VirtualBox
Answer: On newer systems, the command "lscpu" give's you the information you need, inclusive which hypervisor the VM is running on.
Comment: This seems to work for newer versions showing the "Hypervisor vendor:" entry when a hypervisor is present, but doesn't work for older versions that don't have lscpu such as RHEL 5.
Answer: You can look at the output of the following:

virt-what
cat /proc/cpuinfo
dmidecode
lspci
lshw
hwinfo

Any of these will print various things that should point to if and what virtualisation-platform is being used.


Fixed point vs Floating point number

Question: I just can't understand fixed point and floating point numbers due to hard to read definitions about them all over Google. But none that I have read provide a simple enough explanation of what they really are. Can I get a plain definition with example?
Comment: I think this is a relevant discussion (especially describing the traps with floating numbers and the better precision with fixed point and why you'd never want to descibe money as a float. http://stackoverflow.com/questions/6320209/javawhy-should-we-use-bigdecimal-instead-of-double-in-the-real-world
Comment: I am also having trouble finding a good definition. The main thing I'm looking for is something to help me understand these results: 3.11 + 42.0 = 45.110001 (not 45.11), 3.12 + 42.0 = 45.119999 (not 45.12), 3.15 + 42.0 = 45.150002 (not 45.15).
Comment: [Random link where the topics are mentioned](https://www.khronos.org/opengles/) "OpenGL® ES OpenGL ES includes **profiles for floating-point and fixed-point systems** and the EGL™ specification..."
Comment: why have you not accepted an answer? what is missing for you? want place a bounty to fill in the missing knowledge you need?
Answer: A fixed point number has a specific number of bits (or digits) reserved for the integer part (the part to the left of the decimal point) and a specific number of bits reserved for the fractional part (the part to the right of the decimal point). No matter how large or small your number is, it will always use the same number of bits for each portion. For example, if your fixed point format was in decimal IIIII.FFFFF then the largest number you could represent would be 99999.99999 and the smallest non-zero number would be 00000.00001. Every bit of code that processes such numbers has to have built-in knowledge of where the decimal point is.
A floating point number does not reserve a specific number of bits for the integer part or the fractional part. Instead it reserves a certain number of bits for the number (called the mantissa or significand) and a certain number of bits to say where within that number the decimal place sits (called the exponent). So a floating point number that took up 10 digits with 2 digits reserved for the exponent might represent a largest value of 9.9999999e+50 and a smallest non-zero value of 0.0000001e-49.
Comment: @BrianGordon: I didn't forget sign bits; I intentionally ignored them in order to have a **simple** description and not have to worry about the difference between minimum/maximum and smallest/largest. I also intentionally left out exponent biasing (which has nothing to do with the number of discrete values between any two numbers), NaNs, infinities, normalizing, gradual underflow, signed zeroes, the fact that most floats are binary (which allows the first bit of the mantissa to be left out), and a number of other aspects that are unnecessary to illustrate the concept.
Comment: Well you're forgetting that floating point numbers are almost always signed, so the minimum value would really be `-9.9999999e+50`.
Comment: @zer0uno: The key is that the answer said 10 *digits*, rather than 10 *bits*, as many folks familiar with computer arithmetic might expect. After discussing binary representations, the answer switched to examples that were all in decimal. So 9.9999999+e50 is 1 digit for the 9, 7 for the 9999999, and 2 for the 50, for a total of (1 + 7 + 2 =) 10.
Comment: Also there is exponent biasing so that you can represent vastly more discrete values between 0 and 1 than you can between 1,000,000 and 1,000,001. And there are lots of complications with floating point operations which come up, like ensuring you don't report 0 as the difference between two very similar numbers when the bias isn't enough to increase precision.
Comment: @NickMiller: Sorry for the confusion, but I was talking about non-zero numbers. My example format can represent 0, 0.00001, 0.00002, ..., 99999.99998, 99999.99999.
Comment: Why is the cutoff for the minimum number of fixed-point `00000.00001`?  I'm expecting to see `00000.00000` instead.  Also, do you have any references that go into more detail about fixed-point numbers?
Comment: Can anyone explain how he got `9.9999999e+50` and `0.0000001e-49` with a floating-point of 10 bits?
Comment: @CharlieParker, 2 digits is enough for 100 different exponents (-49 to 50). If you had 2 digits *plus* a sign bit, you could have 200 different exponents (-99 to 100), but I intentionally excluded sign bits from my description to simplify things.
Comment: I'm confused...if you have 2 digits for the exponent, then why is it not `e+99` and `e-99` as the limit for your examples?
Comment: Oh, I was confusing exponent biasing with normalizing
Comment: @Gabe , I understand the smallest, but why largest number is not 99999999e+50 ? Why you put a . to make number 9.9999999?
Answer: A fixed point number just means that there are a fixed number of digits after the decimal point.  A floating point number allows for a varying number of digits after the decimal point.
For example, if you have a way of storing numbers that requires exactly four digits after the decimal point, then it is fixed point.  Without that restriction it is floating point.
Often, when fixed point is used, the programmer actually uses an integer and then makes the assumption that some of the digits are beyond the decimal point.  For example, I might want to keep two digits of precision, so a value of 100 means actually means 1.00, 101 means 1.01, 12345 means 123.45, etc.
Floating point numbers are more general purpose because they can represent very small or very large numbers in the same way, but there is a small penalty in having to have extra storage for where the decimal place goes.
Comment: floating point usage becomes a problem when you start doing calculations with them like for instance if you add a really small and a really large floating point number together. The summed result loses accuracy since it has to represent a number with two extremes and the lower decimals get trimmed off (and aren't rounded).
Comment: also the potential use of exponent values in a floating point can cause issues with computer systems expecting standard numbers
Answer: From my understanding, fixed-point arithmetic is done using integers. where the decimal part is stored in a fixed amount of bits, or the number is multiplied by how many digits of decimal precision is needed.
For example, If the number 12.34 needs to be stored and we only need two digits of precision after the decimal point, the number is multiplied by 100 to get 1234. When performing math on this number, we'd use this rule set. Adding 5620 or 56.20 to this number would yield 6854 in data or 68.54.
If we want to calculate the decimal part of a fixed-point number, we use the modulo (%) operand.
12.34 (pseudocode):
v1 = 1234 / 100 // get the whole number
v2 = 1234 % 100 // get the decimal number (100ths of a whole).
print v1 + "." + v2 // "12.34"

Floating point numbers are a completely different story in programming. The current standard for floating point numbers use something like 23 bits for the data of the number, 8 bits for the exponent, and 1 but for sign. See this Wikipedia link for more information on this.
Answer: The term 'fixed point' refers to the corresponding manner in which numbers are represented, with a fixed number of digits after, and sometimes before, the decimal point.
With floating-point representation, the placement of the decimal point can 'float' relative to the significant digits of the number.
For example, a fixed-point representation with a uniform decimal point placement convention can represent the numbers 123.45, 1234.56, 12345.67, etc, whereas a floating-point representation could in addition represent 1.234567, 123456.7, 0.00001234567, 1234567000000000, etc.
Answer: There's very little mention of what I consider the defining feature of fixed point numbers. The key difference is that floating-point numbers have a constant relative (percent) error caused by rounding or truncating. Fixed-point numbers have constant absolute error.
With 64-bit floats, you can be sure that the answer to x+y will never be off by more than 1 bit, but how big is a bit? Well, it depends on x and y -- if the exponent is equal to 10, then rounding off the last bit represents an error of 2^10=1024, but if the exponent is 0, then rounding off a bit is an error of 2^0=1.
With fixed point numbers, a bit always represents the same amount. For example, if we have 32 bits before the decimal point and 32 after, that means truncation errors will always change the answer by 2^-32 at most. This is great if you're working with numbers that are all about equal to 1, which gain a lot of precision, but bad if you're working with numbers that have different units--who cares if you calculate a distance of a googol meters, then end up with an error of 2^-32 meters?
In general, floating-point lets you represent much larger numbers, but the cost is higher (absolute) error for medium-sized numbers. Fixed points get better accuracy if you know how big of a number you'll have to represent ahead of time, so that you can put the decimal exactly where you want it for maximum accuracy. But if you don't know what units you're working with, floats are a better choice, because they represent a wide range with an accuracy that's good enough.
Answer: It is CREATED, that fixed-point numbers don't only have some Fixed number of decimals after point (digits) but are mathematically represented in negative powers. Very good for mechanical calculators:
e.g, the price of smth is USD 23.37 (Q=2 digits after the point. ) The machine knows where the point is supposed to be!
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: Take the number 123.456789

As an integer, this number would be 123
As a fixed point (2), this
number would be 123.46 (Assuming you rounded it up)
As a floating point, this number would be 123.456789

Floating point lets you represent most every number with a great deal of precision.  Fixed is less precise, but simpler for the computer..
Comment: The precision with which you can write a number is not related to whether it's written in floating point, integer or fixed point. It's related to the number of significant digits you have available. For an example, INT_MAX is a number that can be exactly represented as an int, but not as a float because they don't have the 31 bits of precision needed to exactly represent it.
Comment: fixed is the most precise as long as its sized to handle the number in question. When you do math with fixed point numbers, rounding occurs when a calculation has a remainder exceeding the decimal limit. With a floating point you can get a very inaccurate value if you add a very small number with a very large one. When that occurs digits are lost without rounding
Comment: This is misleading and wrong. Fixed point means that the number of digits after the decimal point is fixed. It says nothing about how much precision it has.

Fixed point vs Floating point number


Can we end a callback function in Jquery from outside the function

Question: I am using the time-ticker function by David Walsh. I did manage to return false from within the callback function, whenever I had to create a new instance, and wrote a new instance altogether. But it would be far more clean code if I could somehow update the call back function form within. Please let me know, even if it is something more general. Thanks in advance :)
Answer: You can supply whatever callback you like... it is one of the settings - so if you wanted to end the callback, you just need to return out of it.
<code>$('#countdown').countDown({
    startNumber: 10,
    callBack: function(me) {
        $(me).text('All done! This is where you give the reward!').css('color','#090');
        alert("You can do anything here");
        // Including calling another function
        DoSomething();
        return false;
    }
});
</code>


How do I install Cyanogenmod 11 on a Samsung Galaxy Tab 2 (GT-P5113)?

Question: I'd like to install Cyanogenmod 11 on a Samsung Galaxy Tab 2 (GT-P5113), is this currently possible? I see the Rom shows up in Cyanogenmod's Updater.
Answer: Update
Previously it wasn't possible.

In short, the previously used set_perms method was deprecated and replaced by set_metadata. Unfortunately, most of available recoveries didn't allow users to flash these packages properly, and this has resulted in the following error message: set_metadata_recursive: some changes failed

But now all major recoveries support set_metadata_recursive. Just use a version of TWRP newer than 2.7.0
What I did was boot into Download Mode:

Shut down the tablet.
Unplug the USB.
Hold Volume Up and Power.
Let go of both after it boots and you see it is in Download Mode.
Plug in USB.

Flash it into the RECOVERY partition,
heimdall flash --RECOVERY twrp-3.1.1-0-whatever.img --no-reboot

Now when you boot into Recovery Mode and you're in TWRP you'll see the option to flash the CM11 .zip, or adb sideload it, which is what I did.
Comment: The link to "PhilZ-NON-Touch-Recovery_6_(Advanced-CWM).tar.md5" is dead
Comment: @naXa updated now


See a user's reputation *without* daily cap

Question: Is there a way to see what a user's total reputation would be if, hypothetically, there was never a daily rep cap?
Answer: There is a data explorer query that can calculate this based on a user's id.
How much rep would I have if there were no rep cap?
Comment: I managed to grab 5 different queries for this purpose but managed to overlook the one that gave exactly what was needed. Figures, and "rep no cap" doesn't even yield this in a search...
Comment: Ah, I searched for "rep cap". (:
Comment: That said, the query is suspect. It claims my rep on Stack Overflow would be 1608, but I've never even been capped and my rep is 1466.
Comment: @GraceNote, Huh, so what isn't it handling I wonder?
Comment: @GraceNote, it won't be able to count the -1 on downvotes you cast, but from your profile, that isn't it.
Comment: I'm not an SQL expert, but from a quick glance at the query it doesn't differentiate between question upvotes and answer upvotes. And, consequently, the +2 for acceptance. It may need some major tweaking, perhaps with the aid of [this query](http://data.stackexchange.com/stackoverflow/s/683/top-rated-users-if-there-was-no-reputation-cap) or [this query](http://data.stackexchange.com/stackoverflow/s/872/top-rated-users-without-lost-reputation).
Comment: @GraceNote Oy, true.  I just took a cursory glance. q:
Comment: It also doesn't count bounties and doesn't appear to differentiate between wiki posts and regular posts.
Comment: @Pollyanna, it does check the OwnerId and CommunityOwnedDate.  Everything else I didn't catch I blame on not having had caffeine yet this morning!
Answer: No, there isn't, but Jeff once said in a blog post that Jon Skeet would have over 60,000 reputation without a cap.
And this was over 2 years ago.
Comment: I recently read that post, which is actually what prompted me to ask this.  Jon is currently at > a quarter million, which made me wonder what it would be today.  Oh well, thanks for the answer.
Comment: @Adam Jon Skeet would be at a whopping 750,000 points without the rep cap.
Comment: Yeah - I saw.  If anything I'm surprised it's not over a million with the way his answers are (justifiably) upvoted.


Connect a pressure sensor with Raspberry Pi 2

Question: I have a normal 3 line (V,GND,SIG) Analog pressure sensor and I want to connect and read data using Raspberry Pi GPIO. Can anyone help with a Python code?

ebay link
Comment: What is a standard pressure sensor? Similar looking sensors or those with the same number of wires can be very different when it comes to interface and software. Is that a digital sensor? Please edit your question and add a link to the datasheet and a link to where you purchased it.
Comment: "Normal analog pressure sensor" is meaningless. Does the device have  part number? Further, just because a device is "analog" does not necessarily tell us anything about its interface. This could well be an analog device (i.e. it reads pressure) with a digital interface. Equally, it could be a digital device (i.e. tells us when a particular setpoint has been achieved) but not give any indication of what the pressure is.
Answer: Raspberry pi does not have any Analog input so you will need an external ADC.
Your sensor is 5V, so go with a 5V torrent ADC. you can use ADS1115 because it has 4 ADC channels so you can connect upto 4 sensor to one board. it has inbuilt voltage ref so you dont need any external Vref. its a 16 bit ADC so your readings will be highly accurate. it also has gain multiplier. its input are 5V torrent.
You can find the python code for ADC ADS1115 over here
if you are looking for video tutorial for connecting an ADC with raspberry pi please check over here. interfacing ADC with raspberry Pi
Answer: You are going to have a few problems with the Pi. These problems are not insurmountable.

The first is the Pi does not have any analog inputs.
Second the sensor requires 5V as input and the Pi operates at 3.3V and will not tolerate 5V.

This tutorial on reading analog values with an ADC an the PI includes Python code.
You will also need a way to convert the 5V sensor to 3.3V for the Pi (e.g. logic level shifter, a voltage divider etc.) This related question will have some additional specifics.
Answer: While the OP probably figured out a solution, I stumbled across this question on my own search for how to get meaningful readings out of what I think is the same sensor. I am hoping this info may help others.
I'm not sure who the actual manufacturer is but LOTS of people sell the same sensor under various brands for water and fuel applications with a working range of 0 to 1.2 mPa (approximately 0 - 175 psi). The reason I suspect it is the same is that the product photo is identical to the manufacturer photo used by some of the suppliers.
It is indeed an analog device and as mentioned previously requires an A/D converter to work with the RPi. The 5v nature of the device is not a concern since the ADC merely provides a numeric value to the RPi via spi or i2c representing the voltage. Most ADCs accept up to 5V in. Some ADCs allow you to switch the VCC from 5v to 3.3v if you want to be consistent with the RPi and avoid problems in case you accidentally connect it to the RPi directly.
However, the output of the device is really just a function of voltage in and you can also run in on 3.3v if it makes you feel more comfortable.
All that said, similar-looking sensors run at also much lower pressures (0-10 psi, for instance) and their performance will be very different. Regardless it is necessary to locate the vendor-specific piece of info for your device that explains the transfer function.
In the case of what I think is this sensor, the function is Vout = Vcc(.66667 * P + .1)
This info is also embedded in a few python examples that are floating around out there for reading this sensor.
For example, at 100psi (.69 mPa) and 5v Vcc, you should see something like:
5 * (.66667 * .69 + .1) = 2.8v
Note that if you used 3.3v as Vcc you would get something more like 1.848v out reported to your ADC.
Note that both the constants ".66667" and ".1" can also be thought of as a voltage bias that may vary depending on whether a pull-up, pull-down, or current limiting resistor is used; some ADC modules provide this circuitry built-in and already account for it.
If you bought a naked ADC such as the 16 channel PI-16ADC, you may have done so externally, although pull up/down resistors are probably not needed for this device in most applications. You may need to fiddle with these numbers and compare them to a known pressure reference. Note that the curve is at least linear ;)


Is 'hawala' and Bitcoin similar?

Question: Hawala is an old indian/middle east , money transaction system , based on mutual trust, and uses an encryption system based on spoken keycodes.How is it similar to bitcoin transaction system?
Answer: The major difference is, while Hawala means trust, Bitcoin does not depend on trust. Everything is made of cryptographical signatures, making it 100%** safe, while Hawala cannot / may not be trusted.

** Two exceptions: 1) Majority of hashrate is attacking the network. See this 2) The theoretically possible, but practically impossible hash collisions. It doesn't happens, while the theoretical safety isn't 100%, rather 99.999999999...%
Comment: 100% safe !what do you mean? Its a very well known fact that un hackable software/programs never exist, how do you say Bitcoin is protected then?
Comment: If there are multiple node implementations and if none of them has 50% of the network, as they're implemented by different developers, there won't be a bug that affects all of them and even if the a node software crashes, the other nodes will stay work and network will stay safe.
Comment: And the private keys can be cracked if some people manage to build a 1500 qubit quantum computer in far future. @Quantumkiller
Comment: great ,thanks @MCCCS  i heard 1000 qubit computers are on the cards!
Comment: @Quantumkiller Last paragraph: https://bitcoin.stackexchange.com/a/57977/38618 I also heard that the 1000 qubit quantum computer exist now, but do you know why they work on both the 50 qubits one and the 1000 qubits one at the same time? I heard that the 1000 qubit one is a special qcomputer that can do only a few things. Even if the qcomputers are able to break ECDSA (private key- address system) your money is safe as long as you avoid address reuse (if RIPEMD is still not cracked). More info here: https://en.bitcoin.it/wiki/Quantum_computing_and_Bitcoin
Comment: @Quantumkiller https://www.reddit.com/r/btc/comments/70v78b/cryptography_as_we_know_it_will_be_completely/dn64cfn/

Is 'hawala' and Bitcoin similar?


Run Java in a chrooted jail

Question: I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh.
I managed to let him use some basic non chroot standard command like chmod or ps.
NOW what I need to do to let him use java to run his own compiled jar inside his new shiny jail?
Comment: The complete Java runtime needs also to be located in the chroot path.
Comment: and it's possible or just crazy stuff to do? Can I also install a dedicated Java machine just inside the chroot dir or...?
Comment: it is possible and not easy.
Answer: Do not use chroot().  Use OpenVZ.  OpenVZ is chroot on steroids: Not only does OpenVZ give a container its own root directory, it also gives a container its own init() process, its own process list, its own IP, its own memory and disk space quota, etc.

http://openvz.org/Quick_installation
Once OpenVZ is installed, go to /vz/template/cache and download a CentOS template: wget http://ftp.openvz.org/template/precreated/centos-6-x86-devel.tar.gz
Now: vzctl create 100 --ostemplate centos-6-x86-devel
Then: vzctl set 100 --ipadd 192.168.1.99 --save Change 192.168.1.99 to a static IP that will work on your network
vzctl set 100 --nameserver 184.108.40.206 --save Use one of Google's free DNS servers
vzctl start 100
vzctl enter 100
At the root prompt in the new container: yum -y update
Install Java in the new container: yum install java-1.6.0-openjdk-devel.i686
Make a user and password/SSH key for the container so your buddy can play with Java: adduser buddy followed by passwd buddy (replace "buddy" with any name you wish to use here)
Make sure the container is running sshd so he can SSH in to the container.
Make sure there is a way for him to get in to your computer.

The big gotcha here is that you will need to have full access to the machine in question and the computer will need to be on a network where you can assign a different IP for each container.  Another gotcha is that the container will use about a gig of hard disk space -- more if your buddy makes a lot of files in the container.  If the machine in question is a machine in a hosting environment, make sure the AUP you have allows you to run OpenVZ and other virtualization technologies (some hosting providers do not permit this).
Comment: This sounds like a solution ;) Many thanks!!

Run Java in a chrooted jail


What code book do I refer to to find the proper repair for a broken wooden floor joist in Arkansas?

Question: The sister joist was not installed properly and the floor is sagging; trying to convince boss it is truly an issue that simply "hitting the sister joist with a sledge hammer" won't fix..please send me in the right direction.  Need to be able to quote something more official than my opinion that the floor needs to be looked at by a structural engineer or, at the very least, the floor jacked back up and the joist replaced.
Comment: I don't know about your state, but it is legal in mine to sister a joist. For the repair to be done correctly sometimes the pair need to be jacked up. Depending on the span and the location of the break I might use through bolts, but many times in the past have used screws and nails with no problems as long as the sistered joist is long enough to pick up the load.
Answer: I don't live in Arkansas, but Google says your building department uses the 2006 International Building Code (IBC) with amendments. (Amendments are added to all building codes by the local Building Codes Division in each state to reflect local conditions, etc.)
You say it's a "home" so the "loading requirements" are usually somewhat less than commercial or industrial loading. So, if the joist failed, (you didn't say how it failed,) then you need to investigate the "why", because this is fairly uncommon...especially if it's one joist in a series of "like joists".
While the Building Code states a "Uniform Load" be applied throughout the house, we'll often add a joist or two under refrigerators, spa tubs, etc. because we know there's an extra load in those areas.
I think Ed Beal is correct that you can sister a joist on each side of the failed joist and fix the problem. However, I'd recommend you find the cause. If you suspect all the joists in this area are undersized, then you need to have it reviewed. Here where I live, you could call the local Building department and tell them the "span" and the "spacing" and they'd let you know if it meets code. If it's an engineered joist, you can call the manufacturer's rep and he can tell you.


King David`s Successor

Question: Before Solomon was born, who was to become king? David has other sons so if Solomon had not been born, who would have been the heir? Would it be one of the sons who were killed?
Comment: Welcome to Christianity Stack Exchange.  Do not forget to take the tour below.  This question would probably be better posed on Biblical Hermeneutics Stack Exchange.
Answer: If Solomon had not been born, obviously another son would have become king.  After David sinned with Bathsheba and was told an ingenious parable by the prophet Nathan, David pronounced his own judgement by saying that such a person must pay four times for this crime (2 Sam 12:6).  Thus, David had the following sons die:

The son from Bathsheba's first pregnancy (2 Sam 12:18)
David's eldest son and the one most likely to have succeeded as king, Amnon (2 Sam 13), if David had not decided to appoint Solomon as heir (1 Kings 1:29, 30).
David's next son, Absalom (2 Sam 15-17)
David's next son, Adonijah (1 Kings 1:1-52, 2:13-25)

This is somewhat academic, as David had made it quite clear who was to succeed him (1 Kings 1:29, 30).  It was the reigning kings prerogative to appoint his chosen heir which was often (but not always) the eldest son.  [Note the important example of this where Jacob chose Judah over Reuben as his primary heir, from whom came King David himself.]
Answer: David did not take it for granted that one of his sons would become king after him. This is because he knew that God chose him (and not any of Saul's sons) to become king of Israel after Saul. It was the prophet Nathan who conveyed that David's descendant would be king after him.
Quoting 2 Samuel 7:12, from the prophecy  of Nathan,

"When your days are complete and you lie down with your fathers, I will raise up your descendant after you, who will come forth from you, and I will establish his kingdom.

Nathan gave this prophecy when David was considering building a temple for the LORD (see 2 Samuel 7:1-4).
And David seemed to be surprised and very grateful that the LORD had chosen one of his descendants to be king after him.
2 Samuel 7:18, 19:

Then David the king went in and sat before the LORD, and he said, "Who am I, O Lord GOD, and what is my house, that You have brought me this far?
"And yet this was insignificant in Your eyes, O Lord GOD, for You have spoken also of the house of Your servant concerning the distant future And this is the custom of man,         O Lord GOD.

At this point of time, David already had many sons and among them were Ammon, Absalom and Adonijah who were the first, second and third in line to the throne respectively.
But the prophecy (verse 12) said, "who will come forth from you". So it was not going to be any of them. And David knew that it would be one born after the prophecy was made who would be the king.
So if not for Solomon, David would have chosen one born after the prophecy was given to be his successor.
Answer: Throughout his reign, David was surrounded by enemies, schemers and plotters, including his own sons. The first three sons died. Adonijah was to succeed David, until his plot to overthow his father was uncovered. Taken from 2 Samuel 3:2-5 are the names of the sons born to David in Hebron:

Amnon the son of Ahinoam of Jezreel (David's wife) – raped his half-sister Tamar – killed by Absolom
Kileab the son of Abigail the widow of Nabal of Carmel (David's wife) – no further mention of him in the Bible except Kileab is called Daniel in 1 Chronicles 3:1 – it is supposed he died
Absolom the son of Maacah daughter of Talmai king of Geshur (David's wife) – killed by Joab but against David's wishes
Adonijah the son of Haggith – tried to steal the throne from David so David gave Solomon the throne instead

Adonijah had already attempted to set himself up as king while David was still alive; when David was notified of the plot, he quickly made Solomon's kingship official (1 Kings 1:28–40).
Nathan the prophet was instrumental in having Solomon succeed David after Adonijah tried to take the throne for himself. Nathan said Solomon was to be called Jedidiah which means "Loved by Yahweh" or "beloved of the LORD" (2 Samuel 12:24-25). The giving of this name suggests that the Lord's special favour rested on Solomon from his birth and that is why Solomon became King of the United Kingdom.  It was God's will.

King David`s Successor


Difference between "transparent" and "translucent"

Question: What's the difference between transparent and translucent? I am trying to describe this record pressing.
Comment: There's some discussion of the difference between transparent and translucent in this answer, but it isn't conclusive http://english.stackexchange.com/a/4308/4915
Comment: remark that transparent can be used more abstractly (as in, "a transparent idea"), but it would be more awkward to do the same with translucent.
Comment: What does the dictionary tell you? What's unclear about what it says?
Answer: Generally transparent means light goes through undisturbed and so makes an image, while translucent allows light through but not an image (e.g. frosted glass).
Answer: These are both Latin words, and the etymologies help here.

trans simply means through
lūceō simply means to shine

So translucent means 'shining through' -- i.e, light passes through, though nothing is said about an image.

pāreō means to look, seem or appear; to think (of); to sound (like)

So transparent clearly refers to identifiable images, most likely visual (hence implying light), but also any sensory percept involving a mental image, as in a transparent lie.
Since transparent usually entails light passing through a substance, translucent has become specialized in its sense to entail light passing, but no image.
Answer: Something that is transparent lets all light through without distorting the image -- it is as if the transparent object were not even there, visually speaking.  Something that is translucent lets some but not all light through.  Something that is opaque lets no light through.
Something that is translucent could be anywhere between transparent and opaque; that's a pretty broad range.
Possibly more than you wanted to know on the subject can be found at Wikipedia.
Answer: To make it easier to differentiate, translucent = semi transparent.
Answer: Technically speaking translucent is semi-transparent. As simple as that. But translucent is only a technical term while transparent may be used figuratively i.e. something which is evident, clearly seen or understood. "Transparent policy, accounting etc."


Buying CAD with USD

Question: We'll be driving from the US via Vermont into Quebec, headed to Trois-Rivieres, Quebec.  What's our best strategy for buying Canadian dollars?
Comment: Can you use a card in an ATM? And have you asked your bank (or checked their website) what costs they charge? I have always found it cheaper to use ATM's  and you can hold some US dollars for emergencies.
Comment: Aside: a notice recently seen on a street food stall said "card payments only". That is the way things are going.
Comment: @WeatherVane seen at a US restaurant in the 1990s: we accept all cards, even cash
Answer: Pretty much any ATM will give you a fair rate. There are two dominant networks, Maestro and Cirrus, so you will be able to withdraw from most Canadian ATMs. There is usually a foreign exchange fee plus a foreign network fee. The exact amount charged depends on the agreement between you bank and the ones in Canada but usually withdrawing larger amount is advantageous since the foreign network fee becomes a relatively smaller percentage. You can stop at currency exchange places but converting to CAD from USD, you are unlikely to get a better rate than at the ATM.
Comment: and in fact most ATMs will support both Maestro and Cirrus.

Buying CAD with USD


Can a Paladin use his Mercies with Channel Positive Energy?

Question: Anyone that gets a Lay on hands from a Paladin also gets all the effects of the Paladin's Mercies. As the Channel Positive Energy uses two lay on hands do they also get the effects of the Mercies?
Answer: NO.
Quote from Pathfinder SRD:

Whenever the paladin uses lay on hands to heal damage to one target, the target also receives the additional effects from all of the mercies possessed by the paladin.

Using lay on hands to channel energy is clearly not the case.
Comment: Agreed, and as a broader rule, using resource X, normally used for Y, to do Z, is still not doing Y, and therefore doesn't qualify for bonuses/penalties associated with doing Y.
Comment: @Melon Even broader, anything that says, "The rules say I can do Thing X, does that mean I can also do (largely unrelated) Thing Y?", the answer is always "No." Possible duplicates: half the questions on this site.


Windows 10 Education after finishing school

Question: What happens if I have a Windows 10 Education license on my PC and I finish school? Does my Windows detect that I am no longer a student? Are there any drawbacks after finishing scool? Or can I use seamlessly my computer for years without any problem?
Comment: Microsoft offers _tons_ of different licenses and license terms, and continually tunes the technical enforcement (activation etc.) of those terms. So you should probably ask your school about this - they are the only ones who know (hopefully) what the license terms are (and the consequences of violation).
Answer: The EULA of DreamSpark says the following when ordering your free products.

TERMS FOR DREAMSPARK DIRECT SUBSCRIPTION.
a.    DreamSpark Direct Subscription. Subject to the terms of this agreement, the DreamSpark Direct Subscription provides a subscription to access software. Microsoft may change the software or other offerings that it makes available under the DreamSpark Direct Subscription at any time without prior notice to you.
b.    End of Student Status. The DreamSpark Direct Subscription is a special offering for students. Once you no longer qualify for the DreamSpark Direct Subscription (due to graduation or otherwise no longer meeting the definition of "you" above), your DreamSpark Direct Subscription will terminate; however, you may continue to use the software you obtained prior to termination of your student status subject to the terms of this agreement.
c.   Termination. Microsoft may terminate the entire DreamSpark program or your specific DreamSpark Direct Subscription at any time without prior notice to you for any reason or no reason.
Answer: It is simply one of the many versions of Windows. Windows 10 Education is for both students and faculty. Its designed for increased security and ease of deployment. Unlike Office 365, the license does not require renewing. You should check with your school as there may be specific licensing restrictions you agreed to as a student.

Windows 10 Education is available exclusively for academic customers
  in Volume Licensing programs. Windows 10 Education includes features
  from Windows 10 Enterprise that are ideal for advanced security and
  the comprehensive device control and management needs of today's
  educational institutions. Windows 10 Education also enables simplified
  deployment with a direct path for many devices to upgrade from Windows
  10 Home or Windows 10 Pro. MDOP is included to help institutions
  manage their IT environments.

source PDF


How to wait for vBlank on Commodore 64

Question: I'm not new to 6502 Assembly but I am new to the Commodore 64. I'm used to the NES where you have to write everything yourself, such as the NMI/RESET/IRQ vectors, etc, but from what I understand the BIOS takes care of all that for you. If I'm programming a disk image program on the c64, how can I wait for vBlank? I'm trying to figure out how to slow down an animation. This question isn't about the built-in Commodore BASIC, I'm not using that at the moment.
Comment: (1) Ask Godot to watch the vBlank. (2) Wait for Godot.
Comment: Have you read any C64 graphics programming tutorials yet?
Comment: BIOS? KERNAL. As long as you haven't paged it out.
Comment: Have a read of https://www.c64-wiki.com/wiki/Raster_interrupt It will tell you how to raise an interrupt based on the screen rastering
Answer:
I'm used to the NES where you have to write everything yourself, such as the NMI/RESET/IRQ vectors, etc, but from what I understand the BIOS takes care of all that for you

The "BIOS" in the Commodore 64 is the Kernal.  The Kernal does handle IRQs and NMIs, but before it does, it indirect jumps through a RAM vector (different than the hardware 6502 vectors in the upper 6 bytes of ROM), so you can hook in your own routine.
Unlike the NES, the VIC video chip does not generate an NMI on each frame.  It can generate an IRQ but this is not enabled by default.
There's quite a few things that can generate IRQs and NMIs on the C64.  The usual situation: IRQs on the C64 are normally driven by the CIA 1 timer (CIA 2 generates NMIs) which is set by the Kernal on power up to fire every 1/60th of a second.  The background tasks done are updating the jiffy timer and scanning the keyboard.
You can turn that off and switch to the VIC though.
Having the VIC generate IRQs is very useful for games to sync for VBlank, so what you need to do is:

SEI

Update RAM vector ($0314-$0315 - look for CINV in the Commodore 64 Programmer's Reference Guide) to your IRQ routine.

At the time the ROM does its JMP ($0314), it has saved the registers on the stack and established that the IRQ is not caused due to the BRK instruction.

Keep the old value (which is probably $FF48) because your IRQ routine should jump to it when yours is done.  That will take care of restoring CPU context back to pre-IRQ state.

Then

Disable CIA 1 interrupts by writing 0 to it's interrupt enable bit.

Program the VIC register that tells which scanline to trigger the IRQ on.

Write to the VIC interrupt enable bit.

Example code for all that here.

CLI

Also, in your IRQ routine you need to acknowledge the VIC's IRQ by writing to $D019 - towards the end of your IRQ routine might be best.  VIC won't generate another IRQ until you do that.  The linked example above explains.
The CIA needs it's IRQ acknowledged too - keep in mind the Kernal will still write to $D0CD to do that, but will be harmless since it's ability to generate IRQs is disabled.
Something to keep in mind - you could hook into the IRQ, not disable the CIA, then implement this logic in your handler:

check the IRQ flag on the VIC

if VIC caused IRQ

do what you want to do during VBlank.

check CIA IRQ flag, and if set, JMP to $FF48 [might be needed in case CIA and VIC try to IRQ at or near the same time]

either way after checking JMP to $EA81--point in Kernal ROM that simply restores registers and RTI (CIA did not cause IRQ).

else

JMP to $FF48 for normal IRQ processing (CIA caused IRQ).

If you want to do it NES style that's the general process.
Comment: If one doesn't mind having to write different code for different models of C64, using the CIA may in some cases be superior to using the 6502.  Among other things, the CIA would allow code to determine how many cycles elapsed between when an interrupt fired and when it was taken, so an IRQ that uses a "cmp/nop" slide could easily align itself with a precise known beam position.
Answer: Here is one way to do it. Note that this approach is quite wasteful; it just wastes time by going round and round in stupid loops until the next frame is reached. It would probably be nicer to do some kind of useful work in the meantime. You could use interrupts to achieve that, but well, it depends on how you want to structure your code.
On to the subroutine that waits for the next frame.
wait_for_next_frame:
     bit $d011
     bpl wait_for_next_frame
     lda $d012
f:   cmp $d012
     bmi f
     rts

So the first instruction, the bit, checks bit 9 (!) of the raster counter. If this bit is not set, then the raster is still quite high in the screen, so the routine will branch back and check again.
Otherwise, we'll proceed to lda $d012, or load the (lower 8 bits of the) raster counter into the accumulator. By continously comparing with the the current value, the program determines when the raster goes back to the start.
Hope that's clear, just do jsr wait_for_next_frame and you should be good.
Comment: There are issue with this code. First, comparing equal values resets the N flag and the second loop doesn't, well, loop. Second, If the scan line counter wraps between reading $d011 and reading $d012 then this routine returns at a raster index around 128 (barring the other issue). It is easier to detect that the msb of $d011 goes from 1 to 0.
Comment: @WimC What would you suggest?

How to wait for vBlank on Commodore 64


which web framework gives more functionality for free?

Question: I'm using codeigniter for a little time and I find it really good, but sometimes it's difficult to find pre-cooked examples on the web that will guide me on what I want to do...so my question is which web framework(independent of language) will offer more examples, better tutorials and more resources in general?thanks in advance
Comment: that is really impossible to answer in a meaningful way.
Answer: Have a look at this wikipedia comparison of frameworks to see what they support out of the box (resources).
As to user base / documentation / useful examples: it depends on code that you can easily read as well. Have a look at:
http://static.raibledesigns.com/repository/presentations/WebFrameworksOfTheFuture-FlexGWTRailsAndGrails.pdf and https://equinox.dev.java.net/framework-comparison/WebFrameworks.pdf also compare frameworks.
I personally use the MS family, and I am satisfied.
Answer: I would strongly recommend CakePHP , it has alot of examples and really nice documentation.
It has a very nice way in handling models relationships
Answer: I'd recommend you have a look at the following, categorized in no particular order, with their language of implementation and support in brackets. They all present rather clean and novative aspects, but I don't think there's any real silver bullets. Just lots of very nice bullets depending on what you aim for.
The Laureates are...

Lift (Scala, Java)
Play (Scala, Java)
SeaSide (Smalltalk)
Ruby on Rails (Ruby)
Grails (Groovy, Java)
Yii (PHP)
Wicket (Java)

Others
There are other ones, but these were the ones that struck me a blow the first time I saw and experimented with them, and which have - in my opinion - brought some innovation to the scene in general or to their platform in particular.
Note that this isn't to say that some other frameworks may have been equally significant, but I merely list relatively recent and modern ones, and most importantly ones that I will still consider to write a modern web-app (in the general case).
Feel free to look around for more (and maybe add them in comments or edit this answer).
A few notes...
Play is indeed fun to poke around. Yii is the only PHP framework I'd touch with a very long pole (maybe CodeIgniter as well, granted, but I find Yii cooler and less of a hurdle to use and to work through). Rails/Grails are obviously on par. Wicket is something you'd want to consider if you are in a Java shop that's relatively restrictive and doesn't want anything ultra-exotic, but still enough on the edge.
But mostly, I'd recommend you have a look at Lift and Seaside, if you want to see something truly amazingly well thoughout and for the highest feature-per-LOC ratio. (Oh, and it's inspired partly by Seaside and Wicket, and designed by someone who had to work with a lot of (g)rails web-apps, so that sums it up. Plus Scala is an amazing language, granted you can use it and its underlying platform...)
This is an old question, but what the hell, Just came across it...