Sentinel-1A and Lansat-8 Resolution difference

Question: Sentinel-1A level-1 high resolution GRD data have 20X22m resolution (rgXaz)with 5X1 number of looks. While Landsat-8 data have 30m resolution. My question is how can I compare the resolution differences between them? In other words, which one of them has higher resolution? When I digitize a lake size from the two sensors, lake size  from  Landsat-8 is always greater than Sentine-1A. Note that its a same lake; images were taken on the same acquisition date or with not much of time difference. What could be the reasons behind for differences in the lake sizes? Is it because of resolution difference? If yes, How can I  interpret the results?
Answer: This is a bit of an apples and oranges comparison. The Sentinel-1A sensor is an active radar system carrying a  C-band synthetic aperture radar array. Whereas, Landsat 8 is a passive spectral system with 16-bit radiometric resolution across 0.43 - 2.29 micrometers (excluding the 100m2 IR bands). The characteristics of the sensors will dictate the feature resolution of the objects being detected.
Because the Landsat 8 sensor is carrying a blue edge band (0.43 - 0.45 um), it is likely able to discriminate water/wetland features more effectively than the backscatter signal from Sentinel-1A. This would account for the differences in feature size, regardless of the on the ground cell resolution differences. If you want to use radar SAR data for water/wetland classification it would be better to use L-band data from ALOS PALSAR. This would provide much better discrimination than Sentinel-1A C-band data.
I would have to add here that you really need to consider a classification algorithm. It is impossible to visually Elucidate information contained in both of these data. There could very well be information contained in the data that is providing feature discrimination that is not readily apparent in a visual assessment. The difference in the results could be associated with user bias and not information content. This is particularity relevant in a multivariate context where there may be very relevant information, contained across multiple bands that are not being used in and RGB composite, comprising the image backdrop being used in heads up digitizing. You are effectively throwing away data. In the radar data there is likely a pixel gradient that is not apparent in your visual interpretation. The image can also be seriously compromised based on the type of stretch used in display.
Comment: @SONAM WANGCHUK, but you are completely ignoring feature discrimination based on the actual data. SAR C-band data does not discriminate water as well as L-band whereas, the Landsat 8 blue-edge band with 16-bit radiometric resolution has the ability to discriminate water features very accurately. The increased discrimination sensitivity of Landsat 8 more than makes up for the differences in resolution differences. It is not all about resolution, you also have to factor in separability and specific feature detection of a given sensor!
Comment: Actually, lake surface was extracted using NDWI index (not RGB). Do you think it could have  influenced  the lake size? Will there be any difference between the lake areas from RGB and NDWI? @Jeffrey Evans
Comment: Yes, because you are using a specific index that is transforming the data from multivarite to univarite. As stated previously, you are throwing data away. The NDWI was developed pre-Landsat 8 and does not utilize the blue edge band which is very relevant to water/wetland gradients.
Answer: Based on the information you provided, Sentinel-1A has a higher spatial resolution. Each pixel from the Sentinel is 20m x 22m, while each pixel from Landsat 8 is 30m x 30m. For a 100m x 100m area, there would be approximately 25 pixels in the Sentinal image and approximately 9 pixels in the Landsat image.
If you're classifying the image, your analysis may be yielding a larger area from the Landsat image because of the mixed pixel problem. Pixels on the edge of the lake cover some lake and some land. But when you classify the image, you force it to pick one or the other. The smaller spatial resolution from the Sentinel image would minimize this problem. Because of the larger Landsat pixel size, there is likely a larger area mistakenly classified as lake when it is really land.
If you're manually digitizing the image, I don't have a quick answer.
EDIT: Sentinel is an active sensor, which is going to change how you interpret the data. If you're just looking for the lake area, I would use a passive sensor and not an active sensor. The lake water will have very low reflectance across all Landsat bands.
Comment: you are not taking into account that Sentinel-1A is an active SAR sensor and Landsat 8 is a passive spectral sensor. The differences in sensor characteristics can directly account for differences in feature representation and thus resulting feature size.
Comment: Sentinel-1A level 1 data is processed into "Single Look Complex" and "Ground Range Detected" data which is quite interpretable and usable in this type of analysis. Dealing with direct interpretation of backscatter data would be an issue with Level-0 processing.
Comment: Edited, thanks. I'm not familiar with Sentinel. An active sensor seems like overkill for this application.
Comment: It is not at all overkill. There is a large body of literature on water and wetland classification using radar sensors. There is a great global effort, out of NASA-JPL, for wetland classification using ALOS PALSAR L-band data.
Comment: It's more esoteric at least. It's far more likely that someone will know how to classify a Landsat image than interpret radar backscatter. Given OP's level of understanding (or lack thereof), Landsat seems like a more feasible option.


Why do we hear so little about the German President?

Question: According to Wikipedia:

Under Article 59 (1) of the Basic Law (German Constitution), the President represents the Federal Republic of Germany in matters of international law, concludes treaties with foreign states on its behalf and accredits diplomats.

So it seems to me that (at least on paper) it's the German President who should be signing international treaties such as the Paris Climate Accords. But in reality few people outside of Germany know the President's name and many don't even realize the position exists.
So what are the de facto powers of the German President and why is he involved so little in international matters?
Comment: Hear about who?
Comment: Near-duplicate: https://politics.stackexchange.com/q/2911/1370
Comment: I came here fully prepared to let the asker know "Germany doesn't have a president, their head of state is...". The more you know!
Comment: When I worked in Germany it seemed to be a running joke that no one knew who the president was, there was a news story of a little kid going up to them and asking them where the toilet was and that news story was the only mention of them all the time I was there on the news!
Comment: He/she just signs on behalf of the government/parliament. It's more a ceremonial office here.
Comment: I seriously didn't know they had one. And I don't think I'm generally ignorant about politics.
Comment: Because foreign policy is made by the federal government, not by the president.
Comment: Though most people do not know the guys, they are highly entertaining. Horst Köhler in 2010 created a scandal in claiming the military in the war on terrorism is securing trade routes (which is highly forbidden after the events of WW2) and retired, successor Christian Wulff took money from friends and tried to cover it up by threatening journalists (famous quote "Ich bin auf dem Weg zum Emir") and retired. The last guy, Joachim Gauck, very presidentially lives with his girlfriend while still being married. The current one is faceless until now...
Answer: The reason is largely historical, the office of President was first introduced in the Weimar Republic of Germany, with significant political powers according to its constitution.

Article 25 of the Weimar Constitution the President had the power to unilaterally dissolve the Reichstag
Article 48 of the Weimar Constitution the President had the power to unilaterally suspend civil liberties.
Article 53 of the Weimar Constitution the President had the power to unilaterally appoint and dismiss the Chancellor and the cabinet.

Basically this created a very unstable sort of government and the Reichstag was constantly getting dismissed and re-elected. Indeed there were 8 elections between 1919 and 1932. Also the cabinet of the Weimar government kept getting appointed and dismissed as the President would appoint them, but they didn't enjoy support in the Reichstag who would promptly dismiss them. This led to the President Hindenburg appointing a bunch of cabinets who outright didn't enjoy support in the Reichstag and were referred to as "presidential" cabinets.
However it all changed in 1933 when Adolf Hitler rose to power, to some degree through abusing powers invested in the office of the President such as with the Reichstag Fire Decree. I quote a translated copy of the text below:

On the basis of Article 48 (Weimar Constitution) paragraph 2 of the Constitution of the German Reich, the following is ordered in defense against Communist state-endangering acts of violence:
Articles 114, 115, 117, 118, 123, 124 and 153 of the Constitution of the German Reich are suspended until further notice. It is therefore permissible to restrict the rights of personal freedom habeas corpus, freedom of (opinion) expression, including the freedom of the press, the freedom to organize and assemble, the privacy of postal, telegraphic and telephonic communications. Warrants for House searches, orders for confiscations as well as restrictions on property, are also permissible beyond the legal limits otherwise prescribed.

As you can see this was clearly an abuse of the power of the president and it along with the Enabling Act led to the downfall of democracy in Germany and the rise of Hitler as chancellor. In 1934 Hitler combined the offices of President and Chancellor to become the Fuhrer

So in 1949 when the West German Basic Law (or constitution) was written, the authors intentionally reduced the powers of the president and made him indirectly elected i.e elected by the Federal Convention (which basically consists of the entirety of the Bundestag and some other regional leaders) instead of the public. Now some dude who is indirectly voted in by the parliament isn't going to garner international headlines unless he is particularly controversial, since in a democracy he isn't that powerful. Also because the public don't need to go to a polling booth to tick his name they simply don't know or don't care.

Nowadays the de facto powers largely lie in the fact that the President of Germany has considerable leeway in exercising his duties, which are quoted as follows:

Proposing the Chancellor to the Bundestag.
Appointing and dismissing the Chancellor and Federal Ministers
Dissolving the Bundestag under certain circumstances
Convening the Bundestag according to article 39 of the constitution
Signing and promulgating laws
Appointing and dismissing federal judges, federal civil servants, and commissioned and non-commissioned officers of the Armed Forces
Exercising the power to pardon individual offenders on behalf of the Federation
Awarding honors on behalf of the Federation
Representing Germany at home and abroad

For example he could independently make representations and political suggestions which would not be allowed to some other heads of state whose role is more ceremonial e.g Her Majesty the Queen.
The President of Germany also possesses some reserve powers if all goes to pot as outlined by Article 81 of Basic Law

Legislative emergency
(1)
      If, in the circumstances described in Article 68, the Bundestag is not dissolved, the Federal President, at the request of the Federal Government and with the consent of the Bundesrat, may declare a state of legislative emergency with respect to a bill, if the Bundestag rejects the bill although the Federal Government has declared it to be urgent. The same shall apply if a bill has been rejected although the Federal Chancellor had combined it with a motion under Article 68.
(2)
      If, after a state of legislative emergency has been declared, the Bundestag again rejects the bill or adopts it in a version the Federal Government declares unacceptable, the bill shall be deemed to have become law to the extent that it receives the consent of the Bundesrat. The same shall apply if the Bundestag does not pass the bill within four weeks after it is reintroduced.
(3)
      During the term of office of a Federal Chancellor, any other bill rejected by the Bundestag may become law in accordance with paragraphs (1) and (2) of this Article within a period of six months after the first declaration of a state of legislative emergency. After the expiration of this period, no further declaration of a state of legislative emergency may be made during the term of office of the same Federal Chancellor.
(4)
      This Basic Law may neither be amended nor abrogated nor suspended in whole or in part by a law enacted pursuant to paragraph (2) of this Article.

