Jquery Ajax Uncaught ReferenceError

Question: I have a form with 4 fields (ramo,garanzia,importo and destinazione) that ask to a Mysql db with this colums
ramo |garanzia|importo|destinazione|risultato|unita|
to estract "unita" for some combination of that 4 fields on form.
I want do this with a query using AJAX Jquery
$.ajax({
            type: "GET",
            url: 'find_result.php',
            //data: { ramo: ramo ,garanzia: garanzia,importo: importo ,destinazione: destinazione},
            data: $("#data_form").serialize(),
            dataType: "JSON",
            }).done(function(reply) {

            $.each(reply, function(key, value) {
                alert(unita.value);
            });

JSON result of find_result.php is
 [{"ramo":"bagaglio","garanzia":"Rimborso rifacimento documenti","importo":"Importo noto","destinazione":"Italia","risultato":"In caso di importo noto e limporto noto verificando che non superi il massimale previsto dalla garanzia. In caso affermativo la riserva e il massimale","unita":"0"}]

As u can see "unita" value exist and is 0 in Json.
So why alert(unita.value) doesn't work?? In chrome debug there's this error message
(index):156 Uncaught ReferenceError: unita is not defined
    at Object.<anonymous> ((index):156)
    at Function.each (jquery-1.12.1.js:370)
    at Object.<anonymous> ((index):155)
    at fire (jquery-1.12.1.js:3232)
    at Object.fireWith [as resolveWith] (jquery-1.12.1.js:3362)
    at done (jquery-1.12.1.js:9836)
    at XMLHttpRequest.callback (jquery-1.12.1.js:10302)

Thx a lot in advance
Answer: Try with:
$.each(reply, function(key, value) {
  alert(value.unita);
});

let result = [{"ramo":"bagaglio","garanzia":"Rimborso rifacimento documenti","importo":"Importo noto","destinazione":"Italia","risultato":"In caso di importo noto e limporto noto verificando che non superi il massimale previsto dalla garanzia. In caso affermativo la riserva e il massimale","unita":"0"}]

$.each(result, function(index, value) {
  console.log(value.unita);
});

Comment: wow if i write "value.unita" works! Mmm why "unita.value" no? Ok I understand maybe because value is the object but so why instead for example (ramo.value) works? Maybe because is an input variable of ajax?
Comment: Because you're getting the `keys` from the `value`, so you were doing it upside down.
Answer: Try console.log(value.unita);
you defined the object in your forloop as value.
Answer: The var unita doesn't exist in your JS.
$.each(reply, function(key, item) {
    alert(item.unita.value);
});

Jquery Ajax Uncaught ReferenceError


What is the dimension of the tangent space

Question:
Write down the equations of the tangent space $T_aX$ to a submanifold $X = \{f_1 = \cdots = f_k = 0 \}$ backwards $\in a = \{a_1, \cdots a_n \}$. What is the dimension of $T_aX$.

I wrote the equations to be
$$\frac{\partial f_1}{\partial x_1} (a) (x_1 - a_1) + \cdots \frac{\partial f_1}{\partial x_k}(a)(x_k - a_k) + \cdots + \frac{\partial f_k}{\partial x_1} (a) (x_1 - a_1) + \cdots \frac{\partial f_k}{\partial x_k}(a)(x_k - a_k)$$
but I don't know what the dimension is. What is it?
Comment: The dimension of the tangent space of a smooth manifold is always the same as the dimension of the manifold itself.
Comment: @DanielRobert-Nicoud So here it would be $k$?
Comment: Your message certainly has many errors or lacks, but it looks like $k$ is the codimension of your submanifold, not its dimension.
Comment: @girianshiido What is missing?
Comment: There was an error in my answer: the dimension of the tangent point of a manifold **at a point** is the same as the dimension of the manifold. The dimension of the tangent space is **twice** the dimension of the manifold.
Answer: The dimension of the tangent space of a smooth manifold at a point is always the same as the dimension of the manifold. The dimension of the tangent space of a manifold is twice the dimension of the dimension of the manifold.
In your case, $k$ is the codimension of the manifold (as it has been pointed out in the comments). This means that if your manifold is a submanifold of $\mathbb{R}^n$ (with $n>k$), then the manifold has dimension $n-k$.
In order to see why it is so, I propose you the following two examples:
The sphere $S^2\subset\mathbb{R}^3$ is given as level set of the single function $f_1:\mathbb{R}^3\rightarrow\mathbb{R},\ (x,y,z)\mapsto x^2+y^2+z^3-1$, that is: $S^2 = \{(x,y,z)\in\mathbb{R}^3|f_1(x,y,z) = 0\}$. As you can see $\dim S^2 = 2$, and its codimension is $1$.
The circle $S^1\subset\mathbb{R}^3$ given as level set of the two functions $f_1:\mathbb{R}^3\rightarrow\mathbb{R},\ (x,y,z)\mapsto x^2+y^2-1$ and $f_2:\mathbb{R}^3\rightarrow\mathbb{R},\ (x,y,z)\mapsto z$ that is: $S^1 = \{(x,y,z)\in\mathbb{R}^3|f_1(x,y,z) = 0,\ f_2(x,y,z)=0\}$. As you can see $\dim S^1 = 1$, and its codimension is $2$.


how to use the pigeon hole principle on a graph problem?

Question: I have this given problem:
In a class there is 6 students,every 2 students of 6 know each other in advance or they don't.
Show that there is 3 students that don't know each other in advance or that there is 3 that know each other in advance.
This problem looks simple but when i try to write a solution for it i'm confused if it's enough or not, here is my attempted:
Case (every two students know each other in advance):
Let $G=(V,E)$ be a graph with $|V|=6$ vertices ,to represent this case the number of edges in this graph should be $|E|=3$.
By using the pigeon hole principle we want to place $|V|=6$ pigeons(vertices) in $|E|=3$ holes(edges) where at each hole there is exactly 2 pigeons.
if we choose a pigeon(vertex) $u\in{V}$ at hole $a\in{E}$ then this ensures that there is 3 other vertices in different holes that are unreachable from $u$.
Is this solution correct or even enough?
for the second case i'm planning to use the same reasoning but I plan to let the vertices be the holes ,and edges for the pigeons.
Answer: Pick one student.  Among the five others, there must be three he knows, or three he doesn't know.  Suppose he knows three people.  If two of them know one another, we have a group of three mutual acquaintances -- those two and the original student.  If none of the three knows one another we have a group of three mutual strangers.


Custom module update with project status url

Question: My .info file is the following.
name = {some_name}
description = This will contain all {some_name} related information
package = {Package_name}
core = 7.x

; Information added by Drupal.org packaging script on 2014-10-03
version = "7.x-1.1"
core = "7.x"
project = "{project_name}"
project status url=http://domain.com/{project_name}/7.0/sub_module
datestamp = "1432104957"

I uploaded the sub_module.zip and the sub_module.tar.gz files, as well as the sub_module folder to the above project status URL, with .info version set to 7.x.2.1.
Still I'm not getting any updates for my custom module.
Can anyone help me with this?
Answer: The project status URL you provided in the .info file is wrong: It should be http://domain.com, in the same way for Drupal.org that URL is http://updates.drupal.org/. A Drupal site will then access (in your case) http://domain.com/{project_name}/{drupal_version} to verify the module needs to be updated.
http://domain.com/{project_name}/{drupal_version} needs to return XML data listing all the versions available for that project and that Drupal version.
To make an example with a project hosted on Drupal.org, the list of all the versions available for Drupal 7.x of the Views module is returned from http://updates.drupal.org/release-history/views/7.x, which returns the following XML data.
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Views</title>
<short_name>views</short_name>
<dc:creator>merlinofchaos</dc:creator>
<type>project_module</type>
<api_version>7.x</api_version>
<recommended_major>3</recommended_major>
<supported_majors>3</supported_majors>
<default_major>3</default_major>
<project_status>published</project_status>
<link>https://www.drupal.org/project/views</link>
<terms><term><name>Projects</name><value>Modules</value></term><term><name>Maintenance status</name><value>Seeking co-maintainer(s)</value></term><term><name>Development status</name><value>Under active development</value></term></terms>
<releases>
<release><name>views 7.x-3.16</name><version>7.x-3.16</version><tag>7.x-3.16</tag><version_major>3</version_major><version_patch>16</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.16</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.16.tar.gz</download_link><date>1491158584</date><mdhash>d840cb148809da844b93d73b16b453f9</mdhash><filesize>1643030</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.16.tar.gz</url><archive_type>tar.gz</archive_type><md5>d840cb148809da844b93d73b16b453f9</md5><size>1643030</size><filedate>1491158584</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.16.zip</url><archive_type>zip</archive_type><md5>58da4a76b03278e613f8298e69f761c6</md5><size>1913513</size><filedate>1491158584</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.16-rc1</name><version>7.x-3.16-rc1</version><tag>7.x-3.16-rc1</tag><version_major>3</version_major><version_patch>16</version_patch><version_extra>rc1</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.16-rc1</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.16-rc1.tar.gz</download_link><date>1489763584</date><mdhash>cba59381dbf64ac9d9d76fa549b4c7c1</mdhash><filesize>1642814</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.16-rc1.tar.gz</url><archive_type>tar.gz</archive_type><md5>cba59381dbf64ac9d9d76fa549b4c7c1</md5><size>1642814</size><filedate>1489763584</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.16-rc1.zip</url><archive_type>zip</archive_type><md5>460ed4581a0a7680fad79e1c124cedc3</md5><size>1913275</size><filedate>1489763584</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security>RC releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.15</name><version>7.x-3.15</version><tag>7.x-3.15</tag><version_major>3</version_major><version_patch>15</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.15</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.15.tar.gz</download_link><date>1487784184</date><mdhash>473cb5384456d55af988feabc1af12ed</mdhash><filesize>1642425</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.15.tar.gz</url><archive_type>tar.gz</archive_type><md5>473cb5384456d55af988feabc1af12ed</md5><size>1642425</size><filedate>1487784184</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.15.zip</url><archive_type>zip</archive_type><md5>d22aa50667d4905a6b954c58d7c29832</md5><size>1913348</size><filedate>1487784184</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.14</name><version>7.x-3.14</version><tag>7.x-3.14</tag><version_major>3</version_major><version_patch>14</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.14</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.14.tar.gz</download_link><date>1466019539</date><mdhash>168bb684c8f34297be94b03c797841e5</mdhash><filesize>1656594</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.14.tar.gz</url><archive_type>tar.gz</archive_type><md5>168bb684c8f34297be94b03c797841e5</md5><size>1656594</size><filedate>1466019539</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.14.zip</url><archive_type>zip</archive_type><md5>b8ee0f4278b2f67e4d10997dc2a05ec4</md5><size>1913123</size><filedate>1466019539</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.13</name><version>7.x-3.13</version><tag>7.x-3.13</tag><version_major>3</version_major><version_patch>13</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.13</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.13.tar.gz</download_link><date>1446804839</date><mdhash>50d3b231f689f8c4ff15d79ea3c261d9</mdhash><filesize>1650157</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.13.tar.gz</url><archive_type>tar.gz</archive_type><md5>50d3b231f689f8c4ff15d79ea3c261d9</md5><size>1650157</size><filedate>1446804839</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.13.zip</url><archive_type>zip</archive_type><md5>d30756ba6b3489fd919ddd359f5decad</md5><size>1900939</size><filedate>1446804839</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.12</name><version>7.x-3.12</version><tag>7.x-3.12</tag><version_major>3</version_major><version_patch>12</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.12</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.12.tar.gz</download_link><date>1446653339</date><mdhash>a50033bb090730176d9263ddae7f32b2</mdhash><filesize>1650130</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.12.tar.gz</url><archive_type>tar.gz</archive_type><md5>a50033bb090730176d9263ddae7f32b2</md5><size>1650130</size><filedate>1446653339</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.12.zip</url><archive_type>zip</archive_type><md5>56beb9d18dcc252ca77834f52b9050d1</md5><size>1900868</size><filedate>1446653339</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.11</name><version>7.x-3.11</version><tag>7.x-3.11</tag><version_major>3</version_major><version_patch>11</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.11</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.11.tar.gz</download_link><date>1430320981</date><mdhash>00d722e1d8ed57e912c8bd586cf2edbe</mdhash><filesize>1649389</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.11.tar.gz</url><archive_type>tar.gz</archive_type><md5>00d722e1d8ed57e912c8bd586cf2edbe</md5><size>1649389</size><filedate>1430320981</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.11.zip</url><archive_type>zip</archive_type><md5>448b10631be9423948f4bad59d269593</md5><size>1899261</size><filedate>1430320981</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.10</name><version>7.x-3.10</version><tag>7.x-3.10</tag><version_major>3</version_major><version_patch>10</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.10</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.10.tar.gz</download_link><date>1423648081</date><mdhash>c9806ffd69448bc505a67e790f97da58</mdhash><filesize>1648314</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.10.tar.gz</url><archive_type>tar.gz</archive_type><md5>c9806ffd69448bc505a67e790f97da58</md5><size>1648314</size><filedate>1423648081</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.10.zip</url><archive_type>zip</archive_type><md5>45246351588a7f9f74a7d8ba1e0554f4</md5><size>1897924</size><filedate>1423648081</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.8</name><version>7.x-3.8</version><tag>7.x-3.8</tag><version_major>3</version_major><version_patch>8</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.8</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.8.tar.gz</download_link><date>1400618927</date><mdhash>0fbe71c455f5d34c7193797563b63b3f</mdhash><filesize>1646817</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.8.tar.gz</url><archive_type>tar.gz</archive_type><md5>0fbe71c455f5d34c7193797563b63b3f</md5><size>1646817</size><filedate>1400618927</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.8.zip</url><archive_type>zip</archive_type><md5>c1a997653b21943a86bcd42f5c803403</md5><size>1886165</size><filedate>1400618927</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term><term><name>Release type</name><value>Bug fixes</value></term><term><name>Release type</name><value>New features</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.7</name><version>7.x-3.7</version><tag>7.x-3.7</tag><version_major>3</version_major><version_patch>7</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.7</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.7.tar.gz</download_link><date>1365499237</date><mdhash>3f36f0d13f3b724d719f6729cbc110ba</mdhash><filesize>1639539</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.7.tar.gz</url><archive_type>tar.gz</archive_type><md5>3f36f0d13f3b724d719f6729cbc110ba</md5><size>1639539</size><filedate>1365499237</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.7.zip</url><archive_type>zip</archive_type><md5>c764bcc139e3698b24f4bfcc531542e4</md5><size>1878608</size><filedate>1365499237</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.6</name><version>7.x-3.6</version><tag>7.x-3.6</tag><version_major>3</version_major><version_patch>6</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.6</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.6.tar.gz</download_link><date>1363810217</date><mdhash>1531a1ece3970332db1559b854f5dcc9</mdhash><filesize>1639219</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.6.tar.gz</url><archive_type>tar.gz</archive_type><md5>1531a1ece3970332db1559b854f5dcc9</md5><size>1639219</size><filedate>1363810217</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.6.zip</url><archive_type>zip</archive_type><md5>0d7c7de301caa52670869060e22d1ef3</md5><size>1878465</size><filedate>1363810217</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.5</name><version>7.x-3.5</version><tag>7.x-3.5</tag><version_major>3</version_major><version_patch>5</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.5</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.5.tar.gz</download_link><date>1345829395</date><mdhash>fba70998d4ebcca5116ef5ee90117738</mdhash><filesize>1632919</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.5.tar.gz</url><archive_type>tar.gz</archive_type><md5>fba70998d4ebcca5116ef5ee90117738</md5><size>1632919</size><filedate>1345829395</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.5.zip</url><archive_type>zip</archive_type><md5>8b1102f6cd54949eee147c63c4fd352b</md5><size>1866348</size><filedate>1345829395</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.4</name><version>7.x-3.4</version><tag>7.x-3.4</tag><version_major>3</version_major><version_patch>4</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.4</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.4.tar.gz</download_link><date>1345559303</date><mdhash>72bd0f35ac467aed74e533c10a76c93f</mdhash><filesize>1632803</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.4.tar.gz</url><archive_type>tar.gz</archive_type><md5>72bd0f35ac467aed74e533c10a76c93f</md5><size>1632803</size><filedate>1345559303</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.4.zip</url><archive_type>zip</archive_type><md5>0e92dc862bea87904d507af72e710af7</md5><size>1866193</size><filedate>1345559303</filedate></file></files><terms><term><name>Release type</name><value>New features</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.3</name><version>7.x-3.3</version><tag>7.x-3.3</tag><version_major>3</version_major><version_patch>3</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.3</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.3.tar.gz</download_link><date>1329946249</date><mdhash>70f24086dc7acfa7fc23c6148c7f8e00</mdhash><filesize>1583249</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.3.tar.gz</url><archive_type>tar.gz</archive_type><md5>70f24086dc7acfa7fc23c6148c7f8e00</md5><size>1583249</size><filedate>1329946249</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.3.zip</url><archive_type>zip</archive_type><md5>e8b5f8d4de7526d2919993bb3a34c0bf</md5><size>1803054</size><filedate>1329946249</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.2</name><version>7.x-3.2</version><tag>7.x-3.2</tag><version_major>3</version_major><version_patch>2</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.2</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.2.tar.gz</download_link><date>1329778551</date><mdhash>c350603991445ca69b30eddf3befe887</mdhash><filesize>1582617</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.2.tar.gz</url><archive_type>tar.gz</archive_type><md5>c350603991445ca69b30eddf3befe887</md5><size>1582617</size><filedate>1329778551</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.2.zip</url><archive_type>zip</archive_type><md5>641a7c36bc39d5c17b997ff5babf6d47</md5><size>1801836</size><filedate>1329778552</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.1</name><version>7.x-3.1</version><tag>7.x-3.1</tag><version_major>3</version_major><version_patch>1</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.1</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.1.tar.gz</download_link><date>1326750948</date><mdhash>e158435dc66d1d89a0df587c39ef1a23</mdhash><filesize>1575585</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.1.tar.gz</url><archive_type>tar.gz</archive_type><md5>e158435dc66d1d89a0df587c39ef1a23</md5><size>1575585</size><filedate>1326750948</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.1.zip</url><archive_type>zip</archive_type><md5>43999fc1888c1aa88f1d20288aace84c</md5><size>1792932</size><filedate>1326750949</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.0</name><version>7.x-3.0</version><tag>7.x-3.0</tag><version_major>3</version_major><version_patch>0</version_patch><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0.tar.gz</download_link><date>1324170451</date><mdhash>1be8cbd6fd3f37bfd1493693dfa95d8d</mdhash><filesize>1461460</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0.tar.gz</url><archive_type>tar.gz</archive_type><md5>1be8cbd6fd3f37bfd1493693dfa95d8d</md5><size>1461460</size><filedate>1324170451</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0.zip</url><archive_type>zip</archive_type><md5>99769e8808519ae36171fa619cf00997</md5><size>1672723</size><filedate>1324170451</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security covered="1"/></release><release><name>views 7.x-3.0-rc3</name><version>7.x-3.0-rc3</version><tag>7.x-3.0-rc3</tag><version_major>3</version_major><version_patch>0</version_patch><version_extra>rc3</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0-rc3</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0-rc3.tar.gz</download_link><date>1321467945</date><mdhash>b3e58f4195308e37621155d3c843e53f</mdhash><filesize>1456218</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-rc3.tar.gz</url><archive_type>tar.gz</archive_type><md5>b3e58f4195308e37621155d3c843e53f</md5><size>1456218</size><filedate>1321467945</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-rc3.zip</url><archive_type>zip</archive_type><md5>502f84cfadb4bf4744b6c452fc01f2d6</md5><size>1665759</size><filedate>1321467946</filedate></file></files><terms><term><name>Release type</name><value>Security update</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security>RC releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.0-rc1</name><version>7.x-3.0-rc1</version><tag>7.x-3.0-rc1</tag><version_major>3</version_major><version_patch>0</version_patch><version_extra>rc1</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0-rc1</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0-rc1.tar.gz</download_link><date>1308341221</date><mdhash>e158db78ae2f8cc615edb910a09384b0</mdhash><filesize>1481151</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-rc1.tar.gz</url><archive_type>tar.gz</archive_type><md5>e158db78ae2f8cc615edb910a09384b0</md5><size>1481151</size><filedate>1308341221</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-rc1.zip</url><archive_type>zip</archive_type><md5>941111b41371084230bc82374ebcae19</md5><size>1682522</size><filedate>1308341221</filedate></file></files><terms><term><name>Release type</name><value>New features</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security>RC releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.0-beta3</name><version>7.x-3.0-beta3</version><tag>7.x-3.0-beta3</tag><version_major>3</version_major><version_patch>0</version_patch><version_extra>beta3</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0-beta3</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta3.tar.gz</download_link><date>1301301971</date><mdhash>114c76f201523ef3e50b9a1d431b0364</mdhash><filesize>1469580</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta3.tar.gz</url><archive_type>tar.gz</archive_type><md5>114c76f201523ef3e50b9a1d431b0364</md5><size>1469580</size><filedate>1301301971</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta3.zip</url><archive_type>zip</archive_type><md5>d69e051c8b4fa2066575c28e3ae197ba</md5><size>1671930</size><filedate>1301301971</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security>Beta releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.0-beta2</name><version>7.x-3.0-beta2</version><tag>7.x-3.0-beta2</tag><version_major>3</version_major><version_patch>0</version_patch><version_extra>beta2</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0-beta2</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta2.tar.gz</download_link><date>1301158871</date><mdhash>c39fab1e76e55b15291fecf2c10386c2</mdhash><filesize>1469243</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta2.tar.gz</url><archive_type>tar.gz</archive_type><md5>c39fab1e76e55b15291fecf2c10386c2</md5><size>1469243</size><filedate>1301158871</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta2.zip</url><archive_type>zip</archive_type><md5>cd30442906e8d9e9bffc7ea8b28f3702</md5><size>1671405</size><filedate>1301158871</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security>Beta releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.0-beta1</name><version>7.x-3.0-beta1</version><tag>7.x-3.0-beta1</tag><version_major>3</version_major><version_patch>0</version_patch><version_extra>beta1</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0-beta1</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta1.tar.gz</download_link><date>1301099796</date><mdhash>6ee4495cbdf0a8d19bd214f57bef0bf4</mdhash><filesize>1468892</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta1.tar.gz</url><archive_type>tar.gz</archive_type><md5>6ee4495cbdf0a8d19bd214f57bef0bf4</md5><size>1468892</size><filedate>1301099796</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-beta1.zip</url><archive_type>zip</archive_type><md5>36acc8675052e2dcb0c933e1ac8eab1d</md5><size>1670997</size><filedate>1301099796</filedate></file></files><terms><term><name>Release type</name><value>New features</value></term><term><name>Release type</name><value>Bug fixes</value></term></terms><security>Beta releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.0-alpha1</name><version>7.x-3.0-alpha1</version><tag>7.x-3.0-alpha1</tag><version_major>3</version_major><version_patch>0</version_patch><version_extra>alpha1</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.0-alpha1</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.0-alpha1.tar.gz</download_link><date>1294276882</date><mdhash>8635e5b0c03fed4516abae25489a5a5c</mdhash><filesize>1561161</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-alpha1.tar.gz</url><archive_type>tar.gz</archive_type><md5>8635e5b0c03fed4516abae25489a5a5c</md5><size>1561161</size><filedate>1294276882</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.0-alpha1.zip</url><archive_type>zip</archive_type><md5>f5ffc235849f2a3a5f66b66f84a73aac</md5><size>1772425</size><filedate>1294276882</filedate></file></files><terms><term><name>Release type</name><value>Bug fixes</value></term></terms><security>Alpha releases are not covered by Drupal security advisories.</security></release><release><name>views 7.x-3.x-dev</name><version>7.x-3.x-dev</version><tag>7.x-3.x</tag><version_major>3</version_major><version_extra>dev</version_extra><status>published</status><release_link>https://www.drupal.org/project/views/releases/7.x-3.x-dev</release_link><download_link>https://ftp.drupal.org/files/projects/views-7.x-3.x-dev.tar.gz</download_link><date>1491154383</date><mdhash>b8b158ae6a7c9f4e84540fbfcfa83ee3</mdhash><filesize>1643061</filesize><files><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.x-dev.tar.gz</url><archive_type>tar.gz</archive_type><md5>b8b158ae6a7c9f4e84540fbfcfa83ee3</md5><size>1643061</size><filedate>1491154383</filedate></file><file><url>https://ftp.drupal.org/files/projects/views-7.x-3.x-dev.zip</url><archive_type>zip</archive_type><md5>db78a5499cda151d5a352a908adf7e6b</md5><size>1913538</size><filedate>1491154383</filedate></file></files><security>Dev releases are not covered by Drupal security advisories.</security></release></releases>
</project>

In short:

You need to change the project update URL reported in the .info file of the module (e.g. http://domain.com)
The server, on http://domain.com/release-history/{project_name}/{drupal_version}, needs to return XML data that describe all the project versions available and compatible with the Drupal version reported as last part of the URL (for example 7.x for Drupal 7, 8.x for Drupal 8)


How can I connect to a CIFS/SMB share on a non-default port?

Question: I'm trying to get a contractor connected to a CIFS share (port 445).  He's not a big shop (so no go on using VPN).  His ISP blocks outgoing connections on port 445.
I've been doing some rsync to ftp madness as a workaround to have the share available to him, but it's getting out of control -- we're syncing nearly 40GB a day to an external ftp site and it's going to be much easier just to have him connect and only grab the stuff he needs.
So... I can have the CIFS share open to the internet (filtered to allow access to his IP only) on port 446.  How the heck can he connect to that?
I looked through "net use" and didn't see anything about using another port.
Answer: Short answer, use a VPN. I don't think even Samba would support this without changing the code.
Longer answer, use another method like WebDAV that can be securly run over the public internet (albeit don't try and use the internal Windows WebDAV client, I've not managed to make it work on XP or Win 7).
Comment: WebDAV or FTP will probably have to be the solution.  Thanks!
Answer: If you dont want to use a vpn, you can use an ubuntu pc or virtual machine as the client (this is free, jsut download vmplayer from vmware and you can even download pre-made vm's), and for the windows host no changes need to be made, however at your router do a port forward with translation. I translated 445 to 4450 and my client is my android phone using the paid for version of the app FX which i LOVE! I will let you know if i can configure ubuntu as a client but im sure its something easy like \server:port\share...
Also webdav does work using windows 7 sp1 builtin client IF you disable autodetect in your internet explorer settings under the connection tab. If you dont disable it, it will stall for 30 seconds per connection attempt and annoy you while it waits for autodiscover to time out in the background.


Criar contas de e-mail usando Postfix para enviar no WooCommerce

Question: Tenho um site hospedado na digitalocean. Configurei o servidor com o EasyEngine para instalação de PHP, MySQL, Nginx, Postfix, WordPress, etc.
Porém, meu WordPress não está enviando e-mail, e como trata-se de uma loja (WooCommerce), preciso dessa função. Então minha duvida é: Será que preciso criar uma conta de e-mail no postfix para poder configurar o SMTP lá no WordPress? Atualmente o e-mail da loja esta alocado no Google App.
Answer: Achei mais fácil usar o SwiftMailer pra enviar emails.
Uso esse código em produção:
$text = 'Olá Fulano';
$html = "Olá Fulano de Tal";

$message = Swift_Message::newInstance()
  ->setSubject('Assunto')
  ->setFrom(array('email@example.com' => 'Remetente'))
  ->setTo(array('email@example.com'))
  ->setBody($text)
  ->addPart($html, 'text/html')
;

$transport = Swift_SmtpTransport::newInstance('ssl://smtp.gmail.com', 465)
  ->setUsername('email@example.com')
  ->setPassword('senha')
;
$mailer = Swift_Mailer::newInstance($transport);
$result = $mailer->send($message);

if (!$result)
    http_response_code(500);

Comment: Acho que a idéia é "deixe quem entende de email cuidar do seu email". Dá pra fazer no braço? Dá. Mas, nossa, tem tanta outra coisa pra fazer :)


What is a theory and what is its extension

Question: As I understand, a theory is a set of sentences which are closed under some notion of deduction (i.e., applying deduction rules to the sentences of a theorem does not produce any new sentences) (wikipedia does not mention this notion of closure I think).
In practice, a theory is represented by a subset of its sentences called axioms  such that all other sentences in the theory are deducible starting from these axioms and using deduction rules. These axioms are actually a representation of a theory, but not the theory itself. Sentences other than axioms in a theory are called theorems.
My Questions:

1) Is what I presented as a definition of theories, axioms, and theorems in the above correct? (I want to make sure that the notion of closure in the sense I defined above is necessary for the definition of theory or it is not?)
2) If we add an axiom to our existing set of axioms in a theory, does this new axiom extend the theory or it restricts it, or it depends on the axiom?

By extension of a theory $T$, I mean getting $T'$ such that $T \subset T'$ and by restriction I mean getting $T'$ such that $T' \subset T$
Answer: 1) As we usually define them:

