Finding the MLE of Poisson in R

Question: I'm trying to determine the MLE of $\lambda$ in a Poisson distribution using R. I'm aware that the MLE is $\hat{\lambda}=\bar{x}$, but I want to demonstrate this using Rmarkdown. My experience with R code is limited, and I wish to learn how to do this, but all reference material I have found involves generating frequencies and such, which I do not want to do. Are there any references for learning how to determine the MLE in R without making use of a sample of data?
Comment: In the formulation of a maximum likelihood estimator you begin by assuming that you have a sample of iid  random variables from the distribution in question. So to use R to get the MLE of $\lambda$ you would first need a sample of Poisson distributed data; whether that was generated or is data you already have and is considered Poisson under your model assumptions.
Answer: If there's no data involved, then a pen and paper would do the trick since the MLE will be the same no matter what. I don't think R would prove very useful, but it would be easy to show your calculations in Rmarkdown. Here's what it could look like:
The PMF for the Poisson distribution is as follows:
$$\frac{\lambda^xe^{-\lambda}}{x!}.$$
We want to find the estimate for $\lambda$ that is most likely given the data. The joint PMF for the data (assuming independent observations) is
$$\prod_{i=1}^{n}\frac{\lambda^{x_i}e^{-\lambda}}{x_i!}$$
when there are $n$ observations. This is the likelihood. It will be easier to find the value of $\lambda$ that maximizes this quantity if we take the log:
\begin{align*}
\log \left(\prod_{i=1}^{n}\frac{\lambda^{x_i}e^{-\lambda}}{x_i!}\right) & = \sum_{i=1}^{n}\log\left(\frac{\lambda^{x_i}e^{-\lambda}}{x_i!}\right) \\
& = \sum_{i=1}^n x_i\log(\lambda) - \sum_{i=1}^n \lambda - \sum_{i=1}^n \log (x_i!) \\
&=\log(\lambda)\sum_{i=1}^nx_i - n\lambda - \sum_{i=1}^n \log (x_i!)
\end{align*}
To find the value of $\lambda$ that maximizes this expression, we take the derivative with respect to $\lambda$, set it equal to zero, and solve for $\lambda$:
\begin{align*}
\frac{1}{\lambda}\sum_{i=1}^nx_i - n & = 0 \\
\sum_{i=1}^n x_i & = n\lambda
\end{align*}
from which we obtain
$$\lambda^* = \frac{\sum_{i=1}^n x_i}{n} = \bar{x}.$$
Comment: Thanks, this cleared things up for me. I was just confused on what I was actually being asked to do but I appreciate the thorough answer!
Comment: @Nick Cox  Thanks.  I didn't know about that one.  I will edit my answer.
Answer: If $n = 10$ and $T = \sum_{i=1}^n X_i = 85,$
then the likelihood is proportional to $\lambda^T e^{-n\lambda}.$
The likelihood function is maximized at MLE $\hat\lambda =T/n= 8.5,$ as illustrated in R:
n = 10;  t = 85;  lam = seq(1, 15, by=.01)
like = dpois(t, n*lam)
plot(lam, like, type="l", lwd=2)
  abline(v = 8.5, col="red")

lam[like==max(like)]
[1] 8.5                # MLE

By contrast, if $n=100, T = 887,$ then $\hat \lambda = 8.87.$
There is more data, so the likelihood function
near $\hat \lambda$ is more tightly curved, and the estimate is
less variable.
n = 100;  t = 887;  lam = seq(1, 15, by=.01)
like = dpois(t, n*lam)
plot(lam, like, type="l", lwd=2)
  abline(v = 8.87, col="red")

lam[like==max(like)]
[1] 8.87

Finding the MLE of Poisson in R


What is the difference between Facebook for Websites and Facebook SDK?

Question: What is the difference between Facebook for Websites and Facebook SDK?
I see the two referenced all the time, and it's confusing.
My setup is a client side javascript app and am wondering which I should use.
Answer: Facebook for websites is made to enable some facebook features on your website, such as the like button. It also allows you to use facebook login and registration for your website much like open id. This eliminates the need for your own user login and registration scripts. It also allows you to use the graph API, giving you access the full social graph of a given user.
Facebook Javascript SDK gives you access to the graph API and a lot more, like facebook dialogs and REST API. Further, it provides a mechanism for rendering of the XFBML versions of our Social Plugins, and a way for Canvas pages to communicate with Facebook.
I think you should consider using the Facebook Javascript SDK as it offers you much more functionality.
Comment: So facebook SDK is a superset of FB for websites?
Answer: SDK stands for software development kit. It's a toolset for doing certain actions.
In terms of Facebook SDK there are official toolsets for

PHP
iOS
Android
JavaScript

These toolsets make it easier for developers to interact with Facebook API (Application Programming Interface), which is a way in which Facebook allows developers to interact with some of its data.
Facebook for Websites represents the idea of making your site a social interaction with respect to Facebook and driving growth through these social interactions. This can be in the form of SDKs (the toolsets mentioned before) or plugins.
Utilizing the Facebook Platform (which encompasses all the toolsets, plugins and API) you can make a better more sociable experience for your website. And that's what Facebook for Websites represents.

So you have a client side Javascript app utilizing the JS SDK (this is the toolset). Now this could be an app for your website in which case you are trying to enrich the experience or you are just making an app for others to enrich their sites/pages with your app.

App for your website? You are using the SDK and it is going on the idea of Facebook for Websites
Apps for distribution to other websites/pages? You are using the SDK for giving them the chance to use Facebook for their Website

So Facebook for Websites denotes the loose phrase of using the Platform on a website for a richer social experience.
I suggest you read this page even if you don't get everything it will give you a better idea than you already had
http://developers.facebook.com/docs/guides/web/


Where is the best place to store firewood outdoors relative to your house?

Question: Is it true I should avoid storing firewood near my home (due to concern about termites)? Or is it perfectly fine to store firewood in a convenient spot just outside the door?
Answer: Storing your firewood on an elevated rack should alleviate most insect problems.  The wood should not be in direct contact with the ground or with a structure.  Leave enough of a gap to promote air flow around the stack.
Rotate your firewood from season to season (do not stack new firewood on top of old).
If you live in a termite prone area (the southeast or California), you may want to keep your stack further away from buildings, in case they do get a hold of the wood.
Comment: I know this answer is old, but would it be unwise to store firewood on a metal rack sitting on a wooden deck that's about 15 feet off the ground (the house is brick, if that makes a difference)? Getting out into the backyard itself involves traversing a lot of stairs, so I'd like to keep it on the deck if I can.
Answer: Where I live termites are only a minor problem. We are more concerned about bushfires. Regardless, most people in the area store their firewood up against the back fence on housing blocks or in a standalone pile at least 100m (30 yards) from any building on larger sites, such as farms. As timber fences are generally treated with creosote nobody's worried about the termites there.
Comment: how is 100m = 30 yards?


Friends profile page

Question: I am designing a web app that is similar to Facebook.
Right now I am stuck on how to load a friends profile page...
On the users main page there's a section with all the user's friends. Each friend is displayed with an  tag.
The link leads to the profile page.
Ideally I would like the profile page do display: 'This is {{friends}}'s Profile page'.
I am having a hard time to to dynamically display the clicked on Friends name...
Here's the some code:
The html for the friend links:

            You are Friends with:
            {% for x in range(friends|length) %}

            {{friends[loop.index -1][0][0]}} {{friends[loop.index -1][0][1]}}

            {% endfor %}

Here's the friends Profile html:
{% extends "layout.html" %}

{% block title %}

    Friend

{% endblock %}

{% block main %}

This is {{friend}}'s profile

{% endblock %}

And here's the python code (nothing really here yet):
@app.route('/friends_Profile', methods=["GET"])
def friends_profile():

    return render_template('friends-profile.html', friend=friend)

So ideally the user would click on the friends name, a new page would load and display the friends information....
Answer: Couple of things:
you are POSTing to /friends_Profile when it only allows GET method=["GET"]
also in the friends_profile function, you haven't specified where the friend variable is coming from in friend=friend (best place might be from flask.request)

Friends profile page


How can I Delete Photo On facebook Pages via PHP SDK?

Question: I have a problem .
I want to delete photos on facebook page , photos are sending via php sdk.
Im try all but not work..
$Curl_Session = curl_init('https://graph.facebook.com/[photoid]');
 curl_setopt ($Curl_Session, CURLOPT_POST, 1);
 curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, "method=DELETE&access_token=$token");
 curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($Curl_Session, CURLOPT_RETURNTRANSFER, 1);

 echo $a8=curl_exec ($Curl_Session);
 curl_close ($Curl_Session);

Dont work..
$url = 'https://graph.facebook.com/'.$id.'?method=DELETE&access_token='.$token;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
echo $data = curl_exec($ch);

This code is dont work

$sonuc=file_get_contents("https://graph.facebook.com/".$id."?method=DELETE\&access_token=".$token);

Please Help..
Facebook allowed deleting photos if sending via php sdk.
But  all codes not work ..
Comment: You can't, it's not possible to delete any photos with apps, even if they were the ones responsible for the upload.
Answer: First off, the photo you're trying to delete must have been uploaded by the app that's trying to delete it. This is mentioned in the Facebook Documentation: A photo can only be removed by the same app that published it.
You'll need a valid Page Access Token to delete the photo too. You can get this my adding the manage_pages permission and calling /me/accounts to get the list of access tokens, finding the one for the correct page).
Finally, calling: https://graph.facebook.com/{PHOTO_ID}?access_token={PAGE_ACCESS_TOKEN}&method=DELETE will delete the photo if the app has permission, otherwise you'll receive a error like:
{
   "error": {
      "message": "(#200) Permissions error",
      "type": "OAuthException",
      "code": 200
   }
}


Make the calendar web part static

Question: I have a request to make the calendar web part static.
Not allow users to change the month or click back to the previous week.
Is this possible?
Answer: You can hide it using CSS. Edit the calendar.aspx page and add the following CSS either using Content Editor webpart or Snippet/Script web part.
<code>    /* Hides Left Nav Small Calendar, Left/Right Nav(arrow) and Ribbon Tab for changing Scope(Year, Month, Week) */
    div.ms-core-navigation #DatePickerDiv,
    div.ms-acal-header a[id$="nav_prev_a"],
    div.ms-acal-header a[id$="nav_next_a"],
    li[id$="Calendar.Scope"] {
        display: none !important;
    }
</code>
Also, go to the list settings and change the default scope to 'WEEK'.
In addition to hiding using the CSS, use the jQuery code as suggested by Jussi.
Answer: There is no straightforward water-proof way of doing that, but I'd use jQuery to clear the required HREFs and ONCLICKs.
So something like:
<code>// Disable small month table navigation
$("#DatePickerDiv a").attr("href", "#");
$("td[class^='ms-picker']").removeAttr("onclick");

