text:
Chess/Puzzles/Directmates

Mate in 2

 * 1) Puzzle by L. Kubbel
 * 2) Puzzle by L. Kubbel
 * 3) Puzzle by S. Veselenchuk
 * 4) Puzzle by V. Leonov
 * 5) Puzzle by A. Shulyakov
 * 6) Puzzle by V. Lashmanov
 * 7) Puzzle by L. Kubbel

Mate in 3

 * 1) Puzzle by Z. Kolodnyi
 * 2) Puzzle by V. Shpekman
 * 3) Puzzle by D. Heyn
 * 4) Puzzle by Sam Loyd
 * 5) Puzzle by Sam Loyd
 * 6) Puzzle by A. Bekorukov
 * 7) Puzzle by G. Zhukov
 * 8) Puzzle by Sam Loyd

Mate in 14

 * 1) Puzzle by I. Kling

title: Chess/Puzzles/Directmates


text:
Chess/Puzzles/Directmates/Two-move 1

Starting from the following position, white starts and wins in two moves.

Authored by L. Kubbel (1924).

/Solution/

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

title: Chess/Puzzles/Directmates/Two-move 1


text:
Chess/Puzzles/Directmates/Two-move 2

Starting from the following position, white starts and mates in two moves.

Authored by L. Kubbel (1924).

/Solution/

title: Chess/Puzzles/Directmates/Two-move 2


text:
Chess/Puzzles/Directmates/Three-move 1

11. Starting from the following position, white starts and wins in three moves. Left-click on a piece to move.

Authored by Z. Kolodnyi (1927).

Hint (0) - Check Answer (Enter)

title: Chess/Puzzles/Directmates/Three-move 1


text:
Chess/Puzzles/Directmates/Three-move 2

12. Starting from the following position, white starts and wins in three moves. Left-click on a piece to move.

Authored by V. Shpekman (1964)

Hint (0) - Check Answer (Enter)

title: Chess/Puzzles/Directmates/Three-move 2


text:
Chess/Puzzles/Directmates/Three-move 3

13. Starting from the following position, white starts and wins in three moves. Left-click on a piece to move.

Authored by D. Heyn (1889).

Hint (0) - Check Answer (Enter)

title: Chess/Puzzles/Directmates/Three-move 3


text:
Chess/Puzzles/Directmates/Three-move 4

14. Starting from the following position, white starts and wins in three moves (white can castle). Left-click on a piece to move.

Authored by Sam Loyd (1857).

Hint (0) - Check Answer (Enter)

title: Chess/Puzzles/Directmates/Three-move 4


text:
Chess/Puzzles/Directmates/Two-move 3

Starting from the following position, white starts and wins in two moves.

Authored by S. Veselenchuk (1985).

/Solution/

title: Chess/Puzzles/Directmates/Two-move 3


text:
Chess/Puzzles/Directmates/Three-move 5

Starting from the following position, white starts and wins in three moves.

Authored by Sam Loyd

/Solution/

title: Chess/Puzzles/Directmates/Three-move 5


text:
Chess/Puzzles/Directmates/Two-move 1/Solution

The solution is: 1. Qa2

If 1... Nc8... 2. d8=N#

Other attempts

 * The move 1. Qb3+ fails because the line 1...Nb5 2. Qxb5+ Kxa8 is mate in three, not two.
 * Likewise 1. Qb8+ fails to Kc6 2. Qb6+ Kxd7
 * And 1. c8=Q+ Nxc8 2. dxc8=Q+ Ka7 3. Qf7# is also one move too slow.


text:
Chess/Puzzles/Directmates/Two-move 2/Solution

The solution is: 1. Qe3

Both other moves (1... Kc4 and 1... a4) allow 2. Qxc5#


text:
Chess/Puzzles/Directmates/Three-move 7

Starting from the following position, white starts and wins in three moves.

Authored by G. Zhukov (1981).

/Solution/

title: Chess/Puzzles/Directmates/Three-move 7


text:
Chess/Puzzles/Directmates/Three-move 6

Starting from the following position, white starts and wins in three moves.

Authored by A. Bekorukov (1981).

/Solution/

title: Chess/Puzzles/Directmates/Three-move 6


text:
Chess/Puzzles/Directmates/Two-move 4

Starting from the following position, white starts and wins in two moves.

Authored by V. Leonov (1981).

/Solution/

title: Chess/Puzzles/Directmates/Two-move 4


text:
Chess/Puzzles/Directmates/Two-move 3/Solution

1. Qd7!

1... Qxh7 2. Qe8#

1... Kxh7 2. Nf6#

1... g6  2. Qf7#

1... Kf8 2. Rxh8#


text:
Chess/Puzzles/Directmates/Three-move 5/Solution

1. d4 Kh5

''If 1... Kg4 then 2. e4+ Kh4 3.g3# ''

2. Qd3, and

3.Qh3#

Note that h4 is the only place on the board where the black king is mated so quickly.


text:
Chess/Puzzles/Directmates/Two-move 5

Starting from the following position, white starts and wins in two moves.

Authored by A. Shulyakov.

/Solution/

title: Chess/Puzzles/Directmates/Two-move 5


text:
Chess/Puzzles/Directmates/Two-move 5/Solution

1. Qd2!

''If 1... Kh4 then 2. Qg5#''

''If 1... Kg4 then 2. Qf4#''

''If 1... Kf3 then 2. Qf4# or 2. Qg2#''

''If 1... Bg4 then 2. Qf2#''

''If black moves the bishop anywhere else then 2. Qf4#''


text:
C Programming

Wikibooks Contributors Present: C Programming A comprehensive look at the C programming language and its features.

Introduction

 * Why Learn the C programming Language?
 * History
 * What you need before you can learn
 * Obtaining a Compiler

Beginning C

 * Intro Exercise
 * Preliminaries
 * Basics of Compilation
 * Programming Structure and Style
 * Variables
 * Simple Input and Output
 * Operators and type casting
 * Arrays and Strings
 * Program Flow Control
 * Procedures and Functions
 * Standard Libraries
 * Exercises

Intermediate C

 * Advanced Data Types
 * Pointers and Relationship to Arrays
 * Memory Management
 * Error Handling
 * Stream I/O
 * String Manipulation
 * Further Math
 * Libraries

Advanced C

 * Common Practices
 * Preprocessor Directives and Macros
 * Sockets and Networking (UNIX)
 * Serialization and X-Macros
 * Coroutines

C and Beyond

 * Particularities of C
 * Low-level I/O
 * C Trigraph
 * Language Overloading and Extensions
 * Combining Languages
 * Object Oriented Programming: The GObject System
 * Commented Source Code Library

Computer Science
Some of the following are C adaptations of articles from the Computer programming book.

 * Statements
 * Side Effects and Sequence Points

Reference Tables
This section has some tables and lists of C entities.
 * Standard Library Reference
 * Preprocessor Reference
 * Language Reference
 * Table of Keywords
 * Table of Operators
 * Table of Data Types

Platform Reference

 * POSIX
 * GNU C Library
 * MS Windows

Appendices

 * C Compilers Reference List
 * Index
 * Links
 * Exercise Solutions

Related Wikibooks

 * A Little C Primer
 * GCC Debugging
 * GNU C Compiler Internals

সি প্রোগ্রামিং Programació en C Kurz programování v C C-Programmierung Προγραμματισμός στην C Programmeerimiskeel C Programación en C Programmation C C C שפת C C (პროგრამირება) Programmeren in C C言語 C Programar em C Язык Си в примерах C Programmering i ANSI-C சி

title: C Programming


text:
Chess/Puzzles/Directmates/Two-move 4/Solution

It is quite simple to show that the only move black could have made to reach this position was b7-b5. Thus, a5 can take b5 en passant.

1.a5xb6 a3

2.b7#


text:
C Programming/History

The field of computing as we know it today started in 1947 with three scientists at Bell Telephone Laboratories—William Shockley, Walter Brattain, and John Bardeen—and their groundbreaking invention: the transistor. In 1956, the first fully transistor-based computer, the TX-0, was completed at MIT. The first integrated circuit was created in 1958 by Jack Kilby at Texas Instruments, but the first high-level programming language existed even before then.

The Fortran project was developed in 1954 by IBM. A shortening of "The IBM Mathematical Formula Translating System", the project had the purpose of creating and fostering development of a procedural, imperative programming language that was especially suited to numeric computation and scientific computing. It was a breakthrough in terms of productivity and programming ease (compared to assembly language) and speed (Fortran programs ran nearly as fast as, and in some cases, just as fast as, programs written in assembly). Furthermore, Fortran was written at a high-enough level (and thus was machine independent enough) to become the first widely adopted programming language. The Algorithmic Language (Algol 58) was derived from Fortran in 1958 and evolved into Algol 60 in 1960. The Combined Programming Language (CPL) was then created out of Algol 60 in 1963. In 1967, it evolved into Basic CPL (BCPL), which was the basis for B, which was created in 1971, and served as the basis of C.

