text:
Video Game Design/Programming/Selecting the Hardware

Selecting the hardware
To develop a game you may need not only qualified personal is special tasks, like graphics designers but you will have also to consider the software for editors (for creating things such as characters, items, scenery) but also the physical hardware to support those tasks, for example graphic tablets may be required for the graphic design, and you will probably need scanners to input hand drawn pictures from artists as well as cameras, cameras could to be used to take pictures of drawn artwork. All these extra costs have to be well considered and depend only on the level of your project.

But hardware considerations are not restricted to the tools you will be using, but most important is the requirement to run your finished product, this will not only affect the target audience but shape the development of the project. The software requirements to implement you game design may require to access large amounts of memory but have a limited amount available to work with at each time the can be also other limitations such weaker CPUs, weaker processor caches or non-default memory alignment requirements.

The easy way out...
No frills, no whistles and no extra costs. If you select a virtual framework, lets say by using Flash as your developing framework you will skip the need to think about and supporting special hardware or setups, you will also have a RAD tool to put your concept into action.

Distribution media
Distribution media is important to determine how much resources can be packed and how they should be packed.

Prototyping
A prototype is meant to be an exploration, a journey to see how ideas will play out once they are embodied into a full working program. It is the testing of a new concept that has not been seen before and because of this it must be most flexible in its implementation so it it easy to improve, since the creation of the prototype will inspires completely new ideas. If the exploration of new concepts is not done during the prototyping phase then what was the point of the prototype at all?

Prototyping is meant to be done quickly and then it needs to change even quicker. To be able to do that it as to be maintainable and use a flexible and well-written code base. But keep in mind that a prototype is only useful if it is good enough so to prove your vision as correct and to be discarded for a real implementation; if you spend so much time on the prototype that you start to begging to question its replacement, then you are on the wrong path or have spent too much effort on what should remain the first tryout of the master plan.


text:
XQuery/Background

XQuery and Functional Programming
XQuery is an example of a functional programming language. Like other functional languages, XQuery variables are immutable, meaning that you can set them once but never change them after that. XQuery functions do not have "side effects" meaning that they do not change data that is not specifically passed to them.

Functional programming has recently gained popularity with the rise of the MapReduce algorithms recently popularized by Google. Google's ability to leverage tens of thousands of CPUs in its data center has shown that functional languages are in many ways superior to procedural languages. But many of the benefits of functional programming go back to mathematical formalisms of the 1930s, including the lambda calculus and the μ-recursive functions.

Although the XQuery 1.0 W3C specification does not allow a function to be passed as an argument to a function, most implementations such as eXist support this, so technically the eXist implementation of XQuery is a true functional language but the W3C standard is not. However, XQuery 1.1 is to allow function items as data while

A history of functional programming is available at Functional Programming. This article has an excellent historical background on functional programming and why functional programs are ideal for a server environment where reliability is critical.

XQuery as a w3c Standard
In 1998 Jonathan Robie and Joe Lapp (then the principal architect of WebMethods) created a new query language designed specifically to query XML files called XQL

In 1998, two query languages, XQL and XML-QL got a lot of interest within the W3C and a working group for XML-based querying languages was formed.

In 1998 the World Wide Web consortium hosted a conference on query languages. This conference gathered XML and query language experts from around the world and from many fields. 66 "Position Papers" were presented. The result was a very large knowledge base of use cases and proposals that began as a basis for a future standardized query language.

The working group selected around 90 use cases and compared the ability of seven advanced query languages to execute them. None of the seven were perfect. Each had some defects. The working group took the best part of each of the seven languages and created the XQuery standard.

The XSLT language reached recommendation status in 1999. But there were many people who felt that XSLT was too difficult to learn, and because of the XML syntax, it was very unfamiliar for many software developers. People with an SQL background had a difficult time understanding how to learn XSLT.

XQuery and SQL
Studies have shown that people familiar with SQL can quickly learn XQuery. Once developers understand the structure of the FLWOR statement, many SQL concepts such as sorting and selecting distinct values are easily learned.

XQuery and XSLT
Many developers once considered XSLT template-style transforms ideal for transforming documents and XQuery ideal for querying more structured XML data such as a collection of book metadata. Recent work with typeswitch-style transforms have shown that XQuery modules and functions can be used to create document-style transforms that rival most XSLT functions. And because many XQuery systems leverage document indexes they can be considerably faster than XSLT transforms that were never designed to use indexed XML structures.

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

title: XQuery/Background


text:
XQuery/Benefits

Benefits of XQuery
The principal benefits of XQuery are:

 * Expressiveness - XQuery can query many different data structures and its recursive nature makes it ideal for querying tree and graph structures
 * Brevity - XQuery statements are shorter than similar SQL or XSLT programs
 * Flexibility - XQuery can query both hierarchical and tabular data
 * Consistency - XQuery has a consistent syntax and can be used with other XML standards such as XML Schema datatypes

XQuery is frequently compared with two other languages, SQL and XSLT, but has a number of advantages over these.

Advantages over SQL
Unlike SQL, XQuery returns not just tables but arbitrary tree structures. This allows XQuery to directly create XHTML structures that can be used in web pages. XQuery is for XML-based object databases, and object databases are much more flexible and powerful than databases which store in purely tabular format.

Unlike XSLT, XQuery can be learned by anyone familiar with SQL. Many of the constructs are very similar such as:

 * Ordering Results: Both XQuery and SQL add an  clause to the query.
 * Selecting Distinct Values: Both XQuery and SQL have easy ways to select distinct values from a result set
 * Restricting Rows: Both XQuery and SQL have a WHERE X=Y clause that can be added to an XQuery

Another big advantage is that XQuery is essentially the native query language of the World Wide Web. One can query actual web pages with XQuery, but not SQL. Even if one uses SQL-based databases to store HTML/XHTML pages or fragments of such pages, one will miss many of the advantages of XQuery's simple tag/attribute search (which is akin to searching for column names within column names).

Advantages over XSLT
Unlike XSLT, XQuery can be quickly learned by anyone familiar with SQL. XSLT has many patterns that are unfamiliar to many procedural software developers. Also, whereas XSLT is good for using as a static means to convert one type of document to another, for example RSS to HTML, XQuery is a much more dynamic querying tool, useful for pulling out sections of data from large documents and/or large number of documents.

The Debate about XQuery vs. XSLT for Document Transformation
There has been a debate of sorts about the merits of the two languages for transforming XML: XSLT and XQuery. A common misconception is that "XQuery is best for querying or selecting XML, and XSLT is best for transforming it." In reality, both methods are capable of transforming XML. Despite XSLT's longer history and larger install base, the "XQuery typeswitch" method of transforming XML provides numerous advantages.

Most people who need to transform XML hear that they need to learn a language called XSLT. XSLT, whose first version was published by the W3C in 1999, was a huge innovation for its time and, indeed, remains dominant. It was one of the very first languages dedicated to transforming XML documents, and it was the first domain-specific language (DSL) to use advanced theories from the world of functional programming to create very reliable, side-effect free transformations. Many XML developers still feel strong indebted to this groundbreaking language, since it helped them see a new model of software development: one focused around the transformation of models and empowering them to fuse both the requirements and documentation of a transformation routing into a single, modular program.

On the other hand, learning XSLT requires overcoming a very substantial learning curve. XSLT's difficulty is due, in part, to one of the key design decisions by its architects: to express the transformation rules using XML itself, rather than creating a brand new syntax and grammar for storing the transformation rules. XSLT's unique approach to transformation rules also contributes to the steepness of the learning curve. The learning curve can be overcome, but it is fair to say that this learning curve has created an opening for an alternative approach.

XQuery has filled this demand for an alternative among a growing community of users: they find XQuery has a lower learning curve, it meets their needs for transforming XML, and, together with XQuery's other advantages, it has become a compelling "all-in-one" language. Like XSLT, XQuery was created by the W3C to handle XML. But instead of expressing the language in XML syntax, the architects of XQuery chose a new syntax that would be more familiar to users of server-side scripting languages such as PHP, Perl, or Python. XQuery was designed to be similar to users of relational database query languages such as SQL, while still remaining true to functional programming practices. Despite its relative youth (XQuery 1.0 was only released in 2007 when XSLT had already reached its version 2.0), XQuery was born remarkably mature. XML servers like eXist-db and were already using XQuery as their language for querying XML and performing web server operations (obviating the need for learning PHP, Perl, or Python).

So, in the face of the XSLT community's contention that "XSLT is best for transforming documents and XQuery is best for querying databases", this community of users was surprised to find that XQuery has entirely replaced their need for XSLT. They have come to argue unabashedly that they prefer XQuery for this purpose.

How does XQuery accomplish the task of transforming XML? The primary technique in XQuery for transforming XML is a little-known expression added by the authors of XQuery, called "typeswitch." Although it is quite simple, typeswitch enables XQuery to perform nearly the full set of transformations that XSLT does. A typeswitch expression quickly looks at a node's type, and depending on the node's type, performs the operation you specify for that type of node. What this means is that each distinct element of a document can have its own rule, and these rules can be stored in modular XQuery functions. This humble addition to the XQuery language allows developers to transform documents with complex content and unpredictable order - something commonly believed to be best reserved for the domain of XSLT. Despite the differences in syntax and approach to transformation, a growing community has actually come to see the XQuery typeswitch expression as a valid, even superior, way to store their document transformation logic.

By structuring a set of XQuery functions around the typeswitch expression, you can achieve the same result as XSLT-style transforms while retaining the benefits of XQuery: ease of learning and integration with native XML databases. Even more important for those users of native XML databases, the availability of typeswitch means that they only need to learn a single language for their database queries, web server operations, and document transformations. These XQuery typeswitch routines have proven easy to build, test, and maintain - some believe easier than XSLT. XQuery typeswitch has given these users a high degree of agility, allowing them to master XQuery fully rather than splitting their time and attention between XQuery and XSLT.

That said, there is still a large body of legacy XSLT transforms that work well, and there are XSLT developers who see little benefit from transitioning to a typeswitch-style XQuery. Both are valid approaches to document transformation. A natural tension has arisen between the proponents of XQuery typeswitch and XSLT, each promoting what they are most comfortable with and believe to be superior. In practice you might be best served by trying both techniques and determining what style is right for you and your organization. Without presuming a background or interest in XSLT, this article and its companion article help you to understand the key patterns for using XQuery typeswitch for your XML transformation needs.

