Snippets Collections
kubectl config set-context --current --namespace=<namespace-name>
kubectl get pod pod1

kubectl get pods pod1

kubectl get po pod1
import tensorflow as tf
mnist = tf.keras.datasets.mnist

(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

model = tf.keras.models.Sequential([
  tf.keras.layers.Flatten(input_shape=(28, 28)),
  tf.keras.layers.Dense(128, activation='relu'),
  tf.keras.layers.Dropout(0.2),
  tf.keras.layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
  loss='sparse_categorical_crossentropy',
  metrics=['accuracy'])

model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)
php artisan make:controller SiteController
from pymongo import MongoClient
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from nltk.corpus import stopwords
import statistics

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

def preprocess_text(text):
    # Remove stopwords
    stop_words = set(stopwords.words('english'))
    tokens = text.split()
    tokens = [token for token in tokens if token.lower() not in stop_words]
    
    return tokens




negative_comments_klm = [
    "I had a terrible experience with KLM. Their customer service was rude and unhelpful.",
    "KLM lost my luggage and didn't offer any compensation or assistance.",
    "Avoid KLM at all costs! They canceled my flight without any notice and left me stranded.",
    "I'll never fly with KLM again. Their planes are old and uncomfortable.",
    "KLM overbooked my flight and bumped me off without any compensation or apology.",
    "KLM delayed my flight multiple times and provided no explanation or updates.",
    "I had a horrible experience with KLM. They were disorganized and incompetent.",
    "KLM's customer service is the worst I've ever encountered. They were unresponsive and dismissive.",
    "KLM's website is a nightmare to use. It's slow, confusing, and full of errors.",
    "I regret choosing KLM for my trip. Their staff was rude and disrespectful.",
    "KLM's flight attendants were unprofessional and uncaring. They ignored my requests and were rude.",
    "I'll never trust KLM again. Their flight schedules are unreliable and constantly changing.",
    "KLM's prices are outrageous for the terrible service they provide. Avoid them if you can.",
    "KLM's planes are dirty and poorly maintained. I felt unsafe throughout the entire flight.",
    "I had a terrible experience with KLM's customer service. They were unhelpful and unsympathetic.",
    "KLM's food and beverage options are awful. I wouldn't feed it to my worst enemy.",
    "I'll never fly KLM again after the nightmare experience I had with them.",
    "KLM's flight attendants were rude and disrespectful. They made me feel unwelcome and uncomfortable.",
    "KLM's cancellation policy is a scam. They charged me outrageous fees to cancel my flight.",
    "I'll be filing a complaint against KLM for the horrendous service I received from them.",
    "KLM's check-in process is a disaster. It took hours to get through, and their staff was unhelpful.",
    "KLM's in-flight entertainment is outdated and limited. There was nothing to do during the flight.",
    "I had a terrible experience with KLM's booking system. It was glitchy and unreliable.",
    "KLM's seats are cramped and uncomfortable. I couldn't sleep a wink on my flight.",
    "I'll never recommend KLM to anyone after the terrible experience I had with them.",
    "KLM's flight attendants were rude and unprofessional. They treated passengers with disrespect.",
    "KLM's flight was a nightmare from start to finish. I'll never fly with them again.",
    "I had a terrible experience with KLM's baggage handling. My luggage was damaged and items were missing.",
    "KLM's customer service representatives were unhelpful and unwilling to assist me with my issue.",
    "I'll be avoiding KLM in the future. Their service was atrocious and their staff were incompetent.",
    "KLM's flight was delayed for hours without any explanation or compensation. It ruined my trip.",
    "I had a horrible experience with KLM's ground staff. They were rude and unhelpful.",
    "KLM's flight was overbooked and they refused to offer any compensation or alternative arrangements.",
    "I'll never fly with KLM again after the terrible experience I had with them.",
    "KLM's flight was cancelled at the last minute and they offered no assistance or compensation.",
    "KLM's customer service was appalling. They were unresponsive and unwilling to help me with my issue.",
    "I had a terrible experience with KLM's flight attendants. They were rude and dismissive.",
    "KLM's flight was delayed multiple times and they provided no information or updates to passengers.",
    "I'll never fly with KLM again. Their service was terrible and their staff were rude.",
    "KLM's flight was overbooked and they refused to compensate me or provide alternative arrangements.",
    "I had a horrible experience with KLM's customer service. They were unhelpful and unresponsive.",
    "KLM's website is a nightmare to navigate. It's slow, confusing, and full of errors.",
    "I'll never trust KLM again after the terrible experience I had with them.",
    "KLM's flight attendants were rude and unprofessional. They made me feel unwelcome and uncomfortable.",
    "KLM's prices are outrageous for the terrible service they provide. Avoid them if you can.",
    "KLM's planes are dirty and poorly maintained. I felt unsafe throughout the entire flight.",
    "I had a terrible experience with KLM's customer service. They were unhelpful and unsympathetic.",
    "KLM's food and beverage options are awful. I wouldn't feed it to my worst enemy.",
    "I'll never fly KLM again after the nightmare experience I had with them.",
    "KLM's flight attendants were rude and disrespectful. They made me feel unwelcome and uncomfortable.",
    "KLM's cancellation policy is a scam. They charged me outrageous fees to cancel my flight.",
    "I'll be filing a complaint against KLM for the horrendous service I received from them.",
    "KLM's check-in process is a disaster. It took hours to get through, and their staff was unhelpful.",
    "KLM's in-flight entertainment is outdated and limited. There was nothing to do during the flight.",
    "I had a terrible experience with KLM's booking system. It was glitchy and",
    "i hate klm"]
list_of_scores = []
for text in negative_comments_klm:
    preprocessed_text = preprocess_text(text)
    processed_text = ' '.join(preprocessed_text)  # Convert preprocessed tokens back to text
    score = analyze_sentiment(processed_text)
    list_of_scores.append(score)

average_score = statistics.mean(list_of_scores)
print("Average sentiment score:", average_score)
from pymongo import MongoClient
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from nltk.corpus import stopwords
import statistics

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

def preprocess_text(text):
    # Remove stopwords
    stop_words = set(stopwords.words('english'))
    tokens = text.split()
    tokens = [token for token in tokens if token.lower() not in stop_words]
    
    return tokens




negative_comments_klm = [
    "I had a terrible experience with KLM. Their customer service was rude and unhelpful.",
    "KLM lost my luggage and didn't offer any compensation or assistance.",
    "Avoid KLM at all costs! They canceled my flight without any notice and left me stranded.",
    "I'll never fly with KLM again. Their planes are old and uncomfortable.",
    "KLM overbooked my flight and bumped me off without any compensation or apology.",
    "KLM delayed my flight multiple times and provided no explanation or updates.",
    "I had a horrible experience with KLM. They were disorganized and incompetent.",
    "KLM's customer service is the worst I've ever encountered. They were unresponsive and dismissive.",
    "KLM's website is a nightmare to use. It's slow, confusing, and full of errors.",
    "I regret choosing KLM for my trip. Their staff was rude and disrespectful.",
    "KLM's flight attendants were unprofessional and uncaring. They ignored my requests and were rude.",
    "I'll never trust KLM again. Their flight schedules are unreliable and constantly changing.",
    "KLM's prices are outrageous for the terrible service they provide. Avoid them if you can.",
    "KLM's planes are dirty and poorly maintained. I felt unsafe throughout the entire flight.",
    "I had a terrible experience with KLM's customer service. They were unhelpful and unsympathetic.",
    "KLM's food and beverage options are awful. I wouldn't feed it to my worst enemy.",
    "I'll never fly KLM again after the nightmare experience I had with them.",
    "KLM's flight attendants were rude and disrespectful. They made me feel unwelcome and uncomfortable.",
    "KLM's cancellation policy is a scam. They charged me outrageous fees to cancel my flight.",
    "I'll be filing a complaint against KLM for the horrendous service I received from them.",
    "KLM's check-in process is a disaster. It took hours to get through, and their staff was unhelpful.",
    "KLM's in-flight entertainment is outdated and limited. There was nothing to do during the flight.",
    "I had a terrible experience with KLM's booking system. It was glitchy and unreliable.",
    "KLM's seats are cramped and uncomfortable. I couldn't sleep a wink on my flight.",
    "I'll never recommend KLM to anyone after the terrible experience I had with them.",
    "KLM's flight attendants were rude and unprofessional. They treated passengers with disrespect.",
    "KLM's flight was a nightmare from start to finish. I'll never fly with them again.",
    "I had a terrible experience with KLM's baggage handling. My luggage was damaged and items were missing.",
    "KLM's customer service representatives were unhelpful and unwilling to assist me with my issue.",
    "I'll be avoiding KLM in the future. Their service was atrocious and their staff were incompetent.",
    "KLM's flight was delayed for hours without any explanation or compensation. It ruined my trip.",
    "I had a horrible experience with KLM's ground staff. They were rude and unhelpful.",
    "KLM's flight was overbooked and they refused to offer any compensation or alternative arrangements.",
    "I'll never fly with KLM again after the terrible experience I had with them.",
    "KLM's flight was cancelled at the last minute and they offered no assistance or compensation.",
    "KLM's customer service was appalling. They were unresponsive and unwilling to help me with my issue.",
    "I had a terrible experience with KLM's flight attendants. They were rude and dismissive.",
    "KLM's flight was delayed multiple times and they provided no information or updates to passengers.",
    "I'll never fly with KLM again. Their service was terrible and their staff were rude.",
    "KLM's flight was overbooked and they refused to compensate me or provide alternative arrangements.",
    "I had a horrible experience with KLM's customer service. They were unhelpful and unresponsive.",
    "KLM's website is a nightmare to navigate. It's slow, confusing, and full of errors.",
    "I'll never trust KLM again after the terrible experience I had with them.",
    "KLM's flight attendants were rude and unprofessional. They made me feel unwelcome and uncomfortable.",
    "KLM's prices are outrageous for the terrible service they provide. Avoid them if you can.",
    "KLM's planes are dirty and poorly maintained. I felt unsafe throughout the entire flight.",
    "I had a terrible experience with KLM's customer service. They were unhelpful and unsympathetic.",
    "KLM's food and beverage options are awful. I wouldn't feed it to my worst enemy.",
    "I'll never fly KLM again after the nightmare experience I had with them.",
    "KLM's flight attendants were rude and disrespectful. They made me feel unwelcome and uncomfortable.",
    "KLM's cancellation policy is a scam. They charged me outrageous fees to cancel my flight.",
    "I'll be filing a complaint against KLM for the horrendous service I received from them.",
    "KLM's check-in process is a disaster. It took hours to get through, and their staff was unhelpful.",
    "KLM's in-flight entertainment is outdated and limited. There was nothing to do during the flight.",
    "I had a terrible experience with KLM's booking system. It was glitchy and",
    "i hate klm"]
list_of_scores = []
for text in negative_comments_klm:
    preprocessed_text = preprocess_text(text)
    processed_text = ' '.join(preprocessed_text)  # Convert preprocessed tokens back to text
    score = analyze_sentiment(processed_text)
    list_of_scores.append(score)

average_score = statistics.mean(list_of_scores)
print("Average sentiment score:", average_score)
from pymongo import MongoClient
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import statistics


def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

negative_comments_klm = [
    "I had a terrible experience with KLM. Their customer service was rude and unhelpful.",
    "KLM lost my luggage and didn't offer any compensation or assistance.",
    "Avoid KLM at all costs! They canceled my flight without any notice and left me stranded.",
    "I'll never fly with KLM again. Their planes are old and uncomfortable.",
    "KLM overbooked my flight and bumped me off without any compensation or apology.",
    "KLM delayed my flight multiple times and provided no explanation or updates.",
    "I had a horrible experience with KLM. They were disorganized and incompetent.",
    "KLM's customer service is the worst I've ever encountered. They were unresponsive and dismissive.",
    "KLM's website is a nightmare to use. It's slow, confusing, and full of errors.",
    "I regret choosing KLM for my trip. Their staff was rude and disrespectful.",
    "KLM's flight attendants were unprofessional and uncaring. They ignored my requests and were rude.",
    "I'll never trust KLM again. Their flight schedules are unreliable and constantly changing.",
    "KLM's prices are outrageous for the terrible service they provide. Avoid them if you can.",
    "KLM's planes are dirty and poorly maintained. I felt unsafe throughout the entire flight.",
    "I had a terrible experience with KLM's customer service. They were unhelpful and unsympathetic.",
    "KLM's food and beverage options are awful. I wouldn't feed it to my worst enemy.",
    "I'll never fly KLM again after the nightmare experience I had with them.",
    "KLM's flight attendants were rude and disrespectful. They made me feel unwelcome and uncomfortable.",
    "KLM's cancellation policy is a scam. They charged me outrageous fees to cancel my flight.",
    "I'll be filing a complaint against KLM for the horrendous service I received from them.",
    "KLM's check-in process is a disaster. It took hours to get through, and their staff was unhelpful.",
    "KLM's in-flight entertainment is outdated and limited. There was nothing to do during the flight.",
    "I had a terrible experience with KLM's booking system. It was glitchy and unreliable.",
    "KLM's seats are cramped and uncomfortable. I couldn't sleep a wink on my flight.",
    "I'll never recommend KLM to anyone after the terrible experience I had with them.",
    "KLM's flight attendants were rude and unprofessional. They treated passengers with disrespect.",
    "KLM's flight was a nightmare from start to finish. I'll never fly with them again.",
    "I had a terrible experience with KLM's baggage handling. My luggage was damaged and items were missing.",
    "KLM's customer service representatives were unhelpful and unwilling to assist me with my issue.",
    "I'll be avoiding KLM in the future. Their service was atrocious and their staff were incompetent.",
    "KLM's flight was delayed for hours without any explanation or compensation. It ruined my trip.",
    "I had a horrible experience with KLM's ground staff. They were rude and unhelpful.",
    "KLM's flight was overbooked and they refused to offer any compensation or alternative arrangements.",
    "I'll never fly with KLM again after the terrible experience I had with them.",
    "KLM's flight was cancelled at the last minute and they offered no assistance or compensation.",
    "KLM's customer service was appalling. They were unresponsive and unwilling to help me with my issue.",
    "I had a terrible experience with KLM's flight attendants. They were rude and dismissive.",
    "KLM's flight was delayed multiple times and they provided no information or updates to passengers.",
    "I'll never fly with KLM again. Their service was terrible and their staff were rude.",
    "KLM's flight was overbooked and they refused to compensate me or provide alternative arrangements.",
    "I had a horrible experience with KLM's customer service. They were unhelpful and unresponsive.",
    "KLM's website is a nightmare to navigate. It's slow, confusing, and full of errors.",
    "I'll never trust KLM again after the terrible experience I had with them.",
    "KLM's flight attendants were rude and unprofessional. They made me feel unwelcome and uncomfortable.",
    "KLM's prices are outrageous for the terrible service they provide. Avoid them if you can.",
    "KLM's planes are dirty and poorly maintained. I felt unsafe throughout the entire flight.",
    "I had a terrible experience with KLM's customer service. They were unhelpful and unsympathetic.",
    "KLM's food and beverage options are awful. I wouldn't feed it to my worst enemy.",
    "I'll never fly KLM again after the nightmare experience I had with them.",
    "KLM's flight attendants were rude and disrespectful. They made me feel unwelcome and uncomfortable.",
    "KLM's cancellation policy is a scam. They charged me outrageous fees to cancel my flight.",
    "I'll be filing a complaint against KLM for the horrendous service I received from them.",
    "KLM's check-in process is a disaster. It took hours to get through, and their staff was unhelpful.",
    "KLM's in-flight entertainment is outdated and limited. There was nothing to do during the flight.",
    "I had a terrible experience with KLM's booking system. It was glitchy and",
    "i hate klm"]
list_of_scores = []
for text in negative_comments_klm:
    score = analyze_sentiment(text)
    list_of_scores.append(score)
aveage_score = statistics.mean(list_of_scores)
print(aveage_score)
from pymongo import MongoClient, errors
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import string

# MongoDB connection settings
mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"

# Initialize NLTK resources
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')

def get_text_from_doc(doc):
    """
    Extracts the text from the document.
    Returns the text if available, otherwise returns None.
    """
    text = doc.get("json_data", {}).get("text")
    if text:
        return text
    extended_text = doc.get("json_data", {}).get("extended_tweet", {}).get("full_text")
    return extended_text

def preprocess_text(text):
  
    # Remove punctuation
    tokens = [token for token in tokens if token not in string.punctuation]
    
    # Remove stopwords
    stop_words = set(stopwords.words('english') + stopwords.words('spanish') + stopwords.words('dutch'))    
    tokens = [token for token in tokens if token not in stop_words]
    
    # Lemmatization
    lemmatizer = WordNetLemmatizer()
    tokens = [lemmatizer.lemmatize(token) for token in tokens]
    
    return tokens

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]

    cursor = source_collection.find().limit(20)  # Limit to only 20 tweets

    for doc in cursor:
        text = get_text_from_doc(doc)
        if text:
            preprocessed_text = preprocess_text(text)
            processed_text = ' '.join(preprocessed_text)  # Convert preprocessed tokens back to text
            print("Original Text:", text)
            print("Processed Text:", processed_text)
            print("Sentiment Score:", analyze_sentiment(processed_text))
            print()

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
from pymongo import MongoClient
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import statistics
def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']
neutral_comments_klm = [
    "I have a flight booked with KLM.",
    "I'm flying with KLM next month.",
    "I've used KLM for my travels before.",
    "I'm considering KLM for my upcoming trip.",
    "KLM operates flights to various destinations.",
    "I'll be flying with KLM for my vacation.",
    "KLM offers flights at competitive prices.",
    "I'll be traveling with KLM for work.",
    "I've heard about KLM's services.",
    "KLM is one of the airlines I'm considering.",
    "I've seen advertisements for KLM.",
    "I'll be using KLM for my international flight.",
    "KLM provides options for connecting flights.",
    "I need to check KLM's flight schedule.",
    "I'm looking into KLM's frequent flyer program.",
    "I received an email from KLM.",
    "I'm exploring flight options with KLM.",
    "KLM offers flights with various amenities.",
    "I'll be flying with KLM for my family visit.",
    "KLM has partnerships with other airlines.",
    "I'll be using KLM for my business trip.",
    "KLM has a website for booking flights.",
    "I'll be flying with KLM because of the route.",
    "KLM provides options for different classes.",
    "I've considered KLM for my travel plans.",
    "KLM offers online check-in.",
    "I've received information about KLM's services.",
    "I'll be flying with KLM due to convenience.",
    "KLM has a mobile app for flight management.",
    "I'll be using KLM for my upcoming trip abroad.",
    "KLM offers options for booking accommodations.",
    "I've heard about KLM's customer service.",
    "I'll be considering KLM for future travels.",
    "KLM provides options for flight upgrades.",
    "I'll be flying with KLM because of recommendations.",
    "KLM offers options for flight insurance.",
    "I've checked KLM's flight status online.",
    "I'll be flying with KLM for personal reasons.",
    "KLM provides options for seat selection.",
    "I've received promotions from KLM.",
    "I'll be flying with KLM for leisure travel.",
    "KLM offers options for in-flight entertainment.",
    "I've read about KLM's safety measures.",
    "I'll be flying with KLM because of scheduling.",
    "KLM provides options for booking car rentals.",
    "I've looked into KLM's baggage policies.",
    "I'll be flying with KLM for holiday travel.",
    "KLM offers options for travel insurance.",
    "I've explored KLM's route map.",
    "I'll be considering KLM for my next trip.",
    "KLM provides options for airport transfers.",
    "I've browsed KLM's website for information.",
    "I'll be flying with KLM due to flexibility.",
    "KLM offers options for flight add-ons.",
    "I've researched KLM's onboard services.",
    "I'll be considering KLM for my future travels.",
    "KLM provides options for special assistance.",
    "I've looked into KLM's loyalty program.",
    "I'll be flying with KLM for my international trip.",
    "KLM offers options for travel packages.",
    "I've compared KLM's fares with other airlines.",
    "I'll be considering KLM for my next vacation.",
    "KLM provides options for dietary preferences.",
    "I've checked KLM's reviews online.",
    "I'll be flying with KLM for my trip to Europe.",
    "KLM offers options for travel upgrades.",
    "I've explored KLM's flight routes.",
    "I'll be considering KLM for my next adventure.",
    "KLM provides options for group bookings."
]


