UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3'

Question: I have an Excel spreadsheet that I'm reading in that contains some £ signs.
When I try to read it in using the xlrd module, I get the following error:
x = table.cell_value(row, col)
x = x.decode("ISO-8859-1")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)

If I rewrite this to x.encode('utf-8') it stops throwing an error, but unfortunately when I then write the data out somewhere else (as latin-1), the £ signs have all become garbled.
How can I fix this, and read the £ signs in correctly?
--- UPDATE ---
Some kind readers have suggested that I don't need to decode it at all, or that I can just encode it to Latin-1 when I need to. The problem with this is that I need to write the data to a CSV file eventually, and it seems to object to the raw strings.
If I don't encode or decode the data at all, then this happens (after I've added the string to an array called items):
for item in items:
    #item = [x.encode('latin-1') for x in item]
    cleancsv.writerow(item)
File "clean_up_barnet.py", line 104, in <module>
 cleancsv.writerow(item)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2022' in position 43: ordinal not in range(128)

I get the same error even if I uncomment the Latin-1 line.
Comment: I don't think so. The preceding line is x = table.cell_value(row, col), from the xlrd module, though - maybe that's doing something funny?
Answer: A very easy way around all the "'ascii' codec can't encode character…" issues with csvwriter is to instead use unicodecsv, a drop-in replacement for csvwriter.
Install unicodecsv with pip and then you can use it in the exact same way, eg:
import unicodecsv
file = open('users.csv', 'w')
w = unicodecsv.writer(file)
for user in User.objects.all().values_list('first_name', 'last_name', 'email', 'last_login'):
    w.writerow(user)

Answer: For what it's worth: I'm the author of xlrd.
Does xlrd produce unicode?
Option 1: Read the Unicode section at the bottom of the first screenful of xlrd doc: This module presents all text strings as Python unicode objects.
Option 2: print type(text), repr(text)
You say """If I rewrite this to x.encode('utf-8') it stops throwing an error, but unfortunately when I then write the data out somewhere else (as latin-1), the £ signs have all become garbled.""" Of course if you write UTF-8-encoded text to a device that's expecting latin1, it will be garbled. What do did you expect?
You say in your edit: """I get the same error even if I uncomment the Latin-1 line""". This is very unlikely -- much more likely is that you got a slightly different error (mentioning the latin1 codec instead of the ascii codec) in a different source line (the uncommented latin1 line instead of the writerow line). Reading error messages carefully aids understanding.
Your problem here is that in general your data is NOT encodable in latin1; very little real-world data is. Your POUND SIGN is encodable in latin1, but that's not all your non-ASCII data. The problematic character is U+2022 BULLET which is not encodable in latin1.
It would have helped you get a better answer sooner if you had mentioned up front that you were working on Mac OS X ... the usual suspect for a CSV-suitable encoding is cp1252 (Windows), not mac-roman.
Comment: "Reading error messages carefully aids understanding." True when the error message is not cryptic. Perhaps not in your code, but there's plenty of error messages out there that were clearly never intended to be read, at least not by earthlings
Answer: Your code snippet says x.decode, but you're getting an encode error -- meaning x is Unicode already, so, to "decode" it, it must be first turned into a string of bytes (and that's where the default codec ansi comes up and fails).  In your text then you say "if I rewrite ot to x.encode"... which seems to imply that you do know x is Unicode.
So what it IS you're doing -- and what it is you mean to be doing -- encoding a unicode x to get a coded string of bytes, or decoding a string of bytes into a unicode object?
I find it unfortunate that you can call encode on a byte string, and decode on a unicode object, because I find it seems to lead users to nothing but confusion... but at least in this case you seem to manage to propagate the confusion (at least to me;-).
If, as it seems, x is unicode, then you never want to "decode" it -- you may want to encode it to get a byte string with a certain codec, e.g. latin-1, if that's what you need for some kind of I/O purposes (for your own internal program use I recommend sticking with unicode all the time -- only encode/decode if and when you absolutely need, or receive, coded byte strings for input / output purposes).
Comment: Thanks. I guess it's unicode then - but I need to encode it to write it out to a CSV file. When I try to encode it into latin-1, I get another error. Please see my update above...
Comment: Figured it out - the line I needed before writing to CSV was item = [x.encode('mac_roman') for x in item]. Accepting this answer because it helped me work out what was happening - thanks.
Comment: @alex-martelli I would be happy to get your advice on [this question](http://stackoverflow.com/questions/23013236/how-to-encode-xml-into-esri-shapefiles-using-python).
Answer: x = x.decode("ISO-8859-1")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)

Look closely: You got a Unicode***Encode***Error calling the decode method.
The reason for this is that decode is intended to convert from a byte sequence (str) to a unicode object.  But, as John said, xlrd already uses Unicode strings, so x is already a unicode object.
In this situation, Python 2.x assumes that you meant to decode a str object, so it "helpfully" creates one for you.  But in order to convert a unicode to a str, it needs an encoding, and chooses ASCII because it's the lowest common denominator of character encodings.  Your code effectively gets interpreted as
x = x.encode('ascii').decode("ISO-8859-1")

which fails because x contains a non-ASCII character.
Since x is already a unicode object, the decode is unnecessary.  However, now you run into the problem that the Python 2.x csv module doesn't support Unicode.  You have to convert your data to str objects.
for item in items:
    item = [x.encode('latin-1') for x in item]
    cleancsv.writerow(item)

This would be correct, except that you have the • character (U+2022 BULLET) in your data, and Latin-1 can't represent it.  There are several ways around this problem:

Write x.encode('latin-1', 'ignore') to remove the bullet (or other non-Latin-1 characters).
Write x.encode('latin-1', 'replace') to replace the bullet with a question mark.
Replace the bullets with a Latin-1 character like * or ·.
Use a character encoding that does contain all the characters you need.

These days, UTF-8 is widely supported, so there is little reason to use any other encoding for text files.
Answer: xlrd works with Unicode, so the string you get back is a Unicode string. The £-sign has code point U+00A3, so the representation of said string should be u'\xa3'. This has been read in correctly; it is the string that you should be working with throughout your program.
When you write this (abstract, Unicode) string somewhere, you need to choose an encoding. At that point, you should .encode it into that encoding, say latin-1.

>>> book = xlrd.open_workbook( "test.xls" )
>>> sh = book.sheet_by_index( 0 )
>>> x = sh.cell_value( 0, 0 )
>>> x
u'\xa3'
>>> print x
£

# sample outputs (for e.g. writing to a file)
>>> x.encode( "latin-1" )
'\xa3'
>>> x.encode( "utf-8" )
'\xc2\xa3'

# garbage, because x is already Unicode
>>> x.decode( "ascii" )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0:
ordinal not in range(128)
>>>

Answer: Working with xlrd, I have in a line ...xl_data.find(str(cell_value))... which gives the error:"'ascii' codec can't encode character u'\xdf' in position 3: ordinal not in range(128)". All suggestions in the forums have been useless for my german words. But changing into: ...xl_data.find(cell.value)... gives no error. So, I suppose using strings as arguments in certain commands with xldr has specific encoding problems.


What are the pros/cons of splitting date and time into separate fields vs. using the datetime data type and storing the date in a single field?

Question: My database is extremely large and growing at a rate of ~20m rows/day.  I have timestamp data that is important but most of the reporting is based on date ranges and week over week or month over month comparisons.  Time is displayed in the result sets occasionally but never used as a criteria.  Given this, I'm thinking that I'd save considerable storage space with an index on date alone vs a combined datetime field.  I'm not sure if I would also see performance gains in my selects or if there are any disadvantages to splitting into 2 fields.
Comment: I see only pros and no cons - with your requirements - but I'm sure you'll get more thorough answers.
Comment: Agreeing with @ypercube I would push forward and consider adding `week` and `month` fields as well.
Comment: One disadvantage of splitting is if anyone wants to map the same table in an ORM mapper, and if that mapper doesn't support one or both of those datatypes.
Comment: As far as the mention about narrower index width, you wouldn't consider that alone, but also whether dropping the unneeded time component from the index rows would perhaps greatly reduce the total number of unique index rows that need to be stored in the index. E.g., if the index is defined primarily by the timestamp data, and the 20 mil. rows are well enough spread over the time component, then eliminating the time component could reduce the number of index rows per day by a ratio of 1000's or 10's of 1000's to 1.
Answer: For reporting purposes splitting the field out into date and time has some benefits.  Some possible benefits you could realise include:

You can make a date reference table (much the same as a date dimension in a data warehouse) with your breakdown into weeks, months etc.  This can be keyed on the date and used with a join.
Analysis by time of day is easier with a separate time field.  You can also round the time to an appropriate grain and make a reference table.
The index would be slightly narrower although each leaf row still has a (IIRC) 6 byte page reference, so it's not such a great saving overall.

For your application you might get a win from a date reference table (make a clustered PK on date for efficient lookup), which will probably be more efficient than de-normalising the week and month onto your large table.
Answer: The index performance should not change.
In a sorted array or tree structure (i.e. the index), asking for "all entries where  is equal to " requires a lookup of the first and last entries in the range, same thing as when asking for "all entries where  is greater or equal midnight on  and smaller than midnight on ".
What might be interesting is an index on MONTH(datetimecol>) and other commonly used expressions in your queries, which will permit using an index scan to find all rows with a matching month, if you want to trade the extra space for this index for elevated performance.
From a storage space POV, I doubt it matters compared to the size of the data tables.


Who are the other immortals in the Vampire Chronicles?

