Posts by Victor Hugo • 409 points
21 posts
-
3
votes3
answers1939
viewsA: Separate integer and decimal part into a number using Javascript
To solve this problem just convert your number to string using the method toString: var numero = 45.5; var numero_str = numero.toString(); Do this, use the function split(), that will return an…
javascriptanswered Victor Hugo 409 -
1
votes3
answers2843
viewsQ: How does train_test_split work in Scikit Learn?
I am learning machine Learning and in most examples is used the method train_test_split() and there is not a very precise explanation about it (at least not in the articles I’ve read). I know your…
-
0
votes1
answer1805
viewsQ: How does pivot table work on pandas?
I’m new to data science and I’m trying to use the Dataframe.pivot() of the Pandas to create a heatmap but he’s returning me this mistake: Valueerror: Index contains Duplicate Entries, cannot reshape…
-
2
votes3
answers2524
viewsQ: Divide date (day, month, year) into new columns - Dataframe Pandas
I have a DataFrame and needed to give a split in his date field to later add month and day columns. The problem is that the field data Dataframe is not the type str, so I can’t use the method split.…
-
4
votes1
answer12477
viewsQ: Upload image with Axios to a Node.JS server
I’m trying to upload an image using the library Axios, but she’s not getting into the back-end. Image input <input type="file" class="custom-file-input" id="file" name="file"> Note: My form…
-
0
votes1
answer895
viewsQ: CORS is not enabling
I developed a API REST in Node.js and I need to use it in my front-end. I’ve installed the library Cors and enabled on my server but continues to give the error of access when making the request…
-
0
votes1
answer34
viewsQ: Capture query string in Wordpress
I’m trying to capture the query string paged on the main page to call a component and load the data. However, its return is always 0. When I use this component on other pages, it works normally. URL…
-
2
votes3
answers120
viewsQ: Problem with javascript filter in various JSON
I’m trying to capture a certain product for your ID using the filter but there are some problems. It is only returning an empty array. The products are stored within Categories, that is, there is an…
-
1
votes4
answers89
viewsA: Repetition is not equivalent to one second
You can use the time.sleep() to perform an iteration with a given estimated time. import time for i in range(0, 3): time.sleep(1) print "Hello World" This code snippet will print the Hello World 3…
-
2
votes1
answer721
viewsQ: Questions about Authentication Token (JWT)
For a while I used the Json Web Token (JWT) to do the entire authentication process of most systems on which I work on Node.js. But today, developing one of my personal projects, I took a look at…
-
0
votes2
answers151
viewsA: Remove div if input is empty
In fact, your condition is not being compared correctly. To do this the right way just use this script: // Primeiro você precisa capturar o valor var inputUsuario = $('#usuario').val(); // Agora é…
-
1
votes1
answer162
viewsQ: Use of "Return" in module.Exports
I am developing a project in Nodejs and at the moment, I am facing some problems when returning some value of a function within a module. Code: Archive for queries async function query(query){…
-
2
votes1
answer49
viewsQ: Error using async in Nodejs
I have a system in Nodejs in development and finished a step, for the purpose of testing, I put it on a server and from that began to return me error in all lines of code in which I used the async…
-
0
votes2
answers363
viewsA: Select a select by the input value
The solution is simple, insert the code below in your Javascript, but don’t forget to put the Jquery references in your code header. $(function(){ var existeCpf = false;…
-
0
votes2
answers265
viewsQ: ORDER BY Mysql - Reporting organisation
I have a chat and would like to display the contacts according to the date of the last message, I thought of many ways to do this but it is not working in any way. How could I bring this data…
-
0
votes1
answer15
viewsQ: Problems with toggle checkbox(Switchery)
Good Tade, I have a problem adding the checked attribute to checkbox. I have knowledge in Jquery and I’ve done it many other times, but I’ve never used Switchery, I don’t know if that’s the problem,…
-
1
votes4
answers199
viewsA: PHP Create dynamic array from one SQL and Separate by a specified amount of record in another Array
You can create a two-dimensional array, better known as a matrix. For example, heading [0] [0] will be the first ID of the first 6 products, heading [0] [1] will be the second ID. So it goes until…
-
3
votes3
answers73
viewsA: How to close a Session in PHP
Make the following change at Home.php in the first line of code: <?php session_start(); /* Aqui você está verificando se a sessão está setada, * quando ele fizer logoff, seu session_destroy fará…
phpanswered Victor Hugo 409 -
0
votes2
answers93
viewsA: Switch between modes
There’s an easy technique to it: Delete your script and CSS and try with this code: <script> $(function(){ $('.form-edita').hide(); $('.btn-editar').click(function(){ $('.visualizar').hide();…
-
1
votes1
answer26
viewsA: Detect which tag is being selected
There is a solution to this with THIS yes. Would look like this: var tagName; $('.checkout-wrapper').on('blur', '.woocommerce-shipping-fields input, .woocommerce-shipping-fields select', function ()…
-
0
votes2
answers210
viewsQ: Logic for ABC curve
I am developing a project and I would like to make a page only for statistical data, one of these data is the ABC Curve of customers, I mean, I want to return the customers who buy the most. I’ve…