text:
Diagnostic Radiology/Musculoskeletal Imaging/Infection/SAPHO Syndrome

 * Synovitis
 * Acne—commonly involving the face and upper back.
 * Pustulosis—usually involving the palms of the hands and/or soles of the feet (palmo-plantar pustulosis).
 * Hyperostosis
 * Osteitis

SAPHO syndrome is thought to comprise a spectrum of disorders that share some clinical, radiologic and pathologic characteristics. An entity known as chronic recurrent multifocal osteomyelitis (CRMO) was first described in 1972. Subsequently in 1978 several cases of CRMO were associated with clinical findings of palmoplantar pustulosis. Since then, a number of associations between skin conditions and osteoarticular disorders have been reported with a variety of different names including sternocostoclavicular hyperostosis, pustulotic arthro-osteitis, and acne-associated spondyloarthropathy. SAPHO was coined in 1987 and basically represents a spectrum of inflammatory osteitis which may or may not be associated with dermatologic pathology.

Radiologic Findings
Anterior chest wall (most common site, 65-90% of pts): Hyperostosis, sclerosis and bone hypertrophy especially involving the sternoclavicular joint, often with a soft tissue component.

Above images demonstrate sclerosis and hyperostosis of the medial left clavicle (sternocostoclavicular hyperostosis), a very typical site of involvement in the SAPHO syndrome.

Spine (second most common site, 33% of pts): Segmental, usually involving the thoracic spine. 4 main presentations include spondylodiscitis, osteosclerosis, paravertebral ossifications, and sacroiliac joint involvement.

Long bones (30% of pts): usually metadiaphyseal and located in the distal femur and proximal tibia. It looks like chronic osteomyelitis but will not have a sequestrum or abscess.

Flat bones : mandible and ilium (10% of pts).

Peripheral arthritis has been reported in 92% of cases of SAPHO as well.

Children : There is a predilection for the metaphysis of long bones in the legs (tibia, femur, fibula), followed by clavicles and spine.

Treatment
Treatment of patients with SAPHO syndrome is based on clinical symptoms. Generally, treatment involves non-steroidal antiinflammatory drugs and cortisone medications (either in the form of topical creams, tablets, or by injection into the involved area). Topical cold applications may also help in affected areas. If unsuccessful, both sulfasalazine and methotrexate have been tried with mixed results.


text:
User:MathMan64~enwikibooks/Arithmetic/Factoring

= Factoring =

Factors, multiples, divisors, and divisibility
The four terms above apply only to whole numbers.

 * 2 is a factor of 6, because 2 times 3 is 6.
 * 6 is a multiple of 2 for the same reason.
 * 2 is a divisor of 6 because 6 divided by 2 is 3 with no remainder.
 * 6 is divisible by 2 for the reasons above.

These four statements all say the same thing from different perspectives. The terminology used below refers to the smaller numbers as factors, the larger number as being divisible by each of the factors.

Divisibility
There are several ways to tell if one number is divisible by another.

Multiplication
If the numbers are small, a multiplication fact should come to mind.
 * 56 is divisible by 7 because 7 times 8 is 56.
 * 27 is not divisible by 4 because 4 times 6 is 24 and 4 times 7 is 28. Since there is no whole number between 6 and 7, there is no multiple of 4 between 24 and 28.

Division
A way to show divisibility that always works is to divide and see whether or not there is a remainder.

 * 42 is divisible by 14 because 42 divided by 14 is 3 with no remainder.
 * 72 is not divisible by 13 because 72 divided by 13 is 5 with a remainder of 7.
 * 5391 is not divisible by 61 because on a calculator, 5361 divided by 61 is 88.38 (rounded.)
 * 5141 is divisible by 53 because on a calculator 5141 divided by 53 is exactly 97.

Divisibility tests
The most useful way to tell if one number is divisible by another for the following three particular divisors are called the divisibility tests.

Two
Divisibility by 2 can be seen by looking at the one's digit. If the number is even, with a one's digit of 0, 2, 4, 6, or 8; then it is divisible by 2.
 * It is seen that that 78 is divisible by 2, by looking at the one's digit. It is 8, thus 78 is an even number and thus divisible by 2.
 * It is seen that 9105 is not divisible by 2, by looking at the one's digit. It is 5, thus 9105 is an odd number, and not divisible by 2.
 * It is seen that 392,845,160 is divisible by 2, by looking at the one's digit. Since it is 0, the number is divisible by 2.

Five
Divisibility by 5 can be seen by looking at the one's digit. If the number has a one's digit of 0 or 5, then it is divisible by 5. (Think of money in nickels.)
 * It is seen that 78 is not divisible by 5, by looking at the one's digit. It is 8.  Since it is not 0 or 5, 78 is not divisible by 5.
 * It is seen that 9105 is divisible by 5, by looking at the one's digit. It is 5.  Thus 9105 is divisible by 5.
 * It is seen that 392,845,160 is divisible by 5, by looking at the one's digit. Since it is 0, the number is divisible by 5.

Three
Divisibility by 3 is a little more difficult. It takes an extra step. Instead of looking just at the one's digit, all the digits must be added up. If the sum of the digits is divisible by 3, then the original number is divisible by 3. When the sum of the digits is a one-digit number, if the sum is 3, 6, or 9; the original number is divisible by 3. If the sum of the digits is any other one-digit number, then the original number is not divisible by three.
 * 81 can be shown to be divisible by 3, by adding up the digits of 81. The sum of the digits 8 + 1 is 9, so 81 is divisible by 3.
 * 71 can be shown to be not divisible by 3, by adding up the digits of 71. The sum of the digits 7 + 1 is 8, so 71 is not divisible by 3.

If the sum of the digits is greater than 9, the digits of the sum can be added again to see whether or not 3, 6, or 9 results.
 * It can be shown that 78 is divisible by 3, by adding up the digits. The sum of 7 + 8 is 15, and 1 + 5 is 6; thus 78 is divisible by 3.
 * It can be shown that 9105 is divisible by 3, by adding up the digits. The sum of 9 + 1 + 0 + 5 is 18, and 1 + 8  is 9; thus 9105 is divisible by 3.
 * It can be shown that 392,845,160 is not divisible by 3, by adding up the digits. The sum of 3 + 9 + 2 + 4 + 5 + 1 + 6 + 0 is 38, and 3 + 8 is 11, and 1 + 1 is 2; therefore 392,845,160 is not divisible by 3.

Prime and composite
Most whole numbers have several factors.

 * As stated above 2 and 3 are factors of 6. But 1 and 6 are also factors of 6.  The only factors of 6 are 1, 2, 3, and 6 because no other number divides into 6 with no remainder.
 * The factors of 12 are 1, 2, 3, 4, 6, and 12. Notice that these factors occur in pairs whose product is the number being factored: (1 and 12, 2 and 6, 3 and 4.)
 * 1 and 19 are the only factors of 19. No other numbers divide into 19 evenly.
 * The factors of 100 are 1, 2, 4, 5, 10, 20, 25, 50, and 100. All these factors occur in pairs except for 10, since 100 divided by 10 is 10 itself.

Notice in these examples, that every whole number is a factor of itself, and that 1 is a factor of every number. Some numbers have only two factors. 1 and the number itself are the only factors of these numbers.

Definitions

 * Numbers with only two factors are prime numbers. The only factors of a prime are 1 and the number itself.
 * Numbers with more than two factors are composite numbers.
 * Numbers with less than two factors are neither prime nor composite. Zero and one are the only whole numbers that are neither prime nor composite.

Examples
The first ten prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29.

Composite
If a number is divisible by any number besides 1 and the number itself, then it is composite. If one other factor can be found, (any factor other than 1 and the number itself) then the number is shown to be composite. Trying primes as factors is all that is needed, but if it is obvious that a composite number is a factor, the original number is shown to be composite.
 * 124 is divisible by 2, so it is composite.
 * 125 is divisible by 5, so it is composite.
 * 126 is divisible by 3, so it is composite.
 * 140 is equal to 10 times 14, so it is composite.
 * 143 is not divisible by 2, 5, or 3. So we divide by 7, but it doesn't come out even.  So we divide by 11, and it does divide with no remainder.  So 143 is composite.

Prime
If a number is not divisible by any number other than one and the number itself, then it is prime. This is much more difficult. It must be shown that the number is not divisible by any other factor. Only smaller numbers need to be checked. Trying to divide by smaller primes will be sufficient. In fact, it's only necessary to use the primes which when multiplied by themselves give a product that is smaller that the original number.
 * 43 is not divisible by 2, 5, or 3. And 7 times 7 is larger than 43.  So 43 is prime.
 * 173 is not divisible by 2, 5, or 3. When 173 is divided by 7, 11, and 13; none of the divisions result with no remainder.  And 17 times 17 is 289, which is larger than 173.  So 173 is prime.

Two rules

 * The rule of 48 is that any number less than 48 only needs to be checked for divisibility by 2, 3 and 5. This works because 7 is the next prime, and 7 times 7 is 49.
 * The rule of 120 is that any number less than 120 only needs to be checked for divisibility by 2, 3 and 5, and then try dividing by 7. This works because 11 is the next prime, and 11 times 11 is 121.

Prime factorization
Factoring a number into primes is an important skill in working with the fractions of arithmetic. Reducing and finding a common denominator when the numbers in the fraction are large, is made easier as the numbers are factored. The concepts used in working with numeric fractions in this way, are concepts important when working with fractions in algebra.

The fundamental theorem of arithmetic states that every whole number can be factored into the product of primes in only one way. The order in which the factors are listed does not make any difference. The easiest way to be consistent in listing the factors is to have them in order with the small ones first.

The process of drawing a tree diagram will be useful as large numbers are considered. In mathematics, trees are often drawn upside down, with the trunk (or root) at the top and the branches going down from there.

There are three ways to approach the factoring process.

Multiplication
When the number is less than 100, consider whether or not it is the product of a common multiplication fact.

 * Find the prime factorization of 35.

 * The prime factorization of 35 is 5 × 7.

In the case of a prime number, the factorization is written with only the one number and no multiplication sign.
 * When trying to factor 43, there is no example in the multiplication table that equals 43; none of the factors 2, 5 or 3, are divisors of 43; and 43 is less than 48; so 43 is prime.

 * The prime factorization of 43 is 43.

With more than two factors, a larger tree and more steps are needed. The factoring process continues until the numbers at the bottom of the tree are all prime.

 * Find the prime factorization of 72.

 * The prime factorization of 72 is 2 × 2 × 2 × 3 × 3 or 23 × 32.

 * Find the prime factorization of 16.

 * In either case, the prime factorization of 16 is 2 × 2 × 2 × 2 or 24.

