text:
OpenGL Programming/GLStart/Tut1

Tutorial 1: Creating a Windows program in Dev – C++
This chapter will cover programming with the Win32 API.

Setting up Dev – C++
First open up Dev – C++. When it opens up, click on the top menu bar File, New, Project. Make sure the Basic tab is selected and click on Windows Application. Then give it a name and press OK. Then in the next dialog, choose a location on your computer to save and then press Save:

After you do that, your project loads up and you get a default source file with windows code already in it. Right – click the tab main.cpp above the source file and click Close. When it asks you to save changes, click on No.

To add a new source file to the project, go to the top menu bar and click on File, New, Source File. It will ask you if you want to add the source file to the project. Click Yes. Now you will have a blank source file to edit. Before we start coding, click on File, Save. It will ask you where you want to save your source file. Make sure you save it in the same place you put your Dev – C++ project. Name it something like ”winmain” and click Save. Now that we got a blank source file ready, we can start coding our window.

The first line of the source file should have the windows header “windows.h” included:

 * 1) include

This header includes all the functions and structures we need so far to program in Windows.

Before we go on, there are some things we need to discuss about Window events.

Unlike a standard command – line program, a Windows program has many events happening at once. One example would be the fact that a Window has to constantly repaint the background of itself. This we won’t worry about right now. But there are other events such as a user pressing a button on the window, a user right – clicking with the mouse, etc… The event that we are going to worry about in this lesson is when the user hits the X button on the top – right of the window to exit the program. We have to tell the Operating System (Windows) that when the user does that, the program should quit. The function in Windows that handles these types of events is called a Window Procedure. We are going to define this function next. Also note that Windows doesn’t call these actions “events”, but rather they call them messages. Messages are events. We will be using the term “messages” throughout the lessons. Now let’s start coding the Window Procedure.

The return value of the Window Procedure is the result of the processing of the messages which is returned to the WinMain function (more on this later):