// Remove month/week navigation
$("#AsynchronousViewDefault_CalendarView a[id$='nav_prev_a']").remove();
$("#AsynchronousViewDefault_CalendarView a[id$='nav_next_a']").remove();
</code>

Make the calendar web part static


Is it possible to single out a proton, electron, neutron?

Question: I've read that it's nearly impossible to take a proton from an element. But if it's "nearly" impossible then it is possible to some degree. If this has happened, what is exactly the process of taking an atom apart. Likewise, would this be possible for electrons and neutrons as well?
Comment: It is quite possible to remove an electron, through various techniques of [ionization](https://en.wikipedia.org/wiki/Ionization). Neutrons are "removed" from nuclei in such processes as [nuclear fission](https://en.wikipedia.org/wiki/Nuclear_fission), and protons may be removed through [other nuclear processes](https://en.wikipedia.org/wiki/Nuclear_transmutation), although these may also include removing one or more neutrons, as well as one or more other protons.
Comment: In relation to the proton ... consider the ion $^1H^+$.
Comment: Are you asking about a deliberate removal (via a reaction) or radioactive emission? Both are possible, but the radioactive emission is extremely rare.
Comment: It's quite possible to remove a proton. Curiously, this was one of the first nuclear reactions in the history of physics: Rutherford discovered in 1919 that alpha bombardment of nitrogen could create oxygen and a proton according to the reaction 14N + α → 17O + p.
Comment: @HDE226868 Please, stop.
Comment: @PeterHorvath What?
Answer: Taking out electrons is the easiest of all: this happens in a cathode ray tube TV all the time. A filament in vacuum is heated such that the electrons have enough energy to leave the filament. Applying a voltage of the order of 10 kilovolts will accelerate them towards the screen (and prevent them from going back to the filament).
To give an order of magnitude, the binding energy of an electron (in its lowest state) in a hydrogen atom is 13.6 electronvolts.

Taking out protons and neutrons of a multi-nucleon nucleus requires more 'effort' (energy): the so-called binding energy (energy to be 'surmounted' to liberate a proton or neutron from a nucleus) is typically of the order of Mega-electronvolts, see for example the graph of nuclear binding energy per nucleon here.
In practice, to 'excite' a proton or neutron enough, i.e. inject the binding energy or more, one can shoot high energy protons or photons at the nucleus. However, most likely all kinds of reactions other than the desired one will happen at the same time, the efficiency of creating the desired nucleus with one proton or neutron less may be quite low (and one needs some filtering mechanism like a Wien Filter behind the target).
In practice, there are often more efficient ways of producing a given isotope, especially when the isotope in question occurs naturally (e.g. Deuterium).


Is ploticus working with macos m1 ; how to put it in the path?

Question: I'm willing to use ploticus (mostly for basic graph) ; yet I don't if it's still working out the box for macos (m1) since I have not been able yet to get relevant information ; if still working, I can install it with homebrew, but then I dont know how to put the pl command in the path (for myself as user). Does anyone have knowledge to share ?
Answer: Ploticus is supplied by homebrew.
You will be guided to fixing your path before you even install this. I would run through the homebrew installer and then check with brew doctor to validate your path.
Then
brew install ploticus


When is the Yoneda product graded commutative?

Question: Sometimes, given an object A in an Abelian category, the Yoneda product on Ext(A, A) is graded-commutative, for example in cases where it coincides with the cup-product in singular cohomology. Are there any nice theorems about when the Yoneda product is graded-commutative in general? Thanks in advance.
Comment: Not at all. For $R$ a local commutative ring and $A$ its residue field, $\mathrm{Ext}(A,A)$ can be computed by a resolution but it is ver seldom graded commutative. It is always the enveloping algebra of a graded Lie algebra and the Lie algebra may contain for instance large free subalgebras. For instance for $R=k[x_1,...,x_n]/(x_1,...,x_n)^2$ the Lie algebra is free on $n$ generators (in degree $1$).
Comment: As Torsten points out, graded commutativity of Ext(AA) will not hold for every object. However, it will hold when A is the unit object in an appropriate monoidal category, by an Eckman-Hilton argument. An important example of this is Hochschild cohomology of a ring or dga R, which is defined as Ext(RR) in the category of R-bimodules. To  show this is graded commutative, you should think of R as the unit in the monoidal derived category of bimodules and apply Eckmann-Hilton. Here, you should think of the derived category as being enriched over graded vector spaces by summing up all Exts, or
Comment: ... even better, think of the derived category as enriched over cochain complexes (think of it as a dg category). Then you get that Hochschild cochains has two commuting products (Yoneda and tensor product), so is an $E_{2}$-algebra. Note that by Eckmann-Hilton, an $E_{2}$-algebra in graded vector spaces is just a graded commutative algebra.
Comment: You should read what wikipedia has to say about the ring structure on Ext: http://en.wikipedia.org/wiki/Ext_functor#Ring_structure_and_module_structure_on_specific_Exts. It seems like whenever Yoneda products and products given by the "pick a resolution" method (see link) both exist, then they'll be the same (probably by an Eckman-Hilton argument?). In this case it should be graded-commutative. Right?
Comment: This seems right; but it does not apply in several interesting cases (for example, the case of sheaves).
Comment: Intuitively, if you know a bit of rational homotopy theory if you start with A= C*(X), rational chains a simply connected space, than $Ext_A(Q,Q)$ is $H_*(\omega M)$. So this is commutative iff the Whitehead Lie algebra of X is abelian. I guess this is just the "looking glass" point of view on Torsten's comment but depending on whether you're into topology or  commutative algebra it might be helpful... at least for me anyways :)
Comment: Sorry that should be capital $\Omega$ the based loop space...
Answer: I move this to a more proper answer to discuss some subtle points of the
question. The Eckman-Hilton argument (or more concrete calculations) shows, as
Chris points out, that $\mathrm{Ext}(A,A)$ is commutative when $A$ is the unit
for a monoidal category. The subtleties appear when we consider for instance the
ring $R=k[x]/(x^2)$ for $k$ a field and $A=k$. Then $A$ has a uniform resolution
$\dots\xrightarrow{x}R\xrightarrow{x}R\xrightarrow{x}R\to k\to 0$ giving
$\mathrm{Ext}^i(A,A)=k$ for all $i$. Using the definition of the Yoneda product
in terms of maps of resolutions we get that $\mathrm{Ext}(A,A)$ is the
polynomial ring on $\mathrm{Ext}^1(A,A)$. This is graded commutative only when
the characteristic is $2$ (and then it is not graded commutative in the strict
sense of the square of odd degree elements being zero). However, it is exactly
in characteristic $2$ that $R$ is the affine algebra of a finite group scheme
(with $x\mapsto x\otimes1+1\otimes x$ as coproduct) with $k$ the unit for the
associated monoidal structure on the category of $R$-modules. Hence we have a
monoidal reason for the $\mathrm{Ext}$-algebra being graded commutative in
characteristic. On the other hand we have a uniform description of the
$\mathrm{Ext}$-algebra in all characteristics which just happens to fulfil the
definition of being graded commutative in characteristic $2$.
Answer: Another starting point is to think of ${\rm Ext}(A,A)$ as the derived endomorphism ring of the object $A$ and recall Schur's lemma.  If $A$ is a finitely-generated simple module over a ring $R$, then ${\rm Hom}_R(A,A)$ is a division algebra.  For example, if $R$ is a $k$-algebra over an algebraically closed field $k$, then ${\rm Hom}_R(A,A)$ is isomorphic to $k$ (so, in particular, it is commutative.)  Via Freyd-Mitchell embedding, this should give some idea what to expect in degree $0$.
Going back the question, then, the examples one might have in mind are categories of modules over a group ring or enveloping algebra of a graded Lie algebra: in these cases, ${\rm Ext}(k,k)$ is group- or Lie algebra cohomology, respectively, and has a graded-commutative cup product, where $k$ is the trivial module.
Perhaps there is a suitable "semisimplicity" hypothesis one could impose on the category so that ${\rm Ext}(A,A)$ is graded-commutative for all simple objects $A$?
Comment: You need some (finiteness...) hypothesis on $R$ for his to be true: take $k=\mathbb C$, $R=\mathbb C(t)$, and $A$ the $1$-dimensional $R$-vector space.
Comment: A simple module is cyclic (1-generated).


Printwriter destination issue

Question: I am successfully writing strings to a text file with the PrintWriter, and by default the output text file is written to the directory of the Eclipse project I'm working on.
But my Eclipse project has a specific folder called Resources that I want the text file to be written to:
My code is:
protected void saveCommandsToFile() throws FileNotFoundException, IOException {
    PrintWriter out = new PrintWriter("commands.txt");
    int listsize = list.getModel().getSize();
    for (int i=0; i<listsize; i++){
        Object item = list.getModel().getElementAt(i);
        String command = (String)item;
        System.out.println(command);    //use console output for comparison
        out.println(command);
    }
    out.close();
}

If I change the line to:
    PrintWriter out = new PrintWriter("/Resources/commands.txt");

The FileNotFoundException is being thrown. How do I get around this? Thank you!
Answer: A PrintWriter created this way will expect a path, which can be either relative or absolute.
Relative paths are relative to the working directory.
Absolute paths on the other hand need to contain the full path from the root directory (or directories, as it happens), so on a Windows box it'll be something like c:/foo/bar.txt, on Unix-type systems /home/nobody/foo/bar.txt.
The exact rules on absolute and relative paths can be found here.
A note though on the use of relative paths. Be careful when you're relying on them because you have no way of knowing what your working directory is going to be: when you run your application from Eclipse, it will default to your project directory but if you package it up and run from command line, it will be somewhere else.
And even if you're only running it from Eclipse, writing in your project folder isn't the best of ideas. Not only is it possible to accidentally overwrite your source code, but your code won't be very portable, if later on you decide to package everything up in a jar file, you'll find you won't be able to find those directories any more (because they're all packaged up).
Answer: Try below code:
protected static void saveCommandsToFile() throws FileNotFoundException, IOException {
    File file = new File("resources/commands.txt");
    System.out.println("Absolute path:" + file.getAbsolutePath());
    if (!file.exists()) {
        if (file.createNewFile()) {
            PrintWriter out = new PrintWriter(file);
            out.println("hi");
            out.close();
        }
    }
}

Here is the project folder structure:
Project
|
|___src
|
|___resources
    |
    |___commands.txt

Answer: The path you are specifying is an absolute path. If you want it to be relative to where you're running the java program try using "./Resources/commands.txt".
Alternative you could use the full path to the folder within your project.

Printwriter destination issue


How can i light my scene better?

Question:

