OpenLLM-France/wikimedia huggingface dataset:
# AI Art Generation Handbook/Archive/Settings

This is another examples of generating realistic human figures :

### Correlations between settings

The picture shows the correlations between CFG and Sampling Steps.
It is note worthy to look that steps that are too low and with high CFG values will almost caused the images to become distorted.
The CFG that are too low will make the picture appeared washed out.

## References

https://www.felixsanz.dev/articles/complete-guide-to-samplers-in-stable-diffusion#what-is-the-best-sampler-in-stable-diffusion
# AI Art Generation Handbook/ControlNet/Canny

Canny in this context meant Canny Edge Detection algorithm which is kind of popular edge detection used in computer vision.
To use Canny mode , you need to ensure you have downloaded Canny models from here https://huggingface.co/lllyasviel/sd_control_collection/tree/main and search for the following Canny pre-trained ControlNet models .
| ControlNet Canny Pre-processed Model | GPU VRAM Recommendation |
| diffusers_xl_canny_full.safetensors | X > 12GB VRAM |
| diffusers_xl_canny_mid.safetensors | 8GB VRAM >X > 12 GB VRAM |
| diffusers_xl_canny_small.safetensors | X < 8GB VRAM |
Workflow:
First of all, we need to have a base image to work with. Such as picture of this geisha playing shamisen.
Then , you can think of a similar picture such as a rockstar playing guitar.
We shall use prompt : "Photo of a rockstar playing heavy metal music with electric guitar, kneeling on the stage"
Each of the effect are displayed below
Note: All of the settings are the same as per default unless mentioned otherwise .

### Control Weight

Control Weight controls the amount of influence that the reference image has on the generated image. A higher Control Weight will result in a more similar image, while a lower Control Weight will result in a more original image.
| Control Weight | 1.0 | 0.8 | 0.6 | 0.4 | 0.2 |
| Generated ControlNet Images | | | | | |

### Preprocessing Resolution

Pre-Processing Resolution setting in Stable Diffusion ControlNet controls the resolution of the image that is used to train the model. A higher Pre-Processing Resolution will make the model more accurate, but it will also require more computation. Note: If you are using a reference image with a lot of detail, you may need to use a higher Pre-Processing Resolution to capture all of the detail in the generated image. If you are limited by computation, you should use a lower Pre-Processing Resolution.
| Preprocessing Resolution | 300 | 600 | 900 | 1200 |
| Generated ControlNet Images | | | | |
| | 1200 | 1500 | 1800 | 2048 |
| Generated ControlNet Images | | | | |
# AI Art Generation Handbook/ControlNet/Pose

OpenPose in ControlNet was introduced in the paper "Adding Conditional Control to Text-to-Image Diffusion Models" by Standford researchers: Lvmin Zhang and Maneesh Agrawala, published in 2023.
It uses human pose estimation (detects key points on the human body [ joints, face landmarks] ) as a conditioning input for image generation models. It allows users to control the pose and positioning of human figures in generated images by providing a skeleton-like representation of the desired pose.
This concept is not entirely new as this is based from earlier works by researchers at Carnegie Mellon University in the paper "OpenPose: Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields"
# Actually Applicable Application Problems and Brainteasers/Fuel Efficiency
## Overview

This method can be used to calculate your car's fuel consumption in miles per gallon, often called MPG. Depending on the type of car, most cars' MPG value will be in or near the 20-40 range. If you are planning a trip, splitting the cost of gas with a carpool group, or looking out for drastic reductions in your car's MPG that may be a sign of an engine problem, this strategy is Actually Applicable for you.

## General Method

* Fill your car's gas tank and reset the tripmeter.
** It does need to be a true fill-up, for comparison purposes later.
* Drive normally for a while.
* Next time you get gas, notice on the pump or receipt how many gallons it took to fill up again, and how many miles are on your tripmeter.
** Like the other, this also needs to be a true fill-up.
* Divide the miles on the tripmeter by the gallons of gas you purchased. This is your car's fuel consumption in MPG.

## Problems

Someone drives 337.4 miles on 14.357 gallons of gas. How many MPG did they get?

### Make Your Own Problem

Calculate the MPG of your car (or a family member's or friend's car).

### Extension

A car's MPG can vary depending on how it is driven, fuel quality, etc. How could you calculate a point estimate and interval estimate for a car's average MPG?
# Actually Applicable Application Problems and Brainteasers/Linear Systems, Underdetermined by One Constraint
## Overview

