# Tag: check

## it.information theory – How does the choice of basis of parity check matrix affect the tanner graph

Given a binary linear block code defined by its parity check matrix $H$, many important characteristics of this code are determined by graph theoretic properties of the Tanner graph $Gamma$ derived from $H$. The girth of $Gamma$ and the distribution of low length cycles greatly affect the BER (bit error rate) performance when the commonly used iterative decoding algorithms are used (belief-propagation,…). We’re free to choose linear combinations of the rows of $H$ as another basis; this doesn’t affect the code (same codewords,…), but how does that affect the Tanner graph and its properties? What (if anything) is invariant under a change of basis?

## Check transaction per block in Bitcoin

what is bitcoin-cli command for checking how many transaction per block ?

Thanks you

## [Shopsocks5.com] Service Socks5 Cheap – Check Socks5 | Proxies123.com

Check Socks5 Online http://shopsocks5.com/check/

This really useful site that checks if SOCKS5 are LIVE or DIE

Another extremely useful thing is that it parses out SOCKS5 and ports if you copy paste a number of SOCKS5.

You can check unlimited SOCKS5 a day, but check Limit 50 SOCKS5 at a time.

Paste SOCKS5 into the box. You can click check Blacklist or no click Blacklist and click check

Here is the image check SOCKS5

Contact:

Skype: Shopsocks5

Email: admin@shopsocks5.com

ICQ: 727362912

## check emails online

Check Email Online

## How can I programmatically check if a 12 word mnemonic is valid?

I would like to use python to check if a 12 word mnemonic is valid. How can this be done?

## Do you check how much DDoS bandwidth hosting company gives you?

As a customer you check with your hosting company how much DDoS bandwidth they gives you?

Which value is good?

Regards…. | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1844941&goto=newpost

## algorithms – Create Check Digit

I’m trying to create check digits and append them after the UPCs.

The data looks like this:

Because there’re leading 0’s in the front, I have to read it as a character:

```
import pandas as pd
upc = pd.read_csv("/Users/lee/Desktop/upc.csv", dtype = str)
```

**Here’s the check digit calculation algorithm:**

(1) sum up odd digits; sum up even digits then multiply by 3; then sum of both sums.

(2) take this result module 10.

(3) if the result in not 0, substract from 10, this is the check digit; if the results is 0, then 0 is the check digit.

**for example: upc 003459409000**

step (1) 0 + 3*0 + 3 + 3*4 + 5 + 3*9 + 4 + 3*0 + 9 + 3*0 + 0 + 3*0 = 60

step (2) 60 mod 10 = 0

step (3) check digit = 0

**Based on the algorithm, here’s the code:**

```
def add_check_digit(upc_str):
"""
Returns a 13 digit upc-a string from an 12-digit upc-a string by adding
a check digit
>>> add_check_digit('002606500006')
'0026065000069'
>>> add_check_digit('003355800010')
'0033558000109'
>>> add_check_digit('002640027530')
'0026400275305'
"""
upc_str = str(upc_str)
if len(upc_str) != 12:
raise Exception("Invalid length")
odd_sum = 0
even_sum = 0
for i, char in enumerate(upc_str):
j = i+1
if j % 2 == 0:
even_sum += int(char)
else:
odd_sum += int(char)
total_sum = (even_sum * 3) + odd_sum
mod = total_sum % 10
check_digit = 10 - mod
if check_digit == 10:
check_digit = 0
return upc_str + str(check_digit)
```

If I use this function, I get this:

**Now my questions are:**

- This function works only for a single upc, i.e., I have to copy/paste each single upc and get the check digit.

How do I create a function that works for a list of UPCs in a dataframe? Each result should return a 13-digit UPC with the check digits appended after original UPC. - The UPCs are read as strings. How do I apply the function to the UPCs? I suppose I should convert the strings to numbers somehow. I’m really new to python.
- After I get the new UPCs, how do I save the result in a csv file?

