System hotkey to execute cmus-remote?

Question: I am a huge fan of the terminal-based music player cmus. It does everything I want from a music player and nothing I don't. I want to use it instead of iTunes on my Macbook. I installed it via homebrew and it's working great, except for one thing...
I'm trying to set up a system hotkey to play/pause cmus even if it's not focused. cmus provides a command-line program to help you do this.
cmus-remote --pause

Running that from anywhere will connect to the running cmus instance via a socket and issue the play/pause command.
So I'm trying to set up a system hotkey to run that command and play/pause cmus. As suggested in another answer, I've tried creating an Automator service workflow that runs the script. So hotkey starts the Automator service which runs the shell script which runs cmus-remote.

Now here's the real problem:
This Automator workflow works perfectly when I run it from the Automator edit interface, but it always fails when I try to run it as a service. The error message contains no useful information, just "The action "Run Shell Script" encountered an error."
I've attempted to put some debugging output into my script:
echo "AUTOMATION STARTED" >> ~/automation.txt
/usr/local/bin/cmus-remote --pause 2>&1 >> ~/automation.txt

When I read that file, all I see is:
AUTOMATION STARTED

Clearly the workflow is starting and running, and it's the cmus-remote command itself that is failing.
So...

Why this would cmus-remote work inside the Automator GUI, but die mysteriously outside of it?
Is there anyway to get more failure info out of cmus?
Are there open-source alternatives to Automator for binding system hotkeys to simple shell commands?
Answer: I think there is a security setting in Mavericks (and possibly Mountain Lion) that causes Automator not to allow system control. See this question
Open your Console and watch the logs when you run the service. In my case, it crashes when I try to run a shell script.
I tried adding Automator to the Security and Privacy preferences, but it did not solve the issue.
As a work around, you may have to use applescript to create and app, tie that to a service, and add the app to the Privacy tab of your Security and Privacy preference pane.

System hotkey to execute cmus-remote?


Coins not yet refllecting in wallet

Question: i transferred coins to my wallet, but the wallet hasn't finished syncing with the network as yet, so the coins have not reflected. Is this something i need to be concerned about? Do i just wait for it to finish and then see if they appear? I did use the address the wallet gave me.
Answer: Assuming you sent the amount to the correct address you have nothing to worry about. This is expected for a wallet that has to download and verify the whole blockchain. Other wallets use SPV that only verifies transactions for your addresses and thus they do not have to download the whole blockchain. Examples of SPV wallets for the desktop are Multibit and Electrum.
After syncing you will see the balance reflected but you could also immediately check if the coins arrived to your address correctly with a block explorer. E.g. go to Blockchain.info or BlockExplorer and search for your address: you will see the amount on that address, the number of confirmations, etc.
Comment: Also check [this](http://bitcoin.stackexchange.com/questions/6056/cannot-access-my-bitcoins-because-my-wallet-is-still-synchronising-what-can-i-d) if you want to use your coins right now.

Coins not yet refllecting in wallet


How to remove background noise in video being edited in Premiere?

Question: I'm pretty new to video editing and we recently filmed in a slightly crowded area. Any tips on how to minimize the background noise without affecting much the conversation of my main characters? BTW, I'm using Premiere for this.
Comment: Could you post an audio extract with both background noise and speech? (e.g. via soundcloud)
Answer: Here are a few things to try:

Use EQ to reduce frequencies not essential to the vocal: high pass from around 300-600 Hz depending on voice types, and low pass to around 4-5 KHz, maybe lower if result is ok for you. There may be some noise with a significant peak in the midrange which you also can reduce. The problem in general here is that you probably have frequency areas with both noise and speech.
Use an expander to attenuate background noise in pauses: Find a safe threshold below the lowest volume speech part. Set the expander to reduce sounds below this level. This requires that your speech is consistently louder than the noise, and you must ensure that the ratio is not too hard, otherwise you'll get a gated feel to it, which won't sound natural.
Dub it.. (i.e. rerecord the dialog, definitely last resort).
Comment: Great suggestions. I searched EQ effect in Premiere and they looked very intimidating. A lot of knobs I can control. lol. For option 2, Can you further elaborate what setting I need to tweak on that? I like option 3 as the last resort. :)


Is it possible to use a two or three chainring with an internal hub?

Question: I have a Bullit cargo bike. It has a Shimano 39t chainring and a Alfine 8 rear hub. I was going to go for a Rohloff to get more gears, but the price is just getting stupid. I looked at the Alfine 11 but its lowest gear is reported to be the same as the Alphine 8 and I need lower gears to get me up hills. So I have now turned my attention toward buying a smaller chainring that will fit the 68mm HollowTech ii. But I have been thrown by the discussions about chain sizes. If I purchase a chainring with say an SLX 40,28T or Delore 38T,24T would this mean than my normal 1/8th chain would get stuck. fall off etc. And can you use a Deraillia shifter on a front chainring while keeping the rear hub? I am trying to keep my top speed but also obtain lower gears for the hills. I have used the Bullit to carry camping gear and my dog for many trips but now want to tackle some real mountains.
Comment: When you add a crank with 2 chainrings, you are going to need some way of accommodating the difference in chain length when you shift from one chainring to the other.  You will need a chain tensioner (like this: http://www.amazon.com/Shimano-Alfine-Chain-Tensioners/dp/B003UW64N2) You should check if your bike has a way of installing one of those.  Maybe if you read the Amazon reviews for that item, you can learn more about your situation.
Comment: Thank you for this. Have been reading the reviews and understand why I would need a tensioner. Common sense really. The Bullitt's frame is designed for a cassette and there is a fixing spot for the tensioner.
Answer: From what I've read about the Alfine 11 and 8, the lowest ratio is about the same, but the Alfine 11 has a greater highest ratio.  So you could use an Alfine 11 and a smaller front chainring.  Then your top gear would remain about the same, and your lowest gear would get lower.
Try this site for comparing gear ratios, I have found it to be extremely useful:
http://www.ritzelrechner.de
This link will take you to a comparison of Alfine 8 + 39T and Alfine 11 + 33T:
http://ritzelrechner.de/?GR=SA11&KB=33&RZ=20&UF=2125&TF=90&SL=2.5&UN=KMH&GR2=SNI8&KB2=39&RZ2=18&UF2=2125
Comment: Thank you again Nik for adding the comparison site for both hubs. Have been playing with it for some time. Have not decided what to do yet, going to sleep on it. I think it is a choice between buying the 11 with a single chainring, or keeping the 8 and adding two chainrings with the tensioner.
Answer: As is the case with 99% of the questions on this site, Sheldon Brown has an answer for us.
http://sheldonbrown.com/org/otb.html
A 63 speed bicycle.
My recollections from previous discussions about this topic is that you need to be careful to not get too low a gear ratio; if you get the front chainring very small you can have problems with stripping the planetary gears in the Alfine hub.
BTW, it is extremely unlikely that you have a 1/8 inch chain. Shimano generally recommends 9spd 3/32 chain for use with Alfine hubs.
Comment: Have checked Sheldon's site twice but now thanks to you have found what I need. I especially liked how he converted  cassette into a 3-speed hub - and still had a three chain ring in the front. Thank you for you valuable insight.


What considerations must you take into account before you can attempt to configure clustering on your network?

Question: I work as a computer network manager for a large software company. My company sells its software through a web site that is hosted on the company's network. As the company grows, we find that the web server cannot handle the load generated by the traffic on the site. I need to come up with a solution for managing the load on the server, and clustering came to mind. What considerations must I take into account before I can attempt to configure clustering on my network? What must I do in order to analyze business and application requirements? How can I plan storage methods? How can I plan server capacity? How can I plan failover policies?
Comment: "I work as a computer network manager for a large software company" - erk!
Answer: "Formal" clustering is complex and not something I'd look at for a web server due to the complexity probably not being needed.
Have you looked at simple load balancing? Have you considered looking at the website to see if its been coded efficiently to scale, e.g. separate servers for static content such as images, etc? If you use a lot of SSL then have you considered SSL accelerators to move that workload off the web server?
Answer: I see many questions here, and I believe, these can be best answered with more information.
I suggest you start with a good resource to understand the concepts.
If you are looking for Microsoft Cluster, http://technet.microsoft.com
Clusters are basically two types: 1) Failover  2) N/w load balancing.
First, decide which way you want to go and then take it from there.
If you are looking for clustered web server, I suggest you start here
http://technet.microsoft.com/en-us/library/cc778748(WS.10).aspx
Checklist: Planning and creating a server cluster: is also a good start
http://technet.microsoft.com/en-us/library/cc757338%28WS.10%29.aspx
You will find lots of information about Microsoft Clustering here:
http://blogs.msdn.com/b/clustering/


Does any amendment in the bill of rights take priority over any other?

Question: As far as I know, unless a contract/compact states otherwise, or a provision was added at a different point of time, every provision in the contract carries the same priority. The bill of rights was added to the constitution all at once and so each amendment carries the same priority and so when there is a conflict least restrictive means has to be applied.
Comment: The summary in the body of your question seems fairly sound until the end, where it assumes that "when there is a conflict least restrictive means has to be applied."  Where did that come from, and why would it be applicable to a conflict in the Bill of Rights?
Comment: Contracts. Generally if there is no evidence as to difference in priority, least restrictive means is used, though it's of course up to the arbiter at the end of the day.
Comment: The constitution is not a contract, nor is the bill of rights.
Comment: Note that I try to use "contract/compact." While it is not a contract, because that would imply some super-federal legal body, it is indeed a compact. It is an agreement between the states, who act as agents of the people.

