Posts by Gabriel Augusto • 530 points
49 posts
-
0
votes2
answers55
viewsQ: Find the index in a value-based array of dictionaries
If I have an array of dictionaries and want to find the index in the array of a certain dictionary value, as I do? Ex: palavra1 = {'palavra': 'valor1'} palavra2 = {'palavra': 'valor2'} palavras =…
pythonasked Gabriel Augusto 530 -
1
votes2
answers1389
viewsQ: Fetch a value within an array of dictionaries
Hello, I’m doing the following in python: I created an array of dictionaries and would like to search within this array if a given word exists. Ex: palavra1 = {'palavra': 'sim', 'positivo': 0}…
pythonasked Gabriel Augusto 530 -
1
votes2
answers1295
viewsQ: Create a frequency table based on another column in Python
Good afternoon, you guys. I have a data set in a file. csv, containing two columns: tweets and rating, where 'tweets' corresponds to any tweet searched on twitter and 'rating' corresponds to…
pythonasked Gabriel Augusto 530 -
0
votes1
answer254
viewsQ: Google maps does not work within the bootstrap modal
Hello, everybody. I’m developing a register that uses the Google Maps API to find an address and I’m trying to use it within a modal, but when I put inside the modal, it doesn’t show the map and…
-
0
votes0
answers51
viewsQ: How to expand a list item in mobile browser?
I have the following navbar on my website: <div class="navbar-custom"> <div class="container"> <div id="navigation"> <!-- Navigation Menu--> <ul…
-
0
votes3
answers701
viewsQ: (Laravel) How to ignore null values in $request->all()?
I am developing a filter system in which the user may or may not fill in some form fields. In the controller, I’m trying to do a Where as follows: //demais filtros $imoveis = Imovel::where([…
-
1
votes1
answer830
viewsQ: Why doesn’t my modal close?
Why doesn’t my modal close? I couldn’t find anything wrong, especially when compared to other similar fashions that I have. When I click the close button, it does not give the Ismiss, do not…
-
0
votes2
answers3707
viewsQ: How to fill a select with Eloquent?
I’m using the Laravel 5.5 and trying to fill a input select with the Eloquent and using the following code: In the controller: $tipos = Tipo::pluck('nome', 'id'); return…
-
0
votes2
answers750
viewsA: (bootstrap and php) How to create a row every 3 database records
I ended up using the example of the following link: https://stackoverflow.com/questions/40561301/loop-row-in-bootstrap-every-3-columns/42837768 Using the PHP array_chunk function that separates an…
-
0
votes2
answers750
viewsQ: (bootstrap and php) How to create a row every 3 database records
Guys, I have a template that has the following: <div class="row"> <!-- INICIO --> <div class="col-md-4"> Aqui vem uma imagem e o nome de um imóvel </div> </div> <!--…
-
1
votes0
answers33
viewsQ: Fill base view data only once
I have a view base that has a several dropdowns which depend on database values, calling it "base.blade.php". I also have several other views that extend from this base, for example:…
-
0
votes0
answers522
viewsQ: How to validate uploading multiple files in the Windows
I have the following validation rule in the controller: $validator = Validator::make($request->all(), [ 'nome' => 'required|max:255', 'valor' => 'required|numeric|min: 0', 'imagens' =>…
-
0
votes1
answer136
viewsQ: After Variable validation fails, choose a select option
Hello, guys, I have two combos: one states and one cities. When I choose a state, I search the cities via ajax, as follows: $('#estados').on('change', function(e){ console.log(e); var id =…
-
2
votes2
answers1412
viewsQ: Request Variable does not return input file
Why can’t I get the View file? I have a form that directs to a route. Among other attributes, I have an upload of files. This file upload is the only attribute not shown in request. <label…
-
0
votes0
answers271
viewsQ: Laravel Foreign key Constraint incorrectly informed
I couldn’t find where the bug is in my Migration, honestly. Can anyone there understand why I’m making the following mistake: SQLSTATE[HY000]: General error: 1005 Can’t create table…
laravelasked Gabriel Augusto 530 -
3
votes1
answer53
viewsQ: (SQL) Each property has multiple images and a cover image
Suppose I have a Real Estate table where a property can have multiple images. I have therefore another table, Images, with the url. I also have an intermediate table that makes the relationship N:N…
-
1
votes1
answer600
viewsQ: Use the Laravel diff in two Collections
I am trying to fetch items that are not in a particular product. I therefore have a model Produto, each product has several items, and another model Item. I’m trying to use Collections of Laravel,…
-
5
votes3
answers436
viewsQ: How to order the query in the same order as an array used in Wherein?
I would like Laravel to return me a list of products where the ID belongs to this array: [12,5,1,8,16], but sort by id as per array order!* What I have so far: $produtos = Produto::whereIn('id',…
-
1
votes1
answer445
viewsQ: Find the best-selling products (Laravel / eloquent)
In the Table, assuming there is a 'Product' model (whose table is products), an 'Account' model (whose table is accounts), and an N:N relationship between accounts and products, in the Product…
-
0
votes1
answer131
viewsQ: Initialize the graph in matplotlib and then insert elements
Hello. Is there any way I can first open a chart with matplotlib and, after opened, perform some operations? Ex: open graph and then plot a straight line, then another, so on. I know there are some…
-
0
votes0
answers1103
viewsQ: int Object is not subscriptable (python)
I’m new using Python and I don’t know why the error is: Traceback (Most recent call last): File "C: Users Gabriel Desktop Perceptron.py", line 51, in print(perceptron(max_it, errors, alpha, inputs,…
pythonasked Gabriel Augusto 530 -
2
votes1
answer877
viewsQ: jQuery does not recognize event . click of a class added with append
Guys, I’m not getting to make the event . click a button that is added with the append command work. Here is the function that contains the append: function mostrarUploads(nome, tabela) { var $table…
-
2
votes1
answer52
viewsQ: Searching for the next table after a clicked element
Hello, I’m trying to fill the next table closer to the clicked button, but I’m not getting. It is important that it be the next one right after, because there are several tables with the same class,…
-
0
votes2
answers476
viewsQ: Request ajax with append before opening modal
For some reason I’m not getting this append to work. function mostrarUploads(id) { $.ajax({ url: "/painel/mostrarUploads", async: false, method: 'POST', data: {_token: jQuery(".token").val(), id:…
-
1
votes1
answer78
viewsA: Use jquery component inside a formData (fileupload)
I found the answer, it was a mistake in timing. The plugin itself provides a bind method. I looked at the documentation and managed to implement the following, which solved the problem:…
-
0
votes1
answer78
viewsQ: Use jquery component inside a formData (fileupload)
Friends, I am using the jquery fileupload plugin and using the following callback: jQuery("#fileupload").fileupload({ url: '/painel/uploads', dataType: 'json', formData: {_token:…
-
1
votes0
answers276
viewsQ: How to debug an ajax request for a route?
I am making an AJAX request on a route, using the Aravel, as follows: $.ajax( { url: "../controle/pendentes/concluirVarias", type: "POST", data: { ids: arrayIds , _token: '{!! csrf_token() !!}' },…
-
1
votes0
answers37
viewsQ: Create your own scope with each ng-repeat iteration
I’m trying to make a table of values to be filled and stored, row by row. However, even after filling and storing the first line, by changing the value of a select, the select of all lines above the…
angularjsasked Gabriel Augusto 530 -
1
votes1
answer148
viewsQ: First directive at the angle
I’m trying to make a simple directive on Angling for example. This is a button that takes the class name and text as follows: var app = angular.module('app', []) .controller('appController',…
angularjsasked Gabriel Augusto 530 -
0
votes1
answer88
viewsQ: Overflow-y is leaving a blank in the table width
Hello. I am trying to make my table have a scroll, as follows: <table ng-if="vm.model.id" width="100%" class="table table-striped table-bordered table-hover dataTable no-footer" style="width:…
-
1
votes2
answers1567
viewsQ: Error: "Can’t connect to local Mysql server through socket"
I just created a domain on Ocaweb and created a website and database. When accessing the site, it loads part of the page, but I have the following error: SQLSTATE[HY000] [2002] Can’t connect to…
-
3
votes3
answers455
viewsQ: Trying to fill an array with days from now until thirty days from now
Hello, folks, I’m trying to fill an array with days from the current day until 30 days from now. Here is a problem: if today is the 8th, in 30 days it will be 38, but I want the count to return to 1…
javascriptasked Gabriel Augusto 530 -
1
votes0
answers51
viewsQ: Chartjs only starts the chart when I zoom in on the page
Guys, for some reason my chartJS chart only shows the data when I press Ctrl+shift+i to open the console or when I change the page zoom, which is not very interesting for a user. I’m testing on my…
-
0
votes0
answers89
viewsQ: Printing array with console.log is giving different result from accessing directly
Guys, when I print the 'vertical' array, I get the following: (30) [0, 0, 0, 3.21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 104.11, 0, 0, 0, 0, _chartjs: Object, push: Function,…
javascriptasked Gabriel Augusto 530 -
0
votes1
answer498
viewsQ: How to return the result of a select with Prepared statement?
Guys, I’m not getting back the result of a search with Prepared statement. Here’s the code: public function search($obj) { $connection = new Connection(); $this->db = $connection->conectar();…
-
1
votes1
answer1855
viewsQ: include failed to open stream
Ladies and gentlemen, please help me. I have a.php client file, which has a client table to fill. The data that will fill this table is in the Client.php class. I am therefore using a include…
-
1
votes1
answer389
viewsQ: Pass a javascript parameter in the middle of an append
Without too much hustle, I’m stuck on the following problem: I have the following JS code: data.forEach(function(item) { $("#bodyTabelaClientes").append( "<tr><td style = 'text-align:…
-
1
votes2
answers1223
viewsQ: SQL - Searching for best-selling product in a date range
I’m trying to search with SQL the best selling product within a certain period. For this, I have the table 'conta_products', which has the following columns: id (PK) | conta_id (FK) | producto_id…
sqlasked Gabriel Augusto 530 -
-2
votes2
answers1162
viewsA: SQL Group same ID with another condition
Well, I’m sorry, I managed to settle just by using group by with more than one column, as follows: SELECT Count(*) AS quantidade, conta_id, produto_id, precofinal FROM conta_produtos GROUP BY…
-
1
votes2
answers1162
viewsQ: SQL Group same ID with another condition
I believe it’s a little specific question, because I haven’t found anything related yet. I have a table called contas_produtos, which is a relationship Nxn between the tables contas and the table…
-
1
votes3
answers3285
viewsA: Search word in Php text
If there is no reason for you to go through all the lines of the file, just like you are doing, using foreach, why not just print the first line using: <?php $search="<ID>"; $lines =…
phpanswered Gabriel Augusto 530 -
1
votes0
answers1009
viewsQ: Modal bootstrap does not work in Chrome browser
I have a problem in my web system done in PHP/Laravel: I have a loop loop and inside this loop I have a button for each item, which opens a modal of bootstrap, as follows: <button name =…
-
0
votes1
answer787
viewsQ: Asset function of the Laravel is not referencing
I have a project and I honestly do not know what I did differently, but at the time of opening it, out of the blue all images, files css and javascript are not being referenced. I’m using the…
-
0
votes1
answer465
viewsQ: Add button under div using the after() function
Good afternoon! I have the following situation: Multiple Ivs, side by side, using display: inline-block. I want, by clicking on a div, I can put a button underneath of this div. I started using…
-
0
votes2
answers661
viewsA: (Laravel) method $.get can’t find route
it was all a big mess of routes... As I had said, it occurred after I made a new feature (which was a function to make an ascending and descending select), which used a route…
-
1
votes2
answers661
viewsQ: (Laravel) method $.get can’t find route
Eae guys, all right? I would really like your help because I’ve been stuck in this problem for a couple of days and I couldn’t figure it out on my own. I have a multi-row table with a checkbox on…
-
4
votes1
answer978
viewsQ: Pass a view JSON to the route
I’m trying to send a JSON of view for a route, but I’m not getting it. Unfortunately I know little about JSON, ajax, GET and POST. In the view, the json: var json = { "numeroMesa": numeroMesa,…
-
0
votes3
answers2915
viewsA: How to access a private attribute of a class in another class?
I don’t know if I understand it very well, but would putting a public 'getPorta' method in your Server class not solve your problem? Ex: public class Servidor { private int porta; public int…
-
2
votes2
answers3013
viewsA: Change variable value after clicking PHP button
So, friend, the way you want to do, using PHP, I don’t know if it’s possible, unless you pass an initial HTML value to PHP and make an ajax request for PHP to process this number, increment it in…