list_of_scores = []
for text in neutral_comments_klm:
    score = analyze_sentiment(text)
    list_of_scores.append(score)
aveage_score = statistics.mean(list_of_scores)
print(aveage_score)


from pymongo import MongoClient, errors
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

# MongoDB connection settings
mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"

def get_text_from_doc(doc):
    """
    Extracts the text from the document.
    Returns the text if available, otherwise returns None.
    """
    text = doc.get("json_data", {}).get("text")
    if text:
        return text
    extended_text = doc.get("json_data", {}).get("extended_tweet", {}).get("full_text")
    return extended_text

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    compound_score = sentiment['compound']
    if compound_score > 0.05:
        return 'positive'
    elif compound_score < -0.05:
        return 'negative'
    else:
        return 'neutral'

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]

    # Define query to filter tweets related to KLM (tweets made by KLM or mentioning KLM)
    query = {
        "$or": [
            {"json_data.user.id": 56377143},  # Tweets made by KLM
            {"json_data.entities.user_mentions.id": 56377143}  # Tweets mentioning KLM
        ]
    }

    # Count variables for sentiment analysis
    positive_count = 0
    neutral_count = 0
    negative_count = 0

    cursor = source_collection.find(query)

    for doc in cursor:
        text = get_text_from_doc(doc)
        if text:
            sentiment = analyze_sentiment(text)
            if sentiment == 'positive':
                positive_count += 1
            elif sentiment == 'neutral':
                neutral_count += 1
            elif sentiment == 'negative':
                negative_count += 1

    print("Number of tweets related to KLM:")
    print("Positive:", positive_count)
    print("Neutral:", neutral_count)
    print("Negative:", negative_count)

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
import random

