text:
Cookbook talk:Snickerdoodles IV

This is just a recipe, which wikipedia purports not to be for!!
 * You're right about this article as it stands. I believe it has potential for expansion into an encyclopedia article (as soon as I can find some references), but in its current state there's not much to it. I would just ignore it as harmless until it is expanded, but if you really think it should be deleted you can nominate it at WP:VFD. -Aranel (" Sarah ") 12:55, 15 August 2005 (UTC)

why would an encylopedia article for a "major" cookie like the snickerdoodle not include a recipe? Wouldn't that be like an article on water that forgot to mention H2O? While wikipedia doesn't want to get filled up with silly recipes, a recipe serving as a definition of an important cultural icon should be acceptable.

contradiction?
How do we know it's a "creation of nineteenth century New England," if the article then goes on to say that "An interesting side of the snickerdoodle’s history is that the recipe for the cookies cannot be found in any 18th-19th century American cookbook." Joyous | Talk 02:24, 11 December 2005 (UTC)

The recipe will be removed
Per Wp:not point 4, recipes are not appropriate for a wikipedia article. The recipe will be transwikied to wikibooks cookbook, at which point it will be removed from this article. --Xyzzyplugh 14:29, 5 August 2006 (UTC)

Hey all you Snickerdoodle fans
Ya'll should just shut shuttin up whilst talkin' bout the infamous Snicky McDoodle McCookie

Comment
If you attempt to use this recipe (Recipe 2) all you will make is a huge mess in your oven. Butter and flour are in wrong proportions.

