text:
User talk:Mshonle/Fork issue 2

The TOC discussion has moved to yet another page: Talk:Programming:C plus plus/Table of contents. This page can stay here as a history... --Max 00:31, 15 September 2005 (UTC)

Begin the discussions where they left off, but don't copy content from the first page. Instead, just start a new section about whatever issue you'd like to talk about.

Chapter structure
If the restructuring complete? Should we now start merging the content? If so, can we make a TODO page that has all the chapters of C -/- on it, so other people (e.g. me) can help? --Max 05:26, 13 September 2005 (UTC)

 * You should wait until the administrator joins clears or does water whatever editorial work he thinks best on the talk page, then we can start debating the editing of the resulting work--Panic 05:58, 13 September 2005 (UTC)

Authors and prev. or other base works should be next to the title not at the end of the book like other references. My name should be there and I probably made a mistake by adding others to that section, you can use all there references if you merge only the author should remove (and add) it's name (I did add all the others for historical purpose but after examining the GFDL came to the conclusion that I shouldn't.--Panic 03:32, 14 September 2005 (UTC)

Hi Max and Panic. Why don't we use this space right here for an outline of the merged book? Ideally the current structure of the existing book will be kept (but with, for example, the chapter on classes in the middle, before the references section). I would like to see the preprocessor section toward the end (although #include should be mentioned earlier; but the #string tokenizing operator and the ## token-concatenation operator, which are a large part of that section, should be mentioned later) and I would like to see the language comparison section be moved to a part of the FAQ chapter.

Here's a start:
 * 1) Hello world (the introduction to C++, setting up the compiler, and running your first program-- complex details, like buffer flushing, might be more appropriate later)
 * 2) Variables and Operators (used to be "Operators" or "Variables and Expressions")
 * 3) Data Types content
 * 4) Statements (control flow content)
 * 5) Functions
 * 6) Stream and File I/O
 * 7) Classes
 * 8) The STL and Iterators
 * 9) The Preprocessor
 * 10) The Debugger
 * 11) Reference Tables (only place lists of keywords (and other long lists) here)
 * 12) Idioms
 * 13) Singleton design pattern content (the stubs for the other patterns can be deleted for now, someone else can write them later; the Model-View-Controller pattern, the Builder pattern, and the Visitor pattern I would say should be done next, due to their imporantance (and iterator is already done earlier))
 * 14) FAQ
 * 15) Language comparison should go here

This is a large refactoring, but in the end it'll be worth it. What do you guys think? MShonle 03:40, 14 September 2005 (UTC)

Max Version of the TOC
I'll make this a different section so that readers can see both structures and compare / discuss. Please do not edit this section if you are not me. Rather add your comments to the end.

The exact order may change, but this is approx. the structure i'd like to see:

Part 0: About this book
 * Forword
 * About a wikibook (your rights and all that)
 * Authors

Part I: Introdution to C++ and Programming
 * What is a programming language?
 * Binary code
 * Assembler
 * High level languages (C++)
 * Very Short intro: 3 concepts: proc, oo, functional, C++ does all
 * What is the compilation / build process, using a sample program. e.g. Hello world.
 * Example of a build process on unix (gcc)
 * Example of a build process on Win32 (Visual studio)
 * Short intro to language features (explain the hello, world)
 * Variables and the concept of memory (use only some basic types, link -> ref. tables for all data types).
 * Constants
 * simple (!) console i/o (link -> explanation later on)
 * assignment / operators. (explain, link -> ref tables)

Part II: Procedural Programming Concepts
 * Program flow: Branching (if, if/else)
 * Logical operators
 * Program Flow: repetition (while)
 * Program Flow: repetition II (do / while)
 * Program Flow: repetition III (for)
 * Multi-way branching (switch)
 * Function basics
 * Scope
 * the main function
 * Advanced Functions (call-by-value vs. call by reference, overloading, default, etc.)
 * Recursion
 * Array basics
 * Advanced arrays (initialization, partially filled, multi-dimensional, etc.)
 * Arrays and functions

Part III: OO-Programming Concepts (This is completely unordered and probably incomplete, since I have not yet taught an OO-class. So all these should appear, but not necessarily in this order)
 * combining of data and control
 * classes
 * constructors
 * destructors
 * inhertance
 * virtual
 * abstract classes
 * pure abstract classes (interfaces) and why they make sense
 * visibility
 * see list in c -/- -/-

Part IV: C++ Language Features
 * The enum data type
 * The struct data type
 * The union data type
 * typecasting
 * namespaces
 * header files and source files / multi-file programming
 * Strings as character arrays (C-strings)
 * Memory management / Pointers / new, new[], delete, delete[]
 * Operator overloading
 * Exceptions
 * Templates
 * Intro into the praeprocessor
 * Hints for the compiler (inline, etc.)

Part V: Standard C++ Libraries
 * Intro to the STL
 * The String class (C++-Strings)
 * Input and output streams:
 * cin/cout/cerr
 * all those iomanip's
 * text file i/o
 * see list in c -/- -/-

Part VI: C++ in the Real world
 * C++ vs. other languages
 * Common programming styles
 * C++ and varios OS's
 * Win32 (short intro, then link to different section / book ?)
 * Linux / Unix / OS X (explains that there are different GUI things, link -> different section / book ?)
 * Makefiles

Maye a part on GUI in general? Or a different book?

Part VII: Common Programming idioms in c++
 * Intro to design patterns
 * Procedural Idioms:
 * See list in plus plus
 * OO-Idioms
 * some design patterns

Part VIII: Reference Tables
 * List / Table of Keywords (should link to the explaining chapter)
 * List of Standard Headers
 * Table of praeprocessor commands
 * table of compiler keywords
 * Table of Operators
 * Table of Data Types
 * internal storage of the data types (of floats, size of ints. etc)
 * links to other websites
 * links to commercial books

Please make your comments after this line. --Max 05:34, 14 September 2005 (UTC)

