Giter Site home page Giter Site logo

codespaces-nextjs's Introduction

GitHub Codespaces ♥️ Next.js

Welcome to your shiny new Codespace running Next.js! We've got everything fired up and running for you to explore Next.js.

You've got a blank canvas to work on from a git perspective as well. There's a single initial commit with the what you're seeing right now - where you go from here is up to you!

Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you’re ready you can click "Publish Branch" and we’ll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it's gone forever.

To run this application:

npm run dev

codespaces-nextjs's People

Contributors

bdmac avatar chuxel avatar dependabot[bot] avatar joshaber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codespaces-nextjs's Issues

Gestion des bases de données relationnelles

CREATE DATABASE sans;
USE sans;
CREATE TABLE wine(
num_w int primary key,
category varchar(30) not null,
year date,
degree float
);
CREATE TABLE producer(
num_p int primary key,
first_name varchar(30),
last_name varchar(20),
region varchar(50)
);
CREATE TABLE harvest(
num_w int foreign key references wine(num_w),
num_p int foreign key references producer(num_p),
category varchar(30),
date_h DATE,
quantity float);
INSERT INTO wine VALUES (3, 'vin rouge', '1980', 15), (2, 'vin mousseux', '1967', 12), (4,'vin rosé', '1988', 14),
(1,'vin blanc', '1989', 10), (5, 'vin rouge', '1987', 14), (6, 'vin blanc', '1980', 13), (7, 'vin rosé', '1989', 11);
SELECT* FROM wine;
INSERT INTO producer VALUES (12, 'pierre', 'leboeuf', 'sousse'), (2, 'Ousmane', 'niang', 'thies'), (4,'charles', 'mendy', 'sousse'),
(1,'victorine', 'belle', 'Ziguinchor'), (5, 'Diadie', 'dia', 'diourbel'), (14, 'alioune', 'samb', 'aquitaine'), (15, 'alioun', 'sami', 'occitanie');
SELECT* FROM producer;
INSERT INTO harvest VALUES (3, 12, 'vin rouge', '1980', 305), (2, 2,'vin mousseux', '1967', 255.5), (4, 4, 'vin rosé', '1988', 412),
(1,1 ,'vin blanc', '1989', 188), (5, 5, 'vin rouge', '1987', 987), (6,14, 'vin blanc','1980', 542), (7,15,'vin rosé', '1989', 222);
SELECT* FROM harvest;
// donnons la liste des producteurs
SELECT first_name, last_name FROM producer;
// donnons la liste des producteurs triés par nom
SELECT last_name FROM producer ORDER BY last_name;
// donnons la liste des producteurs de sousse
SELECT first_name,last_name FROM producer
where region = 'sousse';
// Calculer la quantité totale
SELECT SUM(quantity) AS Quantite FROM harvest where num_p= 12;

// la quantité totale par catégorie
SELECT SUM(quantity) AS Quantitetotale FROM harvest where category='vin rouge'
GROUP BY category;
SELECT SUM(quantity) AS Quantitetotale FROM harvest where category='vin blanc'
GROUP BY category;
SELECT SUM(quantity) AS Quantitetotale FROM harvest where category='vin mousseux'
GROUP BY category;
SELECT SUM(quantity) AS Quantitetotale FROM harvest where category='vin rosé'
GROUP BY category;
//
// les numéros de vin qui ont un dégré supérieur à 12
SELECT num_w FROM wine WHERE degree >12;

Langage de définition des donnée par cellou

CREATE TABLE clients (
ID_clients INT PRIMARY KEY
, NAME VARCHAR(30) NOTNULL
, ADDRESS VARCHAR(25) NOTNULL
);

CREATE TABLE produits(
ID_produits INT PRIMARY KEY,
NAME VARCHAR(25) NOTNULL,
PRIX DECIMAL CHECK (prix>0) NOTNULL
);

CREATE TABLE commandes (
ID_commandes INT PRIMARY KEY
, ID_clients INT NOTNULL
, ID_produits INT NOTNULL,
Quantité INTEGER NOTNULL,
date_command DATE,
FOREIGN KEY(ID_command) REFERENCES identity(ID_command),
FOREIGN KEY(ID_produits) REFERENCES identity(ID_produits)
);

Checkpoint python pizza delivery

