Posts by Fernando Favini • 66 points
9 posts
-
1
votes1
answer35
viewsA: What is the use of nested classes in python? for which I would use something like that?
I don’t know exactly in Python, but this is a general computing problem. Usually class nested to organize the code. imagine you have a class GoogleAPIClient, and say the answers you want to store in…
-
1
votes1
answer44
viewsA: How to define JSON properties to use in a for loop?
Okay, from what I see, the search structure would be something like this: { "kind": "books#volumes", "totalItems": 894, "items": [{...}, {...}] } when you spin your for about the object search, the…
-
2
votes3
answers77
viewsA: Generate multiple different arrays containing random numbers
That’s an algorithm problem, and I see several options. To illustrate, I will work with a 2 element array: if you think, this array can be represented by a number that will be written in base 3, so…
-
1
votes1
answer32
viewsA: How to return multiple parameters from a Ruby Api name with Faraday
Look, the problem is not only the ruby code, but the API itself. this API accepts more than one name separated by | https://servicodados.ibge.gov.br/api/v2/censos/nomes/fernando|maria in this case,…
-
0
votes1
answer20
viewsA: how to save data from an api with ruby and sqlite3
was seeing, apparently on this line db.execute "INSERT INTO Estados VALUES ( ?, ?, ?)", data here, I believe you would like to insert the id, sigla and nome but the value of data has the Symbol :id…
-
0
votes2
answers92
viewsA: What is the difference between creating a method inside the constructor or inside the prototype property?
Completing the answer when an object receives a message (to access an attribute or a method), it is first checked if such a property exists in the object, if it does not exist, it goes to the…
javascriptanswered Fernando Favini 66 -
0
votes2
answers191
viewsA: Reload script whenever the event happens
From what I saw in the previous answer, the script is loaded only once, so here follows an improvement function loadScript(scriptName) { // Adiciona o script na head do documento var body =…
-
0
votes1
answer50
viewsA: How to make a Docker image of a Node app that uses a private file that requires ssh
Hello, I see two options, Before building, download the package, which will then be available to build Adding a key in a multi-stage build, where one stage adds the key and downloads, and the other…
-
0
votes1
answer18
viewsA: How do I run a Docker image and as soon as the process is over save the generated file inside the container to the host computer?
To do this, Voce has to create a volume, a link between your directory and a directory inside the container See this example, where the command will generate result inside a directory aux and this…