Unit conversion
I made the first recipe, and while it tastes fine, the dough was the consistency of wet sand, which tipped me off that there might have been too much flour. After looking at the recipe, I changed it so the gram measurements made more sense (flour and sugar should not be the same density). I used an online converter (https://convertunits.online/food-conversion/flour/flour-cups-to-grams/), but I'll probably also measure it out next time I make it just to confirm. The ounce measurements also seem inconsistent, but I'm not well-versed enough in baking to know how those should be read.

Split into separate pages
I came to this page this morning to make snickerdoodles, and I found it almost unreadable. I counted at least 5 different recipes, without much rhyme or reason why I'd use one or the other.

I broke it up into 5 articles, with alternatives like "use honey instead" left as comments on the recipe they were closest to.

I'm going to try making the main recipe and see if it's OK. It may make sense to just delete the alternatives; this isn't a particularly complicated food that needs a lot of variants. --EvanProdromou (discuss • contribs) 17:00, 2 December 2021 (UTC)

 * I couldn't do it. The proportions seem nuts, and there are complaints about the recipe above. I'm going to try alternative 1, and if it works OK, I'll move it to main recipe. --EvanProdromou (discuss • contribs) 17:38, 2 December 2021 (UTC)

 * After two trials, I was able to get one of the recipes to work and make snickerdoodles that my family liked, so I used it on the main article here. I moved the vinegar one to its own alternative article. --EvanProdromou (discuss • contribs) 23:46, 2 December 2021 (UTC)

Make disambiguation page?
Given that there are several different snickerdoodle recipes in the cookbook, I think it would make sense to reserve Cookbook:Snickerdoodles as a disambiguation page with links to various snickerdoodle recipes, per the naming policy. I suggest moving this recipe to a new title without a redirect, and then making Cookbook:Snickerdoodles a disambiguation. See Cookbook:Chocolate Chip Cookies as an example of this. Thoughts? -- Nostriker (discuss • contribs) 23:43, 20 January 2022 (UTC)

title: Cookbook talk:Snickerdoodles IV


text:
Cookbook talk:Sambar I

=From wikipedia (transwikied 12:05, 17 October 2006 (UTC))=

Facts
(Referring to the Tamil portion). Is it accurate to say Kozhambu are a variant of sambar? As I saw it, sambar is a form of kozumbu made with tamarind and lentils.

Move
Moved Sambhar to Sambar. Ambarish Talk 19:42, 4 May 2004 (UTC)

Disambiguation
Disambiguated the deer from the dish. Ambarish Talk 07:55, 8 May 2004 (UTC)

Recipe
Recipe for Sambar removed from this page and moved to Wikibooks. Kevyn 07:07, 23 Aug 2004 (UTC)

info about Saaru
I am moving this here, since the info is false here but can be moved to an article about saru/rasam with a bit of tweaking. Sambar without significant vegetable content is called Saru in Karnataka''. Saru without lentils is called hunise saru (tamarind saru), which becomes menasina saru (pepper saru) if pepper is added.'' -- Pamri • Talk 09:35, 20 October 2005 (UTC)
 * Thanks Pamri, I had a doubt about this. -- Sundar \talk \contribs 13:54, 20 October 2005 (UTC)

Cookbook templates
I added both the templates copy to Wikibooks Cookbook and Cookbook, despite the fact that they are generally mutually exclusive. I did this because the Cookbook already has a page on Sambar, but it doesn't have these recipes. If anybody has any better ideas, or wants to put it on the Cookbook and be done with it, go ahead. -- kenb215 06:40, 29 September 2006 (UTC)

=Wikibooks=

I copied this over because there are 2 more recipes, both different from what's on Cookbook:Sambar -- SB_Johnny | talk 12:05, 17 October 2006 (UTC)

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

title: Cookbook talk:Sambar I


text:
Wikijunior:The Elements/Iodine

What does it look, feel, taste, or smell like?
Iodine is a dark grey or purple solid. It can sublimate into a purple-pink gas that has an irritating odor.

How was it discovered?
Iodine was discovered by Barnard Courtois in 1811 by accident.

Where did its name come from?
Iodine gets its name from the Greek word iodes, which means purple. It is a purple element in both the solid and gas phase.

Where is it found?
Iodine is mostly found in seawater as iodide (I-). Seaweed and kelp can absorb iodide and store it, making it easy to harvest.

 Did You Know?
 * Iodine changes directly from a solid to a gas at room temperature (this is called sublimation).
 * Although many people think of iodine as a dark bluish liquid, it's actually a purple solid.

What are its uses?
Iodine is necessary as part of the diet of many organisms. This is because it is part of thyroid hormones produced by the thyroid gland in your neck. Not consuming enough iodine causes a condition called goiter, where the thyroid gland grows abnormally (so, ironically, does consuming too much iodine.) We "iodize" salt by putting iodine in it, converting some of the salt to sodium iodide (NaI), so that we can get the proper amount of iodine in our diet.

A solution of iodine is also used to kill bacteria when someone gets a cut.

Finally, iodine can be used to test for the presence of starch, because starch turns dark blue when it combines with iodine.

Is it dangerous?
Elemental iodine is dangerous and poisonous. Do not touch it.

title: Wikijunior:The Elements/Iodine


text:
User:Kenb215

I am a user mainly at the English Wikipedia. See my userpage there.

title: User:Kenb215


text:
User talk:Kenb215

I can usually be found at Wikipedia. To contact me, use my talk page there.

title: User talk:Kenb215


text:
Basic Physics of Nuclear Medicine/Three-Dimensional Visualization Techniques

Introduction
This is a developing chapter of a wikibook entitled Basic Physics of Nuclear Medicine.

Three-dimensional visualization techniques are used to integrate a series of tomographic slices into a form which is often easier to interpret than the slices on their own. An overview of the major visualization techniques used in medical imaging is presented in this chapter. We'll start with the integration of two-dimensional (2D) axial images before considering various three-dimensional (3D) image presentation methods.

The following set of images will be used to help us with our task. They consist of a SPECT lung-ventilation study, illustrated by the animated sequence on the left, a SPECT lung-perfusion study, in the middle, and a CT pulmonary angiogram (CTPA) from the same patient on the right:

We'll use these image sets at various stages in this chapter so as to provide examples which will help with demonstrating the essence of the techniques we'll consider. Acquisition factors for the image sets include 128 x 128 pixel slices each of thickness 4.8 mm for the SPECT studies and 512 x 512 pixel contiguous slices of thickness 1.5 mm for the axial images reconstructed from the CTPA helical scan. In addition, the lung-perfusion scan was acquired immediately following the ventilation scan, so that residual activity from the latter is present in the former at a level of about 20%.

Its helpful, before proceeding, to consider the axial slices, be they SPECT or CT, stacked one behind the other, as illustrated below:

Notice that the figure illustrates each image as a thin slice when the data represents in reality a slice wide enough to fill the gap between it and the next slice, so that the image data can be considered to be a matrix of volume elements – called voxels for short.

A convention applied in medical imaging is to display axial image stacks with the axes oriented as shown in the following figure:

So the left side of an axial scan represents the patient's right side viewed from below, with their anterior surface at the top of the image. A modification of a little ditty by Spike Milligan might help you remember this perspective:

You're likely to find that its a good idea to experience the real thing when reading this chapter so as to help overcome the abstract nature of many of the topics we'll encounter, as well as the limitations of using a 2D medium (i.e. this webpage) to communicate 3D visualization concepts. Numerous open source 3D programs and image libraries are available via the World Wide Web. The software used to generate images in this chapter, for instance, includes OsiriX (MacOS X only), Madena and ImageJ (multi-platform).

Axial Projection
The first technique we'll consider is a relatively simple one called Axial Projection. It involves integrating a number of axial images to display a composite which presents a three-dimensional impression of that volume of image data. The technique is sometimes referred to as Thick Slab or Z-Projection.

The figure below illustrates the outcome of a range of z-projection methods, with a single slice shown in the bottom right hand corner for reference purposes. The first image in the top left shows the result of summing 16 slices, and the other two images on that row show the results of computing the mean and median of these slices.

The first two images in the second row show the result of what are called a Maximum Intensity Projection (MIP) and a Minimum Intensity Projection (MinIP), respectively. A MIP evaluates each voxel along each line of voxels through the volume to determine the maximum voxel value and forms an image using the values so determined for each line. A MinIP uses the minimum voxel values, as illustrated in the following figure:

Volume rendered projections are shown in the first two images along the bottom row of our collection of example axial projections. This image compositing method involves applying an opacity function to the voxel data as well as a recursive addition of the resulting data. An equation of the form:

Cn = An + Bn

where

 * An = (α).(Voxel Value of voxel, n) ,
 * Bn = (1-α).(Voxel Value of voxel, n-1), and
 * α = opacity, in the range 0 (i.e. fully transparent) to 1 (i.e. fully opaque),
 * α = opacity, in the range 0 (i.e. fully transparent) to 1 (i.e. fully opaque),
 * α = opacity, in the range 0 (i.e. fully transparent) to 1 (i.e. fully opaque),

is applied to each line of voxels as illustrated in the following figure:

The figure shows the line of voxels we've used previously with an opacity table in the top right corner. The opacity function shown is one where a zero opacity is applied to voxel values below a threshold level, a linear increase in opacity is applied to an intermediate range of voxel values and maximum opacity applied to high voxel values. The opacity table is somewhat like the look-up table used for greyscale windowing which we've described earlier, with the function applied to the opacity of voxel values instead of to their grey levels. Note that more complex opacity tables to the one used in our figure above can be also applied, e.g. logarithmic and exponential functions.

The bottom half of the figure shows the steps involved in calculating the volume rendered value of the composited voxel. Voxel values are shown on the top row with opacity values, derived from a crude opacity table, for each voxel shown on the second row. The third, fourth and fifth rows detail the values of A, B and C , calculated using our volume rendering equation above. The final voxel value is obtained by summing the bottom row, and normalizing the result to, say, a 256 level grey scale.

The outcome of this form of processing is the generation of an image which includes visual depth cues on the basis that similar voxel values will be displayed with a similar transparency and those closest to the reference slice having a stronger contribution than those from more distal slices. Further, note that all voxel values in each line contribute to the rendered image, in contrast to the limited number of voxels that contribute to a MIP or a MinIP image. A 3D effect results from volume rendering, as illustrated in the images above.

Notice that volume rendering can be applied from distal to proximal slices, as illustrated in our figure, as well as in the opposite direction, i.e. from proximal to distal slices. Hence the terms Volume Rendering Up and Volume Rendering Down used in our set of nine example images above.

The type of axial projection method appropriate to an individual patient study is dependent on the anatomical and/or functional information of relevance to the diagnostic process. Let's take the case of imaging contrast-filled blood vessels, for example, in our nine example images above. Note that a MIP can be used to give a visually-stunning impression of the vessel bed in the patient's lungs. There's little depth information in this projection, however, so that overlapping and underlying vessels can obscure lesions that might be present in blood vessels of interest. The application of this form of axial projection to angiography is therefore limited to studies where vessel overlap isn't an issue. The inclusion of voxel transparency and depth weighting in volume rendered images addresses this limitation of MIP processing.

A final point to note is that this form of image projection can also be applied to multi-planar reconstructions of axial slices, which we'll consider next.....

Multi-Planar Reconstruction
In the simplest case, multi-planar reconstruction (MPR) involves generating perspectives at right angles to a stack of axial slices so that coronal and sagittal images can be generated. We'll start this section by describing these orthogonal projections before considering their synchronized composite display. We'll also describe three variants on this theme: oblique reconstruction, curved reconstruction and integrated three-dimensional presentation.

 * Coronal Reconstruction

 * Here the image stack is rotated so that the z-axis becomes the vertical and a stack of images is reconstructed using parallel planes of voxels arranged from the patient's anterior to posterior surface, as illustrated in the following figure:

 * Example coronal reconstructions from our image sets are shown below:

 * Here the reconstructed slices are typically displayed from the patient's anterior to their posterior surface with the patient's head towards the top of the slices and their right hand side on the left of the slices.

 * Sagittal Reconstruction

 * Sagittal reconstructions are possible through additional rotations of the image stack so that a patient's left-to-right slice sequence can be generated as illustrated in the following figure:

 * Example sagittal reconstructions from our image sets are shown below:

 * Here the reconstructed slices are typically displayed from the patient's left to right side, with their head towards the top and their anterior surface towards the left of the slices. Note that a right-to-left sagittal stack can also be generated using additional geometric transformation of the data.

 * Composite MPR Display

 * Coronal and sagittal reconstructions are referred to as Orthogonal MPRs because the perspectives generated are from planes of image data which are at right angles to each other. Composite MPR displays can be generated so that linked cursors or crosshairs can be used to locate a point of interest from all three perspectives, as illustrated in these images:

 * This form of image presentation is sometimes referred to as a TCS display – implying the viewing of T ransaxial, C oronal and S agittal slices. It can be combined with the slice projection methods we discussed earlier, as illustrated in the two sets of images below, where the blue lines highlight the limits of the coronal projections:

 * Oblique Reconstruction

 * Oblique MPRs are possible by defining angled planes through the voxel data, as illustrated in the following figure:

 * Here the plane can be defined in, say, the axial images (red line, top left) and a maximum intensity projection (the limits used are highlighted by the blue lines), for example, can be displayed for the reconstructed plane (right). This technique is useful when attempting to generate perspectives in cases where the visualization of three-dimensional structures is complicated by overlapping anatomical detail.

 * Curved Reconstruction

 * Curved MPRs can be used for the reconstruction of more complex perspectives, as illustrated in the next figure:

 * Here a curve (highlighted in green) can been positioned in the axial images (left panel) to define a curved surface which extends through the voxel data in the z-direction, and voxels from this data can be reconstructed into a two-dimensional image (right panel). Note that more complex curves than the one illustrated can be generated so that, for instance, the three-dimensional course of a major blood vessel can be isolated, or CT head scans can be planarized for orthodontic applications.

 * 3D Multi-Planar Reconstruction

 * A final variant on the MPR theme is the generation of a three-dimensional display showing all three orthogonal projections combined so that a defined point of interest locates the intersection of the planes, as illustrated in the following figure:

 * The point of intersection is located for illustrative purposes at the centre of the voxel data in the figure above. It can typically be placed at any point in the 3D data using interactive controls. In addition, the perspective used for the rotating sequence can typically be manipulated interactively to improve the visualization of a region of interest.  Note that the image sequence illustrated above is one from a myriad of perspectives that can thus be generated.  Note also that slice projections (e.g. MIPs) can be combined with this form of display to provide additional perspectives on a feature of interest.

Maximum Intensity Projection
We've described the maximum intensity projection (MIP) earlier in the context of axial projection, where the maximum voxel value is determined for lines running in parallel through the projected slice thickness. A sequence of such images can be generated when this computation is applied at successive angles around the voxel data. One simple sequence is a rotating one for 360 degrees around the horizontal plane, as illustrated in the left panel of the figure below, where the maximum intensity is projected for every 9 degrees around the patient and the resultant 40 images compiled into a repeating, temporal (e.g. movie) sequence:

Notice that the 3D MIP derives its information from the most attenuating regions of the CT scan (given that the CT-number is directly dependent on the linear attenuation coefficient) and hence portrays bone, contrast media and metal with little information from surrounding, lower attenuating tissues. Notice also that continued viewing of the rotating MIP sequence can generate a disturbing effect where the direction of rotation appears to periodically reverse – which may be an aspect of perceptual oscillation. The perspective MIP, illustrated in the panel on the right in the above figure, can reduce this limitation by providing spatial cues which can be used to guide continued visual inspection.

Perspective projections can be generated by changing from the parallel lines used to generate the parallel projections to lines of voxels which diverge from an apparent point behind the volume at a distance such that the viewer of the display can visualize closer features of the image data as relatively larger than deeper features – see the following figure:

Volume Rendering
Volume rendering can be applied to the voxel data in the successive rotation manner described for MIPs above, as illustrated by the results in the following figure:

Note that the volume rendering can be contrast enhanced so as to threshold, for instance, through the voxel values to eliminate low attenuating surfaces, as illustrated in the following figure:

Note also that the colour look-up table (CLUT) can be varied to highlight features of particular interest, as shown in the set of images below:

The influence of the opacity table is illustrated in the following example images:

The influence on volume rendering of various shading settings is shown below:

The shading settings used for the above images are as follows:

A final feature to note about volume rendering is that 3D editing techniques can be applied so as to exclude unwanted features from the computations and to expose internal structure. This is illustrated in the following figure, where planes of an orthogonal frame can be moved to crop the voxel data from six directions.

Surface Rendering
Surface rendering is also referred to as Shaded Surface Display (SSD) and involves generating surfaces from regions with similar voxel values in the 3D data as illustrated by the SPECT lung-perfusion scan shown in the left panel below:

The process involves the display of surfaces which might potentially exist within the 3D voxel data on the basis that the edges of objects can be expected to have similar voxel values. One approach is to use a grey-level thresholding technique where voxels are extracted once a threshold value is encountered in the line of the projection – see the following diagram. Triangles are then used to tesselate the extracted voxels, as shown in the right panel of the figure above – and the triangles are filled using a constant value with shading applied on the basis of simulating the effects of a fixed virtual light source – as shown in the left panel above.

An opacity table can be applied to the results so that surfaces from internal features can also be visualized. As an example, two surfaces have been identified in the following image from the CT scan where voxel values from bone surfaces are coded in an opaque yellow colour and tissue surfaces in a transparent shade of red.

A second example of using an opacity table is shown in the following figure. Here, axial CT data from the patient's airways have been segmented using a region growth technique and the result processed using surface rendering, with full opacity as shown in the left panel and with a reduced opacity (30%) as shown in the right panel:

Notice that internal features of each lung can be discerned when the opacity is reduced. Notice also that continued viewing of this type of transparency display can generate apparent reversal of the image rotation, similar to that noted for the 3D MIPs above. One method of overcoming this type of problem is to segment each lung, for instance. and to blend the results, as illustrated in the following figure:

subFusion Processing
We'll conclude this chapter by considering an application of 3D visualization which integrates many of the image processing techniques we've described in this wikibook. We'll use the two SPECT scans, from a patient's lung-ventilation (V) and lung-perfusion (Q) studies, in an attempt to visualize any mismatch(es) characteristic of pulmonary embolism (PE). The application we'll consider is called subFusion Processing because it involves both image subtraction and image fusion techniques.

Note again that the SPECT studies were generated using a swamping technique where the perfusion scan was acquired immediately following the ventilation scan using an administered activity which generated a relative count rate of about 5:1 between scans. The first image processing step therefore is to correct the perfusion scan for the background ventilation activity.

Since the ventilation tracer in this case was administered using a aerosol, we can assume for simplicity that its biodistribution is reasonably identical in the two scans. Further, since the scans were acquired about 15 minutes apart using the 99mTc radioisotope, we can assume a negligible effect from radioactive decay. We can simply therefore subtract the ventilation stack from the perfusion stack, on the basis of these assumptions, to isolate what we'll call the "pure perfusion" scan.

The second step is to normalize the two scans by multiplying the ventilation stack by a factor such that the mean counts (for example) in the two stacks are similar.

 * We can now compare apples with apples!

Since a PE mismatch is likely to arise from regions of the lungs which contain counts in the ventilation scan and are relatively bereft of such counts in the perfusion scan, we can subtract the "pure perfusion" stack from the ventilation stack, as a third image processing step, to isolate any such differences as positively-valued features.

The final image processing step is to volume render this difference stack along with the "pure perfusion" scan and to blend the results, as illustrated in the following image:

The steps involved are outlined in the following diagram. Note that minor processes, such as CLUT selection, relative opacity adjustment and contrast enhancement are omitted from this diagram for the sake of simplicity. Note also that an image registration step may need inclusion at the beginning of the procedure in cases where patient movement occurs between the two SPECT acquisitions.

A final point to note is the larger appearance of the patient's lungs in the segmented CTPA images relative to the SPECT images. This arises because the CTPA study was acquired using a single breath-hold and the SPECT studies with the patient breathing quietly over the period of gamma camera rotation. The spatial registration of the three sets of images is therefore not possible directly, and would require the application of spatial warping and other techniques which, unfortunately, are beyond the scope of our treatment here.


text:
Talk:Communication Theory/Uses and Gratifications

Ien Ang is cited here but not mentioned in bibliography. Ditto Ruggiero.

The quote from McQuail comes from pages 82-3, not "p. 73"


text:
CDuce/Directives

#help
The CDuce directive #help lists the available toplevel directives: Toplevel directives: #quit;;                quit the interpreter #env;;                 dump current environment #reinit_ns;;           reinitialize namespace processing #help;;                shows this help message #print_type ;; #silent;;              turn off outputs from the toplevel #verbose;;             turn on outputs from the toplevel #builtins;;            shows embedded OCaml values
 * 1) help;;