Divisibility tests
The divisibility tests are very useful when there is not an easily remembered multiplication fact with the product that needs factoring.

 * Find the prime factorization of 111.

 * 111 is not divisible by 2 or 5, but it is divisible by 3. Division of 111 by 3 gives 37.
 * The prime factorization of 111 is 3 × 37.

 * Find the prime factorization of 72 using the divisibility tests.

 * The prime factorization of 72 is 2 × 2 × 2 × 3 × 3 or 23 × 32.

 * Find the prime factorization of 2310.

 * The prime factorization of 72 is 2 × 3 × 5 × 7 × 11.

Division
When all else fails, division must be used.

 * Find the prime factorization of 2873.

 * The prime factorization of 2873 is 13 × 13 × 17 or 132 × 17.

Often combinations of the three factoring methods can be used.

 * Use all three methods to find the prime factorization of 11,730.

 * The prime factorization of 11,730 is 2 × 3 × 5 × 17 × 23.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Diagnostic Radiology/Musculoskeletal Imaging/Joint Disorders/Osteoarthritis

Etiology
The cause of OA is generally multifactorial. Joint integrity, local inflammation, mechanical forces, genetic predisposition, and cellular/biomechanical processes all play a role in the development of OA. Although the etiology cannot always be identified, in general it is caused by repetitive biomechanical stress on the articular cartilage and subchondral bone of the affected joint. This is often due to a preexisting deformity such as developmental dysplasia of the hip, or genu varus of the knee. Additionally, there are multiple risk factors that increase a patient’s predisposition for OA. These include:

 * 1) Advanced age
 * 2) Female sex
 * 3) Obesity
 * 4) Occupation
 * 5) Sports activities
 * 6) Previous injury to the affected joint
 * 7) Muscle weakness/imbalance around affected joint
 * 8) Acromegaly
 * 9) Calcium crystal deposition disease

Clinical Findings
Most often seen in patients over 40 year old. The most common complaint is pain worsened with activity and lessened with rest. Joint effusions and crepitus are often seen on clinical exam, and large osteophytes can be palplated at the affected joint.

The joints most commonly involved in primary OA include the knees, hips, hands, and spine, and less often the elbow, wrist, and ankle.

Symptoms in various joints:
 * Knees: Crepitus, joint effusion, osteophytes, pain, decreased ROM.
 * Hips: Pain in hip or referred to knee.
 * Hands: DIP (Heberden’s nodes), PIP (Bouchard’s nodes), and 1st CMC joint involvement which manifests as enlarged joints.
 * Spine: Most commonly seen at points of greatest spinal flexibility (C5, T8, and L3).
 * C-Spine: Uncovertebral and facet joint osteophytes can narrow the foramina and spinal canal.
 * L-spine: Apophyseal osteophytes can cause spinal stenosis.

Radiologic Findings
Plain films often do not correlate with physical exam findings in early disease. Findings consistent with OA include subchondral sclerosis, osteophytes, subchondral cysts, and joint space narrowing.

Prognosis
The most common course of OA is an intermittent, progressive worsening of symptoms over time, although in some patients the disease stabilizes. Prognosis also varies depending on which joint is involved.

Factors associated with progression of OA:
 * Knees: High body mass index, varus or valgus knee deformity.
 * Hips: Female gender, night pain, presence of femoral osteophytes and subchondral sclerosis.
 * Hands: Older age.


text:
User talk:MathMan64~enwikibooks/Arithmetic/Factoring

The factoring page is (hopefully) done for now.


text:
User talk:205.221.76.84

— Laura Scudder | Talk 21:44, 13 September 2005 (UTC)

title: User talk:205.221.76.84


text:
Ada Programming/Platform/Windows/Console