A theory $T$ is a set of sentences such that $\varphi \in T \Leftrightarrow T \vdash \varphi$ (derivability closure).
A set $\Gamma$ is the axiom set of a theory $T$ iff $T = \left\{ \varphi | \Gamma \vdash \varphi \right\}$
If $T \vdash \varphi$, we say that $\varphi$ is a theorem of $T$ (that is, axioms are 1-line theorems)

2) Suppose you add $\alpha \notin T$ to the axiom set of $T$. The result is then a new theory $T'$, such that $\varphi \in T' \Leftrightarrow T\cup\{\alpha\} \vdash \varphi$. It is easy to see that $T'$ extends $T$, since $T \subset T\cup\{\alpha\} \subseteq T'$.
Comment: @qartal Well, the property of *functional completeness* is usually said of a set of connectives, so that I don't really get what you mean by it. What you probably mean is if there is some algorithm to determine if an arbitrary subset $X \subseteq T$ is the axiom set of $T$. It's enough to check whether $X$'s deductive closure is identical to $T$, that is, if $X \vdash \varphi$, for every $\varphi \in T$. But if our theory is a (non-monotonic) first-order logic, we know there is no such a procedure to determine in general whether $T \vdash \varphi$ for any $\varphi$.
Comment: Regarding a second question, is there any technique to determine if a certain subset of a theory sentences is [functionally complete](http://en.wikipedia.org/wiki/Functional_completeness), in the sense that they can act as axioms for the theory. (This does not seem to be decidable in general, is it?)
Answer:
This is basically all correct, except that I regard axioms as theorems (they're theorems with 0-line proofs). Ergo, the theorems of $T$ are just the elements of $T$. This is kind of like how if $V$ is a vector space, then the vectors of $V$ are just the elements of $V$.
Adjoining a new axiom can never make the theory smaller, although it can potentially make it bigger.
In my opinion, we should try to refrain from speaking of "axioms", since the term is basically meaningless. Admittedly, I tend to violate this recommendation all the time. Anyway, the way I see it, there are sentences. A collection of sentences can entail another sentence. If you have a collection $S$ of sentences, we can write $\mathrm{cl}(S)$ for the collection of all sentences entailed by the sentences of $S$. In words, $\mathrm{cl}(S)$ is the theory generated by $S$. That is all; in particular, calling the elements of $S$ "axioms" gains us nothing. For some reason, however, it seems very difficult to refrain from calling things axioms.


JQuery - grab the td value next to radio button

Question: I have the following dilemma:
My HTML is as such (this exists within a PL/SQL app.):

<input type=radio name="pv_select" value="'||lv_spriden_id||'"/>
'||lv_spriden_id||'	'
'||lv_spriden_last_name||'
'||lv_spriden_first_name||'

I am able to get at the selected radio button value via:
$("input[name=pv_select]:checked").val()

However, I would like to be able to get the value of the "last_name" column cell (which exists within a table next to the radio button). How can I retrieve this value (for the selected row via the radio button) via jQuery?
I've tried several things, but none are working:
$("input[name=pv_select]:checked").parent().siblings("td:eq(1)").text());

Thanks in advance.
Comment: Maybe you can post the generated source, because your post doesn't make any sense.
Comment: Your html snippet doesn't look like html, what is it?
Comment: The HTML exists within a PL/SQL app
Answer: The HTML is invalid; not sure if that's mucking up your DOM tree, and thus confusing jQuery as it tries to traverse the broken DOM tree.
Here's valid HTML:

            <input type=radio name="pv_select" value="'||lv_spriden_id||'"/>

        '||lv_spriden_id||'
        '||lv_spriden_last_name||'
        '||lv_spriden_first_name||'

And jQuery to get the value of the "last name" table cell in the same row as the checked radio button:
$("input[name=pv_select]:checked").parent().siblings("td.c_last_name").text());

