3076
=====================================================================
.. index::
single: 3076
.. index::
pair: 114759, 128874
.. index::
tags:
- 3076
- 3076-114759
- 3076-128874
Overview
--------
This file contains a list of all the places mentioned in this book, sorted by their position.
If you want to do something with the data, have a look at
:ref:`scripting and querying the data <scripting_and_querying>`.
See also
--------
* :ref:`index <index>`
* :ref:`index of all places <all_places>`
* :ref:`book summary <summary>`
* :ref:`book index <index>`
Note that the data is loaded from a database, and might be outdated. If you need the most recent information, please contact the author.
Table of Contents
-----------------
.. contents::
depth: 10
======================================================
=====================================================
# About
## Introduction
The purpose of this project is to test my understanding of the concepts taught in
the "Introduction to Programming Concepts" course (CS124) at the University of
Minnesota Twin Cities. This assignment involves implementing a basic program that
counts the number of occurrences of each word in a text file and outputs the results
in alphabetical order.
## Requirements
The program should accept a text file as input, process it line by line, and count
the number of times each word appears. The output should be sorted alphabetically
and written to a new text file.
## Concepts Covered
- [File I/O](#file-io)
- [String Processing](#string-processing)
- [Map Data Structure](#map-data-structure)
- [Sorting Algorithms](#sorting-algorithms)
# File I/O
The first step in this project is to read a text file and count the number of words it contains. The standard input/output library, `stdio`, provides functions for opening and reading files.
## Reading Files
To open a file for reading, you can use the `fopen()` function from the standard I/O library. This function returns a file pointer that you can use to read from the file. Here is an example:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
FILE *fp;
fp = fopen("input.txt", "r");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
// ...
}
```
In this example, `fopen()` is called with the file name "input.txt" and the mode "r", which specifies that we want to read from the file. If the function succeeds, it returns a file pointer, which we assign to the variable `fp`. If the function fails (e.g., because the file does not exist), it returns `NULL`, and we print an error message and exit the program.
To read from a file, you can use the `fgets()` function. This function reads a line of text from the file pointer `fp` and stores it in a buffer. Here is an example:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
FILE *fp;
char line[1024];
fp = fopen("input.txt", "r");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
while (fgets(line, sizeof(line), fp)) {
// ...
}
}
```
In this example, `fgets()` is called with the file pointer `fp`, a buffer of size `sizeof(line)`, and the mode "r". If the function succeeds, it returns the number of characters read. If the function fails (e.g., because there are no more lines in the file), it returns `EOF`.
To count the number of words in a text file, you can loop through each line of the file and split it into words using the `strtok()` function. Here is an example:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
FILE *fp;
char line[1024];
fp = fopen("input.txt", "r");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
int num_words = 0;
while (fgets(line, sizeof(line), fp)) {
char *word;
size_t len = strlen(line);
for (size_t i = 0; i < len; ++i) {
if (line[i] == ' ') {
word = strtok(line, " ");
num_words++;
// ...
}
}
}
}
```
In this example, we initialize a counter variable `num_words` to zero. Then, in the loop that reads each line from the file, we use `strtok()` to split the line into words based on spaces. For each word, we increment the counter `num_words`.
## Writing Files
To write data to a file, you can use the `fprintf()` function from the standard I/O library. This function writes formatted output to a stream (i.e., a file pointer). Here is an example:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
FILE *fp;
char output[1024];
fp = fopen("output.txt", "w");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
fprintf(fp, "%s
", "Hello World!");
}
```
In this example, `fprintf()` is called with the file pointer `fp`, a format string, and the argument "Hello World!". The format string specifies how the output should be formatted. In this case, we use `%s` to write a string, followed by a newline character `
`.
To write multiple lines of text to a file, you can loop through the data and write each line using `fprintf()`. Here is an example:
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
FILE *fp;
char output[1024];
fp = fopen("output.txt", "w");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
for (int i = 0; i < 3; ++i) {
fprintf(fp, "%d: Hello World!
", i + 1);
}
}
```
In this example, we use a loop to write three lines of text to the file. For each line, we use `fprintf()` with a different argument (i.e., the value of `i + 1`).
# String Processing
The next step in this project is to process each word in the file and count its occurrences. To do this, you will need to split each line into words using the `strtok()` function, and then loop through each word and increment a count.
## Splitting Strings
The `strtok()` function takes two arguments: a string and a delimiter. It returns a pointer to the first token in the string that is separated by the delimiter. If there are no more tokens, it returns a null pointer.
Here is an example of how you might use `strtok()` to split a string into words based on spaces:
```c
#include <stdio.h>
#include <string.h>
int main() {
char *line = "Hello World!";
char *token;
size_t len = strlen(line);
for (size_t i = 0; i < len; ++i) {
if (line[i] == ' ') {
token = strtok(line, " ");
printf("Token: %s
", token);
}
}
}
```
In this example, `strtok()` is called with the string `"Hello World!"` and the delimiter `" "`. If the function succeeds, it returns a pointer to the first token (i.e., "Hello"). Then, we print the value of the token using `printf()`. We continue this process until the end of the line is reached (i.e., the character after the last space).
## Counting Words
To count the occurrences of each word in the file, you can use a map data structure. A map is a collection of key-value pairs, where each key is unique and corresponds to a value. In this case, we will use the key as the word and the value as its count.
Here is an example of how you might implement a map using an array:
```c
#include <stdio.h>
#include <string.h>
int main() {
char *words[1024];
int counts[1024] = { 0 };
for (int i = 0; i < 1024; ++i) {
words[i] = NULL;
counts[i] = 0;
}
// ...
}
```
In this example, we declare two arrays: `words` and `counts`. The `words` array is used to store pointers to the strings (i.e., the words). The `counts` array is used to store the counts for each word. We initialize both arrays with zeros.
To use this map, you will need to loop through each line in the file and split it into words using `strtok()`. Then, for each word, you can search the map to see if it already exists. If it does, you can increment its count. If it doesn't, you can add it to the map with a count of one.
Here is an example of how you might use this map to count the occurrences of each word in the file:
```c
#include <stdio.h>
#include <string.h>
int main() {
char *words[1024];
int counts[1024] = { 0 };
for (int i = 0; i < 1024; ++i) {
words[i] = NULL;
counts[i] = 0;
}
FILE *fp;
char line[1024];
fp = fopen("input.txt", "r");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
while (fgets(line, sizeof(line), fp)) {
char *token;
size_t len = strlen(line);
for (size_t i = 0; i < len; ++i) {
if (line[i] == ' ') {
token = strtok(line, " ");
if (strcmp(token, "hello") == 0) {
counts[strlen(token) - 1]++;
}
}
}
}
}
```
In this example, we use a loop to read each line from the file. For each line, we split it into words using `strtok()`. Then, for each word, we search the map using `strcmp()` to see if it already exists. If it does (i.e., the comparison returns zero), we increment its count by one.
## Sorting Maps
To sort the map by key (i.e., the word), you will need to implement a custom comparator function that takes two key-value pairs and compares them based on their keys. Then, you can use the `qsort()` function from the standard library to sort the array of maps.
Here is an example of how you might implement a custom comparator function:
```c
int compare(const void *a, const void *b) {
char *word1 = *(char **)a;
char *word2 = *(char **)b;
return strcmp(word1, word2);
}
```
In this example, `compare()` takes two pointers to strings (i.e., the keys of the maps). It compares the two strings using `strcmp()`, and returns the result.
To use this comparator function to sort the array of maps, you can call `qsort()` with the array, the number of elements, and the comparator function:
```c
int count = 0;
for (int i = 0; i < 1024; ++i) {
if (strcmp(words[i], "hello") == 0) {
counts[strlen(words[i]) - 1]++;
count++;
}
}
qsort(counts, count, sizeof(int), compare);
```
In this example, we use the `count` variable to keep track of the number of elements in the map. Then, we call `qsort()` with the array `counts`, the number of elements (i.e., `count`), and the comparator function `compare`.
# Sorting Strings
To sort the strings in the file by alphabetical order, you can use a custom comparator function that takes two string pointers and compares them using `strcmp()`. Then, you can use the `qsort()` function from the standard library to sort the array of strings.
Here is an example of how you might implement a custom comparator function:
```c
int compare(const void *a, const void *b) {
char *str1 = *(char **)a;
char *str2 = *(char **)b;
return strcmp(str1, str2);
}
```
In this example, `compare()` takes two pointers to strings. It compares the two strings using `strcmp()`, and returns the result.
To use this comparator function to sort the array of strings, you can call `qsort()` with the array, the number of elements, and the comparator function:
```c
int count = 0;
for (int i = 0; i < 1024; ++i) {
if (strcmp(words[i], "hello") == 0) {
counts[strlen(words[i]) - 1]++;
count++;
}
}
qsort(counts, count, sizeof(int), compare);
```
In this example, we use the `count` variable to keep track of the number of elements in the map. Then, we call `qsort()` with the array `counts`, the number of elements (i.e., `count`), and the comparator function `compare`.
# Writing Output
To write the output to a file, you can use the `fprintf()` function from the standard library. This function takes three arguments: a pointer to a stream (i.e., the output file), a format string, and one or more arguments to be inserted into the format string.
Here is an example of how you might use `fprintf()` to write the sorted strings to a file:
```c
FILE *fp;
fp = fopen("output.txt", "w");
if (fp == NULL) {
printf("Could not open file.
");
return 1;
}
for (int i = 0; i < count; ++i) {
fprintf(fp, "%s
", words[i]);
}
```
In this example, we use the `fopen()` function to open the output file for writing. Then, we use a loop to write each sorted string to the file using `fprintf()`. The format string is simply `%s`, which tells `fprintf()` to insert the string pointer as an argument.
Note that you should always close the output file after you have finished writing to it using `fclose()`. This function takes a pointer to a stream (i.e., the output file) and closes it.
Here is an example of how you might use `fclose()` to close the output file:
```c
fclose(fp);
```
In this example, we simply call `fclose()` with the pointer to the output file (i.e., `fp`). This will close the file.
The first thing we did was set up a few basic pieces of equipment. We got the camera, of course, but we also needed some lights to shine on our subjects. Since we didn’t have any professional lighting equipment, we decided to use some old lamps from my grandmother’s house. They were a bit rusty and covered in dust, but they would do for now.
We also needed a backdrop to put our models against, so we used a piece of black fabric that I had lying around. It wasn’t the best quality, but it was better than nothing. We hung it up on a wall using some old clothes hangers that my grandmother had given me.
Finally, we needed something to sit or stand on while we were shooting. Since we didn’t have any stools or chairs, we used some old crates that I had found in the basement of my grandfather’s house. They were a bit wobbly and hard to climb onto, but they did the job.
Once we had all our equipment set up, we were ready to start shooting. We started with some simple portraits of my friends, using the camera’s auto focus feature to make sure everything was sharp. It wasn’t perfect, but it was good enough for a first attempt.
Next, we decided to try some landscape shots of the woods behind my grandmother’s house. We used a wider angle lens this time, and tried to get a sense of depth by shooting from different distances. The results were mixed – some of the pictures turned out great, while others were too blurry or too dark.
After that, we decided to take a break and grab some lunch. We went down the street to a local diner that had been recommended by my grandmother’s friends. It was a bit out of the way, but it was worth it for the delicious burgers and fries.
Once we were back home, we decided to try our hand at some still life shots. We used some old vases and flowers that I had found in my grandmother’s garden, along with a piece of silverware that my grandfather had given me. It wasn’t the most interesting subject matter, but it was something to work with.
We spent the rest of the afternoon experimenting with different lighting and angles, trying to get the best possible results. We didn’t take any pictures of each other that day, but we did manage to capture some beautiful moments of nature and still life.
As the sun started to set, we packed up our equipment and headed back down the street to my grandmother’s house. She was waiting for us with a fresh pot of tea and some homemade cookies, which we devoured as we looked through our photos.
Overall, it wasn’t the most successful photography session we had ever had, but it was definitely a learning experience. We learned about lighting and composition, about working with different subjects, and most importantly, about having fun and being creative. And that was all that really mattered.
================================================================
===============================================================
# **Python: Calculate the lowest common multiple of 46850 and 129720.**
**Formula:** lcm(a, b) = a * (b//gcd(a, b))
## **Answer:** 46850
### **Explanation:**
*We can use the formula for finding the lowest common multiple of two numbers. In this case, a = 46850 and b = 129720.*
*The greatest common divisor (gcd) of 46850 and 129720 is 50.*
*We can divide b by gcd(a, b) to get the value of (b//gcd(a, b)), which is 25836.*
*Finally, we multiply a by this value to get the lowest common multiple, lcm(a, b): 46850 * 25836 = 12972000.*
## **Sources:**
1. [lcm calculator](https://www.mathsisfun.com/calculators/lcm-calculator.html)
08/29/16 03:40 PM EST
---
title: "Exploring the Future of Artificial Intelligence in Healthcare"
author: "Geraldine Peroni, MD"
source: "https://www.healthitanalytics.com/news/exploring-the-future-artificial-intelligence-healthcare"
url: https://www.healthitanalytics.com/news/exploring-the-future-artificial-intelligence-healthcare
lang: en
---
Artificial intelligence (AI) is already transforming healthcare in many ways, but the potential for this technology to improve patient outcomes and reduce costs is still enormous. Here are some of the ways that AI is currently being used in healthcare:
1. Predictive analytics: AI algorithms can analyze vast amounts of data from electronic health records (EHRs) to identify patterns and make predictions about future health events. For example, an algorithm could predict which patients are at risk for hospital readmissions or which patients are likely to develop certain chronic conditions in the future.
2. Medical imaging: AI-powered tools can analyze medical images such as X-rays, CT scans, and MRIs to help doctors identify abnormalities and diagnose diseases. These tools can also help radiologists more accurately measure and track tumors over time.
3. Virtual health assistants: AI-powered virtual assistants can answer patients' questions about their health conditions, remind them to take medications, and even provide some basic medical advice. For example, the Google Assistant can answer questions about symptoms or medication side effects, while the Mayo Clinic's Chatbot can help patients schedule appointments and get information about their conditions.
4. Drug discovery: AI algorithms can analyze vast amounts of data from previous clinical trials to identify potential drug targets and speed up the drug discovery process. For example, IBM Watson has been used to analyze genomic data from thousands of cancer patients to identify new drug targets for immunotherapy.
5. Personalized medicine: AI-powered tools can analyze a patient's genetic makeup, lifestyle factors, and medical history to create personalized treatment plans that are tailored to their individual needs. For example, the company Tempus Health uses AI algorithms to analyze large amounts of genomic data from cancer patients and develop customized treatment plans based on each patient's unique characteristics.
While these applications of AI in healthcare are already having a significant impact, there is still much more that can be done. As data continues to grow and AI technology advances, we can expect even more innovative solutions to emerge in the coming years. Some of the areas where AI has the potential to make the biggest impact include:
1. Population health management: AI algorithms can analyze population-level data to identify trends and predict future health outcomes. This information can be used to develop targeted interventions that address specific health issues in a community, such as high rates of chronic diseases or opioid abuse.
2. Remote patient monitoring: AI-powered tools can analyze data from remote patient monitoring devices to detect abnormalities and alert healthcare providers to potential problems. For example, an algorithm could detect changes in a patient's heart rate or blood pressure that indicate a serious condition such as a heart attack or stroke.
3. Health information security: AI algorithms can help protect sensitive health information by identifying and mitigating cyber threats. For example, an algorithm could detect unusual patterns of activity on a healthcare network that might indicate a data breach or other security issue.
4. Medical research: AI algorithms can analyze vast amounts of medical research data to identify new insights and accelerate the pace of discovery. This information can be used to develop new treatments for diseases or to improve existing ones.
5. Healthcare workforce management: AI-powered tools can help healthcare organizations optimize their workflows and reduce costs by automating routine tasks such as scheduling, billing, and coding. This can free up healthcare workers to focus on providing high-quality care to patients.
Overall, the potential for AI to improve patient outcomes and reduce healthcare costs is enormous, but it will take a concerted effort from healthcare providers, policymakers, and technology companies to realize this potential. As with any new technology, there are also concerns about privacy, security, and bias that must be addressed in order to ensure that AI is used ethically and responsibly in healthcare. But if we can overcome these challenges, the benefits of AI in healthcare are likely to be truly transformative.
8:42 am, July 10th, 2022
Hello everyone! Today we’re going to talk about one of the most important aspects of our daily lives. We’ll be discussing sleep and its impact on our overall well-being.
We all know how important it is to get enough sleep, but do you really understand just how much? According to recent research, adults need at least 7-9 hours of quality sleep each night to maintain optimal health. However, many people struggle to achieve this amount, and the consequences can be devastating.
Lack of sleep can lead to a range of health problems, including obesity, diabetes, heart disease, and even cancer. It can also impair cognitive function, memory, and concentration, leading to decreased productivity at work or school. In addition, lack of sleep has been linked to increased risk of depression, anxiety, and other mental health disorders.
So how do we ensure that we’re getting enough quality sleep each night? Firstly, it’s important to establish a regular sleep schedule and stick to it as much as possible. This means going to bed and waking up at the same time every day, even on weekends. Secondly, it’s essential to create a relaxing bedtime routine that helps you unwind and prepares your body for sleep. This might include activities such as reading, taking a warm bath, or practicing relaxation techniques like meditation or deep breathing.
It’s also important to pay attention to the quality of your sleep. If you find yourself tossing and turning or waking up frequently during the night, it could be a sign that you’re not getting enough deep, restorative sleep. In this case, it might be helpful to investigate possible underlying causes such as stress, anxiety, or an uncomfortable sleep environment.
Finally, don’t underestimate the importance of exercise in promoting good sleep. Regular physical activity has been shown to improve both quantity and quality of sleep, helping you feel more rested and refreshed throughout the day.
In conclusion, getting enough quality sleep is crucial for our overall health and well-being. By establishing a regular sleep schedule, creating a relaxing bedtime routine, and paying attention to the quality of your sleep, you can help ensure that you’re giving your body the best chance to recharge and thrive. Thanks for joining me today!
321. Let n(b) be the second derivative of b**6/180 - 13*b**5/45 + 7*b**4/18 + 29*b**3/3 - 6*b**2 - 14*b. Find the third derivative of n(w) wrt w.
Answer: 24*w - 260
# 1. What is a cube?
A cube is a shape that has 6 faces, each of which is a square. The faces meet at right angles and the edges of the squares are equal in length.
# 2. How many sides does a cube have?
A cube has 6 sides.
# 3. What is the surface area of a cube?
The surface area of a cube can be calculated by finding the area of one face (which is a square) and multiplying it by 6. The formula for the surface area of a cube is: SA = 6s^2, where SA is the surface area and s is the length of one edge.
# 4. What is the volume of a cube?
The volume of a cube can be calculated by multiplying the length of one edge by itself twice (i.e., cubing it). The formula for the volume of a cube is: V = s^3, where V is the volume and s is the length of one edge.
# 5. Is a cube a regular shape?
Yes, a cube is a regular shape because all its sides are congruent (equal in length) and all its angles are equal to 90 degrees.
* [Home](../index.md)
* [Students](../students/index.md)
* [Syllabus](syllabus.md)
* [Assignments](assignments.md)
* [Lecture Notes](lecture-notes/index.md)
* [Quizzes](quizzes.md)
* [Resources](resources.md)
* [FAQs](faqs.md)
# Quiz 3
## Problem 1: Factor 2x^3 - 9x^2 + 18x - 3
A: `(2x-3)(x^2-6)`
## Problem 2: Find the third derivative of `f(x) = 7*x**4 + 16*x**3 - x**2` with respect to `x`.
A: `288*x`
## Problem 3: What is the second derivative of `g(x) = x^3 + 2*x - 1` with respect to `x`?
A: `6*x`
## Problem 4: Find the first derivative of `h(u) = u**5 + 10*u**2` with respect to `u`.
A: `5*u**3 + 20*u`
========
==========================
This is a collection of notes and ideas for a new type of RPG. The goal of this system is to be a highly immersive role-playing game with a large number of unique abilities, character options, and systems. It should have a strong emphasis on the idea that your character is a living entity with their own thoughts, motivations, and feelings.
The core mechanics of the game revolve around an extensive array of abilities that can be used by characters. These abilities are derived from a wide variety of sources including magic, technology, psionics, martial arts, and so on. Each ability has its own unique effect and can be used in a variety of ways.
The game also features a highly developed character creation system that allows players to create characters with a wide range of abilities, motivations, and backgrounds. Characters can have multiple distinct personalities, each with their own thoughts, emotions, and feelings. Players can choose how these personalities interact with one another and how they respond to various situations.
The game world is also highly immersive, featuring a large number of unique locations, cultures, and societies. Each location has its own history, customs, and people. The world is also home to a wide variety of creatures, some of which are friendly while others are hostile. Players can explore the world and interact with its inhabitants in a variety of ways.
The game also features a highly developed combat system that allows players to engage in a wide range of tactical battles. Combat is highly customizable and can be tailored to suit individual playstyles. The game also includes a variety of different weapons, armor, and other equipment that can be used during combat.
Overall, this game aims to provide an extremely immersive role-playing experience with a wide range of unique abilities, character options, and systems. It is designed to be highly customizable and adaptable to suit individual playstyles.
# Why do my gifs not work on iOS?
I'm trying to add a GIF into my HTML using this code:
```
<img src="https://www.example.com/image.gif" alt="description">
```
It works in Chrome and Firefox, but it doesn't work on iOS devices. In particular I have tried on the iPhone 6s with iOS 8.4.3.
I also tried it on Safari and this is what I got:
Comment: This could be because of your server that hosts the image. Do you have a way to test if the image works fine for other devices?
## Answer (5)
This is a very common issue, try loading the image from a CDN like cdnjs, if it's not working then it's most likely related to your server, if it is working then check if your server is configured correctly for serving gifs.
Comment: That was it. Thanks for pointing me in the right direction.
## Answer (2)
If you are using an iPhone device that has not yet updated to iOS 9, you may need to specify a file size of at least 1MB for your GIFs to work properly on Safari:
```
<img src="https://www.example.com/image.gif" alt="description" width="500px" height="250px">
```
This page contains an example of a simple PHP script that uses a text file to store information about users. Each line in the file contains information about one user, with the format being: first name, last name, email address.
The script allows users to add new users, edit existing users, and delete users from the file. It also displays all users in the file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>User Management</title>
</head>
<body>
<h1>User Management</h1>
<!-- Add user form -->
<form action="add_user.php" method="post">
First Name: <input type="text" name="first_name"><br>
Last Name: <input type="text" name="last_name"><br>
Email Address: <input type="email" name="email"><br>
<input type="submit" value="Add User">
</form>
<!-- Display users form -->
<form action="display_users.php" method="post">
<input type="submit" value="Display Users">
</form>
<!-- Edit user form -->
<form action="edit_user.php" method="post">
User ID: <input type="number" name="user_id"><br>
First Name: <input type="text" name="first_name"><br>
Last Name: <input type="text" name="last_name"><br>
Email Address: <input type="email" name="email"><br>
<input type="submit" value="Edit User">
</form>
<!-- Delete user form -->
<form action="delete_user.php" method="post">
User ID: <input type="number" name="user_id"><br>
<input type="submit" value="Delete User">
</form>
</body>
</html>
# AES-192
**AES-192**, also known as the **Advanced Encryption Standard 128 bits**, is a symmetric block cipher used for secure data transmission. It was adopted by the U.S. National Institute of Standards and Technology (NIST) in October 2003, along with AES-128 and AES-256 as part of the Advanced Encryption Standard (AES).
The design and analysis of AES-192 was performed by Vincent Rijmen and Joan Daemen under funding from the NIST. The standard document for AES-192 is NIST Special Publication 800-38, *Advanced Encryption Standard*.
## Construction
AES-192 uses a block size of 128 bits (16 bytes) and operates on 16-byte data blocks. It also uses a 192-bit key. AES-192 has 10 rounds, which means that each data block is transformed 10 times before being sent or stored.
The key is divided into four parts called *round keys*, each of 48 bits, with each part corresponding to a different round of the algorithm. The key schedule for AES-192 uses a 128-bit key which is first divided into four round keys using a key derivation function (KDF). This KDF is called **AES Key Derivation Function** or **AES-KDF**. The key derivation is performed by repeatedly applying the following operation until the entire key has been used up.
```
#1 P = K[0]
#2 Q = P ^ K[1]
#3 R = Q ^ K[2]
#4 S = R ^ K[3]
```
The four round keys are then used in the rounds of the AES algorithm. The first and last round keys are always used unchanged; the second key is used twice; and the third key is used three times.
## Security analysis
AES-192 is considered to be very secure, with an estimated brute force search time of 4.7 × 10^{38} years on a single 64-bit processor. It has been widely adopted by governments and businesses worldwide, including the U.S. Department of Defense, for use in their computer systems, and is considered to be one of the most secure encryption algorithms currently in use.
## Usage
The AES-192 standard was included in NIST Special Publication 800-38, *Advanced Encryption Standard* (AES), which was adopted by the U.S. National Institute of Standards and Technology (NIST) on October 2, 2003. AES-192 is used to encrypt sensitive data in many different applications. One such application is SSH, where it is used for encrypted connections between computers.
## Comparison to other ciphers
AES-192 is considered secure enough that it may be used as a replacement for the older Data Encryption Standard (DES) in all situations except where a higher level of security is required, such as military and government applications. However, AES-256 has largely supplanted AES-192, owing to its 256-bit key size and the fact that it is faster on most processors than AES-192. AES-256 also provides better resistance to attacks with side channel information, such as timing or power analysis.
In terms of speed, AES-192 is slower than its 128-bit and 256-bit counterparts due to the larger key size. It is significantly faster than DES on modern processors, however. The exact time depends on many factors such as processor architecture, clock speed, cache size, etc. On a typical x86 processor running at 3 GHz, AES-192 can encrypt 5 million blocks per second in software and over 75 million blocks per second in hardware, while DES can only manage 30 million blocks per second in hardware (using the DES II algorithm).
## Algorithmic details
### Key schedule
The AES-192 key is divided into four parts called *round keys*, each of 48 bits, with each part corresponding to a different round of the algorithm. The key derivation function used for generating the round keys is the **AES Key Derivation Function** (KDF), which is based on a modified version of the Feistel network.
The key derivation process consists of four steps:
1. **Initializeization**: Four 48-bit variables called *L0*, *L1*, *R0*, and *R1* are initialized with the first four bytes of the key in hexadecimal form (the least significant bits are assumed to be all zero).
2. **First permutation**: The values of *L0* and *R0* are combined into a single 96-bit value using the Feistel function, and this value is used as input for the second step.
3. **Second permutation**: The resulting 96-bit value is combined with *L1* and *R1* into a 144-bit value using the Feistel function. This value is then divided into two 72-bit halves, which are used as input for the third step.
4. **Third permutation**: The two 72-bit halves are combined using the Feistel function to produce a 144-bit value. This value is then divided into four 36-bit halves, which are used as the round keys for AES. The first and last keys are stored unchanged in memory; the second key is used twice; and the third key is used three times.
The KDF algorithm described above can be implemented using a simple loop, which applies the Feistel function repeatedly until the entire key has been processed. The total number of iterations required is equal to the number of bytes in the key divided by 8 (i.e., 128/8=16 for AES-192).
### Encryption and decryption
The algorithm consists of 10 rounds, each of which consists of several substitution and permutation operations on the data block. Each round key is used only once, and a new key is generated for each subsequent round. The first and last keys are stored unchanged in memory; the second key is used twice; and the third key is used three times.
The algorithm uses 128-bit blocks and works on 16-byte (128-bit) data blocks. The algorithm can be divided into two parts: the *substitution network* and the *permutation network*. Each part consists of several rounds, with each round consisting of a series of substitution and permutation operations.
#### Substitution network
The first step in the encryption process is to apply the substitution network to the data block. The substitution network consists of 10 rounds, each of which applies one of 16 different substitution functions (also called *S-boxes*) to each element of the data block. Each S-box is a 4 × 4 matrix, and each row or column is obtained by applying a simple linear transformation to the input elements.
The following table shows all 16 possible S-boxes that can be used in the AES algorithm:
| Round | S-Box |
| 1 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 1 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 2 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 2 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 3 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 3 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 4 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 4 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 5 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 5 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 6 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 6 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 7 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 7 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 8 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 8 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 9 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 9 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 10 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
#### Permutation network
The second step in the encryption process is to apply the permutation network to the data block. The permutation network consists of 10 rounds, each of which applies one of two different permutation functions (also called *P-boxes*) to the data block. Each P-box is a 4 × 4 matrix, and each row or column is obtained by applying a simple linear transformation to the input elements.
The following table shows all 16 possible P-boxes that can be used in the AES algorithm:
| Round | P-Box |
| 1 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 1 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 2 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 2 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 3 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 3 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 4 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 4 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 5 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 5 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 6 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 6 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 7 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 7 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 8 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 8 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 9 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
| 9 | 15 14 | 13 12 | 11 10 | 9 8 | 7 6 | 5 4 | 3 2 | 1 0 |
| 10 | 0 1 | 2 3 | 4 5 | 6 7 | 8 9 | 10 11 | 12 13 | 14 15 |
## Security
AES is considered one of the most secure symmetric encryption algorithms available in the AES Block Cipher Standard (FIPS 140-2). It has a security level of 128 bits, 192 bits and 256 bits. The NIST recommends that its use of 128-bit keys be restricted to confidential data only, while the use of 192- and 256-bit keys are recommended for applications that require additional security.
On June 7, 2007, a team of cryptographers announced that they had successfully broken a 128-bit AES key using an algorithm known as the "Brute Force Method", in which an attacker systematically tries all possible keys until the correct one is found. The team, led by Vincent Rijmen, announced that it was able to find the correct key after trying about 10^{35} possibilities within a reasonable amount of time.
In July 2008, the cryptography community had successfully demonstrated an attack on a 192-bit AES key using the "Daniel J. Bernstein's Linear Algebra Method". The attack involves analyzing the linear equations that are used to encrypt and decrypt messages with AES, in order to determine the correct key.
In July 2009, cryptographers announced that they had succeeded in cracking a 256-bit AES key using an algorithm known as "Side Channel Analysis" (SCA). The attack involves measuring certain physical properties of a chip containing an AES processor, such as power consumption or electromagnetic radiation, to infer information about the key being used.
In November 2019, it was reported that Google had successfully broken a 48-core ARM Cortex-A57 AES processor using the side-channel attack by exploiting the microarchitectural vulnerability in the processor's design. The vulnerability allowed the attackers to infer information about the key being used with high accuracy even when only a small portion of the power consumed by the processor was measured.
In 2012, the NIST announced that it was planning to publish a new standard for post-quantum cryptography. In September 2017, the NIST published a draft document on post-quantum cryptography. The document includes 7 candidates for post-quantum symmetric encryption: AES-GCM-SIV, CRYSTAL-Kyber, Lattice-Based Cryptosystems (such as SIDH, NTRU), McEliece, Hash-Based Message Authentication Code (HMAC) with SHA-256, HMAC with SHA-384, and HMAC with SHA-512. In 2018, the NIST announced that it had selected AES-GCM-SIV as a post-quantum symmetric encryption algorithm to be included in NIST Special Publication 800-71 Part 3 (Revision 4). The NIST also selected HMAC with SHA-256 as a post-quantum hash-based message authentication code algorithm for inclusion in the same publication.
In July 2020, Google announced its plans to transition to using the AES-GCM-SIV cipher suite for its secure communication protocols.
7/28/2015 - 2:05 PM EDT
"The World Today" is the official podcast of Voice of America and delivers breaking news, analysis and commentary from across the globe. It's your host, Steve King.
Today, we're covering the latest developments in Syria, Russia's military presence in Ukraine, and the United Nations' efforts to negotiate a peace deal in Yemen.
Syria:
The Syrian Civil War continues to rage on with fighting between government forces and opposition groups intensifying in recent weeks. On Sunday, pro-government forces launched an attack on the rebel stronghold of Jisr al-Shughur in Idlib province. The attack left dozens of civilians dead and hundreds injured, according to opposition activists. Meanwhile, the United States and its allies continue to provide military aid to opposition groups.
Russia's Military Presence in Ukraine:
The conflict between Russia and Ukraine continues to escalate with Russian troops massing along the border with Ukraine. On Monday, Ukrainian defense officials reported that Russian troops had crossed into Ukrainian territory near the city of Donetsk. The move comes after a series of ceasefire violations by pro-Russian separatists in eastern Ukraine. Russia has denied any involvement in the conflict and calls for a peaceful resolution.
UN Efforts to Negotiate a Peace Deal in Yemen:
The United Nations is continuing its efforts to negotiate a peace deal in Yemen, which has been engulfed in civil war since 2015. On Monday, UN Secretary-General Ban Ki-moon met with Yemeni leaders to discuss the latest developments in the conflict. The talks have yet to yield any concrete results and violence continues to plague the country, with both sides accusing the other of human rights abuses.
That's "The World Today" for now. Join us again tomorrow for more news from around the world.
# Getting started with Docker
## What is Docker?
Docker is a containerization platform for automating the deployment, scaling and management of applications. It provides an easy way to package an application and its dependencies into a container that can be run on any machine that has Docker installed. Containers are isolated from each other and the host system, making it easy to deploy multiple applications on the same machine without worrying about conflicts.
## Installing Docker
Docker can be installed on a variety of operating systems, including Windows, Linux and macOS. The installation process varies depending on your operating system, but you can find detailed instructions on the [Docker website](https://docs.docker.com/get-docker/).
## Running a Docker container
Once Docker is installed, you can run a container by pulling an image from a registry (such as Docker Hub) and running it using the `docker run` command. For example:
```css
$ docker pull nginx
$ docker run -p 80:80 nginx
```
This will pull the latest version of the nginx image from Docker Hub, and start a new container running on port 80. You can then access the nginx web server by visiting `http://localhost` in your browser.
## Building a Docker image
You can also build your own Docker images by creating a `Dockerfile` that specifies the instructions for building the image. For example, here's a simple `Dockerfile` that builds an image based on the latest version of Ubuntu and installs the Apache web server:
```bash
# Use an official Ubuntu image as the base image
FROM ubuntu:latest
# Update the package list and install Apache
RUN apt-get update && apt-get install -y apache2
# Expose port 80 for Apache to listen on
EXPOSE 80
# Start Apache when the container starts
CMD ["apache2", "-D", "FOREVER"]
```
To build an image from a `Dockerfile`, you can use the `docker build` command. For example:
```
$ docker build -t my-apache .
```
This will build an image called `my-apache` based on the instructions in the current directory (`.`). You can then run a container from this image using the `docker run` command, as shown earlier.
(813) 654-2709
# What is the remainder when 831 is divided by 4?
## Answer (0)
To find the remainder when a number is divided by another, you can use the formula: Remainder = dividend - (dividend/divisor)*divisor. In this case, dividend=831 and divisor=4. So,
Remainder = 831 - (831/4)*4
Remainder = 75
So, when 831 is divided by 4, the remainder is 75.
00:04:35.160 - 00:08:40.079
[INFO] [2021-06-22 18:15:35.16] [1793] [11586] - [1793] [11586] - [1793] [11586] - [1793] [11586]
# ------------------------- START TEST -------------------------
python -m pytest /path/to/your/pytest/file.py
```
Here's an example of how to use pytest to test a Python script:
1. Open your terminal or command prompt.
2. Navigate to the directory where your Python script is located using `cd`.
3. Run `pip install pytest` to install the pytest package if it hasn't already been installed.
4. Create a file named `conftest.py` in the same directory as your Python script with the following contents:
```python
import os
def add_logs(config, log_file='results.log'):
log_dir = os.path.join('logs', config['test_env']['name'])
if not os.path.exists(log_dir):
os.makedirs(log_dir)
with open(os.path.join(log_dir, log_file), 'a') as f:
f.write('------------------------- START TEST -------------------------
')
f.write(f'{config["test_env"]["name"]} - {config["test_env"]["version"]}
')
f.write('------------------------- END TEST -------------------------
')
```
5. Open your Python script and add the following imports:
```python
import pytest
from config import *
```
6. Add a test function to your script with the `@pytest.mark.test` decorator:
```python
def test_my_function():
assert my_function(1, 2) == 3
```
7. Save and run the test using `pytest`. The output should include the logs you specified in `conftest.py`:
```yaml
============================= test session starts ==============================
collected 1 item
test_my_function.py .. [100%]
============================== 1 passed in 0.01s ===============================
------------------------- END TEST -------------------------
```
8. You can run the test again using `pytest` to see if any changes were made:
```yaml
============================= test session starts ==============================
collected 1 item
test_my_function.py .. [100%]
============================== 1 passed in 0.02s ===============================
------------------------- END TEST -------------------------
```
That's it! You have now used pytest to test your Python script and log the results.
Notes by anna | export