Asian English Varieties

Question: Why might one regard "Japanese English" "Korean English" and "China English" as varieties rather than interlanguages? What are the educational implications?
Comment: Never heard of this terminology... What is meant by "Japanese English"? English spoken by a non-fluent Japanese? An English that speaks some anglicized Japanese?
Comment: I'm afraid I fail to see why Japanese/Chinese etc. English could be seen as varieties rather than interlanguages. 1. There are no native speakers of these interlanguages (?), unlike in India or Singapore. 2. They are too localised and not used as a lingua franca.
Comment: _Interlanguage_ is a fluid term; it was intended to be. It's essentially personal. _Variety_, on the other hand, implies a speech community with some cohesion and tradition, so that's social, not personal. As Alex B. has pointed out, the existence and nature of the speech community is what has to be demonstrated, and vague terms like "Japanese English" or _Chinglish_ don't do that. Social phenomena require more evidence than slogans provide.
Comment: Have you at least read this? http://en.wikipedia.org/wiki/Engrish
Comment: You might be interested in certain educational movements and their implications in Asian countries where English is spoken, such as SGEM - Official: http://www.goodenglish.org.sg/ and Wikipedia:http://en.wikipedia.org/wiki/Speak_Good_English_Movement
Comment: Is this like the Speak More Mandarin Movement? It was a big deal in Singapore early on.
Comment: Thank you everyone for your comments! Will dig in more in this question and hopefully come up with a good answer.
Comment: @AntonMarra That'd be nice. :)
Comment: I'm not sure about those but there are certainly India, Singaporean, and Malaysian varieties of English.
Answer: Is the term Japanese English used by anybody?
Several comments to this question indicated doubts that terms such as Japanese English are appropriate or used by anybody. In fact, in research on English as a Lingua Franca (ELF) (and on postcolonial varieties of English) such terms are used frequently. A quick search on Google scholar turns up several instances, such as studies on intonation, language contact and bilingual families.
Educational implications
Sometimes terms such as Japanese English are used as synonyms of English as spoken by learners whose first language is Japanese. Then their use has no educational implications.
Other researchers might consciously opt for Japanese English etc. to underscore their commitment to teaching English as a second/foreign language without positing native speaker norms as a realistic goal or even ideal that learners should strive for. Instead, they should aim for international intelligibility, such as Jennifer Jenkins' Lingua Franca Core.
This philosophy is based on the recognition that

the number of native speakers of English is far outstripped by the number of speakers of English as a second or foreign language (ESL/EFL)
most ESL/EFL speakers interact more with other ESL/EFL speakers than with native speakers, and many ESL speakers hardly ever interact with native speakers of English

Consequently, native speaker norms are argued to be relatively unimportant to their needs. What should be the aim is teaching a variety of English that is internationally intelligible.
Are there native speakers of Japanese English?
Alex B. argued in the comments to the OP that Japanese English is not an appropriate term because there are no native speakers of this variety of English. However, there are also very few native speakers of Indian English, the vast majority of speakers of Indian English acquire it when entering school or later, and yet the term is relatively accepted.
Research into postcolonial varieties of English has largely come to the conclusion that the existence of native speakers is irrelevant to the emergence of a separate variety of English. What is important is a community of speakers, (relatively) separated from other communities, that transmits their variety to future generations. There is a large body of research providing evidence for these claims, and Schneider's Postcolonial English is probably the most important theoretical contribution to the debate.
P.S.: Who is a native speaker, anyway?
Actually, the concept of the native speaker is hard to apply to multilingual societies such as India and Nigeria where English is widely used as a second language. When people acquire two languages from birth, and a third language in school, and finally end up being more proficient in many areas in the third language (chronologically speaking), what is their native language?
The concept of the native speaker is based on the 18th/19th/20th c. Western idea that one nation has one language. This works pretty well for most people in most Western countries (minus recent immigrants), but it didn't in Renaissance, medieval or earlier Europe, where educated people or traders from any country were supposed to be proficient in several languages - Latin, French, Italian, a local dialect, a local standard language.

Asian English Varieties


CyanogenMod 13 fall down to 2G when data connection is OFF

Question: I'm new to Android 6 and I'm coming straight from 4.2.
As my region is with lower celluar network coverage, I'm experiencing problems with my network coverage. Now, the problem is that my Galaxy Note 3 is loosing 3G signal, because the 2G is more common here and 3G is avail only in the city. I can't select "3G (preffered)", like I was able to do in Android 4.2, then when I turn on the Data Connection, the phone will switch to 3G, when I turn it off, it'll go to 2G. I can't do that on Android 6.0, and the phone is in HSDPA all the time.
Comment: Settings, sim, select your sim settings and preferred network here.
Comment: No, there are 3 options there. 4G (preffered), 3G, 2G. If I set 2G, then it won't go to 3G when data conn is turned on, instead it'll stay on EDGE. Very annoying...
Comment: You could create different profiles  to change from 2G to 3G and switch in quick toggles.
Comment: That's an idea, but apparently Android 6 has less options than 4.2/4.4 in that direction. So it can't do that autonomously?
Comment: Other suggestions? The worst thing is that it won't go to 2G when 3G signal is lost, and I'm 100% sure that there is 2G coverage in that area..
Answer: I am using cyanogenmod in my Xiaomi Redmi 1s, I used to do this steps :

Open dialer, and type *#*#4636#*#*.(I think this setting code may vary with each device manufacturer, search appropriate code for your device)
It will enter into Testing mode.
Inside that, tap on Phone Information, look for Set preferred network type, and set it as WCDMA only.

This Setting will be lost after every reboot.


Can I automatically email the row contents I enter in Google Sheets?