LRESULT CALLBACK WindowProc(    HWND hwnd,	// handle of window     UINT uMsg,	// message identifier     WPARAM wParam,	// first message parameter     LPARAM lParam 	// second message parameter    );

I will explain these parameters in a minute. But this is how you declare the Window Procedure. So right underneath the inclusion of the Windows header, put this in:

LRESULT CALLBACK WinProc(HWND hWnd,                         UINT msg,                          WPARAM wParam,                          LPARAM lParam) {

Notice that you can name the function whatever you want. Here we named it “WinProc”. Easy to remember right? We need this name when we create the actual window. Now let me explain the different parameters there:

HWND hWnd is short for a “handle to a window”. Basically this is the actual window object itself. This handle stores the window in it.

UINT msg is the actual message we will be processing. There are tons and tons of messages we can process, but we will only worry about one in this lesson.

WPARAM wParam and LPARAM lParam are different types of message information. We won’t be using these variables in this lesson. I will explain them some other time.

Now within the Message Procedure we need some way of defining what to do for a certain message. We will use the switch command to sort out these messages:

switch(msg) {

Now we will put in a case statement for the one message we want to handle, which is when the user exits the program. This message has an ID value of WM_DESTROY. When we are in its case statement, we put in a function to quit the program. We will use the PostQuitMessage function which takes as a single parameter the exit code, which is 0:

case WM_DESTROY: PostQuitMessage(0); break; default: break; }

Above we put the quitting message and then ended the switch statement. Now that we took care of that message, we are done with the Window Procedure. One last thing we have to do though is return the results of our message processing to the WinMain function. For this we return the DefWindowProc function:

LRESULT DefWindowProc(    HWND hWnd,	// handle to window     UINT Msg,	// message identifier     WPARAM wParam,	// first message parameter     LPARAM lParam 	// second message parameter    );

As you can see this function takes the same parameters as the window procedure itself. So all you have to do is fill it in with the same parameters you did in the Window Procedure declaration:

return DefWindowProc(hWnd,msg,wParam,lParam); }

Now this finally completes our Window Procedure. Now lets move on to the WinMain function.

WinMain

The WinMain function is sort of like the main function in a regular C or C++ program. It is the entry point for all Windows programs. But it is a bit more complex to set up. Here is its prototype:

int WINAPI WinMain(    HINSTANCE hInstance,	// handle to current instance     HINSTANCE hPrevInstance,	// handle to previous instance     LPSTR lpCmdLine,	// pointer to command line     int nCmdShow 	// show state of window    );

Let me explain the parameters:

HINSTANCE hInstance keeps track of the window. Let me explain this better. It keeps track of the instance, or the appearance, of the window. This is a very hard concept to explain. We will go over this some more later.

HINSTANCE hPrevInstance is not really used.

LPSTR lpCmdLine specifies command – line arguments for the program. We won’t need to worry about this.

int nCmdShow is the way that the window is to be shown. We won’t mess with this yet.

After the message procedure type in the initialization for the WinMain function:

int WINAPI WinMain(HINSTANCE hInstance,                   HINSTANCE hPrevInstance,                    LPSTR lpCmdLine,                    int nShowCmd) {

Now within the WinMain function we have to declare three very important variables. Put this in right after the WinMain initialization:

HWND hWnd; WNDCLASSEX wcex; MSG msg;

Let me explain these variables:

HWND hWnd we already explained in the message procedure. It is the handle that stores the window itself.

WNDCLASSEX wcex is the actual window structure. This structure, which you define, sets certain properties of the window. We will be filling in this structure in a minute.

MSG msg is the message structure like the one in the message procedure. This particular structure contains fields such as the actual message itself. We will be using this later in the WinMain function.

Now that we got those variables, lets define that WNDCLASSEX structure. Here is the prototype of the WNDCLASSEX structure:

typedef struct _WNDCLASSEX {   // wc       UINT    cbSize; UINT   style; WNDPROC lpfnWndProc; int    cbClsExtra; int    cbWndExtra; HANDLE hInstance; HICON  hIcon; HCURSOR hCursor; HBRUSH hbrBackground; LPCTSTR lpszMenuName; LPCTSTR lpszClassName; HICON  hIconSm; } WNDCLASSEX;

Let me show you what to fill in these properties with:

-	UINT cbSize is the size of the structure itself. -	UINT style is the window styles. There are quite a few options for this. We will use the CS_HREDRAW and CS_VREDRAW to allow the window to be resized horizontally and vertically. -	WNDPROC lpfnWndProc is the name of the message procedure you want to link to. We already created this in the beginning so put the name of it (WinProc) in here. -	int cbClsExtra and int cbWndExtra will not be used so it will be set to 0 for both of them. -	HANDLE hInstance is the instance handle we created in the declaration of WinMain. Just put in the name we gave it (hInstance) in this property. -	HICON hIcon is the big icon we want to use for the program. For this we will load a standard icon using the LoadIcon function which takes as parameters: the HINSTANCE of the icon (we set this to NULL) and the Icon name (set to IDI_APPLICATION for a standard windows icon) -	HCURSOR hCursor is the mouse cursor we want to use. For this we use the LoadCursor function which takes as parameters: HINSTANCE of Cursor (set to NULL) and the name of the Cursor ( IDC_ARROW for a standard Windows arrow) -	HBRUSH hbrBackground is the color we want for the background. We get this color by using the GetStockObject function which takes as parameter the name of the brush (we set this to GRAY_BRUSH) and type cast it to HBRUSH type. -	LPCTSTR lpszMenuName identifies the menu we want to use in our program. Since we don’t have one, we set this to NULL. -	LPCTSTR lpszClassName is a string for the name of the Windows class that identifies the window. We will need this name later when we create the window. Set it to “WinClass”. -	HICON hIconSm is the small icon to use for the program. Set this to NULL for a default Icon.

So here is the whole structure defined and ready to be typed:

wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WinProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(NULL,IDI_APPLICATION); wcex.hCursor = LoadCursor(NULL,IDC_ARROW); wcex.hbrBackground = (HBRUSH) GetStockObject(GRAY_BRUSH); wcex.lpszMenuName = NULL; wcex.lpszClassName = "WinClass"; wcex.hIconSm = NULL;

After the defining of the WNDCLASSEX structure, we have to register it with the RegisterClassEx function, which takes as a single parameter a pointer to the WNDCLASSEX structure we want to register:

RegisterClassEx(&wcex);

Now we go on to actually create the window. Remember that HWND (handle to window) that we created at the beginning of the WinMain function? Well, we are going to set that equal to the window we are about to create using the CreateWindow function:

HWND CreateWindow(    LPCTSTR lpClassName,	// pointer to registered class name     LPCTSTR lpWindowName,	// pointer to window name     DWORD dwStyle,	// window style     int x,	// horizontal position of window     int y,	// vertical position of window     int nWidth,	// window width     int nHeight,	// window height     HWND hWndParent,	// handle to parent or owner window     HMENU hMenu,	// handle to menu or child-window identifier     HANDLE hInstance,	// handle to application instance     LPVOID lpParam 	// pointer to window-creation data    );

Let me explain these parameters:

-	LPCTSTR lpClassName is the name of the window class we defined in the definition of the WNDCLASSEX structure (“WinClass”) -	LPCTSTR lpWindowName is the string that appears on the title bar of the window. For now, set it to “Window” -	DWORD dwStyle is specifies certain window styles. There are a bunch of these, but for now we will set it to WS_OVERLAPPEDWINDOW for the window to appear with a border and a minimize,maximize, and close button just like a standard windows application. -	int x and int y are the X and Y locations starting from the top – left corner of the screen of the window. For now we set it to 0 and 0. -	int nWidth and int nHeight are the height and width in pixels of the window. For now set it to 400 and 400. -	HWND hWndParent is a window handle to a parent window. Since we are only creating a single window, set it to NULL to indicate there is no parent window. -	HMENU hMenu identifies a menu to use. Since we have none, set it to NULL. -	HANDLE hInstance is the instance handle that we set to the WNDCLASSEX structure (hInstance). -	LPVOID lpParam is not needed, so set it to NULL.

Here is the whole function with the right parameters passed:

hWnd = CreateWindow("WinClass","My Window",            WS_OVERLAPPEDWINDOW,0,0,400,400,NULL,NULL,             hInstance,NULL);

Just to be on the safe side, lets make sure that the window was created successfully. If the CreateWindow function was successful, the window handle (hWnd) would have a window attached to it. If CreateWindow wasn’t successful, then the window handle would have a value of NULL in it. So first, check for a value of NULL in the window handle with an IF statement:

if(hWnd == NULL) {

Now if the window handle was NULL, we need to tell the user about the error and close the program down. First to inform the user of the problem, we can use a popup message box. For that we use the MessageBox function:

int MessageBox(    HWND hWnd,	// handle of owner window     LPCTSTR lpText,	// address of text in message box     LPCTSTR lpCaption,	// address of title of message box       UINT uType 	// style of message box    );

The first parameter is the window handle of the window the message box is coming from. Since if the window handle is NULL, which we are checking for, put in NULL for this value. The second parameter, lpText, is the main text in the message box dialog. For this put in “Error: Couldn’t create window”. The third parameter, lpCaption, is the title caption on the top of the message box. Set this to “ERROR”. The final parameter, uType, is the message box style. Here you can identify the types of buttons for the user to press on the message box and an icon to appear on the message box. For now, set this to MB_OK for just an OK button on there. After we create the message box, we have to quit the program. Just like a standard C++ main function, when an error occurs we put ”return -1” instead of “return 0” to tell the Operating System we are quitting the program with an error. So after the message box put “return 0”:

MessageBox(NULL,"Error: Unable to create Window","ERROR",MB_OK); return -1; }

Now, assuming the window was created successfully, we need to actually show it. We use the ShowWindow function for that:

BOOL ShowWindow(    HWND hWnd,	// handle of window     int nCmdShow 	// show state of window    );

The first parameter is the handle to the window we want to show (hWnd). The second parameter is the variable we created at the initialization of the WinMain function (nShowCmd):

ShowWindow(hWnd,nShowCmd);

Right after this, we should handle any updates to the window by using the UpdateWindow function which takes as a single parameter the handle of the window to update(hWnd):

UpdateWindow(hWnd);

Now that our window is shown, we need to prevent the program from exiting so our window stays on the screen. To do that we create a main loop. The way I am going to do the loop is create a while loop with a condition of 1 so that the loop is infinite:

while(1) {

Now while the loop is going, we need some way to check for if a user quit the program. To do that we have to check the messages being sent to see if one was a quit message. For that we use the PeekMessage function:

BOOL PeekMessage(    LPMSG lpMsg,	// pointer to structure for message     HWND hWnd,	// handle to window     UINT wMsgFilterMin,	// first message     UINT wMsgFilterMax,	// last message     UINT wRemoveMsg 	// removal flags    ); -	LPMSG lpMsg is a pointer to the message structure that we created at the beginning of the WinMain function (msg) -	HWND hWnd is the window that we want the messages from processed. You can put NULL in here to select the default window -	UINT wMsgFilterMin and UINT wMsgFilterMax specify the minimum and maximum ranges for the messages to be processed. Since we want to process all messages, put 0 in for both of these parameters -	UINT wRemoveMsg determines how messages are handled after they are processed. We will use the value PM_REMOVE telling it to remove messages after they are processed.

Since the PeekMessage function returns a Boolean value determining if it was successful or not, lets put it in an IF Statement to assure that it ran successfully:

if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {

If a message was processed, we need to only check to see if that message was a Quit message. We can do that by checking the message property of the MSG structure we created earlier (msg). The message we are checking for is the WM_QUIT message. If it is, then we have to break out of the loop that the program is currently in:

if(msg.message == WM_QUIT) break;

If a quit message was not processed, we still have to have the other messages processed. For that we use the TranslateMessage function to interpret the message. Then after that we use the DispatchMessage function to execute the message. Both functions take as a single parameter a pointer to the MSG structure:

TranslateMessage(&msg); DispatchMessage(&msg); }     }

Those two curly brackets end our main loop. The last thing we do before we finish up the WinMain function is return a value to the Operating System. We return 0 as the value since by this time the program has run successfully:

return 0; }

Now compile and run the program, and you should get this nice result:

OpenGL 프로그래밍/시작/튜토리얼1

title: OpenGL Programming/GLStart/Tut1


text:
Talk:Developing A Universal Religion/Determining Moral Behaviours/Genetic Manipulation

Interesting point, Heres something to think about.

I think all Genetic research of the actively trying to create new Genes, or new Genetic codes variety should absolutely be haulted until we actually know the syntax laws of the code flawlessly.

No amount of genetic research in the "lets play with genetics splicing and see what we get variety" can ever really give us those answers, and, more importantly, there may be genetic instabilities that arrive by bad splicing; We have no idea which laws of the syntax we are breaking when we splice.

What we need to do is make a very public super database (Which is by the way endgame, finished article definition, in the works if you look at wikimedias other sister project.) What we need to do is comprehensively catalogue in total exquisite detail all of the diversity of biology on planet earth, and then use computer simulations and programming to infer the syntax by cross comparing the assorted genetic codes to the assorted holomorphic forms.

Until that is done, Genetic toying might have extremely hazardous results; for instance, ambiguated genetic structures could end up hopping species, either through accidental apeal by means of the splice intermarriage, or by chaos identification and thus slurpage for some happy exotic virus.

Genetic tinkering in the current era is sloppy and thus dangerous. We now have finally built computers with enough processing power, and we are sharing information in enough of a transparent and thus geometrically increasing way on the internet; What is currently known about genetics could probably solve the mjor genetic problems; the problem is that there are thousands of seperated repositories for that knowledge and theres no way for those Databases to be linked.

The intellectual labor that was impossible until probably 1995 is now probably even more feasable now than it was probably around then. Genetic research of the gambling with random chance, chaos, and fate style should be suspended immediately, along with stem cell research. Not because stem Cell research, or Genetic Engineering aren't promising technologies, but because we are fooling ourselves to beleive that we know enough yet to be responsible with those technologies.

Once we know what we are doing, then swing the doors back open....

Anyways, thats a lot for a discussion...lol.

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


text:
Anim8or - Basics to Advanced/PreReq 3

PreRequisite 3 - Downloading and Installing Anim8or
Here we are going to cover how to obtain the Anim8or program and how to run it.

First go to the Anim8or main website at http://www.anim8or.com. Click on the spinning “Enter” text on the bottom and you will be at the main page. From the menu at the left, select the “Download” link. When you get to that page, select the zip file right under the header “Download Anim8or Executable” and download the zip file to a target folder. Optionally you can go a little bit below that header and download the PDF manual for Anim8or in zip format. Once you have all the files downloaded, unzip the Anim8or zip file and look in the unzipped folder. You should only see just one item in the folder called “Anim8or.exe”. Double-click that to open it. Congratulations on obtaining and running Anim8or.

title: Anim8or - Basics to Advanced/PreReq 3


text:
Talk:Developing A Universal Religion/Revelations And Conversions/The Source Of Revelations

Three very relative reality models to research;

1. "The Collective Unconscious" Yeung and evolving works. (Modern Psychology)

2."Tiferet" of the Qabbalistic Tree of Life a. "Tiferet" in the cosmological scale, c. as relative to the representational location of information in the universe. d.(With malkut as mass, yesod as pure energy, da'at as karma, And Keter as Mind of God / Consciousness / The Force.)

e. Tiferet as the primary location of dreamspaces, and the collective unconscious as tiferets Whorl.

3. Quantum mechanics and non local information.


text:
User:X12345678~enwikibooks

Resume
An undergrad student at UCSD, studying aerospace engineering while working at Six Flags Magic Mountain on weekends.

title: User:X12345678~enwikibooks


text:
Talk:Developing A Universal Religion/Solving Problems

Chapter Two. Solving Problems

1. Mathematical Problems

2. Scientific Problems

3. Problem Environments

4. Moral Problems Morality is the map, Ethics is the Territory.

5. Ethics

6. Metaphysics of Ethics

7. Social Problems (Social Engineering)

8. Civil Problems (Civil Engineering)

9. Psychology Problems (Psychonautics)

10. Logic and Propaganda Problems

11. Paradigmal Problems. (Problems on the order of the real solutions to the assorted questions of what is really junk science, what is really junk religion, what is really junk perspective, what is the truth actually, how do we advance a paradigm foreward by thinking more lucidly about the problem....)


text:
Talk:Developing A Universal Religion/A Universal Religion

From meta-purpose, to universal purpose, to a universal religion: what a train of thought! - i agree, but self congratulatory remarks might be better suited for a chat or discussion environment than the actual article itself.

Our meta-purpose remains just an undefined vision of what Life might eventually become. “Supporting Life’s journey to become oB” may well be an emotionally appealing activity worth adopting when considering behavioural alternatives. However, it will not serve as the guiding purpose the world needs to craft legislation of use in international courts of law. For that a well-defined “universal purpose” is needed.

I think there are a whole host of good motivations and reasons that could be listed which would have a more compelling nature to me personally. I haven't honestly followed the whole train through, I'm still just pulling the most interesting thing i spot and making comment on it.

I think what we are doing here is making the argument PRO "Universal" If thats true, then you and I are definitely living in paralell universes, because my POV is "Educated Integrative Eclectic."

The reasons I think that a "universal" or "Eclectic" Approach should be adopted are; 1. The assorted religions don't operate at the functional level for most Users. Whatever else may be said for Christianity or Islam, The current result of participating is suspiciously similar to a neocortical lobotomy. Why? Because the Religions have invariably been kidnapped and held hostage by politically motivated propagandists. Those people invariably want to use information to CONTROL people, NOT Liberate their minds, or faciliate a Genuine Spiritual Life.

2. In MOST cases, the assorted flaws of any given religious dogma are forced to resolve when that dogmas core axioms are compared to similar core axioms in other religions. ie The problems can be flushed out and the entire set of paradigms can be scrubbed clean most easilly by using alternate dirty paradigms as co-scrubbers.

3. This makes the game of doing this lucidly about single paradigm discussions, with stated up front POV Strubs for all of the denominations likely to register a blip or an opinion one way or the other.

4. Most important in the POV sets are the meta sets. These are.

1. Casual Eclectic; Persons who aren't educated, but can see a pattern with two different religions having two similar core axioms.

2. Educated Lazy Eclectic; Anybody highly educated, but in less than three paradigms

3. Educated Integral Eclectic; Anybody highly educated whos whole POV hinges on bringing in as many different details from as many different paradigms as is possible; IE the "Hard Core" Eclectic. Or, A person highly educated in probably at least two or more paradigms, and at least slightly educated in at least 3 or more others.

4. Universal; The intuitive approach at a high level of functionality.

5. Macro Axiom; A schematized and ordered list of Axioms (pro POV only) Which then links into the POV per axiom pages.

6. Macro Flaw; Logical fallacies, Propaganda tricks, The Psychology of being accidentally wrong and evangelical, etc.

7. Historical Footnotes

8. Annoted Integrative Eclectic Bible

9. Annotated Integrative other religious Text

10. Link outs to Ethics, Sociology, Civil Engineering, Psychonautics Solutions.

---

A universal purpose is also required if a nation-guiding moral code is to be developed. Such a code would provide the moral authority international bodies need if they are to serve humanity well as we move into a very uncertain future.

- Yeah, let me say some things as a Politico and a Social Scientist with the equivalent of a doctorate degree in Political Science and the equivalnet of a Bachelors degree in "War" or "Game" Theory.

We cannot win the war on Terrror. Its a futile venture, because there will be a country with Islamic Radicals running it which also has Nukes within our Lifetimes. The Clock is ticking for us to solve this problem in a real way, or, End the human species due to pack psychologies idiot program.

The real solution to the problem is to resolve the social and civil issues well enough that we can end poverty and strife for everybody on the planet. Whatever kneejerk responses that may elicit, the truth of the matter is that for the same price as the IRAQ war, we could have fed, sheltered, and clothed Every person on this planet.

In the modern era, it is less costly to turn your enemies into your dependants than it is to bother to fight them.

And only THAT wisdom will deliver us from Armageddon. --

This chapter suggests steps that might be taken to build a universal religion from the yet-to-be-developed universal purpose. Some might consider that a powerfully worded and valued purpose should suffice to guide collective global decision making, but this is not how I contend the mind operates. -- My opinion, and what I am trying to drive home to you, is that while your overall concept is a noble and high aspiration, you are making a chronicly naive set of assumptions about how much process is going to be needed to arrive at an end product rather than an eventually deleted POV and Propaganda experiment.

Global decision making will need to arise from the blueprint that we as Authors set down. For instance, take the single topic of "Christianity."

What you need is a few new bullets under that main topic;
 * Pro POV
 * Con POV
 * POV Disambiguation; Please State your Denomination and POV.
 * List Of Standard Axioms
 * List of Esoteric Axioms
 * List of Ethical Errors, and Solutions
 * List of Cognitive Errors, and Solutions
 * List Of Logical Errors, and Solutions
 * List of Social Engineering Errors, and Solutions
 * List and Exploration of Derived Gems
 * Eclectic Integrative Analysis
 * Eclectic Integration

That, in my opinion, could serve as a template for each of the religions. --

As we saw in Part Two, the mental Construct that a belief develops can preclude alternative ways of thinking, thus all true believers of any doctrine will always claim that the commandments of their faith override any national or international law. Something labelled a “universal religion” may come to be regarded as worthy of being equally obeyed. My hope is that some day members of all religions might take the time to consider what was being said, if it were being expressed by a sufficient number of well-respected and influential people all claiming to follow a “universal religion.” -

The ultimate pay off for this is that it is the ultimate tool for diplomacy. If there is an axiom map generated between religions, then people of different religions can use their own religious principles to explore similar ideas in other religions. This makes talking to an Islamic Extremist a whole lot easier, if you have printed out our text to ride along with you in say Palestine.

Again, the “universal religion” being proposed here is not something to be force fed to anyone. It should be seen as a companion to other religions, concerned about and dealing with the welfare of community and life, but having nothing to say about any individual after-life beliefs. Eventually, however, I do think that the rationality of the proposed universal religion will lead it to replace the less objective religions that we have inherited, because humankind is itself becoming more rational. Perhaps this transition will occur sometime in the future, however, not in this century, I suspect. -- I am more optomistic. THIS that we are doingright now, has tremendous causal potential, and the potential for geometric progression in terms of participation. We are in the earliest part of THIS century, so unless you wrote that prior to 2000, I think its very realistic to think that we could create something here which would become the new dominant Religious reference text.

From there, its only a matter of time till the old opinionated non-internet using old foagies start to die off. Evolution and paradigmal theory have been held at bay as forces by the propaganda establishment; but thats slowly creating a tidal surge in knowlege and information. Sooner or later that Tide has to come in somewhere, and when its full impact hits, there is going to be rapid paradigmal evolution, because nobody will be able to take the old paradigms seriously any more.

- Elements of this chapter trouble me. Section two seems to be promoting disorder,

You have to break eggs to make omellettes. -

there are many who know much more than I - possibly, but I think you are still the best lead Author.

about promoting a cause in a sensible manner; they would be the ones to consult when action is sought, not me.

lol.


text:
User talk:Wikiacc

You may get a quicker reply at my Wikipedia talk page.

title: User talk:Wikiacc


text:
Talk:Developing A Universal Religion/Possible Applications/World Problems

Large scale problems exist throughout the world. A few words can readily bring some to mind: famine, diseases, polluted water and air, drought, climate change, deforestation, resource depletion, species extinctions, soil loss, wars, genocide, corruption, social and economic disparities— --- I would add propaganda wars, Politics drifting off towards Oligarchy, Social Engineering, and Civil Engineering, to steer towards answers rather than just complaints. --

once begun the list may run for pages. Lumped all together they are immensely depressing. Many seem irresolvable—how can we even hope to improve such situations? --- answers. * Second step; analyze the problems realistically, * third step, generate new schema to describe the realities we face, * fourth step, generate a problem solving process, * fifth step, implement that problem solving process. -
 * First step; facing the fact that the current paradigm has no

It’s not that efforts haven’t been made. --- No, its that the prevailing dominant paradigms are too primitive to have real answers to the problems. The "Establishment" is lost in its groupthink.

and predicting a fifty percent increase—to hit nine billion—within the next two generations.[1] - We could house them all, for instance, in Southern California, in about 50 1 mile tall arcologies, each with a 30 mile radius farming and garden zone.

The problem that some people think population growth is is illusory; its not too many people, its the net and depth impact on natural resources per capita that is the issue here. -

It is the large scale institutions and interventions that seem so often to be ineffectual—neutered during conception,

-- The horrible truth; The classists WANT Poverty and strife because it stratifies society and they gat to have labor bots, wage slaves, and other folks doing stuff so that decent folks can play golf all day. Thats the only reason those problems have not been solved. Not that somebody hasn't come up with the social or cultural or economic solutions; "Religion" combined with "conservatism" combined with herd mentality, group think, and Greed, keep the solutions science has found from being implemented. Considering the fact that Y'shua ben Yeoseph told us so long ago that "It is easier for a camel to fit through the eye of a needle (eye of a needle in this case refering to the decorative pillars put around doors, and the shape of an eye created by the two cross support structures over the tops of those doors...interesting factiod...lol.) Than for a rich man to enter the kingdom of Heaven". -

Large international governmental organizations become unable to carry out their mandate whenever national interests are allowed to overrule collective good. -- There are a lot of factors that overule working for the collective good. ---

Representatives of different nations all too often seek results that favour national,Dogmatic,Goupthink; rather than global, Tribal, community, ecological, interests, --

Prometheuspan 22:04, 2 February 2006 (UTC)


text:
Acoustics

Acoustics (from Greek ακουστικός pronounced akoustikos meaning "of or for hearing, ready to hear") is the science that studies sound, in particular its production, transmission, and effects. The science of acoustics has many applications which are dependent upon the nature of the sound that is to be produced, transmitted or controlled.

In the case of a desirable sound, such as music, the main application of acoustics is to make the music sound as good as possible. In the case of an undesirable sound, such as traffic noise, the main application of acoustics is in noise reduction.

Another major area of acoustics is in the field of ultrasound which has applications in detection, such as sonar systems or non-destructive material testing. The articles in this Wikibook describe the fundamentals of acoustics and some of the major applications.

In order to add an article to this Wikibook, please read the How to contribute? section.

Fundamentals

 * 1) Fundamentals of Acoustics
 * 2) Fundamentals of Room Acoustics
 * 3) Fundamentals of Psychoacoustics
 * 4) Sound Speed
 * 5) Filter Design and Implementation
 * 6) Flow-induced Oscillations of a Helmholtz Resonator
 * 7) Active Control

Applications in Transport Industry

 * 1) Rotor Stator interactions
 * 2) Car Mufflers
 * 3) Sonic Boom
 * 4) Sonar
 * 5) Interior Sound Transmission

