Posts by Vinicius Morais • 1,293 points
76 posts
-
1
votes0
answers24
viewsQ: Error loading a video and creating an object in Django
My function in Django will receive a video from my site, is working normally. So I created the function create: def create(self, request): Video.objects.create(file=request.data['file'],…
-
0
votes0
answers56
viewsQ: How to convert video to memory with moviepy?
I’m converting videos into python and I’m using the moviepy library. I’m using the instructions: clip = VideoFileClip('/home/developer/Pictures/aa.mov')…
pythonasked Vinicius Morais 1,293 -
1
votes1
answer109
viewsQ: When the container does not know the host name?
I created a container on Docker and it tries to access a host called pgmaster. On the machine where Docker is installed I added the sequinte host: 10.0.0.3 pgmaster in the /etc/hosts. So much so…
-
0
votes1
answer25
viewsQ: My inserts are not being saved
I installed a postgre cluster using pgpool in Docker containers, https://github.com/paunin/PostDock. I can connect to pgpool and make insertions and other normal sql commands. psql monkey_db -h…
-
1
votes1
answer117
viewsQ: How to replicate a particular bank in postgres to a particular door?
Well I have the following scenario, I need to do a replication of a bank A for bank B. Well so far I was able to make from one machine to another making the following changes: Master Machine -…
-
1
votes0
answers45
viewsQ: Saving the user activity in the database(sql)
I am creating a chart to analyze the access of posts by age group by time on my site. But the site does not yet have this ability to capture the activity of the user and need to do it. My task and…
-
1
votes1
answer67
viewsQ: How to leave my bank in the postgres always ordered?
I’m making a page search system in which I will always make the subsequent query in the bank: 'SELECT title FROM pages ORDER BY title ASC OFFSET' +iniciaL + 'FETCH FIRST 32 ROWS ONLY' I choose an…
postgresqlasked Vinicius Morais 1,293 -
0
votes2
answers66
viewsQ: How to generate HTML at a specific point in the page?
I’m learning to code in Javascript and jQuery, and I’m having trouble generating HTML code. Given an HTML body how do I insert HTML code within a specific place? In the case below I already know how…
-
2
votes1
answer94
viewsQ: How to do Mongo inserts?
I’m doing a program that will perform numerous insertions in Mongo (about 500,000). But I noticed doing some tests, that the more entries in Mongo I have, the longer is the insertion. My code: def…
-
1
votes1
answer617
viewsQ: Does query with date in sql include the day in question?
I have a doubt in a matter of the exact days that SQL include, and my system once a day performs the following query on the system: SELECT id,nome FROM products WHERE created_date between…
-
2
votes1
answer721
viewsQ: Error installing psycopg2 in a pypy virtualenv environment
I installed the shape sequinte pypy: wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.10.1-linux64.tar.bz2 tar xf pypy3-v5.10.1-linux64.tar.bz2 virtualenv -p ~/pypy3-v5.10.1-linux64/bin/pypy…
-
1
votes0
answers81
viewsQ: What better way to parallelize this function?
I am trying to parallelize a function that calculates the Cosine similarity: Here is my code: import numpy as np def cos_sim(a,b): dot_product = np.dot(a,b) norm_a = np.linalg.norm(a) norm_b =…
-
0
votes2
answers39
viewsA: Mysql Query with multiple tables
Well I don’t know exactly how your tables are, but I would change the query to the following, just by putting () and a DISTINCT for a better organization: SELECT DISTINCT…
-
4
votes1
answer553
viewsQ: Is there a better way to build a graph?
I have a list of articles with their respective tags: artigo1 ['a','b','c'] artigo2 ['a','d','f'] artigo3 ['z','d','f'] ... I need to create a graph that will relate all articles by tags. In the end…
-
5
votes2
answers367
viewsQ: How to optimize my access to the Python dictionary?
I have a dictionary of the form sequinte: dicionario = {'1':'Banana','7':'Maçã','3':'Pera','2':'Melancia'} If I check the key '2' in the dictionary: if '2' in dicionario:. My programmer intuition…
-
1
votes1
answer1071
viewsQ: How to create a dictionary and auto increment values?
I need to create a dictionary from a list of integers, where each key contains the value of the sums that are in the list: t = [[1,2],[2,1],[3,1],[4,1],[1,1],[2,2],[1,2]] dicionario = {} for i in t:…
-
0
votes1
answer489
viewsQ: How to run the Maven dependencies?
I am making an application inside a virtual machine and I am using Maven to install Mahout, in Eclipse on another pc worked perfect, but while doing the same project on a virtual machine I did the…
-
0
votes0
answers2733
viewsQ: Run the Maven java project via terminal?
I did a Maven project on Eclipse, I installed a Mahout dependency on pom.xml, I made the code and it works beautiful, it’s beautiful. But I have to run it on a virtual machine, that is without…
-
2
votes1
answer95
viewsQ: Parallelize with just one core?
I want to parallelize an application, in this case a 'Cosine similarity' calculation, but the machine I am working on has only one core. Parallelizing this calculation with just one core will have…
-
1
votes1
answer1281
viewsQ: How to delete an entry from a Python file without having to read the entire file?
I have a file with the following entries: Ana Joao Pedro José .... And I need to delete the line with the name Pedro, it would be easy for me to read the whole file, save in a list delete Pedro and…
-
0
votes1
answer2368
viewsQ: How to go back days on datetime, python?
I need to return a string in the format "dd/mm/yyyy" in python, I got through the library datetime. import datetime date = datetime.datetime.now().strftime("%d/%m/%y") But I also need the date 7…
-
1
votes1
answer189
viewsA: Error comparing characters with strcmp
You’re going through the wrong vet vector. In your logic if there are 1 million 40 D boots and at the end there is only one 40 E boot, your result will show that there are 1 million pairs. It would…
canswered Vinicius Morais 1,293 -
0
votes1
answer773
viewsA: How to save image in database?
You can create a Mouse database for the images and save the image using the Mouse Docker. It’s quite simple. And in your main bank you save the id that references the image in Mongo.
-
-1
votes2
answers778
viewsA: Doubt about the Slice function
Slice into a list would be the equivalent of using: ":" input = ['laranja','limão','melancia','mamão'] print(input[1:-1]) There are numerous ways you can delimit a list. See this question in the…
-
-1
votes3
answers1943
viewsA: Run Python and C# together
You can make a system call Process.start(@"python C:\ApertouR.py") But I don’t know what kind of application this is.
-
2
votes0
answers45
viewsQ: What is the best ratio for me to create this dataset?
I am creating a 'convolutional neural network' to detect NSFW(Not safe for work) or 18+ images. But I don’t know the ratio and size of my dataset. I hope to join about 70,000 images with 50% sfw and…
asked Vinicius Morais 1,293