XQuery/Introduction

title: XQuery/Benefits


text:
User talk:Sisco~enwikibooks

Welcome message
Hello, and welcome to Wikibooks!

Here are some tips to help you get started:
 * To learn the wiki-markup-language syntax, see Help:Editing.
 * Make sure to sign your posts and comments with four tildes, like this: ~~~~
 * There is a box at the top of the edit window (if javascript is enabled on your browser) that will insert it too (looks like part of a signature). This will let others know who left it, and make it easy to reply back to you.
 * Remember to conduct any editing experiments in the sandbox.
 * You can tell the community something about yourself in your userpage.
 * You can get to this page by clicking the tab at the top of the page labeled with your registered username.
 * Wikibooks is a collection of open-source textbooks. (What is Wikibooks).
 * If you are a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI (requests for importation) to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using Wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Reading Room with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Help us by participating in policy and guideline creation.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Reading Room, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be a good idea to add that page to your "watchlist" so that you can see when any new information is posted there. You can do that by clicking the tab labeled "watch" at the top of the page.

Good luck! --Panic (talk) 02:59, 31 January 2008 (UTC)

Added some...
Didn't know were you were headed in with the book but just created a rudimentary structure and started some topics, I used a very sarcastic tone on the text as it will be probably easier to read, fell free to edit away the text, it was a cool 15minutes. --Panic (talk) 07:18, 31 January 2008 (UTC)

Your account will be renamed
Hello,

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

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

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

Sorry for the inconvenience.

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

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

title: User talk:Sisco~enwikibooks


text:
XQuery/Installing and Testing

Installing the eXist native XML database
Steps for Installing eXist on Microsoft Windows Systems

The full up-to-date quick start installation instructions are available on the eXist web site. This set of instructions is slightly simplified for the needs of the cookbook.
 * 1) Download the JAR file (Java Archive File) from http://www.exist-db.org
 * 2) To install it, you will need a JDK (Java Developer Kit) installed on your system, preferably version 1.5 or higher
 * 3) To test this type "java -version" at the command prompt.
 * 4) If you do not have a JDK installed, install the (not bundled) "Java SE Development Kit (JDK)" JDK 6 Update XX from http://www.oracle.com/technetwork/articles/javase/index-jsp-138363.html
 * 5) Double Click the jar file. This will automatically install the application, otherwise launch   to get the installation window. Warning Do not use the default installation path that has "Program Files" and the default install directory.  This will not work because of the spaces in the path name.  You MUST pick a path that does not have spaces, C:\eXist for example. Complete the installation by selecting the defaults.  It is strongly advised to set the admin password
 * 6) On Windows start up the eXist database by selecting it from the Start menu, or double clicking C:\eXist\bin\startup.bat. This will start up a DOS console.  Give it a few seconds to start up the server.
 * 7) Bring up your web browser to the address: http://localhost:8080/exist  It shows a local copy of the eXist site.
 * 8) Click Admin in the Administration menus (on the left). This section allows you to add users and passwords
 * 9) You may choose to "Import Example Data" if you like
 * 10) You can now enter simple queries by going to the page http://localhost:8080/exist/sandbox/

Adding a WebDAV Client

 * 1) If you are using Windows, you can also add a WebDAV folder that will allow you to drag-and-drop many XML and XQuery files from your windows desktop to and from an eXist collection.

WebDAV Windows

Note that the Windows interface is somewhat buggy. You can not copy files from one eXist system directly to another eXist system. You must first copy to a windows file system and then copy it to the second eXist system.

XQuery/Installation

title: XQuery/Installing and Testing


text:
XQuery/Naming Conventions

Guidelines for wikibook authors
Our goal is to allow many people to contribute examples but allow our readers a consistent user experience. In that light we would like all of our authors to use some of the following standards.

This book has a strong focus on learning some aspect of XQuery via examples. Our hope is to have a large collection of small sample XQuery programs. Each program should have the minimal code to demonstrate some aspect of XQuery. Although most of our users use eXist, we hope the examples can be used with MarkLogic, BaseX and other XQuery systems.

Make sure you use the source tags to surround your code. If it is XML code use the lang="xml" attribute.

If it is XQuery code use the lang="xquery" attribute.

Try to keep the examples as simple as you can to demonstrate the core concepts of your examples.

Sample XQuery File
Each XQuery file should begin with the word xquery and the version number.

Complex XQueries should have comments using the XQuery comments

File Name Conventions
Please use three space characters to indent your XQuery and XML examples. Do not use tabs. We use three characters because we use PDF output of these books and the printed pages have limited width.

Please do not exceed 70 characters per line. This helps formatting for printed versions of this Wikibook.

For XQuery scripts are stored inside the database please use the .xq suffix.

If you are running on a system that MUST be compatible with the three-letter Microsoft DOS file name extension please use the .xql file suffix.

For XQuery modules please use the suffix .xqm.

For each module that has unit tests use the suffix -test.xq.

title: XQuery/Naming Conventions


text:
XQuery/Guest Registry

Dan McCreary
I am using this book for teaching XQuery to my students. Most of my work is in the government and financial sectors. I am using XQuery with REST and XForms.

Chris Wallace
I am using this book mainly as a repository of example programs since I use XQuery on nearly all the websites I make. Not much opportunity to teach XQuery these days. Currently working on moving the executable examples from my old university server to my own and bringing code up to date.

Jim Fuller
I am using this book for teaching some aspects of XQuery to people I mentor professionally and also plan to use for a University course in Prague this September.

Rajamani Marimuthu
I am using this book for creating samples and some real time applications for the users .. and also for teaching to my colleagues and learners.

Dominique Rabeuf
I am using this book for creating XForms/XQuery samples and applications

Chris Cargile
I am using this book for creating XQuery samples for research purposes

Joe Wicentowski
I am using this book to capture community innovations in XQuery and develop best practices. I am using XQuery with REST and XForms.

Esteban Arango Medina
I am using this book to learn about XQuery, I need it for a project where I'm working in my university (EAFIT University).

Chris Misztur
I am using this book to learn eXist-db practices and to advocate XML platforms.

Rajesh Pandian M
I am using this book for learning XQuery,Xpath as a part of my course work. The examples given are very informative.

Carl Burnett
I am using this book to teach XML technologies in my XML Introduction and Advanced courses at the Montgomery College, Information Technology Institute in Maryland.

Luca Guariento
I am using this book for deepening my knowledge of XQuery, which I use in many digital humanities projects.

Raymond Lee
I am using this book as a reference for finding my way through using XQuery to develop and maintain interfaces between the web and online machine learning

Russell Watson
I am using this book to learn XQuery in order to develop XQuery-based analyses of FileMaker databases. Wish me luck!

title: XQuery/Guest Registry


text:
User:BlackPearl14

Wikipedia
Huge editor over there! Check out my page right here.

title: User:BlackPearl14


text:
User talk:BlackPearl14

Hello, mates!

title: User talk:BlackPearl14


text:
User:Global~enwikibooks

myself global interested in books that give me knowledge which other people dont possses.selfish yet smart.

title: User:Global~enwikibooks


text:
User talk:Ddavidson0006

Welcome!
Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--AdRiley (talk) 07:27, 31 January 2008 (UTC)

title: User talk:Ddavidson0006


text:
User talk:Wprlh~enwikibooks

Welcome!
Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--AdRiley (talk) 07:31, 31 January 2008 (UTC)

Your account will be renamed
Hello,

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

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

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

Sorry for the inconvenience.

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

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

title: User talk:Wprlh~enwikibooks


text: User talk:85.187.208.70

title: User talk:85.187.208.70


text:
Circuit Idea/Comparison between Oscillators

<<< contents - LC tank - page stage >>>

Comparing the Ideas behind Relaxation, LC and RC Oscillators

A relaxation oscillator
The basic idea. The simpler and more intuitive relaxation oscillator consists of (Fig. 1) a flow (current) source, an accumulator of potential energy (a capacitor), a switch SW and a load (a resistor). Such an arrangement operates in two stages as follows: in the first stage, we connect the current source to the accumulator and begin charging it; in the second stage, we connect the accumulator to the load (turn on the switch SW) and discharge it. Let's repeat it in other words: in a period of a relaxation oscillation, we first draw a kind of energy (usually, potential) from the flow source to fill the accumulator, then "suck dry" the energy from the accumulator and just "throw out" it to the environment. Thus, in the first stage of every period the source has to restore the energy in the accumulator.

Features. Note that the relaxation arrangement needs only one accumulator. It lies on the way of energy and serves as a buffer that interrupts temporarily the flow (only, the average flow remains constant). In this way, it intermits, tears to "pieces" the energy flow. It is interesting fact that a continuous current enters the accumulator while an intermittent current leaves it; so, we might say that a relaxation oscillator "discretisizes", "portens", "doses" the unceasing input flow of energy. At the same time, the accumulator's contents increases and decreases periodically. The shape of the curve is not sinusoidal because at the points of switching (at the peaks) the "flow-creating" quantity has a maximum magnitude. Note also that increase and decrease can have different durations. Examples of this possibility are a photoflash (slow charging, fast discharging), a toilet tank, a husband that fills slowly and continuously a family money deposit while his wife empties rapidly and regularly it:)

An LC oscillator
The basic idea. Contrary, in order to create an ideal LC oscillation (assume an LC tank without losses), we charge the accumulator only once in the beginning (by turning on the switch SW on the bottom of the figure). Then, we "suck dry" the energy from the accumulator but do not "throw it away"; instead, we convert it into an opposite kind (kinetic to potential or potential to kinetic) and store the converted energy in another accumulator. We move, transfer, convey the energy from the one accumulator to the other. After, we use this energy to restore the energy of the first accumulator instead to "suck" energy from the source (we move back the energy).

Implementation. For this purpose, the LC arrangement consists of two heterogeneous (regarding to the two kinds of energy) accumulating elements (Fig. 2). Each of them can either provide energy (when it serves as a source) or store the energy (when it serves as a load). When act as a source, it is a weakening, depleting, exhausting source because the other (accumulating) element "sucks out" the source's energy. The energy moves from the source to the accumulator and the source's output quantity decreases.

Similarities

 * 1) Both the oscillating circuits contain at least one accumulating element that acts either as a source or as an integrator.