We find it convenient for systems with three variables to have three equations or inequalities, of four variables to have four, and so on, because this gives us unique solutions. However, sometimes situations are more flexible. These situations are called "underdetermined" and this method is a way of dealing with that.
If the constraints are based on a real situation, this is as Actually Applicable as any other strategy in the linear systems/linear programming family.

## General Method

* As you would usually do, set up an equation or inequality for each constraint, put their coefficients and constants into an augmented matrix, and apply RREF to that augmented coefficient matrix.
** Unlike the ideal situation, this RREF will probably have two columns that do not resemble an identity matrix. The second is the constants for the right hand side of the equation, as usual, but the first is the (probably mostly nonzero) coefficients that apply to your "free variable."
* Extract equations from the rows of the RREF matrix.
* Assign any value that makes sense to your free variable (this is why it is called free), and use the equations you extracted in the previous step to determine the values of the other variables.
** If you assign the value 0, the other variables' values can be read directly from the constants column as usual.
** You may need to try more than one value depending on the problem.
** If there are a finite number of possible values for the free variable, you can try each and give all possible solutions.
** A spreadsheet can be helpful for evaluating the other variables' values, especially if there are many options you want to try for your free variable.

## Problems
### Zoo Animals

A zoo wants to buy a total of 11 animals. Their options are elephants, giraffes, and rhinos. Each elephant eats 200kg food per day, each giraffe eats 75kg, and each rhino eats 50kg. The zoo's budget can provide 950kg of food per day to these animals. How many of each type should the zoo buy?
This problem was found in the wild on Facebook. Its original source is unknown.
In the interest of honesty I'll admit that this particular problem is a bit of a brainteaser, since it seems improbable that elephants, giraffes, and rhinos would eat the exact same foods in the same proportions, such that the zoo's budget for them could be accurately expressed in terms of total weight of the food rather than in money. If anyone can point me toward the needed information I'd be happy to develop a better problem of this kind!

### Make Your Own Problem

For a situation, write down some options you need to choose between, and count them.
Find one less linear relationship between those options than the number of options.
Apply this method and make a decision.
# Active Server Pages/Your first page
## Objectives

* Embed ASP scripting code into a web page.
* Upload your ASP page to a server.
* Test your page by viewing it in a web browser.

## Content

ASP is delimited with "<%" and "%>"
within these delimiters is your custom code that is executed in the server.
Here is a small fragment of an ASP code (it outputs "My First ASP" on your browser):
Or you could put the text into a pre-defined variable:
Here is a way to separate your code from your page layout.
# Actually Applicable Application Problems and Brainteasers/Compound Interest
## Overview

Compound interest is used to calculate how a savings account or a debt will grow over time due to interest payments/charges, in the absence of other deposits, payments, fees, etc. This is a very Actually Applicable type of problem because you can use it to explore some ways of getting things you want or need.

## General Method

The formula for compound interest is A=P(1+r/n)^(nt), where those variables mean:
* I: interest
* P: Principal
* r: rate (usually APR, "annual percentage rate")
* t: time (usually in years)
* n: number of compounding periods per year

## Problems
### Forgotten Savings Account

If you deposit $800 in a savings account at 5% with quarterly compounding, then forget to check on it until you receive a letter from that bank 10 years later, how much money will be in that account at that time?

### Goal: Amount of Interest

If you have $200 and would like it to earn $100 in interest (that is, grow to $300), how long will it take to do so in a savings account at 2% with monthly compounding?

### Effective APR

What APR with annual compounding corresponds to a 3% APR with daily compounding? (Hint: it will be more than 3% because compounding makes money grow more quickly. Try plugging in a $100 principal.)

### Make Your Own Problem

Open a savings account and ask what the account's APR and compounding frequency are. Deposit some money in it and calculate how much money will be in the account in 5 years if you don't add any more money to it.
Pick something you would like to buy and find out how long it would take to buy it with whatever you can deposit into a savings account now and that savings account's compounding period and interest rate.
# Actually Applicable Application Problems and Brainteasers/Materials for Projects: Yarn for Flat Projects
## Overview

Knowing how much yarn is needed to complete a project is important if you are making something for your own use or as a gift, to make sure you buy enough yarn, and if you are making the items to sell, to make sure you are charging enough considering the cost of materials.

## General Method

* Make a swatch.
** Usually this will be rectangular but it can vary depending on the project.
* Use a high-enough precision scale to weigh the swatch.
* Calculate the swatch's area.
* Divide the swatch's weight by its area to find the weight of yarn needed to make each square inch.
* Multiply the weight of yarn per square inch by the number of square inches in the project to find the total weight of yarn needed for the project.
* If necessary, do a unit conversion to get the amount of yarn into a convenient unit.