#quit
The CDuce directive #quit permits to quit (e.g. exit) the toplevel interpreter. The keys Ctrl-C and Ctrl-D do the same thing.

#env
The CDuce directive #env lists among other things the defined types. Types: Namespaces AnyXml String Record Latin1 Empty Arrow Float Pair Char Atom Bool Byte Any Int ...
 * 1) env;;

#print_type
The CDuce directive #print_type shows a representation of a CDuce type. [ Char* ]
 * 1) print_type String;;

title: CDuce/Directives


text:
Cookbook:Ginger Beer

| Fermented food recipes

Ginger beer is a traditional fermented drink that can be made as either a soft drink or an alcoholic drink. Make it in a carboy with more sugar or malt extract and with longer fermentation time to get alcoholic ginger beer.

Ingredients

 * 100–300 grams fresh ginger root, peeled and grated
 * 1 whole lemon, zested and juiced OR 2 tsp cream of tartar mixed with lemon extract or zest to make a lemon juice substitute.
 * 500 grams sugar
 * Water
 * Fermentation starter (see note)

Procedure

 * 1) Simmer the ginger, lemon zest and sugar in about 1.5 L water for about 10 minutes.
 * 2) If using yeast as the fermentation starter, rehydrate the yeast in a glass of warm water for 5 minutes.
 * 3) Add the lemon juice and enough water to get 10 L to the fermenter (see note).
 * 4) Let the mixture sit in the fermenter until it has started bubbling well, which should take 8–12 hours with yeast or longer with kefir grains.
 * 5) Bottle into PET bottles or other food-safe bottles.
 * 6) When the bottles are hard (not just firm) from the carbonation, put them into the fridge for storage.
 * 7) Serve cold.

Notes, tips, and variations

 * For the fermentation starter, you can use kefir grains or tibicos, ginger beer plant, ginger bug, ale yeast, or bread yeast.
 * Lemon juice is to provide acidity as well as flavor.
 * For a fermenter, you can use anything from an old PET water bottle to a food-grade bucket or a large stainless-steel pot; don't use copper or aluminium.
 * The water used should be free of chlorine if possible (e.g. boiled and cooled, or filtered, or bottled spring water). This is because chlorine (or chloramine) will inhibit the fermentation a little. Use what you've got, but best results will be obtained without the chlorine.
 * Once the ginger beer is fermenting, as evidenced by lots of tiny bubbles rising to the surface, it can be used as a leavening agent. Simply replace the water and yeast in a bread recipe with ginger beer, and leave to rise as normal.
 * If left to ferment longer (about a week) a yeasty colony called a ginger beer plant will develop. Carbonation will also increase, greatly raising the chances for bottle (or other container) exploding; therefore, it is advisable to use a carboy or suitable container with an airlock.

title: Cookbook:Ginger Beer


text:
CDuce/Types/Int

CDuce integers are arbitrarly large, positive or negative. The three literals 9 09 009 correspond to the same integer. It corresponds also to the type "integer of value nine" which is a singleton set containing the integer 9. -> 9
 * 1) print_type 9;;

The expression type Foo = 1 | 2 | 3 | 4 define the type Foo which corresponds to the set containing the first four positive integer. An other way to construct a set of consecutive integers: type Foo = 1--4

-> -3---1
 * 1) print_type -1 | -2 | -3;;

The sets of strictly positive and strictly negative integers, and constructions from them type Positive = 1--* type Negative = *---1 type NonNul = Positive | Negative -> Int
 * 1) print_type NonNul | 0

title: CDuce/Types/Int


text:
Cookbook:Puff Pastry

| Pastry

In baking, puff pastry (French: pâte feuilletée) is a light, flaky pastry made from dough of the same name. The dough, which is also called puff paste, consists of many layers of fat sandwiched between layers of dough. Although Larousse Gastronomique, and some other writers, use the terms interchangeably, traditionally in English, the term puff pastry is distinguished from the term flaky pastry, in the way in which the shortening (fat) is folded into the dough.

Croissants are sometimes formed from puff pastry. Puff pastry shells used to be filled with crab meat salad or chicken à la king at ladies' luncheons. An American fashion in the late 1970s was to bake a wedge of Brie in puff pastry and serve warm. Choux pastry, used to make cream puffs, is different, using eggs. Bourekas is also made out of puff pastry, filled with various ingredients. Sausage rolls and jambons are puff pastries commonly available from delis in Ireland.

There are several ways to make puff pastries below.

Notes on baking and storing puff pastry
Puff pastry is cooked when the bottom of the item is browned and the pastry does not collapse into itself.

 * Use a very sharp knife to cut puff pastry. A blunt knife will crush the layers together and prevent the pastry from rising to full height.
 * Do not get egg wash or milk wash on the sides of the pastry. This will glue the layers together during baking and result in uneven lift.
 * Excess flour left on the item will burn easily in the oven. Dust it off with a soft pastry brush.
 * Always bake puff pastry in a very hot oven (220°C/425°F). A hot oven ensures the moisture in the dough turns into steam, which is what makes puff pastry rise.
 * Puff pastry should only be baked for a short time. 15 to 20 minutes usually suffices. This is dependent on the oven and recipe used.
 * Open the oven flue during baking to allow steam to escape and the pastry to dry, or failing that, open the oven door near the end of the baking.
 * When using puff pastry as a base, small holes can be cut into the pastry allowing airflow to reach the under side (sometimes referred to as puffin' holes).
 * Puff pastry can be refrigerated for a week, or frozen for three months. Stored puff pastry will have less lift than fresh pastry.

Recipes
The following are either recipes for puff pastry or recipes using puff pastry.

title: Cookbook:Puff Pastry


text:
XForms/Custom Controls

Motivation
Very often complex forms need functionality that go beyond the basics offered by the W3C XForm standard. The good news is that XForms is designed to be easy to extend. This process is called creating a Custom Control.

There are several reason to create XForms custom controls:

 * custom presentation - XForms controls as rendered by your XForms processor do not provide the right presentation for your form
 * custom data types and date type to UI mappings - existing XForms controls do now work properly with your data types (for example binding a boolean to a check box)
 * advanced XForms controls - you need customized controls to extend the functional of the base XForms controls
 * new host language - you'd like to support XForms in host languages

The following example uses a technology called XML Bindings to create a new control. This control displays a different image when a select1 list is selected.

Sample Program
   @namespace xf url(http://www.w3.org/2002/xforms);

xf|output[mediatype="image/*"] { -moz-binding: url('#output-image'); }     Custom Control Sample  Select image to display:

Discussion
This example uses the xbl:binding structure, a few lines of JavaScript and a binding in the CSS file. Note that example will only work within FireFox since XML bindings are not currently part of the XForms specification.

Note that the XML Binding Language (xbl) in currently a w3C working draft. See XBL working draft. When XBL becomes a recommendation these examples may have a better chance to run in multiple implementations of XForms. Right now we need to use implementation specific tags.

title: XForms/Custom Controls


text:
CDuce/Types/Boolean connectives

Conjunction
-> 1--10
 * 1) print_type 1--7 | 5--10;;

type IntOrChar = Int | Char;;

Disjunction
-> 5--7
 * 1) print_type 1--7 & 5--10;;

Difference
-> *---1 | 1--*
 * 1) print_type Int \ 0;;

Empty set
Empty
 * 1) print_type 1--3 & 5--6;;

Universal type
"Any" is the set of all the values. "_" is the same thing, but is preferred in patterns context. -> Any
 * 1) print_type _;;

title: CDuce/Types/Boolean connectives


text:
CDuce/Types/Coercion

Upward static coercion
let x = 7;; -> val x : 7 = 7

x has the value 7 and is of the type 7 (the singleton containing the integer seven)

let y1 = (x : Int);; let y2 : Int = x;;

These two upward coercions give the same thing: the value 7 of type Int. This is possible because the singleton 7 is a subset of the integers set.

Dynamic coercion
The static downward coercion is not possible

type Positive = 1--* let y = (7 : Int);;

let yp = (y : Positive);; -> This expression should have type: Positive but its inferred type is: Int which is not a subtype, as shown by the sample: *--0

But the dynamic downward coercion is possible:

let yp1 :? Positive = y;; let yp2 = (y :? Positive);;

An exception is raised at execution is coercion is not possible

let ybad = (y :? Char);; -> Uncaught CDuce exception: "Value 7 does not match type Empty\n"

The message contains "Empty" because the dynamic coercion give the conjunction type. This can be seen writing

(7 : 1--8) :? 5--10;;

which appears having the type 5--8

Note that for upward coercion the static nethod is more efficient and gives better error handling. Furthermnore, due to the conjunction mechanism, the upward coercion cannot be dynamic:

(7 : 1--8) :? Int;;

continues to be of type 1--8, not Int.

title: CDuce/Types/Coercion


text:
CDuce/Types/Char

The type Char corresponds to the set of all the Unicode characters.

Character literals
A Unicode character literal is enclosed in single quotes : 'a' 'b'

Five special characters are escaped: '\n' '\t' '\r' '\'' '\\'

Arbitrary unicode value can be witten in decimal or hexadecimal way '\55;' '\055;' '\x37;' '\x0037;' '7' are corresponding all to the same character. Please note the mandatory ";".

As for the Int type, intervals of characters can be defined. The Byte type is defined in standard way by type Byte = '\0;'--'\255;'

The types String and Latin1 are respectively defined as sequences of Char and Byte. -> [ Char* ] -> [ Byte* ]
 * 1) print_type String;;
 * 1) print_type Latin1;;