The following libraries will help you when doing Input Output in the Windows console.

 * NT Console : A library for doing output with format and for moving the cursor.
 * Console IO : A library for correct I/O of Latin 1 characters (i.e. 'Pos greater than 127) in the Windows console.
 * NT Mouse : A library for controlling the mouse under the Windows console.

Wikibook

 * Ada Programming
 * Ada Programming/Libraries

Ada Reference Manual
—does not apply—

|Console


text:
Diagnostic Radiology/Musculoskeletal Imaging/Trauma/Peroneal Tendon Injury

Anatomy

 * The P. longus muscle originates on the proximal and mid lateral fibula and fans along the plantar surface of the foot to insert on the plantar aspect of the base of the 1st metatarsal and the medial cuneiform.
 * The P. brevis muscle originates on the mid and distal lateral fibula and inserts on the base of the 5th metatarsal.

Fig. 1 Peroneus Longus (left) and Brevis (right) Muscles

 * The brevis and longus tendons are located on the posterolateral aspect of the ankle, passing posterior and inferior to the lateral malleolus
 * The tendons run within a retromalleolar groove on the back of the fibula and are held in place along the lateral malleolus by the superior peroneal retinaculum
 * The tendons course superficial to the calcaneofibular ligament and  then . ..
 * Next to the calcaneus they may be separated by the calcaneus' peroneal tubercle, with the brevis anterior to the tubercle; or both may pass anterior to the tubercle
 * The longus tendon crosses on the plantar aspect of the brevis before insertion

Function
The Peronei are the major foot everters, using the lateral malleolus as a pulley

Radiologic Findings on MRI

 * The brevis tendon is usually anterior, or less commonly medial, to the longus
 * The brevis' musculotendinous jxn is more distal than the longus', so that just above the lateral malleolus the longus tendon can be seen lateral to the brevis muscle or tendon depending on where the musculotendinous jxn is
 * At or above the retromalleolar groove, the longus tendon is usually rounded while the brevis tendon is usually more flat, though often at the groove the tendons often cannot be appreciated as separate structures (Fig 2)

Fig. 2 Normal Peroneal Tendons at the Retromalleolar Groove—Axial T1-weighted image—The tendons often cannot be appreciated as separate structures. The thin black line posterior to the tendons is the superior peroneal retinaculum.

 * More distal the brevis tendon is more round/oval
 * Both tendons are normally low signal on T1 weighted images (Fig 3 and 4)

Fig. 3 Normal Peroneal Tendons Next to Calcaneus Superficial to Calcaneofibular Ligament—Axial T1-weighted image—Brevis is Anterior and Longus Posterior

Fig. 4 Normal Peroneal Tendons split at Peroneal Tubercle of Calcaneus—Axial and Sagittal T1-weighted images—Brevis is Anterior to the Tubercle (arrow) and Longus is Posterior (arrowhead)

 * Both tendons are normally low signal on T2 and STIR images as well. A little high T2/STIR signal around the tendons within the tendon sheath is normal (Fig 5)

Fig. 5 Normal Peroneus Brevis (anterior, arrow) and Longus (posterior, arrowhead) Tendons—Axial and Sagittal STIR Images—Tendons are low signal with a normal small amount of fluid within the tendon sheath around them

 * Watch out on low TE sequences for "magic angle" phenomenon making the tendons intermediate/high signal as they curve beneath the distal fibula

Peroneal Tendon Displacement

 * The peroneal tendons can be displaced—subluxed or dislocated—when the superior retinaculum is disrupted. This can occur with complex ankle fractures, calcaneal fractures, or with a forced inversion injury with plantar flexion.
 * The diagnosis is made when tendons are lateral to the distal fibula rather than posterior to it (Fig 6).
 * Calcaneal and ankle fractures can also cause tendons to be torn or trapped between fracture fragments.

Fig. 6 Normal Location of Peroneal Tendons and Displaced Tendons on CT—Normal tendon location is posterior to the fibula in the retromalleolar groove, as seen on axial (A) and consecutive coronal (B) CT images. When the tendons are displaced from a torn retinaculum they will move lateral to the fibula as seen on axial (D) and coronal (E) images in a patient with a calcaneal and hindfoot fractures.

Peroneal Tendon Tears
the tendon may become enlarged, may lose its homogenous low signal, or may have focal areas of increased T2/STIR signal.
 * Tendon tears most often occur in the brevis. The longus tendon is partially torn in ~30% of brevis tears and infrequently torn in isolation.
 * In partial tears of the brevis tendon, there may be any combination of the following findings:
 * Longitudinal tears of the brevis tendon are called peroneus brevis splits

Fig. 7 Peroneus Brevis Split—Increased signal is seen within the tendon on axial and sagittal STIR images over 1.5 cm portion just distal to the lateral malleolus.

 * Splits occur in patients of all ages and athletes. It may be difficult to diagnose clinically b/c of overlap with other ankle injuries and may be minimally symptomatic though pain and swelling are common.
 * Splits occur usually when in dorsiflexion as the brevis tendon is wedged between the lateral malleolus and taught longus tendon.
 * Thus most brevis tears begin at the lateral malleolus since that it is the main point of contact. Second most common location would be at the peroneal tubercle.
 * Usually brevis splits occur after chronic "wear and tear" frays the tendon from repetitive dorsiflexve stress culminating in a tear.
 * Tears can propagate distal or proximal to their origin.
 * Certain conditions predispose to splits, such as a shallow retromalleolar groove, lax or torn peroneal retinaculum, low lying brevis muscle belly, and the presence of a peroneus quartus muscle.

Fig. 8 Peroneus Brevis Split—Axial T1 image shows a C-shaped brevis tendon around the longus, a common appearance, just above the retromalleolar groove. More distal, on the axial STIR image, the tendon has split into 2 tendons. This was a patient with rheumatoid arthritis with marked tenosynovitis and an inflamed ankle joint as evidenced by the increased fluid in all compartments.

 * MRI Findings in Peroneus Brevis Splits
 * Splits can be seen as increased T2/STIR signal longitudinally along a part of the tendon
 * Also, more severely, the brevis tendon, which can normally be flat, will be C-shaped, V-shaped, or there will be 2 separate tendons and only 1 muscle body from a longitudinal tear.
 * Brevis splits are most commonly seen on axial images but sometimes you can be lucky and get the longitudinal tear on sagittal or coronal images
 * Again, one must be careful of "magic angle" phenoimenon as the tendons course below the fibula. Oblique axial images angled perpendicular to the peroneal tendons distal to the fibula can be very helpful in this regard.

Fig. 9 Peroneus Brevis Split—Axial Gradient image shows an enlarged brevis tendon with the appearnce of multiple small tendons from marked fraying and tears as the tendon passes the retromalleolar groove. Distal to the fibula the axial T1 image shows a split brevis with small round tendon posteriorly and C-shaped tendon anteriorly and inflamed tissue/fluid between.

 * You may see a fibular spur on the posterior lateral malleolus from reactive periostitis
 * One must be sure to distinguish a full split (2 tendons) from a bifurcated peroneus brevis tendon (there is a muscle belly for each tendon) and an extra tendon from the separate accessory peroneus quartus muscle.

 * Peroneus longus tears usually occur with brevis tears and have a similar appearance on MRI (Fig 10).

Fig. 10 Peroneus Longus Split—Axial STIR images show a cleft of increased STIR signal in the posterior aspect of the longus consistent with a small longitudinal tear. The brevis, medial on the left image and anterior on the right, also has high signal within it from a small tear.


text:
User:Johntex~enwikibooks

I'm a new user from the English version of Wikipedia.

title: User:Johntex~enwikibooks


text:
User talk:Akir~enwikibooks

Just so you don't miss it, I left you a comment here. - Sik0fewl 00:32, 14 September 2005 (UTC)

wikiversity
If you cast a wikiversity vote, please make a link at your Wikimedia meta-wiki user page linking back to your wikibooks user page. If you do not do so, your vote will not count. --JWSurf 02:47, 5 October 2005 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Akir. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Akir~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 22:56, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 04:29, 19 April 2015 (UTC)

title: User talk:Akir~enwikibooks


text:
User:Zntrip

Hello! If you would like to contact be please go to my Wikipedia user page and leave a comment on my discussion page.

title: User:Zntrip


text:
Template:DS:ADT

  Operations

ADT

title: Template:DS:ADT


text:
Talk:General Mechanics

I think that learning about kinematics might be a good starting point, even before dynamics. Straight-line motion is the best place to start with physics, in my opinion.

title: Talk:General Mechanics


text:
Ada Programming/Libraries/Ada.Strings

is a unit of the Predefined Language Environment since Ada 95.

This package is the base package for all string packages. It defines common exceptions and constants.

These child packages are:
 * Ada.Strings.Bounded
 * Ada.Strings.Bounded.Hash (Ada 2005 generic function)
 * Ada.Strings.Fixed
 * Ada.Strings.Fixed.Hash (Ada 2005 generic function)
 * Ada.Strings.Hash (Ada 2005 generic function)
 * Ada.Strings.Maps
 * Ada.Strings.Maps.Constants
 * Ada.Strings.Unbounded
 * Ada.Strings.Unbounded.Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Bounded
 * Ada.Strings.Wide_Bounded.Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Fixed
 * Ada.Strings.Wide_Fixed.Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Maps
 * Ada.Strings.Wide_Maps.Wide_Constants
 * Ada.Strings.Wide_Unbounded
 * Ada.Strings.Wide_Unbounded.Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Wide_Bounded (Ada 2005)
 * Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Wide_Fixed (Ada 2005)
 * Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Wide_Hash (Ada 2005 generic function)
 * Ada.Strings.Wide_Wide_Maps (Ada 2005)
 * Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants (Ada 2005)
 * Ada.Strings.Wide_Wide_Unbounded (Ada 2005)
 * Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash (Ada 2005 generic function)

Specification
Pure Strings Space            Character Wide_Space       Wide_Character Wide_Wide_Space  Wide_Wide_Character Length_Error Pattern_Error Index_Error Translation_Error Alignment  Left Right Center Truncation Left Right Error Membership Inside Outside Direction  Forward Backward Trim_End   Left Right Both AdaStrings

Wikibook

 * Ada Programming/Libraries/Ada
 * Ada Programming/Strings

title: Ada Programming/Libraries/Ada.Strings


text:
Ada Programming/Libraries/Ada.Strings.Unbounded

is a unit of the Predefined Language Environment since Ada 95.

This package defines the operations for unbounded string handling.

Usage
is used in several places. Here some relevant extracts. As always you can follow the download links to see the full examples.

Conversion between unbounded and bounded strings:

;    SU    Ada.Strings.Unbounded; X : SU.Unbounded_String := SU.To_Unbounded_String (CL.Argument (1)); T_IO.Put_Line (SU.To_String (X)); X := SU.To_Unbounded_String (CL.Argument (2)); T_IO.Put_Line (SU.To_String (X));

Another example:

;   Str  Ada.Strings.Unbounded; Get_Line Str.Unbounded_String; Str.Unbounded_String; Operation : Str.Unbounded_String; Get_Line Str.Unbounded_String BufferSize : := 2000; Retval    : Str.Unbounded_String := Str.Null_Unbounded_String; Item      : String (1 .. BufferSize); Last      : Natural; Get_Whole_Line : T_IO.Get_Line (Item => Item, Last => Last); Str.Append (Source => Retval, New_Item => Item (1 .. Last)); Get_Whole_Line Last < Item'; Get_Whole_Line; Retval; Get_Line;

Specification
Preelaborate Unbounded Unbounded_String Preelaborable_Initialization Unbounded_String Null_Unbounded_String  Unbounded_String Length Source  Unbounded_String  Natural String_Access   String Free X   String_Access To_Unbounded_String Source  String Unbounded_String To_Unbounded_String Length  Natural Unbounded_String To_String Source  Unbounded_String  String Set_Unbounded_String Target     Unbounded_String Source      String Append Source     Unbounded_String New_Item  Unbounded_String Append Source     Unbounded_String New_Item  String Append Source     Unbounded_String New_Item  Character "" Left Right  Unbounded_String Unbounded_String "" Left  Unbounded_String Right   String Unbounded_String "" Left  String Right   Unbounded_String Unbounded_String "" Left  Unbounded_String Right   Character Unbounded_String "" Left  Character Right   Unbounded_String Unbounded_String Element Source  Unbounded_String Index   Positive Character Replace_Element Source   Unbounded_String Index   Positive By      Character Slice Source  Unbounded_String Low     Positive High    Natural String Unbounded_Slice Source  Unbounded_String Low     Positive High    Natural Unbounded_String Unbounded_Slice Source      Unbounded_String Target     Unbounded_String Low         Positive High        Natural "" Left Right   Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right   Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right  Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right   Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean "" Left Right  Unbounded_String  Boolean "" Left   Unbounded_String Right   String Boolean "" Left   String Right   Unbounded_String Boolean Index Source   Unbounded_String Pattern  String From     Positive Going    Direction  Forward Mapping  MapsCharacter_Mapping  MapsIdentity Natural Index Source   Unbounded_String Pattern  String From     Positive Going    Direction  Forward Mapping  MapsCharacter_Mapping_Function Natural Index Source    Unbounded_String Pattern   String Going     Direction  Forward Mapping   MapsCharacter_Mapping MapsIdentity Natural Index Source    Unbounded_String Pattern   String Going     Direction  Forward Mapping   MapsCharacter_Mapping_Function Natural Index Source  Unbounded_String Set     MapsCharacter_Set From    Positive Test    Membership  Inside Going   Direction  Forward Natural Index Source  Unbounded_String Set     MapsCharacter_Set Test    Membership  Inside Going   Direction   Forward  Natural Index_Non_Blank Source  Unbounded_String From    Positive Going   Direction  Forward Natural Index_Non_Blank Source  Unbounded_String Going   Direction  Forward Natural Count Source    Unbounded_String Pattern   String Mapping   MapsCharacter_Mapping MapsIdentity Natural Count Source    Unbounded_String Pattern   String Mapping   MapsCharacter_Mapping_Function Natural Count Source    Unbounded_String Set       MapsCharacter_Set Natural Find_Token Source  Unbounded_String Set     MapsCharacter_Set Test    Membership First   Positive Last    Natural Translate Source   Unbounded_String Mapping  MapsCharacter_Mapping Unbounded_String Translate Source    Unbounded_String Mapping  MapsCharacter_Mapping Translate Source   Unbounded_String Mapping  MapsCharacter_Mapping_Function Unbounded_String Translate Source    Unbounded_String Mapping  MapsCharacter_Mapping_Function Replace_Slice Source    Unbounded_String Low       Positive High      Natural By        String Unbounded_String Replace_Slice Source     Unbounded_String Low       Positive High      Natural By        String Insert Source    Unbounded_String Before    Positive New_Item  String Unbounded_String Insert Source     Unbounded_String Before    Positive New_Item  String Overwrite Source     Unbounded_String Position   Positive New_Item   String Unbounded_String Overwrite Source      Unbounded_String Position   Positive New_Item   String Delete Source   Unbounded_String From     Positive Through  Natural Unbounded_String Delete Source    Unbounded_String From     Positive Through  Natural Trim Source  Unbounded_String Side    Trim_End Unbounded_String Trim Source   Unbounded_String Side    Trim_End Trim Source  Unbounded_String Left    MapsCharacter_Set Right   MapsCharacter_Set Unbounded_String Trim Source   Unbounded_String Left    MapsCharacter_Set Right   MapsCharacter_Set Head Source  Unbounded_String Count   Natural Pad     Character  Space Unbounded_String Head Source   Unbounded_String Count   Natural Pad     Character  Space Tail Source  Unbounded_String Count   Natural Pad     Character  Space Unbounded_String Tail Source   Unbounded_String Count   Natural Pad     Character  Space "" Left   Natural Right  Character Unbounded_String "" Left   Natural Right  String Unbounded_String "" Left   Natural Right  Unbounded_String Unbounded_String Import Ada Unbounded_String Import Ada Null_Unbounded_String AdaStringsUnbounded

Wikibook

 * Ada Programming
 * Ada Programming/Libraries
 * Ada Programming/Strings


text:
Ada Programming/Libraries/Ada.Exceptions

is a unit of the Predefined Language Environment since Ada 95.

The package allows you to analyze exceptions you have caught, to raise exceptions with an associated message or to save exceptions occurrences for later processing.

Usage
The following example shows how to implement a "last resort" error handler which just displays the information related to the error which occurred.

; Numeric_6 Exept Ada.Exceptions; ...               An_Exception :  => T_IO.Put_Line (Exept.Exception_Information (An_Exception)); Try;

Specification
Preelaborate Exceptions Exception_Id Preelaborable_Initialization Exception_Id Null_Id  Exception_Id Exception_Name Id  Exception_Id  String Wide_Exception_Name Id  Exception_Id  Wide_String Wide_Wide_Exception_Name Id  Exception_Id Wide_Wide_String Exception_Occurrence Preelaborable_Initialization Exception_Occurrence Exception_Occurrence_Access   Exception_Occurrence Null_Occurrence  Exception_Occurrence Raise_Exception E        Exception_Id Message  String  "" No_Return Raise_Exception Exception_Message X  Exception_Occurrence  String Reraise_Occurrence X  Exception_Occurrence Exception_Identity X  Exception_Occurrence Exception_Id Exception_Name X  Exception_Occurrence  String Wide_Exception_Name X  Exception_Occurrence Wide_String Wide_Wide_Exception_Name X  Exception_Occurrence Wide_Wide_String Exception_Information X  Exception_Occurrence  String Save_Occurrence Target     Exception_Occurrence Source      Exception_Occurrence Save_Occurrence Source  Exception_Occurrence Exception_Occurrence_Access Read_Exception_Occurrence Stream    AdaStreamsRoot_Stream_Type Item    Exception_Occurrence Write_Exception_Occurrence Stream    AdaStreamsRoot_Stream_Type Item    Exception_Occurrence Exception_Occurrence Exception_Occurrence Import Ada Exception_Id Import Ada Exception_Occurrence Import Ada Null_Id Import Ada Null_Occurrence AdaExceptions

Wikibook

 * Ada Programming/Libraries/Ada
 * Ada Programming/Strings


text:
Rebol Programming/Advanced

Collection of essays on more advanced topics - please state authorship here

 * Bindology

 * Identity

 * The Rebol interpreter

title: Rebol Programming/Advanced


text:
Geometry for Elementary School/Copying a line segment

This construction copies a line segment $$\overline{AB}$$ to a target point T. The construction is based on Book I, prop 2.

The construction

 * 1) Let A be one of the end points of $$\overline{AB}$$. Note that we are just giving it a name here. (We could replace A with the other end point B). Geom copyseg 01.png
 * 2) Draw a line segment $$\overline{AT}$$ [[image:Geom copyseg 02.png|225px]]
 * 3) Construct an equilateral triangle $$\triangle ATD $$ (a triangle that has $$\overline{AT}$$ as one of its sides). Geom copyseg 03.png
 * 4) Draw the circle  $$\circ A,\overline{AB} $$, whose center is A and radius is  $$\overline{AB}$$. Geom copyseg 04.png
 * 5) Draw a line segment starting from D going through A until it intersects $$\circ A,\overline{AB} $$ and let the intersection point be E . Get segments  $$\overline{AE}$$ and $$\overline{DE}$$. Geom copyseg 05.png
 * 6) Draw the circle  $$\circ D,\overline{DE} $$, whose center is D and radius is  $$\overline{DE}$$. Geom copyseg 06.png
 * 7) Draw a line segment starting from D going through T until it intersects $$\circ D,\overline{DE} $$ and let the intersection point be F. Get segments  $$\overline{TF}$$ and $$\overline{DF}$$. Geom copyseg 07.png