I would: Otherwise, it looks great. MShonle 14:39, 14 September 2005 (UTC)
 * Keep the "what is a PL?" high-level and not get into OO vs. Procedural vs. Functional yet. That kind of distinction should be made later in an introductory text. Instead, I would just describe the process of compilers turning code into programs. How it's a series of instructions, how computers work and get things done, and so on.
 * Destructors need to be talked about somewhere.
 * Inheritance and virtual need to be talked about.
 * Headers need to be described somewhere.
 * Ok, how about what is a pl shows opcodes vs. assembler vs. c++ (this explains why we need a compiler) and has only a short intro into prog. concepts.
 * For the oo-concepts: I have added them
 * Headers / multi-file sources are currently in C++ language features. (thats what i meant by headers and sourcefiles
 * --Max 16:58, 14 September 2005 (UTC)
 * Sounds good. A description of memory, the CPU, the HD, and how it fetches instructions/executes them (we're talking six paragraphs max), and then machine code versus C++ code (assembly can be more of a footnote, but that all depends on how you write it). MShonle 19:57, 14 September 2005 (UTC)
 * Agreed. --Max 20:27, 14 September 2005 (UTC)

I'll be pushing a policy about that part that should inform users (readers/writers) about theyer rights (and be portable with the work), also the request that any derivative work not only refers wikibooks but the book title (this must be dif. from wikipedia since we are not dealing with single page articles), the final result will be similar to the old foreword template but with more info and a direct link to the GNU GFDL), but it will take some time. For now the only change to that section is that about wikibooks should be included below you Foreword section, since it describes or gives an intro to the work, the next think should be a description of the medium and it's use, heck, the same way as if we were to add a verbatim GFDL license, if I'm not mistaken there is a structure described on the GFDL about it.--Panic 06:21, 14 September 2005 (UTC)
 * Switched authors and "about a wikibook". I believe thats whay you meant --Max 13:58, 14 September 2005 (UTC)

I think removing or losing any information is bad (some Is redundant, like parts of the Hello World as it is almost a stand alone work, some would probably, if extended, be able to fill other books, lets say a book on OOP or MFC and yet another on STL, but then we have a problem, STL is part of the C++ language and the other topics are needed to understand the language, even Win32 that is not part of the C++ language is important since Windows OS is the most (we hope it will change), OS on the Western world, and I don't think removing portions of a book to create another is correct in the first place (since the information is on topic, like the PL (it can also form a closed book) but it's a needed part as an introduction to C++ and leaving it "low-lever" will help C++ reach an newcomers to PL and C++ in particular, if we start using high level CS knowledge in the book it will lose the thing that I, personably was aiming to, and there are already free books that explain the language to that "elite" audience, Thinking in C++ (see ref. section) it's similar to Thinking in Java...--Panic 16:21, 14 September 2005 (UTC)
 * I believe that some parts of this book can be a book on its own once they get big enough. For example: If we have enough STL material, there could be a book on STL. Then this book would intruduce the STL very briefly, and then reference the other book. I would like to see this book as a starting point to collect material, but I would not be afraid to move some of it, as long as it's briefly introduced and the other book is GFDL and linked. --Max 16:58, 14 September 2005 (UTC)

 * I think a more brief introduction to STL is better. I think a "lots of 150-page books" approach is better than a "handful of 500-page books" approach, in terms of growing Wikibooks.

 * This might be a good opportunity to plan out a charter for the book. Basically, something that describes what the book will talk about and what it won't talk about. The way I see it, this book is:

 * An introduction to programming concepts using C++. The book covers the most essential features of the language and its standard library. It also provides a survey of important concepts, like the STL, software design, and design patterns, but only as a stepping stone for the reader to learn more from other books. The book does not cover non-standard C++ libraries, some of the more advanced or esoteric concepts, nor general computer science data-structures and algorithms. The book is not intended to be a complete reference.

 * All of the other gaps, like design patterns, should be covered in other books that would list this book (or the available books like it) as a prerequisite. MShonle 20:15, 14 September 2005 (UTC)

 * Agreed. Definitely a long-term goal --Max 20:27, 14 September 2005 (UTC)

Just thought about something: Recursion should be in another part, called "Functional programming concepts" (after procedural and before oo). However, this would be too small to be it's own part. I have no solution for that problem. --Max 17:00, 14 September 2005 (UTC)
 * Recursion would be better introduced right after loops are (even before switch is, using your current plan). But I think it's pushing it a bit to describe C++ as being functional. Perhaps after operator overloading is discussed the functor idioms can be described, which mimic some of the features in functional languages. MShonle 19:57, 14 September 2005 (UTC)
 * The problem with recursion: Recursion requires functions and scope. Functions make more sense after program flow (if / loops, etc.) With recursion introduced early, functions would have to move way up:
 * Function basics
 * Scope
 * Recursion
 * if
 * all the loops
 * More on functions...
 * However, this solution does not make me happy... I somehow think that recursion should kinda be on its own.--Max 20:34, 14 September 2005 (UTC)

 * I see. Then I think right after the call-by-name/call-by-value discussion that recursion should be covered (before arrays). A good introduction might first show an infinite loop, and describe why it's infinite, and then discuss a recursive loop that terminates (fight the temptation to use factorial). (In my opinion, students should learn recursion first and only later things like loop-constructs and side-effects, but that's more appropriate for languages like Scheme and less suited for C++.) Another note: will references be covered well before pointers then? MShonle 20:43, 14 September 2005 (UTC)
 * Agreed (for recursion). Seems to make sense. --Max 21:05, 14 September 2005 (UTC)

References: I see two types of references: call-by-reference for functions (which should be in functions II), and references as in the reference operator used for pointers (which should imo be covered with pointer). Where would you put references then? --Max 21:05, 14 September 2005 (UTC)
 * Well, references can exist outside of function formals, as in fields (if I recall correctly, they must be initialized in the initialization list of the constructors) and as local variables. There's no ideal location to place them. It's more dependant on the exposition. Since we appear to really be getting somewhere, why don't you move an updated version of your TOC to here: Talk:Programming:C plus plus/Table of contents. Thanks. MShonle 21:25, 14 September 2005 (UTC)

Single letters as variable names

 * Single letters are almost always a VERY BAD (variables), I can only understand your correction if you lack of experience on doing hard coding single name varialbes are always bad, I can agree with your changes but if a proiminent warning about scope, loops etc... in a very crowded piece of code of even if you do Extreme Coding keeping the logic of things in your mind is extremely dif. even more because it fail to observe the rule of auto documentation or verbosity in code, most actual IDEs do provide code complition of a similar function.--Panic 03:47, 14 September 2005 (UTC)
 * Panic, there is no one "right way" of doing anything, particularly when it comes to coding style. Your view is just one POV, while my view is another POV. The text of the book should be neutral to these POVs (and all other important POVs, but not the unimportant, the-moon-is-made-of-cheese POVs). MShonle 04:10, 14 September 2005 (UTC)

Hello World and other hands on examples (with comments) it's my view should be added as extras or appendices to the book, they are almost a closed work in itself, see the index of C -/- -/- I think Max was willing to create other structures to dif. audiences but I don't know his ideas on the subject the same goes to FAQ etc... If you can do fallow the Index of C -/- -/- the merge was what I was doing (part of my beef with you) so I don't see any major problem, if you fix merge the talk page of the destination location and if possible move the one on C -/- -/- keeping the recent comments of C Plus Plus we can move this talk there...--Panic 03:58, 14 September 2005 (UTC)

Cover Art
Merging does not necessarily mean changing the cover art, which is what I believe was what panic criticized. I personally don't like either one, but this issue should now be the lowest priority. Maybe, when the merge is complete there can be a cover-art contest? --Max 05:26, 13 September 2005 (UTC)

 * As the author of the prev. art work :), your comment does hurt a little but an art work contest sound like a good idea (my image is Public Domain, so I have no beef in having it replaced), the problem is getting people to vote, another problem and that was the one I stated is that since I have added it to the other book and it's part of its the cover can I be replaced or a graphical image can be considered "title", that wording of the GFDL is hard to get, and since it is not affected only by my rights on the work I don't know--Panic 05:55, 13 September 2005 (UTC)

 * Your picture can only be used with your permission (GFPL 4.A) " Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.". Now since you said your picture is Public domain, it is ok to use yours as long as you're listed as author. Also, a history page should contain the merge. --Max 06:07, 13 September 2005 (UTC)

 * I had some trouble uploading it to wikibooks, so a user/reader did me that favor, he selected the license as he tought best, I realy didn't check it nor could I re-upload it, I remeber him telling me about it but as it was used for what it wsa created... If that is a problem I give now as the author the permission to anyone to meke it as rights goes, free (I would like to be only mentioned as the author).--Panic 12:43, 13 September 2005 (UTC)

 * Just as a short explanation of what I do not like: Your picture is too full -- to many things going on at the same time. The other picture, however, has too little. But really, content should matter more than the cover art. --Max 06:07, 13 September 2005 (UTC)

 * I think I did a small analisys of the picture after some one commented on it, can't remeber were (try finf here on wikibooks) or google if you have the time for it, it did explain every single object on it, and it's relation with the subject matter.--Panic 12:43, 13 September 2005 (UTC)

I like simple images the best. If you get Gimp you can end up creating all of these metal, 3D, shadowed, shiny titles that just so happen to look like every other web page. As for Panic's image I think a lot of the buzzwords on it don't really apply today.

For example, the idea that languages would be "hybrid" or "multiparadigm" has largely dropped off of the face of the earth. C++ was one of the first major languages to be hybrid. But these days it just doesn't matter; it doesn't distinguish it in any way from the languages common today. People have found out, for example, that they can write procedural programs in any language. I would say that Java is good with OO, object-based, and procedural. And also (to a certain extent) functional decompositions that are much better in Java than in C++ (the access to final variables in lexical scope is what makes Java's anonymous innerclasses more apt to functional programming than C++, even though C++ is the language with the operator overloaded-- to find out why I make this claim, ask yourself why the anonymous innerclasses need to be anonymous, and how different they would be if they were named). MShonle 02:57, 14 September 2005 (UTC)

 * Prevision? MShonle 03:45, 14 September 2005 (UTC)

 * Expectations (those are based on you, your life, you experience), predictions (I don't think this is also the right work, prediction can be a guess, the word I'm after is on the lines of provision, pre-vision, a visualization of the solution of a problem, that would imply some careful study or some kind of knowledge base to make derivations and elaborate an hypothesis...--Panic 04:03, 14 September

2005 (UTC)

 * You want me to form a hypothesis that the term "hybrid" is a term no longer used by programming language researchers? MShonle 04:14, 14 September 2005 (UTC)

 * What I have said so far is that you should try to avoid having "expectations" when others are concerned  if dealing with medium or large audiences, or even more important, if they are directed toward unknowns (in general and not only applied to this particular case, it's a "logic" flaw that I have found you have, you tend to project your way of thinking directly to others and have problems coming to grasp with the idea that they don't behave/think like you expect, a shortcut solution should be a reversion, to an expectation that no one will do as you expect) if you need to pass a point you should be clear about it or at least try. If you do apply you "small" world KB (Knowledge base, or personal experience, if you prefer) to produce predictions they will have a high probability of being false from the beginning--Panic 06:07, 14 September 2005 (UTC)

 * KB? Previsions? MShonle 04:44, 14 September 2005 (UTC)

Oh, I think I may see what you're getting at now. You're saying that, at the time, it sounded like "mutli-paradigm" would be a good word to use on the cover, but now you see that your guess failed to be timeless. MShonle 04:48, 14 September 2005 (UTC)

I think you're mistaking the term "logical flaw" with "things you disagree with." I'm not sure if you're talking about the cover art or variable names, though. MShonle 14:15, 14 September 2005 (UTC)

Not so, the language status hasn't changed, even if it is evolving you can't say that it has ceased to be multi-paradigm avery language has a defined paradigm or defined range, even if OOP is now more active that the other facets of C++ the language is  and will have be a  "multi-paradigm" language, if that changes it will seance to be C++ (Object-C or Java) are examples of "derivations" from the concept even if similar in nature to parts of C++.

PS: I really hate that wikipedian way of using the talk page, edits can be hard to sequence and I have huge problems with the #%&# edit window...--Panic

 * But what I actually said is that it ceased to be an important distinction. MShonle 14:23, 14 September 2005 (UTC)

And I disagree with you on that point, if you want to use OOP you would be probably better using Java or Smaltalk and C for PP etc... the advantage of C++ is the capacity or the problem (depends on POV) of mixing all of those concepts freely. That can be a reason for not using C++ as the primary language to explaining OOP concepts.--Panic 16:32, 14 September 2005 (UTC)

I am sorry I have to be an a***, but I think this discussion went a little off topic. For the task of merging the book it is probably irrelevant whether multi-paradigm is still used and what languages may or may not be better. Please Focus on the task at hand, people! --Max 17:12, 14 September 2005 (UTC)
 * Yes, but aren't you glad we're not talking about the hyphen slashes -/-? MShonle 20:00, 14 September 2005 (UTC)

title: User talk:Mshonle/Fork issue 2


text:
A-level Mathematics/OCR/C2/Integration/Solutions

Worked Solutions
1a)

 * $$ \int 2x^5 \, dx $$

 * Using our rule: That $$\int \frac{dy}{dx} = x^n dx$$ is equal to $$y = \frac {x^{(n + 1)}}{(n + 1)} + C$$

 * We get:

 * $$y = \frac {2x^6}{6} + C $$

b)

 * $$ \int 7x^6 + 2x^3 - x^2 \, dx $$

 * Again using our rule, we would get:

 * $$y = x^7 + \frac {x^4}{2} - \frac {x^3}{3} + C$$

2a)
 * $$ \int x +5 \,dx $$ given that the point $$(0, 3)$$ lies on the curve.

 * Using our rule, the integral becomes

 * $$y = \frac {x^2}{2} + 5x + C $$

 * Now we can sub in our points $$(0, 3)$$, So that:

 * $$ 3 = \frac {0^2}{2} + 5(0) + C $$

 * Therefore C = 3

b)
 * $$ \int 3x^2 + 7x +0.1 \,dx $$

 * Evaulating this we get: $$ x^3 + \frac {7x^2}{2} + 0.1x + C $$

 * Given (2,2), subing these points in:

 * $$ 2 = 2^3 + \frac {7(2^2)}{2} + 0.2 + C$$

 * $$ 2 = 8 + 14 + 0.2 + C$$

 * $$ C = -20.2 $$

3a)
 * $$ \int_{0}^{2} x + 1 \,dx $$

 * Evaluating this we get:

 * $$ \Bigg\lfloor \frac {x^2}{2} + x \Bigg\rceil_{0}^{2} $$

 * Substituting in values we get:

 * $$ \Bigg\lfloor \left(\frac {2^2}{2} + 2\right) - \left(\frac {0^2}{2} + 0\right) \Bigg\rceil $$

 * $$= 4 $$

