Posts by adventistaam • 3,354 points
330 posts
-
1
votes0
answers102
viewsQ: How to search using Google Maps Geocode
I would like to use the google api to click on the map and get the latitude and longitude <!DOCTYPE html> <html> <head> <title>Geocoding Service</title> <meta…
-
0
votes1
answer240
viewsQ: Run sh in java
I am trying to run a file in java with the following command System.out.println("Linux"); String[] env = {"PATH=/bin:/usr/bin/"}; String cmd = System.getProperty( "user.dir" ) +…
-
1
votes1
answer344
viewsA: Sort months by Name Jquery Datatables
You can insert the column with the month number and hide using the display: none in the cell Ai "order": [[ 0, "asc" ]] is according to the column In the example below the month index is in the…
jqueryanswered adventistaam 3,354 -
0
votes1
answer67
viewsQ: Return value of an input
I’m trying to get an input value on sweetalert2 trying to follow this example that is there on the site const {value: password} = await Swal({ title: 'Enter your password', input: 'password',…
-
3
votes2
answers290
viewsA: Doubt when performing SQL with Eloquent of Laravel
According to the answers of this question that I found very interesting, I took one of the simplest answers $balances = BankUser::select(DB::raw('SUM(balance) AS total,created_at, DATE(created_at)…
-
2
votes1
answer363
viewsQ: Consultation Eloquent select total
I am trying to group to bring totals in my query that is in mysql SELECT COUNT(*) as total ,e.descricao FROM pedido_cliente p INNER JOIN estabelecimentos e on e.id = p.estabelecimento_id GROUP BY…
-
1
votes1
answer68
viewsQ: Date field only gets the selected previous date
I am trying to get the date value in the field using the bootstra-datepicker, but it only picks up the selected previous date. For example: if date is chosen 04/12/2018 and I choose the date…
-
0
votes1
answer193
viewsQ: Display file data . env in Blade
I would like to read some data from the archive .env on the page .blade.php, but some do not work, for example, I am using the following way: apkey: {{env('PUSHER_APP_KEY')}} #ler chave…
-
3
votes2
answers155
viewsQ: Perform action before saving?
I’m getting the requests form and putting everything at once to save using the protected $fillable = ['nome', 'idade', 'cep', 'nr_casa']; of Laravel I’m getting it like this: public function…
-
0
votes0
answers26
viewsQ: Parameter by name in the query
I have the following appointment SELECT * FROM myTable WHERE ip = 192.168.1.2 I would like to make a query by sending parameter by name using DB::raw() $dados = DB::raw("SELECT * FROM myTable WHERE…
-
5
votes3
answers141
viewsQ: Result range
I have a table where records are saved every 3 seconds 24 hours a day Table: myTable dado1 dado2 dado3 data "135,05" "134,69" "135,10" "2018-11-13 15:38:16" "132,00" "131,91" "132,61" "2018-11-13…
-
2
votes4
answers278
viewsA: What is the Java command that returns the uppercase characters?
Using the for after the split you can Take a look String x = "Shojibur rahman"; String[] myName = x.split(" "); String saida = ""; for (int i = 0; i < myName.length; i++) { String s =…
javaanswered adventistaam 3,354 -
0
votes1
answer44
viewsQ: Bring data from range
I would like to bring even those where there was value in the consultation For example; table dice id | valor | data 1 | 5 | 01/10/2018 2 | 6 | 03/10/2018 3 | 7 | 04/10/2018 5 | 8 | 05/10/2018 I’d…
-
-1
votes1
answer27
viewsQ: Take advantage of
I would like to take advantage of the result of a consultation in another function when requested For example: Controller public function funcao1(Request $request){ $myObj = DB::select("SELECT *…
-
1
votes0
answers99
viewsQ: Update after Insert field
I’m trying to create a Trigger to update a value after inserting, or earlier if it worked. I have the following table: test Remembering that the field type date is timestamp and the default value is…
-
1
votes1
answer133
viewsQ: Clause Where takes too long
I’m wearing the Laravel 5.6 My model is normal <?php namespace App; use Illuminate\Database\Eloquent\Model; class MyTable extends Model { protected $table = 'myTable'; public $timestamps = false;…
-
0
votes3
answers1090
viewsA: array in a php foreach
You can initialize the amount out of the loop <?php $quantidade_ = array(); foreach ($modelo as $k => $v) { $sql_ = "SELECT * FROM pedido WHERE modelo LIKE '%".$v."%' GROUP BY id ASC";…
-
0
votes0
answers38
viewsQ: Menu option back to login
I’m trying to use Adminlte treeview in the system menu, but every time I click on the menu item it goes back to login. For example: When I click on Dashboard, Graphics or Management, it goes back to…
-
1
votes2
answers164
viewsA: Show Json + Mysql + PHP Value
You can first feed the vector and then return or display the vector Example: function decodificar($id) { $arrRetorno = array(); while ($dados = $listar->fetch(PDO::FETCH_ASSOC)) { if ($id ==…
-
0
votes1
answer112
viewsQ: Redirect page after login
I’m trying to redirect to the homepage after logging in, but the system won’t log in Test code I made for demonstration is this: ngOnInit() { this.loginForm = new FormGroup({ login: new…
angularasked adventistaam 3,354 -
2
votes1
answer231
viewsQ: What is a Bootstrapping?
I didn’t quite understand what that would be Bootstrapping. I saw something that was a way to initialize an application. I’m not talking about Twitter Bootstrap.
terminologyasked adventistaam 3,354 -
1
votes1
answer471
viewsQ: req.body nãp works on Express
I’m trying to read parameters sent via post, but the express only shows on the console.log empty objects. This is the code import * as jsonServer from 'json-server' import {Express} from "express";…
-
0
votes1
answer217
viewsQ: Read data from a url
I would like to get data from a url address Researching I found that one reply I implemented for my reality var http = require('http'); var options = { host: 'http://192.168.1.6', path:…
-
-1
votes1
answer45
viewsA: Ajax, send data without updating page
You can put a return false in your form and the rest makes normal $('#expevt').on('click', function(){ alert('Aqui você vai fazer seu ajax enviar' ) //$.ajax() }) <link…
ajaxanswered adventistaam 3,354 -
0
votes0
answers41
viewsQ: Create database
I’m trying to create a database on postgres but am getting the following message: ERROR: cannot set transaction read-write mode During Recovery I have uninstalled, cleaned the registry, installed…
-
3
votes1
answer460
viewsQ: Login page
I’m learning angular. I’m using angular 6 I am trying to make the login page of Admin LTE I imported these files in angular.json "styles": […
-
0
votes1
answer63
viewsA: selection of an item in the combobox
With display block in jquery you can Take a look $('.combo').on('change', function(){ if( $(this).val() != ""){ $('#campo').css('display','block') $('#campo').val( $(".combo option:selected").text()…
-
1
votes2
answers35
viewsQ: Get duplicate values from Vector
I would like to get only the values that are duplicated in the array I’m trying to do it like this: $cdCursos = array(1, 2,3,4,5,3 ); echo "<pre>"; print_r( $cdCursos ); echo "</pre>";…
-
0
votes1
answer2908
viewsQ: Integrate LTE Admin Template at Angular 6
I’m trying to integrate the administration into my project, but I couldn’t It’s like he can’t find the files I already gave the npm i admin-lte --save-dev I’ve already added the files in…
-
0
votes1
answer24
viewsA: Re-use method
I managed to solve by changing the code to return new Promise( (resolve, reject) => { const { pool, errorHandler } = deps pool.connect((err, client, done) => { if( err ){ errorHandler(err,…
-
0
votes1
answer24
viewsQ: Re-use method
I made a query to search a user. It worked! But I tried to make another appointment, he gave this message Error: Cannot use a pool after calling end on the pool 'Cause every time I make a…
-
0
votes1
answer1101
viewsQ: Connection being refused
Following this tutorial of Vedovelli about Ode with restify and mysql, I implemented on the server with pm2. Only after a few days the connection began to be refused Is showing that message: errno:…
-
1
votes0
answers73
viewsQ: Restart Postgres on Windows
I am trying to create a database in Postgres, but is giving the following message ERROR: cannot execute CREATE DATABASE in a read-only transaction I’ve reinstalled and nothing. I’ve already put off…
postgresqlasked adventistaam 3,354 -
0
votes1
answer126
viewsQ: Shuffle List
I would like to shuffle an Arraylist, and I’m trying to do this with Collections.Sort(), but I don’t think it’s happening The code I’m using is this: Thread t = new Thread(new Runnable() { @Override…
-
0
votes0
answers40
viewsQ: Mysql Read HTTP URL
I would like mysql to read a url through a SELECT I searched and saw that you have an answer here. I did the whole procedure as it is in this link, but to no avail select would call the url as in…
-
0
votes1
answer129
viewsQ: Join Mysql tables
I have a table that has the times of the day SELECT * FROM horas The type of the column hora is VARCHAR(5) And a query containing the values of the hours SELECT DATE_FORMAT( date, '%H:%i' ) HORA…
-
1
votes1
answer75
viewsQ: Catch the hours of the day
I have the following select to pick up the hours of the day SELECT '00:00' AS A UNION SELECT '01:00' UNION SELECT '02:00' UNION SELECT '03:00' UNION SELECT '04:00' UNION SELECT '05:00' UNION SELECT…
-
2
votes0
answers43
viewsQ: Send post parameter to restify
I’m trying to send parameter to nodejs with restify, but it’s always coming undefined I’m sending it sort of like this: $.ajax({ url : 'http://localhost:8080/api', type: 'post', dataType: 'json',…
-
2
votes2
answers852
viewsA: Close sweetalert2 when finding the data
I found out! In case anyone needs it, here’s the code $(document).ready(function(){ alerta() }) function alerta(){ swal({ title: 'Auto close alert!', html: 'I will close in…
-
0
votes2
answers852
viewsQ: Close sweetalert2 when finding the data
I wish that when finding the data the sweetalert2 closed the modal. But it returns nothing in . then Here is my code: swal({ title: 'Auto close alert!', html: 'I will close in…
-
1
votes2
answers188
viewsA: Create multiple PHP variables in the same function
You can make the function return an array (array) In the a.php file you enter the information: a. php <?php function funcaoExibe( $nome, $email, $telefone ) { $retorno = array( 'nome' =>…
phpanswered adventistaam 3,354 -
0
votes0
answers27
viewsQ: Constant value throughout the project
I am using a structured PHP project index php. <?php require 'vendor/autoload.php'; $dotenv = new Dotenv\Dotenv( "C:/env" ); $dotenv->load(); define('VARIAVEL', getenv( 'NOME_DA_VARIAVEL' ));…
phpasked adventistaam 3,354 -
1
votes2
answers3695
viewsQ: Increase the textarea size
I’m trying to use the Sweet Alert 2. I would like to increase the textarea field using the Rows attribute, but it is not working. How do I increase the field size? $('.btn').on('click', function(){…
-
0
votes2
answers473
viewsA: Change value select via ajax as another select with static data
Since you won’t consult in the database, you can make an array in javascript just waiting to put combobox when choosing the option var catraca = [ {value: 'I', text: 'Irrelevante'}, {value: 'E',…
-
0
votes1
answer181
viewsQ: Route with variable
I would like to know in Laravel, when saying the name of the route, it accepts the variable, instead of the name itself, as for example: Example: Instead of being like this: {{ route('minhaRota') }}…
-
1
votes2
answers169
viewsA: Search by date in Mysql does not work
I noticed by looking at your code that the quotes of $sql is not closed And I saw that in execute has a parameter, usually has not. Follow my suggestion: A file called class.dao.php class Dao {…
-
0
votes1
answer35
viewsA: Accounts how many equal ids and make a larger result table for the smaller
You can make a subselect to count the number of comments per post and then sort in descending order SELECT p.id ,p.titulo_postagem ,a.total FROM postagem AS p JOIN ( SELECT COUNT(c.*) total,…
phpanswered adventistaam 3,354 -
0
votes2
answers1354
viewsQ: Select from cursor
I am trying to make a trial with the following mysql block: DECLARE done INT DEFAULT FALSE; DECLARE v_id INT; DECLARE R CURSOR FOR SELECT id ,nome FROM pessoa d DECLARE CONTINUE HANDLER FOR NOT…
-
0
votes2
answers46
viewsQ: Know URL read time
I’m reading the content that has a url Using the following code block: String urlNormal = "http://minhaurl"; URLConnection conn = urlNormal.openConnection(); BufferedReader input = new…
javaasked adventistaam 3,354 -
0
votes0
answers76
viewsQ: Add Object to Jcombobox
I’m trying to add an object in the jCombo box, but, it’s saying showing the message that the Object cannot be converted to String, being that I’m using the public String toString() Follow the Model…