Confused about domain names

Question: I am confused about the difference between http://www.example.com and http://example.com, is that true "www" is actually the subdomain of domain example.com? Do people usually redirect from http://example.com to http://www.example.com or it is the reverse? Please enlighten me!
Comment: See also http://en.wikipedia.org/wiki/World_Wide_Web#WWW_prefix
Comment: Also related: http://webmasters.stackexchange.com/questions/14457/what-does-www-do
Answer: It's true that www is typically a CNAME or PTR record -- it could also be a subdomain, in case there are CNAMEs or PTRs for en.www.example.com or ru.www.example.com.
I most often see example.com redirected to www.example.com, but I prefer the other direction, and publicize my own sites without the www.
Answer:
The "www." helps identify a web server, but not all web servers use
  those letters - as an example, Yahoo has news.yahoo.com,
  maps.yahoo.com, store.yahoo.com, shopping.yahoo.com, and
  www.yahoo.com, and probably others - each one is completely different.

source
Answer: www is the host name. Connecting to a domain without a host name is called "the default host". When the world wide web was first set up, www was used as a host name to indicate that the host was part of the world wide web. At some point it became clear that most http requests to public sites simply want to get to the home web page of the organization that hosts the site, so the concept of host is mostly irrelevant, and the concept of a www host is redundant.
This is a matter of personal preference. If you use the default host people don't have to type as much, which is a clear benefit.

Confused about domain names


Gnome Tab not recognizing Rails anymore using ubuntu 14.04

Question: I am having a strange issue , my main terminal is recognizing the RVM , Ruby and runs Rails command as well , and I had two tabs opened yesterday which were recognizing all of the commands .
Today morning when I opened my terminal and tab ,
terminal recognizes everything , but tab only recognizes RVM and ruby, but not rails and throws out this error .
error - The program 'rails' can be found in the following packages:
 * ruby-railties-3.2
 * ruby-railties-4.0
Try: sudo apt-get install
I have ticked the box run command as login shell in the preferences , but of no use .
update:- I tried running rvm use ruby-2.2.0@learn in the tab (The main terminal window doesnt require this being run ) and it throws this error -
Warning! PATH is not properly set up, '/home/xxx/.rvm/gems/ruby-2.2.0/bin' is not at first place,
     usually this is caused by shell initialization files - check them for 'PATH=...' entries,
     it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
     to fix temporarily in this shell session run: 'rvm use ruby-2.2.0'.

Using /home/xxx/.rvm/gems/ruby-2.2.0 with gemset learn
Any suggestions or help ?
Thanks
Answer: If you installed rvm in multiusermode you should check that the following code is in your bashrc.
source /usr/local/rvm/scripts/rvm


Iran-Iraq War compensations claims

Question: Recently an Iranian MP demanded the Iraqi government to pay Iran more than 1 trillion US dollars as damages for Iran-Iraq War. The MP based his claim on  Article 6 of UN Resolution 598.  I wonder if MP claim is really true ?
Answer: The only news in English about this was thin on specifics for the claim's basis:

Earlier this month, a member of the Majlis (the Iranian parliament), Eivaz Heidarpour, who is also a member of Iran's National Security and Foreign Policy Committee, said that Iran could claim compensation from Iraq amounting to $1 trillion."

Other members of the Iranian leadership publicly turned down the idea, as further detailed in that article.

But this week a senior member of Iran's Islamic Consultative Assembly has said that the time for addressing the issue of reparations relating to the Iraq-Iran war is over.

So it doesn't sound like a serious claim to investigate... although Iraqi leadership threatened counter-claims (probably to deter talk like Heidarpour's in the future).

Ali Alaq, the chief secretary of the Iraqi council of ministers told the Arabic Al-Sabah daily on Tuesday that if the Iranian authorities demanded compensation from the Iraqis for war damages, "which is an illogical request", Iraq could also appeal for compensation from Iran.

Also the UN resolution 598 you mention says nothing about damages/reparations, although it encourages reconstruction (in article 7). The news piece in English doesn't mention the resolution at all. Article 6 is a masterpiece of not-really-gonna-happen, here's the text:

[The Security Council] Requests the Secretary-General to explore, in consultation with Iran and Iraq, the question of entrusting an impartial body with inquiring into responsibility for the conflict and to report to the Council as soon as possible;

Article 7 (the only one which mentions damage[s] and reconstruction, but says nothing about reparation):

[The Security Council] Recognizes the magnitude of the damage inflicted during the conflict and the need for reconstruction efforts, with appropriate international assistance, once the conflict is ended and, in this regard, request the Secretary-General to assign a team of experts to study the question of reconstruction and to report to the Council;

Also if you read Wikipedia's page on the war, there were no reparations authorised (or paid) unlike in the case of Iraq-Kuwait.
Comment: @janh: I've added the text of article 6 & 7 here. The whole resolution is too long (and the pdf is not OCR'd).
Comment: What is required to read that resolution? The UN website won't show me anything and makes vague claims about privacy, slow connection or similar problems. Trying to download the Word-Document (linked on the page) gets me Error 91: Object variable not set
Error Handle in function SearchDS
The UN is even less competent than I had anticipated.

Iran-Iraq War compensations claims


macOS Sierra console search criteria

Question: Is there a way to filter the console by multiple criteria?
I'd like to display only warnings and errors from the PHP log file. The following searches for the string error warning which doesn't exist
Comment: The Console app has limited functionality when analysing text log files;  it's built for filtering output from macOS's unified logging system.  You could try an alternative log analysis tool like lnav — http://lnav.org
Answer: When you open Console, you automatically enter "All messages" section, but you can try switching to Errors and Faults filter which is already created there.
It will give you additional search options the next time you try to filter messages, just click on a search bar and choose what type of messages you want to view.
Hope it'll help.
Comment: It appears this only works with the device log, which doesn't record the Apache/PHP errors. I moved my PHP log into the /Library/Logs folder that's listed in the Reports column. All Messages and Errors & Faults becomes grayed out.
Comment: I see. Sorry, there's no other solution I can think of at the moment.

macOS Sierra console search criteria


Dizzines with Insanity workout at the second month

Question: I started insanity workout and finished the sixth week and stopped for some reasons. A month later I decided to start again and did the fit test, which was really painful with a state of mind of reaching the same level as my last fit test before I stopped. I eventually could reach the same level. Then I continued the insanity workout starting directly at the sixth week. I couldn't do it continuously and had to stop at many points because of strong dizziness. Skipping some 45 seconds cycles I was able to finish it. My question is if those dizziness periods are dangerous and what are the causes behind them? lack of oxygen? fatigue? or just a heart that is not powerful enough to keep up with the pace?
Comment: There's no way for us to diagnose your problem. You should see a qualified medical professional.
Comment: It could any of those factors you mentioned. It could also be dehydration. It's impossible *(or recommended)* for us to give you a diagnosis. So, **hydrate yourself** and **go at your own pace** because **you can faint from dizziness,** which would do you no good. :)
Answer: Dizziness in training can come from a variety of factors. Most everyone who's lifted very heavy doing compound barbell lifts has felt a little woozy after a few reps of heavy weights, and you'll hear a lot of endurance athletes talking about "almost passing out". But real fainting (syncope) in exercise is serious:

Syncope is a common event in which there is a transient loss of
  consciousness and postural tone. Although syncope is generally a
  benign event in young adults (less than 35 years of age) and, in many
  cases, never reaches the attention of a physician, exercise-related
  syncope can signal sudden death.

Vasovagal response, what you could be experiencing, basically means that the vagus nerve has messed up a bit in regulating blood pressure and supply to the brain. The causes of vasovagal response are wide: ranging from standing up too fast to dehydration to being exposed to strong magnetic fields.
You should talk to a physician, to have them rule out anything serious. This isn't blanket advice: I personally know of an extremely fit athlete who had serious cardiac damage because he developed undiagnosed problems in life and attributed his symptoms to general fatigue.
Talk to your normal doctor but consider talking to a sports medicine physician who probably has the equipment in his or her office to conduct the necessary stress test.
Comment: It's actually a very clever response by the body. If you're lying down you can recover far faster because the heart doesn't have to pump blood up the length of your body. Still, it's not a good idea to get dizzy.
Answer: As stated in the other answer, there isn't really any way to diagnose why this happened.. however in my experience I've suffered from feeling dizzy to the point of almost collapsing but only after very serious workouts with heavy kettlebells and minimal rest periods between sets. In my experience it generally boils down to lack of blood sugar pre workout but obviously hydration is also important.
If you're a fit person and have never had any heart problems (or anything else) then it's probably just what I've described however you should seek professional medical advice as we don't want to risk killing ourselves do we?


Probability of die and coin , probability law? conditional probability?

Question: You roll a fair die 3 times, say k rolls are 6's.You then flip a fair coin till you got k head. what is the probability that you flip two time and get k head?
Comment: What are your thoughts on how to proceed?
Comment: Welcome to MathSE. What have you tried?
Comment: I think conditional probability might come in to place. Also, the probability that flip 3 time and get k "6" is (5^(3-k))/6^3. But how  conditional probability apply next?
Answer: The number $k$ of sixes you throw in three trials is binomially distributed; the resulting probabilities are
$$(p_0,p_1,p_2,p_3)=\left({125\over216},{75\over216},{15\over216},{1\over216}\right)\ .$$
Since we do $2$ throws of the coin afterwards we have $1\leq k\leq2$. When $k=1$ the probability that we need exactly $2$ throws for the first $H$ is ${1\over4}$, and if $k=2$ the probability that we arrive at $HH$ in two throws is also ${1\over4}$.
Now put it all together.
Comment: Do you think binomially distribution is nessary for this problem?
Comment: You could invent binomial distribution anew for this simple problem.
Answer: From what I understand of your scantily worded problem.
$P(Y=k)$ where $Y$ is the number of $k$ rolls of $6$.
$P(X|Y=k)$ where $X$ is the number of tosses to get $k$ heads.
$Y$ is distributed as Binomial $(3,\frac{1}{6})$
$X|Y$ is distributed as negative Binomial $(k,r,\frac{1}{2})$. where k is the number of heads and r is the number of tails)
$P(X=k) = P(X=1/Y=1).P(Y=1) + P(X=2/Y=2).P(Y=2)$
You flip two times to get k heads.
$P(X=k) = {1\choose 1}(\frac{1}{2})^2.{3\choose 1}(\frac{1}{6})^1.(\frac{5}{6})^2+{1\choose 0}(\frac{1}{2})^2.{3\choose 2}(\frac{1}{6})^2.(\frac{5}{6})^1$


