Ubuntu 16.10 to 16.04

Question: Hi guys I have a laptop dual-booted with Ubuntu 16.10 and Windows 7. So I was wondering if I could downgrade back to 16.04 LTS and btw I installed 16.04 then upgraded to 16.10. I really want to go back to 16.04 because a lot of software I want hasn't been released for 16.10 "Yakkety"
Answer: There is currently no way of doing a "rollback" to Ubuntu 16.04 LTS.
However you could always just backup, get the 16.04 LTS installation files and clean install.
Comment: How could I do that? Could you supply me with a full text tutorial since I am a newbie to all this:) it would be very much appreciated, and remember I have Windows 7 aswell:)
Comment: @NaiemdaLegend How did you install Ubuntu in the first place? Boot into Windows, format the Ubuntu partition, and then fill out/extend the Windows partition (you can do this from the disk partitioner in Windows). Then, create a Ubuntu LiveUSB, boot it, and install alongside Windows. There is plenty of documentation and no need to create yet another guide for how to dual-boot Windows and Ubuntu.
Comment: @PatrickNegus I had installed Ubuntu 16.04 first then upgraded to 16.10 and then installed Windows 7 on a different partition. And, lets continue this chat in e-mail? E-mail me - firstname.lastname@example.com, and ill send you screenshot of Gparted and tell you which is which.

Ubuntu 16.10 to 16.04


Why isn't the moment of inertia of a cylindrical tube the difference of those of two cylinders?