(I say the HTML is valid: values for the id attribute are meant to be unique within an HTML page, so if you have multiple rows using the same id attributes for the table cells, that's invalid too.)
Comment: Thanks! Fixing the HTML as suggested above solved the issue. This now works in both IE & Firefox. I didn't like referencing the item of interest via eq(). Referencing it via the class name (c_last_name) now works properly. Thanks for your help!
Answer: You selector works on a generic table with an input in td and last name text in another td
maybe your problem is that last name is declared after the submit, so you should try to modify the selector with
$("input[name=pv_select]:checked").parent().siblings("td:eq(0)").text();

where I just changed index of sibling (if I got your table dump correct, your .siblings("td:eq(1)") is First Name, eq(0) should be last name)
Just a suggestion..
EDIT
When you posted your html excerpt, I realized, that you don't need to check sibling elements of radio's parent. As its parent is tr and siblings of tr in table are just another table rows.
What you may consider is using traversing function .next() which moves to next element in the DOM
It's sad, that I cannot test this enough in FF (or just because Firebug / jquery ext.), but this is the code, you exactly asked for (get next element of radio input):
$('input[name="pv_select"]:checked').next();

the only problem is, that next element is font element, which I cannot seem to render properly in FF (and doesn't reside in the table row - it displays directly inside body in FireBug inspector), so .children() cannot find  or whatewer td you are trying to find
Comment: No - this doesn't work either. Regardless, I am not able to post the First Name nor the Last Name. I guess to better phrase my question (without getting into the unnecessary details): How can one via JQUERY grab the column cell next to the selected radio button? I.e., let's say we have: [radio button1] Column1_Value Column2_Value [radio button2] Column1_Value Column2_Value [checked radio button3] Column1_Value Column2_Value How can I grab the Column2_Value value of the *checked* (selected) radio button? (Note that all of the above is included within a table).
Comment: Meant to say: of the selected row (via the radio button). Once again, I am able to grab the radio button value.  Yet cannot grab the value of any of the cells next to the selected radio button.
Answer: I just realized that this works in Firefox, yet not in IE. Hence, I shall be analyzing what may be causing for this to fail in one browser and not the other.


Views: Show all terms of taxonomy with or without containing nodes

Question: I have a view which shows all terms of a specific taxonomy (pages). My terms have a relationship with containing nodes. My nodes are grouped by taxonomy terms.
I get this result with no date filter:
taxonomy term 1
    - node 1 (2016-06)
    - node 2 (2016-07)

taxonomy term 2
    - node 3 (2016-06)

taxonomy term 3

taxonomy term 4

taxonomy term 5

taxonomy term 6
    - node 4 (2016-06)

Problem
I have an exposed date filter to get nodes for different months. But when I use this filter (2016-06), my terms with no matching nodes are not shown in my result.
taxonomy term 1
    - node 1 (2016-06)

taxonomy term 2
    - node 3 (2016-06)

taxonomy term 6
    - node 4 (2016-06)

This is the result I'm looking for, when I use my date filter (2016-06):
taxonomy term 1
    - node 1 (2016-06)

taxonomy term 2
    - node 3 (2016-06)

taxonomy term 3

taxonomy term 4

taxonomy term 5

taxonomy term 6
    - node 4 (2016-06)

So my question is:
How can I show all taxonomy terms in my view with or without containing nodes, if my filter is active?

UPDATE
This is my generated SQL from views when my exposed filter is active. The second where condition removes my terms.
SELECT DISTINCT
    node_taxonomy_index.nid AS node_taxonomy_index_nid,
    taxonomy_term_data.name AS taxonomy_term_data_name,
    taxonomy_term_data.vid AS taxonomy_term_data_vid,
    taxonomy_term_data.tid AS tid,
    taxonomy_vocabulary.machine_name AS taxonomy_vocabulary_machine_name,
    'node' AS field_data_field_position_node_entity_type,
    'node' AS field_data_field_seite_node_entity_type,
    'node' AS field_data_field_sebepla_status_node_entity_type,
    'node' AS field_data_field_typ_node_entity_type,
    'node' AS field_data_field_ausgabenzeitraum_node_entity_type
FROM
    {taxonomy_term_data} taxonomy_term_data
LEFT JOIN {taxonomy_index} taxonomy_index
    ON taxonomy_term_data.tid = taxonomy_index.tid
LEFT JOIN {node} node_taxonomy_index
    ON taxonomy_index.nid = node_taxonomy_index.nid
LEFT JOIN {taxonomy_vocabulary} taxonomy_vocabulary
    ON taxonomy_term_data.vid = taxonomy_vocabulary.vid
LEFT JOIN {field_data_field_ausgabenzeitraum} node_taxonomy_index__field_data_field_ausgabenzeitraum
    ON node_taxonomy_index.nid = node_taxonomy_index__field_data_field_ausgabenzeitraum.entity_id AND
        (node_taxonomy_index__field_data_field_ausgabenzeitraum.entity_type = 'node' AND
        node_taxonomy_index__field_data_field_ausgabenzeitraum.deleted = '0')
WHERE
    (( (taxonomy_vocabulary.machine_name IN  ('sebepla_seiten')) AND
    (DATE_FORMAT(node_taxonomy_index__field_data_field_ausgabenzeitraum.field_ausgabenzeitraum_value, '%Y-%m') = '2016-06') ))

When I use following SQL, I get correct results:
SELECT DISTINCT
    node.nid AS node_taxonomy_index_nid,
    taxonomy_term_data.name AS taxonomy_term_data_name,
    taxonomy_term_data.vid AS taxonomy_term_data_vid,
    taxonomy_term_data.tid AS tid,
    taxonomy_vocabulary.machine_name AS taxonomy_vocabulary_machine_name,
    'node' AS field_data_field_position_node_entity_type,
    'node' AS field_data_field_seite_node_entity_type,
    'node' AS field_data_field_sebepla_status_node_entity_type,
    'node' AS field_data_field_typ_node_entity_type,
    'node' AS field_data_field_ausgabenzeitraum_node_entity_type
FROM
    taxonomy_term_data
LEFT JOIN taxonomy_index taxonomy_index
    ON taxonomy_term_data.tid = taxonomy_index.tid
LEFT JOIN
    (
        SELECT
            node.nid
        FROM
            field_data_field_ausgabenzeitraum node_taxonomy_index__field_data_field_ausgabenzeitraum,
            node
        WHERE
            node.nid = node_taxonomy_index__field_data_field_ausgabenzeitraum.entity_id AND
            node_taxonomy_index__field_data_field_ausgabenzeitraum.entity_type = 'node' AND
            node_taxonomy_index__field_data_field_ausgabenzeitraum.deleted = '0' AND
            DATE_FORMAT(node_taxonomy_index__field_data_field_ausgabenzeitraum.field_ausgabenzeitraum_value, '%Y-%m') = '2016-06'
    ) node ON taxonomy_index.nid = node.nid
LEFT JOIN
    taxonomy_vocabulary taxonomy_vocabulary
        ON taxonomy_term_data.vid = taxonomy_vocabulary.vid
WHERE (( (taxonomy_vocabulary.machine_name IN  ('sebepla_seiten')) ))

Now my new question:
How to implement this query in views? I know that hook_views_query_alter is the key. If someone could explain how to write a left join select with my conditions I've used in views object query, it would help me a lot! :)
Comment: `How can I show all taxonomy terms in my view with or without containing nodes, if my filter is active?` might as well leave it unfiltered...
Comment: Hi. I think you should do that programmatically... Is that an option for you?
Comment: Yeah this is an option for me. But I don't know where to start. I'll update my question.
Comment: There's a slight logical error/priority conflict here: `"I want to show a filtered taxonomy list, but I want to show ALL items!"`.
Comment: I've updated the question. Hope my question is now clear. :)
Comment: @Huelfe, Check an example [here](http://stackoverflow.com/a/25210970/377342) to add left join to your view display. Hope this help.
Answer: From looking at your SQL, it looks like you're trying to build a LEFT JOIN off a subquery. This is one of those cases where you really have to get into in internals of views.
There're a few components you're looking at here:

Building a db_select() subquery that you're joining.
Utilizing views_join() to build the join to the view.
Using views_plugin_query_default::add_table() to insert your joined subquery table into the view.

An incomplete example would look something like this:
function mymodule_views_query_alter(&$view, &$query) {
  //$query->addJoin(j)

  // Build subquery to match expression
  $sub_query = db_select('field_data_field_ausgabenzeitraum', 'node_taxonomy_index__field_data_field_ausgabenzeitraum');
  $sub_query->fields('n', array('nid'));

  // INNER JOIN is the same as "SELECT * FROM table1, table2"
  $sub_query->addJoin('INNER', 'node', 'n');
  $sub_query->conditions('n.nid', 'node_taxonomy_index__field_data_field_ausgabenzeitraum.entity_id');
  // @TODO: Add Remaining Conditions & utilize addExpression() for DATE_FORMAT()

  // Build subquery JOIN.
  $join = new views_join();
  $join->type = 'LEFT';
  $join->definition = array('table formula' => $sub_query);
  $join->left_table = 'taxonomy_index';
  $join->left_field = 'nid';
  $join->field = 'nid';

  // Add the joined subquery table
  $query->add_table('node', NULL, $join, 'node');
}

Comment: Thank you for this answer! Now I get the correct results. :)


Encontrar determinado texto em uma string

Question: Olá estou com uma duvida.
nome=str(input('Qual o seu nome completo?'))
print('Seu nome tem Enzo?{}'.format('Enzo' in nome.lower()))

Tenho esse código que ele verifica sem tem uma determinada string dentro da outra,o problema é eu quero que ele verifique sem tem um determinado nome dentro do texto em que eu digitar e faça uma determinada ação.Ex:Ver se tem a palavra "Enzo" e se tiver escrever algo na tela.
Comment: Parece ser o caso de [marcar uma resposta como aceita](http://meta.pt.stackoverflow.com/questions/1078/). Aqui não escrevemos "resolvido" na questão. Se tem uma resposta que realmente te ajudou, marque-a como aceita. Se chegou sozinho à solução, poste a solução como resposta. Assim o conteúdo fica mais organizado e fácil de ser encontrado futuramente por outras pessoas com problemas parecidos.
Answer: Seu código possui duas considerações importantes que não foram abordadas, de forma satisfatória, nas outras respostas.
1) Redundância na função input. Se você ler a documentação oficial da função, verá o seguinte trecho (adaptado):

The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that.

Isto é, o retorno da função sempre será uma string, independente do conteúdo lido. Assim, fazer str(input(...)) é inserir redundância no código e efetuar uma¹ chamada desnecessária a mais.
2) Sensível à caixa do texto. A comparação que você fez foi 'Enzo' in nome.lower() e ela jamais será válida, pois você está, basicamente, buscando uma string com caracteres maiúsculos em uma string que é composta, certamente, apenas por caracteres minúsculos, visto que utilizou o método lower(). Seria o mesmo que buscar o número 7 em um conjunto de números pares. A lógica está certa, mas falhou na implementação.
Dito isso, seu código basicamente seria:
nome = input('Qual é o seu nome completo?')
print('Seu nome tem Enzo? {}'.format('Enzo' in nome))

Veja funcionando no Repl.it | Ideone | GitHub GIST
Porém, isso produziria uma saída tal como:
Seu nome tem Enzo? True
Seu nome tem Enzo? False

É estranho ter True ou False em meio à uma string em português. Pelo menos eu acho. Faria mais sentido para mim aparecer "sim" ou "não", e para isso, bastaria fazer:
nome = input('Qual é o seu nome completo?')
tem_enzo = 'Sim' if 'Enzo' in nome else 'Não'

print(f'Seu nome tem Enzo? {tem_enzo}')

Veja funcionando no Repl.it | Ideone | GitHub GIST
Para fazer a verificação que não seja sensível à caixa, basta você utilizar o método lower, mas tomando o cuidado de buscar por uma string composta apenas por caracteres minúsculos, tal como em:
'enzo' in nome.lower()

Nota: vale lembrar que este método pode não ser inteiramente eficiente, visto que retornaria como verdadeiro caso o nome do usuário fosse Lorenzo, pois possui 'enzo' no nome. Se for interesse verificar apenas pelo termo completo, a solução seria outra.

¹ : Não é apenas uma chamada, visto que str é uma classe nativa do Python, não uma função. O que acontece, neste caso, é a chamada do construtor.
Comment: Se for Python2 o `input` acaso receber um numero poderá fazer o cast não? Claro que se for mesmo python2 seria interessante usar `raw_input`. Sei que parece estranho, mas ainda existem usuários da versão 2
Comment: +1 principalmente pela parte sobre o case-sensitive.
Answer: Você pode usar o if para isso, ficaria mais ou menos assim
nome=str(input('Qual o seu nome completo?'))

if("Enzo" in nome):
    print("A string tem o nome Enzo")
else:
    print("A string não tem o nome Enzo")

Desta forma acima será sempre case sensitive, para ignorar isso tem essa outra opção
import re

nome=str(input('Qual o seu nome completo? '))

if re.search('enzo', nome, re.IGNORECASE):
    print("A string tem o nome Enzo")
else:
    print("A string não tem o nome Enzo")

Answer: Uma sugestão para com regex seria usar o meta-caractere \b, exemplo:
import re

nome = input('Qual o seu nome completo? ')

if re.search('\\benzo\\b', nome, re.IGNORECASE):
    print("A string tem o nome Enzo")
else:
    print("A string não tem o nome Enzo")

O \b é um meta-caractere que usado para encontrar uma correspondência no início ou no final de uma palavra, evitando assim que que palavras como:

enzon
fenzo

Se rodar em:
import re

print( re.search('enzo', 'enzon', re.IGNORECASE) ) # retorna <_sre.SRE_Match object; span=(0, 4), match='enzo'>
print( re.search('enzo', 'fenzo', re.IGNORECASE) ) # retorna <_sre.SRE_Match object; span=(0, 4), match='enzo'>
print( re.search('enzo', 'cheetos', re.IGNORECASE) ) # retorna None

Agora usando o \b note como funciona:
import re

print( re.search('\\benzo\\b', 'enzon', re.IGNORECASE) ) # retorna None
print( re.search('\\benzo\\b', 'fenzo', re.IGNORECASE) ) # retorna None
print( re.search('\\benzo\\b', 'cheetos', re.IGNORECASE) ) # retorna None

print( re.search('\\benzo\\b', 'enzo foo bar', re.IGNORECASE) ) # retorna <_sre.SRE_Match object; span=(0, 4), match='enzo'>
print( re.search('\\benzo\\b', 'foo enzo bar', re.IGNORECASE) ) # retorna <_sre.SRE_Match object; span=(4, 8), match='enzo'>

O meta-caractere \b é uma verdadeira mão na roda para evitar tais problemas.
Answer: Olá,
Para verificar ocorrências em uma string, você pode usar o count(), que contabiliza quantas vezes determinada substring é encontrada em uma string. Veja:
nome=input("Qual o seu nome completo?")

if(nome.count("Enzo")):
    print("A string tem o nome Enzo")
else:
    print("A string não tem o nome Enzo")


Executing update using Anorm returns PSQLException: The column index is out of range: 2, number of columns: 1

Question: I have been trying to execute an update query for my PostgreSQL database using Anorm with Play Framework 2.6 in Scala. The query works fine in pgAdmin so I am not sure what is going wrong here. I only want to update a specific column of an entry. The wordlistcollection table holds 3 columns: id, title and createddate.
I have tried using both execute() and executeUpdate() as well as adding all required columns but without any success.
override def update(wordListCollection: WordListCollection): Int = db.withConnection { implicit c =>
    SQL"""
      UPDATE wordlistcollection
      SET title = '${wordListCollection.title}'
      WHERE id = ${wordListCollection.id};
    """.executeUpdate()
  }

EDIT: I've also tried this approach, same result
override def update(wordListCollection: WordListCollection): Int = db.withConnection { implicit c =>
    SQL"""
      UPDATE wordlistcollection
      SET title = {title}
      WHERE id = {id}
    """
    .on(
        "id" -> wordListCollection.id,
        "title" -> wordListCollection.title)
    .executeUpdate()
  }

According to the executeUpdate() function it should return the number of rows affected as Integer, but it returns the following:
! @7c21ckgga - Internal server error, for (PUT) [/api/lists] ->

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[PSQLException: The column index is out of range: 3, number of columns: 2.]]
    at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:251)
    at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:178)
    at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:382)
    at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:380)
    at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:412)
    at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
    at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
    at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