# Define the fruit and number words
fruits = ['pear']
number_words = ['forty-one']

# Function to generate a random fruit and number word
def get_random_fruit_and_number():
    fruit = random.choice(fruits)
    number_word = random.choice(number_words)
    return fruit, number_word

# Function to display the game
def play_game():
    print("Welcome to the Number Words Fruit Splat Game!")
    print("Match the number word to the correct number of fruits.")
    
    score = 0
    while True:
        fruit, number_word = get_random_fruit_and_number()
        print(f"How many {fruit}s are there?")
        user_input = input("Enter the number word: ")
        
        if user_input.lower() == number_word:
            print("Correct!")
            score += 1
        else:
            print(f"Incorrect. The correct answer is {number_word}.")
        
        print(f"Your current score is: {score}")
        
        play_again = input("Do you want to play again? (y/n) ")
        if play_again.lower() != 'y':
            break

if __name__ == "__main__":
    play_game()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

	
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        'Chargement de l'image
        Me.PictureBox1.Image = System.Drawing.Bitmap.FromFile("C:\Documents and Settings\Ludo\Bureau\Video Club\Jacquettes\hardcandy.jpg")
 
 
        'Définit un objet Graphics avec l'image de ton picturebox
        Dim ObjGraphics As Graphics = Graphics.FromImage(Me.PictureBox1.Image)
 
        'Définit le pinceau pour l'écriture 
        Dim brush As Brush = New SolidBrush(Color.Black)
 
 
        'Définit la police d'écriture avec la taille ainsi que le style (gras, italique...)
        Dim font As New Font("times new roman", 20, FontStyle.Bold)
 
        'Dessine le texte sur l'image à la position X de 10 et Y de 10
        ObjGraphics.DrawString(Me.TextBox1.Text, font, Brushes.Brown, 10, 10)
 
        'Libère les ressources
        ObjGraphics.Dispose()
 
        'Redessine l'image avec le texte
        Me.PictureBox1.Image = Me.PictureBox1.Image
 
    End Sub
