-
Install Homebrew The Missing Package Manager for macOS (or Linux) — Homebrew
-
Download Miniforge3
-
Install Miniforge3 and restart your terminal as soon as the installation finishes:
This file contains hidden or 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
from typing import Any, Dict, List | |
import s3fs | |
from pyarrow import Table, parquet as pq | |
from pandas import DataFrame, Series | |
def to_df(data: List[Dict[str, Any]]) -> DataFrame: | |
df = DataFrame() | |
for item in data: | |
indexes = [] | |
values = [] |
This file contains hidden or 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 requests | |
def get_weather(latitude_,longitude_): | |
# latitude = latitude_ | |
# longitude = longitude_ | |
# url = 'http://api.openweathermap.org/data/2.5/weather?lat={}&lon={}&appid=8f47bbfcc82517d109015de292ab80cd&units=metric'.format(latitude, longitude) | |
# res = requests.get(url) | |
# data = res.json() | |
response = dict(main="Haze",desc="haze",temp=18,pressure=1014,humidity=72,temp_min=18,temp_max=18,wind_speed=1.5,wind_degree=310,datetime=1544556600,clouds_all=20,sys_sunrise=1544488256,sys_sunset=1544526753) | |
return response |
This file contains hidden or 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 os | |
import pandas as pd | |
import numpy as np | |
import random | |
import django | |
from django.utils import timezone | |
from populate_weather import get_location,get_weather | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'categorized_affect_map.settings') | |
django.setup() |
This file contains hidden or 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 os | |
import pandas as pd | |
import numpy as np | |
import random | |
import django | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'categorized_affect_map.settings') | |
django.setup() | |
from classification.models import Category, Feature | |
from django.utils import timezone |
This file contains hidden or 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> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<script>L_PREFER_CANVAS=false; L_NO_TOUCH=false; L_DISABLE_3D=false;</script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/> |
This file contains hidden or 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
BEGIN TRANSACTION; | |
CREATE TABLE Students (ID integer PRIMARY KEY, Name varchar(255)); | |
CREATE TABLE Friends (ID integer PRIMARY KEY, Friend_ID integer); | |
CREATE TABLE Packages (ID integer PRIMARY KEY, Salary float(23,19)); | |
INSERT INTO Students (ID,Name) | |
VALUES (1,'Ashley'); | |
INSERT INTO Students (ID,Name) | |
VALUES (2,'Samantha'); |
This file contains hidden or 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
# Add User Non-interactively without password | |
1. sudo adduser --disabled-password --gecos "" username | |
# Grant root access to the user so s/he can execute sudo without a password. | |
1. sudo visudo | |
#After includedir /etc/sudoers.d put-. | |
2. username ALL=(ALL) NOPASSWD: ALL | |
# Create a folder named .ssh in the user’s home directory. | |
1. mkdir /home/username/.ssh |
This file contains hidden or 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 | |
log_list = [] | |
hosts = set() | |
hosts_status = set() | |
test_str = '' | |
filepath = 'problem-2.txt' | |
with open(filepath) as fp: | |
test_str = fp.read().strip() |
This file contains hidden or 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 requests | |
class Scraper: | |
''' Request information and Scrape data class ''' | |
def __init__(self,ip=None): | |
self.address = 'http://ip-api.com/json/' | |
self.ip = ip | |
def get_geo_ip_info(self): | |
'''Collect geo ip info''' |
NewerOlder