OpenLLM-France/wikimedia huggingface dataset:
# Actually Applicable Application Problems and Brainteasers/Wheelchair Ramp Standards 2
## Overview

As mentioned in the original Wheelchair Ramp Standards problem listing, measuring the rise and run of real world ramps can be difficult. This is an example of a way around that issue, by using a protractor and the trigonometric tangent function. I'm not saying it's the best way, and it's definitely not the only way, but it's something I've come up with.
This diagram illustrates the geometric relationships involved.

## General Method
### Part 1: Building the tool
#### Materials

* Bubble level
* Protractor with arm that swings around (used on paper for lining something up with the angle's edge)
* Something to attach them with (for example: rubber bands, glue, string, epoxy, etc.)

#### Recommended procedure

* Make sure the protractor's arm is straight up. It must be very straight or the tool will not measure accurately.
** You may want to use a plumbline (a string with some kind of weight on the end) to check this.
* Put the bubble level across the arm's end, laying down.
* Adjust it until it is perfectly level (which should be perfectly perpendicular to the protractor's arm).
* Attach it in place.
** Make sure it will stay attached without shifting or you will have to re-do building the tool to calibrate it every time you use it.

### Part 2: Measuring ramps

* Put the protractor's back down against the ramp.
* Swing the protractor's arm until the bubble level shows that it is level.
* Read the protractor's angle by looking at where the swingable arm meets the curve.
* Take the complement of the protractor's angle (that is, subtract the protractor's angle from 90°). This is the ramp's angle.
* Take the tangent of the ramp's angle (that is, find the ratio of opposite to hypotenuse which corresponds to the ramp's angle).
** One way to calculate tangent is to divide sine by cosine.
* As you can see form the diagram above, the opposite side of the triangle is the rise and the adjacent side of the triangle is the run, so the tangent ratio is the slope of the ramp. You can compare it with the standard, ${\frac {1}{12}}=0.08{\overline {3}}$, to determine whether the ramp meets the accessibility standard.

## Problems

Is a ramp with an angle of 1° accessible?
Is a ramp with an angle of 45° accessible?
Is a ramp with an angle of 10° accessible?
Is a ramp with an angle of 5° accessible?

### Work Backwards

You can cut out steps 4 through 6 by figuring up once and for all what range of angle readings from step 3 will give an accessible result.

### Make Your Own Problem

Use this tool and method to determine whether ramps and other sloped surfaces in your community meet the accessibility standard.
# Ad Hoc Data Analysis From The Unix Command Line/Counting Part 1 - grep and wc

    "90% of data analysis is counting" - John Rauser
...well, at least once you've figured out the right question to ask, which is, perhaps, the other 90%.

## Example - Counting the size of a population

The simplest command for counting things is wc, which stands for word count. By default, wc prints the number of lines, words, and characters in a file.
Nearly always we just want to count the number of lines (records), which can be done by giving the -l option to wc.

## Example - Using grep to select a subset

So, recalling that this is a 1% sample, there were 8.5 million people in Washington as of the 2000 census? Nope, the census data has two kinds of records, one for households and one for persons. The first character of a record, an H or P, indicates which kind of record it is. We can grep for and count just person records like this:
The caret '^' means that the 'P' must occur at the beginning of the line. So there were about 5.9 million people in Washington State in 2000. Also interesting, the average household had 59,150/(85,025-59,150) = 2.3 people.
← Standard Input, Standard Output, Redirection and Pipes · Picking The Data Apart With cut →
# Ad Hoc Data Analysis From The Unix Command Line/Preliminaries
## Formatting

These typesetting conventions will be used when presenting example interactions at the command line:
The "$ " is the shell prompt. What you type is shown in boldface; command output is in regular type.

## Example data

I will use the following sample files in the examples.

### The Unix password file

The password file can be found in /etc/passwd. Every user on the system has one line (record) in the file. Each record has seven fields separated by colon (':') characters. The fields are username, encrypted password, userid, default group, gecos, home directory and default shell. We can look at the first few lines with the head command, which prints just the first few lines of a file. Correspondingly, the tail command prints just the last few lines.