Claim
The segment $$\overline{TF}$$ is equal to $$\overline{AB}$$ and starts at T.

Proof

 * 1) Segments $$\overline{AB}$$ and $$\overline{AE}$$ are both from the center of $$\circ A,\overline{AB} $$ to its circumference. Therefore they equal to the circle radius and to each other. Geom copyseg proof01.png
 * 2) Segments $$\overline{DE}$$ and $$\overline{DF}$$ are both from the center of $$\circ D,\overline{DE} $$ to its circumference. Therefore they equal to the circle radius and to each other. Geom copyseg proof02.png
 * 3) $$\overline{DE}$$ equals to the sum of its parts $$\overline{DA}$$ and $$\overline{AE}$$. Geom copyseg proof03.png
 * 4) $$\overline{DF}$$ equals to the sum of its parts $$\overline{DT}$$ and $$\overline{TF}$$. Geom copyseg proof04.png
 * 5) The segment $$\overline{DA}$$ is equal to $$\overline{DT}$$ since they are the sides of the equilateral triangle $$\triangle ATD $$. Geom copyseg proof05.png
 * 6) Since the sum of segments is equal and two of the summands are equal so are the two other summands $$\overline{AE}$$ and $$\overline{TF}$$. Geom copyseg proof06.png
 * 7) Therefore $$\overline{AB}$$ equals $$\overline{TF}$$. Geom copyseg proof07.png

Geometria per scuola elementare/Copia di un segmento


text:
Geometry for Elementary School/Parallel lines

Definition
Let us recall what we learnt from the lines chapter. Parallel lines are straight lines that never intersect, which means that they never cross. Notice that when we look at parallel parts of shapes there is no place where they intersect even if we extend the lines.

As we have learnt from the plane shapes chapter, parallelograms, including squares, rhombi and rectangles, have two pairs of parallel sides. Also, there is one pair in trapeziums. Can you name any other polygons that contain parallel lines?

Transversals
A transversal is a line segment that cut through two line segments. (They can, of course, be lines and rays as well.) When the two line segments are parallel, the eight angles produced will have some special properties.

In such a case, imagine that one of the angles on one of the segments is called x. It is the top left angle. The top left angle of the other segment would be its corresponding angle, or corr. ∠. Corresponding angles are always the same size. Then imagine the vertically opposite angle of angle x. Let's call it y. The corresponding angle of y would be the alternate angle, or alt. ∠, of x. Bear in mind that alternate angles are also the same in size as they are vertically opposite angles with the corresponding angles. What about the adjacent angles of x? As you can see, these angles are adjacent angles on a straight line with x, so they must be supplementary. These are called interior angles on the same side of the transversal (int. ∠s). They are different from the kind of interior angle in a polygon, so do not mix them up.

When you are doing your sums, you will find out that these three kinds of angles pop up very commonly and are very useful. The reference for these angles are corr./alt./int. ∠s, AB//CD. When you want to prove that two lines are congruent, then use corr./alt. ∠s equal or int. ∠s supp..

Look at the figure. Given that m and n are parallel, angles 1 and 5, 2 and 6, 3 and 7, 4 and 8 are corresponding angles, and are therefore equal. 5 and 3, 6 and 4 are alternate angles, so they must be equal as well. 5 and 4, 3 and 6 are interior angles, so they must be supplementary. Note that there are also two sets of angles at a point and eight pairs of adjacent angles on a straight line.

Let us look at an example. Given that DE and GB are parallel, how can we find x, y and z?

$$\begin{align} \angle EFC &= \angle BGC \text{ (corr. } \angle \text{s, DE} / / \text{GB)} \\ z &= 125^\circ \end{align} $$ $$\begin{align} \angle AFD &= \angle BGC \text{ (alt. } \angle \text{s, DE} / / \text{GB)} \\ y &= 125^\circ \end{align} $$ $$\begin{align} \angle AGB + \angle BGC &= 180^\circ \text{ (adj. } \angle \text{s on st. line)}\\ \angle AGB + 125^\circ &= 180^\circ \\ \angle AGB &= 180^\circ - 125^\circ \\ &= 55^\circ \end{align}$$ $$\begin{align} \angle AGB + \angle EFC &= 180^\circ \text{ (int. } \angle \text{s, DE} / / \text{GB)} \\ 55^\circ + x &= 180^\circ \\ x &= 180^\circ - 55^\circ \\ &= 125^\circ \end{align} $$

Geometria per scuola elementare/Linee parallele


text:
Rebol Programming/Advanced/Interpreter

Author: Ladislav Mecir

Interpretation phases
The interpretation of Rebol source code (a text contained in a text file, a text contained in a Rebol string, a text typed in from the keyboard, etc.), consists from three basic steps:

 * 1) make phase
 * 2) load phase
 * 3) do phase

MAKE phase
In this phase the make function creates a Rebol block.

The created block is filled by make to refer to the Rebol values received by parsing the supplied source text according to the rules for the corresponding Rebol datatypes.

All words (i.e. all values of any-word! datatype) referenced by the new block are unbound, i.e. they have no context information. For more details on contexts see Bindology essay.

LOAD phase
In this phase the load function extends the global context to contain all words (values of the any-word! datatype) referenced by the block made in the previous phase, with the exception of refinements.

All words (except for refinements) in the created blocks are replaced by their global context counterparts.

That is why all words contained in a load result block are global words (except for the refinements, as was stated above).

DO phase
For the do function is immaterial whether the interpreted block is a result of the previous phase or a result of any other operation. This model describes the behaviour of the do function processing Rebol blocks and parens in all situations.

The do function processes the values contained in the interpreted block one by one in a way we call implicit evaluation.

Simple implicit evaluation
For some values, the result of implicit evaluation is the encountered value itself. Examples are integral values, decimal values, characters, strings and blocks.

Implicit evaluation of parens
As opposed to blocks that implicitly evaluate to themselves, parens, when encountered in an interpreted block, are interpreted further in the same way as the do function interprets blocks.

Implicit evaluation of functions
When any-function! datype values are encountered, it is necessary to collect their arguments and supply them to the evaluated functions.

Specifically, if the do function is evaluated, it evaluates its argument in a way that we call explicit evaluation. In particular, if the argument is a block, the do function interprets it recursively as described in the "DO phase" section. Therefore, for a block, the explicit evaluation differs from the implicit evaluation. This is what makes Rebol special.

Implicit evaluation of words
When the implicitly evaluated value is a word having the word! datatype, it is treated as a variable and the value of the variable is looked up and treated depending on its datatype. We call this indirect implicit evaluation.

There is also an indirect explicit evaluation, which happens if a word or a path is supplied as an argument to the do function.

The result of the interpretation
When the do function finishes the implicit evaluation of all values contained in the block, the last obtained value becomes the result of the interpretation of the block.

Exception: if the do function obtains an error! datatype value and the value isn't used as an argument to a function accepting error values, the interpreter causes the error.

In my opinion, this exception is unnecessary and can be painlessly avoided in the future versions of the interpreter.

Simulation (simple Rebol interpreter written in Rebol)
The simulation function below is a simple interpreter able to interpret one line of text you input from the keyboard.