print("Bienvenue dans Python Pizza Delivery")
taille =str(input("Quelle taille de pizza souhaitez-vous? (S, M, L): "))
if taille=="S":
print("vous avez choisi une petite pizza")
elif taille=="L":
print("vous avez choisi une pizza moyenne")
elif taille=="M":
print("vous avez choisi une grande pizza")
else:
print("saisie incorrecte choisir(S/L/M)")
print("la taille de pizza choisit est"+" "+taille)
add_pepperoni = input("Voulez-vous ajouter du pepperoni? (Y/N): ")
if add_pepperoni== "Y" :
print("vous avez choisi du pepperoni")
elif add_pepperoni== "N" :
print("vous n'avez pas choisi du pepperoni")
else :
print("saisie incorrecte ,choisir (Y/N)")

extra_cheese = input("Voulez-vous ajouter du fromage supplémentaire? (Y/N): ")
if extra_cheese== "Y":
print("vous avez choisi un supplement fromage")
elif extra_cheese== "N":
print("vous n'avez pas choisi un supplement fromage")
else:
print("saisie incorrecte ,choisir(Y/N)")
commande=print("votre commande est une pizza de taille" +" "+ taille, add_pepperoni, extra_cheese)

calcul de la facture totale

price = 0
if taille == "S":
price += 15
elif taille == "M":
price += 20
elif taille == "L":
price += 25

if add_pepperoni == "Y":
if taille == "S":
price += 2
else:
price += 3

if extra_cheese == "Y":
price += 1

print(f"Votre facture finale est de: {price} $.")

Build completely broken in codespaces now.

Hello,

I have a codespace build of nextjs, and vite from the codespaces templates
and neither of them work out of the box due to https issues. I'm not sure if the hosting domain for the port forwarded sites has changed, but using .dev means the browser is forced to connect using https and I am pretty sure that neither nextjs or vite are configured to use https which causes ssl issues.

If I load the codespace into my local vs code instance and start the vite/nextjs instance there I can connect just fine. So I imagine for these templates to work again either:

  1. Don't serve these port forwarded instances from a .dev domain so developers can connect to them via http
  2. Update these templates to work for a https connection and make that a default since .dev domains can only be connected to via https

Simple Browser

ssl_issue

Normal Browser (see SSL error)

ssl_issue_2

api key won't work the way it's defined.

It works if I hard card key, but I'm not sure it's pulling the process.env.OPENAI_API_KEY. Do you need to add this comment for copilot to build?

// import process.env.OPENAI_API_KEY from the .env file
require('dotenv').config();

Checkpoint python pizza delivery

#Prix de base des pizzas
prix_petite_pizza = 15
prix_moyenne_pizza = 20
prix_grande_pizza = 25

Prix des garnitures

prix_pepperoni = 2
prix_fromage_supplementaire = 1

try:
# Demandez à l'utilisateur la taille de la pizza
taille_pizza = input("Quelle taille de pizza souhaitez-vous (S/M/L) ? ").upper()
# Vérifiez la taille de la pizza et calculez le prix de base
if taille_pizza == "S":
prix_total = prix_petite_pizza
elif taille_pizza == "M":
prix_total = prix_moyenne_pizza
elif taille_pizza == "L":
prix_total = prix_grande_pizza
else:
raise ValueError("Taille de pizza invalide. Veuillez choisir parmi (S/M/L).")

# Demandez à l'utilisateur s'il veut du pepperoni
add_pepperoni = input("Voulez-vous du pepperoni sur votre pizza (YES/NO) ? ").upper()
if add_pepperoni == "Y":
   print("vous avez ajouté du Peperonni")
   if taille_pizza == "S": 
    prix_total += prix_pepperoni
   else:
    prix_total += prix_pepperoni + 1
else :
   print("vous n'avez pas ajouté du peperonni")

# Demandez à l'utilisateur s'il veut du fromage supplémentaire
extra_cheese = input("Voulez-vous du fromage supplémentaire sur votre pizza (YES/NO) ? ").upper()
if extra_cheese == "Y":
    print("vous avez pris du fromage comme supplément")
    prix_total += prix_fromage_supplementaire
else:
   print("vous n'avez pas pris du fromage comme supplément")
   
 # Affichez la facture finale
