img = cv2.imread(image)
im = Image.open(img)
text = pytesseract.image_to_string(img)
There you are.Read the opencv imagePut it in a pillow format (why don't you start reading straight pillow?)Put it in image_to_string.image_to_string accepts both the pillow images (you try to give him img, not im) and the names of the files. We have an unnecessary chain of envelopes... Just text = pytesseract.image_to_string(image), okay?Conclusion: Work on the name of variables. image - file, img - cv_image, im - pil_image. They're confused.FWDAbout the first exception. First of all, you're wrong to convert opencv into a pillow. https://stackoverflow.com/questions/43232813/convert-opencv-image-format-to-pil-image-format/48602446 Second, AttributeError says that the opencv did not return the image, but none because it was unable to read it. I may have misunderstood that the image was the name of the image file, because I know that it's the first argument, but you might be. ♪ ♪
Problem solved, if someone has that same error corrected this way:/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
source: https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors
java.util.List has the method to remove an element from the list, which in this case is implemented by java.util.ArrayList. JFrame seleccionado = frames.get(0);
frames.remove(seleccionado); // lo quita de la lista.
Do one file (e.g. autoload.php) that connects all the right classes and put it in the composera configuration. "autoload": {
"files": [
"autoload.php"
]
}
Thanks to everyone for their support and threatening thanks for your response, that was the one that gave me the key to solving my problem, you were right, what happens is that I was declaring as an array my main variable and when initializing the properties the ponia as an array also, change everything for {} and I could already get the necessary data.
Thank you very much.Greetings!!!
You can use:composer.phar install --no-dev
or composer.phar install --no-dev --optimize-autoloader
(it generates a class map that will accelerate automatic loading in your application).I hope I helped.
Good afternoon.
What version do you have?
Look what exactly is on the vendor/bower?
Maybe the directory is called bower-access?
If it's called bower-access, you'll have pseudonyms in the configuration file.'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
The problem you have is that you are trying to do a mathematical operation with variables that are not numbers, the variables $tota and $totp are non-Normal string, so PHP cannot perform the operations you try.Apart from the above, you must also recover the data after the query, so you can use PDO::fetch() if you use PDO or mysqli_result::fetch_array ( https://www.php.net/manual/es/class.mysqli-result.php ) if you use MySQLi.You should follow the following steps:Create the query Run the queryRecover query dataWorking with the dataExample with MySQLi as your case:<?php
// cremos la consulta añadimos un alias a count()
$totp="SELECT COUNT() total FROM detalle_resultados WHERE ID_RESULTADO='$quiz'";
// ejecutamos la consulta
if (!$result = $conn->query($totp)) {printf("Error: %s\n", $conn->error); exit;}
// recuperamos el resultado
$total = $result->fetch_assoc()['total'];
// cremos la consulta añadimos un alias a count()
$tota ="SELECT count() total FROM 'detalle_resultados' WHERE ID_RESULTADO='$quiz' AND RESPUESTA=1";
// ejecutamos la consulta
if (!$result = $conn->query($tota)) {printf("Error: %s\n", $conn->error); exit;}
// recuperamos el resultado
$totalAcertado = $result->fetch_assoc()['total'];
// realizamos la operacion
$calif = ($totalAcertado * 100) / $total;
// mostramos el resultado
echo $calif;
Documentation: https://www.php.net/manual/es/book.mysqli.php https://www.php.net/manual/es/mysqli-result.fetch-array.php Example with prepared MySQLi sentences:/* crear una sentencia preparada /
if ($stmt = $conn->prepare('SELECT COUNT() total FROM detalle_resultados WHERE ID_RESULTADO = ?')) {
/* ligar parámetros para marcadores */
$stmt->bind_param("s", $quiz);
/* ejecutar la consulta */
$stmt->execute();
/* ligar variables de resultado */
$stmt->bind_result($total);
/* obtener valor */
$stmt->fetch();
} else {
printf("Error: %s\n", $conn->error); exit;
}
/* crear una sentencia preparada /
if ($stmt = $conn->prepare('SELECT count() total FROM detalle_resultados WHERE ID_RESULTADO= ? AND RESPUESTA = 1')) {
/* ligar parámetros para marcadores */
$stmt->bind_param("s", $quiz);
/* ejecutar la consulta */
$stmt->execute();
/* ligar variables de resultado */
$stmt->bind_result($totalAcertado);
/* obtener valor */
$stmt->fetch();
} else {
printf("Error: %s\n", $conn->error); exit;
}
// realizamos la operación
$calificacion = ($totalAcertado * 100) / $total;
// mostramos el resultado
echo $calificacion;
Documentation: https://www.php.net/manual/es/mysqli.prepare.php Example, in case of using PDO:<?php
// cremos la consulta añadimos un alias a count()
$totp="SELECT COUNT() total FROM detalle_resultados WHERE ID_RESULTADO='$quiz'";
// ejecutamos la consulta
$result = $conn->query($totp);
// recuperamos el resultado
$total = $result->fetch()['total'];
// cremos la consulta añadimos un alias a count()
$tota ="SELECT count() total FROM 'detalle_resultados' WHERE ID_RESULTADO='$quiz' AND RESPUESTA=1";
// ejecutamos la consulta
$result = $conn->query($tota);
// recuperamos el resultado
$totalAcertado = $result->fetch()['total'];
// realizamos la operacion
$calif = ($totalAcertado * 100) / $total;
// mostramos el resultado
echo $calif;
Documentation: https://www.php.net/manual/es/book.pdo.php https://www.php.net/manual/es/pdostatement.fetch.php As a note, some of these codes are vulnerable to SQL Injection.
From what I believe, Composer will always give priority to repositories and then move on to autoload. I didn't find anything in the documentation on the execution priority.In the case, your problem is that when adding the SimpleCrudPhp package, it depends on environment variables that have not yet been defined. I believe that the package itself should have the .env file and not be something external.However, I believe that maybe some of these solutions should help:Add within repositories, a path to the .env file, so when SimpleCrudPhp is executed, the variables have been defined. (I don't know if it works)Add in your code, before importing all autoload issues, the .env file requirement, so before running anything, your program has already loaded the environment variables.I don't know if that helps you, but I hope so.
If you need your own project to use the fork-version of some original bag (this may be your or your foreign fork), you need to:Add VCS repositories with bag for:composer config repositories.yii2-dynamicform vcs spiro-stathakis/yii2-dynamicform
Set up a package with an original name! wbraganca/yii2-dynamicform:composer require wbraganca/yii2-dynamicform dev-master
Profit!PS: dev-master - the name of the repository branch, in this case masterFor your specific case, you need:Remove the packages wbraganca/yii2-dynamicform and spiro-stathakis/yii2-dynamicformGive me back the original name for the package. https://github.com/spiro-stathakis/yii2-dynamicform/blob/master/composer.json Set the package wbraganca/yii2-dynamicform:composer require wbraganca/yii2-dynamicform dev-master
Profit!PS: dev-master - the name of the repository branch, in this case master
I don't know if it's the problem you have, but to set up the proxy on docker there's at least 2 https://docs.docker.com/network/proxy/ .Editing/creating the file ~/.docker/config.jsonUsing environment variablesIn the latter case it would be something like:docker run --rm \
-v $(pwd):/opt \
-w /opt \
-e HTTPS_PROXY="http://usuario:password@url_de_proxy:puerto/" \
laravelsail/php80-composer:latest \
bash -c "laravel new example-app && cd example-app && php ./artisan sail:install --with=mysql,redis,meilisearch,mailhog,selenium"
If you need the HTTP proxy you have to replace or add the variabe HTTP_PROXY (without the "S" final ), which excludes the proxy with NO_PROXY etc.
TLS can be used each version https://ja.wikipedia.org/wiki/Transport_Layer_Security#%E6%9A%97%E5%8F%B7%E3%82%B9%E3%82%A4%E3%83%BC%E3%83%88 is defined.IPA https://www.ipa.go.jp/security/ipg/documents/ipa-cryptrec-gl-3001-2.0.pdf "High security type", "Recommended security type", "Security exception type",High Security Crypto Suite Sets Dark that requires TLS 1.2 supportI would like to note that communication using AES128-SHA cannot be connectedIt is recommended not to use encryption suites that are required in TLS 1.2 as well as TLS 1.2.In the opposite example, Internet Explorer on Windows XP / Vista can be enabled to TLS 1.2 if set. However, because the available crypto suites are limited, you may not be able to connect smoothly with the encryption suites you want on the server using TLS 1.2.Therefore, it is recommended to judge not only the TLS version, but also which crypto suite is available.TLS first sends elloHello from your browser, but it contains a list of crypto suites that allow TLS versions and browsers. After that, the web server returns a crypto suite that has been accepted by ServerHello. TLS handshakes will be sent for the first time, so at least TLS.net will not be able to check what interactions are made with TLS.After all, it seems that htb would be effective as a comment. In other words, the questioner will establish a web server that is limited to the TLS version encryption suite that can be accepted in the future. If you connect to the web server in JavaScript and make a request, how do you decide that the browser does not meet or pass the conditions and switch the display content?
There are several ways to do this using Composer: Indicate the classmap class list, list the files in the file section or establish rule psr-4:"autoload": {
"classmap": [
"services/myserv/Ksl.php"
],
"psr-4": {
"Services\\": "services",
"liw\\": ""
},
"files": [
"config.php"
]
}
You can read the details here. https://klisl.com/composer_autoload.html
There are filters for this: echo(filter_var('asdasd0755asdasdasd', FILTER_SANITIZE_NUMBER_INT));//0755
echo(filter_var('a13sdasd07.55asd', FILTER_SANITIZE_NUMBER_FLOAT , FILTER_FLAG_ALLOW_FRACTION)); //1307.55