title: CDuce/Types/Char


text:
MySQL/Introduction

What is SQL?
For a more general introduction see the SQL Wikibook.

Structured Query Language is a third generation language for working with relational databases. Being a 3G language it is closer to human language than machine language and therefore easier to understand and work with.

 * Dr. E. F. Ted Codd who worked for IBM described a relational model for database in 1970.
 * In 1992, ANSI (American National Standards Institute), the apex body, standardized most of the basic syntax.
 * Its called SQL 92 and most databases (like Oracle, MySQL, Sybase, etc.) implement a subset of the standard (and proprietary extensions that makes them often incompatible).

Why MySQL?

 * Free as in Freedom - Released with GPL version 2 license (though a different license can be bought from Oracle, see below)
 * Cost - Free!
 * Support - Online tutorials, forums, mailing list (lists.mysql.com), paid support contracts.
 * Speed - One of the fastest databases available.
 * Functionality - supports most of ANSI SQL commands.
 * Ease of use - less need of training / retraining.
 * Portability - easily import / export from Excel and other databases
 * Scalable - Useful for both small as well as large databases containing billions of records and terabytes of data in hundreds of thousands of tables.
 * Permission Control - selectively grant or revoke permissions to users.

The MySQL license
MySQL is available under a dual-licensing scheme:

 * 1) Under the GNU General Public License, version 2, ("or later" allowed in versions released before 2007): this is a Free (as in freedom), copyleft software license that allows you to use MySQL for commercial and non-commercial purposes in your application, as long as your application is released under the GNU GPL. There is also a "FLOSS Exception" which essentially allows non-GPL'd but Free applications (such as the PHP programming language, under the PHP license) to connect to a MySQL server. The exception lists a set of free and open-source software license that can be used in addition to the GNU GPL for your MySQL-dependent Free application.
 * 2) A so-called "commercial", paid license, that is, a license where MySQL grants you the right to integrate MySQL with a non-FLOSS application that you are redistributing outside your own organization.

MySQL and its forks
MySQL is Free Software, so some forks and unofficial builds delivering contributions from the community exist.

MariaDB
In 2008 Sun Microsystems bought MySQL, Sun being itself later acquired by Oracle, in 2010. After the acquisition, the development process has changed. The team has started to release new MySQL versions less frequently, so the new code is less tested.There were also less contributions from the community.

In 2009 Monty Widenius, the founder of MySQL, left the company and created a new one, called The Monty Program. He started a new fork called MariaDB. The scopes of MariaDB,

 * import all the new code that will be added to the main MySQL branch, but enhancing it to make it more stable;
 * clean the MySQL code;
 * add contributions from the community (new plugins, new features);
 * develop the Aria storage engine, formerly named Maria;
 * improving the performance;
 * adding new features to the server.

The license is the GNU GPLv2 (inherited from MySQL).

The primary platform for MariaDB is GNU/Linux, but also works on one proprietary system. The following Storage Engine have been added:
 * Aria (also used for internal tables)
 * PBXT
 * XtraDB
 * FederatedX
 * SphinxSE
 * OQGRAPH
 * Others may be added in the future.

Drizzle
In 2008 Brian Aker, chief architect of MySQL, left the project to start a new fork called Drizzle. While Oracle initially funded the project, Drizzle is now funded by Rackspace. Its characteristics are:

 * only a small part of the MySQL code has survived in this fork, the rest being removed: only essential features are implemented in the Drizzle server;
 * the survived code has been cleaned;
 * Drizzle is modular: many features are or can be implemented as plugins;
 * the software is optimized for multiCPU and multicore 64 bit machines;
 * only GNU/Linux and UNIX systems are supported.

There are no public releases of this fork, still. Its main license will be the GNU GPLv2 (inherited from MySQL), but where possible the BSD license is applied.

OurDelta
OurDelta is another fork, maintained by Open Query. The first branch, which has number 5.0, is based on MySQL 5.0. The 5.1 branch is based on MariaDB. OurDelta includes some patches developed by the community or by third parties. OurDelta provides packages for some GNU/Linux distributions: Debian, Ubuntu, Red Hat/CentOS. It is not available for other systems, but the source code is freely available.

Percona Server
Percona Server is a MySQL fork maintained by Percona. It provides the ExtraDB Storage Engine, which is a fork of InnoDB, and some patches which mainly improve the performance.

title: MySQL/Introduction


text:
MySQL/Table types