print(f"Votre pizza {taille_pizza.capitalize()} coûte {prix_total}$. Bon appétit ! 🍕")

except ValueError as e:
print(f"Erreur : {e}")

Checkpoint requête de données

create database CELLOU_DIALL;
use CELLOU_DIALL;
create table customer (
customer_id int primary key,
customer_Name varchar(30)not null,
customer_Tel varchar(30) not null
);
insert into customer values (1, 'fatou','77120');
insert into customer values (2, 'cellou','77843' );
insert into customer values (3,'awa','77187');

select*from customer;

CREATE TABLE product (
product_id int primary key,
product_name varchar(30) not null,
catogory varchar(30) not null,
Price int NOT NULL
);

insert into product values (1, 'widget', 'SMARTPHONE',10), (2, 'gadget', 'ELECTRO',15 ),
(3,'dohickey','sante',20);

select*from product;

create table orders (
orders_id int primary key ,
product_id int ,
customer_id int ,
quantity int,
OrdersDate varchar(30) NOT NULL,
total_amount int,
constraint FK_customer foreign key (customer_id)references customer(customer_id),
constraint FK_product foreign key (product_id) references product(product_id)
);
insert into orders values (1,1,1,5, '28-01-2023','50');
insert into orders values (2,2,2,7,'20-01-2023','105');
insert into orders values (3,1,2,10,'30-01-2023','200');

select*from orders;

use CELLOU_DIALL;
--1 requête SQL pour récupérer les noms des clients qui ont passé une commande d'au moins un widget et d'au moins un gadget
-- ainsi que le coût total des widgets et gadget commandés par chaque client
--Le coût de chaque article doit être calculé en multipliant la quantité par le prix du produit.

select customer.customer_Name, SUM(quantity * product.Price) as 'coût total'
from customer
inner join product on customer.customer_id = product.product_id
inner join orders on product.product_id = orders.product_id
where product.product_name = 'widget' OR product.product_name = 'gadget'
group by customer.customer_Name;

use CELLOU_DIALL;
--requête pour récupérer les noms des clients qui ont passé une commande pour au moins un widget
--ainsi que le coût total des widgets commandés par chaque client.

SELECT customer.customer_Name, SUM(quantity * product.price) AS 'coût total'

from customer
INNER JOIN product on customer.customer_id = product.product_id
INNER JOIN orders on product.product_id = orders.product_id
where product.product_name = 'widget'
group by customer.customer_Name;

use CELLOU_DIALL;
-- requête pour récupérer les noms des clients qui ont commandé au moins un gadget,
-- ainsi que le coût total des gadget commandés par chaque client.

select customer.customer_Name, SUM(quantity * product.price) as 'coût total'
from customer
inner join product ON customer.customer_id = product.product_id
inner join orders ON product.product_id = orders.product_id
where product.product_name = 'gadget'
group by customer.customer_Name;

use CELLOU_DIALL;

--Écrivez une requête pour récupérer les noms des clients qui ont commandé au moins un dohickey
-- ainsi que le coût total des doohickey commandés par chaque client.
select customer_Name, sum(quantity*price) as'coût total'
from customer
inner join orders on customer.customer_id = orders.customer_id
inner join product on orders.product_id = product.product_id
where product.product_name = 'dohickey'
group by customer.customer_Name;

use CELLOU_DIALL;

-- requête pour récupérer le nombre total de widgets et de gadgets commandés par chaque client,
-- ainsi que le coût total des commandes.

select
cl.Customer_name,
sum(quantity) AS 'Nombre Total',
sum(quantity * p.price) AS 'coût total des commandes'
from Customer cl
join
Product p on cl.Customer_id = p.product_id
join
Orders o on p.Product_id = o.Product_id
where
p.Product_name IN ('widget', 'gadget')
group by
cl.Customer_name;

--  une requête pour récupérer les noms des clients qui ont commandé au moins un gadget,

-- ainsi que le coût total des gadget commandés par chaque client.

SELECT customer.customer_Name, SUM(quantity * product.price) AS 'coût total'

FROM customer
INNER JOIN product ON customer.customer_id = product.product_id
INNER JOIN orders ON product.product_id = orders.product_id
WHERE product.product_name = 'gadget'
GROUP BY customer.customer_Name;
-- une requête pour récupérer les noms des clients qui ont commandé au moins un dohickey,
-- ainsi que le coût total des doohickey commandés par chaque client.