simulation: func [/local input-line created-block loaded-block] [ ; step #0, INPUT input-line: ask ">> " ; step #1, MAKE created-block: make block! input-line ; step #2, LOAD loaded-block: load created-block ; step #3, DO      do loaded-block ; done ]

It illustrates the description written above.

Evaluation of Rebol words
Rebol words (the values of the word! datatype) exhibit the most complicated behaviour. When a word is evaluated by the do function, the do function first picks the value the word refers to. If the evaluated word has no context, the do function is unable to pick the value and it causes an error instead:

>> b: make block! "a" ; == [a] == [a] >> do b ** Script Error: a word has no context ** Near: a

The next action depends on the datatype of the picked value. A special case is, when the word is unset, i.e. when the value of the word is of the unset! datatype:

>> do [a] ** Script Error: a has no value ** Near: a

For some values no further action is needed and the picked value becomes the result of the word evaluation, for other values the action is taken in accordance with the datatype. The values of the second kind we could call word-active values, or word-active datatypes. The recent versions of the interpreter use decreasing number of word-active datatypes.

Typical representants of the word-active values are any-function! values. When such a value is encountered as a value of an evaluated word, the do function collects all the arguments for the function and "calls the function" like above.

The shrinking list of the word-active datatypes still contains lit-words and lit-paths (unnecessarily, in my opinion). On the other hand, the behaviour of unset! values could be made more function-like too.

word-active?: func [ {finds out, if a Rebol value is word-active} value [any-type!] ] [       parse head insert/only copy [] get/any 'value [ unset! | any-function! | lit-word! | lit-path! ]   ]

Recursive behaviour
The word-active values can exhibit recursive behaviour like:

; recursive function factorial: func [n] [ either n <= 1 [1] [n * factorial n - 1] ]

>> factorial 5 == 120

In fact, we can make even not-active values to exhibit recursive behaviour, if we use active values appropriately:

; recursive block factorial-block: [ either n <= 1 [1] [n * (n: n - 1 do factorial-block)] ]

>> n: 5 do factorial-block == 120

title: Rebol Programming/Advanced/Interpreter


text:
Guitar/Scales

Western music uses twelve notes called the complete chromatic scale. The seven white keys and their corresponding black keys on a keyboard allows for easy visualization of the complete chromatic scale and the twelve semitones. From this simple twelve note system are all the other scales derived. A scale is simply a way of ordering the twelve sounds found in Western Music. It must be borne in mind that music as an activity precedes musical theory and that the scales we use now have an evolution that predates written records. Today's scale system is referred to as the major-minor system. Go back to the Medieval period and the system used then was called the Church Modes. The study of scales should start with the major scales and minor scales or the blues and pentatonic scales. Unlike the piano where each semitone is represented by a key; on the guitar each semitone is represented by a fret. Pianists visualize the chromatic scale as the seven white keys and five black keys but guitarists should visualize their complete chromatic scale as all the notes from the open E string (low) up to the open high e string. Basically play all the open notes and fretted notes on the first four frets in sequence starting with the low open E string and ending on the high open e string. This is the complete chromatic scale over two octaves as visualized on the guitar. Scales take their names from the first note played - the C major, C minor, C diminished are all scales that start with C. For historical reasons the major scale and the minor scale consists of seven notes. Other scales may use more than seven notes and some (e.g. pentatonic = 5) less than seven notes.

It is important to remember that on the guitar, if you know the pattern of a particular scale, you can move that pattern anywhere else on the fret board and be playing in a different key. By this, I mean if you are playing a major scale, beginning on the low E string at the fifth fret, which is an A note and then you played the same pattern of notes, but you started on the 3rd fret of the low E string, you will be playing a G major scale. If this sounds confusing to you, read the entire article, and if it is still unclear, see the musical scale article on Wikipedia or the Music Theory wikibook.

There are many different scales: the major scale, three different forms of the minor scale, the blues scale, the pentatonic scale, the whole tone scale, the diminished scale and some scales that originated in Spain and India. There are also very interesting scales from eastern music. It is possible to create your own scales by altering another as you wish, or completely coming up with your own. Note that though there are three minor scales (Natural. Harmonic and Melodic) you don't actually have to learn three different scales. The Harmonic and Melodic Minor scales are variations of the Natural Minor scale. After you have learnt, for example, the A natural minor scale, you only have to sharpen the seventh note to change it to a Harmonic minor scale. The Melodic Minor has two notes sharpened - the sixth and seventh note. Once again the reasons for the existence of these scales is historical. The Harmonic minor scale is so called because it is from this scale that minor harmony is usually taken. A simpler way of saying this is that the Harmonic minor scale is the scale we use to build the chords in a minor key. The Melodic Minor scale is so called because this scale is frequently used for building melodies.

The "Circle of Fifths" is a memory aid for learning the major and minor scales which can equally be applied to all scales. The scales in common use have evolved over many centuries and the established major scale, followed by the natural minor and then the two variants: the harmonic minor scale and the melodic minor scale form the basis of Western music. The "Circle of Fifths" and major scales in tab can be found in the Scale Manual section of this book.

All scales in this section are in the key of A and presented in tab except the Hungarian Minor which is given in the key of C. This means that the root note of all these scales is A.

Pentatonic Scales
Pentatonic scales are the least complicated, because they have five notes rather than the seven notes used in the major scale. The pentatonic scale is used extensively by blues and rock guitarists and provides an ideal starting point for jamming along with recorded music. A very famous song that uses the A minor pentatonic is "Stairway To Heaven" by Led Zeppelin.

A Minor Pentatonic
A-C-D-E-G-A

Most guitarists feel comfortable beginning with the A minor pentatonic, which is the single most popular scale for solos in Western music. Most guitarists know this shape of the Am pentatonic scale by heart, mainly because it is so frequently used in solos. It can also be used for pretty much anything, especially if you want to give it a slightly melancholy sound.

Remember that this scale pattern (and any other scale pattern) can be moved up and down the fretboard therefore allowing the guitarist to play in many different keys using the one shape.

In this diagram, the notes are ordered sequentially up the scale (going higher in pitch). The different octaves of the first degree of the scale (in this case, the A note) are highlighted with a yellow dot.

Learning the Scale
When you are learning any scale, it is helpful to break it down into smaller chunks, which can be practiced and memorized much more easily. With the A minor pentatonic scale, it is most commonly broken down into these sections.

Section 1: e |--0---3-- B |-13-- G |--0-2 D |--0-2 A |--0---3-- E |--0---3--

Section 2: e |-3-5-- B |-3-5-- G |--25-- D |--25-- A |-3-5-- E |-3-5--

Section 3: e |--58-- B |--58-- G |--5-7- D |--5-7- A |--5-7- E |--58--

Section 4: e |-8-10- B |-8-10- G |--7-9- D |--710- A |--710- E |-8-10-

Section 5: e |1012-- B |10--13 G |--9---12-- D |1012-- A |1012-- E |1012--

Scales should be practiced repeatedly and slowly. Scales are an ideal way to improve hand co-ordination and finger memory which in turn leads to a personal technique. A common technical problem associated with the guitar is string noise. Even a simple chord movement from C to Am should be played at the slowest speed possible with care being taken not to bend the strings and for each note, open or fretted, to ring out clearly. The A minor pentatonic shapes shown above should be played slowly up and down. If you are playing with a plectrum then practice alternate picking or tremolo picking. To play scales with fingers just alternate the index and middle finger of the right hand. If you are using a steel-string acoustic then to avoid tendonitis and hand fatigue it is advised that you tune your guitar down a tone when practising scales.

The Blues scale
Please see the Blues section for more lessons.

You can easily modify the minor pentatonic scale by adding a single note and turning it into the blues scale - the flatted fifth note (b5) of the scale. In the diagram below, A blues scale is shown at the fifth fret. The number represent the frets played, and the numbers in parentheses represent the Blue Note which, as the name suggests, is the major source of the blues vibe in the scale. The blue note is not actually part of the Minor Pentatonic scale, although it is often added in for extra colour.

e |--58-- B |--58-- G |--5-7-(8)- D |--5-7- A |--5-(6)-7- E |--58--

Major Pentatonic
The A major pentatonic also has five notes:

A-B-C#-E-F#-A

The major pentatonic can be formed from any seven note major scale by simply leaving out the fourth and seventh note. The difference between the A minor pentatonic and the A major pentatonic is their modality. They both use the same first degree, however it is the interval between the first degree and the third that defines a scales modality. In the major pentatonic we have a major third (A - C#) so therefore the modal quality of this scale is major. The minor pentatonic has a minor third (A - C) and therefore the modal quality of this scale is minor. Though they both have the same tonality by starting on the same note they differ in sound. Understanding that it is the third of a scale that determines whether a scale is minor mode or major mode is important. In a scale the I, IV and V notes are called the tonal degrees and the III, VI, and VII notes are called the modal degrees.

e |-5- B |-5-7--- G |--4-6-- D |--47--- A |--47--- E |-5-7---

Practice this the same way you practice the minor pentatonic scale. When you feel completely comfortable with both pentatonic scales, begin to explore the other different scales.

Major Scale
The pattern for any major scale is 2-2-1-2-2-2-1, meaning that the difference from the first note to the second is 2 frets, from the second to the third is 2 frets, from the third to the fourth is 1 fret, etc. The difference in notes can also be called steps, 2 notes being a whole step, and 1 note being a half step. This pattern in steps can be shown as W-W-H-W-W-W-H or as full tones and semitones T-T-S-T-T-T-S.

Major scale in the key of A

A-B-C#-D-E-F#-G#-A

e |-4-5- B |---5---7- G |-4---6-7- D |-4---6-7- A |-4-5---7- E |---5---7-

= Three scale concepts at a glance =

Here all major patterns are shown in comparison to each other in the common 3 scale concepts. We are roughly based on the C major scale.

 * Start with the CAGED scales
 * Find the square and use it to determine the fundamental tone of the major scale.
 * [[Image:Scala Carree.svg]]

 * Derive the first and second fingerings from this.
 * Place the second fingering under the first.
 * Connect the lower half of the second fingering to the first fingering using the third fingering.

 * first fingerings
 * second fingerings
 * third fingerings

 * Use it to learn the 5 CAGED scales.
 * Connect the 5 CAGED scales to the slide module.
 * [[File:Scala 6 71 2-2 34 5.svg]]

 * Note the change in position between the G and B strings.
 * [[File:Scala_6_71_2-2_34_5_GB.svg]]

 * Familiarize yourself with and engage with the CAGED scales.

 * Then learn how to easily expand ANY CAGED scale.

 * [[Image:Extension of the first and second fingering.svg]]
 * [[Image:Extension of the third fingering.svg]]
 * [[Image:Extension of the third fingering.svg]]

 * Learn an alternative third fingering and use it to expand your CAGED scales to the 3 Notes Per Strings scales. (3NPS)

 * Alternative third fingering
 * [[Image:Scala 5 6 7-1 2 3-4 5 6.svg]]

 * Be aware that none of the concepts can be learned and mastered in a weekend. Don't be blinded by false promises on social networks and don't listen to everything that is intended for advanced guitar students.

If you later want to play more demanding polyphonic arrangements (especially jazz, classical and fingerstyle), expand the CAGED and 3NPS scales to the so-called Berklee scales by William Levitt.

 * Notes of the C major scale on the fretboard
 * [[Image:C-Major-Scale on the fretboard.svg]]

 * Intervals of the C major scale (transferable to other keys).
 * [[Image:Scala Griffbrett.svg]]
 * [[Image:Major-Pattern - 3 Pos Berklee - C-Form CAGED.svg]]
 * [[Image:Major-Pattern - 3 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - 4 Pos Berklee.svg]]
 * [[Image:Major-Pattern - 4 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - A-Bb-Form CAGED.svg]]
 * [[Image:Major-Pattern - 5 Pos Berklee.svg]]
 * [[Image:Major-Pattern - 5 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - G-Form CAGED.svg]]
 * [[Image:Major-Pattern - G-Form CAGED Var.svg]]
 * [[Image:Major-Pattern - 6 Pos Berklee.svg]]
 * [[Image:Major-Pattern - 6 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - 7 Pos Berklee - E-F-Form CAGED.svg]]
 * [[Image:Major-Pattern - 7 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - 1 Pos Berklee.svg]]
 * [[Image:Major-Pattern - 1 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - D-Form CAGED.svg]]
 * [[Image:Major-Pattern - 2 Pos Berklee.svg]]
 * [[Image:Major-Pattern - 2 Pos 3NPS.svg]]
 * [[Image:Major-Pattern - 3 Pos Berklee - C-Form CAGED.svg]]
 * [[Image:Longform 1 CAGED.svg]]
 * [[Image:Longform 2 CAGED.svg]]
 * [[Image:Scala Griffbrett.svg]]
 * [[Image:C-Major-Scale on the fretboard.svg]]

adopted from the German-language Wikibooks. here: chapter about the major scales translated from google.

Natural Minor Scale
The pattern for any natural minor scale is 2-1-2-2-1-2-2, shown in steps as W-H-W-W-H-W-W

Natural Minor Scale in the key of A

A-B-C-D-E-F-G-A

e |---5 B |---5-6---8-- G |-4-5---7 D |---5---7 A |---5---7-8-- E |---5---7-8--

The movable shape for this scale is shown: e |---|---x---|---|---|---| B |---|---x---|---x---|---|---x---| G |---x---|---x---|---|---x---|---| D |---|---x---|---|---x---|---| A |---|---x---|---|---x---|---x---| E |---|---x---|---|---x---|---x---| 5th

Harmonic Minor Scale
The Harmonic minor scale has a very different quality than the minor pentatonic scale. It has a "middle-eastern" sound when used to play lead lines.

A-B-C-D-E-F-G#-A

This is a moveable shape and to play in other keys just move the shape up or down the neck:

e |--4--5-7--8-- B |-5--6 G |--4--5-7- D |6--7- A |-5-7--8-- E |-5-7--8--

This looks a little more complicated, and is certainly more difficult to get to sound nice, but when you have mastered it, it will sound great!

Melodic Minor Scale
This scale is actually two scales. Thus when one speaks of a "melodic minor" pattern, one refers to two patterns - one ascending and one descending.

A-B-C-D-E-F#-G#-A (ascending) A-G-F-E-D-C-B-A  (descending)

This is best illustrated by playing the melodic minor scale. Below is the A melodic minor scale in tab; note the sharps when ascending and the naturals when descending.

The ascending pattern is constructed by raising the 6th and 7th steps of the natural minor scale. When descending the normal natural minor scale is used without the 6th and 7th raised. The reason for this is to be found in singing. Vocalists find the augmented second between the F and G sharp in the Harmonic minor scale very awkward to sing. It is not impossible but the dissonance of the interval and the sense of "leaping" meant that a different approach was sought. The answer was to also raise the sixth note. The awkward augmented second was gone and the melody flowed better due to the absence of the leap.

Hungarian Minor
The Hungarian minor scale is a type of combined musical scale. It is akin to the harmonic minor scale, except that it bears a raised fourth. Its tonal center is slightly ambiguous, due to the large number of half steps. Also known as Double Harmonic Minor, or Harmonic Minor #4, it figures prominently in Eastern European music, particularly in gypsy music. Melodies based on this scale have an exotic, romantic flavor.

e |--7--8-10--11-- B |--7--8--9-- G |--7--8- D |9--10-- A |9--10--11-- E |-8-10--11--

A Hungarian minor scale in the key of C would proceed as follows:

C-D-Eb-F#-G-Ab-B-C

Its scale degrees are 1 2 b3 #4 5 b6 7 and its step pattern w - h - + - h - h - + - h, where w indicates a whole step, h indicates a half step, and + indicates an augmented second.

Derived chords
Chords that may be derived from the Hungarian minor scale are:

This scale is obtainable from the *Arabic scale by starting from the fourth of that scale. Said another way, the C Hungarian minor scale is equivalent to the G Arabic scale.

In the video game, The Illusion of Gaia (published by the Enix Corporation), the flute melody found in the Inca Ruins uses the C Hungarian minor scale (a #4 is used in the second phrase); this music is also quoted when the player reaches the Larai Cliff stage of the game, transposed to D.

Joe Satriani has composed several songs using the Hungarian minor scale.

Church Modes
The Church Modes preceded the Major-Minor system. The student is advised to listen to the music of Palestrina as well as the jazz album Kind of Blue by Miles Davis; both use modes to great effect.

For example, in the key of C, the notes are:

C-D-E-F-G-A-B-C

If you wanted to play in the 2nd mode, called the Dorian mode, then you would just play the same notes, but start on the second note. So instead you would play:

D-E-F-G-A-B-C-D

The different modes are called:

 * Ionian
 * Dorian
 * Phrygian
 * Lydian
 * Mixolydian
 * Aeolian
 * Locrian

The Phrygian mode - E F G A B C D E - is of special interest to flamenco players. The third and seventh degrees are often sharpened, giving the scale notes E F G# A B C D# E. This arrangement is commonly used in descending form. The second degree of the scale is referred to as a leaning note, which means the note tends to fall one semitone. In this case F falls to E.

title: Guitar/Scales


text:
Visual Basic/Case Studies

=Introduction= Here you will find detailed discussions of actual applications complete with all the source code. This is not intended to be a software distribution so the code is not provided as zip files but as readable source code linked with comments. The idea is to learn from the code and the explanations, apply the lessons learnt and create something new. If anyone wants to improve the code it should be done in such a way that the reader can see both the improved and un-improved versions and, of course, there should be a thorough explanation of why the change was made, what it fixes and so on.

=Regular Expression Tester= While exploring the possibility for automated download of source code from Wikibooks I found a need to do some regular expression work. As my Regular Expression skills are a bit rusty I did a quick Google search for a tool that would let me test expressions. I found several tools but none were entirely suitable so I decided to write my own; it took about 15 minutes. It proved so useful in its prototype state that i have decided to include it as is without any clean up.

=JArithmetic= An example of multi-language, multi-paradigm programming. Or to say it in more down to earth terms: a program that use object oriented and traditional approaches to coding together with code in languages other than Visual Basic Classic as well as the use of external process and libraries. Take a look.

title: Visual Basic/Case Studies


text:
X86 Disassembly/Assemblers and Compilers

Assemblers
Assemblers are significantly simpler than compilers, and are often implemented to simply translate the assembly code to binary machine code via one-to-one correspondence. Assemblers rarely optimize beyond choosing the shortest form of an instruction or filling delay slots.

Because assembly is such a simple process, disassembly can often be just as simple. Assembly instructions and machine code words have a one-to-one correspondence, so each machine code word will exactly map to one assembly instruction. However, disassembly has some other difficulties which cannot be accounted for using simple code-word lookups. We will introduce assemblers here, and talk about disassembly later.

Assembler Concepts
Assemblers, on a most basic level, translate assembly instructions into machine code with a one to one correspondence. They can also translate named variables into hard-coded memory addresses and labels into their relative code addresses.

Assemblers, in general, do not perform code optimization. The machine code that comes out of an assembler is equivalent to the assembly instructions that go into the assembler. Some assemblers have high-level capabilities in the form of Macros.

Some information about the program is lost during the assembly process. First and foremost, program data is stored in the same raw binary format as the machine code instructions. This means that it can be difficult to determine which parts of the program are actually instructions. Notice that you can disassemble raw data, but the resultant assembly code will be nonsensical. Second, textual information from the assembly source code file, such as variable names, label names, and code comments are all destroyed during assembly. When you disassemble the code, the instructions will be the same, but all the other helpful information will be lost. The code will be accurate, but more difficult to read.

Compilers, as we will see later, cause even more information to be lost, and decompiling is often so difficult and convoluted as to become nearly impossible to do accurately.

Intel Syntax Assemblers
Because of the pervasiveness of Intel-based IA-32 microprocessors in the home PC market, the majority of assembly work done (and the majority of assembly work considered in this wikibook) is x86-based. Many of these assemblers (or new versions of them) can handle amd64/x86_64/EMT64 code as well, although this wikibook will focus primarily on 32 bit (x86/IA-32) code examples.

MASM
MASM is Microsoft's assembler, an abbreviation for "Macro Assembler." However, many people use it as an acronym for "Microsoft Assembler," and the difference isn't a problem at all. MASM has a powerful macro feature, and is capable of writing very low-level syntax, and pseudo-high-level code with its macro feature. MASM 6.15 is currently available as a free-download from Microsoft, and MASM 7.xx is currently available as part of the Microsoft platform DDK.

 * MASM uses Intel Syntax.
 * MASM is used by Microsoft to implement some low-level portions of its Windows Operating systems.
 * MASM, contrary to popular belief, has been in constant development since 1980, and is upgraded on a needs-basis.
 * MASM has always been made compatible by Microsoft to the current platform, and executable file types.
 * MASM currently supports all Intel instruction sets, including SSE2.

Many users love MASM, but many more still dislike the fact that it isn't portable to other systems.

TASM
TASM, Borland's "Turbo Assembler," is a functional assembler from Borland that integrates seamlessly with Borland's other software development tools. Current release version is version 5.0. TASM syntax is very similar to MASM, although it has an "IDEAL" mode that many users prefer. TASM is not free.

NASM
NASM, the "Netwide Assembler," is a free, portable, and retargetable assembler that works on both Windows and Linux. It supports a variety of Windows and Linux executable file formats, and even outputs pure binary. NASM is not as "mature" as either MASM or TASM, but is:
 * more portable than MASM
 * cheaper than TASM
 * strives to be very user-friendly

NASM comes with its own disassembler, and supports 64-bit (x86-64/x64/AMD64/Intel 64) CPUs.

NASM is released under the LGPL.

FASM
FASM, the "Flat Assembler" is an open source assembler that supports x86, and IA-64 Intel architectures.

(x86) AT&T Syntax Assemblers
AT&T syntax for x86 microprocessor assembly code is not as common as Intel-syntax, but the GNU Assembler (GAS) uses it, and it is the de facto assembly standard on Unix and Unix-like operating systems.

GAS
The GNU Assembler (GAS) is the default back-end to the GNU Compiler Collection (GCC) suite. As such, GAS is as portable and retargetable as GCC is. However, GAS uses the AT&T syntax for its instructions as default, which some users find to be less readable than Intel syntax. Newer versions of gas can be switched to Intel syntax with the directive ".intel_syntax noprefix".

GAS is developed specifically to be used as the GCC backend. Because GCC always feeds it syntactically correct code, GAS often has minimal error checking.

GAS is available as a part of either the GCC package or the GNU binutils package.

HLA
HLA, short for "High Level Assembler" is a project spearheaded by Randall Hyde to create an assembler with high-level syntax. HLA works as a front-end to other assemblers such as FASM (the default), MASM, NASM, and GAS. HLA supports "common" assembly language instructions, but also implements a series of higher-level constructs such as loops, if-then-else branching, and functions. HLA comes complete with a comprehensive standard library.

Since HLA works as a front-end to another assembler, the programmer must have another assembler installed to assemble programs with HLA. HLA code output therefore, is as good as the underlying assembler, but the code is much easier to write for the developer. The high-level components of HLA may make programs less efficient, but that cost is often far outweighed by the ease of writing the code. HLA high-level syntax is very similar in many respects to Pascal, which in turn is itself similar in many respects to C, so many high-level programmers will immediately pick up many of the aspects of HLA.

Here is an example of some HLA code:

Some disassemblers and debuggers can disassemble binary code into HLA-format, although none can faithfully recreate the HLA macros.

Compilers
A compiler is a program that converts instructions from one language into equivalent instructions in another language. There is a common misconception that a compiler always directly converts a high level language into machine language, but this isn't always the case. Many compilers convert code into assembly language, and a few even convert code from one high level language into another. Common examples of compiled languages are: C/C++, Fortran, Ada, and Visual Basic. The figure below shows the common compile-time steps to building a program using the C programming language. The compiler produces object files which are linked to form the final executable:

For the purposes of this book, we will only be considering the case of a compiler that converts C or C++ into assembly code or machine language. Some compilers, such as the Microsoft C compiler, compile C and C++ source code directly into machine code. GCC on the other hand compiles C and C++ into assembly language, and an assembler is used to convert that into the appropriate machine code. From the standpoint of a disassembler, it does not matter exactly how the original program was created. Notice also that it is not possible to exactly reproduce the C or C++ code used originally to create an executable. It is, however, possible to create code that compiles identically, or code that performs the same task.

C language statements do not share a one to one relationship with assembly language. Consider that the following C statements will typically all compile into the same assembly language code:

Also, consider how the following loop constructs perform identical tasks, and are likely to produce similar or even identical assembly language code:

Common C/C++ Compilers
The purpose of this section is to list some of the most common C and C++ compilers in use for developing production-level software. There are many many C compilers in the world, but the reverser doesn't need to consider all cases, especially when looking at professional software. This page will discuss each compiler's strengths and weaknesses, its availability (download sites or cost information), and it will also discuss how to generate an assembly listing file from each compiler.

Microsoft C Compiler
The Microsoft C compiler is available from Microsoft for free as part of the Windows Server 2003 SDK. It is the same compiler and library as is used in MS Visual Studio, but doesn't come with the fancy IDE. The MS C Compiler has a very good optimizing engine. It compiles C and C++, and has the option to compile C++ code into MSIL (the .NET bytecode).

Microsoft's compiler only supports Windows systems, and Intel-compatible 16/32/64 bit architectures.

The Microsoft C compiler is cl.exe and the linker is link.exe

Listing Files
In this wikibook, cl.exe is frequently used to produce assembly listing files of C source code. To produce an assembly listing file yourself, use the syntax:

cl.exe /Fa

The "/Fa" switch is the command-line option that tells the compiler to produce an assembly listing file.

For example, the following command line:

cl.exe /FaTest.asm Test.c

would produce an assembly listing file named "Test.asm" from the C source file "Test.c". Notice that there is no space between the /Fa switch and the name of the output file.

GNU C Compiler
The GNU C compiler is part of the GNU Compiler Collection (GCC) suite. This compiler is available for most systems and it is free software. Many people use it exclusively so that they can support many platforms with just one compiler to deal with. The GNU GCC Compiler is the de facto standard compiler for Linux and Unix systems. It is retargetable, allowing for many input languages (C, C++, Obj-C, Ada, Fortran, etc...), and supporting multiple target OSes and architectures. It optimizes well, but has a non-aggressive IA-32 code generation engine.

The GCC frontend program is “gcc" (“gcc.exe” on Windows) and the associated linker is “ld” (“ld.exe” on Windows). Windows cmd searches for the programs with “.exe” extensions automatically, so you don't need to type the filename extension.

Listing Files
To produce an assembly listing file in GCC, use the following command line syntax: gcc -S /path/to/sourcefile.c For example, the following commandline: gcc -S test.c will produce an assembly listing file named “test.s”. Assembly listing files generated by GCC will be in GAS format. On x86 you can select the syntax with  or. GCC listing files are frequently not as well commented and laid-out as are the listing files for cl.exe.

You may add `-g3` flags to enable source-code-level debugging symbols so you can see the line numbers in the listing. The  flag can help eliminate some macros in the listing.

Intel C Compiler
This compiler is used only for x86, x86-64, and IA-64 code. It is available for both Windows and Linux. The Intel C compiler was written by the people who invented the original x86 architecture: Intel. Intel's development tools generate code that is tuned to run on Intel microprocessors, and is intended to squeeze every last ounce of speed from an application. AMD IA-32 compatible processors are not guaranteed to get the same speed boosts because they have different internal architectures.

Metrowerks CodeWarrior
This compiler is commonly used for classic MacOS and for embedded systems. If you try to reverse-engineer a piece of consumer electronics, you may encounter code generated by Metrowerks CodeWarrior.

Green Hills Software Compiler
This compiler is commonly used for embedded systems. If you attempt to reverse-engineer a piece of consumer electronics, you may encounter code generated by Green Hills C/C++.


text:
Ada Programming/Attributes/'Count

Description
X'Count is an Ada attribute where X is an entry point in a protected type. This attribute returns the number of tasks currently enqueued waiting for entrance into the entry procedure.

Example
My_Protected_Type My_Entry; Get_Count( Task_Count : Natural ); My_Protected_Type; ...  Get_Count( Task_Count :  Natural ) Task_Count := My_Entry'Count; Get_Count;

Wikibook

 * Ada Programming
 * Ada Programming/Tasking

Ada Reference Manual

|Count

title: Ada Programming/Attributes/'Count


text:
Visual Basic/JArithmetic

=Introduction= JArithmetic is a prototype application intended to be a sort of poor man's MathCad.

When you start to write a program you need a set of requirements. Sometimes the goal is very precise and can be exhaustively described but it often happens that while the goal is clear it is neither desirable nor practical to describe in detail what the program is to do. JArithmetic is an example of the second type.

The basic requirements are these:
 * An editor for a document type that can include formulas and show both the formula and the result,
 * The editor must support text formatting (typeface, type size, type style.

Obviously such a set of requirements doesn't constrain the developer very much. In this case an additional consideration is this:

 * we aren't sure of the costs and benefits of different capabilities.
 * we aren't sure what we mean by formula,
 * we aren't sure what we mean by text formatting,
 * we aren't sure what we mean by result.

This means that we must develop the program a little before we can decide what additional requirements should be added. Still we ought not to just wander aimlessly in the programming landscape. Therefore we define a set of desired features, a wishlist:

 * It should be possible to include graphics in the document,
 * Results should be displayable as charts.

Another valuable list of characteristics is a negative one. That is a list of things that are not required. This doesn't mean that they are forbidden, just that time is not to be spent on developing them at the expense of required or wishlist features:

 * We will not demand the ability to format mathematical formulas in textbook style. That is, we are after some of the capabilities of Mathcad but are not trying to make camera ready copy.

With the basic requirements, the wishlist and the non-requirements in mind we can begin to sketch the outline of an implementation. However, before we go any further we should remind ourselves of the chief virtues of a programmer.

First the ones that get the process of programming moving, the passionate virtues:

 * laziness:never write code when you can 'steal' it, never write anything twice,
 * impatience:demand results now,
 * hubris:have pride in your power.

and then those that keep it going:

 * diligence:don't be satisfied with sloppy work,
 * patience:don't be deterred when things get slow and hard,
 * humility:take help gladly from whomever and where ever it comes.

The headwords are from Larry Wall but the definitions are mine.

So let's see how far our basic requirements and the passionate virtues can get us.

=Outline Implementation=

Nothing says we have to take the requirements in the order in which they are presented so lets combine the second one:

 * The editor must support text formatting (typeface, type size, type style

with the first two virtues: laziness and impatience to get a basic editor. Once we have that we can start to think about the other principal requirement:

 * An editor for a document type that can include formulas and show both the formula and the result.

The essence of this requirement is that the program must somehow read the document, work out the results of executing the formulas and then put the answers back into the document.

Basic Editor
Built into Windows is a component called the rich text editor. Visual Basic Classic can use this component. This component implements a fancy text box that supports all the typefaces that Windows can use along with type sizes and type styles such as italic, bold, etc. This looks like it should fulfil the requirement and the first virtue. Now let's be impatient.

All you have to do is create a new project and add a reference to the Rich Text control. On NT, Windows 2000 and XP this is usually found in:

x:\WINNT\system32\RICHTX32.OCX

and you can add the reference by clicking Components on the Project menu.

Now add a Rich Text box to the form. Don't worry about naming and resizing just now. .

Now run the project. Even with no code you have an editor in which you can type that understands tabs and newlines.

Now add the following code to the form:

Private Sub RichTextBox1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case Asc("B") - 64 RichTextBox1.SelBold = Not RichTextBox1.SelBold Case Asc("U") - 64 RichTextBox1.SelUnderline = Not RichTextBox1.SelUnderline Case Asc("I") - 64 RichTextBox1.SelItalic = Not RichTextBox1.SelItalic End Select End Sub

Don't worry about the lack of proper naming, constants and so on; this is just throwaway code to play with for the next five minutes.

Run the program, type some text, highlight some text (use the mouse or shift and arrow keys). Now press control-B, control-I or control-U. See the text style change.

This little experiment proves that we can get an editor that satisfies at least one of out principal requirements with almost no code.

Exercises

 * Read the documentation for the rich text control,
 * Extend the program to include font selection and indented paragraphs,
 * Think of another extension and implement it,
 * If you haven't already tried setting the text to italic with control-I try it now. Explain why it doesn't work.
 * Provide an alternative way of setting the bold, italic and underline attributes.

Processing the Document
Now we must see if we can find a way to satisfy our other requirement:

 * An editor for a document type that can include formulas and show both the formula and the result.

This is very vague and leaves to the readers imagination the definitions of a number of key words:

 * formulas:what is a formula? Does it look like the quadratic equations you see in a school text book?

 * result:Is a result a number? Could it be a set of numbers?  What about a chart?  What about text?

Now we could answer all these questions by doing an in depth study of the real meaning of the words and interview our end users about what they want but there is another way: turn around and face the other way, ask what have we already got that could do the job.

Look into your own experience and surroundings for ideas. You are or want to be a programmer so ask yourself 'what do our requirements remind me of?'. Look at our document type, it is made of formulas and results; formulas are just a kind of instruction, they say things like add a to b and multiply the answer by c and results are just whatever comes out of that process. Sounds remarkably like a computer program.

So if our document is to be a computer program we need to decide what language it will be written in. In principle we can use anything from textbook mathematical expressions with all the fancy symbols to Fortran, Lisp, Basic, Pascal, Prolog, etc., etc,. ad nauseam.

We apply Larry Wall's virtues:
 * hubris:tells us that we can implement what we like,
 * laziness:says that would be hard work,
 * impatience: says I can't wait that long!

So are there any languages that are already available to us in a form that our little program can use? The answer is a resounding yes. We can use one of the scripting languages: Ruby, Python, VBScript, JavaScript, etc.

Which one should we choose? We can dismiss some straightaway because they require too much work on our part or make the final program too big:

 * Ruby or Python:great languages, clean and powerful but need a significant amount of stuff to be installed before they will run,
 * VBScript or JavaScript:you probably already have these in the guise of the Microsoft Script Control.

So to get it flying quickly and be able to deliver it to a user who doesn't have Python or Ruby we'll choose the scripting control. We'll delay the choice of VBScript or JavaScript until later.

Processing the document is, in principle, simply a case of sending the text to the Scripting Control and reading back the answers.

Lets add the Scripting Control to the little experimental application. There is no need for a visible control so just add the reference:

Now add a command button to the form:

Now add this code to the form:

Private Sub Command1_Click Dim oSC As ScriptControl Set oSC = New ScriptControl oSC.Language = "JScript" oSC.Eval RichTextBox1.Text With RichTextBox1 .SelStart = Len(.Text) .SelText = vbCrLf & oSC.Eval("a") End With End Sub

Run the project and type:

a=1

in the rich text box. Make sure you delete anything else that might be there.

Now the moment of truth: click the command button. If all is well the number one should appear on the line following the a=1 statement.

Pretty boring though. Try something a little more exciting, clear the text and add this instead:

b=2 c=3 a=b*c

Click the button again. Should say 6. Click again and another 6 should appear.

Now it's time to explain what has been happening. The script control is actually an interpreter or the front end for an interpreter. In fact it can interpret both VBScript and JScript. VBScript is a sort of Visual Basic where all data is Variant and JScript is Microsoft's implementation of JavaScript.

The tiny scrap of code in the command button event handler just creates the script control, tells it which language to use, then asks it to evaluate the code in the rich text box. After that it asks to evaluate the simplest statement:

a

This returns the value of the variable a as the value of the Eval method. Then a little bit of magic with the rich text box adds that value to the end of the text.

This tiny application satisfies in essence all our requirements. Do some exercises before moving on the next section where we will criticize our poor little application and make some improvements.

Exercises

 * Examine the command button event and write a sentence or two of explanation and clarification for each line. Don't repeat what the code says, concentrate on explaining what it does and why.
 * Try the bold, italic and underline formatting commands. Do they affect the results?
 * Add more statements, more variables, make the statement that sets the a variable more complex.
 * If you know JavaScript you can add a function, use the function to set the value of a. If you don't know JavaScript then it's time to learn.

title: Visual Basic/JArithmetic


text:
X86 Disassembly

Preface
The act of program creation, using common compilers and assemblers, takes software from an information-rich source code format and transforms it into a difficult-to-read machine code format. The reverse process, trying to convert machine code into a human-readable format, is significantly more difficult and requires high-level intuition and pattern matching skills.

This book is going to discuss the disassembly and decompilation of x86 machine code and x86 assembly code.

 * This book is new and could use your help. We need help with proof-reading, content authoring, editing and more. This is a wiki, so feel free to join in.

Table of Contents

 * Cover
 * Introduction

Tools

 * Assemblers and Compilers
 * Disassemblers and Decompilers
 * Disassembly Examples
 * Analysis Tools

Platforms

 * Microsoft Windows
 * Windows Executable Files
 * GNU/Linux
 * Linux Executable Files
 * OS X
 * OS X Executable Files

Code Patterns

 * The Stack
 * Functions and Stack Frames
 * Functions and Stack Frame Examples
 * Calling Conventions
 * Calling Convention Examples
 * Branches
 * Branch Examples
 * Loops
 * Loop Examples

Data Patterns

 * Variables
 * Variable Examples
 * Data Structures
 * Objects and Classes
 * Floating Point Numbers
 * Floating Point Examples

Difficulties

 * Code Optimization
 * Optimization Examples
 * Code Obfuscation
 * Debugger Detectors

Resources and Licensing

 * Resources
 * Licensing
 * Manual of Style

title: X86 Disassembly


text:
Cookbook:Garlic Pork Chops with Black Mushrooms

| California cuisine

Pan fried pork chops are topped with a spicy, mushroom, and garlic sauce to make an elegant Asian-inspired dish.

Ingredients

 * 1 cup pork broth
 * 1 ounce dried black chanterelle mushrooms
 * ¼ cup rice wine vinegar
 * 2 tablespoons soy sauce
 * 2 tablespoons honey
 * ¼ teaspoon hot-pepper flakes
 * 2 teaspoons sesame oil
 * 4 cloves garlic, minced
 * 1 tablespoon minced fresh ginger
 * 4 boneless pork chops, ½-inch thick

Procedure

 * 1) Bring the chicken broth to a boil in a small saucepan. Add the dried mushrooms, and simmer over low heat for about 10 minutes.
 * 2) In a small bowl, stir together the vinegar, soy sauce, honey, and red pepper flakes. Set aside.
 * 3) Heat the sesame oil in a large non-stick skillet over medium heat. Add the pork chops, and brown for about 2 minutes on each side. Add the garlic and ginger; cook and stir until fragrant.
 * 4) Stir in the soy sauce mixture, and bring to a boil. Reduce the heat to low, and simmer for 5 minutes, uncovered.
 * 5) Remove the mushrooms from the pan using a slotted spoon, and slice into thin strips. Stir the mushrooms and chicken broth into the pan with the pork chops, and simmer uncovered over low heat until the sauce has reduced by about ⅓, and the pork chops are cooked through.
 * 6) To serve, place pork chops onto serving plates, and spoon mushroom sauce over them.

