This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(A): | |
# sort the array of unique items | |
sorted_a = list(sorted(set(A))) | |
# record the index of the last negative number or 0 | |
neg_index = 0 | |
for i in range(len(sorted_a)): | |
if sorted_a[i] <= 0 : | |
neg_index = i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import requests | |
from bs4 import BeautifulSoup | |
def extract_images(site): | |
""" Extract images from the url given""" | |
response = requests.get(site) | |
soup = BeautifulSoup(response.text, 'html.parser') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets" : ["env", "react"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"dev": "webpack-dev-server --config ./webpack.config.js" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
export default class HelloWorldReact extends Component{ | |
render(){ | |
return <p>Hello world, I just bootstrapped a react app from source. </p> | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
//our main application | |
import App from './src/App' | |
ReactDOM.render(<App />, document.getElementById('app')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>React App</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width initial-scale=1.0"> | |
<head> | |
<body> | |
<div id="app"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = { | |
entry: './index.js', | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
mode: 'development', | |
devServer: { |