flyway -configFiles=configs/flyway_staging.conf migrate  


add migrations location
flyway.locations=filesystem:/Users/pullamma/go/src/github.com/Zomato/logistics-bonus-service/deployment/migrations
Program 1: This program creates a shared memory segment, attaches itself to it and then writes some content into the shared memory segment.
Solution:
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/shm.h>
#include<string.h>
int main()
{
int i;
void *shared_memory;
char buff[100];
int shmid;
shmid=shmget((key_t)2345, 1024, 0666|IPC_CREAT); 
printf("Key of shared memory is %d\n",shmid);
shared_memory=shmat(shmid,NULL,0); //process attached to shared memory segment
printf("Process attached at %p\n",shared_memory); //this prints the address where the segment is attached with this process
printf("Enter some data to write to shared memory\n");
read(0,buff,100); //get some input from user
strcpy(shared_memory,buff); //data written to shared memory
printf("You wrote : %s\n",(char *)shared_memory);
}

//Program 2: This program attaches itself to the shared memory segment created in Program 1. Finally, it reads the content of the shared memory.
Solution:
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/shm.h>
#include<string.h>
int main()
{
int i;
void *shared_memory;
char buff[100];
int shmid;
shmid=shmget((key_t)2345, 1024, 0666);
printf("Key of shared memory is %d\n",shmid);
shared_memory=shmat(shmid,NULL,0); //process attached to shared memory segment
printf("Process attached at %p\n",shared_memory);
printf("Data read from shared memory is : %s\n",(char *)shared_memory);
}
; array_sort.asm
.model small
.stack 100h
.data
    array db 5, 3, 8, 4, 2 ; Array to be sorted
    array_size equ $-array ; Size of the array
    newline db 0Dh, 0Ah, '$' ; Newline characters for printing
    space db ' $' ; Space character for printing

.code
main proc
    mov ax, @data
    mov ds, ax
    mov es, ax

    ; Initialize pointers
    lea si, array
    mov cx, array_size

outer_loop:
    dec cx
    jz sorted ; If the size is 0, array is sorted

    mov di, si
    mov bx, cx

