Posts by Jasar Orion • 1,052 points
75 posts
-
-2
votes2
answers39
viewsA: How to divide an array of 90 elements into 20 on each page, in PHP?
if you want to paginate an array follows an ex of how to do using array_slice <?php $lista=array(); for($i=1;$i<=90;$i++){ $lista[]=$i; } function paginate($lista,$pagina=0,$numporpag=20){…
-
-4
votes2
answers83
viewsA: Javascript image
Much of the code you provided was correct. Only what was missing was you printing the image object inside your HTML thus below. let senha = "teste"; let escrita = window.prompt("SENHA"); if(senha…
javascriptanswered Jasar Orion 1,052 -
-2
votes1
answer46
viewsA: SEND E-MAIL TO MULTIPLE RECIPIENTS WITH SMTPLIB PYTHON
does the following uses a mailing list and makes it run sending for each 1 as in the ex below: import smtplib import email.message def enviar_email(email): corpo_email = """ <p>Prezados, tudo…
-
4
votes2
answers83
viewsA: Grab last file that entered in "Downloads" folder
you can use the function glob python in this way: import glob import os.path folder_path = r'C:\Users\MasterRoot\Desktop\Test' file_type = '\*csv' # se nao quiser filtrar por extenção deixe apenas *…
-
-1
votes2
answers60
viewsA: Doubt in python with Opencv
I did a function that does it efficiently: def merge_image(back, front, x,y): # convert to rgba if back.shape[2] == 3: back = cv2.cvtColor(back, cv2.COLOR_BGR2BGRA) if front.shape[2] == 3: front =…
-
0
votes1
answer32
viewsA: What error in my JS code (repeat loops) is not correct and is lost when the user type 31
you mixed a for with if in a weird way. Separate things let your Cod more levigel. <script> while(true){ var i = window.prompt('digite um valor entre 0 e 30: '); if(i<=30){…
-
-3
votes1
answer46
viewsA: fix the menu at the top of the page
uses the famous Sticky .menu{ position: -webkit-sticky; /* Safari */ position: sticky; top: 0; } follows the source with functional example:…
-
0
votes1
answer44
viewsA: How can I print the screen in the background with Python
in his cron you have to use the export DISPLAY=:0 follows an example: * * * * * export DISPLAY=:0; /usr/bin/python3 script.py remembering that the display value has to be the active display. most of…
-
1
votes2
answers37
viewsA: Git: I used the wrong credentials and now when I try to download the SSH repository, it’s fatal
Do the following, go there at the prompt at the root of your project and type the following command: git config credential.helper store When you do, the git console will ask for the credentials…
-
0
votes1
answer41
viewsA: String Size Using Lists
If you want to print the amount of letters in each string inside a list you must go through it this way: lista = [] while True: nome = str(input()) if nome == 'fim' or nome == 'FIM': break…
pythonanswered Jasar Orion 1,052 -
0
votes1
answer21
viewsA: Keep Scroll at [last position after an AJAX request?
you can create a fixed element right after where you will insert the result to do this way: $(".click").click(function(){ $([document.documentElement, document.body]).animate({ scrollTop:…
-
1
votes2
answers96
viewsA: Problem when performing HTTP request on Android
Good morning. When the request is not secure you need to create special permissions for it. Do the following create an xml file in res/xml with the name network_config.xml in this format below with…
-
0
votes1
answer14
viewsA: $(this). val(') does not remove cache information
it is your validation that this wrong, try so: var quantidade = 100; $('input').keyup(()=>{ if ($('input').val() > quantidade && $('input').val().length > 0) { $('input').val('');…
-
-1
votes1
answer23
viewsA: Python Basehttprequesthandler - How to insert correct image path
Good morning. vc has to do a validation of the extension of the files to return the correct minetype follows an ex taken from the net that works: #!/usr/bin/python from BaseHTTPServer import…
pythonanswered Jasar Orion 1,052 -
1
votes2
answers76
viewsA: Encrypt message through a python socket
you can use these 2 fuinções to encodar and decode the sent message client: from Crypto.Cipher import AES def do_encrypt(message): obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')…
-
0
votes1
answer27
viewsA: Change the color of a parent element in a table
tries to do the opposite: .target:focus-within { background: red !important; } <html> <!DOCTYPE html> <head> </head> <body> <table> <tr class="target">…
-
1
votes2
answers75
viewsA: Loop two functions at the same time
You can use Thread do so: import threading import time if __name__ == "__main__": # e na hora de chamar as funcoes: x = threading.Thread(target=ftp_server) x.start() y =…
-
1
votes1
answer16
viewsA: Download CSV file in WEB directory
makes it simpler. If you already have the file and know where it ta only adds the download tag in the link. ex: <a href="pasta/diretorio/nomedoarquivo.csv" download="nomedoarquivo.csv"…
-
0
votes1
answer52
viewsA: "Solved" Text spacing in HTML table
you can edit the line-height <tr> <td colspan="3" style="text-align:center" class="bg-success text-white"> <class…
-
0
votes1
answer86
viewsA: Return brown percentage in image
when I want to detect % of a certain color in my image you do so: import numpy as np import cv2 img = cv2.imread('J9MbW.jpg') brown = [194, 187, 138] # RGB diff = 20 boundaries = [([brown[2]-diff,…
-
0
votes2
answers806
viewsA: How to use cv2.imread() with an image type object instead of "image path"?
Actually you don’t have to do anything. take this test: import cv2, pyautogui screenshot = pyautogui.screenshot() ####### editado img_opencv = cv2.imencode('.jpg', screenshot )[1].tostring() #######…
-
1
votes1
answer38
viewsA: Problem with opencv on linux
happened to me. it has to do with system variables. you can start like this: import os os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;udp" cap =…
-
0
votes1
answer214
viewsA: Eclipse adds tag to code when trying to resolve conflicts
has to study the flow of git. The conflict happens because the q vc branch is trying to merge this one or more commits behind the one you’re working on. follows a mini tutorial on how to resolve…
-
1
votes1
answer67
viewsA: mysql - Query 3 tables at the same time
try like this : SELECT u.username, count(v.lote_id) as quantidade_vendas, SUM(p.lote_preco) as total from USERS u join VENDAS v on v.user_id = u.username join PRODUTOS p on p.lote_id = v.lote_id…
-
1
votes1
answer30
viewsA: How to use the image generated in html on another page
you can do the following <img src='arquivo_de_boleto.php'> or you can turn your image into a base64 $font = 5; $width = imagefontwidth($font) * strlen($string); $height =…
phpanswered Jasar Orion 1,052 -
1
votes2
answers183
viewsA: Footer at the end of the template after scroll
does the following: Imagine q vc has a content and a footer in your project for the content use a div with css min-height:100vh; so this div will occupy all screen height and right after the footer…
-
0
votes3
answers1303
viewsA: What is a git submodule for?
In fact, the command git submodule update tells Git that you want your submodules to check out the commit already specified in the superproject index. If you want upgrade your submodules for the…
gitanswered Jasar Orion 1,052 -
0
votes1
answer182
viewsA: Curl error in Cielo payment
you are possibly trying to use the plugin WooCommerce that was developed to work with the version 1.5 of API of Cielo. If you started the homologation process recently, you received the keys…
-
1
votes1
answer56
viewsA: Failed to create array
guy this here $array = array( $row['codtestemunho'] , ); is the same as this $array=$row['codtestemunho'] and how you want to send the array ocm all Rows the right one would be this:…
-
0
votes2
answers221
viewsA: Count the total pages of a PDF using PHP
I use this function here: function count_pages($pdfname) { $pdftext = file_get_contents($pdfname); $num = preg_match_all("/\/Page\W/", $pdftext, $dummy); return $num; }…
phpanswered Jasar Orion 1,052 -
4
votes1
answer405
viewsA: How to make an element occupy the entire height of the div?
In your case, it seems that you do not want an element with 100% height of the parent element, but 100% height of the screen, in which case the best to use is: min-height: 100vh; It works as a…
-
1
votes1
answer14
viewsA: Display XML parameters in PHP
uses php like this <?php $xml=simplexml_load_file("arquivo.xml"); print_r($xml); ?> or if your xml is string within a variable <?php $xml=simplexml_load_string($xml_em_string) or…
-
0
votes1
answer1228
viewsA: How to send values with Zeros to left SQL SERVER
can use the following function: replicate(string expression, integer expression); example: select empid, replicate('0', 6 - len(salary)) + cast (salary as varchar) as salary from emp; empid salary…
-
5
votes1
answer407
viewsA: How to not show error screen for User - LARAVEL
just edit the .env and set APP_DEBUG=false
-
1
votes3
answers72
viewsA: mysql repeated names by select
can perform as follows: First you create a field idautor on your table Livro then the consultation looks like this: SELECT a.nome, l.estoque as total from Autor a join Escreve e on e.autor_idautor =…
-
0
votes1
answer19
viewsA: Code error, buttons are doing the same form input functions
have tried this way? <?php while($dados = mysqli_fetch_assoc($resultado_usuarios)) {?> <form action="editar.php" method="post"> <div class="alunos"> <input type="hidden"…
-
0
votes2
answers467
viewsA: How to check query with empty return?
Look I read the documentation and really the ISNULL hopes that the subquery has only one field in select. in case it would work thus SELECT ISNULL( (SELECT p.staff_id from payment p INNER JOIN staff…
sqlanswered Jasar Orion 1,052 -
1
votes2
answers69
viewsQ: Preg Replace to remove awesome font from the texts
I need to ride a preg_replace PHP to remove all font-awesome of a string. for example.: Texto de teste <i class="fab fa-accusoft"></i> Teste Lorem Ipsim I’d have to change to Texto de…
-
2
votes1
answer118
viewsA: Positioning of a button
Simple as that ^^ .btn_over{ position:absolute; bottom:-10px; right:-10px } .btn_over2{ position:absolute; top:100%; left:100%; transform: translate(-100%, -100%); } <link rel="stylesheet"…
-
0
votes1
answer79
viewsA: Remove Dynamic Fields button
var start = 1; $(".add").click(function() { $(".fields").append("<button class='btn btn-remove'>#" + start + " Clique para apagar</button>"); start++; }); $('body').on('click',…
-
1
votes1
answer570
viewsQ: Problems with sweetalert2 and bootstrap4
I’ve set up a page where the customer needs to type in their Cpf to proceed. Includes error messages with sweetalert2 only that when displaying them it is not possible to close. The Sweet-Alert box…
-
2
votes2
answers147
viewsA: Compressing files with PHP 5.1.6
if you are in the best way linux with this php version is using the shell_exec $dado = "Ticker_70_".$MD."_IPCDA.sql"; shell_exec("zip ".$dado.".zip $dado");…
-
0
votes2
answers655
viewsA: Label with input range value
I used it this way but I’ll change it by the way you proposed: $( ".slider" ).mousemove(function() { $(this).find('.lbval').html($(this).find('.custom-range').val()); }); posted the character of…
-
0
votes2
answers655
viewsQ: Label with input range value
Good afternoon. I’m using the BOOTSTRAP 4 specifically an input range like this: <div class='col slider'> <label for="customRange3"><strong>BRIGHTNESS</strong><span…
-
0
votes2
answers65
viewsA: Insert in Postgres with Python is not working
The resolution of the problem was as follows import psycopg2 conn=psycopg2.connect("dbname='teste' user='postgres' host='localhost' password=''") c = conn.cursor() data = list(myarraywhit128values)…
-
0
votes2
answers65
viewsQ: Insert in Postgres with Python is not working
I need to include data and a database of my own, but I can’t and I’m not able to solve the problem. My code is this:: import psycopg2 conn=psycopg2.connect("dbname='teste' user='postgres'…
-
1
votes1
answer465
viewsA: Recover mysql php query with ajax
You can turn all your variaveiz into a json so: $sql = "select * from mensagens"; $query = mysql_query($sql); $chat = mysql_fetch_array($query); echo json_encode($chat,TRUE); and to get the request…
-
2
votes4
answers486
viewsA: Replace a specific character in a <input type="text">
uses this function $('input').keypress(function(e){ if(String.fromCharCode(event.which) == "'"){ event.preventDefault() $(this).val(str + ' '); } }); where the input you put the class of your field.…
-
0
votes3
answers125
viewsA: How to limit extensions that can be saved? (PHP)
you do as follows at the beginning of the page add: ini_set('gd.jpeg_ignore_warning', 1); this does not display a Warning when the image is corrupted or the file type not identified. So validate: if…
phpanswered Jasar Orion 1,052 -
0
votes3
answers971
viewsA: Line with NULL value is disregarded by the SUM function?
Try to use COALESCE ex: SELECT coalesce(sum(qtd_item*vlr_unitario - vlr_desconto),0) from NotaFiscalItem