Question: The moment of inertia of a solid cylinder is $\frac{1}{2}mr^2$, and the moment of inertia of a composite object is the sum of the moments of inertia of the objects it consists of minus the moment of inertia of any air space. That would imply that the moment of inertia of a cylindrical tube is $\frac{1}{2}m(R^2-r^2)$, but it is in fact $\frac{1}{2}m(R^2+r^2)$. Why? Is this a situation in which the rule I described cannot be applied, and if so why?
Comment: In short: you used $m$ to denote three *different* masses.
Answer: In the formula $I_{\rm solid}= \frac 12 mr^2$ the "$m$" is $m_{\rm solid}=\rho \pi r^2L$, where $L$ is the length and $\rho$ the density.
So
$$
I_{\rm solid}[r]= \frac 12 \rho \pi L r^4.
$$
In the hollow cylinder the  "$m$" is  $m_{\rm hollow}= \pi \rho (R^2-r^2)L$.
So
$$
I_{\rm hollow} = m_{\rm hollow}\frac 12 (R^2+r^2)\\= \pi \rho (R^2-r^2)L\frac 12 (R^2+r^2)\\
= \frac 12 \pi \rho L(R^4-r^4)\\
= I_{\rm solid}[R]- I_{\rm solid} [r],
$$
as you expected.
Comment: D-d-d-d-diiference of squares!  (well, 4th powers).
Answer: But it is.
As Kamil Maciorowski notes in the comments, your problem is that you're using the letter $m$ to denote three different masses.  So let's fix that.
Specifically, let $M$ be the mass of the bigger cylinder (with radius $R$), $m$ the mass of the smaller cylinder (with radius $r$) and $m_t = M - m$ the mass of the tube formed by removing the smaller cylinder from the bigger one.
We'll also need to assume that all the cylinders and tubes have the same length and are made of the same homogeneous substance (since the formulas you used are only valid for homogeneous objects).  In particular, that implies that the masses of the cylinders are proportional to their cross section areas, and thus to their radii squared.  That is to say, $M = cR^2$, $m = cr^2$ and $m_t = M - m = c(R^2 - r^2)$, where $c$ is some constant.
(For cylinders / tubes of length $L$ and made of a homogeneous material of density $\rho$, $c = \rho \pi L$, but that doesn't really matter here.  All that matters is that $c$ is the same for all the objects.)
In particular, this means that the moments of inertia of the two cylinders and the tube, as given by the formulas you quoted, are:

Bigger cylinder: $\frac12 M R^2 = \frac12 c R^4$
Smaller cylinder: $\frac12 m r^2 = \frac12 c r^4$
Tube: $\frac12 m_t (R^2 + r^2) = \frac12 c (R^2 - r^2) (R^2 + r^2)$

Now, to show that the moment of inertia of the tube is indeed the difference between the moments of inertia of the two cylinders, all we need to do is some simple algebra:
$$\begin{aligned}
\tfrac12 m_t (R^2 + r^2)
&= \tfrac12 c(R^2 - r^2) (R^2 + r^2) \\
&= \tfrac12 c(R^4 - r^4) \\
&= \tfrac12 c R^4 - \tfrac12 c r^4 \\
&= \tfrac12 M R^2 - \tfrac12 m r^2.
\end{aligned}$$
Answer: Let's put your argument in more explicit terms:

The moment of inertia of a solid cylinder of radius R is $\frac{1}{2}mR^2$. If we take the portion of that cylinder that is within radius $r$ of the center line, the moment of inertia of that cylinder is $\frac{1}{2}mr^2$. So the moment of inertia of the portion of the cylinder that is between $r$ and $R$ should be $\frac{1}{2}m(R^2-r^2)$, but it is in fact $\frac{1}{2}m(R^2+r^2)$.

Your error is in simply putting "$m$" everywhere. If you have one object, then $m$ can represent its mass, but if you are adding and subtracting the moments of inertia for several different objects with different masses, you can't just use $m$ to represent all of their different masses. The moment of inertia of the inner cylinder is indeed one half the mass of the inner cylinder times the square of its radius. But if $m$ is the mass of the entire cylinder, then clearly the inner circle will not also have mass $m$! Its mass will be $\frac {mr^2}{R^2}$. So the moment of inertia will be  $\frac{m(R^2)}2-\frac{mr^4}{2R^2} =\frac{m(R^4-r^4)}{2R^2}=\frac{m(R^2-r^2)(R^2+r^2)}{2R^2} = \frac 1 2 m\left(1-\frac{r^2}{R^2}\right)(R^2+r^2)$ and $m_{h} = m\left(1-\frac{r^2}{R^2}\right)$ is the mass of the hollow cylinder, so the moment of inertia of the hollow cylinder is $\frac 1 2 m_h(R^2+r^2)$.
It might be easier to understand with specific numbers. Suppose that $R=3, r=2, m=18$. If the density and length of the cylinder are fixed, and only the radius is variable, then the mass is proportional to the radius squared. So if a cylinder with radius $3$ has mass $18$, then the inner cylinder has mass $8$, and the portion between them has mass $10$. The moment of inertia of the total cylinder is $\frac 1 2 18 \cdot 3^3 = 81$. The moment of inertia of the inner cylinder is $\frac 1 2 8 \cdot 2^2 = 16$. The moment of inertia of the hollow cylinder is $\frac 1 2 10 (9+4)=65$. And if we check $81-65$, we indeed get $16$.
If you start with a cylinder with moment of inertia $\frac{1}{2}mr^2$ and make it hollow and while keeping its mass the same, then you can't be making it hollow by simply removing the center. You must be taking the mass in the center and squishing it into the outside, increasing the density. Since you're pushing the mass towards the outside, the moment of inertia must be increasing, not decreasing.
Answer: Mass moment of inertia of a composite body can only be added/subtracted when presented in relation to density and volume.
$$ m_{\rm sum} = \sum_i \underbrace{ \rho_i V_i }_{m_i}$$
$$ I_{\rm sum} = \sum_i \underbrace{ \rho_i V_i r_i^2}_{I_i} $$
where $r_i$ is the individual radius of gyration.
As a matter of convenience in the end we divide the above to get
$$ I_{\rm sum} = \frac{m_{\rm sum}}{ \sum_i  \rho_i V_i} \sum_i \rho_i V_i r_i^2 = m_{\rm sum} r_{\rm sum}^2 $$
For a homogeneous part with uniform density $\rho$ you need to split the above into $i$ additive volumes, and $j$ subtractive volumes
$$m_{\rm sum} =\sum_i  \underbrace{ \rho V_i}_{m_i} - \sum_j \underbrace{  \rho V_j}_{m_j}  $$
$$ I_{\rm sum} = \sum_i \underbrace{\ \rho V_i r_i^2}_{I_i} -\sum_j  \underbrace{ \rho V_j r_j^2}_{I_j} $$
In your example, we have the following parts

Component
Part Volume
Rad. Gyration
Part Mass
Part MMOI

Outer Cylinder
$V_1 = \ell \pi R^2$
$r_1 = \tfrac{1}{\sqrt{2}} R $
$m_1 = \rho \ell \pi R^2$
$I_1 = \rho \tfrac{\pi}{2} \ell R^4 $

Inner Cylinder
$V_2 = \ell \pi r^2$
$r_2 = \tfrac{1}{\sqrt{2}} r $
$m_2 = -\rho \ell \pi r^2 $
$I_2 = -\rho \tfrac{\pi}{2} \ell r^4 $

Combined
$V = \ell \pi \left( R^2 - r^2 \right)$
$$r^2 = \tfrac{1}{2} \left(R^2 + r^2\right)$$
$$m_1+m_2 = \rho \ell \pi \left( R^2 - r^2 \right)$$
$$I_1 + I_2 = \rho \tfrac{\pi}{2} \left( R^4 -r^4\right)$$

Now the combined radius of gyration is found by
$$ r^2 = \frac{I_1+I_2}{m_1+m_2} = \frac{ \rho \tfrac{\pi}{2} \left( R^4 -r^4\right)} { \rho \ell \pi \left( R^2 - r^2 \right) } = \tfrac{1}{2} \left(R^2 + r^2\right) $$
And here is the source of the $+$ sign which confuses you. It comes from $ \frac{R^4-r^4}{R^2-r^2} = \frac{ (R^2-r^2)(R^2+r^2)}{R^2-r^2} = R^2+r^2$
Answer: The Moment of Inertia of cylinder x is proportional to the mass of the object $m_x$ and the 2nd power of the radius $r_x$.
$$I_x \propto m_x {r_x}^2$$
However, $m_x \propto {r_x}^2$, so
$$I_x \propto {r_x}^4$$
If z is shape x minus y, we get:
$$I_z = I_x - I_y \propto {r_x}^4 - {r_y}^4$$
Using the difference of squares (well, quartics), we get:
$$I_z \propto ({r_x}^2 - {r_y}^2)({r_x}^2 + {r_y}^2)$$
Now, lets find the mass of z:
$$m_z = m_x - m_y \propto {r_x}^2 - {r_y}^2$$
which we can factor out of $I_z$:
$$I_z \propto m_z ({r_x}^2 + {r_y}^2)$$
and all that is left is to determine the constant.
The core trick, as observed by others, is that the inertia of a tube is proportional to the 4th power of the radius.  And that the $m$ in the equation refers to different things in the smaller, larger and hollow cylinder cases.
We can also sanity check this.  If we have a tube of fixed mass and we make it thinner, we are moving the same mass further away from the axis.  This should increase the moment of inertia.


inputting arbitrary xml in solr

Question: I have a question on Apache Solr. If I have an arbitrary XML file, and a XSD that it conforms to, how do I input it into Solr. Could I get a code sample? I know you have to parse the XML and put the relevant data in a solr input doc, but I don't understand how to do that.
Answer: The DataImportHandler (DIH) allows you to pass the incoming XML to an XSL, as well as parse and transform the XML with DIH transformers. You could translate your arbitrary XML to Solr's standard input XML format via XSL, or map/transform the arbitrary XML to the Solr schema fields right there in the DIH config file, or a combination of both. DIH is flexible.
Sample dih-config.xml
Here's a sample dih-config.xml from a an actual working site (no pseudo-samples here, my friend). Note that it picks up xml files from a local directory on the LAMP server. If you prefer to post xml files directly via HTTP you would need to configure a ContentStreamDataSource instead.
It so happens that the incoming xml is already in standard Solr update xml format in this sample, and all the XSL does is remove empty field nodes, while the real transforms, such as building the content of "ispartof_t" from "ignored_seriestitle", "ignored_seriesvolume", and "ignored_seriesissue", are done with DIH Regex transformers. (The XSLT is performed first,  and the output of that is then given to the DIH transformers.) The attribute "useSolrAddSchema" tells DIH that the xml is already in standard Solr xml format. If that were not the case, another attribute, "xpath", on the XPathEntityProcessor would be required to select content from the incoming xml document.
<dataConfig>
    <dataSource encoding="UTF-8" type="FileDataSource" />
    <document>

        <entity
            name="pickupdir"
            processor="FileListEntityProcessor"
            rootEntity="false"
            dataSource="null"
            fileName="^[\w\d-]+\.xml$"
            baseDir="/var/lib/tomcat6/solr/cci/import/"
            recursive="true"
            newerThan="${dataimporter.last_index_time}"
        >

        <entity
            name="xml"
            processor="XPathEntityProcessor"
            transformer="RegexTransformer,TemplateTransformer"
            datasource="pickupdir"
            stream="true"
            useSolrAddSchema="true"
            url="${pickupdir.fileAbsolutePath}"
            xsl="xslt/dih.xsl"
        >

            <field column="abstract_t" splitBy="\|" />
            <field column="coverage_t" splitBy="\|" />
            <field column="creator_t" splitBy="\|" />
            <field column="creator_facet" template="${xml.creator_t}" />
            <field column="description_t" splitBy="\|" />
            <field column="format_t" splitBy="\|" />
            <field column="identifier_t" splitBy="\|" />
            <field column="ispartof_t" sourceColName="ignored_seriestitle" regex="(.+)" replaceWith="$1" />
            <field column="ispartof_t" sourceColName="ignored_seriesvolume" regex="(.+)" replaceWith="${xml.ispartof_t}; vol. $1" />
            <field column="ispartof_t" sourceColName="ignored_seriesissue" regex="(.+)" replaceWith="${xml.ispartof_t}; no. $1" />
            <field column="ispartof_t" regex="\|" replaceWith=" " />
            <field column="language_t" splitBy="\|" />
            <field column="language_facet" template="${xml.language_t}" />
            <field column="location_display" sourceColName="ignored_class" regex="(.+)" replaceWith="$1" />
            <field column="location_display" sourceColName="ignored_location" regex="(.+)" replaceWith="${xml.location_display} $1" />
            <field column="location_display" regex="\|" replaceWith=" " />
            <field column="othertitles_display" splitBy="\|" />
            <field column="publisher_t" splitBy="\|" />
            <field column="responsibility_display" splitBy="\|" />
            <field column="source_t" splitBy="\|" />
            <field column="sourceissue_display" sourceColName="ignored_volume" regex="(.+)" replaceWith="vol. $1" />
            <field column="sourceissue_display" sourceColName="ignored_issue" regex="(.+)" replaceWith="${xml.sourceissue_display}, no. $1" />
            <field column="sourceissue_display" sourceColName="ignored_year" regex="(.+)" replaceWith="${xml.sourceissue_display} ($1)" />
            <field column="src_facet" template="${xml.src}" />
            <field column="subject_t" splitBy="\|" />
            <field column="subject_facet" template="${xml.subject_t}" />
            <field column="title_t" sourceColName="ignored_title" regex="(.+)" replaceWith="$1" />
            <field column="title_t" sourceColName="ignored_subtitle" regex="(.+)" replaceWith="${xml.title_t} : $1" />
            <field column="title_sort" template="${xml.title_t}" />
            <field column="toc_t" splitBy="\|" />
            <field column="type_t" splitBy="\|" />
            <field column="type_facet" template="${xml.type_t}" />
    </entity>
      </entity>
    </document>
</dataConfig>

To set up DIH:

Ensure the DIH jars are referenced from solrconfig.xml, as they are not included by default in the Solr WAR file. One easy way is to create a lib folder in the Solr instance directory that includes the DIH jars, as the solrconfig.xml looks in the lib folder for references by default. Find the DIH jars in the apache-solr-x.x.x/dist folder when you download the Solr package.

dist folder:

Create your dih-config.xml (as above) in the Solr "conf" directory.
Add a DIH request handler to solrconfig.xml if it's not there already.

request handler:
<requestHandler name="/update/dih" startup="lazy" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">dih-config.xml</str>
</lst>
</requestHandler>

To trigger DIH:
There is a lot more info re full-import vs. delta-import and whether to commit, optimize, etc. in the wiki description on Data Import Handler Commands, but the following would trigger the DIH operation without deleting the existing index first, and commit the changes after all the files had been processed. The sample given above would collect all the files found in the pickup directory, transform them, index them, and finally, commit the update/s to the index (which would make them searchable the instant commit was finished).
http://localhost:8983/solr/update/dih?command=full-import&clean=false&commit=true

Comment: I find that generating the dih-config.xml file is the tricky part. is there any utilities to help generate this file given an abitrary XSD that the client input documents are conforming to?
Answer: the easiest way might be to use DataImportHandler, it allows you to apply a XSL first to transform your xml to Solr input xml
Answer: After some research and finding nothing fully automated to do what you are asking... I think I found something.
Lux SOLR might be what we are looking for http://luxdb.org/SETUP.html
Seems like it somehow takes SOLR and makes it Lux enabled which indexes arbitrary XML's.
Comment: i've been using the Lux server for a few weeks now and it's totally doing great. the ability to write XQuery or XPath against my Soap XML requests and responses has proven amazingly valuable.

inputting arbitrary xml in solr


Authoring an MLA-conforming document in LaTeX?

Question: I am trying to write a paper in proper MLA (Modern Language Association) format, but I am having trouble understanding how it all goes together. Is there an example document or template for MLA (with citations, including parenthetical) for (La)TeX? I find incomplete examples all over the place and I just can't seem to put it together correctly.
Comment: Do you mean MLA style citations? If so, use the `biblatex-mla` package. If you mean a paper for a class, there isn't a very good format around, but the following might be sufficient: [biblatex and mla-paper making weird headings](http://tex.stackexchange.com/q/11172/2693).
Comment: When had to write a paper in MLA style, I found all the templates on the web insufficient, so I hacked together the format on my own. I didn't use any automatic bibliography packages/tools, though.
Comment: If Alan's answer solved your problem, please accept it by clicking the checkmark to the left, thereby marking the question as "solved", and awarding some points to both Alan and yourself.
Answer: If you need MLA-style citations for an article or paper, use the biblatex-mla package.
If you are looking for a specific document class for a term paper for a class that needs to be in MLA style there isn't a very good format around, although there is the mla-paper package.  To use the mla-paper package with biblatex-mla see this question here:  biblatex and mla-paper making weird headings.
Since the kinds of formatting required for a term paper may be quite relaxed, it might be better to just format your paper yourself using standard packages such as titlesec plus the setspace package for double spacing (which is often required by professors.) than to use mla-package.
Answer: For most academic work, I find Ryan Aycock's MLA package sufficient. I've had problems citing URLs, movies and DVDs with biblatex-mla.
\usepackage{mla}

Good luck.


Does C# have anything comparable to Python's list comprehensions?

Question: I want to generate a list in C#. I am missing python's list comprehensions. Is there a C# way to create collections on the fly like list comprehensions or generator expressions do in python?
Answer: If you are using C# 3.0 (VS2008) then LINQ to Objects can do very similar things:
List<Foo> fooList = new List<Foo>();
IEnumerable<Foo> extract = from foo in fooList where foo.Bar > 10 select Foo.Name.ToUpper();

Answer: Matt has mentioned query expressions. These are available for LINQ in general, by the way - not just LINQ to Objects. (For example, the same query applied to a LINQ to SQL datacontext would execute the filter and projection on the database.)
The query expressions in C# 3 are simply syntactic sugar over writing normal C# code - although query expressions usually end up calling extension methods. (They don't have to, and the compiler doesn't care, but they usually do.) There are various things you can do with collections which aren't available in C# query expressions, but which are supported by method calls, so it's worth being aware of both kinds of syntax. For instance, Matt's query expression of:
List<Foo> fooList = new List<Foo>();
IEnumerable<string> extract = from foo in fooList where foo.Bar > 10 select foo.Name.ToUpper();

is "pre-processed" into:
List<Foo> fooList = new List<Foo>();
IEnumerable<string> extract = fooList.Where(foo => foo.Bar > 10)
                                     .Select(foo => foo.Name.ToUpper());

If you want to (say) filter based on the index of the value in the original collection, you can use an appropriate overload of Where which is unavailable via query expressions:
List<Foo> fooList = new List<Foo>();
IEnumerable<string> extract = fooList.Where((foo, index) => foo.Bar > 10 + index)
                                     .Select(foo => foo.Name.ToUpper());

Or you could find the length of the longest name matching the criteria:
List<Foo> fooList = new List<Foo>();
int longestName = fooList.Where((foo, index) => foo.Bar > 10 + index)
                         .Select(foo => foo.Name)
                         .Max();

(You don't have to do the projection and max in separate methods - there's a Max overload which takes a projection as well.)
My point is that using extension methods you can very easily build up sophisticated queries.
You mention Python generators as well - C# has this in the form of iterator blocks. Indeed, these are incredibly useful when implementing LINQ-like operators. (Because most of LINQ to Objects is based on extension methods, you can add your own operators which look "native" to LINQ - although you can't change the query expression syntax yourself.)
Comment: Python's list comprehension can create a list from scratch in addition to *extracting* from another list. As far as I understand, what you have shown *extracts* from an existing list. But the OP mentions *generate* and *create* in their post. I think my answer does the creating thing. Please correct me if I am wrong. After all, you only looked at the question... and the question [answered itself](http://meta.stackexchange.com/a/9147/282546) ;-)
Comment: @Sнаđошƒаӽ: The question isn't really clear enough, to be honest - it would have been closed if it had been raised these days. I'm not going to put any more effort into an answer on an unclear question... although I'd personally use `Enumerable.Range` to act as a "source" rather than the `for` loop in your answer.
Comment: @Sнаđошƒаӽ: Well it would be `string.Join(", ", Enumerable.Range(1, 50).Select(x => $"cb{x:00}")))` which really isn't that long...
Comment: @Sнаđошƒаӽ: Well, you'd only need to change `$"cb{x:00}"` to `string.Format("cb{0:00}", x)`, so there's not *very* much difference - but yes, it's still an improvement.
Comment: Thanks for `Enumerable.Range` pointer. Other than that, is that C# code equivalent to the python's list comprehension? Or, is there any more elegant way in C#? Compared to python's one liner, that C# code looks bulky.
Comment: That `$` thing right there is C# 6 thing, if I am not mistaken, which has really made it a lot simpler and elegant. Thanks.
Answer: List<T>.ConvertAll behaves just like list comprehensions by performing the same operation on every item on an existing list and then returning a new collection.  This is an alternative to using Linq especially if you are still using .NET 2.0.
In Python, a simple list comprehension example:
>>> foo = [1, 2, 3]
>>> bar = [x * 2 for x in foo]
>>> bar
[2, 4, 6]

For C# 3.0, you can pass a lambda function specifying what type of mapping function is needed.
public static void Main()
{
    var foo = new List<int>{ 1, 2, 3};
    var bar = foo.ConvertAll(x => x * 2);    // list comprehension

    foreach (var x in bar)
    {
        Console.WriteLine(x);  // should print 2 4 6
    }
}

For C# 2.0, you can use an anonymous method with the Converter delegate to perform the equivalent.
public static void Main()
{
    List<int> foo = new List<int>(new int[]{ 1, 2, 3});
    List<int> bar = foo.ConvertAll(new Converter<int, int>(delegate(int x){ return x * 2; }));  // list comprehension

    foreach (int x in bar)
    {
        Console.WriteLine(x);  // should print 2 4 6
    }
}

(Note: the same can be done with Arrays using Array.ConvertAll
Answer: I know this is very very late an answer, but I too wondered if C# has anything equivalent to python's list comprehension. Answers from both Matt Campbell and Jon Skeet show how to extract a list from an existing one, as far as I understood. But a python's list comprehension can also create a list from scratch. So here is what I came up with.
First I will show the python list comprehension, and then its C# equivalent that I came up with.
The toy task is to create a string like this
cb01, cb02, cb02, ... , cb50

Python list comprehension:
s = ', '.join('cb{0:02}'.format(i+1) for i in range(50))

C# equivalent I came up with:
string s = String.Join(", ", new Func<List<string>>( () =>
{
    List<string> list = new List<string>();
    foreach (int i in Enumerable.Range(1, 50))
        list.Add(String.Format("cb{0:00}", i));

    return list;
}).Invoke());

I am not sure if I over-did anything or not though.

Edit: (from what Jon Skeet mentioned in his comment, a real one-liner equivalent to python's list comprehension)
String.Join(", ", Enumerable.Range(1, 50).Select(x => $"cb{x:00}")))

Note that $ thing is a C# 6 feature. If you are still not using C# 6, you can go with the old String.Format() way.
Answer: There's this:
new List<FooBar> { new Foo(), new Bar() }

which is only a little longer than its python equivalent:
[Foo(), Bar()]

And then there is this:
public IEnumerable<FooBar> myFooBarGenerator() {
     yield return new Foo();
     yield return new Bar();
}

which is the python equivalent of:
def myFooBarGenerator():
    yield Foo()
    yield Bar()


DB2 - How to estimate proper BUFFERPOOL size?

Question: DB2 9.7.
8GB RAM on server.
Currently BP  has 500 MB (number of pages*pagesize)
Database has issue with increased IOPS.
So we think maybe BP should be increased.
How to estimate needed size for BP? Is there some recommendation? Maybe I would like to  put it on 1GB. What can be negative effect? Is it always greater better for BP?
Answer: You can't "estimate" the size of a buffer pool, because the answer is, "it depends".
Try using the AUTOCONFIGURE command to get started, and enable STMM.  Together these will go a long way towards getting your database running more efficiently.
I would also recommend you spend some time reading about DB2 Performance Tuning.  There is a ton of information available on the web, starting from the entire Performance Tuning section of the manual.
Comment: http://robertsdb2blog.blogspot.com/2010/09/thoughts-on-db2-for-zos-buffer-pool.html I found here that " IF YOU HAVE BIG MEMORY, YOU SHOULD HAVE BIG DB2 BUFFER POOLS." I run Configuration Advisor and it gives me the value 32678 so it is 1 GB. My though is maybe I should increase it more (to 1.5 GB) What can be negative effect except I will have less memory on the server  but currently I have 2,3 GB which are not used so I do not believe I will have some memory heap dump or similar.
Comment: I marked this an answered I am only interested in your opinion if it should be ok if I extend this to 1.5 GB?
Comment: Dejan, I have no way of knowing whether increasing the buffer pool size to 1.5 Gb will have any effect on performance.  If you show that there are 2.3 Gb free then you can certainly try it.  However, if you follow my recommendation of enabling the Self Tuning Memory Manager (STMM) will adjust the size of the buffer pool (and other memory consumers), DB2 will work to optimize the various pool sizes for you.


Quid est opus quod Cicerō in Dē senectūte § 75 prōfert?

Question: In opere Cicerōnis Dē senectūte ipse dīxit: «quod scrīpsī in Orīginibus» (§ 75). Quid est hoc opus? Quid est nōmen rēctum sibī anglicum? In pāginā interrētis Lacus Curtius nōmen operis Orīgō in linguam anglicam Antiquities versum 'st. In pāginā interrētis The Latin Library opus hujus nōminis invenīre nōn possum. Ubī id legere possum? Num, dīs caelīs, opus aeōnibus nōn dēperitum 'st?
Answer:
In opere Cicerōnis Dē senectūte ipse dīxit: «quod scrīpsī in Orīginibus»

You have to be careful here, as, yes, this is Cicero's De Senectute, but the speaker in the text is Cato the Elder. So it is referring not to any work that Cicero wrote, but Cato. With that knowledge, you can check PHI, which lists Cato's Origines among his works.
As far as the name goes, scholars typically just the Latin. Astin's landmark study on Cato uses Origines throughout, as does Tim Cornell's monograph Cato's Origines and the Non-Roman Historical Tradition about Ancient Italy. Likewise, in the Cambridge Companion to the Roman Historians, the English translation of Gotter's article is "Cato's Origines: the historian and his enemies." You chiefly see Antiquities or something like it in 19th century literature.
Using Origines in English is so pervasive and Antiquities is so old-fashioned that I didn't even consider mentioning the latter as an option when I wrote up an article on Cato:

No other complete works of Cato survive, though a good portion of his Origines and a couple speeches survive in part from quotations.
Answer: Nota bene nomen istius operis re vera esse « Cato Maior de Senectute »! Nam etsi a Cicerone scriptum est, hic praeclarus scriptor Catonem Maiorem ipsum induxit disputantem, quia neminem existimabat de senectute maiore auctoritate loqui quam eum et, ut postea scripsit in opere c.n. « Laelius de Amicitia » (eodem modo scilicet scriptum), quia sermo hominibus veteribus attributus ei « plus nescio quo pacto habere gravitatis » videretur. Effectus fuit talis ut Cicero sua verba ipse legens putaverit Catonem secum loqui, ut dixit eodem loco.
Forma operis igitur est dialogi inter C. Laelium Sapientem, P. Cornelium Scipionem, M. Porcium Catonem. In capitulo de quo mentionem fecisti, Catonem loquentem fecit Cicero. Cum igitur de « Originibus » sermo est, id ad Origines Catonis ipsius refert. Quod opus, tristissimum dictu, nobis non traditum est.
Answer: A note in my text of De Senectute (edited by Shuckburgh) says "for Cato's Origines see Introduction. Cicero quotes this sentence from the fourth book of the Origines again in Tusc. 1, 42, 101."
In this introduction is a brief description of some of Cato's works, including:

The Origines (§38). Cato seems to have begun this work with the idea of treating only on early Roman history, and the origin of the Roman state and of the various neighboring towns, -- a kind of compendium of local antiquities. But his plan gradually extended to the writing of the history of Rome down to his own day, (the book is thus sometimes spoken of as Annales), and he added to it up to the last days of his life. It has all perished with the exception of a few insignificant fragments; but it was much used by subsequent writers, though Cicero says it was thin and dry (exilis -- De Legg. 1, 2, 6). The first book told the story of the Kings; the second and third, the origins of the Italian civitates; the fourth, the First Punic War; the fifth, the Second Punic War; the sixth and seventh, the history of Rome from the end of that war to the last days of Cato's life.

Note that this refers to §38 (of De Senectute) where the Origines is mentioned again.


in Game Logic, can Object A use Object B's sensor?

Question: Is there a easy way for Object A to use Object Bs sensor using the logic bricks? or do I need to have an always sensor on Object A, and run a custom python script?
Answer: Maybe I'm reading this wrong, but, it looks like you just need to select both objects, and connect the sensor from objectB to a controller from objectA.
Comment: :P wow, I was trying to start using globalDict to save a global variable and have it play animation on the other object! This was almost to easy! thank you!


Google Earth Engine: Get the ID of images used for median calculation

Question: In Earth Engine it is quite easy to create a median image out of several images from an image collection. But is there any way to get the information which particular images were used to create the median image?
Answer: You can do that by applying the aggregate_array function over the filtered collection used to build the median image. In this function you need to specify the image property that corresponds to its name, which corresponds to the system:index property. As you did not provide any example, here is a simple one.
In addition, if you wish to export the names of the images as a csv file, you can also do that by transforming the ee.List (names of the images) into ee.Features, then to a ee.FeatureCollection and finally, export it using Export.table.toDrive.
// Filter image collection
var imCol = ee.ImageCollection("LANDSAT/LE07/C01/T1_RT")
            // Filter by spatial extent of a polygon
            .filterBounds(ee.Geometry.Polygon(
        [[[-102.10208697216933, 20.235359993650682],
          [-102.10208697216933, 18.82723807089423],
          [-100.52005572216933, 18.82723807089423],
          [-100.52005572216933, 20.235359993650682]]], null, false))
            // Filter by date
            .filterDate('2008-01-01','2009-01-01')
            // Filter by a property of the images, e.g., cloud cover land
            .filter(ee.Filter.lte('CLOUD_COVER_LAND',20));

// Obtain median image
var reduced = imCol.reduce(ee.Reducer.median());

// Aggregate over a property of the images in the filtered image collection
// and obtain a list. In this case get the system:index property, which corresponds
// to the image name
var idList = imCol.aggregate_array('system:index');

// Print the list
print(idList);

// If you want to export it

// First transform list into Features
var exportFeatCol = idList.map(function(entry){
  return ee.Feature(null, ee.Dictionary({id: entry}));
});

// Export and cast object as FeatureCollection
Export.table.toDrive({
  collection: ee.FeatureCollection(exportFeatCol),
  description: 'IdImages',
  fileFormat: 'CSV'
});

Comment: Thanks for your comment. It is nice to know how I can create such a list but is it somehow possible to get the information which median pixels from which particular images were used for the median image?
What I am aiming for is a list of almost cloud-free images over whatever region you like. This is how my code looks like:
https://code.earthengine.google.com/b8385b06ad2e3b2cfaa69dd907b75599

It is quite simple but I was wondering if there is any way to get a more specific information on the images represented in the median image.


How can I delete Windows restore points in c#?

Question: Im looking for a way to delete Windows restore points using C# perhaps by invoking WMI.
Any code snippet would be very helpful.
Answer: Touching on what Morten said you can use that API.  WMI doesn't provide a method to delete a Restore Point as far as I can tell.  The SRRemoveRestorePoint can remove a restore point, provided you have the sequence number.  You can get that through WMI.  Here is my code to Remove a restore point.
<code>[DllImport("Srclient.dll")]
public static extern int SRRemoveRestorePoint(int index);

private void button1_Click(object sender, EventArgs e)
{
    int SeqNum = 335;
    int intReturn = SRRemoveRestorePoint(SeqNum);
}
</code>
I just threw in 335 since that was the farthest one back as I could find on my system.  Its likely that the count starts at 1 and keeps incrementing.  so it isn't as simple as just having an index like you would in an array.
As for getting the sequence numbers, I converted the code from Microsoft to C# which will give you that info.  Be sure to add System.Management as a reference. Otherwise this code won't work right.
<code>    private void EnumRestorePoints()
    {
        System.Management.ManagementClass objClass = new System.Management.ManagementClass("\\\\.\\root\\default", "systemrestore", new System.Management.ObjectGetOptions());
        System.Management.ManagementObjectCollection objCol = objClass.GetInstances();

        StringBuilder Results = new StringBuilder();
        foreach (System.Management.ManagementObject objItem in objCol)
        {
            Results.AppendLine((string)objItem["description"] + Convert.ToChar(9) + ((uint)objItem["sequencenumber"]).ToString());
        }

        MessageBox.Show(Results.ToString());
    }
</code>
I tested this on my box (Vista by the way) and it worked without issue.  Also have to be running as Admin, but I think you figured that.
Answer: While I know nothing about WMI, this resource might get you started. It does not directly touch your issue, but perhaps it can be useful somehow. Anyhow, it seems that the relevant Win32/COM function is SRRemoveRestorePoint. I hope this was of any use.
Alternatively, you can work with VBScript, if you're so inclined.


extend caml token ?

Question: is there an hook or interface or whatever that could be used for extending token functionality of sharepoint? For example [Me] token is insufficient for me and I would like to for example develop my own token that can take values from user profiles. Is that possible?
Answer: There is no way to extend CAML queries. You can see all the existing tokens and possible query elements here:

CAML Query Schema (MSDN)

Well, there are a couple of undocumented CAML Query attributes, but AFAIK nothing that can help in your case.
But there are other possible solutions.
Here I assume that you want to filter a list or a document library. In SharePoint, those objects are rendered via XsltListViewWebPart webpart. This is OOTB webpart, very flexible and powerful.
One solution here would be to set the Query for the XsltListViewWebPart dynamically from your custom webpart deployed to same page.
Another solution, the one I would prefer, is to use parameter bindings. The thing is, you can use parameters in the query. If you open a list view in SPD and select XsltListViewWebPart, there is "Parameters" button on the ribbon.

Using this functionality, you can define one or more parameters. They can come from Query string or from a control on the same page and also from some other places.

Later you can use those parameter in your query:

This will generate the following CAML query:
<Query>
    <OrderBy>
        <FieldRef Name="FileLeafRef"/>
    </OrderBy>
    <Where>
        <Eq>
            <FieldRef Name="Modified"/>
            <Value Type="DateTime">{Param1}</Value>
        </Eq>
    </Where>
</Query>

Additionally, it will generate the parameter binding, like this:
<ParameterBinding Name="Param1" Location="Control(UserProfilePropertyFetcher)" DefaultValue=""/>

So in your case it's quite simple to create a control which will expose a property from the current user profile. Something like this:
public class UserProfilePropertyFetcher
{
  [DefaultProperty]
  public string Value
  {
     get
     {
         var serviceContext = SPServiceContext.GetContext(SPContext.Current.Site);
         var upm = new UserProfileManager(serviceContext);

         var userProfile = upm.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName);
         return userProfile["PropertyName"].Value.ToString();
     }
  }

}

(please replace "PropertyName" with your actual property name)
This control can be deployed either as a delegate control or you can put it straight to the list view page.
P.S. Truth be told, there is already such control in SharePoint, ProfilePropertyValue. Unfortunately, the parameter bingings can only grab values from some public properties of the control, but not from it's output. And unfortunately, ProfilePropertyValue only yields the value of the property to the page, and doesn't expose it to any of it's properties.

extend caml token ?


Why are the words related to Biur Chametz in Aramaic?

Question: The paragraph we say on burning the chametz is in Aramaic.  What is the reason for that part being in Aramaic, but not most of the Haggada? (The search is part of the prescribed Pesach ritual, as is the Haggada.) Was that part added to the Pesach ritual after the Hagadda was written?
Comment: So is Shacharit of chol hamoed and the haftorah of the 7th day
Comment: Additionally, your title should probably be "Why is the Bittul Chametz in Aramaic?" not "Why is the Biur Chametz in Aramaic?" since "biur chametz" is a thing that is done not said. Also, the paragraph I assume you are referencing isn't something "we say on burning the chametz" like a blessing would be, but something said at any time between disposing of one's remaining chametz and chametz ownership becoming prohibited; it is not a part of the burning process.
Comment: That paragraph isn't a part of the haggadah?
Comment: @DoubleAA  Is your comment the beginning of an answer or a critique of the wording of my question?
Comment: I don't understand why you are comparing the language of these two texts
Comment: @DoubleAA  The search is part of the Pesach ritual, as is the Hagadda.
Comment: The Haggadah was not written all at one time. Most of it is from the Mishnaic period. But the four questions we ask differ from those of the time of the Temple. Nirtzah was added much later. The fifteen Simanim are from the time of the Rishonim. The Bittul Chametz is not part of the Haggadah. It is published with the Haggadah the way the Nullification of Vows is printed in the Rosh Hashanah Machzor and classic short works on repentance (Yesod Hateshuvah and Vidui Rav Nissim Gaon) are published in the Yom Kippur Machzor.
Comment: @N.T. Do you know when the Bitul hametz became part of the Pesach preparations?
Comment: The Gemara in Pesachim says to do it.
Comment: @N.T. What page are you referring to?
Comment: https://www.sefaria.org/Pesachim.6b.12?lang=bi&with=all&lang2=en
Comment: @N.T. Is there something in that page of Pesachim that specifies Aramaic?
Comment: No. But the Talmud itself is written in Aramaic.
Answer: The Magen Avraham (Orach Chaim 434:2) writes, that the reason why we say it in Aramaic, is because that was the language that all Jews understood back then, and in order to nullify the Chametz, one must understand what he is saying.
There is another reason, (brought down in Seder Hayom on Biur Chametz) that being that when one destroys food - especially bread - it can cause him to become poor, we say it in a language that the accusing angels won't understand
Comment: The Haggadah was mainly written in Israel during the time of the Temple, when people spoke Hebrew. Nowadays, if you don't understand Aramaic, you should say the Bittul in a language you understand.
Comment: Why is the whole Haggada not written in " the language that all Jews understood back then". Why only focus on people understanding this one paragraph?
Answer: Great question!
I believe that it has to do with how it was added later on to the Haggadah. Let me explain:
There are 3 opinions as to who wrote the Haggadah: 1) In sefer Zechariah Lechaim 4a he mentions that the Haggadah was compiled by Rebbi Akiva and his source is the Yerushalmi Shekalim 5:1. 2) In Sidur HaRashban 29a he writes that Rebbi Elazar ben Hurkanus compiled the Haggadah. 3) Finally in the book Kol Hamevaser Pesach 3 Ot 12 writes that Eliyahu Hanavi compiled it and it was revealed to the sages. Whichever opinion we follow, it was in the times of the Tanaaim and earlier which means they spoke Mishnaic Hebrew (the hebrew/lashon of the Mishnah).
The paragraph we say for Bedikat Chametz is found in a few places: In Mishnaic Hebrew: 1) Yerushalmi Pesachim 2:2, Rambam Hilchot Chametz Umatazah 3:7. However if you look in: Sheiltot Derav Achai Goan Siman 74, Rif, Rosh on Pesachim 6b, Sidur Rashi page 173, Machzor Vitri page 294, and others, it appears in Aramaic.
Therefore I think that even though we had the paragraph of Bedikat Chametz from the Yerushalmi in Hebrew, the reason its in Aramaic is because the Geonim and Rishonim say that many words needed to be included or changed from the Hebrew text into Aramaic, because its meaning only comes out in Aramaic (just like one can't precisely translate some words or any words from one language to another). There are many examples of this. For example, when we say  חמירא it includes all חמץ and all שאור unlike the word חמץ, and thus even if we were to say כל חמץ ושאור וכו, it wouldn't be as clear and concise (and this would also apply with other examples I didn't mention).
Comment: Another suggestion for the haggadah's author is R. Yehuda HaNasi. (R. Naftali b. Avraham Maskil LeAitan at the end of his Maamar Yesod Musad http://buch-binder.blogspot.com/2015/09/blog-post.html)
Comment: @Joel K thank you for sharing this, this is good stuff! It seems that after he comes to the conclusion that the Haggadah's author was in the generation of Rebbi Yehudah Hanasi, he merely makes an assumption that since Rebbi Yehudah redacted the Mishnah then he must have also been the author of the Haggadah, and I don't know why/how that is a valid assumption, why does he assume that? The 3 opinions I quoted have valid sources/assumptions
Comment: Yes, he doesn't have a ראיה מוכרחת. I think his point is that 1) the Haggadah was written in the generation of Rebbe and 2) we know that Rebbe was the editor of another foundational text of Judaism (the Mishnah), so it makes sense to assume that the Haggadah is also his handiwork.


What happens when we reconstruct a signal after its Fourier transform is done and some frequencies are altered?

Question: Since we loose time information when we take a Fourier transform, what happens if we alter a few frequencies from the transform and then reconstruct the signal, do we get the altered frequency at the exact place the original frequency was(in time). Would it be beneficial if we use Wavelet transform or FFT? If yes, how?
Comment: You don't lose time information. The Fourier transform is bijective, there is zero information loss. Temporal characteristics of the signal *might* be harder to spot (hint: that is not even generally true, Fourier transform is even commonly used to estimate fine time shifts). Your question is unclear; what do you mean with "alter a few frequencies"? If we're taking about the continuous ft, then that would change nothing, because "a few" means "countably, even finite", and that means the energy change is zero. If we're talking about the DFT, then: can you please add formulas describing what you
Comment: ... want to do?
Comment: I was talking dft and i meant suppose i get 3 frequencies say 1,2 and 3 and i change 2 and make it 4 so does this mean that that time at which 4 occurs will be the same at which 2 occurred?
Comment: wait, do you mean "frequencies" or "values for a given frequency bin"? Precise wording makes a lot of difference here. Also, your sentence isn't clear to me. I **meant it** when I asked for *formulas*.
Comment: What "benefit" are you looking for?
Comment: I hope to create signals that are similar to the original signal by altering the frequency a bjt
Answer: The spatial content is carried in the phase of the Fourier transform and not in magnitude. As Marcus pointed out, the difficulty with Fourier transform is that it doesn't allow us to immediately analyze the spatial information while still looking at the frequency. There are methods such as windowed FT which try to make that a bit better.
However, if you alter frequencies in the magnitude and reconstruct, you would get filtering effects. For instance, if we cut the low frequencies, than it would be a high-pass filter, and likewise, cutting high bands would cause a low-pass filter effect. This is analogous to applying, e.g. Mean/Gaussian filter to an image.
Regarding Wavelets, they try to address this time/frequency issue I mentioned above. Wavelets are limited in time and frequency. We slide the wavelets in time domain to construct the Wavelet domain. This provides resolution in the time domain.
On the application side, Wavelet denoising is shown to be superior to Fourier domain denoising. But, such superiority is application dependent, as for some applications one doesn't need that spatial analysis.
You could find some more information on the differentiation here.

Here is an example, based on this one, where we do a low-pass filter by keeping only the low frequency values (both positive and negative):
<code>% make our noisy function
t = linspace(1,5,1024);
x = -(t-2).^2  + 2;
y = awgn(x,0.5);
F = fft(y,1024);

freqRange = 20; % range of frequencies we want to preserve

rectangle = zeros(size(F));
rectangle(1:freqRange+1) = 1;       % preserve low positive frequencies
y_half = ifft(F.*rectangle,1024);   % +ve low-pass filtered signal
rectangle(end-freqRange+1:end) = 1; % preserve low negative frequencies
y_rect = ifft(F.*rectangle,1024);   % full low-pass filtered signal

figure;
plot(t,y,'g--');
hold on, plot(t,x,'k','LineWidth',2);
hold on, plot(t,y_half,'b','LineWidth',2);
hold on, plot(t,y_rect,'r','LineWidth',2);
legend('noisy signal','true signal','positive low-pass','full low-pass','Location','southwest');
</code>
The resulting signals look like this:

You could see here that the altered frequencies effect the whole signal - wherever a high frequency existed gets smoothed. The spatial content is preserved in reconstructing the signal, because FT is a loss-less transformation, but we didn't get the chance to modify the exact spatial locations - the whole signal is effected by a change to the FT magnitude.
Comment: Could you please elaborate on the spatial effect of filtering.
Comment: Which aspect would you like to hear more? Are you curious of what those filters are or how to do that operation?
Answer: Time information is not lost by a DFT.  The information about any one transient in time is spread out among ALL the phase information of every frequency bin of a DFT result.  But it's still there, and returned by doing a IDFT.
Modifying a single bin can have unknown or arbitrary effects on any time localized transient, either making it bigger or smaller or earlier or later, etc., depending on exactly how the phase of that single frequency bin relates to and contributes to all the other frequency bins (magnitudes and phases) to represent that localized time event.
Different frequencies and phases have different effects, so moving them around is unlikely to generate the same signal in time.  Filters change signals.


Add county to reports

Question: I'm looking for a way to add sorting and/or grouping by county to reports. Specifically, Membership Details and constituent Details. I've tried a bit of monkeying with the PHP but I don't seem to have a good enough grasp of it. I'm running v4.7.6. Thank you.
Answer: Ah yes unfortunately you will need some PHP edits to make that work; Custom
reports in CiviCRM are a good way to start getting into the code base though!
Here's two references for you:
https://sf2012.civicrm.org/sites/default/files/slides/CiviCRM%20Reports-Customize%20and%20Extend.pdf
and
https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/
Answer: Those two reports work differently.
In most reports, there's an array called columns that determines which fields are available.  However, to make reports more standard, there's a simple function "getAddressColumns" a report can call if they just need standard address columns.  Not all reports can use the standard columns, and not all have been converted over (if it ain't broke etc.), but some have.
Membership Detail report is one of those reports that have been converted - and so it should definitely have the county field.  See screenshot.

Constituent Detail does NOT use that function.  To add the column:

Edit <civicrmroot>/CRM/Report/Form/Contact/Detail.php.
In the section civicrm_address (around line 143), add the county_id field to the array.  Copy the style of "state_province_id".
That will let you select the column, but it will show as an ID, not the county name.  In the alterDisplay function, copy the state_province_id handling (around line 887) and change all the references to county_id from state_province_id.

That should at least get your counties displaying!  I'll let KarinG's answer suffice for getting your sorting/grouping working.
Finally - you can always use exports instead of reports, and group in your favorite spreadsheet program.

Add county to reports


Does a Readied Action or Delayed Turn count as an Opportunity Action or Immediate Action?

Question: Do Readied Actions or Delayed Turns count against your usage limits for Opportunity Actions or Immediate Actions?
Answer: The trigger for a readied action is an Immediate Action.  If you have used your Immediate action prior to the readied trigger then you are out of luck.

Immediate Reaction: A readied action is an immediate reaction. It takes place after your enemy completes the action that triggers it.

DelayDDI is a NO ACTION.  You must delay your entire turn.  This does not provide you with an extra opportunity or immediate action.

Regular turn
Delay (Opportunity Action(OA) and Immediate Actions do not reset)
Coming back into Initiative, start turn (now OA and Immediate's reset)
Comment: This seems to make sense, but could you provide supporting rules citations?


Why did Jacob need to walk into the rain to get his memory erased?

Question: At the end of Fantastic Beasts and Where to Find Them, Newt helps to obliviate all No-majs by using Swooping evil's venom.
Somehow, I don't understand why Jacob only forgets everything he has done together with Newt when he's walking into the rain. There's a guy shown in the shower who seems to lose his memory, too and he's not standing outside.
Answer: The rain water contaminates the water in the pipelines and/or overhead storage tanks of the buildings in the city.
As you mentioned, a guy in the shower loses his memory. There is also a shot of a woman drinking from a tap who also loses her memory.
Observational deduction and I don't have any links confirming this.
Answer: Also, they could've easily obliviated him instead of making him walk into the rain, but I think that wasn't how it was shown because that would mean that the characters proactively wipe his memory, and I think none of them had the heart to do that. Which is why making him walk into the rain was possibly a kinder thing to do.
Comment: This does not answer the actual question
Comment: At face value, this looks like a fine Doylist answer.


Default Storage account for Azure VM

Question: I created a Windows virtual machine with OS + 1 data disk, which storage account the disk are stored. Is there any default storage account? I am using my free azure account and currently I don't have any storage account created? I am confused with where the disk are stored.
Comment: With Managed Disks, Azure manages the storage account for you. - https://docs.microsoft.com/en-us/azure/virtual-machines/windows/managed-disks-overview
Answer: In Azure, all the data disks are the managed disk and managed by Azure. It shows you the disk resource to you in your resource group. But actually, the disks are also stored in the Azure storage account which managed by Azure and you cannot see it. Only when you export the data disk you can see it like this:

Default Storage account for Azure VM


Are column operations legal in matrices also?

Question: In linear algebra we have been talking a lot about the three elementary row operations. What I don't understand is why we can't multiply by any column by a constant? Since a matrix is really just a grouping of column vectors, shouldn't we be able to multiply a whole column by a constant but maintain the same set of solutions for the original and resulting matrices?
Comment: A matrix isn't really just a grouping of column vectors.
Answer: Yes we can, but the question is what properties of the matrix we preserve when we do so.  The row operations (which correspond to multiplication by an invertible matrix on the left) preserve the row space (the linear span of the rows) and the null space.  The column operations preserve the column space (the linear span of the columns) and the null space of the transpose, but they don't preserve the row space or the null space.
Answer: Let's say we have some relation, like
$\left( \begin{array}{ccc}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{array} \right) \left( \begin{array}{ccc} x \\ y \\ z\end{array}\right)
= \left( \begin{array}{ccc} 10 \\ 11 \\ 12\end{array} \right)$
This has a lot of information here. For instance, it says that $x + 2y + 3z = 10$. In fact, one can uniquely solve for $x, y, z$ from this relationship. But suppose we multiply the first column by 3:
$\left( \begin{array}{ccc}
3 & 2 & 3 \\
12 & 5 & 6 \\
21 & 8 & 9
\end{array} \right) \left( \begin{array}{ccc} x \\ y \\ z\end{array}\right)
= \left( \begin{array}{ccc} 10 \\ 11 \\ 12\end{array} \right)$
Both of these cannot be correct (you can fully solve it out if you want, in fact, I encourage it). For instance, knowing that $x + 2y + 3z = 10$ and that $3x + 2y + 3z = 10$ tells us that $x = 0$. That's not so good - clearly, it is not always the case (and it's not here, either). Further, this would result in 3 non-dependent equations in 2 variables - no solution exists.
The main idea is that matrices hide linear equations, and the way in which they hide them is dependent on the laws of matrix multiplication. It's linear with respect to row operations, because that's the same as redundant operations. But it's not the same with respect to column operations. If we wanted to change rows, then we could use matrices... if we multiply on the right instead of the left. Again, it's an artifact of the way in which matrices multiply.
Comment: OK, I worked this out and see what you are saying. But it seems that there is still a valid solution for the second matrix, but you are saying this may not always be the case?
Comment: @weezy: No, it has solution (sometimes). But they're different. The good thing about row operations is that the solutions don't change.  I mean, we care about how we change matrices, right?
Comment: Ok, so the column operations will change the solution for a given **b** , but they will not change the possible **b** 's for which there are solutions?
Comment: @weezy: no, they might. It's as if you're coming up with a completely unrelated, new, matrix almost. So they're not really related.
Comment: but I thought that asking if some vector **b** was a solution for a matrix consisting of the vectors ($v_1$, $v_2$...) was equivalent to asking if you could produce that vector through a multiplication of the vectors by come constants and then add them together to produce **b**
Comment: @weezy: something like that. It has to do with the row and columnspaces, and whether or not b is in it. Changing the columns change the rowspace, which determines whether b has a solution or not.
Comment: It's the same reason you can multiply both sides of an equation by two, but you can't just multiply both terms on the left side of an equation by two. `X+Y=3 -> 2(X+Y)=3` is good -- if the one on the left is true, the one on the right is true, but `X+Y=3 -> 2X+2Y=3` is bad -- they say completely different things.
Answer: We can perform elementary column operations: if you multiply a matrix on the right by an elementary matrix, you perform an "elementary column operation".
However, elementary row operations are more useful when dealing with things like systems of linear equations, or finding inverses of matricces. And anything you want to do with columns you can do with rows... in the transpose.
You can develop the entire theory with elementary column operations instead; you just have to set up everything "the other way around". You would look at systems of linear equations as systems of the form
$$(b_1,b_2,\ldots,b_m) = (x_1,\ldots,x_m)A$$
(that is, $\mathbf{b} = \mathbf{x}A$), with row vectors; the coefficients of the $m$th equation would become the $m$th column of the coefficient matrix $A$. And you would perform elementary column operations instead of elementary row operations.
When you perform elementary row operations with systems of the form $A\mathbf{x}=\mathbf{b}$, your operations do not respect the columnspace, but do respect the rowspace and the nullspace. If you perform elementary column operations to these systems, you respect the columnspace, but you do not respect the rowspace of the nullspace.
That said, matrices are not "really just a grouping of column vectors". They are a lot more.
Answer: I want to point out that you can solve a linear system with column operations. Column operations do change the solution... but the new solution is in terms of different variables! A column operation is a change of variables!
(This is unsurprising of course; row operations corresponds to multiplying by elementary matrices on the left, $\cdots E_2 E_1 A x = y$, ie. we're transforming the result of applying $A$, while column operations correspond to multiplying on the right, $A E_1 E_2\cdots x = y$, ie. we're transforming the variables before they get fed into $A$.)
If you have $\begin{align}2X+3Y&=1\\6X-4Y&=2\end{align}$

Multiplying the first column by $k$ corresponds to the substitution $X = kX'$.
$$\begin{align}2kX'+3Y&=1\\6kX'-4Y&=2\end{align}$$
Exchanging the columns corresponds to the substitution $X = Y', Y = X'$
$$\begin{align}2Y'+3X'&=1\\6Y'-4X'&=2\end{align}$$
Adding $k$ times the second column to the first corresponds to the substitution $Y = Y'+kX$
$$\begin{align}2X+3(Y' + kX)&=(2+3k)X+3Y'&=1\\6X-4(Y' + kX)&=(6-4k)X-4Y'&=2\end{align}$$

So to solve this equation

Multiply the first column by $1/2$: $X = X'/2$
$$\begin{align}X'+3Y&=1\\3X'-4Y&=2\end{align}$$
Add -3 times the first column to the second column: $X' = X''-3Y$
$$\begin{align}X''& &=1\\3X''&-13Y&=2\end{align}$$
Multiply the second column by $-1/13$: $Y=-Y'/13$
$$\begin{align}X''& &=1\\3X''&+Y'&=2\end{align}$$
Add -3 times the second column to the first column: $Y' = Y''-3X''$
$$\begin{align}X''&=1\\Y''&=2\end{align}$$

Now as has been noted, $(1,2)$ is not a solution to the original equation. We need to run all our substitutions backwards to re-express it in terms of $X$ and $Y$.
4. $Y' = Y''-3X''=2-3=-1$
3. $Y = -Y'/13=1/13$
2. $X' = X''-3Y =1-3/13=10/13$
1. $X = X'/2 = (10/13)/2 = 5/13$
Giving the correct solution $X=5/13, Y=1/13$.
This also shows why people prefer row operations. You get the answer in terms of the original variables!
Also note that there was no reason to consider augmented matrices when working this way.
Answer: Doing something similar to what was mentioned in another answer, but this time in a situation where there is a unique solution rather than infinitely many solutions, first consider the following system:
$$ \begin{bmatrix}
1 & 2 \\
4 & 5
\end{bmatrix} \begin{bmatrix} x \\ y\end{bmatrix}
= \begin{bmatrix} 10 \\ 11 \end{bmatrix}$$
The solution is $x= -28/3$, $y= 29/3$.
If we multiply the elements in the first column by $3$, we get
$$ \begin{bmatrix}
1 & 2 \\
4 & 5
\end{bmatrix} \begin{bmatrix} x \\ y\end{bmatrix}
= \begin{bmatrix} 10 \\ 11 \end{bmatrix}$$
and now the solution is $x=-10/3$, $y=29/3$.
So the solution did not remain the same.
Now remember a couple of things: (1) You can multiply both sides of $u=v$ by the same number, and if what you had was true, then what you get is still true.  That justifies row operations, but not column operations. (2) When you do a row operation, you multiply both sides on the left by the same matrix.  Suppose we want to add $-4$ times the first row to the second in the first problem above.  Then we get
$$
\begin{bmatrix}
1 & 0 \\
-4 & 1
\end{bmatrix}
\begin{bmatrix}
1 & 2 \\
4 & 5
\end{bmatrix} \begin{bmatrix} x \\ y\end{bmatrix}
= \begin{bmatrix}
1 & 0 \\
-4 & 1
\end{bmatrix}\begin{bmatrix} 10 \\ 11 \end{bmatrix}.
$$
We're multiplying a matrix on the left by something, and on the other side of the equation we're multiplying the SAME matrix on the left by the same thing.  If we want to multiply on the right rather than on the left, we need a $1\times m$ matrix, for some $m$.  Thus
$$ \begin{bmatrix}
1 & 2 \\
4 & 5
\end{bmatrix} \begin{bmatrix} x \\ y\end{bmatrix} \begin{bmatrix} \bullet & \bullet & \bullet & \cdots \end{bmatrix}
= \begin{bmatrix} 10 \\ 11 \end{bmatrix}\begin{bmatrix} \bullet & \bullet & \bullet & \cdots \end{bmatrix}$$
This does not accomplish a column operation.  That would be done like this:
$$ \begin{bmatrix}
1 & 2 \\
4 & 5
\end{bmatrix} \begin{bmatrix} \bullet & \bullet \\ \bullet & \bullet \end{bmatrix}$$
But you'd have to multiply by the same thing on the right side of the equation, and there's no way to do that.
Answer: One area where column and row ops can be used are when finding the determinant of a matrix. In this case, the determinant property is not affected by the choice of ops because we are not multiplying it by any specific vector.
Example:
$$
det\left( \begin{array}{ccc}
1 & 0 & 0 & 3 \\
2 & 7 & 0 & 6 \\
0 & 6 & 3 & 0 \\
7 & 3 & 1 & -5
\end{array} \right)
$$
This one is a bit time consuming to solve by using cofactor expansion, but we can also use elementary row ops on this one.
You could take the time to work through it just like you were taught in Linear Algebra I or you could take another look at it. What happens if we multiply the first column by -3 and add it to the fourth column? We get:
$$
det\left( \begin{array}{ccc}
1 & 0 & 0 & 3-3 \\
2 & 7 & 0 & 6-6 \\
0 & 6 & 3 & 0 \\
7 & 3 & 1 & -5-21
\end{array} \right) =
det\left( \begin{array}{ccc}
1 & 0 & 0 & 0 \\
2 & 7 & 0 & 0 \\
0 & 6 & 3 & 0 \\
7 & 3 & 1 & -26
\end{array} \right) = 1*7*3*-26 = -546
$$
Bingo! An upper triangular matrix. No correction is needed for this operation so the answer is the product of the diagonal entries: -546;
So to sum up, there are some times when you can use both column operations and row operations. It works as long as you don't need to preserve a multiplication relationship. If you start looking at both column and row operations, it will open up your mind to the power of the matrix. Just be VERY CAREFUL.
--
techdude
Answer: You might find Building generalized inverses of matrices using only row and column operations interesting. As others have mentioned, "column operations" are multiplying on the right by an elementary matrix. You can use them to push further than reduced row echelon form and, given $A \in \mathbb R^{m \times n}$, you can compute $P$ and $Q$ such that
$$ PAQ =
\left[
  \begin{array}{c|c}
    I_r                        & \mathbf{0}_{r \times (n-r)}      \\
    \hline
    \mathbf{0}_{(m-r) \times r} & \mathbf{0}_{(m-r) \times (n-r)} \\
  \end{array}
\right] $$
where $r = \mathrm{rank}\left(A\right)$ and $P$ and $Q$ are invertible. You can get $P$ with just row operations but you need column operations to get $Q$.
Answer: i think that the reason which causes "elementary" column operations incorrect is because of our rules toward the form of linear equations. That is, we define linear equations to be written as what we get used to writing now! You can try to write down theses equations straight and apply column operations to them, and see what happens.


The chess.com vs computer games celebrity category

Question: I came upon chess.com playing against computer mode. I found a resemblance of two professional chess players over there. Do they really resemble their gameplay, though? Does the AI mimic their past plays?
Comment: Nakamura played his bot a couple months ago: https://www.youtube.com/watch?v=mZ5yqDtkQXI I'd say from his comment "And it's playing my friggin' opening!" on game 2 that the bot probably indeed has a bit of his "personality" but I can't say for sure to which extent it goes. The bot also tried to flag him in the endgame, which Nakamura does a lot. Not sure if they kept it as-is when chess.com moved to their new bots UI though.
Answer: I have spent some time playing the lower-rated bots, and can confirm they tend to have different "personalities". I'm not a strong enough player to explain exactly how they are different. However I have observed that some are more aggressive, and tend to gravitate towards particular openings depending on the color.
I know that Hikaru recently did a series of videos on youtube where he played against bots. When I saw the new bots, I had a feeling that it was for the purpose you describe.
Answer: We don't know for sure. Chess.com is closed source so we will never know for sure. One thing I can tell you for sure, you're NOT playing the real Nakamura. It's nothing more than a tuned chess engine wrapped by smart marketing.
Why don't we take a look of PlayMagnus https://www.reddit.com/r/chess/comments/a5ws9t/question_about_playmagnus/?

The higher levels of the app actually makes some attempts to play like
Magnus did at the various ages. It isn't nearly as good as I would
like it to be (I was handicapped by an extreme shortage of development
time and not having anything better than my MacBook available for
tuning and testing), and I hope to find the time to do a better job
some day, but at least it is true that analysis of Magnus' style,
strength and opening choices through the years played some role in the
development of these levels.
The lower levels, however, are pure fiction. We didn't even have any
games played by Magnus at these ages. We made these levels with the
aim that every chess player - even someone who has just learned the
rules - should be able to find some beatable level. Magnus 5, the
lowest level of all, plays completely random legal moves. It has
nothing to do with any research of how Magnus or any other 5 year old
plays chess.

So think of like paying chess.com for a new careful strong tuned chess AI. Sorry, no Nakamura here.
I don't know what exactly was tuned. My guess:

Playing strength
Thinking time
Static evaluation
Search algorithms
Piece square tables
Search depth etc
Answer: They said about individual bot (strengths and weaknesses) but haven't disclosed about the bots, representing professional players.
Answer: no, i think its just the strength of the computer is matched with the computers image like the hikaru nakamura computer. It will play at his strength level.
Comment: I'm pretty sure there's more than engine strength involved, as there are multiple personalities with the *same* listed strength. In order to believe this answer I'd need something better sourced than "I think".
Comment: Thanks. I wonder whether chess.com team fed the AI and train the agent with Hikaru Nakamura's already played game. It would be awesome if they do something like this.


Wordpress images broken after upload on ubuntu 14.04

Question: Ubuntu: 14.04
Wordpress: 3.8.2
I'm migrating an old website to a fresh setup using wordpress front-ended with nginx. It's mostly gone fine, including creating a custom theme, but when I upload images they will only show as broken links.
The upload process itself seems to work. I checked the location on the file system and the files are there in all their different sizes. If I go into "Edit Image" for the uploaded image, I can see it, but every other location in wordpress admin and the main website shows a broken link.
Here is proof that the files are successfully uploading through wp-admin:
root@[hostname]:/srv/www/wp-content/[hostname]/uploads/2014/11# ls -al
total 284
drwxrwxr-- 2 www-data www-data   4096 Nov  8 01:12 .
drwxrwxr-- 3 www-data www-data   4096 Nov  8 01:03 ..
-rw-rw-r-- 1 www-data www-data  10450 Nov  8 01:03 SJB_0227-150x150.jpg
-rw-rw-r-- 1 www-data www-data  20732 Nov  8 01:03 SJB_0227-199x300.jpg
-rw-rw-r-- 1 www-data www-data  89325 Nov  8 01:03 SJB_0227.jpg
-rw-rw-r-- 1 www-data www-data  10069 Nov  8 01:12 SJB_0229-150x150.jpg
-rw-rw-r-- 1 www-data www-data  22616 Nov  8 01:12 SJB_0229-300x199.jpg
-rw-rw-r-- 1 www-data www-data 118579 Nov  8 01:12 SJB_0229.jpg

My /etc/wordpress/config-[hostname].php includes:
define('WP_CONTENT_DIR', '/srv/www/wp-content/[hostname]');

The relevant part of my nginx config:
root /var/www/html/wordpress;
        index index.php;
        server_name [hostname];

        location / {
                try_files $uri $uri/ /index.php?$args;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                include fastcgi_params;
        }

I should note that ubuntu automatically created a full /var/www/html/wordpress/wp-content directory, although I'm not sure what that is used for as the files uploaded through wp-admin show up in WP_CONTENT_DIR defined above.
On my main website the links do not work, and are formed like:
http://[hostname]/wp-content/uploads/2014/11/SJB_0229.jpg

Everything except for viewing images works fine with the website. What am I missing?
UPDATE:
I have a solution below. I should also note that the /var/www/html/wordpress path above was actually a symlink to /usr/share/wordpress that I had created and forgot about. However the issue persisted when it was changed to the actual location.
Comment: As a test I copied one of the JPGs to the root of the website to verify that nginx was willing to display JPGs in general. It displayed fine when directly accessed like that.
Comment: Defining `WP_CONTENT_DIR` in wordpress config does not tell nginx that it should serve `http://[hostname]/wp-content/` from there (outside your root folder). You need to map /wp-content/ to the correct location by either symlinking (like you mentioned in your answer) or by other means.
Answer: It appears that the Ubuntu install is NOT honouring the WP_CONTENT_DIR settings in /etc/wordpress/config-[hostname].php.
I resolved the issue (at least for now) with:
cd /usr/share/wordpress/wp-content
mv uploads uploads-old
ln -s /my/correct/upload/directory uploads


What architecture to use in my pc

Question: I'm new to Ubuntu, I have a dell Inspiron n4010 with Intel core i5 540m 2.5 ghz (1st generation), 5gb RAM.
This machine have from factory Windows 7 Professional x64.
My question is, which is the better Ubuntu for my PC? x64 or x32. I have read a lot of forum posts but I can't decide which is the better one for my PC.
Comment: Canonical now recommends the 64-bit version (starting with 12.04, I believe), so I'd go with that unless you have a specific reason not to.
Comment: https://help.ubuntu.com/community/32bit_and_64bit - I genrally use 32bit PAE versions for Dual-Core Intel i5 2nd Gen + 6GB ram laptop, whilst 64bit for AMD Processor desktop. The main difference is the amount of RAM (or memory) that you can have - 32bit can only do up to 4GB, whilst 64bit or 32bit PAE can have more than 4GB ram. 32bit is sometimes better for compatibility, but 64bit is catching up, especially with flash-player.
Comment: if your window7 64biut is working with lag then go for 64 bit ubuntu ,, else mention the complete configuration..
Answer: The only reason I can think of that you would use the 32 bit version of Ubuntu in a PC with a multi-core, 64-bit processor is if you had less than 4 GB of RAM. Even then, you will still see better CPU performance with the 64 bit version, just less efficient RAM usage.
Since you have a machine that is specifically designed to run a 64-bit operating system, you should go with that. Nowadays, most applications run on 64 bit machines. Unless you have a specific application you want to compile and run for 32 bit Linux, you should go for the 64 bit version.
Comment: Thanks for every body, i made all procedures and my pc is for 64bit, so i'll continue on it thanks

What architecture to use in my pc


What happens if a witch makes a veteran go on alert?

Question: In Town of Salem what happens if a witch causes a veteran to target themself, thus going on alert? The idea behind this would be that if you do it to a veteran they will waste an alert so they can't use it against the mafia or neutral killer(s) that you're teaming with. But since you visited them and made them go on alert it means that it would kill you, right? Do you die or do you live?
Answer: According to this ToS wiki page veterans have "control immunity" so it is impossible for a witch to control them thus this scenario will never arise! If a witch happens to 'control' a veteran, the veteran will see the message "A witch tried to control you but you are immune".
Although if the veteran themselves went on alert and the witch tried to control them, the witch will die.
Because of these facts, it is never a good idea for a witch to intentionally control a veteran.
Comment: I've never experienced this myself. It's interesting how the devs thought of all of this!


Webcam on Lenovo U310 has no video

Question: I've bought a Lenovo U310, installed Ubuntu 12.10 and wanted to use the internal webcam with Skype and Google Hangout. But I cannot get any video signal out of it. Other apps like cheese can. Audio or an external webcam work fine. Any idea on how to fix that?
Answer: Upgrading to kernel 3.5.0-26-generic, which came as a normal system update, fixed the problem. Now everything works fine.
Answer: Apparently the webcams on several Lenovo models have stopped working due to a recent kernel update.  Try the solution posted here:
https://askubuntu.com/a/264461/18665
Comment: Thanks for the note. Yesterday I've upgraded my kernel to 3.5.0-26-generic, which came as a normal system update. Now the webcam works fine :).

Webcam on Lenovo U310 has no video


How can sum of component forces of gravity on inclined plane be greater than actual force of gravity?

Question: First, I understand triangles and trigonometry(I think!), so that's not the issue. The question is more of a conceptual one. How can it be that a force has components whose sum exceeds the actual force? Specifically, on an inclined plane, when the force of gravity on the object (i.e., its weight) is split into its component vectors (parallel and perpendicular to the incline), those two force vectors add up to more than the force of gravity as a single vector.
For example, let's say a 500-Newton objects is on a 45-degree plane (we can assume it's at rest, so there is no net force). The force of gravity is straight down (the hypotenuse), and the parallel and perpendicular vectors of that force (the two legs of the triangle) would be $250\sqrt2$ Newtons. That equals 353.55 Newtons for each component. How can gravity apply 500 Newtons on a system, yet its component force vectors apply over 700 Newtons on that system? What gives?!
This has been bugging me for years. Any illumination would be greatly appreciated.
Comment: Thanks for the reply, though I could have done without the patronizing tone. To be clear, I understand vectors and magnitudes and the WHAT/HOW of it all. Perhaps this is too much of a foundational, conceptual question. At the end of the day, I get that the vectors and magnitudes together resolve neatly into the original force. There's still something missing in the description of WHY a single force can exert itself as magnitudes (in two vectors simultaneously) that collectively exceed the actual force applied.
Comment: That's because force is a VECTOR which means that when summing forces you don't simply sum the magnitudes of the forces, but you sum both the directions and the corresponding component of each force.  This question is a misconception of what a force is. I cannot suggest a book talking about such trivialities alone, but I think that any book of Griffiths should be sufficient to cover such misconceptions in an introductory chapter. Otherwise, ask your teacher to explain to you what vectors are.
Comment: Maybe turn it around and say why adding the magnitudes of the vectors like that is physically meaningful: i.e. explain what aspect of the system that sum is a measure of. If you can't identify such an aspect then perhaps that calculation isn't valid.
Answer: You're adding the magnitudes of the component forces. This gives an answer that is too large, because the component forces aren't pulling in the same direction as each other. The component forces, $\vec{A}$ and $\vec{B}$, say, need to be added as vectors, that is represented as arrows of length proportional to the magnitude of the components and pointing in the direction of these components. Arrange them tail of $\vec{B}$ to head of $\vec{A}$ and the resultant force (the vector sum of $\vec{A}$ and $\vec{B}$) os represented by an arrow going from the tail of $\vec{A}$ to head of $\vec{B}$.
You can do this using a diagram drawn to scale, or a sketched diagram to which you apply trigonometry. When you've done this sort of thing two or three times you don't even need a sketched vector diagram!
A couple of additional remarks that may (or may not) help…
(1) You've resolved the weight into a force of $500\ \frac{1}{\sqrt{2}}$ N normally into the slope, and a force of $500\ \frac{1}{\sqrt{2}}$ N 'down' along the slope. While the downward components (each of $500\ \frac{1}{\sqrt{2}} \frac{1}{\sqrt{2}}$ N) of these two component forces add up as scalars to make the original downward force, their horizontal components, each of $500\ \frac{1}{\sqrt{2}} \frac{1}{\sqrt{2}}$ N but in opposite directions, cancel.
(2) Force is one of a 'family' of Euclidian vectors. The archetypal Euclidian vector is displacement. 500 m North East is an example of a displacement. Suppose that we wanted to get from A to B, a displacement of 500 m North East. Suppose also that roads and rail were only available in a grid pattern, going East-West (and West-East) and North South (and South North). To get from A to B by road or rail you'd have to go $500\ \frac{1}{\sqrt{2}}$ m North and $500\ \frac{1}{\sqrt{2}}$ m East. That means you've gone a total distance of $500\ \sqrt{2}$ m. We've just added the magnitudes (scalars) of the two component vectors, and found a figure that is greater than the magnitude (500 m) of our displacement. But the two component displacements ($500\ \frac{1}{\sqrt{2}}$ m North and $500\ \frac{1}{\sqrt{2}}$ m East) add as vectors to give the required displacement of 500 m North East!
Comment: "the block needs over 700 Newtons of force to counteract gravity." That's your mistake. You're adding magnitudes of component forces, and that's not the way to add forces when they're not in the same direction. It's a little like me owing you £15 and paying you £20, while you give me £5 change. £20 and £5 have passed between us but adding these sums together to make £25 has little relevance. I don't suppose this  has helped, but $I've\ expanded\ my\ original\ answer $ in the hope that you'll be persuaded.  I like your persistence!
Comment: I think that a light bulb $coming\ on\ $ is supposed to signify a moment of understanding, but who cares?
Comment: Thanks! I should have been more clear in my original post that I understand vectors and vector diagrams. I'm fine reproducing the actual, single force out of its component vectors. Going back to the original example with the 500-Newton block on the ramp, a scale embedded in the ramp would read 250root2 Newtons (representing the normal force) and, if the block was static, the force from friction would also be 250root2. In short, gravity is applying 500 Newtons of force but the block needs over 700 Newtons of force to counteract gravity. Any more thoughts? Thanks again!
Comment: This reminds me of the classic [Missing dollar riddle](https://en.wikipedia.org/wiki/Missing_dollar_riddle).
Comment: And me ……………...
Comment: The light bulb just went off! Thank you for the explanation. Your example of exchanging money did the trick. Having a concrete analogy always helps with these conceptual nuances. Thank you for sticking with me on this one.
Comment: Good point. American colloquialism that I've long heard, but I've never considered the syntax. All that aside, the light bulb is indeed on, for which I owe you a debt of gratitude.


Gene density percentage

Question: What do we mean when we say that: Haemophilus influenza genome is 85% genic.
How do we measure gene density in percentage, especially for the above-mentioned case?
Answer: It means that 85% of its genome is coded for proteins (ORFs). The other 15% not, so these can be regulatory elements, repeats, or other.
You can measure that by measuring the total length of all ORFs, and compare it with the total length of the genome.

Gene density percentage


Are there any jEdit syntax highlighting modes for Objective-J

Question: I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly appreciated.
Answer: According to the JEdit features page it already supports Objective C.
Comment: It has for a while too, back when I was doing pop11 it already had Objective-C, but, is Objective-J similar enough that I can use that?
Answer: One of my favorite things about JEdit is how easy it is to define a new syntax highlighting mode.  I work in a land in which every fool wants to create his own custom configuration file language and I've gotten to where I can create a new approximate syntax highlighting mode in about 5 minutes.  I start by copying a mode that is similar to the new language I wanted to create and then iteratively refining the edit mode as I learn more parts of the language. I did this with Specman ( a hardware verification language ) as I was going through the intro course.


Can you use ice in a water jug that has a stopper on shabbos?

Question: Can one use a water jug with ice on shabbos, if when you pour the water there is a wide filter/catcher to stop the ice from coming out? Or perhaps it is an issue of borer/merakeid?
Answer: CLYOR. To me it seems permissible, unless you hate ice, and plan on emptying the pitcher.
It is definitely not borer for several reasons:

It involves taking the good from the bad, so even if you hate ice, you're ok (see 39 Melachot p 404).
It's not even a mixture according to Rabbi Ribiat, quoting Rav Moshe (ibid 391 and footnote there)
Zoreh, Borer and Meraked are so similar that it can be hard to separate them in halacha. This shayla would fall under meraked and not borer as you aren't doing it with hand or similar; you are straining it - see ibid 382 (and you aren't using any form of wind/air power so it's not zoreh either - ibid 379 and footnotes there).

For meraked, the pesolet has to be undesireable. Generally, it means undesirable to most people (ibid 511, quoting Mishna Berura 319:34), which does not include ice. The exception would be if you are particularly averse to ice (ibid 514, quoting Pri Megadim 319, Mishb'tzot Zahav s'k 6, and Biur Halacha there, 10), then you will still be ok if you don't pour it out completely, but leave some behind (based on S'A O'C 319:14).
Answer: After considerable Google search I found this Menucha youth Parasha sheet:
https://btya.org/wp-content/uploads/MenuchaV02I28.pdf
Quoting:

Using a Pitcher with a Slotted Cover
-- by Shlomo Epshteyn
The spring is finally here. For the first time since last summer, the
Mermelstein family put on a Shabbos table a pitcher of water that had
ice cubes in it. Everyone noticed the brand new pitcher that the
father purchased on erev Shabbos. Shmuli noticed, however, that the
cover of the pitcher had a "filter" to hold back the ice. "Abba – but
you taught me that we can't use a kli to do Borer even if we are
selecting 'good' from 'bad' for immediate usage."
Question:  Can this pitcher be used?
Answer:  Yes. However, once the ice cubes have become small (i.e. to a degree where it is no longer very easy to remove them), it is
better to pour the water when the ice cubes are settled at the bottom
of the pitcher. If the ice cubes are small and the water level is very
low, where it does not rise above the ice cubes, it's best then to add
more water to the pitcher.
Explanation:  We have learned in the last few articles that the melacha of Borer is not applicable in a case where a large item is
inside a liquid, whereby it does not require effort to identify and
remove the item from the liquid. There, the item is already considered
as 'selected' - i.e., it is lacking the status of "mixed-in" [1].
An example of such is a case where the eggs are inside the water.
Spilling out the water or removing the eggs from the water—even for
later use—is permitted. Since the eggs are large and don't require
effort to identify and remove them, they are not considered as "mixed
in" with the water [2].
Similarly, the Shemiras Shabbos Kehilchosa rules that due to their
considerably large size, ice cubes inside a drink* are not considered
as mixed in with the liquid [3]. Since there is no "mixture", then
even a kli (i.e., the cover which holds back the ice) may be used in
this case [3]. (The second part of the "Answer" – what to do once the
ice cubes in the pitcher become small – is similar to a case of "a tea
pot with essence and tea leaves." The explanation of these cases needs
to be discussed in a separate article.)

[1] Shevisas HaShabbos (Borer, 25).  [2] ibid.  [3] Shemiras Shabbos
Kehilchosa 3:63.
* From the fact that the Shemiras Shabbos Kehilchosa (3:4) taught
that one may remove a large piece of meat from a clear soup (since it
does not take effort to identify the meat there), it appears that
in a case of ice cubes, the "drink" that Shemiras Shabbos Kehilchosa
is referring to is also a type of drink in which one could see the ice
cubes (e.g., water, apple juice).


fast current pulse

Question: I am wondering if there a way to convert a pulse train with a 200 kHz rep rate, a duration of ~100 nanoseconds, and an amplitude of ~4 volts to a DC voltage in such a way that the area under the curves of the pulse train is equal to the area under dc voltage. In other words, if both graphs of voltage in time were integrated out to infinity, the integrals would be equal. These are from a pulsed laser that I am measuring with amplified photodiodes. I am hoping to measure a very small signal that is occurring at a subharmonic frequency using a lock-in amplifier and then compare it to the magnitude of the pulses. It would be really convenient if I could use the auxiliary channel on the back of the lock-in as a voltmeter for this latter part, but it can only measure a stable DC voltage well.
Comment: A low pass filter with dc gain of 1 will do what you are asking for.
Comment: Can you draw these two graphs, because I don't understand what areyou talking about, also the integral with units. You are talking about current pulse, then it becomes a voltage pule, after that an integral voltage*time becomes voltage with two graphs?!
Answer: What the photon said; If the modulation for the lockin (LI) is very slow compared to the 200kHz, (say factors of ten or more... 1kHz to 10 kHz.) Then you may do better by low pass filtering the 200 kHz pulses first... with a corner set above the LI modulation frequency, and sending that into the lockin... the LP filter will cause some phase shift.. but should be a real help in terms of dynamic range... (not over loading the LI front end.)

fast current pulse


Whats happened with already installed GNOME apps if I install and run KDE to Ubuntu 18.04?

Question: If I want try use KDE Plasma instead of GNOME and install it as second desktop on already configured and working Ubuntu 18.04, will I be able to run/use all the old programs installed with (GNOME) Ubuntu Software using KDE environment OS login?
Comment: Nothing will happen. Some of the launchers might become 'invisible', as they are configured to be shown in a specific DE, but the programs should still be usable.
Comment: I use multiple DEsktops on my Ubuntu systems too, GNOME is GTK+ based, KDE is Qt based - but you can use either apps on your system. The primary consequence is if you desktop is KDE (Qt based) and you run a GTK+ program, it'll need both some Qt & GTK+ libraries in memory (thus footprint is larger) whilst the program is running. The same occurs in reverse, so the main consequence for your machine depends on how much RAM you have.  Yes you can use both, but menus will have twice the programs, more updates & potential for wasted memory
Comment: I vaguely remember this working back when I wanted to test out different DE's but it was awhile ago. Have you tried yet and gotten errors? Or are you apprehensive in installing kde?
Comment: I have Kubuntu 18.04 with several "GNOME" applications working just fine: Google Chrome, Firefox, LibreOffice, Gedit, Mousepad, Leafpad, Zenity. Do you have some specific application in mind?
Comment: A cleaner option would be to install Kubuntu on a separate partition.
Comment: @j-money I beware to install KDE. I'm very careful, coz it my computer for work with lots of pre-installed software. But looks like KDE is more usable on desktop like for me.
Comment: @DK Bose similar list of apps + GIMP, Itellij Idea, FileZilla, Double Commander .. and more...
Answer: In short, nothing will happen with your already installed gnome applications. They will continue to work as before.
In Linux, different desktops can be installed on a single system. And indeed, each user on the system can by default long in on his/her favorite desktop.
All existing applications will remain available for all users of the system, along with the new applications that came with that new desktop. All applications can be used on any desktop, although the use of different themes and widgets may cause an application look a bit out of place when run on a different desktop than that for what is is primarily designed.
All users will see many applications in their menu system, including these that belong to another desktop environment and that they probably will never use. This can be seen as a disadvantage of installing multiple desktops on the same system. While undesired applications can be hidden in the user's menu on a per-user basis, this  requires manual editing of the launchers, or of the menu when a menu-editing application is used.
Another potential issue is that different desktops come with different graphical login managers or screens. In Ubuntu, the current display manager will be replaced if another desktop is added using the *-desktop package. For example, the system will have a KDE login screen after the KDE desktop has been added to the system. A sufficiently skilled system administrator, however, can control what display manager is used for login, and actually may proceed to a more granular install, selectively installing these packages that are desired on the system.
With respect to memory use, there are no immediate consequences of having an additional desktop installed. Memory use depends on the applications you effectively use, not on the amount of software installed on your hard disk. In general, more memory is required if you use programs based on different toolkits simultaneously, because the libraries for these different toolkits need to be loaded in memory. That, however, is independent on having one or more desktops installed. It will also happen on a system containing only one desktop, for example Gnome, if you want to run a KDE application, example KDEnlive.


The difference between "go to shop" and " go shopping"

Question: I've been stuck thinking this for a while. Would anyone explain me the difference between "go to shop" and "go shopping".
Answer: As a simple statement, most English speakers would say:

I'm going shopping

That's to say, they intend to visit a shop or shops to purchase goods.
Go to shop is unusual unless it's part of a sentence - such as:

I am going to shop for shoes this afternoon.

It means to look for with a view to purchasing.
In this construction shop is clearly a verb.
If shop were intended as a noun, the sentence would have to read:

I am going to a/the shop (to look for shoes)
Comment: Although I answered separately before I saw this reply, I agree with this answer.
Answer: It's usage. We generally use the present participle with 'go'.
I will go swimming.
I went fishing.
I always go shopping on Tuesday.
I have gone running on weekends for 20 years.
Answer: I have been thinking about this for a while since I teach Basic 2 level of ESL, and students often ask why we say this.  They also make errors between go + action and go to + place.  As I examine the phrases that use go + gerund, I find that they require a person to go to another location in order to do the action:
--go shopping (you have to go to a store)
--go fishing (you have to go to a body of water)
--go skiing (you have to go to a mountain or ski resort)
This is my present take on the subject.
Comment: Welcome to SE! Please do not answer if you can only provide opinions, when you get 50 reputation you can comment on any post. You will only get reputation if you include in your answers sources/research, thorough explanations, relevant links, etc. please see the Help Center if you require more information.