Created by Ken Thompson at Bell Labs, B was a stripped-down version of BCPL that was also a compiled language (see User's Reference to B) used in early internal versions of the UNIX operating system. As Dennis Ritchie noted in his Development of the C Language :"The B compiler on the PDP-7 did not generate machine instructions, but instead 'threaded code', an interpretive scheme in which the compiler's output consists of a sequence of addresses of code fragments that perform the elementary operations. The operations typically — in particular for B — act on a simple stack machine."Thompson and Ritchie improved B, and called the result NB. Further extensions to NB created its logical successor, C. Most of UNIX was rewritten in NB, and then C, which resulted in a more portable operating system. The portability of UNIX was the main reason for the initial popularity of both UNIX and C. Rather than creating a new operating system for each new machine, system programmers could simply write the few system-dependent parts required for the machine, and then write a C compiler for the new system. Since most of the system utilities were thus written in C, it simply made sense to also write new utilities in C.

The American National Standards Institute began work on standardizing the C language in 1983, and completed the standard in 1989. The standard, ANSI X3.159-1989 "Programming Language C", served as the basis for all implementations of C compilers. The standards were later updated in 1990 and 1999, allowing for features that were either in common use, or were appearing in C++.

de:C-Programmierung: Grundlagen Programación en C/Historia de C Programmation C/Introduction C/Linguaggio/Panoramica Programar em C/História da linguagem C

title: C Programming/History


text:
C Programming/What you need before you can learn

Getting Started
This book introduces and teaches the basics of the C programming language and touches upon some advanced topics as well. This section outlines the required skills and tools you'll need to get the most out of this book.

Skills and Prior Experience You'll Need
This book is for beginning programmers, so don't worry if you have no formal computer training or prior programming experience. It's assumed you know how to turn your computer on, start and stop applications, and perform other basic operations like installing software. It's also assumed you have some experience interacting with your operating system through a terminal window using its command line interface. If you aren't sure what this means, consider seeking out a tutorial for your chosen platform that can get you comfortable with getting around your computer's command line. At a minimum, you should know the basic commands for navigating to different directories and performing simple file management operations. This book will spell out any other commands you'll need to run from the command line to get your C code working on your machine.

Software You'll Need
No one ever became a musician just by reading sheet music. Musicians have to constantly play and practice on their instruments to get good. Similarly, the only way to become a programmer is to write and execute lots of code. To do that, you will need two different pieces of software: a compiler and a text editor. Both can be had for no cost.

Compilers
A compiler is a sophisticated piece of software for converting the C source code you write with your text editor into the machine code that you can execute on your computer. Below is a list of some popular C compilers. Note that some of the compilers listed below come as part of an integrated development environment (IDE). However, if you are brand new to programming, it's best if you can install and run the compiler from the command line instead of through an IDE. This book uses the GNU C Compiler (GCC) in its examples so we recommend installing this compiler for use with this book. The next section in this chapter will explain how to download and install the GCC software to your machine.

Popular C compilers/IDEs include:

Text Editors and IDEs
Aside from a compiler, the only other software requirement is a text editor for writing and saving your C code. Note that a text editor is different from a word processor, a piece of software with many features for creating visually appealing documents. Unlike word processors, text editors are primarily designed to create plain text files. On Windows, the Notepad text editor can be used but it does not offer any advanced capabilities such as syntax highlighting and code completion. There are hundreds of text editors (see List of Text Editors). Among the most popular are Notepad++ for Windows as well as Sublime Text, gedit, Vim and Emacs which are also available on other operating systems (“cross-platform”). These text editors come with syntax highlighting and line numbers, which makes code easier to read at a glance, and to spot syntax errors. Many text editors have features for increasing your coding speed, such as keystroke macros and code snippets, that you can take advantage of as you gain skill as a programmer.

You may also be considering the use of an integrated Development Environment (IDE) to help you write code. An IDE is a suite of integrated tools and features in one convenient package, usually with a graphical user interface. These programs include a text editor and file browser and are also sometimes bundled with an easily accessible compiler. They also typically include a debugger, a tool that will enable you to do such things as step through the program you develop manually one source code line at a time, or alter data as an aid to finding and correcting programming errors.

However, many IDEs do not offer a command line interface to the compiler and/or offer only graphical buttons or a menu for executing programs. So for new programmers, an IDE is not ideal. Instead, a simple text editor will suffice along with the ability to issue simple commands on the command line to help you gain a hands-on familiarity and understanding of core development tools. Of course, an IDE may still be useful to you if you have experience with one. But as a general guideline: Do not use an IDE unless you know what the IDE is doing for you!

Other popular compilers/IDEs include:

On GNU/Linux, GCC is almost always included by default.

On Microsoft Windows, Dev-C++ is recommended for beginners because it is easy to use, free, and simple to install. Although the initial developer (Bloodshed) hasn’t updated it since 2005, a new version appeared in 2011, made by an independent programmer, and is being actively developed. An alternate option for those working only in the Windows environment is the proprietary Microsoft Visual Studio Community which is free of charge and has an excellent debugger.

On Mac OS X, the Xcode IDE provides the compilers needed to compile various source files. The newer versions do not include the command line tools. They need to be downloaded via Xcode->Preferences->Downloads.


text:
C Programming/Obtaining a compiler

Dev-C++
Dev C++ is an Integrated Development Environment (IDE) for the C++ programming language, available from Bloodshed Software. An updated version is available at Orwell Dev-C++.

C++ is a programming language which contains within itself most of the C language, plus extensions. Most C++ compilers will compile C programs, sometimes with a few adjustments (like invoking them with a different name or command line switch). Therefore, you can use Dev C++ for C development.

However, Dev C++ is not the compiler. It is designed to use the MinGW or Cygwin versions of GCC - both of which can be obtained as part of the Dev C++ package, although they are completely different projects.

Dev C++ simply provides an editor, syntax highlighting, some facilities for the visualisation of code (like class and package browsing) and a graphical interface to the chosen compiler. Because Dev C++ analyses the error messages produced by the compiler and attempts to distinguish the line numbers from the errors themselves, the use of other compiler software is discouraged since the format of their error messages is likely to be different.

The latest version of Dev-C++ is a beta for version 5. However, it still has a significant number of bugs. All the features are there, and it is quite usable. It is considered one of the best free software C IDEs available for Windows.

A version of Dev C++ for Linux is in the pipeline. It is not quite usable yet, however. Linux users already have a wealth of IDEs available. (e.g. KDevelop and Anjuta.) Most of the graphical text editors, and other common editors such as emacs and vim, support syntax highlighting.

Windows

 * 1) Go to https://sourceforge.net/projects/orwelldevcpp/ and pick the download option.
 * 2) The setup is pretty straight forward. Make sure the compiler option is ticked.
 * 3) You can now use the environment provided by the software to write and run your code.
 * 4) OPTIONALLY: "C:\Program Files (x86)\Dev-Cpp\MinGW64\bin" can be added to the global PATH variable of the operating system to compile with GCC from a command prompt.

GCC
The GNU Compiler Collection (GCC) is a free/libre set of compilers developed by the Free Software Foundation and can be installed on a wide variety of operating systems. GCC commands are used throughout this book to demonstrate how to compile C code so you are encouraged to take the time to install GCC on your machine.

GNU/Linux
On GNU/Linux, Installing the GNU C Compiler can vary in method from distribution to distribution. (Type in gcc -v to see if it is installed already.)
 * For Ubuntu, install the GCC compiler (along with other necessary tools) by running  in the terminal.
 * For Debian, install the GCC compiler (as root) by running  in the terminal.
 * For Fedora, install the GCC compiler (as root) by running  in the terminal.
 * For RHEL, install the GCC compiler (as root) by running  in the terminal.
 * For Mandrake, install the GCC compiler (as root) by running  in the terminal.
 * For Slackware, the package is available on their website - simply download, and type  in the terminal.
 * For Gentoo, you should already have GCC installed as it will have been used when you first installed. To update it run (as root)   in the terminal.
 * For Arch Linux, install the GCC compiler (as root) by running  in the terminal.
 * For Void Linux, install the GCC compiler (as root) by running   in the terminal.
 * If you cannot become root, get the GCC tarball from ftp://ftp.gnu.org/ and follow the instructions in it to compile and install in your home directory. Be warned though, you need a C compiler to do that - yes, GCC itself is written in C.
 * You can use a commercial C compiler/IDE.

macOS
The simplest method for obtaining a compiler is to install Apple's proprietary IDE, Xcode, available for free.

Xcode comes bundled with a GCC-compatible compiler called clang which replaced GCC as Xcode's default C compiler a number of years ago. But because Xcode aliases the  command to the clang compiler, GCC installation isn't necessary to compile the example code in this book.

If you prefer using the GCC compiler, the third-party package manager, Homebrew, provides an easy installation process. You'll first need to install Homebrew, and then issue the  command to install the desired GCC Homebrew formulae. You may want to find a recent tutorial that will step you through this process as other commands may be necessary to get GCC set up flawlessly on your system, especially if you already have Xcode installed.

For hardcore computer enthusiasts, GCC can be compiled directly from the source code. We highly recommend searching out and following an up-to-date tutorial for installing GCC from source files.

BSD Family Systems

 * For FreeBSD, NetBSD, OpenBSD, DragonFly BSD the port of GNU GCC is available in the base system, or it could be obtained using the ports collection or pkgsrc.

Windows
There are three ways to use GCC on Windows: Cygwin, MinGW and Windows Subsystem for Linux (WSL). Applications compiled with Cygwin will not run on any computer without Cygwin, so MinGW is recommended. MinGW is simpler to install, and takes less disk space.

MinGW

 * 1) Go to http://sourceforge.net/projects/mingw/ download and save this to your hard drive.
 * 2) Once the download is finished, open it and follow the instructions. You can also choose to install additional compilers, or the tool Make, but these aren't necessary.
 * 3) Now you need to set your PATH. Right-click on "My computer" and click "Properties". Go to the "Advanced" tab and click on "Environment variables". Go to the "System variables" section and scroll down until you see "Path". Click on it, then click "edit". Add "C:\MinGW\bin\" (without the quotes) to the end.
 * 4) To test if GCC works, open a command prompt and type "gcc". You should get the message "gcc: fatal error: no input files compilation terminated.". If you get this message, GCC is installed correctly.

Cygwin

 * 1) Go to http://www.cygwin.com and click on the "Install Cygwin Now" button in the upper right corner of the page.
 * 2) Click "run" in the window that pops up, and click "next" several times, accepting all the default settings.
 * 3) Choose any of the Download sites ("ftp.easynet.be", etc.) when that window comes up; press "next" and the Cygwin installer should start downloading.
 * 4) When the "Select Packages" window appears, scroll down to the heading "Devel" and click on the "+" by it. In the list of packages that now displays, scroll down and find the "gcc-core" package; this is the compiler.  Click once on the word "Skip", and it should change to some number like "3.4" etc. (the version number), and an "X" will appear next to "gcc-core" and several other related packages that will now be downloaded.
 * 5) Click "next" and the compiler as well as the Cygwin tools should start downloading; this could take a while.  While you're waiting for the installation to finish, download any text-editor designed for programming.  While Cygwin does include some, you may prefer doing a web search to find other alternatives.  While using a stock text editor is possible, it is not ideal.
 * 6) Once the Cygwin downloads are finished and you have clicked "next", etc. to finish the installation, double-click the Cygwin icon on your desktop to begin the Cygwin "command prompt".  Your home directory will automatically be set up in the Cygwin folder, which now should be at "C:\cygwin" (the Cygwin folder is in some ways like a small unix/linux computer on your Windows machine -- not technically of course, but it may be helpful to think of it that way).
 * 7) Type "gcc" at the Cygwin prompt and press "enter"; if "gcc: no input files" or something like it appears you have succeeded and now have the GCC compiler on your computer (and congratulations -- you have also just received your first error message!).

Windows Subsystem for Linux

 * 1) Go to http://aka.ms/wsldocs and follow the steps to install WSL
 * 2) Go to https://aka.ms/vscode and follow the steps to install VSCode
 * 3) Follow the guide and choose Get Started with C++ and WSL
 * 4) As a result you will need to install possibly Ubuntu and set-up accordingly installing GCC like the Linux guide above.

The current stable (usable) version of GCC is 4.9.1 published on 2014-07-16, which supports several platforms. In fact, GCC is not only a C compiler, but a family of compilers for several languages, such as C++, Ada, Java, and Fortran.

Embedded systems

 * Most CPUs are microcontrollers in embedded systems, often programmed in C, but most of the compilers mentioned above (except GCC) do not support such CPUs. For specialized compilers that do support embedded systems, see Embedded Systems/C Programming.