TLDR:
President is basically ceremonial, but has some leeway in exercise of duties. You haven't heard of him because the public don't elect him and his powers were cut because Hitler used them to become a dictator.
Comment: *Now some dude who is indirectly voted in by the parliament [...] isn't that powerful.* - in an otherwise good answer, I think that particular statement is too broad.  In a traditional Parliamentary system, the Prime Minister is voted in by the parliament, but it is the most powerful position there is.  Isn't the German Chancellor chosen by the parliament too?  I can't find anything in the Wikipedia article to suggest that the Chancellor is directly elected.  (Of course the winning party always votes in their leader, but nonetheless the decision belongs to the Parliament.)
Comment: @HarryJohnston yes, the federal chancellor is elected by the parliament. It is more the other way around: Because the president is not much powerful, there is no point in electing him (or her) in a general election.
Comment: In the last ten years we've been through presidents like underwear, and mutliple times the reasons why we needed a new one yet again made quite some news... so they are in the german public eye, but only if they screw up... but yeah, TL;DR: The chancellor is who most germans would consider the big boss, not the president.
Comment: @AndyT In practise, yes, the PM is the party leader as chosen by the wider party; in theory, however, it is the Parliament whose support they need; constitutionally, I believe they are actually appointed by the monarch. So the monarch appoints the PM, based on the recommendation of Parliament, which in turn takes the recommendation of the national party. From a democratic point of view, though, the public elect Parliament, and Parliament forms a Government, including the PM. All depends how you look at it, really.
Comment: @AndyT, the Prime Minister is elected by the winning party, because the ability to elect your choice of Prime Minister is what *defines* the winning party.  The MPs may be obliged by party rules to vote a particular way, but AFAIK they aren't obliged *by law* to vote that way.
Comment: Even under Ar. 81 he only acts one request of the Federal Government, not on his own.
Comment: @HarryJohnston - I have no idea which system you call "traditional", but FYI in the UK the Prime Minister is (in practice) elected by the winning *party*, according to the internal rules of that party, and hence not necessarily by the members of parliament of that party.
Comment: For your convenience: ü
Comment: "Indeed there were 8 elections between 1919 and 1932." Though there were six in the UK between December 1918 and 1932, so eight doesn't seem like an insane number.
Comment: @DavidRicherby it was still a significant number, although Britain may not have had the most stable politics in the world at that point either a parliament lasting on average less than 2 years is certainly not stable
Comment: @HarryJohnston - I'm not sure what point you're trying to make. Your first sentence is correct, and not in disagreement with my comment. Your second sentence is unclear - either you're talking about how MPs vote on bills etc. (irrelevant), or you are suggesting that the PM is chosen by the MPs *which is incorrect in the UK*.
Comment: @AndyT, do you just mean that there's no explicit "who's going to be the PM" vote?  I don't think we're disagreeing on anything of substance, and I concede that my original comment was imprecisely written.  My point is that a PM cannot remain PM without the support of MPs, the direct mechanism for which is a [motion of no confidence](https://en.wikipedia.org/wiki/Motions_of_no_confidence_in_the_United_Kingdom) or the [defeat of a supply bill](https://en.wikipedia.org/wiki/Motion_of_no_confidence#United_Kingdom).
Comment: @HarryJohnston - That is what I meant yes, and what I understood you to be suggesting. I agree with your revised wording. :)
Answer: As in most other parliamentary republics, the President of Germany is little more than a figurehead. However, he/she is the head of state, and is the symbol of the country and its sovereignty, and do serve as the "final guard" of the constitutional order. Per the Basic Law of Germany, the president's real (i.e., non-ceremonial) powers include:

dissolving the Bundestag (Parliament) when the Bundestag is unable to elect a Chancellor by majority. In this case, the President may either appoint the Chancellor-elect as the head of a minority government, or dissolve the Bundestag and order reelections;
to countersign, or refuse to countersign, legislation, when the President feels that the law is unconstitutional;
proclaim legislative emergency (see Art. 81, GG of the FRG).

