Posts by Jose Henrique • 337 points
16 posts
-
1
votes1
answer599
viewsQ: Schedule and cancel task in Node.JS (Node-cron, cron or Schedule)
I created a simple server with two routes, one to start a periodic service /job/start and another to cancel it /job/stop. Here’s the code: // framework const express = require('express'); const app…
-
3
votes1
answer57
viewsQ: Javapcript Proxy running . get() instead of . set()
I wrote the following minimum code: const greetings = new Proxy( { english: { well: "Hello ", come: "World!" }, portuguese: { bem: "Ola", bindo: "Mundo!" } }, { get: (ctx, key) => {…
javascriptasked Jose Henrique 337 -
0
votes1
answer135
viewsQ: How to prevent a link from working on a child element? (jQuery)
Imagine the following code below: <a id="link" href="/nova_pagina.php"> <div id="abrir-nova-pagina" >Linha_1</div> <div id="nao-abrir-nova-pagina" >Linha_2</div>…
-
1
votes1
answer94
viewsQ: How to emulate ROW_NUMBER() in Mysql V5.7?
I know this is a common and well-documented issue in English, but there is little of it in Portuguese. So I’m going to take this opportunity and take this doubt in a simple and comprehensive way.…
mysqlasked Jose Henrique 337 -
1
votes0
answers18
viewsQ: Lopping each() running without sync - jQuery
I am creating a site like Pinterest and the commands below picks up the answer (reply = post in html format) of the call itself ajax and apende the post on the screen. The commands below check which…
jqueryasked Jose Henrique 337 -
3
votes1
answer2585
viewsQ: Protect php files from direct access without locking to the system
In terms of routing, my site is divided into two parts: First, it has an app folder inside root, where it is contained all the files of the site in MVC system, and second, next to the app, a set of…
-
4
votes1
answer185
viewsQ: How to implement a grid and Infinite scroll together?
I’m developing a site style Pinterest but I’m not able to join these two features. To do the Infinite scroll, I used jQuery with AJAX to pull the database posts and append them into the body.…
-
2
votes1
answer90
viewsQ: How to randomly select a row from each group in Mysql
Suppose I have such a table: item | group -------+-------- item a | group z item b | group y item c | group y item d | group x item e | group z item f | group x And that now I want to randomly…
mysqlasked Jose Henrique 337 -
5
votes2
answers1079
viewsQ: How to do a random query in Mysql without repeating data?
I’m creating a site type images type Pinterest that, in addition to other things, need to combine the following features: Infinite Scrool (I’m applying this code here:…
-
0
votes0
answers203
viewsQ: How do I use to call another namespace without using include?
I see programmers all the time using the "use" command below the "namespace" command without first using a include. An example is the Medoo library: namespace Medoo; use PDO; use Exception; use…
-
4
votes1
answer784
viewsQ: Select the first row of each group in Mysql
Suppose I have such a table: item | group -------+-------- item a | group x item b | group y item c | group y item d | group x item e | group z And that I want to select a single item to represent…
-
-1
votes1
answer247
viewsQ: Hello World in React.JS does not work!
I’m trying to print a "Hello World!" on React.JS Look at my code, it just doesn’t work: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script…
-
0
votes1
answer62
viewsQ: Connection screen of adminMongo
I installed the adminMongo. I followed the installation instructions: Navigate to Folder & install adminMongo: git clone https://github.com/mrvautin/adminMongo.git && cd adminMongo…
mongodbasked Jose Henrique 337 -
0
votes1
answer74
viewsQ: Where should I instantiate the objects?
In POO there is a certain degree of theory and good practice for writing classes and interfaces. They are inside folders with established nomenclatures. The class name must be identical to the file…
-
2
votes1
answer128
viewsQ: Analogy between POO and database
I’ve been reading about the Entity Framework, that it has some features of transforming classes into tables and objects into lines. I found it super interesting! To what extent is this analogy…
-
0
votes2
answers907
viewsQ: How to save and export an object in the browser console?
on the Box website, the results of the lotteries are displayed on the console in the form of objects. http://loterias.caixa.gov.br/wps/portal/loterias/landing/megasena/ I can right-click on the…