inner_loop:
    mov al, [di]
    mov ah, [di+1]
    cmp al, ah
    jbe no_swap

    ; Swap elements
    xchg al, ah
    mov [di], al
    mov [di+1], ah

no_swap:
    inc di
    dec bx
    jnz inner_loop

    jmp outer_loop

sorted:
    ; Print sorted array
    lea si, array
    mov cx, array_size

print_loop:
    mov al, [si]
    add al, '0' ; Convert to ASCII
    mov dl, al
    mov ah, 02h
    int 21h

    ; Print space
    lea dx, space
    mov ah, 09h
    int 21h

    inc si
    loop print_loop

    ; Print newline
    lea dx, newline
    mov ah, 09h
    int 21h

    ; Terminate program
    mov ah, 4Ch
    int 21h

main endp
end main
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bill</title>
</head>
<body>
    <h1>Bill</h1>

    <div id="customerDetails">
        <!-- Customer details will be displayed here -->
    </div>

    <div id="selectedItems">
        <!-- Selected items will be displayed here -->
    </div>

    <script>
        document.addEventListener("DOMContentLoaded", function() {
            // Retrieve customer details from localStorage
            var customerData = JSON.parse(localStorage.getItem('customerData'));

            // Display customer details if available
            if (customerData) {
                var customerDetailsHTML = '<h2>Customer Details</h2>' +
                    '<p>Name: ' + customerData.customerName + '</p>' +
                    '<p>Mobile: ' + customerData.customerMobile + '</p>' +
                    '<p>Table: ' + customerData.customerTable + '</p>';
                document.getElementById('customerDetails').innerHTML = customerDetailsHTML;
            } else {
                // Handle case where customer details are not available
                console.log("Customer details not found.");
            }

            // Retrieve and display selected items for each category
            var selectedItemsHTML = '<h2>Selected Items</h2>';
            // Add code here to retrieve and display selected items for each category

            document.getElementById('selectedItems').innerHTML = selectedItemsHTML;
        });

        function confirmOrder(category) {
            // Get the selected items from the respective popup
            var selectedItems = [];
            var itemList = document.querySelectorAll('.' + category + '-popup-container input[type="number"]');
            itemList.forEach(function(item) {
                var itemName = item.parentElement.querySelector('span').textContent;
                var itemQuantity = item.value;
                if (itemQuantity > 0) {
                    selectedItems.push({ name: itemName, quantity: itemQuantity });
                }
            });

            // Get customer details
            var customerName = document.getElementById('name').value;
            var customerMobile = document.getElementById('mobile').value;
            var customerTable = document.getElementById('table').value;

            // Combine customer details with selected items
            var orderData = {
                customerName: customerName,
                customerMobile: customerMobile,
                customerTable: customerTable,
                selectedItems: selectedItems
            };

            // Store the combined data in localStorage
            localStorage.setItem('customerData', JSON.stringify(orderData)); // Store customer details

            // Optionally, you can also display a confirmation message
            alert('Order confirmed for ' + category + '. Thank you!');
        }

        function redirectToBill() {
            window.location.href = "bill.html";
        }
    </script>
</body>
</html>
	accountCode = 202;
	searchMap = Map();
	searchMap.put("account_code",accountCode);
	///
	fetch = zoho.books.getRecords("chartofaccounts","20091181966",searchMap,"zoho_books");
	info fetch;
# Dictionary View Objects
# keys() , values() & items() are called Dictionary Views as they provide a dynamic view on the dictionary’s items.

# Code
dict_a = {
    'name': 'Teja',
    'age': 15 
}
view = dict_a.keys()
print(view)
dict_a['roll_no'] = 10
print(view)


#output
# dict_keys(['name', 'age'])
# dict_keys(['name', 'age', 'roll_
dict_a = {
  'name': 'Teja',
  'age': 15
}
for key, value in dict_a.items():
    pair = "{} {}".format(key,value)
    print(pair)
GROUP BY AND HAVING CLAUSE

1.	Find the number of employees Department wise.

Ans : 

Select deptno, count(*) no_of_employees from employee group by deptno;

2.	Find the number of employees Job wise.

Ans : 

Select job, count(*) no_of_employees from employee group by job;


3.	Find the total salary distribution job wise in the year 1981. 

Ans : 

select job,sum(12*sal) from emp where to_char(hiredate,'YYYY') = '1981'
group by job ;


4.	Display the number of employees for each job group and department number wise. 

Ans : 

select d.deptno,e.job,count(e.job) from emp e,dept d where e.deptno(+)=d.deptno group by e.job,d.deptno;


5.	List the number of employees in each department where the number is more than 3. 

Ans : 

select deptno,count(*) from emp group by deptno  having count(*) > 3;


6.	List the names of departments where at least 3 are working in that department. 

Ans : 

select d.dname,count(*) from emp e ,dept d where e.deptno = d.deptno 
      group by d.dname 
                           having count(*) >= 3  ;





7.	List the department details where at least two employees are working 

Ans : 

select deptno ,count(*) from emp group by deptno 
       having count(*) >= 2;


8.	List the details of the department where maximum number of employees are working 

Ans : 

select * from dept where deptno in 
      (select deptno from emp group by deptno         
      having count(*) in 
      (select max(count(*)) from emp group by deptno) ); 
(OR) 

select d.deptno,d.dname,d.loc,count(*) from emp e ,dept d 
     where e.deptno = d.deptno group by d.deptno,d.dname,d..loc 
     having count(*) = (select max(count(*) ) from emp group by deptno);


9.	List the name of the department where more than average numbers of employees are working.

Ans : 

select d.dname from dept d, emp e where e.deptno = d.deptno 
group by d.dname 
having count(*) > (select avg(count(*)) from emp  group by deptno);

10.	List the manager name having maximum number of employees working under him.

Ans : 

select m.ename,count(*) from emp w, emp m 
where w.mgr = m.empno  
group by m.ename
having count(*) = (select max(count(*)) from emp group by mgr);      




11.	Check whether all the employee numbers are indeed unique.

Ans : 

select   empno,count(*)  from emp group by empno;

12.	Find all the employees who earn the minimum Salary for each job wise in ascending order. 

Ans : 

select * from emp where sal in 
     (select min(sal) from emp group by job) 
     order by sal asc;


13.	Find out all the employees who earn highest salary in each job type. Sort in descending salary order. 

Ans : 

select * from emp where sal in 
     (select max(sal) from emp group by job) 
     order by sal desc;


14.	Find out the most recently hired employees in each department order by joining date. 

Ans : 

select * from emp  e where hiredate in 
     (select max(hiredate) from emp where e.deptno =  deptno ) 
      order by hiredate;