Differences

 * 1) A relaxation oscillator consists of only one accumulating element while an LC oscillator consists of two accumulating elements.
 * 2) The relaxation accumulator is flow or pressure like; the LC accumulators are heterogeneous (the one is flow-like and the other is pressure-like).
 * 3) A relaxation oscillator stores only one kind of energy (usually potential) in the accumulator while an LC oscillator stores two opposite kinds of energy (kinetic and potential) in the two accumulators.
 * 4) In a relaxation oscillator we "throw away" the energy while in an LC oscillator we treasure it temporarily in an additional accumulator with the purpose of future usage. That's why, LC oscillators are more economical than relaxation ones.
 * 5) Resonance phenomenon does not exist in a relaxation circuit; it can be observed only in the LC tank.
 * 6) In a relaxation oscillator the energy moves only in one direction (source -> accumulator -> load) while in an LC oscillator the energy changes periodically its direction (it circulates between the two elements).
 * 7) The shape of a relaxation oscillation is peaked, angular while the shape of an LC oscillation is rounded (sinusoidal). The reason of that is that at the peaks the source of a relaxation oscillator changes its output quantity with the maximum magnitude while the "source" of an LC oscillator (charged accumulator) does not change its output quantity.
 * 8) The shape of the relaxation oscillation can be asymmetrical (the increase and the decrease can have different durations) while the shape of the LC oscillation is precisely symmetrical.


text:
Talk:Circuit Idea/Comparison between Oscillators

(I would like to start the discussion about relaxation oscillations by moving here the text below from the page about LC tank) Circuit-fantasist (talk) 18:31, 24 January 2008 (UTC)

What the secret of relaxation oscillations is
Maybe, we have first to say here what the truth about relaxation oscillation is and then to discuss how to present this wisdom to visitors (these are different things). Well, let's begin with the first.

The initial point: A steady quantity
At the starting point we need a steady quantity. Where to get it from? As usual in this world, we need energy to create a quantity. We can get this energy from some power source. So, the first thing what we need (in this world) is a power source.

The problem: How to make it oscillate?
Then, we ask yourself, "How do we make the steady quantity oscillate?" But what does mean "to oscillate"? Simply speaking, to oscillate means just to make the quantity increase and decrease consecutively and regularly. How do we do this magic?

Preparing a steady quantity to be changed
It seems it's too difficult to make the very power source oscillate (power sources keep up constant their output quantities). Then, what do we do? We can act like in many situations of routine: instead to change the whole source energy we get some amount of energy from the source and store it in some "place" with the purpose to change it. As there are two kinds of energy - kinetic and potential, we can store energy in two kinds of energy accumulators (integrators). Let's do it; we have got the initial steady quantity. Examples: if we have stored a kinetic energy in an inductor, we obtain a constant current; if we have stored a potential energy in a capacitor, we obtain a constant voltage.

Changing the accumulated quantity
Now, we can begin doing the "veritable work" - to increase and decrase the steady quantity, in order to make it oscillate. How can we make it increase? Of course, by adding continuosly energy to the accumulator. And how can we make it decrease? Contrary, by subtracting continuosly energy from the accumulator. In both the cases we move, transport, transfer energy from one place to other - from the source to the accumulator and v.v.

Relaxation oscillations
(...We might explain what an LC oscillation is, if we say what it is not. Here, we might say that an LC oscillation is not a relaxation one. Only, we would explain what a "relaxation oscillation" is. This phenomenon is no less vague and mystic than the LC phenomenon (I have never met good resources about it). Now, we have opportunity to reveal the secret behind relaxation phenomenon by comparing it with LC one. After that, we may move these thoughts to the future story about relaxation oscillations...)

The basic idea. According to the powerful idea above, we might first build the simpler and more intuitive relaxation oscillator by using three elements: a flow (current) source, an accumulator of potential energy (a capacitor) and a load (a resistor). Such an arrangement operates in two stages as follows: in the first stage, we connect the current source to the accumulator and begin charging it; in the second stage, we connect the accumulator to the load (turn on the switch SW) and discharge it. Let's repeat it in other words: in a period of a relaxation oscillation, we first draw a kind of energy (usually, potential) from the flow source to fill the accumulator, then "suck dry" the energy from the accumulator and just "throw out" it to the environment. Thus, in the first stage of every period the source has to restore the energy in the accumulator.

Features. Note that the relaxation arrangement needs only one accumulator. It lies on the way of energy and serves as a buffer that interrupts temporarily the flow (only, the average flow remains constant). In this way, it intermits, tears to "pieces" the energy flow. It is interesting fact that a continuous current enters the accumulator while an intermittent current leaves it; so, we might say that a relaxation oscillator "discretisizes", "portens", "doses" the unceasing input flow of energy. At the same time, the accumulator's contents increases and decreases periodically. The shape of the curve is not sinusoidal because at the points of switching (at the peaks) the "flow-creating" quantity has a maximum magnitude. Note also that increase and decrease can have different durations. Examples of this possibility (see the analogies below) are a photoflash (slow charging, fast discharging), a toilet tank, a husband that fills slowly and continuously a family money deposit while his wife empties rapidly and regularly it:)

What does "relaxation oscillation" mean? I have been asking myself many times what the word "relaxation" means in this context. What does "relax" here? Maybe, the capacitor? If yes, when does the capacitor relax? Maybe, when we charge it (in this case, "relaxation" would mean restoring, retrieving, recreating the content of the accumulating element). Or maybe, the capacitor relaxes (returns to its initial "zero energy" state of equilibrium) when we discharge it...

Relaxation analogies. We can see many manifestations of this phenomenon in nature, routine, engineering and finally, in electronics. For example, I have a remembrance from my childhood how sometimes faulty toilet tanks began working intermittently (filling -> emptying -> filling -> emptying... up to infinity:) Similarly, imagine you were foolish enough to make a common money deposit with your wife:) Then, you begin working hard to feed up continuously the deposit. As a result, the amount of money increases continuously through time. Only, at some point your wife decides that's enough and draw out all the money accumulated. You begin working again... and she empties the deposit again... and this repeats again... and again... and again...:) Circuit-fantasist (talk) 20:06, 18 January 2008 (UTC)

LC oscillations

The basic idea. Contrary, in order to create an ideal LC oscillation (assume an LC tank without losses), we charge the accumulator only once in the beginning (by turning on the switch SW on the bottom of the figure). Then, we "suck dry" the energy from the accumulator but do not "throw it away"; instead, we convert it into an opposite kind (kinetic to potential or potential to kinetic) and store the converted energy in another accumulator. We move, transfer, convey the energy from the one accumulator to the other. After, we use this energy to restore the energy of the first accumulator instead to "suck" energy from the source (we move back the energy). By the way, maybe is more correctly to say "energy moves" rather than "we move the energy". But why the energy moves by itself? What makes it move? What makes it move to and fro without end? Don't you think there is something mystic in this endless "ping-pong" movement?

Implementation. For this purpose, the LC arrangement consists of two heterogenious (regarding to the two kinds of energy) accumulating elements. Each of them can either provide energy (when it serves as a source) or store the energy (when it serves as a load). When act as a source, it is a weakening, depleting, exhausting source because the other (accumulating) element "sucks out" the source's energy. The energy moves from the source to the accumulator and the source's output quantity decreases.

Similarities

 * 1) Both the oscillating circuits contain at least one accumulating element that acts either as a source or as an integrator.

Differences

 * 1) A relaxation oscillator consists of only one accumulating element while an LC oscillator consists of two accumulating elements.
 * 2) The relaxation accumulator is flow or pressure like; the LC accumulators are heterogenious (the one is flow-like and the other is pressure-like).
 * 3) An relaxation oscillator stores only one kind of energy (usually potential) in the accumulator while an LC oscillator stores two opposite kinds of energy (kinetic and potential) in the two accumulators.
 * 4) In an relaxation oscillator we "throw away" the energy while in an LC oscillator we treasure it temporarily in an additional accumulator with the purpose of future usage. That's why, LC oscillators are more economical than relaxation ones.
 * 5) Resonance phenomenon does not exist in relaxation circuit; it can be observed only in LC tank.
 * 6) In an relaxation oscillator the energy moves only in one direction (source -> accumulator -> load) while in an LC oscillator the energy changes periodically its direction (it circulates between the two elements).
 * 7) The shape of a relaxation oscillation is peaked, angular while the shape of an LC oscillation is rounded (sinusoidal). The reason of that is that at the peaks the source of a relaxation oscillator changes its output quantity with the maximum magnitude while the "source" of an LC oscillator (charged accumulator) does not change its output quantity.
 * 8) The shape of the relaxation oscillation can be asymmetrical (the increase and the decrease can have different durations) while the shape of the LC oscillation is precisely symmetrical.

Circuit-fantasist (talk) 18:31, 24 January 2008 (UTC)


text:
User talk:203.84.170.126

 Majorly  (talk) 12:17, 31 January 2008 (UTC)

title: User talk:203.84.170.126


text:
Cookbook:Pasta and Bean Soup

| Cuisine of Italy

Pasta and bean soup (pasta fagioli) is a true classical Italian peasant dish, again overcomplicated all too often by highfallutin' chefs. But made properly, with simple ingredients, and maybe left to infuse in the pot for 24 hours, you have one of the most delicious and hearty soups imaginable.

Ingredients

 * 1 large dash of premium olive oil
 * 1 glass of dry white wine
 * 5 cloves of garlic, peeled and chopped
 * 1 onion, peeled and chopped
 * 4 very red tomatoes, chopped finely or one tin (235 g) chopped tomatoes
 * 3 large squeezes of Italian tomato purée
 * 2 cans (235 g) borlotti beans
 * 1 handful of fresh, chopped spinach (optional)
 * 1 sprig of rosemary about 3 inches long
 * 1 large handful of chopped parsley
 * 1 ½ litres water
 * 2 chicken stock cubes
 * 1 pinch of salt
 * 1 large pinch of freshly ground pepper
 * 1 large pinch of cayenne pepper
 * 5 handfuls of pasta shells or penne
 * 100 ml single fresh cream (optional)

