This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from mininet.node import Controller | |
from mininet.net import Containernet | |
from mininet.cli import CLI | |
from mininet.log import info, setLogLevel | |
import docker | |
setLogLevel('info') | |
client = docker.from_env() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mininet.node import Controller | |
from mininet.net import Containernet | |
from mininet.cli import CLI | |
from mininet.log import info, setLogLevel | |
import docker | |
setLogLevel('info') | |
client = docker.from_env() | |
client.images.build(path=".", tag="web-server", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from mininet.node import Controller | |
from mininet.net import Containernet | |
from mininet.cli import CLI | |
from mininet.log import info, setLogLevel | |
net = Containernet(controller=Controller) | |
setLogLevel('info') | |
net.addController('c0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
with open("log.txt", "r+", encoding='utf8') as log: | |
log.seek(0) | |
content = log.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
const Timer = () => { | |
const [seconds, setSeconds] = useState(0); | |
const [isActive, setIsActive] = useState(false); | |
const handleTimerClick = () => { | |
setIsActive(!isActive); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
function Timer() { | |
const [time, setTime] = useState(0); | |
const handleClick = () => { | |
setInterval(() => { | |
setTime((prevTime) => prevTime + 1); | |
}, 1000); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useState } from "react"; | |
function Timer() { | |
const [seconds, setSeconds] = useState(0); | |
const [isTimerRunning, setIsTimerRunning] = useState(false); | |
const interval = useRef(0); | |
const startTimer = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useState } from "react"; | |
function Timer() { | |
const [seconds, setSeconds] = useState(0); | |
const [isTimerRunning, setIsTimerRunning] = useState(false); | |
const interval = useRef(0); | |
const startTimer = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
function Timer() { | |
const [seconds, setSeconds] = useState(0); | |
const [isTimerRunning, setIsTimerRunning] = useState(false); | |
const startTimer = () => { | |
if (!isTimerRunning) { | |
const interval = setInterval(() => { | |
setSeconds(seconds + 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
function Timer() { | |
const [time, setTime] = useState(0); | |
const [timerOn, setTimerOn] = useState(false); | |
const handleClick = () => { | |
setTimerOn(true); | |
} |
NewerOlder