Caused by: org.postgresql.util.PSQLException: The column index is out of range: 3, number of columns: 2.
    at org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:65)
    at org.postgresql.core.v3.SimpleParameterList.setBinaryParameter(SimpleParameterList.java:132)
    at org.postgresql.jdbc.PgPreparedStatement.bindBytes(PgPreparedStatement.java:983)
    at org.postgresql.jdbc.PgPreparedStatement.setLong(PgPreparedStatement.java:279)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setLong(HikariProxyPreparedStatement.java)
    at anorm.ToStatementPriority0$longToStatement$.set(ToStatementMisc.scala:197)
    at anorm.ToStatementPriority0$longToStatement$.set(ToStatementMisc.scala:196)
    at anorm.DefaultParameterValue.set(ParameterValue.scala:40)
    at anorm.SimpleSql.$anonfun$unsafeStatement$3(SimpleSql.scala:84)
    at anorm.SimpleSql.$anonfun$unsafeStatement$3$adapted(SimpleSql.scala:84)

I think it has something to do with the returned ResultSet, but I am quite a beginner so no idea how to debug this.
Thanks for your help!
Comment: There is a misuse of Anorm interpolation, as it interpolate values safely as JDBC parameters, not as string as plain interpolation, so as for any `PreparedStatement` quotes not be specified manually (... around `wordListCollection.title`). Also `;` must never be there (as for any JDBC `PreparedStatement`)
Comment: Alright, I did that but it does not fix the problem @cchantep
Comment: Indicate the complete trace of the root exception `org.postgresql.util.PSQLException`, there only the message is given
Comment: Added full stack trace
Answer: So, turns out I did two things wrong.
As @cchantep pointed out, there should not be single quotes surrounding a string when using string interpolation for building up your SQL queries. Removing these quotes fixed the problem.
 override def update(wordListCollection: WordListCollection): Int = db.withConnection { implicit c =>
    SQL"""
      UPDATE wordlistcollection
      SET title = ${wordListCollection.title}
      WHERE id = ${wordListCollection.id}
    """
    .executeUpdate()
  }