Procedure

 * 1) Heat the olive oil in the pan, add the chopped garlic and onions, and fry gently for about 3 minutes until translucent but not coloured. Add the cayenne pepper and mix well in the pan.
 * 2) Add the glass of white wine and allow to evaporate slightly.
 * 3) Add the water, the stock cubes, the tomato paste, pepper, salt, pasta, and the 2 tins of beans, and allow to simmer gently for as long as the pasta needs to cook (see packet) stirring occasionally.
 * 4) Once the pasta is al dente, stop the cooking process, add the chopped parsley and the cream, and stir in well.
 * 5) Add the rosemary sprig, and allow the whole thing to infuse for about 2 hours.
 * 6) Buon appetito Wikibookians!

Notes, tips, and variations

 * Add a small piece of Parmesan rind to the pot once you have added the water. Take it out once you are ready to serve the soup. This adds a parmesany taste to the soup!!
 * The soup should be quite thick, but if it is not thick enough, take some of the soup out of the pot (preferably excluding any pasta) and blend it. Return the blended mixture to the soup to thicken.
 * This soup can be adjusted by the addition of extra beans, extra pasta, to suit your individual taste. As a general rule the pasta should form about 40% of the soup.

title: Cookbook:Pasta and Bean Soup


text:
Talk:Dungeons & Dragons

I don't understand something. Isn't it illegal to write information written in the D&D book, published by wizards of the coast ? answer, cause I will write this article if it's possible. thanks.
 * It would be illegal to copy straight from the guide. The idea is that the stuff written here is free, and is written by contributors. You can write it if you like, as long as it is your own work, and not taken from the book.  Majorly  (talk) 12:51, 31 January 2008 (UTC)