Applications in Room Acoustics

 * 1) Anechoic and reverberation rooms
 * 2) Basic Room Acoustic Treatments

Applications in Psychoacoustics

 * 1) Human Vocal Fold
 * 2) Threshold of Hearing/Pain

Musical Acoustics Applications

 * 1) How an Acoustic Guitar Works
 * 2) Basic Acoustics of the Marimba
 * 3) Bessel Functions and the Kettledrum
 * 4) Acoustics in Violins
 * 5) Microphone Technique
 * 6) Microphone Design and Operation
 * 7) Acoustic Loudspeaker
 * 8) Sealed Box Subwoofer Design

Miscellaneous Applications

 * 1) Bass-Reflex Enclosure Design
 * 2) Polymer-Film Acoustic Filters
 * 3) Noise in Hydraulic Systems
 * 4) Noise from Cooling Fans
 * 5) Piezoelectric Transducers
 * 6) Generation and Propagation of Thunder

Akustik

title: Acoustics


text:
Acoustics/Fundamentals of Acoustics

Introduction
Sound is an oscillation of pressure transmitted through a gas, liquid, or solid in the form of a traveling wave, and can be generated by any localized pressure variation in a medium. An easy way to understand how sound propagates is to consider that space can be divided into thin layers. The vibration (the successive compression and relaxation) of these layers, at a certain velocity, enables the sound to propagate, hence producing a wave. The speed of sound depends on the compressibility and density of the medium.

