using oracle tde

Question: I am new to using oracle database. I want to encrypt data stored in oracle. I am using oracle 18c for this and using TDE(Transparent Data Encryption) feature for it. However, when I run  select query on it, I am getting data in decrypted form. Is there anyway to get the output of select query also as encrypted. Also, it would be great if anyone could let me know good resources for the same as the the oracle official docs are not lucid.
Comment: *Is there anyway to get the output of select query also as encrypted.* When and where does you want to decrypt it? maybe traffic encryption (ssl, for example) is enough?
Comment: I am writing one application which will be connecting to oracle db. I want the data to be decrypted only when the application queries the data. Apart from that, if anyone runs a query on the db explicitly, I want the data displayed to be encrypted
Comment: Hide auth info, use certs. No auth - no access at all.
Answer: TDE encrypts data on disk, and decrypts on the fly when data is accessed from the database.
Introduction to Transparent Data Encryption

After the data is encrypted, this data is transparently decrypted for authorized users or applications when they access this data. TDE helps protect data stored on media (also called data at rest) in the event that the storage media or data file is stolen.

What you described is another feature, called Data Redaction.
Introduction to Oracle Data Redaction
Here is an example with steps: https://oracle-base.com/articles/12c/data-redaction-12cr1

using oracle tde


Simple question about dividing by zero, $y=\frac{x}{x}$ when $x=0$

Question: Is there a rule that says you have to simplify equations before evaluating them? Would $y=\frac{x}{x}$ at $x=0$ be $1$ or undefined, since without reducing it, you'd divide by $0$. I know the equation can simplify to $y=1$, but I thought simplification just made the equation easier to work and was not necessary. It still should yield the same results. I don't no if this is a bad example as the equation reduces to a constant, but the question would still hold up for any power of $x$ divide by $x$. For example, $y=\frac{x^2}{x}$ still has the same issue. At $x=0$ does it evaluate to $0$ or undefined. Sorry if this is a dumb question. Just one of my musings that I've wondered about.
Comment: $y=\frac{x}{x}$ would be undefined at $x=0$...The graph would have a hole at $x=0$ and everywhere else $y=1$.
Comment: As long as $x \neq 0$ right @EmilioNovati ?
Comment: $x\rightarrow 0$ not $x=0$
Comment: Hint: Simplifyng $y=\frac{x^2}{x}$ you have $y=x$ if $x\ne 0$ .... but, as a function this is different from $y=\frac{x^2}{x}$ .
Comment: @randomgirl if y=x/x has a whole in it @ x=0, then is y=x/x not the same as y=1?
Comment: Why not use l'Hospital?
Answer: The proper term to use is "removable discontinuity". You're correct that the expression equals 1 in pretty much every case - still, 0 is not a part of that function's domain. The function you gave is equivalent to this:
$$f(x)=1, x\neq0$$
Answer: I believe more precisely than the "division by zero" that you mention in the title, your question is about $0/0$. To study it, it is better to turn to the plane: rather than $z=f(x)=x/x$, let's consider $z=g(x,y)=x/y$. Then you can define different ways to reach $0/0$. If you follow the $x=0$ line with decreasing $y$, you'll get $\lim_{y\rightarrow 0} g(0,y) = 0$. If you follow the line $x=y$, then $\lim_{y\rightarrow 0} g(y,y) = 1$. And if you follow the curve $y=x^2$, you obtain $\lim_{x\rightarrow 0^\pm} g(x,x^2) =\lim_{x\rightarrow 0^\pm} 1/x = \pm\infty$ !
Thus the function $f(x,y)=x/y$ does not have a continuous extension in $(0,0)$. The ratio $0/0$ is really 'undefined' for this reason. But if you know that you'll be approaching $0/0$ along a definite path (e.g. $y=x$), it is valid to simplify as you will obtain a function which is the continuous extension of the one you started with.


How long do I have to finish a keg once it's been tapped?

Question: I have a kegerator setup with CO2 and a tap.  Once a keg has been put into the kegerator, how long will it stay good?  What can I do to ensure that I get the longest life possible out of a keg once it's been tapped?  Is there some way (aside from the flavor changing) to know that it's gone bad?
Is the answer to this question different for homebrew kegs than for commercial kegs?
Comment: My local brew club just had a lecture about this. A major concern was the loss of flavor in some beers. Aromatics may be lost to the head space in the keg if they sit too long.
Comment: A keg in my fridge last me 2 weeks. have a co2 setup at 10psi. If it goes more than 2 weeks there is a problem. I am not drinking enough.....
Comment: I brewed a lager almost 4 years ago. I never let oxygen touch it and I keep it in a cool place. I have heavy duty seals on it and a clear beer draught system instead of a dip tube inside. I drink about 2 liters of it a year, and i still have about 16 liters left, depending on trub. Still tastes like fresh bread. The finish is becoming kind of like aged champagne, but the beer still has some residual faint sweetness. The keg is naturally over pressurized a bit, so it pours under its own power. BTW I am amazed its drinkable. Stunned. But it is.
Comment: How many licks does it take to get the center of a tootsie roll pop? The world may never know. At least not at my house :-)
Answer: As you drink the keg, you're replacing the beer in the keg with CO2. The CO2 isn't going to stale your beer. As long as you are keeping the pressure in the keg high enough to ensure that the carbonation doesn't dissipate into the keg's head space, the beer should stay tasty for quite a long time.
Unlike kegerators, hand-pump kegs replace the beer with air, which causes staling and allows the co2 in the beer to evolve out, leaving you with flat beer.
If you're not going to drink from the keg for a while, it's a good idea to disconnect it from the intake/outake lines. Just make sure you've pressurized the keg appropriately, then disconnect it.
Comment: It depends on the amount of carbonation you want in the beer and the temperature you're serving at. 15 - 20 is a good estimate, but if you want to really exact, take a look at this nice guide to kegging: www.beernut.com/zen-cart/pub/kegging.pdf

As long as your keg holds pressure and your sanitation was good, you can hang on to it for months and months. I know of home brewers who have kept beers for years.
Comment: Pressurizing the keg appropriately basically means connecting it to a 15 psi CO2 supply and allowing the pressure to equalize?  How long have you kept a keg this way without it going bad?
Comment: I just tapped a 3 year old lager and it still tastes fine. I just dont let any oxygen in. I drink a few liters every year and always throw out whatever was in the "dip tube". I use a clear beer "dip tube" so it grabs beer from the top.
Answer: If the beer is being kept cool and you are using CO2 to push (which I assume you are) then it can last for months.  I think the longest I've ever had a Corny keg last is three months, but that was finishing it, not spoilage.  Kept refrigerated, sealed and under CO2, it should last longer than it takes you to drink it.
The one thing you may want to keep aware of is the cleanliness of your taps.  The taps and lines will be dirty long before the keg goes bad or runs out.  Regular cleaning (about once a month) is necessary.  Dirty taps and lines can make a good beer taste bad.
Comment: Good point about the taps and lines. Cleaning beer lines is the bane of home kegging.
Answer: Do you know what Biogon is? Great mixture of CO2 and Nitrogen. We use it in Czech Republic, but I do not know if it is available in the USA. CO2 keeps the carbonation, Nitrogen preserves it, so it is a great combination.
I think it is called Mixed Gas in your country
Comment: Most places in the USA this is called "Beer Gas".  It was recommended that I do not need this except with heavier beers like stouts and porters which need the additional pressure.
Comment: We use it here mainly for lagers and pilseners. 10+ Plato.
Answer: I've seen a 15.5 gallon keg of beer be good over a year later.  Kept in house at room temperature.  Not just acceptable, but just as good as when it was kegged.
Comment: Was this after it was tapped?  Or between being kegged and being tapped?


Multiple MVP presenters: How to communicate and share information?

Question: I am designing a Winforms MDI application following MVP pattern, and I'm stuck on some problems related to communication between different part of my application.
Here a simple picture of this application:
1 -On the left a treeview
2- In the middle a drawing component
3- on the right, a "property" form.
These 3 parts are managed with a MVP triad ( well ,not really , Model is common to all triads)
When I click on a node on the treeview, I want to see a drawing of the corresponding selected object in the drawing component ,and  I want to see some properties corresponding to this selected object in the property form.
My basic question are :
a) Where to store "Selected object " information ?
b) How to warn Drawing component and property form that "Selected object " has changed ?
I started to imagine some solutions but  I am quite unhappy.
I don't buy putting "Selected object " in the Model and perform observer synchronization.
"Selected object " does not belong to the Model
SO I imagine, I would store this information in a presenter
If I put "Selected object " in Treeview presenter, it seems to me that both Presenter for drawing component and Presenter for Property form  will have to hold a reference on treeview presenter, to retrieve this information.
It creates some coupling between presenters , and  I don't like also.
So I am looking for other ideas, and or comments. thanks for your time.
Answer: First of all, sorry for a late response :) had lots of stuff to finish :D
I don't know how exactly your code is built but may be you could use Retlang. Then you could easily pass list of IDs in the message and handle this message wherever you like.
Also it would be quite interesting for me to hear how you managed to solve your problem a year ago.


Why can't I manually add this VMware based machine?