how to handle error reply messages?

Question: For security reasons, many organizations do not allow error reply messages to leave their internal Internets. How, specifically, could hackers use information in echo reply messages to learn about the firm's internal hosts? Does the same thing apply to ping requests?
Comment: Is this a question about networking in general and ICMP messages in particular?  Should the scope of the question include TCP RST packets?  (and appropriate tagging)  Also, should your first sentence read "echo reply" rather than "error reply"?  I created a suggested edit for your approval.
Comment: icmp message in particular. the question is why error reply are not displayed and what the hackers extract from these messages
Answer: ICMP was designed to help determine characteristics of the network. PING is an application of ICMP.
ICMP has two modes of operation:

Query the network by requesting packets and interpreting the answer
Report non-transient error conditions through error messages

The errors are produced in special conditions such as:

Network is unreachable: this would help map the network.
Host is unreachable: would show what hosts are online
Protocol unreachable: shows what protocols are supported
Port unreachable: some servers would indicate through this error message that no process is listening on that port
The datagram is too big: would show what technology is used in the network.
And many others, for example to differentiate between the Linux kernel and that of the networking device, ICMP Error Quoting size fingerprinting method can be used.

By using ICMP messages and errors it is possible to gather substantial information about the network:

Host Detection
Network Topology
ACL Detection
Packet Filter Detection
OS Fingerprinting

ICMP error messages are not typically involved in directly attacking the network but would greatly help an attacker understand more about the network and know how and where to attack. Therefore this information should not leave the network because it should not be available to people outside the network.
Comment: +1 Pretty good overview. ICMP messages could be used for reconnaissance and could allow an attacker to gain knowledge of network topology, ACLs, packet filters, hosts, OS,... information you normally wouldn't want in the wrong hands. A more detailed description can be found in the [SANS' Intrusion Detection FAQ: How can attacker use ICMP for reconnaissance?](http://www.sans.org/security-resources/idfaq/icmp_misuse.php). Cheers!

how to handle error reply messages?


Why kyokushin Karateka did not prefere soft style technique?

Question: I did have been read article on Wikipedia that in Kyokushin karate they do not use throwing or gripping or any kind of locking technique to practice or to use. which kind of philosophy is stays behind this?
Answer: Every style of martial art is unique from all others.  Kyokushin, like all fighting sports, is no different: there are certain rules about their sport that make it stand out from all other sports.  Their rules are their niche.
Having said that, all styles of martial arts - unless they are new - are systems complete with all kinds of fighting, defensive, and control techniques.  In the case of Kyokushin sport fighting, they have subtracted out some things such as grappling and throwing, as you pointed out.  But that is just the sport aspect.  The style itself is complete, and generally has a more complete repertoire of techniques.  It may be the case that your school/instructor does not teach (or does not know) that aspect of your style - that is a common phenomenon in all styles.
To give you an overall picture of the state of fighting sports in general, take a look at, say, Wu Shu, or Shotokan Karate.  Both are martial arts styles in their own right; are classical styles; and each are known to have a very complete repertoire of techniques, including striking, kicking, throwing, pins, locks, chokes, gouges, and weapons.  One may counter your original question by asking: Why do these styles - known to have weapons - never compete with weapons?  Some may argue that they do - but only via forms (kata or taolu).  Others argue it's too dangerous - but would not explain European fighting which DO use weapons in fighting sports.  The overall answer is this: the styles have weapons, and their practitioners are no doubt familiar with many of the weapons their styles traditionally use; but for whatever reason, they choose not to use them for competition.  Whether it is because of popularity, insurance, safety, timing, quality instruction, legalities of training with such weapons, similarity to another sport, or some other reason or combination of reasons therein, that is known only to the sport body governing that style or particular competition instance.
I would also caution about what you read from Wikipedia.  It's a great resource to have, especially if the author(s) cite their references.  Your best bet is to go directly to the body which governs a particular tournament or style.  From there, you can read their rules, and if you so incline, you can ask them why such rules are in place.
In all honesty, I tried to do just that for you, and unfortunately came across some verbiage which clearly indicates petty infighting between federations.  For example, this one, especially about half-way down:
KYOKUSHIN WORLD FEDERATION - Q&A
And then there's this one comparing itself to "others", also about half-way down:
World Kyokushin Karate Federation
...and on it goes, there are many federations, and all pointing fingers at each other (or maybe perhaps at a few; it's hard to tell, and I'm not part of that milieu of politics).  Nevertheless, the rules governing sport are very similar, and, the components which make up the style (including kata used by other Karate styles) are also pervasive.  Therefore, your style isn't old, but it derives from very old styles, and still, is very complete.  What you may lack is quality instruction.  We in Taekwondo see this all the time, and often have to resort to joining Karate schools with emphasis on kata, bunkai, and oyo in order to help learn what we do, when local TKD instruction lacks in this area (although they may excel when it comes to competition).
Comment: of course that could be no one and complete martial arts as there will be too many situations of fight,too many techniques, too many aspects or approaches so too many style and forms and having know to that its baseless to point finger to other style or martial arts i just wonder what is philosophy/perspective behind this exclusion.


Simplest way to implement user login / authentication in Python

Question: I'm developing a fairly simple Python web app and I want to allow users to log in. I know the solution will probably involve installing some sort of framework rather than doing it in straight Python and I'm OK with that, I'm just wondering, what would be the easiest, most hassle-free way to add authentication? The app is already written in straight Python so any extra code I use will only be used to for this purpose.
Answer: Store the user's login, the salted hash of their password, and the salt in a database. (If you're going for cryptographic overkill, you can use a very expensive-to-compute hashing algorithm like bcrypt.)
You can use SQLite as that's bundled with Python, but it would probably make more sense to install a database separately and use that.
Comment: Thanks! I think I will use SHA256.


Control duty time and frequency with different potentiometers using one 555 timer

Question: How can I regulate duty time and frequency of 555 timer output with 2 potentiometers?
Comment: Ouch, @Klasik, please use capitalization to make your comments easier to read.
Comment: By steering the charge and discharge currents.
Comment: i'm so nooby i know that i need control capacitor charging time and discharge time with those resistors... maybe someone can draw schematic? i googled a lot and just founding duty cycle regulators or freq.. but no one in same layout.
Comment: So then examine the two and put them together.
Comment: i think its impossible :) to duty cycle used 7 - discharge as output... in freq... using 3 output as output
Comment: I don't think that is possible. But it would be easy with any small microcontroller :)
Answer: Using two pots to adjust the frequency and duty cycle is easy, but there may be interaction between the controls. The simplest method is to have one pot for charge and another for discharge, with diodes steering the current between them. To change duty cycle you turn one pot up and the other down. To change frequency you adjust both in the same direction. That's a lot of interaction!
You can rearrange the pots so one controls duty cycle and the other changes frequency, but there will still be some interaction. Here's a circuit which has minimal interaction and provides a duty cycle range of about 2~98%. The practical frequency range is only about 3:1, and is quite sensitive at the low end.

simulate this circuit – Schematic created using CircuitLab
However there is a way to get wide frequency range with 0~100% duty cycle and no interaction, using the same number of parts! It uses the 555 as a triangle wave generator, and an opamp or comparator to control the duty cycle.