In this chapter, we will only consider the propagation of sound waves in an area without any acoustic source, in a homogeneous fluid.

Equation of waves
Sound waves consist in the propagation of a scalar quantity, acoustic over-pressure. The propagation of sound waves in a stationary medium (e.g. still air or water) is governed by the following equation (see wave equation):

$$\nabla ^2 p - \frac{1}\frac = 0$$

This equation is obtained using the conservation equations (mass, momentum and energy) and the thermodynamic equations of state of an ideal gas (or of an ideally compressible solid or liquid), supposing that the pressure variations are small, and neglecting viscosity and thermal conduction, which would give other terms, accounting for sound attenuation.

In the propagation equation of sound waves, $$c_0$$ is the propagation velocity of the sound wave (which has nothing to do with the vibration velocity of the air layers). This propagation velocity has the following expression:

$$c_0 = \frac{1} $$

where $$\rho _0$$ is the density and $$\chi _S$$ is the compressibility coefficient of the propagation medium.

Helmholtz equation
Since the velocity field $$\underline v$$ for acoustic waves is irrotational we can define an acoustic potential $$\Phi $$ by:

$$\underline v = \text{grad }\Phi $$

Using the propagation equation of the previous paragraph, it is easy to obtain the new equation:

$$\nabla ^2 \Phi - \frac{1}\frac = 0 $$

Applying the Fourier Transform, we get the widely used Helmholtz equation:

$$\nabla ^2 \hat \Phi + k^2 \hat \Phi  = 0 $$

where $$k$$ is the wave number associated with $$\Phi$$. Using this equation is often the easiest way to solve acoustical problems.

Acoustic intensity and decibel
The acoustic intensity represents the acoustic energy flux associated with the wave propagation:

$$\underline i (t) = p\underline v $$ We can then define the average intensity:

$$\underline I =  \langle \underline i  \rangle $$ However, acoustic intensity does not give a good idea of the sound level, since the sensitivity of our ears is logarithmic. Therefore we define decibels, either using acoustic over-pressure or acoustic average intensity:

$$p^{\rm dB} = 20\log \left(\frac{p}\right) $$ ;  $$L_I  = 10\log \left(\frac{I}\right) $$ where $$p_\mathrm{ref} = 2*10^{ - 5}~{\rm Pa}$$ for air, or $$p_\mathrm{ref}  = 10^{ - 6}~{\rm Pa}$$  for any other media, and $$I_\mathrm{ref} = 10^{ - 12}~{\rm W/m}^2$$.

Plane waves
If we study the propagation of a sound wave, far from the acoustic source, it can be considered as a plane 1D wave. If the direction of propagation is along the x axis, the solution is:

$$\Phi (x,t) = f\left(t - \frac{x}\right) + g\left(t + \frac{x}\right) $$ where f and g can be any function. f describes the wave motion toward increasing x, whereas g describes the motion toward decreasing x.

The momentum equation provides a relation between $$p$$ and $$\underline v$$ which leads to the expression of the specific impedance, defined as follows:

$$\frac{p}{v} = Z = \pm \rho _0 c_0 $$

And still in the case of a plane wave, we get the following expression for the acoustic intensity:

$$\underline i =  \pm \frac\underline {e_x } $$

Spherical waves
More generally, the waves propagate in any direction and are spherical waves. In these cases, the solution for the acoustic potential $$\Phi$$ is:

$$\Phi (r,t) = \frac{1}{r}f\left(t - \frac{r}\right) + \frac{1}{r}g\left(t + \frac{r}\right) $$ The fact that the potential decreases linearly while the distance to the source rises is just a consequence of the conservation of energy. For spherical waves, we can also easily calculate the specific impedance as well as the acoustic intensity.

Boundary conditions
Concerning the boundary conditions which are used for solving the wave equation, we can distinguish two situations. If the medium is not absorptive, the boundary conditions are established using the usual equations for mechanics. But in the situation of an absorptive material, it is simpler to use the concept of acoustic impedance.

Non-absorptive material
In that case, we get explicit boundary conditions either on stresses and on velocities at the interface. These conditions depend on whether the media are solids, inviscid or viscous fluids.

Absorptive material
Here, we use the acoustic impedance as the boundary condition. This impedance, which is often given by experimental measurements depends on the material, the fluid and the frequency of the sound wave.

title: Acoustics/Fundamentals of Acoustics


text:
Acoustics/Rotor Stator Interactions

An important issue for the aeronautical industry is the reduction of aircraft noise. The characteristics of the turbomachinery noise are to be studied. The rotor/stator interaction is a predominant part of the noise emission. We will present an introduction to these interaction theory, whose applications are numerous. For example, the conception of air-conditioning ventilators requires a full understanding of this interaction.

Noise emission of a Rotor-Stator mechanism
A Rotor wake induces on the downstream Stator blades a fluctuating vane loading, which is directly linked to the noise emission.

We consider a B blades Rotor (at a rotation speed of $$\Omega$$) and a V blades stator, in a unique Rotor/Stator configuration. The source frequencies are multiples of $$B \Omega$$, that is to say $$mB \Omega$$. For the moment we don’t have access to the source levels $$F_{m}$$. The noise frequencies are also $$mB \Omega$$, not depending on the number of blades of the stator. Nevertheless, this number V has a predominant role in the noise levels ($$P_{m}$$) and directivity, as it will be discussed later.

Example

For an airplane air-conditioning ventilator, reasonable data are :

$$B=13$$ and $$\Omega = 12000$$ rnd/min

''The blade passing frequency is 2600 Hz, so we only have to include the first two multiples (2600 Hz and 5200 Hz), because of the human ear high-sensibility limit. We have to study the frequencies m=1 and m=2.''

Optimization of the number of blades
As the source levels can't be easily modified, we have to focus on the interaction between those levels and the noise levels.

The transfer function $${{F_m } \over {P_m }}$$ contains the following part :

$$ \sum\limits_{s = - \infty }^{s =  + \infty } {e^{ - {{i(mB - sV)\pi } \over 2}} J_{mB - sV} } (mBM) $$

Where m is the Mach number and $$J_{mB - sV}$$ the Bessel function of mB-sV order. In order to minimize the influence of the transfer function, the goal is to reduce the value of this Bessel function. To do so, the argument must be smaller than the order of the Bessel function.

Back to the example :

''For m=1, with a Mach number M=0.3, the argument of the Bessel function is about 4. We have to avoid having mB-sV inferior than 4. If V=10, we have 13-1x10=3, so there will be a noisy mode. If V=19, the minimum of mB-sV is 6, and the noise emission will be limited.''

Remark :

''The case that is to be strictly avoided is when mB-sV can be nul, which causes the order of the Bessel function to be 0. As a consequence, we have to take care having B and V prime numbers.''

Determination of source levels
The minimization of the transfer function $${{F_m } \over {P_m }}$$ is a great step in the process of reducing the noise emission. Nevertheless, to be highly efficient, we also have to predict the source levels $$F_{m}$$. This will lead us to choose to minimize the Bessel functions for the most significant values of m. For example, if the source level for m=1 is very higher than for m=2, we will not consider the Bessel functions of order 2B-sV. The determination of the source levels is given by the Sears theory, which will not be discussed here.

Directivity
All this study was made for a specific direction : the axis of the Rotor/Stator. All the results are acceptable when the noise reduction is ought to be in this direction. In the case where the noise to reduce is perpendicular to the axis, the results are very different, as those figures shown :

For B=13 and V=13, which is the worst case, we see that the sound level is very high on the axis (for $$\theta = 0$$)

For B=13 and V=19, the sound level is very low on the axis but high perpendicularly to the axis (for $$\theta = Pi/2$$)

External references

 * Prediction of rotor wake-stator interaction noise by P. Sijtsma and J.B.H.M. Schulten

title: Acoustics/Rotor Stator Interactions


text:
Talk:Haskell/Monad transformers

Type of main
I've just discovered that main can have in fact different type than IO, which I thought shouldn't be the case ever. I tried to copy the MaybeT and askPassphrase to a file and run it, first in ghci. But then I wanted to use runghc and put  in the file which worked fine. But adding usual type of IO to main gave an error. Adding IO (Maybe ) worked. This is the first time ever I see that main can have slightly different type, that should be explained a little further or just emphasized at this point.

Kowey's notes
I'm using this section to note my thoughts down as I struggle to understand monad transformers. Perhaps these bits and pieces can then be used to build a tutorial. Don't pay it any heed. I'll clean it up as things become clearer to me and share them with the wikibooks community.

Perhaps one useful trick to understanding this is not to think in terms of embedding one monad instead another, but of combining two monads into a third super-monad with functionality from both.

Or another way to look at is that that monad transformers are devious creatures: we talk about them as if we're running a monad inside of another, but what we're really doing is threading the so-called outer-monad through in so-called inner monad.

 * http://homepages.inf.ed.ac.uk/wadler/topics/monads.html

lift (or liftM for monads)
Ok, so you use  to lift non-monadic functions into a monad. Similarly, monad transformers are monads which provide a function  to lift functions from one monad into another. So,  isn't anything fancy; it's just the same thing as   for monads.

class MonadTrans t where lift :: Monad m => m a -> t m a

Wait a sec: why is it that all of a sudden, our lift function only takes one argument and not two?

 * It looks to me like lift is now lifting any monadic value, not just functions. Let's see here:

