Posts by Vinicius Morais • 1,293 points
76 posts
-
0
votes1
answer119
viewsQ: What is the best way to update a branch?
Currently when I update a branch with the modifications I made on another computer I do the sequinte: git fetch -p Then the origin/branchName and branchName are separated being the branchName…
gitasked Vinicius Morais 1,293 -
0
votes1
answer55
viewsQ: What is the coplexity of my solution?
I have the following computer problem: Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M). More formally check if there…
-
-1
votes1
answer45
viewsQ: What does this expression mean?
I’m trying to install and use Minio: https://github.com/minio/minio, and installed the https://github.com/py-pa/django-minio-storage for user as Storage in my djando project. But when saved an image…
python-3.xasked Vinicius Morais 1,293 -
2
votes0
answers67
viewsQ: What may cause the error in JSON conversion?
I’m making a Crawler, which will take the GIFS from 9gag. The code is this: In [11]: import requests In [12]: t = requests.get('https://9gag.com/v1/group-posts/group/gif/type/hot?') In [13]:…
-
0
votes0
answers47
viewsQ: Is this type of merge correct?
I’m doing the following method to administer my branchs, but I don’t know if it’s the right one: I create a branch with git branch -b newbranch and fix the changes. So when I do an update I simply…
-
7
votes1
answer92
viewsQ: How to detect when the textarea has more than one line?
I’m doing a chat, and I came across the following problem, my textarea when breaking a line, whether the user press enter or not have enough space and jump to the next line, my textearea does not…
-
2
votes1
answer73
viewsQ: How to adjust a div correctly?
I’m trying to do a chat input, but I’m having a hard time adjusting the input size with the buttons. The problem is that if I put the input of fixed size, in a larger cell phone may remain size. And…
-
0
votes1
answer41
viewsQ: How to keep the value of the variable inside the is using promise?
I got the following for: for(var i = 0; i < $scope.d.sections.length; i++) { if($scope.d.sections[i].uid) { if ($scope.d.sections[i].title != $scope.d.sections[i].oldTitle) { var uid =…
-
-1
votes1
answer1114
viewsQ: How to get the full size of the scroll?
I’m looking to acquire the percentage that my scroll is, to manipulate css. But I have these two variables: document.documentElement.scrollTop; document.documentElement.scrollHeight; The first one…
-
2
votes0
answers242
viewsQ: How to change the position of the video controller?
To fit the video on the screen of a mobile application, I made the sequinte, I put the width screen size video, I put margin-top negative for the half of what’s left of the container to adjust the…
-
0
votes0
answers276
viewsQ: How to call a function 'this' when my function does not recognize?
In the question was difficult to explain, but my problem is the sequinte, I added in my component the keyboard component. However in the function _keyboardDidHide I am calling another function that…
-
1
votes1
answer147
viewsQ: How to validate a regex rule for a user quote?
I’m making a feature on my site to quote users using @: @bananinha disse aquilo In case the name @bananinha will turn into a link when the person submits the comment. I can do with a lot of if but I…
-
0
votes2
answers461
viewsQ: How to wait two promises before returning to function?
I am making a code that makes two requests, the value returned is the size of a file content-length, but I need the function that contains these two requests to return the value after the requests…
-
0
votes1
answer33
viewsQ: Error adding ternary condition within a ui-sref
I’m making a link on a page that will redirect according to the object data. So I made a ternary condition, but it’s giving a syntax error and I can’t see what’s wrong: My html: <a…
-
1
votes1
answer439
viewsA: Optimize 20 Million registry mysql database
You can partition tables horizontally, this consists of due tables by indexes, for example date, Cpf, id. Thus there will be several tables subdivided by the index decreasing the consultation time.…
-
0
votes1
answer54
viewsA: The app I made cancels the sound of other apps
I ended up figuring out how to solve my problem, but I don’t think it’s a 100% effective solution. I reread the question github post and apparently the props disableFocus does not work, the default…
-
1
votes1
answer54
viewsQ: The app I made cancels the sound of other apps
I made an app for android, which in short is a feed of videos and images. When I open my app and some video is paused or executed, the sound of other apps is also paused (Music, radio). I’ve looked…
-
2
votes1
answer20
viewsQ: Why is my getbands returning 'L'?
I am working with images and am filtering images with transparency. I am using the function getbands() Pillow. But this image is returning : ('L',) while I just waited: ('R','G', 'B') and ('R','G',…
python-3.xasked Vinicius Morais 1,293 -
-1
votes2
answers105
viewsA: Trying to understand c/c++ pointers
You are going to edados in the function, but since it is not by pointer the value does not remain. The right one would return in the function. edados = e_inicializa(edados); and put a Re-turn inside…
-
0
votes1
answer508
viewsQ: Problem going up a page in React
I am creating a page for myself. I installed Nginx and directed the index.html for my React project. But when you go to the page it’s blank (Shouldn’t). Nginx and React are working because the page…
reactasked Vinicius Morais 1,293 -
7
votes3
answers1301
viewsQ: How to catch the element where my cursor is?
I’m creating some functions for the text editor Alloyeditor. Then I came across the need to acquire the element in Jquery that the cursor is present. I just don’t know if there is any way through…
-
1
votes1
answer2744
viewsQ: How to cancel <Text> line break?
I’m nesting several components <Text> then the problem is that at the end of each <Text> React breaks a line. I know if I do it that way: <Text> <Text>Oi</Text>…
react-nativeasked Vinicius Morais 1,293 -
2
votes1
answer41
viewsQ: Why did I have to add global research to this replace?
I am trying to remove this string from my string ​. var mypage = '<div pr-compile-html="d.article.body" id="article-body" pr-highlight="" pr-highlight-tooltip="#highlight-tooltip"…
-
0
votes2
answers127
viewsA: How to write the condition "if not A" more explicitly?
The not will deny something: not 1 #False not 2 #False not False #True So if not A will simple return will not be satisfied while A is None, False or 0 (And a few others: /a/365341/5878). If you…
-
3
votes1
answer3640
viewsA: How to check if there is an element in a Python list?
You can use the command in: 1 in [1,2,3] # True 7 in [1,2,3] # False In the case of if: if x in nomes: print(x)…
-
0
votes1
answer189
viewsQ: How to concatenate two React components?
I have the function sequinte, that does not work. textao() { var texto = <Text>Texto1</Text>; var texto2 = <Text>Texto2</Text>; return texto + texto2; } I want to concatenate…
-
1
votes2
answers92
viewsQ: Does Javascript have the equivalent of Python’s list comprehension?
I have the following code in Python: tag = 3 stack = [1,2,3,4,5,3,2,4,55,3,4,3] results = [i for i, x in enumerate(stack) if x == tag] This code will generate the following list: [2, 5, 9, 11]. And…
-
9
votes2
answers130
viewsQ: How does the interpretation of HTML code work?
I’m making a tree to derive an HTML code. And I’m treating some particular cases. And one of those cases is just when someone opens a tag and doesn’t close it: <html> <body> <div>…
-
2
votes2
answers432
viewsQ: How to compare two identical`strings, but different encoded strings?
I want to compare two strings, which are equal but have different encoding. G%C3%A9rard Depardieu and Gérard Depardieu I need to make several comparisons in two lists, but I came across this. The…
-
5
votes3
answers144
viewsQ: Is there any way to pass the parameters to a constant function?
I’m trying to do the following, I have this connection to Influxdb: InfluxDBClient('localhost', 8086, 'root', 'root', 'example') But I want to turn these parameters into a constant, so I don’t have…
-
-1
votes1
answer125
viewsQ: Is there any way to limit the number of characters in a crypt?
I need to encrypt some database keys to decrypt in the future, but all generated messages need to be the same size. md5 has generated messages of the same size, but can not translate back (E is not…
-
5
votes3
answers347
viewsA: Return the oldest person from a list with tuples
No need to walk velho, and it doesn’t even have to be a list. pessoa=[("pedro",1999,"porto"),("pedro2",2020,"feira"),("pedro3",2002,"sjm")] velho=("pedr22o",2000,"porto22") for i in pessoa: if i[1]…
-
0
votes1
answer66
viewsQ: Is there any way to divide one table into several small ones and keep the querys?
I have a problem on my server, my table artigos has 5.5 million lines and a normal select takes about 8 seconds to run. I didn’t have a brilliant idea, I will divide my table into 10 tables, and the…
postgresqlasked Vinicius Morais 1,293 -
1
votes1
answer63
viewsQ: Why adding an ng-click to the html body does not work?
I have the code: <div ng-show="d.box" class="box-red"> <img src="images/boxred.jpeg"> </div> <div> <i class="button" ng-click="d.box = !d.box"></i> </div>…
-
1
votes0
answers49
viewsQ: How do I use a directive to turn my component on and off?
I am zooming in on my website. When someone clicks on the image, I will zoom in. If the user clicks again (anywhere) will close the zoom and return to the page: But I’m having some difficulties in…
-
1
votes1
answer3735
viewsQ: How to update an on-screen variable in React-Native?
I have my own page: import React from 'react'; import { ScrollView, StyleSheet, Text, Button, } from 'react-native'; export default class ArticlesScreen extends React.Component { constructor(props)…
-
4
votes3
answers69
viewsQ: Shouldn’t this function return a bool instead of a pizza?
I am studying Act and I came across the following expression: {this.state.text.split(' ').map((word) => word && '').join(' ')} This summary expression will print a pizza for each word…
javascriptasked Vinicius Morais 1,293 -
3
votes1
answer121
viewsQ: What is the difference between function statements (React)?
I am learning Act and came across this example (Which works normally): import React, { Component } from 'react' import './Teste.css'; class Teste extends Component { constructor(props) {…
-
0
votes2
answers108
viewsA: Problems with Casino Roulette
I don’t know if it will help, but I would do the code like this: So you’re sure it will fall into the loop at least. String option; do{ System.out.println("Deseja adicionar jogador? sim ou não");…
javaanswered Vinicius Morais 1,293 -
2
votes1
answer187
viewsQ: How to decode this string in javascript
I get this string on frontend, but I need to decode it. Tr%E1%BA%A7n_H%C6%B0ng_%C4%90%E1%BA%A1o -> Trần Hưng Đạo I don’t know any function to decode it.
javascriptasked Vinicius Morais 1,293 -
1
votes1
answer23
viewsQ: Coding problem A u015bvagho u1e63a (Python3)?
I’m working with wikipedia, and I’m having some coding problems. When I add such a link in my browser everything works fine: https://en.wikipedia.org/wiki/A%C5%9Bvagho%E1%B9%A3a That goes in the…
-
0
votes1
answer382
viewsQ: How to kill the process automatically with Popen?
I am running a parallel process in python: process = subprocess.Popen(['python',path, title, uid]) The program takes +- 1 minute to finish and runs normally. The process generates a PID that I can…
python-3.xasked Vinicius Morais 1,293 -
0
votes2
answers32
viewsQ: Decryption error in request
I am sending the segiunte string via post (Javascript) to my server Bootle(Python): query = { 'wiki': `Tr%E1%BA%A7n_H%C6%B0ng_%C4%90%E1%BA%A1o`, 'uid':'f17afd66aae3a' } $.post(url, query,…
-
3
votes1
answer527
viewsQ: How to make a parallel system call in python?
I’m looking to run a program parallel to mine, in case it’s called download.py, it must run independent of my main execution main.py, but should be called in the same. I thought of making systems…
python-3.xasked Vinicius Morais 1,293 -
0
votes2
answers91
viewsQ: How to access a container within another container in Jquery?
I’m doing a function to modify these groups of buttons, but I don’t know how to access containers inside containers with Jquery. <div class="buttons"> <button…
-
5
votes2
answers544
viewsQ: Is there any way to access a CSS value?
I’m trying to adjust a css image on my site, and I want to extend the image on the whole screen, only for that I have to assign to my image: margin-left, to correct the positioning of the screen.…
cssasked Vinicius Morais 1,293 -
0
votes2
answers64
viewsQ: How to access a jquery without id?
I always completed a jquery using the command: $('#id_1'), but always in a html body that has id. How do I access an html body that does not have id, using the attribute data-uid in my case below?…
-
2
votes1
answer220
viewsQ: How to assign two values in ng-click?
I have this html body that will invert the boolean variable d.expandedBlog when clicked. It is working normally. <div class="article-blog-icon-comment"> <i class="fa fa-commenting-o…
-
2
votes2
answers487
viewsA: Can we create artificial intelligence in any language?
1- If you have the premise that an artificial intelligence is an algorithm that will make decisions for you, I think it can be programmed in any language. At heart I think working with AI is more…
-
0
votes1
answer906
viewsQ: Limit when creating a list in Python
With the following command, I can create a Python list: lista = [[None]]*50 I will have a list of 50 units. However, if I create a list this way: lista = [[None]]*50 for l in lista:…
pythonasked Vinicius Morais 1,293