In other words, the President of Germany's powers are similar to that enjoyed in other parliamentary republics and constitutional monarchies. By convention, both powers are used only sparingly by the head of state in any parliamentary regime. Overuse of those "reserve" powers may lead to constitutional crisis (e.g. the 1975 Australian constitutional crisis) and more terrible things.
On a tangent, it is not unheard of for modern constitutional monarchs to refuse to sign laws either. King Baudouin of Belgium refused to sign a 1990 law permitting abortions, after which the cabinet was not too happy and declared him unfit to rule for a day. On the other hand, there are other heads of state who are constitutionally bound to whatever the Parliament offers to them, e.g. the King of Sweden, the Emperor of Japan.
Comment: Note that for most actions of the president, the chancellor (or some other member of the government) needs to sign too. The appointment of the Chancellor or dissolving the parliament in certain cases is the only real power.
Comment: Add the Queen of the United Kingdom to the list of HoSs that are constitutionally bound to sign.  (Just because we don't have a *written* constitution doesn't mean we don't have one.)
Comment: @PaŭloEbermann: And even then he has no real freedom. The best he can do is refuse to sign a law and pass it to the Bundesverfassungsgericht.
Comment: @MartinBonner: "The Queen has a veto. The Queen has at most *one* veto." :-)
Comment: @MartinSchröder Interesting: https://www.theguardian.com/uk/2013/jan/14/secret-papers-royals-veto-bills  It appears that the Queen has rather more powers than I thought.  I do not approve.
Comment: @MartinBonner: Yeah, but if she used her veto on something controversial (like the Brexit), that would be her last veto.
Comment: @MartinSchröder It's so ironic that the queen - who is inherently undemocratic and represents a long gone era - is now the ultimate defense of democracy and freedom.
Comment: The status of the German President is probably a partly a cultural thing and partly because the president isn't elected. Some countries with a ceremonial president like Ireland have a better-known person who acts as more of a public figurehead, even if they have no real power.
Comment: @xuq01 potentially of interest: [Guardrails against the German president from "going rogue"; violating norms and guidelines and unilaterally making/blocking foreign policy decisions?](https://politics.stackexchange.com/q/72589/16047)


PIDs and associator rings

Question: Let $R$ be a principal ideal domain and let $p \in R$ be prime. Show that the quotient $R/\langle p^k\rangle$ is an associator ring for any positive integer $k$ - that is, if $a, b \in R/\langle p^k\rangle$ generate the same ideal, then there exists a unit $u$ in $R/\langle p^k\rangle$ with $a=ub$ in this ring.
Comment: So "associator ring" means every two generators of a given principal ideal are unit multiples of one another?  (I only got 5 hits in google, and I couldn't get to a definition in any of them.)
Comment: In my experience, they are usually called strongly associate rings.
 This gives some background: http://journals.math.tku.edu.tw/index.php/TKJM/article/viewFile/464/396
Answer: This property that $(a)=(b)$ implies $a=\lambda b$ for some unit $\lambda \in U(R)$ is called a strongly associate ring usually in my experience.  Any ring which is presimplifiable has this property.  I believe this kind of ring is called a Special Principal Ideal Ring.  This kind of thing is studied here in a paper by Anderson, Axtell, Forman, and Stickles called When are associates unit multiples?: https://www.researchgate.net/publication/38371302_When_are_Associates_Unit_Multiples

PIDs and associator rings


Installing debian on existing ubuntu - will /home folder be removed?

Question: I want to install Debian with LXDE on partition, that already have Ubuntu 11.04 installed. I have a lot of music there, and I don't want copy it to another partition. I know that Debian installer will propt that on this partition is already linux installed, but will it remove all from my /home/ folder if I type the same username in setup? Or should I have to encrypt this folder?
Comment: It will likely purge everything on the ubuntu partition prior to installation.  You should create a dedicated partition for your music and move your music to there, in my opinion.
Answer: First, make sure you have backups. Accidents can happen.
The Debian installer will overwrite the partition that you select to install the system. Shrink the existing partition to make room for a new partition where you'll install Debian. In general, it's a good idea to have a partition for the system and a partition for your data.
Have you made your backup yet?
Boot from a Linux live CD or live USB, such as the Ubuntu live CD or the GParted live CD. Remove all the files outside /home, then move the directories in /home one level up, and remove the (now empty) /home directory. (Of course, if there are files you want to keep outside /home, make sure not to remove them, just move them to a good place!) Then use the disk/partition manager (I forget exactly what it's called), and shrink the existing Linux partition.
When you install Debian, tell it to use the free space as a partition to install the system. And tell it to mount your existing partition at /home, without formatting it.
Did you test that your backup was readable and contained all the files it should?
Answer: I believe that Debian will (or may?) overwrite and effectively remove your home folder and encrypting it is not protection against it getting overwritten.
You should copy your home folder to an external hard drive if possible so you can restore it later.
Backup. Backup. Backup.
Comment: Oh, thanks, I will backup all tomorrow :)
Comment: +1 for mentioning "Backup. Backup. Backup." - people don't do it enough.
Comment: Reinstalling operating systems on a drive is perhaps _the_ singlemost high dataloss risk operation you can find as it may choose to reformat any drive. Anything you want to survive this should be carefully backed up.
Comment: If you keep `/home` on a separate partition and explicitly tell debian NOT to format that partition but instead use it as is, you should be fine.


Using perpendicular offsets in FindFit

Question: I want to use perpendicular offsets in the built-in FindFit function.
Are there any possible ways or do I have to code everything by myself?
Comment: Look here http://cf.net16.net/odlsf/
Comment: *Mathematica* does not yet have explicit support for **orthogonal regression** / **total least squares**, but one can certainly use the built-in optimization functions to implement this sort of fitting.
Comment: For *Mathematica* examples of orthogonal fitting, see [this](http://mathematica.stackexchange.com/a/13122) and [this](http://mathematica.stackexchange.com/a/23115).
Answer: Ok,
I had done this long time ago since my supervisor insisted, this is a numerical approach to what you asked for and I have done this for a L-J potential function but can be extended to any function.
I hope this will help you.
In principle we need to minimize the the perpendicular distance. For example
if U[r] is our function and E[r] is our energy points (data),
we will have to different types of fitting
minimizing U[r]-E[r] =Vertical fit
minimizing U[x]-E[r] =perpendicular fit,
where x is the point on the curve which is perpendicular to our data point.
Problem here is we don't have any coordinates for points on our functional to draw perpendicular lines and minimize them, therefore what I did was doing a normal builtin fitting which would be vertical as an initial guess!
something like:
NMinimize[(U[r] -E[r] ), {A,B,C}]

Then I draw perpendicular lines from the first best vertical fit assumption and minimize them
for that!
you Find Perpendicular coordinates on to the line (here's the x we need!)
FindMinimum[{(E[x] - U[r])^2 + (x - r)^2}, {x,"initial guess"}]

Then minimize this distance by refitting in the same procedure as before but this time instead minimizing E[r]-U[r] you minimize E[r]-U[x] where x is perpendicular to E[r].
after this you can put it in a loop and continue this loop to satisfaction.
[1
Comment: it was long time ago but thanks you answered in great details with a nice numerical approach.

Using perpendicular offsets in FindFit


Perform basic maths on contents of Google Document (not spreadsheet)

Question: In Microsoft Word, it is possible to use very simple formula e.g. =SUM(ABOVE) to display the total of a column or =SUM(LEFT) etc. Is it possible to do something similar in Google Docs? Obviously this is possible in Google Spreadsheets, but I need to do it within a table in a document.
Comment: Related (possible duplicate?): [How to calculate SUM in Google Docs?](https://webapps.stackexchange.com/q/111359/33787)
Answer: At this time Google Docs (documents) doesn't include a feature to do calculations.
An alternative is to use an add-on or a Google Apps Script to extend the built-in features of Google Docs.
References
Extend Google Docs, Sheets, and Forms with Apps Script - Docs editors Help
Answer: To illustrate the usage of Apps Script for such purpose, I wrote a function that sums selected values in a document: either in a table, or in a paragraph, or in several paragraphs, etc.
It is invoked by menu command "Sum selected", found under "Custom"; this menu item is created when the document is opened. The text of election is split by whitespace, and then each piece is interpreted as a number (if possible). Such numbers are added and the result is displayed to the user by an alert dialog.  (I considered inserting it into the document, but there isn't a natural place for it: when a user is selecting text, their cursor position is lost.)
This is a one-time calculation; if the values are changed, one would need to perform it again.
function onOpen() {
  DocumentApp.getUi().createMenu('Custom').addItem('Sum selected', 'sum').addToUi();
}

function sum() {
  var selection = DocumentApp.getActiveDocument().getSelection();
  if (selection) {
    var elements = selection.getRangeElements();
    var s = 0;
    for (var i = 0; i < elements.length; i++) {
      var element = elements[i];
      var text = element.getElement().editAsText();
      if (text) {
        var str = text.getText();
        if (element.isPartial()) {
          str = str.slice(element.getStartOffset(), element.getEndOffsetInclusive() + 1);
        }
        var pieces = str.split(/\s+/);
        for (var j = 0; j < pieces.length; j++) {
          s += (parseFloat(pieces[j], 10) ? parseFloat(pieces[j], 10) : 0);
        }
      }
    }
    DocumentApp.getUi().alert(s);
  }
}

Answer: The easiest way to use formulas in a table in Google Docs is to build your table in Sheets and then copy it over, keeping it linked when prompted. Here's an example where I copied three different sections from a Sheet into my Doc:

This is very flexible. In my case, some of the values in the equations even come from parts of the sheet that I didn't import:

In order to update the values, update in Sheets and then you will see a refresh icon button over each table that needs to be updated in Docs. Clicking on that opens up the menu for that table, where you can click "Refresh" again to perform a refresh:
Answer: Using the add-on Reversible Formulas - Sketch-n-Script, you can add formulas to display a table and also to perform arbitrary JavaScript computation on it.
Write in your document:
expenses = ([10, 20, 30])
incomes = ([30, 20, ""])

=table([["Expenses", "Income"]].concat(rotate([expenses, incomes])))

Totals

=table([["Expenses", "Income"]].concat([[sum(expenses),sum(incomes)]]))

Click on "Display values". You should obtain the following - I added bold to 'Totals':

Url of the add-on:
https://chrome.google.com/webstore/detail/formulas-for-google-docs/kgjbgmonlnhglokmfnpnklegakfknbeh
Disclaimer: I am the author of this add-on.
Disclaimer: As of now, it's not yet possible to modify the rendered tables visually. I'm working on it.
Answer: I took user79865's code and made some changes.
This code can evaluate any simple equation from a selected text:
function onOpen() {
  DocumentApp.getUi().createMenu('Custom')
  .addItem('Evaluate', 'evaluate').addToUi()
  .addToUi();
}

function evaluate() {
  var selection = DocumentApp.getActiveDocument().getSelection();
  if (selection) {
    var element = selection.getRangeElements()[0];
    var text = element.getElement().editAsText();
    if (text) {
      var str = text.getText();
      if (element.isPartial()) {
        str = str.slice(element.getStartOffset(), element.getEndOffsetInclusive() + 1);
      }
      var val = eval(str);
      val = +val.toFixed(2)
      DocumentApp.getUi().alert("Equation: " + str + "\nResult: " + val);
      //text.appendText('\nAppended text.');
    }
  }
}

It's also possible to uncomment the last line and the code will write the answer at the document.
Operators that I've used and worked well:

+   Addition
–   Subtraction
*   Multiplication
/   Division
**  Exponentiation
( ) Group numbers in the order of operations
Answer: I like Rogério's answer, and will like it even better once my Apps Script skills get good enough so that I can figure out how to make the result populate where I want it to in the Google Doc.
Rogério's solution, however, doesn't answer Jonathan Day's question. I've also been looking for a similar solution and have come across something that's only partial, but better than nothing. I found it on here: Functions on a Google Documents Table.
I was struggling with the code as shown on the author's blog, so I contacted him and he was gracious enough to send me a fuller version of the code to test. Here's the script that I've implemented on this doc:
function onOpen(e) {
  var menu = DocumentApp.getUi().createAddonMenu();
  menu.addItem("Sum Table", "sumTable");
  menu.addToUi();
}

function sumTable() {
    // First table is "table[0]".
    var table_index = 0;
    // First row is "row[0]".
    // Starting row offset for skipping a header.
    var row_start_offset = 1;
    // First column is "column[0]".
    var column_index = 1;

    // Get document body.
    var doc = DocumentApp.getActiveDocument();
    var body = doc.getBody();

    // Get the tables.
    var tables = body.getTables();
    // Find out how many rows are in the table.
    var numRows = tables[table_index].getNumRows();

    // Initialize variables.
    var row;
    var val;
    var total = 0.0;
    // Starting from the row offset, loop over all rows until the last.
    for(row = row_start_offset; row<numRows-1; row++) {
        // Get the value of the cell.
        val = tables[table_index].getCell(row, column_index).getText();
        // Skip the "$" if present.
        if (val[0] == '$') {
        val = val.slice(1);
        }
        // If there is a value in the cell.
        if(val) {
        total += parseFloat(val);
        }
    }

    tables[table_index].getCell(numRows-1,column_index).setText("$"+total.toString());
}


Is the set of real numbers the largest possible totally ordered set?

Question: Because I find any totally ordered set can be "lined up" in a straight line, I'm guessing that the set of all the real numbers is the biggest totally ordered set possible. In the sense that any other totally ordered set is isomorphic (order-preserving) to a subset of real numbers. Is that right?
Comment: Perhaps it was because OP's name is Voldemort, but I originally read Qiaochu's link as the "Hogwarts number."
Comment: No. There are arbitrarily large totally ordered sets. See http://en.wikipedia.org/wiki/Hartogs_number .
Comment: @JavaMan: Yours should be the comment of the day. I wish I could give you +50 for it.
Comment: Related question: Any example of how to order a set of aleph-2 cardinality (for example the set of sets of reals?)
Comment: The set of real numbers is the largest totally ordered group only in the sense that having no nontrivial convex subgroups. This means any totally ordered group having convex subgroups only zero subgroup is isomorphic to subgroup of R as a ordered group.
Answer: Elementary Construction
Without going into too much set theory, it is possible to produce an explicit example of a totally ordered set that cannot be embedded into $ (\mathbb{R},\leq_{\mathbb{R}}) $ in an order-preserving manner.
Define a total ordering $ \preceq $ on $ \mathbb{R}^{2} $ as follows:
$$
\forall a,b,c,d \in \mathbb{R}: \quad (a,b) \prec (c,d) ~ \stackrel{\text{def}}{\iff} ~ (a <_{\mathbb{R}} c) ~~ \text{or} ~~ (a = c ~~ \text{and} ~~ b <_{\mathbb{R}} d).
$$
Observe that $ \{ \{ r \} \times \mathbb{R} ~|~ r \in \mathbb{R} \} $ is an uncountable collection of pairwise-disjoint non-degenerate $ \preceq $-intervals of $ \mathbb{R}^{2} $. Hence, $ (\mathbb{R}^{2},\preceq) $ cannot be embedded into $ (\mathbb{R},\leq_{\mathbb{R}}) $ in an order-preserving manner; if this were not the case, then $ \mathbb{R} $ would contain uncountably many pairwise-disjoint non-degenerate intervals, so by picking a rational number from each of these intervals, we would end up with uncountably many rational numbers ⎯ contradiction.

Model-Theoretic Construction
There is a neat way to prove the existence of totally ordered sets with arbitrarily large cardinality. It relies on the Compactness Theorem in logic and model theory. Let $ \kappa $ be a cardinal and $ \mathcal{L} $ the first-order language consisting of

a set $ \mathcal{C} $ of $ \kappa $-many constant symbols and
a single binary relation symbol $ \leq $.

Next, define $ T $ to be the first-order $ \mathcal{L} $-theory consisting of:

For distinct $ c,d \in \mathcal{C} $, the sentence $ \neg(c = d) $.
The Axiom of Reflexivity: $ (\forall x)(x \leq x) $.
The Axiom of Antisymmetry: $ (\forall x)(\forall y)(((x \leq y) \land (y \leq x)) \Longrightarrow (x = y)) $.
The Axiom of Transitivity: $ (\forall x)(\forall y)(\forall z)(((x \leq y) \land (y \leq z)) \Longrightarrow (x \leq z)) $.
The Total-Ordering Axiom: $ (\forall x)(\forall y)((x \leq y) \lor (y \leq x)) $.

Although $ T $ has infinitely many sentences (by (1)), it is easy to see that $ (\mathbb{N},\leq_{\mathbb{N}}) $ is a model of any finite number of these sentences. Therefore, by the Compactness Theorem, $ T $ has a model $ (\mathcal{M},\leq^{\mathcal{M}}) $. Clearly, if we choose $ \kappa > {\frak{c}} $, then we cannot embed $ (\mathcal{M},\leq^{\mathcal{M}}) $ into $ (\mathbb{R},\leq_{\mathbb{R}}) $ in an order-preserving manner.

Set-Theoretic Construction
The model-theoretic approach above suffers from a mild drawback, in the sense that the Compactness Theorem is equivalent to the Boolean Prime Ideal Theorem, which is a weak form of the Axiom of Choice. If one wishes to work strictly within the framework of the Zermelo-Fraenkel axioms, then one can use Hartogs' result that for any set $ X $, it is possible to find an ordinal $ \alpha $ that cannot be mapped injectively into $ X $. In particular, there exists an ordinal $ \alpha $ that cannot be mapped injectively into $ \mathbb{R} $, much less embedded into $ \mathbb{R} $ in an order-preserving manner.
Comment: But $\mathbb{R} \times \mathbb{R}$ is the same size as $\mathbb{R}$.  I think the poster is looking for a set strictly larger than $\mathbb{R}$ (For instance if there existed an ordering on $\mathcal{P}(\mathbb{R})$, that would be good.)
Comment: Let me just add that there are certain models of set theory without choice where the reals are maximal in a sense: Define $\mathbb R/E_0$ as the set of equivalence classes of the relation that identifies two reals iff their difference is in $\mathbb Q$. In natural models of the axiom of determinacy, the size of $\mathbb R/E_0$ is a successor of the size of $\mathbb R$: It is strictly larger, and there are no intermediate sizes. This set is not linearly orderable and, if a set $X$ is not linearly orderable, then $\mathbb R/E_0$ can be injected into $X$.
Comment: An ordering on $ \mathcal{P}(\mathbb{R}) $ requires some form of the Axiom of Choice (AC). I wanted to avoid using AC when providing an answer. However, as Qiaochu has mentioned, Hartog's Theorem gives us a way of producing an ordinal that does not inject into a given set. For example, by Hartog's Theorem, there exists an ordinal $ \alpha $ that does not inject into $ \mathbb{R} $, much less inject into $ \mathbb{R} $ in an order-preserving manner.
Comment: The great thing about Hartog's Theorem is that it is a theorem of ZF. Naturally, as Hartog's Theorem is about well orderings, it is a harder result. My example only deals with total orderings, so it is simple to construct. It is clear that my example is not a well-ordered set.
Comment: The point of my construction is that one does not have to resort to larger cardinalities in order to exhibit a counterexample.
Answer: No, absolutely not. Assuming the axiom of choice, let $\kappa$ be any cardinal greater than $2^\omega=|\Bbb R|$; then $\kappa$ in its natural order is a linear order of greater cardinality than $\Bbb R$. If the axiom of choice fails in such a way that $\Bbb R$ cannot be well-ordered, there is still a well-ordered set that cannot be embedded in $\Bbb R$, the Hartogs ordinal of $\Bbb R$.
Comment: Actually, no uncountable ordinal can be embedded in $\mathbb{R}$. I give the argument in my answer.
Comment: @Michael: I know; after all, $\Bbb R$ is ccc, hereditarily separable, etc. I was deliberately concentrating on the cardinality aspect.
Answer: The real line is the largest order separable linearly ordered set. That is, if $(L,\preceq)$ is a linearly ordered set such that a countable set $C\subseteq L$ exists satisfying that for all $x,y\in L$ with $x\prec y$ there is $c\in C$ with $x\preceq c\preceq y$, then there exists a function $f:L\to\mathbb{R}$ such that $f(x)<f(y)$ iff $x<y$ for all $x$ and $y$ in $L$. The existence of such a set $C$ is also necessary. A proof of these facts is given here.
Here is yet another counterexample without order separability: Let $(W,\preceq)$ be an uncountable well-ordered set. Let $W'$ be $W$ without the maximum of $W$ if such a maximum exists. For each $w\in W'$, let $S(w)$ be its immediate sucessor given by $S(w)=\min\{w'\in W:w'\succ w\}$. It is easily seen that $x\prec y$ implies $x\prec S(x)\preceq y\prec S(y)$. So if a strictly increasing function $f:W\to\mathbb{R}$ would exist, the uncountable family of intervals $\{(f(w),f(S(w))):w\in W'\}$ would be disjoint, which cannot be for the same reason pointed out by Haskel Curry in his answer.
Comment: I think you mean:  the uncountable family of intervals $\{(f(w), f(S(x))) : w\in W'\}$.
Comment: @Anguepa That family of intervals is clearly exactly disjoint when the given family of order intervals is disjoint.
Comment: I must insist, I think you mean $\{(f(w),f(S(w))) : w\in W'\}$ is place of $\{(w,S(w)): w\in W'\}$. The intervals $(w, S(w))$ are empty.
Comment: @Anguepa You are right. I'll edit it.
Answer: Some linearly ordered sets are not isomorphic to any subset of the reals even though there are not more of them than there are reals.  The set of all countable ordinals is an example.
Answer: EDIT: this may be order isomorphic to the reals, but not as a field, as it is not Archimedean.
As an elementary example, the rational functions $\mathbb R(x)$ are an ordered field. The quotient $p(x) / q(x),$ with leading terms $p_m x^m$ and $q_n x^n,$ is called positive if $p_m / q_n$ is positive. Comparison of two rational functions is given by taking the difference and checking the sign as above. So, for example, $1/x$ is positive but is smaller than any positive real number, as with positive $A$ we find
$$  A - \frac{1}{x} = \frac{Ax-1}{x}.   $$
Comment: Regarding your EDIT: Your construction is not order-isomorphic to the reals because $\{(p-1/x,p+1/x):p\in\Bbb R\}$ is an uncountable set of pairwise-disjoint nontrivial intervals, so as in Haskell Curry's answer you get an uncountable set of rational numbers in these sets.
Answer: No, in fact it's a famous result that ANY set can be totally ordered--this is known as the Well-Ordering Theorem and is equivalent to the Axiom of Choice.
For more information, see here.
Comment: You do not need the well-ordering theorem to exhibit arbitrarily large total orders. See http://en.wikipedia.org/wiki/Hartogs_number .
Comment: He's not saying arbitrarily large numbers - he's saying any set.
Comment: The well-ordering theorem (equivalent to AC) is strictly stronger than the Ordering Principle (that every set admits a total order). The Ordering Principle can be proved from the Ultrafilter Lemma, which is weaker than AC. (nice answer at http://math.stackexchange.com/a/211621/62940.)


What's the right hardware and Photoshop configuration for big size canvas with a lot levels?

Question: with the new devices like iPad Pro I need to design UI with a lot of details and a lot of levels (also with smart object for a faster modifications) cause I need to have all on the same files, the result: a Photoshop LAGGY consequence (like 2 sec. to move an object and 20 sc to save a PNG 2048x1280)... What is your pipeline? I've 8 GB of Ram on my workstation, need more ram?
Thank you.
Answer: My approach has always been a systems approach rather than suboptimizing specific components. The critical elements in a computer system to run Photoshop are, in order of my preference:

RAM, with the prices today, add as much as your budget allows, certainly more than 8GB. If you are planning to keep your gear, this is where you can gain substantial improvements with modest investment
CPU, clearly faster the better. If possible, an i7 class CPU is better than an i5, or i3
Graphics card, the later versions of Photoshop and even Lightroom to some extent are able to use some GPU capabilities. Check the version of Photoshop you are using and find out what graphics capabilities it supports and move accordingly
Scratch disk, a fast separate scratch disk will add to the performance. Despite all the memory, Photoshop still offloads information from memory to disk. This process should not compete with program module switches and other system level disk access. Add a second hard disk drive and set Photoshop to use it for its scratch disk not your system drive C.

Allocate your budget to come up with a balanced "system". There is no sense in using the fastest CPU on a computer with 8GB RAM and a single drive. However, the most visible performance gain will likely come from adding more RAM to your system.
Comment: so you mean that isn't about photoshop pipeline but hardware performance, my settings was already right like you said. Thank you!
Comment: I don't really know how you set up Photoshop, but 8GB RAM is clearly on the rather low side. The file size you mentioned is not too large at all, you may also be suffering from the scratch disk performance. The more the number of levels you have the slower the save would be, that's the nature of the beast.
Comment: With large files, I've found the scratch disk size makes a considerable difference.  What setting are you using for it?


Multiple emails and attachments, reusing memory stream

Question: I am generating a pdf form based on user input from an MVC website form. The pdf is genrated using the Foxit .NET SDK, then attached to three separate emails, generated using Postal. It has been requested that the file not be saved to disk at any stage.
I have not worked a lot with files or MemoryStreams before so would just like to know if my code is following the standard practices for managing memory and performance etc.
MergeDocument document = new MergeDocument(); // The PDF File Object
// ... Populate and create the pdf file

// Generate and Send the emails
// To the user
dynamic useremail = new Email("FormSubmitted");
useremail.To = User.EmailAddress;
useremail.Attach(new Attachment(new MemoryStream(document.Draw()), "OrderForm.pdf"));
useremail.Send();

// To the Vendor
dynamic vendoremail = new Email("FormSubmittedVendor");
vendoremail.To = Vendor.EmailAddress;
vendoremail.Attach(new Attachment(new MemoryStream(document.Draw()), "OrderForm.pdf"));
vendoremail.Send();

// To us
dynamic internalemail = new Email("FormSumbittedUs"); // To: is hardcoded in view.
internalemail.Attach(new Attachment(new MemoryStream(document.Draw()), "OrderForm.pdf"));
internalemail.Send();

Is it ok to create new MemoryStream objects for each email?
Answer: Basically it is ok, to create a new MemoryStream 3 times, but I have to ask, why you don't create one Attachment adding it to each of the emails like so
var attachment = new Attachment(new MemoryStream(document.Draw()), "OrderForm.pdf");
useremail.Attach(attachment);
vendoremail.Attach(attachment);
internalemail.Attach(attachment);

Comment: @jake you just have to rewind the stream
Comment: Thanks. I did try that initially but received a `One of the streams has already been used and can't be reset to the origin.` exception


Does sniper's eye allow sneak attack damage with splash damage?

Question: Can an alchemist/rogue with the rogue talent sniper's eye deal sneak attack damage with his bomb's splash damage?
Comment: You're welcome. Just cutting to the chase. And a heads-up: Don't worry about a downvote or two just because "[s]plash weapons cannot deal precision-based damage" ([here](http://www.d20pfsrd.com/gamemastering/combat/#TOC-Throw-Splash-Weapon)); I think this is a *great* specific *versus* general question considering the *very* specific language of sniper's eye!
Comment: I know there is the Archtype: Undergound Chemist: which allows at level 4 to get that ability but our DM did not allow archtypes to come into play until after a key point in the campaign and only when we have to make a new character  --- [http://www.d20pfsrd.com/classes/core-classes/rogue/archetypes/paizo---rogue-archetypes/underground-chemist/ ] link for Underground Chemist
Answer: No, splash weapons are explicitly denied precision damage.

Splash weapons cannot deal precision-based damage (such as sneak attack).

The rogue talent Sniper's Eye only removes the prohibition against precision damage if the target benefits from concealment. It doesn't change the way that splash weapons work or affect anything other than the bolded parts below. It certainly does not allow carte blanche sneak attack with all ranged weapons.

Sneak Attack: ... The rogue must be able to see the target well enough to pick out a vital spot and must be able to reach such a spot. A rogue cannot sneak attack while striking a creature with concealment.
Sniper's Eye (Ex): A rogue with this talent can apply her sneak attack damage on ranged attacks targeting foes within 30 feet that benefit from concealment. Foes with total concealment are still immune.

There is a rogue archetype, Underground Chemist, which does explicitly allow precision damage with splash weapons, but only under certain narrow circumstances. It doesn't allow precision damage on top of the weapon's splash damage, however, only to the primary target and only on the first attack per round. If you threw two bombs in a round, and missed with the first but hit with the second, you would deal only the base bomb damage.

Precise Splash Weapons (Ex): At 4th level, an underground chemist can deal sneak attack damage with splash weapons. The attack must be her first attack in that round, must qualify to be a sneak attack (such as an attack against a flat-footed target), and must be directed at a creature rather than a square. This ability replaces the rogue talent gained at 4th level.


is an accordion the best way to display payment method selection on mobile

Question: Working on checkout of a mobile e-commerce app. what would be the best way to display options for payment method? right now the it seems accordion might be a good choice. the content within each block hugely varies (e.g. cash on delivery might just be one sentence while for credit card it would be a form) and how and where would the summary of the selection be displayed. outside the accordion or an the head of the that particular accordion block. overall it seems like a lot of details and content needs to be simplified but visible at the same time within a limited space. any other suggestions than an accordion (already considered tabs but there's too many payment options to show horizontally)
Comment: One alternative is dropdown, which simplifies the UI but limits the visibility of all the options on default.
Answer: I'm not a big fan of multiple choices once the user selected the desired one, so once the user "made his mind", I try to reduce friction as much as possible by "killing" any other non-needed choice.
In this particular case, what I would do  is to use a multi step process: first, user selects the desired payment option. Then, user is directed to a page where he/she will see the process for that option and NOTHING ELSE. Thus, I can make a better use of space, there's no "noise" and no accidental touching of the other options. Keep in mind that this approach also requires an easier to manage process in case the payment process fails: simply add another window with a simple message:

Payment has failed #
retry / use another method

Now imagine what would happen if I do the whole process inside an accordion window, my method fails and then I have to use another accordion panel
So, IMHO, the "accordion approach" is not a good method for payment process because you have different screens, hence content is dynamic (causing the problems I mention above), while acordions are meant to be used with static content.
Here you have some info on when and whether to use accordions:

http://ui-patterns.com/patterns/AccordionMenu
https://developer.yahoo.com/ypatterns/navigation/accordion.html
http://www.nngroup.com/articles/accordions-complex-content/ (this one has a mobile section close to the bottom of the article)

As you may see, while there's no mention of NOT to use it in payment processing, you'll notice it is mentioned as one of the situations to use them. Furthermore, there's not mention of using them with ANY dynamic content at all, only static
And finally, something that might be of direct interest for you: http://baymard.com/blog/accordion-and-tab-design (scroll to Better Alternatives)

If the content isn't mutually exclusive, consider simply listing all
  of the fields on the page or splitting them out across multiple form
  steps. Our research shows that good checkout usability isn't about the
  number steps but rather how user-friendly those steps are. Whether you
  have a 2 or 4 checkout steps doesn't matter that much, what matters is
  what users have to do at each step, and how they are asked to do it
  (i.e. are users able to seamlessly progress through the steps).
Answer: I think it's a great solution. The shortcoming you have to watch out for is the fact that alternative payment methods can become clutter once the user has selected their preferred method. You can counteract this by A) making sure only one payment method can be open at a time, B) fading payment methods other than the one currently selected, and c) including a CTA (next/confirm) within the accordion section rather than making the user scroll past the other payment methods in order to complete their transaction.


What is the proper substitute for "Batmanning"?

Question: After planking, owling and leisure dive, now there is the trend which is called "Batmanning". Obviously it is a made-up word. Is there a proper substitute for it? What is the verb that defines the act when a bat hangs from somewhere?
Comment: Doesn't your question answer itself? The verb when a bat hangs somewhere is "hang". Or are you looking for a one-word synonym for the verb phrase "hang upside-down"?
Comment: Yes, I saw the tag, but since "hang" is already a single word...
Comment: (Bah! Batman does *not* hang upside-down like that.)
Comment: @Peter: The latter. That's why I tagged my question as _single-word-requests_.
Comment: @Peter: I thought there would be a verb to distinguish _upside down_ from _upright_...
Answer: "Planking" is just as incorrect as "Batmanning" other than the spellchecker is okay with it for unrelated reasons. If the masses of the internet feel like coining a term that compares 'hanging like a bat' to 'planking' then so be it. The same goes for "owling".
Assuming you meant a word that just means, "hanging upside down":

roost
perch
hang
suspend
dangle

There isn't usually a way to distinguish "upside down" from "upright" positions with these but context generally helps:

He hung from the rafters.
Comment: If the masses of the internet feel like using "than" when they mean "then," _then_ so be it. :)
Comment: Yeah, I still haven't been able to figure out an easy way to remember which is which. :P
Answer: Teenage trends are all about being different from the oldies, and I am sure the 'Batmanners' would be mortified to find that there already was a word for the activity they have invented.  That said, I think they are fairly safe in assuming "hanging upside down like a bat while somebody takes a picture of you" is not popular enough to have a single-word synonym.
Answer: Well, the boots they use with hooks to keep you hanging on a bar like that are called "inversion boots". They were popular back in the 80's after Richard Gere used them in a movie (don't tell the kids this).
If you want a technical term for the act of using inversion boots, it would be inversion.
Answer: You might describe it as resupinate. Although resupination means to appear upside-down, I think in a human context, the hanging part would be implied.


Lens adapter AE1

Question: My wife has multiple lenses from her old Canon Ae1 film camera with a doubler, I would like to upgrade her to a Canon rebel T5.
Is there an adapter available to make use of her old lenses ? If so , where would I purchase one ?
Answer: Before I say anything else let me just say that the choice of a camera is quite a personal one, as handling is very important.  It is probably best that you let your wife make a choice on the camera she likes.
For technical reasons adapters from Canon FD ( the AE1 mount ) to the Canon EOS mount are practically non-existent, although eBay may help.
Canon did make an adapter years ago, but it's quite rare.  There are versions on eBay.  However I think this is a mistake.  If you go the DSLR route I would suggest that modern DSLR lenses ( some of which are cheap enough ) are optically quite good and better matches to the system.
However it is relatively common to mount Canon FD lenses on mirrorless interchangeable lens cameras ( or MILC for short ).  Examples of MILCs that would be suitable are :

Sony E-mount and FE-mount systems like the A6000 and A7
Fuji X-mount series, like the X-E1 and X-E2

The Sony E-mount system would have the most adapter for it, I think.  I have a Sony E_mount system myself.
MILC systems either use an electronic viewfinder ( typically a good one ) or have no viewfinder at all.
Many, but not all, MILCs have a feature called focus peaking.  This is a terrific aid to manual focusing.  This is quite important because modern DSLRs do not have split focus screens, which were the way you would get a good focus with a manual film camera.  With MILCs you can often get both focus peaking and a magnified view in the screen.
Controls on MILCs normally come as something of a shock to people used to film cameras, but they are, I assure you, quite capable of adapting to.  I personally come from an SLR then DSLR background and found it relatively painless to get used to my Sony NEX F3, and the A6000 is something of an improvement on the F3 in terms of customization and controls.
When using manual lenses on a MILC you would typically set the aperture on the lens, and the camera can adjust exposure automatically using it's internal metering system.  In many ways this is something of the best of both worlds and I woudl have my old Pentax lenses on my own Sony NEX F3 more often than not.
One last point.  The sensor on some MILCs is smaller than standard film frame.  This creates what is known as a crop factor effect.  It means than an lens with e.g. a focal length of 50mm will give a field of view on a crop frame system like a 75mm lens ( 1.5x crop factor ).  This is why kit lenses for crop frame DSLRs and MILCs have kit lenses starting at 18mm ( 1.5x 18mm is about 27mm or about the same as the wide focal length on old film camera kit lenses ! ).  So this all means that using an old lens from a film camera on many MILCs will not get you the expected field of view.
But there is a fix for that.  They're called focal reducer adapters.  These neat bits of optics project the full frame down onto the crop frame sensor, almost restoring the full frame view.
In addition focal reducers also give you as much as a stop more light than the lenses rating ( but not for very wide apertures ).  So an f4 lens will act like an F2.8 lens, but an f1.4 lens will be about the same.  It's still very useful.
All these adapters can be found on e-Bay quite cheaply.
So the kind of system I would suggest you consider if you really want to utilize old FD lenses would be :

Sony A6000 ( nice EVF built in )
A focal reducer adapter for the NEX ( like this one ).

Note that the "plain" adapters give you the crop factor effect I mentioned, but are really cheap and it's actually easy to buy both types ( the focal reducer is the expensive one ).
Now there are many alternative, so don't think this is an absolute recommendation, but a simple suggestion.

Lens adapter AE1


crash after reading textfile to tableview

Question: I would like to read a textfile from NSBundle which I have saved before in Xcode to an Array, to fill the data into a UITableView.
I have a textfile with information like this "this;is;a;test" named cart.txt
Now I tried the following code, and I can fill it into an array, but if I trie to set the rows of my tableview to the array count, the whole app crashes.
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"cart" ofType:@"txt"];
if (filePath) {
    NSString *textFromFile = [[NSString alloc]initWithContentsOfFile:filePath];
    lines = [textFromFile componentsSeparatedByString:@";"];
}

I can read the lines array like textfield.text = [lines objectAtIndes:0]; to a textfield. everything works.
But If I trie to get my data in a tableview, or even set the rows count to [lines count] the app crashes.
can someone help me with that problem?
I hope so :-(
Thank you in advance.
Comment: What is the exact error on crash?  Show the stack trace.
Answer: I guess it crashes because "lines" array is already released when you send "count" message to it. Try lines = [[textFromFile componentsSeparatedByString:@";"] retain]; and release "lines" in view controllers dealloc method


How do speed up ubuntu 12.0.4 on virtualbox 5.1.2 by getting a lighter DE?

Question: hope you can help me.
I've been setting up for flask development in Ubuntu on a VM on Windows Vista (old, but outside the VM works fine). I've tried most the Ram tweaks for the VM platform (Virtualbox).
The terminal commands/downloads work at good speed but navigation and folder browsing etc is quite slow.
I've been looking to speed it up and there are many tweaks available online but 1 not sure if they'll result in much performance improvement 2 they are all quite time-consuming to implement.
What I'm looking for is a bare bones, no-nice effects version of the OS purely for dev work. Even and old Dos style setup would be fine, with no packages/programs not relevant to dev work.

q1 Would I lose all my work (packages installation (pip, node, flask,
npm, venvwrapper, bootstrap, my app itself) if I switch?
q2 Will the
switch result in faster performance but not exclude/hider dev work?
q3 If I do switch, how long would it take and which should I go for,
I'm new to the platform so excuse my lack of knowledge:
A- No desktop https://askubuntu.com/a/413879
B- (Seems like right option) Lubuntu with XDE/ just install LXDE as mentioned here https://askubuntu.com/a/367369/578534. The only reasons I'm asking a new question is that I'm unsure of what will happen to my old changes/updates in this event
C- Continue with ubuntu and keep using the tweaks (such as disabling 3D      effects, changing RAM allocating/swap rate)

My priority is time and I would rather not spend hours installing/downloading/modifying. Also keeping the changes/installs I have made to Ubuntu would be semi-necessary (depending how much performance improvements the new setup would offer). Current version is tolerable so might just continue with that.
Help is much appreciated, I'm new to the platform and have heard the community is very helpful so thought I'd ask for assistance.
Many thanks
edit: LXDE seems like a simple install that would give immediate benefits. Also no desktop would seems like a quick effective fix. Trying to keep out of the weeds of complicated/time-consuming changes! Hoping for a quick fix (unsurprisingly).
Answer: I have installed xfce4 alongside Unity and do not have any problems. All software works in both desktop environments (running steam games for example).
sudo apt-get install xfce4

Switching between unity and xfce4 is done on login screen.
Only problem I had there was no unity notifications after xfce4 install so I had to uninstall xfce4-notifyd package
sudo apt-get remove xfce4-notifyd


What would would be the best controller for a custom gateway page for a community?

Question: I am trying to write a custom VForce page for a Community landing page so after users login they can see the main sections of the Community and click on the links and then go to the page layouts view. Is this possible and what kind of controller would I need and would it be custom or standard? I would guess custom.
Answer: Please refer to this post Customize communities login page which I think will provide you with the instructions and code that I believe you're looking for.
Depending on whether or not you plan to use SSO, you may also want to refer to the following links as well: How to create a custom login page in salesforce.com, Using frontdoor.jsp to login to Salesforce UI and Communities and the following Help page.
Answer: If you're looking to implement your own custom Communities homepage in Visualforce and the page requires a logic layer in apex, you would need a custom controller. If you don't require apex at all, you don't need a controller at all.
Comment: I read his question entirely different than you did. I didn't pick up on him asking about a custom community home page. Will be interesting to read any clarification on the question.


Call to a member function find() on a non-object error in unix only

Question: I'm using cakephp 2.0 and Wamp and it's all good. However, production server is unix Ubuntu. Both computers access the same mysql data.
I have these relations:
Model setup.php
var $belongsTo = array('Client', 'User');

Model client.php
var $hasMany = array('Setup');

Model user.php
var $hasMany = array('Setup');

Everything works great in localhost WAMP, but the production server is unix ubunto, to which I copy the whole directory. After chmod 777 everything, the app works fine except these errors:

Notice (8): Undefined index: Client [APP/View/Setups/index.ctp, line 38]

index.php line 38
<?php echo $this->Html->link($setup['Client']['name'], array('controller' =>
'clients', 'action' => 'view', $setup['Setup']['client_id'])); ?>

Notice (8): Undefined index: User [APP/View/Setups/view.ctp, line 66]

view.php    line 66
<?php echo $this->Html->link($setup['User']['name'], array('controller' => 'users',
'action' => 'view', $setup['User']['id'])); ?>`

Also, upon http://mailsender.asc/setups/add

Fatal error: Call to a member function find() on a non-object in
  /disk/www/mailsender/app/Controller/SetupsController.php on line 69

SetupsController.php (line 69 is the "find" on add function)
public function add() {
// The relations belongs, has many etc.
$users = $this->Setup->User->find('list');

(IT suggested /cake upgrade all for fix, and it seemed to fix the above but broke other things, such as logout and login).
Can Anyone help?
I was wondering also if are there any steps I should take upon moving my whole app from windows local machine to unix ubuntu.
Thank you in advance !
Best regrds.
Carlos
from Tijuana, México.
unix version:
Linux genesi 3.0.0-12-generic-pae #20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011 i686 i686 i386 GNU/Linux
php version:
Localhost: Version 5.3.0
genesi (production server) : Version 5.3.6-13ubuntu3.6
Answer: users.php should be user.php (singular)
Comment: user.php ok. The model es user.php. That was only a typo in my Question.  --- ! ----


Pressure canner processing time cut short

Question: Pressure canning dried pinto beans, 7 quarts for 90 minutes. My range top malfunctioned and the 90-minute timer still had 9 minutes to go. After cool down period, all jars sealed. Will it be safe or do I need to pitch it?
Comment: I'm not a canner, but my understanding is that there's a safety margin built into the times, so as you got 90% of the way there, and the jars sealed, you're probably okay.  If you want to be especially careful, let them cool down, refrigerate them, and use them soon.  It shouldn't require disposing of
Answer: The functioning of the stove (and heat input) matters less than the pressure and temperature maintained in your canner during those 9 minutes.
If your dial/weight jiggler indicated that it was at correct pressure for your altitude during those 9 minutes, then the 240F steam temperature needed for canning was properly maintained, the beans are safe and properly processed.
The full lethality time at pressure and cooling down is needed to guarantee safety for the products based on the researched and validated product processing tables - for those unfamiliar, refer to USDA's Complete Guide to Home Canning (chapter 4, p. 4-5 for dried beans).
If there was any doubt regarding processing time, as @Joe said there is a safety margin built in to the processing schedules for home use, but safety as validated isn't guaranteed. It's easy enough to fix within 24 hours with reprocessing, there's no need to discard - refer to this answer for more: My jars sealed, cold packed raw chicken quarts, but canner ran dry towards the end. Can I reprocess within 24 hrs when my new canner arrives?
With reprocessing you'll end up with perfectly safe but mushy beans though, so you may want to reprocess with added ingredients as baked beans.


Cannot add partitions when installing Ubuntu 16.04

Question: When I am installing Ubuntu 16.04 as a dual boot alongside Windows 7 I cannot add partitions. Maybe there are too many disks.

Disk Management Windows 7
Answer: Have you tried shrinking your C or D drives?
To do this:

Right-click the drive you want to shrink
Choose Shrink
Set the amount to how big you want your new partition to be

Once you've shrunk it, right-click on the black "Unallocated" area and press Create simple volume.
Alternatively the Ubuntu installer (if booted from CD or USB) should offer you the option to install Ubuntu alongside Windows and you can set how much space you'd like to allocate to each from there.


importing tweets to csv file using Python

Question: I would like to import tweets and date posted from specific person's Twitter account into a CSV file using Python. I get all data but date goes to underneath (next row) of twitter post instead of next column. I want twitter post in first column and date posted in next column. Could you please help. Thanks
Answer: You are trying to write your own csv reader and writer.
Have you tried just using python's built-in module?
https://docs.python.org/3.6/library/csv.html
<code>import csv
with open('eggs.csv', 'w', newline='') as csvfile:
    spamwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
    spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
    spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
</code>


Magento2 blank Checkout Page with JS errors

Question: Since a few months the Checkout Page show blank except of the logo. In the Browser console there are several JS errors. There are a few threads about this error but nothing helped. I did try fixing it by static-content:deploy and other command, but nothing really works as a solution.
Answer: I already found the solution and posted it on this question:
After upgrade to Magento 2.3 - js error in arrays.js in cart and checkout
Hope it might be useful for some people.


Missing modifier and scene selection windows (Sorry, I'm a newbie)

Question: I'm just starting out with blender and currently doing the "Donut" tutorial. It was recommended since it encompasses many aspects of modeling and is great for beginners. In this tutorial @5:49, he gets into showing how to split the screen. Well I messed up at some point and had windows everywhere. I fixed it, but in the process accidently pushed out my modifier and scene selection windows. I've tried looking online and saw someone with somewhat of a similar problem where the solution was to press F9 but unfortunately it does nothing. Any suggestions?
Answer: The quickest way is probably to save your blend file to the desktop or somewhere convenient with the layout as it is. Then close Blender and restart it. That will give you the default layout.
Then go to File > Open to bring up the file selector window. Press N or click the gearwheel icon indicated below to show the selector properties panel, uncheck the LoadUI checkbox then select your file and click Open. That will open your file with the default layout preserved.
Comment: Wow! Thank you so much! That worked! You've made my day kind stranger.
Comment: @Lightfoot Glad to hear it. Please click on the check mark beside my answer to accept it. Thanks.


Can I write an article in a reputable CS journal not with results but conjecture?

Question: I work in industry and some interesting idea has struck me. This is a conjecture which will take a year or two of full time research work to confirm it although it looks very realistic. Unfortunately I cannot apply for post doctorate or a grant due to my work commitments but I would be glad to publish an article if a reputable CS journals would be interested. This may solve very hard practical problem but surprisingly it is difficult to monetize so I cannot do it in industry.
Comment: Or write a position paper and submit this to a workshop.
Comment: vague! meta! try writing it up on a blog 1st and getting feedback there, or just asking the question on stackexchange in the form "will this work?"
Comment: [Reposting a comment that got lost in the migration] See also this related question: [What are examples of appropriate journals to publish new mathematical conjectures?](http://academia.stackexchange.com/q/2375/546)
Comment: The only way to see if they are interested is to try. OTOH, it might be a better idea to submit this (as it isn't finished work) to a conference.
Comment: If we knew we could resolve the conjecture in a year or two, then it probably wouldn't be research.  More likely is that you can't and won't know whether it's possible to resolve the conjecture in a year or two until you try, so you shouldn't assume it can necessarily be proven/refuted in "a year or two of full time research work".
Answer: You can certainly publish an article based on a conjecture.  (One famous case is Subhash Khot's 2002 paper introducing the Unique Games Conjecture.)  On the other hand, you need to include some supporting information in the paper.  Why is your conjecture plausible?  Can you supply examples or applications?  What are its implications or connections with related work?  Answering these questions may be much easier than resolving the conjecture, but they can still require some serious work.
You're most likely to be able to publish the conjecture if there's no straightforward way to resolve it.  If it's clear in principle what you should try, and the only issue is that you don't have time to try it, then you're more likely to meet resistance (it may still be possible, depending on the publication venue, but this would probably rule out many of the more prestigious conferences).


What does "LF runes" mean?

Question: I have read the term "LF runes". What does it mean?
Answer: "LF" usually means "looking for".  It sounds like that person is looking for runes and has 9 keys of destruction to trade.
I've seen "LFG" also used in games, which means  "looking for group", usually used when someone is looking to party up for some sort of activity.
Comment: The answer is spot on, but I also wanted to mention that you may also sometimes see ISO (in search of) used in a similar way, too.
Comment: For completeness: LFT (looking for trades) and WTB/WTS/WTT (want to buy/sell/trade)
Comment: And for even more completeness. You'll often see:
WTB Wisp O Ist
This means they want to buy the Wisp unique ring and are offering an Ist rune in trade.

What does "LF runes" mean?


Can we delete Android system WebView app to free up space?

Question: I am looking to free up some space on my android device.
Answer:
you cannot delete it without root as it is a system app.
even if you could delete it, it wouldn't free up space for other apps. System apps reside in their own space (<code>/system</code>), which during normal operations is mounted read-only.
even ignoring the other two points: deleting Webview would cause several apps to just stop working as they depend on it for displaying content (even local one).

TL;DR: No, don't.
Comment: @Izzy You have a point: since `/data` holds both a system app's... data and its updates, deleting everything either before or after disabling it can save up some usable space. Of course, if one is open to rooting, they can trick their phone into thinking a system app has been removed, and still reap the "no Dalvik" benefit. The `Debloater` module comes to mind - *I'm not affiliated, but I do use it*.
Comment: Regarding bullet #2, deleting a system app actually frees *a bit* of space in `/data`, because the system doesn't build a Dalvik/ART cache for it anymore. Disabling it doesn't help, though.
Comment: @DeathMaskSalesman just "uninstalling" it for user0 (if there isn't another user) doesn't achieve that? I've never checked. And if you go for that: disabling *and deleting its data* helps a bit, too :)


Tooltip is missing in stack overflow logo

Question: Tooltip is missing on stack overflow logo
Comment: As a warning: people are starting to get very tired with the series of poorly-researched and poorly-asked questions you've posted lately to Meta. This is resulting in multiple flags. Because a question ban does not exist on Meta.SO, our only recourse to get you to stop will be to suspend your main account. Please don't let it come to that, and take a bit more time to research and think through these questions.
Comment: _"as per the user interface"_ - I think you accidentally a word.
Comment: How about you gather all these non-issues in a document, then suggest all those changes in ___one___ question, in a month or so? Then we don't have to vote on a daily basis...
Comment: Before you come here with yet another non-sensical suggestion..... Next time you have an idea: look at it, try to understand WHY your idea would improve the site (like for this proposal, you have no real justification as to why it should be there), then research and take the time to PROPERLY explain it.... seriously, this is getting to be a bit much by now :/.
Comment: I'm not the one to answer that. I'm telling you that your question is unclear (**was** it missing or **is** it missing?), I'm asking what the title **should** be according to you and I'm asking what you mean exactly by _"as per the user interface"_.
Comment: @CodeCaster  They mean the other images/logos on the navbar (like the notifications icon, the achievements, etc) all have tooltips so the logo should too.
Comment: :O Sorry for my poor English. I'll go to learn English then I'll come back here. Let start  **`A B C D E ........ XZYR.....PST.....`**
Comment: @RameshRajendran I'm assuming it was intentional but, that comment really hurts to read.
Comment: So was it missing, or is it? If it is, what should it be?
Comment: Actually as per the user interface we should provide title attribute if we are using any icon or image.
Comment: @CodeCaster Then why we are providing tool tip for other icons?
Comment: @CodeCaster Doesn't "as per" just mean "according to"? Or is something else unclear?
Comment: @Xufox it means "In accordance with" so yeah "according to" fits as well
Comment: @Xufox May be am a very popular person in this web site. :( :P
Comment: @Cerbrus . :p  I will try.. But I asked another question while you typing your comment. OOPS!
Answer: There is no standard that says images or anchor tags must have a title attribute.
Since none of the buttons next to that one have a title attribute, it's only consistent for that one not to have one either.


Broadcast times for new devices in ARP protocol

Question: How many broadcasts are needed in ARP protocol for one new device send to another new device to get necessary ARP table entries for lookup in one switch?
Comment: Switches do not use ARP tables, the hosts do. Switches use MAC address tables.
Answer: A simple L2 switch doesn't have an ARP table. It has a MAC address table. Once a switch accepts a frame on one of its ports it registers the source MAC address to the port the frame arrived from, so that future frames that are destined to that MAC address can be delivered to that specific port (and not flooded to all ports).
ARP is just one type of packet (could be any other type) that enables the switch to learn the information it needs.
Specifically for ARP, it's enough to have an ARP request to learn the MAC address of device 1, and an ARP reply to learn the MAC address of device 2 (assuming such device exists on the same broadcast domain).
L3 switches also have their own ARP tables for management purposes (enables you to connect to the switch via SSH) and for routing.
Comment: In total for two new devices, does that mean I will only make switches broadcast two messages to get all information in the ARP table (for the two new devices), In one switch, I mean two devices in the same Ethernet switch.
Comment: The devices should have their local ARP tables. After they have MAC address to IP address mapping they can start communicating. In this context the switch is only a means for delivering the packets on the local segment. The switch doesn't care about MAC to IP address mappings.
Answer:
How many broadcasts are needed in ARP protocol for one new device send to another new device to get necessary ARP table entries

One. The node trying to send an IP packet broadcasts an ARP request and hopefully receives a reply, learning the required MAC address for link-layer transport.

for lookup in one switch?

The ARP process above also ensures MAC table population in all involved switches.
Switches themselves don't use ARP. They just require the destination MAC that the sender learned through ARP for IPv4.
Switches only use ARP for layer-3 functions (when supported) like management over IPv4, or layer-3 switching/routing.


Default full name format in Active Directory

Question: When I create a new account in Active Directory, I enter the new user's first name and last name, and it auto-fills the full name in the form "First Last". Can I set AD to use "Last, First" instead?  The domain controller is currently Server 2003.
Answer: You'll need to edit the createDialog attribute of the displaySpecifier named CN=user-Display to alter the default format in ADUC.

Launch adsiedit.msc
Right-click the root and choose "Connect to..."
On the "Select well known Naming Context" choose "Configuration"
Expand "Configuration", on the left pane and drill down:

CN=Configuration,DC=example,DC=com
CN=DisplaySpecifiers
CN=409 (Note this is for EN-US, you need to select your domain's locale)
CN=user-Display

Open the properties of this specifier.
Change the createDialog attribute to %<sn>, %<givenName>

This is documented, in more detail, in MS support Article ID: 250455
How to change display names of Active Directory users.
Edit:  To answer, possibly, your next question, you can change the existing displayName attributes of users with the following Powershell.
The LDAP filter will select users with a populated displayName, but will exclude users if displayName contains a comma.
Get-ADUser -LDAPFilter "(&(objectCategory=person)(!displayName=*,*)(displayName=*))" |
    ForEach-Object {
        Set-ADUser $_ -DisplayName "$($_.Surname), $($_.givenName)"
    }

Comment: @JimB Changing an object in the `Configuration` partition is ***not*** a schema change, and nothing enforces the display name format - it's simple to change the display name away from the auto-generated one after or even during user creation.  This change is just a "convenience" one to prevent needing to manually edit the display name that's generated when you input the first name, last name, and initial.
Comment: This is great! It always irked me to have to change the display name format during user creation, can't wait to implement this one.
Comment: You can as @jscott provided, but make sure you have a very clear, very well thought out business reason for making a schema change like this. Many utilities and applications use the default. Generally speaking, this change isn't a breaking change (its usually a sort order or display issue), but it is painful when it occurs.
Comment: @ShaneMadden Updated to remove my misuse of terminology -- apologies.
Comment: @ShaneMadden Correct it's not a schema change (I wasn't about to write a missive on what is and isnt a schema change) however this is certainly not a "convienience" change and can break things that are not exactly up to spec (I'm looking at you Cisco Unity...) in they way they lookup and provide names


How can I fill a small hole in fiber cement siding?

Question: I've found a couple small holes in my home's fiber cement siding. What's the best way to fill them?
Answer: "If you have some small cracks and holes in your siding, you can fill them in with patching material specifically designed for this purpose, available at your local hardware store. Keep in mind that the patching will be obvious, whether or not you paint over it, so this is the best solution if the cracks and holes are in out of the way places that aren't readily noticeable. If you have really big holes and cracks, then the siding will probably have to be replaced altogether."
Source: http://www.doityourself.com/stry/how-to-repair-fiber-cement-siding#b
Comment: Since the article isn't very specific about what to use, I'll suggest Bondo. If the hole is really big, you'll need to get some kind of backer in there. If possible, screws set below the finish surface can help lock the filler in place. Note that there's a point in Bondo's curing cycle where it's like very stiff Jello and you can slice it away with a long knife. After that, it's hard to sand excess off.


keyboard not working in Ubuntu 18.04Lts

Question: Actually a few days back I switched from windows 10 to Ubuntu 18.04 LTS version. Everything was fine till today suddenly due to some power failure (loose battery) my laptop went off while working on it.
After starting laptop I was able to put the password in the login screen however after that keyboard didn't work. Things I tried:

Reinstalled xserver-xorg-input-all
Checked for slow keys in universal access> typing. It is off.
The keyboard is working fine in the grub menu.
My caps lock key has led indicator so before putting password if the light is on then it will remain on and vice versa. Which means the keyboard is freezing after login.
As Ubuntu 18.04 comes with Gnome3, I tried replacing with unity but after that situation gets even worse. The keyboard was not even working on the login screen.
Tried repairing all broken packages in Ubuntu generic recovery option.
My Ubuntu is fully updated.
No additional driver is needed to install.
Answer: Don't know the exact reason. But i tried uninstalling Gnome3 and replacing this by unity8, as mentioned earlier. After that with the help of on screen keyboard i logged in tty screen. There i again uninstalled unity and installed gd3. Also made it default. Things worked out, for me.

keyboard not working in Ubuntu 18.04Lts


Reversed S in Japanese transliteration

Question: I recently found a strange spelling of a reversed S (Ƨ) on an old Japanese matchbox label (late 19th century), in the phrase "MANUFACTURED IN ƧEIRYUKWAN". At first I thought this was just a mistake in the graphics, or perhaps the Latin alphabet was not well known. However, I later found an example where the normal and reversed S occur side by side, in "OSAKANATUƧINSIYA ƧEIZU". This does look like the artist should've noticed. This made me wonder: is this some weird old-style form of transliteration, and what could the difference between those twop forms be? I don't speak Japanese unfortunately, so I couldn't come up with any guesses.
Comment: Can you add a photo of the matchbox? Seeing the Japanese text would help...
Answer: Are you referring to this?

As far as I understand, 'reversed S' does not have any particular meaning, so I suppose this is probably a mere mistake, or maybe an intentional design element like this. Other matchbox images from Seiryukwan (for example, here) on the net do not have this "problem".
Comment: Yes. As I said, the side-by-side in the other example made me consider there might've been more to this.

Reversed S in Japanese transliteration


How to diagnose microwave oven that goes completely powerless for 3-5 minutes after each use?

Question: I have a run-of-the-mill GE microwave oven that goes completely powerless for about 3-5 minutes after each use, indiscriminately whether the use is for a single second or many minutes. While shut down, the microwave appears to be completely dead, as neither the door light, the LCD display, nor the keypad work. When the microwave reemerges from shutdown, the clock must be reset which indicates that there was a total shutdown without any persistence. How do I diagnose this issue?
Comment: If it's a 120V  microwave,  move it to another outlet on a different circuit for a quick test.
Comment: Turn off the breaker, remove the receptacle and check for loose wires and/or push in connections.  Tighten screws.  Repeat for any other receptacles/lights/switches on the same breaker.  After this if the problem remains, it might be the microwave.
Answer: Of course check to make sure there isn't a problem with the circuit supplying the microwave first.
What I suspect is actually going on here though is a problem with one of the thermal cutout switches. There's typically two of these: one for the magnetron and one for the cooking chamber. These are the only devices in the microwave that can both interrupt power to the control electronics and reset themselves. One of your thermal switches is probably false triggering.
If you're comfortable with electronics repair, you may be able to follow the electrical diagram located in the service manual or on the inside of the case to determine which switch is triggering. Since it's after only a second or two, it's quite unlikely to be an actual overtemperature situation.
If there is any chance you're not comfortable with working around high voltage, just replace the unit. Microwaves are quite capable of killing you dead once the cover is off.
Comment: `One of your thermal switches is probably false triggering.` Be aware that it might _not_ be a _false_ trigger and that something may be overheating (perhaps a loose wire is overheating) and that there may be an actual problem causing a thermal shutdown. Otherwise, +1.
Comment: I considered that, but the possibility of it triggering after a single second and then working for several minutes the next time makes me think it's quite unlikely to be a loose wire. I suspect one of the thermal limit switches actually has a bad connection internally, so it's triggering itself occasionally.
Comment: A loose wire could be wiggled by the vibrations of the microwave, especially the motor spinning the turntable. Some runs could leave the wire more firmly connected than others. Also, my microwave's turntable runs in opposite directions each time I turn it on (why, I have _no_ idea). It's possible that it stops immediately every other run based on turntable direction and the OP just hasn't noticed...
Comment: How straightforward is the process of diagnosing the thermal switches?
Comment: https://www.repairfaq.org/sam/micfaq.htm has you covered there. Make sure to read the section on safety. I quote: Microwave ovens are probably the most dangerous of consumer appliances to service. Very high voltages at potentially very high currents are present when operating - deadly combination. These dangers do not go away even when unplugged as there is an energy storage device - a high voltage capacitor - that can retain a dangerous charge for a long time.


If silver nanoparticles kill bacteria by penetrating the cell membrane, why don't they also kill human cells on contact?

Question: Apparently, the silver from the nanoparticles can penetrate the cell wall of bacteria and kill them from the inside. Why, then, doesn't the same happen to human cells, e.g. the skin on my foot when I wear nanosilver-coated antibacterial socks, or the stomach lining when people drink nanosilver-treated water? Is it because the cell wall is different in bacteria than in multicellular organisms?
Answer:
The nanoparticles from your sock will most certainly not reach to your foots cell membrane (Walls are for plants/fungi)  because of the thick layer of dead skin, oils, than about 30 cell thick cornified layer (stratum corneum) build up from practically dead cells (with no nuclei or organelles) but lots of filamentous keratine. This is the most outer shell of your epidermis followed by layers and layers of 4 other tissue types , then comes the "actual" skin dermis and the hypodermis beneath.

If some of the silver-sock -nanoparticles would actually make it through there to basal tissue and reach the cells plasmamembrane, they enter via endocytosis, and start to release Ag+ they break all kinds of things, because Ag+ is cytotoxic it induces ROS, damages you Mitochondira, disturb some pathways... you get the point.

However this was proven to happen within human in vitro celllines.

a few in vivo studies showed that Ag-NPs cause adverse effects on reproduction, malformations, and morphological deformities indifferent non-mammalian animal model.

Says "Review: A systematic review on silver nanoparticles-induced cytotoxicity: Physicochemical properties and perspectives
https://doi.org/10.1016/j.jare.2017.10.008
Comment: conclusion, definitely enough evidence to be suspicious, but don't freak out, just change socks daily, wash feet and don't drink dubious solutions or liquids. (sunscreen could be a factor )
Comment: I'm not freaking out, just wondering. :)
So, in the case of skin contact, I'm protected by a layer of dead skin, OK.
But there are disinfectant sprays with nanosilver, meant to be applied to open wounds. And disinfected water that goes to your stomach.
Is it actually killing both bacteria and your cells, but you're fine because your cells get replaced? Or what's the idea?


Blending cylinders

Question: So I'm trying to model two cylinders perpendicular to each other and I want them to blend into each other like this; but so far I haven't found a clean and reliable way to make that happen. I have tried boolean but that makes for an unclean mesh and doesn't really work. Do any of you have an idea as to what I could do? A swift answer would be well appreciated, thanks.
Answer: Its just kind of a topology thing. You have to count the verteces. Add some edge ring to the cylinder so it fit the number then delete the faces and merge the verteces.

Blending cylinders


Repeated measure ANOVA with an interaction

Question: I am conducting a one way repeated measure ANOVA where my dependent variable is measured at 3-time points, at baseline, 1 month, and at 2 months. I also have another variable measured at baseline. My primary goal is to see if there is a significant difference in the dependent variable between baseline-1month, baseline-2months, and 1month-2months. However, the literature shows that the other variable measured at baseline can influence the magnitude of dependent variable over time, as well as can make it insignificant. I don't know if controlling for is the right word, but I would like to see the interaction effect of this other variable in the 3 pairs of comparison. Any suggestion is highly appreciated! Thank you.
Comment: Your objective is not clear. Please restructure your question and I think you are looking for Anova solution. Give  a few more details about datatypeand samples size etc.
Answer: You could treat this as a mixed-effects (a.k.a., multilevel or hierarchical) model. The first "level" is measurement occasion, while the second is the individual. The independent variable at the first "level" is the time point, and the baseline moderator is at the second "level." The dependent variable is also at the first "level."
Let $Y$ be the dependent variable, $X$ be the time point, and $Z$ be the baseline moderator; $i$ denotes a measurement occasion, and $j$ denotes an individual.
Your model would be:
Level 1:
$Y = \beta_{0j} + \beta_{1j}X_{ij} + \epsilon_{ij}$
This means that your dependent variable is predicted by an intercept, the time point, and a residual. The subscript $j$ for $\beta_0$ and $\beta_1$ means that the intercept and effect of time will be different for every person. These will, in turn, be predicted by the baseline score for every person:
Level 2:
$\beta_{0j} = \gamma_{00} + \gamma_{01}Z_j + u_{0j}$
$\beta_{1j} = \gamma_{10} + \gamma_{11}Z_j + u_{1j}$
Where $\gamma_{00}$ is the average intercept, $\gamma_{10}$ is the average effect of time, $\gamma_{01}$ is the effect of the baseline moderator on the individual's intercept (this turns into the main effect of the baseline moderator), and $\gamma_{11}$ is the effect of baseline moderator on the individual's effect of time (this turns into the cross-level interaction that you're interested in).
The easiest way to run this, in my opinion, would be using the lme4 package for R. This would look something like:
your_model <- lmer(dv ~ iv * baseline_moderator + (1 + iv | id), data)
where dv would be your dependent variable, iv would be the independent variable, baseline_moderator would be the baseline moderator, id would be the identification code (as a factor vector) for each of your participants, and data would be the name of the data frame.
More information on the lme4 package can be found here: http://rpsychologist.com/r-guide-longitudinal-lme-lmer
Answer: you have 2 indep. variables:
1- variable which is between subj. factor
2- within subject variable (time)
and you evaluating these factors on the third (dependent) variable.
so you need to perform a mixed design test.
good luck


How to turn off facebook synchronisation?

Question: It seems like I made a mistake connecting my game to my facebook account. I don't feel a big need to have a backup all the time. So, there is a switch in the options, which, I suppose, allows you to stop this automatic synchronisation. But even though it is always on "off" in my TDS, it continues doing backups. How do I stop this? Will the "choose a backup" disappear after disable automatic backups?
Comment: I don't personally need this but I'm sure a bunch of people would appreciate some help... I know that you can usually log into FB and un-attach the game that way but I tried with mine and, either mine's not attached because the iOS version doesn't work properly (known bug), or it's not possible from that end.  Anyone with Android able to check?
Answer: Here's what I would try - give it a shot.  Keep in mind it's possible doing this could destroy your game data completely, but I doubt it.

Log into Facebook.
Click the Settings gear in the top right.
Click the Apps category on the left, in the last section.
Select the game.
Click Remove App and remove the app.