b)
 * $$ \int_{-3}^{4.7} \frac{1}{7}x^{\frac{1}{3}} + 1 \,dx $$

 * Evaluating this we get:

 * $$ \Bigg\lfloor \frac {3x^{\frac{4}{3}}}{28} + x \Bigg\rceil_{-3}^{4.7} $$

 * $$ \Bigg\lfloor \left(\frac {3(4.7)^{\frac{4}{3}}}{28} + 4.7\right) - \left(\frac {3(-3)^{\frac{4}{3}}}{28} -3\right) \Bigg\rceil $$

 * $$\approx 8.08$$

4)
 * The question is simply to evaluate this definite integral:

\begin{align} \int_{-2}^{0} \bigg(y=-x^4-\frac{1}{2}x^3+3x^2 \bigg) \,dx &= \Bigg\lfloor \left(\frac{-1}{5}x^5-\frac{1}{8}x^4+x^3\right) \Bigg\rceil_{-2}^{0} \\&= -\bigg(\frac{-1}{5}*-2^5-\frac{1}{8}*-2^4-2^3 \bigg) \\&=3.6 \end{align} $$

Integration/Solutions

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


text:
Template:Mergeto

This adds pages to Category:Books to be merged.

Usage
This template is used to suggest that the page the template is added to should be merged into another page.

Optionally there are two additional arguments that let you specify a reason for merging and give a custom place for the discussion page to happen.

title: Template:Mergeto


text:
Template:Mergefrom

This adds pages to Category:Books to be merged.

Usage
This template is used to suggest that another page it should be merged the page the template is added to.

Optionally there are two additional arguments that let you specify a reason for merging and give a custom place for the discussion page to happen.

title: Template:Mergefrom


text:
Ada Programming/All Chapters

= Preface =

= Basic Ada=

= Installing =

= Building =

= Control Statements =

= Type System =

= Integer types =

= Unsigned integer types =

= Enumerations =

= Floating point types =

= Fixed point types =

= Arrays =

= Records =

= Access types =

= Limited types =

= Strings =

= Subprograms =

= Packages =

= Input Output =

= Exceptions =

= Generics =

= Tasking =

= Object Orientation =

= New in Ada 2005 =

= Containers =

= Interfacing =

= Coding Standards =

= Tips =

= Common Errors =

= Algorithms =

= Chapter 1 =

= Chapter 6 =

= Knuth-Morris-Pratt pattern matcher =

= Binary Search =

= Function overloading =

= Mathematical calculations =

= Statements =

= Variables =

= Lexical elements =

= Keywords =

= Delimiters =

= Operators =

= Attributes =

= Pragmas =

= Libraries =

= Libraries: Standard =

= Libraries: Ada =

= Libraries: Interfaces =

= Libraries: System =

= Libraries: GNAT =

= Libraries: Multi-Purpose =

= Libraries: Container =

= Libraries: GUI =

= Libraries: Distributed Systems =

= Libraries: Databases =

= Libraries: Web =

= Libraries: Input Output =

= Platform Support =

= Platform: Linux =

= Platform: Windows =

= Platform: Virtual Machines =

= Portals =

= Tutorials =

= Web 2.0 =

title: Ada Programming/All Chapters


text:
Energy Efficiency Reference/Residential/How to Reduce Energy Usage

Energy conservation is the practice of reducing the use of energy. Individual consumers can do numerous things to conserve energy and reduce home energy costs. Adopting just a few of these strategies can make a measurable difference in your overall energy usage, and the energy demands of the planet.

General tips

 * Choose energy-efficient home appliances, which have been designed with energy conservation in mind. In the United States, Energy Star is a government program to promote energy-efficient consumer products. The EU energy label is a similar European Union program.
 * Choose natural gas furnaces, water heaters, stoves, and clothes dryers. Natural gas is significantly more efficient than electricity derived from fossil fuel sources, for heating purposes. An efficient way to use electricity for heating is with a heat pump.
 * Try to use natural ventilation and only use your heater when temperatures drop below 20 °C(68 °F), and try to only use cooling devices when temperatures get above 26 °C(78 °F).
 * For tips on reducing transportation-related energy usage, see the Transportation energy usage section below.
 * For tips on reducing energy at home, work and at travel, see Reducing Energy at home, work and travel

Reduce heating costs

 * Operate your furnace efficiently:
 * Install a programmable thermostat and set it so your home will not be heated as much when you are away or asleep.
 * Check your furnace's air filter monthly - replace/clean as required. Do this more often if there is a lot of dust or pet dander in your home's air.
 * Get furnace serviced annually, check for slow gas line leaks- especially at the meter and pipe junctions
 * Do not obstruct or close heating or air-return vents by placing furniture or other items in front or on top of them.
 * Insulate and weatherize your home effectively:
 * Ask your local utility to inspect your home to ensure that you have adequate insulation installed. Some may provide incentives for this checkup.
 * Seal off rooms that are not in regular use and close heating vents.
 * Carefully hold a smoking combustible material (such as an incense stick) near the frames of exterior doors and windows. If the smoke moves toward or away from the window, an air leak is likely. A thin shred of paper or string may also be used if a combustible smoking material is not available, though it may not work as well.
 * Replace old, leaky windows (especially single-pane glass) with newer double or triple pane, gas filled, low E windows. If you have single-pane basement windows, consider replacing them with better windows, or, if they are never opened, consider replacing them with glass block, which is about as good as an ordinary double-pane window, though not as good as an argon filled and/or low-e double-pane window. Keep at least two basement windows in place, however, so you can vent the basement if needed.
 * Install heavy curtains over windows. Use them at night, let the sun in during the day.
 * Fit full length curtains that fit snugly with the floor. Fitting a pelmet above will also help reduce air circulation when the curtains are drawn.
 * There are still benefits to be gained in placing radiators beneath windows so as to counteract the down-draft effect that the windows continue to generate despite improvements to window insulation. Radiators beneath windows will obviously have greatest night time effect if a minimum of window cooled air is enabled to sink into a room while allowing the maximum radiator-warmed air to remain in the living space.  Overlaps between radiators and curtains should typically be avoided.  One practice is to tuck curtains behind the radiators or onto window sills on cold nights.
 * Try not to place furniture in front of radiators especially if circulating air is prevented from being drawn in to the radiator's base by either the furniture itself or by all the stuff that gets packed beneath it.
 * Protect your home from cold winds by using windbreaks or other energy-efficient landscaping methods.
 * Choose an apartment or condominium rather than a free-standing house. These dwellings share walls and therefore have fewer exterior walls.
 * Heat less space:
 * Choose a smaller home and avoid unnecessarily high ceilings to reduce the volume of space your heating system will have to heat.
 * Wear several layers of clothing to keep your home's air temperature lower during the day.
 * Use thick blankets so you can keep your home's air temperature lower at night. Wearing a cap at night can enable much lower temperatures. Use an electric blanket for comfortable sleeping while allowing the room's air temperature to be lower.
 * If you live alone and/or in a large home, it may be more efficient to keep your overall house temperature low (55 to 65 °F/13 to 18 °C) and use an electric space heater to heat the areas you use most often. For example, keep a heater near your desk, or use one in the bathroom to avoid heating the whole house during your morning routine. You could even carefully use a hair-dryer to preheat your bed in seconds. Take care to use electric heaters safely, especially near water.
 * Heat water efficiently:
 * Turn down the temperature on your water heater to 120 °F/49 °C and drain the silt occasionally with a water hose. Be sure to check and replace the anode rods periodically as well.
 * Replace your water heater with a heat pump water heater, which is generally 200% or more efficient, compared to regular electric water heaters which are always less than 100% efficient.
 * Replace your water heater with a gas tankless water heater, which heats water on demand rather than storing heated water.
 * Consider solar water heating options, especially if you live in a sunny region.
 * "Reuse" heat:
 * Leave hot water in the bathtub or in cooking pots instead of draining it immediately. This allows the water's stored heat to dissipate into your home rather than being lost down the drain. Keep lids on the pots to avoid cooling them by evaporation instead of by delivering heat to the room, and to avoid adding excess humidity.
 * If you have an electric dryer, you may vent it inside occasionally. The vented air will be very moist, so track humidity levels; if the humidity is high for extended periods you may encourage mold and mildew growth. Venting the dryer hose into an empty bucket or garbage can will allow much of the humidity to condense and be collected. Under no circumstances should you vent gas dryers indoors due to carbon monoxide present in the exhaust.

Reduce cooling costs

 * Many of the steps you can take to reduce heating costs, such as insulating and sealing your home, will also reduce air conditioning costs.
 * Install (easy for DIY folks) solar shades on the outside or exterior of all east, south and west facing windows. They prevent most of the sun's UV rays from even entering the home through the window. They cost much, much less than say an awning. And, you can still see outside.
 * Use fans instead of air conditioning (Fans make the air feel about 4 degrees cooler).
 * Turn fans off when no one is directly in the air stream of the fan. Fans do not actually cool the air; they help your skin to evaporate water more quickly, which cools you.
 * If you have more than two window air conditioners, it is usually more energy-efficient to install a central air conditioner.
 * Pay attention to efficiency ratings when looking for a new air conditioner.
 * Size your system properly. Calculate the heat loads. (Free online calculator.)
 * If you have a portable air conditioners, be sure that it is vented outside. If it is vented inside, you are actually heating your home.
 * In geographic areas where summer night-time temperatures fall below 75 °F/24 °C, open windows and use window fans to pull cool outside air into your home. Depending on the layout of your home, it may be best to only open certain windows and position fans so outside air is pulled in on one side of the house and interior air is pushed out on the other side of the house. It may be a wise choice to install a whole-house fan (if in a sufficiently dry climate), which pulls air through your home and pushes it out through your attic. Choosing a whole-house fan.
 * Install awnings over windows and close window blinds or curtains to keep direct sunlight out.
 * Plant trees near your home. Choose locations that will shade your house during the afternoon. Even trees not directly shading your home will reduce local air temperatures.
 * Drink plenty of fluids to help your body cool itself.
 * Keep closet doors closed. This can save you up to 5% in heating/cooling and air costs alone.
 * When possible avoid adding heat to your home, by eating cold foods or cooking outside on your grill, solar oven, or earth oven, by line drying instead of using a dryer, etc...