Question: I remember Marius telling Lestat that there were other immortals which were not vampires (Possibly in The Vampire Lestat). That he had seen them on a few occasions over the course of a century or more. Were these other immortals ever identified?
Answer: The only one she has written about is Ramses the Damned.  In that book several others were made with the elixir of life, but as Ramses was sleeping throughout Marius' life, and the immortals made in Ramses the Damned were not alive yet it is assumed he has made other immortals throughout the years that have not been written about.  As Marius said, at least one is female.
Answer: The other Immortals refers to the now extended universe of Anne Rice, they would be the vivid blue eyed Immortals made from the Elixir of Life from the Ramses The Damned series. The Morphenkinder/Werewolves that do not age and are invulnerable to disease from The Wolf Gift series. The Forest Gentry- spirits who were once human yet chose to remain on earth and are able to create solid bodies for themselves by drawing microscopic particles of solid matter to themselves, also from The Wolf Gift series. The Taltos that age rapidly from birth to full adulthood in mere days and who are atleast 7 ft tall, who also cease to age upon becoming fully grown, featured in the Mayfair Witches series. The Replimoids/aliens from the star system known as Bravenna who made Amel an Immortal body, featured in the book Prince Lestat and The Realms of Atlantis. In The Wolf Gift series I believe the Werewolves servants are subservient Elves/Fairies who do not age either and exist to serve other Immortals as servants in exchange for their protection as they are weak and peaceful beings. I don't know if she's mentioned any others but I do so wish she was still alive to continue her beautiful fictional universe. :(
Comment: Done, books added, and split into sentences.  :)
Comment: Much better, thank you! +1
Answer: I never finished the more recent books, but I don't think they were ever directly identified; I believe it was Anne Rice's way of setting up a possible cross-over to some of her other books, like Servant of the Bones and Ramses the Damned.  (Much as she brought in the Mayfair Witches in some of the later Vampire books.)
Comment: This is the correct answer, or at least part of it.  Mummies were one of the other immortals who walked in the light that Marius feared.  It's possible that the ghost/demon in the witches series was another type of immortal.
Answer: It has been rumored that Anne Rice did this intentionally in order to set the stage for other books like for the new Werewolf book that is about to come out. However, there is no evidence that this rumor is true.
The more likely explanation, is that when Marius said "other immortals", it was in the context which was regarding "other vampires".
QUOTE:

"He spends his time as a vampire, observing, roaming and studying,
  never evoking danger from other immortals. Having grown up around the
  rich influences of sculptors, painters and poets, Vittorio still
  spends most of his nights roaming the city streets of Florence. After
  a little minor background history and a quote from Sheridan Le Fanu,
  his story begins."

Also:

"Right now I must explain that before this adventure commenced, I was
  also grieving for the other immortals I had known and loved, because
  they had long ago scattered from our last late-twentieth century
  gathering place. Folly to think we wanted to create a coven again.
  They had one by one disappeared into time and the world, which was
  inevitable."

As you see, the context in these quotes is regarding other vampires.
It is this dynamic, multifaceted language that makes Anne Rice's writings so interesting, fascinating, and transfixing.
Comment: No, Marius says there are other Immortals that ARE NOT VAMPIRES, that he has seen them. He wasn't speaking of other vampires. I don't particularly want to go through tons of internet pages to find the exact quote. Mine are audiobooks.
Answer: No. Based on recent books they were either mummies or ghosts/spirits who'd learned to form bodies for themselves by magnetically drawing particles out of the air to themselves.
Comment: Can you add a reference for this?
Comment: The Mummy, and Prince Lestat, where the identities of the other immortals is revealed.


Is it legal to display user airline seat info on a public platform with absolute user consent

Question: Planning a public platform to display user seating info after taking proper user consent , will that still attract legalities if user is ok with it , will it fall under any legal clauses under GDPR regulations.
Comment: If you fulfill the Art 7 conditions for consent this should be fine, although you will still have to comply with all GDPR requirements (information, access, erasure, etc). Could you explain a bit more for which *purpose* the seating info should be published? Will you obtain the data from users or third parties?
Comment: What do you mean by "user seating info"?
Comment: the passenger name and the seat number where he/she will be sitting will be displayed if the user is willing .
Answer: Consent is necessary but not sufficient. You must still obey by the other GDPR rules as well. If the user changes his or her mind, for instance, you must remove the data.


Single file compilation and execution in Visual C++ 2008?

Question: I am doing a tutorial on C++ (learning it). The best way to learn is by example. I have little .cpp files with not much in them. I am using the best C++ IDE (Visual C++). Is there a way where I can have a project called "Tutorial Guide" and make my .cpp and .h files, BUT when I run them, it only runs the current file. I have heard that the debug runs ALL the files in the project and that would be a chaos in a tutorial type project. Please respond with Visual C++ answers only. No "make the .cpp and compile with Cygwin" or "use this ide instead". I would like to familiarize myself with the Visual C++ IDE.
Answer: You cannot do it like you seem to want, a project implies a single output executable. What you can do is create an empty solution first then for each .cpp file you create a new project (right click the solution icon in the solution explorer and select new project).
You can then right click each project and select "Set as startup project" this will change which one runs when you hit debug.
Comment: Or you can right-click on a project in Solution Explorer and run/debug that specific project using its context menu. But, yes, 1 project per output .exe would be a requirement.
Answer: From your question your best bet would be to do each tutorial as a district project.  That way you could easily organize your projects and VS will build them all as you requested but will only run the project you have selected as the startup project.


Australia visa Immigrant country-of-origin preferences?

Question: Just a general question for those lucky enough to hold dual-triple-etc citizenships. Does Australia Immigration have preferences/bias to the number of skilled independent worker visa's (subclass 189) given out to different countries? (e.g. is it better to apply with an EU – European Union, Germany or UK for example – citizenship, a USA citizenship, or Canadian citizenship?)
Answer: No.  All preferences accorded to country of origin, citizenship, race, ethnicity etc were abolished in 1973, along with the last remnants of the White Australia policy:

In 1973 the Whitlam Labor government took three further steps in the
  gradual process to remove race as a factor in Australia's immigration
  policies.
These were to:

legislate that all migrants, of whatever origin, be eligible to obtain citizenship after three years of permanent residence
issue policy instructions to overseas posts to totally disregard race as a factor in the selection of migrants
ratify all international agreements relating to immigration and race.

And while there are overall caps and quotas on certain types of visas granted per year, as far as I'm aware there are none on visas per country.
Note that there are some temporary visas (eg. working holiday) that are restricted to nationals of some countries, but this is mostly a quid-pro-quo thing, and none of these are an official path to getting residence in Australia.
Comment: This does answer my question, I have looked into the quota's for each type of visas, and the breakdown per job type applicant (which is what brought me to ask this question to maybe have an edge). I guess I'll just have to start the process and see what happens. Thanks for the response :)


Referencing to Equations in word 2010 - problems with parantheses

Question: I use equation referencing word, in particular a solution on using a table with equation numbering suggested here how easily add equation numbers in word.
In addition, I want to add parantheses arround the equation number so, for example (1.1). I did this manually in the template created in the link given above. So I added ( and ) left and right of the equation number and saved it as a formula template. With each new template added, there is now a nice equation number in parantheses (1.2)... that is automatically created.
However, now I want to cross-reference the euqation. When I add the complete labeling it will add (1.1). However, now I want only the number. When I select 'only category and number' it will add
(1.1
If I select add only label it inserts
)
This is strange, but reproducible, if you just create a simple equation number and add parantheses. Now add a cross-reference in the way described above and hte problem occurs. Is there a way to avoid this and only get the number?
Answer: It seems to be that "(" is recognized to be part of the number format but ")" not. I have no idea how to solve this issue with cross referencing the equation number. My suggestion is a workaround.
What I am doing to avoid this problem is setting a bookmark for "1.1" (not on "(1.1)") and cross-referencing the bookmark.
I got this solution from here: http://www.pcreview.co.uk/threads/possible-to-have-a-linked-autonumber-field.2850387/


What is the unit of measurement of fatigue damage in a structure?

Question: I looking the specific meaning of fatigue damage in structures. I have one structure and which is subjected to repeated loading cycles. I want to see is this design is safe from fatigue point of view.
Comment: Related: https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19970025228.pdf
Answer: Damage calculations use S-N curves, which define the number of cycles to failure, N(S), for stress range S.
The damage value itself can be thought of as the proportion of the fatigue life that is used up by 1 cycle of stress range S.
$$D(S) = \begin{cases}
\dfrac{1}{N(S)} &\text{if }S > FL \\
0               &\text{if }S \leq FL
\end{cases}$$
$FL$ is the defined endurance limit below which no damage occurs.
There are 3 models of mean stress effects Goodman, Soderberg and Gerber. Each one has its own formulas. This is so because mean stress effects are handled by modifying each stress range according to a formula dependent on the mean stress level.
T-N curves are handled in a similar way. A T-N curve defines the number of cycles to failure, N(T), for effective tension range T. There is no analogue of endurance limit for T-N curves. Likewise there are no analogues of stress concentration factor and thickness correction factor.
As for S-N curves, damage is defined as:
$$D(T) = \dfrac{1}{N(T)}$$
The summation of damage is then performed in an identical manner to that performed for S-N curves.
So that would be your unit: number of cycles before failure.
Comment: first of all thank you for your effort, I am aware of all this stuff, My question is little different, i.e. suppose one structure is subjected to cyclic loading above FL, then as the number of cycle increase (bellow failure) what changes in the structure can be seen at macroscopic level, since the fatigue is consider to be linear cumulative damage, so where does the damage(hypothetically) stored in the structure?
Comment: The fatigue is linear in the case we deal with linear tensor forces. In the case of cyclic bending, for example, distribution is no longer linear and damage will be done in a reverse-gaussian manner (more on the outer sides of the material and less near the middle of it). If you have a practical example I'm sure we could explain a lot better. In general situations, I personally use (along with other researchers) a SID (structural integrity damage) scale, witch measures integrity of a material between 0 and 100%. This becomes simple to apply to any material with known mechanical properties.
Comment: Thank you for explaining, I am having long flexible pipe and which subjected to the random loads. I have stress time history of the pipe, I just want to know is the minners rule is sufficient to calculate fatigue  damage? or do I need to use some other method?
Comment: In this case tension is way less relevant, so yes, Miner's Rule / Cumulative Damage Models are the thing you'd want to apply. If you have time history/stats and you know the exact pipe material you could even get a good estimate of its remaining lifetime until damage exceeds a safety limit value.
Answer: Typically you might use Miner's Rule and compute the Damage Fraction which is the percentage of predicted life consumed. It's a simplified model though and there are better ways using software like ALTA
Comment: that is what i want to understand, As the number of loading cycles increase the damage index D increase, now what does that damage index meaning in regards of structure, i.e. if I talk about deflection as I increase load deflection increase in similar way as i increase number of loading cycles what does it show on the structures? I hope my question is clear
Comment: Just as an aside, though the link leads to aerospacengineering.net, Miner's Rule is also applicable to structures (at least Brazilian codes make reference to it).
Comment: @Wasabi aircraft and the like ARE structures
Comment: @DLS3141: Sure, but the loads and behavior of aircraft are quite distinct from structures. If nothing else, aircraft suffer significantly more violent dynamic loads than structures, meaning that fatigue is usually more of a concern for aircraft (but must also be checked in structures, of course). My comment was mainly to remove the issue of "ok, so this can be used to describe the behavior of an aircraft's wing, but how applicable is this to structures?"
Comment: @Wasabi the structures and loads are different, but the idea of cumulative damage and its application to predicting life are the same.
Comment: @DLS3141: I agree. I was just quelling any possible doubt the asker might have had that that wasn't the case. We are in agreement here.
Comment: @Wasabi I have no issue with minners rule I can understand that, my structure is actually offshore related which comes under the cyclic loading, As the understanding part is concern I just want to know how the fatigue can be seen from macroscopic point of view, that is as I mention the example of the deflection in my previous comment...


