# [Solved] PyInstaller collect package issue (Google Analytics)?

S

#### squidg

##### Guest
I have the below imports:

Code:
from apiclient import discovery
from oauth2client.service_account import ServiceAccountCredentials

I'm trying to make a single file exe file by running:

Code:
pyinstaller --onefile -w --icon=icon.ico --add-data client_secrets.json;. main.py  --collect-data "google-api-python-client" --collect-data "oauth2client";.

I also tried:

Code:
pyinstaller --onefile -w --icon=icon.ico --add-data client_secrets.json;. main.py  --collect-data google-api-python-client --collect-data oauth2client;.

But when i run the exe file I get the error:

Code:
  Failed to execute script 'main' due to unhandled exception: name analytics version: v3
File "main.py", line 81, in <module>
File "main.py", line 32, in get_service
File "googleapiclient\_helpers.py", line 130, in positional_wrapper
File "googleapiclient\discovery.py", line 287, in build
File "googleapiclient\discovery.py", line 404, in _retrieve_discovery_doc
googleapiclient.errors.UnknownApiNameOrVersion: name: analytics  version: v3

The script works fine as a python file.

#### what is a data lake catalog technically?

SSSOF Asks: what is a data lake catalog technically?
Is a datalake catalog, a file (XML) that the datalake consults before storing retrieving data from a Hadoop database?

Thanks.

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### Encoding "all-except" constraints in CNF

Markus Asks: Encoding "all-except" constraints in CNF
I am looking for an efficient CNF encoding of the following situation: I have sets of boolean literals $A = \{ a_1, \ldots, a_m \}$, $B = \{ b_1,\ldots, b_n \}$ and subsets $B_1, \ldots, B_m$, where for all $i$ we have $B_i \subseteq B$ and $|B_i|\le 10$. I would like to encode the constraints $$a_i \to \bigwedge_{b \in B \setminus B_i} b\qquad (i = 1, \ldots, m)$$ into CNF. The arrow is logical implication. In other words: Each $a_i$ should imply all elements of $B$ except those which are contained in the small set $B_i$.

The naive encoding $\{(\lnot a_i \lor b)\}_{i = 1, \ldots, m,\ b \in B\setminus B_i}$ requires $\mathcal{O}(n\cdot m)$ clauses. I am looking for an encoding that only requires $\mathcal{O}(n + m)$ clauses. I'm happy to introduce helper literals like in the Tseytin transformation.

## Progress​

I have encodings using $\mathcal{O}(n + m\log n)$ and $\mathcal{O}(n\log n + m)$ clauses. Both constructions are inspired by tree data structures for Range-Minimum Queries.

### $\mathcal{O}(n + m\log n)$​

Construct a binary tree of optimal height with $n$ leaves and assign one of the $a_i$ to each leaf of the tree. Introduce a helper variable for each inner node of the tree. If $n$ is a literal assigned to an inner node of the tree and its children are assigned the literals $n'$ and $n''$, we have clauses $(\lnot n\lor n')$ and $(\lnot n\lor n'')$. Then it is easy to see that each "all-except" can be encoded using a logarithmic (in $n$) number of clauses of the form $(\lnot a_i\lor n)$, where $n$ is the literal associated with a node in the tree.

### $\mathcal{O}(n \log n + m)$​

This encoding is reminiscient of the sparse table data structure for RMQ.

We introduce helper literals $h_{i, j}$ for $0\le j\le \log_2 n$, $1 \le i\le n - 2^j + 1$ and have clauses $\{(\lnot h_{i, 0}\lor b_i)\}_i$,$\{(\lnot h_{i, j + 1} \lor h_{i, j})\}_{i, j}$, $\{(\lnot h_{i, j + 1}\lor h_{i + 2^j, j})\}_{i, j}$. Using this, we can encode each constraint using at most 22 clauses, since it is possible to encode a rule of the form $a_i \to b_u \wedge b_{u+1}\wedge \cdots \wedge b_{v - 1} \wedge b_v$ using only two additional clauses.

### Question​

Is it possible to do it with $\mathcal{O}(n + m)$ clauses? I know that there are RMQ data structures with linear precomputation and constant queries, but it's not clear to me that their ideas are useful in my setting.

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### An extreme question from chemical kinetics