If we could arbitrarily select which provisions dominate, then there are any problems.
Answer: Sometimes rights conflict with each other, and the courts decide which right takes priority.
The Sixth Amendment provides that a defendant is entitled to "compulsory process for obtaining witnesses in his favor".  The Fifth Amendment says "No person... shall be compelled in any criminal case to be a witness against himself".  And the First Amendment gives the right to free speech, which includes the right to not be compelled to speak.
If you're on trial and try to get someone else to confess on the stand, his Fifth Amendment right against self-incrimination trumps your Sixth Amendment right to have him testify.  But if he couldn't take the fifth (for example, if he had already been acquitted), your Sixth Amendment right would override his First Amendment right to free speech.
Comment: Very good example


Best practice for template theming - #markup vs safe_value

Question: When doing complex display logic and breaking apart a renderable array in a field collection template, what's the best string output to use from the array: #markup, or safe_value? Presumably #markup is already run through the right filters... right?
Answer: You actually want to use the render() function like so:
<?php print render($content[FIELD_NAME]); ?>

See http://api.drupal.org/api/drupal/includes%21common.inc/function/render/7 for reference. Also, be sure to use hide($content[FIELD_NAME]) right before you render $content or you will render the field a second time (unless you've hidden it in the view mode on the Manage Display tab of the content type).
Comment: Thanks, but I'm working with a field collection template, and it's a bit hairier than that. Tried to keep the question general and best-practicy though. That would work in the node template, yes. Attempts at solving the specific problem: https://drupal.org/node/1398966, http://drupal.stackexchange.com/questions/35355/accessing-a-field-collection
Comment: You can accomplish the same thing in the field-collection-item.tpl.php as in the node template. Directly from the tpl comments:`$content: An array of comment items. Use render($content) to print them all, or
 *   print a subset such as render($content['field_example']). Use
 *   hide($content['field_example']) to temporarily suppress the printing of a
 *   given element.`
Comment: Not usefully for our case, alas. Theming the field-collection-items template is nasty, and there is currently a core bug in the ordering of .tpl.php files that means the template of a field-collection-item.tpl.php recurses, being applied to the output of each field item inside it as well, and there's no way to make it idempotent. It's truly awful if you want to access specific items within a collection and change their order, for example to collate them in the output. We went a built a custom formatter instead and grabbed the field data off the entity IDs. Proved far less painful.
Comment: I'm giving this accepted answer, because even though it doesn't work for *our* use-case, it is the best standard way. (However, I still would really like to know, just for curiosity's sake, for people who must output raw from an array, which is better to use, safe-value or #markup. ;)


High Range WiFi receiving antennas

Question: I am looking to see if what I am trying to do is even possible. Is there an antenna powerful enough that I can connect with to regular WiFi networks that are hundreds of meters away. If it is sensitive enough wouldn't it be able to capture and send packets to many meters away? Is it going to be easy to create a channel and communicate normally? Would the connection be too slow or have any downsides such as static noise?
Comment: There are directional antennae that can be used to connect two distant networks. There are also laws regarding the use of high-gain antennae, so you should check before using. This will not usually work for distant clients because Wi-Fi is two-way, and the radios and antennae in most clients simply can't reach a distant WAP.
Comment: I understand that it is a two way communication, however wouldn't a powerful and yet sensitive enough antenna be able to both capture and send?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: The most powerful ones that I dealt with first hand that were still impressive were the Ubiquiti Long Range devices. We were able to link from device to WAP from 150m away (I know this isn't the plural "Hundreds of meters", but perhaps it can give you a starting point and this particular WAP, I actually witnessed holding solid at 200Mbps as opposed to reading a spec and repeating it here).
Comment: could you link to that specific product or a more powerful one?
Comment: Product or resource recommendations are explicitly off-topic here, as they are on most SE sites. There is [hardwarerecs.se].

High Range WiFi receiving antennas


Can the contingency spell trigger a cantrip?

Question: Can the contingency spell trigger a cantrip?  Ex. Could your death trigger spare the dying?
Answer: Yes, contingency can trigger cantrips, including spare the dying (assuming you can cast it).

Choose a spell of 5th level or lower that you can cast, that
  has a casting time of 1 action, and that can target you.

Cantrips are level 0 spells:

A cantrip's
  spell level is 0.

So they are spells of lower than 5th level. The spare the dying cantrip has a casting time of 1 action, and can target you, so as long as you can cast it, it's a valid choice for contingency.
You should note, though, that it needs to be triggered by you reaching 0 hit points, not by your death.

You touch a living creature that has 0 hit points. The
  creature becomes stable.

If you've died, it's too late for spare the dying to help you. It needs to be triggered while you're still dying in order to save you.
Comment: While this is the intuitive solution (+1), [recent discussion](https://rpg.stackexchange.com/questions/124707/can-i-select-a-spell-that-doesnt-use-a-slot-as-a-contingent-spell/124710) leads me to question whether this is true (but not reject outright) since *contingency* hints at needing to expend a spell slot. You may want to consider that with your answer here or weigh in over there.


Is hypotheticality a word?

Question: My browser's spelling checker say it isn't. Google results showed no authentic sites apart from wiktionary
Comment: It's a regular construction through a productive derivation with a predictable meaning; I don't see why any dictionary would feel constrained to list it.
Comment: Well, I got a list of books on GOOGLE.BOOKS that cite this word in very reliable sources. Maybe you and I don't have the same google, but in my search I read articles about "The Hypotheticality Continuum in Russian," the "hypotheticality of human action" in philosophy, the "hypotheticality of a resumptive protasis" in Arabic, the "hypotheticality of the apodosis" in English poetry, the hypotheticality inherent in Newton's Law, and many more. I think it's safe to say it's a word.
Comment: @CocoPop this proves nothing, I googled "the hypotheticality" between quotes and got this question as the first result.
Comment: I googled "the hypotheticality" between quotes and got over 2000 hits.
Comment: @StoneyB- but I can produce both *hypotheticality* and *hypotheticalness*.  Ngrams say the former is much more prevalent but it also shows a bump in 1870's where the opposite appears to be true. I'm on my phone so I didn't investigate further.
Answer: Words get into dictionaries, when the dictionary editors find evidence of extensive usage over time. See this Ask the editor video from MW or this explanation by Kory Stamper delivered in a talk show for a story about that.
So, is the word " hypotheticality" being used? (Oh, look, my browser just underlined it as incorrect as well).
Google Books gave 432 results for this word. I haven't checked each and every one of those for false positives and untrustworthy publishers, but here is an example that is good:

Like Reporting, Hypotheticality is based on the notion of authorial detachment, but here the writer detaches him/herself from the world of actuality through the creation of a hypothetical world. Hypotheticality presupposes that the writer is aware of the gap between his/her conceptual world and that of the reader and by means of this device the writer is able to set up a world where there are only two countries, two linguistic theories in order to confine him/herself to those aspects of a situation that will enable him/her to derive a generalization.

from: Advances in Written Text Analysis edited by Malcolm Coulthard, Routledge, 2002.
Another one:

These alternatives to the directly experienced reality define, respectively, four dimensions of psychological distances - temporal distance, spatial distance, social distance and hypotheticality.

from: Social Psychology: Handbook of Basic Principles edited by Arie W. Kruglanski, Edward Tory Higgins, Guilford Press, 2007
There is another one (found through 'ordinary' Google):

Aspects of the meaning of if … then for older preschoolers: Hypotheticality, entailment, and suppositional processes

This is the title of a scientific article from: Cognitive Development
Volume 7, Issue 2, April–June 1992, Pages 189–212
Psychology isn't my field, but this journal was published by Elsevier, which is a respected publisher for scientific journals.
In the end this Google Ngram shows that the word has appeared here and there since the 30s, but it gained popularity (and if I see correctly the usage tripled) since 1990.

I expected to find it in a dictionary and checked ODO, MW, CDO, LDOCE, AHD, Collins and Macmillan - and found nothing (or I found 'hypothetical' but not 'hypotheticality').
So, is it a word? Based on the fact that it is being used in print, published by reputable sources, I'd say yes. The fact that it is formed in a way nouns are derived from adjectives (as StoneyB noted in his comment) by adding the suffix -ity to the adjective hypothetical, which you will find in many dictionaries, only strengthens this conclusion.
Why isn't it in dictionaries yet? I'm not sure, but this process takes time. If you (and others) use it and keep using it, it just might make it into a dictionary some day.
Comment: In the quote you chose, "Hypotheticality" is used capitalised. If it's also defined earlier in the same work, then this indicates that it's being used as jargon. Jargon words are still words, and can still get into dictionaries, but as I understand it one of the things lexicographers look for is the use of a word *without requiring definition*, that is to say the expectation of the writer is that it will communicate something to the reader. This show it's not just a collection of letters being used to name a concept for brevity, for the duration of one work.
Comment: Furthermore, I'm not sure how to answer the question "is hypotheticality a word?" in the case where it turns out the term is always capitalised. It's either "yes", "no but there's a very similar word", or "yes but you misspelled it" ;-)
Comment: @SteveJessop Thanks, I edited my answer. I did wander whether the fact that 'Hypotheticality' is capitalised in my first example could be a counter argument, but to be honest, I was in a bit of a hurry, and didn't have time to go through other options. As for the definition - I guess it is a somewhat new technical term, so I'd expect  a lot of works which use it to include a definition. Maybe this was the case with the word 'ribosome' e.g., before the 60s. An aside: check Araucaria's answer; it has examples better than mine.
Answer: When talking about conditionals in linguistics and philosophy this word is very commonly used (A conditional is a special type of sentence, typically beginning with if). I see this word on a daily basis in my academic life, and use it too.
Here is a sample of 1,400 odd scholarly articles and books from Googlescholar which use the word hypotheticality.
Answer: Yes it is. It is a noun that describing the state of being hypothetical or something of a hypothetical nature.
Sources: Your Dictionary
Comment: @MagikCow https://en.wiktionary.org/wiki/hypotheticality is the actual source - the one you pointed out only calls on "English Wiktionary" as the source.
Comment: It's refreshing to see people who don't get defensive at the first well-intended remark, but actually make the effort to edit their post :-). I don't know if you had the chance to have a look at meta, but you might find this [list of resources](http://meta.ell.stackexchange.com/questions/735/resources-for-learning-english) useful for finding references in the future.
Answer: Yes, it is a noun.

