Posts by E.Thomas • 1,379 points
47 posts
-
0
votes3
answers142
viewsA: Switch locks command when entering a letter
Note the variable declaration r0. Analyzing the switch, it is possible to infer that you have declared the variable r0 with the guy int. This is causing the loop. Try to adapt your code to the…
-
1
votes1
answer3961
viewsA: Save data in. xlsx format with pandas
The problem is that with every passage in the loop, you are creating a DataFrame new. Change your code to the following: import time import pandas as pd loop = 0 df = pd.DataFrame() while True: loop…
-
1
votes2
answers40
viewsA: Dataframe using R
You can use the function rbind. x <- data.frame("Nome" = "Fulano", "Idade" = 22, "Sexo" = "M") y <- data.frame("Nome" = "Fulana", "Idade" = 27, "Sexo" = "F") z <- rbind(x, y) The exit must…
-
1
votes2
answers394
viewsA: Vb script to call an executable
This problem occurs because the path that you are trying to perform has spaces: C:\Program Files (x86)\Lancamentos.net\Lancamentos.exe In this case, you should add two extra quotes so that the path…
-
3
votes3
answers694
viewsA: The code skips the fgets, not reading the word
Being direct, use getchar(); before calling fgets. The code would look like this: printf("Digite sua altura\n"); scanf("%f",&altura); printf("Digite seu peso\n"); scanf("%f",&peso);…
-
2
votes1
answer121
viewsA: Page search program for a Python website
There is an error in your code. Missing is the location where the variable value will be injected line at the url. response = requests.get('https://www.nomedosite.com/{}'.format(linha))…
-
2
votes2
answers1474
viewsA: Is it possible to do an INSERT and UPDATE in the same query in java?
Yes, it is possible. And there are two ways to do it. To first is by inserting these queries in an SP (Stored Procedure). This way it is enough to call the AS with the parameters and practically any…
-
2
votes2
answers2208
viewsA: SQL to compare hours and minutes when Timestamp in Postgresql
Your approach is correct, except for the use of team. An alternative is to make the CAST to TIMESTAMP field for TIME, allowing comparison only of field time. The use of CAST in this case, in…
-
-1
votes2
answers524
viewsA: How to remove the decimal separator from a result?
As commented by @Maniero, just multiply the value by 100 instead of 1000. If you do not have management over this multiplication, the conversion to INT suggested by @Pablovargas is also valid,…
-
1
votes3
answers4839
viewsA: SQL script to create mask
Assuming that you are using SQL Server, that all records have 8 digits and that your NCM field is of type VARCHAR: UPDATE TMP SET CODIGO = LEFT(CODIGO, 4) + '.' + SUBSTRING(CODIGO, 5, 2) + '.' +…
-
2
votes1
answer266
viewsA: Query with Count returning empty
When a grouping function is used (SUM, COUNT, MIN, MAX, ...) if there is one more field beyond the field being grouped, A GROUP BY clause MUST be added, always before ORDER BY (when it exists). In…
-
1
votes2
answers54
viewsA: Adding value with Mysql
There is an error in the structure of your query. First, choose to leave the queries connected by UNION with the same field nomenclature (it is not mandatory, but it facilitates): SELECT SUM(valor)…
-
0
votes1
answer44
viewsA: How to make second select in "Read"?
There is, in this case, no imperative need to use the same object IDataReader, can therefore create a new object IDataReader within the scope of else. Your code would look like this: public…
-
1
votes1
answer174
viewsA: Query with sql query using time interval
Change the JOB query that is set to run at 06:00 to filter the current date - 1: CAST(c.dtHrProcesso AS DATE) > DATEADD(ss, 64800, DATEADD(d, -1, CAST(CONVERT(varchar(10), GETDATE(), 103) AS…
sql-serveranswered E.Thomas 1,379 -
0
votes1
answer143
viewsA: What’s wrong with my code?
There’s an error in the structure of your code. To implement a CASE structure in Visualg you must declare it as follows: choosing case ... child Your correct code would look like this: algoritmo…
-
0
votes2
answers257
viewsA: Assign Value to a Non-method Array
There is nothing wrong with your code. The output is also correct. What happens is that the variable todosresultados is local and when exiting the last recursion it is empty, making the program…
-
-1
votes3
answers737
viewsA: Field comparison problem with date and time
Yes, it causes a problem with data return. In your example, the data between '23/11/2016 00:01' and '23/11/2016 23:59' will not be returned in the query. I face this problem in my work environment…
sql-serveranswered E.Thomas 1,379 -
1
votes2
answers576
viewsA: Problem when performing Join in tables with generalization
In fact what you need is a smaller number of fields, tables and consequently relationships: The search select would look something like: SELECT A.* FROM Responsavel R INNER JOIN Usuario U ON…
-
2
votes1
answer830
viewsA: Read XML with Java
In Java this is simple. You just need to create a method to read a file: static String readFile(String path, Charset encoding) throws IOException { byte[] encoded =…
-
0
votes2
answers219
viewsA: Creating component generating DLL
I hope when you are referring to components as being the controls used for handling the user interface (i.e. textbox, combobox, etc.). Is there any way not to generate the DLL and compile everything…
-
0
votes1
answer123
views -
1
votes1
answer1652
viewsA: How to create a Trigger for a specific column of a table?
In Mysql you cannot directly fire a Trigger only after changing a column. Triggers are triggered after an interaction (Insert, update or delete) in the table row. For your case it is necessary to…
-
3
votes2
answers2696
viewsA: Regular expression
If your intention is to leave the string only with the numbers use: String fone = "(51)9994-5845"; String cpf = "025.454.644-55"; String cnpj = "02.321.351/0001-35";…
-
3
votes1
answer114
viewsA: Make Join of 3 lists in c# from queries in the database
I think the question is related to object orientation concepts. It turns out that its variable "Join" does not have the same type of "list clubs" and "list reports". The "Join" statement should be:…
-
3
votes2
answers98
viewsA: Evaluation of conditional expressions in Java
There is an optimization done by the compiler that actually identifies that the code inside the IF will not be executed, but chooses to omit it and not generate an "unreachable code" error. This…
-
5
votes1
answer4261
viewsA: Current time of the states of Brazil C#
The territorial extent of Brazil comprises 4 time zones (-2hs, -3hs, -4hs and -5hs in relation to Greenwich). You can get the time in each of these spindles through the following code:…
-
1
votes1
answer672
views -
0
votes1
answer807
viewsA: Convert the result value of the sql query
If you want the result to be of the numeric type, it is necessary to make a CAST or CONVERT. With you did not specify which DBMS, I took the liberty to exemplify in SQL Server: select *,…
-
4
votes1
answer572
viewsA: Convert String to Calendar
If you have configured the SimpleDateFormat for "yyyy-MM-dd", this is the format you should use in the command parse: Date date = sdf.parse("2016-07-04"); That is the reason for exception. The code…
-
1
votes2
answers398
viewsA: How to write data from two columns of a table using select?
You can concatenate the code and brand name value and place them in VALUE. When redeeming the value of the VALUE attribute, split and save them in the desired fields. <label>Selecione a…
-
2
votes2
answers995
viewsA: Convert text to number in C# to write to DB
Avoid using text fields in the BD to store numerical values. Besides being a bad practice (except if there is a strong goal for this) increases the size of the database and makes research very…
-
1
votes1
answer246
viewsA: How to change a list view from a Combo on VB6
You should use the combo box events for this. Create a method to popular the listview type Private Sub PopularListView(ByVal letra As String) 'Adicionar as linhas conforme a letra passada por…
-
2
votes1
answer179
viewsQ: Assembly structure in a project using the Pattern MVVM
I’m having trouble organizing the Solution of a project using the MVVM. I don’t use any MVVM framework. I currently have the following structure: Solution | --- AppView (Projeto principal onde estão…
-
3
votes1
answer3126
viewsA: How to share variables in Crystal Reports
You can create a variable within a formula as follows (using Basic Syntax): shared variavel as string variavel = "teste" formula = variavel Do not forget that this formula should be on a…
-
1
votes5
answers1583
viewsA: How to get the number of weeks in a date range in C#?
I could try this way: public int NumeroDeSemanas(DateTime dataInicial, DateTime dataFinal) { TimeSpan Span = dataFinal.Subtract(dataInicial); //Testa se a diferença é menor ou igual a 7 (número de…
-
14
votes7
answers21276
viewsA: Best kind of data to work with money?
Recently completed a PAF-ECF application, from start to finish, and I have no problem with it. I used Money in the database (SQL Server), and in the management system and PAF-ECF (both in C#) I used…
-
12
votes4
answers16962
viewsA: What do you call a "Stored Procedure"?
First you create a Command in C#. The following example is for SQL Server DBMS: System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("GetAdmin");…
-
1
votes1
answer864
viewsA: Popular Grid VB6
If it is only to display the data and not requiring grid editing, I suggest using the Listview component. The code for popular Listview would look like this: lvwItens.ListItems.Clear While Not…
visual-basic-6answered E.Thomas 1,379 -
5
votes3
answers12254
viewsA: How to initialize an array using pointers?
See if this is what you want: int main() { int matriz[5][5], i, *ponteiro; ponteiro = matriz[0]; for (i = 0; i < 25; i++) { *ponteiro = 0; ponteiro++; } return 0; } It’s pretty much the same…
-
1
votes3
answers19154
viewsA: How to take the path of the open executable in C#
The method reported by @Isalamon is correct. But it’s also possible to search for Assembly: String currentPath = Path.GetDirectoryName(Assembly.GetAssembly(typeof(Models.Configuracao)).Location);…
-
1
votes2
answers3111
viewsA: How to check the database update from a browser?
If the desired information depends on specific tables, a Trigger could be created in the respective table (I will call table A) which, when having a record inserted, updated or removed, saves the…
-
1
votes2
answers4499
viewsA: Save images in repository and recover it through a Path with C#
An alternative is to only write the file path to the database (Path). Having in hand the image Path, loaded from the database, it is possible to do as follows: private static BitmapImage…
-
1
votes8
answers2292
viewsA: Why create an object using the superclass?
The advantage in their case of the use of the type Musico is the possibility to use methods that deal with the characteristics that Violinista and Baterista have in common. On the other hand,…
-
1
votes5
answers411
viewsA: How to avoid a comparison by brute force?
You could create a HashMap containing the types and their respective description. So, if I understood your purpose correctly, just search the HashMap and capture its corresponding description. It…
-
0
votes2
answers345
viewsA: How to fix the problems reported with the Blackbox Debug plugin in Wordpress?
Therefore it is possible to verify in this error report, the substitution of the method is requested is_a() for instanceof, since the first one is obsolete (according to PHP 5 manual). For example:…
-
2
votes2
answers256
viewsA: Number of variable parameters in C#
It is possible to improve a little the first example described by Miguel Angelo. Instead of using variable of type Object, it is possible to obtain the same result, but with better use of resources…
-
5
votes2
answers1593
viewsA: How to register dll . net using Inno Setup
Use the following syntax in your Inno Setup script: [Run] Filename: "{dotnet20}\Regasm.exe"; Parameters: "{nome da dll} /codebase"; WorkingDir: "{app}"; Flags: runhidden; StatusMsg: "Registrando…