Posts by José Henrique Luckmann • 1,084 points
45 posts
-
1
votes1
answer40
viewsQ: How to handle specific customizations with git
Where I work, we follow the following methodology when working with git We have a production branch We have an approval branch And we create branchs for every development sprint But the need arose…
-
0
votes1
answer43
viewsA: Mongodb return last value using filter and grouping by variable
I managed to solve my problem as follows: reg = db.logs.aggregate([ {'$match': {'metric': 'temperature'}}, {'$match': {'owner': owner}}, {'$sort': {'datetime':-1}}, {'$group': {'_id':'$source',…
-
0
votes1
answer43
viewsQ: Mongodb return last value using filter and grouping by variable
I have the following event being inserted into my Mongodb base { _id:"5c0539158863a16a282917ad", owner:"clientX", source:"Deposito01", metric:"temperature", datetime:"2018-12-03T12:09:25.000Z",…
-
0
votes1
answer746
viewsQ: Traverse color gradient according to value
I need to represent the temperature of a place using colors, the lowest temperature I should represent with blue, the intermediate with yellow and the highest with red. But I can’t just fix these 3…
-
0
votes1
answer254
viewsQ: Get dynamically created Checkbox values
Developing a python application using the Flask framework for simple registration I have the following problem, I have a register of bids and these bids can have several categories, the categories…
-
2
votes2
answers519
viewsA: Validation in an ATM
You just need to add one more check to your withdraw method, you need to check if the value reported by the customer is less than 0 The ideal is to do the same to deposit it, the two methods will…
-
1
votes1
answer287
viewsQ: Update console line with C#
I already asked this same question once, but in that case I needed for the python language, now I need to solve this same problem, with the C language# I have a loop in C#, and would like to inform…
-
2
votes1
answer202
viewsA: Object Orientation in C# - Inheritance
The meanings of each concept have already been perfectly explained in this question: Meaning of terminology: "Object oriented" But as you asked for some examples of how to implement, it follows a…
-
7
votes1
answer1325
viewsQ: Record records with the mask or remove before?
Contextualizing my question, kind of by convention of my old work environment I always recorded the records without the mask at the base, but a situation arose in my new job where they are saving…
-
1
votes2
answers1404
viewsA: What’s the "self" for?
A comparison that might help you understand, is to think about self as if it were the this java/C#. Which is not explicit in the implementation but also points to the object itself. In the case of…
-
1
votes1
answer197
viewsQ: Identify EOF in a Datainputstream
I am making a program that needs to read a binary file and go extracting some information from it, what I have so far is the following: public void processarArquivo() throws Exception{ try {…
-
1
votes0
answers161
viewsQ: Which is the most correct way to store files
I always run into this question when I have to work with file storage inside a software. It is ideal that I simply record them in any folder and record the information in the database, with a field…
-
2
votes1
answer52
viewsA: How to create a sustainable software framework
I think for your case you could use a microservices Microservices or Microservices can be defined as: An approach to develop a single application as a suite of services, each running on its own…
-
2
votes3
answers7146
viewsA: How to run the method inside a.py file by linux terminal
To run a specific method within the file, the solutions proposed so far are correct, but I think what you’re looking for is something more like Python Command Line Arguments, which is what is used…
-
2
votes1
answer969
viewsA: Get path where python file is called
You can use the method getcwd library the It returns your current working directory import os print(os.getcwd()) See working on Repl.it If you want to read some more: the getcwd.…
-
1
votes1
answer221
viewsA: Problem with classifier in PLN
After a lot of tests, I was able to figure out what the problem was. The problem was how many possible classes the classifier needed to interpret For example the following training set: oie, oi oi,…
-
4
votes5
answers1258
viewsA: How to open a new background tab and redirect the current tab?
You can do this using javascript: Open two separate tabs HTML: <a href="#" onclick="abrir_pagina();">Abre duas páginas</a> JS: function abrir_pagina() { window.open('http://google.com');…
-
2
votes2
answers15185
viewsQ: Formatting strings with ". format" and "%"
It’s been a while since I’ve been studying some python code. Some people format code using ". format": fruta = "Maça" print("Eu gosto de {0}!".format(fruta)) And others use the "%" fruta = "Maça"…
pythonasked José Henrique Luckmann 1,084 -
3
votes1
answer56
viewsA: Preparing Linux Development Server
In your case the two commands will install PHP 7.0 What defines which will be installed by default when executing the command without specifying the version is the distribution repository. Until…
-
1
votes5
answers19389
viewsA: Differences and advantages between Github and Gitlab
In the way you’ll work it won’t change at all, the two are services that offer solutions to use git. The big difference will be what your purpose is, if you are developing something Opensource,…
-
2
votes1
answer221
viewsQ: Problem with classifier in PLN
I’m developing a chatbot, and to get the answer I’m using the Naive Bayes classifier to sort the questions and answers. For those who want to see all the project code and more settings follow the…
-
1
votes2
answers70
viewsQ: Remove and insert characters in the same position
I have the following problem in PHP I need to remove the characters from a string, and then insert them in the same position. I’m currently doing so, but I’m open to suggestions. I have an initial…
phpasked José Henrique Luckmann 1,084 -
5
votes2
answers1757
viewsQ: Hide password on terminal
I am developing a python application that will work by the terminal At a certain point, I need to login: print('É necessário informar suas credenciais para se comunicar com a API') email =…
pythonasked José Henrique Luckmann 1,084 -
2
votes1
answer845
viewsA: Automate reading multiple text files in a Python script
You can use what was explained in this question: List files from a Python folder #encoding: utf-8 import os #lista apenas os arquivos txt da pasta pasta = "c:\scripts" caminhos =…
-
0
votes4
answers2496
viewsA: Performance of COUNT(*) and COUNT(1)
The two selects no difference in performance. In both cases, it counts all table values, including if the columns are null. To count the rows SQL scans the entire table (Table Scan) and then…
-
0
votes4
answers634
viewsA: Find and delete different characters between strings
Since you cannot simply set one variable equal to another, I created a function to manually remove the excesses, follow an example: def remove_letras(modelo, palavra): #passa letra por letra…
-
1
votes1
answer2019
viewsA: How to program a button in Unity that after being clicked, shows a text with information on the screen?
Follow a small C# script to create an object that is a message box: using UnityEngine; using System.Collections; public class MessageBox : MonoBehaviour { //A janela 200x300 px aparecerá no centro…
-
3
votes2
answers539
viewsQ: Docker during the development
I started to study the use of Docker and a question arose that I still can not understand: Imagine that I have a python script that I want to run inside my container, so I go there and create the…
dockerasked José Henrique Luckmann 1,084 -
0
votes1
answer92
viewsA: Convert data, how to proceed?
I could not understand your code well, but from what I understand you are looking for a way to convert different strings with a date format? Example to convert the two types This code is far from…
javaanswered José Henrique Luckmann 1,084 -
0
votes1
answer611
viewsQ: Using an external folder function
I have the following situation: Within the Pasta1\ i have a file that is my main code This file codigo_principal.py reads a file that is in a subfolder within the Pasta1\ I also have another folder,…
pythonasked José Henrique Luckmann 1,084 -
4
votes3
answers4694
viewsA: How is the structure of projects in python?
I don’t know if there’s a pattern to this kind of division, I even consulted PEP, but I couldn’t find anything related. But it follows the pattern I use to build my projects, based on this…
-
1
votes3
answers1432
viewsA: Print element from a specified position in the list
Your function is not returning any results, you need to call the Return at the end of the function passing the number of the month -1, the -1 is pq the array starts counting at 0 and not at 1 def…
-
0
votes3
answers372
viewsA: Some help in function exercise (python)
I tried to make the function as simple as possible You do not need to account for the divisors, if there is any divisor between 1 and half of itself, you can already define that the number is not…
pythonanswered José Henrique Luckmann 1,084 -
0
votes3
answers83
viewsA: Is SEO possible with site that contains only Images?
As already mentioned, SEO is a very broad content to get us here and give you a formula Since you only use images, I recommend abusing metatags, fill in as much information as possible so that the…
seoanswered José Henrique Luckmann 1,084 -
3
votes2
answers225
viewsQ: Regexp extract value
I have the following strings: "The.Office.US. S{SE}E{EP}.the.Dundies.720p.srt" "The Office [{SE}. {EP}] The Fight.srt" This string is a "template" of a file name, the files will be in the following…
-
1
votes1
answer407
viewsQ: Update console line
I have a python loop, and would like to inform the value of a variable each time it is updated, however I don’t want to dirty the console printing every time and or clean the whole console. There is…
-
2
votes1
answer1777
viewsA: Access SQL Server base via CMD
You can manage your Microsoft SQL Server 2008 databases Express (SQL Server Express) using the sqlcmd utility at the prompt command. To access the sqlcmd utility, click Start, at Run and type…
-
0
votes1
answer1232
viewsA: Remove the last value of an array
As far as I know an Array cannot be resized, so the easiest way to get this control is to create a variable to store which is the last record of the stack. I used the variable count in the example…
-
3
votes2
answers755
viewsA: What is #pragma c#
The #pragma serves to pass specific instructions to the compiler To use must inform as follows #pragma nome-configuracao argumentos In the following example it is disabled the warnings for the test…
c#answered José Henrique Luckmann 1,084 -
1
votes1
answer250
viewsA: Dictionary exercise
You can before giving the split check which will be operation, just observe the first character of the input string (input[0]) See if that’s not more or less what you’re trying to do: dicionario =…
-
0
votes1
answer301
viewsA: Input, on the same line, of a string without spaces and another with spaces
You can change the split to break only at first occurrence What your code will look like: dic={} nome,desc=input().split(" ", 1) dic.update({nome:desc})
-
0
votes2
answers40
viewsA: Searching and comparing java
if (Arrays.stream(ra).anyMatch(xh -> xh == cadastroRa)) Your final code will look like this: for (int i = 0; i < ra.length; i++) { int cadastroRa =…
-
6
votes2
answers2292
viewsA: Operations with time quantities and conversion between time units
It is very quiet to manipulate dates and times if they are in Datetime format //Cria uma nova data 09:00:00 06/06/2017 DateTime teste = new DateTime(2017, 6, 6, 9, 0, 0); //Cria uma nova data…
c#answered José Henrique Luckmann 1,084 -
0
votes3
answers5096
viewsA: Centralize printf
Unfortunately there is no feature in the printf to center the string, and the handling should be done manually Perform the procedure on the printf: printf("%", center_print("CLÍNICA DE ANÁLISES…
canswered José Henrique Luckmann 1,084 -
2
votes1
answer1007
viewsA: Eclipse Installation
Installation in Windows is very simple Are you trying to set up a java project? If yes you can follow this tutorial: Summary: You will need to: JDK: Download the latest version here:…