When is my summer lilac ready for the next phase of my guerrilla gardening plan?

Question: The "landscaping" in front of my apartment building is less than attractive. Nobody ever does anything so I came up with the idea to plant something nice on my own. Not wanting to spend money on this experiment I searched the neighborhood and tool a cutting from a summer lilac shrub in the area.
My first cutting didn't make it but this one has finally sprouted some roots in the water glass I'm keeping it.
I assume that at some point I'll probably have to transplant it to a pot with soil before moving it to the front of the house. But I am unsure when to do that. How big should the roots be for potting? The cutting itself is about 20cm.
Answer: According to Thomas DeBaggio in Water Works: Rooting Cuttings in Water, when 1/4 to 1/2 inch long.


Can icomplete mode be enabled selectively, only for certain commands?

Question: I'd like to use icomplete-mode for certain commands, but not for everything. Is there a way to enable it for just a list of commands I specify?
Answer: IIRC, Currently, the only way icomplete offers to control it is via icomplete-with-completion-tables which is rather inflexible.  Of course, you could enable/disable it for specific commands by advising those commands and temporarily rebinding icomplete-with-completion-tables accordingly.
Comment: @Tom: This advice applies to the execution of the *function*, i.e. the code run once we know which arguments to pass to the function, whereas you need the advice to apply to the *construction* of those arguments, i.e. the interactive spec.
Comment: I tried simple around advising, turning icomplete on and off, but it doesn't work for some reason `(defun my-icomplete (orig-fun &rest args)
  (icomplete-mode 1)
  (apply orig-fun args)
  (icomplete-mode -1))