Weirdly the approach using
override def update(wordListCollection: WordListCollection): Int = db.withConnection { implicit c =>
    SQL"""
      UPDATE wordlistcollection
      SET title = {title}
      WHERE id = {id}
    """
    .on(
        "id" -> wordListCollection.id,
        "title" -> wordListCollection.title)
    .executeUpdate()
  }

Did not work, it gave me another exception.
Comment: Keep it simple, either use `SQL(..)` function with `{placeholder}`s, or Anorm interpolation `SQL".."`, mixing add useless complexity (and unpredicatable result according the target JDBC driver).


Longest IPv6 prefix match

Question: We are trying to implement a lngest prefix match of IPv6 addresses. What is the best way to represent IPv6 addresses to perform this computation (Longest Prefix match) efficiently.
IPv6 addresses are usually represented in Array[Byte]. (IPv6 addresses are usually represented in Array[Byte] [16]).
And to find a longest prefix match we need to convert the addresses to BitSet (or some sort of array representation of bits) and then find out the longest prefix.
New to this level of stack, and wondering if there is anything I am missing.
Any pointers that would help me move in right direction is highly appreciated.
FYI, this is on Scala. (So any JVM related pointers would be helpful)
Answer: If you just keep your original two arrays and scan down the bytes with a while-loop until they're non-identical, you should be about as fast as you can be.  Once you get a hit, if you want to know what bit it is, use
java.lang.Integer.numberOfLeadingZeros((a[i] << 24) ^ (b[i] << 24))