Other C compilers
We have a long list of C compilers in a much later section of this Wikibook. Which of those compilers would be suitable for beginning C programmers, that we should say a few words about getting started with that particular compiler in this section of this Wikibook?

C/Używanie kompilatora

title: C Programming/Obtaining a compiler


text:
C Programming/Intro exercise

The "Hello, World!" Program
Tradition dictates that we begin with a program that displays a "Hello, World!" greeting to the screen, followed by a new line, and then exits. Below is the C source code that does just that. Type this code into your preferred text editor/IDE and save it to a file named hello.c.

Source code analysis
Although this is a very simple program, a lot of hidden meaning is packed into the many symbols you see in the code. Though your compiler understands it, you can only guess at what the code, sprinkled with some familiar English words, might do. One of your first jobs as a new programmer will be to learn the many "words" and symbols of the C programming language, the language your compiler understands. Once you learn the meaning underlying the code, you will be able to "talk to" the compiler and give it your own orders and build any kind of program you are inventive and resourceful enough to create.

But note that knowing the meanings of arcane symbols is not all there is to programming. You can't master another language by reading a translation dictionary. To become fluent in another language, you have to practice conversing in that language. Learning a programming language is no different. You have to practice "talking" to the compiler with the source code you write. So be sure to type in the code example above and feel free to experiment and alter it with your curiosity as your guide.

OK, so let's dive in and look at the first line in our program:

Before understanding what this line does, you have to know that your machine already comes pre-installed with some C software code. The code is there to save you from the drudgery of writing code that performs basic, common tasks. This reusable code is referred to as a library. And so our first line in our example program signals to the compiler that we'd like to "check out" some code from the library and make use of it in our program. Here, we are borrowing code that will help us print text to the screen.

The way we tell the C compiler to include library code into our own code is by using what's called a. One of the very first tasks your compiler will perform is to search through your source code for preprocessor directives which modify your source code in some way. In our case, the  preprocessor directive tells the compiler to copy source code from a library and insert it directly into the code where the preprocessor directive is found. Since our directive is at the very top of the file, the library code will be inserted at the top of the source file. (Note that this all happens in the computer's memory, so the original file on your disk never actually gets altered.)

But which library code should the compiler insert? The next bit in the line, the, tells the compiler to copy and paste the C code from the stdio.h file into your code. The angle brackets surrounding the file name tell the compiler to look for the file in the standard library as opposed, to say, your own personal library of reusable code. Note that files with the .h extension are called header files. The stdio.h header file contains many functions related to input and output that are defined according to the C standard. Though this header file gives us access to many different functions, the only library function we are interested in from stdio.h is the  function.

OK, but what, exactly, is a function? Let's take a look at the next line in our code so we can begin to get an idea:

Here we create a function named  that is the starting point for all C programs. All C programs require a function called "main" or they will not compile. Our function name is surrounded by two mysterious symbols, int and (void). The "int" bit tells the compiler what kind of value our function will return while the "(void)" bit tells our compiler what kind of values we will "pass" into our function. We'll skip over what exactly this means for now as these values will be covered in more detail later in the book. The most important thing to understand right now is that together, these symbols declare our function to the compiler and tell it that it exists.

So what is a function? In computer science, the term “function” is used a bit more loosely than in mathematics, since functions often express imperative ideas (as in the case of C) - that is, how-to process, instead of declarations. For now, suffice it to say, functions define a set of computer statements that work together to carry out a specific task. In C, the statements associated with a function are placed between a set of curly braces,, which mark the beginning and end of the statements. Together, the curly braces and the statements are called a block. Let's take a look at the first line in our function's block:

This line of code is the heart of our program, the one that outputs our greeting to the user’s console (also known as the terminal in the context of Unix-like operating systems), the text-based interface installed on your computer. This statement is a function call and has two main parts: the name of the library function used to print our greeting, printf, followed by the data that we will pass to the function, seen here between the pair of parentheses. The data we are passing to the function is the string, “Hello World!\n”. The "\n" part at the end of the string is a special kind of character called an escape sequence. The "\n" escape sequence generates the new line at the end of our text. Strings and escape sequences will be covered in more detail later. We terminate the function call statement with a semicolon so the compiler knows that it should begin looking for a new statement which it finds on the next line:

Here, we say that our  function returns an integer value using the   keyword. The integer value we are returning is "0". But what does this mean, exactly? In the specific context of the  function, the value we return is called the exit status, which we report back to the operating system to indicate whether our code ran without error. As our programs grow in complexity, we can use other integers as codes to indicate various types of errors. This style of providing exit status is a long standing convention. We will go into much more detail on return values of functions later in the book.

So that's a lot to take in, even for such a short program. Don't worry if you don't understand all of it and don't worry about memorizing it. You do not learn programming by memorizing, you learn by repetition and by doing. Memorizing all the notes to Beethoven's 5th symphony does not make you a concert pianist, you must get on the keyboard and practice and play!

Next we will show you how to take the source code you typed in and turn it into an executable file with your compiler.

Compiling
Compiling is the process we used to describe translating the orders you gave to the compiler in your source code into the machine language that can be run by your operating system and microprocessor. In this way, your C compiler is a middle-man. You talk to the compiler in a language it understands, C source code, and the compiler translates the source into machine code to save you a lot of painstaking, tedious work writing assembly code.

If the compiler finds your source code confusing, it will throw an error along with a message to help you fix up your source code and clear up any confusion. You will then need to try to recompile the code and repeat the process until it compiles without error. Note that code that compiles without error doesn't mean it's free of bugs. It just means the compiler understands the instructions provided by your source code.

Unix-like
If you are using a Unix(-like) system, such as GNU/Linux, Mac OS X, or Solaris, it will probably have GCC installed, otherwise on Linux you can install it using the package manager of your distribution. Open the virtual console or a terminal emulator and enter the following (be certain your current working directory is the one containing your source code):

gcc hello.c

By default gcc will generate our executable binary with the name a.out. To run your new generated program type:

./a.out

You should see  printed after the last prompt.

To see the exit status of the last program you ran, type on your shell command:

echo $?

This shows the value the  function has returned, which is 0 in the above example.

There are a lot of options you can use with the gcc compiler. For example, if you want the output to have a name other than a.out, you can use the -o option. The following shows a few examples:

 * : indicates that the next parameter is the name of the resulting program (or library). If this option is not specified, the compiled program will, for historic reasons, end up in a file called "a.out" or "a.exe" (for cygwin users).

 * : indicates that gcc should warn about many types of suspicious code that are likely to be incorrect.

You can use these options to create a program called "helloworld" instead of "a.out" by typing:

gcc -o helloworld hello.c -Wall

Now you can run it by typing:

./helloworld

All the options are well documented in the manual for GCC.

On IDEs
If you are using an IDE you may have to select console project, and to compile you just select build from the menu or the toolbar. The executable will appear inside the project folder, but you should have a menu button so you can just run the executable from the IDE. The process is roughly the same on all IDEs.

title: C Programming/Intro exercise


text:
Chess/Puzzles/Directmates/Two-move 6

Starting from the following position, white starts and wins in two moves.

Authored by V. Lashmanov.

/Solution/

title: Chess/Puzzles/Directmates/Two-move 6


text:
Chess/Puzzles/Directmates/Two-move 6/Solution

1. Qd6!

''If 1... b4 then 2.Qa6#''

''If 1... Ka4 then 2.Qa3#''


text:
Chess/Puzzles/Directmates/Three-move 1/Solution

1.e7 Kc7

1... Kb5 leads to 2.e8Q+ and 3.Qea4#

2.e8B! Kc8 (2.e8Q?? would stalemate the black king.)

3.Qd7#


text:
Chess/Puzzles/Directmates/Three-move 2/Solution

1.Kc4! Ka7

2.Qc7! Ka6

3.b8N#!


text:
Radiation Oncology/Head & Neck/Hypopharynx

Hypopharynx Cancer

Epidemiology

 * 2,500-3,000 annual cases in US
 * Pyriform sinus most common (65-75%), posterior pharyngeal wall 10-20%, postcricoid region 5-15%
 * Majority (>80%) present with Stage III-IV disease
 * Highly associated with tobacco use; EtOH impact not as clear (per Perez, 5th ed). Also occupational exposure to dust, iron compounds, fumes
 * HPV associated in 20-25%, clinical implications not yet clear
 * May arise in the setting of Plummer-Vinson syndrome, characterized by iron deficiency anemia, hypopharyngeal webs, weight loss, and dysphagia

Anatomy

 * Extent
 * Superior extent - level of superior border of hyoid bone / floor of valecula
 * Inferior extent - level of lower border of cricoid cartilage
 * Anterior extent - connection of the two pyriform sinuses at post cricoid region.
 * Posterior extent - posterior pharyngeal wall

 * Subsites
 * Bilateral pyriform sinuses
 * Extends from pharyngoepiglottic fold to upper end of esophagus, at the lower border of cricoid cartilages
 * Superiorly are surrounded by thyrohyoid membrane, through which passes the internal branch of superior laryngeal nerves. Tumor involvement can result in referred otalgia
 * Postcricoid region
 * Mucosa overlying cricoid cartilage. Arytenoids and AE folds form the superior border. Esophageal mucosa forms the inferior border
 * Posterior pharyngeal wall
 * Squamous mucosa covering middle/inferior pharyngeal constrictor muscles, typically <1 cm thinck

Nodal Drainage

 * Rich lymphatic network draining through thyrohyoid membrane into jugulodigastric LNs; there may also be direct drainage to spinal accessory LNs
 * Typical primary drainage for posterior pharyngeal wall: Level II and III, typically below jugulodigastric LN
 * Surgical reports show direct drainage to lateral retropharyngeal LNs, bypassing jugulodigastric LNs
 * Case report from Dana Farber shows involvement of retropharyngeal LNs at base of skull
 * >50% present with clinically positive LNs

 * Dana Farber, 2007 PMID 17290070 -- "Retropharyngeal nodes in hypopharynx cancer on positron emission tomography." (Allen AM, J Clin Oncol. 2007 Feb 10;25(5):599-601.)
 * Case report. Hypopharynx T2N1 (2.5cm right jugulodigastric LN)
 * PET/CT: Additionally bilateral lateral retropharyngeal nodes (nodes of Rouviere) positive. Patient upstaged to Stage IV (T2N2c)
 * Conclusion: recommend including lateral retropharyngeal LNs to base of skull in IMRT volumes

Staging
AJCC 7th Edition (2009) Primary Tumor
 * T1 - one subsite of hypopharynx and <= 2 cm
 * ''AJCC Subsites: left/right pyriform sinus, left/right lateral hypopharyngeal wall, posterior hypopharyngeal wall, postcricoid region

 * T2 - more than one subsite of hypopharynx or adjacent site, or >2 but <=4 cm
 * T3 - >4 cm, or fixation of hemilarynx or extension to esophagus
 * T4a - invades thyroid or cricoid cartilage, hyoid, thyroid gland, central compartment soft tissue (e.g, strap muscles, subcutaneous fat)
 * T4b - invades prevertebral fascia, encases carotid, involves mediastinum