Question: GUI "add machine dialog"
Using VMware fusion 11 pro, I've created a rack controller. It correctly provides PXEboot to a raw machine; but enlistment failed. To make progress, it seemed that "add machine" ought to be easy enough. But filling in all the required fields does NOT ungrey "save machine" is one of the optional fields required? Or is there some way to elicit a useful error?
Comment: I think perhaps this is better suited to [VMWare Community Forms](https://communities.vmware.com/community/vmtn/developer/forums)
Answer: Curiouser and curiouser. Changing the login credentials did get to "save" but aren't working (and considering there isn't a guest OS yet, I was obviously misled. On the host mac,
<code>vmrun start  Virtual\ Machines.localized/Clonemaas_slave1.vmwarevm
</code>
started the machine (so VMware isn't imposing the requirement for credentials). The machine makes it to "new" but fails commissioning with
 Error: [Errno 111] Connection refused
The other settings:
vm UUID (cd $VMs/grep -Ri ...) but also deleted the UUID and used the name
vmware hostname: localhost
username:        $myMacUserName
vmware password: $myMacLogin
note ssh $myMacUserName@localhost works fine.


Life and Galactic Age: What galactic ages make a planet habitable?

Question: How old does a galaxy need to be to harbor life for prolonged periods of time? Our galaxy was 8 or 9 billion years old by the time life emerged on Earth, so the lower boundary must be younger than that. However, young galaxies are not good places for life, as they contain many massive O and B type stars that explode violently in supernovae and can destroy a planet's atmosphere. Very old galaxies aren't good places for life to develop either, as they would have a higher percentage of red and brown dwarfs with masses less than 0.2 solar masses, and within orbit around those stars tidal heating would occour within the habitable zone of the star and squeeze any volatiles like water off the planet. But how old does a galaxy have to actually be to sustain life?
Comment: To be fair, how would we know? We have just one data point to work with: Earth. For all we know life could have formed after the first 100-million-years and either died out, don't want to talk to us, or are so far away they think they're the only life in the galaxy. And for all we know life could easily be sustained right up until the end (we're not dead yet... but we're working on it...). So, to set your expectation - any answer you get is IMO a best-guess. (The last 10 years have had a lot of, "we believed it impossible... but we found one!" astronomical discoveries.)
Comment: Also, life seems to require heavier elements that would require a certain amount of stellar cycling until there is enough carbon, oxygen, nitrogen, ect. But I'm not an expert on the timeline.
Comment: Well we can use stellar ages, which we know, to help us. O stars die within a few million years and B stars within a few tens of millions of years, but B stars can reform from supernovas of O stars, so maybe 500 million years old for the younger end?
Comment: This sight suggests under perfect conditions in areas with high stellar turnover, there may have been the needed elements within a billion years, but that requires lots of supernovae, and that isn't good for life either. https://medium.com/starts-with-a-bang/what-was-it-like-when-life-in-the-universe-first-became-possible-c64f3cef4a0a#:~:text=That%20puts%20life%20as%20we,evolution%20to%20make%20life%20possible
Comment: Another limit is that the first supernovae had to spread heavier than hydrogen elements around for planets to form.
Comment: @DWKraus life *on Earth, the only data point we have* required heavier elements. Please prove that *no life whatsoever, of any form* could never form in any other conditions. I'm always nervous when people assume that the science we know today is the only science there will ever be and can never be wrong.
Comment: @JBH If I had proof like that, I'd have answered the question, not just put in a comment. And I'd be busy pitching my book on the topic. ;)
Comment: @JBH "no life whatsoever, of any form" - for the purpose of this question I think we should limit the answers to "life as we know it". Otherwise it would get very speculative.
Comment: @Alexander That's making an assumption on the OP's behalf. Respondents are welcome to state that assumption in their answers, but it's bad form to make such an assumption globally without the OP's input. And the point I made with my comment is that "life as we know it" is just as speculative as any other answer and can just as easily fail the OP as any other answer.
Comment: @JBH OP's question contains references like "habitable zone" and "water", hence my assumption.
Answer: Depends on the largest question of context or how you set your world.
If you see intelligent life which we can interact with and understand as the result of evolution and as things that evolved in their own unique environment then it won't matter.
Because it's basically life only happens as something something life starts happening and natural selection takes care of the rest.
Have a planet with no water or atmosphere or with acid rain on ammonia based air or even the sun.
Just time and the existence of a platform, planet or asteroid or something like that, will mean that life forms will emerge and with time will be intelligent.
The part about intelligent life here means basically human like or human comparable creatures.
Like 99% of all human writing is. This is kind of a must because anything produced by a human is human produced so people who think this story is alien either wrong or just being metaphorical.
Thing point is important as we can only interact with stuff that have bodies and with a brain and thoughts and motives like us...etc.
Think of a pet. You can life with them. But can you keep a rock, tree, or a jar of air as a pet? At least it would be a "pet"
Now think of creatures made of thin air and operate on 1165 dimensions and my limited human brain can't handle that. I just can't continue.
Anyway this theory will claim that there are No requirements for life and it just happens with enough time.
On the other hand you can introduce a god or creator or old aliens or something which can mean a lot.
First maybe they did create the universe the way it is or set it up so that particular life forms can exist. Why? Who the heck knows. Earlier point about the minds of absolute alien things.
Here Lovecraft is not a bad influence. I mean on how alien they are and how utterly we are nothing compared to those old things.
Anyway creator can make it so that the universe was created in such a way as to accommodate the little ones, us and the other species, but here is a question:
Why this way and not that? Why does the sun in our world appears yellow?
I think there is a degree of absolute arbitrariness in their.
It just is.
Even with religions but lets not make it about that.
Anyway your point about older stars seems kind of not that much as like we said either creator creates species which can live under those stars, old or new, or that life evolved to live under those starts. Same end result really.
Like how the Turians got their biology or how the Quarians got their immune system messed up.
Just growing from the soil of the planet, metaphorically, and those who could survive did.
1 factor we have to consider is energy. I really don't think a universe without any energy, suns obviously but could be anything, can be comprehensible to us.
I am no astrophysicist though. So maybe you can have a cold dead universe. But I would love to hear on what you think life will be like in that place.
And lastly we only got like 1 planet with life on it. I mean it seems absurd to judge the entire biological world to a mere planet but also we can judge the entire universe to some of our knowledge. Otherwise there is no thinking.
So the take away from this is how much can we say for certain that A is right?
Big does not mean no laws and also does not mean our laws. So yes I would say in the realm of biology it is possible to develop and grow and have life of all forms in almost all places. But the actual hard data is messing because you know.
Does this help? Not sure man. I am just saying no body went beyond the universe and got a list of hard requirement of life or knows about the exact start age to have what life forms under it.
So if I can advise you then just introduce some side effects of older stars in your world and have the story go as usual.
Comment: Introducing a creator and the Lovecraftian Mythos in the same paragraph is dangerous. I wonder, if a human asked the creator "What is the purpose of humanity?", would the answer be "They were created to be prey for my beloved first creations."
Comment: Yes, but planetary formation cannot occour in young galaxies, they're just too chaotic. Plus, life cannot arise on stars or gas giants.
Comment: @NipDip.
We just don't know. Besides this is covered in the post.
Can life do that? We have no date.
Just because we did not see a black swan does not mean there are no black swans, get me?
Answer: I would challenge the premise that a young galaxy is a dangerous place for a habitable planet. Bear in mind that while higher star formation rates mean a greater quantity of hot O and B stars, and therefore supernovae, these objects are still quite rare. For instance, in the Milky Way, only $10^{-5}$% of all stars are O stars. Even in an epoch of high star formation - which is generally believed to have peaked in the universe at a redshift $z\sim2$, or just under 3 billion years after the Big Bang - it's unlikely that many would be nearby.
To plug in some numbers: the local mean stellar number density is $n\sim0.1\;\text{pc}^{3}$, implying a mean inter-star distance of about 7 light-years, or just under twice the distance to Proxima Centauri. If we increase the stellar number density by two orders of magnitude, we decrease the mean distance by a factor of 5. But even this means that there should only be one O star within about 100 parsecs of the any given star - likely too far to cause problems. If I remember correctly, 8 parsecs is the distance at which a supernova becomes dangerous, and it's highly unlikely that that O star will be that close.
The other consideration is whether the elements for life would exist at a given time. It seems like we only need a few billion years for the heavier elements to form in large enough quantities to become abundant in the nebulae that form Population II stars and their planets.
Putting this altogether: I think it's quite reasonable for habitable planets to begin to form around 3-4 billion years after the Big Bang, a little bit after the star formation peak. Certainly, the longer you wait, the better the odds; planets will become more and more enriched with carbon and oxygen, and star formation rates will decrease.
Comment: Well look at the large magellanic cloud. It has an extreme amount of very massive O and Wolf-Rayet stars.
Comment: @NipDip Yeah, the LMC is definitely an interesting case study. I think it's forming stars at roughly the same rate as the Milky Way, but since it's about 100 (?) times less massive, it's effectively forming 100 times as many stars relative to the existing stellar population.


Is it possible to manipulate the default Store View programmatically?

Question: I recently tried to update some product-information on the default storeView (id 0). Instead of applying the changes to the default store, it instead applied them to the product in the next higher increment of storeIds.
I then tried to get all available storeIds for the product and the default store was not listed. Is it not possible to make changes to the default storeView programmatically?
Answer: yes, it is possible to add values directly to the default store view for any product. By default, all products belong to the default store view, there is no need to somehow assign them there.
this can be seen in action when you save a value in admin in the 'all store views' scope (which is the default store with id 0) as opposed to having a value on say 'default store view' (with id 1).
just play a little in your admin and you will see the difference.
the default store view is not counted as a storeview per se and that's why you don't see it returned in the query for the retrieval of the product storeviews.
Comment: Thank you for your answer, it was very insightful and sparks hope.
While I was able to change the product-data of the default store-view through the admin-frontend manually, I have yet to achieve this programmatically.

Whenever I try to edit product data using the ProductRepository (handing over no store-id or a storeId value of 0), the product data of another store is instead updated (the store with storeId 1).
Answer: The problem I was encountering was only present when using the ProductRepository-class to try and update the product in question.
I got it to work by using the following code:
<code>$storeId = 0;
$productCollectionFactory = $objectManager->get(CollectionFactory::class);
$action = $objectManager->create(Action::class);
$updateAttributes['name'] = "test";

$action->updateAttributes([$product->getId()], $updateAttributes, $storeId);
</code>


Will computer knowledge reach a perfect game, after expanding prepared openings/endgames?

Question: If computers just check in an openings-DB what to do in the first 10, 15 or even 20 moves, and if they just check the endgames-DB at the endgame; wouldn't it reach a point where they have a DB of perfect games that goes from opening to endgame?
Comment: While there is perfect play available on the back end in the form of endgame tablebases (as noted e.g. in Sam's answer below), one doesn't know whether any moves on the front end coming from opening databases are optimal play or not. Determining perfect play wouldn't be a matter of meeting in the middle, but just of working backwards as far as one can.
Answer: To my mind, what you are asking is can a computer ever "know" the correct move and evaluation in every conceivable position. Without such complete knowledge, it wouldn't be possible to play perfectly because every evaluation is dependent on evaluations of the multitude of possible upcoming positions. This perfection is what endgame tablebases provide. Outside of contexts where distance to mate can be calculated, tablebases are the only context in which computers have a "perfect" understanding of a position. For reference, 5 piece tablebases (e.g. 2 kings and 3 other pieces) require 7 GB of storage. 6 piece tablebases require 1.2 TB, and 7 man tablebases are only recently completed and require 140 TBs. To solve chess completely, you would need a 32 man tablebase.
The problem is comparable in fictional magnitude to the calculation of the "Ultimate Question of Life, the Universe, and Everything" as depicted in Hitchhiker's Guide to the Galaxy. In that case an entire planet, was devoted to identifying the question. It seems an equally pointless and gargantuan task to attempt to "solve" chess.
Just to put your mind at ease... even though computers may play well above the level of the best humans today, there are still plenty of decisive games between top level computers today. Check out the ongoing TCEC tournament. Clearly, computers are still quite capable of mistakes.
Answer: I will try a more serious answer because the discussion becomes pointless if we resort to empty arguments. Yes, the Universe may be finite, and yes, the "Ultimate Question of Life, the Universe, and Everything" may need a full Earth and 7.5 million years to solve... so what?
Let's do some quick numbers. Each of the 64 squares can be empty or hold one of 12 different pieces (R, K, B, Q, K, and P in black and white), so the total number of positions that you could set is at most
13^64 = 196053476430761073330659760423566015424403280004115787589590963842248961.
That is about 2 x 10^71 different positions. Of course this is a huge overestimate, because most positions are fake (we should eliminate positions with three or more kings, nine or more white pawns, pawns in the eighth rank, quadruple checks, etc). Let's take the square root:
13^32 = 442779263776840698304313192148785281,
or about 5 x 10^35. By taking the square root we are pretending that for each legal position there is a chess Universe worth of distinct fake positions. This is probably an underestimate, so the true answer must be somewhere in between these two numbers. Now we can confidently say that computers cannot study every legal position in a reasonable time. Even the "tiny" 13^32 is too large...
Wait! so am I arguing against myself? No! Computers cannot analyze every position one-by-one. BUT that is not the only way to solve chess. We humans are reasonably smart. In fact, smart enough to have invented chess. What I suggest is the possibility that people may find shortcuts; rules of thumb that eliminate many cases at a glance. We already have many trivial ones; for instance "K+Q vs K always wins". More sophisticated rules could be found by yet-unknown arguments, perhaps supported by computer tables.
Solving chess by analyzing all positions is brute force, and impractical. Solving chess in a smart manner may still be possible, and I do not see any obstacle. In fact, I do expect computers armed with faster processors and better chess knowledge may become provably perfect within 50 years.
Answer: Chess is a finite game. Lots and lots of positions, but finite. Eventually, with enough computing power, yes, computers will be able to play a perfect game. When will that happen? That is a different question. It could be less than 10 years if enough breakthroughs in algorithms and hardware are made. It could take 50 years. Who knows?
Comment: Arguably, the universe is finite as well. Something can be finite, yet outside the practicable bounds of knowability.
Comment: Who knows? I suppose that's possible to calculate how many moves are still there in the "middle" (where the computer still has to computer since they are outside any tablebase) and how much time it could take to calculate them.
Answer: The game will not be solvable for a long time.  In fact, it will never be solvable unless insanely radical hardware advancements are made.  The search tree is too deep and too wide.  Since we're talking about 'solving' chess, not 'winning the game', heuristics will not do; every move played - every one of them - must be evaluated to completion.
Choose the fastest processor you know of, multiply its speed by 1000 and you are really no closer to solving this problem.  Multiply it by a million instead. Still, no closer from any practical sense.
Right now the new hotness in computer architecture is called a 'quantum computer'.  They are still very primitive.  The gist is that they can manipulate objects that are in multiple states. So theoretically, a pawn could be on a2 and a3 at the same time.  With decades and decades of development, this could yield unheard-of efficiencies.   Or, like bubble memory, it could fade away not long after making a splash.


What are the best ways to increase your site's position in Google - Still Correct?

Question: This question was asked and answered pre penguin and panda. I don't really have a problem with it's content at this point, but does it need modification two years down the line to handle issues like unnatural link penalties and the like.
Answer: If you are referring to What are the best ways to increase your site's position in Google? please use the edit feature for this community wiki Q/A to improve upon it as you see fit.
I would recommend citing sources (and preferably only those at Google) if you plan to make substantial changes to ensure that the information you add is readily understood and accepted, but aside from that I wouldn't anticipate too much discussion would need to be devoted to improvements.
Was there a particular aspect you wanted to discuss before making changes?
Comment: Mostly I wanted to see what peoples thoughts were on the need for an update. There have been substantial changes to the SEO landscape in two years, so I figured we should chat about the need.


how to connect to blockchain via etherscan provider

Question: Hello i am trying to connect to the ethereum network with etherscan as HTTP provider so users don't have to have a running node but i cant seem to find their provider-URL.
Answer: Not sure if they have a provider available still, but Alchemy is a good alternative.
You just sign up for an account, create an app, and then view key:
Answer: The provider is still available,

You choose a plan here
Once you have an account on your https://etherscan.io/myapikey you will see the API key menu.
Create one.
To connect with your application you can follow the documentation which includes how to connect to both Etherscan and INFURA.

Basically you just need this line of code:
new ethers . providers . EtherscanProvider( [ network = "homestead" ] [ , apiToken ] )


Why is the TORA of 27R not the same as the TORA of 09L?

Question:
09L and 27R are the same runway but just in opposite directions. I've drawn out a diagram and for some reason the TORA for 27R is 18m less? Where has that 18m disappeared? I've been trying to work out the difference in values using only the information in the table and I still feel that 27R should have a TORA of 3902m (the same as 09L).
Comment: Note that the numbers you have are not up to date. There is still a difference in the latest numbers, though.
Answer: These seem to be the numbers of Heathrow / EGLL. When you look at the taxi diagram, you see that on 09L you have a taxiway that places you right at the beginning of the runway whereas on 27R when taxiing on A1 you end up juuust behind the start of the runway – probably 18m behind it.


QAM modulation problem with python

Question: I have a IQ signal with a bandwidth of $200\,\text{MHz}$.
I do I*cos(2*pi*1000e6*t)-Q*sin(2*pi*1000e6*t), but my signal doesn't shift to carrier frequency 1000e6 on the power spectrum. I cant find the problem. I do this with Python.
Comment: It's not quite clear what you're doing. What's the sampling rate? If you say you have a signal, do you mean baseband or bandpass signal?
Comment: I have baseband signal with sample rate of 250MHz  and its bandwidth is 200MHz. Im trying to upconvert it to carrier frequency. Carrier frequency can be for example 1000MHz. @MarcusMüller
Comment: well, basics question time! What is the maximum frequency you can represent with a sample rate of 250 MHz?
Comment: 125MHz. Okay now i get it haha
Comment: So I need to upsample the baseband I and Q signals for it to work? @MarcusMüller
Comment: see the last sentence of the answer you've gotten :)
Comment: There is no need to simulate it at some actual carrier frequency. Do your simulation with IQ baseband, and then pretend "0" is any other carrier frequency you want. That is what the power spectrum will look like. The actual carrier frequency doesn't have any effect.
Answer: Assuming that you have a complex baseband signal (i.e., IQ samples), then you need to multiply that signal by a $cos{(2{\pi}ft/Fs)}$
In python this would look something like this:
N  = 1000          # samples in input array
Ts = 1.0 / 250e6   # sample period
f  = 1000e6        # output frequency
t  = np.arange(0, Ts*N, Ts)
y  = x*np.exp(-1j*2*np.pi*f*t)

Where x is an input array of baseband I/Q samples and y is the tuned output.
Keep in mind that if your signal is not sufficiently upsampled, then you won't be able to modulate to the desired output frequency from your question.

QAM modulation problem with python


http url input parameters

Question: Is this a valid http url
http://www.example.com?x&y
or
we must always have = sign for parameters.
http://www.example.com?x1=x&x2=y
Answer: Well, it works, and the W3C recommendations are extremely general -- only the use of ? and + are defined. So I think from the perspective of HTTP/HTML the = is optional. It's use is obviously a common convention and many client & server libraries use it, but there doesn't seem to be any reason you couldn't define a service to work on some other scheme.
Anecdotally, I like to leave out the =blah part when I'm using the query string as a flag as in http://www.example.com?logout
Reference: http://www.w3.org/Addressing/URL/4_URI_Recommentations.html
Answer: According to the ABNF in Appendix A of RFC 3986, both examples above are valid URL.
Note that if you read only the Wikipedia article on Query string, you might get the false impression that the second ne is the only valid one.

http url input parameters


What is wave particle duality?

Question: I am sort of confused about this. Wave particle duality says that sub atomic particles are waves.  There is something more though. What is the actual meaning of wave particle duality?
Comment: http://en.wikipedia.org/wiki/Wave%E2%80%93particle_duality
Comment: Come on, there is a whole tag for this question: http://physics.stackexchange.com/questions/tagged/wave-particle-duality
Comment: possible duplicate of [Is the wave-particle duality a real duality?](http://physics.stackexchange.com/q/46237/)
Comment: What is your question?  You don't even ask a question.
Comment: In a nutshell, the (what we think are the) fundamental *entities* of reality exhibit, depending on the context, wave like properties (such as interference) and particle like properties (such as localization).  Thus, these fundamental 'bits' of reality *defy* classical intuition; they are, in a sense, both and neither.  As to what this *means*, well, if anyone can answer that, they'll probably get the last Nobel prize in physics.
Answer: I answered a question related to this a few days ago, so I suppose I'll try to summarize it here.
Wave particle duality doesn't really say that waves are particles. It says that "particles" aren't really particles, nor are they really waves, they're just little objects that have some properties of waves and some properties of particles, and there are certain situations where one is more visible than the other. I've heard it said (in a very rough sense) that subatomic objects travel like waves, and interact like particles. Again, this is a huge simplification, but there's an important intuition, which is that these objects are always a little like waves and a little like particles. We can describe their position by a function that tells you the probability that the object will be at a particle point in space at a particular time; this function takes the mathematical form of a wave, so we call it a wavefunction, and this is the sense in which particles are like waves. When these objects interact, however, we tend to see them more as particles, like little classical marbles.
The double-slit experiment is a good example of this. Once more, I emphasize that this is a very big simplification, but just for the purposes of giving you a bit of context, we can imagine that as the electron travels through the slits, its wavelike character is more obvious, and so there are noticeable behaviors we normally attribute to classical waves, like interference. When it collides with the backboard, however, its particle-like character is more obvious, and so we see a single point where the electron collided with the wall. But at all times, the electron had both wave and particle characteristics, and that's the essence of wave-particle duality.
Comment: I think a link to Bohr's famous complementarity (http://en.wikipedia.org/wiki/Complementarity_(physics) ) is indispensible to provide both a historical background and a generalization of this discussion to a fully developed philosophical standpoint which is valuable as a way of thinking about science in general. It is important to appreciate the ''new situation in epistemology created by quantum theory''.
Answer: It's a little easier to think about photons for starters, because we are more used to them.  But it turns out that all the other particles in nature work this way ...
Start with a classical picture of a propagating electric field: a classical wave.  Consider it in the context of a double-slit interference experiment.  The electric field exists everywhere, at least everywhere we have any interest: after the source, between the source and the slits, within the slits, between the slits and the screen, at the screen. We can increase the intensity of the field as much or as little as we like.  We have no trouble understanding this.
Add quantum mechanics:  We no longer can change the intensity of the field in small amounts. We can only change it in quantum steps.  When we raise the intensity by one quantum, we say that "we have created a photon".   Lower the intensity by one quantum, and "we have destroyed one photon".  Remember that the field exists throughout space.  The "photon" has no specific location.  Each time we create or destroy a photon we add or subtract a quantum of energy from the field.  Not only that, we add or subtract momentum from the field.  The field carries energy and momentum.
Suppose there is an atom in the field with energy levels whose energies differ by the energy of one quantum of the field.  There's a chance (a probability) that the field will interact with the atom, in which case a photon will be destroyed, and the atom will take the energy and be raised to the higher energy state.  It will also take the momentum from the field, and get a little kick in the direction of the field's momentum.
From the point of view of the atom, it looks like it's been hit by a particle.  It has more energy, and has picked up some momentum. (Glossing over some conservation issues.)  The interaction has occurred at the location of that atom.  But the field excitation, the photon, lives everywhere in a pattern described by the classical wave.  The field/wave obeys all the laws of wave physics, but the interactions happens at a particular location, and is indistinguishable from a particle collision.  Wave and particle.
At the photographic film at the screen of the interference experiment, the field interacts with the molecules of the film at individual locations.  But where those interactions might occur are determined by the law of interference.
It turns out that all elementary particles can be described by fields.  So there are wave equations that tell us what the wavefunction is ... where interactions might occur.  These fields are a little more complicated because of other conservation laws that apply in the subatomic domain: you can't destroy an electron as you can a photon, but you can redirect an electron, which is like destroying one electron and creating another that moves in a different direction.  Or neutron can be destroyed while simultaneously creating and electron, proton, and neutrino.  And so on.
Comment: My usual addition to this type of answer that the wave is a probability  wave. It should be stressed because the naive questioners think it is the mass that is spread all over the place:  What is "waving" is not the mass nor the energy, just the probability can be described by wave behavior in space and time.
Comment: Agreed; I'm trying to dissuade the OP from thinking of electrons as little marbles that somehow exist everywhere and nowhere.  IMO, it's best to move away from the "tiny marble" metaphor when considering wave/particle duality.  But different pictures for different people. E.g. @Iota has a nice description too, and brings up the gnarly issue of the "reality" of fields (including the EM field).  Our brains aren't wired to *really understand* what's going on.
Answer: It was found through the law of dynamics we calculated and observed the particle to follow on a macroscopic scale failed miserably when applied to microscopic objects. The particle showed some properties that were essentially found to be similar of waves, in the sense then when a lot of particles are observed they give properties similar to that what a wave distribution would have given. As a result we lost out on the determinacy of a particle's state and it was replaced by calculating probabilities whether a particular state would show up on actual measurement. Now the function that gives this probability in each state is a function that follows the same differential equation in some sense that the actual wave equation follows, however things like wavelengths etc. are momentums,energy etc. in this function.
So in the end it is all just about the mathematical function which is used to say that the particle has dual nature. There is actually no wave there whose energy you can measure or which you can interact with, whole energy of the particle is located at one place only.
Kind of like F=ma is replaced by Schrodinger's equation, now the Schrodinger's equation is similar to the wave equation of the wave you see on a string, hence you can physically assume that the particle is travelling like a wave in a very crude sense, kind of like if some other thing's dynamics follows F=ma, you can consider it to be like a particle, however mass will not mass in this case here, it will be some other property completely. However on a heuristic level, it will help you solve and think about problems.

What is wave particle duality?


What tips can you offer to someone porting code?

Question: What advice (tips, techniques, gotchas, et cetera) do you have for someone who is porting a code library from one language to another, or rewriting it to work in a different compiler, environment?
Comment: don't "port" -- i.e., clone something into a new language retaining features of the original language.  Totally rewrite it so that it has the same test results.
Comment: What did you mean by port?  Here's a hint.  Don't comment on your own question.  **update** your question to be complete and crystal clear.    Never comment on your own question because it's your question.  You own it and you can make it perfect.  Feel free to delete the comments which form a hard-to-follow trail when your comment assumes we know what you're talking about with words like "That's what I meant".  What does "that" refer to?
Comment: My Advice: Don't.
Comment: @JohnFX - Don't what?
Comment: @S.Lott That's what I meant by "port".
Answer: Know the native capabilities of both your "to" and "from" language/framework.
I was porting a calendar library to iOS from Javascript. iOS has a robust calendar class whereas JavaScript had nothing which was of use to me. (I was converting from a religious calendar to the Gregorian calendar and vice versa.)
I spent time rewriting the entire library in Objective-C only to realize that my code was largely redundant. (By the way, I did a poor job and was getting inaccurate results. That's when I took a step back and realized my mistake.)
Several tens of lines of conversion methods were replaceable with six or so lines of native framework code.
Answer: If this is a critical project (porting often is), write a complete test plan (ideally with unit tests in the target language) BEFORE porting each piece of code and the entire system.
There is no way in the world that the porting will be 100% accurate in the first try, so you need to make sure in advance that you're catching everything.
If possible, execute the same plan for the original code because there are no guarantees that it was written correctly, and, in fact, having an equivalent behavior may depend on an incorrect implementation.
Comment: +1 for test plan with unit tests in the target language.
Answer: Every platform (language and system libraries) has its own persona.  The way a Ruby programmer designs their API takes advantage of the unique features and culture that make Ruby what it is.  This is distinctly different than the way a C or C++ developer would design their API, which is in turn different from the way a Java or C# developer would do it.
You want to take the ideas from the original platform, and mold them into the concepts that make the new platform what it is.  Nothing feels less natural than using a library designed in a completely different manner than the other libraries in the platform.  There's a number of programming platforms that are actually well designed, and elegant.  You want to leverage those strengths for your port.
Answer: -> Focus on the functionality not the way it has been coded.
-> Think before write, because some elements can be already handled by language, platform etc.
-> Use the advantage of new platform.
Answer: "Porting" -- as you appear to be using the word -- is just TDD with annoying legacy code.
Get the test cases right.  Confirm that the legacy code passes the test cases.
Then discard the legacy code.
Then write new code that passes the test cases in the new language.
Answer: Build a class diagram/hierarchy tree so you know which to port first. Map the basic data types (int -> Int32?). Do the same for the data structures.


Is it possible to automatically sync my iMac and MacBook Pro

Question: I would like to keep all my files (i.e. pages/numbers/keynote) automatically synced between my iMac and MacBook Pro. Is this possible? I don't want to have to save something in the cloud each time, then download it from the cloud on the other machine to work on and then save back in the cloud again. I just want to be able to open up either machine and have all identical files there automatically. Is this a pipe dream?
Answer: If iCloud Drive (FAQ) isn't syncing fast enough for you (or you're not on El Capitan ) then you could try a commercial solution (per Gb most are cheaper) or you could use one of the "roll-you-own" solutions.
There are multiple commercial solutions that do this, in no particular order:

Dropbox
Microsoft's OneDrive
Box
Google Drive

Then there's a range of self-hosted solutions which let you use your own network, servers etc to provide cloud storage & sync.
Of course if you put your laptop to sleep if will always have sync changes from your desktop when it wakes up no matter what solution you use.


less with "update file" like functionality

Question: I want to watch a file that gets overwritten every 5 minutes with less. How can I make less follow the new file descriptor instead of keeping the old one displayed? watch "cat file" won't do it because the file is too long to fit into one terminal window.
Comment: "Follow" implies following the end of the file. You may want to clarify that your file gets overwritten and you are interested in reopening it.
Comment: Use `less --follow-name` see http://unix.stackexchange.com/a/74287/112522
Comment: I meant following the file descriptor, as it is defined in `tail -f`'s man page. But nevertheless I have clarified my question.
Comment: Appears from the comments to answers that he wants a full-blown "less" that is running and operating on the "current version" of a certain large file (i.e. at the top)...
Answer: You can get this effect by issuing the F command (Shift+F) while viewing the file in less. To stop following and switch back to paging, press Ctrl+C
Since your file only changes every 5 minutes, you could also use tail -f and specify a longer sleep time with -s (defaults to 1 second). For instance,
tail -f -s 60 myfile

checks myfile for output every 60 seconds.
EDIT: Due to misleading question, the above answer was unsatisfactory. Second attempt follows:
To re-open the same file in less every 5 minutes, try this:
while true; do ( sh -c 'sleep 600 && kill $PPID' & less myfile ); done

This will spawn a subshell which backgrounds another shell process instructed to kill its parent process after 5 minutes. Then it opens the file with less. When the backgrounded shell command kills the parent subshell, it kills all its children, including the "less" command. Then the loop starts the process over again.
The only easy way I know of to kill this is to kill the terminal your original shell is in. If that's unacceptable, you can use the "killfile" trick:
touch killfile
while [ -f killfile]; do stuff; done

To stop doing stuff, rm the killfile in another shell.
Comment: This is only partially useful for my case. The watched file is very big the updated information at the top. It is no "scrolling" log file. Shift+F immediately scrolls to the end of the file...
Comment: You should edit your question to clarify. I edited my answer to answer this, too.
Comment: `watch -n 1 less `
Comment: appears `watch -n 1 less ` is the equivalent of `watch -n 1 head -n40 ` (i.e. less piped in becomes same as cat, but watch shows you the topmost lines) FWIW...so it does get you the top lines anyway :)
Answer: You can do something similar in vim.
Start a server session of vim:
vim -R --servername refresh_session

Then in another console, monitor the file for updates and tell the vim session to reload the file as soon as it gets updated:
inotifywait -e close_write -m your_log_file | while read filename events; do
    vim --servername refresh_session --remote $filename
done

A few gotchas.

This will of course not work if your vim is not compiled with the clientserver feature in.
inoifywait will stop working when the file gets deleted. So I hope your file gets overwritten. It is possible to work around that, too, of course.

And if you want to have a more less-like experience, you can use the less macros to get your less key bindings in vim.
/usr/share/vim/vim73/macros/less.sh --servername refresh_session

Answer: You might try this command:
tail -f file
Answer: Tail is your friend. "tail -f filename" will show you new lines when they appear.
Or if you are looking for changes made in the middle of the file, maybe run a script every few minutes to make a copy of the file to a temp location and do a diff on it?
Comment: I don't think that's very fair. To be crystal clear, we need to look at the original, unedited post, because if you look at the date of my answer, that's the question I was answering. In that unedited question, my answer makes perfect sense. http://serverfault.com/posts/445899/revisions
Comment: I did check the revisions.  Keywords "new file".
Comment: It was quite clear even in the original post that there was a "new file".  Therefore the file descriptor would have changed but `tail -f` would still read the old one.
Answer: I found an old, but very good "less" like program (a "pager"). It has a "R" command that refresh the file.
It's called "lv", You can install it on Ubuntu using:
sudo apt install lv

However, it seems to have no autoreload feature.


The most simple way to take data from excel file asp.net mvc

Question: I'm developing an ASP.NET MVC C# Application to take data from excel file and extract info from it to replace an Email Template that user created. But I see in many results I search the method so complicated and long. I would like to know the most simply want to take data from excel file. For example, my mail template has a  placeholder and I would like to extract the data from Distributor column and create a list of mail based on the excel file, how many rows does it have.
Comment: Possible duplicate of [Reading Excel files from C#](https://stackoverflow.com/questions/15828/reading-excel-files-from-c-sharp)
Comment: Look at the OpenXML SDK for Excel 2007+ to read the raw file without Excel.
Comment: Look up how to use Microsoft.Office.Interop.Excel.dll
Answer: Do not use interop in Server environment:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. Source: Microsoft note.
Check out this library - ExcelDataReader. It is fast and reliable and definitely not requires much code.
Answer: A sample code:
<code>public string excelParsing(string fullpath)
{
    string data = "";
    //Create COM Objects. Create a COM object for everything that is referenced
    Excel.Application xlApp = new Excel.Application();
    Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(fullpath);
    Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1];
    Excel.Range xlRange = xlWorksheet.UsedRange;

    int rowCount = xlRange.Rows.Count;
    int colCount = xlRange.Columns.Count;

    //iterate over the rows and columns and print to the console as it appears in the file
    //excel is not zero based!!
    for (int i = 1; i <= rowCount; i++)
    {
        for (int j = 1; j <= colCount; j++)
        {
             //either collect data cell by cell or DO you job like insert to DB
            if (xlRange.Cells[i, j] != null && xlRange.Cells[i, j].Value2 != null)
                data += xlRange.Cells[i, j].Value2.ToString();
        }
    }

    return data;
}
</code>
For detail description : http://sforsuresh.in/how-to-read-an-excel-file-using-asp-net-mvc4/


break whenever a file (or class) is entered

Question: In Visual Studio, is there any way to make the debugger break whenever a certain file (or class) is entered?  Please don't answer "just set a breakpoint at the beginning of every method" :)
I am using C#.
Comment: Specifying the language you're working with (Visual Studio could be C#, C++, Managed C++, or VB.Net) might help people to give you better suggestions.
Comment: What answer did you come up with?
Comment: Just set a breakpoint at the beginning of every method.
Comment: This functionality isn't available out of the box in visual studio.
To accomplish you have to mark each method or insert Debugger.Break(). (see my comment how to do this with a macro if you are using C/C++)
As a general principle you can consider "testing is cool, debugging sucks".
Comment: WHY do you want to do this? Probably we can help you with this information :)
Comment: I'm not sure if your c# addition was in response to my macro, but macros cannot be written in c#. They can, obviously, still interact with a c# project.
Answer: Macros can be your friend. Here is a macro that will add a breakpoint to every method in the current class (put the cursor somewhere in the class before running it).
Public Module ClassBreak
    Public Sub BreakOnAnyMember()
        Dim debugger As EnvDTE.Debugger = DTE.Debugger
        Dim sel As EnvDTE.TextSelection = DTE.ActiveDocument.Selection
        Dim editPoint As EnvDTE.EditPoint = sel.ActivePoint.CreateEditPoint()
        Dim classElem As EnvDTE.CodeElement = editPoint.CodeElement(vsCMElement.vsCMElementClass)

        If Not classElem Is Nothing Then
            For Each member As EnvDTE.CodeElement In classElem.Children
                If member.Kind = vsCMElement.vsCMElementFunction Then
                    debugger.Breakpoints.Add(member.FullName)
                End If
            Next
        End If
    End Sub

End Module

Edit: Updated to add breakpoint by function name, rather than file/line number. It 'feels' better and will be easier to recognise in the breakpoints window.
Comment: If it's helpful, in VS08 typing Ctrl+Shift+F9 will delete all breakpoints.
Comment: Access Macros via Tools->Macros->Macros IDE, then create a Module called ClassBreak and paste the code above. Then you can access the Macro via Tools->Macros->Macro Explorer (just double click ClassBreak -> BreakOnAnyMember to run it)
Comment: Can you provide a quick howTo link on how to create macros in Studio?
Comment: +1 . add please macros from removing all this breakpoints, after.
Comment: The simplest solution is to select all the breakpoints for that file in Debug > Windows > Breakpoints (or CTRL-D, B) and click delete (X). If no breakpoints appear in this window, check Columns > Name
Comment: Worked for 2/3 runs and then failed with exception "how to resolve Unspecified error(Exception from H_RESULT 0x80004005:EFAIL)" in VS2010
Comment: @user1502952 - The only thing I can imagine is the position of the cursor is outside a class (or somewhere confusing) or that the breakpoints are colliding.
Answer: You could start by introducing some sort of Aspect-Oriented Programming - see for instance
this explanation - and then put a breakpoint in the single OnEnter method.
Depending on which AOP framework you choose, it'd require a little decoration in your code and introduce a little overhead (that you can remove later) but at least you won't need to set breakpoints everywhere.  In some frameworks you might even be able to introduce it with no code change at all, just an XML file on the side?
Answer: Maybe you could use an AOP framework such as PostSharp to break into the debugger whenever a method is entered. Have a look at the very short tutorial on this page for an example, how you can log/trace whenever a method is entered.
Instead of logging, in your case you could put the Debugger.Break() statement into the OnEntry-handler. Although, the debugger would not stop in your methods, but in the OnEntry-handler (so I'm not sure if this really helps).
Here's a very basic sample:
The aspect class defines an OnEntry handler, which calls Debugger.Break():
[Serializable]
public sealed class DebugBreakAttribute : PostSharp.Laos.OnMethodBoundaryAspect
{
    public DebugBreakAttribute() {}
    public DebugBreakAttribute(string category) {}
    public string Category { get { return "DebugBreak"; } }

    public override void OnEntry(PostSharp.Laos.MethodExecutionEventArgs eventArgs)
    {
        base.OnEntry(eventArgs);
        // debugger will break here. Press F10 to continue to the "real" method
        System.Diagnostics.Debugger.Break();
    }
}

I can then apply this aspect to my class, where I want the debugger to break whenever a method is called:
[DebugBreak("DebugBreak")]
public class MyClass
{
    public MyClass()
    {
        // ...
    }
    public void Test()
    {
        // ...
    }
}

Now if I build and run the application, the debugger will stop in the OnEntry() handler whenever one of the methods of MyClass is called. All I have to do then, is to press F10, and I'm in the method of MyClass.
Answer: Well, as everyone is saying, it involves setting a breakpoint at the beginning of every method. But you're not seeing the bigger picture.
For this to work at all, a breakpoint has to be set at the beginning of every method. Whether you do it manually, or the debugger does it automatically, those breakpoints must be set for this to work.
So, the question really becomes, "If there enough of a need for this functionality, that it is worth building into the debugger an automatic means of setting all those breakpoints?". And the answer is, "Not Really".
Comment: Actually, I could see the usefulness of something like this for performing a quick-n-dirty code coverage verification.  I've done something like it myself sometimes for new functions I write where I'll put a breakpoint at each decision point to make sure the unit tests get good coverage.
Comment: @Mike B: That's why the Good Lord (or at least, BillG) gave us http://connect.microsoft.com/ to campaign for new features.
Comment: I can see some good reasons to do this, and the AOP approach or http://www.postsharp.org/ is a good way of implementing.
Comment: In fact I see a lot of situations when this would be handy, is your class loaded, when is something you've written called and how and why from external code. I think it would actually be easier than setting a breakpoint in every method, just put a break on the classes memory space, no?
Comment: Also, what if he wants to break whenever a member of a Class/Object is accessed?
Comment: @PintSizedCat: unfortunately, C# doesn't support data breakpoints yet, if that's what you mean
Comment: I'm not sure what's your point? "Don't do that?" The VC++ debugger and WinDebug can do this. The answer was not "not really" in those cases. Maybe I'm missing something?
Comment: The VC++ debugger CAN do this (Set a breakpoint on every function entry automatically)?  First I'm hearing of it....
Comment: Minus 1. You don't answer the question. If you don't know, you don't answer.
Answer: This feature is implemented in VS for native C++.  crtl-B and specify the 'function' as "Classname::*", this sets a breakpoint at the beginning of every method on the class.  The breakpoints set are grouped together in the breakpoints window (ctrl-alt-B) so they can be enabled, disabled, and removed as a group.
Sadly the macro is likely the best bet for managed code.
Comment: C++ solution described here: http://blogs.msdn.com/habibh/archive/2009/09/10/class-breakpoint-how-to-set-a-breakpoint-on-a-c-class-in-the-visual-studio-debugger.aspx
Answer: This works fine in WinDbg:
bm exename!CSomeClass::*

(Just to clarify, the above line sets a breakpoint on all functions in the class, just like the OP is asking for, without resorting to CRT hacking or macro silliness)
Answer: You could write a Visual Studio macro that obtained a list of all of the class methods (say, by reading the .map file produced alongside the executable and searching it for the proper symbol names (and then demangling those names)), and then used Breakpoints.add() to programmatically add breakpoints to those functions.
Answer: System.Diagnostics.Debugger.Break();

(at the beginning of every method)
Answer: No.  Or rather, yes, but it involves setting a breakpoint at the beginning of every method.
Answer: Joel, the answer seems to be "no".  There isn't a way without a breakpoint at every method.
Answer: Use Debugger.Break(); (from the System.Diagnostics namespace)
Put it at the top of each function you wish to have "broken"
void MyFunction()
{
    Debugger.Break();
    Console.WriteLine("More stuff...");
}

Answer: Isn't the simplest method to get closest to this to simply set a break point in the constructor (assuming you have only one - or each of them in the case of multiple constructors) ?
This will break into debugging when the class is first instantiated in the case of a non-static constructor, and in the case of a static constructor/class, you'll break into debugging as soon as Visual Studio decides to initialize your class.
This certainly prevents you from having to set a breakpoint in every method within the class.
Of course, you won't continue to break into debugging on subsequent re-entry to the class's code (assuming you're using the same instantiated object the next time around), however, if you re-instantiate a new object each time from within the calling code, you could simulate this.
However, in conventional terms, there's no simple way to set a single break point in one place (for example) and have it break into debugging every time a class's code (from whichever method) is entered (as far as I know).
Answer: Assuming that you're only interested in public methods i.e. when the class methods are called "from outside", I will plug Design by Contract once more.
You can get into the habit of writing your public functions like this:
public int Whatever(int blah, bool duh)
{
    // INVARIANT (i)
    // PRECONDITION CHECK (ii)

    // BODY (iii)

    // POSTCONDITION CHECK (iv)
    // INVARIANT (v)

}

Then you can use the Invariant() function that you will call in (i) and set a breakpoint in it. Then inspect the call stack to know where you're coming from. Of course you will call it in (v), too; if you're really interested in only entry points, you could use a helper function to call Invariant from (i) and another one from (v).
Of course this is extra code but

It's useful code anyway, and the structure is boilerplate if you use Design by Contract.
Sometimes you want breakpoints to investigate some incorrect behaviour eg invalid object state, in that case invariants might be priceless.

For an object which is always valid, the Invariant() function just has a body that returns true. You can still put a breakpoint there.
It's just an idea, it admittedly has a footstep, so just consider it and use it if you like it.
Answer: To remove the breakpoints set by the accepted answer add another macro with the following code
Public Sub RemoveBreakOnAnyMember()
    Dim debugger As EnvDTE.Debugger = DTE.Debugger

    Dim bps As Breakpoints
    bps = debugger.Breakpoints

    If (bps.Count > 0) Then
        Dim bp As Breakpoint
        For Each bp In bps
            Dim split As String() = bp.File.Split(New [Char]() {"\"c})

            If (split.Length > 0) Then
                Dim strName = split(split.Length - 1)
                If (strName.Equals(DTE.ActiveDocument.Name)) Then
                    bp.Delete()
                End If
            End If
        Next
    End If
End Sub

Answer: Not that I'm aware of.  The best you can do is to put a breakpoint in every method in the file or class.  What are you trying to do?  Are you trying to figure out what method is causing something to change?  If so, perhaps a data breakpoint will be more appropriate.
Answer: You could write a wrapper method through which you make EVERY call in your app.  Then you set a breakpoint in that single method.  But...  you'd be crazy to do such a thing.
Answer: Mad method using reflection. See the documentation for MethodRental.SwapMethodBody for details. In pseudocode:
void SetBreakpointsForAllMethodsAndConstructorsInClass (string classname)
{
  find type information for class classname
  for each constructor and method
    get MSIL bytes
    prepend call to System.Diagnostics.Debugger.Break to MSIL bytes
    fix up MSIL code (I'm not familiar with the MSIL spec. Generally, absolute jump targets need fixing up)
    call SwapMethodBody with new MSIL
}

You can then pass in classname as a runtime argument (via the command line if you want) to set breakpoints on all methods and constructors of the given class.
Answer: Files have no existence at runtime (consider that partial classes are no different -- in terms of code -- from putting everything in a single file). Therefore a macro approach (or code in every method) is required.
To do the same with a type (which does exist at runtime) may be able to be done, but likely to be highly intrusive, creating more potential for heisenbugs. The "easiest" route to this is likely to be making use of .NET remoting's proxy infrastructure (see MOQ's implementation for an example of using transparent proxy).
Summary: use a macro, or select all followed by set breakpoint (ctrl-A, F9).
Answer: If you are willing to use a macro then the accepted answer from this question
Should be trivially convertible to you needs by making the search function searching for methods, properties and constructors (as desired), there is also quite possibly a way to get the same information from the the ide/symbols which will be more stable (though perhaps a little more complex).
Answer: You can use Debugger.Launch() and Debugger.Break() in the assembly System.Diagnostics
Answer: You could put a memory break point on this, and set it to on read.  I think there should be a read most of the time you call a member function.  I'm not sure about static functions.
Answer: you can use the following macro:

#ifdef _DEBUG
#define DEBUG_METHOD(x) x DebugBreak();
#else
#define DEBUG_METHOD(x) x
#endif

#include <windows.h>

DEBUG_METHOD(int func(int arg) {)
    return 0;
}

on function enter it will break into the debugger
Answer: IF this is C++ you are talking about, then you could probably get away with, (a hell of a lot of work) setting a break point in the preamble code in the CRT, or writing code that modifies the preamble code to stick INT 3's in there only for functions generated from the class in question...  This, BTW, CAN be done at runtime...  You'd have to have the PE file that's generated modify itself, possibly before relocation, to stick all the break's in there...
My only other suggestion would be to write a Macro that uses the predefined macro __FUNCTION__, in which you look for any function that's part of the class in question, and if necessary, stick a
__asm { int 3 }

in your macro to make VS break...  This will prevent you from having to set break points at the start of every function, but you'd still have to stick a macro call, which is a lot better, if you ask me.  I think I read somewhere on how you can define, or redefine the preamble code that's called per function..  I'll see what I can find.
I would think I similar hack could be used to detect which FILE you enter, but you STILL have to place YOUR function macro's all over your code, or it will never get called, and, well, that's pretty much what you didn't want to do.


Scanning from HP PhotoSmart C4580 - what is SANE?

Question: I have a multifunction HP printer/scanner. I've always used it wirelessly with a PC before now, but want to connect it to my Maverick laptop. I have hplip installed and have connected the machine to the computer via USB (wireless is not supported.) The printer works just fine, but when I try to scan, the scanner's console (not the computer, but the window on the scanner itself) tells me there's an error.
I've looked at the hplip documentation for my machine, and it says, "Scan supported means that PC initiated scan using a SANE compatible software application is supported over parallel, USB, or network (depending on I/O connection)."
What is SANE? I'm assuming it's a driver that's already installed, but where do I find a SANE compatible software application?
Answer: I still can't claim to understand exactly what SANE is, other than some kind of driver. But you can find a list of compatible GUI apps at The SANE Project website.
Answer: I am no expert!
Try to install the XSANE or SANE package in Synaptic. You might also need to install libsane-hpao which contains SANE's backend drivers for HP scanners. Start either XSANE or SANE in the menu-graphics.
Hope this helps.
Answer: SANE is a program talking to your scanner hardware.
I have the same printer. I installed it using HPLIP which is installed by default in Ubuntu and scanning worked out of the box (install hplip-gui if you want the graphical menu).
However the printing driver added extra space (extra margins) so I uninstalled to try with another driver, installing it as a network printer through CUPS and using the hpijs driver instead of hp-cups. Which fixed my printing but broke scanning...
Installing the multifunction again through HPLIP toolbox added it as local printer and fixed scanning. So I keep the network version as default printer and renamed the local version to "scanner" to avoid confusion.


Simple Google Analytics API Algorithm

Question: One of those "urgent needed yesterday" projects has come up and would appreciate input.
We have Google Analytics account with a couple of reports which are in the "customization" section of the reports....
What is the best way to create a program that can pull this information for the reports, but with our code running a loop of dates (we need DAILY reports starting back in 2011) and export this to CSV....
to be more detailed I need the API code to do the following (this is obviously psuedo-algorithm but gets idea across hopefully)

Date: aug 2011 (this will be the top of the loop)
pull Page views, Pages /visit Visits, Visit Durations metrics
Feed custom Variable (this works great in google analytics itself, but I am lost as to how one does this via the API?)

Export to csv
loop again with next date
Questions on Solutions
Is Javascript or php a good way to go? if so does anyone have ANY examples/samples of how to do this?
2.BTW I have downloaded the SDK for asp.net C#... as you all might well know, with this being urgent need, I thought to ask if there is a simpler route I have missed...
Anyone use APp Scripts for something like this, where you can run a routine in a loop to get the spreadsheet/csv info?
Answer: solved!
I am working on documenting this insane world of Google analytics that put me through 8 hours of discovering and rediscovering how google expects API calls ...
as a hint I went with a simple .NET solution... once I have it all straight in my head and the project is done, I am documenting it and will update this post!

Simple Google Analytics API Algorithm


Middleman: run custom action after build

Question: How can I run custom action (eg. copy file to build folder) after middleman built pages?
I want to put Readme.md file from source to build dir.
Comment: I'm not familiar with middleman, but it looks like it runs in the terminal, so you could make a bash script to call middleman and then move the files into the correct folder.
Comment: I guess you also mean outside source - because all files within the source folder will be copied into the build by default.
Answer: You can use after_build hook. add following code to config.rb.
The hook which you can use is written in https://middlemanapp.com/advanced/custom_extensions/ .
Although it is not well documented, it seems that after_build can use directly in config.rb, without writing your own extension.
after_build do |builder|
  src = File.join(config[:source],"Readme.md")
  dst = File.join(config[:build_dir],"Readme.md")
  builder.thor.source_paths << File.dirname(__FILE__)
  builder.thor.copy_file(src,dst)
end

Answer: Though the after_build hook is a default answer, i would suggest using a task runner to do the job.
A task runner is awesome to make such routines easier. For example, most Middleman projects require deployment to a hosting server. So if you happen to use a task runner for deployment, you could use it for copying the file as well.
If you don't use a task runner, consider using one. It will save you a lot of nuisance.
Rake is the natural choice for Middleman's Ruby environment, but i prefer Grunt.
Here's a Grunt copy task (uses the grunt-contrib-copy plugin):
copy: {
  bowercomponents: {
    files: [
      {
        expand: true,
        flatten: true,
        src: [
          'source/Readme.md'
        ],
        dest: 'build/',
        filter: 'isFile'
      }
    ]
  }
}

And here's a deployment task using the grunt-shell plugin:
shell: {

    buildAndPublish: {
        command: [
          'echo "### Building ###"',
          'bundle exec middleman build --verbose',

          'echo "### Adding built files to git index ###"',
          'cd build/',
          'git add -A',

          'echo "### Commiting changes ###"',
          'git commit -m build',

          'echo "### Pushing the commit to the gh-pages remote branch ###"',
          'git push origin gh-pages',
          'cd ..'
        ].join(' && '),
        options: {
          stdout: true,
          stderr: true
        }
    }

}


Does Robocopy SKIP copying existing files?

Question: I have read that Robocopy does not replace existing files (even if different) in the destination. But I can't find a Command Line switch for that. Is it enabled by default?
Comment: RichCopy is a better alternative...https://technet.microsoft.com/en-us/magazine/cc6e2e09-912c-43c2-b8f6-052c6e92051c
Answer: Only if you explicitly ask it to.
The help says:
C:\WINDOWS\system32>robocopy /?

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Tuesday, August 16, 2016 17:26:53
              Usage :: ROBOCOPY source destination [file [file]...] [options]

             source :: Source Directory (drive:\path or \\server\share\path).
        destination :: Destination Dir  (drive:\path or \\server\share\path).
               file :: File(s) to copy  (names/wildcards: default is "*.*").

::
:: Copy options :
::
                 /S :: copy Subdirectories, but not empty ones.
                 /E :: copy subdirectories, including Empty ones.
             /LEV:n :: only copy the top n LEVels of the source directory tree.

                 /Z :: copy files in restartable mode.
                 /B :: copy files in Backup mode.
                /ZB :: use restartable mode; if access denied use Backup mode.
                 /J :: copy using unbuffered I/O (recommended for large files).
            /EFSRAW :: copy all encrypted files in EFS RAW mode.

  /COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
                       (copyflags : D=Data, A=Attributes, T=Timestamps).
                       (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).

               /SEC :: copy files with SECurity (equivalent to /COPY:DATS).
           /COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).
            /NOCOPY :: COPY NO file info (useful with /PURGE).
            /SECFIX :: FIX file SECurity on all files, even skipped files.
            /TIMFIX :: FIX file TIMes on all files, even skipped files.

             /PURGE :: delete dest files/dirs that no longer exist in source.
               /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

               /MOV :: MOVe files (delete from source after copying).
              /MOVE :: MOVE files AND dirs (delete from source after copying).

     /A+:[RASHCNET] :: add the given Attributes to copied files.
     /A-:[RASHCNET] :: remove the given Attributes from copied files.

            /CREATE :: CREATE directory tree and zero-length files only.
               /FAT :: create destination files using 8.3 FAT file names only.
               /256 :: turn off very long path (> 256 characters) support.

             /MON:n :: MONitor source; run again when more than n changes seen.
             /MOT:m :: MOnitor source; run again in m minutes Time, if changed.

      /RH:hhmm-hhmm :: Run Hours - times when new copies may be started.
                /PF :: check run hours on a Per File (not per pass) basis.

             /IPG:n :: Inter-Packet Gap (ms), to free bandwidth on slow lines.

                /SL :: copy symbolic links versus the target.

            /MT[:n] :: Do multi-threaded copies with n threads (default 8).
                       n must be at least 1 and not greater than 128.
                       This option is incompatible with the /IPG and /EFSRAW options.
                       Redirect output using /LOG option for better performance.

 /DCOPY:copyflag[s] :: what to COPY for directories (default is /DCOPY:DA).
                       (copyflags : D=Data, A=Attributes, T=Timestamps).

           /NODCOPY :: COPY NO directory info (by default /DCOPY:DA is done).

         /NOOFFLOAD :: copy files without using the Windows Copy Offload mechanism.

::
:: File Selection Options :
::
                 /A :: copy only files with the Archive attribute set.
                 /M :: copy only files with the Archive attribute and reset it.
    /IA:[RASHCNETO] :: Include only files with any of the given Attributes set.
    /XA:[RASHCNETO] :: eXclude files with any of the given Attributes set.

 /XF file [file]... :: eXclude Files matching given names/paths/wildcards.
 /XD dirs [dirs]... :: eXclude Directories matching given names/paths.

                /XC :: eXclude Changed files.
                /XN :: eXclude Newer files.
                /XO :: eXclude Older files.
                /XX :: eXclude eXtra files and directories.
                /XL :: eXclude Lonely files and directories.
                /IS :: Include Same files.
                /IT :: Include Tweaked files.

             /MAX:n :: MAXimum file size - exclude files bigger than n bytes.
             /MIN:n :: MINimum file size - exclude files smaller than n bytes.

          /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.
          /MINAGE:n :: MINimum file AGE - exclude files newer than n days/date.
          /MAXLAD:n :: MAXimum Last Access Date - exclude files unused since n.
          /MINLAD:n :: MINimum Last Access Date - exclude files used since n.
                       (If n < 1900 then n = n days, else n = YYYYMMDD date).

                /XJ :: eXclude Junction points. (normally included by default).

               /FFT :: assume FAT File Times (2-second granularity).
               /DST :: compensate for one-hour DST time differences.

               /XJD :: eXclude Junction points for Directories.
               /XJF :: eXclude Junction points for Files.

::
:: Retry Options :
::
               /R:n :: number of Retries on failed copies: default 1 million.
               /W:n :: Wait time between retries: default is 30 seconds.

               /REG :: Save /R:n and /W:n in the Registry as default settings.

               /TBD :: wait for sharenames To Be Defined (retry error 67).

::
:: Logging Options :
::
                 /L :: List only - don't copy, timestamp or delete any files.
                 /X :: report all eXtra files, not just those selected.
                 /V :: produce Verbose output, showing skipped files.
                /TS :: include source file Time Stamps in the output.
                /FP :: include Full Pathname of files in the output.
             /BYTES :: Print sizes as bytes.

                /NS :: No Size - don't log file sizes.
                /NC :: No Class - don't log file classes.
               /NFL :: No File List - don't log file names.
               /NDL :: No Directory List - don't log directory names.

                /NP :: No Progress - don't display percentage copied.
               /ETA :: show Estimated Time of Arrival of copied files.

          /LOG:file :: output status to LOG file (overwrite existing log).
         /LOG+:file :: output status to LOG file (append to existing log).

       /UNILOG:file :: output status to LOG file as UNICODE (overwrite existing log).
      /UNILOG+:file :: output status to LOG file as UNICODE (append to existing log).

               /TEE :: output to console window, as well as the log file.

               /NJH :: No Job Header.
               /NJS :: No Job Summary.

           /UNICODE :: output status as UNICODE.

::
:: Job Options :
::
       /JOB:jobname :: take parameters from the named JOB file.
      /SAVE:jobname :: SAVE parameters to the named job file
              /QUIT :: QUIT after processing command line (to view parameters).
              /NOSD :: NO Source Directory is specified.
              /NODD :: NO Destination Directory is specified.
                /IF :: Include the following Files.

::
:: Remarks :
::
       Using /PURGE or /MIR on the root directory of the volume will
       cause robocopy to apply the requested operation on files inside
       the System Volume Information directory as well. If this is not
       intended then the /XD switch may be used to instruct robocopy
       to skip that directory.

As you can see in the /X area, there are multiple options that can support your demand:
 /XF file [file]... :: eXclude Files matching given names/paths/wildcards.
 /XD dirs [dirs]... :: eXclude Directories matching given names/paths.

                /XC :: eXclude Changed files.
                /XN :: eXclude Newer files.
                /XO :: eXclude Older files.
                /XX :: eXclude eXtra files and directories.
                /XL :: eXclude Lonely files and directories.

depending on what exactly you want - /XC excludes all changed files, for example.


Is ubuntu adopting performance for gaming?

Question: I was just wondering if the future builds of ubuntu would give better performance with games and multi-tasking.
Many threads suggest that ubuntu gives slower performance with many active applications than Windows. I agree that linux platform is yet to rival with windows when it comes to multi-tasking.
But still, can the future builds (hopefully the next one) of ubuntu give good performance with games and stuff like high end graphics?
Comment: Can you give examples of these threads? Because from what STEAM says, linux, especially ubuntu, gives better fps than windows in the same configurations.
Answer: Yes,  STEAM is on linux and probabbly for ubuntu than you can play almost any kind of heavy graphical games and anything and form than forward you will see drastic changes on gaming on `LINUX/UBUNTU. And its not that ubuntu is slow unity has to be improved a bit but if you play games on Steam than there should be no problem.
And yes now vendors of PC's are taking ubuntu seriously like DELL, ACER and now they will make hardware more compatible with LINUX and there own drivers for Graphic cards ETC and than you will see the real power of linux and you should know that Android is Linux and you know there are alot of heavy games for android if android can run heavy games on small mobile device than why not ubuntu on multi-core device.
Comment: steam has been on linux for quite some time. I believe it's in ubuntu's repositories even...
Comment: yea but frpm linux above i meant to say ubuntu


Can a devil patron grant a warlock immortality?

Question: Are devils limited with regards the powers they give to a warlock by a pact? I want to know if a devil can grant immortality by a pact. Normally they want the souls after death.
Comment: Are you asking whether the rules allow adding effects to a pact that aren't part of the class features, or are you asking whether a devil *would* offer immortality? Those are two different questions.
Comment: I think we need some clarity with this question. Is the devil in question a warlock patron? Do you want the devil to grant immortality to the warlock as a part of that pact? Are you worried that the devil would not do this because they actually want the warlock to die so that they can have the warlock's soul for eternity? Or are you asking an entirely different question?
Comment: @Mathaddict Based on the previous question that this was part of, I believe the question is whether a warlock's devil patron can bestow immortality as part of a pact.
Comment: @QuadraticWizard thats what i mean
Comment: Edited to clarify the meaning of the question.
Comment: What text in the Players Handbook are you reading that suggests that this is something a warlock receives from its patron?  What boon in the DMG are you using as a reference?
Answer: The DM can do whatever they want to, including adding additional effects to a pact, so this isn't really something we can answer with the rules-as-written. Presumably if the DM does this, there would be some story-based reason for it.
Whether a devil would offer immortality, and what exactly that means, is a question the DM would also have to handle on a narrative level. Normally, a warlock trades their soul for the magical powers that make up their class features, but devils make lots of kinds of bargains with mortals that aren't necessarily related to the warlock class. (For example, if a person sold their soul to grant power to another person, then the devil might be looking for a way to get the recipient of those powers to also sell; or if the warlock performed some great service, they may be able to demand a repayment in the form of an extra gift, though perhaps one with strings attached.)
In the real-world folktales, immortality is often one of the things the Devil will offer to somebody, but -- one supposes -- only if they're pretty wicked already and he's pretty sure keeping that person around will inflict more harm on the world than letting them pass on, thus setting up a villain for the hero to face and some conditions that will require an adventure to deal with.
But devils' bargains being what they are, I think we can assume there will be some sort of twist to it. Just to start with, "immortality" can mean a lot of things:

Unending age - you never die, but continue to grow older and more infirm forever
Ageless - you remain young forever but can be killed as easily as any mortal
Deathless - you can't die but damage still accrues to your body and may not heal
Invincibility - you regenerate from any injury or damage
Revival - you can die but will always come back (sooner or later)

For example, the elves of Lord of the Rings are ageless*, the characters in Death Becomes Her are deathless, the Greek prince Tithonus aged forever until he withered into an insect, and certain characters in Baldur's Gate are invincible.
And then there are riders or conditions to the immortality, like the classic Koschei the Deathless stories, where he's effectively invincible, but can be killed if you can find his heart (hidden in the eye of a needle in an egg in a duck in a rabbit, etc.) and destroy it. Possibly a PC warlock is ageless, but only as long as they keep using their infernal pact to take lives, which feeds their ageless state (and also gives them temporary HP).
From a game-balance perspective, agelessness (eternal youth) is more or less meaningless. A character's whole adventuring career may span only a few years or a decade of in-universe time, depending on how big the gaps between adventures are (if any), and writing down that you're actually 900 years old instead of 19 means very little. Similarly, being able to revive when you die may not actually equate to an in-game power boost if the revival period is long enough (e.g. if you'll come back but it takes 10 years, that's not going to help the party or have any impact on the current storyline).  Obviously, being able to regenerate like Wolverine would be completely broken in a game-mechanical sense, so probably not that one, at least for a PC.
*Technically, Tolkien's elves also have that Revival thing going on, but since their respawn point is outside the world of mortals and they can't really come back after, it's functionally death as far as anyone outside Valinor is concerned.
Comment: "immortality from age" is a classic example, only to be used to either torture the victim into suicide or setting them up to be slain by someone else.
Comment: "Unending" age is what King Cikadus of Greek Myth got when he asked the gods to never die. He got ever smaller and more shrivelled until he was tiny, and his voice was just a chirping to be heard. It where cicadas get their name from.
Comment: THANK YOU! I knew there was a classical example of getting older forever but I couldn't remember what story it was. Name was actually Tithonus though.
Comment: @DarthPseudonym, Ah yes, I recounted it from memory. You are entirely right about the name.
Comment: The last example of "immortality" reminds me of the curse Subaru from the Anime Re:Zero suffers: He can die, but revives a little bit in the past afterwards, with all the memories and the pain he felt intact.
Comment: "Revival" reminds me of the [daily curse](https://www.goblinscomic.com/comic/11092015-2) from the Goblins comic, or Nameless One from [Planescape: Torment](https://en.wikipedia.org/wiki/Planescape:_Torment)
Comment: Yeah, Torment is one of the things I was thinking of. But in the case of Torment, it *is* quick enough to have a game impact, so something like that would be a terrible idea in a real tabletop game.
Answer: Immortal, perhaps, but not invulnerable.
D&D 5th edition lore heavily ties the devil's pact to the warlock character class. However, books from earlier editions of D&D (and therefore the canonical history of Faerûn) often describe pacts which grant a huge variety of different boons, which may plausibly include immortality.
Baldur's Gate: Descent into Avernus, Appendix A, refers to these as Diabolical Deals, and even lesser devils like imps can offer them. This is different than a warlock's pact, which according to the Player's Handbook can only be offered by the most powerful of devils. (You could, for example, sell your soul to an imp for a single magic item.)
However, the ultimate goal of a devil is to reap the contractee's soul eventually, and they are particularly well known for exploiting technicalities in contracts. Therefore, while they might grant someone immortality, they will certainly have some loophole in mind.
Immortality as a reward
In the D&D 5e Dungeon Master's Guide, there's an Epic Boon called the Boon of Immortality, which allows someone to never die of old age. It's possible for a warlock to receive such a boon from their patron after reaching level 20, or a cleric from their deity, and so on. It's entirely possible for a warlock's patron to grant them some gifts like this. However, they can still die if slain.
Descent into Avernus suggests that a diabolical deal with an archdevil can give you the benefit of a wish spell, which can do practically anything including bringing the dead back to life, DM willing. Avernus suggests you can have immunity to aging, although not immortality. In other words, immortality is the upper bounds of power, relative to what you would normally be given, and it may even be too powerful a reward. A wish spell can also have unexpected consequences if you ask too much of it, so perhaps you would simply be transformed into a vampire, which is technically a form of immortality.
In the AD&D 2e World of Greyhawk sourcebook Ivid the Undying, there is a mage named Karoolck who made a pact with the archfiend Baalzephon. He is not truly immortal, but will live without aging for 333 years, and return to life if slain during that time. Since Karoolck is a powerful 19th-level archmage, it gives the sense that actual immortality is rarely awarded.
Comment: But it is not the devil's pact, it is the Fiend Patron and pacts are made with The Fiend.
Comment: @KorvinStarmast True, but the devil is a subcategory of fiends, and is the one best associated with fiendish pacts in the lore. I can't think of any warlocks whose patron is a yugoloth, for example.
Comment: QW: Orcus and Demagorgon are demon princes who could easily be fiend patrons.


Where can I see how many points of reputation I have lost from all my deleted posts (without doing it manually)?

Question: I'm an active member on Mathematics.
Where can I see how much reputation I have lost with all my deleted posts (not to do it manually)?
Answer: You can semi-automatically get this by adding up the reputation earned numbers in the annual reputation league pages. The number displayed for reputation earned within a given time frame excludes changes as a result of "private" reputation events such as deleted posts. Therefore, if you add up the reputation numbers that the league shows you as having earned every year (the longest period available for which that number is shown), and subtract that from your current rep, you'll get the overall gain/loss in rep that happened because of "private" reputation events.
Keep in mind that said "private" reputation events also exclude the 1 rep you lose from downvoting answers (as well as the -100 penalty for posting spam or abuse), so to get the actual true number you'll need to add to your prior calculation the number of answers you've downvoted, which you'll have to either manually count in the "votes" tab on your user profile, or use this trick to extract them from the /reputation page (assuming you haven't received any -100 penalties for spam or abuse).
tl;dr: you can get that number with the following formula:
Your current rep
 - SUM(Reputation earned per year, as displayed in annual rep league pages)
 + Number of answers you've downvoted
 + (Number of posts deleted as spam or abusive, for which the red flags weren't cleared) * 100
 = Amount of rep you've gained or lost due to deleted posts

Answer: Use this SEDE query: Shows all deleted answers for the specified user, your user number is 463553 and the result is:

You'll see more information if you run the query yourself and scroll sideways. The posttypeid can be edited: Meaning of Values for PostTypeId in data explorer or in data-dump.
Comment: First of all, this only returns answers, not all posts. You also need the score breakdown (because +3 could be +53/-50). Then, you need to make sure that the post did not meet the criteria for the points to be kept (which I think is a score of +3 and the post is at least 60 days old when it is deleted).