Thank you very much for your help.

## python – StatsModels Groupby linear regression data type error: Pandas data cast to numpy dtype of object. Check input data with np.asarray(data)

I am trying to run linear regression by group using statsmodels, but I’m getting the error: Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).

Dtypes are the following: EmailCampaignId: int64, percentOpen: float64, and Email Dates: datetime64(ns).

```
import statsmodels.api as sm
def GroupRegress(data, yvar, xvars):
Y = np.asarray(data(yvar))
X = data(xvars)
X('intercept') = 1.
result = sm.OLS(Y, X).fit()
return result.params
df_emails.groupby('EmailCampaignId').apply(GroupRegress, 'percentOpen', ('Email Dates'))
```

I believe int64 and float64 should be okay, and maybe regressing on datatime64 is the issue. I’d appreciate any help!

Additionally, I’d like to output R^2 for each group in a table. How do I pull this?

## javascript – How to check if a string is included in an array? discord.js

Basically I am trying to make a discord bot to make trivia questions by showing an embed and awaiting the answer, I have put the answers in an array in a separate file, the `possibleAnswersF`

is the array that includes the answers that give you 5 points, and the `possibleAnswersT`

is the array that includes the answers that give you 10, and possibleAnswers is the array that includes all of the answers, I tried to use `possibleAnswersF.includes(collected)`

but it wouldn’t work, I tried to make collected an array and use `includes()`

the other way but it jumped to `catch()`

instead.

```
const { MessageEmbed } = require('discord.js');
//const talkedRecently = new Set();
const Characters = require('../../triviacharacterlist');
const points = require('../../points.json');
const fs = require('fs');
module.exports = {
commands : ('trivia', 't'),
minArgs : 0,
maxArgs : 0,
callback : (msg, arguments, text) => {
function TriviaGuess(possibleAnswers, possibleAnswersF, possibleAnswersT, CharacterImgDir) {
const guessCharacterString = "Guess character bo3";
let pointAmt1 = 5;
let pointAmt2 = 10;
const triviaEmbed = new MessageEmbed()
.setColor('#008fff')
.setTitle(guessCharacterString)
.setImage(CharacterImgDir)
msg.channel.send(triviaEmbed)
const filter = m => possibleAnswers.some(answer => m.content.toLowerCase().includes(answer));
msg.channel.awaitMessages(filter, { max: 1, time: 15000, errors: ('time') })
.then(collected => {
const fivePoint = `**Congrats**, ${collected.first().author} you got **5** points for guessing the character only!`;
const tenPoint = `**Congrats**, ${collected.first().author} you got **10** points for also guessing the series/game!`;
if (possibleAnswersF.includes(collected)) {
msg.channel.send(fivePoint);
points(msg.author.id) = {
points: points(msg.author.id).points + pointAmt1
};
fs.writeFile('./points.json', JSON.stringify(points), (err) => {
if (err) {
console.log(err)
}
});
}
if (possibleAnswersT.includes(collected)) {
msg.channel.send(tenPoint);
points(msg.author.id) = {
points: points(msg.author.id).points + pointAmt2
};
fs.writeFile('./points.json', JSON.stringify(points), (err) => {
if (err) {
console.log(err)
}
});
}
})
.catch(collected => msg.channel.send('too bad u took too long ya 3am'));
}
var characterRandom = 0;//Math.floor(Math.random() * 0);
if (characterRandom == 0) {
TriviaGuess(Characters.CreeperVariants, Characters.CreeperVariantsF, Characters.CreeperVariantsT, Characters.CharacterImgs.creeperimg);
}
}
}
```

The other file that has the arrays:

```
const CreeperVariants = (
'creeper',
'creeper minecraft',
'creeper mc'
)
const CreeperVariantsF = (
'creeper'
)
const CreeperVariantsT = (
'creeper minecraft',
'creeper mc'
)
```