### Census data

The US Census releases Public Use Microdata Samples (PUMS) on its website. We will use the 1% sample of Washington state's data, the file pums_53.dat, which can be downloaded here
Important note: The format of this data file is described in an excel spreadsheet that can be downloaded here.

## Developer efficiency vs. computer efficiency

The techniques discussed here are usually extremely efficient in terms of developer time, but generally less efficient in terms of compute resources (CPU, I/O, memory). This kind of brute force and ignorance may be inelegant, but when you don't yet understand the scope of your problem, it is usually best to spend 30 seconds writing a program that will run for 3 hours than vice versa.

## The online manual

The "man" command displays information about a given command (colloquially referred to as the command's "man page"). The online man pages are an extremely valuable resource; if you do any serious work with the commands presented here, you'll eventually read all their man pages top to bottom. In Unix literature the man page for a command (or function, or file) is typically referred to as command(n). The number "n" specifies a section of the manual to disambiguate entries which exist in multiple sections. So, passwd(1) is the man page for the passwd command, and passwd(5) is the man page for the passwd file. On a Linux system you ask for a certain section of the manual by giving the section number as the first argument as in "man 5 passwd". Here's what the man command has to say about itself:
Standard Input, Standard Output, Redirection and Pipes →
# Ad Hoc Data Analysis From The Unix Command Line

Once upon a time, I was working with a colleague who needed to do some quick data analysis to get a handle on the scope of a problem. He was considering importing the data into a database or writing a program to parse and summarize that data. Either of these options would have taken hours at least, and possibly days. I wrote this on his whiteboard:
    Your friends: cat, find, grep, wc, cut, sort, uniq
These simple commands can be combined to quickly answer the kinds of questions for which most people would turn to a database, if only the data were already in a database. You can quickly (often in seconds) form and test hypotheses about virtually any record oriented data source.

## Intended audience

You've logged into a Unix box of some flavor and run some basic commands like ls and cd and cat. If you don't know what the ls command does, you need a more basic introduction to Unix than I'm going to give here.

## Table of Contents

* Preliminaries
* Standard Input, Standard Output, Redirection and Pipes
* Counting Part 1 - grep and wc
* Picking The Data Apart With cut
* Joining The Data Together With join
* Counting Part 2 - sort and uniq
* Rewriting The Data With Inline perl
* Quick Plotting With gnuplot
* Appendices
# Ad Hoc Data Analysis From The Unix Command Line/Appendices
## Appendix A: pcalc source code

A perl read-eval-print loop. This makes a very handy calculator on the command line. Example usage:
Source:

## Appendix B: Random unfinished ideas

Ideas too good to delete, but that aren't fleshed out.

### Micro shell scripts from the command line

Example - which .so has the object I want?

### James' xargs trick

James uses echo with xargs and feeds one xargs' output into another xargs in clever ways to build up complex command lines.

### Example - Finding duplicate keys in two files

← Quick Plotting With gnuplot
# Brlcad/How to mged/command/nirt

The nirt command is used to launch the nirt utility which produces a list of intersection points between the viewpoint ray and the displayed objects.
# Brlcad/How to mged/command/rset

The rset developer command can be used to configure resources.
# Brlcad/How to mged/command/vrmgr

The vrmgr command establishes a link between the current mged display and a vrmgr process running on a remote host. The vrmgr process must be started on the remote host prior to executing the vrmgr command in mged.

### Modes

* master mode
* slave mode
* overview mode
# Brlcad/How to mged/command/make

The make command can be used to create a shape with default dimensions:
# Brlcad/How to mged/command/mater

The mater command is used to set the material properties for a previously defined region. This includes parameters, such as the material shader, the shader properties, the rgb colour values and any inheritance properties of the materials.

### Setting the material shader properties

The shader properties that can be configured depends on the type of material shader being utilized. The following example shows how to set the transparency, reflectiveness, and shininess properties for a plastic material.
Note that the shader and shader properties are passed as a single parameter enclosed in quotation marks. The quotation marks are necessary for grouping parameters separated by spaces.
# Brlcad/How to mged/command/quit

The quit command or q command causes the mged interpreter to exit:
# Brlcad/How to mged/command/rt

The rt command executes the raytracer program.
# Brlcad/How to mged/command/oed

The oed command is used to put mged into object editing mode.
# Brlcad/How to mged/command/r
### Creating a region from a list of shapes

The r command is used to create a region from a list of shapes. Note that the shapes must have been created in the database for the operations to work:
# Brlcad/How to mged/command/ls

The ls command is used to list all the shapes in the database:
# Animal Care/Cockatoo

Cockatoo care
* Many avian veterinarians suggest that parrots should be fed a pelleted diet, supplemented by fresh food and a small quantity of seeds as snacks.
* They should have fresh, clean water at all times.
* Their cages should be lined with papers that are replaced regularly.
* Parrots enjoy regular time outside of their cages interacting with owners, and as they are intelligent, they need plenty of toys to keep them busy. A good rule of thumb is, "A busy bird is a happy bird!"
* When you bring home your first parrot, be sure to find an avian veterinarian—one who specialises in birds—to bring your new friend to. It is important to schedule a well-bird exam to ensure that your cockatoo in good health.
* Any future birds you bring home should spend approximately 45 days in quarantine from the bird(s) already in your home. This is to prevent the spread of disease.
* Do not cage incompatible types of birds together. For example Cockatiels are so docile that they can easily be hurt by other, more aggressive birds—even smaller ones, like budgerigars and parrotlets.
* Many veterinarians recommend that prospective bird-owners seek out a breeder, for breeders' birds are likely to be healthy (as they are not "factory-farmed") and friendly (as they are typically hand-fed and well-socialized).

## Some warnings

* Never give a pet parrot chocolate, caffeinated beverages, alcohol, avocado, or rhubarb.
* Avoid using PFTEs (often referred to by the brand name of Teflon) around all pet birds. When PFTEs/ Teflons get very hot, they emit particulates into the air. Birds are more sensitive to particulates than humans are, and they can die suddenly when exposed to PFTE. PFTEs are found in cookware, hair dryers, irons, printers, and more—check all labels before using electric products near your birds.
* Also avoid using candles, air fresheners, etc. near birds. Their respiratory systems are much more susceptible to pollutants than those of most mammals.
* Although cockatiels are capable of reproducing by the time they are a year old, they should be prevented from doing so until they are at least two years old. This is especially important for female cockatiels: Laying eggs requires much calcium, and when a hen lays eggs at too young an age, the egg-laying can interfere with the calcium required by her bones.
* Birds that lay eggs frequently—especially cockatiels—are extremely prone to a dangerous condition known as oviduct prolapse.
* Do not give parrots gravel for their gizzards. Unlike softbills, parrots do not need it to digest their food.

## External links

* Tiel Talk, a Cockatiel bulletin board for tiel owners
* The Association of Avian Veterinarians' guide to Basic Pet Bird Care
* The American Board of Veterinarian Practitioners' List of Certified Avian Vets
* The Association of Avian Veterinarians' Vet Lookup
* Vetafarm Australia's list of Australian Avian Vets
* Stainless Steel Bird Cage
* Adequately sized Cockatoo bird cages
* Bird cage basics
# Animal Care/Emergencies

An animal emergency is always a possibility for pet owners. You should provide proper veterinary care for your animal in order to avoid medical emergencies. Before you obtain a new animal you should find a veterinarian in your area. If you own an exotic animal, it is important to find a vet which specializes in the species you own. In case of a medical emergency you should know the phone number and location of the closest animal hospital, these places can provide emergency care for pets at any hour. They are generally more expensive than a routine vet visit, so it is better to provide a routine checkup for your pet than to wait for a serious problem.
Many emergencies can be avoided by educating yourself on the kind of animal you are caring for. Some animals can be poisoned by certain houseplants or foods that are commonplace in the house. Others can suffer from heatstroke during summertime weather. By learning about the problems your pet can have, you may avoid serious medical bills and the possibility of death.
← Comparison
# Animal Care/Comparison

If you are interested in adding a pet to your household, it is important to pick one which suits your lifestyle. For example - Some pets don't mind if you never have time to play with them - while others may fall to pieces. The two main varieties of pets are domestic animals and exotic animals.

## Domestic Pets

Generally, domestic pets are cheap and plentiful. Some examples of domestic animals are cats, dogs, hamsters, and rabbits. Although these animals can be adopted from breeders, there are many happy and well adjusted homeless pets at animal shelters all over the world. Generally it is much cheaper to adopt a pet from a shelter than to buy one from a breeder, and many shelters provide all kinds of breeds to choose from.

### Dogs

Dogs tend to be very loving, and desire a lot of human interaction. If you are interested in owning a dog you should be prepared to devote a lot of time to exercising and expressing a lot of affection. They are a good choice for families or people with a lot of spare time.

### Cats

Cats are relatively independent. They require little care, but benefit from all attention given to them. If you are unable to spend much time interacting with a pet, adopting two cats is a good option. They can socialize with each other when you are not around. Contrary to popular belief, cats are quite expressive and affectionate. If you have not spent much time around cats, it is a good idea to read about their body language and how they communicate.

### Hamsters

Hamsters and rodents require the least cost and level of care of all domestic animals. They have a very short lifespan (~3 years) and their food is very cheap. But like other domestics they can benefit a great deal from affection and attention. They may have a fear of humans (this is a greater risk if they were purchased as an adult), but with patience and empathy they may grow to desire contact. If you are unable or do not want to interact with them, toys and environmental enrichment can lead to a fulfilling life for the rodent and can be interesting for the owner to watch.

### Rabbits

Rabbits have been known to make good indoor pets - but most often they are kept in hutches outdoors. They have shorter lifespans than cats and many dogs. Although they are more prone to anxiety and a fear of humans than cats and dogs, with proper care they can be just as affectionate and emotionally connected. They are much quieter than other pets - they may make no vocalizations at all.

## Exotic Pets

Exotic pets tend to be more expensive than domestic pets. Some examples of exotic pets are parrots, tropical fish, and reptiles. Besides the cost of the animal when you buy them, medical and caretaking costs can be quite high. The lifespan of the animal - and the level of difficulty in owning them - range wildly. You should only choose an exotic pet if you have spent a great deal of time educating yourself about the species.
← Why Take Care of an Animal · Emergencies →
# C++ Programming/Programming Languages/C++/Code/Keywords/union

The union keyword is used to define a union type.

## Syntax

Union is similar to struct (more than class), unions differ in the aspect that the fields of a union share the same position in memory and are by default public rather than private. The size of the union is the size of its largest field (or larger if alignment so requires, for example on a SPARC machine a union contains a double and a char [17] so its size is likely to be 24 because it needs 64-bit alignment). Unions cannot have a destructor.
What is the point of this? Unions provide multiple ways of viewing the same memory location, allowing for more efficient use of memory. Most of the uses of unions are covered by object-oriented features of C++, so it is more common in C. However, sometimes it is convenient to avoid the formalities of object-oriented programming when performance is important or when one knows that the item in question will not be extended.
The use of union is covered in greater detain in the Unions Section.
# C++ Programming/Programming Languages/C++/Code/Keywords/static cast

The static_cast keyword can be used for any normal conversion between types. Conversions that rely on static (compile-time) type information. This includes any casts between numeric types, casts of pointers and references up the hierarchy, conversions with unary constructor, and conversions with conversion operator. For conversions between numeric types no runtime checks are performed if the current content fits the new type. Conversion with unary constructor will be performed even if it is declared as explicit.

## Syntax

It can also cast pointers or references down and across the hierarchy as long as such conversion is available and unambiguous. For example, it can cast void* to the appropriate pointer type or vice-versa. No runtime checks are performed.

## Common usage of type casting

Performing arithmetical operations with varying types of data type without an explicit cast means that the compiler has to perform an implicit cast to ensure that the values it uses in the calculation are of the same type. Usually, this means that the compiler will convert all of the values to the type of the value with the highest precision.
The following is an integer division and so a value of 2 is returned.
To get the intended behavior, you would either need to cast one or both of the constants to a float.
Or, you would have to define one or both of the constants as a float.
# C++ Programming/Programming Languages/C++/Code/Keywords/static/Permanent Storage
###### Permanent storage

Using the static modifier makes a variable have static lifetime and on global variables makes them require internal linkage (variables will not be accessible from code of the same project that resides in other files).

####### static lifetime

    Means that a static variable will need to be initialized in the file scope and at run time, will exist and maintain changes across until the program's process is closed, the particular order of destruction of static variables is undefined.
static variables instances share the same memory location. This means that they keep their value between function calls. For example, in the following code, a static variable inside a function is used to keep track of how many times that function has been called:
# C++ Programming/Programming Languages/C++/Code/Keywords/typeid
## Syntax

The typeid operator is used to determine the class of an object at runtime. It returns a reference to a std::type_info object, which exists until the end of the program, that describes the "object". If the "object" is a dereferenced null pointer, then the operation will throw a std::bad_typeid exception.
Objects of class std::bad_typeid are derived from std::exception, and thrown by typeid and others.
The use of typeid is often preferred over dynamic_cast<class_type> in situations where just the class information is needed, because typeid, applied on a type or non de-referenced value is a constant-time procedure, whereas dynamic_cast must traverse the class derivation lattice of its argument at runtime. However, you should never rely on the exact content, like for example returned by std::type_info::name, as this is implementation specific with respect to the compile.
It is generally only useful to use typeid on the dereference of a pointer or reference (i.e. typeid(*ptr) or typeid(ref)) to an object of polymorphic class type (a class with at least one virtual member function). This is because these are the only expressions that are associated with run-time type information. The type of any other expression is statically known at compile time.

## Example

Output (exact output varies by system):
# C++ Programming/Programming Languages/C++/Code/Keywords/typedef

typedef keyword is used to give a data type a new alias.
typedef existing-type new-alias;
The intent is to make it easier the use of an awkwardly labeled data type, make external code conform to the coding styles or increase the comprehension of source code as you can use typedef to create a shorter, easier-to-use name for that data type. For example:
The syntax above is a simplification. More generally, after the word "typedef", the syntax looks exactly like what you would do to declare a variable of the existing type with the variable name of the new type name. Therefore, for more complicated types, the new type name might be in the middle of the syntax for the existing type. For example:
This keyword also covered in the Coding style conventions Section.
# Bartending/Cocktails/Lynchburg Lemonade

Named after the home town of Jack Daniels, Lynchburg, Tennessee. A Lynchburg Lemonade is a cocktail made with Jack Daniels, orange liqueur, sour mix, and any lemon-lime soda to fill. It is typically served on the rocks in a Collins glass, and garnished with a lemon or cherry.

## Standard Mix

* 1oz Jack Daniels
* 1oz Orange liqueur (Triple-sec, or Cointreau)
* 2oz Sour-mix
* 4oz Lemon-Lime Soda (Sprite, or 7up)
* Garnish: Usually a Lemon wedge or maraschino cherry
# Bartending/Cocktails/Manhattan

The Manhattan is a classic American cocktail.

## Ingredients

* 1 shot Rye or Canadian whiskey
* 1/2 shot Sweet vermouth
* Angostura bitters

## Garnishes

* Maraschino cherry

## Glass

* Cocktail Glass

## Instructions

* Pour whiskey and vermouth over ice in a mixing glass
* Add a dash of bitters
* Stir and strain into a cocktail glass
* Garnish with a cherry

## Variations

* The Perfect Manhattan (half dry vermouth, half sweet vermouth)
* The ratio can be made sweeter or drier
* Brandy Manhattans are popular in some regions

## Related Drinks

* The Rob Roy, which is made with Scotch
* Less closely, the Martini, and all its relatives