liftM :: Monad m                => (a -> b) -> m a -> m b lift  :: (Monad m, MonadTrans t) => m a      -> t m a

 * I'm not sure how well these unify, but hopefully this answers your question. --Ihope127 17:10, 17 February 2006 (UTC)

 * Whoops! Sorry, I didn't mean to leave these old notes lying around. I think I'm ok with   and   now (see the module page).  If you want to help me understand arrows, though, see Talk:Programming:Haskell arrows/Kowey :-D -- Kowey 23:27, 17 February 2006 (UTC)

Squeee!
Nothing serious, but today I figured out how to use the State monad (hurray for me), and I wrote a silly program using a state-monad transformer! I think I'm finally getting this stuff :-)

bottle :: StateT Int IO Int bottle = do  t <- get liftIO $ putStrLn $ show t ++ " bottles of beer on the wall!" put (t - 1) return (t - 1) countBottles :: StateT Int IO countBottles = do  n <- bottle if n == 0 then liftIO $ return else countBottles bottles :: Int -> IO (, Int) bottles = runStateT (countBottles)

Thank you, wikibooks folks!

--Tchakkazulu 20:54, 7 September 2006 (UTC)

Instance definitions
instance (Monad m) => Monad (Maybe m) where

Shouldn't this rather be:

instance Monad Maybe where

Same for List.

--gog (2007-01-18)

 * Whoops! I think the correct declaration is instance Monad (Maybe a) where Thanks for pointing this out -- Kowey 11:49, 18 January 2007 (UTC)

 * Maybe a has kind *. A monad must have kind * -> *. --gog (2007-01-18)

 * You are so right (and you have given me a better grasp what kinds are for). I got confused glancing down at the instance for State, but of course I forgot that the s in State s refers to the thing we're passing around.  Sorry about that.  -- Kowey 12:35, 18 January 2007 (UTC)

Shouldn't be

case b_v of  Nothing -> Nothing Just v -> f v

instead of

case b_v of  Nothing -> Nothing Just v -> Just $ f v ? --buben.razuma 14:27, 5 April 2007 (UTC)

 * I don't think so, because f v already is of type  -- Kowey 19:10, 5 April 2007 (UTC)

 * Yes, it is, that's what I mean. The second snippet is what's written and the first one is what should be. --buben.razuma 19:16, 5 April 2007 (UTC)

 * Eep! You're quite right... hmm... maybe worth taking a second look at that MaybeT... Sorry, I wasn't reading carefully enough. Thought you were talking about the other way around  -- Kowey 05:29, 6 April 2007 (UTC)