Notes, tips, and variations

 * When doubling recipe, don't double vinegar or red pepper flakes—use ⅛ more of each.
 * When combining vinegar, soy sauce, honey, and red pepper flakes, let it macerate for 5 minutes, then check for balance/taste.
 * Try pre-brining pork.
 * Add baby bok choy or replace the mushrooms with the baby bok choy.


text:
Ada Programming/Pragmas/Volatile

pragma Volatile (local_name);

Description
Volatile is a representation pragma that can be used with types and variables to specify that the variable in question may suddenly change in value. For example, this may occur due to a device writing to a shared buffer.

When this pragma is used, the compiler must suppress any optimizations that would interfere with the correct reading of the volatile variables. For example, two successive readings of the same variable cannot be optimized to just one or reordered.

Compare with pragma Atomic, Atomic_Components, and Volatile_Components.

Example
Video_Buffer  (Natural  <>)  RGB_Value; (Video_Buffer);

Ada versions

 * This pragma is available in Ada 95 and Ada 2005 (Annex C, a specialized needs annex).
 * In Ada 83 there is not an standard pragma completely equivalent to Volatile. However, pragma Shared is similar to Atomic (although it is obsolescent since Ada 95), and some compilers added an implementation-defined pragma for this purpose.

Compilers
Volatile is a standard pragma since Ada 95, defined in the Systems Programming Annex (Annex C). This is a specialized needs annex, therefore this pragma is not available in those compilers not implementing that annex.