Reduce lighting costs

 * Take advantage of sunlight and leave lights off during the day. If possible, adjust your daily routine to align your waking hours with sunlit hours.
 * Use compact fluorescent light bulbs in place of conventional incandescent light bulbs. A CFL uses approximately one-fourth the wattage of an incandescent bulb producing a similar level of illumination, and they last 8,000 to 10,000 hours. The savings in electricity typically amounts to over $30 per replaced bulb. Replace your most-used bulbs first for maximum savings.
 * Install motion-detection switches or timers for outdoor lighting rather than leaving lights on all night.
 * Install dimmer switches for incandescent light fixtures so you can use less light when less is needed. CAUTION: Most CFLs and other fluorescent bulbs are not designed for use with a dimmer.
 * Replace incandescent night lights with LED or electroluminescent (Indiglo™, Limelite™, etc.) lights.
 * Don't use excessive holiday lighting.
 * Dust light bulbs occasionally (with the power off) to increase light levels.
 * Use limited, focused lighting when performing a task in a small area instead of lighting the entire room.
 * Choose light fixtures that require fewer bulbs, or unscrew some of the bulbs in existing fixtures.
 * Change conventional ballast with electronic ballast
 * Try to limit the extent to which you put lights in forms of shade. When "light shades" are needed choose those that merely diffuse light and have less potential to gather dust.
 * Use special capacitor for lamp, see the example of calculation in

Reduce water usage

 * Install water-saving shower heads, faucets, and toilets.
 * Fix leaky pipes and plumbing fixtures in your home's plumbing system. Toilet tank leaks are easily detected by adding a few drops of food coloring to the water reservoir. If the water in the toilet bowl becomes dyed, water is leaking from the tank and the valve should be repaired or replaced.
 * Lower the water level of your toilet's water reservoir. Be careful not to lower it to the point that it does not flush adequately. If your toilet's flush mechanism does not allow an easy way to lower the water level, place a plastic or glass jar filled with water into the water tank, clear of the flush mechanism, to displace water. Do not use a brick in your water tank, as it can break down and cause plumbing problems.
 * Invest in a composting toilet
 * Take showers instead of baths.
 * Take shorter showers.
 * Have an outdoor shower, where one hangs a five gallon bag in the sun throughout the day to heat. (bags found in camping section)  To wash, wet for 1 minute, close clamp, soap up all bodily parts, then rinse with remaining 2.5 gallons.  Saves water and electricity on heat.
 * Use the light cycle when using a dishwasher on dishes that aren't extremely dirty. Try the same when using a washing machine.
 * Install a water softener if your water is "hard".
 * Water outdoor plants early in the morning or late in the evening to reduce the amount of water lost to evaporation.
 * Mulch plants heavily to prevent weed growth (that would use up water) and water evaporation.
 * Invest in a water barrel - use for watering plants, washing the car.
 * Use a public swimming pool instead of purchasing your own.
 * Wash and rinse clothing by hand with a hand wringer.
 * Run full loads for washing dishes or clothes.

Reduce household waste

 * Do not purchase products with excessive or unnecessary packaging.
 * Purchase products in the largest size practical so as to reduce the product:packaging ratio. However, do not purchase products in larger quantities than you will actually use, and be aware that having a larger quantity on hand may cause you to use more of the product than you would have ordinarily used.
 * Use and reuse gift bags in place of gift wrap.
 * Bring your own bags or boxes along when shopping to carry your purchases home.
 * Put off purchases whenever possible. You will often find that you didn't really need the item.
 * Use rechargeable batteries instead of conventional batteries.
 * Compost food waste instead of throwing it in the garbage.
 * Reuse "garbage" for other than intended purposes. For example, make Easter baskets out of gallon milk jugs,planters out of yogurt cups, butter bowls for saving leftovers in the fridge, etc..

Reduce electricity usage

 * Turn off all electric appliances (lights, computers, televisions) when they are not in use. Computer printers and photocopiers are typically high energy users.
 * Watch TV with the light off.
 * Change out a CRT TV with an LCD model of equivalent size.
 * Reduce miscellaneous electric use from power adapters and electronics in standby mode by plugging them into a power strip that can be switched off.
 * Use the new LED light bulbs available. You may have to switch to E-27 Sockets in order to fit the new bases for the LED lights.
 * Set your computer to automatically shut off the monitor and switch to standby mode (if available) after a certain number of minutes of disuse. Choose a flat panel display instead of a conventional CRT. Adjust your display's brightness to the surrounding light conditions (less brightness is needed in dark rooms).
 * Purchase a laptop and use it as a replacement for your desktop computer. Most laptops are optimized for energy efficiency and don't need an uninterruptible power supply, since the battery can be used during thunderstorms and the like.
 * Use products with the Energy Star logo (or similar). In particular, recycling and replacing old refrigerators with an Energy Star-approved one can save a few hundred kilowatt-hours a year. Replacing old refrigeration and air conditioning units (even if they are still functional) with more efficient ones is often an economically and ecologically sound decision.
 * Consider installing and using a clothes line for drying clothes. Each load not dried in an electric dryer saves 3 to 5 kilowatt hours.
 * Unplug appliances that will not be used for an extended period of time; many devices, especially consumer electronics, use a small amount of electricity even when they are switched off, due to indicator lights or listening for remote-control signals. Direct current converters, which are typically used to connect small consumer electronics devices to household power, lose a significant amount of energy as heat, even when the device is not plugged into the converter.
 * Set your furnace/AC fan to "auto" rather than "on" so it will not run when the furnace/AC unit itself is off. The fan uses a significant amount of electricity.
 * Your refrigerator is probably among the biggest energy users in the home. Take special care to operate it efficiently:
 * Clean the condenser coils on your refrigerator to keep them operating efficiently.
 * Reduce the number of trips you make to the refrigerator/freezer and do not leave the door open unnecessarily.
 * Refrigerator/freezer configuration affects the unit's efficiency. Bottom-freezer models are generally most efficient. Top-freezers (the most common configuration) are reasonably efficient. Side-by-side models are relatively inefficient. Chest freezers are generally more efficient than conventional front-opening models.
 * Small refrigerators are often less efficient than larger models because they usually have less insulation or a less-efficient compressor.
 * Keep your refrigerator/freezer reasonably well stocked so that less cold air is lost when the door is opened.
 * Cover beverages and moist foods to keep the humidity level in the refrigerator lower. Dry air is easier to cool.
 * Keep your refrigerator's temperature above 36 °F/2 °C and below 42 °F/5.5 °C. Keep your freezer's temperature at about 0 °F/-18 °C. A good gauge of freezer temperature is ice cream. If the ice cream is too soft, lower the temperature; if it is very hard and difficult to spoon, raise the temperature.
 * As an alternative to using your refrigerator, consider storing less-frequently used foods in a cold-store room, cellar, or garage.
 * When cooking:
 * Turn off your electric oven or stove shortly before the end of the required cooking time; the heating element will still be hot enough to finish the cooking process.
 * Cover pots to reduce heat loss.
 * Do not heat a small pot on a large burner.
 * Microwave foods when possible. However, microwaving liquids or foods with high moisture content is usually less energy-efficient than heating it on a stove.
 * Thaw or partially thaw frozen food in the refrigerator prior to cooking.
 * Replace drip pans periodically. Dirty drip pans are much less reflective than new pans and cannot reflect as much heat back up to the pan being heated.
 * Avoid opening the oven door unnecessarily. Instead, view the food through the door's window and use a timer to help you determine when the food will be fully cooked. Most foods are fully cooked when the fragrance of the food begins to fill the room from within the oven.
 * Invest in a solar oven if your region will allow for it

Ventilate properly
Proper attic ventilation will:
 * keep the house cooler in hot weather. Attics radiate heat downward when they are hotter than the living area.
 * keep the attic cold in the winter, which can prevent ice dams.
 * allow moisture to escape from the house. Warm, moist air rises from the living area. Ventilation of this humid air is important year-round for preventing mold and rot, but it is especially important in the winter, when the moisture is more likely to condense.

Be aware that decreased ventilation increases the effectiveness of any insulation that is a poor barrier to air infiltration, such as fiberglass batting. The increased ventilation will create low pressure areas, so that the house will push conditioned air through the insulation faster than it normally would.

With insufficient ventilation:
 * Attic heat can penetrate into living areas during summer.
 * There will be excessive humidity, which can cause mold and eventually rot.
 * Water vapor can condense and collect on insulation, on rafters, and on the underside of roof sheathing. This will reduce the effectiveness of the insulation and can greatly hasten the activity of mold and rot.
 * Condensation and mold will also occur in the living area, especially on perimeter walls (because they are coolest) and where ventilation is poorest, such as in corners and around furniture.

You will need more ventilation than usual if:
 * You live in a damp climate.
 * Your house is in the shade.
 * The crawlspace or basement has a dirt floor.
 * There isn't much wind.
 * You have a modern, super-tight house.
 * You have a solid masonry house.
 * You have a house with impermeable siding such as vinyl or aluminum.
 * You do not have sufficient (or any) vapor barriers.

Most houses treat the attic and basement as unconditioned space. You can think of unconditioned space as outdoor space, minus the rain and snow. The unconditioned space surrounding the living area shouldn’t be wide open, but it shouldn't be sealed shut either. A good compromise is to have two foundation vents in the basement and two different types of vents in the attic. Vents should always exist in pairs (but not necessarily two of the same type) to allow for cross-ventilation. In an attic, one member of the pair should be low on the roof and the other member should be higher up, so that outside air is pulled through one and out the other. Natural attic ventilation through these vents is usually sufficient. Powered vents in the attic may interfere with proper furnace and fireplace venting.

Some ways to ventilate an attic naturally:
 * Soffit vents
 * Ridge vents (you can cover the ridge vent with shingles)
 * Gable vents

Modern homes often incorporate all three types of attic vents, providing continuous cross-ventilation via multiple air pathways.

Make sure gable vents have screens to keep out insects and animals, and keep the screens clean to maintain proper ventilation.

Never close or block off the vents to a damp basement or crawlspace, except in extreme cold to prevent pipes from freezing. Closing the vents to a damp basement or crawlspace will cause mold, rot, and structural defects. Sometimes a basement or crawlspace will look bone dry but is transpiring moisture through the dirt floor at a rapid rate. To see if this is the case, lay down some clear plastic on the dirt floor for a few days and observe how much water collects on its underside.