Note: T4a and T4b are the same as for larynx (glottic, subglottic, and supraglottic)

Regional Lymph Nodes

Distant Metastasis
 * MX - Cannot be assessed
 * M0 - No distant metastasis
 * M1 - Distant metastasis

Clinical Stage
 * Stage 0 - Tis N0 M0
 * Stage I - T1 N0
 * Stage II - T2 N0
 * Stage III - T3 or N1
 * Stage IVA - T4a or N2
 * Stage IVB - T4b or N3
 * Stage IVC - M1

Changes from 6th edition: Extension to esophagus is now T3 instead of T4a.

Older staging systems
AJCC 6th Edition (2002) Primary Tumor
 * T1 - one subsite of hypopharynx and <= 2 cm
 * ''AJCC Subsites: left/right pyriform sinus, left/right lateral hypopharyngeal wall, posterior hypopharyngeal wall, postcricoid region

 * T2 - more than one subsite of hypopharynx or adjacent site, or >2 but <=4 cm
 * T3 - >4 cm, or fixation of hemilarynx
 * T4a - invades thyroid or cricoid cartilage, hyoid, thyroid gland, esophagus, central compartment soft tissue (e.g, strap muscles, subcutaneous fat)
 * T4b - invades prevertebral fascia, encases carotid, involves mediastinum

Note: T4a and T4b are the same as for larynx (glottic, subglottic, and supraglottic)

Regional Lymph Nodes

Distant Metastasis
 * MX - Cannot be assessed
 * M0 - No distant metastasis
 * M1 - Distant metastasis

Clinical Stage
 * Stage 0 - Tis N0 M0
 * Stage I - T1 N0
 * Stage II - T2 N0
 * Stage III - T3 or N1
 * Stage IVA - T4a or N2
 * Stage IVB - T4b or N3
 * Stage IVC - M1

Treatment

 * Memorial Sloan Kettering; 2007 PMID 17493769 -- "Concurrent chemotherapy and intensity-modulated radiotherapy for locoregionally advanced laryngeal and hypopharyngeal cancers." (Lee NY, Int J Radiat Oncol Biol Phys. 2007 Oct 1;69(2):459-68. Epub 2007 May 9.)
 * Retrospective. 20 larynx and 11 hypopharynx patients, treated with IMRT and concurrent platinum-based chemo. Most Stage IV disease. RT dose painting GTV 70 Gy (@2.12 Gy/fx), high-risk CTV 59.4 Gy (@1.8 Gy/fx, typically Levels II-IV; Levels I or V not routinely contoured unless judged high risk eg positive Level II), low-risk CTV 54 Gy (@1.64 Gy/fx, uninvolved contralateral neck and base of skull). Chemo cisplatin 100 mg/m2 Q3W or carbo 60-70 mg/m2 + 5-FU 600 mg/m2. Median F/U 2.2 years
 * Outcome: 2-year LC 86%, RC 94%, laryngectomy-free 89%, DM-free 92%, OS 63%.
 * Toxicity: No late G2+ xerostomia. PEG-dependent hypopharynx 31% vs. larynx 15%
 * Conclusion: IMRT + chemo encouraging LR control in advanced larynx/hypopharynx. However, high rate of PEG dependency

 * Kyushu, 2005 (Japan) PMID 15936545 -- "Chemoradiation therapy with or without salvage surgery for early squamous cell carcinoma of the hypopharynx." (Nakamura K, Int J Radiat Oncol Biol Phys. 2005)
 * 43 patients with Stage I/II: 30-40 Gy +/- chemo, if complete response (75%), RT to 61.2 Gy
 * 5-year OS 70.4%, DSS 89.5%
 * Conclusion: Majority of patients with early hypopharyngeal cancer was curable. However, second malignancies influenced the overall outcome of patients with early hypopharyngeal cancer.

Pre-op RT vs. Post-op RT

 * RTOG 73-03 (1973-1979)
 * Randomized. 320 patients. Operable stage T2-T4 any N (but not fixed); oral cavity, oropharynx, supraglottic larynx, hypopharynx, or maxillary sinus. Arm 1) Pre-op RT 50 Gy vs. Arm 2) Post-op RT 60 Gy. In addition, OC and OP lesions may be randomized Arm 3) definitive RT 65-70 Gy, with surgery reserved for salvage (n=43).
 * 10-years; 1999 PMID 1993628 — "Randomized study of preoperative versus postoperative radiation therapy in advanced head and neck carcinoma: long-term follow-up of RTOG study 73-03." (Tupchong L et al. Int J Radiat Oncol Biol Phys. 1991 Jan;20(1):21-8.)
 * Only pre-op vs. post-op subset (n=277). Oral cavity (14%), oropharynx (17%), hypopharynx (43%), supraglottic larynx (26%)
 * Outcome: LRC pre-op 58% vs. post-op 70% (SS), <2 years no difference (failures 59% vs. 58%), but marked >2 years (failures 27% vs 8%); OS no difference due to late (>2 years) deaths from DM and from second primaries
 * Toxicity: no difference
 * Conclusion: Post-op RT better for LRC (especially in SGL), but no impact on OS due to distant failure and second primaries
 * Comment: some argument for definitive chemoRT instead of surgery and post-op RT since after 2 yrs, distant mets are primary cause of failure resulting in similar 10 OS in this trial. LRC still better for post-op vs definitive RT alone. Also, different doses used, at the time believed equivalent given the setting

Induction Chemo-RT vs. Primary RT alone

 * RTOG 68-01
 * Randomized. 638 patients, Stage III-IV oral cavity (23%), oropharynx (55%), supraglottic larynx (12%), hypopharynx (10%) . Arm 1) RT alone vs. Arm 2) IV MTX 25 mg q3d x5 followed by RT. RT 55-80 Gy
 * 1980 PMID 7410127 -- "Adjuvant intravenous methotrexate or definitive radiotherapy alone for advanced squamous cancers of the oral cavity, oropharynx, supraglottic larynx or hypopharynx." (Fazekas JT, Int J Radiat Oncol Biol Phys. 1980 May;6(5):533-41.)
 * Outcome: median OS RT vs. MTX-RT: oral cavity 11.8 mo vs. 12.4 mo, oropharynx 13.6 mo vs. 13.1 mo, SGL 17.2 mo vs. 19.2 mo, hypopharynx 9.7 mo vs. 13.4 mo
 * Conclusion: Minimal gain, induction methotrexate should not be used

Laryngectomy + RT vs. Chemo-RT

 * EORTC 24891 (1990-1993) - Surgery + post-op RT vs Induction cisplatin/5-FU + RT
 * Randomized. 194/202 patients. Operable SCC of the pyriform sinus or AE fold, Stage T2-T4 N0-N2b, N3 (N2c initially allowed, stopped in 1992). Arm 1) Immediate surgery + post-op RT 50-70 Gy vs. Arm 2) Induction cisplatin 100 mg/m2 + 5-FU 1000 mg/m2 x2 cycles. If CR, then RT 70 Gy. If PR, then cisplatin/5-FU x another cycle. If CR, then RT 70 Gy. If PR, or PD anytime, then surgery. RT given 50 Gy bilateral neck + 20 Gy boost to tumor/palpable LNs. Surgery was total laryngectomy with partial pharyngectomy to allow primary closure
 * 4-years; 1996 PMID 8656441 — "Larynx preservation in pyriform sinus cancer: preliminary results of a European Organization for Research and Treatment of Cancer phase III trial. EORTC Head and Neck Cancer Cooperative Group." Lefebvre JL et al. J Natl Cancer Inst. 1996 Jul 3;88(13):890-9.) Median F/U 4.25 years
 * Outcome: median OS surgery 2.1 years vs. chemo-RT 3.7 years (equivalent). Larynx preservation 3-years 42%, 5-years 35%. LF 12% vs. 17%, RF 19% vs. 23%
 * Conclusion: Larynx-preserving strategy is feasible, induction chemo followed by RT is new standard treatment for EORTC.
 * 10-years; 2004 ASCO Abstract -- "Is laryngeal preservation (LP) with induction chemotherapy (ICT) safe in the treatment of hypopharyngeal SCC? Final results of the phase III EORTC 24891 trial." (Lefebvre JL, Journal of Clinical Oncology, 2004 ASCO Annual Meeting Proceedings (Post-Meeting Edition). Vol 22, No 14S (July 15 Supplement), 2004: 5531) Median F/U 10 years
 * Outcome: 5-year OS surgery 33% vs. chemo-RT 38%; 10-year OS 14% vs. 13%. 5-year PFS 26% vs. 32%. Larynx preservation 5-years 22% (58% survivors), 10-years 9% (69% survivors)
 * Conclusion: Similar survival curves with larynx preservation as with conventional total laryngectomy, with 2/3 survivors retaining their larynx

Primary Chemo-RT Timing Strategies

 * France (2001-2005) -- Induction chemo-RT vs. concurrent chemo-RT
 * Randomized. 75 patients, T3 pyriform sinus (N0-N3). 4 centers. Arm 1) concurrent chemo-RT. Chemo cisplatin 100 mg/m2 Q3W, RT 70 Gy vs. Arm 2) induction chemo cisplatin 100 mg/m2 + 5-FU 100 mg/m2 x2 courses. If CR/PR >80%, RT 70 Gy, else total laryngectomy
 * 2009 PMID 19449227 -- "Randomized phase III trial comparing induction chemotherapy followed by radiotherapy to concomitant chemoradiotherapy for laryngeal preservation in T3M0 pyriform sinus carcinoma." (Prades JM, Acta Otolaryngol. 2009 May 15:1-6.) Median F/U 2 years
 * Outcome: 2-year laryngeal preservation concurrent 92% vs induction 68% (SS). Local control 81% vs. 62%. Distant mets 19% vs 38%. EFS 36% vs. 41% (NS). 2-year OS 47% vs. 51% (NS)
 * Toxicity: any toxicity 76% vs 71%
 * Conclusion: Concurrent chemo-RT superior to sequential chemo-RT

 * EORTC 24954 (1996-2004) -- Sequential chemo-RT vs. alternating chemo-RT
 * Randomized. 450 patients. Larynx T2-T4 N0-N2 (21% by AJCC staging) or Hypopharynx T2-T4 N0-N2 (79% by AJCC staging), surgical candidates for total laryngectomy not requiring flap closure. Excluded if candidates for partial laryngectomy. Arm 1) Sequential chemo->RT. Induction cisplatin 100 mg/m2 + 5-FU 1000 mg/m2 x4 cycles followed by RT 70 Gy; if stable/progression on chemo, total laryngectomy vs Arm 2) Alternating chemo->RT. Cisplatin 20 mg/m2 + 5-FU 200 mg/m2 x1 week -> RT 20 Gy -> cisplatin/5-FU x1 week -> RT 20 Gy -> cisplatin/5-FU x1 week (based on prior Italian randomized data)
 * 6-years; 2009 PMID 19176454 -- "Phase 3 Randomized Trial on Larynx Preservation Comparing Sequential vs Alternating Chemotherapy and Radiotherapy." (Lefebvre JL, J Natl Cancer Inst. 2009 Jan 27. [Epub ahead of print]) Median F/U 6.5 years
 * Outcome: Larynx preservation sequential 1.6 years vs. 2.3 years (NS); 5-year larynx preservation 30% vs. 36% (NS). Median OS sequential 4.4 years vs. alternating 5.1 years (NS); median PFS 3.0 vs 3.1 years (NS). DSS ~50%. Salvage surgery sequential 30% vs. alternating 22%. No difference in patterns of relapse
 * Toxicity: Grade 3-4 mucositis sequential 32% vs. alternating 21%; late fibrosis 16% vs. 11%
 * Conclusion: Both strategies valid for larynx preservation
 * Editorial (PMID 19176460): larynx preservation defined as survival with larynx without tumor, tracheotomy or use of feeding tube, which gives these states equal utility as death; other issues with endpoints used for larynx preservation. Need a common standardized endpoint