Plural form: hypotheticalities
(uncountable) The state or property of being hypothetical.
(countable) Something of hypothetical nature.

Source: Wiktionary: hypotheticality
Comment: Well, simply copying the Wiktionary entry *when OP has already given the link in the question* doesn't make a good answer IMHO.
Comment: Well, when I read a question there wasn't a link to the Wiktionary or it's just my bad and I didn't see it.
Comment: The question wasn't edited (I can say this because SE keeps the history of every question and there is none), so you didn't read carefully.
Comment: @Stephie: note that edits made within five minutes of the original post are not recorded in the history.
Comment: @HarryJohnston I haven't edited the question at all and there is one hour gap between his answer and my question
Comment: @Terve: didn't say you had!
Answer: It is a new age word like "functionality, usability, drivability, drinkability, playability" and others. In my world it is newspeak, a made up word to eliminate the use of others. Functionality = describing the functions of an item and avoids the descriptions. Usablity = an item is usable. One can merely add "ability" to the end of any word and create a new one. Most people will adopt it as an actual word as it sounds new age and hip.
Here's an example..."That trail looks to be an easy walk, it has walkability for most anyone".
Comment: Welcome to the site. Perhaps people don't make up new words because they sound "hip" (and most certainly not because they are ["new age"](https://en.m.wikipedia.org/wiki/New_Age)), but because the english language is rather flexible and new words are coined to express things better or more concise that with a long sentence?

Is hypotheticality a word?


What is the standard editorial timeline for genre fiction novels?

Question: I'm signed with a publisher working on my first genre fiction novel. The editor is driving me crazy not getting her work done and putting the rewrites on me at the last minute up against the deadlines. Is this standard operating procedure in the industry, or should I contact the publisher with my concerns? Is there a normal timeline for how long I have to make the changes she suggests?
Comment: Feel free to contact the publisher, there is no shame in it. The "normal timeline" is probably defined in your contract. Have you read it?
Comment: Not to be cynical, but: Does the publisher get extra money out of the deal if you fail to meet a deadline?
Comment: That is an excellent question. No, he wanted us to be done with the editing by the end of the year so he could benefit from the tax write offs for production costs, so if anything he wanted it done more than I do. The problem seems clearly to lie with the editor, in my opinion. She is over-extended, and I don't mind that she can't get the work done faster except that it leaves me with the pressure to get the rewrites done in just a few days. I sent a request this morning for a timeline, at least, and she hasn't responded.
Answer: This all depends on the editor and publisher you are working with. Each team at any publishing house has their own time frame. The amount of time taken should be stated in your contract. An editor should not be taking so much time that you have only a couple of days to finish rewrites. That does not sound professional to me. Sends up a red flag. Did you read up on this company, or at least this editor before signing the contract? The publisher pushing to get your work done before the end of the year for tax write offs doesn't sound right either. A good place to check if someone is on the "writer beware" list is :http://www.sfwa.org/other-resources/for-authors/writer-beware/
A good resource to use for the least chance of finding an editor or publisher that will scam  you is http://www.writersmarket.com  You have to pay for a subscription, but it is well worth it.


How can I calculate the difference between investing cash in a mutual fund versus using it to install solar?

Question: I am a moderately experienced investor, but I have this one question that I have had a really hard time answering. What would be more profitable: invest in solar electricity, which I have calculated will lead to a net surplus of $60,000 in 15 years (savings on no electricity bill plus income on SRECs and annual utility credit), or invest the $20,000 in a mutual fund. On the surface, investing the $20k into a mutual fund at 8% would give me $63,433 in 15 years, but if I install the solar array I will be investing the roughly $2000 in income that I earn each year. I feel like there must be a simple way to calculate this but I can't wrap my head around it.
Comment: Do you know of any mutual funds that guarantee  8% per year for the next 15 years?
Comment: while no investment in a mutual fund is guaranteed, how solid are your estimates for the solar? Are you sure your electric bill will be zero? And that you will even make more electricity than you will use?
Comment: Fairly certain based on a neighbors system, comparison of install cost, etc. Obviously some room for variation, but even with an estimated return, I am hoping to be able to make calculations based on what I asked.
Comment: No guarantees. I used 8% as variable. What I am asking for is a way to calculate, and I could obviously then use different rates in that calculation.
Comment: @Craig Set up two spreadsheets.  In the first one, include all solar investment  variables (savings, credits,  income on SRECs, etc.).  In the second one, pick the mutual fund(s) that you'd be likely to invest inand include expected historical distributions based on previous years (deduct taxes on them, if any), etc.  Vary the expected yield on the MF and see at what MF yield the results are equal.
Comment: @Craig It's not very scientific but when I'm faced with a decision like this, I imagine myself "X" months/years down the road and think about how I would feel about my current decision if things did not go my way.  With that kind of pretend hindsight projection, I'd do the solar since I prefer a bird in the hand versus an assumption (or hope) that markets will appreciate 8% per year over the next 15 years.
Answer: tl;dr: Installing solar is the winner.
Here are the assumptions this calculation is based on:

Installing solar will cost $20K, and you have the cash to pay for it.
If you don't install solar, you could invest the $20K cash in a mutual fund and earn 8%.
Based on your statement that in 15 years you would have a net surplus of $60K, this means having solar will net you $4K per year compared to not having solar. Perhaps this comes from $2K/year in savings from not having an electric bill, and another $2K in income from power you provide to the grid. Either way, you can invest that $4K/year additional cash flow into a mutual fund and earn 8%.

Compare (using a calculator):

$20K at 8% for 15 years = $63,443
Starting with $0, and adding $4K per year at 8% for 15 years = $117,297

Solar clearly wins.
But is the additional $2K per year in income taxable? Even in a worse case scenario with a 50% effective tax rate, you'd still be able to invest $3K/year:

Starting with $0, and adding $3K per year at 8% for 15 years = $87,973

Solar still clearly wins.
Let's suppose you only invested $2K per year (simply because you mentioned that in your question):

Starting with $0, and adding $2K per year at 8% for 15 years = $58,649

This is about $5K less than the investing the $20K in a fund, however, none of the above calculations took into consideration that the value of your home should be increased due to having solar. Presumably the value would still be significant until the warranty runs out, which is typically at least 20 years, once again tipping the scales in favor of solar.
Comment: I would be investing $2000 per year since the additional savings I am calculating is on *not* paying an electric bill, but that savings will obviously free up funds that I can probably manage to invest, so both of your calculations are helpful. While you are correct that the pv (solar) system will add value to my home, I have heard from multiple agents and developers that it will not increase my asking price. This is hard to imagine, but somewhat irrelevant in this case I do not plan to sell in the next 20 years. Thanks for the help.


Adobe Illustrator Vector colors appearance, hex code, RGB and CMYK completely different when opened on another computer

Question: When I send my AI to my colleague, the colour appears to be different in her computer. And is not juz the appearance issue, the entire Hex code, RGB value and CMYK value were totally off. We both are using the same Adobe Illustrator CC.
Comment: Thats kindof the point of color management. But i betcha no one calibrated your monitors so you are getting meaningless color management.
Comment: No two devices will show the same colours, at least not without calibration. Colour calibration is a complex topic - probably best handled with a colour calibration device.
Answer: Are you both using the exact same monitor model with the exact same settings? The same video card, drivers and operating system?
Assuming you don't, that's likely the main reason for this.
Comment: As our computer are provided by our company, the model of all accessories are exactly the sam
Answer: Most Likely The hardware (monitors / laptops) are the main culprit. Always use the same screens to have an exact color reproduction.
If the HEX or RGB are off. Try to use in on a plain page and print them out separately once from your device and once from the other. and see if there is a difference in color.
MAKE SURE BOTH DEVICES HAVE THE SAME PRINTER PROFILES AND OUTPUT MODES.
Hope this helps.
Answer: It sounds like the numbers generating the colors have changed, not just the appearance of the colors.
Did your colleague change the color space of the document: from CMYK to RGB or vise versa?


How to convert GPA to German Grade?

Question: My GPA of bachelor is about 3.0, and I just want to know how much it would approximately be in German Grade? Would it be lower than 2.7 in German Grade?
I have read other questions on this website, but none of them could help me, can you simply tell me how to convert GPA to German grading system?
Comment: Have you looked at **Grade Conversion Charts** section of the [Academic grading in Germany](http://en.wikipedia.org/wiki/Academic_grading_in_Germany) Wiki page?
Comment: No. Don't even try.
Comment: Yes I read it completely but couldn't calculate my german grade
Answer: Without knowing the specifics of your system, no, it's not possible to tell you how to convert your grades (or anyone else's) from one system to another.
However, what you do need to know about the German system is that it works "backwards": a 1 is the best grade, and 5 is a failing grade. The "1,0" corresponds to an A or A+ in an American style 4.0-system, and then moves in increments of 0.3 or 0.4. 4.0 corresponds to a D, and anything below that would be regarded as an F.
Comment: yes i knew about the point which you mentioned. thanks anyway
Answer: A GPA of 3.0 is (usually) exactly a B, which is coincidentally 3.0 in German Grade. Note that this is an estimate. Also, the correct way to calculate it would be not to convert the GPA directly, but to go through the transcript and re-compute the average using the German Grade.
This is a tool I found after a second of googling:
http://www.foreigncredits.com/Resources/GPA-Calculator/
It has grade tables and even a calculator that can do the math for you.
Comment: This is actually wrong. the correspondance is more:
A -> 1.0 (best possible grade),
B -> 2.0,
C -> 3.0,
D -> 4.0 (barely passing grade),
F -> 5.0 (failed),