StateT definition
I don't see the point of the extra return and (<-) operator in the implementation of the bind operator of StateT: (StateT x) >>= f = StateT $ \s -> do -- get new value, state (v,s') <- x s -- apply bound function to get new state transformation fn (StateT x') <- return $ f v -- apply the state transformation fn to the new state x' s' Couldn't we use let instead?: (StateT x) >>= f = StateT $ \s -> do -- get new value, state (v,s') <- x s -- apply bound function to get new state transformation fn let (StateT x') = f v -- apply the state transformation fn to the new state x' s' -- Auders (talk) 20:28, 28 June 2008 (UTC)

 * Yes, the  is bad style here. Changed to   to mimic the use of  .-- apfeλmus 10:16, 29 June 2008 (UTC)

MonadPlus (MaybeT m)
I tried to copy classes and instances definitions for `MaybeT` into file and trying to run it with GHCi. But I am getting a bit cryptic error message: [1 of 1] Compiling Main            ( Main.hs, interpreted )

Main.hs:28:10: Could not deduce (GHC.Base.Alternative (MaybeT m)) arising from the superclasses of an instance declaration from the context (Monad m)     bound by the instance declaration at Main.hs:28:10-40 In the instance declaration for ‘MonadPlus (MaybeT m)’ Failed, modules loaded: none.

Here is my complete .hs-file: module Main where

import Control.Monad import Control.Monad.Trans.State import Control.Monad.Trans.Class import System.Random

newtype MaybeT m a = MaybeT { runMaybeT :: m (Maybe a) }

instance Monad m => Monad (MaybeT m) where return = MaybeT. return. Just

x >>= f = MaybeT $ do maybe_value <- runMaybeT x                         case maybe_value of                               Nothing    -> return Nothing Just value -> runMaybeT $ f value

instance Monad m => Functor (MaybeT m) where fmap = liftM

instance Monad m => Applicative (MaybeT m) where pure = return (<*>) = ap

instance Monad m => MonadPlus (MaybeT m) where mzero    = MaybeT $ return Nothing mplus x y = MaybeT $ do maybe_value <- runMaybeT x                           case maybe_value of                                 Nothing    -> runMaybeT y                                 Just _     -> return maybe_value

instance MonadTrans MaybeT where lift = MaybeT. (liftM Just)

My GHCi version is: $ ghci --version The Glorious Glasgow Haskell Compilation System, version 7.10.3

Am I missing something? 79.173.88.26 (discuss) 21:25, 5 January 2016 (UTC)

 * You are not doing anything wrong. The issue is that from GHC 7.10 onwards not only  is a superclass of   but also   (which is to   what   is to  ) is a superclass of  . That means the example code was only half-converted to 7.10 -- to make it work, we would also need to add the   instance, which is the really same one written for  :

instance Monad m => Alternative (MaybeT m) where empty    = MaybeT $ return Nothing x <|> y  = MaybeT $ do maybe_value <- runMaybeT x                            case maybe_value of                                 Nothing    -> runMaybeT y                                 Just _     -> return maybe_value

instance Monad m => MonadPlus (MaybeT m) where mzero = empty mplus = (<|>)

 * That wasn't fixed yet because doing so in the proper way requires rewriting the  chapter so that it also talks about    as well, which in principle calls for explaining   in at least a preliminary way amidst these monad chapters -- and figuring out the best way of rearranging the book to do that is still a bit of an open problem... --Duplode (discuss • contribs) 06:23, 6 October 2016 (UTC)

requests

 * 1) Could a motivating example be put near the beginning of this article, e.g. something that shows exactly why you would use a transformer and how you'd use it to combine actions from two different monads.
 * 2) The table of transformers in the "cousins" section should include a row for MaybeT since MaybeT is explained in detail further down.  MaybeT is probably a good candidate for the motivating example above as well, since Maybe is such a simple monad.  So you'd have an example of using MaybeT near the top, then go on to the implementation explanation further down.  Any other transformers mentioned in the article should also be put in the table, if they're not already there.
 * 3) I'm a bit fuzzy about this but "The type constructor Reader r is an instance of the Monad class" looks a little odd to me; I thought that types (not type constructors) were instances of type classes.  Am I missing something?  If there's a distinction, is it just a pedantic one?
 * Thanks.

 * Yes. The chapters about monads are currently undergoing a rewrite, starting with Haskell/Understanding monads. So, this chapter will be rewritten too and get motivation, but I can't say when :-)
 * Yes. Someone please do so.
 * Type constructors (i.e. things of kind ) can indeed be instances of classes two. In fact, this feature was added to Haskell exactly to make the monad class possible. So, the the constructor   is the monad, not the "concrete" type   (of kind  ). Haskell/Understanding monads already contains a bit of info on this.
 * -- apfeλmus 11:19, 5 August 2007 (UTC)

 * I'm not sure I want to be tinkering with the article text, but here's a motivating example I emailed a friend once. I think it's right. It may be of some use:

 * Concrete example: Suppose I was writing a server. Each client thread must be of type IO (that's because forkIO :: IO  -> IO ThreadID)).

 * Suppose also that this server has some configuration that (in an imperative program) would be global that the clients all need to query.

 * > data Config = Config Foo Bar Baz

 * One way of doing this is to use currying and making all the client threads of type Config -> IO . Not too nice because any functions they call have to be passed the Config parameter manually. The Reader monad solves this problem but we've already got one monad. We need to wrap IO in a ReaderT. The type constructor for ReaderT is ReaderT r m a, with r the shared environment to read from, m the inner monad and a the return type. Our client_func becomes:

 * > client_func :: ReaderT Config IO

 * We can then use the ask, asks and local functions as if Reader was the only Monad:

 * (these examples are inside do blocks)

 * > p <- asks port

 * (Assuming some function port :: Config -> Int or similar.)

 * To do stuff in IO (or in the general case any inner monad) the liftIO function is used to make an IO function work in this wrapped space:

 * (given h :: Handle, the client's handle)

 * > liftIO $ hPutStrLn h "You lose"
 * > liftIO $ hFlush h

 * IO is once again special. For other inner monads, the lift function does the same thing. Note also that IO has no transformer and must therefore always be the innermost monad.

 * This is all well and good, but the client_func now has type ReaderT Config IO and forkIO needs a function of type IO . The escape function for Reader is runReader :: Reader r a -> r -> a and similarly for ReaderT the escape function is runReaderT :: ReaderT r m a -> r -> m a:

 * (Given some c :: Config that's been assembled from config files or the like)

 * > forkIO (runReaderT client_func c)

 * Will do the trick.

 * Monad transformers are like onions. They make you cry but you learn to appreciate them. Like onions, they're also made of layers. Each layer is the functionality of a new monad, you lift monadic functions to get into the inner monads and you have transformerised functions to unwrap each layer. They're also like a present in that regard: in this example we unwrapped the outer wrapping paper to get to the present: an object of type IO, which let us make haskell do something. 129.11.251.78 (talk) 23:26, 13 December 2007 (UTC)

Dead links.
Please fix up the ghc documentation links. Thanks for the great tutorial.

2012-05-06 reorganization
I have just performed a major reorganization in the article. The getPassword example, which introduces transformers though MaybeT, was made slightly more detailed to work better as an introduction. The corresponding section about MaybeT further in the page was removed, along with most references to the sandwich analogy (though I left a body note about it near the beginning). The dissection of ListT was grouped at the end with the StateT discussion; the lift section now precedes it. The older introduction is mostly gone, with only the All About Monads derived part (the one with the table) remaining, and even that was completely reworked to fit the surrounding context (a later addition to it, which tried to generalize the non-generalizable was summarily removed). Hopefully you will find the text much more readable now. There are still improvements to be made - IMO, the key one is adding better practical exercises (I have a few ideas about that) and providing solutions to the existing ones. --Duplode (discuss • contribs) 13:22, 6 May 2012 (UTC)

2015-09-11 cleanup
A general cleanup of the sections after the  introduction was performed, with the main goal of clarifying some confusing passages and shifting the focus of some others. Solutions to the exercises were added as well. Remaining concerns include:

 * The  discussion was mercilessly removed, mostly to avoid facing the infamous "ListT done wrong" issue (that is, the fact that the   in transformers violates the monad laws when used with non-commutative base monads).
 * Calling the non-transformer "cousin" of a monad transformer "base monad" is unfortunate, as "base monad" usually refers to what this chapter calls "inner monad".
 * The password example should probably include a runnable full-program demonstration.

This is the latest revision before the cleanup.

Duplode (discuss • contribs) 10:17, 11 September 2015 (UTC)

 * The issue with "inner" vs "base" monad looks a bit confusing indeed. Intuitively, i felt that in,   is the base monad and   is the inner, because   is essentially   (with   inside), and i would say that   is based on  .  This also agrees with the usage in Control.Monad.Trans.Class documentation.  However, to be sure, i would have liked to know if there is any relevant mathematical terminology. --Alexey Muranov (discuss • contribs) 17:08, 21 April 2017 (UTC)

 * Indeed, that definitely needed fixing -- thanks for reminding me of it. The transformers documentation uses "base monad" and "inner monad" as synonyms (contrast the passages that talk about "an operation runXXXT to unwrap the transformer, exposing a computation of the inner monad" and "a mapping from transformations between base monads"), and doing anything else is likely to result in confusion. That being so, I changed the text so that "base monad" now refers to e.g.  in  . It is trickier to pick a term for the role of , and there isn't really an established choice. Since the monad in this role often isn't literally part of the unwrapped type, but only notionally so (an example of that is  ), explanations about transformers tend to talk about them in more abstract terms (such as "added effect", or "added feature"). Taking that into account, I provisionally changed it to "precursor monad", in the sense of a conceptual precursor to the transformer. I also thought of "model monad", which might capture the idea better, at the cost of appropriating a word with significantly more baggage. If you have other suggestions, I'm all ears! --Duplode (discuss • contribs) 08:26, 22 April 2017 (UTC)

 * How about imitating the OOP and calling  in   the base or parent monad?  As to , what about feature monad?
 * I tried to follow some links and references from the nLab page on Monad transformers, but didn't find so far any special terms for these notions. (I wonder if these notions are not too unimportant from the general theoretical viewpoint.)  I do not know much about this subject so far. --Alexey Muranov (discuss • contribs) 13:21, 22 April 2017 (UTC)

 * Yup, in the first case "base monad" is the way to go. As for the second case, "feature monad" might work too. In a similar vein, I had thought about "added monad", but that might be confusing in the cases in which the "added" monad isn't literally there. Another option worth considering is rewriting everything so that we don't refer to it as a monad, but rather as the "added feature" (or "added effect", etc.). That might make some passages less clumsy (in particular, the paragraph after the table in the "Type juggling" subsection).

 * As for math references, as far as I'm aware of your suspicion is right: this is a topic more interesting to Haskellers than to category theorists, and so the mathematical literature doesn't have much to say about terminology.

 * Duplode (discuss • contribs) 20:12, 22 April 2017 (UTC)

MonadState instance declaration
This is a bit confusing. The explanation in the box is especially confusing. Nowhere have we talked about a set of types that "together form an instance of" some type class. Does the  class have a parameter  ?

 * "Does the  class have a parameter  ?" Yes, it does; and no, we haven't talked about such things before. That is an example of a multi-parameter type class, one of the many type system extensions in common use. It is the sort of detail we would rather not emphasise during an introductory presentation of something else, and so the note was an attempt to not leave it unmentioned without bogging down the reader in details. The wording probably can be improved -- perhaps it glosses over the issue a little too much. --Duplode (discuss • contribs) 05:59, 6 October 2016 (UTC)

askPassphrase not exactly the same.
Great tutorial, but the simplified 'askPassphrase' function is not equivalent. There is no printing of "Passphrase invalid." in the transformer version.

title: Talk:Haskell/Monad transformers


text:
Haskell/Monad transformers

We have seen how monads can help handling  actions, , lists, and state. With monads providing a common way to use such useful general-purpose tools, a natural thing we might want to do is using the capabilities of several monads at once. For instance, a function could use both I/O and  exception handling. While a type like  would work just fine, it would force us to do pattern matching within   do-blocks to extract values, something that the   monad was meant to spare us from.

Enter monad transformers: special types that allow us to roll two monads into a single one that shares the behavior of both.

Passphrase validation
Consider a real-life problem for IT staff worldwide: getting users to create strong passphrases. One approach: force the user to enter a minimum length with various irritating requirements (such as at least one capital letter, one number, one non-alphanumeric character, etc.)

Here's a Haskell function to acquire a passphrase from a user:

First and foremost,  is an   action, as it needs to get input from the user. We also use, as we intend to return   in case the password does not pass the. Note, however, that we aren't actually using  as a monad here: the   block is in the   monad, and we just happen to   a   value inside it.

Monad transformers not only make it easier to write  but also simplify all the code instances. Our passphrase acquisition program could continue like this: The code uses one line to generate the  variable followed by further validation of the passphrase.

With monad transformers, we will be able to extract the passphrase in one go — without any pattern matching (or equivalent bureaucracy like ). The gains for our simple example might seem small but will scale up for more complex situations.

A simple monad transformer:
To simplify  and the code that uses it, we will define a monad transformer that gives the   monad some characteristics of the   monad; we will call it. That follows a convention where monad transformers have a " " appended to the name of the monad whose characteristics they provide.

is a wrapper around, where   can be any monad (  in our example): This data type definition specifies a  type constructor, parameterized over , with a data constructor, also called  , and a convenient accessor function  , with which we can access the underlying representation.

The whole point of monad transformers is that they transform monads into monads; and so we need to make  an instance of the   class:

It would also have been possible (though arguably less readable) to write the return function as:.

Starting from the first line of the  block: It may look a bit complicated, but aside from the copious amounts of wrapping and unwrapping, the implementation of 's bind works the same way as the implementation of  's familiar bind operator:
 * First, the  accessor unwraps   into an   computation. That shows us that the whole   block is in.
 * Still in the first line,  extracts a   value from the unwrapped computation.
 * The  statement tests  :
 * With, we return   into  ;
 * With, we apply   to the   from the  . Since   has   as result type, we need an extra   to put the result back into the   monad.
 * Finally, the  block as a whole has   type; so it is wrapped with the   constructor.

Why use the  constructor before the   block while we have the accessor   within  ? Well, the  block must be in the   monad, not in   (which lacks a defined bind operator at this point).

As usual, we also have to provide instances for the superclasses of,   and  :

In addition, it is convenient to make  an instance of a few other classes:

implements the  function, so we can take functions from the   monad and bring them into the   monad in order to use them in   blocks. As for  and , since   is an instance of those classes it makes sense to make the   an instance too.

Passphrase validation, simplified
The above passphrase validation example can now be simplified using the  monad transformer as follows:

The code is now simpler, especially in the user function. Most importantly, we do not have to manually check whether the result is  or  : the bind operator takes care of that for us.

Note how we use  to bring the functions   and   into the   monad. Also, since  is an instance of , checking for passphrase validity can be taken care of by a   statement, which will return   (i.e.  ) in case of a bad passphrase.

Incidentally, with the help of  it also becomes very easy to ask the user ad infinitum for a valid passphrase:

Running your new version of askPassphrase on ghci is easy:

A plethora of transformers
The transformers package provides modules with transformers for many common monads (, for instance, can be found in ). These are defined consistently with their non-transformer versions; that is, the implementation is basically the same except with the extra wrapping and unwrapping needed to thread the other monad. From this point on, we will use precursor monad to refer to the non-transformer monad (e.g. Maybe in MaybeT) on which a transformer is based and base monad to refer to the other monad (e.g. IO in MaybeT IO) on which the transformer is applied.

To pick an arbitrary example,  is a computation which involves reading values from some environment of type   (the semantics of , the precursor monad) and performing some   in order to give a value of type. Since the bind operator and  for the transformer mirror the semantics of the precursor monad, a   block of type   will, from the outside, look a lot like a   block of the   monad, except that   actions become trivial to embed by using.

Type juggling
We have seen that the type constructor for  is a wrapper for a   value in the base monad. So, the corresponding accessor  gives us a value of type   - i.e. a value of the precursor monad returned in the base monad. Similarly, for the  and   transformers, which are built around lists and   respectively: and

Not all transformers are related to their precursor monads in this way, however. Unlike the precursor monads in the two examples above, the,  ,  , and   monads have neither multiple constructors nor constructors with multiple arguments. For that reason, they have run... functions which act as simple unwrappers, analogous to the run...T of the transformer versions. The table below shows the result types of the run... and run...T functions in each case, which may be thought of as the types wrapped by the base and transformed monads respectively.

Notice that the precursor monad type constructor is absent in the combined types. Without interesting data constructors (of the sort that  and lists have), there is no reason to retain the precursor monad type after unwrapping the transformed monad. It is also worth noting that in the latter three cases we have function types being wrapped. , for instance, turns state-transforming functions of the form  into state-transforming functions of the form  ; only the result type of the wrapped function goes into the base monad. is analogous. is different because of the semantics of  (the continuation monad): the result types of both the wrapped function and its function argument must be the same, and so the transformer puts both into the base monad. In general, there is no magic formula to create a transformer version of a monad; the form of each transformer depends on what makes sense in the context of its non-transformer type.

Lifting
We will now have a more detailed look at the  function, which is critical in day-to-day use of monad transformers. The first thing to clarify is the name "lift". One function with a similar name that we already know is. As we have seen in Understanding monads, it is a monad-specific version of :

applies a function  to a value within a monad. We can also look at it as a function of just one argument:

converts a plain function into one that acts within. By "lifting", we refer to bringing something into something else — in this case, a function into a monad.

allows us to apply a plain function to a monadic value without needing do-blocks or other such tricks:

The  function plays an analogous role when working with monad transformers. It brings (or, to use another common word for that, promotes) base monad computations to the combined monad. By doing so, it allows us to easily insert base monad computations as part of a larger computation in the combined monad.

is the single method of the  class, found in. All monad transformers are instances of, and so   is available for them all.

There is a variant of  specific to   operations, called , which is the single method of the   class in.

can be convenient when multiple transformers are stacked into a single combined monad. In such cases,  is always the innermost monad, and so we typically need more than one lift to bring   values to the top of the stack. is defined for the instances in a way that allows us to bring an  value from any depth while writing the function a single time.

Implementing
Implementing  is usually pretty straightforward. Consider the  transformer:

We begin with a monadic value of the base monad. With  (  would have worked just as fine), we slip the precursor monad (through the   constructor) underneath, so that we go from   to. Finally, we wrap things up with the  constructor. Note that the  here works in the base monad, just like the do-block wrapped by   in the implementation of   we saw early on was in the base monad.

The State transformer
As an additional example, we will now have a detailed look at the implementation of. You might want to review the section on the State monad before continuing.

Just as the State monad might have been built upon the definition, the StateT transformer is built upon the definition:

will have the following  instance, here shown alongside the one for the precursor state monad:

Our definition of  makes use of the   function of the base monad. uses a do-block to perform a computation in the base monad.

If the combined monads  are to be used as state monads, we will certainly want the all-important   and   operations. Here, we will show definitions in the style of the mtl package. In addition to the monad transformers themselves, mtl provides type classes for the essential operations of common monads. For instance, the  class, found in, has   and   as methods:

There are  instances for state monads wrapped by other transformers, such as. They bring us extra convenience by making it unnecessary to lift uses of  and   explicitly, as the   instance for the combined monads handles the lifting for us.

It can also be useful to lift instances that might be available for the base monad to the combined monad. For instance, all combined monads in which  is used with an instance of   can be made instances of  :

The implementations of  and   do the obvious thing; that is, delegating the actual work to the instance of the base monad.

Lest we forget, the monad transformer must have a, so that we can use  :

The  function creates a   state transformation function that binds the computation in the base monad to a function that packages the result with the input state. If, for instance, we apply StateT to the List monad, a function that returns a list (i.e., a computation in the List monad) can be lifted into  where it becomes a function that returns a. I.e. the lifted computation produces multiple (value,state) pairs from its input state. This "forks" the computation in StateT, creating a different branch of the computation for each value in the list returned by the lifted function. Of course, applying  to a different monad will produce different semantics for the   function.

Acknowledgements
This module uses a number of excerpts from All About Monads, with permission from its author Jeff Newbern.

Haskell/Monad transformers

title: Haskell/Monad transformers


text:
Acoustics/Sound Speed

The speed of sound c (from Latin celeritas, "velocity") varies depending on the medium through which the sound waves pass. It is usually quoted in describing properties of substances (e.g. Sodium's Speed of Sound is listed under Other Properties). In conventional use and scientific literature, sound velocity v is the same as sound speed c. Sound velocity c or velocity of sound should not be confused with sound particle velocity v, which is the velocity of the individual particles.

More commonly the term refers to the speed of sound in air. The speed varies depending on atmospheric conditions; the most important factor is the temperature. Humidity has very little effect on the speed of sound, while the static sound pressure (air pressure) has none. Sound travels slower with an increased altitude (elevation if you are on solid earth), primarily as a result of temperature and humidity changes. An approximate speed (in metres per second) can be calculated from:

c_{\mathrm{air}} = (331{.}5 + (0{.}6 \cdot \theta)) \ \mathrm{m/s}\, $$

where $$\theta\, $$ (theta) is the temperature in degrees Celsius.

Details
A more accurate expression for the speed of sound is

c = \sqrt {\kappa \cdot R\cdot T} $$ where
 * R is the gas constant (287.05 J/(kg·K) for air). It is derived by dividing the universal gas constant $$R$$ (J/(mol·K)) by the molar mass of air (kg/mol), as is common practice in aerodynamics.
 * κ (kappa) is the adiabatic index (1.402 for air), sometimes noted as γ (gamma).
 * T is the absolute temperature in kelvins.

In the standard atmosphere:

T0 is 273.15 K (= 0 °C = 32 °F), giving a value of 331.5 m/s (= 1087.6 ft/s = 1193 km/h = 741.5 mph = 643.9 knots). T20 is 293.15 K (= 20 °C = 68 °F), giving a value of 343.4 m/s (= 1126.6 ft/s = 1236 km/h = 768.2 mph = 667.1 knots). T25 is 298.15 K (= 25 °C = 77 °F), giving a value of 346.3 m/s (= 1136.2 ft/s = 1246 km/h = 774.7 mph = 672.7 knots).

In fact, assuming an ideal gas, the speed of sound c depends on temperature only, not on the pressure. Air is almost an ideal gas. The temperature of the air varies with altitude, giving the following variations in the speed of sound using the standard atmosphere - actual conditions may vary. Any qualification of the speed of sound being "at sea level" is also irrelevant. Speed of sound varies with altitude (height) only because of the changing temperature!

In a Non-Dispersive Medium – Sound speed is independent of frequency. Therefore the speed of energy transport and sound propagation are the same. For audio sound range, air is a non-dispersive medium. We should also note that air contains CO2 which is a dispersive medium and it introduces dispersion to air at ultrasound frequencies (~28 kHz). In a Dispersive Medium – Sound speed is a function of frequency. The spatial and temporal distribution of a propagating disturbance will continually change. Each frequency component propagates at its own phase speed, while the energy of the disturbance propagates at the group velocity. Water is an example of a dispersive medium.

In general, the speed of sound c is given by

c = \sqrt{\frac{C}{\rho}} $$ where
 * C is a coefficient of stiffness
 * $$\rho$$ is the density

Thus the speed of sound increases with the stiffness of the material, and decreases with the density.

In a fluid the only non-zero stiffness is to volumetric deformation (a fluid does not sustain shear forces).

Hence the speed of sound in a fluid is given by

c = \sqrt {\frac{K}{\rho}} $$ where
 * K is the adiabatic bulk modulus

For a gas, K is approximately given by

K=\kappa \cdot p $$

where
 * κ is the adiabatic index, sometimes called γ.
 * p is the pressure.

Thus, for a gas the speed of sound can be calculated using:

c = \sqrt {{\kappa \cdot p}\over\rho} $$ which using the ideal gas law is identical to:

$$ c = \sqrt {\kappa \cdot R\cdot T} $$

(Newton famously considered the speed of sound before most of the development of thermodynamics and so incorrectly used isothermal calculations instead of adiabatic. His result was missing the factor of κ but was otherwise correct.)

In a solid, there is a non-zero stiffness both for volumetric and shear deformations. Hence, in a solid it is possible to generate sound waves with different velocities dependent on the deformation mode.

In a solid rod (with thickness much smaller than the wavelength) the speed of sound is given by:

c = \sqrt{\frac{E}{\rho}} $$

where

 * E is Young's modulus
 * $$\rho$$ (rho) is density

Thus in steel the speed of sound is approximately 5100 m/s.

In a solid with lateral dimensions much larger than the wavelength, the sound velocity is higher. It is found by replacing Young's modulus with the plane wave modulus, which can be expressed in terms of the Young's modulus and Poisson's ratio as:

M = E \frac{1-\nu}{1-\nu-2\nu^2} $$

For air, see density of air.

The speed of sound in water is of interest to those mapping the ocean floor. In saltwater, sound travels at about 1500 m/s and in freshwater 1435 m/s. These speeds vary due to pressure, depth, temperature, salinity and other factors.

For general equations of state, if classical mechanics are used, the speed of sound $$c$$ is given by

c^2=\frac{\partial p}{\partial\rho}$$ where differentiation is taken with respect to adiabatic change.

If relativistic effects are important, the speed of sound $$S$$ is given by:

S^2=c^2 \left. \frac{\partial p}{\partial e} \right|_{\rm adiabatic} $$

(Note that $$ e= \rho (c^2+e^C) \,$$ is the relativistic internal energy density).

This formula differs from the classical case in that $$\rho$$ has been replaced by $$e/c^2 \,$$.

Speed of sound in air
Mach number is the ratio of the object's speed to the speed of sound in air (medium).

Sound in solids
In solids, the velocity of sound depends on density of the material, not its temperature. Solid materials, such as steel, conduct sound much faster than air.

Experimental methods
In air a range of different methods exist for the measurement of sound.

Single-shot timing methods
The simplest concept is the measurement made using two microphones and a fast recording device such as a digital storage scope. This method uses the following idea.

If a sound source and two microphones are arranged in a straight line, with the sound source at one end, then the following can be measured:

 * 1) The distance between the microphones (x)
 * 2) The time delay between the signal reaching the different microphones (t)

Then v = x/t

An older method is to create a sound at one end of a field with an object that can be seen to move when it creates the sound. When the observer sees the sound-creating device act they start a stopwatch and when the observer hears the sound they stop their stopwatch. Again using v = x/t you can calculate the speed of sound. A separation of at least 200 m between the two experimental parties is required for good results with this method.

Other methods
In these methods the time measurement has been replaced by a measurement of the inverse of time (frequency).

Kundt's tube is an example of an experiment which can be used to measure the speed of sound in a small volume, it has the advantage of being able to measure the speed of sound in any gas. This method uses a powder to make the nodes and antinodes visible to the human eye. This is an example of a compact experimental setup.

A tuning fork can be held near the mouth of a long pipe which is dipping into a barrel of water, in this system it is the case that the pipe can be brought to resonance if the length of the air column in the pipe is equal to ( {1+2n}/λ ) where n is an integer. As the antinodal point for the pipe at the open end is slightly outside the mouth of the pipe it is best to find two or more points of resonance and then measure half a wavelength between these.

Here it is the case that v = fλ

title: Acoustics/Sound Speed


text:
Talk:Emergency Medicine/Dysbarism

Dysbarism refers to problems with depressuriziation/repressurization, often to do with aquatic submersion with rapid ascent, or difficulty acclimating to altitude. This article is about radiation injuries, and as such is under the wrong heading altogether.

R. S. Sahsi, B.Sc(Hons) MD CCFP(EM)

64.26.155.24 02:31, 3 February 2006 (UTC)

title: Talk:Emergency Medicine/Dysbarism


text:
Budget Watch Collecting/Jewels

17 jewels is a magic number for a jeweled watch--That is the minimum number needed to jewel all the critical parts on a time-only watch. Any fewer jewels on a detached lever watch is a budgetary compromise. Note: in horology, the terms lever and pallet are interchangeable.

Jewel Definitions
A pivot jewel has a hole in the center. The pivot from a staff will use that hole as a bearing.

A cap jewel (also known as an endstone) covers the end of a pivot, helps hold oil in place. When properly done, will slightly improve performance.

The impulse jewel is the main part of the balance assembly that the pallet fork contacts.

Pallet jewels are somewhat rectangular with angled surfaces, the parts of the pallet that touch the escape wheel.

The standard jewels, in order of usefulness
Balance wheel pivot jewels (2) Balance wheel cap jewels (2) (4) Balance wheel impulse jewel (1) (5) Pallet jewels (2)  (7)

This would be the logical arrangement for a 7 jewel movement.

pallet pivot jewels (2) (9) Escape wheel pivot jewels (2) (11) 4th wheel pivot jewels (2) (13) third wheel pivot jewels (2) (15)

Some 15 jewel watches will include all of these jewels, while others will include the center wheel jewels but use a pin-lever mechanism in place of the jeweled lever.

Center wheel pivot jewels (2) The final necessary jewels.

Other places for jewels
Additionally, pairs of cap jewels can be added to the pivots of the fork, escape, fourth and third wheels, in order of usefulness. Cap jewels on the fork are useful but fairly difficult, while cap jewels on the train are fairly easy.

Complications can legitimately use jewels--Chronographs and auto-wind systems are two common uses of jewels

The mainspring arbor may also be jeweled. This is a marginal use of jewels.

Marketing jewels

Many watches have jewels added that do not materially improve the watch, but appeal to the "more jewels is better" belief. In some cases, a 15 jewel pinlever movement will have an extra set of cap jewels added to get to the magic 17. Timex made a very odd 21 jewel watch, based on their zero-jewel pinlever designs. In these, the balance had no cap or pivot jewels, but most of the train had cap jewels of marginal value, in addition to somewhat useful pivot jewels. Waltham made a 75 and 100 jewel watch with a standard 17 jewel movement enhanced by the addition of jewels around the rim of the watch theoretically to prevent the rotor from wearing the movement if it was impacted. see [this article on Timezone.com] for more details.

title: Budget Watch Collecting/Jewels


text:
Budget Watch Collecting/How a Watch Works

Overview:

The crown (of a manual wind) or the rotor (of an auto wind) rotates, turning gears in the keyless works which in turn rotate the mainspring arbor, winding the mainspring. The mainspring turns the mainspring barrel, which turns the train, which supplies power to the escapement, which slows the train down to a precisely regulated speed.

The Keyless works

In the winding position, turning the crown turns the winding pinion. Clockwise (as viewed from the crown) the winding pinion will turn the clutch wheel, which will turn an intermediate wheel and then a gear attached to the mainspring arbor. Counterclockwise, the winding pinion and clutch wheel have ramped teeth that will disengage.

In the setting position, the winding pinion moves away from the clutch wheel and towards the center of the watch where it engages an intermediate wheel that in turn engages the minute wheel.

The Train

The train consists of the center wheel, which turns at one revolution per hour. The center wheel drives the third wheel and also the motion works. The third wheel drives the fourth wheel usually at 1 revolution per minute. In direct seconds watches, the fourth wheel directly drives the seconds hand.

The Motion Works The cannon pinion is attached with a friction fit to the center wheel. It drives the minute wheel, and also holds the minute hand. The hour wheel slips over the cannon pinion, and is driven by the minute wheel, using the cannon pinion as it's axle.

During setting, the intermediate wheel will be turned by the winding pinion, and will turn the minute wheel, which will make the cannon pinion slip on the center wheel shaft.

The Escapement

The escapement consists of the balance, hairspring, lever and escape wheel. When force is applied to the escape wheel by the fourth wheel, it will begin to turn, forcing one of the pallet jewels (referred to as jewel A) away, but bringing the other pallet jewel (B) into position to stop the movement after a 1/2 tooth rotation. The tail end of the fork will send an impulse to the balance through the impulse jewel. This will cause the balance to rotate in one direction until it is reversed by the tension of the hairspring. When the balance reverses, it will push the fork in the opposite direction, moving jewel B out of the way, and allowing the escape wheel to rotate. As the escape rotates, it supplies an impale to jewel B, which will again send an impulse through the tail (in the opposite direction of the first one) to the balance wheel, causing it to rotate. Additionally, jewel A will move into position to block the rotation of the escape wheel after 1/2 tooth of rotation. Once again the balance will be reversed by the hairspring, moving jewel A again until it can again be pushed out of the way, repeating the cycle.

The mass of the balance wheel and the length and stiffness of the hairspring combine to have a natural resonant frequency--generally between 5 and 8 half-cycles (or beats) per second on a wristwatch. Each beat will cause one jump of the seconds hand. The outside of the hairspring is held to the balance cock by the hairspring stud, while the inside is held to the balance by the collet. Generally either the stud or the collet is moveable to allow the balance to be adjusted "in beat", where the motion is centered on the fork rather than turning farther in one direction than the other.

In most watches, the hairspring will pass through the regulator, a slot on a moveable arm. When this arm is moved closer to the stud, the working length of the spring is longer, slowing the resonant frequency, causing the watch to run slower. Moving it away from the stud speeds the watch up. A few watches have no regulator, instead relying on moveable weights on the balance to adjust the resonant frequency and rate of the watch.


text:
User:Jguk

Hello.

I'm a 32-year-old tax advisor from London. I'm here to write a wikibook on Taxation in the United Kingdom. I'm starting with corporation tax, as that's my specialism. If you can contribute, either by adding content on corporation tax or other tax issues, or by asking questions or critiquing the text, please do.

I'm also writing up Wikijunior Kings and Queens of England. Again, if you're interested, please come and help.

Jon

title: User:Jguk


text:
Taxation in the United Kingdom

Contents

 * 1) [[Image:25%.svg]]/Introduction/
 * 2) [[Image:25%.svg]]/Income tax/
 * 3) [[Image:25%.svg]]/Capital gains tax/
 * 4) [[Image:25%.svg]]/Corporation tax/
 * 5) [[Image:25%.svg]]/Value Added Tax/
 * 6) [[Image:25%.svg]]/National insurance/
 * 7) [[Image:25%.svg]]/Stamp taxes/
 * 8) [[File:00%.svg]]/Council tax/
 * 9) [[Image:25%.svg]]/Inheritance tax/
 * 10) [[File:00%.svg]]/Business rates/
 * 11) [[File:00%.svg]]/Indirect tax/

