Posts by Murilo Portugal • 2,092 points
82 posts
-
2
votes1
answer71
viewsA: Display Mysql search results according to the sequence shown in the in clause
Use the ORDER BY FIELD(), thus: sql = select var_valor from tabela where var_codigo in (4,2,7) order by FIELD(var_codigo, 4,2,7); In the case of the example you posted in SQL Fiddle, it would look…
-
0
votes1
answer184
viewsA: Sequential update SQL
Friend, I believe that the easiest way to do this will be to use some programming language to compare the previous value with the current one and have a better control of the data. Below is an…
-
2
votes1
answer78
viewsA: Get data stops with Node.JS
Friend, I’m assuming that this ajax code of yours is running on the same URL as your Node API, so at the url of your ajax you’re not passing the full path, only the /api/post, correct? Well, if so,…
-
2
votes3
answers224
viewsA: Selection of the first number from a list
Friend, you will need to control with an auxiliary variable every time the value returns to negative. See the code below valores = [-1,-2,1,2,-2,-3,4,5] aux = 0 for atual in valores: if atual <…
-
1
votes1
answer72
viewsA: Inheritance in classes
@Diovana, you’re not adding because of your method: def acrescenta_lista_socio(self, Carteira): self.lista_de_socios.append((self.numero, self.bilhete)) Note that in the second line you are giving…
pythonanswered Murilo Portugal 2,092 -
0
votes1
answer94
viewsA: Value storage problem of a variable in Arduino: it reads a value and saves for two cycles, is there any way to solve this?
Oops, nice to see that you followed the tip I gave you to send only the UID by serial and wait for the answer if it exists or not, and no longer recording the database Uids in the memory of the…
-
0
votes3
answers103
viewsA: Send error for duplicate login C#
Friend with Try-catch you will not be able to validate that the login already exists. Behold: Firstordefault(Ienumerable) Returns the first element of a sequence or a default value if a sequence…
-
1
votes1
answer50
viewsA: Use this in onclick event to set css style in specific element
Friend, instead of using jquery to change the opacity property, try using pure JS by taking the button ID like this: document.getElementById("qbutton-<?php echo $_item->getId();…
-
1
votes1
answer33
viewsA: SQL: Sort by columns from another table
Without you to inform the table fields it is difficult to assemble a more specific query. But by the example below I believe you can understand what must be done. SELECT u.CamposDaTabelaUtilizador,…
-
1
votes1
answer390
viewsA: Display number that most repeated and its quantity
Friend, besides the aux > count as @Anderson commented, in its code else: print(repetido(entrada, n)) You ask to print the return of the repeated function() but it is not returned anything. Apart…
-
2
votes1
answer211
viewsA: Consumption of all dynamically allocated space in Hyper-v with freebsd
Friend this gives to the fact of the type of disk they chose when creating the server. See, the Hyper-V te 3 options fixed, dynamic and differential. Fixed In this format it will already allocate…
hyper-vanswered Murilo Portugal 2,092 -
0
votes1
answer33
viewsA: Click the button and hide two other buttons
can use a very simple function with javascript for this, take a look at this example. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport"…
-
0
votes1
answer8975
viewsA: Error in Node.JS
Friend by what is described in his error, he is not finding the module http-errors. This module must be present inside the folder node_modules which is usually at the root of the project, along with…
-
0
votes1
answer48
viewsA: INNER JOIN Horizontal Results
You can make the select so: SELECT e.*, ( SELECT ',' + ContatoNome AS 'data()' FROM #Contato where idEmpresa = e.Id FOR XML PATH('') ) as contatos FROM #Empresa as e Utilize this site to test.…
-
1
votes1
answer429
viewsA: How to pick up portions of texo inside a site using Curl
Friend what you want to do is called Web Scraping, below follows an example with Curl. $curl = curl_init('www.pudim.com.br'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $page =…
-
0
votes2
answers625
viewsA: How to manipulate Date attribute from a Python Json result
convert the JSON date can do as per the code below. I left to glory in the code’s comments and not here in the answer to make it easier to understand. import json; import datetime; dados =…
-
2
votes1
answer78
viewsA: jSSC does not find the USB ports of my PC
Just to clarify that we are talking about the same thing, the JSSC library is used for communication SERIAL, it will not communicate with your USB devices unless this device simulates a serial port…
-
1
votes1
answer79
viewsA: Click/Reset Button
If what you want is that the same button that increments, when arriving at 99° click itself reset and back from the beginning, could do the following, in the registerClick function puts it to check…
-
5
votes1
answer123
viewsA: Search for products with more than one word Delphi
You can only do this using good old SQL. You would need to concatenate all the fields you want to filter and add an alias to it. SELECT Nome+' '+Marca as campoBusca from tabela_produto The return of…
-
1
votes2
answers132
viewsA: Filter results from BD with JS (no refresh and no request to other pages)
Friend, as you said you only need to hide the Divs as the user type the name in the input the code below can help you. By entering the name in the input field and pressing the ENTER key to trigger…
-
2
votes2
answers350
viewsA: Show json output on jquery and html screen
You can solve your problem in many different ways, one way simple is to use a table. With javascript you can assemble this table and use innerHTML and insert it later in the page. I created this…
-
1
votes2
answers99
viewsA: I cannot run a query with jdbc java
Friend change your code ResultSet resultSet = prepareStatement.executeQuery(sql); To ResultSet resultSet = prepareStatement.executeQuery(); You do not need to pass the query as a parameter of the…
-
0
votes1
answer85
viewsA: Get the page title within a Javascript dynamic variable
You could use the attributeStartsWith jQuery. Follow the example of the site: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>attributeStartsWith…
javascriptanswered Murilo Portugal 2,092 -
1
votes2
answers209
viewsA: $. each on a JSON of cities
That way I think it solves your problem. var cidade = [ { "sigla": "AC", "nome": "Acre", "cidades": [ "Acrelândia", "Assis Brasil", "Brasiléia", "Bujari", "Capixaba", "Cruzeiro do Sul",…
-
1
votes2
answers227
viewsA: Error in creating Rest api in Javascript
Friend, change in INSONIA your http request the key "tasks" to "tasks" as this in your code. (as mentioned by friend Christian Luã Lemos) const { title, description, tasks } = req.body; Other than…
-
0
votes1
answer97
viewsA: Nodejs Duplicate data when using Request Api
Friend, I think your problem is in your crontab. In your code you make a schedule (Schedule) to run the select function(client). Let startTime = new date(Date.now() + 1000); var j =…
node.jsanswered Murilo Portugal 2,092 -
2
votes1
answer4074
viewsA: What does Expressjs urlencoded mean in practice?
Good night. The "Extended" option tells the express which library it should use to make the Parsing of the content of the requests it receives. When Extended : true will use the library Qs and when…
-
-1
votes2
answers266
viewsA: How to store the values of a phpMyAdmin table in a variable/array/array and use it in Arduino code?
Good night buddy. My challenge now is to take a column of this database (which would be the registered Uids) and play in a variable to use in the Arduino code to look something like: From what I…
-
1
votes1
answer81
viewsA: How do I switch players in this java script code?
That way I think it solves your problem. <script> alert("Erre o numero entre 1 e 100 para ganhar!"); var ValorMinino = 1; var ValorMaximo = 100; var Aleatorio = Math.floor(Math.random() *…
javascriptanswered Murilo Portugal 2,092 -
1
votes2
answers524
viewsA: Validate Form Jquery
The reply of the friend @Ricardo Pontual is quite complete. But as you said your problem is validation before of the shipment, I am assuming that the shipment is ok and you do not want to change, so…
-
0
votes1
answer55
viewsA: My subquery is overwriting a column of the searched table
Good night. Well, from what I understand you have the home table and the post table, and from the looks of the relationship the tables would be that 1 house can do N posts correct? So I believe that…
mysqlanswered Murilo Portugal 2,092 -
3
votes1
answer3054
viewsA: Nodejs / Mongodb: Deprecationwarning: Current URL string parser is deprecated, and will be Removed in a Future version
Do not put { useNewUrlParser: true } inside your url variable, you must put it as the second parameter in the connection object. thus: const mongoClient = require("mongodb").MongoClient;…