If your basement or crawlspace is dry and has been dry for several years you can:
 * Close the foundation vents in the winter to conserve energy, and open them again in the warmer months to allow interior moisture from the house to escape.
 * Close the foundation vents permanently, install a polyethylene vapor barrier on the floor (just to be safe), insulate the basement or crawlspace walls, and part of the floor, if necessary, and include the basement or crawlspace as part of the conditioned space of the house. If you take this route you don’t need to insulate the floor above the basement or crawlspace, but it doesn’t hurt if the floor is already insulated. Keep an eye on humidity. There will be less condensation on walls and pipes, but possibly greater humidity because of trapped air, requiring increased ventilation in the upper floors and attic to compensate.

Advantages of insulating a dry basement and crawlspace and making them part of the conditioned space of the house:
 * Decreased condensation, because walls are closer in temperature to the air inside the house, and because cold pipes are not exposed to outdoor air during the warmer months.
 * Reduced energy losses from ducts passing through the basement.
 * Reduced risk of pipes freezing in winter.

Residential ventilation checklist

 * Vent sources of moisture directly to the outside. This is especially important for the bathroom, which normally produces more moisture than any other room in the house, and for the dryer, which produces more moisture than any other appliance.
 * Do not vent moisture directly into the attic. The last thing you want to do is put warm, moist air into the attic. In cold climates this can contribute to icing and resulting leaks.
 * A whole-house fan is acceptable because of its usual location, installed in the attic floor near a gable vent, and because it is not directly connected to a source of moisture. The whole-house fan can help to remove cooking odors and can cool the entire house when it is not hot enough to turn on the air conditioning. Use caution: natural-draft heating appliances could be adversely affected by too much exhaust - products of combustion could be drawn into the house.
 * If you cannot vent the bathroom directly to the outside, install the vent up through the attic and down through a soffit vent. This will prevent water from dripping back down into the vent as it would if you installed the duct straight up through the roof. Wire the bathroom vent to a timer switch, so that people can turn it on without having to remember to turn it off.
 * Always vent the clothes dryer to the outside with a smooth-walled (do not screw into walls of duct), metal (not plastic) duct that is as short as possible. To prevent a house fire check the duct for clogs regularly. Do not vent the dryer directly into the laundry room.  This puts much too much moisture into the house.
 * Kitchens should have a vent hood with an exhaust fan. The vent hood should have a back draft flap to keep out insects and cold air - but some cold air will inevitably seep in.
 * Install ceiling fans to improve ventilation and distribute heat. To disperse heat properly run the ceiling fan in reverse so that it pushes warm air up against the ceiling and down along the walls, where people tend to sit.
 * Do not block air intake vents for heating or air conditioning equipment. Blocking these vents will starve the equipment for air, causing it to run inefficiently.
 * If your unfinished basement has windows, keep them closed on hot, humid days to prevent moisture from condensing on the walls continuously, all day long. Open the windows once the humidity drops below the natural humidity of the basement so that moisture doesn’t build up inside.
 * People, in their zeal to do a good job, sometimes pack insulation into the eaves, blocking the soffit vents, because they don’t know that the vents exist or don’t know what they are for. If you are installing insulation in the attic for the first time do not cover the soffit vents with insulation.
 * If your attic is already insulated on the floor make sure insulation is not blocking the soffit vents. This is more of a problem for loose-fill, since wind can scatter the fill around. To prevent loose-fill from scattering and covering the soffit vents, you can install baffles between the rafters.  You staple the baffles to the underside of the roof sheathing, and the baffles maintain 2 inches of ventilation space next to the sheathing.
 * Wind coming through soffit vents can also push batt insulation up off the floor, causing cold airflow against the ceiling and cold spots high up on exterior walls. Baffles installed near the eave should also prevent this problem by keeping the batts from flipping up and over.
 * If you are going to install batts or spray foam between the rafters, you should extend the baffles all the way up to the ridge vent. This will keep the sheathing dry and prevent it from rotting invisibly behind the insulation.
 * Likewise, when you insulate between the floor joists in the ceiling of an unconditioned basement or crawlspace, you should leave some space between the insulation and the sheathing (subfloor) to allow water vapor to escape.

Other conservation tips
There are many ways to conserve energy that will not economically benefit the consumer directly. However, many of these methods improve overall efficiency of the economy, which can lead to economic growth.
 * Rent or borrow items you will not use very often. This eliminates the significant amount of energy that goes into the manufacture and disposal of an additional item.
 * Check books out from your local library rather than purchasing your own copy.
 * Purchase used items when possible.
 * Donate usable clothing and other items to charity rather than discarding them.
 * Use "disposable" items (such as paper and plastic dishware and cutlery, or disposable cameras) sparingly. Opt instead for the reusable version.
 * At public restrooms, use electric hand dryers (if available) instead of paper towels. The energy needed to heat and blow air at your hands is far less than the energy needed to make and transport paper towels and haul waste away.
 * Use a digital camera in place of a conventional film camera and get prints of only the best photographs. Use a printing service rather than purchasing your own photo printer.
 * Use toilet paper, paper towels, and other products made of recycled materials.
 * Ask your local energy utility about credits or rebates given for the purchase of energy-efficient appliances.
 * Make an effort to defer electricity usage to off-peak hours. Reducing usage during peak hours (usually mid-afternoon to early evening on hot days) helps prevent the construction of additional power plants that would be required to keep up with demand during peak hours.
 * If you plan to use air conditioning, cool your house early in the day and turn it off around noon, allowing the house to warm up throughout the afternoon.
 * Do laundry early in the morning or late at night.
 * Eat a "cold" non-cooked meal (sandwiches, fruit, etc.) or cook outside for lunch. This saves the electricity needed for cooking and/or the electricity needed by the air conditioner to cool the heated air.

Transportation energy usage
Moving from one place to another takes energy. This book offers some advice on how to reduce the energy and cost associated with transportation in general, and driving in specific. The first priority is to reduce driving where possible. When driving is necessary, you should try to drive lighter, more conservatively, and in a fuel-efficient vehicle. If you must have a personal automobile, consider getting an electric model.

Drive less

 * Walk, bike, carpool, or use public transportation whenever possible.
 * If practical for your job, ask your employer to let you telecommute on occasion to save trips to the office. Or, if your work hours are flexible, consider working four 10-hour days a week instead of five eight-hour days, to save a commute each week.
 * Choose a home near your workplace if possible.
 * Spend some time planning your errands to reduce the number of trips needed.
 * Choose routes that have fewer stops and less congestion. A slightly longer freeway route is usually more efficient than a street route. If possible, avoid driving during rush hour so you aren't wasting fuel in slow-moving traffic.

Drive light

 * When purchasing a vehicle, choose a smaller, lighter vehicle. You may be able to purchase a small vehicle and borrow or rent a truck or other large vehicle when needed. However, take care to compare safety statistics of light vehicles. The smallest vehicles, especially motorcycles, carry higher risks of injury or death in crashes.
 * Don't leave unnecessary items in your vehicle. The clutter may only amount to a few pounds, but hauling it around adds up over time. Consider also that there are around 200 million vehicles in the United States alone; if each of those carried just one pound of excess cargo, it would amount to 100,000 tons.
 * Open windows create significant drag when driving at highway speeds. During warm weather, keep your windows up and use the air conditioner (if needed) when traveling at 45 MPH or above. When driving at lower speeds, turn the AC off. However, do not continually turn the AC on and off. It functions more efficiently during longer periods of operation.
 * Don't put magnetic decals, flags, antenna decorations, or the like on your vehicle. These create drag.

Drive conservatively

 * Reduce your speed. The amount of fuel needed to push air out of your vehicle's path increases rapidly with increases in speed. As a result, fuel efficiency drops rapidly. Most vehicles are most fuel efficient between 50 and 55 MPH. However, do not drive so slowly that you impede the flow of traffic, which creates dangerous situations.
 * Accelerate slowly. Getting your vehicle "up to speed" quickly is hard on your vehicle and uses more fuel than a slow start. Also, braking softly farther from your intended stopping point will make your brakes last longer.
 * Use your cruise control. Steady speeds are more efficient. Do not use cruise control in inclement weather.
 * If you are parked for more than a minute, turn your vehicle off. A non-moving vehicle gets zero miles per gallon. However, stopping and starting your vehicle too frequently causes excess wear on your engine. Diesel vehicles should not be turned off frequently as the ignition process uses significant fuel.
 * Do not push the gas pedal when approaching a red light (if it will not change to green by the time you get to it). Rushing to a red light will not get you to your destination any faster.

Keep your vehicle running efficiently

 * Keep your tires inflated to the recommended tire pressure.
 * Change spark plugs when recommended by your owner's manual.
 * Check your air filter regularly; more frequently if you drive in dusty conditions. To check it, hold it up to the light: if you cannot see light through the filter, replace it.
 * Use regular-grade gasoline unless premium or mid-grade gasoline is specifically recommended by your owner's manual.


text: Template:Radiation Oncology/SCLC/TOC

title: Template:Radiation Oncology/SCLC/TOC


text:
Radiation Oncology/SCLC/Overview

Presentation
About 30% have limited stage disease.

Symptoms

 * Clinical presentation: Cough and dyspnea
 * Paraneoplastic syndromes:
 * Lambert-Eaton: progressive muscular weakness similar to myasthenia gravis, but starting with proximal leg muscles, caused by autoantibody to voltage-gated calcium channels)
 * Paraneoplastic encephalomyelitis: multiple neurologic deficits, caused by anti-Hu antibody that cross-reacts with SCLC antigens and neuronal RNA-binding proteins
 * Cushing's syndrome: central obesity (including moon face and buffalo hump), thin skin, hirsutism, striated skin, caused by inappropriate ACTH release
 * SIADH: hyponatremia and fluid overload, caused by inappropriate ADH release

Workup

 * CBC, LFT’s, LDH, electrolytes, Ca++, BUN/Cr
 * bronchoscopy/biopsy, sputum cytology. Thoracentesis rec'd if effusion present.
 * CT chest/liver/adrenal, CT/MRI brain
 * Bone scan or PET (not currently reimbursed by CMS for SCLC).
 * Mediastinoscopy or surgical LN evaluation if T1-T2 N0.
 * Bone marrow involved in 15-30% of patients, but solitary site in only 2-5% of cases, therefore, biopsy not usually obtained

Pathology

 * Malignant epithelial tumor, small cells, scant cytoplasm, high mitotic count
 * In up to 30% of autopsies, areas of NSCLC differentiation, suggesting pluripotent stem cell origin
 * Immunoreactive for keratin, epithelial membrane antigen, TTF-1 and neuroendocrine markers (chromogranin A, NSE, NCAM, synaptophysin) though these alone not sufficient since they are present in ~10% of NSCLC

