
*The `/` characters define the beginning and end of the regex.*
## Features
* Optionally supports [PCRE](http://php.net/manual/en/book.pcre.php) syntax
* Automatic marking of matched text
* Manual marking of text
* Manual replacement / replacement preview
* Automatic replacement
* Automatic comment-based replacement with `>` and `<`
* Tools for writing and testing regular expressions
* Built-in list of common regular expressions (with descriptions)
* Unlimited undo/redo
* Viewing of sublime-style [capture groups](http://doc.qt.io/qt-5/qregularexpression.html#capturedTexts)
* Viewing of [PCRE capture groups](http://www.regular-expressions.info/captureall.html) and backreferences
* Opens files from command-line and via drag & drop
* Loads and saves projects
* Internal clipboard
* Copy & paste of
INSERT INTO LOGIN ('ID',NAME,PASSWORD) VALUES
(1,'TOM','12345'),
(2,'TOM2','123456'),
(3,'TOM3','1234567'),
<button id="logout">Logout</button>
<div class="container" id="main">
<h1>Sign up</h1>
<form>
<div class="form-group">
<label for="username">UserName</label>
<input type="text" class="form-control" id="username">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password">
</div>
<div class="form-group">
<label for="fullname">Full Name</label>
<input type="text" class="form-control" id="fullname">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email">
</div>
<button type="button" class="btn btn-primary">Submit</button>
</form>
</div>
## Source code
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
self.weight = 100
def work_out(self):
self.weight -= 1
def eat(self):
self.weight += 1
def __str__(self):
return f"{self.name} is {self.age} years old and weights {self.weight} kilos"
student1 = Student("Rado", 20)
student2 = Student("Ivo", 21)
student3 = Student("Ivan", 20)
print(student1)
print(student2)
print(student3)
student1.eat()
student2.work_out()
print(student1)
print(student2)
/^[a-zA-Z0-9_]{2,30}$/
time complexitySun, 12 Feb 2023 *Answer:
1. O(1)
2. O(n) - linear, where n is the size of the list
3. O(n^2) - exponential, where n is the size of the list
4. O(log(n)) - logarithmic, where n is the size of the list
5. O(1)
time complexitySun, 12 Feb 2023 O(1)
translateSat, 11 Feb 2023 $result = array();
$data = array("firstname" => "Fred", "lastname" => "Smith", "address" => "111 Main Street");
$result = $data;
def guess_the_number(guess):
if guess < 5:
return 'Oops! Your guess was too low.'
if guess > 5:
return 'Oops! Your guess was too high.'
if guess == 5:
return 'Good job! Your guess was just right.'
Python
time complexitySun, 12 Feb 2023 ## Anagrams
## Arrays
## Binary Search
## Bit Manipulation
## Brain Teasers
## Debugging
## Dynamic Programming
## Enumeration
## Graphs
## Hash Tables
## Hashing
## Heaps
## Linked List
## Math
## Recursion
## Sorting
## Stacks
## Strings
## System Design
## Trees
## Two Pointers
## Testing
## Trie
## Two Heaps
## Two Pointers
## Two Sum
## Union Find
user name : admin
password: 123
<a class="nav-link" href="#">Logout</a>
time complexitySun, 12 Feb 2023 O(2^n)
HTML
/login[\s]*:[\s]*(\w+)/
import unittest
class TestWhatIs(unittest.TestCase):
def test_what_is(self):
self.assertEqual(what_is_software_eng(), "a profession that involves the development of computer software")
def add(a: int, b: int) -> int:
return a + b
(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9]).{8,}
time complexitySun, 12 Feb 2023 The iPhone as well as the iPad are mobile devices that allow a
company to reach its customers and suppliers anywhere, at anytime.
Customers can access information about items for sale and even make
online purchases. Companies can also use their iPhones to reach
their suppliers and request information about the supplies that they
need.
Adding a logout button to the navbar in order to logout users.
time complexitySun, 12 Feb 2023 software eng is the application of a systematic, disciplined,
quantitative approach to the development, operation, and maintenance of software; that is, the application of engineering to software
function formatDate($date) {
return date('g:i a', strtotime($date));
}
fix invalid codeSun, 12 Feb 2023 php
<?php
$sql = "SELECT * FROM `users`";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();
?>
<div class="container">
<form action="registrations.php" method="post">
<div class="form-group">
<label for="email">Email address</label>
<input name="email" type="email" class="form-control" id="email" placeholder="Enter email">
</div>
<div class="form-group">
<label for="password">Password</label>
<input name="password" type="password" class="form-control" id="password" placeholder="Password">
</div>
<div class="form-group">
<label for="passwordConfirmation">Password Confirmation</label>
<input name="password_confirmation" type="password" class="form-control" id="passwordConfirmation" placeholder="Password Confirmation">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
time complexitySun, 12 Feb 2023 f(n) = n * n
<?php
session_start();
$_SESSION['user'] = 'username';
$_SESSION['pass'] = 'password';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Login</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="text" name="user" id="user" placeholder="Username">
<input type="text" name="pass" id="pass" placeholder="Password">
<input type="submit" name="submit" id="submit" value="submit">
</form>
</body>
</html>
<?php
if(isset($_POST['submit']
time complexitySun, 12 Feb 2023 The iPhone is a game changer because anyone
can use it. It has no complicated parts and
has a user-friendly interface. It is also very
easy to contact your suppliers because
everyone has a cellphone and a supplier can
contact you on the go. Even your customers
can contact you on the go if you give them your
cellphone number
<button onClick={() => {
this.props.dispatch(actions.logout())
}}>Logout</button>
<?php
$host = 'localhost';
$username = 'root';
$password = '';
$database = 'login';
$connection = mysqli_connect($host, $username, $password, $database);
?>
time complexitySun, 12 Feb 2023 ### Presentation
- Slides (deck)
- Script (notes)
- Hints (for the presenter)
### Homework
- [Python: Introduction](https://github.com/hft-stuttgart-ai/python-intro)
## Python
**Python** is a programming language created by
Guido van Rossum in 1991.
> Python is an interpreted, high-level,
general-purpose programming language.
- [python.org](https://www.python.org/)
## Python
- [Python 3](https://www.python.org/downloads/)
- [Anaconda](https://www.anaconda.com/distribution/)
time complexitySun, 12 Feb 2023 a computer is a machine that can be instructed to carry out sequences of arithmetic or logical operations automatically via computer programming. Modern computers have the ability to follow generalized sets of operations, called programs. These programs enable computers to perform an extremely wide range of tasks.
$_POST['login']
$_POST['password']
<a href="logout.php" class="btn btn-danger">Logout</a>
fix invalid codeSat, 11 Feb 2023 def add(a, b):
return a + b
time complexitySun, 12 Feb 2023 an e-commerce store that allows users to store their credit card details.
It is highly likely that this store will have a database with a table that
stores credit card details.
It will also have a web server component that handles requests by the users
to add, edit or delete these credit card details.
def code_game(num1, num2, num3):
num = num1 * num2 + num3
return num
code_game(1, 2, 3)
In order to login succesfully the username and password has to be the same as the one in the database.
time complexitySun, 12 Feb 2023 O(n^2)
<button class="btn">logout</button>
php
<?php
$db_name="registration";
$mysql_username="root";
$mysql_password="";
$server_name="localhost";
$conn=mysqli_connect($server_name,$mysql_username,$mysql_password,$db_name);
if($conn){
echo"<h3>connection successful</h3>";
}
else{
echo"<h3>no connection</h3>".mysqli_connect_error();
}
?>
<meta name="keywords" content="software engineering, software, engineering, se, software eng, software engineer">
/\w+\s\w+\s\w+\s\w+\?/
fix invalid codeSun, 12 Feb 2023 php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "registration";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$sql = "INSERT INTO users (name, username, password, email) VALUES ('$name', '$username', '$password', '$email')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
fix invalid codeSat, 11 Feb 2023 $sql = "SELECT * FROM login WHERE username = '$username'";
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("registration", $con);
$sql="insert into registration (firstname,lastname,email,phone,bdate,password,re_password ) values ('$_POST[firstname]','$_POST[lastname]','$_POST[email]','$_POST[phone]','$_POST[bdate]','$_POST[password]','$_POST[re_password]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
def logout(request):
if request.method == 'POST':
auth.logout(request)
return redirect('/')
$sql = "SELECT * FROM table WHERE name = '".$_POST["name"]."' AND password = '".$_POST["password"]."'";
it's a button that logs you out of the site
$sql = "INSERT INTO users (name, email, password)
VALUES ('John', 'john@gmail.com', '12345')";
fix invalid codeSun, 12 Feb 2023 php
<?php
try {
$pdo = new PDO('mysql:host=localhost;dbname=regestarion', 'root', '');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf8"');
} catch (PDOException $e) {
$error = 'Unable to connect to the database server.';
include 'error.html.php';
exit();
}
if (isset($_POST['firstname'])) {
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$password = $_POST['password'];
$password2 = $_POST['password2'];
$errors = array();
if ($password != $password2) {
$errors[] = "the two passwords do not match";
}
if (strlen($password