SELECT customer.customer_Name, SUM(quantity * product.price) AS 'coût total'
FROM customer
INNER JOIN orders ON customer.customer_id = orders.customer_id
INNER JOIN product ON orders.product_id = product.product_id
WHERE product.product_name = 'dohickey'
GROUP BY customer.customer_Name;
--requête pour récupérer le nombre total de widgets et de gadgets commandés par chaque client,
-- ainsi que le coût total des commandes.
SELECT
cl.Customer_name,
SUM(CASE WHEN p.Product_name = 'widget' THEN o.quantity ELSE 0 END) AS 'Nombre Total de Widgets',
SUM(CASE WHEN p.Product_name = 'gadget' THEN o.quantity ELSE 0 END) AS 'Nombre Total de Gadgets',
SUM(o.quantity * p.price) AS 'Coût Total des Commandes'
FROM
Customer cl
JOIN
Product p ON cl.Customer_id = p.product_id
JOIN
Orders o ON p.Product_id = o.Product_id
WHERE
p.Product_name IN ('widget', 'gadget')
GROUP BY
cl.Customer_name;

-- Écrivez une requête pour récupérer les noms des produits qui ont été commandés par au moins un client
--ainsi que la quantité totale de chaque produit commandé.
SELECT 
p.Product_name, 
SUM(o.quantity) AS 'la quantité totale'

FROM
Product p
JOIN
Orders o ON p.Product_id = o.Product_id
GROUP BY
p.Product_name
HAVING
SUM(o.quantity) >= 1;

--Écrivez une requête pour récupérer les noms des clients qui ont passé le plus de commandes
--ainsi que le nombre total de commandes passées par chaque client.
SELECT
cl.Customer_name,
MAX(total_amount) AS 'le Montant total de commande'
FROM
Customer cl
JOIN
Orders o ON cl.Customer_id = o.Customer_id
GROUP BY
cl.Customer_id, cl.Customer_name;

-- requête pour récupérer les noms des produits les plus commandés, 

--ainsi que la quantité totale de chaque produit commandé.

SELECT Product_name, sum(quantity) 'les noms des produits les plus commandés'
FROM Customer cl
JOIN Product p
ON cl.Customer_id = p.Product_id
JOIN Orders o
ON p.Product_id = o.Product_id
GROUP BY Product_name;
--Écrivez une requête pour récupérer les noms des clients qui ont passé une commande chaque jour de la semaine
--ainsi que le nombre total de commandes passées par chaque client.
SELECT Customer_name, sum(quantity) 'le nombre total de commandes passées par chaque client'
FROM Customer cl
JOIN Product p
ON cl.Customer_id = p.Product_id
JOIN Orders o
ON p.Product_id = o.Product_id
WHERE ordersDate LIKE '2023-02-%' OR OrdersDate LIKE '2023-05-%'
GROUP BY Customer_name;

Checkpoint bases de données

CREATE DATABASE DQL;
USE DQL;
CREATE TABLE customer (
customer_id INT PRIMARY KEY, customer_Name VARCHAR(30) NOT NULL, customer_Tel VARCHAR(30) NOT NULL
);
CREATE TABLE product (
product_id INT PRIMARY KEY, product_name VARCHAR(30) NOT NULL, catogory VARCHAR(30) NOT NULL, Price VARCHAR(30) NOT NULL
);
CREATE TABLE orders (
orders_id INT PRIMARY KEY ,
product_id INT not null ,
customer_id INT not null ,
quantity INT not null,
OrdersDate VARCHAR(30) NOT NULL,
total_amount INT not null,
FOREIGN KEY (customer_id) REFERENCES customer(customer_id),
FOREIGN KEY (product_id) REFERENCES product(product_id) );
--inserer des enregistrements
INSERT INTO customer VALUES (1, 'cellou','77120'); INSERT INTO customer VALUES (2, 'dior','77130' ); INSERT INTO customer VALUES (3, 'awa','77187'); SELECTFROM customer;
INSERT INTO product VALUES (1, 'widget', 'mobile','500'); INSERT INTO product VALUES (2, 'gadget', 'electro','700' ); INSERT INTO product VALUES (3, 'doohickey', 'sante','800'); SELECT
FROM product;
INSERT INTO orders VALUES (1, 1, 2,10,'10-01-2024',5000); INSERT INTO orders VALUES (2, 2, 1,12,'15-01-2024',7000); INSERT INTO orders VALUES (3, 3, 3,8,'20-01-2024',8000); INSERT INTO orders VALUES (4, 2, 2,11,'30-01-2024',8500); SELECT*FROM orders;
-- requête pour récupérer les noms des clients qui ont commandé au moins un widget et au moins un gadget
-- ainsi que le coût total des widgets et gadgets commandés par chaque client. -- Le coût de chaque article doit être calculé en multipliant la quantité par
le prix du produit.
SELECT customer.customer_Name, SUM(orders.quantity * product.Price) AS 'coût total'
FROM customer