to count how many bits within the ith index (assuming a and b are your arrays) match.
One could think about converting to a larger numeric type like Long first, but typically you'll take as much time doing the conversion as you will to find the match, so unless you have a bunch more bitwise math to do on the addresses, you may as well keep it as bytes.

Longest IPv6 prefix match


Node.js passport-facebook callback looping

Question: I'm using passport-facebook to login my users and i´m getting into undefined loop when facebook calls myt callback. I have read lot of sites and question, even here, but really, i cant find any solution.
Here is the code, I´m going to put it all here, like it were into une single file:
var restify = require('restify');
var passport = require('passport-restify');
var FacebookStrategy = require('passport-facebook').Strategy;

var server = restify.createServer();
server.use(restify.bodyParser());

passport.use(new FacebookStrategy({
  clientID: 'APP_ID',
  clientSecret: 'APP_SECRET',
  callbackURL: 'http://192.168.0.13:8080/login/facebook/callback'
  }, function (token, refreshToken, profile, done) {
        //this code never is executed, why?
        return done(null, profile);
  }));

server.use(passport.initialize());

server.get('/login/facebook', function(req, res, next) {
    passport.authenticate('facebook', { display: null, scope: ['email']})(req, res, next);
});

server.get('/login/facebook/callback', (req, res, next) => {
        //here is where the loop happends, i´m getting into this and never can go out from here
        passport.authenticate('facebook', function(profile) {
            //I could not execute this
            if (!profile || !profile.id) {
                return res.json(500, 'We had trouble signing you up with Facebook. Please try again or sign-up via email.');
            } else {
                res.json(200, profile);
            }
        })(req, res, next);
});

server.listen(config.port, function () {
  console.log('%s listening at %s', server.name, server.url);
});

Really, i'm very frustrated, i now, i now, there are thousands of post talking about that... I tried all of them, i'm here anyway...
Thanks.
Comment: Could you showing your serialize / deserialize functions ?
Comment: passport.serializeUser(function (profile, done) {
  done(null, profile);
});

passport.deserializeUser(function (profile, done) {
  done(null, profile);
});
Comment: inside the serializeUser try to replace this `done(null, profile)` by this `done(null, profile.id)`
Comment: I got the same result... an infinite loop in the same line. Thanks very much
Comment: Your server running on nginx ?
Comment: No no, i'm just running on restify (express). Here is my package.json (i've avoided what i thinks we dont need this time...)

  "engines": {
    "node": "0.8.x"
  },
  "dependencies": {
    "crypto-js": "^3.1.6",
    "jsonwebtoken": "^7.1.7",
    "node-fetch": "^1.6.0",
    "passport-facebook": "^2.1.1",
    "passport-google": "^0.3.0",
    "passport-google-oauth": "^1.0.0",
    "passport-google-oauth2": "^0.1.6",
    "passport-local": "^1.0.0",
    "passport-restify": "^1.0.1",
    "restify": "4.1.x",
    "restify-jwt": "^0.4.0"
  },
Comment: I got the same error once time ago this was because my callbackUrl was bad. I set the port :8080 then I removed it because I have a proxy pass on my server and it works but it is not your case apparently. Have you tried to use the old syntax for anonymous functions ? Remove the => as you did on your other functions. `function(req, res, next){`
Comment: I tried what John suggested to me, but the problem is still there
Answer: I found the problem after a little while. What i've posted was the result of multiple test.
The problem was i was using in a bad way the parhentesis.
Being simplest, I was doing this:
server.get('/login/facebook/callback', passport.authenticate('facebook', (req, res, next) => { /* magic here*/ });

So, the callback for next() execution was passed like it was into the authenticate method. This was not because I didn't understand the problem, It was just I didn't realize where the error was.
The correct way should be:
server.get('/login/facebook/callback', passport.authenticate('facebook'), (req, res, next) => { /* magic here */ });

Thanks everybody for cooperating.


Write multi-line secret to windows runner in GitHub workflow

Question: Summary
What specific syntax must be changed in the code below in order for the multi-line contents of the $MY_SECRETS environment variable to be 1.) successfully written into the C:\\Users\\runneradmin\\somedir\\mykeys.yaml file on a Windows runner in the GitHub workflow whose code is given below, and 2.) read by the simple Python 3 main.py program given below?
PROBLEM DEFINITION:
The echo "$MY_SECRETS" > C:\\Users\\runneradmin\\somedir\\mykeys.yaml command is only printing the string literal MY_SECRETS into the C:\\Users\\runneradmin\\somedir\\mykeys.yaml file instead of printing the multi-line contents of the MY_SECRETS variable.
We confirmed that this same echo command does successfully print the same multi-line secret in an ubuntu-latest runner, and we manually validated the correct contents of the secrets.LIST_OF_SECRETS environment variable.  ...  This problem seems entirely isolated to either the windows command syntax, or perhaps to the windows configuration of the GitHub windows-latest runner, either of which should be fixable by changing the workflow code below.
EXPECTED RESULT:
The multi-line secret should be printed into the  C:\\Users\\runneradmin\\somedir\\mykeys.yaml file and read by main.py.
The resulting printout of the contents of the C:\\Users\\runneradmin\\somedir\\mykeys.yaml file should look like:
***
***
***
***

LOGS THAT DEMONSTRATE THE FAILURE:
The result of running main.py in the GitHub Actions log is:
ccc item is:  $MY_SECRETS

As you can see, the string literal $MY_SECRETS is being wrongly printed out instead of the 4 *** secret lines.
REPO FILE STRUCTURE:
Reproducing this error requires only 2 files in a repo file structure as follows:
.github/
    workflows/
        test.yml
main.py

WORKFLOW CODE:
The minimal code for the workflow to reproduce this problem is as follows:
name: write-secrets-to-file
on:
  push:
    branches:
      - dev