Staging

 * There are 3 staging systems that are frequently used:
 * AJCC is the official staging in US, which is the same as for NSCLC, but is not routinely used
 * VA Lung Study Group defined "limited disease" and "extensive disease" in 1957 in its inoperable lung trials. Limited stage patients could be treated in a reasonable RT portal. However, patients with ipsilateral pleural effusion and contralateral SCV nodes were not well defined. Some investigators treated these as limited stage, others as extensive stage, and they were typically not accrued onto limited stage trials
 * International Association of Lung Cancer clarified the VA staging in 1989 to include all non-metastatic patients in the limited stage category

AJCC

 * See: Radiation Oncology/Lung/NSCLC/Staging

VA Lung Study Group

 * 1973 PMID 4580860 -- "Keynote address on biostatistics and data retrieval." (Zelen M, Cancer Chemother Rep 3. 1973 Mar;4(2):31-42.)
 * Limited Disease:
 * a) Disease confined to one hemithorax, although local extensions may be present;
 * b) No extrathoracic metastases except for possible ipsilateral supraclavicular nodes if they can be included in the same portal as the primary tumor;
 * (c) Primary tumor and regional nodes which can be adequately treated and totally encompassed in every portal.
 * Extensive Disease:
 * Inoperable patients who cannot be classified as having limited disease.
 * Controversial (not well defined):
 * Ipsilateral pleural effusion
 * Contralateral supraclavicular nodes

International Association of Lung Cancer

 * IASLC; 2007 PMID 18090577 -- "The International Association for the Study of Lung Cancer lung cancer staging project: proposals regarding the clinical staging of small cell lung cancer in the forthcoming (seventh) edition of the tumor, node, metastasis classification for lung cancer." (Shepherd FA, J Thorac Oncol. 2007 Dec;2(12):1067-77.)
 * Retrospective. Survival analysis using IASLC and SEER databases
 * Conclusion: TNM staging is recommended for SCLC

 * IASLC; 1989  -- "Staging and prognostic factors in small cell lung cancer; a consensus report." (Stahel RA, Lung Cancer 1989;5:119-26.)
 * Limited Disease: "The classification of limited disease SCLC should include patients with the disease restricted to one hemithorax with regional lymph node metastases, including hiliar ipsilateral and contralateral mediastinal, and ipsilateral and contralateral mediastinal, and ipsilateral and contralateral supraclavicular nodes and should also include patients with ipsilateral pleural effusion independent whether the cytology is positive or negative."
 * Extensive Disease: "The classification of extensive disease SCLC should comprise all patients with sites of disease beyond the definition of limited disease. Thus extensive disease as proposed here is equivalent to stage IV, whereas limited disease is equivalent to stage I-III of the revised TNM system."

Staging Comparison

 * Mainz; 2002 (Germany) PMID 12234695 -- "Staging small cell lung cancer: Veterans Administration Lung Study Group versus International Association for the Study of Lung Cancer--what limits limited disease?" (Micke P, Lung Cancer. 2002 Sep;37(3):271-6.)
 * Retrospective. 109 consecutive SCLC patients classified in the 2 staging systems. 21% controversial
 * Conclusion: IASLC staging criteria higher prognostic impact than VALG

Survival

 * No treatment - Median survival - 2-4 months
 * Limited stage - Median survival - 16-24 months. 5-yr survival - 20%.
 * Extensive stage - Median survival - 6-12 months. Few long term survivors.

 * NCI; 2002 (1972-1992) PMID 12237922 -- "Twenty-five years of clinical research for patients with limited-stage small cell lung carcinoma in North America." (Janne PA, Cancer. 2002 Oct 1;95(7):1528-38.)
 * Review of 6564 patients on 30 Phase III trials in North America and SEER database outcomes
 * Outcome: Median OS treated 1972-1981 12 months vs. treated 1982-1992 17 months (SS); however only 5/26 RCT showed a significant improvement in OS. SEER database shows improved 5-year OS 5% to 12% (SS)
 * Conclusion: Significant improvement in OS over time

Extrapulmonary small cell carcinoma (EPSCC)

 * E Galanis et al. Extrapulmonary small cell carcinoma. Cancer. 1997 May 1;79(9):1729-36. ( 9128989)
 * Leora Brazg Ferro et al. Extrapulmonary Small Cell Cancer: A New Insight into a Rare Disease. Oncology. 2021;99(6):373-379. ( 33774637)

title: Radiation Oncology/SCLC/Overview


text:
Old English/Pronouns

Pronouns are used to substitute for nouns in most speech. They are words like "I", "you", "he", "they", "anybody", "who", and many more. They are not a requirement of a sentence, and it is possible for them never to be used in sentences. However, they are useful because they help avoid repeating the same noun over and over again; and they make it easier for a sentence to be understood. For an example without using any pronouns, see this sentence:

 * Alistair is doing what Alistair thinks is best for Alistair's rights as a human being.

Because it repeats "Alistair" so much it seems strange and tedious. A more usual way to say the above, using pronouns, would be:

 * Alistair is doing what he thinks is best for his rights as a human being.

There are different types of pronouns:
 * Personal pronouns - usually refer to specific persons or objects
 * Interrogative pronouns - used to ask questions of identity like Modern English "who", "what", and "which one"
 * Relative pronouns - used after another substansive to add additional information, like Modern English "whom" in "John is the person whom I like"
 * Demonstrative pronouns - words used often when pointing to something, with with a sense of location, as in Modern English "this" or "that"
 * Indefinite pronouns - used to talk about nobody in particular, or about everyone in general, like Modern English "anybody" and "everybody". Also includes negative pronouns - pronouns used to talk about "nobody" or "nothing".

Like nouns and adjectives, pronouns are declined according to case, gender (only sometimes), and number.

Personal pronouns
The simple personal pronouns are declined like this:

First person
First person pronouns are pronouns that refer to the speaker (in singular), or the speaker and other people (in dual and plural), like Modern English "I" and "we".

Notice that there is a dual number; it means "both" or "two" as in "we both" or "we two". The separate dual number is exceptional and rare. If used with an adjective or a verb, it should take the same declensions and conjugations as plural. Since there is a dual number for each set of pronouns, the plural form should only be used for three or more.

In Anglian dialects, in the accusative, "mec" was used instead of "mē"; "uncit" was used instead of "unc"; and "ūsiċ" was used instead of "ūs". Also in Anglian dialects, "ūser" was sometimes used instead of "ūre".

Second person
Second person pronouns are for the person who is being spoken to, like Modern English "you" (and “thou” and “ye” in dialects).

In Anglian dialects, "þec", "inċit" and "ēoƿiċ" were used in the accusative instead of "þē", "inc", and "ēoƿ" respectively.

Third person
Third person pronouns refer to another person not involved in a conversation, like Modern English "he", "she", "it", and "they".

In Anglian dialects, "hēo" was used for feminine and plural nominative and accusative. In earlier Old English, both in West Saxon and Anglian dialects, "hīo" was used instead of "hēo".

Interrogative pronouns
Interrogative pronouns are pronouns used to ask questions of identity, such as Modern English "who" and "what" as in "Who are you?" and "What is that animal?" The following are Old English interrogative pronouns:

Note that "hƿæt" was used when a person had been identified, and that was the person who was being enquired about. "Hƿā" was used when no person had been identified. Consider, "Hƿæt is hē?" - "Who is he?", where "hē" shows that we are aware of which person the question applies to. But "Hƿā ǣt mīnne hlāf?" - "Who ate my bread?", where no one is indicated.

The instrumental form of "hƿæt" (hƿȳ) is used to mean "why". Also used for "why" is for hƿȳ.

In Old English, they had a word meaning "which of two" as might be used in "Which of the two children went with you?", declined the same as the strong adjective declension.

Like hƿæðer is āhƿæðer "some one, something; any one; anything", ǣġhƿæðer "of two" "either, both, each"; "of many" "every one, each", nāhƿæðer "neither", sƿæðer "whichever of two, whosoever of two".

The following word is also used as an interrogative adjective, like Modern English "which" as in "Which fruit did you eat?" Used standalone as a pronoun, though, it means "which one". Because it is an adjective, it also simply takes the strong adjectival declension.

Like hƿilċ is sƿilċ "such", ġehƿilċ "each/every one", ǣġhƿilċ "each one, every one", nāthƿilċ "someone I know not", samhƿilċ "some".

Relative pronouns
Relative pronouns are pronouns that are used to refer to an earlier substansive, called an antecedent, and give additional information, as the "who" in the following examples:

 * "It was John who did that" - Hit ƿæs Iohannes se þe dyde þæt
 * "I like men who know what they're doing" - Mē līciaþ menn þā þe ƿiton þæt hīe dōþ

And the "that" in the following examples:

 * "The thing that I hate most about it, is the stupidity of it all" - Þæt þing þæt iċ þæs mǣst hatġe, is his dƿola
 * "All the trees that I cut down had green leaves" - Eall þā treoƿ þā iċ fylede hæfdon grēnu lēaf

And the "which" in the following examples:

 * "The squirrel, which was red, ran away" - Þæt ācƿeorna þæt þe rēad ƿæs, earn aƿeġ
 * "The house which I live in is old" - Þæt hūs in þǣm þe iċ ƿuniġe is eald

In Old English, the relative pronoun was the same as the definitive article, but it could be followed in addition by þe. You could also use just þe by itself.

Note that because se by itself could also mean "that (one", alongside this relative pronoun meaning; and þe alone could be a relative pronoun, se þe could actually be just a relative pronoun, or a relative pronoun and an indicative pronoun combined, e.g. "that which" or "he who".

A kind of word which in Modern English could be confused with a relative pronoun, is an indirect interrogative. The bold words in the following examples are indirect interrogatives:

 * "I asked him what he was doing"
 * "Do you know who they are?"

As in Modern English, the indirect interrogative pronouns in Old English were the same as the normal interrogative pronouns, for which see the "Interrogative pronouns" section of this page.

Demonstrative pronouns
Demonstrative pronouns are the kind of pronoun you might use while pointing at something, often having also a sense of location, as in Modern English "this" and "that", where "this" has a meaning like "the one here" and that has a meaning like "the one there".

The plural of þes (þās) has the meaning of "these".