INNER JOIN product ON customer.customer_id = product.product_id
INNER JOIN orders ON product.product_id = orders.product_id
WHERE product.product_name = 'widget' OR product.product_name = 'gadget' GROUP BY customer.customer_Name;
-- 2 Écrivez une requête pour récupérer les noms des clients qui ont commandé au moins un widget,
-- ainsi que le coût total des widgets commandés par chaque client.
SELECT customer.customer_Name, SUM(orders.quantity * product.Price) AS 'coût total'
FROM customer
INNER JOIN orders ON customer.customer_id = orders.customer_id INNER JOIN product ON orders.product_id = product.product_id WHERE product.product_name = 'widget'
GROUP BY customer.customer_Name;
-- récupérer les noms des clients qui ont commandé au moins un gadget
-- ainsi que le coût total des gadget commandés par chaque client.
SELECT customer.customer_name, SUM(orders.quantity * product.price) AS 'coût
total'
FROM customer
INNER JOIN orders ON customer.customer_id = orders.customer_id INNER JOIN product ON orders.product_id = product.product_id WHERE product.product_name = 'gadget'
GROUP BY customer.customer_name;
-- récupérer les noms des clients qui ont commandé au moins un doohickey
-- ainsi que le coût total des doohickey commandés par chaque client.
SELECT customer.customer_name, SUM(orders.quantity * product.price) AS 'coût
total'
FROM customer
INNER JOIN orders ON customer.customer_id = orders.customer_id INNER JOIN product ON orders.product_id = product.product_id WHERE product.product_name = 'doohickey'
GROUP BY customer.customer_name;
-- récupérer le nombre total de widgets et de gadgets commandés par chaque client
-- ainsi que le coût total des commandes.
SELECT customer.customer_name,
SUM(CASE WHEN product.product_name = 'widget' THEN orders.quantity ELSE
0 END) AS 'Nombre Total de Widgets',
SUM(CASE WHEN product.product_name = 'gadget' THEN orders.quantity ELSE
0 END) AS 'Nombre Total de Gadgets',
SUM(orders.quantity * product.price) AS 'Coût Total des Commandes'
FROM customer
INNER JOIN orders ON customer.customer_id = orders.customer_id INNER JOIN product ON orders.product_id = product.product_id WHERE product.product_name IN ('widget', 'gadget')
GROUP BY customer.customer_name;
-- Écrivez une requête pour récupérer les noms des produits qui ont été

SELECT product.product_name, SUM(orders.quantity) AS 'Quantité Totale'
FROM customer
INNER JOIN orders ON customer.customer_id = orders.customer_id
INNER JOIN product ON orders.product_id = product.product_id
GROUP BY product.product_name;
-- requête pour récupérer les noms des clients qui ont passé le plus de
commandes
-- ainsi que le nombre total de commandes passées par chaque client
SELECT cl.Customer_name, COUNT(o.orders_id) AS 'Nombre total de commandes' FROM Customer cl
JOIN Orders o ON cl.Customer_id = o.Customer_id
GROUP BY cl.Customer_name
ORDER BY COUNT(o.orders_id) DESC;
-- requête pour récupérer les noms des produits les plus commandés -- ainsi que la quantité totale de chaque produit commandé.
SELECT Product_name, sum(quantity) 'les noms des produits les plus commandés' FROM Customer cl
JOIN Product p
ON cl.Customer_id = p.Product_id
JOIN Orders o
ON p.Product_id = o.Product_id GROUP BY Product_name;
-- requête pour récupérer les noms des clients qui ont passé une commande chaque jour de la semaine
-- ainsi que le nombre total de commandes passées par chaque client.
SELECT cl.Customer_name, SUM(o.quantity) AS 'le nombre total de commandes passées par chaque client'
FROM Customer cl
JOIN Orders o ON cl.Customer_id = o.Customer_id
JOIN Product p ON o.Product_id = p.Product_id
WHERE (MONTH(o.ordersDate) = 1 OR MONTH(o.ordersDate) = 7) AND YEAR