(advice-add 'describe-variable :around 'my-icomplete)`
Comment: Thanks, I didn't know that. I tried advising completing-read, but apparently I can't detect the current command while the arguments are gathered. Shouldn't this-command show this? Even if the command is not executing yet, its arguments are being gathered, so this-command could indicate the current command already.


File Monitor For Windows CE/Mobile

Question: Is there a tool that will show me what files have changed over a period of time on either a Windows CE or Windows Mobile device? The reason I want this is I am trying to figure out exactly where IE history is stored. I was going to start the file watcher, delete my history, and then see what has changed.
Answer: I saw your question about this topic in SO. I think it is possible that IE history is saved in the Windows Registry. I was going to recommend you to use "Remote Registry Editor" provided with Visual Studio in order to take two screen shots of the registry, after and before doing some browsing. Then you can use a diff tool (winmerge for example) to locate the registry keys that where changed.
Answer: There is a software app that resembles Filemon for full blown windows called CEMon. You can get it here:
http://mobile.butterscotch.com/preview/32476/CEMon
Comment: I did not try this out because I solved my problem without it, but it looks to be what I asked for...

File Monitor For Windows CE/Mobile


Stack lists under each other with cards

Question: Is there a way you can stack lists under each other with their own lists in a column rather than run every list accoss the page?
Answer: I developed the extension List Layouts for Trello that allows you to toggle between displaying a Trello board's lists vertically, horizontally, or in a grid.
Answer: I just did this with the plugin Stylish and some CSS tweaks.
Just add
<code>
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("trello.com") {

    .list {
       margin: 0 5px 13px 10px;
    }
    #board {
       flex-wrap: wrap;
       overflow: auto;
    }
}
</code>
to a stylish Section and apply to URLS starting with https://trello.com
Works for me.
Answer: No, if you try and drag a list under another list it'll just snap back to it's original position.
Each card list is just that, a vertical list that will automatically grow to the height of your browser tab adding a scroll bar as necessary.
Answer: If you fiddle with small-ish window size, Trello will suddenly switch between 2 or more alternative stacked views. The behavior currently is very unpredictable, unfortunately.

Stack lists under each other with cards


How can I save attachments on InfoPath form to spreadsheet?

Question: I need to save attachments submitted with the infopath form (for future reference) either on a spreadsheet or other format on a shared drive.
Comment: Can you please give more context? What version of SharePoint? Is this InfoPath on a workflow or on a list form? Where do you want to save the attachments? Are you doing this with SharePoint Designer, Visual Studio, Web UI, etc.? What have you tried so far?
Answer: Attachments are base 64 encoded and stored within the XML of the InfoPath form. I have used a Nintex workflow in the past to extract the attachments via workflow and send them in an email.
You'll likely need to write an event receiver to extract the attachments and store them where necessary.


Continuous dependence on initial parameters of an ODE for non-Lipschitz functions?

Question: For ODEs, the standard theorem of continuous dependence of initial parameters deals only with functions that are Lipschitz. Do there exist more general results holding for non-Lipschitz functions? If so, could someone direct me to some resources on the topic?
Comment: For non-Lipschitz differentil equations, there is no uniqueness theorem. So we cannot speak of "dependence" on initial conditions at all. There are some generalizations of uniqueness theorem to more general functions, but it is something very close to the Lipschitz condition.
Comment: Welcome to MathOverflow! Hmm, if the vector field is not Lipschitz, the solution will not be unique, in general. So it seems to me that it is not even clear what one means by "continuous dependance on the initial parameter", since there could be many solutions for each initial value. (+1 anyway, since I find the question to be an interesting thought.)
Comment: When we lose uniqueness, maybe we can do with an "existence" formulation of continuous dependence? Something along the lines of "for every bounded open $\Omega\subset\mathbb{R}^N$ there exists a time interval $(-T,T)$ and a continuous function $f: \Omega\times(-T,T) \to \mathbb{R}^N$ such that $\frac{d}{dt} f(\alpha,t) = F(f(\alpha,t))$ with initial data $f(\alpha,0) = \alpha$"?
Comment: https://mathoverflow.net/questions/234183/solution-set-of-non-unique-solutions-to-first-order-odes/234198#234198
Comment: In regards to my previous comment: I think in at least the case of the Peano theorem (where the vf is only continuous), the usual proof by looking at the integral formulation and using compactness should go through.
Answer: The continuous dependence on initial conditions and parameters (and even on the right-hand side in the compact-open topology) is a consequence of the uniqueness. See Theorem 3.2 of Chapter II in Hartman's "Ordinary differential equations" (I call this statement the Kamke lemma). Note that without the uniqueness, the question of continuous dependence (in the classical sense) is incorrect. So when you have this correctness, you automatically have the continuous dependence.


Sum of $1+4\epsilon +9\epsilon^2 +16\epsilon^3+...+2018^2 \epsilon^{2017}$

Question: I have this problem from a college exam: Let $\epsilon$ be a non-real root of unity of order 2018, find the sum$$S=1+4\epsilon +9\epsilon^2 +16\epsilon^3+...+2018^2 \epsilon^{2017}$$Here is my try. First I considered $$S_1=\sum_{k=0}^{2018} x^k=\frac{1-x^{2019}}{1-x}$$ Now I derivate one time then I multiply again by x to get: $$\sum_{k=0}^{2018} kx^k=\frac{x-x^{2020}-2019x^{2019}}{(1-x)^2}$$ And now I must derivate one more time and set $x=\epsilon$ in order to get the desired sum: $$S=\sum_{k=0}^{2018} k^2\epsilon^{k-1}=\frac{2019^2\epsilon^{2018}-2020\epsilon^{2020}-(2019^2-3\cdot2019-1)\epsilon^{2019}-\epsilon-1}{(1-\epsilon)^3}$$ And my final simplification to the numerator was:$$\epsilon(2019^2-2021)-2018\epsilon^2-2019^2-1$$ Now there were 5 answers given, and not a single one  was even close to this one. Out of luck because only 2 answer had $1-\epsilon$ in the denominator I have choosen the correct one, which was: $$S=\frac{2018(2018\epsilon-2020)}{(1-\epsilon)^2}$$ Can you help me to get that  answer?
Comment: The upper limit should be $2017$, not $2018$.
Comment: You should double check your result for $\frac{dS_1}{dx}$, WA gives [different answer](http://www.wolframalpha.com/input/?i=simplify+(+(1-x%5E2019)%2F(1-x)+)%27).
Comment: "Derivate" is a noun, not a verb.  Differentiate is a verb.  Use it instead of derivate.  And derivative is preferred as a noun.
Comment: The sum should be to $2018$
Comment: I believe that after @MarkViola's correction is made, your method should yield the correct answer.
Answer: Using the operator $\delta = x \, \frac{d}{dx}$ leads to
\begin{align}
\sum_{k=0}^{n} x^{k} &= \frac{1 - x^{n+1}}{1-x} \\
\sum_{k=0}^{n} k \, x^{k} &= \delta \left(\frac{1 - x^{n+1}}{1-x} \right) = \frac{x - (n+1) x^{n+1} + n x^{n+2}}{(1-x)^2}  \\
\sum_{k=0}^{n} k^{2} \, x^{k} &= \delta^{2} \left(\frac{1 - x^{n+1}}{1-x} \right) = \frac{x(1 + x - (n+1)^2 x^n + (2n^2 +2n -1) x^{n+1} - n^2 x^{n+2})}{(1-x)^{3}}
\end{align}
Letting $x^{n} =1$ gives
\begin{align}
\sum_{k=1}^{n} k^{2} \, x^{k-1} &= \frac{1 + x - (n+1)^2 + (2n^2 +2n -1) x - n^2 x^2}{(1-x)^{3}} \\
&= - \frac{n \, (n+2 + 2 (n+1) x + n x^2)}{(1-x)^3}
\end{align}
Now let $n=2018$.
Answer: Consider the sum $$1+x+x^2+\dots+x^{2018}=\frac{1-x^{2019}}{1-x}$$ Differentiate both sides once: $$1+2x+3x^2+\dots+2018x^{2017}=\frac{1-x^{2019}}{{(1-x)}^2}-\frac{2019x^{2018}}{1-x}$$
Multiply both sides by $x$:$$x+2x^2+3x^3+\dots+2018x^{2018}=\frac{x-x^{2020}}{{(1-x)}^2}-\frac{2019x^{2019}}{1-x}$$
and differentiate again w.r.t. it:
$$S'=1+4x +9x^2 +16x^3+...+2018^2 x^{2017}$$
On the right hand side,
$$S'=\frac{2(x-x^{2020})}{(1-x)^3}+\frac{1-2020x^{2019}-2019x^{2019}}{(1-x)^2}-\frac{2019^2x^{2018}}{1-x}$$
Now, realising $\epsilon$ is a root of unity of order 2018, with
$$\begin{cases}
  \epsilon^{2018} = 1 \\
  \epsilon^{2019} = \epsilon \\
  \epsilon^{2020} = \epsilon^2 \text{,} \\
\end{cases}$$
you then have$$\begin{align}S&=\frac{2(\epsilon-\epsilon^2)}{(1-\epsilon)^3}+\frac{1-2020\epsilon-2019\epsilon}{(1-\epsilon)^2}-\frac{2019^2}{1-\epsilon}\\
&=\frac{2\epsilon+1-2020\epsilon-2019\epsilon-2019^2+2019^2\epsilon}{(1-\epsilon)^2}\\&=\frac{2018^2\epsilon+(1+2019)(-2018)}{(1-\epsilon)^2}\\&=\frac{2018(2018\epsilon-2020)}{(1-\epsilon)^2}\end{align}$$
Comment: A correct sum gives you a correct answer. Also, don't plug in $\epsilon$ until you have the desired sum because there's something to "carry".
Comment: glad to help  . .
Answer: Here is a way through.
You have $s=1+ \dots +x^{2018}$ so that $(xs')'=xs''+s'=x+4x^2+\dots +(2018)^2x^{2017}$
Lets do the general case with $n$ instead of $2018$ so that:
$$s=\frac {x^{n+1}-1}{x-1}=\frac {p(x)}{q(x)}$$
Now note that evaluating at $\epsilon$ where $\epsilon^n=1$ we have  $p(\epsilon)=q(\epsilon)$, $p'(\epsilon)=n+1$ and $\epsilon p''(\epsilon)=n(n+1)$. We have also $q'(x)=1$, and $q''(x)=0$ which can be applied before evaluating.
Next we take the necessary derivatives $$s'=\frac {p'q-pq'}{q^2}=\frac {p'q-p}{q^2}$$
and $$(xs')'=\left(\frac{xp'q-xp}{q^2}\right)'=\frac{\left(p'q+xp''q+xp'-p-xp'\right)q^2-2q\left(xp'q-xp\right)}{q^4}$$
Now we can evaluate at $\epsilon$ using the simplifications noted earlier so that the numerator becomes $$\left((n+1)q+n(n+1)q-q\right)q^2-2q^2\epsilon n=$$$$=(n^2+2n)q^3-2q^2\epsilon n$$ and taking out a factor of $q^2$ to cancel with the denominator, and setting $q=\epsilon -1$ we get a numerator of $$n^2\epsilon-n(n+2)$$
as required.
I think this simplifies the calculations somewhat. The trick of putting $n$ instead of a large constant can, in appropriate cases, save quite a lot of writing in this kind of question and can also help to illuminate what is going on, as some of the cancellations and factorisations may be more obvious.


Approver unable to edit the assigned record

Question: I've a three level approval process. When I initially submit a record to level 1, level 1 approver checks the record and approves it to level 2, during the  level 2 approval process, assigned approver inputs details in the fields of assigned visualforce record which are required for level 3 approver. However, during the level 2 process, the assigned approver was only able to edit the record once. If he tries to edit the record again (before approving it to level 3), it says insufficient privilage. This issue is really getting on my nerves. I would really appreciate if any one can help me. I've given the necessary view/edit permissions, record editablity for all concerned approvers but I'm only able to edit/save the record once. It's the same issue with all the approvers.
Answer: It sounds to me as though this is "working as designed". During an approval process, records are locked. You can't allow users to edit them multiple times unless a user first "recalls" the approved request and then resubmits it. See the KB Article Current Approver unable to edit locked record after updating record editability for an Approval Process for more on the topic.
Comment: Hello, thanks for your inputs. Let me explain it clearly once again. Say, the record is in level 2 approval step, the assigned level 2 approver inputs the details in the field and saves the record (hasn't approved it yet). However, he realizes just after saving the record, that he has to add extra information to the same field. After inputting the extra information, he is now unable to save the record. It says insufficient privileges. I'm unable to understand why he is getting the error, when he's trying to save the record second time.
Comment: @ShashankN Again, I refer you to that Kb article. The approver only gets one shot at editing the record. If the approver wants to edit it a 2nd time, it needs to be called back and resubmitted.


Did Bhima drink the blood of Duhsasana in the Mahabharata war?

Question: It is said that Bhima drank the blood of Duhsasana in the Mahabharata war.
Please post the relevant verses from the Mahabharata about this.
Answer: Yes, he did. From Bibek Debroy's translation based on the Critical Edition of the Mahābhārata:

Karna-Vadha Parva
Chapter 1211 (61)
Sanjaya said, "Prince Duhshasana accomplished an extremely difficult
  task in that tumultuous battle. He severed Bhima's bow with a
  razor-sharp arrow and pierced his charioteer with six arrows. In an
  instant, the great-souled one then struck Bhimasena with many
  excellent arrows. Bhimasena hurled a fierce club towards him. It
  struck Duhshasana and flung him a distance of ten bow-lengths away,
  rendering him like a wounded elephant with shattered temples. He was
  struck and fell down, trembling. O Indra among kings! It slew his
  horses and charioteer and having crushed the horses and the chariot,
  fell down. His armour, ornaments and garments were destroyed and,
  completely immobile, he shrieked in pain. The spirited Bhimasena
  remembered all the acts of enmity that had been performed by your
  sons. He jumped down from the chariot onto the ground and eagerly
  looked at him. He grasped an extremely sharp sword and placed it
  against the throat of the trembling one. He tore apart the breast of
  the one who had fallen down on the ground and drank the warm blood. He
  repeatedly savoured the taste.
Then, excessively angry, he glanced at him and spoke these words.
  'This is superior to mother's milk, honey, clarified butter,
  well-prepared liquor, celestial water and skimmed and churned milk. It
  is my view today, that the blood of my enemies is tastier than all of
  these.' He again repeated these cheerful and eloquent words.
Whoever saw Bhimasena in that state then, fell down in distress and in
  fear. men the men fell down there, the weapons also fell down from
  their hands. Others were terrified and glanced at him with half-open
  eyes, uttering loud lamentations of woe. All those who saw Bhima drink
  Duhshasana's blood were terrified and miserable and ran away in
  different directions. They said, 'This one is not human.'
In the hearing of the brave ones in the world, he spoke these words.
  'O worst of men! I am drinking the blood from your throat. In great
  rage, you repeatedly called us cattle. When I was asleep in
  Pramanakoti, you fed me poison and made me suffer the hardship of
  being bitten by serpents. You burnt us down in the house of lac. You
  robbed our kingdom through a gambling match and made us dwell in the
  woods. We were robbed of the happiness in our homes and suffered from
  weapons in battle. There were many other hardships and we have never
  known any joy. Dhritarashtra and his son have always acted maliciously
  towards us.' O king! O great king! Having spoken these words,
  Vrikodara, who had obtained victory, again spoke these words to
  Keshava and Arjuna. 'O brave ones! I had taken a vow about Duhshasana
  in the battle. I have accomplished that today. I will accomplish the
  second vow now too, that of killing Duryodhana like a sacrificial
  animal. In the presence of the Kouravas, I will press down the
  evil-souled one's head with my foot and obtain peace.'
Having spoken these words, he cheerfully roared, blood streaming from
  his body. The extremely powerful and great-souled one danced, like the
  one with one thousand eyes after Vritra's death."

Here are the Sanskrit verses for the same chapter:

Book 8
Chapter 61

[s]
  tatrākarod duṣkaraṃ rājaputro; duḥśāsanas tumule yudhyamānaḥ
  ciccheda bhīmasya dhanuḥ kṣureṇa; ṣaḍbhiḥ śaraiḥ sārathim apy avidhyat
tato 'bhinad bahubhiḥ kṣipram eva; vareṣubhir bhīmasenaṃ mahātmā
  sa vikṣaran nāga iva prabhinno; gadām asmai tumule prāhiṇod vai
tayāharad daśa dhanvantarāṇi; duḥśāsanaṃ bhīmasenaḥ prasahya
  tayā hataḥ patito vepamāno; duḥśāsano gadayā vegavatyā
hayāḥ sasūtāś ca hatā narendra; cūrṇīkṛtaś cāsya rataḥ patantyā
  vidhvastavarmābharaṇāmbara srag; viceṣṭamāno bhṛśavedanārtaḥ
tataḥ smṛtvā bhīmasenas tarasvī; sāpatnakaṃ yat prayuktaṃ sutais te
  rathād avaplutya gataḥ sa bhūmau; yatnena tasmin praṇidhāya cakṣuḥ
asiṃ samuddhṛtya śitaṃ sudhāraṃ; kaṇṭhe samākramya ca vepamānam
utkṛtya vakṣaḥ patitasya bhūmāv; athāpibac choṇitam asya koṣṇam
  āsvādya cāsvādya ca vīkṣamāṇaḥ; kruddho 'tivelaṃ prajagāda vākyam
stanyasya mātur madhusarpiṣo vā; mādhvīka pānasya ca satkṛtasya
  divyasya vā toyarasasya pānāt; payo dadhibhyāṃ mathitāc ca mukhyāt
  sarvebhya evābhyadhiko raso 'yaṃ; mato mamādyāhita lohitasya
evaṃ bruvāṇaṃ punar ādravantam; āsvādya valgantam atiprahṛṣṭam
  ye bhīmasenaṃ dadṛśus tadānīṃ; bhayena te 'pi vyathitā nipetuḥ
ye cāpi tatrāpatitā manuṣyās; teṣāṃ karebhyaḥ patitaṃ ca śastram
  bhayāc ca saṃcukruśur uccakais te; nimīlitākṣā dadṛśuś ca tan na
ye tatra bhīmaṃ dadṛśuḥ samantād; dauḥśāsanaṃ tadrudhiraṃ pibantam
  sarve palāyanta bhayābhipannā; nāyaṃ manuṣya iti bhāṣamāṇāḥ
śṛṇvatāṃ lokavīrāṇām idaṃ vacanam abravīt
  eṣa te rudhiraṃ kaṇṭhāt pibāmi puruṣādhama
  brūhīdānīṃ susaṃrabdhaḥ punar gaur iti gaur iti
pramāṇa koṭyāṃ śayanaṃ kālakūṭasya bhojanam
  daśanaṃ cāhibhiḥ kaṣṭaṃ dāhaṃ ca jatu veśmani
dyūtena rājyaharaṇam araṇye vasatiś ca yā
  iṣvastrāṇi ca saṃgrāmeṣv asukhāni ca veśmani
duḥkhāny etāni jānīmo na sukhāni kadā cana
  dhṛtarāṣṭrasya daurātmyāt saputrasyā sadā vayam
ity uktvā vacanaṃ rājañ jayaṃ prāpya vṛkodaraḥ
  punar āha mahārāja smayaṃs tau keśavārjunau
duḥśāsane yad raṇe saṃśrutaṃ me; tad vai sarvaṃ kṛtam adyeha vīrau
  adyaiva dāsyāmy aparaṃ dvitīyaṃ; duryodhanaṃ yajñapaśuṃ viśasyā
  śiromṛditvā ca padā durātmanaḥ; śāntiṃ lapsye kauravāṇāṃ samakṣam
etāvad uktvā vacanaṃ prahṛṣṭo; nanād acoccai rudhirārdragātraḥ
  nanarta caivātibalo mahātmā; vṛtraṃ nihatyeva sahasranetraḥ


Anyone can ID this "FCI" connector in a Fiat 500 parking light?

Question: I'm looking to replace the terminals but can't even ID the connector. Can get a connector kit from the dealer for $70 but just need one 50 cent terminal.
Comment: This might be one of those cases where a wrecking yard is your best option. Jeep Cherokee seems to use a similar connector.
Comment: Yes that is my second choice. I got the light itself from the junkyard but didn't think I would need the connector then.
Answer: I was searching for nearly the same connector (black instead of green) for fixing a problem on my Fiat Panda and also had only found quite expensive connectors and adapters for down to 20 Euros.
The number "PA66..." on the violet plate has mislead me a little.
It is the number of the used plastic material...
Finally I found on a distributors site (automotive-connectors com) only the violet "secondary lock" with the number "FCI 17260874".
For this I found 17260851, the male counterpart of the connector housing on the photo. A little more searching and I found the female variant...
The 17260855 should be the green female housing as on the photo, with 17260879, the secondary lock. The part numbers 211CC2S2161 and 17062010 are examples for the crimp connectors (taken from the datasheet of the connector housing).
They seem to be the same as in the infamous grey connector (headlights failed) on the Fiat Panda body computer.
The part numbers may help to find the data sheets provided by the electronics distributor with the "M".
BTW: according to the data sheets, both connector sides should have a silicon gasket. I hope these were not forgotten by Fiat during assembly...


"Opensource" equivalent for hardware

Question: Generally being open source is a description for software and computer programs. What should be called a hardware device, robot, etc. that people could freely take benefits of that and manipulate its operations, algorithms and control mechanisms?
Comment: I'd still call that _open source_. The 'source' doesn't have to be source _code_: it can be a source design, mechanism, content, etc. There may be a more specific term that I'm not aware of, but I don't think too many people would look askance at you if you just called it open source.
Comment: @JanusBahsJacquet, Thanks for the comment, but isn't there any problem with this term in the scientific community?
Comment: Not that I'm aware of. There may be in some scientific circles, but none that I've circled in.
Comment: Do you mean that everyone can come along and change the same robot, or that everyone can build their own robot using the freely available plans and instructions?
Comment: @MaxWilliams, Anyone can submit his designed algorithm (robot control, navigation and path planning) to apply on real robot, then he will receive the result.
Comment: That's just called "providing a service".  This is literally how computers used to used, before personal computers came along - you'd send your program and get the results back.
Answer: Open-source hardware — Wikipedia

Open-source hardware (OSH), consists of physical artifacts of technology designed and offered by the open design movement. Both free and open-source software (FOSS) as well as open-source hardware is created by this open-source culture movement and applies a like concept to a variety of components.
It is sometimes, thus, referred to as FOSH (free and open-source hardware). The term usually means that information about the hardware is easily discerned so that others can make it - coupling it closely to the maker movement. Hardware design (i.e. mechanical drawings, schematics, bills of material, PCB layout data, HDL source code and integrated circuit layout data), in addition to the software that drives the hardware, are all released under free/libre terms.
The original sharer gains feedback and potentially improvements on the design from the FOSH community. There is now significant evidence that such sharing can drive a high return on investment for investors.

"Opensource" equivalent for hardware


MATLAB installation using Software Center

Question: I tried to install MATLAB on Ubuntu 14.04 (Trusty Tahr) using software center, but I couldn't embed MATLAB with it. How do I install MATLAB on Ubuntu 14.04 64-bit using Software Center?
Answer: The package called 'Matlab' in Software Center is actually just an integration package (called matlab-support). As explained in the package description (apt-cache show matlab-support):
 This package does not provide MATLAB. Instead, it configures an
 existing MATLAB installation to integrate more comfortably in
 a Debian installation.
 .
 Currently it provides /usr/bin/matlab through the alternatives
 system, offers to work around incompatibilities between the libraries
 bundled with MATLAB and system libraries, and provides a helper
 utility meant to be used by other packages to compile MEX extensions.
 .
 Install this if you would like your MATLAB installation to behave more
 like an ordinary Debian package. Other packages may depend on
 this one if they install MATLAB code, for example in order to
 compile MEX extensions.

You will need to obtain your own licensed copy of Matlab for Linux first.
Answer: MATLAB is not free, and Linux distributions usually do not include limited demos, because of the amount of work it requires to bundle.
If you want to try something free and open, and MATLAB-like, try Octave or QtOctave (Octave + GUI). It uses the same dialect as MATLAB and the base math & graphs package are identical to MATLAB. It lacks in extensions however.
If you're in statistics, then another cool tool is IPython Notebook, found at
http://ipython.org/ipython-doc/dev/notebook/. It's nice because you learn two in one. A good tool for math/stats and a respected and used programming language at the same time.
Comment: Thank you for the edits. I will make a habit of answering with full details next time.


Could a plant grow on a building taller than mount Everest?

Question: I was wondering if it was possible to potentially grow a plant on a building taller than mount Everest. I mean on as in bottom to top with grass or some other plant. Would the grass run out of oxygen or would it live but be partially dead? If it is possible how could it be done?
Comment: A repeat to all close voters.  **This is not off topic.**  Though the question could use a little more detail/explanation.
Comment: Hello there!  I expect your question would garner better attention on a different stack exchange site, like perhaps [Biology](https://biology.stackexchange.com/).  Here on Worldbuilding we are generally focused on fictional worlds.  Please visit the [Help Center](https://worldbuilding.stackexchange.com/help) for more information.
Comment: Are we talking about a plant being grown on the roof of the building, or a plant covering an entire wall of this building? By the way, the building reaches taller than Mt Everest, but where does it start? At K2's summit, at sea level, or somewhere in between?
Comment: @MozerShmozer As a general rule if a poster chooses WB over one of the science based sites we let the poster make that choice.  Making a suggestion that it be moved it is fine but we wouldn't consider it on topic.
Comment: Just a heads up, Kilauea is taller than the Everest. But its base is underwater, so it is not as high as the Everest. Do you really mean tall, or did you mean high?
Comment: Plants can survive in thin atmosphere, but they can't actually grow in temperatures below freezing. You need a mechanism for for your plant to get thawed.
Comment: @MozerShmozer I imagine that on biology.stackexchange the answer will be a quick "no". Here in worldbuilding we at least have much more room to play with possibilities.
Comment: @Alexander see the link in my answer, you may be surprised.
Answer: Yes it could.
You have two issues here, pressure and temperature. For pressure, see this question on a sister site:
What is the lowest pressure at which plants can survive? — it turns out that with the right kind of plant, this limit is at 1/10 of Earth 's sea level pressure; and with lichens you can even get lower, to the pressure of Mars. Since it's a building, I assume you want a garden. For small plants this is doable; you could have grass and some flowers.
The other issue is temperature. This NASA article suggests that by using bacteria genes we can have plants grow in really cold conditions. But hey! It is a building! You can shield the roof garden from wind and use chimneys to provide heat. With a building so tall you will have a lot of waste heat from water pumps, elevator engines, air conditioning and so on. Heating a garden seems like a really reasonable idea to put all that waste heat to good use.
If you want all surfaces covered with plants, that's also possible. The lower the better for them. Higher up you need to provide more heat. The Square cube law saves the day; with a building so big you're going to have more volume per surface square meter than modern buildings. This means heating the walls could make sense. Water would start to be an issue, but it is doable. A civilization able to build something this tall for sure would have pumps etc figured out. Make terraces every meter or so, with porous substance in place of earth and keep it moist for plants to use.
Comment: If I'm reading the question correctly, OP is looking for a way to have the plant grow up the outside surface of the building, from bottom to top, like how climbing ivy will do.
Comment: @AndyD273 I don't see how this invalidates anything I wrote, the lower the better and he will have a lot of excess heat. I'll add a paragraph about that case, why not. Wait a minute please.
Comment: I wasn't saying your answer was wrong, just pointing it out as the way it was written wasn't as clear as it could be.
Comment: @AndyD273 better?
Comment: Looks fine to me, for what that's worth
Comment: What about oxygen?
Comment: @JoelCoehoorn I believe that's covered under the umbrella of "pressure" since that's essentially "How much gas is there around". I also imagine the  bigger problem would be CO2 since this is what plants primarily metabolise.
Comment: @Mołot: It does invalidate the answer, because a climbing plant must bring water up from its roots.  The limit to that is a bit over 100 m - the height of the tallest redwoods.
Comment: It's not hard to imagine that such a plant would create new roots periodically at various points in the climb to get nutrients more locally.
Comment: @jamesqf that's why I added last paragraph and mentioned man made pumps.
Comment: @JoelCoehoorn detailed biological answers are on biology stack (linked) but it looks like it would be hard, but doable for plants in terms of both CO2 and O2 under lower pressure.
Answer: If you mean to grow on the outside of the building, like a climbing vine, I think the answer is probably yes.
Oxygen is one of the limiting factors, but the bigger one is heat, since a frozen plant can't grow. Both factors can be solved though. The upper floors will have to be heated and pressurized for human habitation. If the building isn't well sealed then warm, moist air will be leaking out, along with radiant heat coming from the building, which could be enough for the plant to survive, especially if it is something well adapted for high altitude.
Over time roots would dig into the gaps, letting more air out, and giving the plant more warmth.
It would be horribly inefficient and expensive, but maybe they have really cheap energy and so don't care.
Comment: Usually plants metabolise CO2 rather than oxygen, but that doesn't invalidate your answer at all since the air from inside the building will necessarily contain normal levels of the stuff.
Comment: @neophlegm Actually plants do metabolize molecular oxygen. They take in carbon dioxide in order to produce starch, but when they need energy (as all living things do), they must use oxygen to break down that starch. In the day they consume _net_ CO2, and at night they consume _net_ O2. Embryophyte catabolism involves good old aerobic respiration.
Comment: @neophlegm Good point. I should have used the word air instead of oxygen. Plants don't do well at super low air pressure, so having a supply that is escaping the building will help with that.
Answer: Not all the way to the top
Plants do not live at the top of the tallest mountains. Gymnostomum aeruginosum, a moss, was found at 6480 meters on Mount Everest; while Arenaria bryophylla is the highest flowering plant at 6180 meters on the same mountain.
Meanwhile, there are several mountains over 8000 meters. They are often covered in snow, so I did some investigation. I found a ledge of clearly flat, non-snow covered land near the top of Mount Everest at 27.98767 N, 86.91939 E. Checking with an altitude tool, this ledge is at 8220 plus or minus 20 meters, and about 100 meters across. There are many similar ledges nearby.
Since there are no mosses living at this altitude, or within 2000 meters of this altitude where there is evidently plenty of space not covered by snow in the summertime, I conclude that plants won't live this high as they are currently designed.  If your building goes over ~6000 meters, there won't be much plant life that can survive on it.
Comment: If you read the other answers, you see that the reason things don't normally grow that high isn't because of the air pressure but because of the temperature. If the building surface were heated, this could allow some kinds of plants to grow.
Comment: I also like the suggestion in Andy's answer that air from inside the building could well leak-out, providing enough CO2 (and sometimes O2) for the plants to survive.
Answer: Not a "conventional" plant.
A self-sustaining plant could not grow so tall because it would need to withstand too high a compressive stress (a column of wood 8 kilometers tall generates pressures in the order of the hundreds of atmospheres).
A vine, relying on the building for support, still could not do it because bringing water and mineral salts from the roots all the way to the top is a losing proposition. A 2m vine can need as little as half a liter of water per day, but a vine 8000 m tall would need somewhere around two cubic meters of water per day, which raises three problems: how to absorb that through the root system? How to supply the root system with enough energy to perform the task? And is there even that much water available to be pulled?
A lichen/moss carpet could. Nutrient transport could be as slow as needed, it would just limit growth rate; water would be gathered from the atmosphere, and sunlight is available everywhere. With no leaves, water loss and cold are much less of a problem.
Going up, dryness is going to be a problem, so we'd need some sort of slow water transport as well, and the lichen organization seems more promising: there are lichens surviving in the extreme cold. Low pressure and low oxygen are not a problem, they would just slow the growth rate, but the organism would simply gather what little CO2 might be available and accumulate it.
Answer: A plant needs to pump nutrients from the soil to every part of its "body", so you have a really big problem. You might be interested in Geoffrey West's new book Scale: The Universal Laws of Growth, Innovation, Sustainability and the Pace of Life in Organisms, Cities, Economies, and Companies, which goes into some of the issues. Also check out his TED talk.
Tallness is an obvious advantage (monopolize sunlight), so if evolution hasn't grown a plant that big, it's a strong hint that it is very difficult - borderline impossible.
Comment: While the links may provide an answer, it's better if you can also put something in writing.
Answer: Me, I'd suggest a slight parabolic space holding water that has typical in-water plants growing at that height. The shallow water at the perimeter would warm the water to prevent freezing & providing movement would also contribute to that. Fish? The oceans are extremely deep & COLD & yet full of life all the way down. Would this body of water know where it was?


How to convert Html files to Pdf?

Question: The title say it all, I want a 100% accurate tool to convert a HTML page to a PDF document.
Comment: Through which rendering engine?
Comment: Don't we all...
Answer: Check out wkhtmltopdf. It uses the Webkit layout engine (as used in Safari, Chrome, etc.).
Comment: +1 good answer, wkhtml even waits until jscript code is done with the dom (nice for asciidoc-toc stuff)
Comment: I've been using NitroPDF for a couple years.  Just found wkhtmltopdf, it works better, is faster and runs on ubuntu.
Comment: This didn't work for me on OS X. It would never finish 'rendering'. A very similar program did work, called [wkpdf](http://plessl.github.com/wkpdf/)
Comment: Been looking for something like this for a number of hours now - thank you!
Comment: i use it in ubuntu . works great but somt pictures are not in the output. my not perfect workaround: `cutycapt --url=https://stackoverflow.com/cv/sl5net --out=traditional_sl5net.jpg --print-backgrounds=on && img2pdf traditional_sl5net.jpg -o traditional_view.pdf`
Answer: Consider the fact that no two browsers can render that HTML completely identically for a moment, and then realize that you're never going to get it.
Comment: Well, if you interpret "100% accurate" to mean "exactly as rendered in a specific browser", then you can most definitely get that.
Comment: @Michael: Sure, but that information wasn't included in the question.
Answer:
Install a virtual printer driver that saves print output as PDF
Open HTML in browser
Printo to virtual printer
Comment: nice workaround, I'll try it
Comment: Be aware that depending on the browser you're using, the settings in it, and the webpage, some parts of the printed PDF page won't be 100% what you see on screen. Obvious things to look for, if you have a dark/black background set with light/white text over it, default print settings in most browsers will change that to black text with white background.
Comment: Yes, this won't be 100% accurate, results will vary from page to page.
Comment: @MichaelBorgwardt: AFAIK, virtual printers do not [fully support HTML links](http://www.novapdf.com/kb/create-active-pdf-links-using-novapdf-professional-68.html), right?
Answer: I use Primo PDF to convert HTML to PDF. it's just a PDF Printer.
File > Print > Choose primo PDF

It's useful one for me because I couldn't use the Internet everything. If I want to read some articles from Wiki, I've printed out with that printer and read at home.
Answer: I've been looking for this too. My best solution at the moment is to use a combination of Firefox and PDFCreator. I've also tried the other main browsers, but they don't let you turn off their own headers and footers. If you want to be able to print grey/gray text as grey (rather than black) then be sure to enable the "Print Background (color and images)" option in the File | Page Setup | Format & Options dialog.
Unfortunately, none of the main browsers seem to support the CSS @page rule for specifying things like headers, footers, widows, orphans, page sizes, landscape/portrait, etc.
There is a tool called Prince that claims to be able to do all of that (and more), with good reviews, but I haven't used it because it's expensive. (There is a free version for personal use, but it adds its own logo onto the front page of the PDF document.)
Answer: wkpdf worked perfectly for me when wkhtmltopdf did not, on OS X. It's a Ruby Gem, which was very simple to use on a stock OS X install.
Answer: if you use Ubunto.
today i using img2pdf:
sudo apt-get install -y cutycapt
sudo apt-get install -y img2pdf
cutycapt --url=https://stackoverflow.com/story/sl5net --out=story_sl5net.jpg --print-backgrounds=on && img2pdf story_sl5net.jpg -o story_sl5net.pdf

my problem is that no automatic page breaks are created when converting
for OCR i using https://wiki.ubuntuusers.de/Paperwork/
Maybe also very helpful way to do this:
https://github.com/Szpadel/chrome-headless-render-pdf

How to convert Html files to Pdf?


pdflib - sh: phpize: command not found

Question: I need my website to generate a pdf file.  I was planning on using PDFlib.  When I try install it through the PEAR graphic interface, I get the error message "sh: phpize: command not found".  Does anyone have any suggestions?
Comment: Most likely you need the PHP development libraries. On Debian-derived systems, it'd be something like `apt-get install php5-dev`.
Comment: OK, so maybe I am really going to showcase my ignorance, but I don't know where to go to access a command line.
Comment: I can't get onto an Ubuntu console right now, but going off vague memories, it's under System -> Terminal or something like that. Even if you can't get to a shell, there's always GUI package managers like Synaptic from which you can do the install.
Answer: As noted by Marc B, you should have in your system a package containing the files needed for building PHP extensions (php-devel, usually).
On my Centos system you should type this command as root in a terminal:
yum install php-devel

This should work on Red Hat and Fedora, by the way.
On Debian or Ubuntu the command is slightly different:
sudo apt-get install php5-dev

If you want to start a terminal, the steps required depend on your desktop environment. Usually on Ubuntu users get Unity installed, so:
 Dash -> More Apps -> Accessories -> Terminal

On Gnome3:
 Applications menu -> Accessories -> Terminal

The keyboard shortcut is the same on both environment: Ctrl  + Alt  + T .
For other DEs take a look at this doc: https://help.ubuntu.com/community/UsingTheTerminal

pdflib - sh: phpize: command not found


having trouble in tabbar in android?

Question: i am new in android.
i am using android fragment tab .i follow the following tutorial.
http://maxalley.wordpress.com/2013/05/18/android-creating-a-tab-layout-with-fragmenttabhost-and-fragments/
but problem is that i have more than one activities in on tab now what am missing.
i mean i have Tab1 : activity A-->activity B--> activity c -->
any body can help me?
Answer: Hi please follow the link
Hope it will solve yours problem.
https://github.com/rameshkec85/BottomTabsFragmentTabHost
https://github.com/Balaji-K13/Navigation-drawer-page-sliding-tab-strip

having trouble in tabbar in android?


What is hybrid suspend

Question: What is hybrid suspend?
Please also add other info such as packages, etc. A how-to would be great too.
Comment: How to is already available on AU: http://askubuntu.com/questions/145443/how-do-i-use-pm-suspend-hybrid-by-default-instead-of-pm-suspend
Comment: Thanks. Any idea what it is exactly?
Comment: Yes it is a special kind of suspend. some more info here: http://askubuntu.com/questions/1685/whither-hybrid-suspend see the comment with (now) +3
Answer: <code>   pm-suspend-hybrid
       Hybrid-suspend is the process where the system does everything it
       needs to hibernate, but suspends instead of shutting down. This
       means that your computer can wake up quicker than for normal
       hibernation if you do not run out of power, and you can resume even
       if you run out of power. s2both(8) is an hybrid-suspend
       implementation.
</code>
Answer: Hybrid suspend is when your computer does suspend-to-disk and suspend-to-RAM at the same time. So you get the fast resume speed of suspend-to-RAM, but you don't lose your session if you lose power or run out of battery. So in principle, it's better than either suspend-to-ram or suspend-to-disk alone.
From this question
Thanks to Rinzwind for the comment

What is hybrid suspend


What are the differences of Phala Samapatti between each stage of sainthood?

Question: What are the differences of Phala Samapatti between each stage of sainthood? The fruit of each stage of Sainthood possibly would be different. Hence there would be some distinction and differences between the stages of sainthood.
Answer: The fruition consciousnesses are classified as being resultant consciousnesses (vipākacittāni) so they differ based on what the wholesome consciousness produce them, so the difference between the fruit of a stream-enterer and a sakadagamin is the wholesome consciousness that causes them. For the fruit of stream entry, the wholesome consciousness that causes it is the path consciousness of stream entry, and for a sakadagamin it is the path consciousness of a sakadagamin.
Then one will wonder what is the difference between the different path consciousnesses. That is an easier question to answer. It is the path consciousnesses that cut through the fetters. The path consciousness of stream entry cuts through the first three fetters, the path consciousness of a sakadagamin weakens desire and ill-will, etc...
For more information on this I would recommend reading §26 and §27 of A Comprehensive Manual of Abhidhamma and chapter 22 of the Visuddhimagga. Both of these books are freely and legally available online as PDFs.
Answer: This describes different stages of Phala Samapatti
Here is the Phala Samapatti progessions http://www.palikanon.com/english/practice_insight/characteristics_of_forgetting.htm
Comment: Please avoid posting link answers. The question should be addressed in the answer itself.


What is the difference between user and kernel modes in operating systems?

Question: What are the differences between User Mode and Kernel Mode, why and how do you activate either of them, and what are their use cases?
Comment: @SalvadorDali hi, current consensus is to close by "quality": http://meta.stackexchange.com/questions/147643/should-i-vote-to-close-a-duplicate-question-even-though-its-much-newer-and-ha Since "quality" is not measurable, I just go by upvotes. ;-) Likely it comes down to which question hit the best newb Google keywords on the title. I encourage you to simply copy your answer there with a disclaimer added at the bottom, and link from this one, in case it closes.
Comment: Possible duplicate of [What is the difference between the kernel space and the user space?](https://stackoverflow.com/questions/5957570/what-is-the-difference-between-the-kernel-space-and-the-user-space)
Comment: @CiroSantilli709大抓捕六四事件法轮功 a question which was asked 7 years ago can't be a closed as a duplicate for a question asked 6 years ago. If they are really duplicates, the closure should be other way around.
Answer:

Kernel Mode
In Kernel mode, the executing code has complete and unrestricted
  access to the underlying hardware. It
  can execute any CPU instruction and
  reference any memory address. Kernel
  mode is generally reserved for the
  lowest-level, most trusted functions
  of the operating system. Crashes in
  kernel mode are catastrophic; they
  will halt the entire PC.
User Mode
In User mode, the executing code has no ability to directly access
  hardware or reference memory. Code
  running in user mode must delegate to
  system APIs to access hardware or
  memory. Due to the protection afforded
  by this sort of isolation, crashes in
  user mode are always recoverable. Most
  of the code running on your computer
  will execute in user mode.

Read more
Understanding User and Kernel Mode
Comment: @JackieLam : It should be in the kernel mode.
Comment: Wonder when the CPU is running operating system code, which mode is the processor in?
Comment: So per se, To run a __user space__ process, it must be mapped to __kernel space__?
Comment: @rahul I doubt reference memory can be obtained by user mode or that the simplest manipulate data will result in expensive mode change in a language like java.
Answer: These are two different modes in which your computer can operate. Prior to this, when computers were like a big room, if something crashes – it halts the whole computer. So computer architects decide to change it. Modern microprocessors implement in hardware at least 2 different states.
User mode:

mode where all user programs execute. It does not have access to RAM
and hardware. The reason for this is because if all programs ran in
kernel mode, they would be able to overwrite each other's memory. If
it needs to access any of these features – it makes a call to the
underlying API.  Each process started by windows except of system
process runs in user mode.

Kernel mode:

mode where all kernel programs execute (different drivers). It has
access to every resource and underlying hardware. Any CPU instruction
can be executed and every memory address can be accessed. This mode
is reserved for drivers which operate on the lowest level

How the switch occurs.
The switch from user mode to kernel mode is not done automatically by CPU. CPU is interrupted by interrupts (timers, keyboard, I/O). When interrupt occurs, CPU stops executing the current running program, switch to kernel mode, executes interrupt handler. This handler saves the state of CPU, performs its operations, restore the state and returns to user mode.
http://en.wikibooks.org/wiki/Windows_Programming/User_Mode_vs_Kernel_Mode
http://tldp.org/HOWTO/KernelAnalysis-HOWTO-3.html
http://en.wikipedia.org/wiki/Direct_memory_access
http://en.wikipedia.org/wiki/Interrupt_request
Comment: @JackieLam: kernel mode
Comment: Wonder when the CPU is running operating system code, which mode is the processor in?
Answer: CPU rings are the most clear distinction
In x86 protected mode, the CPU is always in one of 4 rings. The Linux kernel only uses 0 and 3:

0 for kernel
3 for users

This is the most hard and fast definition of kernel vs userland.
Why Linux does not use rings 1 and 2: CPU Privilege Rings: Why rings 1 and 2 aren't used?
How is the current ring determined?
The current ring is selected by a combination of:

global descriptor table: a in-memory table of GDT entries, and each entry has a field Privl which encodes the ring.
The LGDT instruction sets the address to the current descriptor table.
See also: http://wiki.osdev.org/Global_Descriptor_Table
the segment registers CS, DS, etc., which point to the index of an entry in the GDT.
For example, CS = 0 means the first entry of the GDT is currently active for the executing code.

What can each ring do?
The CPU chip is physically built so that:

ring 0 can do anything
ring 3 cannot run several instructions and write to several registers, most notably:

cannot change its own ring! Otherwise, it could set itself to ring 0 and rings would be useless.
In other words, cannot modify the current segment descriptor, which determines the current ring.
cannot modify the page tables: How does x86 paging work?
In other words, cannot modify the CR3 register, and paging itself prevents modification of the page tables.
This prevents one process from seeing the memory of other processes for security / ease of programming reasons.
cannot register interrupt handlers. Those are configured by writing to memory locations, which is also prevented by paging.
Handlers run in ring 0, and would break the security model.
In other words, cannot use the LGDT and LIDT instructions.
cannot do IO instructions like in and out, and thus have arbitrary hardware accesses.
Otherwise, for example, file permissions would be useless if any program could directly read from disk.
More precisely thanks to Michael Petch: it is actually possible for the OS to allow IO instructions on ring 3, this is actually controlled by the Task state segment.
What is not possible is for ring 3 to give itself permission to do so if it didn't have it in the first place.
Linux always disallows it. See also: Why doesn't Linux use the hardware context switch via the TSS?

How do programs and operating systems transition between rings?

when the CPU is turned on, it starts running the initial program in ring 0 (well kind of, but it is a good approximation). You can think this initial program as being the kernel (but it is normally a bootloader that then calls the kernel still in ring 0).
when a userland process wants the kernel to do something for it like write to a file, it uses an instruction that generates an interrupt such as int 0x80 or syscall to signal the kernel. x86-64 Linux syscall hello world example:
.data
hello_world:
    .ascii "hello world\n"
    hello_world_len = . - hello_world
.text
.global _start
_start:
    /* write */
    mov $1, %rax
    mov $1, %rdi
    mov $hello_world, %rsi
    mov $hello_world_len, %rdx
    syscall

    /* exit */
    mov $60, %rax
    mov $0, %rdi
    syscall

compile and run:
as -o hello_world.o hello_world.S
ld -o hello_world.out hello_world.o
./hello_world.out

GitHub upstream.
When this happens, the CPU calls an interrupt callback handler which the kernel registered at boot time. Here is a concrete baremetal example that registers a handler and uses it.
This handler runs in ring 0, which decides if the kernel will allow this action, do the action, and restart the userland program in ring 3. x86_64
when the exec system call is used (or when the kernel will start /init), the kernel prepares the registers and memory of the new userland process, then it jumps to the entry point and switches the CPU to ring 3
If the program tries to do something naughty like write to a forbidden register or memory address (because of paging), the CPU also calls some kernel callback handler in ring 0.
But since the userland was naughty, the kernel might kill the process this time, or give it a warning with a signal.
When the kernel boots, it setups a hardware clock with some fixed frequency, which generates interrupts periodically.
This hardware clock generates interrupts that run ring 0, and allow it to schedule which userland processes to wake up.
This way, scheduling can happen even if the processes are not making any system calls.

What is the point of having multiple rings?
There are two major advantages of separating kernel and userland:

it is easier to make programs as you are more certain one won't interfere with the other. E.g., one userland process does not have to worry about overwriting the memory of another program because of paging, nor about putting hardware in an invalid state for another process.
it is more secure. E.g. file permissions and memory separation could prevent a hacking app from reading your bank data. This supposes, of course, that you trust the kernel.

How to play around with it?
I've created a bare metal setup that should be a good way to manipulate rings directly: https://github.com/cirosantilli/x86-bare-metal-examples
I didn't have the patience to make a userland example unfortunately, but I did go as far as paging setup, so userland should be feasible. I'd love to see a pull request.
Alternatively, Linux kernel modules run in ring 0, so you can use them to try out privileged operations, e.g. read the control registers: How to access the control registers cr0,cr2,cr3 from a program? Getting segmentation fault
Here is a convenient QEMU + Buildroot setup to try it out without killing your host.
The downside of kernel modules is that other kthreads are running and could interfere with your experiments. But in theory you can take over all interrupt handlers with your kernel module and own the system, that would be an interesting project actually.
Negative rings
While negative rings are not actually referenced in the Intel manual, there are actually CPU modes which have further capabilities than ring 0 itself, and so are a good fit for the "negative ring" name.
One example is the hypervisor mode used in virtualization.
For further details see:

https://security.stackexchange.com/questions/129098/what-is-protection-ring-1
https://security.stackexchange.com/questions/216527/ring-3-exploits-and-existence-of-other-rings

ARM
In ARM, the rings are called Exception Levels instead, but the main ideas remain the same.
There exist 4 exception levels in ARMv8, commonly used as:

EL0: userland
EL1: kernel ("supervisor" in ARM terminology).
Entered with the svc instruction (SuperVisor Call), previously known as swi before unified assembly, which is the instruction used to make Linux system calls. Hello world ARMv8 example:
hello.S
.text
.global _start
_start:
    /* write */
    mov x0, 1
    ldr x1, =msg
    ldr x2, =len
    mov x8, 64
    svc 0

    /* exit */
    mov x0, 0
    mov x8, 93
    svc 0
msg:
    .ascii "hello syscall v8\n"
len = . - msg

GitHub upstream.
Test it out with QEMU on Ubuntu 16.04:
sudo apt-get install qemu-user gcc-arm-linux-gnueabihf
arm-linux-gnueabihf-as -o hello.o hello.S
arm-linux-gnueabihf-ld -o hello hello.o
qemu-arm hello

Here is a concrete baremetal example that registers an SVC handler and does an SVC call.
EL2: hypervisors, for example Xen.
Entered with the hvc instruction (HyperVisor Call).
A hypervisor is to an OS, what an OS is to userland.
For example, Xen allows you to run multiple OSes such as Linux or Windows on the same system at the same time, and it isolates the OSes from one another for security and ease of debug, just like Linux does for userland programs.
Hypervisors are a key part of today's cloud infrastructure: they allow multiple servers to run on a single hardware, keeping hardware usage always close to 100% and saving a lot of money.
AWS for example used Xen until 2017 when its move to KVM made the news.
EL3: yet another level. TODO example.
Entered with the smc instruction (Secure Mode Call)

The ARMv8 Architecture Reference Model DDI 0487C.a - Chapter D1 - The AArch64 System Level Programmer's Model - Figure D1-1 illustrates this beautifully:

The ARM situation changed a bit with the advent of ARMv8.1 Virtualization Host Extensions (VHE). This extension allows the kernel to run in EL2 efficiently:

VHE was created because in-Linux-kernel virtualization solutions such as KVM have gained ground over Xen (see e.g. AWS' move to KVM mentioned above), because most clients only need Linux VMs, and as you can imagine, being all in a single project, KVM is simpler and potentially more efficient than Xen. So now the host Linux kernel acts as the hypervisor in those cases.
Note how ARM, maybe due to the benefit of hindsight, has a better naming convention for the privilege levels than x86, without the need for negative levels: 0 being the lower and 3 highest. Higher levels tend to be created more often than lower ones.
The current EL can be queried with the MRS instruction: what is the current execution mode/exception level, etc?
ARM does not require all exception levels to be present to allow for implementations that don't need the feature to save chip area. ARMv8 "Exception levels" says:

An implementation might not include all of the Exception levels. All implementations must include EL0 and EL1.
  EL2 and EL3 are optional.

QEMU for example defaults to EL1, but EL2 and EL3 can be enabled with command line options: qemu-system-aarch64 entering el1 when emulating a53 power up
Code snippets tested on Ubuntu 18.10.
Comment: Since this question isn't specific to any OS, `in` and `out` are available to ring 3. The TSS can point to an IO permission table in the current task granting read/write access to all or specific ports.
Comment: Of course you set the IOPL bits to the value 3 then the ring 3 program has full port access and the TSS IO permissions don't apply.
Comment: @MichaelPetch thanks, I didn't know this. I have updated the answer.
Answer: A processor in a computer running Windows has two different modes: user mode and kernel mode. The processor switches between the two modes depending on what type of code is running on the processor. Applications run in user mode, and core operating system components run in kernel mode. While many drivers run in kernel mode, some drivers may run in user mode.
When you start a user-mode application, Windows creates a process for the application. The process provides the application with a private virtual address space and a private handle table. Because an application's virtual address space is private, one application cannot alter data that belongs to another application. Each application runs in isolation, and if an application crashes, the crash is limited to that one application. Other applications and the operating system are not affected by the crash.
In addition to being private, the virtual address space of a user-mode application is limited. A processor running in user mode cannot access virtual addresses that are reserved for the operating system. Limiting the virtual address space of a user-mode application prevents the application from altering, and possibly damaging, critical operating system data.
All code that runs in kernel mode shares a single virtual address space. This means that a kernel-mode driver is not isolated from other drivers and the operating system itself. If a kernel-mode driver accidentally writes to the wrong virtual address, data that belongs to the operating system or another driver could be compromised. If a kernel-mode driver crashes, the entire operating system crashes.
If you are a Windows user once go through this link you will get more.
Communication between user mode and kernel mode
Answer: I'm going to take a stab in the dark and guess you're talking about Windows.  In a nutshell, kernel mode has full access to hardware, but user mode doesn't.  For instance, many if not most device drivers are written in kernel mode because they need to control finer details of their hardware.
See also this wikibook.
Comment: This is important to you as a programmer because kernel bugs tend to wreak far worse havoc than you may be accustomed to.  One reason for the kernel/user distinction is so the kernel can monitor/control critical system resources and protect each user from the others.  It's a bit oversimplified, but still helpful, to remind yourself that user bugs are often annoying, but kernel bugs tend to bring the entire machine down.
Answer: Other answers already explained the difference between user and kernel mode. If you really want to get into detail you should get a copy of
Windows Internals, an excellent book written by Mark Russinovich and David Solomon describing the architecture and inside details of the various Windows operating systems.
Answer: What
Basically the difference between kernel and user modes is not OS dependent and is achieved only by restricting some instructions to be run only in kernel mode by means of hardware design. All other purposes like memory protection can be done only by that restriction.
How
It means that the processor lives in either the kernel mode or in the user mode. Using some mechanisms the architecture can guarantee that whenever it is switched to the kernel mode the OS code is fetched to be run.
Why
Having this hardware infrastructure these could be achieved in common OSes:

Protecting user programs from accessing whole the memory, to not let programs overwrite the OS for example,
preventing user programs from performing sensitive instructions such as those that change CPU memory pointer bounds, to not let programs break their memory bounds for example.


Bubbles of Different Size

Question: Suppose that I have 2 bubbles of different sizes located in a liquid, and assume that both of those bubbles are close to one another.  What exactly will happen to both of those bubbles?  From a surface tension standpoint, I know that the smaller bubble will have higher pressure gas inside than that larger bubble.  So, would the smaller bubble be sucked into the larger bubble?  Is there a better way to explain this?  I know that, if the bubbles were attached with, say, a nanowire, then the pressure gradient would force the smaller bubble's gas into the larger bubble's, but I'm not sure what happens when they're both separated. Any insight/clarification to my interpretation would be greatly appreciated.
Comment: "but I'm not sure what happens when they're both separated" - nothing happens when they're separated...
Comment: ...........why? What if there's a thin film of liquid between them?
Comment: Can you define what you mean by: *close* and *separated?*
Comment: is there any type of fluid motion? what type of fluid? what type of bubble? are we talking about gas bubbles from you in a bathtub or bubbles in a bubble chamber? there is too many variables to give a simple "yes or no" answer to your question… if you r talking about "forever" suspended bubbles nothing should happen, but i have been wrong before
Comment: Thanks for the response.  In this case, I'm considering gas bubbles in an infinite chamber of liquid.  By close, I mean that the distance between each bubble's interface is less than each bubble's respective radius but great enough such that they don't overlap at t=0.
Comment: Do you guys agree with my answer below?
Comment: Any input on my question above?
Answer: Beautiful article (great graphics - not sure if they are photos or GCI) at http://math.berkeley.edu/~hutching/pub/bubbles.html - not sure if this addresses "your" kind of bubbles, but worth a look anyway. In general surface tension prevents bubbles from becoming a single larger bubble as there is an intermediate phase when the surface would have to be bigger. Instead they will try to share an interface (surface smaller) and that interface will be curved depending on their relative sizes (the smaller bubble is stronger and pushes the interface to the larger bubble). See the math in linked papers at the above link.
Preview from the above:
Comment: Very interesting (and well-done) graphics here; thanks for the link.
Answer: Alright, so here's how I'm thinking about the scenario now.  I'd appreciate any comments/suggestions on my logic here.  If the bubbles are close, density gradients in each bubble will cause some of the gas to diffuse out into the liquid, and, since the small bubble has a larger pressure, the concentration outside of the smaller bubble will be higher than that outside of the larger bubble.  Thus, this concentration difference will cause the gas to diffuse into the larger bubble, and, eventually, the small bubble will be completely "consumed" by the larger bubble.  Does that sound logical?

Bubbles of Different Size


Limit youtube full screen mode to window in firefox using qtile

Question: I'm wondering if there's a way to limit the full screen mode in youtube to just the window that Firefox already takes up. I know that Firefox has the picture in picture mode that creates a floating window, but that seems like a pretty hacky way of doing it. I'd like be able to just click full screen and have the full screen constrained to that window. It would also be nice to have it on a key toggle so that I could have the video take up the whole screen sometimes.I'm using Qtile as my window manager.
Comment: Not a 'native' solution, but you could use an extension like this one: https://addons.mozilla.org/en-US/firefox/addon/windowed/
Comment: Not really the solution I was hoping for, but it's something that can work until I figure out a way to do it without a Firefox extension. Thanks.
Comment: The question is contradictory. In essence, "How can I get _fullscreen_ **without** fullscreen?" It sounds like what you want is to make the video play in the full size of the Firefox window, instead of fullscreen _or_ in a player that only displays on part of the page, correct? (Edit your question to clarify, so that others on the site will see it and understand... do not simply reply in comments which they may not read...)
Answer: You can do this by setting auto_fullscreen = False in your config. Set a key binding for manually going full screen using lazy.window.toggle_fullscreen() and you'll be good to go. Now, whenever you double click on a video or press f, it will only take up the window size unless you manually switch to fullscreen mode with your keyboard shortcut.
Answer: Another hack would be to  change the YouTube URL from
https://www.youtube.com/watch?v=V1De0Ha5h

to
https://www.youtube.com/embed/V1De0Ha5h

This would leave you with the video maximized within the current tab + the tab bar and the toolbar on top which you can remove by other means if you want.


Splitting a string after punctuation while including punctuation

Question: I'm trying to split a string of words into a list of words via regex. I'm still a bit of a beginner with regular expressions.
I'm using nltk.regex_tokenize, which is yielding results that are close, but not quite what I want.
This is what I have so far:
>>> import re, codecs, nltk
>>> sentence = "détesté Rochard ! m'étais à... 'C'est hyper-cool.' :) :P"
>>> pattern = r"""(?x)
    #words with internal hyphens
    | \w+(-\w+)*
    #ellipsis
    | \.\.\.
    #other punctuation tokens
    | [][.,;!?"'():-_`]
    """
>>> nltk.regexp_tokenize(sentence.decode("utf8"), pattern)
[u'd\xe9test\xe9', u'Rochard', u'!', u'm', u"'", u'\xe9tais', u'\xe0', u'qu', u"'", u'on', u'...', u"'", u'C', u"'", u'est', u'hyper-cool', u'.', u"'", u':', u')', u':', u'P']

I would like to have the output as follows:
[u'd\xe9test\xe9', u'Rochard', u'!', u"m'", u'\xe9tais', u'\xe0', u"qu'", u'on', u'...', u"'", u"C'", u'est', u'hyper-cool', u'.', u"'", u':)', u':P']

I have a workaround for the "emoticons", so what I'm most concerned with are quotes.
Answer: It seems that the desired output is not consistent with your input sentence

[u"qu'", u'on'] : I can't figure out from where did these two matches were determined from your sentence
Why u'.' was not part of u'hyper-cool' (Assuming you want the punctuation as part of the word.
Why u"'" was not part of u"C'". (Assuming you want the punctuation as part of the word.

Also if you just want regex split, is there any reason why you are using nltk apart from splitting the lines? I have no experience with nltk so would be proposing just a regex solution.
>>> sentence
u"d\xe9test\xe9 Rochard ! m'\xe9tais \xe0... 'C'est hyper-cool.' :) :P"
>>> pattern=re.compile(
    u"(" #Capturing Group
    "(?:" #Non Capturing
    "[\.\.\.\]\[\.,;\!\?\"\'\(\):-_`]?" #0-1 punctuation
    "[\w\-]+"                           #Alphanumeric Unicode Word with hypen
    "[\.\.\.\]\[\.,;\!\?\"\'\(\):-_`]?" #0-1 punctuation
    ")"
    "|(?:[\.\.\.\]\[\.,;\!\?\"\'\(\):-_`]+)" #1- punctuation
     ")",re.UNICODE)
>>> pattern.findall(sentence)
[u'd\xe9test\xe9', u'Rochard', u'!', u"m'", u'\xe9tais', u'\xe0.', u'..', u"'C'", u'est', u'hyper-cool.', u"'", u':)', u':P']

See if this works for you
If you need more information on Capturing Group, Non-Capturing Group, Character Class, Unicode Match and findall I would suggest you take a cursory glance on the re package of python.
Also I am not sure if the way you are continuing string in multiple lines is appropriate in this scenario. If you need more information on splitting string across lines (not multi-line strings) please have a look into this.


Can you please help me identify this tree is it a spruce?

Question: We are looking at putting in an offer on a house, however, it has a large tree in the back garden and we are looking to see how hard it would be to care for it over the years. We don't have a clue as to what type of tree it is so if you would be able to help us with this and any hints on upkeep that would be amazing thanks.
Comment: Can we get a close uo picture of the needles?
Comment: I would like to see a picture of the entire tree from a distance. I think it's a Norway spruce, but the tree form is a key in identifying the species. If a Norway spruce, you won't have any maintenance.
Answer: It is certainly some very spruce-like tree. The exact type is difficult. Note that there are many varieties of spruce tree.
As to care required: It is not ordinarily a high maintenance tree. You won't need to do much for it. It looks like a well established mature tree. You won't need to water it or prune it. It will provide shade and attract birds and squirrels.
They are quite hardy trees, able to cope with a wide range of weather from a very dry hot summer to an extremely cold windy winter.
When I lived on the farm, more than 40 years ago, one of the spruce trees was hit by lightning. The heat split the trunk for several meters and drove splinters of heart wood out through the crack. The tree grew over the split and is still alive and well today.
The dropped needles and cones are not a huge volume relative to, for example, leaves from a maple tree. We never bothered to try to rake them, just went over them with the lawn mower. The grass near the spruce trees was always quite healthy.
If it was me, the spruce tree would be a big plus in favor of the house.
Comment: Heh. I only just noticed how old this question was.
Answer: Most likely it is spruce, but to be positive I would need photo of back side of green needles, bark.
You can always cut down the tree, sell the wood and plant some other trees more suitable for back garden - like Japanese maple.
Answer: The droopy needles I think I see in the pictures remind me of Norway spruce. (Clearer pictures of needles, bark, and cones would be beneficial for accurate identification.) Mature Norway spruce is basically a no-maintenance tree, I believe, when it reaches that size. Younger trees need protection from weed competition, but that large a tree is far beyond the weed competition stage.


Shnayim Mikra Out of Order

Question: When doing shnayim mikra, may one read an entire parsha/aliyah once, then do the targum, then read the pesukim again? Or does it have to be in the order of its name - first shnayim mikra and then echad targum? Similarly, may one read the pesukim out of order (assume b'dieved - he got confused as to what day it was and read chamishi on Wednesday, for example - does he have to do chamishi again after going back and doing revi'i)? Thanks.
Comment: This seems to me to be a duplicate of this earlier asked question: https://judaism.stackexchange.com/q/64929
Comment: @Alex I'm not sure that this is a total duplicate - the final question here ("Similarly, may one read the pesukim out of order...") is not asked in the other question.
Answer: To answer part of your question:

Or does it have to be in the order of its name - first shnayim mikra and then echad targum?

The Birur Halacha (Beginning of 285) writes that reading the entire parsha once and then each pasuk followed by it's Targum, or reading each pasuk once followed by it's Targum and then the entire parsha once are both valid options that are halachically the same as the Arizal's method because the entire issue is reading the Targum close to the pasuk. This is brought by Bikkurei Chaim 3:1 (source: footnote #18 here)

I couldn't find an answer for your specific case, but we see from the bold text above, that not necessarily does it have to be first shnayim mikra and then echod targum. (This doesn't necessarily answer the rest of your question though.)
Answer: Rav Eliezer Melamed says as follows (Peninei Halacha Hilchot Shabbos 5:10):

Be-di'avad, the order is not critical. If one reads the verse, then targum, and then repeats the verse – he fulfills his obligation (Levush; AHS 285:3). Similarly if he reads the parsha out of order from end to beginning, he fulfills his obligation. The main objective is to read all the verses twice and the translation once.

Therefore, however one reads it, they fulfill their obligation, even if "out of order".
Answer: Rav Shlomo Zalman Auerbach (Halichot Shlomo, Tefillah page 155) is quoted to have allowed one to read Parashiyot out of order (I've heard Rav Hershel Schachter say so, as well). In the Biurim, they say all the more so it should be fine to read the Pesukim within a Parasha out of order.
Answer: The point of the Targum is that it explains the passuk when it might cause some sort of misunderstanding. Therefore, one reads the passuk, then the targum and then the passuk again, after the meaning has been made clear.
Comment: Interesting idea. Is it your own or that of some respected known authority on Judaism? Please [edit] to clarify.
Comment: I did not mention the source because I am not sure but since you ask, I think this is how the Yemenites study the Torah. The second time, the verse is read by the whole group together.

Shnayim Mikra Out of Order


How do you get a Sandstorm dragon in DragonVale?

Question: I've tried breeding mud and air and some other stuff but it doesn't work. I need proof, by the way - only answer if you got one or have a friend that has one.
Comment: Actually if the breeding pair has the combo of elements the child dragon needs and the pair can breed, they'll always be able to give an egg of the wanted dragon; some are just rarer than others and some pairs don't work as well as others. Sandstorm took quite a few tries if I recall correctly.
Answer: You can breed a Sandstorm Dragon by mixing Air and Earth.  Since Air and Earth are opposites, you need to use at least one hybrid.  So you could mix Air + Mud, Air + Moss, Earth + Willow, etc.  Note that as with any hybrid dragon breeding, you should be aware of pairs which can produce unintended long incubate offspring.  In this case as BenBrocka points out Earth + Sonic can be a very bad pairing as it can produce the 24 hour incubating Crystal.
It has a two hour incubation period, so if you see something different than that you did not get it, but since other dragons you could breed also have two hour incubation, you have to wait to see the egg to be sure.  From the wiki, the egg looks like this:
Comment: Side note, don't breed earth dragons with sonic dragons, you might get crystal dragons with a 24hr egg time
Comment: No problem, and welcome to the site!  If you look just below your question, you'll see a "dragonvale" tag.  If you click that, you'll find the answer to many more useful questions about Dragonvale - and of course, feel free to keep asking :).
Answer: You have to use air & mud or air & willow, air & willow worked for me.
Comment: Welcome to Arqade! This answer brings nothing that have not already been said. Please avoid duplicating content and only provide answers that add something new.
Comment: ^Yes, in Arqade, we all love people to share all  their **DIFFERENT** thoughts. Although many of us agree on certain things, in Arqade, we must only share different answers in answer form, but when you get enough reputation, feel free to leave a comment of your opinion! :)
Answer: Try a sand dragon + air dragon. It just makes sense and wen I tryed I got it on my first time.


Decimal expansion of an irrational number not ending in a particular sequence

Question: Consider the set $N$ of natural number, $N$={1,2,3,4,5,6,7,8,9,10,11...} and consider the subsequence  {$N_i$} ,$i \in N$
Each $N_i$ consists of elements in ascending sequence greater than $i$
$N_1$={2,3,4,.....}  ,$\quad$$N_2$={3,4,5,.....},$\quad$$N_{11}$={12,13,14,15,...} and so on
0.1234567......., $\quad$ 0.0123456.....,$\quad$ 0.1119012345679810....$\quad$ 0.992018151617181920 $\quad$ are are all irrational numbers in $[0,1] $, but the tail  of each sequence  can be mapped to a subset of {$N_i$}: for example $\quad$ 0.992018151617181920... can be mapped to $\quad$ $N_{15}$={15,16,17,18,19,20,21,....}
My question is can someone give example of irrational number in $[0,1] $ ,such that the tail of its decimal expansion cannot be mapped to any subset of {$N_i$} ?
Of course there are uncountable of such examples. But to construct one is not trivial. You may know the decimal expansion of $\pi$ upto one billion decimal places but that doesn't stops its remaining digits being mapped to {$N_i$}.
Answer: How about: 0.1121231234123451234561234567... ?
Comment: How do you define your remaining ........digits?


What is the best way to generate JavaScript test objects for website automation

Question: Bit of background:
The team is writing QUnit UI tests AND browser automation tests using C#. I would like to create a JSON object that can be shared between the two. That way if a class name gets changed, the config file will only need to be updated in one place.
The site is very dynamic using templating so these test object config files must be created at run time, can't just parse static html.
I could hand generate the data structure or write a tool to help me capture the ids/classes and then modify the generated data structure. I'd prefer to not hand code it as the site my team is testing has hundreds of controls.
The tests would leverage these test objects to make maintenance easier as the site is under a lot of churn and our current tests break daily. Once all the tests reference the same test object, it would only require fixing that objects config.
Currently I am thinking of creating a JavaScript function that takes a selector and generates all the properties for that element and its children. I could at run time call the function passing the control I want to scrape, cut and paste the output for later use. Is there a better way to generate these objects?
Illustration:
Nav bar with children A, B, C. One can be selected.

A

B

C

I would like to create the following code (jQuery style selectors):
var nav_bar = {
    selector: "#nav-bar",
    children: {
        a: { selector: ".a" },
        b: { selector: ".b" },
        c: { selector: ".c" },
    }
}

I could then add some special properties by hand like selectedItem:
var nav_bar = {
    selector: "#nav-bar",
    children: {
        a: { selector: ".a" },
        b: { selector: ".b" },
        c: { selector: ".c" },
        selectedItem: { selector: ".selected" }
    }
}

With that I could parse the nav_bar object to create a useful test object:
var nav = createTestObject(nav_bar);
// var nav = {a: $(".a", "#nav-bar"), b: $(".b", "#nav-bar"), selectedItem: function() { return $(".selected", "#nav-bar"); }}
// Can automate a simple test at this point...could use some more helper functions
// Click b if not already selected
if(nav.b[0] != nav.selectedItem()[0])
{
   nav.b.click(); // assumes clicking causes selected class to change
}

If the class ".selected" changes, I don't have to search and replace throughout the test code, just update the one config file for selectedItem.selector.
Thanks in advance,
Joe
Comment: @JosephtheDreamer - I kind of feel like research questions are somewhat okay as long as the op has done some research himself. This doesn't strike me as your typical "Giv me deh codez" type questions we oftentimes get. Still, I think it's great to remind people that this site is for actual programming problems and that the line can be very, very thin.
Comment: +1 for an interesting idea. But we would like to remind you that [Stack Overflow is not your personal research assistant](http://meta.stackexchange.com/a/128553/177538)
Comment: Just curious, what is this for exactly?
Answer: I don't understand what you are trying achieve by generating test objects. Once you do nav.b.click() do you want to test that b is now the selected class?
You should look into using PhantomJS or testing with Zombie.js.
Comment: My goal is to be able to farm these tests out with TestSwarm: [link](https://github.com/jquery/testswarm) to find browser specific issues. In my experience, if the project doesn't use a test object abstraction, code maintenance gets really gnarly...


Overlapping faces while extruding corners

Question: When I extrude the face that's been highlighted in the first image, it overlaps with some part of the face marked as 2, as shown in the second image. How can I make it so when I extrude face 1, it'll also divides face 2 into 2 pieces so I can merge the overlapping faces. Or should I be following a different practice all together? Thank you for your time.
Comment: No since this approach will generally create non-manifold geometry (the one which can't exist in real life like intersecting infintely flat surfaces etc). Final way likely depends on the desired result to not become speculation and opinion-based discussion
Answer: You should try to avoid overlapping geometry, like faces that occupy the same space creating z-fighting and other problems.
One of the many ways to go about this is to use loop cuts, and use those that define the places where the intersections should take place, and more importantly to create new vertices for such intersections.
Select one of the newly created edges, extrude to the point where the new vertex is (Enable snap to vertex for precise placement). Select the matching edge on the other wall and pres F to create a new face.
At the end of all of this do "remove doubles" to get rid of extra vertices


How to deal with the ground node in circuit graph and the gains of dependent sources?

Question: in this circuit I am asked to find the gains of both dependent current and voltage sources. I've drawn the circuit graph and done the analysis that I had supposed. But I am not sure about whether there should be four or five nodes in the graph. I supposed that there are just four nodes since the currents before and after the ground (from right to left) are the some so the difference in voltage also should be the same. But after that I had i3 in a negative value! If this is correct should the gain g be positive or negative?
Comment: There is a schematic editor here, with the ability to display your circuit. Please use it to clarify the situation. It's hard to read your photo.
Answer: I see there also only 3 nodes.
The picture is hard to read but if the calculation is right the minus means only that your first intention of writing down the direction of our graph for i3 was in the wrong direction.
If you change this you will get a positive gain g.
Its just a matter of drawing your graphs.
Comment: I wrote its direction as described in the circuit I  changed nothing in that.


Why are wavefunctions with same principal quantum number and different azimuthal quantum number orthogonal

Question: The value  turns out to be zero . This is understandable since they are completely independent of each other and also perpendicular in real space. But also turns out to be zero . How do I justify the orthogonality of the s and the p levels?
Answer: The mathematical answer to this specific question lies in the fact that s and p orbitals are simultaneous, non-degenerate eigenfunctions of the quantum mechanical $\hat{L}^2$ operator, which is hermitian:
$$\begin{align}
\hat{L}^2\left|\mathrm{s}\right> = [l(l+1)\hbar]^2 \left|\mathrm{s}\right> &= 0 \\
\hat{L}^2\left|\mathrm{p}\right> = [l(l+1)\hbar]^2 \left|\mathrm{p}\right> &= 2\hbar^2 \left|\mathrm{p}\right>
\end{align}$$
since $l = 0$ for s orbitals and $l = 1$ for p orbitals.
It is a simple proof that the eigenstates of hermitian operators that correspond to different eigenvalues are necessarily orthogonal. Suppose, for a hermitian operator $A$, we have $A\left|m\right> = a_m\left|m\right>$ and $A\left|n\right> = a_n\left|n\right>$ with $a_m \neq a_n$. Then:
$$\begin{align}
\left\langle m \middle| A \middle| n\right\rangle &= \left\langle n \middle| A \middle| m\right\rangle^* & &\text{(definition of hermiticity)} \\
a_n\left\langle m \middle| n\right\rangle &= (a_m\left\langle n \middle| m\right\rangle)^* & &\text{(extracting the eigenvalues)} \\
&= a_m\left\langle n \middle| m\right\rangle^* & &\text{(eigenvalues of hermitian operator are real)} \\
&= a_m\left\langle m \middle| n\right\rangle & &\text{(definition of inner product)} \\
(a_n - a_m)\left\langle m \middle| n\right\rangle &= 0 \\
\left\langle m \middle| n\right\rangle &= 0 & &(a_m \neq a_n)
\end{align}$$
You can likewise show that any pair of atomic orbitals in the hydrogen atom are orthogonal, using whichever of the three operators $\hat{H}$, $\hat{L}^2$, $\hat{L}_z$ that you need. All atomic orbitals are simultaneous eigenfunctions of these three operators, and have different eigenvalues which correspond to the quantum numbers $n$, $l$, and $m_l$:
$$\begin{align}
\hat{H}\left|n,l,m_l\right> &= E_n\left|n,l,m_l\right> = -\frac{m_e e^4}{2(4\pi\varepsilon_0)^2 \hbar^2 n^2}\left|n,l,m_l\right> \\
\hat{L}^2\left|n,l,m_l\right> &= L^2\left|n,l,m_l\right> = [l(l+1)\hbar]^2\left|n,l,m_l\right> \\
\hat{L}_z\left|n,l,m_l\right> &= L_z\left|n,l,m_l\right> = m_l\hbar\left|n,l,m_l\right>
\end{align}$$
Since no two orbitals have the same three quantum numbers, no two orbitals can have the same eigenvalues for all three operators. Consequently, there must be at least one operator which can be used to show that those two orbitals are orthogonal.
Comment: Thanxx for the explanation! Another thing I would like to ask is that since px and py are perpendicular in real space...can this be used to say that their wave functions will be orthogonal?
Comment: Yes, you can. Although do note that the $\mathrm{p_x}$ and $\mathrm{p_y}$ orbitals are no longer eigenfunctions of the $\hat{L}_z$ operator (they are linear combinations of the eigenfunctions). To prove it mathematically, you would need the explicit form of the wavefunctions.
Comment: Thanxx @orthocresol


Syntax to use when entering geographic data into geography columns via SQL Server Management Studio

Question: I am starting to learn about spatially aware databases.  I have QGIS 2.61 and SQL Server Express 2012.  I can set up a table using the  SQL Server Management studio GUI and insert a geography column.  What syntax should I use when entering data into that column to store, for instance, the coordinates for a polygon or linestring etc.  Try as I might I cannot find an answer other than using Transact SQL which is not what I want to do.
Answer: If you have lat long point locations in a sql table and you've added a geometry field you can convert ths Lat Long to geometry with this code:
<code>UPDATE tablename
 Set geographyfield = geography::STGeomFromText('POINT(' +
 CAST([Longitude] AS VARCHAR(20)) + ' ' + CAST([Latitude] AS
 VARCHAR(20)) + ')', 4326)
</code>
It's much more complicated with polygons and line strings and best to use other software to write the layers to sql tables. You can also use ogr and python if you have shape files or other formats and want to store them in sql server
Comment: I see my answer was in t-SQL which isn't what you want. I guess I'm not clear what you are trying to do. Enter coordinate data in QGIS? Build a geometry field with coordinates in SQL?


iScroll not initializing until page is reloaded

Question: I'm having a problem with iScroll not being initialized correctly in my jQuery mobile project. The iScroll plugin is only being used in one subpage, to allow horizontal scrolling on a big image (needed to make it work on Android, since their browser does not support it out of the box)...
The plugin works correctly if you access the URL directly, or if you refresh it manually. But when you access it via the menu, from another starting point, it won't work. I'm guessing this has something to do with the ajax loading in jQuery mobile, but setting data-ajax="false" to the link is not an option, since I need the whole thing to work well also as a home screen app in iOs (where links with data-ajax="false" opens in a new Safari window for some strange reason).
In the head tag:

In the content section:

Is there any way I could force a refresh of the actual page after it's loaded, or is there any other way I force the iScroll to be initialized correctly?
Answer: To answer you second question, i.e. is there another way: There is a very neat iScroll plugin for jQM at https://github.com/watusi/jquery-mobile-iscrollview that is very easy to implement and no need to worry about initialization problems


What causes overtime in the final round?

Question: In Kirby's Dream Buffet, sometimes the final round will go into overtime before bonus strawberries are awarded. What determines if the final round goes into overtime?
Answer: My speculation comes from this video.
It appears that, when the timer is about to run out, the pink Kirby was 2nd while the blue one was 1st. The frame I took is from the instant in which pink Kirby gets first, probably equalizing the blue one.
So overtime should begin when at least 2 Kirby have the same (or very similar) strawberries count.


Is HTML5 and Canvas good for rapid prototyping of games?

Question: Are there frameworks and processes for HTMl5 that can be used for the rapid prototyping of 2D games?
Answer: I built http://gamejs.org partly for this purpose. It follows the PyGame API which I know is sometimes used for prototyping.
I would argue that JavaScript lends itself very well to writing game code quickly; for a more elaborate argument to this effect see Capitalizing on JavaScript's prototypal inheritance
Other advantages if you stay with simple technologies, like html5 & js:

every computer has an interpreter and a debugger for JS installed (even mobile devices)
easy to pickup for newcomers
well documented language, still evolving
open technologies through & through

Whether html5 is more suitable than, say, Flash or even pen&paper depends on your game and how evolved your concept is.
Answer: I've been using PixieEngine. It's a web based game development IDE that lets you develop and publish games without having to download or set up a development environment.

The advantages over plain HTML Canvas and JavaScript are that CoffeeScript is a very syntax light language, and the built in libraries optimize specifically for the prototyping of games.
For example in HTML Canvas when you want to fill a circle you need to call:
context.fillStyle = color
context.beginPath()
context.arc(x, y, radius, 0, Math.TAU, true)
context.closePath()
context.fill()

But the PixieEngine canvas wrapper provides a simple method
canvas.fillCircle(x, y, radius, color)

HTML Canvas and JavaScript are good for rapid game prototyping, but PixieEngine is much better.
Answer: Well, a cursory Google search produces several results:

Isogenic Engine
Akihabara
Impact
LimeJS

I don't know anything about them specifically, but I would think that in general HTML5 is probably a decent way to prototype games even without a framework or engine: quick, direct, low overhead and easy to iterate on.
Answer: Yes!  I'm part of the 2 man team that builds Construct 2, the HTML5 game creator.
Our tool is popular for building full games and also amongst an audience who wish to rapidly prototype games and ideas.
When creating a prototype anything that can save you time is beneficial and we've worked hard to make Construct 2 a powerful time saving device as well.  Results can be created in minutes.


Why an ancient vampire sleeping for centuries under some castle in Europe would come to Brazil?

Question: A vampire has been sleeping under a castle in Austria for centuries. But now the castle became a tourist attraction. It's really annoying. And the taste of the blood of the people on the region didn't change. Why would he come to Brazil?
Comment: Welcome to Writing.  Questions asking *what* to write, such as plot ideas, are off-topic here (and tend to be pretty subjective).  We can help you with questions about how to convey an idea or structure a plot or reveal worldbuilding, but the actual content is still up to you.  Please check out our short [tour].  Thanks for understanding.
Answer: He wouldn´t...but if you really must:

I guess you could have him hanker for exotic blood cocktails and dancing the samba.
Some of the tourists visiting the caste were brasileros and tasted so good.
He gets married and takes a blood-moon trip to Rio.
The last occupants of the castle, his "family", were Nazi Austrian officers who fled to the Amazon jungle to escape justice...
He is tired of Austrian prudeness and wants to wear a man´s thongs, a string bikini with pouch and flaunt that he is a stiff. :)

This took me all of 2 minutes....there could be so many reasons, but the premise seems dumb and is reminiscent of Bella´s Twightlight honeymoon.
Comment: #1 is best. He hears a song on the radio and can't get that crazy rhythm out of his system. He takes dancing lessons and heads to Rio.


When to call mysqli::close

Question: When should i call mysqli::close? I never used to use if statements to check whether bind_param(), prep() and execute() were successful. Should I call $stmt->close() at the end of the method(below) . Or should I call it after every condition ensuring that I close the database connection even if the process fails at some stage e.g bind param.
public function function_name($id,$new_id ){
    $query = "UPDATE TABLE SET name = ? WHERE field = ? ";
    if($stmt=$this->prepare($query)){
        if($stmt->bind_param("is", $id, $new_id)){
            if($stmt->execute()){

            }else{//Could not execute the prepared statement
                $message = "Could not execute the prepared statement";
            }
        }else{//Could not bind the parameters
            $message = "Could not bind the parameters";
        }
    }else{
        $message = "Could not prepare the statement";
    }
    return $message
}

Comment: Unless you're in a long-running-script situation, don't bother doing a close operation, as PHP will clean up for you when the script exits. The connection shouldn't be closed until you're absolutely sure you're done with ALL database operations.
Comment: @MarcB - I'm not sure I agree that it's good practice to do that. Whilst PHP will tear everything down automatically, getting into the habit of looking after your resources and disposing of them when you're done is a very important habit to maintain if you ever plan to move to the world of native programming.
Comment: Incidentally, you should look into PHP exception handling rather than using a giant nest of `if` statements: http://php.net/manual/en/class.exception.php
Answer: When PHP exits it closes the database connections gracefully.
The only reason to use the close method is when you want to terminate a database connection that you´ll not use anymore, and you have lots of thing to do: Like processing and streaming the data, but if this is quick, you can forget about the close statement.
Putting it in the end of a script means redundancy, no performance or memory gain.
Whats is important: unset unused data, and if you will want to avoid memory leaks (which in my humble opnion are problem of PHP core in this case) use:
mysqli_kill();
mysqli_close();

This way the socket is killed too.
Answer: You should always gracefully close the connection when you are done with it, to avoid performance and memory/handle leak problems. On the other hand, you should also make sure that you really are done with it - your script will crash if you try to use a closed connection.
The same goes for statements. If a statement is no longer going to be used, dispose of it appropriately.
Answer: Just a little thought you could create another method called function_close and call it after you have called the function_name method.
This way if you change to pdo or mongo you will just have to refactor the methords rather than every instance of close.
Comment: I don't think he was asking about that.
Comment: Try just thought I would give him something to think about.
Answer: you should close it especially after a multi query (http://php.net/manual/en/mysqli.multi-query.php) because you could get memory problems. Otherwise closing is not needed.

When to call mysqli::close