Appendices

 * 1) [[File:00%.svg]]/Definitions/
 * 2) [[File:00%.svg]]/Legislation/

title: Taxation in the United Kingdom


text:
Acoustics/Anechoic and Reverberation Rooms

Introduction
Acoustic experiments often require to realise measurements in rooms with special characteristics. Two types of rooms can be distinguished: anechoic rooms and reverberation rooms.

Anechoic room
The principle of this room is to simulate a free field. In a free space, the acoustic waves are propagated from the source to infinity. In a room, the reflections of the sound on the walls produce a wave which is propagated in the opposite direction and comes back to the source. In anechoic rooms, the walls are very absorbent in order to eliminate these reflections. The sound seems to die down rapidly. The materials used on the walls are rockwool, glasswool or foams, which are materials that absorb sound in relatively wide frequency bands. Cavities are dug in the wool so that the large wavelength corresponding to bass frequencies are absorbed too. Ideally the sound pressure level of a punctual sound source decreases about 6 dB per a distance doubling.

Anechoic rooms are used in the following experiments:

Intensimetry: measurement of the acoustic power of a source. Study of the source directivity.

Reverberation room
The walls of a reverberation room mostly consist of concrete and are covered with reflecting paint. Alternative design consist of sandwich panels with metal surface. The sound reflects off the walls many times before dying down. It gives a similar impression of a sound in a cathedral. Ideally all sound energy is absorbed by air. Because of all these reflections, a lot of plane waves with different directions of propagation interfere in each point of the room. Considering all the waves is very complicated so the acoustic field is simplified by the diffuse field hypothesis: the field is homogeneous and isotropic. Then the pressure level is uniform in the room. The truth of this thesis increases with ascending frequency, resulting in a lower limiting frequency for each reverberation room, where the density of standing waves is sufficient.

Several conditions are required for this approximation: The absorption coefficient of the walls must be very low (α<0.2) The room must have geometrical irregularities (non-parallel walls, diffusor objects) to avoid nodes of pressure of the resonance modes.

With this hypothesis, the theory of Sabine can be applied. It deals with the reverberation time which is the time required to the sound level to decrease of 60 dB. T depends on the volume of the room V, the absorption coefficient αi and the area Si of the different materials in the room :

Reverberation rooms are used in the following experiments: measurement of the ability of a material to absorb a sound measurement of the ability of a partition to transmit a sound Intensimetry measurement of sound power


text:
Talk:The Way of the Java/Methods

The section "Composition" needs an explanation of Math.exp This is helping me pass my degree thanks alot for your work people

title: Talk:The Way of the Java/Methods