Posts by Kfcaio • 570 points
30 posts
-
0
votes1
answer80
viewsA: Add elements in Dictionary and convert them to string
descricao=soup.find('div',{'class':'conteudoAbasProduto'}).children The variable descricao above returns an object list iterator: <list_iterator object at 0x7f9c14b99908> The text you are…
-
1
votes1
answer77
viewsA: How to use 'Native' in Java?
First, let’s understand what it is Native in Java. Simply put, your definition is correct, this is a access modifier used to access methods implemented in a language other than Java such as C / C ++…
-
0
votes0
answers33
viewsQ: How to search for array in postgres through sqlalchemy?
My database has a column like ARRAY(sa.BIGINT). My intention is to use the command filter_byof sqlalchemy to search for an element that has the list_secao_id field equal to [58,45,12], for example:…
-
1
votes1
answer55
viewsQ: How to format response of a bash command?
My intention is to print on the screen the number of pages of each PDF in a given directory. I even managed to do this through the following command: find "$PWD" -iname "*.pdf" | xargs -i pdfinfo {}…
-
2
votes2
answers253
viewsQ: Extract content from "Name:" field until end of line
Given a string in the following format: 'a1in1iionia\n\nDados do cliente\nNome: Foo\nE-mail: [email protected]\n' I need to extract the full content from the "Name" field. For this I wrote the code:…
-
3
votes1
answer1600
viewsQ: How to update content without reloading an HTML page?
I built a Flask API connected to a Mysql database, which has its entries displayed in an HTML page. player_manager.py: from flask import Flask from flask import render_template from flask import…
-
1
votes1
answer159
viewsQ: Referencing elements with CSS to reposition them
I have to change a code base responsible for generating PDF reports using the tool Jinja2. To do so, I need to change HTML and CSS documents. For the former, my concern is with the naming convention…
-
1
votes1
answer6307
viewsQ: Remove accent via formula in Google Sheets
I need to remove diacritical signals (accentuation and cedilla) in the values of a column in Google Sheets. I know that it is possible and easier to solve this problem through an App Script…
-
0
votes1
answer808
viewsQ: How to separate each element from a list, with a String, in a row
The problem is simple, I would like to add an element to a real-time generated list for each given iteration. For example, if the list l is generated through [x for x in range(10) if x%2==0], then I…
-
0
votes1
answer914
viewsQ: Use return of one method in another method of the same class
I am working with The Guardian API, through two methods, search_content() and data_to_csv(), contained in the Theguardian class. The first method is responsible for searching The Guardian database…
-
0
votes1
answer47
viewsQ: Extract '_id' from load_response object
After post, I get an object load_response, in Dict format, with the following structure: {'_content':…
-
1
votes0
answers27
viewsQ: How to generate Factory Boy Fuzzy Attribute before running each test?
I am creating unit tests to perform integration tests of my web application. The tools I am using are: Mongomock to create a temporary bank instance for testing and Factory Boy to create mock…
-
1
votes1
answer604
viewsQ: How to integrate and make queries with pymongo?
I am learning to integrate Python and Mongodb and, because of that, I proposed a challenge: create a small program to register football players. My program has two modules, info_player and…
-
1
votes1
answer80
viewsQ: Time consumption in cubic code
I need to calculate the time consumption of the following algorithm: int somaSequencial(int v[],int n){ int m = 0; for(int i = 0; i < n; i++){ for(int j = i; j < n; j++){ int s = 0; for(int k…
-
3
votes1
answer420
viewsQ: Time complexity of recursive palindromic algorithm
I need to analyze the time consumption of my algorithm for a size vector n = f - i + 1, through a recursion, to then define a closed formula. public class ehpalindromo { public static boolean…
-
0
votes1
answer62
viewsQ: Change signature and parameters of some functions
I’m creating a program that reverses the non-vowel sequences of a word represented by a list simply chained, headless and without a sentinel. That is, each node in the list has a letter field. My…
-
5
votes3
answers300
viewsQ: Code for reversing sequence of non-vowels ending with zero status
I’m implementing the function decodificar, which aims to call auxiliary functions to reverse all non-vowel sequences. For example, if the word is "cool monsters," it will go to "mortsnol segais".…
-
2
votes3
answers16313
viewsQ: Comparison of char in C
I need to find out if each element of a chained list is a vowel or not. How can I fix my code? int BuscaNv(LISTA* resp){ NO* atual = resp->inicio; while(atual){ if(atual->letra == 'a' || 'e'…
-
0
votes1
answer2436
viewsQ: Copy list simply chained in C
Hey, guys, I need help copying a list just chained up backwards. For example, if the original list is 1->2->3->null, I need it to be 3->2->1->null. #include <stdio.h>…
-
2
votes1
answer118
viewsQ: Problem with linked list of dynamic C implementation
Hello, folks, I have two questions: Why can’t I print out any list? How do I scroll through a given list, without head and sentinel, backwards using this implementation? #include <stdio.h>…
-
3
votes1
answer3131
views -
1
votes1
answer594
viewsQ: Receive user vector in C
Hello, everyone. I need help getting an array of integers (separated by spaces) from the user. Here’s my code: #include <stdio.h> #include <stdlib.h> #include <string.h>…
-
1
votes1
answer5742
viewsQ: Print chained list in C
I’m creating a program that receives a vector and creates a chained list. I need help creating the "print()" function, which prints the generated chained list. I don’t know how to proceed. #include…
-
2
votes1
answer221
viewsQ: Call methods and catch exception
I created three classes, an abstract class called Form, a class Retangulo extending Forma and a class programa, containing the method Main. My intention is in the "program" class to receive the…
-
1
votes2
answers126
viewsQ: Release of exceptions as a function of prime number
Write a function that receives a number, throw an exception if the number is not positive and return true if it is prime, or false, otherwise. My answer: public static void main(String []args)…
-
1
votes1
answer498
viewsQ: Prime number algorithm only works for the first verified number
I created a program to check primes and in it I receive n entries. That is to say, n is the number of test cases. The problem is that in the first test case everything works fine. Already in the…
-
0
votes1
answer372
viewsQ: For loop in Java
need to receive an n number and then repeat the receipt and processing of the v string, n times. I tried to do the following: import java.util.Scanner; public class Main { public static void…
-
3
votes1
answer1045
viewsQ: URI Online Judge - 1168 - Java
I am trying to solve the 1168 URI problem. However, I am not getting the number of Leds needed to mount a number. Specifically, my variable is valorLed is always resulting in zero. Can you help me?…
-
7
votes1
answer1093
viewsQ: How does dynamic typing work in Python 3.x?
I am new to Python and a question came to me when solving exercise 1001 of Uri Online (read A and B, assign sum to X and print), when writing the following code, I received the concatenation: a =…
-
0
votes1
answer60
viewsQ: Approvals, reprovacations and room-Java media
I need to receive 30 bills and return the number of approvals, reprobations and the average of the room. I tried the following: public class notas { public static int aprovacoes; public static int…