jobs:
  write-the-secrets-windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - shell: python
        name: Configure agent
        env:
          MY_SECRETS: ${{ secrets.LIST_OF_SECRETS }}
        run: |
          import subprocess
          import pathlib
          pathlib.Path("C:\\Users\\runneradmin\\somedir\\").mkdir(parents=True, exist_ok=True)
          print('About to: echo "$MY_SECRETS" > C:\\Users\\runneradmin\\somedir\\mykeys.yaml')
          output = subprocess.getoutput('echo "$MY_SECRETS" > C:\\Users\\runneradmin\\somedir\\mykeys.yaml')
          print(output)
          os.chdir('D:\\a\\myRepoName\\')
          mycmd = "python myRepoName\\main.py"
          p = subprocess.Popen(mycmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
          while(True):
            # returns None while subprocess is running
            retcode = p.poll()
            line = p.stdout.readline()
            print(line)
            if retcode is not None:
              break

MINIMAL APP CODE:
Then the minimal main.py program that demonstrates what was actually written into the C:\\Users\\runneradmin\\somedir\\mykeys.yaml file is:
with open('C:\\Users\\runneradmin\\somedir\\mykeys.yaml') as file:
  for item in file:
    print('ccc item is: ', str(item))
    if "var1" in item:
      print("Found var1")

STRUCTURE OF MULTI-LINE SECRET:
The structure of the multi-line secret contained in the secrets.LIST_OF_SECRETS environment variable is:
var1:value1
var2:value2
var3:value3
var4:value4

These 4 lines should be what gets printed out when main.py is run by the workflow, though the print for each line should look like *** because each line is a secret.
Comment: You should narrow down the problem and write a minimal test code. This is not useful(You didn't even specify the python version).
Comment: I'm investigating why this `output = subprocess.getoutput('echo "$MY_SECRETS" > C:\\Users\\runneradmin\\somedir\\mykeys.yaml')` isn't working but I think doing `MY_SECRETS=os.getenv("MY_SECRETS")` and then doing  `output =subprocess.getoutput('echo "{}" > C:\\Users\\runneradmin\\somedir\\mykeys.yaml').format(MYSECRETS)` will work
Comment: @relent95 Two other users were able to meet the requirements specified by this OP.  Also, this OP has had a python3 tag from the beginning.
Answer: The problem is - as it is so often - the quirks of Python with byte arrays and strings and en- and de-coding them in the right places...
Here is what I used:
test.yml:
name: write-secrets-to-file
on:
  push:
    branches:
    - dev
jobs:
  write-the-secrets-windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - shell: python
        name: Configure agent
        env:
          MY_SECRETS: ${{ secrets.LIST_OF_SECRETS }}
        run: |
          import subprocess
          import pathlib
          import os
          # using os.path.expanduser() instead of hard-coding the user's home directory
          pathlib.Path(os.path.expanduser("~/somedir")).mkdir(parents=True, exist_ok=True)
          secrets = os.getenv("MY_SECRETS")
          with open(os.path.expanduser("~/somedir/mykeys.yaml"),"w",encoding="UTF-8") as file:
              file.write(secrets)
          mycmd = ["python","./main.py"]
          p = subprocess.Popen(mycmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
          while(True):
              # returns None while subprocess is running
              retcode = p.poll()
              line = p.stdout.readline()
              # If len(line)==0 we are at EOF and do not need to print this line.
              # An empty line from main.py would be '\n' with len('\n')==1!
              if len(line)>0:
                # We decode the byte array to a string and strip the
                # new-line characters \r and \n from the end of the line,
                # which were read from stdout of main.py
                print(line.decode('UTF-8').rstrip('\r\n'))
              if retcode is not None:
                  break

main.py:
import os
# using os.path.expanduser instead of hard-coding user home directory
with open(os.path.expanduser('~/somedir/mykeys.yaml'),encoding='UTF-8') as file:
    for item in file:
        # strip the new-line characters \r and \n from the end of the line
        item=item.rstrip('\r\n')
        print('ccc item is: ', str(item))
        if "var1" in item:
            print("Found var1")

secrets.LIST_OF_SECRETS:
var1: secret1
var2: secret2
var3: secret3
var4: secret4

And my output in the log was
ccc item is:  ***
Found var1
ccc item is:  ***
ccc item is:  ***
ccc item is:  ***

Answer: Edit: updated with fixed main.py and how to run it.
You can write the key file directly with Python:
      - shell: python
        name: Configure agent
        env:
          MY_SECRETS: ${{ secrets.LIST_OF_SECRETS }}
        run: |
          import os
          import pathlib
          pathlib.Path('C:\\Users\\runneradmin\\somedir\\').mkdir(parents=True, exist_ok=True)
          with open('C:\\Users\\runneradmin\\somedir\\mykeys.yaml', 'w') as key_file:
            key_file.write(os.environ['MY_SECRETS'])
      - uses: actions/checkout@v3
      - name: Run main
        run: python main.py

To avoid newline characters in your output, you need a main.py that removes the newlines (here with .strip().splitlines()):
main.py
with open('C:\\Users\\runneradmin\\somedir\\mykeys.yaml') as file:
    for item in file.read().strip().splitlines():
        print('ccc item is: ', str(item))
        if "var1" in item:
            print("Found var1")

Here's the input:
LIST_OF_SECRETS = '
key:value
key2:value
key3:value
'

And the output:
ccc item is:  ***
Found var1
ccc item is:  ***
ccc item is:  ***
ccc item is:  ***

Here is my complete workflow:
name: write-secrets-to-file
on:
  push:
    branches:
      - master
jobs:
  write-the-secrets-windows:
    runs-on: windows-latest
    steps:
      - shell: python
        name: Configure agent
        env:
          MY_SECRETS: ${{ secrets.LIST_OF_SECRETS }}
        run: |
          import os
          import pathlib
          pathlib.Path('C:\\Users\\runneradmin\\somedir\\').mkdir(parents=True, exist_ok=True)
          with open('C:\\Users\\runneradmin\\somedir\\mykeys.yaml', 'w') as key_file:
            key_file.write(os.environ['MY_SECRETS'])
      - uses: actions/checkout@v3
      - name: Run main
        run: python main.py

Also, a simpler version using only Windows shell (Powershell):
      - name: Create key file
        env:
          MY_SECRETS: ${{ secrets.LIST_OF_SECRETS }}
        run: |
          mkdir C:\\Users\\runneradmin\\somedir
          echo "$env:MY_SECRETS" > C:\\Users\\runneradmin\\somedir\\mykeys.yaml
      - uses: actions/checkout@v3
      - name: Run main
        run: python main.py

Answer: I tried the following code and it worked fine :
LIST_OF_SECRETS
key1:val1
key2:val2

Github action (test.yml)
name: write-secrets-to-file
on:
  push:
    branches:
      - main
jobs:
  write-the-secrets-windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - shell: python
        name: Configure agentt
        env:
          MY_SECRETS: ${{ secrets.LIST_OF_SECRETS }}
        run: |
          import base64, subprocess, sys
          import os
          secrets = os.environ["MY_SECRETS"]

          def powershell(cmd, input=None):
              cmd64 = base64.encodebytes(cmd.encode('utf-16-le')).decode('ascii').strip()
              stdin = None if input is None else subprocess.PIPE
              process = subprocess.Popen(["powershell.exe", "-NonInteractive", "-EncodedCommand", cmd64], stdin=stdin, stdout=subprocess.PIPE)
              if input is not None:
                  input = input.encode(sys.stdout.encoding)
              output, stderr = process.communicate(input)
              output = output.decode(sys.stdout.encoding).replace('\r\n', '\n')
              return output

          command = r"""$secrets = @'
          {}
          '@
          $secrets | Out-File -FilePath .\mykeys.yaml""".format(secrets)

          command1 = r"""Get-Content -Path .\mykeys.yaml"""

          powershell(command)
          print(powershell(command1))

Output
***
***

As you also mention in the question, Github will obfuscate any printed value containing the secrets with ***
EDIT : Updated the code to work with multiple line secrets. This answer was highly influenced by this one
Comment: Okay, this doesn't work with multiple line secrets. Seems like a powershell issue fixing it now.
Comment: @CodeMed I updated the answer to work for multiple lines. Yes it may sound a bit weird having to encode the powershell commands into base64 before executing them, but this solved all the formatting/encoding issues between Python and Powershell that I encondered trying to use powershell's here string. As to why we are stating powershell in the command, we have to because we are overriding Action's default shell with Python and then the shell it opens is cmd.
Comment: Your code does not call `main.py` as specified in the OP.  Your code breaks when we use it to call `main.py`
Answer: You need to use yaml library:
import yaml

data = {'MY_SECRETS':'''
var1:value1
var2:value2
var3:value3
var4:value4
'''}#add your secret

with open('file.yaml', 'w') as outfile: # Your file
    yaml.dump(data, outfile, default_flow_style=False)

This is result:

I used this.
Comment: This works only if you have access to `C:\\Users\\runneradmin\\somedir\\mykeys.yaml`.
Comment: Can you please test your code on an actual GitHub workflow calling a runner with `windows-latest` as the OP specifies?  Your code does not work in the environment specified in the OP.  It only takes a few minutes to set up the minimal example from the OP in a new GitHub repository if you have a free GitHub account.


What could cause an iOS App to quit unexpectedly?

Question: I am developing an iOS app and testing its stability. There are no memory leak issues when I check it using XCode Analyze. I simulated on my iPhone 5 and iPad 2 and tried clicking buttons and flipping the UIScrollView continuously as fast as I could.
The debug log did show a "received memory warning" message several times but still no message about memory leaks. I keep doing the crazy testing and the app quits unexpectedly. I can still find the app running in background when I double click the "home" button. After I click back to the app, it can still run normally.
Therefore, here I would like to know what possible reasons would cause the app to quit unexpectedly. How might I trace the reason for the app quitting, using any tools or tactics?
PS: I am a new iOS developer and I really have no ideas about this issue. I need some help. Thank you!
Comment: Have you tested with Instruments? That's the debugging tool Apple provides.
Answer: There is a difference between leaked memory - which is memory you've allocated that you cannot give back to the system because you've lost the pointer to the memory and you can't release it. And then there is poorly using memory - which is where you allocate memory. It's not "leaked" because you can give it back, but you don't give it back.
Consider the example of creating 100 of images.
If you create 100 image views even though they are not all visible, but you keep references to the image views, then you don't have a leak, but you haven't managed you memory properly.
The static analyser helps you find leaks - it doesn't tell you where you are using memory badly.
Try running your app under Instruments with the allocations tool to see where all the memory is being created and used.
Comment: Thank you. I will try Instruments with the allocations tool to trace. Btw, what is a proper memory allocation for your 100 image views case?
Comment: The proper way in this case is to release the imageview when it is no longer being shown.
Comment: Thank you, Abizern. Is it the proper way that I set the object of UIImageView to nil after the UIImageView object added into current view (if using ARC)? I would like to know can the memory exactly drop to previous memory size. For example, are the memory usages of initialization, object creation and object destruction 1mb, 1.5mb and then 1mb again?
Answer: A lot of causes would cause iOS app quit suddenly. For example, you have updated your iPhone firmware but the app is still the old version, then they would be not compatible.
Or you opened too many apps simultaneously and the apps get distracted each other.
And another common situation is that you have jailbroken your iPhone, and installed unauthorized app on your iPhone.
Check more here: http://iphone-6-data-recovery.blogspot.tw/2014/09/troubleshooting-iphone-app-quit-suddenly.html


Fitch natural deduction proof of $\forall x F(x) \lor \forall x G(x) \vdash \forall x (F(x) \lor G(x))$

Question: I'm going through old exam papers and I found this question regarding the universal quantifier:

Now this seems to be very obvious, but I just can't get it right. Doing similar proofs with the existential quantifier seems easy, but this one just gets me. This is how I translated the question to the natural deduction site:

Thanks a lot in advance.
EDIT:
I think I figured it out. I had the right idea but just didn't execute it correctly with the given tool. Thanks @lemontree for all of your assistance.
Comment: As a little exercise on the rules for $\forall$ and $\exists$, once you have completed the proof of $\forall x F(x) \lor \forall x G(x) \vdash \forall x (F(x) \lor G(x))$, try to think of why (in terms of natural deduction rules, not just semantics) the reverse direction is not possible, i.e. why we have $\forall x (F(x) \lor G(x)) \not \vdash \forall x F(x) \lor \forall x G(x)$.
Answer: Hint: The "hourglass strategy" mentioned my answer to your other question applies to quantifiers just as well:
If you want to work linearly from the top to the conclusion, work your way through the premises from the outside to the inside by destructing them with elimination rules for the operators that occur in the premise, starting with an elimination rule for the main (= outermost) operator of the premise formula, until you disassembled them to minimally complex formulas. Then work your way towards the conclusion by constructing it from the inside out from the pieces you got by using introduction rules, the last one of which will be the main (= outermost) operator of the conclusion formula.
Here, this means: First get rid of the disjunction, then of the $\forall$'s, at which  point you arrive at atomic formulas (this also means that your $Fa$ and $Ga$ will not be assumptions, as in the screenshot of your attempt, but derived from other (sub)formulas); then assemble them back together, first by introducing the disjunction, then the universal quantifier.
Often it is easier to start a proof from its conclusion, to see which sub-formulas are needed to be derived from the premises, in which case you use a kind of bottom-up-top-down strategy:
First un-do introduction rules on the conclusion formulas until you can no further disassemble them (or until it makes no more sense to do so), then try to meet in the middle by working your way down from the premises.
Here, this means: Apply backwards the introduction of the universal quantifier from the conclusion, then the introduction of the disjunction. Now try to see how you can arrive at the atoms you reconstructed given the form of the premises. This is where you will have to start working to-down again, disassembling the premises by use of elimination rules to meet the the second half of the proof in the middle.
Comment: Thanks for all of the hints so far @lemontree...it pains me to say but I actually cannot get to the bottom of this one. I've tried everything but I keep getting errors when introducing the universal quantifier at the end. I do need some more "spoonfed" help to just get this monkey off my back. Sorry and thank you!


Group of matrix isomorphism

Question: I have 2 groups:

general linear $ k  \times k $ with $\cdot$
top-triangle matrix $ n \times n $ with 1 on main diagonal. Operation is $\cdot$ too

Is there isomorphism for any any non-trivial $n,k$ i.e $n \neq 2 \ or \  k \neq 1$ over $\mathbb{R}$ or $\mathbb{Q}$?
If no, how can I prove it?
Comment: Upper-triangular matrices form solvable groups, general linear groups are not solvable (for $k>1$). Thus they cannot be isomorphic.
Comment: Did you intend $\mathbb{N}$ to be the set of integers? natural numbers?
Comment: @BillCook, I mixed it up with $\mathbb{Q}$, fixed now
Answer: Upper-triangular matrices form solvable groups, general linear groups are not solvable (for $k>1$). Thus they cannot be isomorphic.
Comment: Upper triangular matrix groups with 1 on the main diagonal are even nilpotent.
Answer: Another reason is that if the field is of characteristics $0$ then all elements (except the identity matrix) in the set upper triangle matrix with 1 on the main diagonal do not have finite order. However, there are lots of matrix in $ GL_k(F)$ has finite order. For instance, those have $-1$ or $1$ on the main diagonal and $0$ elsewhere.
However, this argument doesn't work for fields of finite characteristics.

Group of matrix isomorphism


$A$ is Positive Definite iff $B=\frac{1}{2}\left(A+A^{\mathrm{T}}\right)$ is positive definite

Question: While studying Symmetric matrices for my nonlinear optimization class, I encountered the following problem:
Problem:
Suppose that $A$ is an arbitrary real square matrix. Show that $\mathbf{x}^{T} A \mathbf{x}>0$ for all $\mathbf{x} \neq \mathbf{0}$ if and only if the symmetric matrix $$B=\frac{1}{2}\left(A+A^{\mathrm{T}}\right)$$ is positive definite.
Definitions/Observations:

Suppose that $A$ is an $n \times n$ symmetric matrix. We say that $A$ is positive definite if $z^{T}Az > 0$ for all $z \in \mathbb{R}^{n}.$

For the other direction of the statement I was trying something very very similar, but it did not work either.

Related questions: Prove that a square matrix $A$ is positive definite if and only if $A$+ $A^T$ is positive definite
and
Is $A$ positive definite iff $\dfrac{A + A^H}{2}$ positive definite?. One of them is a slightly different version, where the $\frac{1}{2}$ term does not appear. The other question regards the complex case, but for the sake of completeness I thought it should be nice to include!

Attempt:
I am trying to prove that if $B=\frac{1}{2}\left(A+A^{\mathrm{T}}\right)$ is positive definite, then $\mathbf{x}^{T} A \mathbf{x}>0$. What I did was basically rewriting $x^{T}Ax$ using the fact that $$2B - A^{T} = A$$ which leads us to:
$$x^{T}Ax = x^{T}\left(2B-A^{T}\right) x = \left(2 x^{T} B - x^{T} A^{T}\right) x$$
which equals:
$$2x^{T}Bx - x^{T}A^{T}x$$
Now, since $x^{T}A^{T} = \left(Ax\right)^{T}$, the above expression becomes:
$$2x^{T}Bx - \left(Ax\right)^{T}x$$
By using the symmetry of the inner product: $$\left(Ax\right)^{T}x = \langle Ax,x \rangle = \langle x, Ax \rangle = x^{T}Ax$$ one obtains:
$$
2x^{T}Bx - \left(Ax\right)^{T}x = 2x^{T}Bx - x^{T}Ax
$$
Now I am stuck.
I know that $x^{T}Bx > 0$, since we are assuming B is positive definite. However, I just cannot justify why the last (or any of the equalities) implies $x^{T}Ax > 0$.
Any help is appreciated, I am struggling really hard with this problem.
Thanks in advance, Lucas!
Comment: Because $x_ix_j=x_jx_i$; multiplication is commutative! So $a_{ij}x_ix_j+a_{ji}x_jx_i=(a_{ij}+a_{ji})x_ix_j$. Try working out the $2\times2$ (or even $3\times3$) case for practice if it seems to abstract at the moment.
Comment: I don't think of it as a "strategy of the proof" to write $x^TAx$ as a double summation. I consider that as simply wanting to see what $x^TAx$ looks like explicitly. If finding out what it looks like ends up helping in a proof, all the better.
Comment: Do you see why $x^TBx\color{Red}{=} x^TAx$? Note the coefficient of $x_ix_j$ in $x^TAx$ is $(a_{ij}+a_{ji})$, after combining like terms, which means we'd get the same result if the matrix's $ij$ and $ji$ entries were both $\frac{1}{2}(a_{ij}+a_{ji})$. Indeed, this is the very first comment on the question you linked about $A+A^T$. Another way to show this is by transposing $x^TAx$ to get $x^TA^Tx$ is the same scalar, so averaging yields $x^TAx=\frac{1}{2}x^T(A+A^T)x$.
Comment: When you expand out $x^TAx$ explicitly it looks like the double sum $\sum_i \sum_j a_{ij}x_ix_j$, but you can combine $a_{ij}x_ix_j$ with $a_{ji}x_jx_i$ since they are like terms. | Also, you seem to think proving $A+A^T$ is pos def won't help you show $\frac{1}{2}(A+A^T)$ is pos def... do you realize any positive scalar multiple of a definite matrix is still a definite matrix? You can multiply/divide $x^TAx>0$ by any positive scalar.
Comment: You can also think of this as regrouping the terms in the expression then adding it back to the original expression by pairing terms appropriately - meaning, seeing that $x^TAx=x^TA^Tx$ (since they have the same terms, only rearranged) and averaging to get $x^TAx=\frac{1}{2}x^T(A+A^T)x$. You may have seen a similar version of this trick, showing $1+2+\cdots+n$ equals $n+\cdots+2+1$ and averaging yields $1+2+\cdots+n=\frac{1}{2}(n+1)+\cdots+\frac{1}{2}(n+1)=n(n+1)/2$. The trick shows up quite a lot in many forms. | Basically all the ingredients for proofs are in the comments and answer.
Comment: Very interesting! However, I did not understand the reasoning behind it... Also, what are the coefficients $x_{i} x_{j}$?
Comment: At the time I just thought it was a typo, but you are right, the scalar multiple still works
Comment: So the goal is to show that $x^{T} B x=x^{T} A x$?
Comment: But how can the terms $a_{i j} x_{i} x_{j}$ and $a_{j i} x_{j} x_{i}$ be combined to yield the result?
Comment: Nice! I see the algebra working now! However, I still dont get what is the strategy of the proof when using the explict double summation
Comment: Interesting! Would you be able to write the proof? I am very interested in your arguments! Usually, I only go about matrix problems by using matrix algebra
Answer: $x^TAx$ is a scalar, so it is equal to its transpose $x^TA^Tx$. This gives $x^TBx=x^TAx$ and you are done.
If $B$ is positive definite, from the equality you get $x^TAx>0\forall x\ne0$. Conversely if $x^TAx>0\forall x\ne0$, then $B$ is positive definite.
Comment: Well, you are not so far after all. You got $x^TAx=2x^TBx-x^TAx$ which gives $x^TAx=x^TBx$ right? @Lucas
Comment: Do you think $x^TAx$ can be positive when $x=0$ for any matrix? The requirement $x\ne0$ is there is the definition as well. @Lucas
Comment: @Lucas Because $x^TBx=(x^TAx+x^TA^Tx)/2$.
Comment: But why is $x^{T} B x=x^{T} A x$?
Comment: What did you think of my work? Can it be reused somehow? I worked so hard on it, I am a bit sad to be honest that it was so far from the proof
Comment: That is true! I just dont know how I did not see that! Thank you very very much!
Comment: Quick question: Since the definition says that $x^{T}Ax$ shoud be bigger than zero for all $x \in \mathbb{R}^{n}$, is it a problem that we require $x$ different from zero in the proof? Because then it does not hold for every vector in $\mathbb{R}^{n}$
Comment: That is true, sorry for the confusion!


How to configure PyCharm to wrap lines in a sensible way

Question: I cannot be certain, but it seems that I have inadvertedly reset some setting (or there has been a buggish feature in an update to PyCharm), but it seems that the current version seems to wrap to long lines in an undesirable way:
E.g, consider that this:
this.trainwreck.is.too.long.to.fit.on.a.single.line.foo.bar.do_something\
    (snakes,
     planes,
     samuel,
     jackson)

Which is just, well, pretty-much brain dead, since both
this.trainwreck.is.too.long.to.fit.on.a.single.line.foo.bar.do_something(
    snakes, planes, samuel, jackson)

and
this.trainwreck.is.too.long.to.fit.on.a.single.line.foo.bar.do_something(
    snakes,
    planes,
    samuel,
    jackson)

would make much more sense. Is there a setting to fix this, because I'm pretty sure that this wasn't broken when I was running version 2.5.1
Answer: Looks like a bug, reported at YouTrack, please star/vote to receive notifications on progress.