15.	List the number of employees and Average salary within each department for each job 

Ans : 

select count(*),avg(sal),deptno,job from emp 
      group by deptno,job;


16.	Find the maximum average salary drawn for each job except for ‘President’. 

Ans : 

select max(avg(sal)) from emp  where job != 'PRESIDENT' group by job;


17.	List the department number and their average salaries for department with the average salary less than the averages for all departments.

Ans : 

select deptno,avg(sal) from emp group by deptno
having avg(sal) <(select avg(Sal) from emp);



<!DOCTYPE html>
<html>
<head>
  <title>أسماء المواضيع</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }
    .post-list {
      list-style-type: none;
      padding: 0;
    }
    .post-list li {
      margin: 5px 0;
    }
  </style>
</head>
<body>
  <h1>أسماء المواضيع</h1>
  <ul class="post-list" id="post-list"></ul>

  <script>
    function fetchPosts() {
      const blogId = 'blogId'; // استبدل YOUR_BLOG_ID بمعرف مدونتك
      const apiKey = 'apiKey'; // استبدل YOUR_API_KEY بمفتاح API الخاص بك

      const url = `https://www.googleapis.com/blogger/v3/blogs/${blogId}/posts?key=${apiKey}`;

      fetch(url)
        .then(response => response.json())
        .then(data => {
          const posts = data.items;
          const postList = document.getElementById('post-list');
          
          posts.forEach(post => {
            const listItem = document.createElement('li');
            const link = document.createElement('a');
            link.href = post.url;
            link.textContent = post.title;
            listItem.appendChild(link);
            postList.appendChild(listItem);
          });
        })
        .catch(error => console.error('Error fetching posts:', error));
    }

    document.addEventListener('DOMContentLoaded', fetchPosts);
  </script>
</body>
</html>
随机怎么生成
from pymongo import MongoClient, errors

# MongoDB connection settings
mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]

    # Define query to filter tweets related to KLM (tweets made by KLM or mentioning KLM)
    query = {
        "$or": [
            {"json_data.user.id": 56377143},  # Tweets made by KLM
            {"json_data.entities.user_mentions.id": 56377143}  # Tweets mentioning KLM
        ]
    }

    # Count the number of tweets related to KLM
    klm_tweet_count = source_collection.count_documents(query)

    print("Number of tweets related to KLM:", klm_tweet_count)

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
from pymongo import MongoClient, errors
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

# MongoDB connection settings
mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"

def get_text_from_doc(doc):
    """
    Extracts the text from the document.
    Returns the text if available, otherwise returns None.
    """
    text = doc.get("json_data", {}).get("text")
    if text:
        return text
    extended_text = doc.get("json_data", {}).get("extended_tweet", {}).get("full_text")
    return extended_text

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]

    cursor = source_collection.find().limit(20)  # Limit to only 20 tweets

    for doc in cursor:
        text = get_text_from_doc(doc)
        if text:
            print("Text:", text)
            print()

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
from pymongo import MongoClient, errors
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

# MongoDB connection settings
mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"

def get_text_from_doc(doc):
    """
    Extracts the text from the document.
    Returns the text if available, otherwise returns None.
    """
    text = doc.get("json_data", {}).get("text")
    if text:
        return text
    extended_text = doc.get("json_data", {}).get("extended_tweet", {}).get("full_text")
    return extended_text

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]

    cursor = source_collection.find()  # Limit to only 20 tweets

    for doc in cursor:
        text = get_text_from_doc(doc)
        if text:
            compound_score = analyze_sentiment(text)
            print("Compound Sentiment Score:", compound_score)
            print()

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
from pymongo import MongoClient, errors
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import re

# MongoDB connection settings
mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"

def get_text_from_doc(doc):
    """
    Extracts the text from the document.
    Returns the text if available, otherwise returns None.
    """
    text = doc.get("json_data", {}).get("text")
    if text:
        return text
    extended_text = doc.get("json_data", {}).get("extended_tweet", {}).get("full_text")
    return extended_text

def analyze_sentiment(text):
    """
    Analyzes the sentiment of the given text using VADER.
    Returns the compound sentiment score.
    """
    analyzer = SentimentIntensityAnalyzer()
    sentiment = analyzer.polarity_scores(text)
    return sentiment['compound']

def detect_irony(text):
    """
    Detects irony in the given text.
    Returns True if irony is detected, otherwise False.
    """
    irony_patterns = [
        r"\b(?:delay)\b.*\thanks\b",
        r"\b(?:can't|cannot)\b.*\bimagine\b",
        r"\bwhat a surprise\b",
        r"\bsarcasm\b",
        r"\birony\b",
        r"\bjust what I needed\b",
    ]

    for pattern in irony_patterns:
        if re.search(pattern, text, re.IGNORECASE):
            return True
    return False

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]

    cursor = source_collection.find().limit(20)  # Limit to only 20 tweets

    for doc in cursor:
        text = get_text_from_doc(doc)
        if text:
            compound_score = analyze_sentiment(text)
            irony_detected = detect_irony(text)
            print("Compound Sentiment Score:", compound_score)
            if irony_detected:
                print("Irony detected in text:", text)
            else:
                print("Text is not ironic.")
            print()

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
from pymongo import MongoClient, errors

mongo_uri = "mongodb://localhost:27017/"
database_name = "twitter_database"
source_collection_name = "tweets"
target_collection_name = "tweet_cleaned"

fields_to_extract = [
    "json_data.id",
    "json_data.user.id",
    "json_data.created_at",
    "json_data.text",
    "json_data.user.created_at",
    "json_data.in_reply_to_status_id",
    "json_data.in_reply_to_user_id",
    "json_data.user.description",
    "json_data.quoted_status_id",
    "json_data.extended_tweet.full_text",
    "json_data.entities.user_mentions.0.id",
    "json_data.entities.user_mentions.1.id",
    "json_data.entities.user_mentions.2.id",
    "json_data.lang",
    "json_data.entities.hashtags",
    "json_data.user.location",
    "json_data.is_quote_status",
]

def get_nested_field(data, field_path):
    keys = field_path.split('.')
    for key in keys:
        if isinstance(data, list):
            try:
                key = int(key)
                data = data[key]
            except (ValueError, IndexError):
                return None
        elif isinstance(data, dict):
            data = data.get(key)
        else:
            return None
        if data is None:
            return None
    return data

try:
    client = MongoClient(mongo_uri, serverSelectionTimeoutMS=5000)
    db = client[database_name]
    source_collection = db[source_collection_name]
    target_collection = db[target_collection_name]

    cursor = source_collection.find()

    for doc in cursor:
        lang = get_nested_field(doc, "json_data.lang")
        
        if lang in ["en", "nl", "es"]:
            new_doc = {field: get_nested_field(doc, field) for field in fields_to_extract}
            new_doc["_id"] = doc["_id"]
            
            # Insert the new document into the target collection
            target_collection.insert_one(new_doc)

    print("Data successfully transferred to new collections.")