## Problems

How much yarn would you need to make a scarf 10 inches wide and 4 feet long?

### Make Your Own Problem

Pick a project you would like to make, and figure out how much yarn you need for it.
# Actually Applicable Application Problems and Brainteasers/Circle Skirt
## Overview

Circle skirts are a popular fashion item, so for anyone who likes to make their own clothing designs, this type of math is definitely Actually Applicable.
The method described below is for a pull-on circle skirt cut from a single piece of fabric. Depending on your measurements, how long a skirt you want to make, and what fabric you have available, you might need to make and stitch together pieces of fabric that are actually half, a quarter, or etc., of the skirt. If you do that, please remember to leave seam allowances.

## General Method

* Use a tape measure to measure the waist and hips of the person the skirt is meant for.
* You can use either inches or centimeters, or something else, as long as you are consistent.
** If you don't have a tape measure, use a string, then use a yardstick or ruler to measure the string.
** Cut a piece of elastic the length of your waist measurement. Sew its ends together without twisting it between and try the elastic on. If the elastic is fairly stretchy, you might need to shorten it by a few inches.
* Divide the hip measurement by 6.28. This is the hip radius.
* Subtract half an inch or one centimeter, or whatever you prefer, for a seam allowance.
** Usually seam allowances are added but this time subtracting will make the fabric reach up higher. You'll see!
* Draw a quarter-circle centered on the corner of a big piece of paper, with the radius you just calculated.
** I like to use the back of wrapping paper.
** If you don't have a drawing compass big enough, you can use a piece of string.
* Add the length you want the skirt to turn out, plus whatever hem allowance you prefer, to the radius of the quarter-circle you just drew. This is the hem radius.
* Draw a quarter-circle with the radius you just calculated centered at the corner.
* Cut out the pattern.
* Fold the fabric once horizontally and once vertically (so that it is in four layers), line the pattern up so that it is centered at the corner where the fabric's two folds cross. Adjust the fabric if necessary to make sure the pattern has four layers of fabric under it all over.
* Cut out the skirt, sew on the elastic, and sew up its hem.

### Variations

If you will be adding a zipper instead of using elastic, use the waist measurement for the inner circle instead of the hip measurement.

## Problems

Suppose you are a fashion designer and sketch patterns for these clients' orders. They don't have to be full-size, but do make sure you have all the needed numbers.
* A client with a 34" waist and 40" hips wants a 20" skirt with a zipper.
* A client with a 37" waist and 46" hips wants a 24" skirt with elastic.

### Make Your Own Problem

Measure yourself or a family member, friend, stuffed animal, etc., and do the calculations to make an actual circle skirt. As an extension to the problem you can visit a fabric store, choose fabric you like, decide if actually making that skirt is in your budget, and if you wish, actually make it.
# Active Server Pages/Protecting against user-input (XSS attacks)

To protect your users from Cross-site scripting (XSS) and similar attacks, you should escape both URLs and user-submitted text. In ASP this is done with two functions Server.HTMLEncode, and Server.URLEncode.

## Server.HTMLEncode

Don't ever output non-escaped user data:
Instead do the following:
This method should also be used for all data that comes from SQL. Better safe than sorry.

## Server.URLEncode

To encode URLs that you insert into the href attribute of A tags, use the Server.URLEncode function, like this:
# Advanced Structural Analysis/Part I - Theory/Failure Modes

* Introduction
* Fatigue
* Plastic Failure
* Brittle Failure
* Creep
* Tribological Mechanisms
* Corrosion
* Deflection
* Vibration
etc.

# Introduction

We define Failure Mode as a possible condition where an engineering structure fails to operate as intended. This includes different forms of material failure, excessive vibrations and deformations.
The covered failure modes are discussed in great detail. Related mechanisms, analysis methods, failure criteria, environmental influences, material aspects etc. are covered extensively.
# Advanced Structural Analysis/Part II - Application

This part of the book illustrates how the theoretical background described in Part I can be implemented in practice.
* Rigid Body Mechanics
* Linear Static Analysis
* Linear Static Bifurcation Analysis
* Geometrically Nonlinear Elastic Static Analysis
* Materially Nonlinear Static Analysis
* Geometrically and Materially Nonlinear Static Analysis
* Geometrically Nonlinear Elastic Static Analysis with Imperfections Included
* Geometrically and Materially Nonlinear Static Analysis with imperfections Included
* General Dynamic Analysis
* Thermal Analysis
# Advanced Structural Analysis/Part I - Theory/Failure Modes/Fatigue