How can i make my picture look more like the bottom one? it doesnt have to be perfect but i feel like i got the models down i just need to have a better lighting. I have a hdr in there i dont know hwy the mountains are so dark. I dont know what else to do with it
Comment: Could you either provide your blend file or show us where your lights actually are?
Comment: heres the blend file https://www.dropbox.com/s/00wid0fl8mn1c4i/mustafar%20copy.blend?dl=0
Comment: I believe https://blend-exchange.com/ is the preferred method of uploading blend files here, and be sure to edit it into your question as comments aren't permanent
Comment: The biggest difference is almost always the type of light. Here you have a (weak) ambient light on the one hand and on the other hand the lava also emits light. You've only used volumetrics tentatively so far, and that in combination with the light from the lava creates the character of this image.
Answer: It's not just a matter of lighting, it's also the materials. They both work together. And also how you built your scene.
Materials
Your tower's material is a pure plain black base color with a bit of specular reflections. Your rocks also use a lot of black. Unless you blow up your scene with lights everywhere, that will be hard to make it not look so dark.
There is an informal rule in image making: avoid pure black/white. It's highly unnatural to begin with, and in CGI it's a pain to make it look right.
So start by giving these shaders a bit more clarity, and particularly your tower needs textures to make it less CGI. Your reference picture itself shows a greyish tower with some variations and rougher reflections, why not try to do that?

Additionally, your lava should cast a lot more light. It's literally burning hot molten rocks and metal.
Then we can think about lighting.
Lighting
You mentioned you used an HDRI, but do you think the picture you picked matches what you need in any way?

What you have here is an HDRI casting bright lightblue spots, and then some yellow and greys blue reflections. That's quite out of the subject, isn't it?
AMHA, HDRIs are good only to complement the scene's lighting, especially to provide nicer reflections. But you often can't rely just on that for lighting your scene.
A good thing for exterior is sometimes to have one big softbox-like light above the scene that casts a soft top-to-bottom light everywhere. If you think about it, it's basically what happens in real life, most of the light comes from the sky.
Sky
You are using a backplate that is quite clearly not shot with a similar camera angle, which make it instantly look like a background wallpaper instead of the actual scene's background.
You can sort of cheat it by rotating or distorting the plate to fix the depth perception and angles:

It kind of works, but this plate have birds on it. The issue is, whoever took this photo, had the birds closer than the sky behind. Here you put the plate behind, so the birds that should be close to the camera are displayed behind the entire scene. Making it look fake, and especially small.
But at this point we are fighting against assets because they are not made to be used like you want to.
In your reference, the sky is mostly dark clouds with a pink/orange horizon.
How about we try to do this ourselves?
For the clouds, you can find world shaders online that simulate clouds (like this one, but you can also make volumetric clouds or even get VDB files (I.E. this free pack).
If you go for the sky shader approach, it really depends the shader so I won't detail here. But here is what I get by using just one big VDB cloud, a slightly blue dark grey sky to tint the clouds, and a big plane light bellow the cloud to make the red horizon:

Layout
If we look at your reference, one of the things that's striking is the feeling of gigantism and landmasses spreading far beyond what we can see. We certainly got some of it back in the scene by removing the birds, but we are still with a scene where things looks small and limited to what the camera sees.
Here's an attempt of trying to give the scene more scale by changing the camera a bit, and moving/duplicating stuff around:

Atmosphere
Adding some smoke around doesn't help just with the global mood and ambience, it also helps selling the scale and believability of the scene.
You can add more smoke plates as you already started, or use shader based smoke-fakes like this one, you can also add an actual volume in the scene, or even make smoke simulations.

Final touches
Add some Depth of field  to the camera:

And some atmospheric perspective using some render passes and compositing, and some more effects to polish a bit:
Comment: can you send me that project file? its looks way better. Wow thank you!
Comment: it's deleted already X) but there's pretty much all there
Answer: You should look into the volumetrics to create the smoke effect, your mountains will appear a bit brighter, and also it will give a kind of depth to your scene. Plug a Principled Volume node into the Volume input of the Material Output, plug a Noise Texture into the Density of the Principled Volume to give it texture. You can even give it a bit of Emission Strength to make it emit light:

If you want a gradient on Z, mix your Noise with a Separate XYZ in a MixRGB:

How can i light my scene better?


What steps do I need to take to replace my Apple TV 4 remote?

Question: We broke our Apple TV 4 remote, and bought a replacement. However, the new one does not appear to control the Apple TV. Do I need to take any steps to get the new remote to control my existing Apple TV 4?
Answer: Make sure the old Apple TV Remote is out of Bluetooth range, then while in front of the Apple TV set top box press a button on the new remote. This should pair the remote to the Apple TV.
If not, try pressing Volume Up and Menu simultaneously on both remotes for 2-3 seconds, new and old, then do the aforementioned steps again with the new remote.
Comment: Pressing Volume Up and Menu at the same time in front of the Apple TV on the new remote did the trick. For good measure, I put the old remote as far as I could in the back yard. :) Thanks so much!


Contracting a rational curve in a Calabi-Yau threefold

Question: Let $X$ be a Calabi-Yau threefold and $C \subset X$ be a rational curve with $N_{C/X}\cong \mathcal{O}\oplus \mathcal{O}(-2)$. Can one contract the curve $C$? Assuming the answer is yes, what kind of singularity does one get? Explicit equation?
Comment: There is something like this in Reid's "Minimal Models of Canonical Threefolds" -- if I read it right the answer is yes, and the singularity is (locally analytically) $xy = z^2-t^{2n}$.  This is remark 5.13(b).  Not posting as an answer, since I haven't really read the rest of the paper and could be misunderstanding.
Comment: I do not have Reid's paper on my desk now, but are you sure that this is not a *local* statement (like Laufer's one contained in my answer)? The OP asks whether there are examples of such a contraction in a Calabi-Yau threefold: this is a question of *global* nature, and I do not see a obvious way to answer it by means of a local result.
Comment: Ah, you are right, sorry.  He proves only local contractibility, using the Grauert criterion.
Answer: Given a rational curve $C$ in a threefold $X$ with normal bundle $N_{C/X}\cong{\mathcal O}\oplus{\mathcal O}(-2)$, what Miles Reid proves is that, at least locally, "$C$ either contracts or moves". $C$ certainly moves infinitesimally to order one, since $\dim H^0(N_{C/X})=1$. Reid proves that if $C$ moves to order $k$ but no further, then locally at least it is contractible to the hypersurface singularity in Francesco's answer. Alternatively, if $C$ deforms to arbitrary order, then there is a small analytic disc over which $C$ deforms in a ruling inside $X$. In this case, any contraction that contracts $C$ will also have to contract all other fibres of the ruling, and locally the singularity is an $A_1$ surface double point times the small disc, given by the equation $x^2+y^2+z^2=0$ inside affine four-space.
Whether a contraction exists inside a projective Calabi-Yau threefold, in either case, is a global question, and seems quite subtle. I don't really have anything else to say in the isolated case. It is very easy to produce non-isolated examples: let $\bar X$ be a singular Calabi-Yau threefold containing a smooth curve $S$ of $A_1$ singularities; many such examples exist. Blowing up $S$ gives a smooth Calabi-Yau threefold $X$ with an exceptional divisor which is a ruled surface over $S$; the fibres of the ruling have the normal bundle you want.
Just to see that the problem is really global, consider the following, related example. Let $\bar Y$ be a singular Calabi-Yau threefold which contains a smooth curve $Z$ of $A_2$ singularities, in such a way that when you blow up $Z$ inside $\bar Y$, you get an irreducible exceptional divisor $D$ which fibres over $Z$. Over any point $p\in Z$ the fibre in $D$ will of course be a line pair, but it can happen that $D$ is irreducible because of monodromy. This can also be achieved inside a projective Calabi-Yau threefold $Y$. Either one of the lines in the fibre still has the normal bundle you want, and the numerical class of the curve can be contracted, but only by contracting both fibres along the whole of $Z$, so the contraction has to give $\bar Y$ back, with a curve of $A_2$ singularities.
Answer: This is only a partial answer.
Threefolds $V$ with an isolated singular point $p$ such that there is a small resolution $\pi \colon X \to V$ with exceptional set isomorphic to $\mathbb{P}^1$ were investigated by H. B. Laufer in the paper
On $\mathbb{CP}^1$ as an exceptional set, Recent Developments in Several Complex Variables 100,  Annals of Mathematics Studies (1981).
Laufer proves the following

Theorem. Let $V$ be an analytic space of dimension $n \geq 3$ with an isolated singularity at $p$. Suppose that there exists a non-zero holomorphic form $\omega$ on $V - \{p\}$ (i.e., that $p$ is a Gorenstein singularity). Assume moreover that there exists a small resolution $\pi \colon X \to V$ with irreducible exceptional locus $C := \pi^{-1}(p)$.
Then $C$ is isomorphic to $\mathbb{P}^1$, $n=3$ and the possible bidegrees for the normal bundle $N_{C/X}$ are $(-1, \, -1)$, $(-2, \, 0)$ and $(-3, \, 1)$.
In the $(-2, \, 0)$ case the local form for $V$ around $p$ is given by a hypersurface in $\mathbb{C}^4$ of equation $$x^2+y^2+z^2+w^{2k}=0,$$
with $k \geq 2$ (whereas for $k=1$ we have normal bundle of type $(-1, -1)$).

I did not have the time to check if for some of these example the small resolution $X$ is a Calabi Yau threefold. If so, this would provide an affermative answer to your question.
Answer: This is actually a comment on Francesco's answer, but too long for a comment. The examples given by Laufer are local; one way to make them global would be to start with a Calabi-Yau $\,X\,$ with one singular point of type $A_{2k-1}$ -- for instance the quintic in $\mathbb{P}^4$, with coordinates $(x_0,x_1,x_2,t,u)$,  given by $u^3\sum x_i^2+ut^4+\sum x_i^5=0$. The point $p:=(0,\ldots ,0,1)$ is a singular point of type $A_{3}$. Laufer gives a resolution $\hat{V}\rightarrow V$ of an analytic neighborhood $V$ of $p$; glueing $X\smallsetminus \{p\} $ and $\hat{V}$ along $V\smallsetminus \{p\} $ provides a compact manifold $\hat{X}$ wih trivial canonical bundle, and a map $\pi :\hat{X}\rightarrow X$ such that $\pi ^{-1}(p)$ is a $\mathbb{P}^1$ with the required normal bundle. What is not clear to me is whether $\,\hat{X}\,$ is Kähler, hence Calabi-Yau.


Weights in scikit-learn metric functions