simulate this circuit
Comment: My son has asked for some help with a school project, building a dc motor controller. We decided to use the lower of the two circuits. We got it working as displayed, but cannot get the duty cycle to 0- it is stuck on the low end at 160 uSec. Top end is fine at 99% duty cycle. Only changes are elimination of R1 to set the frequency at 1kHz and using a UA741CN Op amp in lieu of the MCP601. I have tried reducing the value of R5, with no effect! Any ideas?
Comment: @user218517: Your biggest problem is the [741 opamp](https://electronics.stackexchange.com/q/304521/11683). It is simply not designed to work from a 5V power supply -- it requires a minimum of 20V for proper operation.
Comment: I don't get how this setup can set the duty cycle in so wide range. If I get it correctly, the voltage on the positive input of the opamp can be set between 1/3 - 2/3 Vcc. To be able to set the duty cycle in range 0-100% I would expect this voltage between 0 - Vcc.
Comment: As the pot voltage changes it crosses the triangle wave at a different height, which equates to a larger 'on' time as it moves towards the apex. Above 2/3Vcc the PWM is fully on, and below 1/3Vcc it is fully off. The pot voltage only has to cover that range, which is why R3 and R4 are there (otherwise the pot would only be effective in the middle of its range).
Comment: Sorry, I have no electrical engineering background, but does that mean the triangle wave alternates in the 1/3 -2/3Vcc range and not in 0 - Vcc?
Comment: Yes. The 555 charges the capacitor when it goes below 1/3 Vcc, and discharges it when it goes above 2/3 Vcc.


Pathfinder golem senses / sight

Question: I cannot find a particular documentation about golem senses, what will happen when a golem is inside a Fog cloud spell? Can he see and hear normally? Is its line of sight blocked?
In our case we are dealing with an Iron golem.
Answer: Golems are constructs.  Per the general construct rules (unless the specific golem writeup overrides it) they therefore have darkvision 60' and low-light vision.
I'm not sure how you are not finding this, as it's in the stat block for every creature under Senses, right after the Init in the top section of the monster stats. For example:
<code>Iron Golem  CR 13
XP 25,600
N Large construct
Init –1; Senses darkvision 60 ft., low-light vision; Perception +0
</code>
They also have immunity to mind-affecting affects including illusions of the pattern and phantasm types, and immunity to spells in general, but fog cloud is a SR/no conjuration (creation) spell and thus the fog it conjures blocks sight. (Because "An iron golem is immune to spells or spell-like abilities that allow spell resistance.")
So no, an iron golem can not see through a fog cloud (and it can slip on grease). Those are actually some of the basic standbys to fight them.
Comment: Yes I saw that, but no description about their senses: can they hear? They see normally with 2 eyes like humanoid creatures (with darkvision of course)? Or they see at 360°? (I hardly figure out they can smell or taste but.. who knows)

Pathfinder golem senses / sight


How to crimp JST VHR series?

Question: I need to crimp the 18 awg wires into the 3-pin female JST VHR connector, but have no clue as to how to do it. How would the crimp latch onto the JST housing? Can somebody point me to any helpful resources?

Thanks!
Comment: I agree with the answers about buying pre-terminated jumpers. But, to answer your question, please see this [answer](https://electronics.stackexchange.com/a/158725/38335) I wrote about crimping a different connector series. The method is the same. Good luck!
Answer: You could get the crimper and put terminals directly onto the wires you have; the part number is WC-930 and it's almost $500.  Or, you could get pre-terminated jumpers from Digikey, et. al. and splice them onto the wires.  They're less than $1 each.  The contacts have a little tab on them that latches into a notch inside the connector housing.  Just don't screw up the wiring since the extraction tool is $200.
Answer: You already have an answer apparently pointing out the "proper" tool, which you could also determine from manufacturer guidance.
If you only need to do a few for prototype use however, there are more universal manual solutions, such as the Engineer PA-09 and PA-20.  These require some degree of skill and experimentation to produce acceptable results, but are a pragmatic solution when you have more variety than you can justify having unique tools for.
Apparently official removal tools are expensive.  A small jeweler's screwdriver makes an unofficial one, be careful not to bend the locking tab too far or you may have to bend it back and/or replace the contact.
You appear to have stripped far too much insulation, typical connectors crimp once on the bare wire and then also just past that over the insulation, but details vary - and vary even more if you end up needing to improvise with an official unsupported wire size.
Ultimately what the best solution is depends on the volume and requirements of your need...
Comment: Another thing the pre-crimped jumpers have going for them is that they are already crimped perfectly (some contacts take a bit of practice to get right) and the wire is guaranteed to be compatible with the contact.  Maximum insulation diameter for those contacts is 3mm; it looks like it might be OK in the picture but who knows.
Comment: Those can have their place, but the asker isn't making "jumpers" rather they seem to be putting the contacts on the end of the pictured 3-conductor cable.  Maybe that could be ordered as a custom assembly.  Maybe it should be.  But there's also a role for an "I need to put this on this *this afternoon*" class of solution in many engineering labs, which makes it useful to know how to do that, as well...

How to crimp JST VHR series?


How did John Carter get sent back to Earth?

Question: For people to travel to Barsoom (Mars) or to Earth (Jasoom) or any other planet with that specific device they must say the chant (ohm octei etc. and planet name) themselves, while holding the device, as we have seen in the movie. But in the end the therm sends John to Earth by saying the chant from his own mouth. How can this be possible?
Answer: In the books the talisman doesn't exist, so we can't refer there for more information.
But, given the scene where they visit the "map room" they discover that they can control and manipulate the devices without any access codes or other form of authorization. Same holds true for the weapon given to Sab Than (he could use the device immediately after receiving it, leaning to the idea that anyone can use any of the devices at any time.
Going along these lines, the chant would need only be spoken to activate the device, then the device (and any people attached) would then be transported to the targeted location. Given that no other device shown has any restrictions, it would stand to reason that the talisman would not either.
Also, note, that the Thern that Carter kills in the cave speaks the incantation that transports him up to Mars in the first place.
EDIT: My bad, still early. Refined point and added more info.
Comment: wow..... That's what happens when you change thought trains mid sentence... Fixing and adding missing sentences now.
Comment: In which books is there a device? I read the first three and have no memory of any device used to transport anyone between worlds. The talisman being an addition for the movie was even discussed [in an answer to another question](http://scifi.stackexchange.com/questions/12559/what-are-the-differences-between-the-john-carter-2012-movie-and-the-a-princess).
Answer: My guess: "Okh Ohem Oktei Oeeis* (destination)" is ONE command, a Thern would know others, and we never hear all the syllables when Matai Sheng sends him back. There might be a "send myself there" command, and a "send THIS guy there" command.
*It strikes me as cool to spell it assonantly, so I do. But who knows for sure how to spell it. Where's that darn Disney screen play, when you need it.
Edit: correcting myself already, huh. Spun the tape back, and it seems we do hear Matai Sheng do the whole command when sending Carter back! He just does it very fluidly, four words become one, sounds like "okomoktewis Jasoom." There would almost certainly still be a lot of variability in doing it, available to the operator.


Why Canvas App asks for Heroku Account

Question: We can Integrated Canvas app with a java application deployed on a third party server but why does Canvas App creation wizard asks for Heroku authentication (Username/Password,API Key,OAuth) even though we have not deployed the third party application in Heroku?
Answer: Heroku is only used to deploy the Canvas Quickstart app, if you want to quickly see the features of Canvas. If you do not need the Quickstart app, you do not have to use it.
Just go to the Apps menu in Setup or the Connected Apps menu and configure your app for the location you want. Your app could be on Azure or your own data center, for example.

Why Canvas App asks for Heroku Account


Is there a limit to twinning?

Question: Can developing twins further divide and subdivide and become identical quadruplets or octuplets or...?
Can twinning be induced, either in utero or in vitro?
Might it be possible to just keep harvesting a few cells off the original clump indefinitely and making an unending stream of identical embryos for implantation in a surrogate uterus?
Answer: Sequentially:
Yes. Up to the limit of what the mother's body can tolerate.  Of course, if the cells never aggregate, that suggests some sort of fundamental problem with the embryo's developmental process, and you will probably not get a viable organism.
Sort of and yes.  In utero, fertility drugs can cause multiple eggs to be released per cycle, which can cause fraternal twins when each egg is fertilized.  IVF can do the same thing, but you can also manually subdivide a single embryo into two (smaller) viable embryos, provided you perform the division before any cell differentiation occurs.
Yes, but good luck getting an ethics review board to approve that :D

Is there a limit to twinning?


tokens generation in smart-contracts specific to one asset

Question: I have been building a smart-contract for tokens for songs such that they are specific to different songs such that one token is only valid for one specific song not other. Ive made a smart-contract which does exactly that but does not follow ERC-20 and so the tokens do not show in the mist wallet. What is the best approach, to inherit ERC-20 in my smart contract and make it have the total supply of all tokens for all songs?? If yes then I would need the initial supply to be increased dynamically, is that possible(or should even be done)?? Thanks in advance.
Comment: Hi there. I think this question will get flagged as either too broad, or opinion-based, I'm afraid. This sort of question often leads to discussion, with no single answer being considered "correct". Reddit might be a better place for such design-related questions: https://www.reddit.com/r/ethereum
Comment: @shubhabrata-mukherjee take a look at the ERC-721 standard for non-fungible tokens
Answer: If you want to create tokens that are specific to different songs they are not going to be fungible and may require implementation in separate contracts. It's good practice to have fungible tokens as they may be easily traded and transferred. For a more theoretical introduction to tokens properties you ma read this tokens taxonomy.
The best approach is to extend your token from a popular and audited ERC-20 reference implementation like StandardToken.
Yes, you may increase the initial supply of tokens by a process which is often named minting. It's a good practice to inform all of the token holders about the rules for new token creation as the process may create an inflation and depreciate the value of held tokens.


how to transfer everything from one icloud to another icloud in same iphone

Question: i want to transfer everything from one iCloud to another one in same iphone. i want to finish iCloud and i want to have a new one.
is there any one to help me?
Comment: Apple support? What specifically is "everything"
Answer: You cannot transfer everything from one Apple ID to another.
Documents, photos, yes... apps, books, music etc, no.
The ID that purchased those [even free apps, even the iDevice itself] is locked to the Apple ID that purchased them & can never be transferred. The only alternative would be to wipe all the old data & set up as a new device, then repurchase the things belonging to the old ID. [This would also require the permission [password etc] of the ID giving up the device.
If all you really require is to change the email address associated with your ID, then you can do that - the ID itself is not dependant on any given email address [in fact it doesn't even have to be an email address, it's just easier to think that way]
See Apple KB : Change your Apple ID for full details.
Answer: I move things from one iCloud folder to another using PathFinder.  It requires a mac and it's not free, although they give you 30 day trial period.  I have used it for years and bought the few additional upgrades that weren't free.  It's published by Cocoatech and allows you to see the source and target in side-by-side windows.  You can use a single command to move one file, a group of files or everything from one window to another.
http://www.cocoatech.com will answer any other questions.
Comment: I think the OP meant "everything", not just a few documents. I think, though this answer covers some aspects, it really doesn't feel like what they're actually asking for... which is, of course, not possible...


What's the accepted way to distribute an Excel template with .NET dependencies?

Question: I've created a handy-dandy excel template for myself that other people want it now as well. It has VBA and a couple of dependencies in the form of .NET /C# libraries that I've built.  For the template to work on another machine, currently I have to drop down to an administrator command window, regasm all the libraries and then the template will work.
So is there a better way to distribute a template that doesn't require all this manual work?  For instance, Excel embeds VBA - can it also somehow embed C# code?
Answer: You could create some  Install batch file (or other kinds) to do those regasm things for you.


Principal ideals having embedded components

Question: Does there exist a noetherian domain $A$ and a principal ideal $I = (x)$ in it having an embedded component?
Comment: In a more geometric term, if $X=\mathrm{Spec}(A)$ is an integral surface with only one non-normal point $p$, then $O_{X,p}$ is not $(S_2)$ (hence has depth 1) by Serre's criterion. Take any non-zero $x \in A$ belonging to the maximal ideal corresponding to $p$, then $A/xA$ has depth $0$ at $p$ and Krull dimension $1$, so $p$ is an embedded point of $A/xA$.
Answer: Take the homogeneous coordinate ring of the rational quartic curve, that is,
$$R=K[a,b,c,d]/(ad-bc, a^2c-b^3, bd^2-c^3, ac^2-b^2d).$$
(Note that this ring is isomorphic to the affine semigroup ring $K[x^4,x^3y,xy^3,y^4]$ and now we have a connection to the answer from this topic.) Then chose any nonzero noninvertible homogeneous element of $R$ and get the required example.
If you want to study more I can recommend you this paper.
Remark. In the book of B. Hassett, Introduction to Algebraic Geometry, exercise 8.9 provides an example of a principal ideal that has embedded associated primes. His example looks pretty similar to the one given above, but isn't an integral domain. (I wonder whether Hassett missed somehow one generator from the defining ideal of his ring $R$, because for rings which are not integral domains there are much simpler examples.)
Answer: Let $X$ be a locally Noetherian scheme, e.g., we have that $X =$ Spec $A$, where $A$ is a Noetherian ring.
Then, if $X$ is reduced (as a scheme), then $X$ has no embedded points.
In particular, if $A$ is a domain, then $X$ has no embedded points.
The converse isn't true. As you probably know, the scheme Spec $k[u,v]/(u^2,uv)$, where $k$ is a field, admits an embedded point corresponding to the maximal ideal $(u,v)$.
Maybe I'm misunderstanding the question?
Comment: It's a good thing that you think geometrically, but the question is about the scheme $X=V(x)=Spec(A/(x))$ having embedded components.
Comment: That said, I certainly did *not* downvote your  answer.


Saving a rendered file with a audio track on it

Question: Hi everyone i am just needing some help on my animation i have made. i have rendered it as an animation and added a audio file on top of it but i don't know how to save it as a mp 4 file with the sound on top of it.
Answer: I'm showing you my set up.
I select FFmpeg Video RGB.
Container: MPEG-4.
Codec: H.264.
Audio Codec: MP3.
See the image below:
Answer: Hey buddy you can do it in render tab right side panel. Just. Look for ouput section in this tab you will find Output format sect mp4 as your preference then render . You are done.
Answer:  Output Properties
In order to export an animation with audio, you need to change how your blender file will output its animation data!
Let's take a quick look at how to output audio in Blender 3.0.
Below is my video file, with my video and audio tracks. Let's navigate to the "Output Properties" tab (Icon outlined in red, which looks like a small printer)

Here, we can manage many of our output settings! Let's take a closer look.
Below, we see an image of the Output Panel. If we look closely at the Output panel, we'll see almost everything we need to know about our export:

The Output Path tells your computer where to export your animation. (if you give your computer the path to your 'pictures' folder, then it will show up in your pictures folder! And so on.)
The File Format tells your computer how to export your animation! (Specifically, in what format to export!) Let's look here, to get to the next step.
Currently, our animation is set to export as a sequence of PNG's! This is also known as a flip-book. (I don't know if you've ever seen a flip-book animation before, but unless you plan to make audio by flapping your lips together, you need to choose a different method of exporting!) Let's change our animation from a flip-book (PNG) to an MPEG, which can store audio data!
Click on the "File Format" box, and select the option that reads "FFmpeg Video".

A new option titled "Encoding" will appear! Click on it.

The Container for your Audio will allow certain programs to read and play your audio without running into trouble! The Codec will control the quality of your audio. Each situation is different - But I would recommend using the settings below, outlined in red, as they are versatile, and are my personal choice:

(Container: MPEG-4) (Audio Codec: AC3)
(OPTIONAL, Output Quality: Perceptually Lossless)
Finally, you are ready to render your animation! To render your full animation, press  CTRL  +  F12 , or navigate to the Render header window (at the top of the .blend file) and click to render your animation! (Shown below.)

 Bonus - PNG Rendering - Render Like the Pros
So, if PNG / Flipbooks are so useless, then why are they an option?
Simply put, it's because they're actually the better option!
Rendering large animations (Animations that take more than 24 hours) is very dangerous when using the above method alone! Renders can have all kinds of issues, including crashes, visual errors, frame-skipping, on and on!
When an MPEG render crashes, it cannot usually be recovered, as the data file is typically corrupted by nature of the crash.
However, when a PNG render crashes, you only lose one frame of your render! (And that's not even the half of it!)
Rendering each frame allows for perfect control over each individual portion of the render! Have a crashed render? No problem! Render from the last finished frame. Have a render with a visual error? Go to the last working frame, and render from there! Have a render with frame skipping? Sure, you betcha - I'll render just the missing frames!
The possibilities are, quite literally, next to endless!
"But, now we're back to the same issue as before! How do I put audio on a flip-book render?"
Actually, it's very simple - and it involves a second render where you re-compile your rendered flipbook into an MPEG! (The process takes only a few moments, up to a few hours, and is much less risky!) Here's a video explaining how to render PNG Sequences (the technical term for a "flip-book.")
Here is the Link, pasted below:
https://youtu.be/Bgab9VC_laQ
Let me know if you need anything!
Good luck, and Happy Blending!


Doubt in understanding the potential energy of dipole in external electric field?

Question: When a dipole is placed in external electric field it experiences a torque $$\vec \tau = \vec p \ \times \vec E $$
whose magnitude is
$$||\vec \tau|| = ||\vec p|| \cdot ||\vec E|| \cdot sin\theta$$
On calculating the potential energy:
$$W=-\Delta U$$
$$\therefore W = -\int pEsin\theta\cdot d\theta $$
Which gives:
$$W = pEcos\theta$$
But its wrong and is given as $-pEcos\theta$ in many text books.
Please Explain.
Comment: The value of a potential energy depends on where you choose the reference position.  Notice that the expression given by the book is zero when the angle is 90 degrees. It increases for larger angles and decreases for smaller (going negative). You need to specify limits on your integral.
Answer: Let me start from the beginning
Wnet = $\Delta$K.E
Wconservative+Wnon-conser.+Wexternal = $\Delta$K.E
Wnon-conser. = Zero [No non-conservative force is acting ]
$\Delta$K.E = zero [Assumption here is that the dipole is rotated very slowly therefore change amounts to zero]
Therefore the equation reduces to
-Wconservative = Wexternal
-d(Wconservative) = $\Gamma$*d$\theta$
-$\int$d(Wconservative) = $\int$ $\Gamma$*d$\theta$
-Wconservative = $\int$ p*E sin$\theta$ d$\theta$
-Wconservative =  p*E $\int$ sin$\theta$ d$\theta$
-Wconservative = p*E(-cos$\theta$)
$\Delta$U =  -p*E cos$\theta$ [ Work done by conservative force is negative of change in potential energy of system.]

It would make sense to integrate having definite limits then comparing the equations on both sides to understand what the potential of the dipole at and angle would be, I haven't done that in hopes that you can carry it from here(that is if you want it as such). Either way the result would be the same.


Outline fonts with opaque white centers?

Question: The outline fonts I'm finding define the black areas and their centers are empty, leaving the background colors to come through. I need a black outline with a white opaque center that overlays the background, preferably in the Arial family (or similar). Do such two-tone fonts exist?
Answer: You could simply use a standard font, set the text to white then apply a stroke to the edge.
In Photoshop...

Result...

It will round the corners slightly, but you can choose whether to round the inner corners [as shown], the outer, by swapping the stroke to 'Outside', or both by using 'Centre'
Answer: Current generation of fonts can only have one color. Older font technologies could do colored fonts. Also the next generation technology can do so, but its not entirely rolled out yet (but is basically same as earlier with xml tags).
The way you circumvented this is to have your editor stroke, or dropshadow the stroke. Or overlay two text on top one white and one outline.
Comment: Thanks for the explanation @joojaa. I wasn't very clear in my post that the app that renders the font doesn't have the ability to manipulate it aside from the bald, italicize, and underline, so your explanation of current fonts having only one color explains the limitation I'm seeing.


People can view the item which was added by them in the SPlist.Not able to view the item which was added by others

Question: i want the coding for People can view the item which was added by them in the list.....
[i need to add item in custom splist but that was not able to view by anyone...likewise people who are adding item in the same list which was not able to view by others(i gave permission to view my Splist for the user).]
Comment: Hi Hugh Wood.... For example if A has added some items to  SPlist, and B has added some items to same SPlist. Now my requirements as follows: A shouldnot able to see what B has added and B should not able to see what A has added ... Please Try to find  answer ASAP.. Thanx in advance...
Comment: I'm sorry can you please reword your question to attempt it to be a little clearer?
Answer: If I understood you correctly you need to set up Item-level Permissions.
Go to list settings -> advanced settings and set Item-level Permissions Read: Read items that were created by the user .
Edit after Ksesh comment:
Also set Create and Edit access to : Create items and edit items that were created by the user
Edit programmatically in shortcut:
<code>   SPList spList = SPContext.Current.Web.Lists["MyList"];
   spList.ReadSecurity = 2;
   spList.WriteSecurity = 2;
   spList.Update();
</code>
Comment: Plus I think permissions to create and change should be also changed to "created by a user"
Comment: hi...thanx for ur answer...but i want to do that by programmatically...
Comment: Ok, you can mark this answer as correct so other can find it.
Comment: hi jedrzej...how to set security for listitem programatically.i have two radio button.(i)view by every one (ii)me only...if i select 'view by every one' radiobutton when i add item to list.that item able to view by everyone.if i select 'me only'.then that item ll view by me ly.plz help me...is there any property to do this..thanx in advance..
Answer: This can be done without any line of code also i.e. Item-level Permissions in order to do that

Move to List Setting of said list.
Move to views in the page.
Click on "All Items".
Move to the filter.
check "Show items when the following is true"
Put the condition Created By "Is equal To" TYPE([Me])
Click on OK.

in short you need to put filter on public view for condition  "Created By "Is equal To" TYPE([Me])"


Over-provisioning an SSD - does it still hold?

Question: Multiple (but not very recent) sources suggest that ~7% of the SSD space should be left unallocated in order to reduce the drive wear. Is it still valid as for now or has the situation changed?
Comment: It does matter because of the TRIM-enable problem, as I said.  I suspect SU is a good fit for this question, but it does now need editing to mention Linux!
Comment: the free space is allows for better performance. Drive wear & tear is overstated and possibly a myth now. A good quality SSD can last over 10 years writing to it 24/7.  this might be a good article to review: http://www.howtogeek.com/165472/6-things-you-shouldnt-do-with-solid-state-drives/ - writing to an empty block is fairly quick, but writing to a partially-filled block involves reading the partially-filled block, modifying its value, and then writing it back. Repeat this many, many times for each file you write to the drive as the file will likely consume many blocks. ---
Answer: Windows will generally use TRIM.  This means as long as you have X% free space on the filesystem, the drive will see X% as unallocated.[*]  Over-provisioning not required.
Exception: historically, SSDs with Sandforce controllers/firmware have not restored full performance after TRIM :(.
Performance loss on the full drive can be significant, and more so than some other drives.  This will be associated with high write amplification, and hence increases wear.  Source: Anandtech reviews.
So it's necessary if and only if

you're not sure that TRIM will be used.  AFAIK it's still not enabled by default on Linux, because of performance issues with a few old & badly-behaving drives.
OR you're worried about filling a Sandforce drive (and that the content won't be amenable to compression by the smart controller).

It's not too hard to enable TRIM on Linux, and you're unlikely to notice any problems.
Fortunately, several of the most popular brands make their own controller.  The Sandforce controllers are not as popular as they used to be.  Sandforce issues make me skeptical about that specific "smart" controller design, which was very aggressive for its time.  Apologies to Sandforce but I don't have a reference for the exact controller models affected.

[*] Filesystems like having plenty of free space too, to reduce fragmentation.  So TRIM is great, because you don't have to add two safety margins together, the same free space helps both of them :).
The drive can take advantage of the unallocated space to improve performance, as well as avoiding high wear as you say.
Comment: Is it possible to detect a Sandforce controller once having an installed SSD?
Comment: There isn't a standard read-out or a test that I'm aware of.  You need to know what the drive is & try looking it up.  About all I can see is a "model number" e.g. in GNOME Disks like "M4-CT128M4SSD2", which might be awkward to match.  Sorry again.  I believe Samsung use their own controllers, and Crucial/Micron use Marvell.  OCZ/Toshiba have used various controllers including Sandforce.
Comment: This assumes that you actually *have* free space on the filesystem, right?  :D
Comment: Be specific as to what part you're responding to please, this was over a year ago. I think you mean "[hypothetical] I have no discipline,  need my system to push back against _continued_ abuse, and have no software to set a high water mark alarm".  Which is a perfectly valid criticism, albeit interesting from someone who would consider over-provisioning in the first place.
Answer: Modern SSD controllers are smart enough that overprovisioning is not typically necessary for everyday use. However, there are still situations, primarily in datacenter environments, where overprovisioning is recommended. To understand why overprovisioning can be useful, it is necessary to understand how SSDs work.
SSDs must cope with the limitations of flash memory when writing data
SSDs use a type of memory called NAND flash memory. Unlike hard drives, NAND cells containing data cannot be directly overwritten; the drive needs to erase existing data before it can write new data. Furthermore, while SSDs write data in pages that are typically 4 KB to 16 KB in size, they can only erase data in large groups of pages called blocks, which can be several hundred KBs to several MBs in size in modern SSDs.
NAND also has a limited amount of write endurance. To avoid rewriting data unnecessarily in order to erase blocks, and to ensure that no block receives a disproportionate number of writes, the drive tries to spread out writes, especially small random writes, across all of the underlying space. If the writes replace old data, it marks the old pages as invalid. Once all the pages in a block are marked invalid, the drive is free to erase it without having to rewrite valid data.
SSDs need internal free space to function optimally, but not every workload is conducive to maintaining free space
Because each block can contain varying amounts of invalid data waiting to be erased, the amount of free space that is internally available can be significantly less than what is logically available to the operating system.
A drive with little or no internal free space remaining may be forced to erase blocks immediately to allow new data to be written. Any valid data in those blocks must be rewritten into free pages in other blocks. If there aren't many free pages left, more blocks will need to be erased and rewritten, and so on. This process can occur several times for each individual write operation, especially if the drive is under a continuous stream of writes.
Such rewriting means that the total amount of data written to the NAND is greater than the actual amount sent to the drive. This phenomenon is called write amplification, and it can significantly degrade SSD performance and endurance. Write amplification is especially pronounced with random write-intensive workloads such as online transaction processing (OLTP). Applications that give more the drive more idle time, including everyday consumer usage, allow for background data moves that require less rewriting (and thus lower write amplification) than would be necessary if it had to make space for new data right away.
To reduce write amplification, most modern systems support a command called TRIM, which tells the drive which sectors no longer contain valid data and can safely be erased. This is necessary because the drive would otherwise need to assume that data logically deleted by the operating system is still valid, hindering its ability to maintain adequate internal free space.
But TRIM cannot completely eliminate write amplification. With wear leveling, random writes are scattered across all of the underlying NAND, so some amount of rewriting is inevitable even if the drive is logically nowhere near full. Furthermore, older operating systems and certain external enclosures may not support the TRIM command. In rare cases, a drive may appear to support TRIM but fail to internally free space, rendering the command useless.
Modern SSDs experience significantly less write amplification than older drives but some workloads can still benefit from overprovisioning
The earliest SSDs had immature firmware that tended to rewrite data much more than is necessary. Early Indilinx and JMicron controllers (the JMF602 was infamous for stuttering and abysmal random write performance) suffered from extremely high write amplification under intensive random-write workloads, potentially in excess of 100x. (Imagine writing over 100 MB of data to the NAND when you're just trying to write 1 MB!). Newer controllers, with the benefit of higher processing power, improved flash management algorithms, and TRIM support, can handle these situations much better, although heavy random-write workloads can still cause write amplification in excess of 10x in modern SSDs.
Overprovisioning provides a guarantee that there is some amount of free space available to handle random writes and minimize forced rewriting of data. All SSDs are overprovisioned to at least a minimal degree. Some use only the difference between GB and GiB to allow about 7% of the raw capacity to be used as internal free space. Conversely, drives intended for special applications may have significantly more overprovisioning. For example, an enterprise SSD for write-heavy OLTP or database workloads may have 512 GiB of physical NAND yet have an advertised capacity of 400 GB, rather than the 480 to 512 GB typical of consumer SSDs with similar amounts of NAND.
If your workload is particularly demanding, or if you're using the drive in an environment where TRIM is not supported, you can manually overprovision space by partitioning the drive so that some space is unused. For example, you can partition a 512 GB SSD to 400 GB and leave the remaining space unallocated, and the drive will use the unallocated space as spare space. Do note, however, that this unallocated space must be trimmed if it was previously written to; otherwise, it will have no benefit as the drive will see that space as occupied. (Partitioning utilities should be smart enough to do this, but I'm not 100% sure; see "Does Windows trim unpartitioned (unformatted) space on an SSD?")
If you're just a normal consumer, overprovisioning is generally not necessary
In typical consumer environments where TRIM is supported, the SSD is less than 70-80% full, and is not getting continuously slammed with random writes, write amplification is typically not an issue and overprovisioning is generally not necessary.
Ultimately, most consumers will not write nearly enough data to disk to wear out the NAND within the intended service life of most SSDs, even with high write amplification, so it's not something to lose sleep over.
Answer: The size of additional space differs very much between SSD drive models, but in general this is still true.
Comment: Yes, I was wondering whether this is still true for all drives, or only for specific models or brands, as the other answer suggests that over-provisioning is no longer necessary on recent drives.
Comment: From the doc for Samsung SSD: "there is always the option to manually set aside additional space for even further-improved performance (e.g. under demanding workloads)", i.e. they suggest you don't need to start considering this unless you have a "demanding workload".
Comment: Do you have any reference for this?
Comment: Do you mean reference for a specific drive? Many drives (not only SSD) have public technical references, but sorry, I don't have time to search. However if you're interested in general reference, check this: http://www.samsung.com/global/business/semiconductor/minisite/SSD/downloads/document/03_NAND_Basics.pdf
Comment: The other answer is not exactly right. Indeed drives with Sandforce controllers had plenty of additional space. That's perfectly true. But also any other SSD controller uses additional space, just not as much. As this probably won't change.
Comment: My answer is that you should be able to provide that additional space by a) enabling TRIM b) not abusing your filesystem by filling above 90% or something; this will also benefit the filesystem.  It does rely on you having the discipline not to use the filesystem at near-100% full for an extended period. I guess your point is that requirement may be unreasonable.  The unfortunate exception is that if you abuse a Sandforce drive and then clean it up by deleting files, the automatic TRIM will not restore the performance (and therefore write amplification must be staying high causing extra wear).
Answer: The minimum amount of over-provisioning for an SSD is set at the factory, but users can allocate more space for better performance. Either way, a moderate understanding of over-provisioning is necessary in order to make better SSD purchasing decisions and to configure drives in the most advantageous way possible for each unique environment and use case.
SSDs work very differently. The fundamental unit of NAND flash memory is typically a 4 kilobyte (4KB) page, and there are usually 128 pages in a block. Writes can happen one page at a time, but only on blank (or erased) pages. Pages cannot be directly overwritten. Rather, they must first be erased. However, erasing a page is complicated by the fact that entire blocks of pages must be erased at one time. When the host wants to rewrite to an address, the SSD actually writes to a different, blank page and then updates the logical block address (LBA) table (much like the MFT of an HDD). Inside the LBA table, the original page is marked as "invalid" and the new page is marked as the current location for the new data.
Of course, SSDs must erase these invalid pages of data at some point, or the usable space on the SSD would eventually fill up. SSDs periodically go through a process called garbage collection to clear out invalid pages of data. During this process, the SSD controller, or flash controller, that manages NAND flash memory in an SSD, reads all the good pages of a block
(skipping the invalid pages) and writes them to a newly erased block. Then the original block is erased, thus preparing it for new data.
All SSDs reserve some amount of space for these extra write operations, as well as for the controller firmware, failed block replacements, and other unique features that vary by SSD controller manufacturer. The minimum reserve is simply the difference between binary and decimal naming conventions. Many people are blissfully unaware that one gigabyte (GB) is precisely 1,000,000,000 bytes, and one gibibyte (GiB) is precisely 2^30 = 1,073,741,824 bytes, or about 7.37% more than a GB. Many people are also blissfully unaware that storage is properly measured in gigabytes, whereas memory is properly measured in gibibytes. Even though SSDs are built from NAND flash memory chips, they are marketed as storage devices, and SSD manufacturers reserve an extra 7.37% of memory space as a provision for background activities such as garbage collection.
So even if an SSD appears to be full, it will still have 7.37% of available space with which to keep functioning and performing writes. Most likely, though, write performance will suffer at this level.
In practice, an SSD's performance begins to decline after it reaches about 50% full. This is why some manufacturers reduce the amount of capacity available to the user and set it aside as additional over-provisioning. For example, a manufacturer might reserve 28 out of 128GB and market the resulting configuration as a 100GB SSD with 28% over-provisioning. In actuality, this 28% is in addition to the built-in 7.37%, so it's good to be aware of how vendors toss these terms around. Users should also consider that an SSD in service is rarely completely full. SSDs take advantage of this unused capacity, dynamically using it as additional over-provisioning.
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).


What is the difference between Ph.D, D.Sc, D.Litt, etc.?

Question: Is there any difference between Ph.D, D.Sc, D.Litt and the similar degrees?
Comment: If I remember correctly, MIT gave me a choice of getting a PhD or ScD for the same work when I completed my doctoral requirements in EECS in 1998.
Answer: The meaning of these degrees vary by country. In some countries (especially in Europe), PhD is the "basic" degree. It's the one you get out of graduate school. D. Litt (aka. Doctor of Letters) and D.Sc (Doctor of Science) are the highest conferred degrees. You need sustained achievement at the top before these are awarded. Here's a quote from the Wikipedia article on D. Litt:

The Litt.D. degree is awarded to candidates whose record of published work and research shows conspicuous ability and originality and constitutes a distinguished and sustained achievement. University committee and board approval is required, and candidates must provide documented mastery of a particular area or field. The degree may also be awarded honoris causa to such individuals as the university or the learned body in question deems worthy of this highest academic award.

D.Sc is similar, except it's for the sciences as opposed to social sciences. Again, see the Wikipedia article, except there're many non-European countries who take D.Sc to be effectively equivalent to PhD.
Answer: Speaking literally, nothing at all except an indication of the field. However, life isn't quite that simple. Doctorates in general are intended to be research degrees. Research in Literature, or Mathematics, or whatever. The actual choice of designation is up to a granting institution and/or some governmental authority.
A person with a doctorate is expected to have the skills to extend the known state of a field in meaningful ways. Moreover, he or she is expected to have demonstrated that skill via an accepted dissertation and some period of study. The study includes both the breadth of the field and particular depth in some (usually small) aspect of it. A Master's degree doesn't have the same expectations and normally, philosophically, a person with this degree should be able to carry on the normal work of the field and to move with the field as it changes. It normally stresses breadth more than depth in a subfield (though there are exceptions).
However, not all doctorates are created equal and not all are, in fact, accepted as Research Degrees. This may be especially important to a candidate for a degree, especially one contemplating an academic career.
The UK and other countries that follow UK traditions also have the concept of a "Higher Doctorate." for a discussion of that concept, see the answer of Allure here.
The NSF in the US keeps a list of "Research Doctorates" that it considers "equivalent" to the PhD. This has an impact on getting grants, especially from the NSF and may have an effect on tenure decisions.
Wikipedia gives some of the distinctions and local variations.
I also discussed the US position of the NSF as an answer to another question here: https://academia.stackexchange.com/a/112004/75368
Normally you would also name the field if you earn a more "general sounding" degree such as PhD, than a more specific one such as D. Litt.


How to cite AI generated images in a presentation?

Question: I'm making a presentation, and wanted to use some images from an AI tool as sort of stock imagery. How would I properly cite them? I'm making them myself using Midjourney, but could find no guidance on this. I would also be curious if that's different from images made with other models such as a public open source Stable Diffusion model.
Answer: I think that in the short term it is best if you just name the tool(s) you used. Longer term there may still be a question about who/what the creator of such an image should be. Where does any "creativity" lie?
I'll note that in the US, at least, the copyright office of the government has decided that AI generated images can't be copyrighted, implying that the AI itself isn't a creator. Whether creativity will be attributed to the person directing the AI, when that happens, might still be an open question.
But you lose nothing by mentioning your tools, in any case.
Comment: Gratefully thanking our soon-to-be AI Overlords might curry some favor...
Answer: The authorship and citation quagmire will remain with us for some times to come. Until then, we continue with principle of ethics.

making them myself using Midjourney, ... I would also be curious if that's different from images made with other models such as a public open source Stable Diffusion model.

Irrespective of Midjourney, Leonardo.ai, or even visualgptmaking extensive use of Stable Diffusion under the hood, the question remains, who is the author/owner.
For now, one might play it safe with

... image generated by author through AI generation using [tool] ...
image AI generated by author using [tool]

This approach will not be far off from how we handle Tables and visual representation of models/concepts that we use in our manuscript.


If all Jericho squads are doomed to die, how come we encounter previous versions?

Question: In Clive Barker's Jericho, the Jericho squad learns that there have been several predecessors (romans, templars and WW2 soldiers) before them. We later learn that the squad has to sacrifice itself in order to close the breach. It's not clear to me what this entails, specifically. If they would have to die, why would our squad encounter all the previous ones? What is the precise meaning of dying in the Box anyway? We learn that Ross didn't actually die when he was killed, but contrary to the previous Jericho squads he was non-corporeal.
Answer: Your link answers your question: They're not doomed to die. They have to sacrifice themselves, but not by dying.

When [the Jericho team] finally reach the point at which they can seal the breach, they decide that they should kill the Firstborn rather than try to reseal the breach, as resealing would just result in them being trapped in the Box and endlessly tortured until the breach was opened again.

Their sacrifice is not being able to return to real world (probably ever); getting tortured for eternity; and probably eventually corrupting similar to the Sumarian priests you have to fight as bosses during the game.
Comment: I don't get how the Wikipedia article arrives at this conclusion. Wikipedia shouldn't contain original work (and is not authoritative in itself). So I wonder from which canonical statements this was derived.
Comment: @bitmask: Canonically, all its previous keepers are stuck in the box. You see them in the game, often corrupted by the Firstborn. The "original work" is your question assuming "sacrifice" means "kill".


When should you build defensive armies in Stellaris?

Question: When should you build defensive armies in Stellaris? And how should you work out how many to build? At the moment (2260) I have no defensive armies anywhere.
Comment: This would depend upon what civilization you're playing as, which ones you're playing against, the decisions you've made up to this point, the current situation in the game, and your future plans. Depending upon these factors, the answer could easily be "never".
Comment: Thanks. I've found I can often build them fast enough after a declaration of war - certainly if I have spaceports on every planet the enemy might try to invade early on.
Comment: basically: when you need them. for example: if you have aggressive and expansive neighbors it might be a good idea to station at least a few defensive units per planet, just in case a surprise invasion is around the corner. on the other hand, if you plan to go crusading through the galaxy yourself you might as well build assault forces exclusively and let others worry about defense.
Comment: This is a good question and I've been wondering the same thing.  Its not clear what the advantage of having a defensive ground force vs defensive fleet.
Answer: Old question with a new answer since 2.2 "LeGuin":
You don't.
With the 2.2 rework of planetary population, defensive armies are no longer built directly, they are spawned automatically by certain jobs and buildings -- by default, that'd be the capital, police precincts and military forts/academies, the 'soldier' and 'enforcer' jobs.
Strictly speaking, I haven't found a lot of use for stacking massive amounts of defensive armies - if you're not at war they're not of much use and there are better jobs for your pops to be doing, and when you are at war it's a lot more cost effective to invest in space superiority so invaders won't get a chance to land in the first place.
Studoku correctly reminds me that the jobs that produce defensive armies also have side benefits - enforcers reduce crime, soldiers increase the naval cap, fortresses provide housing /and/ jobs, which may help overcrowding problems. Whether that's worth a building slot is up to you.
Comment: It's worth noting that the jobs that produce defense armies- soldiers and enforcers- have other uses. Soldiers increase your naval cap and enforcers reduce crime.


How to measure capacity of a Lithium-ion battery

Question: I bought a Lithium-ion battery for a camera (much cheaper than the brand replacement but non unreasonably cheap compared to AAA Li-Ion batteries with similar charge). I however have doubts that it has the capacity it claims on the package (in mAH). Is there a simple way for me to roughly verify the claim on the package which is more precise and less time consuming that to run some benchmarks with the camera and a comparison battery? I.e. is there some device / method that given a a Lithium-ion battery which is supposedly fully charged determines:

Is it actually fully charged
What is its current charge in mAH
Comment: Lithium ion batteries when sold should show a 60% charge if they have been properly stored. When storing lithium-ion batteries yourself you should discharge to 60% and keep in a freezer. This is for long term storage(read: Months), not for a couple days between uses.
Answer: Assessing full charge is the easy part.

Method (a) A fully charged Lithium Ion single cell battery will have an open circuit voltage of about 4.2 Volt*. (4.1 to 4.2 OK. 4.0 not quite there. 4.3 - a bit high.) Some cameras use two cells - double the expected voltages. Laptops and other larger devices use 3 or more cells. The voltage should be a multiple of the above voltage. [*There are variants that allow higher voltages. Unless you are CERTAIN that this includes your one, assume that it doesn't. Getting it wrong can be 'upsetting'.
(ie N x (4.1 to 4.2V))

Method (b) Use a good quality charger (eg one supplied by camera manufacturer or one of known quality) which has a "charging light.

| Added 2024: It is now reasonably common for chargers to be available which provide a bargraph display of battery state of charge. I personally find these very useful and recommend them.
When a fully charged cell is inserted in a charger - A good charger will display the full state and not restart charging. Some chargers will recommence a charging cycle regardless and then terminate after a period of typically tens of seconds to a few minutes.
Place "charged battery on charger". Depending on how long since it was last charged the charge light should either flash or perhaps remain on for a minute or two and then go off.|
Remove battery from charger. Wait 10 seconds. Place battery back on charger. Charge light should flash very briefly and go out.
Assessing capacity is harder, but not hard.
(a) you can get some indication, for nominally equal batteries, from the weight. A significant part of the weight in a LiIon battery is actively involved components whether electrically or mechanically  (separators, conductors, electrolyte & (of course) Lithium metal in ionic form.
(2024: A LiIon cell provides about 12 Wh per gram of 'metallic Lithium  equivalent' - or ABOUT 0.8g of Li by weight in a 10 Wh LiIon 18650 cell.).
Two batteries of the same nominal capacity should have similar weights. I'd guesstimate that a 10% difference may be due to happenstance and construction, but beyond that I'd be suspicious. In larger & heavier batteries this test will work better than for very small batteries.
For interest, for AA NimH cells this is an excellent indicator. Modern high capacity AA's which claim 2500 mAh + capacity should be in the high twenty gram range - say 26 grams plus with some just over 30 grams. Anything under 20 grams is a complete dud and anything 25 grams or below is suspect.
(b) For any sort of accuracy you need to discharge the battery to an "end point" and measure capacity. No other method reasonably available to you is available. There are other methods such as measuring the change in voltage over a given time under a given load and trying to assess where you are on the discharge curve. This is difficult to get right and needs experience and a degree of luck. Measuring discharge time is "easier".
Best is a constant current load, which can be made very easily with eg an LM317 and one resistor, but I'll assume for now that you don't want to do that. Ask if interested.
A discharge resistor that takes at least one hour to discharge should be used. You could use a motor or lamp or camera or ... but a resistor has some advantages.
R minimum ~= (Cells_in_battery x 4000) / mAh
eg if you have a 1 cell battery (Voc=~4.2V) of 1500 mAh capacity then

R = cells x 4000 / mAh = 1 x 4000/1500 = 2.666 ohm ~= 3 ohm or 3.3 ohm (std value)

Use the next largest resistor than the value calculated.
Up to Several times larger is OK BUT it will take proportionally longer.
Resistor power rating: Resistor power = V^2/R = (4 x number of cells)/R
eg for the above single cell and 3 ohm resistor the minimum wattage rating is

4 x 1 / 3 = 1.333 Watt.

Use a 2 Watt or greater resistor.
Method:
I'll describe this briefly as I don't know your experience level. This may be easy to follow or hard. If hard, ask more questions.

Attach temporary wires to battery terminals. Two paper clips bent at end resting on terminal is flat and accessible and held with weight or tape. Wires inserted into connector id not openly accessible. Some batteries will not provide power until you give them secret handshakes. but most will.

Battery with accessible terminals.

Below:  Harder to access terminals. Two dress making pins or two wires can work here BUT DO NOT SHORT TOGETHER !!! IF YOU ARE NOT COMFORTABLE DOING THIS DON'T DO IT.

Monitor battery voltage throughout. Multimeter connected to battery wires and set to appropriate range.

http://t2.gstatic.com/images?q=tbn:ANd9GcR4lcHSRViGF_kk58tbzmBWf9G11VxLY3J45qj0lW-_spRMZIiDNg

Connect resistor to battery leads. Start a timer. Monitor voltage. Stop at 3.2V per cell. DO NOT DISCHARGE BELOW 3 VOLTS PER CELL. STOPPING AT 3.2V IS A "GOOD IDEA". A LiIon battery may be damaged badly by very deep discharge. Set a timer. DO NO leave this running and walk away.

Below: Typical lithium Ion 1 cell 'battery' discharge curve.

Best method is to do this with genuine and clone batteries and compare times.

Method (c) Easiest :-).

Use a camera. Set to video or timed photos. Note start and end frame times. Compare.
Major advantages are

"set and forget

no playing with battery connections

self timing.

UPDATE - January 1st 2013 - Happy New Year.
I've just been asked offlist by somebody about the LM317 circuit I mentioned for constant current discharge. Here is an example. I copied this from the very useful and relevant webpage on LED driving - here and they in turn copied it from an LM317 data sheet.

The off list query said

You mentioned a way by using LM317 to determine battery capacity. I need to check a lithium ion battery with about 1700mAh capacity.
What do you recommend to me to measure this kind of battery capacity in a reasonable time like 3-4 hours.

A 1700 mAh battery would be discharged in 3 hours by 1700/3 =~ 570 mA and in 4 hours by 1700/4 ~= 425 mA. So using about 500 mA and seeing how long it takes will give a measure of battery capacity.
The current of the3 load in the circuit above is
Iout = Vref/R1  so
R1 = Vref/Iout
For an LM317 Vref = 1.25V so for 500 mA
R1 = V/I = 1.25V / 0.5A = 2.5 Ohm.
Power in R1 = I^2 R = 0.5^2 x 2.5 or about 0.7 Watt.
A 1 Watt resistor would probably survive this - a 2 Watt or 5 Watt would be better.
The LM317 will dissipate V_LM317 x I = (Vbattery - Vref) x I = (4.2-1.25) x 0.5 =~ 1.5 Watt. So a heatsink or piece of Aluminum or other thermally conductive material on the LM317 will be "a good idea". I use 4.2 V for the battery voltage. It will drop as the battery discharges.
Note that in many cases a 1700 mAh LiIon battery can be safely discharged at up to 1C rate - = 1700 mA in this case. Safer is C/2 = 850 mA. Actual max allowed rate should be set by the manufacturer. Use Imax = C/2 if no data available. This will usually be safe but "caveat emptor" / "YMMV" ... . If using a higher rate the power  dissipation in the resistor and LM317 will be higher and changes will be needed. Some LM317 will handle 1A max. Some will handle 1.5A. (Some smaller pkgs < 1A) . See data sheet. The LM350 is a big brother version of the LM317 that works at several amps.
The battery endpoint voltage should be the endpoint Voltage that you will use in your system. As per my comments above, this MUST NOT BE below 3.0V to prevent battery damage, and higher is safer. You need either to keep a close eye on this if stopping discharge manually OR set up an automatic cutoff system. How you do this and how you time the discharge period is up to you.

Added 2023 (from old comment of mine):
Some batteries have internal electronics that talk to the camera and report capacity. The capacity claim may be accurate OR the battery may be fully charged BUT the clone battery may not have emulated the original protocol accurately enough.
An often reasonably continuous load on a camera battery is to put it into USB mode. I have several cameras which do not shut down if there is no activity in this mode but simply drain the battery. This has the advantage of not over-discharging the battery.
You still need to manually time it.
Comment: My extensive professional experience is with NimH and not LiIon. I have good LiIon experience as a keen photographer with numerous Sony / Minolta system batteries.
  **IN MY EXPERIENCE:** Clones have slightly lower capacity than genuine. Some clones fail to extremely low capacity long before they should. Clones that are good in capacity tend to have poorer calendar lives than original batteries. Overall clones are inferior in a range of ways with the original batteries always being the best performers. But, value for money clones are good enough on average to be worth their price.
Comment: Great, detailed answer. I'll give that a go. Regarding 1b, I tried that but the results are odd. Both the external charger I used and the camera internal charger I used claim fully charged at the end of charging and agree with each other. When inserted into the camera and switched on (non charging mode) the camera claims that the battery is only about 1/3 charged. I'll try and verify voltage...
Comment: There is no *metallic* Lithium in Lithium-*ion* cells, e.g. see the Wikipedia article [Lithium-ion battery](https://en.wikipedia.org/wiki/Lithium-ion_battery). This is a widespread misconception, so it would be well worth the effort to fix it here, to help alleviate that.
Comment: @BillDubuque I'm not sure what part of the answer you are referring to. The closest I can see to what you say is "A significant part of the weight in a LiIon battery is Lithium metal."  This is a correct statement as it stands and is the manner in which the battery Li content is referred to in eg IATA and similatr airfreight regulations. It was not meant to be addressing the form in which the Lithium metal is present. | Avoiding metallic Lithium as "bare metal" is an important object of end of charge arrangements. Terminal voltages above 4.2V tend to plate out metallic Li - a VERY bad idea.
Comment: Yes, that statement is incorrect. **There is no Lithium *metal* in Li-ion batteries** (except trace amounts in rare exceptional conditions when it plates out due to over/too-fast charging). This (widespread) confusion causes many problems, e.g. firefighting techniques differ for cells containing Lithium metal (Lithium *primary* cells) vs. those that contain no metallic Lithium (Lithium-ion *secondary* cells). Please read the linked Wikipedia article to learn more about Li-ion batteries.
Comment: Some further corrections: (1) 4.2V is not necessarily 100% state-of-charge, e.g. many modern cells are charged to 4.35V not 4.2V. (2)  Many chargers turn on their "completely charged" indicator when the CV phase starts, which can be anywhere from 80-90% state-of-charge.
Comment: (3) It is crucial to use the correct current and termination-voltage when attempting to duplicate the manufacturer's capacity claims. Normally Li-ion cells are rated at C/5 discharge, terminated between 2.5-2.75V, but it is possible that cells intended for lower-drain devices (e.g. cell phones) may be quoted at lower drain rates. Consult the datasheet to be sure.)
Comment: Further, your (false) claim that "A significant part of the weight in a LiIon battery is Lithium metal" is inconsistent with your [answer here.](http://electronics.stackexchange.com/a/34504/40673) A typical 18650 weighs about 45g, but there you claim it has about 0.75g Lithium content, hardly a significant part of its weight. Even if you mean the nebulous "equivalent Lithium content", whatever its definition, surely it is not meant to be more than an order of magnitude different from the *actual* Lithium metal content.
Comment: What brand and model of camera and battery? Some batteries have internal electronics that talk to the camera and report capacity. The capacity claim may be accurate OR the battery may be fully charged BUT the clone battery may not have emulated the original protocol accurately enough. // An often reasonably continuous load on a camera battery is to put it into USB mode. I have several cameras which do not shut down if there is no activity in this mode but simply drain the battery. This has the advantage of not overdischarging the battery. You still need to manually time it.
Comment: the camera is a Sony HX9V and the battery is some no-name brand off e-bay. Not bottom of the heap though, cost $20 (which sounds reasonable for a 1400mAh battery), came in a well made package with grammatically correct English, boasts double IC circuit protection, knows the secret Sony handshake, and claims cells made in Japan.

The USB tip is great. Normal camera mode is very unpredictable in battery drain as these fancy cameras spend a lot of energy in processing to find faces, adjust exposure, make sure everybody smiles, do GPS, ... which is hard to control.
Comment: The failure mode of a cheap battery is more likely to be low cycle life than low capacity.  It's a design tradeoff and a scammer would probably choose to make the battery test well in a handful of cycles and fail after a month instead of a year.  By then they've changed their seller ID on eBay.
Answer: Yes, you need a dummy load and a way of measuring voltage (i.e. multimeter)
It can be as simple as a resistor, but the current will drop alongside voltage, so mAh is a little "harder" to calculate. A constant current dummy load is probably preferable. This can be bought as an IC, or easily made with an opamp, or a couple of transistors (you can use one but not as accurate, a thing called a cascode is better)
Either way, say your battery starts off at 4V fully charged (usually around 4.1 to 4.2V really), and you place a 40 ohm resistor across it. This will cause 100mA of current to flow. If you measure the voltage regularly, you can calculate the current flowing. When the battery is flat you can integrate the readings gathered to give you battery capacity in mAh. So if you were to read hourly and you get 10 readings of 100mA before the battery is considered flat (around 3V usually, be good to be whatever manufacturer tests to, but voltage will drop quite steeply at end of capacity), you have a 1000mAh battery (In reality the current will drop unless you use a constant current load)
Note that batteries will usually have less capacity at higher currents, so if you draw 1A the overall mAh will be lower. I would select a value that is low enough for the battery to perform reasonably (whatever the manufacturers tested at, if there is a datasheet available - probably quite low)
You should end up with something like this when you plot your results (note the x axis is in Amp hours:

C is the discharge rate needed to discharge in 1 hour, so for a 1000mAh battery 0.1C is 100mA, 1C is 1A, 18 C is 18A. You can see how the capacity drops at higher discharge rates. NOTE - (as Russell mentioned) do not attempt to discharge at large currents (e.g. much above > 1C) unless you are absolutely sure the battery can handle this (e.g some camera batteries and RC batteries can discharge at huge rates) The above pic is only meant to be an example of discharge curves.
Also make sure the resistor (if you use one) is accurate (1% or less if you can) and rated for whatever power you need it to handle. For the above example at 0.1A and 4V, you have 0.4W, so you need at least a 0.5W 40 ohm resistor.
Comment: Do not discharge standard lithium Ion batteries at faster than the 1C rate eg not more than 1500 mA for a 1500 mAh battery. Some standard batteries will allow 2C discharge and some special batteries much more **BUT** trying to discharge a standard battery at say 10C may be the last discharge it ever does. "Vent with flame" is the standard euphemism.
Comment: Yep, good point I'll add this. The pic was just an example of what curves should look like, not a recommendation for discharging at 18C :-)
Answer: For info: I've been measuring lithium ion cells with 100mA constant current and 3.5 minimum shutoff voltage. Found the general, inexpensive 14500 cells stamped with 4000 mAhr show about 150 to 325 MaH capacity. The larger 16850 also stamped 4000 mAh show about 1000 to 1600 mAh capacity. I recently dismantled old laptop batteries and found they were unmarked 16850 type but all had capacities of 1760 mAh. Running higher discharge rates drastically reduce the capacity as mentioned in this article. It is best to quantify battery capacity requirements according to your circuit design to determine actual time of use. The difficulty is finding batteries to buy that state "honest" ratings.
Answer: I don't know if anyone is ever going to read this response, since it's been years since the last one, but here is my approach, havind had the same question: what's my LiIon battery's capacity.
Wel I figured waht I was really interested in was: how much charge is delivered between a fully charged state and the battery shutting down. Shutting down, in my case, meant that the equipment started beeping, meaning that it wanted to be recharged.
To charge the battery I use a simple usb cable, but with a device that measures voltage, current, time, and total milliAmp-hours.  These gadgets can be found on the internet and are cheap.
So, to determine the capacity of the Li-Ion battery at hand, just let it die down and recharge it. The amout of mAh shown in the recharge dongle is the effective capacity.
I understand that Li-Ion batteries do not get hot or anything, and any mAh going in during charging, is available for discharge in operation as well. So, the number you find fully charging it should give you the answer.
Comment: Not really, if you measure the power going in some will be wasted as heat and is not recoverable when pulling energy back from the battery. The way to determine how much charge you have is usually done from the batteries characteristic curve.
Comment: "Charge efficiency is about 99 percent and the cell remains cool during charge". This I read on the "http://batteryuniversity.com/learn/article/charging_lithium_ion_batteries" page. Any heat wasted is wasted outside the battery, i.e. the voltage difference between charger and battery times the charge current.
Comment: I've recently bought one of these USB testers and you have to understand what's happening under the hood to interpret results correctly. Charging is done with 5V (as you said you use USB), but the battery's internal voltage is between 3.7V and 4.2V. Therefore you'd need to correct for the voltage conversion: the same amount of charged energy (expressed in Wh) yields a smaller mAh value displayed by the USB tester gadget equivalent to an approximately 25% higher mAh value received by the battery. Same for discharging: a booster circuit increases a power bank's voltage output.
Comment: Good point: know what's going on under the hood.  In smaller devices, the "voltage conversion" from 5 to 3.x Volts is performed by a diode and resistor in series, with a level detector that says "enough already" by means of a led.  In that case mAh registered at the USB output is the actual charge.

I fully appreciate that that's not the best way to charge a Li-Ion battery, but it was the situation I was dealing with when I wrote my original response.  Thanks for the comment.


How much time is there before my loot disappears ?

Question: Sometimes, fights get too intense that I cannot pick up my loot right away... How long does it last before it disappears? Does it stay there indefinitely until you load into a different area?
Comment: It doesn't seem to stay indefinitely, and it seems that the rarity of the item might have an effect on how long it stays around. As far as actual times, there doesn't seem to be any consensus on the internet as to the specific time it takes for items to disappear. Here's a link to a discussion on the same topic: http://www.gamespot.com/borderlands/forum/did-anyone-ever-have-items-on-the-ground-shrink-until-they-disappeared-52573223/
Comment: @A.Still Is that an answer?
Comment: Since it was all just conjecture and speculation, I didn't want to offer it as an answer. I usually like to be a bit more definitive when I offer up an answer.
Answer: Got this from http://forums.gearboxsoftware.com/showthread.php?p=2083544...
There is no set time-limit for loot, though the PC's INI files contain a few setting for influencing it.
ShortLivedDropLifeSpan=600
LongLivedDropLifeSpan=1800
PickupShrinkDuration=15
The first two adjust the time certain loot is kept around, and it depends on whether an item is short-lived (money) or long-lived (Orange weapons).
The last one is the time-to-shrink setting. You have noticed that some loot starts to shrink before it disappears entirely, right? The default is 15 seconds, I believe. I have set it to 1 second at times, and the stuff shrinks and disappears very quickly.
My observations...
Each item type has a different setting for whether it's short-lived or long-lived. Money seems to disappear first. White weapons disappear before green which disappears before blue... and so on.
The overall lifetime of loot appears to adjust on an as-needed basis. If there is a ton of loot hanging around - hundreds of items - then loot will start to disappear sooner. I suspect this is done to keep the engine from over-loading.
When opening hundreds of chests in my test map, white weapons would disappear by the time I opened two more chests. By the time I opened the last chest, only purples and oranges remained, and only in about half the chests.
In the end, loot should stick around for at least 5 minutes as long as there isn't too much loot littering the ground.
Good loot, like Legendaries, should stick around for a half hour. Again, as long as there isn't too much loot littering the ground. But since all that other, lesser loot will disappear first, the good loot should remain for quite a while.
Answer: The time is dependent on two factors:

the rarity of the items in question
how many are on the battlefield.

The lower rarity an item has, the less time it will stay on the battlefield. Legendary and pearlescent items however, will stay indefinitely. Also the more loot there is on the ground, the quicker the items will disappear.


I want to protect a way of illustrating grammar

Question: I have a system of illustrating grammatical concepts with graphical representations. It is interactive, and will be displayed on a web page. I don't know if it counts as a "program" or not, and I wonder if I am looking at a patent or a copyright. I don't want to be too descriptive here, obviously, but I wonder if someone can help me onto the correct path.
Comment: It is not just patent or copyright, it might be patent and copyright. Copyright is a given.
Answer: I am not a lawyer, but I do have patents. Copyright is a given. Your specific implementation will be copyrighted as will the underlying code. Whether or not your product is patentable is more complex. It certainly might be, but it depends on stuff that is technical legally. Certainly where you might decide to patent it matters. Also, the normal requirements for patentability are required such as usefulness, novelty and non-obviousness. What I will say is that you would be very well served to consult with an actual patent attorney. We can't tell you whether your product is patentable as you can't publicly disclose it to us. If you do seek a patent attorney, try to fine one with experience in software patents.


Apache mod_proxy port redirect for game server?

Question: I've got a game running on port xxxx (server, that is). I made a rule for mod proxy in Apache to forward that port to 25555 /game (which theoretically should work. Problem comes when conencting, since I'm led to believe that the Headers are incorrect or basically Apache mod proxy only works with http or ftp traffic. It doesn't forward all packets directly to the destination and back with proxy reverse? For websites on other ports it works, just not anything non-http or ftp.
Example config:
(only summarizing)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /folder/ http://localhost:8180/folder
ProxyPassReverse /folder/ http://localhost:8180/folder
Answer: Yep, proxying is for specific types of traffic. HTTP, FTP, AJP, etc. By its nature a proxy server needs to know the nature of the traffic its dealing with. Proxy/Apache is not the correct tool to use for port forwarding of any connections/traffic. You need some other lower level network utility for generic forwarning.
If you're on linux I think you can use iptables or something for this. Maybe go and ask on Server Fault, as generic forwarding is more suited over there.