text:
Chess/Puzzles/Directmates/Three-move 3/Solution

1.Bb5! Kf7

1... Kd8 leads to 2.Qd6 Kc8 3.Ba6#

2.Kg5 Ke7

2... Kg8 leads to 3.Bc4#

3.Qf6#


text:
C Programming/Language overloading and extensions

Most C compilers have one or more "extensions" to the standard C language, to do things that are inconvenient to do in standard, portable C.

Some examples of language extensions:

 * in-line assembly language
 * interrupt service routines
 * variable-length data structure (a structure whose last item is a "zero-length array").
 * re-sizeable multidimensional arrays
 * various "#pragma" settings to compile quickly, to generate fast code, or to generate compact code.
 * bit manipulation, especially bit-rotations and things involving the "carry" bit
 * storage alignment
 * Arrays whose length is computed at run time.


text:
C Programming/Mixing languages

Assembler
See Embedded Systems/Mixed C and Assembly Programming

Cg
Make the main program (for CPU) in C, which loads and run the Cg program ( for GPU ).

Header files
Add to C program:

Minimal program

 * by bobobobo

Java
Using the Java native interface (JNI), Java applications can call C libraries.

See also
 * Java_Programming/Keywords/native

Perl
To mix Perl and C, we can use XS. XS is an interface description file format used to create an extension interface between Perl and C code (or a C library) which one wishes to use with Perl.

The basic procedure is very simple. We can create the necessary subdirectory structure by running "h2xs" application (e.g. "h2xs -A -n Modulename"). This will create - among others - a Makefile.PL, a .pm Perl module and a .xs XSUB file in the subdirectory tree. We can edit the .xs file by adding our code to that, let's say: void hello CODE: printf("Hello, world!\n"); and we can successfully use our new command at Perl side, after running a "perl Makefile.PL" and "make".

Further details can be found on the perlxstut perldoc page.

Python
Here can be found some details about extending Python with modules written in C. You might read about Cython and Pyrex as well, that makes easier to create modules in C, translating a Python-like code into C.

Using the Python ctypes module, one can write C code directly into Python.

title: C Programming/Mixing languages


text:
C Programming/Code library

The following is an implementation of the Standard C99 version of :

title: C Programming/Code library


text:
User:Man-hi~enwikibooks

X-Plane, flight sim and aviation enthusiast.

FAA CFI, SEL&S, MEL, IFR, Taildragger, Floats. Student Helo.

title: User:Man-hi~enwikibooks


text:
C Programming/Why learn C?

C is the most commonly used programming language for writing operating systems. The first operating system written in C was Unix. Later operating systems like GNU/Linux were all written in C. Not only is C the language of operating systems, it is the precursor and inspiration for almost all of the most popular high-level languages available today. In fact, Perl, PHP, Python and Ruby are all written in C.

By way of analogy, let's say that you were going to be learning Spanish, Italian, French, or Romanian. Do you think knowing Latin would be helpful? Just as Latin was the basis of all of those languages, knowing C will enable you to understand and appreciate an entire family of programming languages built upon the traditions of C. Knowledge of C enables freedom.

Why C and not assembly?
The biggest reason to learn C over assembly is because it's much easier and faster to write code in C than in assembly for a given programming task. With C, you will write far fewer lines of code, complete the job much quicker, and with far less mental effort than if you wrote it in assembly. And with today's modern compilers, an executable file compiled from C source code will typically run faster than one written "by hand" using assembly. Only in rare edge cases, and only if you really know what you are doing, can assembly offer important speed advantages over C code compiled with a decent compiler.

And with C, you do not have to sacrifice a lot of low level control over how your code is executed. A typical C statement translates into just a few assembly instructions. But C also provides you with a large software library to help you execute low-level tasks that you'd rather not be bothered programming.

Another huge advantage of C is portability. Different processors have different instruction sets. Having to rewrite and maintain assembly code for each computer architecture you wish to execute your code on is an onerous task. And so one of the main strengths of C is that it combines universality and portability across various computer architectures while still giving you the same kind of low level hardware control you get with assembly. This means you can write your C source code once and easily compile it into binaries for use on a wide variety of machines.

For example, C programs can be compiled and run on the HP 50g calculator (ARM processor), the TI-89 calculator (68000 processor), Palm OS Cobalt smartphones (ARM processor), the original iMac (PowerPC), the Arduino (Atmel AVR), and the Intel iMac (Intel Core 2 Duo). Each of these devices has its own assembly that is completely incompatible with the assembly  of any other. C makes it possible to run your code on these machines with much less effort.

So is it any wonder that C is such a popular language?

Like toppling dominoes, the next generation of programs follows the trend of its ancestors. Operating systems designed in C always have system libraries designed in C. Those system libraries are in turn used to create higher-level libraries (like OpenGL, or GTK), and the designers of those libraries often decide to use the language the system libraries used. Application developers use the higher-level libraries to design word processors, games, media players and the like. Many of them will choose to program in the language that the higher-level library uses. And the pattern continues on and on and on...

That said, learning assembly can be fun and worthwhile because it can give you a deep understanding of how your computer works at very low levels. And learning assembly will definitely help you become a more skilled C programmer. So, by all means, we encourage you learn assembly, but when it comes time to do real work, you'll definitely want to get it done with C.

Why C, and not another language?
The primary design of C is to produce portable code while maintaining performance and minimizing footprint (CPU time, memory usage, disk I/O, etc.). This is useful for operating systems, embedded systems or other programs where performance matters a lot (“high-level” interface would affect performance). With C it’s relatively easy to keep a mental picture of what a given line really does, because most of the things are written explicitly in the code. C has a big codebase for low level applications. It is the “native” language of UNIX, which makes it flexible and portable. It is a stable and mature language which is unlikely to disappear for a long time and has been ported to most, if not all, platforms.

One powerful reason is memory allocation. Unlike most programming languages, C allows the programmer to write directly to memory. Key constructs in C such as structs, pointers and arrays are designed to structure and manipulate memory in an efficient, machine-independent fashion. In particular, C gives control over the memory layout of data structures. Moreover dynamic memory allocation is under the control of the programmer (which also means that memory deallocation has to be done by the programmer). Languages like Java and Perl shield the programmer from having to manage most details of memory allocation and pointers (except for memory leaks and some other forms of excess memory usage). This can be useful since dealing with memory allocation when building a high-level program is a highly error-prone process. However, when dealing with low-level code such as the part of the OS that controls a device, C provides a uniform, clean interface. These capabilities just do not exist in most other languages.

While Perl, PHP, Python and Ruby may be powerful and support many features not provided by default in C, they are not normally implemented in their own language. Rather, most such languages initially relied on being written in C (or another high-performance programming language), and would require their implementation be ported to a new platform before they can be used.

As with all programming languages, whether you want to choose C over another high-level language is a matter of opinion and both technical and business requirements could dictate which language is required.

title: C Programming/Why learn C?


text:
User:Evil Monkey/monobook.css