The linked tool converts a german 2 to a GPA of 4.0 which would correspond to straight As, which is clearly wrong
Comment: thanks for your information. I have also found that tool, but couldn't work with it, i guess i have to spend some more time with it

How to convert GPA to German Grade?


Dynamic Topology Very Slow

Question: I've been following this tutorial, and at about 22:45 he uses the grab brush to create the neck of our character.
At this point, using the grab brush brings Blender to an absolute crawl: it takes a second or two for the screen to redraw. Per the tutorial, I've been using dynamic topology; if I turn off dyntopo, speed returns to normal.
I understand that for a large enough mesh, dynamic topology will eventually slow down, but I thought this was at the millions of vertices point; my model only has 48K verts.
This is on a reasonably powerful computer (Xeon E5-2687W, dual 1080Ti video cards). It's running Linux (Ubuntu 18.04), and GPU acceleration for rendering works. This problem persists with Ubuntu's Blender packages, as well as the Thomas Schiex 2.79 and 2.80 packages.
How can I resolve this issue and get decent performance with dyntopo enabled?
I've made the file available here.
Update: I've been experimenting some more, and it seems that this is only a problem for the grab brush: the other brushes can all do dynamic topology without slowing down.
Update 2: actually, looking more closely, enabling dynamic topology for the grab brush doesn't seem to actually create any new topology. This screenshot shows the mesh after using the grab brush (with dyntopo enabled) to pull out the neck on my model:

Is the grab brush not supposed to create any new topology when dyntopo is enabled? Reading the manual, this might be what's going on. If that's the case, it seems like I can just disable dyntopo for the grab brush? How can I then create new topology on the parts of the mesh that I have moved with the grab brush?
Comment: for make extrusions in the sculpt dont use grab, use snake hook instead, and too add geometry (new topology) in that part use clay,clay strips, sculpt brush or other brush
Comment: While the snake hook changes geometry, it can also be much faster than grab, as shown in this model.
Answer: Do you have active modifiers on the object? Some modifiers will recalculate on every mesh change that occurs during dynamic sculpting.
Comment: Please only use the answer section for answers; ask for details in the comment section. Thanks!

Dynamic Topology Very Slow


How come that a certain language is more logical as compared to another language?

Question: Is it acceptable to say that a specific language is more logical than another language? To give an example, I always see the argument, that Latin (and also Japanese) is more logical than English.
Comment: Why don't you summarise that argument that you often see, or at least point to wherever it is discussed?
Comment: Is the argument supposed to be to the effect of "having a more regular grammar makes logical structure a more accurate description of natural language practice, so since Latin and Japanese are more formally structured, arguments made in those languages are clearer and/or more trustworthy"?
Comment: I think the word "logical" is overused. What do you mean - logical as opposed to emotional? or like consistent? simple? the vocabulary and the relation between the words?
Comment: The question needs to be clarified. By "logical," do you mean grammatically rule-abiding? Or, do you mean logical in terms of sentence analysis? Is this a question of syntax, semantics, both, or neither?
Comment: I think the use of the language is always usefull in their own country. Like Eskimo's: They have 50 words for snow, what has great use for them and is very logical to them. But in our language it wouldn't be useful and not logic at all. So in my opinion it depends on where you from to see how logic and usefull a language is.
Answer: The reason you see this argument is because Latin has a complete case-structure, like many primitive languages, while English has no case structure. The case structure is appealing to people (this is the reason that it is introduced in the first place), since it allows sentences to match part of speech to a noun directly, not with little inconvenient word-attached tags. This case structure sounds superficially more "logical" than uncased languages like modern English, modern French, etc.
To approximate the effect, I will use the one remaining vestigial case in English--- the postmodifier "X-ward" to mean "to X". So you say

I walk seaward.

to mean

I walk to the sea.