Platforms
This pragma is portable to different architectures and operating systems.

Interfacing
In C/C++, the volatile qualifier is equivalent to this pragma. However, this C qualifier is used for both volatile and atomic data, even if atomic access is required. Therefore, when interfacing with existing C code, the programmer must read the code to understand whether the data needs atomic load and stores. If needed, the data should be marked in the Ada side with pragma Atomic or Atomic_Components, or with pragma Volatile or Volatile_Components otherwise.

Volatile objects without address clauses
In many cases, when a volatile object is used for interfacing with a hardware device it should have an address clause too.

 * gnatcheck:

+R Volatile_Objects_Without_Address_Clauses

 * AdaControl:

check object_declarations (volatile_no_address);

Wikibook

 * Ada Programming
 * Ada Programming/Pragmas
 * Ada Programming/Pragmas/Atomic
 * Ada Programming/Pragmas/Atomic Components
 * Ada Programming/Pragmas/Volatile Components
 * Ada Programming/Pragmas/Shared (obsolescent)

title: Ada Programming/Pragmas/Volatile


text:
Rebol Programming/Third party

Brief descriptions of third party and other tools commonly used

 * Cheyenne - a web server implementation

 * Async Call - asynchronous call implementation

 * NTLM - support for the Microsoft NTLM (NT Lan Manager) authentication scheme over a Windows LAN

 * Captcha - visual captcha generation

 * NT-services - support for the Windows Services

 * Uniserve - a client/server network programming framework

 * MakeDoc - a tool for creating HTML documents

 * Pdf-maker - a tool for simple and fast PDF creation

 * NicomDoc - John Niclasen's "simplified-markup to HTML" converter.

 * Rugby - a request broker

 * BEER Framework - Block Extensible Exchange in Rebol

 * RebGUI - an alternative to VID