It is obvious to see that the Modern English word "that" came from the neuter form of this word - þæt. This word was also the definitive article (like Modern English "the") in Old English, so if it was used to modify a noun, it might either mean "the" or "that", depending on context.

Indefinite pronouns
Indefinite pronouns are pronouns which don't refer to anything specific. They can have the sense of "any" or "every". They also include negative pronouns - pronouns that mean "nothing" or "nobody".

 * Ġehƿā - "anybody" or "everybody"; declined just like the interrogative pronoun hƿā.
 * Ġehƿilċ - "anything/anyone" or "everything/everyone"; declined just like the interrogative pronoun hƿilċ.
 * Ġehƿæt - "anything" or "everything"; declined just the interrogate pronoun hƿæt.

Negative pronouns
Negative indefinite pronouns, or simply negative pronouns, are pronouns which refer to a lack of someone or something, like "nothing" in Modern English.

Note that nā(ƿi)ht is actually a compound of nā - "not" and ƿiht - "something". The declension is simply the strong singular neuter noun declension.

"Nobody" is in Old English nān mann, which is actually just the negative article (which is declined like a strong adjective) and the noun mann - "human", "person", for whose declension see here.

title: Old English/Pronouns


text:
User:Ideasman42

Hi, I have just started editing some of the blender3d/python wiki content for Blender n00b to pro. I have written many mesh editing tools and intend to write a tutorial on this subject. Checkout my website [Campbells Script Log]

title: User:Ideasman42


text:
Talk:Introduction to Sociology/Deviance

