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 socket | |
| import dns.resolver | |
| from dns.exception import Timeout, DNSException | |
| def main(): | |
| while True: | |
| domain = input("Enter a domain name (example: github.com): ").strip() | |
| if not domain: | |
| print("Please enter a non-empty domain name.") | |
| continue |
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 sys | |
| import mysql.connector | |
| from mysql.connector import Error | |
| DB_CONFIG = { | |
| "host": "localhost", | |
| "port": 3306, |
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
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdbool.h> | |
| typedef enum { | |
| BROWSING, | |
| TRIAL_STARTED, | |
| PAYMENT_SETUP, | |
| SUBSCRIBED, | |
| CANCELED |
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
| #!/usr/bin/env python3 | |
| import sys | |
| import subprocess | |
| import platform | |
| import time | |
| import socket | |
| # ----------------------------- | |
| # Utility: IP <-> Integer |
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 pygame | |
| import random | |
| import sys | |
| import math | |
| # ── Constants ────────────────────────────────────────────────────────────────── | |
| CELL = 36 # size of one grid cell in pixels (bigger = bigger snake) | |
| COLS = 50 # number of columns | |
| ROWS = 38 # number of rows | |
| WIDTH = COLS * CELL |
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
| // Pin assignments | |
| const int RED_PIN = 13; | |
| const int YELLOW_PIN = 12; | |
| const int GREEN_PIN = 11; | |
| void setup() { | |
| pinMode(RED_PIN, OUTPUT); | |
| pinMode(YELLOW_PIN, OUTPUT); | |
| pinMode(GREEN_PIN, OUTPUT); |
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
| #!/usr/bin/env python3 | |
| import sys | |
| import mysql.connector | |
| from mysql.connector import Error | |
| # ---------- CONFIGURE THESE FOR YOUR DOCKER MYSQL ---------- | |
| DB_CONFIG = { | |
| "host": "localhost", | |
| "port": 3306, |
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 matplotlib.pyplot as plt | |
| import pandas as pd | |
| # Load CSV | |
| df = pd.read_csv("zombie_outbreak.csv") | |
| # Extract columns | |
| days = df["days"] | |
| zombies = df["total_zombies"] |
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 pandas as pd | |
| my_collection = { | |
| 'player_num': [10, 7, 10, 10, 10, 11, 7], | |
| 'first_name': ['Lionel', 'Cristiano', 'Edson', 'Neymar', 'Zlatan', 'Mohamed', 'George'], | |
| 'last_name': ['Messi', 'Ronaldo', 'Pele', 'Jr', 'Ibrahimovic', 'Salah', 'Best'], | |
| 'Goals': [672, 701, 767, 436, 511, 331, 179], | |
| 'Reds': [3, 11, 0, 8, 9, 0, 8], | |
| 'Yellows':[85, 129, 2, 97, 94, 18, 35], | |
| 'date_joined': ['2004-10-16', '2002-10-07', '1956-09-07', '2009-03-07', '1999-03-31', '2010-05-03', '1963-09-14'], |
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 transformers import pipeline | |
| # Load text generation pipeline | |
| generator = pipeline("text-generation", model="gpt2") | |
| def generate_text(prompt, max_length=120): | |
| result = generator( | |
| prompt, | |
| max_length=max_length, | |
| num_return_sequences=1, |
NewerOlder