Question: Most of the scikit-learn metric functions have an option to take into account sample weights. What is the purpose or use case to use this options? Unbalanced classes?
Answer: Unbalanced classes is definitely one use case, another purpose is cost sensitive learning, where the cost of misclassifying classes is different for each class. In particular scikit-learn give weights for each sample so it allows a greater flexibility.
Answer: Sample weights change the probability of each sample to be fed into model training. For example, we have 4 samples A, B, C, D with weights $1, 2, 3, 4$, it means our model has two times the probability to fit on sample B than sample A, and 3 times the probability to fit on sample C than sample A.
As you wonder what's the purpose of doing that, let's imagine what our model will become when it's fed with different weights of samples.
Example: Durian World
If you're born in a country full of durian, when you grow up, the word "fruit" means something smells awful, but we all know that most fruit smells tasty.
So is machine learning models, when our model doesn't recognize durian, just feed more durian(increase weight as there are few durian in our life compared to apple or banana). That's the situation called "unbalanced class".
When(and if) you hate durian very very much (assume you would die when you smelt durian), but you can't recognize durian well, how to keep you survived? Just feed more durian and non-durian samples, you might loss the capability to distinguish apple from banana, but you shall survive. That's the situation called "cost sensitive".


Equilateral triangle and area

Question: I need help with the following problem:
Given an equilateral triangle $\triangle ABC$ with $AB=1$, $M,\ N$ and $Q$ are points on the sides $AB,\ BC$  and $AC$ such that the lines $AN,\ BQ$ and $CM$ divide the triangle into $4$ triangles and $3$ quadrilaterals. We color the triangles in two colors (black and blue) in such way that any two triangle with common vertex are colored with different colors. If the area colored in black is equal to that colored in blue, find the sum $AM+BN+CQ$.
Answer:   The diagram is shown above.  Let $a,b,c,d,e,f,g$ be the areas of each region as shown.  Then $a+b+f+g=CN\frac {\sqrt 3}2, d+e+f+g=AQ\frac {\sqrt 3}2, b+c+d+g=BM\frac {\sqrt 3}2$.  The condition on coloring says $a+c+e=g$.  Adding the first three gives $(a+c+e)+2(b+d+f)+3g=(CN+AQ+BM)\frac {\sqrt 3}2$.  Using the coloring, we get the left side is twice the area of the triangle:  $2\frac {\sqrt 3}2=(CN+AQ+BM)\frac {\sqrt 3}2$ or $CN+AQ+BM=2$
Answer: let the triangle be EDF.

now [EDF]=[ABC]$-$( [AMC]+[ABN]+[BQC]$-$[ECQ]$-$[ADM]$-$[BFN] )
SO [EDF]=[ABC]$-$( [AMC]+[ABN]+[BQC] )+[EQC]+[ADM]+[BFN]
so we have [ABC]=[AMC]+[ABN]+[BQC]
IN $\bigtriangleup$ABC each hight is $\sqrt[2]{3}$.$\frac{1}{2}$
so we have $\frac{a}{4}$=$\frac{1}{2}$.$\frac{a}{2}$.AM +$\frac{1}{2}$.$\frac{a}{2}$.BN +$\frac{1}{2}$.$\frac{a}{2}$.CQ [ WHERE a=$\sqrt[2]{3}$ ]
from this we get AM +BN +CQ=2

Equilateral triangle and area


Unix: How do I list all directories containing a program name

Question: How would I list all directories containing the program name "minecraft"?
Comment: Programs called `minecraft`, or any files called `minecraft`? Directories in your `PATH` or any directory on the system?
Comment: What have you tried so far?
Comment: Do you want to find directories whose name contains `minecraft` or directories whose contents include a file whose name includes `minecraft`?
Answer: Using find and dirname to locate all files with the name minecraft in the current directory (adjust the search location to suit).
find . -type f -name minecraft | xargs -L 1 dirname

For finding files with executable permissions, you can use the -perm option for find (adjust the value to suit your search criteria):
find . -type f -perm +0111 -name minecraft | xargs -L 1 dirname

This should print the directory path relative to the search location.
If you want to search your whole system, just pass / as the first argument to find.
Answer: If this is Unix, you could type "which Minecraft". If it is Windows, you could type ""where Minecraft". Add --all to the which command to list all the programs not just the first. Both programs search the PATH or in the case of Windows, the path plus certain runtime registry locations.
To find programs in places beyond the path, do the find command above, but add --perm to specify the an executable. Add --type f to limit it to files.  In ancient days, there used to be an slocate command which searches an index.


Simple harmonic oscillator in a rocket which accelerates upward

Question: I'm working my way through a textbook that deals with differential equations. Here's a problem that I need some help to solve:
Suppose a spring with a constant 4.5 kg/sec² is attached to a body with the mass m = 0.5 kg. This system is sitting in a rocket which accelerates upward at a rate of 29.4 m/sec². The bottom of the body is attached to one end of the spring. The other end of the spring is attached to the rocket. So the system does not hang downwards, it is standing upwards inside the rocket.
Solve the problem if at t = 0 (liftoff), y(0) = y'(0) = 0.
Here are some constants that are used in the problem:
gravity g = 9.8 m/sec²
spring constant k = 4.5 kg/sec²
mass of the body m = 0.5kg
acceleration of the roket ar = 29.4 m/sec²
What I did was the following:
I assumed that the positive y-axis is pointing up.
First, I calculated the equilibrium position of the body:
$$
h=-\frac{m\cdot g}{k}-\frac{m\cdot a_{r}}{k}
$$
Then I tried to set up the differential equation using h:
$$
m\cdot\frac{d^{2}y(t)}{dt^{2}}=-k\cdot\left(y(t)+ h\right)-m\cdot g-m\cdot a_{r}
$$
$$
m\cdot\frac{d^{2}y(t)}{dt^{2}}=-k\cdot\left(y(t)-\frac{m\cdot g}{k}-\frac{m\cdot a_{r}}{k}\right)-m\cdot g-m\cdot a_{r}
$$
This can be simplified to:
$$
m\cdot\frac{d^{2}y(t)}{dt^{2}}+k\cdot y(t)=0
$$
And this is the differential equation of a simple harmonic oscillator which is easy to solve. But the solution of this equation isn't the right solution for the problem. I am missing the influence of the rocket in my equation. So how should I change the equation to include the rocket?
Comment: Probably related: https://physics.stackexchange.com/q/148298/25301
Answer: You've taken the rocket into consideration when you used $a_r$ as an upward acceleration. Notice that it even behaves like some "extra gravity" when $h = -\frac{m g*}{k}$ and $g* = g + a_r$. So to an observer inside the rocket, there is no difference between accelerating upwards and adding some extra gravity downwards. That's the equivalence principle!
You've also shown that the equilibrium position doesn't really matter. You can always change coordinates about a new equilibrium position (you did, assuming $y = u - h$ and replacing for $u$, note the derivatives are the same), or take both weight and "inertial force" (so to speak) as constant forcing terms. These terms will only displace the central position (there's no damping, if it had, it would be the final rest position). Instead of $y + h$ on the RHS, replace only $y$ and see what changes (it will be only the equilibrium position - remember to adapt the boundary conditions, also).
Comment: Thank you for your answer and explanation! Unfortunately, my solution still doesn't match the solution in the textbook. The solution in the textbook is:
y(t)=E*(cos(1.5*t)-1)
where E=(3*2kg*9.8m/sec²)/(4*4.5kg/sec²)
My solution would be:
Using m*y''+k*y=0 with the initial condition of y(0)=y'(0)=0 no oscillation would occur. -> y(t)=0
using m*y''+k*y=-m*(g+ar) -> y(t)=4.356*(cos(3*t)-1)
In my solution, omega is the square root of k/m and this is 3 however in the textbook, it is 1.5. And my E is 4.356, but in the textbook, it's 3.265. What am I missing here?


Question about ROIC

Question: I was reading a book called "Pitch the Perfect Investment" and I reached a table of data I did not understand (attached below). Can anyone explain why cost of capital is not tallied for the first year? That part doesn't make much sense to me, as I would imagine that there is an opportunity cost of choosing this investment in the first year too.
Answer: Actually it is taken into account. The capital charge for Year 1 is the 5$ shown under Year 2 (60 * 8.5%), for Year 2 is the 11$ (126 * 8.5%) and so on. Hope this makes sense.

Question about ROIC


Accessing the content database directly - SharePoint

Question: Is accessing a content database is not a 'best practice/advisable' or it 'should' not be done as Microsoft does not support it? I just want to know if it 'can' be done in the worst case or it 'should not be done' at all.
Comment: Oops. It is related to SharePoint.
Answer: For worst case scenario or any normal scenario till the time you are making readonly request to content database its fine. the only risk associated with this is since microsoft does not recommends the same they can change thier internal DB structure any time during  hotfix or SP release. Be causious in accessing the data so that you do not cause any lock or dead lock type situations
Answer: You should not access a ContentDB directly. The access to any SharePoint DBs can void your support for the farm, and yes, this includes READING from the DB.
See: http://support.microsoft.com/kb/841057/en-us
[...]
Examples of such database changes include, but are not limited to, the following: Reading from the database, manually or programmatically Adding database triggers:
Adding database triggers
Adding new indexes or changing existing indexes within tables
Adding, changing, or deleting any primary or foreign key relationships
Changing or deleting existing stored procedures
Calling existing stored procedures directly
Adding new stored procedures
Adding, changing, or deleting any data in any table of any of the databases for the products that are listed in the "Applies to" section
Adding, changing, or deleting any columns in any table of any of the databases for the products that are listed in the "Applies to" section
Making any modification to the database schema
Adding tables to any of the databases for the products that are listed in the "Applies to" section
Changing the database collation
Running DBCC_CHECKDB WITH REPAIR_ALLOW_DATA_LOSS (However, running DBCC_CHECKDB WITH REPAIR_FAST and REPAIR_REBUILD is supported, as these commands only update the indexes of the associated database.)
Answer: Well, I wish I could give you a firm answer BUT I can say this; if you are looking for a "worst case senario" then hook your SharePoint list up to an Access db and pull it all down via a link table.  That way you can copy into a 'real' table.
That is if that is what you're looking to get to.
If you're looking to just do reporting on it, then TOTALY use link tables in Access and report off of them.  It'll be safe and it will be real-time.
Comment: No. I dont want to make a copy. I want to generate reports based on the real time data. Mirroring the DB is not going to help me.
Comment: @NLV oh, well you can just use link table in access to do your reporting.  It'll be safe and real-time.
Comment: @NLV Seems to work fine for us...a division of top 500 company.


Why does Spanish Stack Exchange prefer Spanish questions?

Question: I'm pretty sure Spanish Stack Exchange is for Spanish learners to ask and answer questions about the Spanish language. So why would it prefer questions in Spanish? Why would a forum for Spanish learners want the questions to be in Spanish? That doesn't make sense to me. Can someone please explain? Also, why does Spanish Stack Exchange require tags to be in Spanish?
Answer:
Why would a forum for Spanish learners want the questions to be in Spanish?

Well, that's not the site's only purpose:

Spanish Language Stack Exchange is a bilingual question and answer site for linguists, teachers, students and Spanish language enthusiasts in general wanting to discuss the finer points of the language.

Besides that, asking, answering and reading Spanish posts is a great way to do immersion. Yes, you (and I, and other learners) would be able to read posts in English much faster than posts in Spanish, and understand them better. But for our overall progress in learning Spanish, it's better to use Spanish. Tag names help a little too - it's one of the few things the community can contribute to what a user experiences as 'the system' (unlike e.g. button and label texts, which are always in English).
That said, a question being in English or in Spanish should never matter to determine whether it's on-topic or not, nor should it influence voting.
Answer: As a Spanish learner I really value questions and answers by Spanish speakers especially from a Spanish speaking country other than Spain like this one
I can learn all the standard vocabulary but it becoomes harder to read the papers when you don't know who the people are that are involved especially the politicians. Their names are not in a dictuionary anywhere. Once you know who Señor Sanchez is, reading the Spanish papers becomes so much easier.


seamless DNXHR player

Question: I am looking for a player for DNxHR that will playback files seamlessly, as there is no brief pause between files playing. two files played back to back should play as though they are effectively one file. can someone recommend a good solution for this? thanks!
Answer: Player like djv and vlc should be able to play dnxhr without issue. The pauses likely occur because of the reading-speed of the drive. If djv and vlc are still buffering while playing, try moving your footage to a faster ssd and try again.
Comment: they seem to play a single file fine, but I see a hiccup between files. from what I can tell I have plenty of drive speed. any other ideas?
Comment: Hmm. Could you elaborate on the "hiccup"? Does the program have to buffer when playing two videos back to back and switching from one file to another? In that case, I think that a programmer could actually help you more than the beautiful folks here.
Comment: I believe it is a buffering, but not entirely sure.
Comment: I'd leave this question open here but ask the same one on the stackexchange or a similar forum dedicated to programming. I'd guess that your chances are better there :)