To do
Some suggestions by a friend who specializes in criminology:

 * 1) In your section on strain, perhaps include a short discussion of Robert Agnew's General Strain Theory. Merton is "classic," of course, but Agnew is what people use these days.  I'd also suggest, to help people comprehend Merton (which I think is a good summation), Rosenfeld and Messner's "Crime and The American Dream."  In short, they argue crime occurs because the goals are more important than the means (so a person who has acheived a great deal is worth more, socially, than someone who has acheived less, even if person 1 had committed crimes to get that far).  I think their argument helps people get the idea of a collectivity regarding materialism, and how that tends to eliminate the impulse to behave pro-socially at times.
 * 2) Have you considered including your section on structual functionalism with labeling theory? They seem to blend together quite well, in my opinion; especially when you use examples of the Columbine shootings in your section.
 * 3) In your discussion of white-collar crime, perhaps Charles Tittle's Control-Balane Theory would help? It asserts that people have general (overall) and specific (contextual) control ratios (the amount of control you have over others, compared to the amount of control others have over you).  So, a CEO has a significant surplus of control at work, but perhaps not at home, and perhaps not at PTA meetings.  It also makes a unique argument: for those who have the greatest control deficits (which could perhaps imply the infirm, or the poor), there is less crime committed due to a lack of autonomy.
 * 4) I think your labeling section would be boosted by a discussion of Charles Lemert's definitions of primary and secondary deviance. Secondary deviance is what happens when people accept the label they are given as their "master status," and act accordingly.  I think the Columbine example would work exceptionally well here.  Primary deviance, on the other hand, is, in the words of labeling theorists, "all that other shit."  To their chagrin, they never bother to explain primary deviance (those actions, criminal, delinquent, or merely not normative, that get the attention of others sufficient to begin using a label), but, as you point out in your section on structural functionalism, there are behaviors that, by virtue of their existence, help unify others socially; it is possibly those acts of primary deviance that help do so (think Megan's Law, or that fucking sex offender relocation act downtown).
 * 5) Other theories/theorists you should consider:
 * Hirschi and Gottfredson's "A General Theory of Crime" (the $100,000 theory, as it's cited so damned much; it would fit in a section on social control)
 * Terrie E Moffit - "Pathways in the Life Course to Crime" (this focuses on developmental theories, and starts with childhood control problems and antisocial tendencies, so it's pretty encompassing)
 * Social Disorganization Theory (William Julius Wilson, Robert Sampson, Clifford Shaw and Henry McKay) - Pretty much all "chicago school" stuff, but focuses on unstable areas in communities (housing, employment, and residential instabilities) that lead to crime through a collective breakdown of norms.
 * Differential Association/Social Learning Theory (Sutherland and Cressey, Sykes and Matza) - Focuses on the small group processes in which crime is learned through "definitions" favorable to crime/deviance over definitions unfavorable to prosocial behavior. (perhaps Becker's piece on learning to get high would work well here, and articles on Marijuana, regrettably, always resonate well with undergrads - and probably grads too).
 * Biosocial Theory (Lombroso's long-discredited work on the biological criminal archetype, for instance). Phrenology is also pretty fun, and if you can find a phrenological map (I think I have one saved) is interesting for discussion, since it was developed prior to Lombroso's calls for positivism (the same positivism that discredited his theory), and thus comes from the time when we just made shit up.

Thomasfbrown (talk) 22:04, 3 November 2008 (UTC)
 * Add section on the four rationales for punishing offenders.
 * Add section on Durkheim's contribution re anomie.
 * Add section on the relativity of deviance.
 * Compare psychological and biological perspectives on deviance with the sociological perspective.

I think this section is mislabeled or should be changed. There's no (or very little ) discussion of "norms." some discussion might help since really the two terms -- deviance and norms -- are defined in tandem and different theories, e.g. structural functionalism, take different positions on the relationship of the two. [User: rlkap 12/28/2010]

Gender theory
Under the header gender, this nice little textbook (my compliments to those who contributed to it) says: "While the focus of this chapter is not on exploring the motivations behind rape, the number of rapes in the U.S. and internationally can be seen to reflect power imbalances (social-conflict approach) between men and women." It suggests that a higher rate of rape might be correlated with power imbalances in a country. Maybe I am missing something, but I find it hard to believe that there is more power imbalance between men and women in the United States than in Saudi-Arabia and Oman (see the chart), those are hard-line Islamist countries in which women have few, if any, rights. But I'm not a sociologist. It would be good if someone who actually knew something about this subject, elaborated on this issue in the book. --Democrat 23:46, 11 June 2006 (UTC)

title: Talk:Introduction to Sociology/Deviance


text:
Talk:X86 Disassembly/Assemblers and Compilers

What i think this page needs is just a discussion of assemblers which are functionally dissimilar enough to warrent individual discussion. Many compilers are just clones of MASM or FASM or GAS, and therefore are not going to be discussed. We can, however, include links to all sorts of assemblers in the "Further Reading" section --Whiteknight 14:30, 13 September 2005 (UTC)

Update list of "common" compiler to include Clang?
It seems that Clang/LLVM is quite popular during the last few years. I think I've seen Clang on the Internet more times than Intel's compiler in 2015, at least in the Linux world. (Examples: MinetestClangBSD mpv) However, Clang may be only popular in my particular circle, so instead of editing the book, I'd like to know what people think first: do you think Clang is popular enough to be added to the list? --sheep0x (discuss • contribs) 05:49, 14 November 2015 (UTC)


text:
Talk:Reverse Engineering/Java Compiler

We can bump this page up to 50% if we can list other java implementations. frankly, there isnt alot to talk about in this chapter given the depth we (will) go into in section 6 --Whiteknight 03:58, 20 September 2005 (UTC)

At least two dead links on this page - the MS java SDK and the GNU Java compiler

title: Talk:Reverse Engineering/Java Compiler


text:
Talk:Reverse Engineering/C Sharp Compiler

This page can be 50% completed if we list some other .NET implementations, and perhaps mention a few things about other .NET languages, and their compilers. --Whiteknight 04:00, 20 September 2005 (UTC)


text:
Talk:X86 Disassembly/Linux

I listed a few of the Shells and GUIs that i know of, although i dont know enough about any of them to make any kind of authoritative teacher. Shells or GUIs that require alot of discussion to relate the general architecture (at least the stuff a reverser should probably know about) should probably be given their own heading (or subheading). Whiteknight

X-Windows
What happened to X-Windows? It's the basis for GNOME and KDE (that is, they both run on top of it). I'm not an expert, but it's quite important and deserves a mention.

 * Probably does. I'm not a Linux expert either, so i'm not really qualified to add the material. --Whiteknight (talk) (projects) 01:18, 26 July 2006 (UTC)

Tools
I've added 2 debuggers and 2 file analyzers, but I'm curious about something. Would it be acceptable to post a link to some swf files demonstrating a real world use of the tools themselves? For example, http://papsy.net/gdb or http://papsy.net/strings and maybe a little explanation to go with them?

 * That most certainly would be acceptable. So far this book doesn't have any detailed instructions on how to use debuggers (or how to use them well), and we would benefit from that. --Whiteknight (talk) (projects) 11:49, 14 August 2006 (UTC)

title: Talk:X86 Disassembly/Linux


text:
Talk:Art Tutorials

Someone has stated that we should merge this book with Art. However, I think they should remain two separate books. Multiple people on the discussion page think so too. Many stated that that books is more like an Art 101. In my Art 101 type class, we talked very little about media and techniques, which is the primary focus of this books. This book is pretty new and underdeveloped, but so far, the only overlap I see is the "art concepts" bit, which is usually covered in an Art 101 type course.

Any thoughts? --Blainegarrett 15:31, 13 September 2005 (UTC)

Orphaned Module
I'm working on cleaning up orphaned modules and found this page which apparently belongs to this book, but I'm not sure where to link it in the TOC. Someone familiar with the project should place this module in the appropriate place in the Table of Contents. Xerol Oplan 03:48, 23 March 2006 (UTC)

title: Talk:Art Tutorials


text:
Active Server Pages/Expressions

= Objectives =

In this section, you will learn how to build expressions in Active Server Pages. After studying this section, you will learn how to build an expression and learn how to combine variables and string literals in combination to manipulate data.

= Content =

An expression is a group of literal and variables which are organized in a structured format using operators. The best example of an expression is a mathematical expression such as x + 3.

Expressions are made up of a collection of mathematical, comparison, bit-wise and logical operators as well as literal values and ASP variables which are placed together for evaluation by the ASP Interpreter. Once an expression is evaluated, it can be assigned to a variable, used as the argument to an ASP procedure or output on an ASP page.

Assignment
One of the most basic statements you can make in ASP is an assignment. This basically evaluates an expression and places the result into a variable. The equals sign (=) separates the variable that gets the result (on the left side) and the expression to build the result (on the right side).

Don't worry too much about some of the more complicated expressions found in this example. All of this will be explained later in this chapter. You should note that the left side of the expression is always a variable. You are only allowed to put a single ASP variable on the left side of the equals sign.

Evaluation Order
The way an expression is evaluated, depends on the operator precedence. Precedence is kind of an importance assigned to an operator. Operators that have the highest precedence are evaluated first and those that have the lowest are evaluated last. When two operators exist that have the same precedence, the operators are evaluated from left-to-right.

Take for example the following expression:

In this example, you will see we have three different operators. The "+" and the "-" operator have the same precedence while the multiplication operator (*) has a higher precedence. In this case, the multiplication takes place first reducing the expression to:

Now there are two expressions that have the same precedence. In this case, we evaluate the left-most expression first. After two more reductions we get the final result:

You should note also that if we had evaluated the expression from the other direction we would get a completely different result. This order of evaluation follows the same method used in mathematics (if you remember your basic algebra.)

Grouping Sub-Expressions
If you want to over-ride the default order-of-evaluation (precedence) for evaluating an expression, you can group expressions that should be evaluated first in parentheses. You can think of it as an expression embedded in another expression or a "sub-expression".

If you remember the example from the previous section, we can modify it to change the order-of-evaluation like so:

And just like in Algebra, we know that we have to evaluate these sub-expressions first. So the first step in reducing this type of expression is to evaluate the sub-expression:

The final reduction will yield a result of 14 which is a completely different result than we got before. Be careful about how you group your expressions. It can cause a lot of problems and increase the complexity of your code. If you want to keep your code simpler, you can always create new variables to store the results of sub-expressions.

Mathematical Expressions
The following table lists all of the binary mathematical operators. They are "binary" because they require two arguments. The first argument is on the left-side and the second argument is on the right-side. So the operator "+" in the expression "5 + 6" has the binary arguments "5" and "6".

The following table lists all of the unary mathematical operators. A unary operator only has a single argument to act on.

Of course you can combine binary and unary operators in one expression. The results of one binary operation might serve as the argument to your unary operation.

There are many advanced mathematical functions that can be used to do complex arithmetic which we will talk about later. These will not be covered in this chapter.

String Operators
When working with strings, Active Server Pages provides a wealth of functions for manipulating strings. But since we are only talking about operators that may be used in an expression, we will only be dealing with the one string operator here: the string concatenation operator.

String concatenation means that you want to append one string to another. This operation is a binary operation meaning that it takes two arguments: the left-side is the string you want to append to and the right-side is the string that you want to append.

As you can see in the example above, we are using the string concatenation operator to append three string values together: "Bill", " ", and "Gates". Two of the strings are stored in variables while the space character is just a string literal.

You may concatenate as many variables as you want together using the string concatenation operator. It has been shown that string concatenation under Active Server Pages is very inefficient. So if your page is performing slowly and you have a lot of string concatenations, you should look for ways to eliminate them.

Comparison Operators
Comparison operators, as you might have guessed, are used to compare two different expressions and return a value of "true" or "false". In most cases the two expressions being comparted will evaluate to a number, but it is possible to compare string values, dates and booleans.

The following table lists the binary comparison operators. These operators require two expression arguments: one on the left-side of the operator and one on the right-side. Just like mathematical expressions, you may combine two-or-more of these expressions together. In the next section we will explain how to these are combined using logical operators.

These operators are most commonly used in an If Then statement which will take an action based on the boolean result of an expression. Unless you already have a boolean value stored in an ASP variable, you will need to write an expression like the following:

Of course, your expression can be as complicated as you want as long as it evaluates to a boolean value.

Logical Operators
Whereas mathematical expressions are used to manipulate numbers, logical operators are used to work with the two boolean values "true" and "false". These operators are always used to combine two expressions that result in boolean values.

In addition to these binary operators, there is also one unary operator:

The negation operator basically will give you the opposite value of the expression. So if the expression evaluates to "true" and you perform the Not operation on it, it becomes "false". Conversely, "false" will become "true" when Not is applied.

So using these logical operators, we can group many comparison expressions together to create a very complex expression like so:

The first comparison (nX = 2) looks just like an assignment. You can never put an assignment in an expression like this. Assignment only occurs at the start of an expression, where the first symbol is an ASP variable which is followed by the assignement (=) operator.

You will notice that we used parentheses to group the expressions. Even in some cases where parentheses are not required, it sometimes makes your expressions easier to read when you put them in there.

Bit-Wise Operators
For advanced programming, Active Server Pages has operators for working with individual "bits". A "bit" is the digit used in the binary number system and was formed from a contraction of the words "binary digit". It can only have one of two different values: "0" and "1".

In the old days of computer, programmers were severely limited in storage and had to make the most of the available storage. One way they did this was by combining multiple variables into a single "byte". This has carried through to modern-day computer systems and this is why we need bit-wise operators.

In computer terms, we talk about "bytes". A byte is composed of 8 "bits" and therefore can have 2 ^ (raised-to-the-power) 8 or 256 possible values. An integer is composed of two bytes so it can have a value of 256 ^ 2 or 65536 possible values.

The 8 bits from a byte and their integer equivalents

+---+ | Bit7 | Bit6 | Bit5 | Bit4 | Bit3 | Bit2 | Bit1 | Bit0 | +--+--+--+--+--+--+--+--+ | 128 |   64 |   32 |   16 |    8 |    4 |    2 |    1 | +---+

For all of the bits that are set (equal to 1) above, you need to add their integer equivalent to determine the resulting byte value. So If bits 6, 4, 1 and 0 were set, the equivalent byte value would be: 64 + 16 + 2 + 1 = 83.

Going the other way around, we can convert an integer to binary. We just take the integer value and subtract the biggest binary value we can and note the corresponding bit. We continue to do this subtracting binary values until we come up with the resulting bit string:

When working with the bit-wise operators, we sometimes have to convert between binary and integer like this and vice-versa.

In Active Server Pages, bit-wise operators are only used on numeric expressions to manipulate individual bits. The numberic expression can evaluate to integers, longs, single or double-precision numbers. After evaluating the bit-wise operation, the resulting value will be compatible with the original arguments.

The following bit-wise operators require two arguments: one on the left-side of the operator and one on the right-side.

The following operators are "unary" operators meaning they only require one argument. The single expression argument must be to the right-side of this operator.

Truth Tables
Truth tables display the results of the binary operators on a bit-by-bit basis. You can think of each bit in the arguments being evaluated one-by-one. Bits are matched up based on their position in the bytes. So for a 16-bit integer, each bit would be operated on individually and the resulting bits would be strung together in the same order to generate the resulting number.

When viewing these tables, think to yourself "When performing a bit-wise and (&), bit 0 from argument 1 and bit 0 from argument 2 are anded together and the result is X. Next bit 1 from argument 1 and bit 1 from argument 2 are anded together and the result is Y". And continuing on for all the bits in the arguments.

Manipulating Date and Time Values
ASP has some built-in functions to manipulate datetime values. Thought technically not operators, we mention them here for completeness since datetime is a valid data type and it is often necessary to calculate dates and times.

Information about optional arguments for these functions and valid interval types will be discussed in a later chapter. You should note that none of the mathematical operators apply to datetime values. You must use the various conversion and calculation functions above to manipulate dates.

Line Continuation Operator
If you have a really long line in ASP that you would like to split into two lines, you can use the line continuation operator. This is an underscore (_) placed at the end of the line that tells the ASP interpreter that statement or expression continues on the next line.

if ((bDaysLeft < DateDiff("d", Now, dBirthDay)) Or _  (bDaysLeft > DateDiff("d", Now, dChristMas)) Then 	Response.Write "Hooray!" End If

In the example above, we use the line continuation to continue a boolean expression. You may use it to continue any type of expression or statement. It makes sense to split up long lines for readability. Just be careful how you split lines so that you don't make the line more confusing to read.

= Summary =

There are eight different types of operators in ASP:

 * Assignment Operators
 * Mathematical Operators
 * String Operators
 * Comparison Operators
 * Logical Operators
 * Bit-wise Operators
 * Grouping Operators
 * Line Continuation Operator

All but the assignement operators can be used for building expressions. Operators are evaluated based on precedence and the grouping operators. If two operators have the same precedence, then the operators are evaluated from left-to-right.

All date and time values must be manipulated using functions. The mathematical operators are invalid on datetime values.

= Review Questions =

 * What must be on the left-side of the assignment operator?
 * What must be on the right-side of the assignment operator?
 * What are the eight major types of operators?
 * What is meant by operator precedence?
 * Which operator is used to group expressions?
 * How are datetime values used in expressions?

= Exercises =

 * Write the conditional expression to test a variable (nSpeed) is less than or equal to the speed limit (nSpeedLimit)
 * Write an expression to convert a temperature in Fahrenheit to degrees and vice-versa
 * Create a function that calculates the number of days from now until Christmas.
 * Create a page that inputs a user's birthday and then calculates how old that person is.

title: Active Server Pages/Expressions


text:
Ada Programming/Attributes/'Tag

Description
X'Tag is an Ada attribute where X is any tagged type. This attribute returns a value of the private type .Tag which identifies the tagged type.

This attribute is useful to check for membership of a type in a class hierarchy. It can also be used if it is known the type is in a class hierarchy and type-specific processing must take place.

Example
Ref : My_Tagged_Type_Reference; ... Ref. My_Tagged_Type'Class Ref.'Tag = My_Tagged_Type'Tag ; ;

Wikibook

 * Ada Programming
 * Ada Programming/Object Orientation
 * Ada Programming/Attributes/'Class

Ada Reference Manual

|Tag

title: Ada Programming/Attributes/'Tag


text:
User talk:Rakkar~enwikibooks

Kellen T 19:05, 13 September 2005 (UTC)
 * Please also check out the Cookbook policy page and the Cookbook talk pages.
 * Thanks for fixing up Cookbook:Zucchini Pasta Bake. Some further things you could do is to use the "short" version of the recipe summary as it's easier to reproduce correctly (no typos in variable names), use the template instead of  and add some categories.

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

title: User talk:Rakkar~enwikibooks


text:
User talk:213.67.40.63

Kellen T 19:05, 13 September 2005 (UTC)
 * Please also check out the Cookbook policy page and the Cookbook talk pages.
 * Instead of, you might consider using  which is cookbook-specific.

title: User talk:213.67.40.63


text:
Category:Zucchini recipes

| Vegetable Recipes using zucchinis (also known as courgettes).

title: Category:Zucchini recipes