Question: I have a Google Spreadsheet where I enter a row of data with any changes to my office schedule for the day.  Is there a way to automatically email this row of data (not a link to the spreadsheet, but the actual row of data) to another person(s)?
Answer: You cannot send emails from the Google Sheet when an edit is made because the the onEdit trigger cannot call the MailApp service.
You can however save the edit in a queue through PropertyService and then use a time-based trigger to flush the queue and send the content via email.
Answer: Follow these instructions to create a mail script: https://developers.google.com/apps-script/articles/sending_emails
Then within the script area click resources up the top and set the script to trigger On Change. Note that I think that will send emails you every time you change the doc, which you probably don't want. You could simply do it without triggers and manually run the script which isn't too much hassle.
If you want to send to the same person(s) each time hardcode the sender in the script. I imagine to send to multiple email addresses they are comma separated.
(Tangent: My company recently switched from using a massive Google Spreadsheet to https://www.floatschedule.com/ for managing employee schedules. If you're managing multiple employees (or your employer is) that might be easier for you/them. I also discovered I could hook my float schedule up to Google Calendar through ical, so I now have my daily work schedule as a calendar widget on my phone... Not affiliated with float, just find it a better workflow then clunky sheets.)


difference between further and far

Question: Can you explain me what's difference between further and far?
I was searching for an answer but I only I only have found farther vs further.
Comment: I can't cite [ran lower to the ground vs ran low to the ground](https://ell.stackexchange.com/questions/232180/) as the duplicate here, because it has no upvotes. But this is essentially the same issue - ***further*** is "comparative" (so there's probably some contextually relevant distance that's ***not so far***), whereas ***far*** is a simple adjective (the distance being referred to is ***a long way [off]***, regardless of whether anything else is closer or more distant).
Answer: 'Far' is an adjective meaning 'at a great distance'; farther and further are comparative forms of 'far', meaning 'at a greater distance'. American English prefers farther for physical distances, and further when talking about figurative distances: New York is farther from me than London; for some time I have been reducing the amount of meat that I eat, but now I have gone further and stopped altogether. Farther is rare in British English, where further is used for both meanings.
Answer: Let's compare the words by considering uses of the word "further" in its entry at Merriam-Webster. Which of these could be replaced by "far"?
Adverb senses

1: FARTHER sense 1: My ponies are tired, and I have further to go.
2: to a greater degree or extent: We were further annoyed by a second
  intrusion.
3: in addition : MOREOVER: Further, there are aurochs, red deer, wild
  boar, and large quantities of hare or rabbit.

Sense 1 would allow the word "far" with almost the same meaning. The difference would be that the word "further" suggests the idea that the speaker has already traveled, and must travel still more. A speaker who had not already traveled might say that he had far to go, but not that he had further to go.
Senses 2 and 3 would not allow the substitution of the word "far."
Adjective senses

1: FARTHER sense 1: We rode farther across the valley and up the
  further slopes.
2: going or extending beyond : ADDITIONAL: further volumes, further
  education

Again, the idea of literal distance in sense 1 would allow the word "far" instead, with the same distinction as before.
But we would not replace "further" in sense 2 with "far," and say "far volumes" to mean "still more volumes."
Verb senses

furthered; furthering\ ˈfərt͟h-riŋ  , ˈfər-t͟hə- \ Definition of
  further (Entry 3 of 3) transitive verb
: to help forward : PROMOTE Other Words from further

None of these verb senses could be captured in the word "far."

difference between further and far


Craft Commerce Cart

Question: Whenever a customer puts items into their cart and logs out their email disappears until they log back in. Is there a way to view the email and info in commerce of the person when they log out?
Answer: You mean on the front end?   User data is cleared when a person logs out....that would be the expected behaviour surely?  And for privacy reasons, the info for that customer should not be available until they log back in (think about e.g. use of a shared computer).
I think I must be misunderstanding the question, but as I understand it, the answer is no, and the behaviour of the data being clear is expected (and correct).
(Note the cart itself is not cleared on log out with Commerce as it is with most other systems.  Took me a little while to get used to that but it doesn't really seem to cause issues...it would be quite easy to write plugin that clears the cart on logout if you would prefer that).
Comment: Well again that really would be by design - the user has explicitly requested they log out of the site, so it clears the data.  Again, you could write something that listens to logout and restores just the email, or you could store the email in your db table for later matching against the carts, but given the potential security issues (by keeping the email around, you're keeping one half of the login details available) - but users might not like it if they are then e.g. emailed...
Comment: No not the front end but the back end on the commerce plugin where it shows the active cart. When a user logs out their email disappears from their shopping cart so my client doesnt know who's email it belongs too so they can't push it through

Craft Commerce Cart


In orbital hybridisation, what determines the number of orbitals that hybridise to be at the same energy level?

Question: For example, in phosphorus pentachloride five orbitals hybridize, but why not 6, as in the hydrated Al ion? I have read that the reason six orbitals hybridize is that a maximum of six oxygens can stably fit around it. Why is it not the same case for phosphorus?
Secondly, why does water $sp^3$ hybridize even though it has enough lone pairs in its p orbital to bond with 2 oxygens. Surely it would take more energy to pull up the lower $s$ orbital to bond than to allow the $p$'s, already elevated to that energy, to do the bonding?
Answer: The difficulty in talking about hybridization lies in the fact that it tends to confuse atomic and molecular orbitals, or (equivalently?) one- and many-electron wave functions.
Mixing atomic orbitals generally only becomes possible when we do a mathematical approach which treats more than one electron at once. That, however, is mathematically rather complex, and the resulting wave functions are molecular orbitals, which are entirely different from atomic orbitals. Molecular orbitals are constructed as combinations of atomic orbitals, which means that it is possible to e.g. add s and p wave functions together to obtain something that looks like sp hybrids. But, and this is important, there are actually many different possibly ways for such combinations, and none of them should really be considered physical reality; and furthermore, this "mixing together" has to follow very strict mathematical rules which in the end affects the entire set of molecular orbitals at once. Describing molecular orbitals in terms of hybrid orbitals (or something similar) is possible if one does it thoroughly, in terms of a full and correct mathematical treatment. Still, even when applying the concept in this way, it is somewhat arbitrary, since it represents only one of many possible solutions (and depending on the problem, not even the best one).
In the simple and qualitative terms often introduced in chemistry (especially organic chemistry), it is a very crude concept which should be regarded with great caution and especially not as something that would be some sort of reality. Hybridization is a mathematical procedure for many-electron wave functions; nothing more, nothing less.
In more technical terms: The role of one- and many-electron wave functions in atoms is crucial here. Atomic orbitals are assumed to be hydrogen-like wave functions; in the one-electron atom, the orbitals are $\ell$-degenerate, so linear combinations of wave functions for different orbitals would mathematically still be solutions to the Schrödinger equation. In many-electron atoms, the degeneracy breaks down, so combining different orbital wave functions would be invalid, since they belong to different eigenvalues. We do, however, employ a many-electron Hamiltonian such as the Fock operator in this case, and unless I am mistaken, the electron-electron interactions lift this restriction. So, by some unitary transformation of the many-electron wave function of a single atom, I guess one might arrive at something like hybrid orbitals. Then again, this does not reflect physical reality.
Answer: This is only partly an answer to your question. I think teaching hybridization in depth is a bad pedagogical choice, so I am not the right person to explain the inner workings of this theory.
Don't spend too much time try to get the details of the how's and why's of hybridization…  There are arguments over how useful it is as a concept in theoretical chemistry, and it certainly has severe limitations. For example, the picture derived from hybridization for the water molecule is simply wrong: it predicts two equivalent lone pairs on the oxygen atom, and they are not.
Just think in terms of molecular orbitals!


OS X: How can I automatically connect to a non-broadcasted wireless network

Question: Every time I open my MacBook, I am forced to go to Join Other Network, then type in the Network Name, and select the Security type. I check the box for remember this network and it remembers my username/password after I type in the name and security. There has to be a way for it to automatically connect to this network even though it isn't broadcast, right?
Answer: Your MacBook is designed to remember networks to which you connect and look for them in the future even if the SSID is not broadcasted.
To examine and clear your list of remembered networks, go to System Preferences, then Network, select your AirPort interface on the left, then click "Advanced".  You can add a network here, including security settings.  If you already see your network, try deleting it and re-adding it.
Answer: You might check your keychain or your remembered networks to see if something might be interfering with your auto-joining of a WiFi network, because what you describe that you want is exactly how it works for me.


Antivirus patch using gpo?

Question: Can i use gpo for antivirus patches or update ?
is there any way i can extend wsus to do it ?
Comment: is there any way either for symantec endpoint, or McAfee enterprise ?
Answer: You can use GPO software assignment to push out new AV software.  This is actually great way to ensure that all of your workstations are protected: if a computer is in an OU that has the antivirus policy, it will have anti-virus software installed.  (Just make sure, if you are switching AV platforms, that you don't accidentally cause more than one product to be installed concurrently on the same group of workstations.)
However, when it comes to signature updates, you don't want to use Group Policy.  Signature updates are released far too frequently for GPO assignment to be a practical option.  Instead, your AV product needs to update itself via its own management server.  Any enterprise AV product should have this functionality built in.
Based on personal experience, I recommend neither Symantec nor McAfee.  You might consider ESET or Vipre, among others, as better-performing alternatives.
Edit - related question: What is the best Antivirus for a Windows Domain Network?
Answer: Microsoft Forefront Client Security uses your existing WSUS infrastructure to issue it's updates. It's an elegant solution since you probably deliver WSUS patching and AV signatures to the same network segments, and can use this to do it all through a single server, on a single port (80 or 443).
By contrast, deploying Sophos updates requires clients to be able to report back to the central reporting server on a couple of ports, and to Central Install (CI) nodes via SMB ports. In firewall terms across more than a flat network, the rulebase to support this is a mess.
Answer: When deploying AV by Group Policy, the only way to "patch" it is to create a completely new install MSI (making sure to increase the internal version numbers a point), and then Deploying it the same way you did your first package. This will cause a full install on all appropriate machines, but they will be patched.
This is one of the limitations of the GPO software deployment system.
I know from personal experience that SEP has a habit of not incrementing version numbers for small patches.
So far, Microsoft has not extended WSUS to support non-Microsoft approved packages.

Antivirus patch using gpo?


Hiding questions with Interesting and Ignored tags?

Question: I have "Hide ignored tags" turned on in my preferences. If a question comes along with an Interesting tag and an Ignored tag, what happens to it?
Comment: The universe collapses in on itself.
Answer: If you have the hide ignored tags turned off they will display as both interesting and ignored.
If you have the hide ignored tags turned on it will hide it no matter how many interesting tags are in there as well.
Comment: You got a downvote.  Is your answer incorrect?
Comment: Nope. Likely because I posted a tad too slow.
Answer: Its hidden..
What happens is Javascript hides or fades all questions with a <code>.tagged-ignored' class, and highlights all questions with a</code>.tagged-interesting` class. When a question has both classes, they overlap.
This is also why you will notice that when you hide ignored questions, you will have less questions on the entire page. Hiding the questions is taken over by javascript, not the server, so the server doesn't know to list more questions.
Answer: Not sure if this is the right place to feedback on this, but I find the "hide"/"ignore" feature detracts from the overall high quality of the site:
Because it's done browser-side, users see the ignored questions flashing up briefly and then the list of questions collapses in on itself, leaving huge amounts of empty space at the bottom of the page, with a variable number of remaining questions shown that doesn't agree with the number the user chose to prefer. So: A waste of some bandwidth and a hit to the aesthetics and consistency.
Not that it's a big priority, but I feel that at some point the "ignore" filtering should be moved to server side.
Comment: Bring down the server or burn bandwidth, what will Jeff do to solve a browser issue: http://meta.stackexchange.com/questions/2063/large-blank-gap-between-question-list-and-pager
Comment: Chrome 5.0 was just released and finally fixes this bug.
Answer: I would love to have an option to "Hide questions with ignored tags that do not have interesting tags".  That was my initial assumption about how the ignore feature would work.


Why won't either toilet in my mobile home flush?

Question: We have two bathrooms on either side of our trailer. For some reason neither of the toilets want to flush. The back fills up with water, I flush and the water sits in the bowl and doesn't drain at all. I've plunged the hell out of it. It's been snaked. I don't know what else to do. Someone HELP!!
Comment: *"It's been snaked"* with what?  If the answer is a small toilet snake then you need to move to a roto-rooter machine.  The fact both are clogged indicates the problem is further down the line.  Hopefully it's tree-roots and debris and not a collapsed line.
Comment: Does the tank empty and doesn't go down the drain at all or just takes some time? Do any other drains have issues? How about the shower or bathroom sinks?
Comment: How cold is it where you live? The sewage line may have froze between trailer bottom and ground. I'd add a pound of salt to each toilet, stir around to dissolve, then flush when possible. -Should clear out ice.
Answer: Well I am leaving this as an answer because of limited information.if you live in a park contact the superintendent. If on your own property your pipes or tank can be plugged. More information is needed. And you may need to have your tank pumped. I have helped a firend that had a park and with floods one of the tanks floated several inches and broke the pipes the filled with mud and several homes had the exact problems you have more info is needed.


Now that NationalAtlas.Gov is retired/removed, where is the largest source of public shapefiles for the USA?

Question: I used nationalatlas.gov for many years, downloading various shapefiles regarding water, roads, boundaries, environmental factors, and more.  NationalAtlas.gov was a central public site that many GIS users in the USA relied upon regularly.  Nationalatlas.gov now forwards to nationalmap.gov , which has a map viewer but does not provide nearly the level of functionality or shear volume of downloadable shapefiles.  So, now that nationalatlas.gov is retired, where are the largest sources of public shapefiles that can be easily accessed?
Comment: @-http://lasp.colorado.edu/education/outerplanets/orbit_simulator/
Answer: I just checked my old National Atlas bookmark and was redirected not to the National Map Viewer, but to the National Map's Small Scale data page. There are 197 datasets available for download there, to my eyes it looks like it's the same data that was available at the old National Atlas page and they just moved it to the new URL. Are you not being forwarded to that site?
The main page states:

The National Map is now offering a collection of small-scale datasets
  that can be downloaded for free. Although the 1997-2014 Edition of
  the National Atlas of the United States was retired in September 2014,
  The National Map recognizes the importance of continuing to make a
  collection of the small-scale datasets, originally developed for the
  National Atlas, available to users.

It sounds like the layers that are there may not be updated going forward.
Comment: Thanks so much Dan.  I feel like a dummy not finding that link underneath that says "small-scale data download page".  Do you think I should change or remove the question?
Comment: @farrenthorpe I think it's fine to leave it, but feel free to remove it if you like. I suppose it's a bit general, there are quite a few possible correct answers.
Answer: May I suggest the Census Bureau as one of the options?
You can access ftp sites of the available shapefiles in any of three ftp sites:
ftp://ftp.census.gov/geo/
http://www2.census.gov/geo/
ftp://ftp2.census.gov/geo/
Answer: Two other US government sites I use that provide similar (and in some cases duplicate I believe) datasets as those found on the National Atlas are:

USGS Earth Explorer: http://earthexplorer.usgs.gov/
USDA Geospatial Data Gateway: http://datagateway.nrcs.usda.gov/
Answer: This site looks like it's got some unique data as well:
http://www.naturalearthdata.com/


Which function $(\hat{y} - y)^2$ or $(y - \hat{y})^2$ should I use to compute the gradient?

Question: The MSE can be defined as $(\hat{y} - y)^2$, which should be equal to $(y - \hat{y})^2$, but I think their derivative is different, so I am confused of what derivative will I use for computing my gradient. Can someone explain for me what term to use?
Answer: The derivative of $\mathcal{L_1}(y, x) = (\hat{y} - y)^2 = (f(x) - y)^2$ with respect to $\hat{y}$, where $f$ is the model and $\hat{y} = f(x)$ is the output of the model, is
\begin{align}
\frac{d}{d \hat{y}} \mathcal{L_1}
&= \frac{d}{d \hat{y}} (\hat{y} - y)^2 \\
&= 2(\hat{y} - y) \frac{d}{d \hat{y}} (\hat{y} - y) \\
&= 2(\hat{y} - y) (1) \\
&= 2(\hat{y} - y)
\end{align}
The derivative of $\mathcal{L_2}(y, x) = (y - \hat{y})^2 = (y - f(x))^2$ w.r.t $\hat{y}$ is
\begin{align}
\frac{d}{d \hat{y}} \mathcal{L_2}
&= \frac{d}{d \hat{y}} (y - \hat{y})^2 \\
&= 2(y -\hat{y}) \frac{d}{d \hat{y}} (y -\hat{y}) \\
&= 2(y - \hat{y})(-1)\\
&= -2(y - \hat{y})\\
&= 2(\hat{y} - y)
\end{align}
So, the derivatives of $\mathcal{L_1}$ and $\mathcal{L_2}$ are the same.
Answer:
The MSE can be defined as $(\hat{y} - y)^2$, which should be equivalent to $(y - \hat{y})^2$

They are not just "equivalent". It is actually the exact same function, with two different ways to write it.
$$(\hat{y} - y)^2 = (\hat{y} - y)(\hat{y} - y) = \hat{y}^2 -2\hat{y}y + y^2$$
$$(y - \hat{y})^2 = (y -\hat{y})(y - \hat{y}) = y^2 -2y\hat{y} + \hat{y}^2$$
These are exactly the same function. Not just "equivalent" or "equivalent everywhere", but actually the same function. It is therefore no surprise that any derivative is also the same - including the partial derivative with respect to $\hat{y}$ which is what you typically use to drive gradient descent.
The two ways of writing the function is because it is a square and thus has two factorisations. When you write it as a square you can choose which form to use for the inner term.

Which function [form] should I use to compute the gradient?

You can use either form, it does not matter. They represent the same function and have the same gradient.
Answer: The derivative is the same as far as I understand it.
If $y$ is constant and $\hat{y}$ is the variable the result will be:
$((\hat{y} - y)^2)' = 2(\hat{y} - y)$
and for the other formula:
$((y - \hat{y})^2)' = -2(y - \hat{y})$
which is the same.
Comment: I can see that the second equation can only be derived if you have taken the correct route for partial derivative (I commented earlier that it looked wrong - but actually I was wrong to say that).  Usually tutorials don't consider that $y$ is a "constant", but that this is a *partial* derivative, where we only care about the gradient w.r.t. $\hat{y}$. The result is much the same, but either way it may help to show a step of expansion


Can Magnus Carlsen force draw (pun-intended) himself to victory?

Question: So far Carlsen has a 2 game lead over Anand and there are only 4 games left.  At the strength of these players, can Magnus basically force his opponent into draws by playing certain openings or styles?  Can he force Anand into drawing the rest of the games to win the world championship?
Answer: It depends what you mean by "basically". He cannot actually force a draw in any given game (otherwise he would have started doing it already, as soon as he won one game). However he can play drawish lines; the variation he went into in game 8, for example, is almost never lost by White at top levels.
It's going to be difficult for Carlsen to "force" a draw if Anand plays something sharp like the Dutch or Pirc. His optimal strategy is still pretty much to just continue to play good chess.
Comment: Maybe Basically wasn't the correct word, but you answered my question.  I guess the fact that he can play drawish lines as in game 8 which is almost never lost by white as you said means that his chances of drawing go up significantly.
Answer: Well, Carlsen certainly is going to be pretty comfortable for the rest of the games as white. He can choose lines that have a high drawing percentage.
I would expect Anand to start choosing more tactical lines as white and black. So far we've seen quite a bit of king pawn games, more specifically the Ruy Lopez. I wouldn't be surprised to see Anand break out a Sicilian or two in the coming games.
Comment: Yes, I think that has been a surprise that Anand keeps going back to the Ruy Lopez when it is not working for him.


How to add programmatically all pages and children to backend menu

Question: I have a big website with tons of content, and I would like to automatically add all pages and their children to the menu in the backend, so I can then rearrange them easily via drag and drop.
I tried to use plugins such as Auto Submenu but it doesn't work, and when I am using it I cannot add any pages manually, as soon as I save they disappear from the menu again. Is there a code I could use in the database to add all pages with their children?
Answer: The helpers you'll need are wp_create_nav_menu() and wp_update_nav_menu_item().
This will allow you to create a menu and then, using a query posts loop, programmatically add every page in your site dynamically.
You can use the get_pages() helper to retrieve all pages from the DB.
<code><?php
// These are default args and don't need to be set explicitly.
// I've included them here for reference.
$args = array(
    'hierarchical' => 1,
    'post_type' => 'page',
    'post_status' => 'publish'
);

$pages = get_pages($args);

// loop goes here
// foreach or while will work, whatever you are comfortable with
?>
</code>
Comment: Thank you but that's not what I want, I want to be able use the backend interface, so I can add other links to it in a graphical way, and later non programmers can also rearrange the menu items as needed. I know there is a box called "select all" but it doesn't keep the hierarchy, and you have to do it for every page of the pagination. I would like the same, but for every page of my website while keeping the hierarchy.
Comment: Understood. The helpers mentioned in my answer will create the menu programmatically (as you requested). Once your code creates the menu and adds all of the parents and children, you'll be able to freely edit the menu using the backend interface (where you can drag/drop/modify).
Comment: oh sorry, thank you :). I'm trying to get all the pages but somehow it just show me some, what can of function should I use? I'm using this now: `function get_all_pages(){
    $args = array(
        'post_type' => 'page'
    );

    $post_query = new WP_Query($args);
    if($post_query->have_posts() ) {
      while($post_query->have_posts() ) {
        $post = $post_query->the_post();
          var_dump($post);
      }
    }
}`
Comment: I've updated the answer to include a basic usage of the get_pages() helper which you can use to start a loop. In this case my personal preference would be a foreach loop along the lines of


Should virtualization questions be tagged as both virtualbox and vmware?

Question: Should virtualization questions be tagged as both virtualbox and vmware?
Answer: VMWare and VirtualBox are separate products. If specifically asking about one or the other, use the appropriate tag. No need to use both unless they are both relevant to the question. In either case, you would still use the virtualization tag as well.
Answer: I think it should not since VMWare is a specific software but Virtualization can be more general like Virtualbox and other virtualization software.


permission denied to open file for writing using perl

Question: I have a problem that I have tried to get to work.  First, I wrote a PERL Script a long time ago and it is on another server.  We are creating a new server, and I have downloaded/installed Strawberry PERL 64-bit.  I am now checking all of my PERL scripts to make sure all work on the new server.
I converted a script to the new way Strawberry wants (use of require to use another file in-line), but I just can't get past the following error: permission denied to open file for writing.
I start will a shell program that calls the inline file:
require "cgi/cr/main_test.pl";

This array hold the text files that will be run through:
my @main = ("BOOKS","CDs","DVDs","VIDEOS","PERIODICALS","VIDEO-GAMES","TOYS","RECORDED-BOOKS","BINS");

The require calls a program to open files for writing results, and then goes through each text file and display and add the numbers in each file.
#!/usr/bin/perl -w

my $recFnd = "C:\\inetpub\\wwwroot\\cgi-bin\\CustomerRelations\\recs_found.txt";
chmod 0755, $recFnd;
print "
$recFnd
";
open (my $newloc, '>', $recFnd) or die "Couldn't open: $!";

The above is $recFnd opens a text file that will be written any code that is found (I have a file that has all of the codes.  I use the data from both to find any new codes that have been used.).  One the next line I change file permission, but that is just passed by (may work, but I cannot test since this is a windows environment).  Then I print the location 7 name of the file to be sure it has the correct file.  Finally, the open where I have tried every version I could to get this to work.  Originally the code for opening the file as:
open (NEWLOC, "> recs_found.txt ") || die;

No matter what I do, I get a permission error.  The folder the files for writing is in has everyone in the building Full Control.  I am not sure what I can do.
If anyone can help, it would be very appreciated.
Comment: You say that the folder has full permissions, but what are the permissions on the file itself? Looking at the error message, it is complaining about the file rather than the directory. You could also try to see what the permissions on the file are `my $mode = (stat($recFnd))[2];
printf "permissions are %04o\n", $mode &07777`. Make sure that ` use File::stat;` is defined first if not already.
Answer: So if this is Strawberry Perl, this is on Windows, and if these are scripts, they are probably running under a system account.  Your problem is probably on the filesystem acls problem not on the Perl side.
The way to troubleshoot and resolve this issue is to art by verifying which user the service is running under.  If this is a web application, it will be whatever service is running Apache, IIS, or the like.  It is likely to be the NetworkService account.  However, you should verify this.  As with all things it is a good idea to give read permission to all parent directories and write access to this directory.
Note that Windows uses ACLs as a model rather than the UNIX UGW model.
If other scripts can write to the file from the web server then something else is happening, but I would be very surprised if it were.
Additionally,  your post has a UNIX shebang line while your post indicates a Windows implementation.  This is partly being pedantic, but solving these problems requires an eye for detail and so being pedantic here is good.


Symmetry in elliptical orbit according to Noether's theorem

Question: Noether's theorem suggests that every differential symmetry of a physical system has a corresponding conservation law. For example, a free particle in space has translational symmetry and therefore its linear momentum is conserved. Also a satellite revolving around a planet in a circular orbit has a rotational symmetry and hence its angular momentum is conserved about its centre of rotation. My question is that if we take the elliptical orbit of planetary motion instead of circular motion, its angular momentum is also conserved about an axis on one of its foci and perpendicular to the plane of motion. What is the associate continuous symmetry of this system?
Comment: Angular momentum is conserved not because the orbit is circular, but because space has a continuous rotational symmetry. It doesn't matter what the shape of the orbit is. Angular momentum is conserved in any closed system around any axis with any motion of its parts. What matters is the symmetry of space, not the symmetry of the motion. For example, a curved space may not have the rotational symmetry, so proving conservation of angular momentum there may be a challenge.
Answer: In general, there are 3 types of symmetries:

Symmetry of an action.
Symmetry of an EOM.
Symmetry of solutions to an EOM.

They are not necessarily the same cf. this Phys.SE post. E.g. 3D rotations are not a symmetry of an elliptic orbit, but they are a symmetry of the action for the Kepler problem. Noether's theorem then predicts that the angular momentum is conserved on-shell.
Answer: If I understand your geometry properly, its that the semi-major axis can be rotated around your symmetry axis without changing $\vec L$ or $E$.
For an excellent exposition of symmetry and orbital motion, see John Baez's web page at UCR.


SU question 473143 has two accepted answers

Question: The question How to tab between buttons on an Mac OS X dialog box, recently migrated from SO to SU, has the interesting sight of two accepted answers. Even if this is a case of a merge (which is not documented on the page), surely the checkmark should only be shown for the answer accepted by this question's author.
Comment: That's funny :)
Comment: This kind of issue was reported here on meta before too,[Two accepted answers?](http://meta.stackexchange.com/q/127792/173001)
Comment: @Lucifer looks like it must be different causes since this happens after a refresh
Comment: @BenBrocka, but both the sites are different. The case has not repeated to S.O. but this is first time for Superuser site.
Comment: This is not the first time it's happened on SU @luc
Comment: I think this may be the highest upvote *rate* of any of my posts...
Comment: Interesting case; the tooltips on the two checkmarks differ (the second one adds a date).
Answer: I suspect this is an ancient bug (and probably long-ago fixed so new posts can't cause this anymore), but it's bizarre
The SO question was one of the first posts, and the timeline shows that it's always had two accepted answers, with no unaccept. The first one is the one recorded in the data dump as the actual accepted answer. The SU migration automatically unaccepted the second one, but both posts are still showing up with checkmarks, and the supposed unaccepted one is the one getting credit (this versus this)
The way the database schema is set up, only one post can actually be accepted, so the double checkmark has to be generated some other way. It looks like https://superuser.com/a/473144/36115 is the one that's actually accepted
Answer: Some ancient bug in migrations (I think we're on revision 8 on that) smashed that particular post, I've fixed up the data.
Comment: And now the wrong one is pinned to the top. :)
Comment: @Mysticial it'll fix itself in a minute.
Comment: Looks like it's already fixed. :)


How to load a post into an empty div tag anywhere across the pages?

Question: Absolute beginner question:
I need to load text into specific div tags across the page.
On my html mockup its a lorem ispum text box waiting for wordpress to load the real content.
So, how do i control the real content and its relation with the div box text on the page?
Can it be a post, so i can manage it from the dashboard?
Thanks in advance.
Answer: You can solve this in different ways.
One it's to use simple querys with WP_Query and using the p parameter to retrive a particular post like it's explained here.
Something like this:
<code>$the_query = new WP_Query( 'p=123' );
while ( $the_query->have_posts() ) : $the_query->the_post();
    the_content();
endwhile;
</code>
Where 123 it's the post id from where you need the data (the_content).
Or you can query the content from a single post using get_post function.
Like this:
<code>$postid = 123;
$queryp = get_post($postid);
$content = $queryp->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
</code>
Where 123, again, it's the postid from where you need to extract the content.
And i think wp_get_single_post function should work too.
Then you can control your content everywhere just extracting the desired data from certains posts by postid
Comment: Thanks for the quick reply, TCattd. I'm not sure about where to put the code(which page, which part) but I'll give it a try. Thx again.


How to design a solenoid.?

Question: I want to design a DC solenoid valve that could compress a spring under 5 kg of load. All I know is the voltage (12V), load (5kg), the current range (15-20), and the cross-sectional area of the winding. kindly help me with the number of turns, wire gauge, etc.
Comment: I think you need to [edit] to add the required stroke. You should probably convert your load requirement to newtons (N). Multiply by *g* (9.81 m/s), so 50 N. You might also explain how you know both the voltage and current when you haven't done the calculations. If 15 - 20 A is the maximum available then state that. What research did you do and where are you stuck?
Comment: Actually, I need a stroke of 10mm max and I want to operate it on a DC power supply having a rating of 12V and 15-20 amps.
Comment: So [edit] your question to state that. Don't hide important information in the comments.
Comment: #اسامہ سجاد , Welcome and nice to meet you. Two years ago I played with solenoids to push/pull something and found them not so strong as I expected. Then I tried electromagnets and found them many times stronger. You might like to read my experiment blog posts: (1) Connecting electromagnet to pi - tlfong01 Rpi.org.forum, 2019mar05
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=234552&start=75#p1437668. Have a great project. Cheers.
Comment: Check out some of the products at [http://www.magneticsensorsystems.com/](http://www.magneticsensorsystems.com/) ... that might give you some idea of scale.
Answer: This is something you'll likely need to do experimentally. Use a force gauge or a 5kg weight to find the needed number of turns and the current/torque needed.
Answer: You can do this experimentally, or look up someone who has done measurements and calculations and published them. One such reference is this one from 1910, when electromagnets and solenoids were hot stuff.
There is far too much there to distill into a reasonable length answer and I don't think it would be particularly helpful to others, so regrettably this will be essentially a link-only answer, and also I encourage you to search for other references which may be easier to use.
Answer: To add to the other answers here, this sort of a design problem is actually an excellent use case for the freeware magnetics simulator FEMM (Finite Element Method Magnetics): https://www.femm.info/wiki/HomePage
In particular, take a look at the "force on a plunger magnet" example: https://www.femm.info/wiki/RotersExample
FEMM can't do full 3D simulations, however, it can do axisymmetric simulations (ie: simulations with radial symmetry). Since pretty much any solenoid will by radially symmetric (barring some unusual geometries), it should work pretty well for your use case.
At minimum, you'd model two cases: one case where the armature is fully retracted (to ensure that the solenoid generates enough force to overcome the compressed return spring + required holding force of the mechanism), and one where the armature is out at full travel (to ensure that the solenoid has enough force to overcome the uncompressed spring). If you need to do more, you can also programmatically alter the geometry with MATLAB or Octave, so you can step the armature position and generate a force vs. position graph to ensure that you are generating enough force at every point through the stroke for your mechanism.
Answer: Force of solenoid comes from an effort to neutralize the unbalance magnetic force induced to the arm core inside the solenoid. That force will press or pull one side to make it center. In your case, it will press, press the spring which the load is 5kg (around 50N). Current (I) is number of voltage over resistor (V/R), which R is the resistor of the solenoid. For this R, you must measure it with AVO meter. Pick one size coil conductor then put to the equation below:
F = (N * I)^2 x magnetic constant * A / (2 * g^2),
Where:
^ is mean power of, power of 2 in this case.
F is the force exerted by the magnetic force inside the solenoid, which in your case is 5kg*9.81km/m^2 or around 50N.
magnetic constant=4pi10^-7 H/m (this is left question, why magnetic permeability of the core is always put air).
N is number of turn,
I is the current flow through the solenoid (V/R).
A is cross sectional area (assume you have cross sectional diameter = 5cm or 0.05m).
g is length of the solenoid, probably 1 cm or 2 cm (0.01m or 0.02m). It is normally denoted as l (small letter of L, while L capital is denoting inductance).
was also long time confusing for me about the gap, but thanks to Mr. David Cope in the reference 4 below that here wrote the equation, and we may compare it to Wikipedia to get what is it.
By knowing the parameters and by using calculator in reference 2 and 3 below, you may easily get the required.
Reference: How to Calculate the Force of an Electromagnet, Solenoid (Electromagnet) Force Calculator, Solenoid Electromagnetic Force Calculator, and compare the first reference to this answer by Mr. David Cope here and to this Wikipedia.

How to design a solenoid.?


Is it possible to create fields in a Matrix block from frontend?

Question: My clients wants its restaurant owners to create FAQs from frontend where each owner can add its questions from frontend and the users will have to submit its answers. I thought to implement it through creating a matrix field which will be available for each restaurants entry. The name of the field could be the question and the text field could be the answer. Each users could save there answers to a new block. I know how to put data into matrix fields that are already made. But i can't find anything from which i can add fields in a matrix block. Is it even possible? Is there any type of plugin available which would help me in it? Any other ideas for this issue would be appreciated.
Answer: There's a lengthy rundown about this in this ticket if you need a detailed explanation.
In short, you'll want to check out P&T's Guest Entries plugin to populate entries on the back-end from front-end input.
I highly suggest paying very close attention to how you should set up your form fields' name attributes from this StraightUpCraft post (scroll to the very bottom for Matrix fields): https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input


Mapbox GL / separation of style and data

Question: I have played with Mapbox and can quite easily create a Choropleth map in Mapbox studio and interact with it in Javascript.
I would like to create Choropleth map of the states with the ability to change the colours of the states for 100 years of different data points. I'm not allowed to upload the data into Mapbox as its sensitive healthcare data and I can't get sign of for the $499 a month cost.
My idea is I create a mapbox style layer in MapBox Studio then push the data client side for each of the states depending on the year x that the user selects. I have seen quite a few cloropeth tutorials such as this https://www.mapbox.com/help/choropleth-studio-gl-pt-1/ but the data is added in through a layer in Mapbox Studio.
Does anyone have any ideas if this is possible? and perhaps any useful API requests which may help me achieve this https://www.mapbox.com/api-documentation/
Answer: You could join local JSON data with vector tile geometries:
Here is a Mapbox example which shows how to achieve this:
https://www.mapbox.com/mapbox-gl-js/example/data-join/


Why the Killing form?

Question: I'm teaching a short summer course on algebraic groups and it's time to talk about the Killing form on the Lie algebra.  The students are all undergrads of varying levels of inexperience, and I try to make everything seem like it has a point (going back to the basic goals of "what is an algebraic group" and "what does this have to do with representation theory").  I am having a hard time justifying the Killing form from anything like first principles: it is useful, and I can prove theorems explaining why it is useful, but I can't think of an explanation of why it is reasonable to invent.  The ideal answer to this question will be a "naive" explanation.  Other interesting answers (which I would appreciate for myself) can be more sophisticated.
Comment: Ryan, tell them Killing form was introduced by Cartan (in thesis), to characterize solvable and especially ss Lie algebras (Bourbaki LIE I, 5.5 Cor. 1 and 6.1 Thm. 1).  If one aims to characterize semisimple ones (reasonable, since Lie had proved earlier that the "classical" Lie algebras were simple, and ss must have been "in the air") then experience with finite group rep'ns (which one really should have before studying Lie algebras) suggests to look for "natural" invariant bilinear form to make complements. Why that trace form? Well, the analogue proves semisimplicity of matrix algebras...
Comment: In my head it's pretty much "the adjoint action is natural, and traces are natural, and bilinear forms are useful."  Is that not good enough?
Comment: I don't remember the details, but here's what went through my mind when I first struggled with this stuff: If you're teaching Lie algebras (and Lie groups?) to undergraduates, you'd better be focusing on matrix groups, so they should view a Lie algebra as a subspace of complex or real matrices that is closed under Lie bracket. Then a natural question is whether there is a natural inner product on the subspace. The first obvious thing to try is $ = tr A^tB$. The question then is whether this works or not and, if it doesn't, how to fix it. Or how to generalize it to non-matrix Lie algebras
Comment: I just feel like I'm not doing them much of a service if I slap down the trace form and tell them it might be useful before deducing a few things that are not obviously related to traces.  For example, if I say that bilinear forms (especially inner products) are useful, then they should have some reason to believe that two vectors in the Lie algebra having a trace-free product means they're orthogonal is appropriate.
Comment: An unsubstantiated notion is that if I do make this definition, and if this form is nondegenerate, then the sum of products that constitutes the Casimir operator has trace equal to dim(V) in any representation V.  In particular, it is nonzero, and I think they can see the value in having a natural nonzero $\mathfrak{g}$-endomorphism of any representation.  This is still slightly too long a daisy chain, though.
Answer: You might find Thomas Hawkins' book "Emergence of the Theory of Lie Groups" an interesting place to look for first-principles explanations of Lie-theory facts. He explains how Killing, Cartan, and Weyl first came up with the structure theory for semi-simple Lie algebras. (See Section 6.2, in particular, for a detailed discussion of Cartan's contributions to Killing-style structure theory---including his introduction and use of the Killing form.)
According to Hawkins, one of Killing's insights in his structure theory for a Lie algebra $\mathfrak{g}$ was to consider the characteristic polynomial
$$
{\rm det} (t I - {\rm ad}(X)) = t^n -\psi_1(X)t^{n-1} + \psi_2(X)t^{n-2} + \cdots + (-1)^n\psi_n(X)
$$
as a function of $X$. (The start of the structure theory was to consider those $X$---regular elements---such that the eigenvalue $0$ has minimal multiplicity.) In general the coefficients $\psi_i(X)$ are polynomial functions on $\mathfrak{g}$ that are invariants for the adjoint action of $\mathfrak{g}$ on itself.
Consider, in particular, a simple Lie algebra $\mathfrak{g}$. Killing observed that the coefficient $\psi_1(X)$, which is a linear functional on $\mathfrak{g}$, must vanish identically, since its kernel is an ideal. Cartan considered the coefficient $\psi_2(X)$, which is a quadratic form on $X$. (The value $\psi_2(X)$ is essentially the sum of the squares of the eigenvalues---roots---of $X$, since $\psi_1(X)=0$.) The bilinear form associated to this quadratic form is the usual Killing form. The invariance of $\psi_2$ under the adjoint action translates to the "associativity" property of the Killing form. Cartan observed (in essence) that for $\mathfrak{g}$ simple, the kernel of the the associated bilinear form is either $0$ or $\mathfrak{g}$ (by invariance + simplicity), and he managed to prove that the kernel is always $0$, starting his repair of the faults in Killing's structure theory. One can look at Hawkins' book for the details of the story, stripped of modern efficiencies.
It is tempting to think that the simpler structure theory of finite-dimensional associative algebras (where non-degeneracy of the trace form also characterizes semi-simplicity) may have inspired Cartan. It seems (again according to Hawkins) that Molien introduced this form for associative algebras (as a bilinear form---as opposed to Cartan's quadratic form) independently in the same year (1893) that Cartan published his thesis.
Comment: That is absolutely fascinating.  I will have to read that book.
Comment: James, I wondered what Hawkins' book would say on this (but was too lazy to walk over to the bookshelf); very nice.  That's quite a coincidence about the case of associative algebras.  So much for my attempt to derive  history by pure thought.  :)
Answer: Hi Ryan,
I presume given your description of the students that they know finite groups pretty well, and have seen the averaging idempotent $e=\frac{1}{|G|}\sum_{g\in G} g$, and how this can be used to construct an invariant inner product on any representation of a finite group.  Perhaps you can convince them that compact groups admit the same sort of averaging idempotents via integral, and so perhaps you can construct the invariant inner product on finite dimensional representations of a compact group in more or less direct analogy with finite groups.  Then you can derive the properties the Killing form should satisfy on the Lie algebra by setting g=e^tX, and taking derivatives of the axioms of the group's inner product?
This is the closest connection I can think of to finite group theory, which is hopefully well-understood by, or at least familiar to, your students.
What do you think?
-david
Comment: Allen, to state the obvious, Cartan's criterion is extremely useful and fails for other invariant forms.
Comment: This seems to be a motivatation for an invariant form on a general representation of $g$, which is a worthy goal, but not for the Killing form per se, which has more to do with the structure of the Lie algebra itself and also has properties not shared by all invariant forms.
Comment: This is a nice idea!  I did actually spend a lecture on finite groups that I can draw on for motivation, and I made a point of talking up the averaging procedure in the course of proving Maschke's theorem.  In a better-structured course I would have done the inner product at that time, and then what you say would be perfect.  Perhaps I can still rig it...
Comment: Are any of the Killing form's extra properties useful?
Comment: @VictorProtsak: to play devil's advocate, to some extent that depends on how you state the theorem -- if $(V,\rho)$ is a $\mathfrak g$-representation, and we write $t_V(x,y) = \text{tr}(\rho(x)\rho(y))$, then $\rho(\mathfrak g)$ is solvable if and only if $t_V$ vanishes on $D(\mathfrak g)$. This obviously implies Cartan's Criterion, and it is also potentially more useful in the sense that if a Lie algebra is given as a subalgebra of some $\mathfrak{gl}(V)$, the restriction of the trace form may be simpler to use that the Killing form.
Answer: A less algebraic answer, but one that really helped me to understand the role of the Killing form, is that it induces the unique G-invariant riemannian metric on symmetric spaces $G(\mathbb{R})/K$ (K maximal compact subgroup), another fact which was very dear to Cartan as well...
Answer: For me, the important property of the Killing form is its naturality with respect to ideals (an illuminating fact to prove).  Then, suddenly, its connection to semi-simplicity becomes quite clear: could there be an abelian ideal?  Well, it would have to be in the radical of the Killing form.
Answer: I always thought of the Killing form as the natural way to introduce an invariant inner product (that was nontrivial) on a Lie algebra, hence the ideal tools for proving theorems in the semisimple case.  Indeed, the trace form is a reasonable invariant bilinear form on $\mathfrak{gl}_n$, and the adjoint map is the first choice of a map from a Lie algebra into $\mathfrak{gl}_n$ that one would think of.
Answer: A one-sentence answer is that the Killing form provides the appropriate generalized inner product on a Lie algebra. A slightly longer answer is that the Killing form gives structural information about (e.g.) solvability and semisimplicity via the Cartan criteria and (e.g.) allows Levi decompositions to be effected in practice and the compact real form of the semisimple part of a Lie group to be constructed via Weyl's so-called "unitary trick".
Answer: It's the essentially unique (Ad) $G$ invariant "inner product"... ok, maybe not positive or negative definite, so just "pairing" ... on $\mathfrak g$. So whatever "geometry" we imagine might live on $\mathfrak g$ is expressed in terms of the Killing form.
Answer: Since you have already explained to them the process of exponentiation of the Lie algebra to go to a Lie group and the linearization of a Lie group to get to the Lie algebra, you can borrow some ideas from the following article to build some very easy connections to basic differential geometry concepts, such as the tangent plane and vectors that belong to the tangent plane. The wonderful article is
http://jakobschwichtenberg.com/adjoint-representation/
After explaining to them how the group is a manifold (with elements being points on the manifold) and how a Lie algebra is the tangent plane at the point that corresponds to the identity element (with elements of the Lie algebra being tangent vectors), you can just view the Killing form as the analogue/generalization of the inner product at the tangent space; in particular, with the inner product between vectors that they are probably most familiar with, we sum over 1 index (i.e. $\vec{v}\cdot \vec{u}=\sum_i v_i u^i$), the Killing form is the analogue of this in the case where our local tangent "vectors" are matrices: $$g_{\alpha\beta}=tr(A_\alpha A_\beta)=\sum_i\sum_j\left(A_\alpha \right)^i_j \left(A_\beta\right)^j_i$$
with $A_\alpha$ being a generator (labelled by the index $\alpha$) of the Lie algebra, in the adjoint representation (although you can give them the definition in any representation for simple Lie agebras).
Comment: Now that I re-read, I realize you were making the analogy with the ordinary dot product on $\mathbb{R}^n$ being "summing over one index" while the Killing becomes "summing over two indices" because "the vectors are matrices". Personally I find this extrinsic viewpoint quite confusing, but maybe other people or the students can make sense out of it...
Comment: "you can just view the Killing form as the analogue/generalization of the inner product at the tangent space" - *the* inner product on a tangent space to an abstract manifold? Even in case you think of $G$ as a concrete closed subgroup $\subseteq\mathrm{GL}_n(\mathbb{R})$, the Killing form on $\mathfrak{g}=T_1G$ is not in general that induced from the standard dot product (a.k.a. trace form) on $\mathrm{Mat}_n(\mathbb{R})$, as the latter is always (positive) definite.
Comment: @Qfwfq Yes, the analogy is the latter which you commented on. It is only an analogy meant to motivate undergrads. At that level, I can personally not find any intuitive way to think about it. Cheers!

Why the Killing form?


No autoplay when plugging my mmc sd

Question: I'm on Windows 7. When I plug my mmc sd I hear the sound indicating it was identified (and when I unplug I hear the "unplugged" sound). However, the autoplay window doesn't show up. Also, the sd drive doesn't appear on "My Computer". What can I do?
Answer: You could try enabling the autoplay feature in control panel. Windows 7 automatically disables autoplay for security reasons.

No autoplay when plugging my mmc sd


What was it like for the family members of astronauts before a launch?

Question: What was it like to be the family member of an astronaut in the days and hours before a launch? Specifically, I'm curious about launches during NASA'S space shuttle program. Where did family members stay while the astronauts were quarantined at the crew quarters at KSC? Where did they watch the launch from? What happened to them during the event of a tragedy, like when Challenger blew up?
I'm also curious about if they had the chance to contact the astronauts via phone or mail before a launch, even though the astronauts were quarantined. Basically, any information you can give me on what it was like to be the spouse/ child of an astronaut. TIA
Comment: The topic is interesting but this is too many questions for one question post. "any information you can give me on what it was like..." could be on-topic or off-topic depending on the specific question, and one could argue either way. There's already one close vote for being "primarily opinion-based" and it's possible that asking about specific individuals on the ground about a traumatic event is in poor taste. I'm sure that's not your intention, but I'd recommend you look at other questions here and get a better feeling for the kinds of questions that are well received.
Comment: See if you can ask one question at a time (you can post more questions) and stick to things where the answer can be factually verified, rather than how a person feels.
Comment: Also see answer to this question[When and where did the traditional wave across the ditch take place](https://space.stackexchange.com/questions/30578/where-and-when-did-the-traditional-wave-across-the-ditch-take-place)
Answer: Having recently just finished reading First Man - The Life of Neil Armstrong, by James R. Hansen, 2006 and Apollo 13, by Jim Lovell and Jeffrey Luger, 2006, read earlier this year.
During the quarantine periods, prior to launches and after the return of the Apollo 11 crew, the families stayed in there homes in Houston. During both quarantine periods, the astronauts were able to contact family via telephone. In the biography of Neil Armstrong it states that he telephoned his wife in Houston and his parents in Ohio during quarantine prior to launch.
In the book, Last Man on the Moon, 1999, Eugene Cernan and Don Davis, do not mention anything about the families of Apollo 17 during the quarantine period prior to launch.
Pre launch quarantine was done to ensure none of the astronauts contracted any diseases that might affect the mission and it also helped to keep the crew focused on the mission.
Regarding the families during launch. At least for the early Apollo missions the families were flown from Houston to Cape Kennedy (as it was then) watched the launch and then returned home to Houston.
As I recall, Janet Armstrong watched the launch of Apollo 11 from a yacht near the launch site. The families of other Apollo astronauts tended to watch the launch from the NASA designated site for viewing the launch at the Cape.


Given an AES-CBC encrypted string, IV, and plain text, how can I compute the key?

Question: If I have the AES-CBC encrypted string along with the IV and the plain text before encryption, how can I compute the key which was used for encryption?
Answer: If I had a way to do this, I would be rich (at least temporarily, until I moved on to smashing the capitalist system before the money got to my head), because trillions of dollars of economic value in communications across the world are secured by the assumption that you can't.
It's kinda one of the design principles of modern cryptography.  Not only can you not figure out the key, but you can't even distinguish another encrypted message under the same key from random noise, no matter how many plaintext/ciphertext pairs you have of your choosing, up to limits that are beyond the reach of humanity.  This property is sometimes called 'indistinguishability under chosen plaintext attack', or IND-CPA.


Gnome 3 on Ubuntu 10.04 / 10.10

Question: Is it possible to install Gnome 3 (relased on 6th April)on Ubuntu 10.04 or 10.10 ?
And  if i can can  can i revert back to the earlier version ?
Comment: found installation instructions [here](http://digitizor.com/2011/04/07/install-gnome3-desktop-ubuntu/) (works only on 11.04 though)
Answer: There may be experimental repositories for Gnome 3 for 10.04 or 10.10, but I can assure you Ubuntu won't offer it as a direct upgrade and most likely will not support it.  Depending on how the packages are built, you might be able to get back to Gnome 2, but don't expect it to work flawlessly.  If you're really itching to try it, wait for the next release of Ubuntu (11.04) where they have it available via PPA, but again, it's highly experimental.  Have a look at this link:
http://www.omgubuntu.co.uk/2011/04/gnome-3-released-to-be-available-for-ubuntu-11-04-via-ppa/
Comment: off to setup a new VM :)
Answer: In System -> Administration -> Software Sources add the repository ppa:gnome3-team/gnome3. Open Synaptic from the Administration menu as well and click Refresh in the upper left. Go into the Origin sort in the lower left and select the GNOME3 ppa (the name will be notably different from any already there). Install gnome-desktop3 and any dependencies and restart. This will probably break GNOME2 so perhaps install XFCE4 (or any other desktop environment) at the same time so you can revert if GNOME3 doesn't work. Then note on the GNOME3 page on Launchpad says,
"This package contains packages from GNOME3 and their dependencies so they can be used in Ubuntu 11.04 (Natty). This PPA is EXPERIMENTAL and MAY BREAK YOUR SYSTEM. There is no downgrade process."
so be careful.
Changing desktop environments is along the bottom of the screen after you select your username.
To revert, you would go into Software Sources again and remove the source we added earlier, although it will now be called "deb http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu natty main" or something similar. Open Synaptic and refresh packages again. Go into the Status tab in the lower left and mark any packages under Local / Obsolete that seem GNOME-related for reinstallation.
Do all this with caution.
Answer: If it is available, it should be in your repositories. Just search for it in Synaptic.
When you log in, you get the choice of different desktop environments. (Gnome 2.X, 3, Kde, Xfce)
This is afaik, I haven't been on Ubuntu since 10.04 was new.
Comment: Thats what i figured too , but can we toggle between different versions of Gnome ?

Gnome 3 on Ubuntu 10.04 / 10.10


Is it known whether $BPP\cap NP\subseteq RP$?

Question: The reverse inclusion is obvious, as is the fact that any self-reducible NP language in BPP is also in RP. Is this also known to hold for non-self-reducible NP languages?
Comment: What *is* known is that $\mathrm{NP}\subseteq\mathrm{BPP}$ implies NP = RP. @chazisop, where did you get that $\mathrm{NP}\cap\mathrm{BPP}=\mathrm{RP}$ implies BPP = RP or NP = RP?
Comment: You got the first two cases mixed up. More importantly, in the third, generic, case, your conclusion is identical to the assumption, so the whole argument doesn't accomplish anything. In particular, it does not support the incorrect claim in your first comment.
Comment: If it was known, from the inclusions $\mathbb{RP} \subseteq \mathbb{BPP}$ and $\mathbb{RP} \subseteq \mathbb{NP}$, it would follow that either $\mathbb{BPP} = \mathbb{RP}$ or $\mathbb{RP} = \mathbb{NP}$ (or both, essentially depending on the relationship between $\mathbb{BPP}$ and $\mathbb{NP}$. So I think it is safe to assume that it is currently unknown. Since $\mathbb{RP}$ has one-sided error, it is easy to see how it is contained in $\mathbb{BPP}$, without needing self-reducibility or any other property.
Comment: Suppose we knew $BPP \cap NP \subseteq RP (1)$. Then we can do case analysis:

- If $BPP \subseteq NP$, then from (1) $NP \subseteq RP$, which with known results implies $NP = RP$.

- If $NP \subseteq BPP$, then from (1) $BPP \subseteq RP$, which with known results implies $BPP = RP$.

- If $NP \not\subseteq BPP$ (neither is a subset of the other), then we get $BPP \cap NP = RP$.

PS: Sorry for deleting the previous comment, I accidentally posted it mid-comment and couldn't edit it to include the rest of the cases.
Comment: The assumption only asks for the subset, not equality. In any case, my argument (even badly formatted and with errors), does show that if we knew what is being asked, then we could derive complexity class relations that are currently open problems. Furthermore, I fail to see how the third case if more generic than the rest: it explicitly excludes the possibility of one class containing the other, which is currently unknown.
Answer: As with most questions in complexity, I'm not sure there will be a full answer for a very long time. But we can at least show that the answer is non-relativizing: there is an oracle relative to which inequality holds and one relative to which equality holds. It's fairly easy to give an oracle relative to which the classes are equal: any oracle which has $\mathrm{BPP} = \mathrm{RP}$ will work (eg any oracle relative to which "randomness doesn't help much"), as will any oracle which has $\mathrm{NP} \subseteq \mathrm{BPP}$ (eg any oracle relative to which "randomness helps a lot"). There are a lot of these, so I won't bother with the specifics.
It's somewhat more challenging, though still fairly straightforward, to design an oracle relative to which we get $\mathrm{RP} \subsetneq \mathrm{BPP} \cap \mathrm{NP}$. The construction below actually does a bit better: for any constant $c$, there is an oracle relative to which there is a language in $\mathrm{coRP} \cap \mathrm{UP}$ which is not in $\mathrm{RPTIME}[2^{n^c}]$. I'll outline it below.
We'll design an oracle $A$ that contains strings of the form $(x,b,z)$, where $x$ is an $n$-bit string, $b$ is a single bit, and $z$ is a bit string of length $2n^c$. We will also give a language $L^A$ which will be decided by a $\mathrm{coRP}$ machine and a $\mathrm{UP}$ machine as follows:

The $\mathrm{coRP}$ machine, on input $x$, guesses $z$ of length $2|x|^c$ randomly, queries $(x,\mathtt{0},z)$, and copies the answer.
The $\mathrm{UP}$ machine, on input $x$, guesses $z$ of length $2|x|^c$, queries $(x,\mathtt{1},z)$, and copies the answer.

To make the above-specified machines actually meet their promises, we need $A$ to satisfy some properties. For every $x$, one of these two options must be the case:

Option 1: At most half of $z$ choices have $(x,\mathtt{0},z) \in A$ and zero $z$ choices have $(x,\mathtt{1},z) \in A$. (In this case, $x \not\in L^A$.)
Option 2: Every $z$ choice has $(x,\mathtt{0},z) \in A$ and precisely one $z$ choice has $(x,\mathtt{1},z) \in A$. (In this case, $x \in L^A$.)

Our aim will be to specify $A$ satisfying these promises so that $L^A$ diagonalizes against every $\mathrm{RPTIME}[2^{n^c}]$ machine. To try to keep this already long answer short, I'll drop the oracle construction machinery and a lot of the unimportant details, and explain how to diagonalize against a particular machine. Fix $M$ a randomized Turing machine, and let $x$ be an input so that we have full control over the selection of $b$'s and $z$'s so that $(x,b,z) \in A$. We will break $M$ on $x$.

Case 1: Suppose there is a way to select the $z$'s so that $A$ satisfies the first option of its promise, and $M$ has a choice of randomness which accepts. Then we will commit $A$ to this selection. Then $M$ cannot simultaneously satisfy the $\mathrm{RP}$ promise and reject $x$. Nevertheless, $x \not\in L^A$. So we have diagonalized against $M$.
Case 2: Next, assume that the previous case did not work out. We will now show that then $M$ can be forced either to break the $\mathrm{RP}$ promise or to reject on some choice of $A$ satisfying the second option of its promise. This diagonalizes against $M$. We will do this in two steps:

Show that for every fixed choice $r$ of $M$'s random bits, $M$ must reject when all of its queries of the form $(x,\mathtt{0},z)$ are in $A$ and all of its queries of the form $(x,\mathtt{1},z)$ are not in $A$.
Show that we can flip an answer $(x,\mathtt{1},z)$ of $A$ for some choice of $z$ without affecting the acceptance probability of $M$ by much.

Indeed, if we start with $A$ from step 1, $M$'s acceptance probability is zero. $A$ doesn't quite satisfy the second option of its promise, but we can then flip a single bit as in step 2 and it will. Since flipping the bit causes $M$'s acceptance probability to stay near zero, it follows that $M$ cannot simultaneously accept $x$ and satisfy the $\mathrm{RP}$ promise.

It remains to argue the two steps in Case 2:

Fix a choice of random bits $r$ for $M$. Now simulate $M$ using $r$ as the randomness and answering the queries so that $(x,\mathtt{0},z) \in A$ and $(x,\mathtt{1},z) \not\in A$. Observe that $M$ makes at most $2^{n^c}$ queries. Since there are $2^{2n^c}$ choices of $z$, we can fix the unqueried choices of $z$ to have $(x,\mathtt{0},z) \not\in A$, and have $A$ still satisfy the first option of its promise. Since we couldn't make Case 2 work for $M$, this means $M$ must reject on all its choices of randomness relative to $A$, and in particular on $r$. It follows that if we select $A$ to have $(x,\mathtt{0},z) \in A$ and $(x,\mathtt{1},z) \not\in A$ for every choice of $z$, then for every choice of random bits $r$, $M$ rejects relative to $A$.
Suppose that for every $z$, the fraction of random bits for which $M$ queries $(x,\mathtt{1},z)$ is at least $1/2$. Then the total number of queries is at least $2^{2n^c} 2^{2^{n^c}}/2$. On the other hand, $M$ makes at most $2^{2^{n^c}} 2^{n^c}$ queries across all its branches, a contradiction. Hence there is a choice of $z$ so that the fraction of random bits for which $M$ queries $(x,\mathtt{1},z)$ is less than 1/2. Flipping the value of $A$ on this string therefore affects the acceptance probability of $M$ by less than $1/2$.
Comment: @Kaveh: I looked at [this survey](http://www.cs.stonybrook.edu/~keriko/survey2.pdf) (it's the one you're referring to, right?), but I didn't notice much that seems immediately relevant. Most of the results seemed like they would fall into the case of proving $\mathrm{BPP} \cap \mathrm{NP} = \mathrm{RP}$.

One notable point is that $\mathrm{P} = \mathrm{RP}$ relative to a random oracle, and so we get $\mathrm{BPP} \cap \mathrm{NP} = \mathrm{RP}$ relative to a random oracle.
Comment: This answer is fairly long and would probably benefit from a link to an outside resource that gives a better explanation of the techniques involved. If anyone knows of one, I'll happily include it.
Comment: It might be in Ko's survey.
Answer: No, it's not known.
This might not be the most convincing proof, but take a look at
this Google search.


Legs training program

Question: I'm male 90kg 172cm. I've been going to gym for about 3 weeks. It seems like my legs are weak compared to upper body. For example I could hardly do 4x15 squats with 40/45kg during 1/2 week, while I bench press about 70/75kg. (from my observations all people in the gym squat more then bench press) A friend of mine says I should increase the weight for squats and reduce reps for time being. What's the logic behind this advice? Is it better to slowly increase the weight keeping current sets and reps?
Answer: Reps in the range of 12+ tend to be geared more towards muscle endurance than hypertrophy (more muscle mass) or strength.
A vast number of training programs with a trainee's 1-rep max (1rm) in mind, this is the most that the trainee can lift one time before failure.

As shown in the image, working in a lower rep range will provide your body with a different stimulus that will promote overall strength gains. That doesn't mean that you have to work in the lower rep range, but progress will be slower if you stick to 15 reps for all of your lifts. This page provides various links that will allow you to explore the effects of the different rep ranges. You can also use the ExRx website to help estimate your 1rm to better plan your routines / overall program.
In the end, what you decide to do in terms of increasing the weight for your squats while decreasing the number of reps, is ultimately up to what your goals are. If you're looking for maximal strength then sticking to sets of 3-5 reps might be best, while going for size will benefit from having sets with 8-12 reps.
Answer: 15 is a very high number of reps compared to what most gym-goers do, it's also in fact, as Alex L showed, a very endurance focused rep range.
There are three main factors which affect how many reps you can do:

I. neurological adaptation This is your nervous systems ability to make your muscles do their work at the highest possible strength. When you work out at 1-5 reps, your nerves will perform better.
II. Muscle fibre type 1 These are your slow twitch fibers, they are the ones doing the work when you need endurance, when you do 50 body weight squats etc. When you work out at 12+ reps, you will get increases in these fibers mostly.
III. Muscle fibre type 2 These are your fast twitch fibers, they are used when you need to lift heavy, but they also tire out a lot faster than the type 1 fibres. When you work out at 1-5 reps, you will get increases in these fibers mostly.
Comment: I've heard from numerous gym instructors that all those types of rep ranges are higher for legs? what is particular reason for that?
Comment: Honestly I've never heard anything about legs being different than upper body in that regard. Calves are known to have a larger proportion of type 1 fibers, due to their constant use, which could mean that higher rep ranges are better for volume (still not for strength though!) If you want to be able to squat heavy, you should train squats heavy.
Comment: went from 15 to 12 reps and on the next week and managed to do 50/60/65/70kg. I felt like I would definitely not be able to do 15 reps in 65/70 sets though)
Answer: Can I just say that you should be patient. I've seen some of the younger personal trainers in my gym tell guys to do insane squats when they're starting out and the muscles just aren't developed enough. It's painful, dangerous and would scare me away from the gym. Happy training.

Legs training program


Drooping peace lily plant

Question: I have bought a peace lily 7 days ago, but the leaves are drooping and lower leaves have turned yellow. I have tried watering it, soil is moist but condituin is not improving. Drooping leaves have also developed breaks in it and seems like beyond repair ... kindly help !!!
Answer: In my eyes the soil seems to be too heavy with no aeration. Peace Lilies do like a little aeration for their root system.
At first, it might be some sort of shock from moving to a new place. if it is a shock, just give it a few more days and be careful to not over water. do not fertilize now. try to keep it away from sources of dry air, that is, opened windows and doors specially in summer. they work their best in humid air. and too much room temperature also cause them to droop their leaves and produce brown tips in my experience. these are slow growing plants.
If the situation not improved, it might also be from root rotting, then I suggest these procedure:
try removing the old soil from the roots completely with water very gently, cut only mushy and black part of the roots if any, put the plant in a water container fast with water covering the roots only, wash the pot with dish soap, and replant, this time using a bagged general Potting Soil with some degree of quality. and remember the drainage hole in the pot is a MUST.
In a similar situation I had with one Peace lily (not recovering from droopy situation), I've kept it in a water container for a week or so. and changed the water every day with new water and when it recovered, then I replanted it in soil. the broken or withered leaves are not going to heal. so cutting them is actually a good idea. it'll let the plant to work on new roots and growth.

Drooping peace lily plant


Transposing data points to line using ArcGIS Desktop

Question: See sketch below.
The main objective, using ArcGIS 10 or 10.1, is to get the P points to the perpendicular P line and, either the closest B point to the endpoint of the P line where it interesects the B lines, or an averaged value, whichever is easier.  My process for doing this is:
"Step 1" is the data as I initially have it.  The parallel B lines have data points and the perpendicular P line has data points scattered around it.
To get to Step 2, I am creating perpendicular lines along the P line then joining the P data point attributes to the perpendicular lines.  Then, I am creating points at the intersection of the P line and the perpendicular lines.  I am then joining the perpendicular line attributes to the intersection points, resulting in the "Step 3" figure.
I am then creating points like those shown in Step 4 and doing a spatial join that assigns the closest value from the points in Step 3 to the F data points in step 4.
Is there a more efficient way of accomplishing this process?
I have about 400 P lines and anywhere between 200-1000 P points at each P line.  I have tried using the Geospatial Modeling Environment, previously Hawth's Tools, with the snap points to line tool but am unable to get it to work "Command text could not be interpreted error).  I think this is because I have P lines that are close together (the sketch below is a simplified idea of what I am doing) and when the tool is trying to snap points to line, the point lies within the snapping tolerance distance of 2 P lines, causing it to crash.
Answer: With the advanced licence, you can select by attribute all your P lines, then use the "Near" tool in order to get the coordiantes of your nearest points (equivalent to the point on the perpendicular) on the lines (Near_X and Near_Y fields). Then you can create points from these coordinates (see here or with the "add XY event" tool.)
If not, you can use the linear referencing tool "locating features along routes"


Time complexity of subset sum problem with reals instead?

Question: It is well known that the conventional subset sum problem with integers is NP-complete. What if the array elements can be any real numbers and also target sum can be any real number? Is it NP-complete still or harder (NP-hard)?
Comment: What model of computation are we talking about here? Most real numbers cannot be encoded as a finite string.
Answer: What model of real numbers are you using?  If it's something like floating point, where everything is really rational, just multiply through by a common denominator and you're back in the world of integers. The bit-length is only polynomially larger than the ones you started with (the common denominator is at most the product of $n$ $n$-bit numbers, so it has at most $n^2$ bits), so nothing has changed, complexity-wise.
Beyond that, things will get more complicated – can you even tell in polynomial time what numbers are represented by the input?
However, the real-number version is definitely still NP-hard, since it has the integer version as a sub-problem.
Comment: *Something* does change with the complexity when using rational numbers instead of integers. The problem becomes strongly NP-complete as shown by Wojtczak in this paper: https://arxiv.org/abs/1802.09465


What diet/foods decrease IGF-1 and increase IGFBP-1?

Question: And also, what happens to these markers when non-fibrous carbohydrates are substantially reduced?  Thanks a lot for any comments.
Answer: My son's pediatric endocriniologist recommended a low-carb diet for increasing his insulin sensitivity (=reducing his insulin resistance).  This is apparently not totally mainstream (yet), though, because his pediatrician, who was otherwise very up on recent developments and research, did not know about the low carb diet, and had trouble understanding it.
I personally have not read much scientific literature about this -- my personal focus was more on implementing the specialist's recommendations at my house -- but here are a couple of references that might get you started if you are interested in following up:
http://www.nejm.org/doi/full/10.1056/NEJMoa022637#t=article
Bray, G. A. (2005). Is there something special about low-carbohydrate diets? Annals of Internal Medicine, 142(6), 469-70.
We found that a low carb diet, paired with metformin treatment and attention to regular, moderate exercise, has helped my insulin resistant son increase his IGFBP-1 lab results, lose weight in a slow, sustainable way, and then keep his BMI for age out of the obese zone.  It has also helped him experience less

cravings
headaches
nausea
problems with energy level and concentration

The rest of the family, who are not genetically related and have no insulin resistance, benefited mildly from the low carb diet as well, especially in terms of better concentration in the afternoon.
Note about my son's experience with exercise: He has always been a boy who got a lot of enjoyment from both organized sports as well as just plain running around, riding his bike, and showing off his strength by carrying around heavy things.  I was surprised how much it helped in the early months of his treatment to avoid exercise that involved short, intense spurts, and religiously walk 20-30 minutes every day (as recommended by the specialist).
He was 9 when we were given the diagnosis and he is now 13.
Since there is not just one approach to "low carb diet", I will share what we have worked out.  The specific approach to a low carb diet we use:

no high fructose corn syrup
no candy
no sweet baked goods (except for birthdays, and then we use special flours, such as almond meal)
high fiber bread, maximum one slice per meal
100% whole grain pasta (I buy the kind that tastes like cardboard, hence one doesn't want to eat very much of it)
complex carbohydrates such as brown rice and potatoes in small servings
fruit limited to two servings per day; fresh and whole (requires chewing)
offer salads several times per week
we don't limit fats or protein
we aim for a good proportion of protein to carb ratio at each meal or snack
we all follow the same diet with the child
no fruit juices -- beverages are water, whole milk, and homemade, flavored bubble water (examples of flavorings: lime juice or pure cranberry juice)
raw baby carrots or large carrots often used as a snack, sometimes with hummus

When he hit a plateau after about three months, we temporarily substituted pizza sauce for catsup.  That did the trick.  He got unstuck, lost a couple more pounds over the next month, and hit his target.  We were eventually able to go back to catsup (no high fructose corn syrup) in moderation.
Comment: Thank you very much for your interesting and detailed reply.  It's very interesting that 'HIIT'-style exercise didn't help, but gentle cardio (walking) did.  I'm extremely interested in one of your bullet points where you say "we don't limit fats or protein".  I can really understand the fat side of things, but the unlimited protein really has me intrigued.  I thought that excess protein caused the liver to create glucose, which would counteract the low carb approach?
Comment: I'll refer you to the books and articles about low carb to be sure, but -- maybe it's because the digestion of protein takes longer.  The exercise thing has to do with adrenaline.  Diabetics are told to walk regularly and to do some gentle strength training.


Improve downspout fitting on gutter

Question: This used to be fine without the flexible adapter, I had a rigid gutter to pipe adapter in the past. The ground below must have pushed the pipe around over time. The fitting was barely working for the last year and more recently not working at all. I bought a flexible adapter today and it is really straining to fit. Is there a better solution? I could not find flexible pipe to pipe connectors for this job.
Comment: why don't you dig up the ground and reposition the black pipe that is in ground
Comment: I think it will still be misaligned laterally if I dig up the ground to push the pipe down. I need to push the pipe down and back towards the concrete slab on the right
Answer: I would suggest that you replace the rigid gutter to pipe adapter with a new one. Adjust the downspout as necessary to make it fit.
What you've got now looks like it will restrict water flow because the flex pipe has a dip in it - effectively a shallow P-trap. Not something you want in an rain gutter. Also, if that's not a tight fit between the flex and rigid piping, you're going to end up with dirt and plant life in the buried section and it will end up backing up and flooding this area.
I can't tell from the picture which way the rigid pipe goes once it's underground, but you may have to dig up a few inches of it to move it so it will once again meet up with the downspout and adapter.
Comment: I double-checked the adapter and it does not make a p-trap. I do agree that the situation is not good and I can't let this be more than temporary.
Answer: dig some of that dirt out of the way, push the black flexible pipe down and back against the foundation, rotate the black elbow until it faces upward an use a rigid adaptor to connect the two pipes. (or instead remove the black elbow and just use the flexible adaptor to connect ro the black pipe.)
an empty pipe is lighter than dirt and will tend to float out of mud, so you may need put a stake into the groud to fix its location.

Improve downspout fitting on gutter


Apps For Android Like JsFiddle

Question: I would like names for apps for Android that work like JsFiddle but locally. Basically, an editor where I can write HTML, CSS and JS and see the changes right there. No need to save files or anything. Because I might be offline with my pad. So any suggestion regarding this is welcome.
Comment: So basically a WYSIWYG HTML editor? If so, you might wish to check my list of [Text editors for developers](http://android.izzysoft.de/applists/category/named/office_office#group_105).
Comment: @Izzy Thanks for the comment. But I meant more like code editor where I can write code with syntax highlighting and then I can see the preview of the HTML, JS and CSS.
Comment: Yes, that's what I meant. Syntax highlighting, text completion, and the likes are definitely present in those ones. Didn't check for the preview features, as I'd say those should be even more "essential" than code-completion ;)
Comment: anWriter free is the best i found yet. It has autocompletion and highlights and allows previews. I use it for simple exercises.
Answer: http://kodeweave.sourceforge.net/

kodeWeave is a realtime HTML, CSS, Javascript and Markdown coding playground. Similar to JSFiddle and JSBin, but kodeWeave was made to work offline.
kodeWeave is similar to jsfiddle, jsbin, dabblet, liveweave, codepen and tinkerbin, but allows you to export your web app as a desktop and/or chrome application or extension (this functionality is slowly being ported to Android)
You can save your weave to the cloud and share it with your friends both on the web app and in the Android application.
In addition kodeWeave comes with a built in color picker and numeric slider, along with support for jade, coffeescript and stylus preprocessors.
So currently if you're looking for a jsFiddle alternative for Android. This one is for you!
Answer: Webmaster Lite HTML Editor does this but only the paid version will let you preview it. It has syntax highlighting for css, javascript, html etc although you do need to save code locally prior to doing a preview. Options include dark or light interface, line numbers, a search/replace function (which is a bit buggy)  and setting the file type, with the default being UTF-8. It's very usable on small screens and excellent on a tablet.

To view the code you have written without the paid version you can launch a web browser when offline and enter the path, eg as file://storage/emulated/0/coding/test.html if it is using as folder called coding.  Boat Browser will allow you to double-click the file and launch without typing the path.
Also good is TurboEditor (Text Editor) by Maskyn, pretty much the same features but the newer versions now include ads in the free version. There is only a tiny ad box in Webmaster Lite so usually I don't see it.
Answer: You should try JSitor.com, JSitor provides both Web and Mobile Apps. It simple to use and very straight forward.
JSitor.com

JSitor Apps -
iOS - https://apps.apple.com/us/app/jsitor/id1455784773
Android - https://play.google.com/store/apps/details?id=com.ashvin777.apps.jsitor

Apps For Android Like JsFiddle


What should I do if I catch my cat eating a poisonous plant?

Question: Just a thought. If I were to catch on of my cats eating a plant that I know is poisonous to cats (e.g. travelling over christmas and they found a poinsettia). Is there something that I should do to immediately to try and mitigate the problem before going to the vet?
Answer: My first-aid manual1 has a few tips for immediate aid:

Immediately call your vet or an emergency veterinary hospital depending on time of day. This is a medical emergency and needs swift resolution.
Inducing vomiting only if the cat is fully awake and in control of their body and you know what they ate. If there's any doubt that they are not then don't do it as it they may inhale it coming up. Also, do not do this if they ate a caustic poison! (see below) In any event, 3% hydrogen peroxide solution with a dosage of 1 teaspoon (real measure don't wing it from your cutlery) per 10 pounds of pet. Cats are not as susceptible to it as dogs are, but the foaming action will tend to induce vomiting. Keep any vomit for analysis by the vet.
Dilute it. If you can get them to eat something, even treats, then the food can dilute and delay the absorption of the poisonous material.
Be prepared to give artificial respiration and/or CPR. This can be tricky when it comes to animals, so I'd really suggest getting your vet to show you how to do this so you can respond in an emergency. A bit of training ahead of time may help save the life of your pet.
When going to the vet, take any samples of the poisonous material and any vomit that your pet has produced.

For caustic poisons like ammonia or bleach and with petroleum products like kerosene and the like, you can try and feed them bread that has been soaked in mineral or vegetable oil. The oil will help protect the stomach lining and intestines. As noted above, never induce vomiting in this situation.
If the poison is caustic, it's unlikely they have swallowed it, unless it was in something that prevented tasting, and so may have only burned their mouths on it. Treat that with milk and/or water to help cool the burns, but you'll still need to get to the vet.
1 The First Aid Companion for Dogs and Cats. - Amy D. Shojai
Answer: The are veterinary poison control centers. Keep the number for one handy, and call them before either panicking or doing anything that might make matters worse. Or call your vet.
Comment: My first impulse was that this was not a very good answer, but you are correct many poisons can do more harm coming back up, every event must be considered singularly, other than calling for help there is no single solution.  What the solution for one event may be fatal in a different scenario.