(o.ordersDate) = 2024 GROUP BY cl.Customer_name;

Dml

Dml Check point

  1. ecrire les requetes sql pour créer et inserer tous les enregistrements fournis
    CREATE TABLE produits(
    nom varchar(25),
    prix INT
    );

SELECT * FROM produits;
INSERT INTO produits VALUES('cookies' ,'10') , ('candy' , 5);
SELECT * FROM produits;
CREATE TABLE clients(
nom varchar(25),
adresse varchar(25)
);
INSERT INTO clients VALUES('ahmed' ,'tunisie') ,('coulibaly' ,'senegal') ,('hasan' ,'egypte');
SELECT *FROM clients;
CREATE TABLE commandes(
costumer_id INT,
product_id INT,
Quantity INT,
order_date DATE
);
INSERT INTO commandes(costumer_id, product_id, Quantity, order_date) VALUES (1, 2 ,3 , '2023-01-22') , (2 ,1, 10 , '2023-04-14');
SELECT * FROM commandes;
2. METTRE à jour
UPDATE commandes SET Quantity = 6
WHERE Quantity = 2;
3. SUPPRIMER LE 3eme client
DELETE FROM clients WHERE nom = 'hasan';
4. a- Supprimer le contenu d’une table
DELETE FROM commandes;
b- suppimer la table completement
DROP TABLE commandes;

Checkpoint pizza delivery

print("Bienvenue dans python pizza delivery")

Prix de base des pizzas

prix_petite_pizza = 15
prix_moyenne_pizza = 20
prix_grande_pizza = 25

Prix des garnitures

prix_pepperoni = 2
prix_fromage_supplementaire = 1

try:
# Demandez à l'utilisateur la taille de la pizza
taille_pizza = input("Quelle taille de pizza souhaitez-vous (S/M/L) ? ").upper()
# Vérifiez la taille de la pizza et calculez le prix de base
if taille_pizza == "S":
prix_total = prix_petite_pizza
elif taille_pizza == "M":
prix_total = prix_moyenne_pizza
elif taille_pizza == "L":
prix_total = prix_grande_pizza
else:
raise ValueError("Taille de pizza invalide. Veuillez choisir parmi (S/M/L).")

# Demandez à l'utilisateur s'il veut du pepperoni
add_pepperoni = input("Voulez-vous du pepperoni sur votre pizza (YES/NO) ? ").upper()
if add_pepperoni == "Y":
   print("vous avez ajouté du Peperonni")
   if taille_pizza == "S": 
    prix_total += prix_pepperoni
   else:
    prix_total += prix_pepperoni + 1
else :
   print("vous n'avez pas ajouté du peperonni")

# Demandez à l'utilisateur s'il veut du fromage supplémentaire
extra_cheese = input("Voulez-vous du fromage supplémentaire sur votre pizza (YES/NO) ? ").upper()
if extra_cheese == "Y":
    print("vous avez pris du fromage comme supplément")
    prix_total += prix_fromage_supplementaire
else:
   print("vous n'avez pas pris du fromage comme supplément")
   
 # Affichez la facture finale
print(f"Votre pizza {taille_pizza.capitalize()} coûte {prix_total}$. Bon appétit ! 🍕")

except ValueError as e:
print(f"Erreur : {e}")

Checkpoint pizza python delivery

Par Mamadou cellou Diallo

Prix de base des pizzas
prix_petite_pizza = 15
prix_moyenne_pizza = 20
prix_grande_pizza = 25

Prix des garnitures

prix_pepperoni = 2
prix_fromage_supplementaire = 1

