Posts by JB_ • 561 points
48 posts
-
2
votes1
answer112
viewsQ: Sum of all integers within a List<int>
I have a way: public static int soma(params int[] n) { int resultado = 0; for (int i = 0; i < n.Length; i++) { resultado += n[i]; } return resultado; } On my console: List<int> numeros =…
-
0
votes1
answer732
viewsQ: Loop to run python scripts
I have a loop process to run scripts in parallel, but the VPS that I will last does not allow to use parallelism, In that case I need to create a code like: scripts = [ 'siteodonto.py',…
-
0
votes1
answer95
viewsQ: run python file list with shell script
My code: #!/bin/bash scriptspy =( '/scs/sp1.py', '/scs/sp2.py', '/scs/sp3.py', '/scs/sp4.py', '/scs/spweb.py', '/scs/sp11.py', '/scs/spservice.py', .... ) for i in scriptspy; do python3.7 $i; done…
-
0
votes1
answer134
viewsQ: Loop to perform quantity processes in quantity
I have a size 30 list in python, I need to make a loop to catch 6 item from that run list, after we finish the 6 run over 6 and so on until finalizing the list. but I’m not finding a way to do that.…
-
1
votes2
answers310
viewsQ: Regular expression to get number between two bars
I have a code that takes a certain URL, divides it and returns me a list. url = 'https://www.site.com.br/categoria-produto/category/page/67/? gclid=Cjkdksjkcm35522' last_page = url if…
-
0
votes1
answer142
viewsQ: How to create an Array within the other
I need to create an array that has Indice and values page_links receives the links of a page all_links_main = [] for link in page_links: all_links_main.append(link.get('href')) produto = [] for…
-
4
votes1
answer290
viewsQ: How to get a PHP file past $.ajax?
I’m having a problem I don’t know if it’s sending in $.ajax or picking up with PHP. Is not coming the $_FILES normal on the other side, arrives as 'caminhofoto' => string 'C:\fakepath\1.jpg'…
-
0
votes1
answer282
viewsQ: How to take individual td values from dynamic table without clicking on the row
I have a button that sends the form, and inside the form have the respective fields, inside the fomulário has a table that brings dinanmicamente the data of the database that is allows editing of…
-
1
votes1
answer1080
viewsQ: Generate dynamic id in html and catch with Jquery
I have an HTML table that gets the values from the database. Each row of the table, when clicked on the icon need to take the values of this line and when opening the modal show this information in…
-
0
votes0
answers85
viewsQ: Store global Ajax data return
I am currently using ajax making several different requests for queries. Ex: $.ajax({ method: "POST", url: "getData.php", data: { nome:nome, endereco: endereco } }) .done(function( data ) { var…
-
0
votes3
answers90
viewsQ: Give form Ubmit with empty field validations
I have this code that validates a form if it has several fields but it does the form Submit: $("#btnAdd").click(function (e) { e.preventDefault(); var erros = 0; $("#formAdd input").each(function ()…
-
0
votes1
answer86
viewsQ: Fill modal to edit with information coming from the database based on id
I need to fill a Modal in edit mode based on the received id. My code: $("body").on('click', '#editfoto', function () { $('#modalEdit').modal('show'); id = $(this).data("idedit");…
-
1
votes1
answer734
viewsQ: Edit data in modal filled with php database data
I have a form that edits the database data based on the received id. /* função para atualizar os dados quando clicado em submit */ $('.editfoto').submit(function () { var form = $(this); var dados =…
-
1
votes1
answer246
viewsQ: How to update a page after Insert, update or delete with ajax without reflesh
I have the code on the exten page delete.php that makes the actions, HTML: <div class="modal fade" id="modalAddfoto" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"…
-
0
votes0
answers52
viewsQ: Load information into modal inputs based on id sent by clicking the data-id link
Using the bootstrap documentation, made a change of a href for button <button type="button" class="btn-a" data-toggle="modal" data-target="#EditaFoto" data-whatever="<?php echo $row['idfoto'];…
-
0
votes1
answer552
viewsQ: How to get the link from a specific bootstrap tab
I have a page that uses the Tabs navs of bootstrap 4.1, I’m looking and I can’t find a solution, I want to make sure that by clicking on a link it opens a specific 'tab' of the bootstrap. In this…
-
0
votes0
answers77
viewsQ: Get id via URL in JS sent by PHP
I have a code that plays an ID in HTML for a link: <a href="javascript:confirmacao(<?php echo $row['idfoto'] ?>)"> <i class="fas fa-trash"></i></a> Already in…
-
1
votes2
answers482
viewsQ: Calculation of interest and fines in PHP
I’m making a code that calculates interest and fines on PHP based on the amount of days past due. However, I’m having trouble getting the date and making this calculation. $databx = new DateTime();…
-
2
votes1
answer75
viewsQ: Bring the sum of IDS and data into two tables using SQL
I need to make an SQL to bring me the data of: `DATA | QTDE IDTa | QTDE IDTb | VALORa | VALORb | Saldo (diferença de VALORa - VALORb) ` However I am not able to bring the data correctly with this…
-
0
votes1
answer1251
viewsQ: Convert PHP data to save to Mysql database
I need to receive a date using the datapicker as dd/mm/yyyy and switch to database format (mysql). have the access methods (Getter and Setter) in them applied this date function and strstring to…
-
0
votes1
answer36
viewsQ: pick private user id of a session
I want to get an id of a user who is recorded in the session, I’m trying to serialize the object when created: $_SESSION['usuario'] = serialize($objUsuario); and to recover I tried to use: echo…
-
1
votes1
answer1837
viewsQ: Validate dates with Jquery validate for dd/mm/yyyy
I want to validate the dates with Jquery Validate, but error, I researched a lot more the solutions found did not solve my problem. my JS: // incluir todos elementos do form na pagina…
-
1
votes0
answers157
viewsQ: Redirect to url with bootstrap tabs 4
I have this html code using bootstrap tabs: <div class="tab-pane fade" id="nav-fotos" role="tabpanel" aria-labelledby="nav-fotos-tab"> <br> <div class="container"> <button…
-
0
votes1
answer36
viewsQ: Resume a #div via PHP jo Ajax file
My problem is, I have a table that displays the information you have in the database registered information in the index. And in the index you have the option to add a new record (Modal Ajax) in the…
-
0
votes0
answers385
viewsQ: How to take modal bootstrap data and send it to PHP
I need to get the data from the Modal form via Ajax My code: var url = 'fotovisita.php'; var data = $('#foto').serialize(); var type = "POST"; $(document).on('click', '#save-foto', function () {…
-
1
votes1
answer216
viewsQ: Grab bank ID to load into HTML select
How can I get bank ID to load into HTML select My function like this: public function ComboBox($sql, $idcampo, $selected) { $cn = conexao::getInstance()->prepare($sql); echo "<select name='" .…
-
-1
votes2
answers1781
viewsQ: Pick radio button value and check what is selected
I have a form with a radio button with Individual and legal person. I want that if the person button is selected change the label attribute from html to CPF otherwise CNPJ, and apply the masks…
-
1
votes1
answer985
viewsQ: How to ignore a subfolder with gitignore
How to ignore a subfolder with gitignore? in my case only the sub-folder /vendor My structure / /Systema/vendor my git is on the project root my gitignore too !systema/ systema/vendor/* I tried this…
-
1
votes1
answer319
viewsQ: Doubt about autoload php
About autoload I studied about: Autoload for classes in the same folder function __autoload($nomeClass) { require_once ("$nomeClass.php"); } Autoload for classes in specific folders…
-
1
votes1
answer779
viewsQ: Loop to receive form data and save with array
I’m wanting to receive the form data with loop, I located an example like this: foreach($_POST as $nome_campo => $valor) { $comando = "$" . $nome_campo . "='" . $valor . "';"; eval($comando); }…
-
1
votes0
answers28
viewsQ: Lumen project creation error: Application ready! Build Something Amazing
I did the installation following the indications of the documentation, but when running Lumen new [project] it simply returns the message: Application ready! Build Something Amazing. , creates…
-
0
votes1
answer218
viewsQ: Declare Entity Framework Relationship one for many
I have two classes: Person public class Pessoa { public int Codigo { get; set; } public string Nome { get; set; } .... public virtual ICollection<Endereco> Endereco { get; set; } } Address…
-
2
votes2
answers1332
viewsQ: Relationship one for many and many for an Entity Framework
I am developing these classes of this diagram, but I am in doubt how to declare relationships [One for many, and many for one] This is the diagram: for example Product has a Category, and a Category…
-
1
votes2
answers241
viewsQ: Validation in Edit and Delete operations by ID at url
I tested by taking the id and passing via url, normally performs the operation as long as it exists, otherwise error as expected. EX: http://localhost:55199/Person/Delete/7…
-
2
votes1
answer53
viewsQ: When there is no string specification with the configured class where the Entity Framework creates the tables
I created a new project using Asp.Net MVC with EF, and did not configure the connection string property with the same name as the Context class : Dbcontext. Rodei enable-Migrations -> worked…
-
0
votes1
answer1271
viewsQ: Error CS0012 The type 'Client' is defined in an Assembly that is not referenced
Handling class with RU: ContextEF Contexto = new ContextEF(); public List<Cliente> Listar() { //var query = from c in Contexto.Cliente // select c; return Contexto.Cliente.ToList() ; } Onclick…
-
1
votes3
answers1150
viewsQ: Handling Foreign key errors in Codeigniter
I am implementing a code where there is a foreign key in two tables. Soon I tried several means and could not handle the error: Error Number: 1451 Cannot delete or update a parent row: a foreign key…
-
1
votes1
answer392
viewsQ: How to list all files in ". ts" format of folders and subfolders to be converted to ". avi"?
I found a shell-script and modified it to meet my need and stayed like this: #!/bin/bash [ "$1" ] && cd "$1" ls -1 *.TS [ "$?" -ne 0 ] && echo 'Sem arquivos TS nesse diretório'…
-
0
votes1
answer55
viewsQ: Error in anonymity function does not allow compiling
I am studying a PHP OO book. There is an example of anonymous function, but is giving error: # FUNÇÂO ANONIMA $remove_acento = function($str) { $a = array( 'à', 'á', 'â', 'ã', 'ä', 'ç', 'è', 'é',…
-
0
votes1
answer520
viewsA: Problem with Nginx configuration
I was able to solve the problem by helping the instructor: the error was just where: Location ~* . (?: ico|css|js|gif|jpe? g|png)${ and Location ~ . (php|phtml)${ put a gap between $ and {: Location…
-
0
votes1
answer520
viewsQ: Problem with Nginx configuration
Hail personal, I’m having trouble with this setup: local do arquivo: /etc/nginx/conf.d/virtual.conf # # A virtual host using mix of IP-, name-, and port-based configuration # server { listen 80; #…
-
4
votes2
answers7173
viewsQ: Firebird SQL auto-increment
I’m taking an SQL/Modeling course in mysql the creation of a composite table would look like this: USE banco; CREATE TABLE clientes( cli_id integer not null auto_increment, cli_nome varchar(20) not…
-
3
votes3
answers506
viewsQ: User way to include new pages on a website without programming
Just as in Wordpress you have the option to create, edit, display and edit pages I know I can use WP, but for learning I would like to do programming. I’m trying to develop a function in my panel…
-
1
votes1
answer198
viewsQ: Doubt about the Doctrine dbal project structure
I read the Documentation the only thing I didn’t understand was what his structure is like. Explain: My file composer.json at the root of the project { "require": { "doctrine/dbal": "2.4.*" } } When…
-
1
votes2
answers37
viewsQ: Doctrine DBAL dev version
See only the dev version is paid :? I’m talking because you’re making a mistake again: "C: bin Composer.bat" "-ansi" "-no-Interaction" "validate" . /Composer.json is invalid, the following…
-
1
votes0
answers85
viewsQ: Plugin javascript or jquery stars
Obs: I don’t know if you can ask this question here, if not! Please disregard/delete. Does anyone know any plugin that I can make this screen(the rating): Where this classification I’m trying to do,…
-
1
votes1
answer133
viewsQ: Doctrine DBAL bank operations DB
To make bank operations and better use(or which to use): Data manipulation Query-Builder To work with data manipulation ? and how I would do to make bank operations will go with it for example:…
-
2
votes2
answers3709
viewsQ: Crud Energy with PDO
The connection part is ready: <?php /* * O padrão Singleton */ abstract class Conexao { const USER = "root"; const PASS = ""; private static $instance = null; private static function conectar() {…