except errors.ServerSelectionTimeoutError as err:
    print("Failed to connect to MongoDB server:", err)
except errors.PyMongoError as err:
    print("An error occurred while working with MongoDB:", err)
finally:
    client.close()
Private Sub btnUpdateCompanyName_Click()
    Dim accApp As Access.Application
    Dim strNewCompanyName As String
    Dim obj As AccessObject
    Dim ctl As Control
    Dim dbPath As String

    On Error GoTo ErrorHandler
    
    ' Get the new company name from the text box and handle Null value
    strNewCompanyName = Nz(Me.txtCompanyName.Value, "")

    ' Check if the text box is empty
    If Trim(strNewCompanyName) = "" Then
        MsgBox "Please enter the new company name.", vbExclamation
        Exit Sub
    End If

    ' Construct the relative path to the other database
    dbPath = CurrentProject.Path & "\Sales.accdb"

    ' Check if the other database is already open
    If IsDatabaseOpen(dbPath) Then
        MsgBox "The database is already open. Please close it before running this operation.", vbExclamation
        Exit Sub
    End If

    ' Open the other database
    Set accApp = New Access.Application
    accApp.OpenCurrentDatabase (dbPath)

    ' Loop through all forms
    For Each obj In accApp.CurrentProject.AllForms
        accApp.DoCmd.OpenForm obj.Name, acDesign
        For Each ctl In accApp.Forms(obj.Name).Controls
            If ctl.ControlType = acLabel And ctl.Name = "Label1" Then
                ctl.Caption = strNewCompanyName
            End If
        Next ctl
        accApp.DoCmd.Close acForm, obj.Name, acSaveYes
    Next obj

    ' Loop through all reports
    For Each obj In accApp.CurrentProject.AllReports
        accApp.DoCmd.OpenReport obj.Name, acViewDesign
        For Each ctl In accApp.Reports(obj.Name).Controls
            If ctl.ControlType = acLabel And ctl.Name = "Label1" Then
                ctl.Caption = strNewCompanyName
            End If
        Next ctl
        accApp.DoCmd.Close acReport, obj.Name, acSaveYes
    Next obj

    ' Close the other database
    accApp.CloseCurrentDatabase
    accApp.Quit
    Set accApp = Nothing

    ' Notify user
    MsgBox "Company name updated successfully!"

    Exit Sub

ErrorHandler:
    If Not accApp Is Nothing Then
        accApp.CloseCurrentDatabase
        accApp.Quit
        Set accApp = Nothing
    End If
    MsgBox "An error occurred: " & Err.Description, vbCritical

End Sub

The MIT License (MIT)

Copyright (c) 2020 Dean Attali

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
describe('DBM Smoketests', function() {
  it('E2E Hotel2 WorldPay System', function() {
    cy.visit('https://obmng.dbm.guestline.net/');
    cy.url().should('include','/obmng.dbm');

    Cypress.on('test:after:run', (test) => {
      addContext({ test }, { 
        title: 'This is my context title', 
        value: 'This is my context value'
      })
    });
  });
});
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v4
      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."
Error: Not Found
The requested URL /favicon.ico was not found on this server.
#include<bits/stdc++.h>
using namespace std;
int fact(int n)
{
    int m=1;
    for(int i=1;i<=n;i++)
    {
        m=m*i;
    }
    return m;
}
int main()
{
    int n;
    cin>>n;
    cout<<"Factorial of number is: "<<fact(n);
    return 0;
}
Download Android Studio Jellyfish | 2023.3.1 Patch 1
Before downloading, you must agree to the following terms and conditions.

Terms and Conditions
This is the Android Software Development Kit License Agreement
1. Introduction
1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. 1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: https://source.android.com/, as updated from time to time. 1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (https://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). 1.4 "Google" means Google LLC, organized under the laws of the State of Delaware, USA, and operating under the laws of the USA with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA.
2. Accepting this License Agreement
2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement. 2.2 By clicking to accept and/or using this SDK, you hereby agree to the terms of the License Agreement. 2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK. 2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
3. SDK License from Google
3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android. 3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose. 3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. 3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. 3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. 3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
4. Use of the SDK by You
4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
5. Your Developer Credentials
5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
6. Privacy and Information
6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy, which is located at the following URL: https://policies.google.com/privacy 6.3 Anonymized and aggregated sets of the data may be shared with Google partners to improve the SDK.
7. Third Party Applications
7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.
8. Using Android APIs
8.1 Google Data APIs 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. If you use the Android Recognition Service API, documented at the following URL: https://developer.android.com/reference/android/speech/RecognitionService, as updated from time to time, you acknowledge that the use of the API is subject to the Data Processing Addendum for Products where Google is a Data Processor, which is located at the following URL: https://privacy.google.com/businesses/gdprprocessorterms/, as updated from time to time. By clicking to accept, you hereby agree to the terms of the Data Processing Addendum for Products where Google is a Data Processor.
9. Terminating this License Agreement
9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below. 9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. 9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. 9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
10. DISCLAIMER OF WARRANTIES
10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
11. LIMITATION OF LIABILITY
11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
12. Indemnification
12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.
13. Changes to the License Agreement
13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
14. General Legal Terms
14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK. 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. 14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party. 14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. July 27, 2021
 I have read and agree with the above terms and conditions
Download Android Studio Jellyfish | 2023.3.1 Patch 1 for ChromeOS
android-studio-2023.3.1.19-cros.deb
<manifest>
  <uses-sdk android:minSdkVersion="5" />
  ...
</manifest>
import android.webkit.CookieManager
import android.webkit.WebView

class MainActivity : AppCompatActivity() {
  lateinit var webView: WebView

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    webView = findViewById(R.id.webview)

    // Let the web view accept third-party cookies.
    CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true)
    // Let the web view use JavaScript.
    webView.settings.javaScriptEnabled = true
    // Let the web view access local storage.
    webView.settings.domStorageEnabled = true
    // Let HTML videos play automatically.
    webView.settings.mediaPlaybackRequiresUserGesture = false

    // Load the URL for optimized web view performance.
    webView.loadUrl("https://webview-api-for-ads-test.glitch.me")
  }
}
import android.webkit.CookieManager
import android.webkit.WebView

class MainActivity : AppCompatActivity() {
  lateinit var webView: WebView

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    webView = findViewById(R.id.webview)