Every table is a logical object in a database; but it also needs to physically store its data (records) on the disk and/or in memory. Tables use a Storage Engine to do this. SE are plugins which can be installed or uninstalled into the server (if they're not builtin).

Many operations are requested by the server but physically done by the SE. So, from the SE we choose for a table affects performance, stability, LOCKs type, use of the query cache, disk space required and special features.

In some future versions of MySQL, partitioned tables will be able to use different SE for different partitions.

Let's see which Storage Engine is good for which uses.

MyISAM and InnoDB
MyISAM does table level locking, while InnoDB does row level locking. In addition to foreign keys, InnoDB offers transaction support, which is absolutely critical when dealing with larger applications. Speed may suffer, particularly for inserts with full transaction guarantees, because all this Foreign Key / Transaction stuff adds overhead.

The default table type for MySQL on Linux is MyISAM, on Windows, normally InnoDB. MyISAM uses table level locking, which means during an UPDATE, nobody can access any other record of the same table. InnoDB however, uses Row level locking. Row level locking ensures that during an UPDATE, nobody can access that particular row, until the locking transaction issues a COMMIT. Many people use MyISAM if they need speed and InnoDB for data integrity.

MyISAM

 * Pros
 * Fulltext search is currently only available with MyISAM tables
 * Geometric datatypes
 * Sometimes faster reads
 * All numeric key values are stored with the high byte first to allow better index compression
 * Internal handling of one AUTO_INCREMENT column per table is supported. MyISAM  automatically updates this column for INSERT  and UPDATE operations. This makes AUTO_INCREMENT columns faster (at least 10%)

 * Cons
 * Table (not row) level locking only
 * No foreign keys constraints (but planned for MySQL 6.x)
 * Slower table checking and restarts after power loss, an issue for those who need high availability

InnoDB

 * Pros
 * Provides MySQL with a transaction-safe (ACID compliant) storage engine that has commit, rollback, and crash recovery capabilities
 * XA transactions
 * Foreign keys
 * Row level locking
 * Maintains its own buffer pool for caching data and indexes in main memory
 * Faster for some workloads, particularly those where physical ordering by primary key helps or where the automatically built hash indexes speed up record lookups
 * Tables can be of any size even on operating systems where file size is limited to 2GB.
 * Fast and reliable recovery from power loss.

 * Cons
 * Data takes more space to store
 * ACID guarantee requires full sync to disk at transaction commit, can be turned off where speed is more important than full ACID guarantees.
 * Data Versioning and transactions add overhead to table management.
 * They can lead to high memory requirements to manage large numbers of locks used in row locking.
 * Indexes are slow to build when they're added after a table has been created. Indexes should therefore be created when data is bulk-loaded.

Overall, InnoDB should be used for with applications that rely highly on data integrity or need transactions, while MyISAM can be used where that is not required or where fulltext indexing is needed. Where speed is more important, both should be tried because which is faster depends on the application.

Drizzle, a MySQL's fork supported by Sun Microsystems, uses InnoDB as its default engine and doesn't support MyISAM.

Merge Table
Synonyms: Merge, MRG_MYISAM

 * A MERGE table is a collection of identical MyISAM tables that can be used as one.
 * Identical means that all tables have identical column and index information, no deviation of any sort is permitted.

CREATE TABLE mumbai (first_name VARCHAR(30), amount INT(10)) TYPE=MyISAM CREATE TABLE delhi (first_name VARCHAR(30), amount INT(10)) TYPE=MyISAM CREATE TABLE total (first_name VARCHAR(30), amount INT(10)) TYPE=MERGE UNION=(mumbai,delhi)

Merges can be used to work around MySQL's or system's filesize limits. In fact those limits affect single MyISAM datafiles, but don't affect the whole Merge table, which doesn't have a datafile.

In the past, in some cases Merge and MyISAM could be used to replace views, which were not supported by MySQL. Merge could be used as a base table and MyISAM tables could be used as views containing part of the base table data. A SELECT on the Merge table returned all the effective data. View support was added in MySQL 5.0, so this use of Merge tables is obsolete.

MEMORY / HEAP
HEAP is the name of this table type before MySQL 4.1. MEMORY is the new, preferred name.

This engine is introduced in version 3.23.

BDB
Synonyms: BDB, BerkleyDB

BDB has been removed from version 5.1 and later due to lack of use.

BerkeleyDB is a family of free software embeddable DBMS's developer by SleepyCat, a company which has been acquired by Oracle. SleepyCat provided a Storage Engine for MySQL called BDB.

BDB supports transactions and page-level locking, but it also has many limitations within MySQL.

BLACKHOLE
Discards all data stored in it but does still write to the binary log, so it is useful in replication scale-out or secure binlog-do filtering situations where slaves aren't trustworthy and for benchmarking the higher layers of the server.

Miscellaneous
For completeness, other storage engines include:
 * CSV: simple Comma-Separated Values engine, that uses the CSV format to store data. Used to share database with other CSV-aware applications maybe? Due to the simple nature of its format, indexing is not available.
 * EXAMPLE (a stub for developers)
 * ISAM (for pre-3.23 backward compatibility, removed in 5.1)

Metadata about Storage Engines
You can get metadata about official MySQL Storage Engines and other Storage Engines which are present on your server, via SQL.

SHOW STORAGE ENGINES
Starting from MySQL 5.0, you can get information about the Storage Engine which you can use using the SHOW STORAGE ENGINES statement.

SHOW STORAGE ENGINES

The STORAGE word is optional. This command returns a dataset with the following columns:

 * Engine - Name of the Storage Engine.
 * Support - Wether the Storage Engine is supported or not. Possible values:
 * 'DEFAULT' - it's supported and it's the default engine;
 * 'YES' - supported;
 * 'DISABLED' - it has been compiled, but MySQL has been started with that engine disabled (possibly with options like --skip-engine-name);
 * 'NO' - not supported.
 * Comment - Brief description of the engine.
 * Transactions - Wether the engine supports SQL transactions. Added in MySQL 5.1.
 * XA - Wether the engine supports XA transactions. Added in MySQL 5.1.
 * Savepoints - Wether the engine supports savepoints and rollbacks. Added in MySQL 5.1.

INFORMATION_SCHEMA `ENGINES` table
`ENGINES` is a virtual table within the INFORMATION_SCHEMA database. It can be used to get information about Storage Engines. Its columns are the came which are returned by the SHOW ENGINES statement (see above).

ENGINES has been added in MySQL 5.1.5.

HELP statement
If you want more info about an official MySQL Storage Engine, you can use the HELP command:

HELP 'myisam'

If you are using the command line client, you can omit the quotes:

help myisam \g

SQL
When you want to create a table using a given Storage Engine, you can use the ENGINE clause in the CREATE TABLE command:

CREATE TABLE ... ENGINE=InnoDB

If the ENGINE clause is not specified, the value of the storage_engine variable will be used. By default it's MyISAM, but you can change it:

SET storage_engine=InnoDB

Or you can modify the value of default-storage-engine in the my.cnf before starting the MySQL server.

You can also change the Storage Engine of an existing table:

ALTER TABLE `stats` ENGINE=MyISAM

mysql_convert_table_format
mysql_convert_table_format is a tool provided with MySQL, written in Perl. It converts all the tables contained in the specified database to another Storage Engine.

The syntax is:

mysql_convert_table_format [options] database

database is the name of the database in which the program will operate. It's mandatory.

Options are:

--help Print a help and exit.

--version Print version number and exit.

--host=host The host on which MySQL is running. Default: localhost.

--port=port TCP port.

--user=user Specify the username.

--password=password Specify the password. As it is insecure (it's visible with the coomand top, for example), you can use an option file, instead.

--type=storage_engine The storage engine that the tables will use after conversion.

--force Don't stop the execution if an error occurs.

--verbose Print detailed information about the conversions.

Example:

mysql_convert_table_format --host=localhost --user=root --password=xyz970 --force --type=InnoDB test

This command specifies access data (localhost, username, password) and converts all tables within database `test` into InnoDB. If some tables can't be converted, the script skips them and converts the others (--force).

Italic text

title: MySQL/Table types


text:
MySQL/Language

 * /Browsing the databases/
 * Specifying table names
 * Definitions
 * /User Variables/
 * /Alias/
 * /Data Types/
 * /Table manipulation/
 * /Data manipulation/
 * /Queries/
 * Using/Dealing with NULL
 * /Operators/
 * /Import/export/
 * /Functions/
 * /Exercises/
 * /Reserved Words/

title: MySQL/Language


text:
User talk:Eva~enwikibooks

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally. Kellen T 16:20, 17 October 2006 (UTC)
 * Please also check out the Cookbook policy page and the Cookbook talk pages.
 * Thanks for making Cookbook:Yeast! This page has been needed for some time now. I have just found it useful myself.

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 Eva. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Eva~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:11, 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:57, 19 April 2015 (UTC)

title: User talk:Eva~enwikibooks


text:
MySQL/Databases manipulation

Creation
Require? Privilege.

is a command-line wrapper for this function.

NB: in MySQL,  is a perfect synonym of , contrarily to some other DBMS like Oracle or SQL Server.

Deletion
Require ? privilege.

is a command-line wrapper for this function. The  option can be used to suppress the interactive confirmation (useful for unattended scripts).

Rename
In some 5.1.x versions there was a  command, but it has been removed because renaming databases via SQL caused some data loss problems.

However, in the command-line, you can create/export/import/delete:

Another option, if you have root access, is to rename the database directory:

You also need to drop privileges on name1 and recreate them on name2:

Copy
There is no direct copy command in MySQL. However, this can easily be done using some tools.

With mysqldump
The mysqldump command-line can be used to generate a complete flat-file copy of the database. You can then reinject this copy in another database.

This requires a direct access to the database; if you do not have it, you may need to use phpMyAdmin instead.

Backup
To set an automatic backup every day at midnight, in Linux:

Restoration
mysql -h localhost -u root MaBase < MaBase.sql "C:\Program Files (x86)\EasyPHP\binaries\mysql\bin\mysql.exe" -h localhost -u root MyDB < MyDB.sql
 * With Linux:
 * With Windows, the program may not be into the environment variables:

Contrarily to the PhpMyAdmin importations, there is no limit. For example, we can load a 2 GB database in five minutes.

Migration from other databases
Tools: MySQL Migration Toolkit

Tools for data modeling

 * MySQL Query Browser apparently includes a MySQL Table Editor module.
 * Kexi (wikipedia: Kexi)

DB Designer 4 and MySQL Workbench
DBDesigner begins to be old. It is released under the GNU GPL, but it cannot be fully considered as free software since it requires the non-free Kylix compiler to build.

But MySQL AB acquired fabFORCE, who distributed DB Designer, and MySQL Workbench is the next version. For now the project is still Alpha and not ready for use yet.

Meanwhile, if you use the latest release of DBDesigner, you'll find that it cannot connect to MySQL, with the "unable to load libmysqlclient.so" error. To workaround this, sudo ln -sf /usr/lib/libmysqlclient.so.10 /usr/lib/DBDesigner4/libmysqlclient.so rpm2cpio x.rpm | cpio -i sudo cp libXft.so.1.1 /usr/lib ldconfig
 * Install the MySQL "Shared compatibility libraries" (from http://dev.mysql.com/downloads/mysql/5.0.html#downloads for version 5.0, generic RPMS aka MySQL-shared-compat.i386 will do).
 * Replace DBDesigner's version of libmysqlclient.so with the newly installed one:
 * Find and install
 * Find an old xorg (e.g.  from FC4) and extract it:
 * Get libXft.so.1.1 in that package and install it:

You now can connect to your MySQL5 server from DBDesigner4. Consider this a temporary work-around waiting for community (free) and commercial (not free) versions MySQL Workbench.

OpenOffice Base and ODBC
Typical configuration :
 * MySQL database on a host machine (which name is  below)
 * OOo 2 on a client machine (Debian GNU/Linux for instance)
 * Connection via ODBC.

It's a client configuration : we need : aptitude install mysql-client Under Fedora/CentOS: yum install mysql

Before installing ODBC, we can test the remote connexion locally: $ mysql -h mysqlhost -u user1 mysqldatabase -p Enter password: PassUser1

You must have create the database  and the user   on. It seems there is no problem (hope there is not ;-)): Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 33 to server version: 5.0.24a-Debian_5~bpo.1-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>

Then, it's possible to test, through different queries : mysql> show databases; ++ | Database          | ++ | information_schema | | mysqldatabase     | ++ 2 rows in set (0.00 sec) .... mysql> quit; Bye

Fine ! Let's go with OOo and ODBC, on the client machine: aptitude install libmyodbc unixodbc For Fedora/CentOS: yum install mysql-connector-odbc unixODBC

(empty file) and  are created. declares the available ODBC driver. Here's the MySQL statement (paths to the .so files may vary depending on the distribution); for Debian: [MySQL] Description    = MySQL driver Driver         = /usr/lib/odbc/libmyodbc.so Setup           = /usr/lib/odbc/libodbcmyS.so CPTimeout       = CPReuse        = FileUsage      = 1 for CentOS: [MySQL] Description    = ODBC for MySQL Driver         = /usr/lib/libmyodbc3.so Setup           = /usr/lib/libodbcmyS.so FileUsage       = 1

Now we can use  : unixODBC 2.2.4 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini USER DATA SOURCES..: /root/.odbc.ini For further options :
 * 1) odbcinst -j

First of all, we have to create at least one DSN (Data Source Name or Data Set Name), because every ODBC connection is initialized through an existing DSN. It's true in every cases, so it is required for an ODBC connection from OOo.

To create a DSN, one have different possibilities :
 * Modify /etc/odbc.ini (concerns all users)
 * Modify ~/.odbc.ini (concerns a specific user)
 * Use graphical applications such as ODBCConfig (Debian:, Fedora:  ). Finally, these graphical applications modify /etc/odbc.ini or ~/.odbc.ini

For instance, a  file (the name of the DSN is between brackets []): [MySQL-test] Description    =       MySQL ODBC Database TraceFile      =       stderr Driver         =       MySQL SERVER         =       mysqlhost USER           =       user1 PASSWORD       = DATABASE       =       mysqldatabase In that case, the DSN is called MySQL-test

Then we can test, using isql command:

$ isql -v MySQL-test user1 PassUser1 +---+ | Connected! | |                                      | | sql-statement                         | | help [tablename]                     | | quit                                 | |                                      | +---+ SQL> show databases; +---+ | Database         | +---+ | information_schema| | mysqldatabase    | +---+ 2 rows affected 2 rows returned SQL> quit;

And now, from OOo: -> File -> New -> Database -> Connecting to an existing database -> MySQL -> Next -> Connect using ODBC -> Next -> Choosing a Data Source -> MySQL-test -> Next -> Username : user1 (tick password required) -> Yes, register the database for me -> Finish

At that step, one is connected to the mysqldatabase database, under the user user1. Just before accessing the database, for example to create tables, one will give user1 password. Then, through OOo, it is now quite easy to access and manipulate the database. We can just notice that Java is required in the following cases :
 * Wizard to create a form (at the opposite, to create a form directly don't need any JRE).
 * Wizard to create reports.
 * Wizard to create queries (at the opposite, to create a query directly or through a view don't need any JRE).
 * Wizard to create tables (at the opposite, to create a table directly or to create a view don't need any JRE).

GNU/Linux distros usually ships OpenOffice with IcedTea ( / ) or GCJ ( / ) so that these Java-based features work.

title: MySQL/Databases manipulation


text:
MySQL/Administration

Debian packages
The package name is usually mysql-server, either directly or as a transitional package for the latest version.

Stable
There are two Debian packages in the current stable release:
 * mysql-server: depends on latest MySQL version
 * mysql-server-5.0: MySQL 5.0

You can install it using this command: apt-get install mysql-server or by installing the package you want using the Synaptic GUI.

Backports
Backports.org may also offer more recent versions.

To install it, you need to add the backports source in your : deb http://www.backports.org/debian lenny-backports main and then use aptitude: apt-get install -t lenny-backports mysql-server-5.1

Uninstall
To simply remove the program: apt-get remove mysql-server

To remove the configuration files as well, resulting in a clean environment: apt-get remove --purge mysql-server Debconf will ask you if you want to remove the existing databases as well. Answer wisely!

Fedora Core 5
The package name is mysql-server.

You can install it using this command: yum install mysql-server which will take care of installing the needed dependencies.

Using pirut (Applications->Add/Remove Software), you can also server MySQL Database in the Servers category:

Gentoo
MySQL is available in the main Portage tree as "dev-db/mysql". You must use the fully qualified ebuild name as "mysql" is made ambiguous by "virtual/mysql"

Command: emerge dev-db/mysql

FreeBSD
The stable FreeBSD port is version 5.0, and beta version 5.1 is also available.

You can install it using this command: cd /usr/ports/databases/mysql50-server/ && make install clean This command will install the MySQL 5.0 server as well as all necessary dependencies (which includes the MySQL client). t

Debian
In Debian, you use the  init script. /etc/init.d/mysql start /etc/init.d/mysql stop /etc/init.d/mysql restart

If you need to do so in scripts, prefer the  command, which only restarts the service if it is launched on system startup. That way, you do not launch a service if it wasn't meant to be run: invoke-rc.d mysql start|stop|restart

If you want to control whether to launch MySQL on startup, you can use the  package, or update-rc.d: cp /usr/local/mysql/support-files/mysql.server /etc/init.d/anysqlservernamehere chmod +x /etc/init.d/anysqlservernamehere update-rc.d anysqlservernamehere defaults

Fedora Core
Fedora Core suggests that you use the  wrapper, which cleans the environment before to run the service, so that all services run in the same standard environment (for example, the current directory is set to the system root  ).

service mysqld start|stop|restart service mysqld --full-restart # means stop, then start - not a direct restart

You can also use the  if needed.

FC5 displays useful hints the first time you launch the MySQL server (i.e. when launching /usr/bin/mysql_install_db): $ service mysqld start [...] PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h localhost password 'new-password' [...]

See the next section about changing passwords.

To control whether to launch MySQL on startup, you can use the  tool:

Client connection
There are two ways to connect to a MySQL server, using Unix sockets and TCP/IP.

The default TCP/IP port is 3306: mysql          3306/tcp                        # MySQL mysql          3306/udp                        # MySQL mysql-cluster  1186/tcp                        # MySQL Cluster Manager mysql-cluster  1186/udp                        # MySQL Cluster Manager mysql-im       2273/tcp                        # MySQL Instance Manager mysql-im       2273/udp                        # MySQL Instance Manager
 * 1) grep mysql /etc/services

As a client, MySQL interprets 'localhost' as 'use the Unix socket'. This means that MySQL won't connect to 127.0.0.1:3306, but will use : $ mysql -h localhost mysql> \s -- mysql Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i386) using readline 5.0 [...] Current user:          sylvain@localhost [...] Connection:            Localhost via UNIX socket [...] UNIX socket:           /var/lib/mysql/mysql.sock

If you really need to connect to MySQL via TCP/IP to the local host without using Unix sockets, then specify '127.0.0.1' instead of 'localhost': $ mysql -h 127.0.0.1 mysql> \s -- mysql Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i386) using readline 5.0 [...] Current user:          sylvain@localhost [...] Connection:            127.0.0.1 via TCP/IP [...] TCP port:              3306

In both cases, MySQL will understand your machine name as 'localhost' (this is used in the privileges system).

Configuration
Configure /etc/mysql/my.cnf - for heavily loaded databases, for fat databases...; different kinds of connections (Unix sockets, TCP/IP w/ or w/o SSL, MySQL+SSL licensing issues)

Change the root password
$ mysql -u root mysql> SET PASSWORD = PASSWORD('PassRoot');

For more information, see the section.

Network configuration
--bind-address=127.0.0.1 # localhost only --bind-address=0.0.0.0 # listen on all interfaces --bind-address=192.168.1.120 # listen on that IP only

skip-networking
When you specify  in the configuration, then MySQL will not listen on any port, not even on localhost (127.0.0.1). This means that only programs running on the same machine than the MySQL server will be able to connect to it. This is a common setup on dedicated servers.

The only way to contact MySQL will be to use the local Unix socket, such as  (Debian) or   (FC5). You can specify where the socket is located using the  parameter in the   section of the configuration: [mysqld] ... socket=/var/lib/mysql/mysql.sock

Privileges
The MySQL privileges system.

Introduction
MySQL requires you to identify yourself when you connect to the database. You provide the following credentials:
 * an identity, composed of:
 * a username
 * a machine name or IP address (detected automatically by the server)
 * a password, to prove your identity

Usually, MySQL-aware applications also ask you for a database name, but that's not part of the credentials, because this does not relate to who you are.

MySQL then associates privileges to these credentials; for example, the right to query a given database, add data to another one, create additional databases or remove existing ones, etc.

Who am I?
Once connected, it is not necessarily obvious who MySQL thinks you are. CURRENT_USER provides this information: mysql> SELECT CURRENT_USER; ++ | CURRENT_USER | ++ | root@localhost | ++ 1 row in set (0.00 sec)

SHOW GRANTS
Prototype: SHOW GRANTS FOR user SHOW GRANTS --current user

SHOW GRANTS allow you to check the current privileges for a given user. For example, here are the default privileges for user root:

mysql> SHOW GRANTS FOR 'root'@'localhost'; +-+ | Grants for root@localhost                                          | +-+ | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION | +-+ 1 row in set (0.00 sec)

You also use use  to check the privileges for the current user.

GRANT
The GRANT command allows you to give (GRANT) privileges to a given user.

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, database.* TO 'user'@'localhost';

DROP USER
DROP USER 'mediawiki'; DROP USER 'mediawiki'@'host';

Starting with v5.0.2, this removes the associated privileges as well.

With earlier versions, you also need to REVOKE its PRIVILEGES manually.

REVOKE
REVOKE ALL PRIVILEGES ON database.* FROM 'user'@'host'; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'host';

SET PASSWORD
Prototype: SET PASSWORD [FOR user] = PASSWORD('your_password')

If user is not specified, the current user is used (this is useful when you connect to mysql using the command line).

Example with an explicit user: SET PASSWORD FOR 'mediawiki'@'localhost' = PASSWORD('ifda8GQg');

There is a command-line synonym: mysqladmin password 'your_password' (with the usual connection options    and  )

However, using passwords on the command line presents a security risk. For example, if root changes his MySQL password: root# mysqladmin password 'K2ekiEk3'

Then another user can spy on him by looking at the process list: user$ ps aux | grep mysqladmin root     7768  0.0  0.1   7044  1516 pts/1    S+   16:57   0:00 mysqladmin password K2ekiEk3

Conclusion: don't user.

If you are looking for a way to generate passwords, either secure or easy to remember, try the  program (there is a Debian package available): $ pwgen ooGoo7ba ir4Raeje Ya2veigh zaXeero8 Dae8aiqu rai9ooYi phoTi6gu Yeingo9r tho9aeDa Ohjoh6ai Aem8chee aheich8A Aelaeph3 eu4Owudo koh6Iema oH6ufuya [...] $ pwgen -s # secure zCRhn8LH EJtzzLRE G4Ezb5BX e7hQ88In TB8hE6nn f8IqdMVQ t7BBDWTH ZZMhZyhR gbsXdIes hCQMbPE6 XD8Owd0b xitloisw XCWKX9B3 MEATkWHH vW2Y7HnA 3V5ubf6B [...]

Very handy if you manage a lot of accounts :)

MySQL 4.1 password issues
As of version 4.1, MySQL introduced a password-related change.

You'll experience this via errors such as: Client does not support authentication protocol requested by server; consider upgrading MySQL client.

If you wish to support older client programs, you need to define the MySQL account password this way: SET PASSWORD [FOR user] = OLD_PASSWORD('your_pass');

There is apparently no way to use old passwords with the  syntax.

Alternatively, you can use the  configuration option in your server's. This means that new passwords will be encoded using the old-style, shorter, less secure format. For example, in Debian Sarge and FC5, the MySQL default configuration enforces old-style password for backward compatibility with older clients: [mysqld] ... old_passwords=1

provides a command-line synonym: $ mysqladmin processlist ++---+---+---+-+--+---+--+ | Id | User     | Host      | db        | Command | Time | State | Info             | ++---+---+---+-+--+---+--+ | 34 | monddprod | localhost | monddprod | Sleep  | 1368 |       |                  | | 44 | root     | localhost |           | Query   | 0    |       | show processlist | ++---+---+---+-+--+---+--+

KILL
If a heavy, nasty query is consuming too many resources on your server, you need to shut it down.

TODO: Add a sample SHOW PROCESSLIST output here

The brute force way is to restart the server: /etc/init.d/mysql restart

A more subtle way is to use SHOW PROCESSLIST to identify the nasty query and kill it independently of other server threads.

mysql> KILL 342; Query OK, 0 rows affected (0.00 sec)

There is also a command-line synonym: $ mysqladmin kill 342

Security
Basic security: firewall (iptables), SELinux? also, some words about: do not store passwords as cleartext

Backup
Backup/recovery and import/export techniques.

mysqldump
mysqldump --opt -h 192.168.2.105 -u john -p'****' mybase | gzip > mybase-`date +%Y%m%d`.sql.gz

This creates the  file.

is the magical option that uses all the options that are generally useful. In recent versions of mysqldump, it is even enabled by default, so you need not type it. means  - so it will lock tables during the backup for consistency, add DROP TABLE statements so the dump can be applied without cleaning the target database, will use the most efficient ways to perform the INSERTs and specify the charset (latin1, Unicode/UTF-8...) used.

If you don't provide a database to mysqldump, you'll get a backup containing all databases - which is less easy to use for restoring a single database later on.

Daily rotated mysqldump with logrotate
We're using logrotate in a slightly non-standard way to keep a batch of dumps. Each day, logrotate will cycle the dumps to keep the last N dumps, removing old backups automatically, and generating the new one immediately through a postrotate hook.

The following configuration keeps 2 months of daily backups:

/dumps/mybase.sql.gz { rotate 60 dateext dateyesterday daily nocompress nocopytruncate postrotate HOME=/root mysqldump --opt mybase | gzip > /dumps/mybase.sql.gz        endscript }

Cf. logrotate(8) in the GNU/Linux man pages for more information.

Variant to backup all databases at once: /dumps/*/*.sql.gz { daily rotate 20 dateext dateyesterday nocompress sharedscripts create postrotate export HOME=/root for i in $(mysql --batch --skip-column-names -e 'SHOW DATABASES' | grep -vE '^information_schema|performance_schema$'); do                        if [ ! -e /dumps/$i ]; then mkdir -m 700 /dumps/$i; fi                        mysqldump --events $i | gzip -c > /dumps/$i/$i.sql.gz                 done endscript }

Setup:
 * Create your  for password-less database access
 * Place the logrotate configuration file above in the  directory
 * Bootstrap the first dump:
 * Check the dump using.
 * Check the dump using.
 * Check the dump using.
 * Check the dump using.
 * Check the dump using.

Comments on the code:  is needed for systems (such as FC5) that set   in their cron, which prevents mysqldump from finding the   configuration. We also use  instead of logrotate's   option for disk I/O efficiency (single-step).

In production, you'll get something like this:

total 16520 -rw-r- 1 root clisscom 2819533 mar 2 06:25 clisscom.sql.gz -rw-r- 1 root clisscom 2815193 mar  1 06:25 clisscom.sql.gz-20100302 -rw-r- 1 root clisscom 2813579 fév 28 06:26 clisscom.sql.gz-20100301 -rw-r- 1 root clisscom 2812251 fév 27 06:25 clisscom.sql.gz-20100228 -rw-r- 1 root clisscom 2810803 fév 26 06:25 clisscom.sql.gz-20100227 -rw-r- 1 root clisscom 2808785 fév 25 06:25 clisscom.sql.gz-20100226 ...
 * 1) ls -lt /dumps

Beware that the date in the filename is the date of the rotation, not the date of the dump. Using  helps with remote backups, because filenames don't change daily, not you avoid re-downloading all of   each time.

Remote mysqldump using CGI
mysqldump can be found sometimes in shared-hosting facilities. You can use a simple CGI script to get a direct dump: echo "Content-Type: application/x-tar" echo "Content-Encoding: x-gzip" echo "" mysqldump --host=mysql.hosting.com --user=john --password=XXXXX my_base | gzip 2>&1
 * 1) !/bin/sh

You can then get it with your browser or wget: $ wget -O- --quiet http://localhost/~sylvain/test2.cgi > base-`date +%Y%m%d`.sql.gz

You can even re-inject it on-the-fly in your local test database: $ wget -O- --quiet http://localhost/~sylvain/test2.cgi | gunzip | mysql test_install -u myself -pXXXX

Protect the script with a, write a   for wget to use, and you'll have a simple, unattended way to grap a backup even without command-line access. This allows to gain time when grabing a dump (compared to using phpMyAdmin) and to setup remote automated backups (no interaction is needed).

Something similar should be feasible in PHP provided you have access to exec.

Exporting a single table
If you need to import/export a table, not a complete database, check MySQL/Language.

Binary logs
Binary logs are a mechanism to keep track of everything that happens on the MySQL server (forensics), allowing to replay the same sequence of commands on a different computer (master/slave replication), or at a later time (crash recovery).

On Debian they are stored in.

To view the SQL commands in a binary log, you use the  command: mysqlbinlog /var/log/mysql/mysql-bin.000001

For the crash recovery to be useful, binary logs are usually stored on a different computer (via a NFS mount, for example). Note that it is meant to recover the full mysql server, not just one database. You could attempt to filter the log by database, but this isn't straightforward.

So in order use binary logs as a recovery plan, you usually combine them with a full standard backup: mysqldump -A | gzip > all.sql.gz To flush/reset the logs at the same time (TODO: test): mysqldump -A --master-data --flush-logs | gzip > all.sql.gz

To recover you'll just combine the two sources (preferably, disable binary logging in the server configuration during the recovery, and re-enable it right after.): (zcat all.sql.gz && mysqlbinlog /var/log/mysql/mysql-bin.0*) | mysql

Logs
Where interesting logs are located, common errors to look at. For example:

tail -f /var/log/mysql.log

Admin Tools
Various third-party graphical interfaces and utilities.

Web interfaces

 * phpMyAdmin (wikipedia: phpMyAdmin)
 * eSKUeL: an alternative to phpMyAdmin
 * MySQL on Servers Support

Desktop GUI

 * MySQL Administrator: from MySQL AB. If you want to create real backups, though, do not use this, since it runs backups using  on the client machine - which is likely not to be online every day.

title: MySQL/Administration


text:
C Sharp Programming/The .NET Framework/Console Programming

Input
Input can be gathered in a similar method to outputting data using the and  methods of that same  class:

The above program requests the user's name and displays it back. The final waits for the user to enter a key before exiting the program.

Output
The example program below shows a couple of ways to output text:

The above code displays the following text:

Hello World! This is... my first program! Goodbye World!

That text is output using the class. The statement at the top allows the compiler to find the  class without specifying the  namespace each time it is used.

The middle lines use the method, which does not automatically create a new line. To specify a new line, we can use the sequence backslash-n. If for whatever reason we wanted to really show the \n character instead, we add a second backslash. The backslash is known as the escape character in C# because it is not treated as a normal character, but allows us to encode certain special characters (like a new line character).

Error
The output is used to divert error specific messages to the console. To a novice user this may seem fairly pointless, as this achieves the same as Output (as above). If you decide to write an application that runs another application (for example a scheduler), you may wish to monitor the output of that program - more specifically, you may only wish to be notified only of the errors that occur. If you coded your program to write to the stream whenever an error occurred, you can tell your scheduler program to monitor this stream, and feedback any information that is sent to it. Instead of the Console appearing with the Error messages, your program may wish to log these to a file.

You may wish to revisit this after studying Streams and after learning about the Process class.

Command line arguments
Command line arguments are values that are passed to a console program before execution. For example, the Windows command prompt includes a command that takes two command line arguments. The first argument is the original file and the second is the location or name for the new copy. Custom console applications can have arguments as well. c sharp is object based programming language. .net framework is a Microsoft programming language is used to create web application,console application, mobile application.

If the above code is compiled to a program called username.exe, it can be executed from the command line using two arguments, e.g. "Bill" and "Gates":

C:\>username.exe Bill Gates

Notice how the method above has a string array parameter. The program assumes that there will be two arguments. That assumption makes the program unsafe. If it is run without the expected number of command line arguments, it will crash when it attempts to access the missing argument. To make the program more robust, we can check to see if the user entered all the required arguments.

Try running the program with only entering your first name or no name at all. The property returns the total number of arguments. If no arguments are given, it will return zero.

You are also able to group a single argument together by using the quote marks. This is particularly useful if you are expecting many parameters, but there is a requirement for including spaces (e.g. file locations, file names, full names etc.)

C:\> Test.exe Separate words "grouped together" 1: Separate 2: words 3: grouped together

Formatted output
and allow you to output a text string, but also allows writing a string with variable substitution.

These two functions normally have a string as the first parameter. When additional objects are added, either as parameters or as an array, the function will scan the string to substitute objects in place of tokens.

For example:

The is identified by braces, and refers to the parameter index that needs to be substituted. You may also find a format specifier within the braces, which is preceded by a colon and the specifier in the question (e.g. ).

Rounding number example
This is a small example that rounds a number to a string. It is an augmentation for the  class of C#. The result of the Round method has to be rounded to a string, as significant figures may be trailing zeros that would disappear, if a number format would be used. Here is the code and its call. You are invited to write a shorter version that gives the same result, or to correct errors!

The constant class contains repeating constants that should exist only once in the code so that to avoid inadvertant changes. (If the one constant is changed inadvertantly, it is most likely to be seen, as it is used at several locations.)

The  class is an enhancement to the   library and contains the rounding calculations.

Extensive testing of a software is crucial for qualitative code. To say that the code is tested does not give much information. The question is what is tested. Not in this case, but often it is also important to know where (in which environment) it was tested, and how - i.e. the test succession. Here is the code used to test the  class.

The results of your better code should comply with the result I got: Maths.Round('.', 0, 5) = 0.00000 Maths.Round('.', -1.40129846432482E-45, 5) = -1.4012E-45 Maths.Round('.', 1.40129846432482E-45, 5) = 1.4013E-45 Maths.Round('.', -1.999999757E-05, 5) = -1.9999E-5 Maths.Round('.', 1.999999757E-05, 5) = 2.0000E-5 Maths.Round('.', -0.0001999999757, 5) = -0.00019999 Maths.Round('.', 0.0001999999757, 5) = 0.00020000 Maths.Round('.', -0.001999999757, 5) = -0.0019999 Maths.Round('.', 0.001999999757, 5) = 0.0020000 Maths.Round('.', -0.000640589, 5) = -0.00064058 Maths.Round('.', 0.000640589, 5) = 0.00064059 Maths.Round('.', -0.339689999818802, 5) = -0.33968 Maths.Round('.', 0.339689999818802, 5) = 0.33969 Maths.Round('.', -0.34, 5) = -0.33999 Maths.Round('.', 0.34, 5) = 0.34000 Maths.Round('.', -7.07, 5) = -7.0699 Maths.Round('.', 7.07, 5) = 7.0700 Maths.Round('.', -118.188, 5) = -118.18 Maths.Round('.', 118.188, 5) = 118.19 Maths.Round('.', -118.2, 5) = -118.19 Maths.Round('.', 118.2, 5) = 118.20 Maths.Round('.', -123.405009, 5) = -123.40 Maths.Round('.', 123.405009, 5) = 123.41 Maths.Round('.', -30.7699432373047, 5) = -30.769 Maths.Round('.', 30.7699432373047, 5) = 30.770 Maths.Round('.', -130.769943237305, 5) = -130.76 Maths.Round('.', 130.769943237305, 5) = 130.77 Maths.Round('.', -540, 5) = -539.99 Maths.Round('.', 540, 5) = 540.00 Maths.Round('.', -12345, 5) = -12344 Maths.Round('.', 12345, 5) = 12345 Maths.Round('.', -123456, 5) = -123450 Maths.Round('.', 123456, 5) = 123460 Maths.Round('.', -540911, 5) = -540900 Maths.Round('.', 540911, 5) = 540910 Maths.Round('.', -9.22337203685478E+56, 5) = -9.2233E56 Maths.Round('.', 9.22337203685478E+56, 5) = 9.2234E56

If you are interested in a comparison with C++, please compare it with the same example there. If you want to compare C# with Java, take a look at the rounding number example there.


text:
MySQL/Contributors

Add  here to add your name, and what you did.

 * Beuc: structured the book in chapters and setup the print version; wrote the initial Administration, Database Manipulation, CheatSheet section; contributed to Introduction (MySQL license), Optimization (query cache and benchmark examples, indices exercise), Table types (reference other possible table types), Language (datetime/timestamp valid intervals), Pivot table (alternate version w/o maths). I'd like to thank my employer, Cliss XXI, for giving me time to work on these chapters. Then wrote the Replication section (on free time).
 * JackPotte: added a certain amount of data on several pages, and tested every script on MySQL 5.6 when translating into the French Wikibooks.
 * Lathspell: wrote the initial Optimization section
 * LucienPetit: wrote the initial OpenOffice Base and ODBC section. I'd like to thank my employer, Cliss XXI, for giving me time to work on it (but I also worked on my free time).
 * Shantanuo: wrote the initial Language section.
 * Sante Caserio: started Stored Programs; started APIs; edited some existing stuff; added Language.Operators; added Table Types.Metadata about Sorage Engines;

Links

 * Recording Contributors in Information for Maintainers of GNU Software: best practices

title: MySQL/Contributors


text:
CDuce/Types/Records

type T = { a=Int b=Char c=?Char} let x : T = { b='2' a=1 c='3' } let y : T = { a=1 b='2'} y.a;; x.c;;

title: CDuce/Types/Records


text:
CDuce/Types

integers, characters, records

boolean connectives

coercion

title: CDuce/Types


text:
CDuce

 * /Toplevel/
 * /Directives/
 * /Types/

title: CDuce


text:
Basic Book Design/Headings and Subheads

Headings and Subheads
Set your chapter and section heading leadings in multiples of the text leading. This will align your lines of text on facing pages.

E.g., you’re using 15-point leading for your text. Make the chapter headings 45 points and the section headings 30 points. The chapter heading might have a 14-point font, preceded by 20 points above and 11 points below (20+14+11=45). The section headings might have a 12-point font, preceded by 15 points above and 3 points below (15+12+3=30).

If you don’t do this, the lines towards the bottom of the recto (right-hand) pages won’t align with the lines towards the bottom of the verso (left-hand) pages.

Don’t use relative leading (e.g., single-spaced, double-spaced), especially if your headings are a larger font size than your text. Instead, use absolute leading (e.g., 15 points).

Numbering Sections
If you number your chapters, sections, and subsections, use whole numbers for chapters, the ﬁrst decimal place for sections, the second decimal place for subsections, etc.

In contrast, the Chicago Manual of Style numbers its sections and subsections consecutively. E.g., its four levels (chapter, section, subsection, sub-subsection) are numbered:
 * 6. Spelling and Distinctive Treatment of Words
 * INTRODUCTION
 * 6.1
 * 6.2
 * 6.3
 * 6.4
 * SPELLING
 * Preferences of Special Groups
 * BRITISH VERSUS AMERICAN SPELLING
 * 6.5
 * SPELLINGS PECULIAR TO PARTICULAR DISCIPLINES
 * 6.6
 * Plurals
 * GENERAL RULES
 * 6.7
 * COMPOUND NOUNS
 * 6.8
 * 6.9
 * PLURALS IN DICTIONARIES
 * 6.10
 * PROPER NOUNS
 * 6.11…

I.e., the Chicago Manual of Style numbers most—not all—paragraphs consecutively, restarting the numbers in each chapters. A better way to number subsections is:

 * 6. Spelling and Distinctive Treatment of Words
 * 6.1 INTRODUCTION
 * 6.2 SPELLING
 * 6.2.1 Preferences of Special Groups
 * 6.2.1.1 BRITISH VERSUS AMERICAN SPELLING
 * 6.2.1.2 SPELLINGS PECULIAR TO PARTICULAR…
 * 6.2.2 Plurals
 * 6.2.2.1 GENERAL RULES
 * 6.2.2.2 COMPOUND NOUNS
 * 6.2.2.3 PLURALS IN DICTIONARIES
 * 6.2.2.4 PROPER NOUNS…

LaTeX automatically numbers sections in this style.

Unnecessary Sections
Each of your lowest-level subsections should have at least two paragraphs. Each next-higher-level section should have at least two subsections. Each chapter should have at least two sections. If you ﬁnd lone paragraphs or sections, consider removing the heading.

Bleed Tabs and Thumbnail Indexes
Bleed tabs are blocks of black ink (with something written in white in the blocks) at the outer edge of each page in a chapter so that you see black blocks when you look at the edge of the book. Bleed tabs require placing a graphic outside the text margins. A bleed tab is always placed on the outside page edge (never on the inside, top, or bottom of a page).

Create the graphic in Adobe Photoshop. You might also be able to create the image in Microsoft Word using View…Toolbars…Drawing or Insert…Picture…Autoshapes.

In Microsoft Word, create a table using Table…Insert > Table… Specify one column and one row. Set the initial column width to fit your graphic. Insert your illustration in the table using Insert…Picture…From File…

Select the table and go to Table…Table Properties… Set the horizontal alignment to Left or Right, with zero indent. Open the Options window. Set all cell margins to zero. Close these windows.

Select and drag the table’s left or right border to fit the illustration.

Select the table and go to Table…Table Properties… again. Select Text Wrapping…Around and open the Positioning window. Click Move With Text.

Select Horizontal…Position…Left (or Right) and Horizontal …Position… Page. This aligns the graphic with the edge of the page.

Set the Vertical…Position…as you wish (e.g., aligned with a paragraph, or centered down the page).

Your printer may want the bleed tabs to extend 1/8" or 1/4" beyond the paper edge (this is what “bleed” means). If so, set Microsoft Word to use a larger paper size, and let your printer crop the PDF files as he or she wishes.

Thumbnail indexes are like bleed tabs, but have paper cut-outs. Expensive dictionaries have these.

title: Basic Book Design/Headings and Subheads


text:
Basic Book Design/Word Division

Hyphenation (properly called word division) is breaking long words between lines. The purpose of hyphenation is to reduce the white space between words. A line with little white space is called a close line. A line with wide white spaces is called an open line.

A second purpose of hyphenation is to make your document shorter.

A sign of amateur design is too much white space between words. A professionally designed book has an even grayness on each page, not splotchy darker and lighter paragraphs.

But another sign of amateur design is bad hyphenation. Follow these rules:

 * Hyphenate only between syllables.
 * Don’t hyphenate across a turned page, i.e., from a recto to a verso.
 * The Chicago Manual of Style doesn’t allow more than three successive lines to end in hyphens (6.58). In my opinion, this is too liberal; I don’t end two lines in a row with hyphens.
 * Never hyphenate a website URL. If it’s too long for a line, make a URL into an extract (see below) and break the URL at a backslash.

The Chicago Manual of Style (6.44-49) lists four pages of addi-tional rules for word division, e.g., not dividing personal names. The Chicago Manual of Style (6.49) allows dividing words with two letters (but never one letter, 6.48) before the division. It doesn’t allow leaving two letters after the division (6.49). This makes no sense to me. The reader should be able to recognize the word from the part before the division. The part after the division doesn’t affect the reader’s recognition of a word. I suggest instead trying to keep four or ﬁve letters before the division, and accepting two letters after a division.

E.g., if you know the ﬁrst ﬁve letters, you can guess most words:

 * You shoul not have a probl readi this sente. (5 letters)
 * Four lett divi are also not hard to read. (4 letters)
 * In con, if you hyp at thr let, it is muc har to rec wor. (3 letters)
 * Re wo fr th ﬁ tw le wo ch ev Va Wh. (2 letters— Recognizing words from the ﬁrst two letters would challenge even Vanna White.)

Hyphenate Compound Words
If two words have a special meaning when used together, they form a compound word. Hyphenate compound words. If you don’t, the reader might get confused.

 * …the ear splitting log.
 * …the ear-splitting siren.

The former sentence means that the ear was splitting a log, like an ax. The latter sentence means that the siren was loud. I.e., in the former sentence, the ear splits the log. In the latter sentence the siren splits the ear.

However, words ending in ly do not follow this rule. Do not hyphenate two words when the ﬁrst word ends in ly. E.g., “…the beautifully painted staircase.”

The Chicago Manual of Style further explains compound words. It provides great examples and explanations for knowing when to hyphenate between words. The table is a great tool to use when determining proper usage. One of the latest updates to the hyphenation table can be found on Chicago Manual of Style's website, The Chicago Manual of Style Online, in chapter seven's section titled, "Spelling, Distinctive Treatment of Words, and Compounds," namely section 7.85. Various examples of this hyphenation table may also be found online without a subscription to CMoS, but be aware of the version and source for proper adherence to the most current grammar rules.

Hanging Punctuation
Professional typesetters extend some punctuation marks, e.g., hyphenation, beyond the right margin. Word processors can’t do this.

title: Basic Book Design/Word Division


text:
Wikijunior:The Elements/What's a molecule?

What is a molecule?
A molecule is the smallest thing that a substance can be divided up into, while remaining the same substance. It is made up of two or more atoms held together by chemical bonding. These atoms can be the same kind, or different kinds. This is slightly different to a compound, where it has to be two or more atoms of different elements. This does mean that all compounds are molecules, but not all molecules are compounds.

Where do we find molecules?
Almost everything is made up of molecules, including the air you breathe, the food you eat, and even the water you drink! In the air, oxygen atoms usually travel with a partner (2 x O = O2), as does hydrogen (2 x H = H2) and nitrogen (N2). Water (H2O) is made of two hydrogen atoms (H2) and one oxygen atom (O). Even regular table salt that you eat is a combination of molecules! Would it surprise you to know that the molecules in table salt are made up of dangerous atoms? You may eat salt every day, but it is made up of an explosive atom (sodium) and a toxic one (chlorine)! The reason salt is safe to eat is that molecules are very different from the atoms that make them up.

How do the atoms join together?
Atoms come together to form molecules because of their electrons. Electrons can join (or bond) atoms together in two main ways. When two atoms share electrons between them, they are locked together (bonded) by that sharing. These are called covalent bonds. Bonds like this are in oxygen gas, nitrogen gas, and hydrogen gas. But when an atom gives one of its electrons to another atom, they are held together by electric forces. These sorts of bonds are called ionic, because once an atom loses or gains an electron, it becomes something called an ion, which has a positive or negative charge. These sorts of bonds are in acids, like vinegar, and bases, like ammonia. Salt is also held together by ionic bonds. The sodium, usually explosive, loses an electron to the chlorine, which is also dangerous in its natural state, but when this reaction happens, both become harmless and even tasty!


text:
Talk:Economic History

This entire book needs to be renamed Economic History. History of Economic Thought should be a history of economnic thought.

I concur. Perhaps it would help to say what we mean by "history of economic thought." Courses and books under that title survey the contributions of the great economists, such as Adam Smith, Malthus, Ricardo, Marx, Mill, Marshall and others, and (usually) something on the contributions of philosophers and others before Smith and something on twentieth-century developments in economics. My course also includes Austrian economics. The draft we see here is indeed economic history, and many economic historians probably would have their doubts about the "stages" approach it uses.

Rogerashton 13:04, 22 October 2006 (UTC)Rogerashton

I completely agree. This book doesn't mention names of economists that founded the theory of economics how we understand it today.

Jarda-wien 17:30, 15 May 2007 (UTC)

I agree. This is economic history, no history of economics! Dick Bos (talk) 09:14, 8 February 2009 (UTC)

I agree with the others, but also feel that if this book isn't going to be vastly expanded it should be edited to include more relevant information and moved to another econ/phil book or deleted all together. After all most of this information would really just be copying the wikipedia page History of Economic THougt -- Mattseeger 2:14 25 January 2009 (CST)

Corrections concerning fears about Communism
I this correction fails our neutral point of view policy. Thenub314 (talk) 08:19, 6 December 2010 (UTC)

title: Talk:Economic History