It's a little archaic, but it's still obvious. Latin is chock-full of these cases, for all the prepositions you can imagine: "in X", "for X", "with X", etc, these all have little modifiers on the words to indicate that this is what X is doing in the sentence.
This is typical not just of Latin, but of most ancient or pre-written languages. The structure of these ancient languages then looks more complex then the structure of modern languages, leading to the degeneration paradox of linguistics: why are ancient languages more morphologically complex than modern ones?
In this linguistics stackexchange answer , I gave an answer to this question, one which I strongly believe, but which is not found in the literature as far as I know. It is mostly derived from my personal experience with Hebrew (which is formerly ancient, recently revived, and shed it's last two remaining cases, the locative and possessive, not too long ago to remember how it happened). The hypothesis I'm pushing is supported also by comparison of ancient epic poems (Gilgamesh vs. Odyssey), and from the example of Piraha, which is both non-recursive and insanely heavily cased.
Since Everett's work of 2005, it has become eminently clear that linguistic recursion is a much more recent invention than what was commonly supposed since at least 1957, and perhaps as far back as the renaissance. The Chomskian idea that all languages have a recursive grammar is dead wrong, Piraha lacks recursive grammar, full blown center recursion is absent from ancient Sanskrit, ancient Chinese (and a lot of modern Chinese), Australian languages like Warlpiri, ancient Hebrew, ancient Germanic languages, relatively recent Slavic languages (like midieval Polish), and more generally, any ancient language except ancient Greek and Latin, and some later Sanskrit, past Panini's time, which is approximately the 6th century BC. There are sporadic recursions in other ancient languages too, but the general rule is valid.
It seems that either the Greek or Sanskrit speakers invented recursion, and it spread horizontally from there, infecting language after language with recursion, until practically the entire old world was recursing. The recursion didn't touch Australia and America, although some native American languages had limited forms of recursion still, likely independently constructed.
Once you have recursion, complex case systems become unnatural, because in a recursive sentence, the noun objects can be very complicated to case. For example

I walked ( to that rickety hard to maintain drug-den of a house which my father bought from the clan of fox-eating cave-people which settled on the shores of New Jersey in 1833).

Becomes, in some cased languages:

I walked (that rickety hard to maintain drug-den of a houseward which my father bought from the clan of fox-eating cave people ...)

It's hard when the thing is embedded deep, and it requires a scan to move the noun-phrase to another position:

That rickety hard to maintain drug-den of a house which my father bought from the clan of fox-eating cave-people which settled on the shores of New Jersey in 1833 is smelly.

That was easy. For the case example, I have to scan to find the "ward", and remove it. This is hard. So to accomodate easy recursion, languages replace cases with stand alone function words. You can date this to the time the language first becomes fully recursive among nearly all speakers, which usually coincides with the date of first universal literacy.
This is something I experienced personally with two case shedding events in modern Hebrew. The first concerns the locative ("to") case:

Hu halach hahara.

In Hebrew means "He walked mountain-ward". It is never said this way in modern Hebrew, which replaces it with

He halach lahar.

The "la" is attached to har, but that only means you can't insert adjectives before it, which you wouldn't do anyway because Hebrew puts adjectives after the noun.
The other case example, which is still in progress, is

Shmi Ron.

This means "name-o-mine is Ron". This is not how people say it anymore (although it is still prescriptively encouraged, and bedevils Hebrew instruction). What you say is

Hashem sheli Ron

"The name of me is Ron". I know that this transformation is easier to recurse with, since you often say:

Hashem shel ha-ach hakatan sheli she nolad be-74 ze Gaby.

"The name of the brother the-little of-mine who was born in 74 it's Gaby" (my younger brother's name is Gaby). This easy recursion is obviously the reason the longer construction "hashem sheli" is preferred over "shmi", it is clear to any speaker that this is the driver of the case-shedding, and I inducted the principle from this experience.
Anyway, that's why Latin sounds more sophisticated. It has recursion, but it's tacked on and confined to upper class folks, it hasn't yet spread around to everyone, and once it does, it turns into uncased French, Italian, and Spanish.
Comment: *The reason you see this argument is because Latin has a complete case-structure, like many primitive languages, while English has no case structure.* Many modern languages do have case structure (notably Slav languages, German, Greek - in the same family as English), but also Uralic languages (like Finnish and Hungarian) and agglutinative languages (like Turkic languages.) So English and Romance languages are rather and exception than the rule.
Answer: It strongly depends what you mean by 'logical', but from philosophical point of view the most important is the ability to express logical topics, to speak logical etc.
The modern linguistic has refused the theory, that some languages are 'primitive' and it is not impossible to express some ideas in them. I've found this statement in very many scientific books about Africa, where in introduction about the African languages, there was a statement, that linguistics haven't found any example of modern human language, in which some ideas couldn't be expressed. Of course, languages have various vocabulary and isolated languages spoken by a few people tends to have limited vocabulary, but even among English speakers, most of them have limited vocabulary as single people, only the language as the whole has so wide vocabulary.
But note how little words in English are native English words. Most of them are from Latin, Greek and Latin languages. The same process can be applied to any other of human languages. So, if the whole philosophical library can be translated into any language, none of them can be considered less applicable for discussing logic issues as well. Therefore, no language is more logical than the other.
Answer: It's impossible to answer conclusively unless you explain what you mean by "logical".  But if you mean that various rules for the language (grammar, spelling, etc.) are more compactly stated and admit fewer exceptions, you can certainly rank languages this way, and some are indeed more logical than others (with English not doing so terribly well especially in the spelling department, especially with the most common words; but languages with gender taking a big hit because of the semi-arbitrary assignment of gender to objects that have none).
Anyway, its largely an artifact of history.  English is an amalgam of Latin, Germanic, and Celtic roots, primarily.  It's really a wonder that it manages to work together as well as it does, and the efforts of dictionary-makers and others to regularize it had only modest success.  See The Story of English (link to Wikipedia, but you need the book and/or miniseries).  In contrast, Spanish was more forcibly regularized by King Alfonso X and Queen Isabella among others (see the seminal work on Spanish (Castillian) grammar); Japanese spellings were regularized by cabinet order.


Is it appropriate for a student to have an advisor who is also a family member?

Question: We know that family can have a lot of impact on academic direction of a student, but is it appropriate for a student to have a supervisor/advisor who is also a family member? For example, a dad might supervise their son. What would make this more or less appropriate? What conditions might be required to make this appropriate?
Comment: Sure, I know examples. What is the question?
Comment: conflict of interest?
Comment: There is a case of an electrical engineering professor who was at University of Washington (he is now a "Professor in Residence" at UC Berkeley) who co-authored several papers with a younger student of his with the same last name. Their last name is not very common, and I've always assumed they were related (father/daughter), but I do not know for sure.
Comment: I'd think there would be plenty of ways to go around such issues, e.g. get another member of staff as supervisor.
Comment: I've edited the question to focus on the implicit question. I.e., when and whether it is appropriate. The question of whether there has ever been a case of familial supervision is not especially relevant as the obvious answer is yes, there has been a case.
Comment: parents tend to be proud of their children...Maybe opinions about the quality of the work are biased
Comment: Surprised no one has mentioned the [Bernoulli Family](https://en.wikipedia.org/wiki/Bernoulli_family).  Particularly, Nicolaus I studied under Jacob Bernoulli.  Of course, this is purely historical and probably has little bearing on this question, but it is interesting and (semi) on-topic.
Answer: I'm sure that such cases might happen (and frequently do for earlier education, like elementary school), but they should not happen at the graduate student level.
All of the usual concerns of nepotism and coercion apply, just as for any other professional relationship.  Moreover, at the graduate level, there are so many different options available and an emphasis placed on intellectual "cross-fertilization" that means most institutions strongly prefer to send their students elsewhere for future positions.  I cannot then see how a graduate student supervised by their own parent would be anything but a rather dubious relationship at multiple levels.
Comment: I was specifically told I would not be allowed to attend my father's class as a grad student at the Master's program I went to. I'm sure there's less of a conflict with advising, but still, the thought of a dadvisor bending the rules a bit more is a bit concerning, so I wouldn't recommend it.
Comment: @compass +1 for "dadvisor". That's great.
Comment: I'm pretty sure I know a father who had his son as a master's student. The son went elsewhere for his PhD.
Answer: Counterexamples notwithstanding, the practice certainly raises all sorts of questions about conflicts of interest: is the adviser providing unbiased advice, is the adviser unbiased in their assessment of the academic proficiency of the candidate, is the advisee independent to choose their research direction, etc.
In cases like this, nobody looks good -- people wonder about the judgment of the adviser, they wonder about the actual quality of the candidate if papers are jointly written, and they wonder about what's going on in the department to let such things happen. As a consequence, people and departments are generally well advised not to let this happen, simply because the perception of a conflict of interest is oftentimes just as bad as the actuality of something improper happening.
Comment: +1 for the important point none of the rest of us made about perception being as bad as reality.
Comment: My current funding agency has explicit rules against this kind of stuff..
Answer: Yes, I happen to know a researcher in country A supervising his own wife's PhD :)
They are both from country B, and come from the same city. He was her lecturer during her undergraduate in that city. He then moved to country A, and they had been dating before she started her PhD in his institution.
After they had got married, she changed to another supervisor. During her PhD, she published 8 papers: her husband was the first author in 7 of them, and the second author in the 8th (in which she was the first author). The new supervisor only co-authored 3 papers. So I guess, he continued to mentor her even after she had changed supervisor.
She graduated last year, and seems to have a good job in industry, according to her Linkedin profile. He is now director of research in his institution, having published more than 100 papers. Their baby is also nearly one year old now.
A is one of the most developed countries in Europe. B is also in Europe, but not in the level of A.
Comment: Why did you mask the countries with *A* and *B*? It's possible that this is completely cultural, and knowing those countries would be of value to your answer. You didn't mention any last names, so I don't think there's any need to mask the countries.
Comment: @ChrisCirefice I don't think this is cultural, I don't know any other similar cases. I listed two separated countries to let you know that they are from the same hometown, and have known each other for a very long time. If I reveal the countries, people may guess his name. I don't think there are many researchers from country B who are working at A, and have published more than 100 papers.
Comment: Yes, I know one which did not even change the supervisor after the marriage.
Answer: Fact just for fun:
Actually, this question reminds me the story of the Curie family.
Irène Joliot-Curie, a Nobel laureate, supervised both of her children, who are also notable scientists.
Irène herself was supervised by Paul Langevin, grandfather-in-law of her daughter, former lover of her mother, and former Phd student of her father. What a complicated relationship.
Comment: Those were times! ;-)
Answer: I can see why some might raise an eyebrow at this arrangement – from both perspectives. Other students might wonder if the thesis student is getting preferential treatment. Other faculty might wonder if the advisor is applying the same standards of rigor.
I think this might be avoided if the parent (or other relative) offered to serve on the committee, but not take on the role of primary advisor. If my daughter was in graduate school and asked me to be her advisor, that's probably what I would recommend: "I'll be on your committee, but you'll have to find someone else to be your main advisor."
That said, people are citing counterexamples; evidently, the practice is not universally verboten. So long as the research is quality reseach that withstands any scrutiny, I suppose it can be made to work. However, if the student is coasting along with research of marginal quality, this has potential to backfire.
Back to the hypothetical between me and my daughter: if I were to agree to such an arrangement, I'd want to be very sure she could do some outstanding research independently, to ward off any conflict-of-interest allegations.
Answer: If someone's dad is the best in the field they like, and they were accepted by the department to the graduate program, what's the problem?
Could it lead to abuse? Sure. But why shouldn't this person be with the best? Matter of fact, this person probably knows more about the field than any other student, having being brought up in a certain environment.
Just to amuse readers: There's a book in optics written by: "Pedrotti, Pedrotti, and Pedrotti".
Comment: @PeteL.Clark. There's a good reason not to marry your mother: it is abomination to nature. We're biologically wired to be naturally repelled by it, as the offspring are not viable. That's not to say that some folks with Freudian problems haven't done it, but rather that it is abhorrent.

In the case of a *good, hard working* student, working with someone who's the best will result in good papers. That's not to say it's the normal outcome, but that it's unfair to the exceptionals to be limited by fear of nepotism. I call for safeguards instead.
Comment: I get the sentiment, but the world we live in is far from being a perfect world. I know a graduate student who published several engineering physics papers with his father, but it's hard to take the graduate student's role seriously on any of the papers since it's not at all clear that he actually did any sizeable amount of work on the project. For all anyone knows, he got his name on the paper simply out of nepotism. Later on in life, collaboration is perfectly acceptable, but a student-advisor relationship should be strictly professional.
Comment: Perhaps making a (much) more extreme statement will help to identify the flaws: "Why shouldn't you marry your mother if she is the most attractive woman in the world?"


Isolate the non blurred part of foucsed image

Question: I have an image taken by a mobile phone camera with focus on a part of it let say a face or whatever.
I want to know -approximately-  where is the focused area. For example, a bounding box around the focused area.
example :
Answer: In general, this is an image segmentation problem (http://en.wikipedia.org/wiki/Image_segmentation) into which you would be trying to isolate the focused to the non-focused regions of the image.
Optical lenses are equivalent to low pass filters anyway and the effect of a low pass filter on a signal is to smooth it out by limiting the higher frequency content.
In digital image processing, low frequencies correspond to big objects (general form) and higher frequencies correspond to small objects (details).
Therefore, to isolate the focused region, you could be looking for areas that are at a higher standard deviation relative to the blurred areas which would be at a lower standard deviation because of the smoothing operation of the out-of-focus lens.
To distinguish 'blurred' vs 'non-blurred' regions  you can setup a "window" of dimensions $M \times N$ and slide it over your image.
At each position of the window compute the variance of the "patch" values as if they were a one-dimensional vector of $M \times N$ values. This will result in another "image" (or more generally a two-dimensional array) depicting the variation of the standard deviation at each location on your image. You can then collect all of these values and obtain their histogram. The histogram will exhibit a multimodal distribution (For more information please see http://en.wikipedia.org/wiki/Multimodal_distribution ).
In the case of the image in your post, the histogram is likely to exhibit two modes. One corresponding to relatively high values of standard deviation (focused area) and one corresponding to relatively low values of standard deviation (blurred areas).
You can then position a threshold, for example just between the two modes to establish a criterion between your focused and unfocused regions and then select all "patches" (or MxN window areas) whose standard deviation is higher than your threshold. (For more information please see: http://en.wikipedia.org/wiki/Thresholding_%28image_processing%29)
This will isolate the focused parts of the image for you.
Hope this helps.
Comment: I am going to make a deep reading for your answer and come back with a feed back, Many thanks
Comment: Thank you very much, great and detailed answer, I am going to share the implementation if I got good results using opencv, thanks again
Comment: By the way do thing a gray representative of the image is sufficient or I need o process each channel ?
Comment: Glad you found it helpful. Working in grayscale would work just fine for the discrimination between blurred and focused areas but including additional colour information could help you to prescribe more complex areas (for example, track the area of a face in a portrait or isolate just the flower in the picture in your post).
Comment: The question was edited back to its original form following the discussion at: http://meta.dsp.stackexchange.com/questions/1337/when-is-an-edit-a-separate-response @vast-academician Please add your comments as a separate response. The main part has been preserved at: http://pastebin.com/kjCC1wM6
Answer: Here is an easier approach, that does not involve sliding-window analysis.

Convert your image to grayscale (this is not required, but I will assume that you only have one channel for the sake of clarity)
Calculate the gradient in both directions
Calculate the magnitude (or just square the gradient)
Sum both gradient images in both directions

As was already said, the focussed part of the image will have higher frequencies than the non-focussed area. From the summation you will end up with two projections, where there is a lot of variation (higher values) in that part where the focussed object is placed along this direction. You can do now the following:

Determine the start and end point of these higher values. You could use a simple threshold (e.g. 0.7*maximum_value) or smooth the profiles, take the second derivative and check for the highest values in there.
The Start/Stop positions from the previous step give you the pixel positions along both directions where to place your area-of-sharpnes-indicating rectangle.


Is there a way to get an overview of ancestry.com member trees?

Question: I recently started on ancestry.com building my family history, starting from nothing to over 150 people in about a month. I see a number of member tree "hints" of interest but is there any way to tell how much data (people, etc.) another person has amassed without a paid account? I'm assuming I'll pay eventually but wanted to wait until I had built up my data. On the other hand, if there is a lot of data available, I'll pull the trigger sooner.  I don't want to start paying to get access to some record just to find out it was a short-lived effort with nothing significant in it.  Secondly, what is accessible in these public member trees?  Everything they have posted?  Thank you.
Comment: @AndyHatchett: "other peoples' trees" on ancestry.com are indeed neither evidence nor documentation, and indeed a great many of them are pure junk, but in my experience they are helpful in pointing you towards names and dates which you can then investigate properly.
Comment: This isn't an answer, just a very strong caution **not**  to take everything in member trees on Ancestry at face value; there is a lot of rubbish out there, and you will be storing up misery for yourself if you don't check everything you find with original sources and make up your own mind.
Also, you might find a trial subscription to Ancestry helpful in answering your own question.
Comment: If you are planning on doing genealogical research then online family trees is the very LAST place you should be looking. You should be starting with yourself and documenting each generation back from you with evidence. Online family trees are neither evidence nor documentation; in truth, a great many of them are pure  junk.
Comment: I couldn't stand the suspense any longer and signed up for the free trial. The member trees ended up not being as useful as I had hoped but still gave me so info I didn't have. Thanks for all your comments.
Answer: [1] Tree sizes (without an active subscription)

if you have a tree owner's user name, you can access their profile page*. Often, the names and people counts of their public trees are listed. The profile may include other personal information or uploaded items that may help you access their interest in your family line.

*Profile pages can be found by searching the Member Directory, found under the "Collaborate" tab. User names are entered in "Basic Information", or use surnames and/or locations in "Research Interests".

searching Family Trees will give a list of tree names that contain matches; unfortunately only the private tree matches will link to the tree owner's name and tree size (with or without a subscription). Public tree matches either let you in (subscribed) or link to the subscription page (not subscribed)

[2] Accessibility in public trees (with an active subscription)

information on living people is hidden (i.e. names, birth and death dates/locations, timeline entries, attached sources). Relationships ARE shown in the family column and in the charts. Further access needs an invitation from the tree owner. Sometimes names can be identified if you are coming to the tree from an attached document image.
information on persons with death dates (or badly formatted dates or with missing birthdates) is visible to all subscribed or invited visitors - names, dates, timeline entries, attached documents and pictures, sources, charts, links to related persons. HomePersons and lists of all persons (exc the privatized) are accessible.
tree owner name links to their profile page*, see above, which may also show other trees they own

[3] Assessing potential tree hints

When I visit a tree, I try to determine the relationship of the tree owner to the person I am searching: do they have more intimate knowledge of the family, are they in direct line, etc. Are there attached document sources, are there careless mistakes, are they missing or mis-interpreting obvious clues? I check the owner's profile page: what are their interests, how active are they? These will give a feel for the reliability of that portion of the tree. Sometimes a beginner just needs a little help, sometimes it's clear that it's hopelessly wrong, sometimes I find the clue I need to proceed in my research. I might leave a comment or contact the tree owner, depending on my assessment and their indicated interests.
Comment: +1 " ... try to determine the relationship of the tree owner to the person I am searching: do they have more intimate knowledge of the family, are they in direct line, etc." P.S. The larger the tree, the more difficult it can be to learn that relationship.
Comment: When I can't determine the exact relationship or even the connecting surname (sometimes through spouses), I put a LOT more weight on sourcing and diligence.


"Install Spotify" can't be opened because Apple cannot check it for malicious software

Question: I'm running macOS 10.15 Catalina Beta.
When I try to install Spotify I see the following error:

Is this a Spotify issue or a Catalina issue?
Thanks.
Answer: Catalina requires all apps that are signed with developer IDs to be 'notarized' by Apple.
In the absence of an updated version from the developer, you can try the following:

Right-click and select "Open". This may bring up the same dialog, but with an option to Open the file anyway.
You can get round this by removing the quarantine Extended Attribute on the file:
xattr -d com.apple.quarantine /path/to/file

Naturally, this bypasses Apple's security precautions which exist to stop maliciously altered software from running.
Comment: This is fantastic! I had an issue with a component launched as a daemon by Adobe Creative Cloud, and so the 'right-click and select open' solution did not work. Changing the Extended Attribute worked miracles! Many thanks! (I keep forgetting that Extended Attributes _exist_ — but even if I remember that, I hardly recall the attribute names...)
Comment: I'm not convinced this is always an application's issue. I'm having the same problem with 1 user on a DMG that is signed and notarized correctly - as far as i can see.
Comment: xattr: : No such xattr: com.apple.quarantine. Please check again.
Answer:
for older version of macOS

System Preferences -> Security & Privacy -> check Allow Anywhere

for macOS Sierra, High Sierra, Mojave

$ sudo spctl --master-disable

But if the Move To Trash issue still exists. This is because Apple has removed TNT certification. You may use codesign to resign it:
$ codesign --sign - --force --deep <app-path>

for macOS Catalina

I think codesign sometimes doesn't work for the notarization issue recently, so you should use xattr to remove the quarantine:
$ xattr -d com.apple.quarantine <app-path>

I have got a conclusion. When installing app from 3rd party on different macOS, you can try different ways when it comes up to Move to Trash issue. Meanwhile, I think this is a common issue for 3rd party apps, so you may change the title question to something that contains Cannot be opened or Move to trash as well.
Comment: The fix - System Preferences -> Security & Privacy -> check Allow Anywhere
worked for me.
Answer: This is a notarization issue with Spotify on Catalina. Although you can right-click to open, you should be extremely cautious with that! That bypasses the mechanisms macOS is using to try to protect you from malware.
If you use this method to open something that you know, with 100% certainty, is actually from Spotify, that is a temporary workaround. But the failing here is that Spotify didn't get their software notarized despite knowing since at least June that it would be a requirement for Catalina. Please let Spotify know that you are dissatisfied with this level of carelessness, and do the same with any other vendor whose Mac software is not yet notarized.
Answer: I was facing the same issue while I was trying to install .Net Core 2.2 SDK.

dotnet-sdk-2.2.207-osx-x64 (1).pkg" can't be opened because Apple
  cannot check it for malicious software.

And as mentioned in this forum entry all I had to do was to press the CTRL key while the installation was going on. I am not a Mac fan and that was the first time I was using the same, so I am not sure what happened when I was pressing CTRL key. Sharing this info for people who needs a quick resolution to this problem.
Answer: You can fix this problem by right-clicking on that .dmg or .pak file and choose open.
Here is the video to fix that type problem:
https://youtu.be/6Cjpo3uKHLw
Answer: After unzipping the mac sqldeveloper.zip file, you will find the SQLDeveloper.app file.
Copy the SQLDeveloper.app to Applications folder. Later execute the below command in terminal.
xattr -d com.apple.quarantine /Applications/SQLDeveloper.app

Comment: Is there an echo in here?


Say I own some shares in a company and their stock rises and I want to buy more shares does my older price change to the new one?

Question: Say I own some shares in a company and their stock rises and I want to buy more shares does my older price change to the new one? And if I sell just the amount I bought the 2nd time what happens? I would love it if you could explain it with an example. Thanks in advance
Comment: I'm not sure what you mean... are you asking if you'd have to pay more money for your old shares if you wanted to buy more?
Comment: What do you mean "your price"?
Comment: "If I buy a TV and then the price goes up and I want to buy another TV does my older price change to the new one? And if I sell just the second TV what happens?"
Comment: @Brosky There's two relevant prices for shares you own, the cost basis and the current value. Which do you mean when you say the "older price"? (Current value is unaffected by buying, it's just whatever the market says. Cost basis for tax purposes could be affected depending on where you are. For example, Canada uses average cost as cost basis when selling stocks so you could say buying new shares "changes" the cost basis for older shares - it doesn't really, but it kinda looks like it does from a tax perspective.)
Comment: @user253751 I meant the price of shares I already owned
Answer:
I would love it if you could explain it with an example.

Say you go to the store and buy 10 apples for $1 each. You then go to the store the next day and the price has risen to $2. How much would you expect to pay for 10 more apples?
Obviously you'd pay $2 each. What you paid for apples yesterday is irrelevant.
Now suppose you buy the 10 extra apples, and and want to sell 10 for $2 (we're ignoring bid/ask spreads in this example). So you sell 10 apples for $2 each. You have 10 apples that you spent a net $10 for (the $30 you spent less the $20 you got for selling the 10). It doesn't really matter (at this point) which 10 apples you sold, except possibly for tax purposes, which I don't think you're asking about.
Answer: Just because you buy shares does not "lock in" the price. The shares are worth whatever the market currently values them at. A stock "rising in price" intrinsically means that it now costs more to purchase, unless I'm misunderstanding your question...
Say you buy two shares at $100 each. Your position is currently worth $200. The stock price then rises to $120. You now own two shares, priced at $120 each, for a total of $240. If you buy one more share at this new price, you own three shares, each worth $120, for a total of $360. Note that in this example your position is worth $360, but you only paid <code>$100 x 2 + $120 = $320</code>.
Answer: Keeping it simple, buying stock (shares) is a risk. The value of the stock you are holding will most likely change after buying them. If you want to buy more shares at a later date and the price has changed, either up or down, you buy at that new price, no matter what the 'original' price was. So if you sell the same number of shares and the value has gone down you receive less than what you paid originally (you have lost some money). Conversely, if the value has gone up you receive more than what you originally paid (you have made some money).
Comment: Let's say I own 100 shares and buy 100 more at different prices. So I have 200 and if now decided that I want to sell just 100 shares which shares will be sold(the latest I bought..?)?
Comment: You will need to pick a methodology and be consistent about it for tax purposes. Either First in First out (FIFO) or (LIFO).  Aside from taxes and accounting rules it is irrelevant, a stock is a stock.


Thinking of buying a guitar that has a 'crack' where the neck meets the body.

Question: Obviously you're not viewing this in person but is this a deal killer? It looks pretty minor to me but I don't know. It's an 80's 12 string going for $200. I actually have the same era though slightly different model guitar and and I love it so much I want another. Tks!
Comment: It would be nice if you could edit the photo to circle the crack.  Are you referring to the slight gap in the outer band of the guitar's sides, at the end of  the decorative strip, a little bit off to the right of the centerline?
Comment: Impossible to find a 'crack' from this pic.
Comment: I think I see a light-coloured "crack" in the binding at the left hand side of that neck arch. (Especially when following the link so I can view it bigger.) It's not a large crack, but it also looks like the rear of the neck join is a little "uneven" as if some filler material has been introduced in that area. It's probably ok, but I would **definitely, totally, 100%** want to play it in person first!
Answer: We have no idea what guitar you have other than what kind of guitar you have (80's 12-string acoustic). So valuing whether $200 is a good deal is a bit harder to do. Traditionally, a Gibson is much more valuable, then say a Samick, even if they are identically constructed.
When I looked at the blown up picture, I did see where the binding met (off center) at the back of the guitar. That is not actually a crack at all, and just a detail error in the manufacturing (as you can see, it seems to be filled with something a bit darker than the white binding):

If you're speaking about the finish variation between the strap-button area of the neck and the body that's also pretty common. Too much movement (that one would be worried about) would cause a physical separation between the body and neck here, not just some weird checking of the finish. Keep in mind a 12-string guitar is under about 2x as much string tension.
Seems like a stable guitar, and worth whatever you think it's worth, until we can get an average used value for what this guitar is (Who makes it, what model, what year, etc).
Answer: I'm not seeing a crack in the photo attached. However the price and age of the instrument, combined with the fact that it is a 12 string, would make me wary of entering any deal, crack or not. 12 strings carry a lot of tension in the strings, so watch out for the top warping around the bridge. This could be rectified by shaving down the saddle to compensate for any increase in string action over time, but a neck reset (the ultimate solution) is an expensive fix for a cheap guitar. The crack may well be simply in the finish, or indicative of structural issues that would cost more to fix than the value of the instrument.
While you might own and enjoy similar guitar, but you don't yet own this guitar. Evaluate it for what it is; a cheap, ~30 year old 12 string guitar.
Answer: I kind of agree with answer #3 It really depend on who made it as far as if its a good deal I dont see the crack at the heel but there would be more pressure there from a 12 string. any crack can be repaired  if done correctly as to weather its a crack in the finish or wood does make a differance you circle shows the binding not touching but I dont see the crack I would say make sure the guitar is worth more than the asking price any repair by a luthier will cost a minimum 100..00


How to get (from terminal) total number of threads (per process and total for all processes)

Question: I tried googling it, but I can't find it. I am looking for:

number of threads in process X
total number of threads running currently
Comment: http://stackoverflow.com/questions/268680/how-can-i-monitor-the-active-thread-count-of-a-process-jvm-on-linux
Answer: To get the number of threads for a given pid:
ps -o nlwp <pid>

To the get the sum of all threads running in the system:
ps -eo nlwp | tail -n +2 | awk '{ num_threads += $1 } END { print num_threads }'

Comment: @Siddharth NLWP stands for Number of LightWeight Processes which is the number of threads.
Comment: `ps -o nlwp ` returns NLWP :), what does that mean ?
Comment: For total threads, this is simpler and give the same result `ps -eLf | wc -l`
Comment: You can suppress the "NLWP" with "h" (hide headers); ie: `ps h -o nlwp $pid`
Answer: For finding the number of threads running a single process you can look at /proc/<pid>/status. It should list the number of threads as one of the fields.
Answer: I'm basing this answer around ps axms. ps is a great tool for listing what's running.
If you want to filter that by a process, you could try something like this:
echo $(( `ps axms | grep firefox | wc -l`  - 1))

We subtract 1 because grep will show in that list.
For all threads in general this should work:
echo $(( `ps axms | wc -l`  - 1))

We subtract one this time because there is a header row.
Comment: This is inaccurate, as it reports an extra thread per process
Answer: On linux specifically, here is one way to do it per-process:
#!/bin/sh
while read name val; do
    if [ "$name" = Threads: ]; then
        printf %s\\n "$val"
        break
    fi
done < /proc/"$1"/status

You may then invoke this script with a PID as an argument, and it will report the number of threads owned by that process.
To get the thread count for the whole system, this suffices:
#!/bin/sh
count() {
    printf %s\\n "$#"
}
count /proc/[0-9]*/task/[0-9]*

These approaches may seem a little unorthodox in that they rely heavily on shell features, but in return both of them are faster than the corresponding ps and awk-based approaches on my machine (while also not creating extra threads of their own for pipes). Bear in mind that the shell launched to run these scripts will have a thread of its own (or more, if you are using a strange implementation).
Answer: To get the total number of the threads(tiny pieces of a process running simultaneously) of a you can use the command ps -o nlwp <pid> It works all the time.
But if you prefer to try to see it through a file. you should probably look at the files that were created for each and every process of the system. There you can get the ultimate details of the process. For each and every process, there is a folder created in /proc/<pid> there you can see all the other details also.
Answer: In my case it was useful to count just the total number of running threads for which top in -H mode works very nicely. The full command runs top in batch mode (-b) a single time (-n 1) and strips the top 8 lines. Then counts the rest.
top -bH -n 1 | tail -n +8 | wc -l


Cognitive biases ontogenesis

Question: Are cognitive biases "hardcoded" into our brain or learned?
And have they evolved over time e.g. more cognitive biases could emerge evolutionally?
Comment: Possible duplicate of https://psychology.stackexchange.com/q/8584/7001
Answer: Either, depending on the bias.
For example, the Müller-Lyer illusion could well have some significant learned aspects (how much is debated). Categorical perception of phonemes is a kind of bias, I guess, that's definitely mostly learning. At the other end of the spectrum supposedly 'irrational' context effects in decision making have been observed in slime molds, those are probably universal (so they're probably also adaptive).
In general it's probably not very useful to split cognition into 'biases' and 'the rest'. Maybe think of cognition as a memory system (with some flaws and a salience-not-probability weighting scheme) a reasoning/decision system (with limited resources and high time pressures) a perceptual system (facing a fundamentally underspecified problem) etc etc... the 'biases' are not really distinct processes. From that framing the question is hard to answer. If you singled out a particular bias, probably someone here could tell an evo story about how it came to be though! Maybe even a plausible one.
Comment: Related to your answer, I'd suggest learning about [heuristics](https://en.wikipedia.org/wiki/Heuristic) is important to understanding the adaptive nature of things we also think of as biases - this is the umbrella term for a lot of what your answer describes.

Cognitive biases ontogenesis


Why is my 9 month old not sleeping through the night?

Question: My son would sleep 10 to 12 hrs every night from the time he was about 3 months old. All the sudden he's waking almost every hour. It's worse than when he was an infant. Also would like to know if night feedings to get him back to sleep will cause weight gain as he is in top percentile for weight and height.
Comment: It may be teething. But I agree with swbarnes that you should teach him to fall asleep on his own, without feedings. 1 or 2 feedings at night is ok at that age, especially a busy tot who is distracted while eating during the day.
Comment: Whatever you expect from your child regarding sleep, eating, pooping, laughing, crying - "you get he point" - will be wrong.  BTW, teething has no real effect on children, there's no pain; that's an old myth.   If you're breast feeding, feed as much as possible, their own body knows their own needs better than us.  Weight gain is better than any other factor when breastfeeding.  For sleeping you can try cuddling instead of feeding or the reverse.  107.2% of children are different.
Answer: First of all, lots of babies change their sleep habits at about 4 months.  It's sometimes called a sleep "regression" but it's more a permanent chance in how the baby's brain is wired.  So you can't expect sleep habits at 3 months to carry on past that.
A 9 month old is capable of eating enough during the day to not need to feed at night, so first order of business is to taper off the night feedings.
Once that's out of the way, your kid needs to learn how to soothe themselves back to sleep.  And then need you to give them the opportunity to learn that.
Answer: As your child grows, it will also get more energy and sleep requirement may become a bit less. It's then important to make sure the child gets enough play time that is physically challenging enough for the child. If the child lacks the necessary exercise time appropriate for him, then the child may not sleep well during the night.
Answer: We have two sons, 4 and 1.5, and they both went through a similar pattern at some point.  We were excited when at 3, 4, 5 months old we had "good sleepers" compared to some of our friends' kids, but then each went through (multiple) different periods of regression at some point.  Now they both generally sleep 11-12 hours every night, but you never know when you're going to have "one of those weeks".
My advice is:

Try to take the long view.  Meaning that things will probably change, and change again in the near future, so don't worry too much about what's causing the behavior today, or this week.  Instead, try to work towards setting good nighttime patterns that will pay off in the future.  Whenever we "intervened" in our boys' nighttimes, we always kept lights as dark as possible, used very quiet voices, kept them in their own rooms/beds, etc.
Experiment with different levels of intervention.  In other words, when your son cries, don't necessarily go immediately to him and pick him up.  Try shushing from outside his door, or humming a little tune, or just patting/rubbing his belly.  Whatever intervention you make will be what he learns to expect, so the more you have to do to get him back down the more he'll get used to that.  In my experience, it's much nicer to just have to give a few pats for a minute than it is to have to pick up/rock/walk around.  (We actually had a period of time where we could shush one of our boys from our bedroom down the hall without even getting out of our bed.  At that point, I think he just needed to know we were out there somewhere, and a quick shush was enough verification for him.)  You never know what's going to work, so try some stuff out, and maybe you'll hit on his This-Is-The-Thing-I-Need-As-A-9-Month-Old-At-Night.  But of course, it will likely change again soon!
Try to eliminate the nighttime feedings, but don't beat yourself up if you give in now and then.  Your high-percentile 9-month-old probably doesn't need to eat during the night, but may instead use feeding as a way to feel comforted.  Try to find a different way to give that same comfort.  At the same time, you're probably a very tired person now, so don't get down on yourself if you occasionally go "Nothing's working, screw it, I'm feeding him."

There are so many things that could cause this regression that I wouldn't worry about getting to the bottom of it.  Instead know that there's a light at the end of the tunnel and he'll start sleeping again soon if you work on it together.  But of course also remember: there will be another tunnel after that!  Get as much sleep as you can now.  Good luck!


Making DEM from contours without elevation data?

Question: I got a shapefile with contours, but no elevation data is present. We can assume as known info, that the contours mark elevations at known steps (say, 20 m). Is it still possible to restore the elevation information and build the DEM model of relief, assigning arbitrarily the 0 elevation value to some starting contour? (either in ArcMap, or in QGis/Grass)
Comment: You could split them at the outset but I would research/ask about your preferred option first because an answer to that may enable you to find the answer for the other for yourself.
Comment: If you were *really* lucky and the lines were sortable by some attribute (even their OID) that was in the same order as increasing or decreasing elevation value, maybe you could auto-increment a new z field. But the odds are heavily against this working. More likely you'd have to manually assign a z value to each line, one at a time (especially if there are sinks or ridges). It should be relatively easy to write a script that fills in an attribute with an incrementing value for each select/assign, select next. Or at least it sounds like it should be, to someone who doesn't script.
Comment: You'd need ancillary information to make this possible, otherwise there'd be a very large number of potential assignments (starting with 0,20,0,20,..).
Comment: Which GIS software are you more likely to use to try and do this?  Asking for multiple options in one question makes this too broad.
Comment: I would do this in Qgis (2.4, 2.8) under Linux as first option, but ArcMap (10.2 Desktop) is OK as well.Should I rather split this question to ask separately for solutions in qgis and ArcMap?
Comment: The second part of this question has been answered in http://gis.stackexchange.com/questions/18116/is-it-possible-to-make-a-dem-from-contours-in-qgis?rq=1
Answer: One solution would be to convert your contours into points at a certain interval (I'm not sure how to select the interval objectively) and do a co-kriging interpolation, using an auxilary layer like a remotely sensed image of the area or other closely related variable with elevation (land cover might do too).
Comment: @underdark Eh, depends on your definition of interesting. :) I'd certainly agree that manually assigning a z value to a bunch of lines (one possible solution) is definitely uninteresting. The idea of 'co-kriging interpolation' with non-elevation *specific* ancillary data sounds interesting, but I couldn't say if it were practical, effective, or efficient. But yes, once you *have* z values on the lines, going to DEM has been covered in several questions.
Comment: Don't we loose our last chance to even guess the elevation values by turning the lines into points?
Comment: @underdark not really, assuming the points retain an attribute that links them to their source line. Even if they don't, an intersect or similar overlay operation could create/restore one. Whether points or lines, the z values have to be taken from some ancillary source or assigned, so converting the lines to points really has more to do with the method you use for that step (ie point sampling, spatial joining, or overlay operation).
Comment: @ChrisW ok, so this answer skips the more interesting part of the question :-) the remainder has been answered multiple times on gis.se
Comment: I agree with @ChrisW. The choice for the point spatial class is for the benefit of the variogram analysis and kriging, with appropriate sampling we shouldn't be losing much information. After we have our points with the elevation from the contour line as z- values, we can either do an IDW as suggested by the previous answer in SE, or we can go a bit further and account for spatial dependency through kriging. It will be even better to randomly select points from the converted point cloud to calculate the semi-variance parameters so that we can capture the spatial auto-correlation pattern.
Comment: the suggestion for co-kriging, with the additional variable is useful to balance any bias we introduce from using over-represented classes in the dataset (the contour dataset that reps selected values only ).


Visualisation using simple plotting routines or advanced GIS packages?

Question: When I have geographic data to be displayed, I usually use a plotting library to visualise the data, for example, combining matplotlib and basemap, or using the Matlab Mapping toolbox. For example, I have data gridded on a lat - lon grid, and to get them on a map, all I need is a projection and a bit of background map data (usually only coastlines). I am quite satisfied with the results of my visualisation. What does a full-fledged GIS package add that I'm currently missing?
Answer: According to Wikipedia:

Geographic information system (GIS) is a system designed to capture,
  store, manipulate, analyze, manage, and present all types of
  geographical data.

As for whether you're missing anything, that would depend on your use cases. If all you need to do is visualize geographic data then you're not really missing anything. Though you might want to add TileMill to your visualization toolkit. Makes for some pretty maps ;-) A GIS would just be overkill for plain visualization work.

If you're going to do spatial analysis though, then go for the GIS packages. Unless of course, implementing spatial analysis algorithms are your thing.


Is there any evidence that soft tissue can be preserved for 65m+ years and if not what hypotheses exist to explain it?

Question: I read an article on howstuffworks.com and they mentioned how we have found soft tissue in dinosaurs. According to the article even Mummies and Mammoths have no soft tissue left. Is there any evidence that soft tissue can remain intact this long even under perfect conditions? and if not what are some hypotheses that could explain it?
Comment: Science is not at the stage of imaginative hypotheses. We have the natural experiment of DNA recovery from geological strata that are easily and precisely dated, for example by 14C. From the fact that, as you look at older rocks, you see less useful DNA, the highly likely conclusion is that DNA is unstable in time. There is less fossil DNA in warm, humid places, pointing to a few explanations. There are DNA fossils dating more than those 65 million years, but they were in places where mammoths could not get (say, salt deposits that form today's mines).
Answer: Schweitzer et al. (2007) studied soft tissue preservation in a number of specimens, including an 800-1000 year old moas, 300,000 year old mammoth and mastodon, and 65 million year old *T. rex. and Triceratops. The oldest specimen was a 78 million year old Brachylophosaurus. Their goal was to try to find common environmental conditions that favor soft tissues preservation in fossils. As of this study, they have not been able to identify a single common environmental factor that seems to favor soft tissue preservation. They did note, however, that the specimens from which they could extract soft tissue (with varying success) were from fluvial sandstone environments, meaning sandy rivers. They (so far) could not extract soft tissue from terrestrial mudstone or marine environments.
Note that Schweitzer et al. did successfully extract soft tissue from the mastodon. The conditions required for mummification are probably not conducive to soft tissue preservation.  Here is a good blog article on one of Schweitzer's previous studies of soft tissue preservation.
The importance of extracting soft tissue from fossils cannot be overstated. Based on Schweitzer's work, her and her colleagues (Organ et al. 2008) were able to develop a phylogeny that incorporated both mastodon and T. rex. The used the amino acid sequence from collagen, a protein that is abundant in soft tissue. She and her colleagues repeated the analysis (Schweitzer et al. 2009) and included Brachylophosaurus, a hadrosaur. As predicted by morphological and other evidence, the mastodon was most closely related to modern elephants and the two dinosaurs were most closely related to modern birds and alligators.
Here is the phylogenetic tree derived from Schweitzer's 2009 study. Mammut is the mastodon. Brachylophosaurus and T. rex are the two dinosaurs.

Literature Cited
Organ, C.L. et al. 2008. Molecular phylogenetics of mastodon and Tyrannosaurus rex. Science 320: 499.
Schweitzer, M.H. et al. 2007. Soft tissue and cellular preservation in vertebrate skeletal elements from the Cretaceous to the present. Proceedings of the Biological Society of London B: 274: 183-197.
Schweitzer, M.H. et al. 2009. Biomolecular characterization and protein sequences of the Campanian hadrosaur, B. canadensis. Science 324: 626-631.