• Raghav Kumar Singh
• Chemistry
• Replies: 0
Raghav Kumar Singh Asks: An extreme question from chemical kinetics

Iam thinking that Option B is only correct, but the answer said is two options are correct. which two are correct? Please clarify option E as iam confused about order less than 1. Explain something about reactions having order less than 1?

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### Water dissociation constant $K_w$ in vapour, or are there charges entities ($\ce{H3O+}$, $\ce{HO-}$,...) in water vapour?

• The Quark
• Chemistry
• Replies: 0
The Quark Asks: Water dissociation constant $K_w$ in vapour, or are there charges entities ($\ce{H3O+}$, $\ce{HO-}$,...) in water vapour?
When water is in vapour state, to which degree is there still some dissociation with the existence of charged species like $\ce{H3O+}$ and $\ce{HO-}$? (I would be interested by any reference to experimental studies that attempted to measure the amount of such charged species in water vapour.)

Alternatively, would you know what experimental techniques could be used to make a direct experimental measurement of the amount of charges species in a gas?

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### Why can't Schiff's reagent distinguish between glucose and fructose?

• Harshal Deshpande
• Chemistry
• Replies: 0
Harshal Deshpande Asks: Why can't Schiff's reagent distinguish between glucose and fructose?
I have heard that Schiff's base only gives a positive test for aldehydes. Glucose is an aldehyde. However, I was told that glucose doesn't give a positive Schiff's base test. Is this correct? If so, how?

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### Applying the Clausius inequality to three systems

• Si Chen
• Physics
• Replies: 0
Si Chen Asks: Applying the Clausius inequality to three systems
Suppose we have three systems made up of the same amount of the same substance, $S_1, S_2$ and $S_3$. They start with temperatures $T_1$, $T_2$, $T_3$ such that $T_1>T_2>T_3$.

We can place the systems next to each other along a line: $S_1 | S_2 |S_3$, where $|$ indicates that the systems on either side of it are in contact.

Let us assume that this line of systems, taken as a whole, can be treated as isolated. Within the line itself, however, heat and work may be exchanged between any two systems in contact. The three systems therefore begin to get into thermodynamic equilibrium with each other.

At the very start of the process, $S_1$ loses heat $\delta Q_{12}$ to $S_2$, and $S_2$ loses heat $\delta Q_{23}$ to $S_3$. The systems' entropies change by $dS_1$, $dS_2$ and $dS_3$ respectively.

I would like to show that $dS_1 + dS_2 + dS_3 > 0$, using the Clausius inequality. In other words, I would like to show that the Second Law of Thermodynamics has as a consequence that the entropy for the whole line of systems increases as the line reaches internal thermodynamic equilibrium.

The Clausius inequality automatically gives $d S_1 \geq \frac{-\delta Q_{12}}{T_2}$ and $d S_3 \geq \frac{\delta Q_{23}}{T_2}$, because $S_1$ and $S_3$ are both only in contact with $S_2$, which is at temperature $T_2$.

But can I use the Clausius inequality to complete my argument and say: $d S_2 \geq \frac{\delta Q_{12}}{T_1} + \frac{-\delta Q_{23}}{T_3}$? Can/how would the Clausius inequality can be applied when a system is in contact with two reservoirs of different temperatures?

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.

#### A generic way to deal with intermittent non-numerical values in arrays

sunt05 Asks: A generic way to deal with intermittent non-numerical values in arrays
Sometimes when dealing with arrays with intermittent non-numerical values (e.g., NaNs imported from external sources), the common arithmetic functions (e.g., Median) may break annoyingly. Although it's possible to replace those NaNs with Indeterminate and then carefully remove them before applying the arithmetic functions, such operations are rather tedious compared to other computing environments (e.g., numpy) where similar functions would quietly ignore those NaNs and produce results.

I'm wondering if we can create a similar pure numeric environment in Mathematica that can do such jobs more easily?

For example, for an arbitrary array generated using the code below:

Code:
arNaN = Array[
RandomChoice[{RandomReal[], Indeterminate}] &, {4, 2, 3, 5}]

How can we apply the common arithmetic functions (e.g., Median, Quartiles, etc.) without deliberately removing the non-numerical items?

For people who are also familiar with numpy/pandas, I would like something similar there like numpy.nanmedian/pandas.DataFrame.median which can quietly ignore NaN values.

SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your thoughts here to help others.