seamless DNXHR player


What does it mean that image if formed in front of mirror

Question: Today my teacher told me about plain mirror that distance of image formed(inside mirror) is same as distance of object.
And clearly I can understand like the frame of mirror shown here is a door and someone exactly like me is standing away from me.
But when it comes to concave mirror, I don't get it how do I understand that image is formed in front of mirror ?
Answer: I think you are very much confuse, first thing you should get clear is, images formed by plane mirror are virtual mean incident rays will never intersect in real world, image formed by concave mirror are real with exception,  when object range between (0,F],(where F is the focal distance and 0 is at pole), real image are inverted, when your teacher said  the image formed in front of mirror, he mean the object and image are on the same side.


how to use PTM corner models in hspice

Question: I have downloaded 65nm models for TT, FF,and SS from ptm website(http://ptm.asu.edu/). I want to test these on a cmos inverter using hspice. Kindly tell me how should i proceed. It is for the first time that i will be doing such simulation so kindly also tell me what result should i expect.
Previously I have done Monte carlo of RC filter in LTspice, is corner analysis different from Monte carlo ? If yes, how?
Thanks.
Answer: Typically the value is passed on the command line at the time of evoking the run.
Here is the setup line from my simulator which has the ability to read several different library hierarchies:
<code>foundry/process-name/mosst/param.lib 3s; -> that says use the 3 sigma values
foundry/process_name/mosst/model-name.lib wp -> that says use the wp values
 - wp here is similar to FF,TT,SS etc.
</code>
note: file names are changed for confidentiality reasons
The actual file that the simulator uses is assembled at run time through a series of calls that are like ifdefine statements used in compilers.  Here is a snip from a *.lib file
<code>.lib tm
*bsim3v3
.include ./models/bsim3v3/parameter-name.par
.include ./models/bsim3v3/nmos-name.mod
.include ./models/bsim3v3/pmos-name.mod
</code>
This reads as "if the called library is tm then include these files in the subdirectories"
If you are using a graphical tool there will be command parameters that you have to set that get passed to the spice executable.  If you are running from the command line this will go in to your scripts to call the spice executable.
Temperature is set as a global parameter and SPICE uses it to change the models.
Monte Carlo simulation uses process corners, Voltage and Temperature and schmoos the design (and can be used to schmoo the W/L and stray capacitances at higher levels) to see the safe operating area.  It is very computationally intensive.
Corner analysis is much more and can be viewed to be setting the outer limits that monte carlo must stay within.
I would recommend that you snoop through the library directory and under stand how things are called.  I bet you'll find stuff in the library that would surprise you.
Comment: Thank you very much for your response but I don't have a library from foundry. I downloaded 3 files each for nmos and pmos (corresponding to tt,ff,ss) from ptm. As per your suggestion when looked into them they differs in some parameters such vtho, xj, lint etc. how do i use these file to perform corner of cmos inverter in hspice?
Comment: you either need to setup the *.lib to do the .include like a typical file hierarchy or you need to call the file that you need for each run without the hierarchy.  But you may have issues with house keeping issues like directory structure.

how to use PTM corner models in hspice


Make auctex ask me only for position and width when inserting a minipage environment

Question: If I insert a minipage environment using auctex LaTeX-environment it asks me for "Position", "Height", "Inner Position" and "Width". However I only want to be asked for "Position" and "Width". How can I achieve this?
Answer: AUCTeX in general queries for the next optional argument if the current one is filled with some text and is not a empty string (which is simply  hitting RET by the user).  For me, when I hit C-c C-e minipage RET, AUCTeX queries for the (Optional) Position and if I leave this empty and hit RET, it takes me directly to the mandatory Width with 1.0\linewidth as default.  Maybe you're using a completion infrastructure like vertico which chooses and inserts the first optional argument and then you get queries for more.


Iphone 8 App Store Not Working No Fixes Have Helped

Question: So I recently got off android and bought the Iphone 8 with IOS 11.0.2 running. Everything was good until about a day after I bought it. I noticed I couldn't download apps anymore. I would sign into my apple id then the app store would tell me its all good then it just gave me the spinning circle and never downloads. I have tried restoring twice and once with a new apple id and still same problem. I have tried going to the At&t store to get it fixed yet still nothing they even gave me a replacement phone. Even with that phone its the same issues. I can download apps for about a day then it just shuts off again. Anyone know anything that could fix this? Or am I just going to have to wait until IOS 11.0.4 comes out. FYI this issues is on both 11.0.2 and 11.0.3 I did try updating it. Any help at all would be very appreciated. Thanks
Comment: What other troubleshooting tricks have you tried? Shutting off and restarting the iPhone, logging out of your Apple ID and logging back in, etc.?
Comment: The only thing that works is logging out then back in but I can only download one app per sign in.  I have tried everything from restoring to restarting to getting a new apple ID nothing.
Answer: I had the same issue with my new iPhone 8 Plus. I came from an iPhone 7 and never had that issue, although it seems relates to the Apple ID.
What i did to temporaly work around it was to shut down the phone and turn it on again. Now i was able to download and update apps again.
Also you can try to reset your keychain.
Settings > [Your name]  > iCloud > Keychain
Also, try updating to iOS 11.0.3
At the time i had the issue i was with iOS 11.0.1
Comment: It does it on both IOS 0.3 too The only work around for me is restarting the device every time i need an app or signing out and in.


Open sets in $\mathbb{R}$

Question: In Apostol's Analysis, he says that an open set in $\mathbb{R}^1$ is no longer an open set if it is considered a subset of $\mathbb{R}^2$ because such a set cannot contain a 2-ball. I am having trouble understanding how an open interval in $\mathbb{R}^1$ can ever be a subset of $\mathbb{R}^2$.  Also, does the same apply for open sets in $\mathbb{R}^n$ as subsets of $\mathbb{R}^{n+1}$?
Comment: No nonempty subset of $\mathbb R$ is a subset of $\mathbb R^2.$ However, if $E\subset \mathbb R,$ then $E\times \{0\}$ is a subset of $\mathbb R^2.$ Apostol must be saying that if $U\subset \mathbb R$ is nonempty and open (in $\mathbb R$), then $U\times \{0\}$ is not open in $\mathbb R^2.$
Comment: I can't really make out your notation.
Comment: @zhw.: I mean instead of considering $0$, can't we consider any $a\in\mathbb{R}$? More precisely, can't we interpret Apostol's statement as follows: if $U⊂\mathbb{R}$ is nonempty and open (in $\mathbb{R}$), then $U×\{a\}$ is not open in $\mathbb{R}^2$?
Comment: That would be equivalent, but the usual convention in considering $\mathbb R$ as a subset of $\mathbb R^2$ is $\mathbb R \sim \mathbb R \times \{0\}.$
Answer: You are right to be suspicious. I think what is meant by: "considered as a subset of $\mathbb{R}^2$" is that if $S \subseteq \mathbb{R}$, the set: $S \times \left\{0 \right\} \subseteq \mathbb{R}^2$. It is then clear that such a set cannot contain an open ball and hence is not open, so long as $S \neq \emptyset$.
And yes, the claim can be extended to general $n$.
Comment: thank you so much! makes sense.
Answer: the open Interval $(a,b)$ can be see in $\mathbb{R}^2$ as
$$\{(x,0)\hspace{0.2cm} | \hspace{0.2cm}x \in (a,b) \}$$
Answer: usually, we think of $\mathbb{R}^n$ as imbeded in $\mathbb{R}^{n+m}$ by $$(x_1,...,x_n)\rightarrow (x_1,...,x_n,0,...,0)$$(for this matter, any continuious embedding will do).
the claim is true for any $n,m>0$ ,because any ball in $\mathbb{R}^{n+m}$ has pointsd differing in all cordinates.
Answer: the open Interval $(a,b)$ can be see in $\mathbb{R}^2$ as
$$I_{ab}:=\{(x,0)\hspace{0.2cm} | \hspace{0.2cm}x \in (a,b) \}.$$
Suposed that $I_{ab}$ is a open set in $\mathbb{R}^2$, as $I_{ab}\neq \emptyset$, there's a ball of ratius $\delta>0$ centered in $(c,0)$ for some $c\in(a,b)$ (we will denote such  ball as $B_c(\delta)$) such that
$$B_c(\delta)\subset I_{ab}.$$
Notice now that $(c,\frac{\delta}{2})$ belongs to $B_c(\delta)$ but $(c,\frac{\delta}{2})\notin I_{a,b}$ (--Why?). Absurd!
Therefore, none interval of $\mathbb{R}$ can be a open set in $\mathbb R^2$.
$\hspace{17cm}$$\Box$
Ps. You can use the same idea for $\mathbb R^n$ and  $\mathbb R^{n+1}$.

Open sets in $\mathbb{R}$


What are the preferred server resources needed to run a magento 2 ecommerce site? php memory limit, virtual and physical memory? ,

Question: When updating magento to 2.3, warning was given to set php memory to a minimum of 2048. Wondering what the preferred settings/resources are and if hosting on a shared server is fine.
Comment: You're using a shared server?   I would strongly consider literally any other cart, and if no other choice can work, only then magento.  Seriously, I wish it was made more clear, though I likely had no choice anyway... you still might.
Comment: Thanks for your input. It's just that I'm familiar with it but am running into many issues with magento 2. What would you suggest?
Comment: All of the platforms choices are thoroughly horrible, but I'd suggest woocommerce.  shopify or bicommerce if SAAS is OK, but you'll be working around either as often as you're working within them.
Answer: Here is the needed php configuration.
<code>memory_limit = 2G
max_input_vars = 10000
max_input_time = 1800
max_execution_time = 3600
always_populate_raw_post_data = -1
</code>
According to technology stack requirements:
Memory requirement:
Upgrading the Magento applications and extensions you obtain from Magento Marketplaces and other sources can require up to 2GB of RAM. If you are using a system with less than 2GB of RAM, we recommend you create a swap file; otherwise, your upgrade might fail.
References:
https://devdocs.magento.com/guides/v2.1/install-gde/system-requirements-tech.html
Required PHP settings doc:
https://devdocs.magento.com/guides/v2.3/install-gde/prereq/php-settings.html
PHP settings errors doc:
https://devdocs.magento.com/guides/v2.3/install-gde/trouble/php/tshoot_php-set.html
Your server is shared or dedicated must support above settings for upgrade or install it or any modules of it.
Comment: Thank you for your assistance. The only option I don't see in my php ini settings is the raw_post_data.


Ständchen Schubert arr. Liszt help with line

Question:
While learning this piece I encountered this line connecting two notes between the different clefs. I've never seen it before but my best guess is that maybe it's showing a change in the voice between the two clefs. Any help would be appreciated.
Answer: Like you said, it's just an indication that the voice is changing between the two clefs  (F in the bass clef to D in the treble clef). These kind of lines are common when the author wants to show you how the voice is moving between clefs, when there is no beam to connect them (like the two previous notes in your example).
Answer: Another technical point: the F on the left side of the line is doing double duty as part of the middle voice and part of the lower accompaniment. This creates a bit of difficulty, as you have to repeat that F on the third beat in the accompaniment, while holding it as part of the middle voice. The line is there in part to call that to the performer's attention.
To make that happen, you have to sort of "fake" it, holding the F a little longer than the lower notes in the accompaniment, playing it a little louder perhaps so it will stand out from the lower notes, and using the pedal artfully to give the impression that the note is being held while still managing to make the F on the third beat heard. Of course, you can't do all these things perfectly, but it is possible to communicate the musical intent if you keep the music in mind.
Answer: The line also makes it clearer that the two notes connected with the line should be played with the same hand (the left hand in this case)...although if your right hand can span a 10th, you can use your right hand for both of the last notes in the upper staff (the F above High C and the D above Middle C) while still following the fingering.
Comment: The note is to be played with the right hand (though it would be easier with the left). If it was to be played with the left hand, it would be notated relative to the bass staff with an upward-pointing stem. Liszt had no qualms about writing tenths; there's on on the downbeat of the measure — same notes one octave higher.


Two compounds (not stereoisomers) have same SMILES code

Question: Are there compounds that have the same SMILES code but are not stereoisomers? I am trying to find inconsistencies with SMILES code and currently I have that many compounds have multiples options for SMILES code but I want to find if there is a SMILES code that can represent multiple compounds.
Comment: Did you check the SMILES to be of same type and origin? The three likely most frequently requested SMILES openbabel assigns are canonical, universal, and InChIfied SMILES ([documentation](https://open-babel.readthedocs.io/en/latest/FileFormats/SMILES_format.html)); it only is a question of structure complexity of the molecule structures submitted if they differ (within one program), or in comparison to other programs (GUI like ChemDraw/ChemDoodle/Marvin, CLI like RDKit). Both obabel and RDKit allow SMILES to SMILES conversion for a consistent starting point for such a test, too.
Comment: Once on a solid ground, comparison with similar benchmarks/checks might be of interest for you, too.  There are (at least) the ones by Noel O'Boyle, John Mayfield, Roger Sale presented to 256th ACS National Meeting Boston Aug 2018 ([slides](https://www.slideshare.net/NextMoveSoftware/a-de-facto-standard-or-a-freeforall)), and the blog post [Running a SMILES Validation Benchmark](https://depth-first.com/articles/2020/10/05/running-a-smiles-validation-benchmark/) by 2020 by Richard L. Apodaca.
Answer: Many SMILES for single structures
There are many, many valid SMILES for most organic structures.  For example, CCO, OCC, and C(O)C are all valid SMILES for ethanol.
Many structures for single SMILES?
There are probably cases where the same SMILES can represent multiple compounds, but most of these probably involve transition metal complexes, which SMILES is (I think) widely regarded as not handling very well, or else cases where what is meant by "compound" is also ambiguous.  E.g. are "ethenol" and acetaldehyde are arguably both represented by C=CO, but in order to see that you need to know about keto-enol tautomerism.
Comment: The correct (re)assignment of double bonds in organic compounds indeed can be problematic. [We need to talk about Kekulization, Aromaticity and SMILES](https://www.slideshare.net/baoilleach/we-need-to-talk-about-kekulization-aromaticity-and-smiles) by Noel O'Boyle, John Mayfield presented to the 254th ACS National Meeting in Washington, DC Aug 2017 provides an insight. For an identification of a molecule in a database, given the computational power available today, use of multiple descriptors (SMILES complemented by a second «key») can be helpful (a bit like two-factor authorization on email).
Answer: The SMILES corresponds to the underlying molecular graph (with bonds being edges and atoms vertices). This means the question you are asking is "are there any molecules that are different, not stereoisomers, and have the same underlying molecular graph".
The answer to this is yes. One typical example is atropoisomers (due to conformational barriers), though this can also be considered stereoisomery depending on how strict you are. This is actually relevant, for example in the kinase field some biaryls will show atropoisomerism. Another example is topological isomery. Imagine a trefoil knot C100 cycloalkane vs the ordinary C100 cycloalkane. Same graph, so same SMILES. However, in most typical uses of SMILES, these type of issues can be considered purely curiosities.


How do I exclude directories when listing files?

Question: How do I exclude directories when listing files in the current directory?
ls .

^ will include directories in the listing.
Answer: Try this one:
find . -maxdepth 1 -not -type d

Comment: No. (1) it would be recursive, (2) it would not list symlinks. @Steve asked for equivalent of `ls .` without directories — and here it is.
Comment: keep it simple:
$ find . -type f
Comment: Adding `-ls` or `-exec ls -l {} \;` would make it like `ls -l` without directories.
Comment: `find . -maxdepth 1 -type f -o -type l` could also add includes of symlinks beside files.
Comment: This was perfect for my needs except for leading `./` in the listing, but easily removed with `cut -c 3-`
Answer: To get it exactly equivalent to ls . you need to not show hidden dirs.
find . -maxdepth 1 -not -type d -and -not -name '.*'
and that still leaves you with './' prefixed to each filename.  That's not really an issue, but I think it's kinda ugly.  I went with:
ls -p | grep -v '/$'
And that will get you a listing that looks the same, and you can add additional ls arguments too.  Add a --color=always and you'll get your dircolors back, or -a to see hidden files.
I like Alexander's answer because he's actually depending on a filesystem characteristic of the file in question so it won't get fooled ever.  My answer will get fooled by a file that has a '/' as the last character in it's name.  But that seems like it's asking for trouble.
Comment: @JiriXichtkniha what is the POSIX alternative to -not?
Comment: '-not' is GNU find related, as it is not POSIX compliant, it's better not to teach these options as an user could have "bad" habbits and feel lost on other UNIXes :)
Answer: try this:

$ find . -maxdepth 1 -type f

or this:

$ ls -p | egrep -v /$
$ ls -la | egrep -v ^d
Answer: Though it's an old post, but i thought this might help..
$ ls -l |grep -v ^d
It will list all the files including symlinks,character and block files.
Comment: This answer was already provided over a year before by jamzed, (making this visual noise.)
Answer: The "find" solutions above lose some of the capabilities of ls - for example: list only files, sorted in descending modification time.
The "ls -p | grep" answers do not elegantly deal with other elements of ls such as -R should they be desired
The following answer, while more verbose, in my opinion reflects the truest ls behaviour and most flexibility for selecting "files only"
ls -t . | while read line; do
  if [ -f $line ]; then
    echo $line
  fi
done

Simply replace the ls switches as desired and the result will be returned with files only. If links and other items are also required then minor rework would need to be done to the test for inclusion.
Answer: ls $(file --no-pad  -F' '  * | grep -v directory | cut -d' ' -f1)

With this you can still use any other options ls usually takes.
Or... remove -v to list only directories.
Or... replace directory with any other filetype that file understands and reports, like ASCII, empty, ELF, and so on.
Comment: `ls -t .|while read f;do [ -f "$f" ]&& echo $f;done` is about 3x faster in my tests
Comment: This doesn't work if any of the filenames to be listed contain spaces.
Answer: I was on a system where the find binary did not support -not and I ended up using:
ls|while read f;do [ -f "$f" ]&& echo $f;done

Advantages:
Does not rely on anything other than sh ls echo
Is compatible with bash and dash
Can be changed to match other things, (such as directories) by changing -f
Is fastest than some of the answers and uses less RAM and CPU
Answer: ls -pd $PWD/* |grep -v /$ |xargs ls -l --color=always


Fix for : A Web Part with this ID has already been added to this page

Question: I'm trying to copy a Production Site over to my Development server using DocAve which I have done successfully many times. But I'm having a problem with a particular site. Even though it copies over correctly when I try to access the site I get the "A Web Part with this ID has already been added to this page" error. Can anyone advise how I can fix this issue?
Answer: You can add ?Contents=1 to the page url and see what all webpart are installed.
#From
http://portal/Pages/Blog.aspx

#To
http://portal/Pages/Blog.aspx?Contents=1

If duplicates exists then you can select those and delete.
If that didn't resolve, then you can probably remove all webpart and add it using Insert WebPart option.
Answer: as amal noted you need to add contents=1 to the url page that shows this error! and remove the offending webpart that has the error or is in error state!
it could possibly also be that your using the wrong template when the site is created well i say you i mean avepoint is! The template being used usually must be the same as the one that was used on the source site ;) .
I hate using these third party rubbish applicaitons that claim todo what you can do for free and far quicker! yes they can do easy tasks as they are ok but when it comes to complex migrations or sometimes simple migrations they not only fail they do it in style and time :)
how about do it the ms approved way? use export in powershell or if its 2010 to 2010 or 2013 to 2013 than just export the content database via SQL server. Save the file to the dev enviroment. In the dev enviroment you can create a web application and create a site collection.
now in central admin detach from the content database the webapp you just made. Goto SQL server on dev and overwrite the detatched content database with the one you migrated over!
once complete you can then use powershell to re attach back the content databse.
once complete goto the web application url and you should have a working mirror copy of the origional site without ID missmatch!!
all done! else if your insistant on using docave make sure there is a checkbox that you can tick to change the guids of webparts when it exports so that the ids are different in content database!
Migration of SharePoint from 2007 to 2010/2013
Answer: Thanks Ali/Amal. I tried the ?contents=1 but I got an error and it never showed me the Web Parts so I wasn't able to delete them from there. Maybe my case is unique but this is how I was able to fix it.
Instead of using DocAve I used PowerShell and exported the site. I then went and created a basic site and proceeded to import the exported site. The process would stop and again give me the duplicate error. So I used the ?contents=1 on the basic site and deleted the Web Parts. Tried importing the site again but with no luck.
So I verified the import log and noticed that the problem was not a Web Part but a document library, the Shared Document library to be exact. So I deleted and recreated the basic site and proceeded to delete the Shared Document library from the basic site. I then tried the ?Contents=1 to delete any Web Part but none appeared on the list. Somehow deleting the library removed the Web Parts associated with it. I then proceeded to import the site via PowerShell and it worked.
Again thanks for your help.


Which is the better investment: real estate or stocks?

Question: I get a better ROI with real estate but it is time intensive. Stocks take very little time but the ROI can vary wildly.  Also, during a recession, the value of stocks can plummet but with real estate your rent should never go down.  What is a good strategy to take advantage of both?
Comment: What is your ROI on real estate?  My own experience is that you are hard pressed to achieve 4% ROI with a lot of work.  Stocks are much more attractive IMHO.
Comment: The title question sounds opinion-based, but you ask a different question in the body. Can you edit to clarify?
Comment: "I get a better ROI with real estate but **it is time intensive**." Time is money.  What else can you be doing with your time **which earns you money** instead of spending it on your rental properties?
Answer:
with real estate your rent should never go down.

Well, you could keep your retla rate constant, but you can absolutely lose rental income if you have renters fail to pay (or break their lease) or the house goes unrented for long periods because your rent is too high.
Plus you can have unexpected expenses that can lower returns, and even cost you more than you're bringing in, akin to a "loss" in stocks.
I think you've hit the main points - real estate has higher return on average but takes more active work. You need to decide if you like being a landlord and the work is worth the extra return.
Comment: Evicting renters can take a *long time*, be very expensive, and -- in the meantime -- they trash the place, causing you even more expense.
Comment: also your rent can absolutely go down; so can your purchase price (causing opportunity cost even if you get the same rent); most real estate purchases are leveraged so you can lose massive amounts of money in that case.
Answer: If you want to bet on the market for renting real estate while avoiding all the work of being a landlord, then you can invest into a Real Estate Investment Trust or a Real Estate Fund.
This way you are not buying one real estate property. You are buying shares in a portfolio of real estate properties. Those properties are managed by a company which takes care of all the landlord stuff. You and the other investors receive the revenues from the rent, minus the cost for management and maintenance of the properties.


How strength of RF coupling depend on the antenna material?

Question: If we place different materials in the microwave owen, they will get hot at different speeds. For instance meals get hot really fast. What material property decides on the strength of the coupling? Resistance? Permeability?
Comment: Food in a microwave is not normally considered an "[antenna](https://en.wikipedia.org/wiki/Antenna_types)", so you might get a better response if the title matched the actual content of the question.
Comment: Thanks, the title actually reflects of what I would like to know.
Answer: Many factors influence microwave heating. Resistance, dielectric absorption, magnetic hysteresis, geometry, ...
Answer: In AC regime, major part of non-magnetic material medium's response to external EM field (the linear part) can be described either via the frequency-dependent complex conductivity $\sigma(\omega)$, or via frequency-dependent complex permittivity $\epsilon(\omega)$. The choice is somewhat arbitrary and depends on convention, and the two functions differ by a trivial frequency factor. In optics permittivity/index of refraction is used, in conductive materials (metals) conductivity is used.
Comment: Thanks for your comment. I'm actually comparing 3 wires: metal (Molybdenum), carbon fibre (so mainly graphite) and silicon carbide (SiC). And I'm trying to figure out which one will absorb more energy in frequency range 50 MHz - 1 GHz. Where do I find data about frequency-dependent complex permittivity?


How can I read the files stored on the hard drive of a Xerox 7242 printer?

Question: So, I've read that most printers save the files they print/scan and I was trying to see if that's the case with our work printers. Is there a tool to let me access these files?
Answer: Everything that I've read and news reports I've seen about this problem seems to indicate that dismantling the machine and removing the hard disk drive is the best way to get to the data. If you're doing a pen-test I'd say that it's fairly unlikely that the Customer is going to let you tear their photocopier apart.
Presumably there are vulnerabilities in many copiers' operating systems that would permit access to the hard disk drive, but it may go well beyond the level of a simple pen-test to develop software to exploit these sorts of vulnerabilities. If that's something that interests you then you may want to start investigating the various OS's and embedded platforms used in copiers, serarching for vulnerabilities, and developing exploits to get at the data. You might well be able to make a name for yourself...

Forensic analysis of digital copiers

Digital Photocopiers Loaded With Secrets
Comment: From http://www.computerworld.com/s/article/print/277746/Smart_Printers_Scary_Printers
 - "At the Black Hat conference in Las Vegas in August, O'Connor delivered a blow-by-blow presentation on how to bypass authentication, inject commands at the root level and create shell code to take over printers in Xerox Corp.'s WorkCentre line of printers, which run on Linux operating systems.

"
I'm just taking my first baby steps in sec and pentests, but since most printers everywhere are left with default configs and store sensitive data, I assumed there would already be a way to test/exploit this...
Comment: @Penetrator: My experience is that many printers don't run as fully-feature of an operating system as Linux. Certainly, though, the higher-end printers (Xerox, Ricoh, Canon, etc) are more apt to be running general-purpose OS's. I wouldn't be surprised if there are goodly numbers of command injection bugs in the various web-based interfaces on a lot of higher-end machines. That's probably the first place I'd look, along w/ fingerprinting the OS and daemons running on the machine and looking for known vulnerabilities.
Answer: Talk to your vendor sales or support rep.
I'm pretty sure that most Xerox devices in this range automatically encrypt and overwrite data. You may have to purchase an additional license.
Comment: Could you explain the license issue? What's the default behaviour if such a license doesn't exist?
Comment: The Xerox collateral mentions a "Data Security Kit". I don't know whether you have to pay extra for that or not. My employer has required encryption for a few years now, so I'm not sure whether it is an added cost or not.
Answer: At least with older Xerox printers there were a variety of Postscript operations available for interacting with the local filesystem...you could use this by submitting the appropriate print job to the printer, or possibly through an interactive telnet session.  Look at the "File operators" section in chapter 8 of the Postscript Language Reference Manual.
Of particular interest may be the filenameforall operator, which will execute a block of code for each filename matching a pattern...this is a great way to write your own version of the ls command.
At one point I had some tools for connecting to the printer via telnet and dumping the contents of all the files (and then splitting them apart on the receiving end).  I think they've been lost after some job and hardware changes, but it's definitely possible.
EDIT: Section 7.4.2 of the MIME RFC is also interesting from a security perspective w/r/t Postscript printers.


Podman: What if user is member of docker group?

Question: From a security perspective: Is it necessary that a user, that runs OCI containers with Podman, is not at the same time a member of the docker group?
From what I understand the idea behind Podman is to re-map the  user ids, such that the root user within the container is equivalent to the user on the host. The security concept is better because if a user can take over the container and break out, the user is not automatically root user on the host (given that the process within the container was started as the container's root user).
Now if the user on the host is in the docker group it should be equivalent of having root access as stated in the Docker post-installation guide:

The docker group grants privileges equivalent to the root user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.
-- Source

So if an attacker breaks out of a container managed by Podman, and at the same time the user who started the container is in the docker group, the security gain should be none compared to managing containers with Docker. Is this correct?
Answer: Yes, I'd say that your assertion here is correct. Gaining access to an account which is a member of the Docker group on a host (absent other custom protections) will allow the attacker to escalate their privileges to be root on the host.
Typically podman is used for developer systems rather than running production services, which would usually be done with something like CRI-O, in that kind of environment.
It's possibly worth noting that it is possible to run Docker in a rootless mode similar to podman, which may mitigate this kind of issue.


Screen turns off while VLC is playing movies in Kubuntu

Question: When I play a movie on VLC the screen turns off after 10 minutes. I used to run Ubuntu and this didn't happen there.
Answer: There are couple of settings that you should check in VLC:
1) Tools --> Preferences --> Show All --> Video --> Disable screensaver
2) Tools --> Preferences --> Show All --> Advanced --> Inhibit the power management daemon during playback
If both of this options are checked, you could try a simple wrapper script which disables the monitor modes that will power down, standby or blank the screen prior to calling VLC:
#!/bin/bash

#Disable modes
/usr/bin/xset -dpms &
/usr/bin/xset s off &

#Open VLC
/usr/bin/vlc "$@"

#Re-enable modes
/usr/bin/xset dpms
/usr/bin/xset s on
exit

Comment: How to use the script?
Comment: Both of the options were already checked.
Comment: so, you could try a wrapper script
Answer: For me the solution was to access System Settings as root by pressing Alt+F2 to open the run dialog at the top of the screen and run
kdesudo systemsettings
then go to 'Display and Monitor' to get to the 'Screen Saver' selection screen and uncheck the checkbox next to 'Automatically start after:', then click 'Apply'.  For some reason it seems that the screen saver setting is active on the root account in various versions of Kubuntu (probably in Ubuntu as well since I've seen posts for Ubuntu users experiencing this problem too).  Doing this worked for me after first trying the suggested options of disabling Display Power Management and disabling the Screen Saver on my user account.  I have not tested to see if the problem returns when those items are re-enabled but as I indicated with all of those items disabled I no longer have a problem with the screen going blank while watching videos with VLC.
Answer: Have you tried to disable the "Screen Energy Saving" from the Power Management ?
System Settings > (Hardware) Power Management > Power Profiles

A bit older: http://www.kubuntuforums.net/showthread.php?51579-SOLVED-video-standby-every-10-minutes-when-mouse-is-not-used-(watching-a-video)
Comment: I unchecked "Screen Energy Saving" and the monitor still turns off after 10 min. I also tried to set it to 360 min and it still turns of after 10 minutes. I did the changes on the performance profile, and this is the profile that's currently selected because my laptop is plugged. It's as if the option is ignored. I'll try using 'xset -dpms' from the link you gave.
Answer: There is a separate setting in system/settings/display-monitor that is independent from power management settings. Just go there and disable screen saver. This will take care of your problem.
Answer: It may also help starts vlc with the "--inhibit" option. You can put that option in the VLC startup line editing the KickOff launcher menu: /usr/bin/vlc --inhibit %U that works on Debian Wheezy 7.8.0 vlc version 2.0.6 Twoflower (2.0.6-0-gbe9623c)
Answer: You could install tool like Caffeine:
Caffeine
Caffeine is a system applet that allows the user to temporarily inhibit both the screensaver and the sleep power saving mode, simply by clicking on it.
This could be useful for example when watching long flash videos or playing certain full screen games that don't inhibit the screensaver by themselves. Caffeine can be set to automatically activate when any user specified application is running.
More info at: http://ubuntu-tweak.com/app/caffeine/
Installation steps:
sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine


Could the magnetic field influence tectonic forces

Question: Paleomagnetism can be measured as the magnetic field at the time of rock forming is preserved in some minerals.
Could the paleomagnetism and the present magnetic field somehow influence the movements of tectonic plates?
Comment: I doubt it, but [the reverse has been *considered*](http://phys.org/news/2011-10-plate-tectonics-reversals-earth-magnetic.html).
Answer: The electromagnetic force and related field is a strong force at very small distances (governs the way the proton and electron are held to an atom) but is relatively weak over large distances.  I don't see how that small force could act on processes involved in the convection of the mantle.  If memory serves, the iron in magmas preserves the force of the electromagnetic field on earth at the time the magma cools to form rock. It leaves its imprint but has no affect on the process or origin of magmatism much less the convection that drives plate tectonics
Answer: The forces of a magnetic field on materials that are not ferromagnetic and not electric conductors are negligible compared to pressure, tension, and buoyancy. It is likely safe to ignore them for the upper mantle.
However, the lower mantle is a semiconductor with a significant thermal gradient, which induces electrical gradient via thermoelectricity. This paper suggests this effect can be strong enough to actually be a source of geomagnetism. If true, it is also strong enough to interact with geomagnetic field to produce mechanical forces, which would manifest as a depth-oriented gradient of East-west drag.
Another paper claims both geomagnetism and plate tectonics have the same cause: Global coupling at 660 km is proposed to explain plate tectonics and the generation of the earth's magnetic field.


How can I protect an EventSourced aggregate from user-generated event storm?

Question: Let's say you're building a social web app where an aggregate root (f.e. BlogPost) could be liked and unliked. Now consider a malicious user who wrote a script to perform an endless amount of like and unlike on the same aggregate, maybe he hijacked multiple user accounts to do it in parallel. This would mean the aggregate would require lots of events in order to be rebuilt and the event log would contain thousands of useless events that are once collapsed only projecting one state change. Is there some pattern in EventSourcing to collapse those events with their respective anti-event in order to reduce the amount of data?
Answer: Typically, you would handle this sort of thing in the application, rather than in the domain.  For example, a rate limiter to restrict the number of edits per BlogPost, maybe another on the edit command itself.  This sort of thing comes up in authentication security, so you might look there.
A second approach would be to treat up or down votes as events, rather than commands.  These are external events that your application subscribes to, just as though it were listening to events emitted by a different domain model.  A downstream process manager subscribes to the events, and dispatches commands to your model in response.
The advantage here is that it makes sense to treat the events as a batch; rather than passing through every event that you see, you can filter out any events that cancel out before passing them through for processing.  You could use throttling here as well (again, these aren't your model's events, so you don't need to worry about re-hydrating state from them; you only use your own events to rebuild state).
If those don't work for your circumstances, you could also consider loading your state from snapshots (you still have the enormously long event history, but it doesn't matter because those events have been collapsed behind the recent snapshot).
Another alternative is to simply repair the event stream; elide the events generated by the attack, generate new sequence numbers for the rest, replace.  If the problem is rare, and inexpensive to fix, it's perfectly reasonable for the business to decide that complicated solutions to prevent the problem are not a priority.
Comment: With external events you mean the commands are not implemented on my side, but by some external system?
Answer: You can counter this problem and solve some others by 'snapshotting' your object.
When you do this you build an object to its current state via events and then save that state as the new first event. Discarding or moving to an archive  events which occurred before the snapshot.
This enables you to limit the size of an object at the cost of losing its history.
Comment: Yeah, I've been thinking about snapshots, but throwing away history seems scary. I guess the problem can be seen bigger, applicable to multiple domain, so a rate limiting authentication layer seems to be required.


Motion sensor won't switch off

Question: I have a motion sensor in the ceiling to turn the lights on, it turns them on ok but won't turn them off until you turn the power off. Only just started
Comment: This sounds like mis-set *expectations*. Under which conditions do you expect it to turn off? is it possible you're just not giving it enough time?
Comment: Has anyone messed with the settings?
Comment: I have seen this with for 2 reasons the first is spiders, sometimes behind the white plastic piece, the 2nd cheap sensitively adjustment potentiometers, try noting their position and them move it from the current position to the ccw limit then Cw limit then back to the original position and see if it works for a while. These are the most common issues I have found other than power spikes that make the sensor think you have forced it on.
Comment: How old is the sensor?  Could it be dust covering it?  Have had experience with motion sensors not lasting...  could you change it without changing the whole fixture?
Comment: What make and model is the sensor?
Answer: From your question I can make two assumptions:
1) It worked appropriately for a period of time (week, a month or longer).
2) There are very few settings, possibly one for duration and maybe one for sensitivity.
If neither of those are true, bring it back to the store and get a different unit.
If they are both true, try changing the sensitivity to a lower (less sensitive) setting and the duration to a longer setting. This will help to troubleshoot the unit and indicate whether there is some unknown motion that was too small to trip it previously but has become more significant. I had one in a hallway that tripped when the furnace came on and blew the tips of some flowers in a vase. If there weren't any flowers or they became dry, the motion sensor worked great but if there were fresh flowers it would trip (only when the furnace came on) - that almost drove me crazy!
I'm also assuming that you don't have a dog, cat, mouse, ferret, bat, bird, etc. that is running/flying through the room when you aren't looking.
If that doesn't take care of it, then replace the unit. You didn't say how you were using it either, but if it was to turn the light on when you entered the room (the switch is across the room) you might consider getting a motion sensor integrated into the switch rather than the ceiling. They tend to be a little higher quality, have better settings and easier to put in without a ladder.

Motion sensor won't switch off


Question about the dispersion relation

Question: I'm a Non-physics major student. Recently, I am puzzling by the dispersion relation.
   For a wave, we have $v=f\lambda$, where $v$, $f$ and $\lambda$ is the velocity, frequency and wave length of the wave, respectively. According to this relation, velocity should depends on the frequency. Then why should we have the definition of dispersive medium, as in my opinion everything is dispersive. Because from the formula above, the velocity should automatically depends on the frequency. Can anybody help me with my question? Thanks a lot!
Answer: This question has an interesting connection to a post a few days ago. I can't find that question at the moment.  The questioner there asked if it made any difference if one writes $F=ma$ or $a=F/m$.  Of course, the math is the same, but the way the expression is written suggests "cause" and "effect".
Here's an example where the format of the formula might have helped.  For simple or ideal cases, the speed of a wave in medium is a constant independent of frequency.   So the left hand side of $v=\lambda f$ should never change.  It looks like it changes with frequency, but when you change the frequency, the wavelength changes at the same time in such a way that $v$ does not change.
Perhaps it would be wiser to be acknowledge the constant speed and write $$\lambda = \frac{v}{f}$$.
Here the typography makes clear the inverse relationship between frequency and wavelength.
Dispersion occurs in media where the speed is not constant. Strictly speaking, all media are dispersive.  Taking the speed as constant is an approximation that works very well for some purposes.  (Of course, vacuum is not a medium, so that statement does not apply to electromagnetic radiation in the vacuum.) We would have $$\lambda(f) = \frac{v(f)}{f}$$   The format of the formula doesn't matter from the point of view of math, but it does suggest something about interpretation.  I suppose the linear versions $F=ma$ and $v=\lambda f$ are more common because it's easier and takes less space to typeset the formula on one line.  (That's just a guess.) Hope that helps!
Comment: Thanks garyp! You analogy makes me clear. I have another analogy, where an object is tranlating in one direction. We have $v(t)t=s(t)$, here $f$ plays the same role as $t$. At any $t$we have one $v(t)$. Similarly, for a specific medium, for a wave with fixed frequency $f$, we will get a $v$ according to $v(f)$. Actually,  $v=f\lambda$ just comes from the relation between  displacement, time and velocity.
Answer: For media where the speed does not depend on frequency, the equation $v = f \lambda$ does not mean $v$ depends on the frequency. It is a relationship between $f$ and $\lambda$ such that when you multiply them together they give the speed $v$.
For a non-dispersive medium if you know the frequency of the wave and its wavelength, then you can work out the speed and this number is the same for all frequencies and wavelengths.
This means that if you change the frequency of the wave then (since you also know the speed $v$ as a fixed number) you can work out the wavelength (similarly if you have a wave with a different wavelength you can determine the frequency).
For media described as dispersive then you write this as $v(f)$. This means if you know the wavelength for one particular frequency you can calculate the speed of the wave for that combination.
But, if the frequency changes and you do not know how the speed depends on frequency, then you cannot work out the wavelength for a different frequency (since you do not know what the speed is, as it changes with frequency and you have only worked it out for one frequency).
Comment: Thanks Jim! So in non-dispersive medium $f$ and $\lambda$ always holds the relation that  $constant=f\lambda$ . That is $f$ is always proportion of $1/\lambda$
Comment: Yes, that's right.

Question about the dispersion relation


Does chanting Hare Krushna mantra means that one is looking for moksha?

Question: What if one devotee chants Hare Krushna Mantra and don't want to attain moksha, will lord attract him towards it and try to take away his material desires? Does chanting mantra means that one is looking for moksha? If yes, what is the alternate way to feel close to Krishna?
Answer: ISKCON members are Gaudiya Vaisnavas, and Chaitanya Mahaprabhu added a new teaching that rendering pure devotional service to Krishna is more important than moksha. In fact, gaudiya vaisnavas are indifferent either to liberation or non-liberation, all they aspire to is krishna-prema-bhakti.
They cite Damodarashtakam, said to be in Padma Purana:
http://kksongs.org/songs/n/namamisvaram.html
Damodarastakam

O Lord, although You are able to give all kinds of benedictions, I do not pray to You for the boon of impersonal liberation, nor the highest liberation of eternal life in Vaikuntha, nor any other boon (which may be obtained by executing the nine processes of bhakti). O Lord, I simply wish that this form of Yours as Bala Gopala in Vrndavana may ever be manifest in my heart, for what is the use to me of any other boon besides this?

O Lord, Your lotus face, which is encircled by locks of soft black hair tinged with red, is kissed again and again by mother Yasoda, and Your lips are reddish like the bimba fruit. May this beautiful vision of Your lotus face be ever manifest in my heart. Thousands and thousands of other benedictions are of no use to me.

O Lord Damodara, just as the two sons of Kuvera, Manigriva and Nalakuvara, were delivered from the curse of Narada and made into great devotees by You in Your form as a baby tied with rope to a wooden grinding mortar, in the same way, please give to me Your own prema-bhakti. I only long for this and have no desire for any kind of liberation.