    // Let the web view accept third-party cookies.
    CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true)
    // Let the web view use JavaScript.
    webView.settings.javaScriptEnabled = true
    // Let the web view access local storage.
    webView.settings.domStorageEnabled = true
    // Let HTML videos play automatically.
    webView.settings.mediaPlaybackRequiresUserGesture = false
  }
}
star

Fri May 31 2024 22:22:44 GMT+0000 (Coordinated Universal Time) https://kubernetes.io/docs/reference/kubectl/

@calazar23

star

Fri May 31 2024 22:22:31 GMT+0000 (Coordinated Universal Time) https://kubernetes.io/docs/reference/kubectl/

@calazar23

star

Fri May 31 2024 22:22:22 GMT+0000 (Coordinated Universal Time) https://kubernetes.io/docs/reference/kubectl/

@calazar23

star

Fri May 31 2024 22:13:17 GMT+0000 (Coordinated Universal Time) https://www.tensorflow.org/

@calazar23

star

Fri May 31 2024 21:21:17 GMT+0000 (Coordinated Universal Time)

@jdeveloper #php

star

Fri May 31 2024 20:20:54 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Fri May 31 2024 18:51:38 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Fri May 31 2024 18:37:36 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Fri May 31 2024 18:16:47 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Fri May 31 2024 16:51:22 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Fri May 31 2024 16:21:44 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Fri May 31 2024 16:02:35 GMT+0000 (Coordinated Universal Time) https://www.sheppardsoftware.com/math/early-math/number-words-fruit-splat-game/

@s727769

star

Fri May 31 2024 15:45:29 GMT+0000 (Coordinated Universal Time) https://www.developpez.net/forums/d320845/dotnet/developpement-windows/windows-forms/mettre-texte-picturebox/

@demelevet

star

Fri May 31 2024 15:20:10 GMT+0000 (Coordinated Universal Time) https://prizewall.xyz/

@llvllike

star

Fri May 31 2024 15:07:48 GMT+0000 (Coordinated Universal Time)

@pullamma

star

Fri May 31 2024 14:56:20 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri May 31 2024 14:53:25 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri May 31 2024 14:07:20 GMT+0000 (Coordinated Universal Time)

@dsce

star

Fri May 31 2024 12:08:03 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Fri May 31 2024 11:10:57 GMT+0000 (Coordinated Universal Time) https://forums.steinberg.net/t/attention-macos-code-signing/201922

@milliedavidson #mac #audio #plugin #signature

star

Fri May 31 2024 06:19:51 GMT+0000 (Coordinated Universal Time) https://learning.ccbp.in/problems-set?auth_code

@karthiksalapu

star

Fri May 31 2024 06:14:13 GMT+0000 (Coordinated Universal Time) https://learning.ccbp.in/problems-set?auth_code

@karthiksalapu ##dictionaries ##iteration

star

Fri May 31 2024 04:29:07 GMT+0000 (Coordinated Universal Time) https://github.com/YadlaMani/Java-Lab

@signup

star

Fri May 31 2024 03:06:48 GMT+0000 (Coordinated Universal Time) https://www.file.io/kuz2/download/kJNthk9ZJrjW

@signup

star

Fri May 31 2024 03:06:47 GMT+0000 (Coordinated Universal Time) https://www.file.io/kuz2/download/kJNthk9ZJrjW

@signup

star

Fri May 31 2024 03:06:46 GMT+0000 (Coordinated Universal Time) https://www.file.io/kuz2/download/kJNthk9ZJrjW

@signup

star

Fri May 31 2024 03:01:43 GMT+0000 (Coordinated Universal Time) https://www.file.io/jTfn/download/9Ix5SNFQo6Or

@signup

star

Fri May 31 2024 01:13:49 GMT+0000 (Coordinated Universal Time)

@signup

star

Thu May 30 2024 22:39:48 GMT+0000 (Coordinated Universal Time)

@rmdnhsn #blogger

star

Thu May 30 2024 22:23:48 GMT+0000 (Coordinated Universal Time)

@Leda

star

Thu May 30 2024 21:24:43 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Thu May 30 2024 21:06:23 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Thu May 30 2024 21:05:25 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Thu May 30 2024 21:04:07 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Thu May 30 2024 20:35:23 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Thu May 30 2024 16:21:27 GMT+0000 (Coordinated Universal Time)

@rmdnhsn #vba

star

Thu May 30 2024 15:52:28 GMT+0000 (Coordinated Universal Time) https://webmasters.stackexchange.com/questions/141549/how-to-deploy-a-single-html-file-to-static-hosting-and-have-it-show-up-for-reque

@shookthacr3ator

star

Thu May 30 2024 14:58:31 GMT+0000 (Coordinated Universal Time) https://github.com/daattali/cashflow-calculation-extension

@curtisbarry

star

Thu May 30 2024 14:57:56 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/53343181/detailed-reporting-cypress-mochawesome

@al.thedigital #javascript #mochawesome #report

star

Thu May 30 2024 14:50:34 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/actions/quickstart

@shookthacr3ator

star

Thu May 30 2024 14:37:38 GMT+0000 (Coordinated Universal Time) https://web-share-in-third-party-iframe.glitch.me/

@shookthacr3ator

star

Thu May 30 2024 14:16:23 GMT+0000 (Coordinated Universal Time) https://calculator.apps.chrome/favicon.ico

@curtisbarry

star

Thu May 30 2024 12:53:19 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/19807665/auto-refresh-for-every-5-mins

@Bh@e_LoG #javascript

star

Thu May 30 2024 12:47:10 GMT+0000 (Coordinated Universal Time) https://www.pyramidions.com/mobile-app-development-chennai.html

@Bastina_1

star

Thu May 30 2024 11:50:22 GMT+0000 (Coordinated Universal Time)

@anchal_llll

star

Thu May 30 2024 10:47:46 GMT+0000 (Coordinated Universal Time) https://github.com/creativecommons/global-network-strategy

@curtisbarry

star

Thu May 30 2024 10:23:26 GMT+0000 (Coordinated Universal Time) https://developer.android.com/training/wearables/versions/5/setup

@curtisbarry

star

Thu May 30 2024 10:16:11 GMT+0000 (Coordinated Universal Time) https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels

@calazar23 #xml

star

Thu May 30 2024 10:10:51 GMT+0000 (Coordinated Universal Time) https://developers.google.com/ad-manager/mobile-ads-sdk/android/browser/webview

@calazar23 #kotlin

star

Thu May 30 2024 10:10:46 GMT+0000 (Coordinated Universal Time) https://developers.google.com/ad-manager/mobile-ads-sdk/android/browser/webview

@calazar23 #kotlin

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension