Posts by Lucas Lopes • 306 points
10 posts
-
0
votes2
answers201
viewsA: Conditionally add elements into the Javascript Array
Try it this way: let conditional = false; let arr4 = ['value2', ...(condition ? arr1 : [])];…
-
0
votes2
answers798
viewsQ: How to create a scheduled task
Guys I’m trying to work with cron for the first time and trying to create a very simple scheduled task. was looking at the documentation and saw that this command needs to be executed * * * * * php…
-
2
votes1
answer430
viewsQ: How to run a Python Crawler with PHP
I made a Crawler with Python and run it by command line: python crawler.py As soon as I execute this command he asks me for the keyword that will be searched and start running. global keyword…
-
5
votes1
answer741
viewsQ: Subtract 2 weeks from a full date in Pyhton
I’m thinking a date in this format: time.strftime("%d/%m/%Y") // 00/00/0000 I want to subtract two weeks from that date, but I don’t know how to do it.
-
0
votes1
answer15259
viewsQ: Run a.js file
I am doing a JS course and created a.js file on var/www/html/js/index.js. But when I try to run the file in the browser http://localhost/js/index.js it does not run ! It just shows the code I wrote…
-
3
votes1
answer5339
viewsA: PHP - How to configure . env from Laravel to access different databases and different languages?
You can create different connections. In the config/Databases.php file there is the connection of your default database, but Voce can create other connections. So: 'connections' => [ 'mysql'…
-
3
votes1
answer498
viewsQ: Error with scrapy requests
I have a csv file with some urls that need to be accessed. http://www.icarros.com.br/Audi, Audi http://www.icarros.com.br/Fiat, Fiat http://www.icarros.com.br/Chevrolet, Chevrolet I’ve got an Spider…
-
1
votes1
answer98
viewsQ: Create a new function with scrapy
I’m starting to learn scrapy and created the following function: import scrapy class ModelSpider(scrapy.Spider): name = "model" start_urls = [ 'http://www.icarros.com/' ] def parse(self, response):…
-
4
votes1
answer260
viewsQ: How to install Python 3
I’m new to Ubuntu and I’m learning Python. I have installed on my pc Pyhton 2.7.12 and would like to know how I do to upgrade to version 3. I’m taking a course where I need to use a lib. import…
-
0
votes1
answer669
viewsQ: Compare two arrays with PHP
I am developing a project where I need to compare two arrays and organize the values. Example: # Objeto 1 $array1 = [1, 2, 3]; # bjeto 2 $array2 = [2, 1, 3]; I need to show the user a list of this…