Actually Wizards of the Coast makes available a document called the SRD, which I think stands for Standard Rules something. Anyway the point is the SRD is offered up on the Open Gaming License, which (i'm not a lawyer) Means it can be copied and reproduced word for word here. It is not however a full guide to Dungeons and Dragons but instead offers a basic trimmed down version of the game, sans flavor content. --Evilestmark (talk) 05:56, 19 February 2010 (UTC)

title: Talk:Dungeons & Dragons


text:
User talk:Nataraj

Welcome!
Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--AdRiley (talk) 13:42, 31 January 2008 (UTC)

my Screenshot is Unknown License?!
Hello Shaplov,

When you upload the image you need to select the appropriate license. Where have these images come from? If you have created them yourself then you will be fine to license them under GFDL. However if these are screenshots of someone elses work then you may not have permission to use these images in Wikibooks. Looking at what you have uploaded it wouldn't take long to create free versions of these images. Let me know if you need anymore help. --AdRiley (talk) 07:40, 6 February 2008 (UTC)
 * Yeah... I need help. First of all, when I uploaded images, the upload page said:

 * "Permission: Supply a short quote of the permission the copyright owner of the file gave you. In case of a general permission (e. g. US Public Domain or a website releasing its content under a free license) supply a short link to that legal disclaimer or an according hint. Omit if you are the author."
 * So, as far as I created this images, I ommited the permision assuming that it will be licenced on default licence used in this site. May be you should change text at download page.

 * The second thing is that I created a screenshot of my own site. I do not know how to do these screenshots so they won't be a screenshot of someone else's work. I think that MediaWiki is licenced on GPL and I can use anything I create using it (including screenshots) for free...
 * --Shaplov (talk) 11:27, 21 February 2008 (UTC)

Screenshots
Those are. I restored them, fixed the licensing and reverted my removal from the page. – Mike.lifeguard  | talk 14:57, 27 April 2008 (UTC)

title: User talk:Nataraj


text:
User talk:125.103.80.139

Join Us!
--AdRiley (talk) 13:42, 31 January 2008 (UTC)

title: User talk:125.103.80.139


text: User talk:202.133.73.39

title: User talk:202.133.73.39


text:
User talk:76.74.65.2

Blocked
You cannot edit for 3 months due to disruptive editing. You are welcome to contribute constructively when editing privileges are restored. You may appeal this action with a reasonable argument by adding the text below.

title: User talk:76.74.65.2


text: User talk:204.9.123.251

title: User talk:204.9.123.251


text: User talk:207.190.81.34

title: User talk:207.190.81.34


text:
User talk:Kekett~enwikibooks

Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.

Thank you for starting the book Physiology & pharmacology - 3 years of study. Rather than starting new books from scratch, would you mind if we merged that book into the Human Physiology and Medical Physiology wikibooks? --DavidCary (talk) 17:33, 31 January 2008 (UTC)

Your account will be renamed
Hello,

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

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

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

Sorry for the inconvenience.

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

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

title: User talk:Kekett~enwikibooks


text: User talk:206.158.2.80

title: User talk:206.158.2.80


text:
User talk:131.123.181.99

{{mbox|type=serious|msg=Please help improve Wikibooks. Recent edits you made have not been considered constructive by your fellow contributors. Please use the sandbox in the future if you wish to test something out. For a description of the type of content that we do allow, see WB:WIW. If you have questions about this, or need help, ask at the Reading Room Assistance page. Thanks.Mattb112885 (talk to me) 18:42, 31 January 2008 (UTC)

title: User talk:131.123.181.99


text:
User:Kasia1986/my bywords

My favourite bywords:

Polish
Kupuj drogie rzeczy, bo są lepsze od tanich

Klawiatura mój przyjaciel

''Mydła z Dou...... najgorsze''

Sing your songs, rock the nations, right all wrongs

Near, far, wherever you are

English
You buy expensive commodits, because they are better than chip commodits.

Keybord my friend.

''Soaps from Dou.... is worst.''

Śpiewaj piosenki, spraw, aby kolysały sie narody, na bok całe zło.

Blisko daleko, gdziekolwiek jesteś

title: User:Kasia1986/my bywords


text:
User:Sethwoodworth

I am an intern at OLPC and I am here to work on cleanup and re-formatting for the XO. Please leave me messages on my OLPC wiki talk page.

title: User:Sethwoodworth


text:
User talk:Fizafj

i want some essay in english
i want some essay in english

title: User talk:Fizafj


text:
Photography Equipment/What should I get?

=It depends.=

If you're seriously interested in photography and just starting out, you are generally best served with a DSLR.

Other classes of camera are also worth considering, and may suit your desires better.

In more detail:

 * Compact Digitals: These are for casual photographers: "point & shoot"
 * If you don't want to dedicate much time or money, want a camera that fits in a pocket or purse, and just want to easily take photos to view on computers or small prints, compact digitals are ideal, and the choice of 100 million people per year. Conversely, they are generally of lower quality than more advanced cameras, and their automatic operation takes control of the image away from the photographer.

 * DSLRs: These are for serious photographers.
 * DSLRs are suitable for almost all purposes, can provide excellent quality (properly used), and are reasonably portable and affordable. Systems start from below $500 and they can be easily carried around. Over 5 million bodies are sold per year.

 * Medium Format or Large Format, (film): top quality, bulky and slow, film workflow
 * Medium Format, and especially Large Format cameras are capable of superb image quality. They have some severe limitations though, notably bulk and speed: the largest systems require a car or fit person to carry. Further, only the most expensive top-of-the line models have digital sensors. Most large cameras still use film, and hence the film process, which is both more technically demanding of the photographer and more expensive in production, due to the cost of film and processing.. If you are interested in photographing subjects suitable for such cameras, and don't mind or would enjoy working with film, you should definitely consider such a camera, though perhaps not as your first system.

Sensor size

The key reason that compact digitals are disdained by serious photographers is that the sensors are small. All else equal, a bigger sensor is better – the typical compact digital sensor size is 25 mm2, while the smallest DSLR sensors are 9 times bigger, more typically 13–15 times bigger, with the biggest DSLR sensors being over 34 times bigger. This results in a major difference in quality, but an increase in cost and size – bigger sensors are harder to make, and require bigger (and heavier) lenses.

The larger sensors in DSLRs provide very significant advantages in low-light sensitivity, dynamic range, and image noise.

With a few exceptions (discussed below), until recently large sensors were found only in DSLR cameras. Today, the professional market is diverging towards professional mirrorless cameras, which offer reduced bulk and weight at the price of an optical viewfinder. As with other features, whether this is a good bargain depends on individual preference.

Compact digitals
Compact digitals vary greatly in appearance, interface, and features, and substantially in price, but rather little in image quality. Specific models are hard to recommend because of the rapid replacement cycle in this category.

Biggest issues (beyond price) are generally portability (does it fit where you want to carry it?) and usability: does the interface work for you?

Auxiliary camera. Compact cameras are widely used and recommended as auxiliary cameras – a camera is no good if it's at home – and thus many photographers will carry around a pocket or purse-sized camera when not on a specifically photographic expedition.

Ignore pixel count. At these sensor sizes, higher pixels yield higher noise which swamp the higher resolution and instead yield worse image quality, not better.

 * The Best Digital Cameras, by Philip Greenspun

Recently a few compact cameras with large sensors have been released – these allow a camera that can fit in a pocket but can take DSLR-quality images, though compared to DSLRs they generally lack features and make other trade-offs. These include the Sigma DP1 and Sigma DP2, which featured a fixed lens, and an announced camera by Olympus in the Micro Fourth Thirds system, which features interchangeable lenses and a retro design.

These have caused some measure of excitement, as they allow high quality images in a camera that can easily be carried around, and thus are suited as an auxiliary camera for when one does not wish to carry around a DSLR.

Bridge cameras
Bridge cameras—cameras between compact digitals and DSLRs—form an amorphous category.

Usual meaning
They generally mean "a small sensor with a big lens" – thus a style similar to a DSLR, but with a small sensor and hence relatively poor image quality. By comparison with compact digitals, they have bigger and faster lenses, hence can take photographs in lower light and of moving objects, while by comparison with DSLRs the lenses are much easier to make, and hence are generally super-zoom.

These fill a niche which is increasingly small as the price of DSLRs has come down, and one is almost always better served by an entry level DSLR such as the Canon Rebel XTi/XSi or Nikon D40. Currently in the US entry DSLRs (with kit lens) retail for $375 (Nikon D40) to $600 (Canon Digital Rebel XSi), while bridge cameras are in the $250 to $400 range.

If quality is a concern, get an entry-level DSLR or large sensor non-DSLR (see below); if budget is a concern, get a compact digital and play to its strengths.

Large sensor non-DSLR
The "large sensor non-DSLR" class is an emerging class, consisting of cameras with large sensor (like entry-level DSLRs), but a smaller format. Several of these are in the Micro Four Thirds System, by Panasonic and Olympus, which features a Four Thirds size sensor and interchangeable lenses. There are currently two types:
 * High-quality compact
 * These are pocket-size (compact) cameras with a large sensor
 * Sigma DP1 & Sigma DP2 are available, and have a fixed (non-interchangeable) lens with a fixed focal length.
 * Olympus has also announced a camera in this class with interchangeable lenses and a retro design.
 * DSLR-style without viewfinder
 * These are similar in design and size to bridge cameras, but with large sensors: smaller bodies than DSLRs, and an electronic viewfinder (EVF)
 * Panasonic Lumix DMC-G1 & Panasonic Lumix DMC-GH1

High-quality compact cameras have generated some measure of excitement, as they finally provide a camera that takes quality photographs but fits in the pocket. These are limited in many ways compared to DSLRs (the Sigma DP1 & DP2 have fixed lenses with fixed focal length), but can function within their limits, and as auxiliary cameras.

Large sensor non-DSLRs fill a similar role to entry-level DSLRs, and are worth considering as alternatives – the lack of a pentaprism and mirror makes them significantly smaller and lighter, at the cost of not having an optical viewfinder. Further, there are very few cameras in this class.

DSLRs
As discussed at DSLRs, you are first buying a system, not a camera or body. Unless you find an other brand particularly compelling – and there are reasons to do so – you should get a Canon or Nikon body and some lenses.

 * Building a DSLR system, by Philip Greenspun

System
See Canon and Nikon for comparison between the systems; they are both excellent and high in quality. Try them both out to see if either particularly delights you, and consider how you expect to use your camera, and whether either brand has particular strengths or weaknesses. If you have trouble deciding, price up what you expect to buy on either system and choose one if it's substantially cheaper than the other. Otherwise, flip a coin: they're both good.

Body
Which body is mostly determined by budget: the more you spend, the higher quality and more features. Some issues:
 * weight: The largest DSLRs (like the 1Ds Mark III) are very heavy and bulky, which may bother you.
 * full-frame: Several top-end DSLRs (currently Canon 1Ds, 5D, and Nikon D3, D3X, D770 and Sony α 900) are full-frame. This is a substantially larger sensor and consequently yields much higher quality pictures; for some this is a sine qua non. However, this is more demanding on the lenses.
 * high-speed: If you wish to do professional sports photography, the Canon 1D and the Nikon D3 have much higher speeds than the others.

Lenses
In general, one begins with a standard lens, and subsequently buys lenses as necessary for particular subjects. See lenses for details.

As a standard lens, most commonly people use the zoom lens that is included with the DSLR body (called the kit lens). Indeed, many people use no other lenses, and thus reap relatively little of the flexibility benefits that a DSLR affords. Others decry this practice and suggest instead that one use a (prime) normal lens.

Kit lenses are not the highest quality zoom lenses, having low Image Quality and being slow (hence needed lots of light and not being capable of Depth of Field effects); they may be a good value though.

For a prime normal lens on a small sensor DSLR, the appropriate focal length is 50mm divided by the crop factor. For APS-C Canons (EF-S: Rebel, 20D/30D/40D), this is 1.6x, so a normal lens is 31.25mm, or about 30mm. For APS-C Nikons (DX), this is 1.5x, so a normal lens is 33 1/3mm.

Some common recommendations follow.
 * Canon Lenses Overview by Bob Atkins, especially for APS-C (Rebel, 20D/30D/40D)
 * General Purpose Canon Lenses (from The-Digital-Picture)

Sample professional collections:
 * Canon lenses
 * Nikon lenses

Canon
Photography Equipment/Lenses/Canon standard

Standard Zoom

 * kit lenses: Canon EF-S 18-55mm: considered very soft
 * Canon EF-S 17-55mm ($1,300) excellent general-purpose lens

Standard Prime

 * Sigma 30mm f/1.4 for Canon ($400)

Nikon
Photography Equipment/Lenses/Nikon standard

Standard Zoom

 * Kit
 * Nikkor 18-55mm (various versions)
 * Nikon 18-70mm f/3.5-4.5
 * Nikkor 28-105mm f/3.5-4.5, ~$325
 * Comparison of popular Nikon zoom lenses
 * Nikkor 28-115mm

Standard Prime

 * Sigma 30mm f/1.4 for Nikon ($400)

Medium Format and Large Format
Medium Format (MF) and Large Format (LF) are largely film cameras. Digital backs (bodies/sensors) exist, but are quite expensive and limited.

Film

 * Choosing a Medium Format Camera, by Philip Greenspun
 * Choosing a Large Format Camera, by Philip Greenspun

Digital
MF backs exist that are similar to DSLR sensors: a full sensor. These are extremely expensive, but can be rented.

LF backs are scanning backs: a sensor the size of a LF image would be prohibitively expensive, so instead one uses a row of sensors which scans across the image, with exposures measured in minutes. They are thus only suited for photography of static objects.


text:
Wikijunior talk:Big Book of Fun Science Experiments/How A Bath Fizzer Works, and How To Make One

This page is supposed to demonstrate how (chemically speaking) salts work, and how to make a bath fizzer. Laleena (talk) 23:09, 31 January 2008 (UTC)


text:
Signals and Systems/Time Domain Analysis/System Response

Example 1
Consider the driven RLC circuit below. Determine the current in the circuit, y(t), given an input of $$x(t)=8e^{-2t}$$. The initial current is 0A and the initial voltage across the capacitor is 2V.

Setting Up the Differential Equation
Recall that the voltages across inductors, resistors and capacitors are related to the current as follows:
 * $$v_L=L \frac{di}{dt}$$
 * $$v_R=iR \,$$
 * $$v_C=\frac{1}{C} \int i \, dt$$

By Kirchhoff's Voltage Law, we obtain the loop equation, replacing i with y(t):

 * $$x(t)=L \frac{dy(t)}{dt}+Ry(t)+\frac{1}{C} \int y(t) \,dt$$

Differentiating with respect to t gives us:

 * $$\dot x(t)=L \ddot y(t)+R \dot y(t)+\frac{1}{C} y(t)$$

Substituting in the values gives us our differential equation describing the system:

 * $$\dot x(t)= \ddot y(t)+ 4 \dot y(t)+ 3 y(t)$$

We want to put this into the following form:

 * $$Q(D)y(t)=P(D)x(t)\,$$
 * $$ \left( D^2+4D+3 \right) y(t) = D x(t)\,$$

Now we have our equation, we can begin to find the responses.

Zero-input Response
Zero-input response (ZIR) is the behaviour of the circuit when the input is null. Thus the differential equation to solve is:

 * $$\left( D^2 + 4D + 3 \right) y(t) = 0 $$

What we expect to see here is the capacitor discharging its initial charge through the resistor and inductor, subject to the initial conditions. The ratio of the component values will set the damping. Let's look at this first to get an idea of the behaviour of the circuit.

The equation can also be written as:

 * $$ \left( D^2 + 2\zeta\omega_0 D + \omega_0^2 \right) y(t) = 0 $$,

where ζ is the damping ratio, and ω0 is the resonant frequency, found in the DE as the constant term in the polynomial:
 * $$\omega_0=\sqrt{3} \, \mbox{rad/s}$$

We therefore can solve for ζ:
 * $$2 \zeta \omega_0 = 4\,$$
 * $$\zeta = \frac{4}{2 \sqrt{3}} \approx 1.15$$

This system is therefore over-damped, so we expect to see the current rising and decaying to zero without oscillation.

Initial Conditions
The initial conditions also need to be factored in before we can compute the ZIR. We know from the problem that the initial current is zero. However, the current's derivative is not explicitly given. However, the voltage across the capacitor is, so we can go back the loop voltage equation:

 * $$x(t)=v_L+v_R+v_C\,$$

We know that the input is zero, and that there is 2V across the capacitor. Also, as the current is zero, the resistor also has zero current across it. Thus:

 * $$0=v_L+0+2\,$$
 * $$v_L=-2 \,\mbox{V}$$

The voltage across the inductor is linked to the derivative of the current:

 * $$v_L=L \dot y_0(t)$$
 * $$\dot y_0(t)= -2 $$

We now have enough initial conditions:

 * $$y_0(t)=0; \quad \dot y_0(t)=-2$$

Solving the DE
The characteristic equation is:

 * $$\lambda^2 + 4 \lambda + 3 = 0\,$$
 * $$(\lambda+1)(\lambda+3)=0\,$$

We have our characteristic roots:

 * $$\lambda_1=-1; \quad \lambda_2=-3$$

The general solution is:

 * $$y_0(t)=c_1 e^{-t} + c_2 e^{-3t}\,$$

Applying initial conditions:

 * $$    y_0(0)=  0 =   c_1 + c_2\,$$
 * $$\dot y_0(0)= -2 = - c_1 - 3 c_2\,$$

Solving these simultaneous equations gives us:

 * $$c_1=-1; \quad c_2=1$$

The zero-input response is now:

 * $$y_0(t)=-e^{-t}+e^{-3t}\,$$

Unit-impulse Response
To find the unit input response, h(t), we consider the same differential equation as for the zero-input case above, but we consider the circuit with all values (current and voltage) at zero. To do this, we specify the following initial conditions, to find a sum of the characteristic modes of the system, yn(t).

 * $$y_0(t)=0; \quad \dot y_0(t)=1\,$$

The general solution is the same as before:

The general solution is:

 * $$y_n(t)=c_1 e^{-t} + c_2 e^{-3t}\,$$

However, solving for the coefficients yields a different specific solution:
 * $$c_1=\frac1 2; \quad c_2=-\frac1 2$$

 * $$y_n(t)=\frac1 2 e^{-t} - \frac1 2 e^{-3t}$$

Now, recall that the original DE describing the circuit had a differential operator, P(D) on the right-hand side, acting on the input. Because we are now applying an input, we must take this into account. This is done by applying it to yn(t). In this case, it is a single derivative. The result of this is the unit-impulse response.

 * $$h(t)=P(D)y_n(t)\,$$
 * $$h(t)=(D)y_n(t)\,$$

 * $$h(t)= -\frac1 2 e^{-t} + \frac3 2 e^{-3t}$$

Note that this is non-zero at t=0, which appears to contradict our conditions. However, as the unit impulse lasts for an infinitesimal period, the circuit must suddenly "jump" to a different total energy instantly, or else it couldn't ever be excited by an impulse. In real life, a finite-duration signal will cause the circuit to ramp up rather than jump.

Zero-state Response
The zero-state response, ys(t) is the response of the initially relaxed circuit to the input x(t). This is found by the convolution of the unit-impulse response and the input:

 * $$y_s(t)=h(t) * x(t)\,$$

By the definition of convolution:

 * $$y_s(t)=\int_0^t h(\tau) x(t-\tau) \, d\tau$$
 * $$y_s(t)=\int_0^t \left( -\frac1 2 e^{-\tau} + \frac3 2 e^{-3\tau} \right) \left( 8 e^{-2(t-\tau)} \right) \, d\tau$$

Multiplying through:

 * $$y_s(t)=\int_0^t \left( -4 e^{-\tau} e^{-2(t-\tau)}+ 12 e^{-3\tau} e^{-2(t-\tau)} \right) \, d\tau$$
 * $$y_s(t)=\int_0^t \left( -4 e^{-\tau} e^{2\tau}e^{-2 t)}+ 12 e^{-3\tau} e^{2\tau}e^{-2 t)} \right) \, d\tau$$

Because the integral is with respect to τ, we can bring out the t term:

 * $$y_s(t)=e^{-2 t}\int_0^t \left( -4 e^{-\tau} e^{2\tau}+ 12 e^{-3\tau} e^{2\tau} \right) \, d\tau$$

 * $$y_s(t)=e^{-2 t}\int_0^t \left( -4 e^{\tau} + 12 e^{-\tau} \right) \, d\tau$$

 * $$y_s(t)=e^{-2 t} \left[ -4 e^{\tau} - 12 e^{-\tau} \right]_0^t$$

 * $$y_s(t)=e^{-2 t} \left( -4 e^{t} - 12 e^{-t} + 4 + 12 \right)$$

Finally, multiplying out and combining exponentials gives us the zero-state response:

 * $$y_s(t)=-4 e^{-t} + 16 e^{-2t} - 12 e^{-3t}\,$$

Note that the current is now zero at t=0 again. For any realistic signal, this will happen, due to the inductor disallowing steps in current.

Total Response
The total response is given by the sum of the zero-input and zero-state components:

 * $$y_t(t)=y_{0}(t)+h(t) * x(t)\, $$
 * $$y_t(t)=-e^{-t}+e^{-3t}-4 e^{-t} + 16 e^{-2t} - 12 e^{-3t}\,$$
 * $$y_t(t)=-5 e^{-t} + 16 e^{-2t} - 11 e^{-3t}\,$$

We can plot the zero-input, zero-state, unit-impulse and total responses together:


text: User talk:76.28.80.48

title: User talk:76.28.80.48


text: User talk:68.77.27.201

title: User talk:68.77.27.201


text:
Video Game Design/Introduction

Video Game Design
Video games have many different forms, from old arcade games to small hand held devices, simple flash games you play online to the newest hit for one of the big names in the industry that can cost more than a movie to make.

Like any other type of game, a video game can be simple or complex, quick or slow, and even require a great deal of practice or patience to get the hang of. A lot of people, however, do not really know what goes on behind the screen. You can see the moving symbols and colors, the sounds, and know that they react when you press buttons, but what actually is happening back there?

Before designing a game for implementation, it is necessary to understand the industry you are getting into. Video Games have been around since 1931, today it is one of the fastest industries. Most new ideas in software developments are really new variations on old ideas. Some research will always provide new insights or ease the implementation of new approaches.

Today there are a myriad of different programming languages available to the amateur game designer, many of them freely available. There are also tools that allow you to create your own games without programming. If you ever want to be a paid game designer, you will have to know a programming language or two. If, however you just want to make games for your own amusement, this is not required.

title: Video Game Design/Introduction


text:
Common Lisp/External libraries/clbuild

clbuild is a shell script helping with the download, compilation, an invocation of Common Lisp applications. It defaults to SBCL but otherwise tries to be somewhat independent of your local environment.

title: Common Lisp/External libraries/clbuild


text:
User talk:129.196.227.125

Join Us!
--Laleena (talk) 01:20, 1 February 2008 (UTC)

title: User talk:129.196.227.125


text:
User talk:Cpoor002

Welcome!
Come introduce yourself at the new users page. If you have any questions, you can ask there or contact me personally.--Laleena (talk) 01:26, 1 February 2008 (UTC)

edit summary
We generally like for that box to be used. Please try to add a short comment for every edit you make, especially for major edits. Thanks; happy editing! – Mike.lifeguard  | talk 19:07, 6 February 2008 (UTC)

title: User talk:Cpoor002


text:
Futurebasic/Language/Reference/poundendif

Syntax
[statementBlock1] [ #else [statementBlock2]]
 * 1) if condition
 * 1) endif