title: Rebol Programming/Third party


text:
Biblical Studies/Christianity/The Bible/KJV

In 1604, King James VI of Scotland and I of England authorized that a new translation of the Bible into English be started. It was finished in 1611, just 85 years after the first translation of the New Testament from Greek into English appeared (Tyndale, 1526). It has been the standard English version for the past 400 years. The King James Bible (KJV) is public domain in the United States.

 * Preface

Old Testament

 * Genesis
 * Exodus
 * Leviticus
 * Numbers
 * Deuteronomy
 * Joshua
 * Judges
 * Ruth
 * 1 Samuel
 * 2 Samuel
 * 1 Kings
 * 2 Kings
 * 1 Chronicles
 * 2 Chronicles
 * Ezra
 * Nehemiah
 * Esther
 * Job
 * Psalms
 * Proverbs
 * Ecclesiastes
 * Song of Solomon
 * Isaiah
 * Jeremiah
 * Lamentations
 * Ezekiel
 * Daniel
 * Hosea
 * Joel
 * Amos
 * Obadiah
 * Jonah
 * Micah
 * Nahum
 * Habakkuk
 * Zephaniah
 * Haggai
 * Zechariah
 * Malachi

New Testament

 * Matthew
 * Mark
 * Luke
 * John
 * Acts
 * Romans
 * 1st Corinthians
 * 2nd Corinthians
 * Galatians
 * Ephesians
 * Philippians
 * Colossians
 * 1st Thessalonians
 * 2nd Thessalonians
 * 1st Timothy
 * 2nd Timothy
 * Titus
 * Philemon
 * Hebrews
 * James
 * 1st Peter
 * 2nd Peter
 * 1st John
 * 2nd John
 * 3rd John
 * Jude
 * Revelation


text:
User:Apina

Need to know free (as in freedom) electronics CAD program to draw schematics to wikipedia. Preferably is in Debian distribution, but I can compile it from sources, too.

title: User:Apina


text:
User:Bobwinmill~enwikibooks

I hope to contribute.

Some experience in space systems. USAF TAV program from 1982-84, AFWL 1984-86. Then dropped out because of lack of progress with existing fundamental technologies. Became interested again with change in policy emphasis to more private activities and some fundamental new technologies.

title: User:Bobwinmill~enwikibooks


text:
Rebol Programming/Developer

Discuss available resources here ...

Rebol.com
http://www.rebol.com -- Home of Rebol Technologies.

Rebol.net
http://www.rebol.net -- Links to many other developer resources.

Rebol.org
http://www.rebol.org -- Script library and searchable archive of the mailing list.

RIX
http://babelserver.org/rix - Search engine indexing only sites related to Rebol.

title: Rebol Programming/Developer


text:
User talk:Ferox~enwikibooks

Hi Ferox,

we are currently working on restructuring the Programming:C plus plus book. We would love your input at Talk:Programming:C plus plus/Table of contents. Thanks. --Max 00:42, 15 September 2005 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Ferox. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Ferox~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:10, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 04:59, 19 April 2015 (UTC)

title: User talk:Ferox~enwikibooks