Posts by Costa.Gustavo • 249 points
14 posts
-
0
votes1
answer24
viewsQ: Decimal value formatting . NET Framework
Considering the code below, how can I change the return of .7777 for 0.7777? using System; using System.Globalization; namespace Teste { class Program { static void Main(string[] args) { decimal x =…
-
3
votes3
answers398
viewsQ: Intersection between pandas columns
Considering two dataframes like the ones below: import pandas as pd df = pd.DataFrame({'id':[3,6,9,12,15]}) df1 = pd.DataFrame({'id': [2,4,6,8,10,12,14]}) How to account for the intersection between…
-
0
votes1
answer632
viewsQ: Pandas: Convert Dataframes to Image
Given a Dataframe as the following: df = pd.DataFrame({'id_emp' : [13524791000109, 12053850000137, 4707821000113, 4707821000114, 1], 'name_emp': ['Cristiano', 'Gaúcho', 'Fenômeno','Angelin',…
-
1
votes2
answers6875
viewsQ: Dataframe - Pandas. Assigning values in columns from comparing another column
I have the following Dataframe: import pandas as pd df = pd.DataFrame({'id_emp': [1,2,3,4,1], 'name_emp': ['x','y','z','w','x'], 'donnated_value':[1100,11000,500,300,1000],…
-
2
votes3
answers1730
viewsQ: Remove quotes in lines from csv file
Given a particular file iris.csv: "sepal_length,sepal_width,petal_length,petal_width,species" "5.1,3.5,1.4,0.2,setosa" "4.9,3,1.4,0.2,setosa" "4.7,3.2,1.3,0.2,setosa" "4.6,3.1,1.5,0.2,setosa" I try…
pythonasked Costa.Gustavo 249 -
0
votes1
answer280
viewsQ: Count number of comparisons and exchange in a python sorting algorithm
I need to count the number of comparisons and exchange in the following sorting algorithm: def selecao(lista): c1 = c2 = 0 for i in range(0, (len(lista)-1)): mini = i c1 += 1 for j in range(i+1,…
-
0
votes1
answer79
viewsQ: Sum of Mysql column values
I have the following Mysql tables: CREATE TABLE IF NOT EXISTS `tcc2`.`catalogo` ( `idPHL` BIGINT(20) UNSIGNED NOT NULL, `isbn` VARCHAR(15) NULL DEFAULT NULL, `titulo` LONGTEXT , `autor` LONGTEXT…
mysqlasked Costa.Gustavo 249 -
1
votes1
answer217
viewsA: Count repetitions of TAG in XML file
I found the solution using the following function: private static int getCount(Node parentNode) { int qtdEx = 0; NodeList nList = parentNode.getChildNodes(); for (int i = 0; i <…
-
1
votes1
answer217
viewsQ: Count repetitions of TAG in XML file
Example of XML file: <rec> <v001>001</v001> <v002>2012609272311</v002> <v003>616.890231</v003> <v005>7</v005> <v006>m</v006>…
-
1
votes0
answers31
viewsQ: Mysql and Jaspersoft
I need to generate a dynamic report through Jaspersoft, the result of consulting three Mysql tables. The tables are: CREATE TABLE IF NOT EXISTS `tcc`.`Catalogo` ( `idCatalogo` INT NOT NULL, `titulo`…
-
0
votes2
answers52
viewsQ: Get mysql table id in application
I am developing an application in Java where I need to redeem the id of a Course table (idCurso, nameCurso, typeCurso). Here’s what I’m trying to do: public class Teste4 extends javax.swing.JFrame {…
-
2
votes1
answer96
viewsQ: Fix Jbutton that is running 2 events
I have an application where in a Jframe I create new records for mysql table, and in another I return a select JTable with all records created. I have a change button, which when I select a Jtable…
-
0
votes2
answers833
viewsQ: Return search data to database in Jtable
I’m developing an interface that should return in a JTable values of a mysql table. I have developed the following method: public class Teste extends javax.swing.JFrame { private JTable table;…
-
0
votes1
answer164
viewsQ: Error Code: 1215. Cannot add Foreign key Constraint/ Error to add foreign key
I’m trying to create a table called Disciplina, however I am not getting on account of foreign keys. I’ve checked it over and over and I can’t identify the mistake, if you can help me, I’d…
mysqlasked Costa.Gustavo 249