* Introduction
* Nomenclature
* Elementary Definitions
* Crack Initiation
* Crack Growth
* Final Failure
* Special Members

# Introduction

Material fatigue is the most common form of material failure in metal structures. The phenomenon is characterized by cumulative material damage due to repeated loading and may occur at stress levels far below yield stress.
The picture to the right shows a bicycle pedal arm that has undergone a complete failure due to fatigue. Here the damage was initiated at the bottom of the failure surface, and progressed upwards leaving a characteristic "wavy" pattern behind as it worked its way through the material of the increasingly weakened structural element. Eventually, the pedal arm became impaired to the point where it could no longer sustain the applied load, and therefore ruptured in what appears to have been a brittle failure.
Metal fatigue progress in three subsequent main stages:
* initiation
* crack growth
* final failure
The fatigue life of initially crack-free parts is commonly dominated by the initiation period. During this stage, the damage is small and the mechanical strength is approximately unperturbed. Sufficiently harsh conditions will take the advancement into the crack growth phase. Here, present micro-cracks break through the boundaries between the grains of the material and become macro-cracks. Final failure occurs if the macro-cracks grow large enough to eliminate the component's capacity to sustain applied loads.
Welded joints are particularly susceptible to fatigue. This is due to several facts, and one of them is the that welds have significant initial cracks. The discussion of fatigue in welds is dedicated a major separate section.
# Advanced Structural Analysis/Part II - Application/Rigid Body Mechanics

* Statics
* Dynamics
# Advanced Structural Analysis/Part I - Theory/Continuum Mechanics

* Introduction
* Kinematics
* Stress Measures
* Laws of Conservation
* Constitutive Equations

# Introduction

* Introduce the separate parts of the theory and how they fit together.
# Advanced Structural Analysis/Part I - Theory/Failure Modes/Fatigue/Crack Initiation

* Introduction
* Fundamentals
* The Wöhler Curve
* The Similarity Principle
* Loading
* Additional Influences

# Introduction

The crack initiation phase normally spans the majority of the considered life-cycle in non-welded parts. In fact, it is common practice in many applications to approximate the total fatigue life by the duration of the crack initiation period.
The initiation process is bound to the material surface, and is regarded as ended when subsequent fatigue damage no longer depends on the surface conditions.
# Advanced Structural Analysis/Part I - Theory/Failure Modes/Fatigue/Crack Initiation/Additional Influences
## Residual stress

An engineering structure may contain internal stress components that are independent of external loads and body loads. Such internal stresses are commonly called Residual Stresses and may be substantial in magnitude.
As was established in the section Influence of Mean Stress", a perturbation of the mean stress may have a significant positive or negative impact on the fatigue life. Residual stresses are in effect perturbations of mean stress, when cyclic loading is present. Thus, predictions of the fatigue life can be thrown off by the residual stresses, which do not relate to the external loads.
The following are sources of residual stress:
* Pre-tensioned design elements such as bolts
* Inhomogeneous plastic deformation
* Thermal effects

## Surface Treatments

* Roughness
* Residual stress

## Fretting Corrosion

Fretting corrosion is the combined effect on fatigue life caused by fretting and corrosion. The mechanism is a surface effect and can have a detrimental impact on the crack initiation period, and consequently the high-cycle fatigue life. However, it has little or no effect on crack growth and consequently plays only a small role in low-cycle fatigue.
Note that fretting corrosion may reduce the fatigue limit, $\sigma _{f}$.
Fretting occurs when two surfaces are rubbing against each other during cyclic loading. Fretting corrosion can be significant even when rubbing displacements are very small, -displacements in the order of the elastic deformation of the rubbing parts can have a dramatic effect on the fatigue life. Corrosion has an important role even in normal air.
The effects of fretting corrosion can be reduced or even avoided by:
* Separating surfaces where fretting would otherwise occur
* Making sure the fretting zone is not also a stress concentration
* Lubrication

## Corrosion

Corrosion may reduce the fatigue life and fatigue limit significantly. The presence of liquids such as salt-water magnifies the effect and should be avoided if at all possible.
# Motivation

Advanced Structural Analysis has tremendous potential value to organizations world-wide that depend on reliable and effective structural analysis. One particularly advantageous feature of the material is the fact that it may not be copyrighted. Thus, everyone is free and welcome to copy and edit any segment, and implement it in any context. Consequently, ASA makes it possible to assemble extensive structural analysis directives and handbooks with minimal effort and cost.
Participating in the project will strengthen your competence indeed. But it can also help you verify your skills as you may receive expert feedback on your work.