When to use SQL Server or MySQL and when to manage data myself

Question: If I have a small database with fixed table layouts can I get any kind of performance benefit from handling the data myself rather than using a backend like MySQL? What are the benefits to using such a database backend?
Answer: Handling the data yourself usually means saving them in flat file and accessing them with custom code.  In this case they are easier to migrate and deploy, sometimes with better performance but not always, and performance should not be a concern for small data set much less the concern.
Using a database make it harder to corrupt the data when multiple users change the data at the same time, easier to filter/sort the data, easier for other programmers to maintain, more data tools to integrate with (charts, data forms, reports, etc.), data is less likely to be tampered by user, and your hosting company may backup database more frequently then files.
Answer: Databases provide ACID features (http://en.wikipedia.org/wiki/ACID) which are hard to deliver when rolling your own solution.
In addition, databases tend to scale to larger volumes of data with better performance characteristics.
Answer: Main benefit is automatic data handling - storing, retrieving, querying.
If you only have very small amount of simple data then you can of course just use INI files or Windows registry or just text file. This saves you from having to handle the MySQL installation and configuration and managing.
Answer: Theoretically, you could get more performance for specialized data structures.
On the other hand, you have more flexibility wrt data structures with a database.
You might want to look into the NoSQL options available.


Ehcache RMI replication does not work on linux with tomcat but works fine on windows?

Question: we are have installed two instances of a server which is a web application say SampleWebApp on two systems on linux. We have configured ehcache to cache local data and also a default RMI replication to replicate changes done on Server1 to Server2. The replication works fine on Windows environment but it does not work on Linux environment. Even there is no error printed, it fails silently.
The configurations done in ehcache.xml file are below-
<code>    <cacheManagerPeerProviderFactory              class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
    properties="peerDiscovery=manual,
    rmiUrls=//<ip>:50000/sampleReplicatedCache"
    propertySeparator="," />
    <cacheManagerPeerListenerFactory             class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"   properties="port=40000"/>
    <cache name="cmServerReplicatedCache" maxElementsInMemory="100" eternal="true"
    memoryStoreEvictionPolicy="LRU" >
    <cacheEventListenerFactory       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
    properties="replicateAsynchronously=true, replicatePuts=true,
    replicatePutsViaCopy=true, replicateUpdates=true, replicateUpdatesViaCopy=true,           replicateRemovals=false,   asynchronousReplicationIntervalMillis=5000"/>
    <bootstrapCacheLoaderFactory      class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
    </cache>
</code>
There is no firewall installed which could block replication so firewall is not a reason why it is failing.
Also checked if ports are opened. Allocated port 50000 is opened and Ehcache listens to this port. Problem is that if there is update in cache, this change is not getting replicated.
Any suggestions or clarifications on this will be appreciated.
Thanks,
Wonder!
Comment: This problem is solved. Forgot to post the answer. Issue was that I was using tokens in ehcache.xml but spring expression resolver (token replacement using ${}) is not supported in ehcache.xml file since the file does not come under spring application context. I replaced the tokens with actual values and then it worked.
Answer: This problem is solved. Forgot to post the answer. Issue was that I was using tokens in ehcache.xml but spring expression resolver (token replacement using ${}) is not supported in ehcache.xml file since the file does not come under spring application context. I replaced the tokens with actual values and then it worked


How does Lightning payment service Works?

Question: Let's say A merchant is using lightning payment service to accept BTC as payment for his shop. How does existing lightning payment service were able to manage to provide merchant's BTC in form of fiat considering BTC price volatility rate , because at the end of the day merchant needs fiat currency to spend his daily living.
Answer:
How does existing lightning payment service were able to manage to provide merchant's BTC in form of fiat

It doesn't.
Hedging currencies is something that must be performed outside the Lightning or Bitcoin networks.
Exchanging currencies is something that must be performed outside the Lightning or Bitcoin networks.
Some commercial businesses might offer to provide such hedging and/or exchange services but that is separate from Bitcoin and Lightning.
I expect businesses or individuals who are worried about exchange rate fluctuations will often choose to recalculate the prices they offer at very short intervals (e.g. daily, hourly?) and often will immediately exchange received currency they consider uncomfortably volatile for another they consider more stable. Those who are extremely concerned about a specific currency will perhaps choose to transfer all the risk to the other party by insisting on a transactional currency they are comfortable with.
Comment: How can we performing hedging separately, because how can we short Lightning Channel's BTC. We can't take that BTC out of channel and then Hedge that BTC right when channel is not closed?
Comment: hedging: *"Hedging is accomplished by purchasing an offsetting currency exposure. For example, if a company has a liability to deliver 1 million euros in six months, it can hedge this risk by entering into a contract to purchase 1 million euros on the same date, so that it can buy and sell in the same currency on the same date."*
Comment: Let's say I am Lightning payment service, I want to instantly convert BTC to receiver's fiat currency. So, I want to hedge  sender & receiver's channel BTC where transaction happened, How can I hedge the channel's BTC which is present in lightning channel without closing channel?


Using stringstream precision to format floats but discarding zero-padding

Question: I'm trying to set precision (i.e. number of decimal places) of floats and long doubles to 10, but i don't want them zero padded. I.e.,
123456.789123456789 should give 123456.7891234568, but
123456 should not give 123456.0000000000, but rather 123456
So far i've narrowed it down to:
long double myNumber;
string myString;
ostringstream myStream;
myStream.setf(ios::fixed,ios::floatfield);
myStream.precision(10);
myStream << myNumber;
myString = myStream.str();

I've also tried fiddling with setfill(' ') and std::ws but can't really get the hang of it.
Any suggestions?
Answer: Don't use ios::fixed for ios::floatfield. That's what causes the padding. Simply use setprecision.


What is the oxidation state of nitrogen in nitrate ion and what is its structure?

Question: What's the oxidation state of nitrogen in $\ce{NO3-}$ ion. Simple calculation depicts that it's $+5$. But second period elements never show variable oxidation states. And it's structure is so confusing to me. Some people show dative/co-ordinate bonds, whereas others show a positive charge on nitrogen. Which should be considered as correct one?
Comment: Also related http://chemistry.stackexchange.com/q/21856/4945
Answer: You are correct that the oxidation state is +5. The second period elements, particularly carbon, nitrogen and oxygen, do show variable oxidation states regularly.
The $\ce{NO3-}$ ion cannot be depicted using a single Lewis structure. However, its resonance structures are shown below:

What this means is that the actual structure of the nitrate ion is somewhere in between the three structures shown below. It is sometimes also depicted like this to show the symmetrical nature of the ion and the distribution of charges across it.

http://en.wikipedia.org/wiki/List_of_oxidation_states_of_the_elements
http://en.wikipedia.org/wiki/Nitrate#Structure
Comment: but if Nitrogen can show +5 oxidation state here, then why it cann't form NCl5 (whereas PCl5 is possible). As per my knowledge is concerned, 2nd period elements cann't go for octet expansion due to the abscence of vaccant d-orbital... please enlighten me..
Comment: in nitrate the nitrogen uses its p orbitals to bond with the oxygens. however, in a hypthetical $\ce{NCl5}$ molecule the orbital overlap between the chlorine and nitrogen orbitals would be poor due to energy mismatching and steric hindrance between the chlorines and so this molecule is not stable


Absorbing heat from a surface

Question: I have a cold body of constant temperature A and a hot surface several times it's area. What is the best way I can absorb the heat from that surface using A. Will sheets of metal like alluminium or copper help?
Comment: Metal heat sinks come to mind. I was amazed to find the most thermally conductive material under normal conditions is … Diamond! Closely followed by thin sheets of Graphite/Graphene. All this amusingly brings to mind a vision of nanoscopically thin diamond sheets attached together at one end where they become a thicker block of diamond, like a book.
Comment: I understand that water cooling (flowing cold water) is good too. Water can absorb a lot of energy before it changes temprerure much, and is good at taking thermal energy from hot objects as well. Also liquid nitrogen cooling in a similar way.
Comment: I was asking something not wet...Is it possible,because as of now if i put A on the sheet then only the part in comtact gets cold
Answer: A shape such as the one below will help. Make the piece from metal (copper). Insulate the edges.

As the differences in area get larger, this will eventually have diminishing returns in improvement. When the goal is high heat transfer, thinner is better. Of course, at some point, the thin piece will be the same as just putting the smaller cold piece directly on the larger hot piece. The trade off is between the heat transfer perpendicular versus lateral in the piece. When the goal is uniform temperature on the (larger) hot surface, thicker may be better. In the latter case, an optimal shape (curvature of the sidewalls) may be possible instead to minimize lateral temperature differences versus the perpendicular temperature difference.

Absorbing heat from a surface


How to create an installable iso from my linux distro

Question: I extremely customized Ubuntu to the core to create my own distro. But I don't know how to create an installable iso for it. Does anyone have an idea how?
Comment: Do you really need an ISO, or just good backups. Most settings are in /home, your installed apps can be listed and used to reinstall all of them. Only if you have installed server apps may you need some folders in / (root) for them.https://help.ubuntu.com/community/BackupYourSystem Best practice for Backups
https://ubuntuforums.org/showthread.php?t=2436006 & https://askubuntu.com/questions/569679/whats-a-good-back-up-strategy-for-1-desktop-pc & http://askubuntu.com/questions/545655/backup-your-home-directory-with-rsync-and-skip-useless-folders
Answer: Two steps:

Package your changes
Include your package in your iso

Designing the package
I expect your package to contain five things:

New configuration files
Scripted customizations to existing configuration files
Scripted commands
Required Dependencies
Convenient Dependencies

New configuration files are easy to install as part of a package.  Simply add them to your package.  If you've changed a file such as /etc/sudoers or /etc/apt/sources.list, try to put your changes in /etc/sudoers.d/ or /etc/apt/sources.list.d/.  Don't deploy your own version of /etc/sudoers expecting it to override the version deployed by sudo. Your package will be in conflict and fail to install.
If you really need to make changes to an existing configuration file, add it to your postinst script.  Make an attempt to undo the change in the prerm script.  Here are some examples:
echo "192.168.1.1    router" >> /etc/hosts
sed 's/PasswordAuthentication yes/PasswordAuthentication no/' -i /etc/ssh/sshd_config

If you need to run any commands (such as useradd or realm) then you should also do that in postinst.
You can also add dependencies to this package.  If you've made a change to /etc/ssh/sshd_config, then you probably want to depend on openssh-server  which ensures that file is installed before your script works on it. You can find which packages own each file with dpkg -S /path/to/file.
You can also add dependencies on packages you know you want in your custom config.  If you like chromium and know you'll want that installed everytime you use this image, then go ahead and add a dependency on chromium to avoid the need to manually apt-get later on.
Making the package
Some tools you can use to make packages include dh_make or cpack.
dh_make will make a template for you so you can add the files you like and then use dpkg-buildpackage to produce the *.deb file.  Understanding all of the options is a little daunting and takes time to study and understand, but it's how native debian/ubuntu packages are produced.
cpack uses a CMakeLists.txt file to define the rules.  Add files to your package with the install() command and CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA will help you define your postinst.  I find cpack was easier to learn, especially for trivial packages.
Once you have a package, boot up a new Ubuntu (maybe use a chroot or vm), then test your package by installing it with dpkg -i.  If your system is how you want it, then you've succeeded.  Now you can take a basic ubuntu installation and customize it all by installing this single package.
ISO packaging
But I see you want to go further...  You don't want to run that one command, you want to get this customization out-of-the-box.  You can!
You'll need to generate the installation disc in the same way Debian or Ubuntu does it, but add you're own package to the disk and set it to auto-install.
Simple-CDD is probably the easiest tool to make a debian-based iso.  I'm not sure how well it works with Ubuntu though.  LiveCD customization sounds like the most likely solution there.
Comment: Thanks for the answer. I had never heard of simple-cdd before. But I was actually considering Distroshare or Systemback. But both of those don't really work for me. I intend to release a full distro based on ubuntu. It's not that I am lazy but I was looking for a more easy and automated way to create an iso with an installer and stuff.
Comment: I think Simple-CDD or LiveCDcustomization are still the answers.


Prove that the series diverges

Question: I am struggling trying to prove that the following series diverges:
$$
\sum_{n=1}^{\infty}\frac{\sin{n}}{\sqrt{n}+\sin{n}}
$$
I would be very grateful if anyone could give me some clue.
Answer: Well, $\sum_{n\geq 1}\frac{\sin n}{\sqrt{n}}$ is convergent by Dirichlet's test: $\sin(n)$ has bounded partial sums and $\frac{1}{\sqrt{n}}$ is decreasing to zero.
We have
$$ \frac{\sin n}{\sqrt{n}}-\frac{\sin n}{\sqrt{n}+\sin n} = \frac{\sin^2(n)}{n+\sqrt{n}\sin(n)} $$
and it is enough to show that
$$ \sum_{n\geq 2019}\frac{\sin^2(n)}{n+\sqrt{n}\sin(n)} $$
is divergent. Due to the equidistribution of $e^{in}$ in $S^1$ we have that for at least $N-O(1)$ integers in the interval $[N,3N]$ the inequality $\sin^2(n)\geq \frac{1}{2}$ holds, so for any $N$ large enough
$$ \sum_{n=N}^{3N}\frac{\sin^2(n)}{n+\sqrt{n}\sin(n)} \geq \frac{1}{2}\cdot\frac{N-O(1)}{3N+\sqrt{3N}}\geq \frac{1}{7} $$
holds and we are done.
Comment: You can also show that
$\sum_{n\geq 2019}\frac{\sin^2(n)}{n+\sqrt{n}\sin(n)}
$
diverges by noting that
$\frac{\sin^2(n)}{n}-\frac{\sin^2(n)}{n+\sqrt{n}\sin(n)}
=\frac{\sqrt{n}\sin^3(n)}{n(n+\sqrt{n}\sin(n))}
$
so that
$\sum_{n\geq 2019}\frac{\sin^2(n)}{n+\sqrt{n}\sin(n)}
=\sum_{n\geq 2019}\frac{\sin^2(n)}{n}
-\sum_{n\geq 2019}\frac{\sqrt{n}\sin^3(n)}{n(n+\sqrt{n}\sin(n))}
$
and the first sum diverges
and the second converges.

Prove that the series diverges


Prediction interval for very small dataset

Question: Does it make sense to calculate prediction interval for very small dataset (about 60 samples)? I know it's easy for linear regression. But it seems like for tree-based methods or non-linear methods it doesn't make any sense. Am I wrong?
Comment: What would the prediction interval be for a tree-based model anyway? Regardless of data size, there's no standard definition that I'm aware of.
Comment: You can use Quantile Regression Forests, for example, to calculate prediction interval
Answer: In the case of quantile modeling, it makes sense as long as the quantile model makes sense. If you are able to build a good quantile model with 60 observations, then your estimates of intervals between quantiles should also be good. Keep in mind how errors will propagate when building intervals:

The bias in the width of the interval will be the sum of the biases in the quantile estimates; they might balance out, or they might make things worse.
The variance of the width of the interval will also be the sum of the variances of the quantile estimates. This could be a pretty big number, knowing that with 60 observations the "true" model variance will be large and hard to estimate.

Outside of that, it all depends on the model. Common statistical models tend to have explicit expressions for prediction intervals. In MCMC-based inference they can be inferred from the sampled values. In these cases, 60 is as good as 6,000 as long as the model works. As above, keep in mind that error propagation is not always easy to control. If these intervals are needed for serious applications, it's a good idea to generate fake data and run a sensitivity analysis.
The most generic solution is to obtaining a prediction interval is resampling. With just 60 observations, you can run full Leave-One-Out cross-validation (LOOCV). Or you can do bootstrap resampling. It might be a good idea, or the variance of the procedure will be through the roof. Again, simulation-based sensitivity analysis will help you decide.
Comment: @DmytroSytro any resampling (bootstrap, CV, LOOCV) gives you a distribution of models, and you use that to estimate the prediction interval. Just make sure you use a nested loop if you are doing hyperparameter selection.
Comment: @DmytroSytro in sensitivity analysis, you would simulate a large "population", draw 60 sample records from it, and fit your model. The objective is to see how the model changes in response to different underlying assumptions.
Comment: How can I obtain prediction interval with leave-one-out? As I understand, I have 60 models and 60 predictions. And how can fake data help in sensitivity analysis? Thank you!


Why did Katniss not tell Peeta that she loves him?

Question: In the movies and in the books, why does Katniss (not in the sense of denying) never say she loves Peeta or make him feel that she loves him, not until the end of the last book?
Comment: Because she's socially and emotionally constipated. Well, outside of her sister.
Answer: Because she isn't sure.
After their first Games, they've been through a lot together, but they've had to pretend to be in love for the sake of the cameras. That's an excellent way to stop real love from forming, or to make people deny (even to themselves) whatever real feelings they may have. Quoting from the first book:

I don't know. I haven't even
begun to separate out my feelings about Peeta. It's too
complicated. What I did as part of the Games. As
opposed to what I did out of anger at the Capitol. Or
because of how it would be viewed back in District 12.
Or simply because it was the only decent thing to do.
Or what I did because I cared about him.

In their second Games, more or less the same is true, only she has enough genuine care and respect for him (she's not sure whether it's love) to want to save his life more than her own. She does start to have some kind of feelings for him then, but she's too unsure of her own mind to be able to share them with him. Perhaps her strongest feeling is when they kiss on the beach:

"No one really needs me," he says, and there's no self-pity in his voice. It's true his family doesn't need him. They will mourn him, as will a handful of friends. But they will get on. Even Haymitch, with the help of a lot of white liquor, will get on. I realize only one person will be damaged beyond repair if Peeta dies. Me.
"I do," I say. "I need you." He looks upset, takes a deep breath as if to begin a long argument, and that's no good, no good at all, because he'll start going on about Prim and my mother and everything and I'll just get confused. So before he can talk, I stop his lips with a kiss.
I feel that thing again. The thing I only felt once before. In the cave last year, when I was trying to get Haymitch to send us food. I kissed Peeta about a thousand times during those Games and after. But there was only one kiss that made me feel something stir deep inside. Only one that made me want more. But my head wound started bleeding and he made me lie down.
This time, there is nothing but us to interrupt us. And after a few attempts, Peeta gives up on talking. The sensation inside me grows warmer and spreads out from my chest, down through my body, out along my arms and legs, to the tips of my being. Instead of satisfying me, the kisses have the opposite effect, of making my need greater. I thought I was something of an expert on hunger, but this is an entirely new kind.

Remember also that throughout their Games (the main time they spend together, at least in what we see of them in the first two books), they're constantly on camera and displayed live to the whole of Panem. Not the best situation in which to declare any real feelings. The closest they get is in the scene I've just quoted.
In Mockingjay, the first time she sees him is when he's been hijacked into a 'mutt' to kill her - again, obviously not a situation in which she can declare her love. His rehabilitation process is long and slow, and by the time he's fully recovered, the war is over and they're back in District 12. And that's the time when she does eventually tell him she loves him:

"You love me. Real or not real?"
And I say, "Real."
Answer: Because she had feelings for both Peeta and Gale and therefore was unsure of her feelings throughout the series.
She was always close with Gale but her relationship with Peeta started out as an act to generate sympathy and sponsorship.
During the series she grows even closer to both Gale and Peeta. You could even say she loved both of them. However she rejects Gale in the end, in part because he

 helped create the bombs that killed Prim.

So with Gale out of the picture, Katniss was much less confused about her feelings - she loved Peeta, and was then able to say it:

PEETA: You love me. Real or not real?
KATNISS: Real.

luckily for her, Peeta was still waiting around for her
Comment: Hmm. Not sure if I agree with this. Sure, her relationship with Gale gets in the way a bit, but her relationship with Peeta is a very interesting thing in its own right. I think that if Gale had never existed, quite a lot of what happened between her and Peeta would have remained the same.
Comment: @Randal'Thor Gale does love Katniss, and Katniss struggles to figure out who she loves. But Gale is a major character in The Hunger Games series. Removing Gale would shake the setting and plot violently. I would suggest that you do not remove Gale from the series.
Answer: In the book Mockingjay, when she realizes Snow is torturing Peeta because she's the Mockingjay, everyone tries to comfort her but she thinks:

In the end, the only person I truly want to comfort me is Haymitch, because he loves Peeta, too.

Basically admitting it without realizing.
Answer: She loves Peeta but she feels Gale will be hurt by her actions.  It is not fair on both boys but it's not fair on her because they make her feel she has to choose between them...


Is it necessary to have a "loop" antenna to make the primary antenna work?

Question: I know nothing of ham radios. However, my elderly uncle, who lives next door to me has a ham radio. He has a very tall antenna. He gets a friend of his to string what looks like to me, an "air fence" around the property. He attaches what he calls a "loop antenna" to my house. This wire is strung through the trees. It doesn't create a complete circle. Is this really necessary?
Comment: Hello Laura, and welcome to ham.stackexchange.com!
Answer: The loop antenna is a different antenna than the primary antenna.  Because the primary antenna and the loop antenna work differently, sometimes one antenna can be used to make contact with another station when the other antenna wouldn't work.  Sometimes one antenna will work, sometimes the other antenna will work, and sometimes they both will work.  So the loop antenna is probably not strictly necessary.  Your uncle probably doesn't need to use both antennas to enjoy ham radio, but having two antennas is more fun for your uncle than having just one antenna.
Answer: It is most commonly unnecessary to need a loop antenna to make a (tall) vertical antenna work.
However, a horizontal loop antenna has a different polarization (like polaroid sunglasses for reflections) and pattern (roughly its aim) than a vertical antenna. And each antenna might be better at receiving signals that match their polarization and directional aim (if any).  So having two antennas allows a HAM operator to switch between them and perhaps hear or send signals from or to a different set of far away (or nearby) radio stations.
To receive or transmit lower frequency signals, a loop antenna may need to be of a certain large enough size to work efficiently.  Hundreds of feet for the lowest HAM band frequencies.
Also, power lines and stuff inside houses sometime radiate interfering electromagnetic waves.  A horizontal loop might pick up less of this electrical noise, making it easier to hear more distant radio stations.
Comment: Perhaps a vertical could use shorted lower loops of certain lengths as portions of its couterpose set?
Comment: Not typically.  A vertical would usually use multiple ground radials, not loops.  There's not a lot of antennas that would combine the two.


Where was Herod's temple built?

Question: The Scripture says that the Second Temple was built on the foundation of Solomon's Temple, but was Herod's Temple built in the same place or was it built next to it? (Do we have any records that say so?)
Comment: The question on the Judaism site is http://judaism.stackexchange.com/questions/66517/where-was-herods-temple-built
Comment: The other possibility, where this question *might* fit better, is [Judaism StackExchange](http://judaism.stackexchange.com/). It might be worth your while searching there to see if there is a similar question already there. If by "The Scripture" you are referring to anything in the New Testament, this question would have to be modified to fit well there. What, exactly, *do* you mean by "The Scripture"? What passages are you referring to? Passages in Ezra and Nehemiah? This might also clarify your question.
Comment: Welcome to Christianity.SE. For a quick overview of what this site is about, please take the [Site Tour](http://christianity.stackexchange.com/tour). Though this question isn't technically about Christianity, perhaps it will be considered on-topic here anyway, since the Temple is a significant site in the New Testament. We'll see what the mods think.
Comment: This appears to be the only forum in Stack Exchange where this question even remotely matches.
Comment: @LeeWoofenden, Thanks, after sitting here almost a week without any comments or answers, I moved it to the Judaism Stack Exchange and got two pages of answers in the first two hours.
Answer: Herod's Temple is the massive building on which the Salomon Temple (with golden roof) stood, so the chances are; however, there is no archeological evidence of any previous Salomon Temple.
http://media-cache-ec0.pinimg.com/736x/0c/b4/ca/0cb4ca76c5c01a5b43938663503a222e.jpg

Where was Herod's temple built?


File Permission - Only let script read?

Question: I have a password stored in plaintext. I only want my expect script "LoadList" to be able to read the password in order to spawn an SFTP session. There's no scenario in which I want to be able to read the password. Can this be accomplished somehow by assigning the script to a user, and only giving that user read access?
Answer: $ssh-keygen
Accept the default file location then hit return twice to not include a passphrase.
Will generate a file in the home directory/.ssh called id_rsa.pub
then use ssh-copy-id {name of the server you want to connect to} select yes then enter the users password.
This will create a file called authorized_keys in the .ssh directory of the users home directory.
If that fails to create the file, copy the contents of this file to the authorized_keys directory on the destination server - home directory/.ssh/authorized_keys
Test ssh doesn't prompt for a password.
Comment: I do have access to both servers. Do you have a link to any documentation or sample code on how to implement?
Comment: Updated original
Comment: Thanks!
The commands worked and the authorized_keys file was generated with content that ended in "user@server", however ssh still asks for a password.
Comment: Try setting it up on both servers and make sure you copy the keys across, may need to do it manually.

File Permission - Only let script read?


Bloom in Cycles for animation or ring transparency in Evee?

Question: I am making a space scene and I am having a problem with not being able to solve either one of these problems. Cycles renders the rings around my planet properly by making the space between the ring transparent. In Evee it displays the black between the rings and doesn't recognize it as transparent. For making a shadow on the planet it also shows the full ring that the texture is on and not the pattern the texture is making. In cycles I can not find a way to to do the bloom I can get in Evee and have it to where it is over the whole animation; but the rings and shadows from the rings onto the planet render correctly. If anyone knows a solution to either problem it would be greatly appreciated.
Comment: Use glare in the compositor.
Answer: Go to the compositor and add in a glare node between the render output image and the composite node. Then for the type, choose "Fog Glow". Adjust the settings to your liking.
Comment: When using the compositor those changes are just for the image and will not be applied to all the images in an animation correct? I saw this method, but wasn't sure if it be applied over the entire timeline of an animation.
Comment: The compositor node setup will be applied to every frame that is rendered, no matter what (unless you disable it inside output settings). So yes, it will be done for the entire animation if you plan to make one.


What is the largest size for Windows Pagefile.sys you can set?

Question: I know that recommended size for a page file C:\Pagefile.sys in Windows is about 2 or 1.5 times the RAM. Out of curiosity what is the maximum size for a page file that can be set?
Comment: "I know that recommended size for a page file" ... "in Windows is about 2 or 1.5 times the RAM."  Nope.  Famed utility creator Mark Russinov notes, in [Pushing the Limits of Windows: Virtual Memory](http://blogs.technet.com/b/markrussinovich/archive/2008/11/17/3155406.aspx), "There's no end of ridiculous advice" ... "even Microsoft has published misleading recommendations. Almost all the suggestions are based on multiplying RAM size by some factor, with common values being 1.2, 1.5 and 2. Now" (after reading more of what he wrote, you can) "see how useless such formulas truly are."
Comment: What is the point of this question?
Comment: @djsmiley2k In theory how large can a page file can be? This question is for people who have imagination and like to push the limits.
Comment: These days the recommended size for a pagefile is to let the operating system decide.
Answer: The limit on Windows 7 is 16 Terabytes.

Learn Best Practices for Optimizing the Virtual Memory Configuration
  - Microsoft TechNet
On a PC with a processor that supports Physical Address Extension
  (PAE)—which is to say, on any PC that is capable of running Windows
  7—the maximum size of the page file is 16 TB.

When attempting to set a larger amount, Windows displayed the error:

System Properties
Enter a maximum page file size that is greater than or equal to the
  initial page file size, and less than 16777216 MB.

Note: This limit is also the max file size for a file on Windows 7 NTFS (Source: NTFS - Wikipedia).  The max file size for NTFS on Windows 8 and Windows 10 are larger, but it is unclear if a larger page file is allowed.
Comment: This number is absolute for Windows 7.  I don't have a Windows 10 machine to test at the moment.  I also can't find the Windows 10 limit online.
Comment: You think the number is absolute or it is somehow tied to the HDD size in percentage?
Comment: You're right, it's an absolute figure. Hm, interesting.
Comment: I believe 32-bit versions can only handle pagefiles up to 4GB in size.  But I don't have a 32-bit machine to confirm.. :)
Comment: https://www.howtogeek.com/307972/what-is-the-maximum-size-a-windows-page-file-can-be/
Answer: In the days of XP with 1 gig ram, the answer was 1 and 1.5. One being the ram and 1.5 being the pagefile. Otherwise, there was the option of letting the machine decide.
Answer: The above mentioned limits of 16TB etc seem quite off the charts!
Couldn't find any documentation to base those claims.
According to Microsoft itself, 64-bit versions of Windows have a 4GB max paging file size limit.
Windows XP
Windows Server 2003, 2008 & 2008 R2, 2012, 2012 R2, 2016
Windows Vista
Windows 7, 8, 10
It's clear from the above the OS don't play a much of a role in regards to max paging file size.
It plays a role though in recommended page file size (not much but it does).
Since this post is coming quite high in google search, i thought to lay out the facts.
Data taken from:
https://support.microsoft.com/el-gr/help/2860880/how-to-determine-the-appropriate-page-file-size-for-64-bit-versions-of
Comment: I think you misread your link.  It says that the maximum is the **higher** of  4 GB or **3x RAM**, except Win 8.1 & 10 impose additional restrictions based on volume size.
Comment: Yes indeed!! you're right, it's whichever is larger. Thanks for that, it actuallu solved some discrepancies in systems i checked.
Answer: i use a 1004 gb page file on a dell Inspiron 3000 i5  witch is 1 million mb super snappy now run the forest ultra settings in window mode. way better stability and performance no upgrades on this laptop ever things factory
Comment: You created a 1TB page file? Why? That just seems excessive?


Why would some exchanges not support receiving Ether via smart contract?

Question: I notice that some exchanges, such as Bitstamp, only support withdrawing Ether via a smart contract. On the other hand, many exchanges do not support receiving Ether via smart contract. Why would an exchange not support smart contracts?
Answer: Until recently geth didn't have an event or other means to determine when the balance of an address has changed.
A solution is to check if the recipient (ie "to" ) of a transaction is the address you are checking. If "to" is your address then you are receiving funds. This doesn't work when the transfer is done through a contract because the transfer is done with EVM opcode, these are the so called "internal transaction". In those cases "to" is the contract address.
There are solutions to the issue of "internal transaction" but can be complex, and difficult to implement. For example you have to modify geth source code, and port those changes for each new version.
Arguably they could have used a contract to receive funds, and generate events for each transfer (this are easy to track). But I'd guess exchanges usually already have an infraestructure for other coins, and they will prefer to reuse it for Ethereum.
Answer: Sending Ether via Smart contract to main accounts is not advisable, That is why many exchanges do not allow this. Thank you
Comment: why not? you can use `extradata` to specify the destination address of the acocunt holder


Do I have to re-check luggage on connecting flight?

Question: My first flight will be from Amsterdam to Frankfurt , and then from Frankfurt to Newark . Is it necessary to reclaim my luggage or is it done for me ?
Comment: can you tell more about your flight (one ticket or two different tickets), which airline?
Comment: @FOPYX Right, but did you book it on a single ticket (i.e., is there only one one ticket number for both flights)? This actually makes a difference. If it is a single ticket, then you do not need to recheck your luggage. If you booked the connection as two separate tickets, you will need to recheck your luggage.
Comment: I booked with Lufthansa. I have a boardingpass for AMS-FRA and for FRA-EWR.
Comment: If you mean booking reference then yes they are the same for both AMS-FRA and FRA-EWR. I booked this flight as a combination on Lufthansa's site.
Comment: @FOPYX Then, your luggage will be checked through. The ticket number is, by, the way, printed on your boarding passes. There are some cases in which you can have different booking references, but the parts of your journey are still on the same ticket, hence the question whether the ticket number is the same.
Comment: There is an ETKT ( I presume E-ticket) number which is the same luckily. Thank you.
Answer: Since both legs are on the same ticket, your bags will be checked through to Newark, and to Amsterdam on the way home. You can check with the check-in agent that this has been done, in both cases.
When you're travelling on one ticket, bags are almost always checked through. One semi-exception to this is that, if you were taking an internal flight in the US, you'd need to collect your bags at Newark to take them through US customs there. But even then, there's a special re-check counter and your bag is technically checked through; you wouldn't need to go to the main check-in area. This doesn't apply to you, since Newark is your final destination.


Is my refurbished iPad 2 a Model A?

Question: I recently acquired a refurbished iPad 2 WiFi and, being an iOS developer, I would like to use it as a test device and load beta iOS versions on it.  Apple offers two different downloads, one for an "iPad 2" and one for an "iPad 2 (Model A)."  I'm not sure which one I can safely use.  This Ask Different answer states that iPad 2's with model number MC979 are not Rev A, whereas A1395 MC954 (black) or MC989 (white) are Model A's.  My iPad 2 has "Model A1395" written on the back, however in Settings -> General -> About, it lists the Model as FC769LL/A.  Is mine a Model A or not?
Comment: What makes an iPad an version A or not?
Answer: Apparently, the Version A is the iPad 2 that came out in March 2012 and was only sold in a 16GB version. It has a revised A5 CPU and it's Model Identifier is iPad2,4.
The two numbers you're referring to, provide different information.
The one on the back cover is the actual Model Number, which in this case is A1395, whereas the one retrieved from Settings / General / About is the Order Number, and holds information regarding when and where the device was made, its colour and storage.

Is my refurbished iPad 2 a Model A?


How to select only time without attaching a date?

Question: Is there a field in Drupal 8 that lets you select a time without actually selecting a date? Or should you just use datetime?
Comment: No.  I'll try to write up a comprehensive answer tonight.
Comment: You can use https://www.drupal.org/project/time_field module.
Answer: You can use datetime element and disable date widget:
<code>$widget['time_container']['time'] = [
  '#type' => 'datetime',
  '#title' => $this->t('Time'),
  '#size' => 20,
  '#date_date_element' => 'none', // hide date element
  '#date_time_element' => 'time', // you can use text element here as well
  '#date_time_format' => 'H:i'
];
</code>
Comment: It doesn't work for me, i got error on validation because Drupal validateDatetime are looking for  $date = $input['object']; and in your case object is empty.
Comment: you can use '#validated' => true to avoid issue in validation
Answer: Depending on what you want to select time for, you may want to try HMS field.

The field stores values as integer. Both input and output can be
  formatted as Hours, Minutes and/or Seconds. Alter functions provide a
  way for developers to add their own format.

Please note that this is a great field for "time durations," but not so good if you are trying to capture a time of day with PM/AM.
Timefield was a good option for capturing just time of the day, BUT it has not been ported to Drupal 8.
Answer: Hi you can use https://www.drupal.org/project/time_field module. Easy and perfect fit.


Is "nuclear electrothermal" a recognized term for a specific technology?

Question: Is the term "nuclear electrothermal" recognized as referring to a specific type of propulsion technology (specifically, the nuclear thermal rocket with heat engine and arcjet afterburner)?
Comment: To double check, is your question "Is 'nuclear electrothermal' recognized as referring to *nuclear thermal rocket with heat engine and arcjet afterburner* and nothing else, or could it refer to something else as well?" or is your question different than that? Maybe it's just me, but I'm having difficult parsing your question or judging exactly what is expected as an answer.
Comment: The "afterburner" concept has basic problems with rockets. Even just doubling the specific impulse would require 3 times the power output of the "primary" engine. In the system you appear to be suggesting, you'd have a nuclear thermal rocket, and then a much larger nuclear electric power system to power an arcjet that can keep up with the mass flow rate of the NTR. I think "why don't we just replace the NTR with the arcjet" would come up early on as an optimization and simplification. (And I personally would have parsed "nuclear electrothermal" as being such a nuclear-electric arcjet system).
Answer: Nuclear thermal propulsion and nuclear electric propulsion are distinct concepts. In nuclear thermal propulsion, a nuclear reactor is used to directly heat the propellant. The heated propellant exits the vehicle through a nozzle to generate thrust.
I'll discuss electric propulsion in general before addressing nuclear electric propulsion. Electric propulsion is a broad class of non-chemical propulsion where electricity is used in some form make the propellant exit the thruster at a high velocity.  The electricity needed to power electric propulsion can come from a variety of sources such as solar arrays, batteries, or fuel cells. With nuclear electric propulsion, the electricity comes from a nuclear reactor that generates electricity.
Electrothermal propulsion is a subclass of electric propulsion. Electricity is used to heat the propellant. (The exhaust can be relatively cool in other kinds of electric propulsion.) Arcjet thrusters are one kind electrothermal propulsion. Resistojets are another kind of electrothermal propulsion. The Variable Specific Impulse Magnetoplasma Rocket (VASIMR) is also typically classified as electrothermal propulsion.
Finally, nuclear electrothermal propulsion is simply electrothermal propulsion where the source of the electricity needed to drive the electrothermal propulsion comes from a nuclear reactor that generates electricity.
Comment: Sounds like the answer is "no".


How are photons involved in electrical flow?

Question: Lets say you have an extremely simple DC circuit with just a 9 volt ideal battery and a superconductive wire connecting one terminal to the other (don't do this on a real battery).  Electrons flow from one atom to the next in the wire, gradually reducing the battery's charge.  Confusingly, the force carrier for electromagnetism is the photon, not the electron.  So, in a simple circuit, where do photons come in?  In AP Physics C I learned how electricity creates magnetism and vice versa, but photons were never mentioned.
Comment: You won't learn about how the photon mediates the electromagnetic force unless you take a physics graduate course in quantum field theory. Simply stated, electrons accelerate by emitting photons.
Comment: @Andrew an electron flow through a circuit is not caused by photons. Its the other way around. When you accelerate electrons they will radiate photons.
Comment: @BillAlsept Does that imply circuits should faintly glow (beyond the glowing caused by resistance)
Comment: @qazwsx everything above absolute zero radiates, even you. It's hard to stop those electrons.
Answer: Circuit theory is best described by the Classical laws of people like Ohm, Faraday and Maxwell.
Photons of electromagnetism only come into the picture at the detailed quantum level when explaining things like the photoelectric effect, and even there the main message to take away is energy threshold levels.
Electrons from a battery are pushed along a wire by an excess of negatively-charged electrons behind them, and/or pulled along by an excess of positively-charged protons in front of them. These electrostatic forces are sometimes explained as an exchange of "virtual photons" of a peculiar kind; if energy is exchanged between two particles then the photons are treated as "real", though still peculiar. But that is a handwavy analogy rather than a mathematical model - nobody has been able to define to me a quantum of the electrostatic field (Somebody please do so if you can!). Quantum field theory boils down to using the classical equations in such circumstances as you ask about.
Answer: The question assumes an ideal battery. An ideal battery is a current source with fixed voltage  ($V$) that always satisfies Ohm's Law ($V=IR$) by supplying the required current:
$$ I = \frac V R $$
NO MATTER WHAT. That is what "Ideal" means.
The question goes on to state that $R=0$, which requires infinite current. At this point, any discussion of atoms and electrons breaks down, as the required set-up is non-physical.
Classically, the force on a charge is (Lorentz Force Law):
$$ \vec F = q(\vec E+ \vec v \times \vec B) $$
so that the force carriers are the electric ($\vec E$) and magnetic ($\vec B$) fields, visible only to things with charge ($q$).
We know, thanks to Maxwell's equations, that the E and B fields support traveling radiation, EM waves. Moreover, quantum theory (and experiment) show that these waves are quantized into packets with a minimum energy ($E$) at fixed frequency ($\omega$) given by the Planck relation:
$$ E = \hbar\omega $$
In term of momentum, that is written:
$$ \vec p = \hbar \vec k $$
The dispersion relation of electromagnetic waves:
$$ \omega = c|\vec k| $$
then shows that photons are massless via:
$$ m = \frac 1 {c^2}\sqrt{E^2-c^2|p|^2} = 0 $$
The calculation of scattering amplitudes of charged particles can be broken down into various terms that are interpreted as an exchange of virtual photons. Virtual photons
conserve energy and momentum when exchanged between 2 particles, and as such, are not massless:
$$ E^2 -c^2p^2 \lt 0 $$
in scattering, while
$$ E^2 > c^2p^2 \lt 0 $$
in annihilation. They are not real photons, but thanks to the remarkable success of quantum electrodynamics, photons are universally known as the force carrier of electromagnetism. At the end of the day, they are made from electric and magnetic fields, so it is the field that carries force.
Since similar formalisms work for the weak force ($W^{\pm},Z$), the color force (gluons), the residual strong force $(\pi, \omega, \rho, \cdots)$, phonons in crystals, etc... it is very handy to refer to the particle as the force carrier, though the particle is a quantum of some underlying field (as all particle are, for that matter).
Obviously, that has nothing to do with circuits. (Though I would not be shocked if someone could derive Ohm's law from a quantized field theory).
Answer: Circuit theory is a simplification of Maxwell's equations which is a simplification of quantum electrodynamics. The photon is a concept of quantum electrodynamics. It is simplified away when you go from quantum electrodynamics to Maxwell's equations. It does not resurface when going from Maxwell's equations to circuit theory.
Unfortunately, there is a terrible tendency to bring in unnecessary concepts from a more complicated theory into a simpler theory. This temptation should be avoided. Any concept of "photon" that you could introduce in circuit theory would necessarily be a severely crippled version of actual photons. Such a crippled version of photons would not provide any future benefit for learning quantum electrodynamics (in fact it would need to be unlearned), nor would it provide any immediate benefit for learning circuit theory. It should therefore not be attempted.
If something is worth doing at all then it is worth doing right. It is not worth teaching photons right in a circuit theory class, so it is not worth doing at all.
Answer: In the simple circuit you describe, there is only an electrostatic field applied to a conductor, so there is no variation with time of the electric field or of the magnetic field.
In that case, according to Maxwell's equations, no electromagnetic field is emitted, therefore no photon intervenes.


Create a Directory using Directory.CreateDirectory( ) that gives a warning message when trying to delete or rename

Question: My application creates several text files that contain important data for its working. I am grouping up all these files in a folder. In Form_load() I gave Directory.CreateDirectory("C:\\xyz"), so that a folder is created in a drive which will later include text files, when the application will be delivered to clients. I want to see that the user does not delete or rename the folder. A dialog box that shows some warning message will be helpful. Is it possible with Directory.CreateDirectory()?
Comment: If these are files that the user shouldn't touch, put them in an appropriate location (a subdirectory under [`SpecialFolder.ApplicationData`](http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx) would seem indicated). That's already "off-limits" to the user from a conventions perspective - if they delete directories/files in there, they're already asking for applications to misbehave.
Comment: Why not just display a normal `MessageBox` after creating the directory?
Comment: Do you want that dialog to appear when your users try to rename or delete created directory, or when it is created in your application? Also, it is better to create that directory somewhere like ApplicationData\YourApplication...
Comment: Not at directory creation. Only when the directory is being deleted or renamed
Comment: @Cdeez Do you mean you're giving them these abilities inside your program, and you want to warn them? If so, what do you expect to happen if someone is modifying the directory outside of your program?
Comment: _"I want to see that the user does not delete or rename the folder."_ - what problem are you trying to solve? If a user deletes a vital part of your application, for example its data files, the user should expect the program not to be working anymore.
Comment: Let me make it more clear. Its a GSM modem application. Those text files will contain contacts, messages,... kind of information. So deleting them will not make any difference to the app but the user's data will be lost. Thats why I just needed a warning message kind of functionality
Answer: I think you should just warn the user about the importance of this directory. However, you can recreate the directory by performing this kind of check :
if(!Directory.Exists(path))
  Directory.CreateDirectory(path);

From this point, you can imagine a mecanism that save the important files in a temporary way, and if the directory is deleted, you recreate it and put the previously saved files in it.
Comment: Yes if there is no directory a new directory will be created and text files are placed into it. But once the directory is deleted containing the files, then all the data is lost. I want to warn the user that he is trying to delete important data. If he still wants to continue that upto him but a warning message is what I want to show
Comment: Look at @Damien_The_Unbeliever , I think it's a good solution
Answer: First of all, you might find reading this helpful.
Second: If I understand your needs correctly, what you want is much more painful than you think.
You should really consider doing what Damien_The_Unbeliever told you.
However, if you insist: You will need to use C++ (C# will give you and your users a lot of pain) for it, and you will need to "hook" SHFileOperation through something like ICopyHook. Start by taking a look at ICopyHook. It will be a lot of work and a lot of learning, and I don't think it's worth it, but there's the info. Good luck.
Comment: Damien_The_Unbeliever: seems like its a quick and easy solution, will go with it. Thanks. @Mehrdad: Thanks for the links but using them seems quite complex so not going with it.
Comment: Even with the copy hook, it only applies for *shell* operations. There's nothing to stop them from firing up `CMD.EXE` and performing the delete. You'd have to be looking at implementing (I think it's called...) a file system filter driver.
Comment: @Damien_The_Unbeliever: Yes. I assumed this is enough for the OP to get started, since a determined user can even bypass filter drivers, anyway, and this is already hard enough as-is. (And if he's using the command prompt, he probably knows the consequences of his actions well enough that he should be allowed to 'override' the protection.)


PythonTeX rendering problem

Question: I tried the PythonTeX package, and the output it produced contained question marks instead of running python code, what should i do ??
Comment: I haven't used PythonTeX but I've used similar packages (SageTeX) which give the same ?? unless you process it in 3 stages: run latex on the document (the output will be the question marks you've seen) and a special file will be created (with sage it's a .sage file). Next, run the script/program on that special file. Finally, latex the document again. Question marks should be gone if the code was valid. I googled up [this video](http://www.youtube.com/watch?v=yIO4l0zHGjw) on PythonTeX where the author mentions the 3 step process at the 9:30 mark. Have you done the 3 step process?
Comment: [Welcome to TeX.sx!](http://meta.tex.stackexchange.com/q/1436) Please add a [minimal working example (MWE)](http://meta.tex.stackexchange.com/q/228) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with `\documentclass{...}` and ending with `\end{document}`. Moreover, as I read it PythonTeX lets you execute python code, and putting the result back into the document. It is not meant to show the code itself, right?
Comment: DJP is correct; PythonTeX's operation uses the same principle as SageTeX.  You have to run LaTeX (this saves all the Python code in an auxiliary file), then run the PythonTeX script (pythontex2.py or pythontex3.py, depending on your Python version), and finally run LaTeX again (which brings in the output of the script).  There are question marks/placeholders for any code output that is expected but not yet available, with corresponding warnings.
Comment: @DJP I guess that is the problem, i didn't know that i should run the python script, thank you
Comment: @DJP you should post this as answer, so this question won't remain "unanswered"
Answer: Packages which call other programs, such as sagetex, python, gnuplot, or (as G. Poore confirms) PythonTeX require you to process the your document in a similar fashion:
1. (pdf)latex your document to create a special file (with sagetex it's a .sage file.
2. Process the special file with the program/script (Sage/Python/gnuplot)
3. (pdf)latex your document again.
After step 1 your output will have ?? marks where the computations/pictures are supposed to be. I suspect you didn't realize that 2 more steps of processing are necessary. As G. Poore indicates above your second step will be "run the PythonTeX script (pythontex2.py or pythontex3.py, depending on your Python version)". Depending on the package you might be able to streamline the process with a shell escape in your tex file or configuration of your IDE

PythonTeX rendering problem


Remove others' self-answered questions from unanswered questions

Question: Would it be possible to tag questions as self-answered or extract the answer from the question and mark it as accepted?
Comment: I added tags [meta-tag:search] and [meta-tag:advanced-search] since this could be implemented as a switch in the Search Fu. If you think I'm wrong, feel free to revert it.
Answer: If a question has been solved either in the comments or by the OP editing the answer into their question, and is now lying around, feel free to post a proper answer. If you have moral questions about taking credit for other people's work, mark it as community wiki.
There's no guarantee that it'll get accepted (in fact, it seems to me that there's a rather low chance), but if it gets an upvote that'll remove it from the unanswered list.
Comment: This doesn't answer the question. Many self-answered questions are borderline quality questions with borderline not-an-answer answers. Some of them could in theory get closed (but what would it help to?) or reworded, but that all is quite a lot of work with (IMHO) little gain.
Comment: @yo' If you don't think the questions are worth spending time on, then don't spend time on them.  If you think they're worth spending time improving, then spend time improving them.  It's your decision to make.
Comment: @Servy Which means that the request by the OP is quite reasonable, so that he doesn't spend time on self-answered questions.
Comment: @yo' The fact that one person doesn't want to spend time on it doesn't mean nobody else does, or that nobody else should.  I see no reason why these questions should be treated any differently than any other.  If you personally don't want to spend the time, you don't have to, but that doesn't mean you should be actively inhibiting others who *do* want to help from helping.
Comment: @Servy I don't question this. I don't suggest the **default** unanswered list to be changed, but an **option to the Search Fu** could be added.
Comment: That's not what the question here is suggesting, so your statement that the OP's request is reasonable simply isn't true, as he isn't making that request.
Answer: I write a query for unanswered questions without self-answered in StackExchange Data Explorer:
<code>select TOP(50)
  q.Id As [Post Link],
  q.Tags
from
  Posts q
  left join
  Posts a on q.Id = a.ParentId

where
  q.PostTypeId = 1 and
  q.AcceptedAnswerId is null and
  0 = isnull((select max(ai.Score)
              from Posts ai
              where ai.ParentId = q.Id), 0) and
  0 = isnull((select count(*)
              from Posts ai
              where ai.ParentId = q.Id
                and ai.OwnerUserId = q.OwnerUserId), 0) and
  q.tags like '%##Tags##%'
group by
  q.Id,
  q.Tags,
  q.PostTypeId
</code>
For seeing a result-set for the top 50 unanswered questions without self-answered questions that involved tags of mysql sql in StackOverflow you can check this link.


How can I find where the dryer vent is broken or clogged?

Question: I live on the second floor of a three story condo building.We had a company come in to clean our dryer venting, and they said they could not pull a vacuum.The company said that that the venting is clogged or pulled apart.How do I find were it is clogged or pulled apart without tearing down my entire ceiling or wall?
Comment: I would think a pulled apart vent would result in a lot of vacuum, just not going back to the dryer. It should be very easy for them to tell the difference between a clog and a disconnected vent. And they make tools for cleaning dryer vents.
Comment: If your vent is clogged, the question you should be asking is how to clean it, not where is the clog. In which case "[What is the best way to clean your clothes dryer exhaust?](http://diy.stackexchange.com/q/5401/2196)" should be helpful.
Comment: A professional should have been able to tell the difference between clogged and pulled apart.  Also keep in mind if your vent needs cleaning, chances are all the other units need it also.  Perhaps the HOA can hire real professionals to do them all, justifying it as lowering fire risk.
Answer: You would need to run an inspection camera through it in order to identify exactly where the break or clog is.  Though, as the comments suggest, often it's easier and cheaper to just run a cleaning tool through to unclog it versus first running an inspection camera through.
I would probably only resort to an inspection camera if it became a chronic problem, which would suggest an issue in the pipe (sharp bend, collapse, etc.).  If it has only clogged once, and you've never cleaned it before, its quite possible it just clogged from normal use over a long time.


Limit the comments view to node author

Question: Is it possible to add a visibility restriction to article comments? (For instance, only the poster can view comments.)
Answer: A way by which you can elegantly do this from a custom module would be:
/**
 * Implements hook_node_view_alter().
 */
 function my_mod_node_view_alter(&$build) {
   $node = $build['#node'];
   if (isset($build['comments'])) {
     // It is good practice to allow the administrator to see comments of all nodes.
     $build['comments']['#access'] =
       user_access('administer comments') || ($node->uid == $GLOBALS['user']->uid);
   }
 }

Comment: this code hides the comments which are not made by the poster of any posts, but it doesnt show the comments made on his/her own posts.. any way to alter the codes?
Comment: Fixed a small typo in the reference to the PHP $GLOBALS variable. Can try again now?
Answer: I can't find contrib module for your task. I suggest you to write some code.
In template.php add template_preprocess_node()
function THEMENAME_preprocess_node(&$variables){
  global $user;
  $variables['some_var'] = ($user->uid == $variables['node']->uid) ? TRUE : FALSE;
}

Than in node.tpl.php
<?php if ($some_var): ?>
 <?php print render($content['comments']); ?>
 <?php else: ?>
 <?php print 'You have no access to see comments'; ?>
 <?php endif; ?>
Please tell me, if be some problems.
Comment: Even though your approach should work to hide comments, print statement will print the text at the very top of the browser because output has not started yet (we are PREprocessing right ?)
Answer: If you are using panels. In the content visability section you can set that up.
Comment: Can you expand a little on how this is done?

Limit the comments view to node author


Setup and Deployment of Visual Studio templates, locating devenv.exe to call in custom actions

Question: I am working on a project that consists of installing some Visual Studio templates.  Part of the requirement is that the VS executable must be called during Commit and Uninstall phases to make VS aware of the templates.  I don't have much information or any proper examples to go on, and I'm pretty new to setup and deployment projects.  So, my question is:
How, within the context of a Custom Action in a Setup and Deployment project, can I determine the location of the VS 2008 executable and call "devenv.exe /setup"?  I know that this information exists in the registry (and I've located it), however I have no idea to add this as logic within a custom action.
Additionally, if anyone has any experience in this area and has any good links or any advice on the subject of things to know and be aware of, please feel free to chime in.
Answer: Two methods i used to simplify complex operation in deployment projects, which I believe can assist you:

Create a external DLL, with Install/Uninstall methods, that will be called. example.
Use Wix as an alternative.

With an installer class, you can easily check the registry for devenv location:
HKLM\Software\Microsoft\VisualStudio\X.X\InstallDir


Physical meaning of $\left \langle \psi_{nml} | x | \psi_{n'm'l'} \right \rangle$ for hydrogen atom?

Question: I know how to calculate the matrix element $\left\langle \psi_{nml} | x | \psi_{n'm'l'} \right\rangle$, but what is the physical meaning of it? In general, what does the following mean:
$$
\left \langle \psi_{nml} | A | \psi_{n'm'l'} \right \rangle
$$
where $A$ is a Hermitian operator (or does $A$ have to be Hermitian?)?
Comment: @DanielSank they're both matrix elements between different eigenstates, not expectation values.
Comment: Have you read the Wikipedia entry on [expectation values in QM](https://en.wikipedia.org/wiki/Expectation_value_%28quantum_mechanics%29)?
Comment: @fqq Ah, I see I missed the primes. In any case, it's still unclear whether the author wants to know specifically about $x$ or more generally about any operator.
Comment: As worded, this question is very broad and confusing. First it asks for the meaning of the expectation value of $x$, which has a pretty simple physical meaning. Then it asks for the meaning of an expectation value for an arbitrary operator. Could you please edit the post so that it asks *one specific* question? Otherwise, this post will likely be closed as being *too broad*, or even for being *unclear what you're asking*.
Answer: That is the transition dipole moment integral. It is basically the probability that an electric dipole (i.e. a photon) can cause a transition between the states $\psi_{nml}$ and $\psi_{n'm'l'}$.
Answer: $\lvert \psi_{n'm'l'} \rangle$ is the state you start out with. $A {\mid} \psi_{n'm'l'} \rangle$ is the new state you get when you apply $A$ to the original state. $\langle \psi_{nml} {\mid} A {\mid} \psi_{n'm'l'} \rangle$ is the projection of this new state onto $\lvert \psi_{nml} \rangle$; that is, it measures the overlap between the unprimed state and the result of operating on the primed state. Loosely, it measures how much the operator mixes the two states.
That's really all that can be said for a general operator. However, if the operator is describing the time evolution of the system, the matrix element describes the rate at which the primed state is turned into the unprimed state. This is captured by Fermi's golden rule, which says the transition rate is proportional to $\lvert \langle \psi_{nml} {\mid} A {\mid} \psi_{n'm'l'} \rangle \rvert^2$.
Answer: The quantity $A|\psi\rangle$, for general Hermitian operators $A$, is mostly meaningless. The eigenvalues and eigenvectors of $A$ are meaningful, as is the quantity $\langle \psi | A | \psi \rangle$, but $A|\psi\rangle$ by itself is not. This is a sort of confusing point when first learning QM because it feels like the most important thing about operators should be, well, how they operate on state vectors.
The exception is when the Hamiltonian contains a term that's proportional to $A$, such as when $A = \mathbf{r}$ and the Hamiltonian contains an electric dipole moment term. Then since $d\psi/dt \propto H\psi$, the rate of change of $\psi$ contains $A\psi$, in which case $A |\psi \rangle$ really does tell you something physical: the rate at which $\psi$ evolves into other states. Projecting out a specific state and squaring to get a probability gives the transition rate, $|\langle \psi' | A | \psi \rangle|^2$.


what does ""diminishing importance with a decreasing budget""

Question:
For some CIOs, the changing landscape forces
  them to act as a manager of a cost center of
  diminishing importance with a decreasing
  budget, narrowly focused on driving efficiencies
  and reducing costs. For others, it means
  unprecedented opportunity, increased salary, and
  a critical ascent into a more strategic leadership
  position for their organizations. In this eBook,
  we explore these changes and how CIOs can
  leverage their expertise to help their organizations
  succeed in the rapidly evolving landscape.
Comment: The business isn't making as much money in that department as it used to and because of that its budget is being reduced.
Answer: Here, we should analyze "diminishing importance" and "with a decreasing budget" as two separate modifiers. The cost center is becoming less important (diminishing importance), and it is also suffering from a smaller and smaller budget (decreasing budget). The sentence emphasizes that there are two negative effects of "the changing landscape" for some CIOs; the following sentence highlights the potential positive effects.


Face Mask for Shmoneh Esreh?

Question: Is a facemask considered "overdressed for davening"? Is there a difference between a disposable blue one vs custom made
Comment: I hope the options you're considering are davening in a minyan with a mask or davening by yourself without a mask.  Because davening in a minyan without a mask is obviously asur.
Comment: Is there an issur to be overdressed. What is an issur is to be 'badly' dressed like almost everyone wearing t'fillin, with one hand in and one out of the jacket. One doesnt stand before a king like that.
Answer: The mishna brura gives a general guideline of how ones attire should be when davening 90:1
Specifically that one should see themselves standing in front of a king and with awe and dress accordingly.
These days, due to the pandemic, it is perfectly normal to visit the president of the U.S. or the prime minister of Israel with a mask and probably it is enforced.
No reason to assume that it's not appropriate to daven with one on.
What's more, there are those who will consider a person who davens in shul without a mask as a rodef (רודף).
Comment: The Rodef argument doesn't help because he can just daven alone.
Comment: Does anyone _not_ consider such a person a rodef?
Comment: Double AA, use commend sense. The whole assumption of the question is that one is not davening alone as there is no need for the mask and no one in the right mind would speak with the president or a king with a mask on their face for no purpose. And if one must daven alone in an area which one suspects has the virus droplets still in the air, then once again the mask is needed. The last sentence of the answer was to prevent someone from suggesting to daven in a shul without a mask.
Comment: @Heshy The danger is sufficiently attenuated that to use the the term Rodef seems ridiculous. I am aware of Poskim who suggest standing at a significant distance and prohibit a mask during Sh"E. If Prime Ministers compromise on their honor due to health risk, does this make the garment honorable?
Comment: Every location has to be judged according to local circumstances. But even in an area with an outbreak r"l, an individual is most likely not infected. Therefore he will be at worst "safek rodef", which many poskim do not consider rodef. And even if he is a carrier, he will not necessarily infect anyone at minyan without mask, especially if he is careful to maintain distancing. And if someone at the minyan  becomes infected he may well become better, though of course, he might infect others while he is contagious.

Face Mask for Shmoneh Esreh?