try:
# Demandez à l'utilisateur la taille de la pizza
taille_pizza = input("Quelle taille de pizza souhaitez-vous (S/M/L) ? ").upper()
# Vérifiez la taille de la pizza et calculez le prix de base
if taille_pizza == "S":
prix_total = prix_petite_pizza
elif taille_pizza == "M":
prix_total = prix_moyenne_pizza
elif taille_pizza == "L":
prix_total = prix_grande_pizza
else:
raise ValueError("Taille de pizza invalide. Veuillez choisir parmi (S/M/L).")

# Demandez à l'utilisateur s'il veut du pepperoni
add_pepperoni = input("Voulez-vous du pepperoni sur votre pizza (YES/NO) ? ").upper()
if add_pepperoni == "Y":
   print("vous avez ajouté du Peperonni")
   if taille_pizza == "S": 
    prix_total += prix_pepperoni
   else:
    prix_total += prix_pepperoni + 1
else :
   print("vous n'avez pas ajouté du peperonni")

# Demandez à l'utilisateur s'il veut du fromage supplémentaire
extra_cheese = input("Voulez-vous du fromage supplémentaire sur votre pizza (YES/NO) ? ").upper()
if extra_cheese == "Y":
    print("vous avez pris du fromage comme supplément")
    prix_total += prix_fromage_supplementaire
else:
   print("vous n'avez pas pris du fromage comme supplément")
   
 # Affichez la facture finale
print(f"Votre pizza {taille_pizza.capitalize()} coûte {prix_total}$. Bon appétit ! 🍕")

except ValueError as e:
print(f"Erreur : {e}")

Port forwarding doesn't work

Description
Port forwarding seems to be broken.

Reproduction Steps

  1. Press "Use this template" then "Open in codespace"
  2. Wait until the codespace is ready and nextjs app has started
  3. Click on the console url "http://localhost:3000"
  4. A new page with an automatically generated URL opens up, but it doesn't work
  5. Trying to append :3000 to the current URL or generated URL, but this doesn't work either
  6. Click on "Ports" in the editor and on "Forward a port", enter 3000. You will get the error message: "unable to forward localhost:3000. the host may not be available or that remote port may already be forwarded"

Better support for non-x86-64 archs

Firstly, thanks for this awesome template! I'm pretty new to Next, so I'm sorry if this isn't a very good issue.

I believe that the mcr.microsoft.com/devcontainers/universal:2 image used in this template is only built for x86-64 arch according to https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux. I'm guessing this is going to run into many performance issues for amd64 users like me on Apple silicon.

I found a simple change like this seems to at least work enough for a template: main...myyk:codespaces-nextjs:patch-1 (pls excused the misleading comment on it and the bad formatting)

I don't know if there are other reasons why devcontainers/universal was used instead of devcontainers/typescript-node though.

Checkpoint python pizza

print("Bienvenue dans Python Pizza Delivery")
taille =str(input("Quelle taille de pizza souhaitez-vous? (S, M, L): "))
if taille=="S":
print("vous avez choisi une petite pizza")
elif taille=="M":
print("vous avez choisi une pizza moyenne")
elif taille=="L":
print("vous avez choisi une grande pizza")
else:
print("saisie incorrecte choisir (S/M/L)")
add_pepperoni = input("Voulez-vous ajouter du pepperoni? (Y/N): ")
if add_pepperoni== "Y" :
print("vous avez choisi du pepperoni")
elif add_pepperoni== "N" :
print("vous n'avez pas choisi du pepperoni")
else :
print("saisie incorrecte ,choisir (Y/N)")

extra_cheese = input("Voulez-vous ajouter du fromage supplémentaire? (Y/N): ")
if extra_cheese== "Y":
print("vous avez choisi un supplement fromage")
elif extra_cheese== "N":
print("vous n'avez pas choisi un supplement fromage")
else:
print("saisie incorrecte ,choisir(Y/N)")
commande=print("votre commande est une pizza de taille" +" "+ taille, add_pepperoni, extra_cheese)

calcul de la facture totale

price = 0
if taille == "S":
price += 15
elif taille == "M":
price += 20
elif taille == "L":
price += 25

if add_pepperoni == "Y":
if taille == "S":
price += 2
else:
price += 3

if extra_cheese == "Y":
price += 1

print(f"Votre facture finale est de: {price} $.")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.