/* make a few corners round, only supported by moz/firefox/other gecko browsers for now */ -moz-border-radius-topleft: 1em; -moz-border-radius-topright: 1em; } -moz-border-radius-topleft: 1em; -moz-border-radius-bottomleft: 1em; } div.pBody { -moz-border-radius-topright: 1em; -moz-border-radius-bottomright: 1em; }
 * 1) p-cactions ul li, #p-cactions ul li a {
 * 1) content {

/* Get rid of the stupid arrow after external links (only for http for the time being) */ background:inherit !important; padding-right:inherit !important; } /* suppress the person icon by your username */ li#pt-userpage { background: none; }
 * 1) bodyContent a[href ^="http://"] {

/* remove the ugly, recently-reinstated link underlines
 * 1) BodyContent a { text-decoration: none; }
 * 2) BodyContent a:hover { text-decoration: none; }*/

a { text-decoration: none;} a:hover { text-decoration: none;}

/* Dotted borders on pre look ugly, replace with a solid one */ border: 1px solid #aaa; } /* Dont need this copyright notice on every page */
 * 1) bodyContent pre {

/*li#f-copyright, li#f-lastmod,
 * 1) editpage-copywarn { display: none; }*/

/*   adapted from fr: like it because of the navigation and rounded tabs

 * 1) content { background : #F8FCFF; } // bleu ciel
 * 2) p-cactions li { background : #F8FCFF; }
 * 3) p-cactions li a { background : #F8FCFF; }

.ns-0 * #content { background : white; } .ns-0 * #p-cactions li { background : white; } .ns-0 * #p-cactions li a { background : white; }

.ns-1 * #content { background : #FFFFEE; } .ns-1 * #p-cactions li { background : #FFFFEE; } .ns-1 * #p-cactions li a { background : #FFFFEE; }

.ns-2 * #content { background : white; } .ns-2 * #p-cactions li { background : white; } .ns-2 * #p-cactions li a { background : white; }

.ns-3 * #content { background : #FFFFEE; } .ns-3 * #p-cactions li { background : #FFFFEE; } .ns-3 * #p-cactions li a { background : #FFFFEE; }

.ns-4 * #content { background : #F4F4F4; } .ns-4 * #p-cactions li { background : #F4F4F4; } .ns-4 * #p-cactions li a { background : #F4F4F4; }

.ns-5 * #content { background : #FFFFEE; } .ns-5 * #p-cactions li { background : #FFFFEE; } .ns-5 * #p-cactions li a { background : #FFFFEE; }

.ns-7 * #content { background : #FFFFEE; } .ns-7 * #p-cactions li { background : #FFFFEE; } .ns-7 * #p-cactions li a { background : #FFFFEE; }

.ns-8 * #content { background : #EEEEFF; } .ns-8 * #p-cactions li { background : #EEEEFF; } .ns-8 * #p-cactions li a { background : #EEEEFF; }

.ns-9 * #content { background : #FFFFEE; } .ns-9 * #p-cactions li { background : #FFFFEE; } .ns-9 * #p-cactions li a { background : #FFFFEE; }

.ns-11 * #content { background : #FFFFEE; } .ns-11 * #p-cactions li { background : #FFFFEE; } .ns-11 * #p-cactions li a { background : #FFFFEE; }

.ns-12 * #content { background : #FFEEEE; } .ns-12 * #p-cactions li { background : #FFEEEE; } .ns-12 * #p-cactions li a { background : #FFEEEE; }

.ns-13 * #content { background : #FFEEEE; } .ns-13 * #p-cactions li { background : #FFEEEE; } .ns-13 * #p-cactions li a { background : #FFEEEE; }

.ns-15 * #content { background : #FFFFEE; } .ns-15 * #p-cactions li { background : #FFFFEE; } .ns-15 * #p-cactions li a { background : #FFFFEE; }

/* '0': 'article', '2': 'user', '4': 'wikipedia', '6': 'image', '8': 'mediawiki', '10':  '??', '12':   '??', '14':   'category'

.pBody {  padding: 0.3em 0.1em; -moz-border-radius-topright: 0.5em; } .portlet h5 { background-color: #e0e3e6; border: thin solid silver; -moz-border-radius-topright: 0.5em; } {   -moz-border-radius-topright: 0.5em; -moz-border-radius-topleft: 0.5em; }
 * 1) p-cactions ul li, #p-cactions ul li a

div.egy_calendrier#cadre {       border:1px solid #CCCC99; background: #FFFFFF; text-align: center; font-size: smaller; }

div.egy_calendrier#lien {       background: #CCCC99; padding: 0.2em; }

div.egy_calendrier#saison { }

div.egy_calendrier#mois { }

div.egy_calendrier#jour {       font-size: medium; }

table.egyleft {   float: right; margin: 0.5em 0.5em 1em 1em; border: 1px solid #ccccaa; background: #efefdd; text-align: center; width: 170px; }

/* * Divers */

.exposant { vertical-align: text-top; }

div.floatleft, table.floatleft {   float: left; position: relative; margin: 0, 0.5em, 0.5em, 0; border: 0; } div.floatright, table.floatright {   clear: right; float: right; position: relative; margin: 0, 0, 0.5em, 0.5em; border: 0; }

div.alerte#style2 { padding:0.5em; background:#FFFFDD; }

div.alerte#style1 { padding:0.5em; } div.alerte#style3 { padding:0.5em; border:solid 1px #808080; background:#F0F0F0; } div.alerte#style4 { padding:0.5em; background-color:#f7f8ff; border:1px solid #8888aa; border-right-width:2px; border-bottom-width:2px; } div.alerte#style5 { padding:0.5em; border: 1px red dashed; } div.alerte#style6 { padding:0.5em; background: peachpuff; border: 1px solid #cdcdcd; } div.alerte#style7 { padding:0.5em; border:dotted 1mm red; } div.alerte#style8 { padding:0.5em; border:dotted 1mm red; background:yellow; } div.alerte#style9 { padding:0.5em; background:#f0f0ff; }

//body.ns-0 div#p-logo a { background-image: url(/upload/7/7e/Wiki_original.png) !important; }

div.BoxenVerschmelzen, div.NavFrame { margin:0px; padding:2px; border:1px solid #AAAAAA; text-align:center; border-collapse:collapse; font-size:95%; }

div.BoxenVerschmelzen div.NavFrame { border-style:none; border-style:hidden; }

div.NavFrame + div.NavFrame { border-top-style:none; border-top-style:hidden; }

div.NavPic { background-color:#FFFFFF; margin:0px; padding:2px; float:left; }

div.NavFrame div.NavHead { height:1.6em; font-weight:bold; font-size:100%; background-color:#EFEFEF; }

div.NavFrame p { font-size:100%; }

div.NavFrame div.NavContent { font-size:100%; }

div.NavFrame div.NavContent p { font-size:100%; }

div.NavEnd { margin:0px; padding:0px; line-height:1px; clear:both; }

div.PointCarte {  position:absolute; width:1px; height:1px; background:#000000; border: 1px solid #FFFFFF; }

.j11, .j1er1, .j22, .j33, .j44, .j55, .j66, .j77, .j88, .j99, .j1010, .j1111, .j1212, .j1313, .j1414, .j1515, .j1616, .j1717, .j1818, .j1919, .j2020, .j2121, .j2222, .j2323, .j2424, .j2525, .j2626, .j2727, .j2828, .j2929, .j3030, .j3131 {  background: #d7ecff !important }

.avance_boite {  width: 100px; background-color: lightgray; border: solid 1px gray; } .avance_barre {  background-color: #A0A0FF; text-align: right; font-size: 100%; font-weight: bold; }

/* Style boîte login */ form#userlogin { padding: 1em 1em .7em 1em; background-color: #ffffe6; border: 2px solid #fc6; color: #000; margin-right: 2em; }

form#userlogin table { background-color: #ffffe6; color: #000; }

/* Standard Navigationsleisten */

div.BoxenVerschmelzen, div.NavFrame { margin: 0px; padding: 2px; border: 1px solid #aaaaaa; text-align: center; border-collapse: collapse; font-size: 95%; } div.BoxenVerschmelzen div.NavFrame { border-style: none; border-style: hidden; } div.NavFrame + div.NavFrame { border-top-style: none; border-top-style: hidden; } div.NavPic { background-color: #ffffff; margin: 0px; padding: 2px; float: left; } div.NavFrame div.NavHead { height: 1.6em; font-weight: bold; font-size: 100%; background-color: #efefef; } div.NavFrame p { font-size: 100%; } div.NavFrame div.NavContent { font-size: 100%; } div.NavFrame div.NavContent p { font-size: 100%; } div.NavEnd { margin: 0px; padding: 0px; line-height: 1px; clear: both; }

.NavToggle {

font-size: x-small; float:right;

}

/*

title: User:Evil Monkey/monobook.css


text:
File:Heat Capacity vs Temperature.png

This file was created by Frontier. It shows how heat capacity is not constant but changes with temperature.

title: File:Heat Capacity vs Temperature.png


text:
User talk:68.64.220.69

Hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * Remember to conduct any editing experiments in the sandbox.
 * Check out our help page if you need additional help.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 09:18, 24 Jun 2005 (UTC)

title: User talk:68.64.220.69


text:
User talk:82.143.134.41

Hello and welcome to Wikibooks!

Here are some tips to help you get started:

 * Remember to conduct any editing experiments in the sandbox.
 * Check out our help page if you need additional help.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

Good luck!

(Donovan|Geocachernemesis|Interact) 09:21, 24 Jun 2005 (UTC)

title: User talk:82.143.134.41


text:
Radiation Oncology/Kidney

Epidemiology
Less than 3% of all malignancies. 36,000 cases/yr in 2005. 12,660 deaths. 80% have localized disease at presentation. Renal cell carcinoma makes up 85% of kidney cancer. 25% present with advanced disease.

Pathology
Adenocarcinoma. Conventional (clear cell) renal carcinoma - 80%. Papillary renal carcinoma - 12%. Others: chromophobe -4%, oncocytoma (benign), collecting duct, unclassified.

Papillary has 5-yr OS of 90%, 5:1 male predominance. Metastasizes less frequently than does clear cell.

Oncocytomas are benign, but often a kidney is resected for suspected RCC. Collecting duct RCC is aggressive.

VHL gene mutation in 60% of sporadic clear cell RCC.

Syndromes

 * Von-Hippel Lindau disease (retinal angiomas, CNS hemangioblastoma, pheochromocytoma, clear cell renal carcinoma) -- see Radiation Oncology:Cancer Syndromes.

Staging
AJCC 7th Edition (2009) Primary Tumor:
 * T1 - 7 cm or less, limited to the kidney
 * T1a - 4 cm or less
 * T1b - 4-7 cm
 * T2 - > 7 cm, limited to the kidney
 * T2a - >7 but ≤10 cm
 * T2b - >10 cm
 * T3 - extends into major veins or perinephric tissues but not into ipsilateral adrenal gland and not beyond Gerota's fascia
 * T3a - extends into renal vein or invades perirenal and/or renal sinus fat but not beyond Gerota's fascia
 * T3b - extends into the vena cava below the diaphragm
 * T3c - extends into vena cava above the diaphragm or invades the wall of the vena cava
 * T4 - invades beyond Gerota's fascia (including contiguous extension into the adrenal gland)

Regional Lymph Nodes:
 * Regional nodes - renal hilum, caval (para/pre/retrocaval), interaortocaval, aortic (para/pre/retroaortic)

 * N0 - no
 * N1 - yes

Distant Metastases:
 * M0 - no distant mets
 * M1 - distant mets

Stage Grouping:
 * I - T1 N0
 * II - T2 N0
 * III - T3 or N1
 * IV - T4 or M1

Changes from 6th Edition:
 * Subdivided T2 into T2a and T2b based on size
 * Invasion of adrenal moved to T4 (was T3)
 * Invasion of renal vein moved to T3a (was T3b)
 * N-stage is N0 or N1 instead of N0-2
 * Stage grouping remains essentially the same

Older staging systems
AJCC 6th Edition (2002) Primary Tumor:
 * T1 - 7 cm or less, limited to the kidney
 * T1a - 4 cm or less
 * T1b - 4-7 cm
 * T2 - > 7 cm, limited to the kidney
 * T3 - extends into major veins or invades adrenal gland or perinephric tissues but not beyond Gerota's fascia
 * T3a - invades adrenal gland or perirenal and/or renal sinus fat but not beyond Gerota's fascia
 * T3b - grossly extends into renal vein or its segmental branches, or the vena cava below the diaphragm
 * T3c - extends into vena cava above the diaphragm or invades the wall of the vena cava
 * T4 - invades beyond Gerota's fascia

Regional Lymph Nodes:
 * N0 - no nodal mets
 * N1 - single node
 * N2 - more than one node

Distant Metastases:
 * M0 - no distant mets
 * M1 - distant mets

Stage Grouping:
 * I - T1 N0
 * II - T2 N0
 * III - T3 or N1
 * IV - T4 or N2 or M1

Treatment
Standard treatment for nonmetastatic RCC is complete resection of the tumor by either a radical or partial nephrectomy. Adjuvant therapy is not standard.

Prognosis
30% of pts will relapse after surgery. Response rates for metastatic RCC are poor, only 15-25%.

Adverse prognostic factors:
 * nodal and venous involvement (Memorial Sloan Kettering) - PMID 8270978

Relapse according to stage (including median time to relapse):
 * Levy, M.D.Anderson - PMID 9507823
 * T1 - 7%, 38 months
 * T3 - 40%, 17 months
 * especially poor prognosis for T3 with venous invasion

Nomograms

 * Memorial Sloan Kettering
 * nomogram link
 * 2001 PMID 11435824 -- "A postoperative prognostic nomogram for renal cell carcinoma." (Kattan MW, J Urol. 2001 Jul;166(1):63-7.)

Survival
5-yr survival:
 * Stage I - 95%
 * Stage II - 88%
 * Stage III - 59%
 * Stage IV - 20%; median 13 months

 * 2000 PMID 10737472 -- "Prognostic indicators for renal cell carcinoma: a multivariate analysis of 643 patients using the revised 1997 TNM staging criteria." (Tsui KH, J Urol 2000 Apr;163(4):1090-5.)

Neoadjuvant approach

 * Preoperative embolization of the renal artery
 * PMID 10683065 (Zielinksi H et al 2000)
 * Retrospective. 474 pts. 118 had embolization. All had radical nephrectomy or radical nephrectomy with embolization.
 * 5 and 10-year OS 62% and 47% (embolization) vs 35% and 23% (surgery alone)

Adjuvant hormonal therapy and chemotherapy

 * medroxyprogesterone - similar relapse rate (PMID 2934557)
 * VAU (vinblastine, doxorubicin, UFT (tegafur-uracil)) - Japanese study. Retrospective. Improved survival. (PMID 1394804)

Immunotherapy

 * Interferon alpha and IL-2
 * Used with success in metastatic setting

 * ECOG Adjuvant Interferon Trial (PMID 12663707)
 * 294 pts. Randomized after surgery to 12 weeks IFN-alpha or observation.
 * Median f/u 10 years. No difference in recurrence or survival. Significant toxicities of treatment.

 * IL-2 - also failed to show a benefit in the adjuvant setting

Vaccines

 * Jocham et al. Lancet 2004
 * Cell lysates incubated with gamma-IFN/tocopherol acetate.
 * 558 pts. T2-3b N0/1. After nephrectomy, randomized to vaccine or observation.
 * Improvement in tumor progression rate, but only for T3 tumors.

Ongoing trials

 * Heat shock protein vaccines - induces a stronger immunogenic reponse than with tumor antigen alone
 * Thalidomide
 * Adoptive immunotherapy - passive transfer of immuno cells
 * LAK - lymphokine-activated killer cells
 * TIL - tumor-infiltrating lymphocytes

Meta-Analysis

 * Karachi; 2010 PMID 20139152 -- "Need for a new trial to evaluate postoperative radiotherapy in renal cell carcinoma: a meta-analysis of randomized controlled trials" (Tuni MA, Ann Oncol. 2010 Feb 5. [Epub ahead of print])
 * Meta-analysis. 7 RCT, 735 patients. Radical nephrectomy vs radical nephrectomy + post-op RT for localized RCC
 * Outcome: Significant reduction in locoregional failure; no difference in DFS or OS
 * Toxicity: Generally well tolerated
 * Conclusion: PORT significantly reduces LRF, without impact on DFS or OS. However, poor accrual and older RT techniques

Randomized

 * Copenhagen Renal Cancer Study Group, 1987 (1979-84) - PMID 3445125 — "A randomized trial of postoperative radiotherapy versus observation in stage II and III renal adenocarcinoma." Kjaer M et al. Scand J Urol Nephrol. 1987;21(4):285-9.
 * 72 pts. Stage II-III. After nephrectomy, randomized to RT vs observation. RT was 50 Gy in 20 fx to kidney bed, ipsilateral and contralateral nodes
 * No benefit for relapse rate or survival. Unacceptable toxicities from RT.

Radiobiology

 * Renal cell carcinoma cells were the most radiation-resistant cells among 694 cell lines (271 tumor-derived and 423 fibroblast-derived), with D = 4.8Gy (compared with for example melanoma D = 2.51Gy)
 * Paris, 1996 (France) PMID 12118559 -- "A review of human cell radiosensitivity in vitro." (Deschavanne PJ, Int J Radiat Oncol Biol Phys. 1996 Jan 1;34(1):251-66.)

Stereotactic Radiotherapy

 * Karolinska Sweden 1997-2003 PMID 15972239 -- Extracranial stereotactic radiotherapy for primary and metastatic renal cell carcinoma. (2005 Wersall PJ, Radiother Oncol. 2005 Oct;77(1):88-95.)
 * Retrospective. 58 patients treated with SRT (8 Gy x4, 10 Gy x4, or 15 Gy x3)
 * Response: 30% CR, 60% PR/SD; Local control 90-98%
 * Mild side effects
 * Conclusion : "Our use of SRT for patients with primary and metastatic RCC yielded a high local control rate with low toxicity. Patients with one to three metastases, local recurrences after nephrectomy or inoperable primary tumors benefited the most, i.e. had fewer distant recurrences (13/23) and longer survival times compared to patients with >3 metastases (24/27 recurrences)."

Brain Mets

 * ''Also please see the main brain metastases page

Epidemiology

 * Percentage of patients who develop brain mets: only 3-14% (but majority of these have multiple brain mets)
 * Majority of patients with brain mets also have active disease elsewhere, typically lung

 * Japan, 1995 (1981-1992) PMID 7637246 -- "[Clinical study of renal cell carcinoma with brain metastasis]" - [Article in Japanese] (Yonese J, Nippon Hinyokika Gakkai Zasshi. 1995 Jul;86(7):1287-93.)
 * Retrospective. 130 patients with renal cell CA, 10.6% developed brain mets (>90% of these had prior pulmonary mets)

 * 1981 PMID 7272969 -- "Distant metastasis of renal adenocarcinoma." (Saitoh H, Cancer. 1981 Sep 15;48(6):1487-91.)
 * Retrospective. 1451 autopsy cases. Brain mets ~10%

Whole Brain RT

 * WBRT results have historically been poor with standard fractionations, due to perceived radioresistance
 * But, median survival of MD Anderson cohort (4.4 months) is the same as median survival in RTOG RPA meta-analysis PMID 9128946 (4.4 months). The Cleveland Clinic cohort did worse, possibly since they had almost no RPA Class I patients (who were typically treated with WBRT + surgery or + SRS)
 * There may be benefit for patients with multiple brain mets and with RPA Class I

 * Germany, 2010 PMID 20488627 -- "Do Patients Receiving WBRT for Brain Metastases from RCC Benefit from Escalation of the Radiation Dose?" (Rades D, Int J Radiat Oncol Biol Phys. 2010 May 18.)
 * Retrospective analysis of 60 pts receiving 30/10 vs 40/20 or 45/15. Majority of pts were RPA Class 2-3 (13% RPA 1, 42% RPA 2, 45% RPA 3). 30/10 used in 31 pts; higher dose in 29 pt (23 pt treated with 40/20, 6 pt with 45/15).
 * 1 yr OS 13% vs 47% for low vs high dose (SS on MVA)
 * 1 yr local control 7% vs 35% for low vs high dose (trend p=0.06 on MVA)
 * Conclusion: Suggest escalation above 3 Gy x 10 improves outcomes in brain mets from RCC.

 * Cleveland Clinic, 2004(1983-2000) PMID 14697446 -- "Results of whole brain radiotherapy and recursive partitioning analysis in patients with brain metastases from renal cell carcinoma: a retrospective study." (Cannady SB, Int J Radiat Oncol Biol Phys. 2004 Jan 1;58(1):253-8.)
 * Retrospective. 46 patients with RCC treated with WBRT. Median RT 30/10. Median F/U 3 months
 * Median OS: 3 months. RPA I 8.5 months (but only 2 patients!) vs. RPA Class II 3 months vs. RPA Class III 0.6 months
 * RT: higher dose associated with better OS, but confounded by RPA
 * Conclusion: despite poor prognosis, there is benefit to WBRT over supportive care

 * MD Anderson
 * 1997 (1976-1993) PMID 9128947 -- "External radiation of brain metastases from renal carcinoma: a retrospective study of 119 patients from the M. D. Anderson Cancer Center." (Wronski M, Int J Radiat Oncol Biol Phys. 1997 Mar 1;37(4):753-9.)
 * Retrospective. 119 patients treated with WBRT only. Multiple tumors in 60%
 * Survival: median 4.4 months. (single met 4.4 months, multiple mets 3.0 months). 76% neurologic cause of death, 16% systemic progression
 * Conclusion: unsatisfactory results suggest more aggressive approaches
 * 1988 (1968-1985) PMID 2458823 -- "Palliative radiotherapy for brain metastases in renal carcinoma." (Maor MH, Cancer. 1988 Nov 1;62(9):1912-7.)
 * Retrospective. 46 patients with RCC brain mets. Mostly WBRT 30/10
 * Median survival: 8 weeks. 10 patients improved after WBRT, median OS 17 weeks
 * Conclusion: brain mets from renal cell usually unresponsive to conventional photon therapy

 * Jefferson, 1985 (1956-1981) PMID 2414257 -- "Radiation therapy in the treatment of metastatic renal cell carcinoma." (Onufrey V, Int J Radiat Oncol Biol Phys. 1985 Nov;11(11):2007-9.)
 * Retrospective. 125 with metastatic lesions (12 brain mets). Total doses 20-60 Gy
 * Response rate: 65% of TDF >70, 25% for TDF <70
 * Conclusion: kidney mets should be treated to higher doses

 * 1983 (1965-1980) PMID 6185207 -- "The role of radiation therapy in the management of metastatic renal cell carcinoma." (Halperin EC, Cancer. 1983 Feb 15;51(4):614-7.)
 * Retrospective. 35 patients palliated for met renal CA, 60 sites (10 CNS)
 * CNS: disappointing results. 30% response in brain and SC lesions

SRS

 * Patients treated with SRS appear to do better than patients treated with WBRT (as a historical comparison)
 * Role of WBRT in addition to SRS is unclear. It probably improves local control; its effect on distant brain failure and survival is unclear based on several single-institution retrospective reviews

 * Utah, 2006 No PMID link -- "Stereotactic radiosurgery as therapy for melanoma, renal carcinoma, and sarcoma brain metastases: Impact of added surgical resection and whole-brain radiotherapy." (Rao G, Int J Radiat Oncol Biol Phys. 2006 Nov 15;66(4 Suppl):S20-5.)
 * Retrospective. 68 patients with brain mets (melanoma 68%, RCC 28%, sarcoma) treated with SRS +/- WBRT or surgery. KPS >70
 * Median OS: 14.2 months
 * WBRT: no difference in survival

 * MD Anderson, 2005 (1991-2002) PMID 15854241 -- "Outcome variation among "radioresistant" brain metastases treated with stereotactic radiosurgery." (Chang EL, Neurosurgery. 2005 May;56(5):936-45; discussion 936-45.)
 * Retrospective. 189 patients with 264 brain mets (melanom 103, renal cell 77, sarcoma 9) treated with SRS. Median dose 18 Gy (10-24). Median F/U 7.4 months
 * 1-year LC: renal cell 64% vs. melanoma 47% vs. sarcoma 0% (SS). Neurologic death renal cell 31% vs. melanoma 66% vs. sarcoma 60% (SS)
 * 1-year OS: renal cell 40% vs. melanoma 25% vs. sarcoma 22% (SS)
 * WBRT: Only 16 patients WBRT+SRS => no difference in LC, DBF, or OS

 * ECOG E6397, 2004 (1998-2003) ASCO Abstract -- "Phase II trial of radiosurgery (RS) for 1 to 3 newly diagnosed brain metastases from renal cell, melanoma, and sarcoma: An Eastern Cooperative Oncology Group Study (E6397)." (Manon RR, Journal of Clinical Oncology, 2004 ASCO Annual Meeting Proceedings (Post-Meeting Edition). Vol 22, No 14S (July 15 Supplement), 2004: 1507
 * Phase II. 32 patients with renal cell, melanoma, sarcoma brain mets, 1-3 mets, no prior cranial RT. RT 24 or 18 or 15 Gy based on size. Median F/U 25 months
 * Median OS: 8.3 months, 32% died from CNS death.
 * Local control: in-field failure 3 months 28%, 6 months 45%; out-of-field failure 4% and 17%.
 * Conclusion: median survival better than WBRT alone; delaying WBRT may be appropriate for some subgroups. However, local failure rate comparable to surgery only in Patchell trial

 * Pittsburgh
 * 2003 PMID 12593621 -- "Radiosurgery in patients with renal cell carcinoma metastasis to the brain: long-term outcomes and prognostic factors influencing survival and local tumor control." (Sheehan JP, J Neurosurg. 2003 Feb;98(2):342-9.)
 * Retrospective. 69 patients with 146 renal cell brain mets treated with SRS and other things
 * Survival: median 15 months from brain met diagnosis (13 months from SRS for no active extracranial disease, 5 months for with active disease). 83% died of progression of extracranial disease
 * Response: 63% decreased in size, 33% stable, 4% increased
 * Predictors impacting survival: age, KPS, time from Dx to brain mets, dose to margin, total dose, and treatment isodose. Tumor resection, whole brain RT, chemotherapy, immunotherapy did not correlate with survival
 * Conclusion: SRS provides effective control
 * 1998 PMID 9669818 -- "Stereotactic radiosurgery for brain metastasis from renal cell carcinoma." (Mori Y, Cancer. 1998 Jul 15;83(2):344-53.)
 * Retrospective. 35 patients with 52 brain mets treated with SRS. 28 also underwent WBRT. RT 17Gy (13-20)
 * Median OS: 11 months after SRS. 8% died of progression of irradiated tumor
 * LC: 90% (disappearance 21%, regression 44%, SD 26%). LR in 3 patients, DBF in 12 patients
 * WBRT: local control: no failures in WBRT + SRS, DBF 46% vs. 50%, OS no difference

 * Wayne State, 2002 PMID 12507083 -- "Gamma knife radiosurgery for renal cell carcinoma brain metastases." (Hernandez L, J Neurosurg. 2002 Dec;97(5 Suppl):489-93.)
 * Retrospective. 29 patients with 92 brain mets treated with GKS. 48% WBRT prior GKS, 7% after GKS. Mean GKS dose to 50% isodose 16.8 Gy (13-30)
 * Survival: RPA Class I - WBRT/GKS 18 months vs. WBRT 7.1 months, RPA Class II - WBRT/GKS 8.5 months vs. WBRT 4.2 months, RPA Class III - WBRT/GKS 5.3 months vs. 2.3 months
 * Conclusion: WBRT combined with GKS may improve survival in all RPA classes

 * Mayo Clinic, 2002 PMID 12188943 -- "Stereotactic radiosurgery for patients with "radioresistant" brain metastases." (Brown PD, Neurosurgery. 2002 Sep;51(3):656-65; discussion 665-7.)
 * Retrospective. 41 patients with 83 mets (renal cell 16, melanoma 23, sarcoma 2).
 * Survival: 14.2 months after SRS. RPA Class I survival 23.5 months, RPA Class II/III survival 10.5 months. Trend to better survival with renal cell (17.8 months) vs. melanoma (9.7 months).
 * Control: 12% recurred locally, 54% distal brain failure.
 * WBRT: improved local control (100% vs. 85%, SS), and decreased DBF (17% vs. 64%, SS), no impact on OS

 * Cleveland Clinic, 2000 (1991-1998) PMID 10863072 -- "The role of whole brain radiotherapy and stereotactic radiosurgery on brain metastases from renal cell carcinoma." (Goyal LK, Int J Radiat Oncol Biol Phys. 2000 Jul 1;47(4):1007-12.)
 * Retrospective. 29 patients with 66 tumors treated with SRS. Median RT 18 Gy to 60% isodose. Median F/U 12.5 months.
 * Median OS: 10 months. Only 9% recurred locally. WBRT: no improvement on local control
 * Distant brain failure: single met 23% (3/13), multiple mets 60% (6/10).
 * Conclusion: SRS alone excellent control. Consider adding WBRT if multiple brain mets

 * Saar, 1996 (Germany) PMID 8840485 -- "Treatment of brain metastases from hypernephroma." (Nieder C, Urol Int. 1996;57(1):17-20.)
 * Retrospective. 22 patients (7 surgery + RT, 2 fractionated SRT, 13 WBRT to 30 Gy)
 * Best results surgery + RT. SRT alone better than WBRT (accelerated WBRT no difference from standard WBRT). Only 4/13 WBRT improved
 * Conclusion: SRT and surgery superior but not always available. Higher WBRT should be investigated

Bone mets

 * See also: Bone metastases chapter

Prospective trials:
 * Princess Margaret, 2005 (1996-2002)
 * PMID 16177996 (Free full text) — "A phase II trial of palliative radiotherapy for metastatic renal cell carcinoma." Lee J et al. Cancer. 2005 Nov 1;104(9):1894-900.
 * Phase II. 31 pts. Symptomatic mets (25 pts with bone mets) from RCC treated with 30 Gy / 10 fx.
 * 83% reported a decrease in pain; in 43% pain relief lasted until last f/u visit. 13% had complete relief of pain. Median f/u 4.3 mo.

Retrospective:
 * Jefferson, 1985 (1956-1981) PMID 2414257 -- "Radiation therapy in the treatment of metastatic renal cell carcinoma." (Onufrey V, Int J Radiat Oncol Biol Phys. 1985 Nov;11(11):2007-9.)
 * See details above at Brain Mets
 * 86 pts with bone mets.

 * 1983 (1965-1980) PMID 6185207 (Free full text) -- "The role of radiation therapy in the management of metastatic renal cell carcinoma." (Halperin EC, Cancer. 1983 Feb 15;51(4):614-7.)
 * See details above at Brain Mets
 * 36 pts with bone mets. Varying doses given, taking dose and time factors into account as TDF (Time Dose Factor)
 * Bone pain responded at 77% of the treated sites. No apparent dose effect (most bony sites received 45-85 TDF; this is a wide range of doses, corresponding to 30 Gy over 3 weeks to 50 Gy in 5 weeks).

title: Radiation Oncology/Kidney


text:
User:Thaumaturge~enwikibooks

Hi all

I'm a researcher into reading rate, knowledge acquisition, special abilities, and crystallized intelligence.

I'm a liberal minded free thinker, and, um, I quite like GW Bush's stance on economics, but if I had half the chance I would abolish slavery altogether.

Biases I don't think I have any at all

Cheers Thaumaturge 09:27, 24 Jun 2005 (UTC)

title: User:Thaumaturge~enwikibooks


text:
User talk:Thaumaturge~enwikibooks

Hi all

I'm a researcher into reading rate, knowledge acquisition, special abilities, and crystallized intelligence.

I'm a liberal minded free thinker, and, um, I quite like GW Bush's stance on economics, but if I had half the chance I would abolish slavery altogether.

Biases I don't think I have any at all Thaumaturge 09:28, 24 Jun 2005 (UTC)

Your account will be renamed
Hello,

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

Unfortunately, your account clashes with another account also called Thaumaturge. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Thaumaturge~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:46, 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:35, 19 April 2015 (UTC)

title: User talk:Thaumaturge~enwikibooks


text:
A-level Chemistry/AQA/Module 5/Thermodynamics/Specific Heat

Measuring the heat capacity of solids and gases was one of the first clues that we live in a quantum world. Classically, the heat capacity was constant at 1/2Nk per degree of freedom. This would put at a gas at 3/2Nk. Where k is Boltzmann's constant.

The specific heat capacity of a substance is defined as heat capacity per unit mass.

Experimental Values
When people started looking at heat capacity around the turn of century, they discovered some interesting things about how it changed with temperature. These problems took many years to figure out, including many attempts to create models.

Heat Capacity of a Quantum Oscillator
If we take a single quantum oscillator with energy $$\epsilon = \hbar\omega\left(n+\frac{1}{2}\right)$$ Then by summing over n with a Boltzmann distribution for energy. We get a value fot the internal energy of the oscillator.

When we differentiate this with respect to T, we get the Heat Capacity. $$C = \frac{dU}{dT}$$ When we look at the high a low temperature limits for this we see that at high temperatures we get the classical result: C = kB. At the low temperature limit we get that $$C = k_B \left(\frac{\hbar\omega}{k_b T}\right)^2 e^{\frac{\hbar\omega}{k_b T}}$$

The Harmonic crystal approximation
One reason why solids are easy to study is that the atoms in a solid are held very tightly to their equilibrium positions. So tightly, in fact, that all the atoms may be assumed to execute coupled simple harmonic motion about their mean positions.

Einstein's model for a solid
Einstein's model pretty much said that a solid was comprised of 3N quantum oscillators, it provided quite a good model at higher temperatures, but near T = 0K, it didn't agree with experimental values.Let derive the mathematical expression for that.

First Einstein assumed that in solids, the electrons are in the form of waves that don't react with each other (in the real case this does not happen but it can be a good approximating in some cases). Making this assumption, according to Einstein, the probability f(v) that an oscillator has frequency v is given by $$f(v) = \frac{1}{e^{\frac{hv}{kT}}-1}$$.also internal energy of a solid is E=3Nhvf(v).So Einstein specific heat is $$c_v=\frac{dE}{dT}_v = 3R\frac{hv}{kT}*\frac{hv}{kT}*\frac{e^{\frac{hv}{kT}}}{\left(e^{\frac{hv}{kT}}-1\right)^2}$$

Debye's Model
Debye's model was a large improvement over Einstein's, it was based on the fact that the individual atoms do not oscillate independently. He said that waves travel through the material, these phonons were the important part. The maths is a bit more complicated in Debye's model, but is essentially the same as a boson gas, for example, it's analogous to photons.