Description
terminates a compiler conditional block.


text:
Futurebasic/Language/Reference/abs

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
positiveValue = abs( expr )

Description
The  function returns the absolute value of the numeric expression.

The absolute value of a number is its distance from zero. Thus, the number 3 has an absolute value of 3, while the number -12.34 has an absolute value of 12.34. The absolute value of zero is zero.

title: Futurebasic/Language/Reference/abs


text:
Futurebasic/Language/Reference/acos

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
radianAngle# = ACOS (expr)

Description
Returns the arccosine of  in radians. In other words, if  represents the cosine of some angle, then   returns the angle. The returned angle will be in the range of 0 to π radians (which corresponds to 0 to 180 degrees). always returns a double-precision result.

title: Futurebasic/Language/Reference/acos


text:
Futurebasic/Language/Reference/acosh

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
result# = acosh( expr )

Description
Returns the inverse hyperbolic cosine of. This is the (positive-valued) inverse of the  function, so that   equals. always returns a double-precision result.

title: Futurebasic/Language/Reference/acosh


text:
Futurebasic/Language/Reference/and

Operator
✔ Appearance ✔ Standard ✔ Console

Syntax
result& = exprA {and | &&} exprB

Description
Expression   and expression   are each interpreted as 32-bit integer quantities. The  operator performs a "bitwise comparison" of each bit in   with the bit in the corresponding position in  . The result is another 32-bit quantity; each bit in the result is determined as follows:

Example
In the following example, expressions are evaluated as true or false before a decision is made for branching. The logical expression  is true, and is therefore evaluated as -1. The expression  is false, and is therefore evaluated as 0. Then the bitwise comparison (-1)  (0) is performed, resulting in zero. Finally, the  statement interprets this zero result as meaning "false," and therefore skips the first   statement. time = 9.5 long if time > 7 and time < 8.5 print "It is time for breakfast!" xelse print "We have to wait 'til noon to eat!" end if The example below shows how bits are manipulated with : defstr long print bin$( 923 ) print bin$( 123 ) print "" print bin$( 923 and 123 ) program output: 00000000000000000000001110011011 00000000000000000000000001111011

00000000000000000000000000011011

title: Futurebasic/Language/Reference/and


text:
Futurebasic/Language/Reference/annuity

Function
✔ Appearance ✔ Standard ✔ Console

Syntax
annuityFactor# = fn annuity#( rate, periods )

Description
Returns the annuity factor for the given interest rate and number of periods. The interest rate should be expressed as a fraction of 1; for example, 5.2 percent should be expressed as 0.052.

title: Futurebasic/Language/Reference/annuity


text:
Futurebasic/Language/Reference/appearance button

Statement
✔ Appearance χ Standard χ Console

