I use the nyc library to check test coverage.
When I run the tests and they pass successfully, I get an empty table.
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 0 | 0 | 0 | 0 | |
----------|----------|----------|----------|----------|-------------------|
But when one of the tests fails, the table is filled.
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------|----------|----------|----------|----------|-------------------|
All files | 31.64 | 9.25 | 11.76 | 31.86 | |
src | 96.55 | 100 | 66.67 | 96.55 | |
index.js | 96.43 | 100 | 66.67 | 96.43 | 44 |
src/config | 93.75 | 80 | 100 | 93.75 | |
constants.js | 100 | 100 | 100 | 100 | |
multer.config.js | 88.89 | 80 | 100 | 88.89 | 13 |
s3.config.js | 100 | 100 | 100 | 100 | |
src/controllers | 30.5 | 6.49 | 10.68 | 30.77 | |
activateProducts.js | 30.34 | 5.56 | 22.22 | 29.89 |... 26,130,131,138 |
admins.js | 18.92 | 0 | 0 | 18.92 |... 59,265,271,277 |
bookmarks.js | 61.29 | 33.33 | 66.67 | 60 |... 42,43,48,49,56 |
categories.js | 15.38 | 0 | 0 | 16 |... 98,205,213,219 |
comments.js | 20.83 | 0 | 0 | 21.74 |... 31,132,139,147 |
configurations.js | 16.26 | 0 | 0 | 17.39 |... 94,199,200,207 |
filters.js | 19.15 | 0 | 0 | 20 |... 77,81,82,86,87 |
followers.js | 22.67 | 0 | 0 | 23.61 |... 21,127,128,135 |
likes_merchants.js | 31.71 | 0 | 0 | 32.5 |... 58,59,66,67,74 |
likes_products.js | 31.71 | 0 | 0 | 32.5 |... 58,59,66,67,74 |
locations.js | 15.69 | 0 | 0 | 16.33 |... 26,233,241,247 |
locationsType.js | 18.6 | 0 | 0 | 19.51 |... 60,167,175,181 |
merchants.js | 34.62 | 0 | 0 | 36 |... 26,27,34,35,42 |
merchantsSignup.js | 26.56 | 0 | 0 | 26.56 |... 16,218,219,221 |
merchantsVerifyPhone.js | 39.02 | 0 | 0 | 39.02 |... 75,79,84,85,92 |
products.js | 47.24 | 20.62 | 52.17 | 46.39 |... 16,422,428,434 |
productsSold.js | 51.35 | 20 | 50 | 50 |... 49,54,55,62,70 |
saveTokenOfUsers.js | 40.74 | 0 | 0 | 42.31 |... 35,36,41,42,49 |
updateLocationOUsers.js | 28.07 | 0 | 0 | 28.57 |... 3,94,98,99,106 |
userBookmarks.js | 73.17 | 50 | 50 | 71.79 |... 44,53,54,61,69 |
userProducts.js | 81.4 | 50 | 50 | 80.49 |... 42,58,59,66,74 |
users.js | 15.91 | 0 | 0 | 16.41 |
---------------------------|----------|----------|----------|----------|-------------------|
With what it can be connected?
My main test file, where I import the rest of the tests.
import './products/allProductsTest';
Product test folder.
products:
- addProductsTest.js
- allProductsTest.js
- deleteProductsTest.js
- getProductTest.js
- listProductsTest.js
- updateProductsTest.js
I have CSV file which ('user_id')which is 100 and ('Product_id') which is 16370 Columns wise.How i calculate the user to user similarity using Pearson Correlation Coefficient.For that i Using the build in function of python Pearsons, but it show me error.
+-----------------+-------------+-------------+-----------+
| user_id | B004MYH08U | B000BNXDBO | 783229135 |
+-----------------+-------------+-------------+-----------+
| A11L5M4MJP00UW | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A13NO1WIGJZUV4 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A141HP4LYPWMSR | 1 | 4 | 4 |
+-----------------+-------------+-------------+-----------+
| A14HV65O34S8EF | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A174WE983H06N4 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A17RUD7RKGZUA4 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A18758S1PUYIDT | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A19O5ETNRJN39D | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1AFHYBINSG7PH | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1CIW2OEVAJRM2 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1D12NAC1U12F0 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1DDVFGUC6NQD3 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1DZ4MTJY8LAVG | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1FRPGQYQTAOR1 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1I7QGUDP043DG | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1J50B4K22D93F | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1M3W0ROKC7F3C | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1M5405JH9THP9 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1MIFONBFK8OWE | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1MXSUEA3ZK5UZ | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1NN07FHTQZZ6K | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1OUBOGB5970AO | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1R6DF0KOJ0TG6 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1RSDE90N6RSZF | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A1VJCDRXUQVXBM | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A23Q1T4MXZHFM7 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A245OASCPKPJHC | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2582KMXLK2P06 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A27H9DOUGY9FOS | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2942G3FDOIM18 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A295JWKTJLM7YT | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A29DLKCN8QWO7B | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2BTR8ZO8MB01D | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2D595HNMO9PHR | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2DLKD4AC5JV5Q | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2FX6OHBMQ9545 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2H5D7IK9SF07M | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2I6MHMAZZDCRX | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2IMLPUXYQJTSY | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2IOMS4TK2QSFW | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2IT3899H776LW | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2M2O1DI1SCQDI | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2M4H4R4Z7UDZX | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2OKCS5234ZV7S | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2ON9S58W4AZ1Z | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2P7UB02HAVEPB | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2R1VN4J5L2ZCO | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2TTVV34NLMZI8 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2TX99AZKDK0V7 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2UFG3DMVELP6I | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2URPOBDQK3WG | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2VDM3D712BGLE | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2WFI5XFB7NHHJ | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A2YWH9COGWT8VU | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A31YQQYX9PU04Z | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A328S9RN3U5M68 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A34KFDQ5KBHZA5 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A36SSF310LBGSE | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A39I79H1A2A8C3 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A39M64IZTC04G0 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3ENN12GLNTUAF | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3GX0UO7XXZST2 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3IG9WGCIHPJ6X | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3N27L13CWJ9HY | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3N2MVBI1A2I9Y | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3NNR95R50VB4W | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3NPHQVIY59Y0Y | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3NWP0SFAC0ZD2 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3Q4S5DFVPB70D | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3QIEISBZP4QTV | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3QYDL5CDNYN66 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3R95JCH1K9R0S | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3RVH9HUN9J4LZ | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A3VP6XR88INLRB | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A44YJ6ZLTMAR6 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A4FBBS25X3XEL | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A63FDY7VFOMQV | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A66KMXH9V7OGU | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A7LRQFZW3D9NE | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A8DDTUL8OWFMO | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| A9Q28YTLYREO7 | 0 | 3 | 4 |
+-----------------+-------------+-------------+-----------+
| AA72A0AYTWV5Y | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AD4CDZK7D31XP | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AFC8IKR407HSK | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AFJ27ZV9183B8 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AFKMBAY28XO8A | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AH7ZNGM8WOOGN | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AMEJTGF5NQLNH | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| ANZNLFBN62YKH | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AOIT2QUH8GRGA | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AQJVNDW6YZFQS | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| ASES4LU7WKYC | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| ATK3QFC6L1318 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| ATXL536YX71TR | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AUQW6UEZFC7B2 | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AVQRC2N2SSSYS | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AVV8PPI6BDKVA | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AWPODHOB4GFWL | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
| AXMKAXC0TR9AW | 0 | 0 | 0 |
+-----------------+-------------+-------------+-----------+
I Already post the code:
from scipy.stats import pearsonr
data = pd.read_csv("result2.csv")
USER = data.iloc[:,0:16370].values
arr =np.array(USER[0]).tostring()
arr2 =np.array(USER[1]).tostring()
vla = pearsonr(arr, arr2)
print(vla)
Error is :TypeError: len() of unsized object
Can anyone help me How to find Pearson Correlation Coefficient using python?
Here one guy already did this how i contact with him?enter link description here
Just for fun, I have written a solver for str8ts puzzles. While dealing with the REPL representation of a puzzle is okay for me, e.g.
STR8TS> (solve-puzzle #p"puzzles/2019-02-04-hard")
Initial puzzle:
-----------------------------------------------------
| -7 | -9 | 0 | 0 | 10 | 0 | 0 | 0 | 10 |
| 3 | 0 | 6 | 0 | 0 | 0 | 0 | 0 | 10 |
| 0 | 0 | 10 | 0 | 0 | 10 | 10 | 0 | 0 |
| 0 | 1 | 0 | 10 | 10 | 0 | 0 | 5 | 0 |
| 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
| 0 | 0 | 0 | 0 | -6 | 10 | 0 | 9 | 0 |
| 0 | 0 | 10 | 10 | 0 | 0 | -2 | 0 | 0 |
| 10 | 0 | 9 | 0 | 0 | 5 | 0 | 0 | 0 |
| -4 | 0 | 0 | 0 | 10 | 0 | 0 | -1 | -3 |
-----------------------------------------------------
Final state:
-----------------------------------------------------
| -7 | -9 | 5 | 6 | 10 | 2 | 3 | 4 | 10 |
| 3 | 8 | 6 | 5 | 7 | 1 | 4 | 2 | 10 |
| 1 | 2 | 10 | 7 | 8 | 10 | 10 | 6 | 5 |
| 2 | 1 | 3 | 10 | 10 | 7 | 8 | 5 | 6 |
| 10 | 6 | 4 | 3 | 5 | 8 | 9 | 7 | 10 |
| 5 | 3 | 2 | 4 | -6 | 10 | 7 | 9 | 8 |
| 6 | 5 | 10 | 10 | 3 | 4 | -2 | 8 | 9 |
| 10 | 4 | 9 | 8 | 2 | 5 | 6 | 3 | 7 |
| -4 | 7 | 8 | 9 | 10 | 6 | 5 | -1 | -3 |
-----------------------------------------------------
Puzzle solved in 4.168 seconds.
I was wondering what could be a more elegant way to /draw/ the puzzle. The puzzle is stored in a two-dimensional array and 10 and negative number should be black fields.
Is there a library which allows for the generation of a simple png or svg file of the puzzle grid in b/w and the numbers as text?
I use Vecto for things like that. It's fairly low-level (kind of like writing PostScript code), but lets you draw stuff like the Movie Charts, so it's a matter of planning and practice to make what you like.
I'm a bit confused. I need to make an example of using the ITE-Algorithm on every Boolean operation. But I actually don't know how much there are?
As an example I mean, AND, OR, XOR, XNOR, NOR, NAND, NOT. And I don't know the other ones... I at least miss one because it cannot be seven operations. (2^n)
I need to make an example of using the ITE-Algorithm on every Boolean
operation.
This is Exercise 1 from the Fascicle 1B of the Volume 4 of Knuth's The art of computer programming.
The answer is the following.
But I actually don't know how much there are?
There are exactly 16 boolean functions of two variables (and 22ⁿ functions of n variables). Just permutate rows in functions' truth tables.
| F0 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | FA | FB | FC | FD | FE | FH |
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
F0 and FH do not depend on the values of both variables.
F3, F5, FA, FC depend on the value of only one variable.
The table below lists common names of these functions.
The above table is from the Fascicle 0B of the Volume 4.
I'd add that F8 and FE are also known as Pierce's arrow and Sheffer stroke respectively.
I'm trying to get a cell with value BBBBBBBGGGGGJJJJCCCCDDDDAA from these cells:
-----------------------------------------
| 2 | 7 | 4 | 4 | 0 | 0 | 5 | 0 | 0 | 4 |
-----------------------------------------
So it gets the highest value and writes the cell's horizontal address (that might have an offset) that many times. Then gets the next highest and does the same thing until it reaches the zeroes. Is that possible in excel?
additional samples:
------------------------------------------------------------------------------------
| 2 | 0 | 0 | 3 | 0 | 0 | 5 | 0 | 0 | 0 | GGGGGDDDAA |
------------------------------------------------------------------------------------
| 0 | 0 | 2 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | GGGGGCC |
------------------------------------------------------------------------------------
| 0 | 7 | 2 | 2 | 4 | 3 | 3 | 0 | 0 | 0 | BBBBBBBEEEEFFFGGGCCDD |
------------------------------------------------------------------------------------
| 4 | 7 | 0 | 7 | 7 | 0 | 0 | 0 | 8 | 7 | IIIIIIIIBBBBBBBDDDDDDDEEEEEEEJJJJJJJAAAA |
------------------------------------------------------------------------------------
| 0 | 2 | 0 | 2 | 8 | 0 | 8 | 0 | 7 | 10| JJJJJJJJJJEEEEEEEEGGGGGGGGIIIIIIIBBDD |
------------------------------------------------------------------------------------