Syntax
appearance button[#] [-] id&[, [state][, [value][, [min][, [max][, ¬ [title$][,[rect][, [type]]]]]]]

Revided
Feb 2002 (Release 6)

Description
The  statement puts a new control in the current output window, or alters an existing control's characteristics. After you create a button using the  statement, you can use the   function to determine whether the user has clicked it. You can use the statement if you want to dispose of the button without closing the window.

When you first create a button with a specific ID (in a given window), you must specify all the parameters up to and including. If you later want to modify that button's characteristics, execute  again with the same ID, and specify one or more of the other parameters (except , which cannot be altered). The button will be redrawn using the new characteristics that you specified; any parameter that you don't specify will not be altered.

a positive or negative integer whose absolute value is in the range 1 through 2147483647. The number you assign must be different from all other scroll bars or buttons in that window. Negative values build invisible buttons. Positive values build visible buttons. The state may be:

(0/disabled) (1/default/active) (2/selected)

,,   generally an integer value for the initial, minimum, and maximum values of a control a string expression. This parameter is not used to set the text of buttons defined with  or. See  for information on how this may be accomplished.

a rectangle in local window coordinates. You can express it in either of two forms:

Two diagonally opposite corner points.

Long integer expression or  variable which points to an 8-byte struct such as a   type.

any of the many types listed in the following text.

New Things To Keep In Mind
On button creation, default values supplied for missing parameters (if any) are: 1    0     1     null string

You can hide the control with either  or    and you can deactivate the control with either ,   or. Buttons are commonly hidden and revealed as tab panes are brought into or removed from view. The same is true of panes that are changed in response to items such as group pop-up placards. To read an appearance button's value, use either  or

Summary of Appearance Helpers
The following utility routines will help access information regarding the new appearance buttons:

Button Types
The Appearance Manager introduces many new control definitions. While it is not our intention to completely document all of Apple's new buttons, a few possible types are shown below with examples on how each might be implemented.

Push Buttons
Since the Appearance Manager works in both System 9 and OS X, you will see major differences in how each control is presented. Common push buttons are shown below in both versions.

So that you may see how each button was displayed, the following code shows that source used to generate the displays. /* appearance button [#] [-] id&[, [state][, [value][,¬ [min][, [max][, [title$][,[rect][, [type]]]]]]] appearance button bRef,_activeBtn,0,0,1,¬ "_kControlPushButtonProc",@r,_kControlPushButtonProc appearance button bRef,_activeBtn,0,0,1,¬ "_kControlBevelButtonSmallBevelProc",@r,¬ _kControlBevelButtonSmallBevelProc appearance button bRef,_activeBtn,0,0,1,¬ "_kControlBevelButtonNormalBevelProc",@r,¬ _kControlBevelButtonNormalBevelProc appearance button bRef,_activeBtn,0,0,1,¬ "_kControlBevelButtonLargeBevelProc",@r,¬ _kControlBevelButtonLargeBevelProc // "value" is menu ID appearance button bRef,_activeBtn,101,0,1,¬ "Bevel+_kControlBevelButtonMenuOnRight",@r,¬ _kControlBevelButtonSmallBevelProc + ¬ _kControlBevelButtonMenuOnRight // max value is cicn ID appearance button bRef,_activeBtn,0,0,256,¬ "_kControlPushButRightIconProc",@r, ¬ _kControlPushButRightIconProc appearance button bRef,_activeBtn,0,0,256,¬ "_kControlPushButLeftIconProc",@r,¬ _kControlPushButLeftIconProc // get rect from pict to determine button size h = fn GetPicture( 256 ) long if h pR;8 = @h..picFrame% OffsetRect( pR, -pR.left, -pR.top ) OffsetRect( pR, r.left, r.top ) // control "value" is pict ID appearance button  bRef,_activeBtn,256,0,1,¬ "_kControlPictureProc",@pR,_kControlPictureProc end if Not all possible push buttons (and their variations) are shown here. For example, the control that displays an arrow to indicate the presence of a menu was built with a small bevel. It would have been created with a large bevel by using

Other button types that you may wish to investigate are: _kControlIconProc _kControlIconNoTrackProc _kControlIconSuiteProc _kControlIconSuiteNoTrackProc _kControlPictureNoTrackProc

Using Buttons to Group or Separate
FB buttons (which are Control Manager controls) can be grouped together, placed in placards or separated by lines. The following example creates buttons on a plain white background so that you may more easily see the drawing that is implemented by the control definition. We begin with the source code statements used to create the buttons. appearance button bRef,_activeBtn,0,0,1,¬ "_kControlGroupBoxTextTitleProc",@r,¬ _kControlGroupBoxTextTitleProc appearance button bRef,_activeBtn,0,0,1,¬ "_kControlGroupBoxSecondaryTextTitleProc",@r,¬ _kControlGroupBoxSecondaryTextTitleProc appearance button bRef,_activeBtn,1,0,1,¬ "_kControlGroupBoxCheckBoxProc",@r,¬ _kControlGroupBoxCheckBoxProc appearance button bRef,_activeBtn,1,0,1,¬ "_kControlGroupBoxSecondaryCheckBoxProc",@r,¬ _kControlGroupBoxSecondaryCheckBoxProc // min value is menu ID appearance button bRef,_activeBtn,1,101,1,¬ "",@r,_kControlGroupBoxPopUpButtonProc appearance button bRef,_activeBtn,1,101,1,¬ "",@r,_kControlGroupBoxSecondaryPopUpButtonProc appearance button bRef,_activeBtn,1,0,1,¬ "",@r,_kControlPlacardProc appearance button bRef,_activeBtn,1,0,1,¬ "",@r,_kControlSeparatorLineProc

Embedding Buttons
Part of the strength of Appearance Manager buttons is that one button may be embedded in another. By disabling or hiding the parent button (called a super control), all embedded controls would automatically be disabled or hidden. Each window has a primary control known as a root control. The following example builds a window with a parent radio group button. Inside of that parent are three radio buttons. We can determine which of the three buttons has been selected by getting the value (via the  function) of the parent button. // create a window SetRect( r, 0, 0, _btnWd_btnMargin_btnMargin, 120 ) appearance window 1,,@r err = fn SetThemeWindowBackground( window( _wndPointer ),¬  _kThemeActiveDialogBackgroundBrush, _zTrue ) // button #1 is the papa button // note that the parent button has sufficient space so that // it holds all embedded buttons within its own rectangle SetRect( r ,_btnMargin, _btnMargin,¬  _btnMargin_btnWd, (_btnMargin_btnHt)*3 ) appearance button bRef, _activeBtn, 0, 0, 1,¬ "", @r, _kControlRadioGroupProc bRef ++ SetRect( r, _btnMargin, _btnMargin, _btnMargin_btnWd,¬  _btnMargin_btnHt ) appearance button bRef, _activeBtn, 0, 0, 1,¬ "Radio 1", @r, _kControlRadioButtonProc def EmbedButton( bRef, 1 ) bRef ++ : OffsetRect( r, 0, _btnHt_btnMargin ) appearance button bRef, _activeBtn, 0, 0, 1,¬ "Radio 2", @r, _kControlRadioButtonProc def EmbedButton( bRef, 1 ) bRef ++ : OffsetRect( r, 0, _btnHt_btnMargin ) appearance button bRef, _activeBtn, 0, 0, 1,¬ "Radio 3", @r, _kControlRadioButtonProc def EmbedButton( bRef, 1 ) local fn HandleDialog dim as long action,reference action = dialog( 0 ) reference = dialog( action ) long if action = _btnclick MoveTo( 8, 100 ) print "Current Button "; button( 1 ); end if end fn on dialog fn HandleDialog do HandleEvents until gFBQuit

Check Boxes
Other than the obvious differences in physical appearance, check boxes generally follow the same guidelines as they have for many years. One notable exception to this rule is the ability to create a mixed check box. This box contains a dash instead of a check mark to show that part, but not all, of the current selection has a specific feature. This adds a new possible maximum value of 2 to the control's range.

Possible check box values now include:

The buttons in the screen shot above were created using the following lines of code: appearance button bRef, _activeBtn,¬ _kControlCheckBoxUncheckedValue, 0,¬ _kControlCheckBoxMixedValue,¬ "Unchecked Check Box", @r, _kControlCheckBoxProc appearance button bRef, _activeBtn,¬ _kControlCheckBoxMixedValue, 0,¬ _kControlCheckBoxMixedValue,¬ "Mixed Value Check Box", @r, _kControlCheckBoxProc appearance button bRef, _activeBtn,¬ _kControlCheckBoxCheckedValue, 0,¬ _kControlCheckBoxMixedValue,¬ "Checked Check Box", @r, _kControlCheckBoxProc Note: You cannot use  to tick and untick group buttons of type   and. Use  instead. ( and   will however inactivate and activate the button respectively).

Time and Date Buttons
In addition to more common controls, the Appearance Manager can create buttons that manage dates and times. Special data structures are maintained to access the information from these controls, but by following a few simple examples, you can quickly master these skills.

The enhanced  function is useful for extracting complex data from controls. Two specific items come in to play: ignored = button( btnRef, _FBGetControlDate ) ignored = button( btnRef, _FBGetControlTime ) Referencing either of these functions will fill a global date/time record named  and another named. The variable named  is a signed 64 bit variable which may be saved in a file or used in any variable where compressed storage is required.

The format for  is that of a   which follows the layout of the structure below: begin record LongDateRec dim era       as short dim year      as short dim month     as short dim day       as short dim hour      as short dim minute    as short dim second    as short dim dayOfWeek as short dim dayOfYear as short dim weekOfYear as short dim pm        as short dim res1      as short dim res2      as short dim res3      as short end record After calling the  function to examine the contents of a control, you may extract portions of the date/time as follows: dayOfMonth = gFBControlLongDate.day thisYear  = gFBControlLongDate.year Another variable is maintained that holds the text for a specific date/time control. The contents of  (a Pascal string) are determined by the second   function parameter. When  used, it is the control's date. When  is used, it is the control's time.

In addition to setting specific types when creating a date/time control, you must set an initial value of one of the following: _kControlClockNoFlags _kControlClockIsDisplayOnly _kControlClockIsLive The specific statements used to create the Time/Date example follow: appearance button bRef, _activeBtn, 0, 0, 1,, @r,¬ _kControlClockTimeProc appearance button bRef, _activeBtn, _kControlClockIsLive, 0, 1,,¬ @r ,_kControlClockTimeSecondsProc appearance button bRef, _activeBtn, _kControlClockNoFlags,¬ 0, 1,, @r, _kControlClockDateProc appearance button bRef, _activeBtn, _kControlClockNoFlags,¬ 0, 1,, @r, _kControlClockMonthYearProc appearance button bRef, _activeBtn, ¬ _kControlClockIsLive_kControlClockIsDisplayOnly,¬ 0, 1,, @r, _kControlClockTimeSecondsProc To extract and display the contents of a control, the following statements were created: err = button( bRef, _FBgetControlTime ) edit field bRef, gFBControlText, @r

Wait States
The Appearance Manager provides several methods for telling the user that your application is busy with a task. These include chasing arrows, and finite and indeterminate progress bars.

The chasing arrows control is easy to create and is self maintaining. Each time your program scans for events, the arrows are animated. The following statement creates a chasing arrows control:

appearance button bRef, _activeBtn, 0, 0, 1,, @r,¬ _kControlChasingArrowsProc Progress bars are also easy to create, but you need to keep a couple of things in mind. First, the progress bar operates in a range of -32,768 to +32,767. If your task involves a greater number of steps, you will have to calculate a ratio to keep things within range. Second, the progress bar is updated by your program. This is as easy as setting a new value for the button, but it is code that you must write.

The minimum and maximum values for the control become the minimum and maximum values for the progress bar. The initial and current value show the current rate of progress. In the example above, the button was created using the following source: appearance button bRef, _activeBtn, 50, 0, 100,, @r,¬ _kControlProgressBarProc The minimum value was zero; maximum was 100. At the time of creation, the control value was 50, so the indicator shows colorization half way across the bar. If we wanted to indicate that the next step had been completed, we would use the following code:

appearance button bRef,, 51 Indeterminate progress bars are more complex. After the button is created, you must set the control's internal data to a new value. The following code shows how: appearance button bRef, _activeBtn, 1, 0, 1,, @r,¬ _kControlProgressBarProc dim b  as boolean dim err as OSErr b = _true err = fn SetControlData( bRef, 0,¬  _kControlProgressBarIndeterminateTag, sizeof( boolean ), @b )

Range Selectors (Sliders and Arrows)
There are many variations of the slider. Each begins with the simple type constant of. Additional parameters are added to this constant to add features to the control. The following constants are available for slider variations: _kControlSliderLiveFeedback _kControlSliderHasTickMarks _kControlSliderReverseDirection _kControlSliderNonDirectional To create a slider that uses an upward pointing indicator and has tickmarks, the following type would be used: _kControlSliderProc + ¬ _kControlSliderHasTickMarks + ¬ _kControlSliderReverseDirection Vertical sliders are created by building the button with a vertical dimension that is greater than the horizontal dimension. The control definition handles the new orientation automatically.

Range Selectors Sliders and Little Arrows

The following source lines show how this display was created: appearance button bRef, _activeBtn, 1, 1, 10,, @r,¬ _kControlSliderProc appearance button bRef, _activeBtn, 10, 1, 10,, @r,¬ _kControlSliderProc_kControlSliderHasTickMarks appearance button, _activeBtn, 1, 1, 10,, @r,¬ _kControlSliderProc_kControlSliderNondirectional appearance button bRef, _activeBtn, 1, 1, 10,, @r,¬ _kControlSliderProc_kcontrolSliderReverseDirection appearance button bRef, _activeBtn, 10, 1, 10,, @r,¬ _kControlSliderProc_kControlSliderHasTickMarks +¬ _kcontrolSliderReverseDirection

// vert orientation appearance button bRef, _activeBtn, 10, 1, 10,, @r,¬ _kControlSliderProc appearance button bRef, _activeBtn, 10, 1, 10,, @r,¬ _kControlSliderProc_kControlSliderNondirectional appearance button bRef, _activeBtn, 10, 1, 10,, @r,¬ _kControlSliderProc_kControlSliderHasTickMarks +¬ _kcontrolSliderReverseDirection

appearance button bRef, _activeBtn, 0, 0, 1,, @r,¬ _kControlLittleArrowsProc When sliders are created, the number of tick marks is set by the initial value of the control. After the control is created, the value is reset to the control minimum. Sliders range from a minimum value of -32,768 to a maximum of +32,767. The number of tick marks is something that you need to determine by balancing the size of the control against the range of the control's minimum/maximum value.

The little arrows (shown in the screen shot above) are used to increment and decrement a related visual counter (usually an edit field with a specific range of numbers). The current version of the OS X control definition is intolerant of variations in the value used for the height of this type of control. Our tests show that it must be exactly 22 pixels tall. Other values offset the arrows inside of the beveled area or, in more extreme cases, can place the arrows entirely outside of the beveled area.

Pop-Up Menus
There are two distinct types of pop-up menus: beveled, and standard. Both are valid types and the particular use of one over the other is something that should be guided by your individual application and by Apple's Human Interface Guidelines. Beveled buttons are created as follows: appearance button bRef, _activeBtn, menuID, 0, 1,¬ "Bevel+_kControlBevelButtonMenuOnRight",¬ @r, _kControlBevelButtonSmallBevelProc + ¬ _kControlBevelButtonMenuOnRight When bevel-button menus are created, the initial value for the control is the resource ID number of the menu. Three specific  function commands may be used to extract information from the control. handle      = button( bRef, _FBgetBevelControlMenuHandle ) currentItem = button( bRef, _FBgetBevelControlMenuVal ) previousItem = button( bRef, _FBgetBevelControlLastMenu )

Standard pop-up buttons follow slightly different syntax. When creating, the minimum value specifies the menu resource ID and the maximum value is the width of the title for the menu. Passing in a menu ID of -12345 causes the popup not to try and get the menu from a resource. Instead, you can build the menu and later stuff the menuhandle field in the popup data information (using ). You can pass -1 in the  parameter to have the control calculate the width of the title on its own instead of guessing and then tweaking to get it right. It adds the appropriate amount of space between the title and the popup. A maximum value of zero means, "Don't show the title."

After creation you might need to change the value, minimum and maximum to the correct settings for your pop-up menu with: appearance button id&,, value, min, max The standard pop-up button menu in the above illustration was created with the following code: appearance button bRef, _activeBtn, 0, 101, -1, "Pop Title:"¬ ,@r, _kControlPopUpButtonProc A single  function provides access to the menu handle. Remember: standard and beveled pop-up menus do not use the same  function constants. menuHandle = button( bRef, _FBgetControlMenuHandle ) You can retrieve the current pop-up menu item with: mItem = button( bRef )

List Boxes
Lists generally use an auxiliary resource to define their format. The resource type used is 'ldes' and a definition for it can be created using Resourcerer 2.4 or later or by creating a template in any resource editor. You may also format a handle to match the  record and save that handle as a resource. The resource ID for the ldes is passed in the ' ' parameter when creating the control. You may pass zero in value which would tell the List Box control to not use a resource. The list will be created with default values, and will use the standard. You can change the list by getting the list handle. You can set the LDEF by using the tag below in conjunction with.

A list box resource is defined as follows: begin record ldes dim versionNumber  as short dim numberOfRows   as short dim numberOfColumns as short dim cellHeight     as short dim cellWidth      as short dim hasVertScroll  as boolean dim filler1        as byte dim hasHorizScroll as boolean dim filler2        as byte dim LDEFresID      as short dim hasSizeBox     as boolean dim reserved       as byte end record The following example creates a list box from a resource with an ID of 256. Then it fills the list with item text.

To simplify this example, Resourcerer was used to create the list box resource.

appearance button bRef, _activeBtn, 256, 0, 1,¬ "List Box", @r, _kControlListBoxProc dim cH         as handle        //control handle dim @bufferSize as long dim @lH        as handle        //list handle dim y,t$ dim @celly,cellX                //cell "point" record cH = button&( bRef ) err = fn GetControlData( cH, 0,¬  _kControlListBoxListHandleTag, ¬   sizeof( handle ),  lH, bufferSize ) cellX = 0 for cellY = 0 to 9 t$ = "Item #" + mid$( str$( cellY + 1 ), 2 ) LSetCell( @t$[1], t$[0], celly, lH ) next

Tab Buttons
Tab buttons will require more work than other controls. This stems from the fact that tabs are really several controls that act in unison. First is the main tab control. When this is created you specify the number of tabs that will be present by setting the max value of the control. It is generally better to create the tab button invisibly (by using a negative button reference number) then show it by issuing a  statement with the positive version of the reference number.

After the initial shell is built for the tab, you must set the title for each tab using. Then a user pane is inserted for each tab. These are embedded in the tab shell using. Buttons that will reside in each user pane are created and embedded in the user pane.

When a dialog event is encountered, the value of the tab shell button corresponds to the position of the clicked tab in the tab list. Your program must loop through each user pane and show or hide them so that the display matches the clicked tab.

Study the following example to see how a working tab button is created. Be sure to note the simple  handler that maintains the buttons.

There are many styles of tab buttons: _kControlTabLargeProc _kControlTabSmallProc _kControlTabLargeNorthProc _kControlTabSmallNorthProc _kControlTabLargeSouthProc _kControlTabSmallSouthProc _kControlTabLargeEastProc _kControlTabSmallEastProc _kControlTabLargeWestProc _kControlTabSmallWestProc This example uses, but you should experiment with other types to see the results. dim r      as Rect dim x      as long dim bRef   as long dim infoRec as ControlTabInfoRec // Names of the individual tabs _tabCount = 3 dim tabTitles$(_tabCount) tabTitles$(1) = "One" tabTitles$(2) = "Two" tabTitles$(3) = "Three" // create a window SetRect( r, 0, 0, 300, 200 ) appearance window 1, "Tabs", @r, _kDocumentWindowClass def SetWindowBackground( _kThemeActiveDialogBackgroundBrush,¬ _zTrue ) /* Button 100 is the tab 'shell'. In this example, it is made to be the full size of the window, less a small margin. Buttons 1, 2, & 3 will be the embedded user panes that contain information to be displayed for each tab. A tab control is usually built as invisible. This is because the information contained in the tabs will be modified as the control is being constructed. Making it visible after all modifications have been completed provides a cleaner window build. _tabBtnRef = 100 _btnMargin = 8 InsetRect( r, _btnMargin, _btnMargin ) appearance button -_tabBtnRef, 0, 0, 2, _tabCount,, @r,¬ _kControlTabSmallNorthProc /* Fix the tab to use a small font. This is not a requirement, but it is information which many will find useful. dim cfsRec as ControlFontStyleRec cfsRec.flags = _kControlUseSizeMask cfsRec.size = 9 def SetButtonFontStyle( _tabBtnRef, cfsRec ) /* Adapt a rectangle that can be used for the content area of each tab. InsetRect( r, _btnMargin, _btnMargin ) r.top += 20 // Loop thru the tabs and set up individual panes for x = 1 to _tabCount infoRec.version    = _kControlTabInfoVersionZero infoRec.iconSuiteID = 0 infoRec.Name       = tabTitles$(x) def SetButtonData( _tabBtnRef, x, _kControlTabInfoTag, ¬    sizeof( infoRec ), infoRec ) /*    Each of these panes is a button that is embedded in the tab button. The first   one will be visible. All others will be invisible because information from only one tab at a time can be viewed. Remember: negative button reference numbers make invisible buttons. Once a new pane button (_kControlUserPaneProc) is created, it is embedded into the larger tab button. */  if x != 1 then bRef = -x else bRef = x   appearance button bRef,,¬ _kControlSupportsEmbedding,,,, @r,¬ _kControlUserPaneProc def EmbedButton( x, _tabBtnRef ) next /* Now we have a tab shell (_tabBtnRef = 100) and in it we have embedded three tab panes (1,2, and 3). To demonstrate how these can contain separate info, we will place a simple button in each of the three panes. Button 10 in pane 1 Button 20 in pane 2 Button 30 in pane 3 InsetRect( r, 32, 32 ) r.bottom = r.top + 24 r.right = r.left + 128 appearance button 10, _activeBtn,,,,¬ "Pane #1", @r, _kControlPushButtonProc def EmbedButton( 10, 1 ) OffsetRect( r, 8, 8 ) appearance button 20, _activeBtn,,,,¬ "Pane #2", @r, _kControlPushButtonProc def EmbedButton( 20, 2 ) OffsetRect( r, 8, 8 ) appearance button 30, _activeBtn,,,,¬ "Pane #3", @r, _kControlPushButtonProc def EmbedButton( 30, 3 ) button _tabBtnRef, 1 // make visible /* Only one event (a button click in the tab shell button) gets a response from out dialog routine. The value returned (1,2, or 3) corresponds to buttons 1,2, or 3 that were embedded into the tab parent. Our only action is to show (BUTTON j) or hide (BUTTON -j) the proper tab pane. All controls embedded in those panes will automatically be shown or hidden. local fn doDialog dim as long action, reference, j action    = dialog( 0 ) reference = dialog( action ) long if action == _btnClick and reference == _tabBtnRef for j = 1 to _tabCount long if j == button( _tabBtnRef ) button j     xelse button -j end ifF next end if end fn on dialog fn doDialog do HandleEvents until gFBQuit